(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("devtools/client/shared/vendor/react"), require("devtools/client/shared/vendor/lodash"), require("devtools/client/shared/vendor/react-dom"), require("Services"), require("devtools/shared/flags"), require("devtools/client/sourceeditor/editor"), require("devtools/client/shared/vendor/WasmParser"), require("devtools/client/shared/vendor/WasmDis")); else if(typeof define === 'function' && define.amd) define(["devtools/client/shared/vendor/react", "devtools/client/shared/vendor/lodash", "devtools/client/shared/vendor/react-dom", "Services", "devtools/shared/flags", "devtools/client/sourceeditor/editor", "devtools/client/shared/vendor/WasmParser", "devtools/client/shared/vendor/WasmDis"], factory); else { var a = typeof exports === 'object' ? factory(require("devtools/client/shared/vendor/react"), require("devtools/client/shared/vendor/lodash"), require("devtools/client/shared/vendor/react-dom"), require("Services"), require("devtools/shared/flags"), require("devtools/client/sourceeditor/editor"), require("devtools/client/shared/vendor/WasmParser"), require("devtools/client/shared/vendor/WasmDis")) : factory(root["devtools/client/shared/vendor/react"], root["devtools/client/shared/vendor/lodash"], root["devtools/client/shared/vendor/react-dom"], root["Services"], root["devtools/shared/flags"], root["devtools/client/sourceeditor/editor"], root["devtools/client/shared/vendor/WasmParser"], root["devtools/client/shared/vendor/WasmDis"]); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_4__, __WEBPACK_EXTERNAL_MODULE_22__, __WEBPACK_EXTERNAL_MODULE_52__, __WEBPACK_EXTERNAL_MODULE_197__, __WEBPACK_EXTERNAL_MODULE_677__, __WEBPACK_EXTERNAL_MODULE_678__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/assets/build"; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 46); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_0__; /***/ }), /* 1 */, /* 2 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_2__; /***/ }), /* 3 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(32); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__combineReducers__ = __webpack_require__(171); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__ = __webpack_require__(173); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__ = __webpack_require__(174); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__compose__ = __webpack_require__(36); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_warning__ = __webpack_require__(35); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createStore", function() { return __WEBPACK_IMPORTED_MODULE_0__createStore__["b"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return __WEBPACK_IMPORTED_MODULE_1__combineReducers__["a"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindActionCreators", function() { return __WEBPACK_IMPORTED_MODULE_2__bindActionCreators__["a"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "applyMiddleware", function() { return __WEBPACK_IMPORTED_MODULE_3__applyMiddleware__["a"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return __WEBPACK_IMPORTED_MODULE_4__compose__["a"]; }); /* * This is a dummy function to check if the function name has been altered by minification. * If the function has been minified and NODE_ENV !== 'production', warn the user. */ function isCrushed() {} if (false) { warning('You are currently using minified code outside of NODE_ENV === \'production\'. ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) ' + 'to ensure you have the correct code for your production build.'); } /***/ }), /* 4 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_4__; /***/ }), /* 5 */, /* 6 */ /***/ (function(module, exports, __webpack_require__) { var Symbol = __webpack_require__(7), getRawTag = __webpack_require__(10), objectToString = __webpack_require__(11); /** `Object#toString` result references. */ var nullTag = '[object Null]', undefinedTag = '[object Undefined]'; /** Built-in value references. */ var symToStringTag = Symbol ? Symbol.toStringTag : undefined; /** * The base implementation of `getTag` without fallbacks for buggy environments. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { if (value == null) { return value === undefined ? undefinedTag : nullTag; } return (symToStringTag && symToStringTag in Object(value)) ? getRawTag(value) : objectToString(value); } module.exports = baseGetTag; /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { var root = __webpack_require__(8); /** Built-in value references. */ var Symbol = root.Symbol; module.exports = Symbol; /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { var freeGlobal = __webpack_require__(9); /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); module.exports = root; /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; module.exports = freeGlobal; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(792))) /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { var Symbol = __webpack_require__(7); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** Built-in value references. */ var symToStringTag = Symbol ? Symbol.toStringTag : undefined; /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined; var unmasked = true; } catch (e) {} var result = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result; } module.exports = getRawTag; /***/ }), /* 11 */ /***/ (function(module, exports) { /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString.call(value); } module.exports = objectToString; /***/ }), /* 12 */, /* 13 */, /* 14 */ /***/ (function(module, exports) { /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return value != null && typeof value == 'object'; } module.exports = isObjectLike; /***/ }), /* 15 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(168); /***/ }), /* 16 */, /* 17 */, /* 18 */, /* 19 */, /* 20 */ /***/ (function(module, exports, __webpack_require__) { /** * 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. */ if (false) { var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element')) || 0xeac7; var isValidElement = function(object) { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; }; // By explicitly using `prop-types` you are opting into new development behavior. // http://fb.me/prop-types-in-prod var throwOnDirectAccess = true; module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess); } else { // By explicitly using `prop-types` you are opting into new production behavior. // http://fb.me/prop-types-in-prod module.exports = __webpack_require__(177)(); } /***/ }), /* 21 */, /* 22 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_22__; /***/ }), /* 23 */, /* 24 */, /* 25 */, /* 26 */, /* 27 */, /* 28 */, /* 29 */, /* 30 */, /* 31 */, /* 32 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ActionTypes; }); /* harmony export (immutable) */ __webpack_exports__["b"] = createStore; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(33); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable__ = __webpack_require__(15); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_symbol_observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_symbol_observable__); /** * These are private action types reserved by Redux. * For any unknown actions, you must return the current state. * If the current state is undefined, you must return the initial state. * Do not reference these action types directly in your code. */ var ActionTypes = { INIT: '@@redux/INIT' /** * Creates a Redux store that holds the state tree. * The only way to change the data in the store is to call `dispatch()` on it. * * There should only be a single store in your app. To specify how different * parts of the state tree respond to actions, you may combine several reducers * into a single reducer function by using `combineReducers`. * * @param {Function} reducer A function that returns the next state tree, given * the current state tree and the action to handle. * * @param {any} [preloadedState] The initial state. You may optionally specify it * to hydrate the state from the server in universal apps, or to restore a * previously serialized user session. * If you use `combineReducers` to produce the root reducer function, this must be * an object with the same shape as `combineReducers` keys. * * @param {Function} [enhancer] The store enhancer. You may optionally specify it * to enhance the store with third-party capabilities such as middleware, * time travel, persistence, etc. The only store enhancer that ships with Redux * is `applyMiddleware()`. * * @returns {Store} A Redux store that lets you read the state, dispatch actions * and subscribe to changes. */ };function createStore(reducer, preloadedState, enhancer) { var _ref2; if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') { enhancer = preloadedState; preloadedState = undefined; } if (typeof enhancer !== 'undefined') { if (typeof enhancer !== 'function') { throw new Error('Expected the enhancer to be a function.'); } return enhancer(createStore)(reducer, preloadedState); } if (typeof reducer !== 'function') { throw new Error('Expected the reducer to be a function.'); } var currentReducer = reducer; var currentState = preloadedState; var currentListeners = []; var nextListeners = currentListeners; var isDispatching = false; function ensureCanMutateNextListeners() { if (nextListeners === currentListeners) { nextListeners = currentListeners.slice(); } } /** * Reads the state tree managed by the store. * * @returns {any} The current state tree of your application. */ function getState() { return currentState; } /** * Adds a change listener. It will be called any time an action is dispatched, * and some part of the state tree may potentially have changed. You may then * call `getState()` to read the current state tree inside the callback. * * You may call `dispatch()` from a change listener, with the following * caveats: * * 1. The subscriptions are snapshotted just before every `dispatch()` call. * If you subscribe or unsubscribe while the listeners are being invoked, this * will not have any effect on the `dispatch()` that is currently in progress. * However, the next `dispatch()` call, whether nested or not, will use a more * recent snapshot of the subscription list. * * 2. The listener should not expect to see all state changes, as the state * might have been updated multiple times during a nested `dispatch()` before * the listener is called. It is, however, guaranteed that all subscribers * registered before the `dispatch()` started will be called with the latest * state by the time it exits. * * @param {Function} listener A callback to be invoked on every dispatch. * @returns {Function} A function to remove this change listener. */ function subscribe(listener) { if (typeof listener !== 'function') { throw new Error('Expected listener to be a function.'); } var isSubscribed = true; ensureCanMutateNextListeners(); nextListeners.push(listener); return function unsubscribe() { if (!isSubscribed) { return; } isSubscribed = false; ensureCanMutateNextListeners(); var index = nextListeners.indexOf(listener); nextListeners.splice(index, 1); }; } /** * Dispatches an action. It is the only way to trigger a state change. * * The `reducer` function, used to create the store, will be called with the * current state tree and the given `action`. Its return value will * be considered the **next** state of the tree, and the change listeners * will be notified. * * The base implementation only supports plain object actions. If you want to * dispatch a Promise, an Observable, a thunk, or something else, you need to * wrap your store creating function into the corresponding middleware. For * example, see the documentation for the `redux-thunk` package. Even the * middleware will eventually dispatch plain object actions using this method. * * @param {Object} action A plain object representing “what changed”. It is * a good idea to keep actions serializable so you can record and replay user * sessions, or use the time travelling `redux-devtools`. An action must have * a `type` property which may not be `undefined`. It is a good idea to use * string constants for action types. * * @returns {Object} For convenience, the same action object you dispatched. * * Note that, if you use a custom middleware, it may wrap `dispatch()` to * return something else (for example, a Promise you can await). */ function dispatch(action) { if (!Object(__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__["a" /* default */])(action)) { throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.'); } if (typeof action.type === 'undefined') { throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?'); } if (isDispatching) { throw new Error('Reducers may not dispatch actions.'); } try { isDispatching = true; currentState = currentReducer(currentState, action); } finally { isDispatching = false; } var listeners = currentListeners = nextListeners; for (var i = 0; i < listeners.length; i++) { var listener = listeners[i]; listener(); } return action; } /** * Replaces the reducer currently used by the store to calculate the state. * * You might need this if your app implements code splitting and you want to * load some of the reducers dynamically. You might also need this if you * implement a hot reloading mechanism for Redux. * * @param {Function} nextReducer The reducer for the store to use instead. * @returns {void} */ function replaceReducer(nextReducer) { if (typeof nextReducer !== 'function') { throw new Error('Expected the nextReducer to be a function.'); } currentReducer = nextReducer; dispatch({ type: ActionTypes.INIT }); } /** * Interoperability point for observable/reactive libraries. * @returns {observable} A minimal observable of state changes. * For more information, see the observable proposal: * https://github.com/tc39/proposal-observable */ function observable() { var _ref; var outerSubscribe = subscribe; return _ref = { /** * The minimal observable subscription method. * @param {Object} observer Any object that can be used as an observer. * The observer object should have a `next` method. * @returns {subscription} An object with an `unsubscribe` method that can * be used to unsubscribe the observable from the store, and prevent further * emission of values from the observable. */ subscribe: function subscribe(observer) { if (typeof observer !== 'object') { throw new TypeError('Expected the observer to be an object.'); } function observeState() { if (observer.next) { observer.next(getState()); } } observeState(); var unsubscribe = outerSubscribe(observeState); return { unsubscribe: unsubscribe }; } }, _ref[__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default.a] = function () { return this; }, _ref; } // When a store is created, an "INIT" action is dispatched so that every // reducer returns their initial state. This effectively populates // the initial state tree. dispatch({ type: ActionTypes.INIT }); return _ref2 = { dispatch: dispatch, subscribe: subscribe, getState: getState, replaceReducer: replaceReducer }, _ref2[__WEBPACK_IMPORTED_MODULE_1_symbol_observable___default.a] = observable, _ref2; } /***/ }), /* 33 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__ = __webpack_require__(123); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getPrototype_js__ = __webpack_require__(129); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__ = __webpack_require__(139); /** `Object#toString` result references. */ var objectTag = '[object Object]'; /** Used for built-in method references. */ var funcProto = Function.prototype, objectProto = Object.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString.call(Object); /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ * @since 0.8.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { * this.a = 1; * } * * _.isPlainObject(new Foo); * // => false * * _.isPlainObject([1, 2, 3]); * // => false * * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true * * _.isPlainObject(Object.create(null)); * // => true */ function isPlainObject(value) { if (!Object(__WEBPACK_IMPORTED_MODULE_2__isObjectLike_js__["a" /* default */])(value) || Object(__WEBPACK_IMPORTED_MODULE_0__baseGetTag_js__["a" /* default */])(value) != objectTag) { return false; } var proto = Object(__WEBPACK_IMPORTED_MODULE_1__getPrototype_js__["a" /* default */])(value); if (proto === null) { return true; } var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } /* harmony default export */ __webpack_exports__["a"] = (isPlainObject); /***/ }), /* 34 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__root_js__ = __webpack_require__(124); /** Built-in value references. */ var Symbol = __WEBPACK_IMPORTED_MODULE_0__root_js__["a" /* default */].Symbol; /* harmony default export */ __webpack_exports__["a"] = (Symbol); /***/ }), /* 35 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export default */ /** * Prints a warning in the console if it exists. * * @param {String} message The warning message. * @returns {void} */ function warning(message) { /* eslint-disable no-console */ if (typeof console !== 'undefined' && typeof console.error === 'function') { console.error(message); } /* eslint-enable no-console */ try { // This error was thrown as a convenience so that if you enable // "break on all exceptions" in your console, // it would pause the execution at this line. throw new Error(message); /* eslint-disable no-empty */ } catch (e) {} /* eslint-enable no-empty */ } /***/ }), /* 36 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = compose; /** * Composes single-argument functions from right to left. The rightmost * function can take multiple arguments as it provides the signature for * the resulting composite function. * * @param {...Function} funcs The functions to compose. * @returns {Function} A function obtained by composing the argument functions * from right to left. For example, compose(f, g, h) is identical to doing * (...args) => f(g(h(...args))). */ function compose() { for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) { funcs[_key] = arguments[_key]; } if (funcs.length === 0) { return function (arg) { return arg; }; } if (funcs.length === 1) { return funcs[0]; } return funcs.reduce(function (a, b) { return function () { return a(b.apply(undefined, arguments)); }; }); } /***/ }), /* 37 */, /* 38 */, /* 39 */, /* 40 */, /* 41 */, /* 42 */, /* 43 */, /* 44 */, /* 45 */, /* 46 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(1459); /***/ }), /* 47 */, /* 48 */, /* 49 */, /* 50 */, /* 51 */, /* 52 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_52__; /***/ }), /* 53 */, /* 54 */, /* 55 */, /* 56 */, /* 57 */, /* 58 */, /* 59 */, /* 60 */, /* 61 */, /* 62 */, /* 63 */, /* 64 */, /* 65 */, /* 66 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.decode = exports.parse = __webpack_require__(121); exports.encode = exports.stringify = __webpack_require__(122); /***/ }), /* 67 */ /***/ (function(module, exports, __webpack_require__) { var baseGet = __webpack_require__(68); /** * Gets the value at `path` of `object`. If the resolved value is * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.get(object, 'a[0].b.c'); * // => 3 * * _.get(object, ['a', '0', 'b', 'c']); * // => 3 * * _.get(object, 'a.b.c', 'default'); * // => 'default' */ function get(object, path, defaultValue) { var result = object == null ? undefined : baseGet(object, path); return result === undefined ? defaultValue : result; } module.exports = get; /***/ }), /* 68 */ /***/ (function(module, exports, __webpack_require__) { var castPath = __webpack_require__(69), toKey = __webpack_require__(111); /** * The base implementation of `_.get` without support for default values. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @returns {*} Returns the resolved value. */ function baseGet(object, path) { path = castPath(path, object); var index = 0, length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; } return (index && index == length) ? object : undefined; } module.exports = baseGet; /***/ }), /* 69 */ /***/ (function(module, exports, __webpack_require__) { var isArray = __webpack_require__(70), isKey = __webpack_require__(71), stringToPath = __webpack_require__(73), toString = __webpack_require__(108); /** * Casts `value` to a path array if it's not one. * * @private * @param {*} value The value to inspect. * @param {Object} [object] The object to query keys on. * @returns {Array} Returns the cast property path array. */ function castPath(value, object) { if (isArray(value)) { return value; } return isKey(value, object) ? [value] : stringToPath(toString(value)); } module.exports = castPath; /***/ }), /* 70 */ /***/ (function(module, exports) { /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; module.exports = isArray; /***/ }), /* 71 */ /***/ (function(module, exports, __webpack_require__) { var isArray = __webpack_require__(70), isSymbol = __webpack_require__(72); /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/; /** * Checks if `value` is a property name and not a property path. * * @private * @param {*} value The value to check. * @param {Object} [object] The object to query keys on. * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { if (isArray(value)) { return false; } var type = typeof value; if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (object != null && value in Object(object)); } module.exports = isKey; /***/ }), /* 72 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(6), isObjectLike = __webpack_require__(14); /** `Object#toString` result references. */ var symbolTag = '[object Symbol]'; /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || (isObjectLike(value) && baseGetTag(value) == symbolTag); } module.exports = isSymbol; /***/ }), /* 73 */ /***/ (function(module, exports, __webpack_require__) { var memoizeCapped = __webpack_require__(74); /** Used to match property names within property paths. */ var reLeadingDot = /^\./, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; /** * Converts `string` to a property path array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ var stringToPath = memoizeCapped(function(string) { var result = []; if (reLeadingDot.test(string)) { result.push(''); } string.replace(rePropName, function(match, number, quote, string) { result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); }); return result; }); module.exports = stringToPath; /***/ }), /* 74 */ /***/ (function(module, exports, __webpack_require__) { var memoize = __webpack_require__(75); /** Used as the maximum memoize cache size. */ var MAX_MEMOIZE_SIZE = 500; /** * A specialized version of `_.memoize` which clears the memoized function's * cache when it exceeds `MAX_MEMOIZE_SIZE`. * * @private * @param {Function} func The function to have its output memoized. * @returns {Function} Returns the new memoized function. */ function memoizeCapped(func) { var result = memoize(func, function(key) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear(); } return key; }); var cache = result.cache; return result; } module.exports = memoizeCapped; /***/ }), /* 75 */ /***/ (function(module, exports, __webpack_require__) { var MapCache = __webpack_require__(76); /** Error message constants. */ var FUNC_ERROR_TEXT = 'Expected a function'; /** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `clear`, `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; * var other = { 'c': 3, 'd': 4 }; * * var values = _.memoize(_.values); * values(object); * // => [1, 2] * * values(other); * // => [3, 4] * * object.a = 2; * values(object); * // => [1, 2] * * // Modify the result cache. * values.cache.set(object, ['a', 'b']); * values(object); * // => ['a', 'b'] * * // Replace `_.memoize.Cache`. * _.memoize.Cache = WeakMap; */ function memoize(func, resolver) { if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } var result = func.apply(this, args); memoized.cache = cache.set(key, result) || cache; return result; }; memoized.cache = new (memoize.Cache || MapCache); return memoized; } // Expose `MapCache`. memoize.Cache = MapCache; module.exports = memoize; /***/ }), /* 76 */ /***/ (function(module, exports, __webpack_require__) { var mapCacheClear = __webpack_require__(77), mapCacheDelete = __webpack_require__(102), mapCacheGet = __webpack_require__(105), mapCacheHas = __webpack_require__(106), mapCacheSet = __webpack_require__(107); /** * Creates a map cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function MapCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `MapCache`. MapCache.prototype.clear = mapCacheClear; MapCache.prototype['delete'] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; module.exports = MapCache; /***/ }), /* 77 */ /***/ (function(module, exports, __webpack_require__) { var Hash = __webpack_require__(78), ListCache = __webpack_require__(93), Map = __webpack_require__(101); /** * Removes all key-value entries from the map. * * @private * @name clear * @memberOf MapCache */ function mapCacheClear() { this.size = 0; this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash }; } module.exports = mapCacheClear; /***/ }), /* 78 */ /***/ (function(module, exports, __webpack_require__) { var hashClear = __webpack_require__(79), hashDelete = __webpack_require__(89), hashGet = __webpack_require__(90), hashHas = __webpack_require__(91), hashSet = __webpack_require__(92); /** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Hash(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `Hash`. Hash.prototype.clear = hashClear; Hash.prototype['delete'] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; module.exports = Hash; /***/ }), /* 79 */ /***/ (function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(80); /** * Removes all key-value entries from the hash. * * @private * @name clear * @memberOf Hash */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; } module.exports = hashClear; /***/ }), /* 80 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(81); /* Built-in method references that are verified to be native. */ var nativeCreate = getNative(Object, 'create'); module.exports = nativeCreate; /***/ }), /* 81 */ /***/ (function(module, exports, __webpack_require__) { var baseIsNative = __webpack_require__(82), getValue = __webpack_require__(88); /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined; } module.exports = getNative; /***/ }), /* 82 */ /***/ (function(module, exports, __webpack_require__) { var isFunction = __webpack_require__(83), isMasked = __webpack_require__(85), isObject = __webpack_require__(84), toSource = __webpack_require__(87); /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used for built-in method references. */ var funcProto = Function.prototype, objectProto = Object.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } module.exports = baseIsNative; /***/ }), /* 83 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(6), isObject = __webpack_require__(84); /** `Object#toString` result references. */ var asyncTag = '[object AsyncFunction]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', proxyTag = '[object Proxy]'; /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { if (!isObject(value)) { return false; } // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } module.exports = isFunction; /***/ }), /* 84 */ /***/ (function(module, exports) { /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return value != null && (type == 'object' || type == 'function'); } module.exports = isObject; /***/ }), /* 85 */ /***/ (function(module, exports, __webpack_require__) { var coreJsData = __webpack_require__(86); /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; }()); /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && (maskSrcKey in func); } module.exports = isMasked; /***/ }), /* 86 */ /***/ (function(module, exports, __webpack_require__) { var root = __webpack_require__(8); /** Used to detect overreaching core-js shims. */ var coreJsData = root['__core-js_shared__']; module.exports = coreJsData; /***/ }), /* 87 */ /***/ (function(module, exports) { /** Used for built-in method references. */ var funcProto = Function.prototype; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** * Converts `func` to its source code. * * @private * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } module.exports = toSource; /***/ }), /* 88 */ /***/ (function(module, exports) { /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } module.exports = getValue; /***/ }), /* 89 */ /***/ (function(module, exports) { /** * Removes `key` and its value from the hash. * * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { var result = this.has(key) && delete this.__data__[key]; this.size -= result ? 1 : 0; return result; } module.exports = hashDelete; /***/ }), /* 90 */ /***/ (function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(80); /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Gets the hash value for `key`. * * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function hashGet(key) { var data = this.__data__; if (nativeCreate) { var result = data[key]; return result === HASH_UNDEFINED ? undefined : result; } return hasOwnProperty.call(data, key) ? data[key] : undefined; } module.exports = hashGet; /***/ }), /* 91 */ /***/ (function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(80); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Checks if a hash value for `key` exists. * * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function hashHas(key) { var data = this.__data__; return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); } module.exports = hashHas; /***/ }), /* 92 */ /***/ (function(module, exports, __webpack_require__) { var nativeCreate = __webpack_require__(80); /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** * Sets the hash `key` to `value`. * * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the hash instance. */ function hashSet(key, value) { var data = this.__data__; this.size += this.has(key) ? 0 : 1; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } module.exports = hashSet; /***/ }), /* 93 */ /***/ (function(module, exports, __webpack_require__) { var listCacheClear = __webpack_require__(94), listCacheDelete = __webpack_require__(95), listCacheGet = __webpack_require__(98), listCacheHas = __webpack_require__(99), listCacheSet = __webpack_require__(100); /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } // Add methods to `ListCache`. ListCache.prototype.clear = listCacheClear; ListCache.prototype['delete'] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; module.exports = ListCache; /***/ }), /* 94 */ /***/ (function(module, exports) { /** * Removes all key-value entries from the list cache. * * @private * @name clear * @memberOf ListCache */ function listCacheClear() { this.__data__ = []; this.size = 0; } module.exports = listCacheClear; /***/ }), /* 95 */ /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__(96); /** Used for built-in method references. */ var arrayProto = Array.prototype; /** Built-in value references. */ var splice = arrayProto.splice; /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } --this.size; return true; } module.exports = listCacheDelete; /***/ }), /* 96 */ /***/ (function(module, exports, __webpack_require__) { var eq = __webpack_require__(97); /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } module.exports = assocIndexOf; /***/ }), /* 97 */ /***/ (function(module, exports) { /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } module.exports = eq; /***/ }), /* 98 */ /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__(96); /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? undefined : data[index][1]; } module.exports = listCacheGet; /***/ }), /* 99 */ /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__(96); /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } module.exports = listCacheHas; /***/ }), /* 100 */ /***/ (function(module, exports, __webpack_require__) { var assocIndexOf = __webpack_require__(96); /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */ function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { ++this.size; data.push([key, value]); } else { data[index][1] = value; } return this; } module.exports = listCacheSet; /***/ }), /* 101 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(81), root = __webpack_require__(8); /* Built-in method references that are verified to be native. */ var Map = getNative(root, 'Map'); module.exports = Map; /***/ }), /* 102 */ /***/ (function(module, exports, __webpack_require__) { var getMapData = __webpack_require__(103); /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { var result = getMapData(this, key)['delete'](key); this.size -= result ? 1 : 0; return result; } module.exports = mapCacheDelete; /***/ }), /* 103 */ /***/ (function(module, exports, __webpack_require__) { var isKeyable = __webpack_require__(104); /** * Gets the data for `map`. * * @private * @param {Object} map The map to query. * @param {string} key The reference key. * @returns {*} Returns the map data. */ function getMapData(map, key) { var data = map.__data__; return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; } module.exports = getMapData; /***/ }), /* 104 */ /***/ (function(module, exports) { /** * Checks if `value` is suitable for use as unique object key. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ function isKeyable(value) { var type = typeof value; return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') ? (value !== '__proto__') : (value === null); } module.exports = isKeyable; /***/ }), /* 105 */ /***/ (function(module, exports, __webpack_require__) { var getMapData = __webpack_require__(103); /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function mapCacheGet(key) { return getMapData(this, key).get(key); } module.exports = mapCacheGet; /***/ }), /* 106 */ /***/ (function(module, exports, __webpack_require__) { var getMapData = __webpack_require__(103); /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function mapCacheHas(key) { return getMapData(this, key).has(key); } module.exports = mapCacheHas; /***/ }), /* 107 */ /***/ (function(module, exports, __webpack_require__) { var getMapData = __webpack_require__(103); /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { var data = getMapData(this, key), size = data.size; data.set(key, value); this.size += data.size == size ? 0 : 1; return this; } module.exports = mapCacheSet; /***/ }), /* 108 */ /***/ (function(module, exports, __webpack_require__) { var baseToString = __webpack_require__(109); /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {string} Returns the converted string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ function toString(value) { return value == null ? '' : baseToString(value); } module.exports = toString; /***/ }), /* 109 */ /***/ (function(module, exports, __webpack_require__) { var Symbol = __webpack_require__(7), arrayMap = __webpack_require__(110), isArray = __webpack_require__(70), isSymbol = __webpack_require__(72); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined; /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function baseToString(value) { // Exit early for strings to avoid a performance hit in some environments. if (typeof value == 'string') { return value; } if (isArray(value)) { // Recursively convert values (susceptible to call stack limits). return arrayMap(value, baseToString) + ''; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } module.exports = baseToString; /***/ }), /* 110 */ /***/ (function(module, exports) { /** * A specialized version of `_.map` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { var index = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } module.exports = arrayMap; /***/ }), /* 111 */ /***/ (function(module, exports, __webpack_require__) { var isSymbol = __webpack_require__(72); /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** * Converts `value` to a string key if it's not a string or symbol. * * @private * @param {*} value The value to inspect. * @returns {string|symbol} Returns the key. */ function toKey(value) { if (typeof value == 'string' || isSymbol(value)) { return value; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } module.exports = toKey; /***/ }), /* 112 */ /***/ (function(module, exports, __webpack_require__) { var baseSet = __webpack_require__(113); /** * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, * it's created. Arrays are created for missing index properties while objects * are created for all other missing properties. Use `_.setWith` to customize * `path` creation. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @returns {Object} Returns `object`. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.set(object, 'a[0].b.c', 4); * console.log(object.a[0].b.c); * // => 4 * * _.set(object, ['x', '0', 'y', 'z'], 5); * console.log(object.x[0].y.z); * // => 5 */ function set(object, path, value) { return object == null ? object : baseSet(object, path, value); } module.exports = set; /***/ }), /* 113 */ /***/ (function(module, exports, __webpack_require__) { var assignValue = __webpack_require__(114), castPath = __webpack_require__(69), isIndex = __webpack_require__(117), isObject = __webpack_require__(84), toKey = __webpack_require__(111); /** * The base implementation of `_.set`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseSet(object, path, value, customizer) { if (!isObject(object)) { return object; } path = castPath(path, object); var index = -1, length = path.length, lastIndex = length - 1, nested = object; while (nested != null && ++index < length) { var key = toKey(path[index]), newValue = value; if (index != lastIndex) { var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : undefined; if (newValue === undefined) { newValue = isObject(objValue) ? objValue : (isIndex(path[index + 1]) ? [] : {}); } } assignValue(nested, key, newValue); nested = nested[key]; } return object; } module.exports = baseSet; /***/ }), /* 114 */ /***/ (function(module, exports, __webpack_require__) { var baseAssignValue = __webpack_require__(115), eq = __webpack_require__(97); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Assigns `value` to `key` of `object` if the existing value is not equivalent * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } module.exports = assignValue; /***/ }), /* 115 */ /***/ (function(module, exports, __webpack_require__) { var defineProperty = __webpack_require__(116); /** * The base implementation of `assignValue` and `assignMergeValue` without * value checks. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function baseAssignValue(object, key, value) { if (key == '__proto__' && defineProperty) { defineProperty(object, key, { 'configurable': true, 'enumerable': true, 'value': value, 'writable': true }); } else { object[key] = value; } } module.exports = baseAssignValue; /***/ }), /* 116 */ /***/ (function(module, exports, __webpack_require__) { var getNative = __webpack_require__(81); var defineProperty = (function() { try { var func = getNative(Object, 'defineProperty'); func({}, '', {}); return func; } catch (e) {} }()); module.exports = defineProperty; /***/ }), /* 117 */ /***/ (function(module, exports) { /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (typeof value == 'number' || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); } module.exports = isIndex; /***/ }), /* 118 */ /***/ (function(module, exports) { /***/ }), /* 119 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // resolves . and .. elements in a path array with directory names there // must be no slashes, empty elements, or device names (c:\) in the array // (so also no leading and trailing slashes - it does not distinguish // relative and absolute paths) function normalizeArray(parts, allowAboveRoot) { // if the path tries to go above the root, `up` ends up > 0 var up = 0; for (var i = parts.length - 1; i >= 0; i--) { var last = parts[i]; if (last === '.') { parts.splice(i, 1); } else if (last === '..') { parts.splice(i, 1); up++; } else if (up) { parts.splice(i, 1); up--; } } // if the path is allowed to go above the root, restore leading ..s if (allowAboveRoot) { for (; up--; up) { parts.unshift('..'); } } return parts; } // Split a filename into [root, dir, basename, ext], unix version // 'root' is just a slash, or nothing. var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; var splitPath = function(filename) { return splitPathRe.exec(filename).slice(1); }; // path.resolve([from ...], to) // posix version exports.resolve = function() { var resolvedPath = '', resolvedAbsolute = false; for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { var path = (i >= 0) ? arguments[i] : process.cwd(); // Skip empty and invalid entries if (typeof path !== 'string') { throw new TypeError('Arguments to path.resolve must be strings'); } else if (!path) { continue; } resolvedPath = path + '/' + resolvedPath; resolvedAbsolute = path.charAt(0) === '/'; } // At this point the path should be resolved to a full absolute path, but // handle relative paths to be safe (might happen when process.cwd() fails) // Normalize the path resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { return !!p; }), !resolvedAbsolute).join('/'); return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; }; // path.normalize(path) // posix version exports.normalize = function(path) { var isAbsolute = exports.isAbsolute(path), trailingSlash = substr(path, -1) === '/'; // Normalize the path path = normalizeArray(filter(path.split('/'), function(p) { return !!p; }), !isAbsolute).join('/'); if (!path && !isAbsolute) { path = '.'; } if (path && trailingSlash) { path += '/'; } return (isAbsolute ? '/' : '') + path; }; // posix version exports.isAbsolute = function(path) { return path.charAt(0) === '/'; }; // posix version exports.join = function() { var paths = Array.prototype.slice.call(arguments, 0); return exports.normalize(filter(paths, function(p, index) { if (typeof p !== 'string') { throw new TypeError('Arguments to path.join must be strings'); } return p; }).join('/')); }; // path.relative(from, to) // posix version exports.relative = function(from, to) { from = exports.resolve(from).substr(1); to = exports.resolve(to).substr(1); function trim(arr) { var start = 0; for (; start < arr.length; start++) { if (arr[start] !== '') break; } var end = arr.length - 1; for (; end >= 0; end--) { if (arr[end] !== '') break; } if (start > end) return []; return arr.slice(start, end - start + 1); } var fromParts = trim(from.split('/')); var toParts = trim(to.split('/')); var length = Math.min(fromParts.length, toParts.length); var samePartsLength = length; for (var i = 0; i < length; i++) { if (fromParts[i] !== toParts[i]) { samePartsLength = i; break; } } var outputParts = []; for (var i = samePartsLength; i < fromParts.length; i++) { outputParts.push('..'); } outputParts = outputParts.concat(toParts.slice(samePartsLength)); return outputParts.join('/'); }; exports.sep = '/'; exports.delimiter = ':'; exports.dirname = function(path) { var result = splitPath(path), root = result[0], dir = result[1]; if (!root && !dir) { // No dirname whatsoever return '.'; } if (dir) { // It has a dirname, strip trailing slash dir = dir.substr(0, dir.length - 1); } return root + dir; }; exports.basename = function(path, ext) { var f = splitPath(path)[2]; // TODO: make this comparison case-insensitive on windows? if (ext && f.substr(-1 * ext.length) === ext) { f = f.substr(0, f.length - ext.length); } return f; }; exports.extname = function(path) { return splitPath(path)[3]; }; function filter (xs, f) { if (xs.filter) return xs.filter(f); var res = []; for (var i = 0; i < xs.length; i++) { if (f(xs[i], i, xs)) res.push(xs[i]); } return res; } // String.prototype.substr - negative index don't work in IE8 var substr = 'ab'.substr(-1) === 'b' ? function (str, start, len) { return str.substr(start, len) } : function (str, start, len) { if (start < 0) start = str.length + start; return str.substr(start, len); } ; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(120))) /***/ }), /* 120 */ /***/ (function(module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout () { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } } ()) function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch(e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch(e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return [] } process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function() { return 0; }; /***/ }), /* 121 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // If obj.hasOwnProperty has been overridden, then calling // obj.hasOwnProperty(prop) will break. // See: https://github.com/joyent/node/issues/1707 function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } module.exports = function(qs, sep, eq, options) { sep = sep || '&'; eq = eq || '='; var obj = {}; if (typeof qs !== 'string' || qs.length === 0) { return obj; } var regexp = /\+/g; qs = qs.split(sep); var maxKeys = 1000; if (options && typeof options.maxKeys === 'number') { maxKeys = options.maxKeys; } var len = qs.length; // maxKeys <= 0 means that we should not limit keys count if (maxKeys > 0 && len > maxKeys) { len = maxKeys; } for (var i = 0; i < len; ++i) { var x = qs[i].replace(regexp, '%20'), idx = x.indexOf(eq), kstr, vstr, k, v; if (idx >= 0) { kstr = x.substr(0, idx); vstr = x.substr(idx + 1); } else { kstr = x; vstr = ''; } k = decodeURIComponent(kstr); v = decodeURIComponent(vstr); if (!hasOwnProperty(obj, k)) { obj[k] = v; } else if (isArray(obj[k])) { obj[k].push(v); } else { obj[k] = [obj[k], v]; } } return obj; }; var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; /***/ }), /* 122 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var stringifyPrimitive = function(v) { switch (typeof v) { case 'string': return v; case 'boolean': return v ? 'true' : 'false'; case 'number': return isFinite(v) ? v : ''; default: return ''; } }; module.exports = function(obj, sep, eq, name) { sep = sep || '&'; eq = eq || '='; if (obj === null) { obj = undefined; } if (typeof obj === 'object') { return map(objectKeys(obj), function(k) { var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; if (isArray(obj[k])) { return map(obj[k], function(v) { return ks + encodeURIComponent(stringifyPrimitive(v)); }).join(sep); } else { return ks + encodeURIComponent(stringifyPrimitive(obj[k])); } }).join(sep); } if (!name) return ''; return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj)); }; var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; function map (xs, f) { if (xs.map) return xs.map(f); var res = []; for (var i = 0; i < xs.length; i++) { res.push(f(xs[i], i)); } return res; } var objectKeys = Object.keys || function (obj) { var res = []; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); } return res; }; /***/ }), /* 123 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(34); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__getRawTag_js__ = __webpack_require__(127); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__objectToString_js__ = __webpack_require__(128); /** `Object#toString` result references. */ var nullTag = '[object Null]', undefinedTag = '[object Undefined]'; /** Built-in value references. */ var symToStringTag = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */].toStringTag : undefined; /** * The base implementation of `getTag` without fallbacks for buggy environments. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { if (value == null) { return value === undefined ? undefinedTag : nullTag; } return (symToStringTag && symToStringTag in Object(value)) ? Object(__WEBPACK_IMPORTED_MODULE_1__getRawTag_js__["a" /* default */])(value) : Object(__WEBPACK_IMPORTED_MODULE_2__objectToString_js__["a" /* default */])(value); } /* harmony default export */ __webpack_exports__["a"] = (baseGetTag); /***/ }), /* 124 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__ = __webpack_require__(125); /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = __WEBPACK_IMPORTED_MODULE_0__freeGlobal_js__["a" /* default */] || freeSelf || Function('return this')(); /* harmony default export */ __webpack_exports__["a"] = (root); /***/ }), /* 125 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; /* harmony default export */ __webpack_exports__["a"] = (freeGlobal); /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(792))) /***/ }), /* 126 */, /* 127 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Symbol_js__ = __webpack_require__(34); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** Built-in value references. */ var symToStringTag = __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */] ? __WEBPACK_IMPORTED_MODULE_0__Symbol_js__["a" /* default */].toStringTag : undefined; /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined; var unmasked = true; } catch (e) {} var result = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result; } /* harmony default export */ __webpack_exports__["a"] = (getRawTag); /***/ }), /* 128 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /** Used for built-in method references. */ var objectProto = Object.prototype; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString.call(value); } /* harmony default export */ __webpack_exports__["a"] = (objectToString); /***/ }), /* 129 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__overArg_js__ = __webpack_require__(130); /** Built-in value references. */ var getPrototype = Object(__WEBPACK_IMPORTED_MODULE_0__overArg_js__["a" /* default */])(Object.getPrototypeOf, Object); /* harmony default export */ __webpack_exports__["a"] = (getPrototype); /***/ }), /* 130 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } /* harmony default export */ __webpack_exports__["a"] = (overArg); /***/ }), /* 131 */, /* 132 */, /* 133 */, /* 134 */, /* 135 */, /* 136 */, /* 137 */, /* 138 */, /* 139 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return value != null && typeof value == 'object'; } /* harmony default export */ __webpack_exports__["a"] = (isObjectLike); /***/ }), /* 140 */, /* 141 */, /* 142 */, /* 143 */, /* 144 */, /* 145 */, /* 146 */ /***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2014-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ (function (global, factory) { true ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global.Immutable = factory()); }(this, function () { 'use strict';var SLICE$0 = Array.prototype.slice; function createClass(ctor, superClass) { if (superClass) { ctor.prototype = Object.create(superClass.prototype); } ctor.prototype.constructor = ctor; } function Iterable(value) { return isIterable(value) ? value : Seq(value); } createClass(KeyedIterable, Iterable); function KeyedIterable(value) { return isKeyed(value) ? value : KeyedSeq(value); } createClass(IndexedIterable, Iterable); function IndexedIterable(value) { return isIndexed(value) ? value : IndexedSeq(value); } createClass(SetIterable, Iterable); function SetIterable(value) { return isIterable(value) && !isAssociative(value) ? value : SetSeq(value); } function isIterable(maybeIterable) { return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]); } function isKeyed(maybeKeyed) { return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]); } function isIndexed(maybeIndexed) { return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]); } function isAssociative(maybeAssociative) { return isKeyed(maybeAssociative) || isIndexed(maybeAssociative); } function isOrdered(maybeOrdered) { return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]); } Iterable.isIterable = isIterable; Iterable.isKeyed = isKeyed; Iterable.isIndexed = isIndexed; Iterable.isAssociative = isAssociative; Iterable.isOrdered = isOrdered; Iterable.Keyed = KeyedIterable; Iterable.Indexed = IndexedIterable; Iterable.Set = SetIterable; var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'; var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@'; var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@'; var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@'; // Used for setting prototype methods that IE8 chokes on. var DELETE = 'delete'; // Constants describing the size of trie nodes. var SHIFT = 5; // Resulted in best performance after ______? var SIZE = 1 << SHIFT; var MASK = SIZE - 1; // A consistent shared value representing "not set" which equals nothing other // than itself, and nothing that could be provided externally. var NOT_SET = {}; // Boolean references, Rough equivalent of `bool &`. var CHANGE_LENGTH = { value: false }; var DID_ALTER = { value: false }; function MakeRef(ref) { ref.value = false; return ref; } function SetRef(ref) { ref && (ref.value = true); } // A function which returns a value representing an "owner" for transient writes // to tries. The return value will only ever equal itself, and will not equal // the return of any subsequent call of this function. function OwnerID() {} // http://jsperf.com/copy-array-inline function arrCopy(arr, offset) { offset = offset || 0; var len = Math.max(0, arr.length - offset); var newArr = new Array(len); for (var ii = 0; ii < len; ii++) { newArr[ii] = arr[ii + offset]; } return newArr; } function ensureSize(iter) { if (iter.size === undefined) { iter.size = iter.__iterate(returnTrue); } return iter.size; } function wrapIndex(iter, index) { // This implements "is array index" which the ECMAString spec defines as: // // A String property name P is an array index if and only if // ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal // to 2^32−1. // // http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects if (typeof index !== 'number') { var uint32Index = index >>> 0; // N >>> 0 is shorthand for ToUint32 if ('' + uint32Index !== index || uint32Index === 4294967295) { return NaN; } index = uint32Index; } return index < 0 ? ensureSize(iter) + index : index; } function returnTrue() { return true; } function wholeSlice(begin, end, size) { return (begin === 0 || (size !== undefined && begin <= -size)) && (end === undefined || (size !== undefined && end >= size)); } function resolveBegin(begin, size) { return resolveIndex(begin, size, 0); } function resolveEnd(end, size) { return resolveIndex(end, size, size); } function resolveIndex(index, size, defaultIndex) { return index === undefined ? defaultIndex : index < 0 ? Math.max(0, size + index) : size === undefined ? index : Math.min(size, index); } /* global Symbol */ var ITERATE_KEYS = 0; var ITERATE_VALUES = 1; var ITERATE_ENTRIES = 2; var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; var FAUX_ITERATOR_SYMBOL = '@@iterator'; var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL; function Iterator(next) { this.next = next; } Iterator.prototype.toString = function() { return '[Iterator]'; }; Iterator.KEYS = ITERATE_KEYS; Iterator.VALUES = ITERATE_VALUES; Iterator.ENTRIES = ITERATE_ENTRIES; Iterator.prototype.inspect = Iterator.prototype.toSource = function () { return this.toString(); } Iterator.prototype[ITERATOR_SYMBOL] = function () { return this; }; function iteratorValue(type, k, v, iteratorResult) { var value = type === 0 ? k : type === 1 ? v : [k, v]; iteratorResult ? (iteratorResult.value = value) : (iteratorResult = { value: value, done: false }); return iteratorResult; } function iteratorDone() { return { value: undefined, done: true }; } function hasIterator(maybeIterable) { return !!getIteratorFn(maybeIterable); } function isIterator(maybeIterator) { return maybeIterator && typeof maybeIterator.next === 'function'; } function getIterator(iterable) { var iteratorFn = getIteratorFn(iterable); return iteratorFn && iteratorFn.call(iterable); } function getIteratorFn(iterable) { var iteratorFn = iterable && ( (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) || iterable[FAUX_ITERATOR_SYMBOL] ); if (typeof iteratorFn === 'function') { return iteratorFn; } } function isArrayLike(value) { return value && typeof value.length === 'number'; } createClass(Seq, Iterable); function Seq(value) { return value === null || value === undefined ? emptySequence() : isIterable(value) ? value.toSeq() : seqFromValue(value); } Seq.of = function(/*...values*/) { return Seq(arguments); }; Seq.prototype.toSeq = function() { return this; }; Seq.prototype.toString = function() { return this.__toString('Seq {', '}'); }; Seq.prototype.cacheResult = function() { if (!this._cache && this.__iterateUncached) { this._cache = this.entrySeq().toArray(); this.size = this._cache.length; } return this; }; // abstract __iterateUncached(fn, reverse) Seq.prototype.__iterate = function(fn, reverse) { return seqIterate(this, fn, reverse, true); }; // abstract __iteratorUncached(type, reverse) Seq.prototype.__iterator = function(type, reverse) { return seqIterator(this, type, reverse, true); }; createClass(KeyedSeq, Seq); function KeyedSeq(value) { return value === null || value === undefined ? emptySequence().toKeyedSeq() : isIterable(value) ? (isKeyed(value) ? value.toSeq() : value.fromEntrySeq()) : keyedSeqFromValue(value); } KeyedSeq.prototype.toKeyedSeq = function() { return this; }; createClass(IndexedSeq, Seq); function IndexedSeq(value) { return value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value.toIndexedSeq(); } IndexedSeq.of = function(/*...values*/) { return IndexedSeq(arguments); }; IndexedSeq.prototype.toIndexedSeq = function() { return this; }; IndexedSeq.prototype.toString = function() { return this.__toString('Seq [', ']'); }; IndexedSeq.prototype.__iterate = function(fn, reverse) { return seqIterate(this, fn, reverse, false); }; IndexedSeq.prototype.__iterator = function(type, reverse) { return seqIterator(this, type, reverse, false); }; createClass(SetSeq, Seq); function SetSeq(value) { return ( value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value ).toSetSeq(); } SetSeq.of = function(/*...values*/) { return SetSeq(arguments); }; SetSeq.prototype.toSetSeq = function() { return this; }; Seq.isSeq = isSeq; Seq.Keyed = KeyedSeq; Seq.Set = SetSeq; Seq.Indexed = IndexedSeq; var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@'; Seq.prototype[IS_SEQ_SENTINEL] = true; createClass(ArraySeq, IndexedSeq); function ArraySeq(array) { this._array = array; this.size = array.length; } ArraySeq.prototype.get = function(index, notSetValue) { return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue; }; ArraySeq.prototype.__iterate = function(fn, reverse) { var array = this._array; var maxIndex = array.length - 1; for (var ii = 0; ii <= maxIndex; ii++) { if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) { return ii + 1; } } return ii; }; ArraySeq.prototype.__iterator = function(type, reverse) { var array = this._array; var maxIndex = array.length - 1; var ii = 0; return new Iterator(function() {return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++])} ); }; createClass(ObjectSeq, KeyedSeq); function ObjectSeq(object) { var keys = Object.keys(object); this._object = object; this._keys = keys; this.size = keys.length; } ObjectSeq.prototype.get = function(key, notSetValue) { if (notSetValue !== undefined && !this.has(key)) { return notSetValue; } return this._object[key]; }; ObjectSeq.prototype.has = function(key) { return this._object.hasOwnProperty(key); }; ObjectSeq.prototype.__iterate = function(fn, reverse) { var object = this._object; var keys = this._keys; var maxIndex = keys.length - 1; for (var ii = 0; ii <= maxIndex; ii++) { var key = keys[reverse ? maxIndex - ii : ii]; if (fn(object[key], key, this) === false) { return ii + 1; } } return ii; }; ObjectSeq.prototype.__iterator = function(type, reverse) { var object = this._object; var keys = this._keys; var maxIndex = keys.length - 1; var ii = 0; return new Iterator(function() { var key = keys[reverse ? maxIndex - ii : ii]; return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, key, object[key]); }); }; ObjectSeq.prototype[IS_ORDERED_SENTINEL] = true; createClass(IterableSeq, IndexedSeq); function IterableSeq(iterable) { this._iterable = iterable; this.size = iterable.length || iterable.size; } IterableSeq.prototype.__iterateUncached = function(fn, reverse) { if (reverse) { return this.cacheResult().__iterate(fn, reverse); } var iterable = this._iterable; var iterator = getIterator(iterable); var iterations = 0; if (isIterator(iterator)) { var step; while (!(step = iterator.next()).done) { if (fn(step.value, iterations++, this) === false) { break; } } } return iterations; }; IterableSeq.prototype.__iteratorUncached = function(type, reverse) { if (reverse) { return this.cacheResult().__iterator(type, reverse); } var iterable = this._iterable; var iterator = getIterator(iterable); if (!isIterator(iterator)) { return new Iterator(iteratorDone); } var iterations = 0; return new Iterator(function() { var step = iterator.next(); return step.done ? step : iteratorValue(type, iterations++, step.value); }); }; createClass(IteratorSeq, IndexedSeq); function IteratorSeq(iterator) { this._iterator = iterator; this._iteratorCache = []; } IteratorSeq.prototype.__iterateUncached = function(fn, reverse) { if (reverse) { return this.cacheResult().__iterate(fn, reverse); } var iterator = this._iterator; var cache = this._iteratorCache; var iterations = 0; while (iterations < cache.length) { if (fn(cache[iterations], iterations++, this) === false) { return iterations; } } var step; while (!(step = iterator.next()).done) { var val = step.value; cache[iterations] = val; if (fn(val, iterations++, this) === false) { break; } } return iterations; }; IteratorSeq.prototype.__iteratorUncached = function(type, reverse) { if (reverse) { return this.cacheResult().__iterator(type, reverse); } var iterator = this._iterator; var cache = this._iteratorCache; var iterations = 0; return new Iterator(function() { if (iterations >= cache.length) { var step = iterator.next(); if (step.done) { return step; } cache[iterations] = step.value; } return iteratorValue(type, iterations, cache[iterations++]); }); }; // # pragma Helper functions function isSeq(maybeSeq) { return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]); } var EMPTY_SEQ; function emptySequence() { return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([])); } function keyedSeqFromValue(value) { var seq = Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() : isIterator(value) ? new IteratorSeq(value).fromEntrySeq() : hasIterator(value) ? new IterableSeq(value).fromEntrySeq() : typeof value === 'object' ? new ObjectSeq(value) : undefined; if (!seq) { throw new TypeError( 'Expected Array or iterable object of [k, v] entries, '+ 'or keyed object: ' + value ); } return seq; } function indexedSeqFromValue(value) { var seq = maybeIndexedSeqFromValue(value); if (!seq) { throw new TypeError( 'Expected Array or iterable object of values: ' + value ); } return seq; } function seqFromValue(value) { var seq = maybeIndexedSeqFromValue(value) || (typeof value === 'object' && new ObjectSeq(value)); if (!seq) { throw new TypeError( 'Expected Array or iterable object of values, or keyed object: ' + value ); } return seq; } function maybeIndexedSeqFromValue(value) { return ( isArrayLike(value) ? new ArraySeq(value) : isIterator(value) ? new IteratorSeq(value) : hasIterator(value) ? new IterableSeq(value) : undefined ); } function seqIterate(seq, fn, reverse, useKeys) { var cache = seq._cache; if (cache) { var maxIndex = cache.length - 1; for (var ii = 0; ii <= maxIndex; ii++) { var entry = cache[reverse ? maxIndex - ii : ii]; if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) { return ii + 1; } } return ii; } return seq.__iterateUncached(fn, reverse); } function seqIterator(seq, type, reverse, useKeys) { var cache = seq._cache; if (cache) { var maxIndex = cache.length - 1; var ii = 0; return new Iterator(function() { var entry = cache[reverse ? maxIndex - ii : ii]; return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]); }); } return seq.__iteratorUncached(type, reverse); } function fromJS(json, converter) { return converter ? fromJSWith(converter, json, '', {'': json}) : fromJSDefault(json); } function fromJSWith(converter, json, key, parentJSON) { if (Array.isArray(json)) { return converter.call(parentJSON, key, IndexedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)})); } if (isPlainObj(json)) { return converter.call(parentJSON, key, KeyedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)})); } return json; } function fromJSDefault(json) { if (Array.isArray(json)) { return IndexedSeq(json).map(fromJSDefault).toList(); } if (isPlainObj(json)) { return KeyedSeq(json).map(fromJSDefault).toMap(); } return json; } function isPlainObj(value) { return value && (value.constructor === Object || value.constructor === undefined); } /** * An extension of the "same-value" algorithm as [described for use by ES6 Map * and Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality) * * NaN is considered the same as NaN, however -0 and 0 are considered the same * value, which is different from the algorithm described by * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). * * This is extended further to allow Objects to describe the values they * represent, by way of `valueOf` or `equals` (and `hashCode`). * * Note: because of this extension, the key equality of Immutable.Map and the * value equality of Immutable.Set will differ from ES6 Map and Set. * * ### Defining custom values * * The easiest way to describe the value an object represents is by implementing * `valueOf`. For example, `Date` represents a value by returning a unix * timestamp for `valueOf`: * * var date1 = new Date(1234567890000); // Fri Feb 13 2009 ... * var date2 = new Date(1234567890000); * date1.valueOf(); // 1234567890000 * assert( date1 !== date2 ); * assert( Immutable.is( date1, date2 ) ); * * Note: overriding `valueOf` may have other implications if you use this object * where JavaScript expects a primitive, such as implicit string coercion. * * For more complex types, especially collections, implementing `valueOf` may * not be performant. An alternative is to implement `equals` and `hashCode`. * * `equals` takes another object, presumably of similar type, and returns true * if the it is equal. Equality is symmetrical, so the same result should be * returned if this and the argument are flipped. * * assert( a.equals(b) === b.equals(a) ); * * `hashCode` returns a 32bit integer number representing the object which will * be used to determine how to store the value object in a Map or Set. You must * provide both or neither methods, one must not exist without the other. * * Also, an important relationship between these methods must be upheld: if two * values are equal, they *must* return the same hashCode. If the values are not * equal, they might have the same hashCode; this is called a hash collision, * and while undesirable for performance reasons, it is acceptable. * * if (a.equals(b)) { * assert( a.hashCode() === b.hashCode() ); * } * * All Immutable collections implement `equals` and `hashCode`. * */ function is(valueA, valueB) { if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) { return true; } if (!valueA || !valueB) { return false; } if (typeof valueA.valueOf === 'function' && typeof valueB.valueOf === 'function') { valueA = valueA.valueOf(); valueB = valueB.valueOf(); if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) { return true; } if (!valueA || !valueB) { return false; } } if (typeof valueA.equals === 'function' && typeof valueB.equals === 'function' && valueA.equals(valueB)) { return true; } return false; } function deepEqual(a, b) { if (a === b) { return true; } if ( !isIterable(b) || a.size !== undefined && b.size !== undefined && a.size !== b.size || a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash || isKeyed(a) !== isKeyed(b) || isIndexed(a) !== isIndexed(b) || isOrdered(a) !== isOrdered(b) ) { return false; } if (a.size === 0 && b.size === 0) { return true; } var notAssociative = !isAssociative(a); if (isOrdered(a)) { var entries = a.entries(); return b.every(function(v, k) { var entry = entries.next().value; return entry && is(entry[1], v) && (notAssociative || is(entry[0], k)); }) && entries.next().done; } var flipped = false; if (a.size === undefined) { if (b.size === undefined) { if (typeof a.cacheResult === 'function') { a.cacheResult(); } } else { flipped = true; var _ = a; a = b; b = _; } } var allEqual = true; var bSize = b.__iterate(function(v, k) { if (notAssociative ? !a.has(v) : flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) { allEqual = false; return false; } }); return allEqual && a.size === bSize; } createClass(Repeat, IndexedSeq); function Repeat(value, times) { if (!(this instanceof Repeat)) { return new Repeat(value, times); } this._value = value; this.size = times === undefined ? Infinity : Math.max(0, times); if (this.size === 0) { if (EMPTY_REPEAT) { return EMPTY_REPEAT; } EMPTY_REPEAT = this; } } Repeat.prototype.toString = function() { if (this.size === 0) { return 'Repeat []'; } return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]'; }; Repeat.prototype.get = function(index, notSetValue) { return this.has(index) ? this._value : notSetValue; }; Repeat.prototype.includes = function(searchValue) { return is(this._value, searchValue); }; Repeat.prototype.slice = function(begin, end) { var size = this.size; return wholeSlice(begin, end, size) ? this : new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size)); }; Repeat.prototype.reverse = function() { return this; }; Repeat.prototype.indexOf = function(searchValue) { if (is(this._value, searchValue)) { return 0; } return -1; }; Repeat.prototype.lastIndexOf = function(searchValue) { if (is(this._value, searchValue)) { return this.size; } return -1; }; Repeat.prototype.__iterate = function(fn, reverse) { for (var ii = 0; ii < this.size; ii++) { if (fn(this._value, ii, this) === false) { return ii + 1; } } return ii; }; Repeat.prototype.__iterator = function(type, reverse) {var this$0 = this; var ii = 0; return new Iterator(function() {return ii < this$0.size ? iteratorValue(type, ii++, this$0._value) : iteratorDone()} ); }; Repeat.prototype.equals = function(other) { return other instanceof Repeat ? is(this._value, other._value) : deepEqual(other); }; var EMPTY_REPEAT; function invariant(condition, error) { if (!condition) throw new Error(error); } createClass(Range, IndexedSeq); function Range(start, end, step) { if (!(this instanceof Range)) { return new Range(start, end, step); } invariant(step !== 0, 'Cannot step a Range by 0'); start = start || 0; if (end === undefined) { end = Infinity; } step = step === undefined ? 1 : Math.abs(step); if (end < start) { step = -step; } this._start = start; this._end = end; this._step = step; this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1); if (this.size === 0) { if (EMPTY_RANGE) { return EMPTY_RANGE; } EMPTY_RANGE = this; } } Range.prototype.toString = function() { if (this.size === 0) { return 'Range []'; } return 'Range [ ' + this._start + '...' + this._end + (this._step !== 1 ? ' by ' + this._step : '') + ' ]'; }; Range.prototype.get = function(index, notSetValue) { return this.has(index) ? this._start + wrapIndex(this, index) * this._step : notSetValue; }; Range.prototype.includes = function(searchValue) { var possibleIndex = (searchValue - this._start) / this._step; return possibleIndex >= 0 && possibleIndex < this.size && possibleIndex === Math.floor(possibleIndex); }; Range.prototype.slice = function(begin, end) { if (wholeSlice(begin, end, this.size)) { return this; } begin = resolveBegin(begin, this.size); end = resolveEnd(end, this.size); if (end <= begin) { return new Range(0, 0); } return new Range(this.get(begin, this._end), this.get(end, this._end), this._step); }; Range.prototype.indexOf = function(searchValue) { var offsetValue = searchValue - this._start; if (offsetValue % this._step === 0) { var index = offsetValue / this._step; if (index >= 0 && index < this.size) { return index } } return -1; }; Range.prototype.lastIndexOf = function(searchValue) { return this.indexOf(searchValue); }; Range.prototype.__iterate = function(fn, reverse) { var maxIndex = this.size - 1; var step = this._step; var value = reverse ? this._start + maxIndex * step : this._start; for (var ii = 0; ii <= maxIndex; ii++) { if (fn(value, ii, this) === false) { return ii + 1; } value += reverse ? -step : step; } return ii; }; Range.prototype.__iterator = function(type, reverse) { var maxIndex = this.size - 1; var step = this._step; var value = reverse ? this._start + maxIndex * step : this._start; var ii = 0; return new Iterator(function() { var v = value; value += reverse ? -step : step; return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v); }); }; Range.prototype.equals = function(other) { return other instanceof Range ? this._start === other._start && this._end === other._end && this._step === other._step : deepEqual(this, other); }; var EMPTY_RANGE; createClass(Collection, Iterable); function Collection() { throw TypeError('Abstract'); } createClass(KeyedCollection, Collection);function KeyedCollection() {} createClass(IndexedCollection, Collection);function IndexedCollection() {} createClass(SetCollection, Collection);function SetCollection() {} Collection.Keyed = KeyedCollection; Collection.Indexed = IndexedCollection; Collection.Set = SetCollection; var imul = typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ? Math.imul : function imul(a, b) { a = a | 0; // int b = b | 0; // int var c = a & 0xffff; var d = b & 0xffff; // Shift by 0 fixes the sign on the high part. return (c * d) + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0) | 0; // int }; // v8 has an optimization for storing 31-bit signed numbers. // Values which have either 00 or 11 as the high order bits qualify. // This function drops the highest order bit in a signed number, maintaining // the sign bit. function smi(i32) { return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF); } function hash(o) { if (o === false || o === null || o === undefined) { return 0; } if (typeof o.valueOf === 'function') { o = o.valueOf(); if (o === false || o === null || o === undefined) { return 0; } } if (o === true) { return 1; } var type = typeof o; if (type === 'number') { if (o !== o || o === Infinity) { return 0; } var h = o | 0; if (h !== o) { h ^= o * 0xFFFFFFFF; } while (o > 0xFFFFFFFF) { o /= 0xFFFFFFFF; h ^= o; } return smi(h); } if (type === 'string') { return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o); } if (typeof o.hashCode === 'function') { return o.hashCode(); } if (type === 'object') { return hashJSObj(o); } if (typeof o.toString === 'function') { return hashString(o.toString()); } throw new Error('Value type ' + type + ' cannot be hashed.'); } function cachedHashString(string) { var hash = stringHashCache[string]; if (hash === undefined) { hash = hashString(string); if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) { STRING_HASH_CACHE_SIZE = 0; stringHashCache = {}; } STRING_HASH_CACHE_SIZE++; stringHashCache[string] = hash; } return hash; } // http://jsperf.com/hashing-strings function hashString(string) { // This is the hash from JVM // The hash code for a string is computed as // s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1], // where s[i] is the ith character of the string and n is the length of // the string. We "mod" the result to make it between 0 (inclusive) and 2^31 // (exclusive) by dropping high bits. var hash = 0; for (var ii = 0; ii < string.length; ii++) { hash = 31 * hash + string.charCodeAt(ii) | 0; } return smi(hash); } function hashJSObj(obj) { var hash; if (usingWeakMap) { hash = weakMap.get(obj); if (hash !== undefined) { return hash; } } hash = obj[UID_HASH_KEY]; if (hash !== undefined) { return hash; } if (!canDefineProperty) { hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY]; if (hash !== undefined) { return hash; } hash = getIENodeHash(obj); if (hash !== undefined) { return hash; } } hash = ++objHashUID; if (objHashUID & 0x40000000) { objHashUID = 0; } if (usingWeakMap) { weakMap.set(obj, hash); } else if (isExtensible !== undefined && isExtensible(obj) === false) { throw new Error('Non-extensible objects are not allowed as keys.'); } else if (canDefineProperty) { Object.defineProperty(obj, UID_HASH_KEY, { 'enumerable': false, 'configurable': false, 'writable': false, 'value': hash }); } else if (obj.propertyIsEnumerable !== undefined && obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) { // Since we can't define a non-enumerable property on the object // we'll hijack one of the less-used non-enumerable properties to // save our hash on it. Since this is a function it will not show up in // `JSON.stringify` which is what we want. obj.propertyIsEnumerable = function() { return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments); }; obj.propertyIsEnumerable[UID_HASH_KEY] = hash; } else if (obj.nodeType !== undefined) { // At this point we couldn't get the IE `uniqueID` to use as a hash // and we couldn't use a non-enumerable property to exploit the // dontEnum bug so we simply add the `UID_HASH_KEY` on the node // itself. obj[UID_HASH_KEY] = hash; } else { throw new Error('Unable to set a non-enumerable property on object.'); } return hash; } // Get references to ES5 object methods. var isExtensible = Object.isExtensible; // True if Object.defineProperty works as expected. IE8 fails this test. var canDefineProperty = (function() { try { Object.defineProperty({}, '@', {}); return true; } catch (e) { return false; } }()); // IE has a `uniqueID` property on DOM nodes. We can construct the hash from it // and avoid memory leaks from the IE cloneNode bug. function getIENodeHash(node) { if (node && node.nodeType > 0) { switch (node.nodeType) { case 1: // Element return node.uniqueID; case 9: // Document return node.documentElement && node.documentElement.uniqueID; } } } // If possible, use a WeakMap. var usingWeakMap = typeof WeakMap === 'function'; var weakMap; if (usingWeakMap) { weakMap = new WeakMap(); } var objHashUID = 0; var UID_HASH_KEY = '__immutablehash__'; if (typeof Symbol === 'function') { UID_HASH_KEY = Symbol(UID_HASH_KEY); } var STRING_HASH_CACHE_MIN_STRLEN = 16; var STRING_HASH_CACHE_MAX_SIZE = 255; var STRING_HASH_CACHE_SIZE = 0; var stringHashCache = {}; function assertNotInfinite(size) { invariant( size !== Infinity, 'Cannot perform this action with an infinite size.' ); } createClass(Map, KeyedCollection); // @pragma Construction function Map(value) { return value === null || value === undefined ? emptyMap() : isMap(value) && !isOrdered(value) ? value : emptyMap().withMutations(function(map ) { var iter = KeyedIterable(value); assertNotInfinite(iter.size); iter.forEach(function(v, k) {return map.set(k, v)}); }); } Map.of = function() {var keyValues = SLICE$0.call(arguments, 0); return emptyMap().withMutations(function(map ) { for (var i = 0; i < keyValues.length; i += 2) { if (i + 1 >= keyValues.length) { throw new Error('Missing value for key: ' + keyValues[i]); } map.set(keyValues[i], keyValues[i + 1]); } }); }; Map.prototype.toString = function() { return this.__toString('Map {', '}'); }; // @pragma Access Map.prototype.get = function(k, notSetValue) { return this._root ? this._root.get(0, undefined, k, notSetValue) : notSetValue; }; // @pragma Modification Map.prototype.set = function(k, v) { return updateMap(this, k, v); }; Map.prototype.setIn = function(keyPath, v) { return this.updateIn(keyPath, NOT_SET, function() {return v}); }; Map.prototype.remove = function(k) { return updateMap(this, k, NOT_SET); }; Map.prototype.deleteIn = function(keyPath) { return this.updateIn(keyPath, function() {return NOT_SET}); }; Map.prototype.update = function(k, notSetValue, updater) { return arguments.length === 1 ? k(this) : this.updateIn([k], notSetValue, updater); }; Map.prototype.updateIn = function(keyPath, notSetValue, updater) { if (!updater) { updater = notSetValue; notSetValue = undefined; } var updatedValue = updateInDeepMap( this, forceIterator(keyPath), notSetValue, updater ); return updatedValue === NOT_SET ? undefined : updatedValue; }; Map.prototype.clear = function() { if (this.size === 0) { return this; } if (this.__ownerID) { this.size = 0; this._root = null; this.__hash = undefined; this.__altered = true; return this; } return emptyMap(); }; // @pragma Composition Map.prototype.merge = function(/*...iters*/) { return mergeIntoMapWith(this, undefined, arguments); }; Map.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1); return mergeIntoMapWith(this, merger, iters); }; Map.prototype.mergeIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1); return this.updateIn( keyPath, emptyMap(), function(m ) {return typeof m.merge === 'function' ? m.merge.apply(m, iters) : iters[iters.length - 1]} ); }; Map.prototype.mergeDeep = function(/*...iters*/) { return mergeIntoMapWith(this, deepMerger, arguments); }; Map.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1); return mergeIntoMapWith(this, deepMergerWith(merger), iters); }; Map.prototype.mergeDeepIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1); return this.updateIn( keyPath, emptyMap(), function(m ) {return typeof m.mergeDeep === 'function' ? m.mergeDeep.apply(m, iters) : iters[iters.length - 1]} ); }; Map.prototype.sort = function(comparator) { // Late binding return OrderedMap(sortFactory(this, comparator)); }; Map.prototype.sortBy = function(mapper, comparator) { // Late binding return OrderedMap(sortFactory(this, comparator, mapper)); }; // @pragma Mutability Map.prototype.withMutations = function(fn) { var mutable = this.asMutable(); fn(mutable); return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this; }; Map.prototype.asMutable = function() { return this.__ownerID ? this : this.__ensureOwner(new OwnerID()); }; Map.prototype.asImmutable = function() { return this.__ensureOwner(); }; Map.prototype.wasAltered = function() { return this.__altered; }; Map.prototype.__iterator = function(type, reverse) { return new MapIterator(this, type, reverse); }; Map.prototype.__iterate = function(fn, reverse) {var this$0 = this; var iterations = 0; this._root && this._root.iterate(function(entry ) { iterations++; return fn(entry[1], entry[0], this$0); }, reverse); return iterations; }; Map.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) { return this; } if (!ownerID) { this.__ownerID = ownerID; this.__altered = false; return this; } return makeMap(this.size, this._root, ownerID, this.__hash); }; function isMap(maybeMap) { return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]); } Map.isMap = isMap; var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@'; var MapPrototype = Map.prototype; MapPrototype[IS_MAP_SENTINEL] = true; MapPrototype[DELETE] = MapPrototype.remove; MapPrototype.removeIn = MapPrototype.deleteIn; // #pragma Trie Nodes function ArrayMapNode(ownerID, entries) { this.ownerID = ownerID; this.entries = entries; } ArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) { var entries = this.entries; for (var ii = 0, len = entries.length; ii < len; ii++) { if (is(key, entries[ii][0])) { return entries[ii][1]; } } return notSetValue; }; ArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { var removed = value === NOT_SET; var entries = this.entries; var idx = 0; for (var len = entries.length; idx < len; idx++) { if (is(key, entries[idx][0])) { break; } } var exists = idx < len; if (exists ? entries[idx][1] === value : removed) { return this; } SetRef(didAlter); (removed || !exists) && SetRef(didChangeSize); if (removed && entries.length === 1) { return; // undefined } if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) { return createNodes(ownerID, entries, key, value); } var isEditable = ownerID && ownerID === this.ownerID; var newEntries = isEditable ? entries : arrCopy(entries); if (exists) { if (removed) { idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop()); } else { newEntries[idx] = [key, value]; } } else { newEntries.push([key, value]); } if (isEditable) { this.entries = newEntries; return this; } return new ArrayMapNode(ownerID, newEntries); }; function BitmapIndexedNode(ownerID, bitmap, nodes) { this.ownerID = ownerID; this.bitmap = bitmap; this.nodes = nodes; } BitmapIndexedNode.prototype.get = function(shift, keyHash, key, notSetValue) { if (keyHash === undefined) { keyHash = hash(key); } var bit = (1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK)); var bitmap = this.bitmap; return (bitmap & bit) === 0 ? notSetValue : this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, keyHash, key, notSetValue); }; BitmapIndexedNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { if (keyHash === undefined) { keyHash = hash(key); } var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; var bit = 1 << keyHashFrag; var bitmap = this.bitmap; var exists = (bitmap & bit) !== 0; if (!exists && value === NOT_SET) { return this; } var idx = popCount(bitmap & (bit - 1)); var nodes = this.nodes; var node = exists ? nodes[idx] : undefined; var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter); if (newNode === node) { return this; } if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) { return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode); } if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) { return nodes[idx ^ 1]; } if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) { return newNode; } var isEditable = ownerID && ownerID === this.ownerID; var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit; var newNodes = exists ? newNode ? setIn(nodes, idx, newNode, isEditable) : spliceOut(nodes, idx, isEditable) : spliceIn(nodes, idx, newNode, isEditable); if (isEditable) { this.bitmap = newBitmap; this.nodes = newNodes; return this; } return new BitmapIndexedNode(ownerID, newBitmap, newNodes); }; function HashArrayMapNode(ownerID, count, nodes) { this.ownerID = ownerID; this.count = count; this.nodes = nodes; } HashArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) { if (keyHash === undefined) { keyHash = hash(key); } var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; var node = this.nodes[idx]; return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue; }; HashArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { if (keyHash === undefined) { keyHash = hash(key); } var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; var removed = value === NOT_SET; var nodes = this.nodes; var node = nodes[idx]; if (removed && !node) { return this; } var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter); if (newNode === node) { return this; } var newCount = this.count; if (!node) { newCount++; } else if (!newNode) { newCount--; if (newCount < MIN_HASH_ARRAY_MAP_SIZE) { return packNodes(ownerID, nodes, newCount, idx); } } var isEditable = ownerID && ownerID === this.ownerID; var newNodes = setIn(nodes, idx, newNode, isEditable); if (isEditable) { this.count = newCount; this.nodes = newNodes; return this; } return new HashArrayMapNode(ownerID, newCount, newNodes); }; function HashCollisionNode(ownerID, keyHash, entries) { this.ownerID = ownerID; this.keyHash = keyHash; this.entries = entries; } HashCollisionNode.prototype.get = function(shift, keyHash, key, notSetValue) { var entries = this.entries; for (var ii = 0, len = entries.length; ii < len; ii++) { if (is(key, entries[ii][0])) { return entries[ii][1]; } } return notSetValue; }; HashCollisionNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { if (keyHash === undefined) { keyHash = hash(key); } var removed = value === NOT_SET; if (keyHash !== this.keyHash) { if (removed) { return this; } SetRef(didAlter); SetRef(didChangeSize); return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]); } var entries = this.entries; var idx = 0; for (var len = entries.length; idx < len; idx++) { if (is(key, entries[idx][0])) { break; } } var exists = idx < len; if (exists ? entries[idx][1] === value : removed) { return this; } SetRef(didAlter); (removed || !exists) && SetRef(didChangeSize); if (removed && len === 2) { return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]); } var isEditable = ownerID && ownerID === this.ownerID; var newEntries = isEditable ? entries : arrCopy(entries); if (exists) { if (removed) { idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop()); } else { newEntries[idx] = [key, value]; } } else { newEntries.push([key, value]); } if (isEditable) { this.entries = newEntries; return this; } return new HashCollisionNode(ownerID, this.keyHash, newEntries); }; function ValueNode(ownerID, keyHash, entry) { this.ownerID = ownerID; this.keyHash = keyHash; this.entry = entry; } ValueNode.prototype.get = function(shift, keyHash, key, notSetValue) { return is(key, this.entry[0]) ? this.entry[1] : notSetValue; }; ValueNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { var removed = value === NOT_SET; var keyMatch = is(key, this.entry[0]); if (keyMatch ? value === this.entry[1] : removed) { return this; } SetRef(didAlter); if (removed) { SetRef(didChangeSize); return; // undefined } if (keyMatch) { if (ownerID && ownerID === this.ownerID) { this.entry[1] = value; return this; } return new ValueNode(ownerID, this.keyHash, [key, value]); } SetRef(didChangeSize); return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]); }; // #pragma Iterators ArrayMapNode.prototype.iterate = HashCollisionNode.prototype.iterate = function (fn, reverse) { var entries = this.entries; for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) { if (fn(entries[reverse ? maxIndex - ii : ii]) === false) { return false; } } } BitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate = function (fn, reverse) { var nodes = this.nodes; for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) { var node = nodes[reverse ? maxIndex - ii : ii]; if (node && node.iterate(fn, reverse) === false) { return false; } } } ValueNode.prototype.iterate = function (fn, reverse) { return fn(this.entry); } createClass(MapIterator, Iterator); function MapIterator(map, type, reverse) { this._type = type; this._reverse = reverse; this._stack = map._root && mapIteratorFrame(map._root); } MapIterator.prototype.next = function() { var type = this._type; var stack = this._stack; while (stack) { var node = stack.node; var index = stack.index++; var maxIndex; if (node.entry) { if (index === 0) { return mapIteratorValue(type, node.entry); } } else if (node.entries) { maxIndex = node.entries.length - 1; if (index <= maxIndex) { return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]); } } else { maxIndex = node.nodes.length - 1; if (index <= maxIndex) { var subNode = node.nodes[this._reverse ? maxIndex - index : index]; if (subNode) { if (subNode.entry) { return mapIteratorValue(type, subNode.entry); } stack = this._stack = mapIteratorFrame(subNode, stack); } continue; } } stack = this._stack = this._stack.__prev; } return iteratorDone(); }; function mapIteratorValue(type, entry) { return iteratorValue(type, entry[0], entry[1]); } function mapIteratorFrame(node, prev) { return { node: node, index: 0, __prev: prev }; } function makeMap(size, root, ownerID, hash) { var map = Object.create(MapPrototype); map.size = size; map._root = root; map.__ownerID = ownerID; map.__hash = hash; map.__altered = false; return map; } var EMPTY_MAP; function emptyMap() { return EMPTY_MAP || (EMPTY_MAP = makeMap(0)); } function updateMap(map, k, v) { var newRoot; var newSize; if (!map._root) { if (v === NOT_SET) { return map; } newSize = 1; newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]); } else { var didChangeSize = MakeRef(CHANGE_LENGTH); var didAlter = MakeRef(DID_ALTER); newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter); if (!didAlter.value) { return map; } newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0); } if (map.__ownerID) { map.size = newSize; map._root = newRoot; map.__hash = undefined; map.__altered = true; return map; } return newRoot ? makeMap(newSize, newRoot) : emptyMap(); } function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { if (!node) { if (value === NOT_SET) { return node; } SetRef(didAlter); SetRef(didChangeSize); return new ValueNode(ownerID, keyHash, [key, value]); } return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter); } function isLeafNode(node) { return node.constructor === ValueNode || node.constructor === HashCollisionNode; } function mergeIntoNode(node, ownerID, shift, keyHash, entry) { if (node.keyHash === keyHash) { return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]); } var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK; var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; var newNode; var nodes = idx1 === idx2 ? [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] : ((newNode = new ValueNode(ownerID, keyHash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]); return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes); } function createNodes(ownerID, entries, key, value) { if (!ownerID) { ownerID = new OwnerID(); } var node = new ValueNode(ownerID, hash(key), [key, value]); for (var ii = 0; ii < entries.length; ii++) { var entry = entries[ii]; node = node.update(ownerID, 0, undefined, entry[0], entry[1]); } return node; } function packNodes(ownerID, nodes, count, excluding) { var bitmap = 0; var packedII = 0; var packedNodes = new Array(count); for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) { var node = nodes[ii]; if (node !== undefined && ii !== excluding) { bitmap |= bit; packedNodes[packedII++] = node; } } return new BitmapIndexedNode(ownerID, bitmap, packedNodes); } function expandNodes(ownerID, nodes, bitmap, including, node) { var count = 0; var expandedNodes = new Array(SIZE); for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) { expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined; } expandedNodes[including] = node; return new HashArrayMapNode(ownerID, count + 1, expandedNodes); } function mergeIntoMapWith(map, merger, iterables) { var iters = []; for (var ii = 0; ii < iterables.length; ii++) { var value = iterables[ii]; var iter = KeyedIterable(value); if (!isIterable(value)) { iter = iter.map(function(v ) {return fromJS(v)}); } iters.push(iter); } return mergeIntoCollectionWith(map, merger, iters); } function deepMerger(existing, value, key) { return existing && existing.mergeDeep && isIterable(value) ? existing.mergeDeep(value) : is(existing, value) ? existing : value; } function deepMergerWith(merger) { return function(existing, value, key) { if (existing && existing.mergeDeepWith && isIterable(value)) { return existing.mergeDeepWith(merger, value); } var nextValue = merger(existing, value, key); return is(existing, nextValue) ? existing : nextValue; }; } function mergeIntoCollectionWith(collection, merger, iters) { iters = iters.filter(function(x ) {return x.size !== 0}); if (iters.length === 0) { return collection; } if (collection.size === 0 && !collection.__ownerID && iters.length === 1) { return collection.constructor(iters[0]); } return collection.withMutations(function(collection ) { var mergeIntoMap = merger ? function(value, key) { collection.update(key, NOT_SET, function(existing ) {return existing === NOT_SET ? value : merger(existing, value, key)} ); } : function(value, key) { collection.set(key, value); } for (var ii = 0; ii < iters.length; ii++) { iters[ii].forEach(mergeIntoMap); } }); } function updateInDeepMap(existing, keyPathIter, notSetValue, updater) { var isNotSet = existing === NOT_SET; var step = keyPathIter.next(); if (step.done) { var existingValue = isNotSet ? notSetValue : existing; var newValue = updater(existingValue); return newValue === existingValue ? existing : newValue; } invariant( isNotSet || (existing && existing.set), 'invalid keyPath' ); var key = step.value; var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET); var nextUpdated = updateInDeepMap( nextExisting, keyPathIter, notSetValue, updater ); return nextUpdated === nextExisting ? existing : nextUpdated === NOT_SET ? existing.remove(key) : (isNotSet ? emptyMap() : existing).set(key, nextUpdated); } function popCount(x) { x = x - ((x >> 1) & 0x55555555); x = (x & 0x33333333) + ((x >> 2) & 0x33333333); x = (x + (x >> 4)) & 0x0f0f0f0f; x = x + (x >> 8); x = x + (x >> 16); return x & 0x7f; } function setIn(array, idx, val, canEdit) { var newArray = canEdit ? array : arrCopy(array); newArray[idx] = val; return newArray; } function spliceIn(array, idx, val, canEdit) { var newLen = array.length + 1; if (canEdit && idx + 1 === newLen) { array[idx] = val; return array; } var newArray = new Array(newLen); var after = 0; for (var ii = 0; ii < newLen; ii++) { if (ii === idx) { newArray[ii] = val; after = -1; } else { newArray[ii] = array[ii + after]; } } return newArray; } function spliceOut(array, idx, canEdit) { var newLen = array.length - 1; if (canEdit && idx === newLen) { array.pop(); return array; } var newArray = new Array(newLen); var after = 0; for (var ii = 0; ii < newLen; ii++) { if (ii === idx) { after = 1; } newArray[ii] = array[ii + after]; } return newArray; } var MAX_ARRAY_MAP_SIZE = SIZE / 4; var MAX_BITMAP_INDEXED_SIZE = SIZE / 2; var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4; createClass(List, IndexedCollection); // @pragma Construction function List(value) { var empty = emptyList(); if (value === null || value === undefined) { return empty; } if (isList(value)) { return value; } var iter = IndexedIterable(value); var size = iter.size; if (size === 0) { return empty; } assertNotInfinite(size); if (size > 0 && size < SIZE) { return makeList(0, size, SHIFT, null, new VNode(iter.toArray())); } return empty.withMutations(function(list ) { list.setSize(size); iter.forEach(function(v, i) {return list.set(i, v)}); }); } List.of = function(/*...values*/) { return this(arguments); }; List.prototype.toString = function() { return this.__toString('List [', ']'); }; // @pragma Access List.prototype.get = function(index, notSetValue) { index = wrapIndex(this, index); if (index >= 0 && index < this.size) { index += this._origin; var node = listNodeFor(this, index); return node && node.array[index & MASK]; } return notSetValue; }; // @pragma Modification List.prototype.set = function(index, value) { return updateList(this, index, value); }; List.prototype.remove = function(index) { return !this.has(index) ? this : index === 0 ? this.shift() : index === this.size - 1 ? this.pop() : this.splice(index, 1); }; List.prototype.insert = function(index, value) { return this.splice(index, 0, value); }; List.prototype.clear = function() { if (this.size === 0) { return this; } if (this.__ownerID) { this.size = this._origin = this._capacity = 0; this._level = SHIFT; this._root = this._tail = null; this.__hash = undefined; this.__altered = true; return this; } return emptyList(); }; List.prototype.push = function(/*...values*/) { var values = arguments; var oldSize = this.size; return this.withMutations(function(list ) { setListBounds(list, 0, oldSize + values.length); for (var ii = 0; ii < values.length; ii++) { list.set(oldSize + ii, values[ii]); } }); }; List.prototype.pop = function() { return setListBounds(this, 0, -1); }; List.prototype.unshift = function(/*...values*/) { var values = arguments; return this.withMutations(function(list ) { setListBounds(list, -values.length); for (var ii = 0; ii < values.length; ii++) { list.set(ii, values[ii]); } }); }; List.prototype.shift = function() { return setListBounds(this, 1); }; // @pragma Composition List.prototype.merge = function(/*...iters*/) { return mergeIntoListWith(this, undefined, arguments); }; List.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1); return mergeIntoListWith(this, merger, iters); }; List.prototype.mergeDeep = function(/*...iters*/) { return mergeIntoListWith(this, deepMerger, arguments); }; List.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1); return mergeIntoListWith(this, deepMergerWith(merger), iters); }; List.prototype.setSize = function(size) { return setListBounds(this, 0, size); }; // @pragma Iteration List.prototype.slice = function(begin, end) { var size = this.size; if (wholeSlice(begin, end, size)) { return this; } return setListBounds( this, resolveBegin(begin, size), resolveEnd(end, size) ); }; List.prototype.__iterator = function(type, reverse) { var index = 0; var values = iterateList(this, reverse); return new Iterator(function() { var value = values(); return value === DONE ? iteratorDone() : iteratorValue(type, index++, value); }); }; List.prototype.__iterate = function(fn, reverse) { var index = 0; var values = iterateList(this, reverse); var value; while ((value = values()) !== DONE) { if (fn(value, index++, this) === false) { break; } } return index; }; List.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) { return this; } if (!ownerID) { this.__ownerID = ownerID; return this; } return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash); }; function isList(maybeList) { return !!(maybeList && maybeList[IS_LIST_SENTINEL]); } List.isList = isList; var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@'; var ListPrototype = List.prototype; ListPrototype[IS_LIST_SENTINEL] = true; ListPrototype[DELETE] = ListPrototype.remove; ListPrototype.setIn = MapPrototype.setIn; ListPrototype.deleteIn = ListPrototype.removeIn = MapPrototype.removeIn; ListPrototype.update = MapPrototype.update; ListPrototype.updateIn = MapPrototype.updateIn; ListPrototype.mergeIn = MapPrototype.mergeIn; ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn; ListPrototype.withMutations = MapPrototype.withMutations; ListPrototype.asMutable = MapPrototype.asMutable; ListPrototype.asImmutable = MapPrototype.asImmutable; ListPrototype.wasAltered = MapPrototype.wasAltered; function VNode(array, ownerID) { this.array = array; this.ownerID = ownerID; } // TODO: seems like these methods are very similar VNode.prototype.removeBefore = function(ownerID, level, index) { if (index === level ? 1 << level : 0 || this.array.length === 0) { return this; } var originIndex = (index >>> level) & MASK; if (originIndex >= this.array.length) { return new VNode([], ownerID); } var removingFirst = originIndex === 0; var newChild; if (level > 0) { var oldChild = this.array[originIndex]; newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index); if (newChild === oldChild && removingFirst) { return this; } } if (removingFirst && !newChild) { return this; } var editable = editableVNode(this, ownerID); if (!removingFirst) { for (var ii = 0; ii < originIndex; ii++) { editable.array[ii] = undefined; } } if (newChild) { editable.array[originIndex] = newChild; } return editable; }; VNode.prototype.removeAfter = function(ownerID, level, index) { if (index === (level ? 1 << level : 0) || this.array.length === 0) { return this; } var sizeIndex = ((index - 1) >>> level) & MASK; if (sizeIndex >= this.array.length) { return this; } var newChild; if (level > 0) { var oldChild = this.array[sizeIndex]; newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index); if (newChild === oldChild && sizeIndex === this.array.length - 1) { return this; } } var editable = editableVNode(this, ownerID); editable.array.splice(sizeIndex + 1); if (newChild) { editable.array[sizeIndex] = newChild; } return editable; }; var DONE = {}; function iterateList(list, reverse) { var left = list._origin; var right = list._capacity; var tailPos = getTailOffset(right); var tail = list._tail; return iterateNodeOrLeaf(list._root, list._level, 0); function iterateNodeOrLeaf(node, level, offset) { return level === 0 ? iterateLeaf(node, offset) : iterateNode(node, level, offset); } function iterateLeaf(node, offset) { var array = offset === tailPos ? tail && tail.array : node && node.array; var from = offset > left ? 0 : left - offset; var to = right - offset; if (to > SIZE) { to = SIZE; } return function() { if (from === to) { return DONE; } var idx = reverse ? --to : from++; return array && array[idx]; }; } function iterateNode(node, level, offset) { var values; var array = node && node.array; var from = offset > left ? 0 : (left - offset) >> level; var to = ((right - offset) >> level) + 1; if (to > SIZE) { to = SIZE; } return function() { do { if (values) { var value = values(); if (value !== DONE) { return value; } values = null; } if (from === to) { return DONE; } var idx = reverse ? --to : from++; values = iterateNodeOrLeaf( array && array[idx], level - SHIFT, offset + (idx << level) ); } while (true); }; } } function makeList(origin, capacity, level, root, tail, ownerID, hash) { var list = Object.create(ListPrototype); list.size = capacity - origin; list._origin = origin; list._capacity = capacity; list._level = level; list._root = root; list._tail = tail; list.__ownerID = ownerID; list.__hash = hash; list.__altered = false; return list; } var EMPTY_LIST; function emptyList() { return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT)); } function updateList(list, index, value) { index = wrapIndex(list, index); if (index !== index) { return list; } if (index >= list.size || index < 0) { return list.withMutations(function(list ) { index < 0 ? setListBounds(list, index).set(0, value) : setListBounds(list, 0, index + 1).set(index, value) }); } index += list._origin; var newTail = list._tail; var newRoot = list._root; var didAlter = MakeRef(DID_ALTER); if (index >= getTailOffset(list._capacity)) { newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter); } else { newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter); } if (!didAlter.value) { return list; } if (list.__ownerID) { list._root = newRoot; list._tail = newTail; list.__hash = undefined; list.__altered = true; return list; } return makeList(list._origin, list._capacity, list._level, newRoot, newTail); } function updateVNode(node, ownerID, level, index, value, didAlter) { var idx = (index >>> level) & MASK; var nodeHas = node && idx < node.array.length; if (!nodeHas && value === undefined) { return node; } var newNode; if (level > 0) { var lowerNode = node && node.array[idx]; var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter); if (newLowerNode === lowerNode) { return node; } newNode = editableVNode(node, ownerID); newNode.array[idx] = newLowerNode; return newNode; } if (nodeHas && node.array[idx] === value) { return node; } SetRef(didAlter); newNode = editableVNode(node, ownerID); if (value === undefined && idx === newNode.array.length - 1) { newNode.array.pop(); } else { newNode.array[idx] = value; } return newNode; } function editableVNode(node, ownerID) { if (ownerID && node && ownerID === node.ownerID) { return node; } return new VNode(node ? node.array.slice() : [], ownerID); } function listNodeFor(list, rawIndex) { if (rawIndex >= getTailOffset(list._capacity)) { return list._tail; } if (rawIndex < 1 << (list._level + SHIFT)) { var node = list._root; var level = list._level; while (node && level > 0) { node = node.array[(rawIndex >>> level) & MASK]; level -= SHIFT; } return node; } } function setListBounds(list, begin, end) { // Sanitize begin & end using this shorthand for ToInt32(argument) // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 if (begin !== undefined) { begin = begin | 0; } if (end !== undefined) { end = end | 0; } var owner = list.__ownerID || new OwnerID(); var oldOrigin = list._origin; var oldCapacity = list._capacity; var newOrigin = oldOrigin + begin; var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end; if (newOrigin === oldOrigin && newCapacity === oldCapacity) { return list; } // If it's going to end after it starts, it's empty. if (newOrigin >= newCapacity) { return list.clear(); } var newLevel = list._level; var newRoot = list._root; // New origin might need creating a higher root. var offsetShift = 0; while (newOrigin + offsetShift < 0) { newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner); newLevel += SHIFT; offsetShift += 1 << newLevel; } if (offsetShift) { newOrigin += offsetShift; oldOrigin += offsetShift; newCapacity += offsetShift; oldCapacity += offsetShift; } var oldTailOffset = getTailOffset(oldCapacity); var newTailOffset = getTailOffset(newCapacity); // New size might need creating a higher root. while (newTailOffset >= 1 << (newLevel + SHIFT)) { newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner); newLevel += SHIFT; } // Locate or create the new tail. var oldTail = list._tail; var newTail = newTailOffset < oldTailOffset ? listNodeFor(list, newCapacity - 1) : newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail; // Merge Tail into tree. if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) { newRoot = editableVNode(newRoot, owner); var node = newRoot; for (var level = newLevel; level > SHIFT; level -= SHIFT) { var idx = (oldTailOffset >>> level) & MASK; node = node.array[idx] = editableVNode(node.array[idx], owner); } node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail; } // If the size has been reduced, there's a chance the tail needs to be trimmed. if (newCapacity < oldCapacity) { newTail = newTail && newTail.removeAfter(owner, 0, newCapacity); } // If the new origin is within the tail, then we do not need a root. if (newOrigin >= newTailOffset) { newOrigin -= newTailOffset; newCapacity -= newTailOffset; newLevel = SHIFT; newRoot = null; newTail = newTail && newTail.removeBefore(owner, 0, newOrigin); // Otherwise, if the root has been trimmed, garbage collect. } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) { offsetShift = 0; // Identify the new top root node of the subtree of the old root. while (newRoot) { var beginIndex = (newOrigin >>> newLevel) & MASK; if (beginIndex !== (newTailOffset >>> newLevel) & MASK) { break; } if (beginIndex) { offsetShift += (1 << newLevel) * beginIndex; } newLevel -= SHIFT; newRoot = newRoot.array[beginIndex]; } // Trim the new sides of the new root. if (newRoot && newOrigin > oldOrigin) { newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift); } if (newRoot && newTailOffset < oldTailOffset) { newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift); } if (offsetShift) { newOrigin -= offsetShift; newCapacity -= offsetShift; } } if (list.__ownerID) { list.size = newCapacity - newOrigin; list._origin = newOrigin; list._capacity = newCapacity; list._level = newLevel; list._root = newRoot; list._tail = newTail; list.__hash = undefined; list.__altered = true; return list; } return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail); } function mergeIntoListWith(list, merger, iterables) { var iters = []; var maxSize = 0; for (var ii = 0; ii < iterables.length; ii++) { var value = iterables[ii]; var iter = IndexedIterable(value); if (iter.size > maxSize) { maxSize = iter.size; } if (!isIterable(value)) { iter = iter.map(function(v ) {return fromJS(v)}); } iters.push(iter); } if (maxSize > list.size) { list = list.setSize(maxSize); } return mergeIntoCollectionWith(list, merger, iters); } function getTailOffset(size) { return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT); } createClass(OrderedMap, Map); // @pragma Construction function OrderedMap(value) { return value === null || value === undefined ? emptyOrderedMap() : isOrderedMap(value) ? value : emptyOrderedMap().withMutations(function(map ) { var iter = KeyedIterable(value); assertNotInfinite(iter.size); iter.forEach(function(v, k) {return map.set(k, v)}); }); } OrderedMap.of = function(/*...values*/) { return this(arguments); }; OrderedMap.prototype.toString = function() { return this.__toString('OrderedMap {', '}'); }; // @pragma Access OrderedMap.prototype.get = function(k, notSetValue) { var index = this._map.get(k); return index !== undefined ? this._list.get(index)[1] : notSetValue; }; // @pragma Modification OrderedMap.prototype.clear = function() { if (this.size === 0) { return this; } if (this.__ownerID) { this.size = 0; this._map.clear(); this._list.clear(); return this; } return emptyOrderedMap(); }; OrderedMap.prototype.set = function(k, v) { return updateOrderedMap(this, k, v); }; OrderedMap.prototype.remove = function(k) { return updateOrderedMap(this, k, NOT_SET); }; OrderedMap.prototype.wasAltered = function() { return this._map.wasAltered() || this._list.wasAltered(); }; OrderedMap.prototype.__iterate = function(fn, reverse) {var this$0 = this; return this._list.__iterate( function(entry ) {return entry && fn(entry[1], entry[0], this$0)}, reverse ); }; OrderedMap.prototype.__iterator = function(type, reverse) { return this._list.fromEntrySeq().__iterator(type, reverse); }; OrderedMap.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) { return this; } var newMap = this._map.__ensureOwner(ownerID); var newList = this._list.__ensureOwner(ownerID); if (!ownerID) { this.__ownerID = ownerID; this._map = newMap; this._list = newList; return this; } return makeOrderedMap(newMap, newList, ownerID, this.__hash); }; function isOrderedMap(maybeOrderedMap) { return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap); } OrderedMap.isOrderedMap = isOrderedMap; OrderedMap.prototype[IS_ORDERED_SENTINEL] = true; OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove; function makeOrderedMap(map, list, ownerID, hash) { var omap = Object.create(OrderedMap.prototype); omap.size = map ? map.size : 0; omap._map = map; omap._list = list; omap.__ownerID = ownerID; omap.__hash = hash; return omap; } var EMPTY_ORDERED_MAP; function emptyOrderedMap() { return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList())); } function updateOrderedMap(omap, k, v) { var map = omap._map; var list = omap._list; var i = map.get(k); var has = i !== undefined; var newMap; var newList; if (v === NOT_SET) { // removed if (!has) { return omap; } if (list.size >= SIZE && list.size >= map.size * 2) { newList = list.filter(function(entry, idx) {return entry !== undefined && i !== idx}); newMap = newList.toKeyedSeq().map(function(entry ) {return entry[0]}).flip().toMap(); if (omap.__ownerID) { newMap.__ownerID = newList.__ownerID = omap.__ownerID; } } else { newMap = map.remove(k); newList = i === list.size - 1 ? list.pop() : list.set(i, undefined); } } else { if (has) { if (v === list.get(i)[1]) { return omap; } newMap = map; newList = list.set(i, [k, v]); } else { newMap = map.set(k, list.size); newList = list.set(list.size, [k, v]); } } if (omap.__ownerID) { omap.size = newMap.size; omap._map = newMap; omap._list = newList; omap.__hash = undefined; return omap; } return makeOrderedMap(newMap, newList); } createClass(ToKeyedSequence, KeyedSeq); function ToKeyedSequence(indexed, useKeys) { this._iter = indexed; this._useKeys = useKeys; this.size = indexed.size; } ToKeyedSequence.prototype.get = function(key, notSetValue) { return this._iter.get(key, notSetValue); }; ToKeyedSequence.prototype.has = function(key) { return this._iter.has(key); }; ToKeyedSequence.prototype.valueSeq = function() { return this._iter.valueSeq(); }; ToKeyedSequence.prototype.reverse = function() {var this$0 = this; var reversedSequence = reverseFactory(this, true); if (!this._useKeys) { reversedSequence.valueSeq = function() {return this$0._iter.toSeq().reverse()}; } return reversedSequence; }; ToKeyedSequence.prototype.map = function(mapper, context) {var this$0 = this; var mappedSequence = mapFactory(this, mapper, context); if (!this._useKeys) { mappedSequence.valueSeq = function() {return this$0._iter.toSeq().map(mapper, context)}; } return mappedSequence; }; ToKeyedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; var ii; return this._iter.__iterate( this._useKeys ? function(v, k) {return fn(v, k, this$0)} : ((ii = reverse ? resolveSize(this) : 0), function(v ) {return fn(v, reverse ? --ii : ii++, this$0)}), reverse ); }; ToKeyedSequence.prototype.__iterator = function(type, reverse) { if (this._useKeys) { return this._iter.__iterator(type, reverse); } var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); var ii = reverse ? resolveSize(this) : 0; return new Iterator(function() { var step = iterator.next(); return step.done ? step : iteratorValue(type, reverse ? --ii : ii++, step.value, step); }); }; ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true; createClass(ToIndexedSequence, IndexedSeq); function ToIndexedSequence(iter) { this._iter = iter; this.size = iter.size; } ToIndexedSequence.prototype.includes = function(value) { return this._iter.includes(value); }; ToIndexedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; var iterations = 0; return this._iter.__iterate(function(v ) {return fn(v, iterations++, this$0)}, reverse); }; ToIndexedSequence.prototype.__iterator = function(type, reverse) { var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); var iterations = 0; return new Iterator(function() { var step = iterator.next(); return step.done ? step : iteratorValue(type, iterations++, step.value, step) }); }; createClass(ToSetSequence, SetSeq); function ToSetSequence(iter) { this._iter = iter; this.size = iter.size; } ToSetSequence.prototype.has = function(key) { return this._iter.includes(key); }; ToSetSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; return this._iter.__iterate(function(v ) {return fn(v, v, this$0)}, reverse); }; ToSetSequence.prototype.__iterator = function(type, reverse) { var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); return new Iterator(function() { var step = iterator.next(); return step.done ? step : iteratorValue(type, step.value, step.value, step); }); }; createClass(FromEntriesSequence, KeyedSeq); function FromEntriesSequence(entries) { this._iter = entries; this.size = entries.size; } FromEntriesSequence.prototype.entrySeq = function() { return this._iter.toSeq(); }; FromEntriesSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; return this._iter.__iterate(function(entry ) { // Check if entry exists first so array access doesn't throw for holes // in the parent iteration. if (entry) { validateEntry(entry); var indexedIterable = isIterable(entry); return fn( indexedIterable ? entry.get(1) : entry[1], indexedIterable ? entry.get(0) : entry[0], this$0 ); } }, reverse); }; FromEntriesSequence.prototype.__iterator = function(type, reverse) { var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); return new Iterator(function() { while (true) { var step = iterator.next(); if (step.done) { return step; } var entry = step.value; // Check if entry exists first so array access doesn't throw for holes // in the parent iteration. if (entry) { validateEntry(entry); var indexedIterable = isIterable(entry); return iteratorValue( type, indexedIterable ? entry.get(0) : entry[0], indexedIterable ? entry.get(1) : entry[1], step ); } } }); }; ToIndexedSequence.prototype.cacheResult = ToKeyedSequence.prototype.cacheResult = ToSetSequence.prototype.cacheResult = FromEntriesSequence.prototype.cacheResult = cacheResultThrough; function flipFactory(iterable) { var flipSequence = makeSequence(iterable); flipSequence._iter = iterable; flipSequence.size = iterable.size; flipSequence.flip = function() {return iterable}; flipSequence.reverse = function () { var reversedSequence = iterable.reverse.apply(this); // super.reverse() reversedSequence.flip = function() {return iterable.reverse()}; return reversedSequence; }; flipSequence.has = function(key ) {return iterable.includes(key)}; flipSequence.includes = function(key ) {return iterable.has(key)}; flipSequence.cacheResult = cacheResultThrough; flipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; return iterable.__iterate(function(v, k) {return fn(k, v, this$0) !== false}, reverse); } flipSequence.__iteratorUncached = function(type, reverse) { if (type === ITERATE_ENTRIES) { var iterator = iterable.__iterator(type, reverse); return new Iterator(function() { var step = iterator.next(); if (!step.done) { var k = step.value[0]; step.value[0] = step.value[1]; step.value[1] = k; } return step; }); } return iterable.__iterator( type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, reverse ); } return flipSequence; } function mapFactory(iterable, mapper, context) { var mappedSequence = makeSequence(iterable); mappedSequence.size = iterable.size; mappedSequence.has = function(key ) {return iterable.has(key)}; mappedSequence.get = function(key, notSetValue) { var v = iterable.get(key, NOT_SET); return v === NOT_SET ? notSetValue : mapper.call(context, v, key, iterable); }; mappedSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; return iterable.__iterate( function(v, k, c) {return fn(mapper.call(context, v, k, c), k, this$0) !== false}, reverse ); } mappedSequence.__iteratorUncached = function (type, reverse) { var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); return new Iterator(function() { var step = iterator.next(); if (step.done) { return step; } var entry = step.value; var key = entry[0]; return iteratorValue( type, key, mapper.call(context, entry[1], key, iterable), step ); }); } return mappedSequence; } function reverseFactory(iterable, useKeys) { var reversedSequence = makeSequence(iterable); reversedSequence._iter = iterable; reversedSequence.size = iterable.size; reversedSequence.reverse = function() {return iterable}; if (iterable.flip) { reversedSequence.flip = function () { var flipSequence = flipFactory(iterable); flipSequence.reverse = function() {return iterable.flip()}; return flipSequence; }; } reversedSequence.get = function(key, notSetValue) {return iterable.get(useKeys ? key : -1 - key, notSetValue)}; reversedSequence.has = function(key ) {return iterable.has(useKeys ? key : -1 - key)}; reversedSequence.includes = function(value ) {return iterable.includes(value)}; reversedSequence.cacheResult = cacheResultThrough; reversedSequence.__iterate = function (fn, reverse) {var this$0 = this; return iterable.__iterate(function(v, k) {return fn(v, k, this$0)}, !reverse); }; reversedSequence.__iterator = function(type, reverse) {return iterable.__iterator(type, !reverse)}; return reversedSequence; } function filterFactory(iterable, predicate, context, useKeys) { var filterSequence = makeSequence(iterable); if (useKeys) { filterSequence.has = function(key ) { var v = iterable.get(key, NOT_SET); return v !== NOT_SET && !!predicate.call(context, v, key, iterable); }; filterSequence.get = function(key, notSetValue) { var v = iterable.get(key, NOT_SET); return v !== NOT_SET && predicate.call(context, v, key, iterable) ? v : notSetValue; }; } filterSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; var iterations = 0; iterable.__iterate(function(v, k, c) { if (predicate.call(context, v, k, c)) { iterations++; return fn(v, useKeys ? k : iterations - 1, this$0); } }, reverse); return iterations; }; filterSequence.__iteratorUncached = function (type, reverse) { var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); var iterations = 0; return new Iterator(function() { while (true) { var step = iterator.next(); if (step.done) { return step; } var entry = step.value; var key = entry[0]; var value = entry[1]; if (predicate.call(context, value, key, iterable)) { return iteratorValue(type, useKeys ? key : iterations++, value, step); } } }); } return filterSequence; } function countByFactory(iterable, grouper, context) { var groups = Map().asMutable(); iterable.__iterate(function(v, k) { groups.update( grouper.call(context, v, k, iterable), 0, function(a ) {return a + 1} ); }); return groups.asImmutable(); } function groupByFactory(iterable, grouper, context) { var isKeyedIter = isKeyed(iterable); var groups = (isOrdered(iterable) ? OrderedMap() : Map()).asMutable(); iterable.__iterate(function(v, k) { groups.update( grouper.call(context, v, k, iterable), function(a ) {return (a = a || [], a.push(isKeyedIter ? [k, v] : v), a)} ); }); var coerce = iterableClass(iterable); return groups.map(function(arr ) {return reify(iterable, coerce(arr))}); } function sliceFactory(iterable, begin, end, useKeys) { var originalSize = iterable.size; // Sanitize begin & end using this shorthand for ToInt32(argument) // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 if (begin !== undefined) { begin = begin | 0; } if (end !== undefined) { if (end === Infinity) { end = originalSize; } else { end = end | 0; } } if (wholeSlice(begin, end, originalSize)) { return iterable; } var resolvedBegin = resolveBegin(begin, originalSize); var resolvedEnd = resolveEnd(end, originalSize); // begin or end will be NaN if they were provided as negative numbers and // this iterable's size is unknown. In that case, cache first so there is // a known size and these do not resolve to NaN. if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) { return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys); } // Note: resolvedEnd is undefined when the original sequence's length is // unknown and this slice did not supply an end and should contain all // elements after resolvedBegin. // In that case, resolvedSize will be NaN and sliceSize will remain undefined. var resolvedSize = resolvedEnd - resolvedBegin; var sliceSize; if (resolvedSize === resolvedSize) { sliceSize = resolvedSize < 0 ? 0 : resolvedSize; } var sliceSeq = makeSequence(iterable); // If iterable.size is undefined, the size of the realized sliceSeq is // unknown at this point unless the number of items to slice is 0 sliceSeq.size = sliceSize === 0 ? sliceSize : iterable.size && sliceSize || undefined; if (!useKeys && isSeq(iterable) && sliceSize >= 0) { sliceSeq.get = function (index, notSetValue) { index = wrapIndex(this, index); return index >= 0 && index < sliceSize ? iterable.get(index + resolvedBegin, notSetValue) : notSetValue; } } sliceSeq.__iterateUncached = function(fn, reverse) {var this$0 = this; if (sliceSize === 0) { return 0; } if (reverse) { return this.cacheResult().__iterate(fn, reverse); } var skipped = 0; var isSkipping = true; var iterations = 0; iterable.__iterate(function(v, k) { if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) { iterations++; return fn(v, useKeys ? k : iterations - 1, this$0) !== false && iterations !== sliceSize; } }); return iterations; }; sliceSeq.__iteratorUncached = function(type, reverse) { if (sliceSize !== 0 && reverse) { return this.cacheResult().__iterator(type, reverse); } // Don't bother instantiating parent iterator if taking 0. var iterator = sliceSize !== 0 && iterable.__iterator(type, reverse); var skipped = 0; var iterations = 0; return new Iterator(function() { while (skipped++ < resolvedBegin) { iterator.next(); } if (++iterations > sliceSize) { return iteratorDone(); } var step = iterator.next(); if (useKeys || type === ITERATE_VALUES) { return step; } else if (type === ITERATE_KEYS) { return iteratorValue(type, iterations - 1, undefined, step); } else { return iteratorValue(type, iterations - 1, step.value[1], step); } }); } return sliceSeq; } function takeWhileFactory(iterable, predicate, context) { var takeSequence = makeSequence(iterable); takeSequence.__iterateUncached = function(fn, reverse) {var this$0 = this; if (reverse) { return this.cacheResult().__iterate(fn, reverse); } var iterations = 0; iterable.__iterate(function(v, k, c) {return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$0)} ); return iterations; }; takeSequence.__iteratorUncached = function(type, reverse) {var this$0 = this; if (reverse) { return this.cacheResult().__iterator(type, reverse); } var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); var iterating = true; return new Iterator(function() { if (!iterating) { return iteratorDone(); } var step = iterator.next(); if (step.done) { return step; } var entry = step.value; var k = entry[0]; var v = entry[1]; if (!predicate.call(context, v, k, this$0)) { iterating = false; return iteratorDone(); } return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); }); }; return takeSequence; } function skipWhileFactory(iterable, predicate, context, useKeys) { var skipSequence = makeSequence(iterable); skipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; if (reverse) { return this.cacheResult().__iterate(fn, reverse); } var isSkipping = true; var iterations = 0; iterable.__iterate(function(v, k, c) { if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) { iterations++; return fn(v, useKeys ? k : iterations - 1, this$0); } }); return iterations; }; skipSequence.__iteratorUncached = function(type, reverse) {var this$0 = this; if (reverse) { return this.cacheResult().__iterator(type, reverse); } var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); var skipping = true; var iterations = 0; return new Iterator(function() { var step, k, v; do { step = iterator.next(); if (step.done) { if (useKeys || type === ITERATE_VALUES) { return step; } else if (type === ITERATE_KEYS) { return iteratorValue(type, iterations++, undefined, step); } else { return iteratorValue(type, iterations++, step.value[1], step); } } var entry = step.value; k = entry[0]; v = entry[1]; skipping && (skipping = predicate.call(context, v, k, this$0)); } while (skipping); return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); }); }; return skipSequence; } function concatFactory(iterable, values) { var isKeyedIterable = isKeyed(iterable); var iters = [iterable].concat(values).map(function(v ) { if (!isIterable(v)) { v = isKeyedIterable ? keyedSeqFromValue(v) : indexedSeqFromValue(Array.isArray(v) ? v : [v]); } else if (isKeyedIterable) { v = KeyedIterable(v); } return v; }).filter(function(v ) {return v.size !== 0}); if (iters.length === 0) { return iterable; } if (iters.length === 1) { var singleton = iters[0]; if (singleton === iterable || isKeyedIterable && isKeyed(singleton) || isIndexed(iterable) && isIndexed(singleton)) { return singleton; } } var concatSeq = new ArraySeq(iters); if (isKeyedIterable) { concatSeq = concatSeq.toKeyedSeq(); } else if (!isIndexed(iterable)) { concatSeq = concatSeq.toSetSeq(); } concatSeq = concatSeq.flatten(true); concatSeq.size = iters.reduce( function(sum, seq) { if (sum !== undefined) { var size = seq.size; if (size !== undefined) { return sum + size; } } }, 0 ); return concatSeq; } function flattenFactory(iterable, depth, useKeys) { var flatSequence = makeSequence(iterable); flatSequence.__iterateUncached = function(fn, reverse) { var iterations = 0; var stopped = false; function flatDeep(iter, currentDepth) {var this$0 = this; iter.__iterate(function(v, k) { if ((!depth || currentDepth < depth) && isIterable(v)) { flatDeep(v, currentDepth + 1); } else if (fn(v, useKeys ? k : iterations++, this$0) === false) { stopped = true; } return !stopped; }, reverse); } flatDeep(iterable, 0); return iterations; } flatSequence.__iteratorUncached = function(type, reverse) { var iterator = iterable.__iterator(type, reverse); var stack = []; var iterations = 0; return new Iterator(function() { while (iterator) { var step = iterator.next(); if (step.done !== false) { iterator = stack.pop(); continue; } var v = step.value; if (type === ITERATE_ENTRIES) { v = v[1]; } if ((!depth || stack.length < depth) && isIterable(v)) { stack.push(iterator); iterator = v.__iterator(type, reverse); } else { return useKeys ? step : iteratorValue(type, iterations++, v, step); } } return iteratorDone(); }); } return flatSequence; } function flatMapFactory(iterable, mapper, context) { var coerce = iterableClass(iterable); return iterable.toSeq().map( function(v, k) {return coerce(mapper.call(context, v, k, iterable))} ).flatten(true); } function interposeFactory(iterable, separator) { var interposedSequence = makeSequence(iterable); interposedSequence.size = iterable.size && iterable.size * 2 -1; interposedSequence.__iterateUncached = function(fn, reverse) {var this$0 = this; var iterations = 0; iterable.__iterate(function(v, k) {return (!iterations || fn(separator, iterations++, this$0) !== false) && fn(v, iterations++, this$0) !== false}, reverse ); return iterations; }; interposedSequence.__iteratorUncached = function(type, reverse) { var iterator = iterable.__iterator(ITERATE_VALUES, reverse); var iterations = 0; var step; return new Iterator(function() { if (!step || iterations % 2) { step = iterator.next(); if (step.done) { return step; } } return iterations % 2 ? iteratorValue(type, iterations++, separator) : iteratorValue(type, iterations++, step.value, step); }); }; return interposedSequence; } function sortFactory(iterable, comparator, mapper) { if (!comparator) { comparator = defaultComparator; } var isKeyedIterable = isKeyed(iterable); var index = 0; var entries = iterable.toSeq().map( function(v, k) {return [k, v, index++, mapper ? mapper(v, k, iterable) : v]} ).toArray(); entries.sort(function(a, b) {return comparator(a[3], b[3]) || a[2] - b[2]}).forEach( isKeyedIterable ? function(v, i) { entries[i].length = 2; } : function(v, i) { entries[i] = v[1]; } ); return isKeyedIterable ? KeyedSeq(entries) : isIndexed(iterable) ? IndexedSeq(entries) : SetSeq(entries); } function maxFactory(iterable, comparator, mapper) { if (!comparator) { comparator = defaultComparator; } if (mapper) { var entry = iterable.toSeq() .map(function(v, k) {return [v, mapper(v, k, iterable)]}) .reduce(function(a, b) {return maxCompare(comparator, a[1], b[1]) ? b : a}); return entry && entry[0]; } else { return iterable.reduce(function(a, b) {return maxCompare(comparator, a, b) ? b : a}); } } function maxCompare(comparator, a, b) { var comp = comparator(b, a); // b is considered the new max if the comparator declares them equal, but // they are not equal and b is in fact a nullish value. return (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || comp > 0; } function zipWithFactory(keyIter, zipper, iters) { var zipSequence = makeSequence(keyIter); zipSequence.size = new ArraySeq(iters).map(function(i ) {return i.size}).min(); // Note: this a generic base implementation of __iterate in terms of // __iterator which may be more generically useful in the future. zipSequence.__iterate = function(fn, reverse) { /* generic: var iterator = this.__iterator(ITERATE_ENTRIES, reverse); var step; var iterations = 0; while (!(step = iterator.next()).done) { iterations++; if (fn(step.value[1], step.value[0], this) === false) { break; } } return iterations; */ // indexed: var iterator = this.__iterator(ITERATE_VALUES, reverse); var step; var iterations = 0; while (!(step = iterator.next()).done) { if (fn(step.value, iterations++, this) === false) { break; } } return iterations; }; zipSequence.__iteratorUncached = function(type, reverse) { var iterators = iters.map(function(i ) {return (i = Iterable(i), getIterator(reverse ? i.reverse() : i))} ); var iterations = 0; var isDone = false; return new Iterator(function() { var steps; if (!isDone) { steps = iterators.map(function(i ) {return i.next()}); isDone = steps.some(function(s ) {return s.done}); } if (isDone) { return iteratorDone(); } return iteratorValue( type, iterations++, zipper.apply(null, steps.map(function(s ) {return s.value})) ); }); }; return zipSequence } // #pragma Helper Functions function reify(iter, seq) { return isSeq(iter) ? seq : iter.constructor(seq); } function validateEntry(entry) { if (entry !== Object(entry)) { throw new TypeError('Expected [K, V] tuple: ' + entry); } } function resolveSize(iter) { assertNotInfinite(iter.size); return ensureSize(iter); } function iterableClass(iterable) { return isKeyed(iterable) ? KeyedIterable : isIndexed(iterable) ? IndexedIterable : SetIterable; } function makeSequence(iterable) { return Object.create( ( isKeyed(iterable) ? KeyedSeq : isIndexed(iterable) ? IndexedSeq : SetSeq ).prototype ); } function cacheResultThrough() { if (this._iter.cacheResult) { this._iter.cacheResult(); this.size = this._iter.size; return this; } else { return Seq.prototype.cacheResult.call(this); } } function defaultComparator(a, b) { return a > b ? 1 : a < b ? -1 : 0; } function forceIterator(keyPath) { var iter = getIterator(keyPath); if (!iter) { // Array might not be iterable in this environment, so we need a fallback // to our wrapped type. if (!isArrayLike(keyPath)) { throw new TypeError('Expected iterable or array-like: ' + keyPath); } iter = getIterator(Iterable(keyPath)); } return iter; } createClass(Record, KeyedCollection); function Record(defaultValues, name) { var hasInitialized; var RecordType = function Record(values) { if (values instanceof RecordType) { return values; } if (!(this instanceof RecordType)) { return new RecordType(values); } if (!hasInitialized) { hasInitialized = true; var keys = Object.keys(defaultValues); setProps(RecordTypePrototype, keys); RecordTypePrototype.size = keys.length; RecordTypePrototype._name = name; RecordTypePrototype._keys = keys; RecordTypePrototype._defaultValues = defaultValues; } this._map = Map(values); }; var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype); RecordTypePrototype.constructor = RecordType; return RecordType; } Record.prototype.toString = function() { return this.__toString(recordName(this) + ' {', '}'); }; // @pragma Access Record.prototype.has = function(k) { return this._defaultValues.hasOwnProperty(k); }; Record.prototype.get = function(k, notSetValue) { if (!this.has(k)) { return notSetValue; } var defaultVal = this._defaultValues[k]; return this._map ? this._map.get(k, defaultVal) : defaultVal; }; // @pragma Modification Record.prototype.clear = function() { if (this.__ownerID) { this._map && this._map.clear(); return this; } var RecordType = this.constructor; return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap())); }; Record.prototype.set = function(k, v) { if (!this.has(k)) { throw new Error('Cannot set unknown key "' + k + '" on ' + recordName(this)); } if (this._map && !this._map.has(k)) { var defaultVal = this._defaultValues[k]; if (v === defaultVal) { return this; } } var newMap = this._map && this._map.set(k, v); if (this.__ownerID || newMap === this._map) { return this; } return makeRecord(this, newMap); }; Record.prototype.remove = function(k) { if (!this.has(k)) { return this; } var newMap = this._map && this._map.remove(k); if (this.__ownerID || newMap === this._map) { return this; } return makeRecord(this, newMap); }; Record.prototype.wasAltered = function() { return this._map.wasAltered(); }; Record.prototype.__iterator = function(type, reverse) {var this$0 = this; return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterator(type, reverse); }; Record.prototype.__iterate = function(fn, reverse) {var this$0 = this; return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterate(fn, reverse); }; Record.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) { return this; } var newMap = this._map && this._map.__ensureOwner(ownerID); if (!ownerID) { this.__ownerID = ownerID; this._map = newMap; return this; } return makeRecord(this, newMap, ownerID); }; var RecordPrototype = Record.prototype; RecordPrototype[DELETE] = RecordPrototype.remove; RecordPrototype.deleteIn = RecordPrototype.removeIn = MapPrototype.removeIn; RecordPrototype.merge = MapPrototype.merge; RecordPrototype.mergeWith = MapPrototype.mergeWith; RecordPrototype.mergeIn = MapPrototype.mergeIn; RecordPrototype.mergeDeep = MapPrototype.mergeDeep; RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith; RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn; RecordPrototype.setIn = MapPrototype.setIn; RecordPrototype.update = MapPrototype.update; RecordPrototype.updateIn = MapPrototype.updateIn; RecordPrototype.withMutations = MapPrototype.withMutations; RecordPrototype.asMutable = MapPrototype.asMutable; RecordPrototype.asImmutable = MapPrototype.asImmutable; function makeRecord(likeRecord, map, ownerID) { var record = Object.create(Object.getPrototypeOf(likeRecord)); record._map = map; record.__ownerID = ownerID; return record; } function recordName(record) { return record._name || record.constructor.name || 'Record'; } function setProps(prototype, names) { try { names.forEach(setProp.bind(undefined, prototype)); } catch (error) { // Object.defineProperty failed. Probably IE8. } } function setProp(prototype, name) { Object.defineProperty(prototype, name, { get: function() { return this.get(name); }, set: function(value) { invariant(this.__ownerID, 'Cannot set on an immutable record.'); this.set(name, value); } }); } createClass(Set, SetCollection); // @pragma Construction function Set(value) { return value === null || value === undefined ? emptySet() : isSet(value) && !isOrdered(value) ? value : emptySet().withMutations(function(set ) { var iter = SetIterable(value); assertNotInfinite(iter.size); iter.forEach(function(v ) {return set.add(v)}); }); } Set.of = function(/*...values*/) { return this(arguments); }; Set.fromKeys = function(value) { return this(KeyedIterable(value).keySeq()); }; Set.prototype.toString = function() { return this.__toString('Set {', '}'); }; // @pragma Access Set.prototype.has = function(value) { return this._map.has(value); }; // @pragma Modification Set.prototype.add = function(value) { return updateSet(this, this._map.set(value, true)); }; Set.prototype.remove = function(value) { return updateSet(this, this._map.remove(value)); }; Set.prototype.clear = function() { return updateSet(this, this._map.clear()); }; // @pragma Composition Set.prototype.union = function() {var iters = SLICE$0.call(arguments, 0); iters = iters.filter(function(x ) {return x.size !== 0}); if (iters.length === 0) { return this; } if (this.size === 0 && !this.__ownerID && iters.length === 1) { return this.constructor(iters[0]); } return this.withMutations(function(set ) { for (var ii = 0; ii < iters.length; ii++) { SetIterable(iters[ii]).forEach(function(value ) {return set.add(value)}); } }); }; Set.prototype.intersect = function() {var iters = SLICE$0.call(arguments, 0); if (iters.length === 0) { return this; } iters = iters.map(function(iter ) {return SetIterable(iter)}); var originalSet = this; return this.withMutations(function(set ) { originalSet.forEach(function(value ) { if (!iters.every(function(iter ) {return iter.includes(value)})) { set.remove(value); } }); }); }; Set.prototype.subtract = function() {var iters = SLICE$0.call(arguments, 0); if (iters.length === 0) { return this; } iters = iters.map(function(iter ) {return SetIterable(iter)}); var originalSet = this; return this.withMutations(function(set ) { originalSet.forEach(function(value ) { if (iters.some(function(iter ) {return iter.includes(value)})) { set.remove(value); } }); }); }; Set.prototype.merge = function() { return this.union.apply(this, arguments); }; Set.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1); return this.union.apply(this, iters); }; Set.prototype.sort = function(comparator) { // Late binding return OrderedSet(sortFactory(this, comparator)); }; Set.prototype.sortBy = function(mapper, comparator) { // Late binding return OrderedSet(sortFactory(this, comparator, mapper)); }; Set.prototype.wasAltered = function() { return this._map.wasAltered(); }; Set.prototype.__iterate = function(fn, reverse) {var this$0 = this; return this._map.__iterate(function(_, k) {return fn(k, k, this$0)}, reverse); }; Set.prototype.__iterator = function(type, reverse) { return this._map.map(function(_, k) {return k}).__iterator(type, reverse); }; Set.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) { return this; } var newMap = this._map.__ensureOwner(ownerID); if (!ownerID) { this.__ownerID = ownerID; this._map = newMap; return this; } return this.__make(newMap, ownerID); }; function isSet(maybeSet) { return !!(maybeSet && maybeSet[IS_SET_SENTINEL]); } Set.isSet = isSet; var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@'; var SetPrototype = Set.prototype; SetPrototype[IS_SET_SENTINEL] = true; SetPrototype[DELETE] = SetPrototype.remove; SetPrototype.mergeDeep = SetPrototype.merge; SetPrototype.mergeDeepWith = SetPrototype.mergeWith; SetPrototype.withMutations = MapPrototype.withMutations; SetPrototype.asMutable = MapPrototype.asMutable; SetPrototype.asImmutable = MapPrototype.asImmutable; SetPrototype.__empty = emptySet; SetPrototype.__make = makeSet; function updateSet(set, newMap) { if (set.__ownerID) { set.size = newMap.size; set._map = newMap; return set; } return newMap === set._map ? set : newMap.size === 0 ? set.__empty() : set.__make(newMap); } function makeSet(map, ownerID) { var set = Object.create(SetPrototype); set.size = map ? map.size : 0; set._map = map; set.__ownerID = ownerID; return set; } var EMPTY_SET; function emptySet() { return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap())); } createClass(OrderedSet, Set); // @pragma Construction function OrderedSet(value) { return value === null || value === undefined ? emptyOrderedSet() : isOrderedSet(value) ? value : emptyOrderedSet().withMutations(function(set ) { var iter = SetIterable(value); assertNotInfinite(iter.size); iter.forEach(function(v ) {return set.add(v)}); }); } OrderedSet.of = function(/*...values*/) { return this(arguments); }; OrderedSet.fromKeys = function(value) { return this(KeyedIterable(value).keySeq()); }; OrderedSet.prototype.toString = function() { return this.__toString('OrderedSet {', '}'); }; function isOrderedSet(maybeOrderedSet) { return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet); } OrderedSet.isOrderedSet = isOrderedSet; var OrderedSetPrototype = OrderedSet.prototype; OrderedSetPrototype[IS_ORDERED_SENTINEL] = true; OrderedSetPrototype.__empty = emptyOrderedSet; OrderedSetPrototype.__make = makeOrderedSet; function makeOrderedSet(map, ownerID) { var set = Object.create(OrderedSetPrototype); set.size = map ? map.size : 0; set._map = map; set.__ownerID = ownerID; return set; } var EMPTY_ORDERED_SET; function emptyOrderedSet() { return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap())); } createClass(Stack, IndexedCollection); // @pragma Construction function Stack(value) { return value === null || value === undefined ? emptyStack() : isStack(value) ? value : emptyStack().unshiftAll(value); } Stack.of = function(/*...values*/) { return this(arguments); }; Stack.prototype.toString = function() { return this.__toString('Stack [', ']'); }; // @pragma Access Stack.prototype.get = function(index, notSetValue) { var head = this._head; index = wrapIndex(this, index); while (head && index--) { head = head.next; } return head ? head.value : notSetValue; }; Stack.prototype.peek = function() { return this._head && this._head.value; }; // @pragma Modification Stack.prototype.push = function(/*...values*/) { if (arguments.length === 0) { return this; } var newSize = this.size + arguments.length; var head = this._head; for (var ii = arguments.length - 1; ii >= 0; ii--) { head = { value: arguments[ii], next: head }; } if (this.__ownerID) { this.size = newSize; this._head = head; this.__hash = undefined; this.__altered = true; return this; } return makeStack(newSize, head); }; Stack.prototype.pushAll = function(iter) { iter = IndexedIterable(iter); if (iter.size === 0) { return this; } assertNotInfinite(iter.size); var newSize = this.size; var head = this._head; iter.reverse().forEach(function(value ) { newSize++; head = { value: value, next: head }; }); if (this.__ownerID) { this.size = newSize; this._head = head; this.__hash = undefined; this.__altered = true; return this; } return makeStack(newSize, head); }; Stack.prototype.pop = function() { return this.slice(1); }; Stack.prototype.unshift = function(/*...values*/) { return this.push.apply(this, arguments); }; Stack.prototype.unshiftAll = function(iter) { return this.pushAll(iter); }; Stack.prototype.shift = function() { return this.pop.apply(this, arguments); }; Stack.prototype.clear = function() { if (this.size === 0) { return this; } if (this.__ownerID) { this.size = 0; this._head = undefined; this.__hash = undefined; this.__altered = true; return this; } return emptyStack(); }; Stack.prototype.slice = function(begin, end) { if (wholeSlice(begin, end, this.size)) { return this; } var resolvedBegin = resolveBegin(begin, this.size); var resolvedEnd = resolveEnd(end, this.size); if (resolvedEnd !== this.size) { // super.slice(begin, end); return IndexedCollection.prototype.slice.call(this, begin, end); } var newSize = this.size - resolvedBegin; var head = this._head; while (resolvedBegin--) { head = head.next; } if (this.__ownerID) { this.size = newSize; this._head = head; this.__hash = undefined; this.__altered = true; return this; } return makeStack(newSize, head); }; // @pragma Mutability Stack.prototype.__ensureOwner = function(ownerID) { if (ownerID === this.__ownerID) { return this; } if (!ownerID) { this.__ownerID = ownerID; this.__altered = false; return this; } return makeStack(this.size, this._head, ownerID, this.__hash); }; // @pragma Iteration Stack.prototype.__iterate = function(fn, reverse) { if (reverse) { return this.reverse().__iterate(fn); } var iterations = 0; var node = this._head; while (node) { if (fn(node.value, iterations++, this) === false) { break; } node = node.next; } return iterations; }; Stack.prototype.__iterator = function(type, reverse) { if (reverse) { return this.reverse().__iterator(type); } var iterations = 0; var node = this._head; return new Iterator(function() { if (node) { var value = node.value; node = node.next; return iteratorValue(type, iterations++, value); } return iteratorDone(); }); }; function isStack(maybeStack) { return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]); } Stack.isStack = isStack; var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@'; var StackPrototype = Stack.prototype; StackPrototype[IS_STACK_SENTINEL] = true; StackPrototype.withMutations = MapPrototype.withMutations; StackPrototype.asMutable = MapPrototype.asMutable; StackPrototype.asImmutable = MapPrototype.asImmutable; StackPrototype.wasAltered = MapPrototype.wasAltered; function makeStack(size, head, ownerID, hash) { var map = Object.create(StackPrototype); map.size = size; map._head = head; map.__ownerID = ownerID; map.__hash = hash; map.__altered = false; return map; } var EMPTY_STACK; function emptyStack() { return EMPTY_STACK || (EMPTY_STACK = makeStack(0)); } /** * Contributes additional methods to a constructor */ function mixin(ctor, methods) { var keyCopier = function(key ) { ctor.prototype[key] = methods[key]; }; Object.keys(methods).forEach(keyCopier); Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(methods).forEach(keyCopier); return ctor; } Iterable.Iterator = Iterator; mixin(Iterable, { // ### Conversion to other types toArray: function() { assertNotInfinite(this.size); var array = new Array(this.size || 0); this.valueSeq().__iterate(function(v, i) { array[i] = v; }); return array; }, toIndexedSeq: function() { return new ToIndexedSequence(this); }, toJS: function() { return this.toSeq().map( function(value ) {return value && typeof value.toJS === 'function' ? value.toJS() : value} ).__toJS(); }, toJSON: function() { return this.toSeq().map( function(value ) {return value && typeof value.toJSON === 'function' ? value.toJSON() : value} ).__toJS(); }, toKeyedSeq: function() { return new ToKeyedSequence(this, true); }, toMap: function() { // Use Late Binding here to solve the circular dependency. return Map(this.toKeyedSeq()); }, toObject: function() { assertNotInfinite(this.size); var object = {}; this.__iterate(function(v, k) { object[k] = v; }); return object; }, toOrderedMap: function() { // Use Late Binding here to solve the circular dependency. return OrderedMap(this.toKeyedSeq()); }, toOrderedSet: function() { // Use Late Binding here to solve the circular dependency. return OrderedSet(isKeyed(this) ? this.valueSeq() : this); }, toSet: function() { // Use Late Binding here to solve the circular dependency. return Set(isKeyed(this) ? this.valueSeq() : this); }, toSetSeq: function() { return new ToSetSequence(this); }, toSeq: function() { return isIndexed(this) ? this.toIndexedSeq() : isKeyed(this) ? this.toKeyedSeq() : this.toSetSeq(); }, toStack: function() { // Use Late Binding here to solve the circular dependency. return Stack(isKeyed(this) ? this.valueSeq() : this); }, toList: function() { // Use Late Binding here to solve the circular dependency. return List(isKeyed(this) ? this.valueSeq() : this); }, // ### Common JavaScript methods and properties toString: function() { return '[Iterable]'; }, __toString: function(head, tail) { if (this.size === 0) { return head + tail; } return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail; }, // ### ES6 Collection methods (ES6 Array and Map) concat: function() {var values = SLICE$0.call(arguments, 0); return reify(this, concatFactory(this, values)); }, includes: function(searchValue) { return this.some(function(value ) {return is(value, searchValue)}); }, entries: function() { return this.__iterator(ITERATE_ENTRIES); }, every: function(predicate, context) { assertNotInfinite(this.size); var returnValue = true; this.__iterate(function(v, k, c) { if (!predicate.call(context, v, k, c)) { returnValue = false; return false; } }); return returnValue; }, filter: function(predicate, context) { return reify(this, filterFactory(this, predicate, context, true)); }, find: function(predicate, context, notSetValue) { var entry = this.findEntry(predicate, context); return entry ? entry[1] : notSetValue; }, forEach: function(sideEffect, context) { assertNotInfinite(this.size); return this.__iterate(context ? sideEffect.bind(context) : sideEffect); }, join: function(separator) { assertNotInfinite(this.size); separator = separator !== undefined ? '' + separator : ','; var joined = ''; var isFirst = true; this.__iterate(function(v ) { isFirst ? (isFirst = false) : (joined += separator); joined += v !== null && v !== undefined ? v.toString() : ''; }); return joined; }, keys: function() { return this.__iterator(ITERATE_KEYS); }, map: function(mapper, context) { return reify(this, mapFactory(this, mapper, context)); }, reduce: function(reducer, initialReduction, context) { assertNotInfinite(this.size); var reduction; var useFirst; if (arguments.length < 2) { useFirst = true; } else { reduction = initialReduction; } this.__iterate(function(v, k, c) { if (useFirst) { useFirst = false; reduction = v; } else { reduction = reducer.call(context, reduction, v, k, c); } }); return reduction; }, reduceRight: function(reducer, initialReduction, context) { var reversed = this.toKeyedSeq().reverse(); return reversed.reduce.apply(reversed, arguments); }, reverse: function() { return reify(this, reverseFactory(this, true)); }, slice: function(begin, end) { return reify(this, sliceFactory(this, begin, end, true)); }, some: function(predicate, context) { return !this.every(not(predicate), context); }, sort: function(comparator) { return reify(this, sortFactory(this, comparator)); }, values: function() { return this.__iterator(ITERATE_VALUES); }, // ### More sequential methods butLast: function() { return this.slice(0, -1); }, isEmpty: function() { return this.size !== undefined ? this.size === 0 : !this.some(function() {return true}); }, count: function(predicate, context) { return ensureSize( predicate ? this.toSeq().filter(predicate, context) : this ); }, countBy: function(grouper, context) { return countByFactory(this, grouper, context); }, equals: function(other) { return deepEqual(this, other); }, entrySeq: function() { var iterable = this; if (iterable._cache) { // We cache as an entries array, so we can just return the cache! return new ArraySeq(iterable._cache); } var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq(); entriesSequence.fromEntrySeq = function() {return iterable.toSeq()}; return entriesSequence; }, filterNot: function(predicate, context) { return this.filter(not(predicate), context); }, findEntry: function(predicate, context, notSetValue) { var found = notSetValue; this.__iterate(function(v, k, c) { if (predicate.call(context, v, k, c)) { found = [k, v]; return false; } }); return found; }, findKey: function(predicate, context) { var entry = this.findEntry(predicate, context); return entry && entry[0]; }, findLast: function(predicate, context, notSetValue) { return this.toKeyedSeq().reverse().find(predicate, context, notSetValue); }, findLastEntry: function(predicate, context, notSetValue) { return this.toKeyedSeq().reverse().findEntry(predicate, context, notSetValue); }, findLastKey: function(predicate, context) { return this.toKeyedSeq().reverse().findKey(predicate, context); }, first: function() { return this.find(returnTrue); }, flatMap: function(mapper, context) { return reify(this, flatMapFactory(this, mapper, context)); }, flatten: function(depth) { return reify(this, flattenFactory(this, depth, true)); }, fromEntrySeq: function() { return new FromEntriesSequence(this); }, get: function(searchKey, notSetValue) { return this.find(function(_, key) {return is(key, searchKey)}, undefined, notSetValue); }, getIn: function(searchKeyPath, notSetValue) { var nested = this; // Note: in an ES6 environment, we would prefer: // for (var key of searchKeyPath) { var iter = forceIterator(searchKeyPath); var step; while (!(step = iter.next()).done) { var key = step.value; nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET; if (nested === NOT_SET) { return notSetValue; } } return nested; }, groupBy: function(grouper, context) { return groupByFactory(this, grouper, context); }, has: function(searchKey) { return this.get(searchKey, NOT_SET) !== NOT_SET; }, hasIn: function(searchKeyPath) { return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET; }, isSubset: function(iter) { iter = typeof iter.includes === 'function' ? iter : Iterable(iter); return this.every(function(value ) {return iter.includes(value)}); }, isSuperset: function(iter) { iter = typeof iter.isSubset === 'function' ? iter : Iterable(iter); return iter.isSubset(this); }, keyOf: function(searchValue) { return this.findKey(function(value ) {return is(value, searchValue)}); }, keySeq: function() { return this.toSeq().map(keyMapper).toIndexedSeq(); }, last: function() { return this.toSeq().reverse().first(); }, lastKeyOf: function(searchValue) { return this.toKeyedSeq().reverse().keyOf(searchValue); }, max: function(comparator) { return maxFactory(this, comparator); }, maxBy: function(mapper, comparator) { return maxFactory(this, comparator, mapper); }, min: function(comparator) { return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator); }, minBy: function(mapper, comparator) { return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper); }, rest: function() { return this.slice(1); }, skip: function(amount) { return this.slice(Math.max(0, amount)); }, skipLast: function(amount) { return reify(this, this.toSeq().reverse().skip(amount).reverse()); }, skipWhile: function(predicate, context) { return reify(this, skipWhileFactory(this, predicate, context, true)); }, skipUntil: function(predicate, context) { return this.skipWhile(not(predicate), context); }, sortBy: function(mapper, comparator) { return reify(this, sortFactory(this, comparator, mapper)); }, take: function(amount) { return this.slice(0, Math.max(0, amount)); }, takeLast: function(amount) { return reify(this, this.toSeq().reverse().take(amount).reverse()); }, takeWhile: function(predicate, context) { return reify(this, takeWhileFactory(this, predicate, context)); }, takeUntil: function(predicate, context) { return this.takeWhile(not(predicate), context); }, valueSeq: function() { return this.toIndexedSeq(); }, // ### Hashable Object hashCode: function() { return this.__hash || (this.__hash = hashIterable(this)); } // ### Internal // abstract __iterate(fn, reverse) // abstract __iterator(type, reverse) }); // var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'; // var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@'; // var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@'; // var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@'; var IterablePrototype = Iterable.prototype; IterablePrototype[IS_ITERABLE_SENTINEL] = true; IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values; IterablePrototype.__toJS = IterablePrototype.toArray; IterablePrototype.__toStringMapper = quoteString; IterablePrototype.inspect = IterablePrototype.toSource = function() { return this.toString(); }; IterablePrototype.chain = IterablePrototype.flatMap; IterablePrototype.contains = IterablePrototype.includes; mixin(KeyedIterable, { // ### More sequential methods flip: function() { return reify(this, flipFactory(this)); }, mapEntries: function(mapper, context) {var this$0 = this; var iterations = 0; return reify(this, this.toSeq().map( function(v, k) {return mapper.call(context, [k, v], iterations++, this$0)} ).fromEntrySeq() ); }, mapKeys: function(mapper, context) {var this$0 = this; return reify(this, this.toSeq().flip().map( function(k, v) {return mapper.call(context, k, v, this$0)} ).flip() ); } }); var KeyedIterablePrototype = KeyedIterable.prototype; KeyedIterablePrototype[IS_KEYED_SENTINEL] = true; KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries; KeyedIterablePrototype.__toJS = IterablePrototype.toObject; KeyedIterablePrototype.__toStringMapper = function(v, k) {return JSON.stringify(k) + ': ' + quoteString(v)}; mixin(IndexedIterable, { // ### Conversion to other types toKeyedSeq: function() { return new ToKeyedSequence(this, false); }, // ### ES6 Collection methods (ES6 Array and Map) filter: function(predicate, context) { return reify(this, filterFactory(this, predicate, context, false)); }, findIndex: function(predicate, context) { var entry = this.findEntry(predicate, context); return entry ? entry[0] : -1; }, indexOf: function(searchValue) { var key = this.keyOf(searchValue); return key === undefined ? -1 : key; }, lastIndexOf: function(searchValue) { var key = this.lastKeyOf(searchValue); return key === undefined ? -1 : key; }, reverse: function() { return reify(this, reverseFactory(this, false)); }, slice: function(begin, end) { return reify(this, sliceFactory(this, begin, end, false)); }, splice: function(index, removeNum /*, ...values*/) { var numArgs = arguments.length; removeNum = Math.max(removeNum | 0, 0); if (numArgs === 0 || (numArgs === 2 && !removeNum)) { return this; } // If index is negative, it should resolve relative to the size of the // collection. However size may be expensive to compute if not cached, so // only call count() if the number is in fact negative. index = resolveBegin(index, index < 0 ? this.count() : this.size); var spliced = this.slice(0, index); return reify( this, numArgs === 1 ? spliced : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)) ); }, // ### More collection methods findLastIndex: function(predicate, context) { var entry = this.findLastEntry(predicate, context); return entry ? entry[0] : -1; }, first: function() { return this.get(0); }, flatten: function(depth) { return reify(this, flattenFactory(this, depth, false)); }, get: function(index, notSetValue) { index = wrapIndex(this, index); return (index < 0 || (this.size === Infinity || (this.size !== undefined && index > this.size))) ? notSetValue : this.find(function(_, key) {return key === index}, undefined, notSetValue); }, has: function(index) { index = wrapIndex(this, index); return index >= 0 && (this.size !== undefined ? this.size === Infinity || index < this.size : this.indexOf(index) !== -1 ); }, interpose: function(separator) { return reify(this, interposeFactory(this, separator)); }, interleave: function(/*...iterables*/) { var iterables = [this].concat(arrCopy(arguments)); var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables); var interleaved = zipped.flatten(true); if (zipped.size) { interleaved.size = zipped.size * iterables.length; } return reify(this, interleaved); }, keySeq: function() { return Range(0, this.size); }, last: function() { return this.get(-1); }, skipWhile: function(predicate, context) { return reify(this, skipWhileFactory(this, predicate, context, false)); }, zip: function(/*, ...iterables */) { var iterables = [this].concat(arrCopy(arguments)); return reify(this, zipWithFactory(this, defaultZipper, iterables)); }, zipWith: function(zipper/*, ...iterables */) { var iterables = arrCopy(arguments); iterables[0] = this; return reify(this, zipWithFactory(this, zipper, iterables)); } }); IndexedIterable.prototype[IS_INDEXED_SENTINEL] = true; IndexedIterable.prototype[IS_ORDERED_SENTINEL] = true; mixin(SetIterable, { // ### ES6 Collection methods (ES6 Array and Map) get: function(value, notSetValue) { return this.has(value) ? value : notSetValue; }, includes: function(value) { return this.has(value); }, // ### More sequential methods keySeq: function() { return this.valueSeq(); } }); SetIterable.prototype.has = IterablePrototype.includes; SetIterable.prototype.contains = SetIterable.prototype.includes; // Mixin subclasses mixin(KeyedSeq, KeyedIterable.prototype); mixin(IndexedSeq, IndexedIterable.prototype); mixin(SetSeq, SetIterable.prototype); mixin(KeyedCollection, KeyedIterable.prototype); mixin(IndexedCollection, IndexedIterable.prototype); mixin(SetCollection, SetIterable.prototype); // #pragma Helper functions function keyMapper(v, k) { return k; } function entryMapper(v, k) { return [k, v]; } function not(predicate) { return function() { return !predicate.apply(this, arguments); } } function neg(predicate) { return function() { return -predicate.apply(this, arguments); } } function quoteString(value) { return typeof value === 'string' ? JSON.stringify(value) : String(value); } function defaultZipper() { return arrCopy(arguments); } function defaultNegComparator(a, b) { return a < b ? 1 : a > b ? -1 : 0; } function hashIterable(iterable) { if (iterable.size === Infinity) { return 0; } var ordered = isOrdered(iterable); var keyed = isKeyed(iterable); var h = ordered ? 1 : 0; var size = iterable.__iterate( keyed ? ordered ? function(v, k) { h = 31 * h + hashMerge(hash(v), hash(k)) | 0; } : function(v, k) { h = h + hashMerge(hash(v), hash(k)) | 0; } : ordered ? function(v ) { h = 31 * h + hash(v) | 0; } : function(v ) { h = h + hash(v) | 0; } ); return murmurHashOfSize(size, h); } function murmurHashOfSize(size, h) { h = imul(h, 0xCC9E2D51); h = imul(h << 15 | h >>> -15, 0x1B873593); h = imul(h << 13 | h >>> -13, 5); h = (h + 0xE6546B64 | 0) ^ size; h = imul(h ^ h >>> 16, 0x85EBCA6B); h = imul(h ^ h >>> 13, 0xC2B2AE35); h = smi(h ^ h >>> 16); return h; } function hashMerge(a, b) { return a ^ b + 0x9E3779B9 + (a << 6) + (a >> 2) | 0; // int } var Immutable = { Iterable: Iterable, Seq: Seq, Collection: Collection, Map: Map, OrderedMap: OrderedMap, List: List, Stack: Stack, Set: Set, OrderedSet: OrderedSet, Record: Record, Range: Range, Repeat: Repeat, is: is, fromJS: fromJS }; return Immutable; })); /***/ }), /* 147 */, /* 148 */, /* 149 */, /* 150 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * This is a straight rip-off of the React.js ReactPropTypes.js proptype validators, * modified to make it possible to validate Immutable.js data. * ImmutableTypes.listOf is patterned after React.PropTypes.arrayOf, but for Immutable.List * ImmutableTypes.shape is based on React.PropTypes.shape, but for any Immutable.Iterable */ var Immutable = __webpack_require__(146); var ANONYMOUS = "<>"; var ImmutablePropTypes = { listOf: createListOfTypeChecker, mapOf: createMapOfTypeChecker, orderedMapOf: createOrderedMapOfTypeChecker, setOf: createSetOfTypeChecker, orderedSetOf: createOrderedSetOfTypeChecker, stackOf: createStackOfTypeChecker, iterableOf: createIterableOfTypeChecker, recordOf: createRecordOfTypeChecker, shape: createShapeChecker, contains: createShapeChecker, mapContains: createMapContainsChecker, // Primitive Types list: createImmutableTypeChecker("List", Immutable.List.isList), map: createImmutableTypeChecker("Map", Immutable.Map.isMap), orderedMap: createImmutableTypeChecker("OrderedMap", Immutable.OrderedMap.isOrderedMap), set: createImmutableTypeChecker("Set", Immutable.Set.isSet), orderedSet: createImmutableTypeChecker("OrderedSet", Immutable.OrderedSet.isOrderedSet), stack: createImmutableTypeChecker("Stack", Immutable.Stack.isStack), seq: createImmutableTypeChecker("Seq", Immutable.Seq.isSeq), record: createImmutableTypeChecker("Record", function (isRecord) { return isRecord instanceof Immutable.Record; }), iterable: createImmutableTypeChecker("Iterable", Immutable.Iterable.isIterable) }; function getPropType(propValue) { var propType = typeof propValue; if (Array.isArray(propValue)) { return "array"; } if (propValue instanceof RegExp) { // Old webkits (at least until Android 4.0) return 'function' rather than // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ // passes PropTypes.object. return "object"; } if (propValue instanceof Immutable.Iterable) { return "Immutable." + propValue.toSource().split(" ")[0]; } return propType; } function createChainableTypeChecker(validate) { function checkType(isRequired, props, propName, componentName, location, propFullName) { for (var _len = arguments.length, rest = Array(_len > 6 ? _len - 6 : 0), _key = 6; _key < _len; _key++) { rest[_key - 6] = arguments[_key]; } propFullName = propFullName || propName; componentName = componentName || ANONYMOUS; if (props[propName] == null) { var locationName = location; if (isRequired) { return new Error("Required " + locationName + " `" + propFullName + "` was not specified in " + ("`" + componentName + "`.")); } } else { return validate.apply(undefined, [props, propName, componentName, location, propFullName].concat(rest)); } } var chainedCheckType = checkType.bind(null, false); chainedCheckType.isRequired = checkType.bind(null, true); return chainedCheckType; } function createImmutableTypeChecker(immutableClassName, immutableClassTypeValidator) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; if (!immutableClassTypeValidator(propValue)) { var propType = getPropType(propValue); return new Error("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `" + immutableClassName + "`.")); } return null; } return createChainableTypeChecker(validate); } function createIterableTypeChecker(typeChecker, immutableClassName, immutableClassTypeValidator) { function validate(props, propName, componentName, location, propFullName) { for (var _len = arguments.length, rest = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) { rest[_key - 5] = arguments[_key]; } var propValue = props[propName]; if (!immutableClassTypeValidator(propValue)) { var locationName = location; var propType = getPropType(propValue); return new Error("Invalid " + locationName + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an Immutable.js " + immutableClassName + ".")); } if (typeof typeChecker !== "function") { return new Error("Invalid typeChecker supplied to `" + componentName + "` " + ("for propType `" + propFullName + "`, expected a function.")); } var propValues = propValue.toArray(); for (var i = 0, len = propValues.length; i < len; i++) { var error = typeChecker.apply(undefined, [propValues, i, componentName, location, "" + propFullName + "[" + i + "]"].concat(rest)); if (error instanceof Error) { return error; } } } return createChainableTypeChecker(validate); } function createKeysTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { for (var _len = arguments.length, rest = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) { rest[_key - 5] = arguments[_key]; } var propValue = props[propName]; if (typeof typeChecker !== "function") { return new Error("Invalid keysTypeChecker (optional second argument) supplied to `" + componentName + "` " + ("for propType `" + propFullName + "`, expected a function.")); } var keys = propValue.keySeq().toArray(); for (var i = 0, len = keys.length; i < len; i++) { var error = typeChecker.apply(undefined, [keys, i, componentName, location, "" + propFullName + " -> key(" + keys[i] + ")"].concat(rest)); if (error instanceof Error) { return error; } } } return createChainableTypeChecker(validate); } function createListOfTypeChecker(typeChecker) { return createIterableTypeChecker(typeChecker, "List", Immutable.List.isList); } function createMapOfTypeCheckerFactory(valuesTypeChecker, keysTypeChecker, immutableClassName, immutableClassTypeValidator) { function validate() { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return createIterableTypeChecker(valuesTypeChecker, immutableClassName, immutableClassTypeValidator).apply(undefined, args) || keysTypeChecker && createKeysTypeChecker(keysTypeChecker).apply(undefined, args); } return createChainableTypeChecker(validate); } function createMapOfTypeChecker(valuesTypeChecker, keysTypeChecker) { return createMapOfTypeCheckerFactory(valuesTypeChecker, keysTypeChecker, "Map", Immutable.Map.isMap); } function createOrderedMapOfTypeChecker(valuesTypeChecker, keysTypeChecker) { return createMapOfTypeCheckerFactory(valuesTypeChecker, keysTypeChecker, "OrderedMap", Immutable.OrderedMap.isOrderedMap); } function createSetOfTypeChecker(typeChecker) { return createIterableTypeChecker(typeChecker, "Set", Immutable.Set.isSet); } function createOrderedSetOfTypeChecker(typeChecker) { return createIterableTypeChecker(typeChecker, "OrderedSet", Immutable.OrderedSet.isOrderedSet); } function createStackOfTypeChecker(typeChecker) { return createIterableTypeChecker(typeChecker, "Stack", Immutable.Stack.isStack); } function createIterableOfTypeChecker(typeChecker) { return createIterableTypeChecker(typeChecker, "Iterable", Immutable.Iterable.isIterable); } function createRecordOfTypeChecker(recordKeys) { function validate(props, propName, componentName, location, propFullName) { for (var _len = arguments.length, rest = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) { rest[_key - 5] = arguments[_key]; } var propValue = props[propName]; if (!(propValue instanceof Immutable.Record)) { var propType = getPropType(propValue); var locationName = location; return new Error("Invalid " + locationName + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected an Immutable.js Record.")); } for (var key in recordKeys) { var checker = recordKeys[key]; if (!checker) { continue; } var mutablePropValue = propValue.toObject(); var error = checker.apply(undefined, [mutablePropValue, key, componentName, location, "" + propFullName + "." + key].concat(rest)); if (error) { return error; } } } return createChainableTypeChecker(validate); } // there is some irony in the fact that shapeTypes is a standard hash and not an immutable collection function createShapeTypeChecker(shapeTypes) { var immutableClassName = arguments[1] === undefined ? "Iterable" : arguments[1]; var immutableClassTypeValidator = arguments[2] === undefined ? Immutable.Iterable.isIterable : arguments[2]; function validate(props, propName, componentName, location, propFullName) { for (var _len = arguments.length, rest = Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) { rest[_key - 5] = arguments[_key]; } var propValue = props[propName]; if (!immutableClassTypeValidator(propValue)) { var propType = getPropType(propValue); var locationName = location; return new Error("Invalid " + locationName + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected an Immutable.js " + immutableClassName + ".")); } var mutablePropValue = propValue.toObject(); for (var key in shapeTypes) { var checker = shapeTypes[key]; if (!checker) { continue; } var error = checker.apply(undefined, [mutablePropValue, key, componentName, location, "" + propFullName + "." + key].concat(rest)); if (error) { return error; } } } return createChainableTypeChecker(validate); } function createShapeChecker(shapeTypes) { return createShapeTypeChecker(shapeTypes); } function createMapContainsChecker(shapeTypes) { return createShapeTypeChecker(shapeTypes, "Map", Immutable.Map.isMap); } module.exports = ImmutablePropTypes; /***/ }), /* 151 */, /* 152 */, /* 153 */, /* 154 */, /* 155 */, /* 156 */, /* 157 */, /* 158 */, /* 159 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ /** * 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. */ var invariant = function(condition, format, a, b, c, d, e, f) { if (false) { if (format === undefined) { throw new Error('invariant requires an error message argument'); } } if (!condition) { var error; if (format === undefined) { error = new Error( 'Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.' ); } else { var args = [a, b, c, d, e, f]; var argIndex = 0; error = new Error( format.replace(/%s/g, function() { return args[argIndex++]; }) ); error.name = 'Invariant Violation'; } error.framesToPop = 1; // we don't care about invariant's own frame throw error; } }; module.exports = invariant; /***/ }), /* 160 */, /* 161 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(process) {(function() { var Query, defaultPathSeparator, filter, matcher, parseOptions, pathScorer, preparedQueryCache, scorer; filter = __webpack_require__(162); matcher = __webpack_require__(166); scorer = __webpack_require__(163); pathScorer = __webpack_require__(164); Query = __webpack_require__(165); preparedQueryCache = null; defaultPathSeparator = (typeof process !== "undefined" && process !== null ? process.platform : void 0) === "win32" ? '\\' : '/'; module.exports = { filter: function(candidates, query, options) { if (options == null) { options = {}; } if (!((query != null ? query.length : void 0) && (candidates != null ? candidates.length : void 0))) { return []; } options = parseOptions(options, query); return filter(candidates, query, options); }, score: function(string, query, options) { if (options == null) { options = {}; } if (!((string != null ? string.length : void 0) && (query != null ? query.length : void 0))) { return 0; } options = parseOptions(options, query); if (options.usePathScoring) { return pathScorer.score(string, query, options); } else { return scorer.score(string, query, options); } }, match: function(string, query, options) { var _i, _ref, _results; if (options == null) { options = {}; } if (!string) { return []; } if (!query) { return []; } if (string === query) { return (function() { _results = []; for (var _i = 0, _ref = string.length; 0 <= _ref ? _i < _ref : _i > _ref; 0 <= _ref ? _i++ : _i--){ _results.push(_i); } return _results; }).apply(this); } options = parseOptions(options, query); return matcher.match(string, query, options); }, wrap: function(string, query, options) { if (options == null) { options = {}; } if (!string) { return []; } if (!query) { return []; } options = parseOptions(options, query); return matcher.wrap(string, query, options); }, prepareQuery: function(query, options) { if (options == null) { options = {}; } options = parseOptions(options, query); return options.preparedQuery; } }; parseOptions = function(options, query) { if (options.allowErrors == null) { options.allowErrors = false; } if (options.usePathScoring == null) { options.usePathScoring = true; } if (options.useExtensionBonus == null) { options.useExtensionBonus = false; } if (options.pathSeparator == null) { options.pathSeparator = defaultPathSeparator; } if (options.optCharRegEx == null) { options.optCharRegEx = null; } if (options.wrap == null) { options.wrap = null; } if (options.preparedQuery == null) { options.preparedQuery = preparedQueryCache && preparedQueryCache.query === query ? preparedQueryCache : (preparedQueryCache = new Query(query, options)); } return options; }; }).call(this); /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(120))) /***/ }), /* 162 */ /***/ (function(module, exports, __webpack_require__) { (function() { var Query, pathScorer, pluckCandidates, scorer, sortCandidates; scorer = __webpack_require__(163); pathScorer = __webpack_require__(164); Query = __webpack_require__(165); pluckCandidates = function(a) { return a.candidate; }; sortCandidates = function(a, b) { return b.score - a.score; }; module.exports = function(candidates, query, options) { var bKey, candidate, key, maxInners, maxResults, score, scoreProvider, scoredCandidates, spotLeft, string, usePathScoring, _i, _len; scoredCandidates = []; key = options.key, maxResults = options.maxResults, maxInners = options.maxInners, usePathScoring = options.usePathScoring; spotLeft = (maxInners != null) && maxInners > 0 ? maxInners : candidates.length + 1; bKey = key != null; scoreProvider = usePathScoring ? pathScorer : scorer; for (_i = 0, _len = candidates.length; _i < _len; _i++) { candidate = candidates[_i]; string = bKey ? candidate[key] : candidate; if (!string) { continue; } score = scoreProvider.score(string, query, options); if (score > 0) { scoredCandidates.push({ candidate: candidate, score: score }); if (!--spotLeft) { break; } } } scoredCandidates.sort(sortCandidates); candidates = scoredCandidates.map(pluckCandidates); if (maxResults != null) { candidates = candidates.slice(0, maxResults); } return candidates; }; }).call(this); /***/ }), /* 163 */ /***/ (function(module, exports) { (function() { var AcronymResult, computeScore, emptyAcronymResult, isAcronymFullWord, isMatch, isSeparator, isWordEnd, isWordStart, miss_coeff, pos_bonus, scoreAcronyms, scoreCharacter, scoreConsecutives, scoreExact, scoreExactMatch, scorePattern, scorePosition, scoreSize, tau_size, wm; wm = 150; pos_bonus = 20; tau_size = 150; miss_coeff = 0.75; exports.score = function(string, query, options) { var allowErrors, preparedQuery, score, string_lw; preparedQuery = options.preparedQuery, allowErrors = options.allowErrors; if (!(allowErrors || isMatch(string, preparedQuery.core_lw, preparedQuery.core_up))) { return 0; } string_lw = string.toLowerCase(); score = computeScore(string, string_lw, preparedQuery); return Math.ceil(score); }; exports.isMatch = isMatch = function(subject, query_lw, query_up) { var i, j, m, n, qj_lw, qj_up, si; m = subject.length; n = query_lw.length; if (!m || n > m) { return false; } i = -1; j = -1; while (++j < n) { qj_lw = query_lw.charCodeAt(j); qj_up = query_up.charCodeAt(j); while (++i < m) { si = subject.charCodeAt(i); if (si === qj_lw || si === qj_up) { break; } } if (i === m) { return false; } } return true; }; exports.computeScore = computeScore = function(subject, subject_lw, preparedQuery) { var acro, acro_score, align, csc_diag, csc_row, csc_score, csc_should_rebuild, i, j, m, miss_budget, miss_left, n, pos, query, query_lw, record_miss, score, score_diag, score_row, score_up, si_lw, start, sz; query = preparedQuery.query; query_lw = preparedQuery.query_lw; m = subject.length; n = query.length; acro = scoreAcronyms(subject, subject_lw, query, query_lw); acro_score = acro.score; if (acro.count === n) { return scoreExact(n, m, acro_score, acro.pos); } pos = subject_lw.indexOf(query_lw); if (pos > -1) { return scoreExactMatch(subject, subject_lw, query, query_lw, pos, n, m); } score_row = new Array(n); csc_row = new Array(n); sz = scoreSize(n, m); miss_budget = Math.ceil(miss_coeff * n) + 5; miss_left = miss_budget; csc_should_rebuild = true; j = -1; while (++j < n) { score_row[j] = 0; csc_row[j] = 0; } i = -1; while (++i < m) { si_lw = subject_lw[i]; if (!si_lw.charCodeAt(0) in preparedQuery.charCodes) { if (csc_should_rebuild) { j = -1; while (++j < n) { csc_row[j] = 0; } csc_should_rebuild = false; } continue; } score = 0; score_diag = 0; csc_diag = 0; record_miss = true; csc_should_rebuild = true; j = -1; while (++j < n) { score_up = score_row[j]; if (score_up > score) { score = score_up; } csc_score = 0; if (query_lw[j] === si_lw) { start = isWordStart(i, subject, subject_lw); csc_score = csc_diag > 0 ? csc_diag : scoreConsecutives(subject, subject_lw, query, query_lw, i, j, start); align = score_diag + scoreCharacter(i, j, start, acro_score, csc_score); if (align > score) { score = align; miss_left = miss_budget; } else { if (record_miss && --miss_left <= 0) { return Math.max(score, score_row[n - 1]) * sz; } record_miss = false; } } score_diag = score_up; csc_diag = csc_row[j]; csc_row[j] = csc_score; score_row[j] = score; } } score = score_row[n - 1]; return score * sz; }; exports.isWordStart = isWordStart = function(pos, subject, subject_lw) { var curr_s, prev_s; if (pos === 0) { return true; } curr_s = subject[pos]; prev_s = subject[pos - 1]; return isSeparator(prev_s) || (curr_s !== subject_lw[pos] && prev_s === subject_lw[pos - 1]); }; exports.isWordEnd = isWordEnd = function(pos, subject, subject_lw, len) { var curr_s, next_s; if (pos === len - 1) { return true; } curr_s = subject[pos]; next_s = subject[pos + 1]; return isSeparator(next_s) || (curr_s === subject_lw[pos] && next_s !== subject_lw[pos + 1]); }; isSeparator = function(c) { return c === ' ' || c === '.' || c === '-' || c === '_' || c === '/' || c === '\\'; }; scorePosition = function(pos) { var sc; if (pos < pos_bonus) { sc = pos_bonus - pos; return 100 + sc * sc; } else { return Math.max(100 + pos_bonus - pos, 0); } }; exports.scoreSize = scoreSize = function(n, m) { return tau_size / (tau_size + Math.abs(m - n)); }; scoreExact = function(n, m, quality, pos) { return 2 * n * (wm * quality + scorePosition(pos)) * scoreSize(n, m); }; exports.scorePattern = scorePattern = function(count, len, sameCase, start, end) { var bonus, sz; sz = count; bonus = 6; if (sameCase === count) { bonus += 2; } if (start) { bonus += 3; } if (end) { bonus += 1; } if (count === len) { if (start) { if (sameCase === len) { sz += 2; } else { sz += 1; } } if (end) { bonus += 1; } } return sameCase + sz * (sz + bonus); }; exports.scoreCharacter = scoreCharacter = function(i, j, start, acro_score, csc_score) { var posBonus; posBonus = scorePosition(i); if (start) { return posBonus + wm * ((acro_score > csc_score ? acro_score : csc_score) + 10); } return posBonus + wm * csc_score; }; exports.scoreConsecutives = scoreConsecutives = function(subject, subject_lw, query, query_lw, i, j, startOfWord) { var k, m, mi, n, nj, sameCase, sz; m = subject.length; n = query.length; mi = m - i; nj = n - j; k = mi < nj ? mi : nj; sameCase = 0; sz = 0; if (query[j] === subject[i]) { sameCase++; } while (++sz < k && query_lw[++j] === subject_lw[++i]) { if (query[j] === subject[i]) { sameCase++; } } if (sz < k) { i--; } if (sz === 1) { return 1 + 2 * sameCase; } return scorePattern(sz, n, sameCase, startOfWord, isWordEnd(i, subject, subject_lw, m)); }; exports.scoreExactMatch = scoreExactMatch = function(subject, subject_lw, query, query_lw, pos, n, m) { var end, i, pos2, sameCase, start; start = isWordStart(pos, subject, subject_lw); if (!start) { pos2 = subject_lw.indexOf(query_lw, pos + 1); if (pos2 > -1) { start = isWordStart(pos2, subject, subject_lw); if (start) { pos = pos2; } } } i = -1; sameCase = 0; while (++i < n) { if (query[pos + i] === subject[i]) { sameCase++; } } end = isWordEnd(pos + n - 1, subject, subject_lw, m); return scoreExact(n, m, scorePattern(n, n, sameCase, start, end), pos); }; AcronymResult = (function() { function AcronymResult(score, pos, count) { this.score = score; this.pos = pos; this.count = count; } return AcronymResult; })(); emptyAcronymResult = new AcronymResult(0, 0.1, 0); exports.scoreAcronyms = scoreAcronyms = function(subject, subject_lw, query, query_lw) { var count, fullWord, i, j, m, n, qj_lw, sameCase, score, sepCount, sumPos; m = subject.length; n = query.length; if (!(m > 1 && n > 1)) { return emptyAcronymResult; } count = 0; sepCount = 0; sumPos = 0; sameCase = 0; i = -1; j = -1; while (++j < n) { qj_lw = query_lw[j]; if (isSeparator(qj_lw)) { i = subject_lw.indexOf(qj_lw, i + 1); if (i > -1) { sepCount++; continue; } else { break; } } while (++i < m) { if (qj_lw === subject_lw[i] && isWordStart(i, subject, subject_lw)) { if (query[j] === subject[i]) { sameCase++; } sumPos += i; count++; break; } } if (i === m) { break; } } if (count < 2) { return emptyAcronymResult; } fullWord = count === n ? isAcronymFullWord(subject, subject_lw, query, count) : false; score = scorePattern(count, n, sameCase, true, fullWord); return new AcronymResult(score, sumPos / count, count + sepCount); }; isAcronymFullWord = function(subject, subject_lw, query, nbAcronymInQuery) { var count, i, m, n; m = subject.length; n = query.length; count = 0; if (m > 12 * n) { return false; } i = -1; while (++i < m) { if (isWordStart(i, subject, subject_lw) && ++count > nbAcronymInQuery) { return false; } } return true; }; }).call(this); /***/ }), /* 164 */ /***/ (function(module, exports, __webpack_require__) { (function() { var computeScore, countDir, file_coeff, getExtension, getExtensionScore, isMatch, scorePath, scoreSize, tau_depth, _ref; _ref = __webpack_require__(163), isMatch = _ref.isMatch, computeScore = _ref.computeScore, scoreSize = _ref.scoreSize; tau_depth = 20; file_coeff = 2.5; exports.score = function(string, query, options) { var allowErrors, preparedQuery, score, string_lw; preparedQuery = options.preparedQuery, allowErrors = options.allowErrors; if (!(allowErrors || isMatch(string, preparedQuery.core_lw, preparedQuery.core_up))) { return 0; } string_lw = string.toLowerCase(); score = computeScore(string, string_lw, preparedQuery); score = scorePath(string, string_lw, score, options); return Math.ceil(score); }; scorePath = function(subject, subject_lw, fullPathScore, options) { var alpha, basePathScore, basePos, depth, end, extAdjust, fileLength, pathSeparator, preparedQuery, useExtensionBonus; if (fullPathScore === 0) { return 0; } preparedQuery = options.preparedQuery, useExtensionBonus = options.useExtensionBonus, pathSeparator = options.pathSeparator; end = subject.length - 1; while (subject[end] === pathSeparator) { end--; } basePos = subject.lastIndexOf(pathSeparator, end); fileLength = end - basePos; extAdjust = 1.0; if (useExtensionBonus) { extAdjust += getExtensionScore(subject_lw, preparedQuery.ext, basePos, end, 2); fullPathScore *= extAdjust; } if (basePos === -1) { return fullPathScore; } depth = preparedQuery.depth; while (basePos > -1 && depth-- > 0) { basePos = subject.lastIndexOf(pathSeparator, basePos - 1); } basePathScore = basePos === -1 ? fullPathScore : extAdjust * computeScore(subject.slice(basePos + 1, end + 1), subject_lw.slice(basePos + 1, end + 1), preparedQuery); alpha = 0.5 * tau_depth / (tau_depth + countDir(subject, end + 1, pathSeparator)); return alpha * basePathScore + (1 - alpha) * fullPathScore * scoreSize(0, file_coeff * fileLength); }; exports.countDir = countDir = function(path, end, pathSeparator) { var count, i; if (end < 1) { return 0; } count = 0; i = -1; while (++i < end && path[i] === pathSeparator) { continue; } while (++i < end) { if (path[i] === pathSeparator) { count++; while (++i < end && path[i] === pathSeparator) { continue; } } } return count; }; exports.getExtension = getExtension = function(str) { var pos; pos = str.lastIndexOf("."); if (pos < 0) { return ""; } else { return str.substr(pos + 1); } }; getExtensionScore = function(candidate, ext, startPos, endPos, maxDepth) { var m, matched, n, pos; if (!ext.length) { return 0; } pos = candidate.lastIndexOf(".", endPos); if (!(pos > startPos)) { return 0; } n = ext.length; m = endPos - pos; if (m < n) { n = m; m = ext.length; } pos++; matched = -1; while (++matched < n) { if (candidate[pos + matched] !== ext[matched]) { break; } } if (matched === 0 && maxDepth > 0) { return 0.9 * getExtensionScore(candidate, ext, startPos, pos - 2, maxDepth - 1); } return matched / m; }; }).call(this); /***/ }), /* 165 */ /***/ (function(module, exports, __webpack_require__) { (function() { var Query, coreChars, countDir, getCharCodes, getExtension, opt_char_re, truncatedUpperCase, _ref; _ref = __webpack_require__(164), countDir = _ref.countDir, getExtension = _ref.getExtension; module.exports = Query = (function() { function Query(query, _arg) { var optCharRegEx, pathSeparator, _ref1; _ref1 = _arg != null ? _arg : {}, optCharRegEx = _ref1.optCharRegEx, pathSeparator = _ref1.pathSeparator; if (!(query && query.length)) { return null; } this.query = query; this.query_lw = query.toLowerCase(); this.core = coreChars(query, optCharRegEx); this.core_lw = this.core.toLowerCase(); this.core_up = truncatedUpperCase(this.core); this.depth = countDir(query, query.length, pathSeparator); this.ext = getExtension(this.query_lw); this.charCodes = getCharCodes(this.query_lw); } return Query; })(); opt_char_re = /[ _\-:\/\\]/g; coreChars = function(query, optCharRegEx) { if (optCharRegEx == null) { optCharRegEx = opt_char_re; } return query.replace(optCharRegEx, ''); }; truncatedUpperCase = function(str) { var char, upper, _i, _len; upper = ""; for (_i = 0, _len = str.length; _i < _len; _i++) { char = str[_i]; upper += char.toUpperCase()[0]; } return upper; }; getCharCodes = function(str) { var charCodes, i, len; len = str.length; i = -1; charCodes = []; while (++i < len) { charCodes[str.charCodeAt(i)] = true; } return charCodes; }; }).call(this); /***/ }), /* 166 */ /***/ (function(module, exports, __webpack_require__) { (function() { var basenameMatch, computeMatch, isMatch, isWordStart, match, mergeMatches, scoreAcronyms, scoreCharacter, scoreConsecutives, _ref; _ref = __webpack_require__(163), isMatch = _ref.isMatch, isWordStart = _ref.isWordStart, scoreConsecutives = _ref.scoreConsecutives, scoreCharacter = _ref.scoreCharacter, scoreAcronyms = _ref.scoreAcronyms; exports.match = match = function(string, query, options) { var allowErrors, baseMatches, matches, pathSeparator, preparedQuery, string_lw; allowErrors = options.allowErrors, preparedQuery = options.preparedQuery, pathSeparator = options.pathSeparator; if (!(allowErrors || isMatch(string, preparedQuery.core_lw, preparedQuery.core_up))) { return []; } string_lw = string.toLowerCase(); matches = computeMatch(string, string_lw, preparedQuery); if (matches.length === 0) { return matches; } if (string.indexOf(pathSeparator) > -1) { baseMatches = basenameMatch(string, string_lw, preparedQuery, pathSeparator); matches = mergeMatches(matches, baseMatches); } return matches; }; exports.wrap = function(string, query, options) { var matchIndex, matchPos, matchPositions, output, strPos, tagClass, tagClose, tagOpen, _ref1; if ((options.wrap != null)) { _ref1 = options.wrap, tagClass = _ref1.tagClass, tagOpen = _ref1.tagOpen, tagClose = _ref1.tagClose; } if (tagClass == null) { tagClass = 'highlight'; } if (tagOpen == null) { tagOpen = ''; } if (tagClose == null) { tagClose = ''; } if (string === query) { return tagOpen + string + tagClose; } matchPositions = match(string, query, options); if (matchPositions.length === 0) { return string; } output = ''; matchIndex = -1; strPos = 0; while (++matchIndex < matchPositions.length) { matchPos = matchPositions[matchIndex]; if (matchPos > strPos) { output += string.substring(strPos, matchPos); strPos = matchPos; } while (++matchIndex < matchPositions.length) { if (matchPositions[matchIndex] === matchPos + 1) { matchPos++; } else { matchIndex--; break; } } matchPos++; if (matchPos > strPos) { output += tagOpen; output += string.substring(strPos, matchPos); output += tagClose; strPos = matchPos; } } if (strPos <= string.length - 1) { output += string.substring(strPos); } return output; }; basenameMatch = function(subject, subject_lw, preparedQuery, pathSeparator) { var basePos, depth, end; end = subject.length - 1; while (subject[end] === pathSeparator) { end--; } basePos = subject.lastIndexOf(pathSeparator, end); if (basePos === -1) { return []; } depth = preparedQuery.depth; while (depth-- > 0) { basePos = subject.lastIndexOf(pathSeparator, basePos - 1); if (basePos === -1) { return []; } } basePos++; end++; return computeMatch(subject.slice(basePos, end), subject_lw.slice(basePos, end), preparedQuery, basePos); }; mergeMatches = function(a, b) { var ai, bj, i, j, m, n, out; m = a.length; n = b.length; if (n === 0) { return a.slice(); } if (m === 0) { return b.slice(); } i = -1; j = 0; bj = b[j]; out = []; while (++i < m) { ai = a[i]; while (bj <= ai && ++j < n) { if (bj < ai) { out.push(bj); } bj = b[j]; } out.push(ai); } while (j < n) { out.push(b[j++]); } return out; }; computeMatch = function(subject, subject_lw, preparedQuery, offset) { var DIAGONAL, LEFT, STOP, UP, acro_score, align, backtrack, csc_diag, csc_row, csc_score, i, j, m, matches, move, n, pos, query, query_lw, score, score_diag, score_row, score_up, si_lw, start, trace; if (offset == null) { offset = 0; } query = preparedQuery.query; query_lw = preparedQuery.query_lw; m = subject.length; n = query.length; acro_score = scoreAcronyms(subject, subject_lw, query, query_lw).score; score_row = new Array(n); csc_row = new Array(n); STOP = 0; UP = 1; LEFT = 2; DIAGONAL = 3; trace = new Array(m * n); pos = -1; j = -1; while (++j < n) { score_row[j] = 0; csc_row[j] = 0; } i = -1; while (++i < m) { score = 0; score_up = 0; csc_diag = 0; si_lw = subject_lw[i]; j = -1; while (++j < n) { csc_score = 0; align = 0; score_diag = score_up; if (query_lw[j] === si_lw) { start = isWordStart(i, subject, subject_lw); csc_score = csc_diag > 0 ? csc_diag : scoreConsecutives(subject, subject_lw, query, query_lw, i, j, start); align = score_diag + scoreCharacter(i, j, start, acro_score, csc_score); } score_up = score_row[j]; csc_diag = csc_row[j]; if (score > score_up) { move = LEFT; } else { score = score_up; move = UP; } if (align > score) { score = align; move = DIAGONAL; } else { csc_score = 0; } score_row[j] = score; csc_row[j] = csc_score; trace[++pos] = score > 0 ? move : STOP; } } i = m - 1; j = n - 1; pos = i * n + j; backtrack = true; matches = []; while (backtrack && i >= 0 && j >= 0) { switch (trace[pos]) { case UP: i--; pos -= n; break; case LEFT: j--; pos--; break; case DIAGONAL: matches.push(i + offset); j--; i--; pos -= n + 1; break; default: backtrack = false; } } matches.reverse(); return matches; }; }).call(this); /***/ }), /* 167 */, /* 168 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(global, module) { Object.defineProperty(exports, "__esModule", { value: true }); var _ponyfill = __webpack_require__(169); var _ponyfill2 = _interopRequireDefault(_ponyfill); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var root; /* global window */ if (typeof self !== 'undefined') { root = self; } else if (typeof window !== 'undefined') { root = window; } else if (typeof global !== 'undefined') { root = global; } else if (true) { root = module; } else { root = Function('return this')(); } var result = (0, _ponyfill2['default'])(root); exports['default'] = result; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(792), __webpack_require__(793)(module))) /***/ }), /* 169 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports['default'] = symbolObservablePonyfill; function symbolObservablePonyfill(root) { var result; var _Symbol = root.Symbol; if (typeof _Symbol === 'function') { if (_Symbol.observable) { result = _Symbol.observable; } else { result = _Symbol('observable'); _Symbol.observable = result; } } else { result = '@@observable'; } return result; }; /***/ }), /* 170 */, /* 171 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = combineReducers; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createStore__ = __webpack_require__(32); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__ = __webpack_require__(33); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_warning__ = __webpack_require__(35); function getUndefinedStateErrorMessage(key, action) { var actionType = action && action.type; var actionName = actionType && '"' + actionType.toString() + '"' || 'an action'; return 'Given action ' + actionName + ', reducer "' + key + '" returned undefined. ' + 'To ignore an action, you must explicitly return the previous state. ' + 'If you want this reducer to hold no value, you can return null instead of undefined.'; } function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { var reducerKeys = Object.keys(reducers); var argumentName = action && action.type === __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* ActionTypes */].INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer'; if (reducerKeys.length === 0) { return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.'; } if (!Object(__WEBPACK_IMPORTED_MODULE_1_lodash_es_isPlainObject__["a" /* default */])(inputState)) { return 'The ' + argumentName + ' has unexpected type of "' + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"'); } var unexpectedKeys = Object.keys(inputState).filter(function (key) { return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; }); unexpectedKeys.forEach(function (key) { unexpectedKeyCache[key] = true; }); if (unexpectedKeys.length > 0) { return 'Unexpected ' + (unexpectedKeys.length > 1 ? 'keys' : 'key') + ' ' + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + '. ') + 'Expected to find one of the known reducer keys instead: ' + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.'); } } function assertReducerShape(reducers) { Object.keys(reducers).forEach(function (key) { var reducer = reducers[key]; var initialState = reducer(undefined, { type: __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* ActionTypes */].INIT }); if (typeof initialState === 'undefined') { throw new Error('Reducer "' + key + '" returned undefined during initialization. ' + 'If the state passed to the reducer is undefined, you must ' + 'explicitly return the initial state. The initial state may ' + 'not be undefined. If you don\'t want to set a value for this reducer, ' + 'you can use null instead of undefined.'); } var type = '@@redux/PROBE_UNKNOWN_ACTION_' + Math.random().toString(36).substring(7).split('').join('.'); if (typeof reducer(undefined, { type: type }) === 'undefined') { throw new Error('Reducer "' + key + '" returned undefined when probed with a random type. ' + ('Don\'t try to handle ' + __WEBPACK_IMPORTED_MODULE_0__createStore__["a" /* ActionTypes */].INIT + ' or other actions in "redux/*" ') + 'namespace. They are considered private. Instead, you must return the ' + 'current state for any unknown actions, unless it is undefined, ' + 'in which case you must return the initial state, regardless of the ' + 'action type. The initial state may not be undefined, but can be null.'); } }); } /** * Turns an object whose values are different reducer functions, into a single * reducer function. It will call every child reducer, and gather their results * into a single state object, whose keys correspond to the keys of the passed * reducer functions. * * @param {Object} reducers An object whose values correspond to different * reducer functions that need to be combined into one. One handy way to obtain * it is to use ES6 `import * as reducers` syntax. The reducers may never return * undefined for any action. Instead, they should return their initial state * if the state passed to them was undefined, and the current state for any * unrecognized action. * * @returns {Function} A reducer function that invokes every reducer inside the * passed object, and builds a state object with the same shape. */ function combineReducers(reducers) { var reducerKeys = Object.keys(reducers); var finalReducers = {}; for (var i = 0; i < reducerKeys.length; i++) { var key = reducerKeys[i]; if (false) { if (typeof reducers[key] === 'undefined') { warning('No reducer provided for key "' + key + '"'); } } if (typeof reducers[key] === 'function') { finalReducers[key] = reducers[key]; } } var finalReducerKeys = Object.keys(finalReducers); var unexpectedKeyCache = void 0; if (false) { unexpectedKeyCache = {}; } var shapeAssertionError = void 0; try { assertReducerShape(finalReducers); } catch (e) { shapeAssertionError = e; } return function combination() { var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var action = arguments[1]; if (shapeAssertionError) { throw shapeAssertionError; } if (false) { var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache); if (warningMessage) { warning(warningMessage); } } var hasChanged = false; var nextState = {}; for (var _i = 0; _i < finalReducerKeys.length; _i++) { var _key = finalReducerKeys[_i]; var reducer = finalReducers[_key]; var previousStateForKey = state[_key]; var nextStateForKey = reducer(previousStateForKey, action); if (typeof nextStateForKey === 'undefined') { var errorMessage = getUndefinedStateErrorMessage(_key, action); throw new Error(errorMessage); } nextState[_key] = nextStateForKey; hasChanged = hasChanged || nextStateForKey !== previousStateForKey; } return hasChanged ? nextState : state; }; } /***/ }), /* 172 */, /* 173 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = bindActionCreators; function bindActionCreator(actionCreator, dispatch) { return function () { return dispatch(actionCreator.apply(undefined, arguments)); }; } /** * Turns an object whose values are action creators, into an object with the * same keys, but with every function wrapped into a `dispatch` call so they * may be invoked directly. This is just a convenience method, as you can call * `store.dispatch(MyActionCreators.doSomething())` yourself just fine. * * For convenience, you can also pass a single function as the first argument, * and get a function in return. * * @param {Function|Object} actionCreators An object whose values are action * creator functions. One handy way to obtain it is to use ES6 `import * as` * syntax. You may also pass a single function. * * @param {Function} dispatch The `dispatch` function available on your Redux * store. * * @returns {Function|Object} The object mimicking the original object, but with * every action creator wrapped into the `dispatch` call. If you passed a * function as `actionCreators`, the return value will also be a single * function. */ function bindActionCreators(actionCreators, dispatch) { if (typeof actionCreators === 'function') { return bindActionCreator(actionCreators, dispatch); } if (typeof actionCreators !== 'object' || actionCreators === null) { throw new Error('bindActionCreators expected an object or a function, instead received ' + (actionCreators === null ? 'null' : typeof actionCreators) + '. ' + 'Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?'); } var keys = Object.keys(actionCreators); var boundActionCreators = {}; for (var i = 0; i < keys.length; i++) { var key = keys[i]; var actionCreator = actionCreators[key]; if (typeof actionCreator === 'function') { boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); } } return boundActionCreators; } /***/ }), /* 174 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = applyMiddleware; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__compose__ = __webpack_require__(36); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /** * Creates a store enhancer that applies middleware to the dispatch method * of the Redux store. This is handy for a variety of tasks, such as expressing * asynchronous actions in a concise manner, or logging every action payload. * * See `redux-thunk` package as an example of the Redux middleware. * * Because middleware is potentially asynchronous, this should be the first * store enhancer in the composition chain. * * Note that each middleware will be given the `dispatch` and `getState` functions * as named arguments. * * @param {...Function} middlewares The middleware chain to be applied. * @returns {Function} A store enhancer applying the middleware. */ function applyMiddleware() { for (var _len = arguments.length, middlewares = Array(_len), _key = 0; _key < _len; _key++) { middlewares[_key] = arguments[_key]; } return function (createStore) { return function (reducer, preloadedState, enhancer) { var store = createStore(reducer, preloadedState, enhancer); var _dispatch = store.dispatch; var chain = []; var middlewareAPI = { getState: store.getState, dispatch: function dispatch(action) { return _dispatch(action); } }; chain = middlewares.map(function (middleware) { return middleware(middlewareAPI); }); _dispatch = __WEBPACK_IMPORTED_MODULE_0__compose__["a" /* default */].apply(undefined, chain)(store.dispatch); return _extends({}, store, { dispatch: _dispatch }); }; }; } /***/ }), /* 175 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2016 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ /* global define */ (function () { 'use strict'; var hasOwn = {}.hasOwnProperty; function classNames () { var classes = []; for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (!arg) continue; var argType = typeof arg; if (argType === 'string' || argType === 'number') { classes.push(arg); } else if (Array.isArray(arg)) { classes.push(classNames.apply(null, arg)); } else if (argType === 'object') { for (var key in arg) { if (hasOwn.call(arg, key) && arg[key]) { classes.push(key); } } } } return classes.join(' '); } if (typeof module !== 'undefined' && module.exports) { module.exports = classNames; } else if (true) { // register as 'classnames', consistent with npm package name !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () { return classNames; }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else { window.classNames = classNames; } }()); /***/ }), /* 176 */, /* 177 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * 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 emptyFunction = __webpack_require__(178); var invariant = __webpack_require__(180); var ReactPropTypesSecret = __webpack_require__(187); module.exports = function() { function shim(props, propName, componentName, location, propFullName, secret) { if (secret === ReactPropTypesSecret) { // It is still safe when called from React. return; } invariant( false, 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types' ); }; shim.isRequired = shim; function getShim() { return shim; }; // Important! // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. var ReactPropTypes = { array: shim, bool: shim, func: shim, number: shim, object: shim, string: shim, symbol: shim, any: shim, arrayOf: getShim, element: shim, instanceOf: getShim, node: shim, objectOf: getShim, oneOf: getShim, oneOfType: getShim, shape: getShim, exact: getShim }; ReactPropTypes.checkPropTypes = emptyFunction; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; /***/ }), /* 178 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * 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. * * */ function makeEmptyFunction(arg) { return function () { return arg; }; } /** * This function accepts and discards inputs; it has no side effects. This is * primarily useful idiomatically for overridable function endpoints which * always need to be callable, since JS lacks a null-call idiom ala Cocoa. */ var emptyFunction = function emptyFunction() {}; emptyFunction.thatReturns = makeEmptyFunction; emptyFunction.thatReturnsFalse = makeEmptyFunction(false); emptyFunction.thatReturnsTrue = makeEmptyFunction(true); emptyFunction.thatReturnsNull = makeEmptyFunction(null); emptyFunction.thatReturnsThis = function () { return this; }; emptyFunction.thatReturnsArgument = function (arg) { return arg; }; module.exports = emptyFunction; /***/ }), /* 179 */, /* 180 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * 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. * */ /** * 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. */ var validateFormat = function validateFormat(format) {}; if (false) { validateFormat = function validateFormat(format) { if (format === undefined) { throw new Error('invariant requires an error message argument'); } }; } function invariant(condition, format, a, b, c, d, e, f) { validateFormat(format); if (!condition) { var error; if (format === undefined) { error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); } else { var args = [a, b, c, d, e, f]; var argIndex = 0; error = new Error(format.replace(/%s/g, function () { return args[argIndex++]; })); error.name = 'Invariant Violation'; } error.framesToPop = 1; // we don't care about invariant's own frame throw error; } } module.exports = invariant; /***/ }), /* 181 */, /* 182 */, /* 183 */, /* 184 */, /* 185 */, /* 186 */, /* 187 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * 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 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; module.exports = ReactPropTypesSecret; /***/ }), /* 188 */, /* 189 */, /* 190 */, /* 191 */, /* 192 */, /* 193 */, /* 194 */, /* 195 */, /* 196 */, /* 197 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_197__; /***/ }), /* 198 */, /* 199 */, /* 200 */, /* 201 */, /* 202 */, /* 203 */, /* 204 */, /* 205 */, /* 206 */, /* 207 */, /* 208 */ /***/ (function(module, exports, __webpack_require__) { var baseIsArguments = __webpack_require__(209), isObjectLike = __webpack_require__(14); /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Built-in value references. */ var propertyIsEnumerable = objectProto.propertyIsEnumerable; /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); }; module.exports = isArguments; /***/ }), /* 209 */ /***/ (function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(6), isObjectLike = __webpack_require__(14); /** `Object#toString` result references. */ var argsTag = '[object Arguments]'; /** * The base implementation of `_.isArguments`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag; } module.exports = baseIsArguments; /***/ }), /* 210 */, /* 211 */, /* 212 */, /* 213 */, /* 214 */ /***/ (function(module, exports) { /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } module.exports = isLength; /***/ }), /* 215 */, /* 216 */, /* 217 */, /* 218 */, /* 219 */, /* 220 */, /* 221 */, /* 222 */, /* 223 */, /* 224 */, /* 225 */, /* 226 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* 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 . */ // @flow const { isDevelopment } = __webpack_require__(1355); const { Services, PrefsHelper } = __webpack_require__(1376); const prefsSchemaVersion = "1.0.3"; const pref = Services.pref; if (isDevelopment()) { pref("devtools.debugger.auto-pretty-print", true); pref("devtools.source-map.client-service.enabled", true); pref("devtools.debugger.pause-on-exceptions", false); pref("devtools.debugger.ignore-caught-exceptions", false); pref("devtools.debugger.call-stack-visible", false); pref("devtools.debugger.start-panel-collapsed", false); pref("devtools.debugger.end-panel-collapsed", false); pref("devtools.debugger.tabs", "[]"); pref("devtools.debugger.ui.framework-grouping-on", true); pref("devtools.debugger.pending-selected-location", "{}"); pref("devtools.debugger.pending-breakpoints", "{}"); pref("devtools.debugger.expressions", "[]"); pref("devtools.debugger.file-search-case-sensitive", false); pref("devtools.debugger.file-search-whole-word", false); pref("devtools.debugger.file-search-regex-match", false); pref("devtools.debugger.project-directory-root", ""); pref("devtools.debugger.prefs-schema-version", "1.0.1"); pref("devtools.debugger.features.project-text-search", true); pref("devtools.debugger.features.async-stepping", true); pref("devtools.debugger.features.wasm", true); pref("devtools.debugger.features.shortcuts", true); pref("devtools.debugger.features.root", true); pref("devtools.debugger.features.column-breakpoints", true); pref("devtools.debugger.features.map-scopes", true); pref("devtools.debugger.features.breakpoints-dropdown", true); pref("devtools.debugger.features.remove-command-bar-options", true); } const prefs = new PrefsHelper("devtools", { autoPrettyPrint: ["Bool", "debugger.auto-pretty-print"], clientSourceMapsEnabled: ["Bool", "source-map.client-service.enabled"], pauseOnExceptions: ["Bool", "debugger.pause-on-exceptions"], ignoreCaughtExceptions: ["Bool", "debugger.ignore-caught-exceptions"], callStackVisible: ["Bool", "debugger.call-stack-visible"], startPanelCollapsed: ["Bool", "debugger.start-panel-collapsed"], endPanelCollapsed: ["Bool", "debugger.end-panel-collapsed"], frameworkGroupingOn: ["Bool", "debugger.ui.framework-grouping-on"], tabs: ["Json", "debugger.tabs", []], pendingSelectedLocation: ["Json", "debugger.pending-selected-location", {}], pendingBreakpoints: ["Json", "debugger.pending-breakpoints", {}], expressions: ["Json", "debugger.expressions", []], fileSearchCaseSensitive: ["Bool", "debugger.file-search-case-sensitive"], fileSearchWholeWord: ["Bool", "debugger.file-search-whole-word"], fileSearchRegexMatch: ["Bool", "debugger.file-search-regex-match"], debuggerPrefsSchemaVersion: ["Char", "debugger.prefs-schema-version"], projectDirectoryRoot: ["Char", "project-directory-root", ""] }); /* harmony export (immutable) */ __webpack_exports__["prefs"] = prefs; const features = new PrefsHelper("devtools.debugger.features", { asyncStepping: ["Bool", "async-stepping", false], projectTextSearch: ["Bool", "project-text-search", true], wasm: ["Bool", "wasm", true], shortcuts: ["Bool", "shortcuts", true], root: ["Bool", "root", false], columnBreakpoints: ["Bool", "column-breakpoints", false], mapScopes: ["Bool", "map-scopes", true], breakpointsDropdown: ["Bool", "breakpoints-dropdown", true], removeCommandBarOptions: ["Bool", "remove-command-bar-options", true] }); /* harmony export (immutable) */ __webpack_exports__["features"] = features; if (prefs.debuggerPrefsSchemaVersion !== prefsSchemaVersion) { // clear pending Breakpoints prefs.pendingBreakpoints = {}; prefs.debuggerPrefsSchemaVersion = prefsSchemaVersion; } /***/ }), /* 227 */, /* 228 */, /* 229 */, /* 230 */, /* 231 */, /* 232 */, /* 233 */, /* 234 */, /* 235 */, /* 236 */, /* 237 */, /* 238 */, /* 239 */, /* 240 */, /* 241 */, /* 242 */, /* 243 */, /* 244 */, /* 245 */, /* 246 */, /* 247 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 248 */ /***/ (function(module, exports, __webpack_require__) { (function(){ var crypt = __webpack_require__(249), utf8 = __webpack_require__(250).utf8, isBuffer = __webpack_require__(251), bin = __webpack_require__(250).bin, // The core md5 = function (message, options) { // Convert to byte array if (message.constructor == String) if (options && options.encoding === 'binary') message = bin.stringToBytes(message); else message = utf8.stringToBytes(message); else if (isBuffer(message)) message = Array.prototype.slice.call(message, 0); else if (!Array.isArray(message)) message = message.toString(); // else, assume byte array already var m = crypt.bytesToWords(message), l = message.length * 8, a = 1732584193, b = -271733879, c = -1732584194, d = 271733878; // Swap endian for (var i = 0; i < m.length; i++) { m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF | ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00; } // Padding m[l >>> 5] |= 0x80 << (l % 32); m[(((l + 64) >>> 9) << 4) + 14] = l; // Method shortcuts var FF = md5._ff, GG = md5._gg, HH = md5._hh, II = md5._ii; for (var i = 0; i < m.length; i += 16) { var aa = a, bb = b, cc = c, dd = d; a = FF(a, b, c, d, m[i+ 0], 7, -680876936); d = FF(d, a, b, c, m[i+ 1], 12, -389564586); c = FF(c, d, a, b, m[i+ 2], 17, 606105819); b = FF(b, c, d, a, m[i+ 3], 22, -1044525330); a = FF(a, b, c, d, m[i+ 4], 7, -176418897); d = FF(d, a, b, c, m[i+ 5], 12, 1200080426); c = FF(c, d, a, b, m[i+ 6], 17, -1473231341); b = FF(b, c, d, a, m[i+ 7], 22, -45705983); a = FF(a, b, c, d, m[i+ 8], 7, 1770035416); d = FF(d, a, b, c, m[i+ 9], 12, -1958414417); c = FF(c, d, a, b, m[i+10], 17, -42063); b = FF(b, c, d, a, m[i+11], 22, -1990404162); a = FF(a, b, c, d, m[i+12], 7, 1804603682); d = FF(d, a, b, c, m[i+13], 12, -40341101); c = FF(c, d, a, b, m[i+14], 17, -1502002290); b = FF(b, c, d, a, m[i+15], 22, 1236535329); a = GG(a, b, c, d, m[i+ 1], 5, -165796510); d = GG(d, a, b, c, m[i+ 6], 9, -1069501632); c = GG(c, d, a, b, m[i+11], 14, 643717713); b = GG(b, c, d, a, m[i+ 0], 20, -373897302); a = GG(a, b, c, d, m[i+ 5], 5, -701558691); d = GG(d, a, b, c, m[i+10], 9, 38016083); c = GG(c, d, a, b, m[i+15], 14, -660478335); b = GG(b, c, d, a, m[i+ 4], 20, -405537848); a = GG(a, b, c, d, m[i+ 9], 5, 568446438); d = GG(d, a, b, c, m[i+14], 9, -1019803690); c = GG(c, d, a, b, m[i+ 3], 14, -187363961); b = GG(b, c, d, a, m[i+ 8], 20, 1163531501); a = GG(a, b, c, d, m[i+13], 5, -1444681467); d = GG(d, a, b, c, m[i+ 2], 9, -51403784); c = GG(c, d, a, b, m[i+ 7], 14, 1735328473); b = GG(b, c, d, a, m[i+12], 20, -1926607734); a = HH(a, b, c, d, m[i+ 5], 4, -378558); d = HH(d, a, b, c, m[i+ 8], 11, -2022574463); c = HH(c, d, a, b, m[i+11], 16, 1839030562); b = HH(b, c, d, a, m[i+14], 23, -35309556); a = HH(a, b, c, d, m[i+ 1], 4, -1530992060); d = HH(d, a, b, c, m[i+ 4], 11, 1272893353); c = HH(c, d, a, b, m[i+ 7], 16, -155497632); b = HH(b, c, d, a, m[i+10], 23, -1094730640); a = HH(a, b, c, d, m[i+13], 4, 681279174); d = HH(d, a, b, c, m[i+ 0], 11, -358537222); c = HH(c, d, a, b, m[i+ 3], 16, -722521979); b = HH(b, c, d, a, m[i+ 6], 23, 76029189); a = HH(a, b, c, d, m[i+ 9], 4, -640364487); d = HH(d, a, b, c, m[i+12], 11, -421815835); c = HH(c, d, a, b, m[i+15], 16, 530742520); b = HH(b, c, d, a, m[i+ 2], 23, -995338651); a = II(a, b, c, d, m[i+ 0], 6, -198630844); d = II(d, a, b, c, m[i+ 7], 10, 1126891415); c = II(c, d, a, b, m[i+14], 15, -1416354905); b = II(b, c, d, a, m[i+ 5], 21, -57434055); a = II(a, b, c, d, m[i+12], 6, 1700485571); d = II(d, a, b, c, m[i+ 3], 10, -1894986606); c = II(c, d, a, b, m[i+10], 15, -1051523); b = II(b, c, d, a, m[i+ 1], 21, -2054922799); a = II(a, b, c, d, m[i+ 8], 6, 1873313359); d = II(d, a, b, c, m[i+15], 10, -30611744); c = II(c, d, a, b, m[i+ 6], 15, -1560198380); b = II(b, c, d, a, m[i+13], 21, 1309151649); a = II(a, b, c, d, m[i+ 4], 6, -145523070); d = II(d, a, b, c, m[i+11], 10, -1120210379); c = II(c, d, a, b, m[i+ 2], 15, 718787259); b = II(b, c, d, a, m[i+ 9], 21, -343485551); a = (a + aa) >>> 0; b = (b + bb) >>> 0; c = (c + cc) >>> 0; d = (d + dd) >>> 0; } return crypt.endian([a, b, c, d]); }; // Auxiliary functions md5._ff = function (a, b, c, d, x, s, t) { var n = a + (b & c | ~b & d) + (x >>> 0) + t; return ((n << s) | (n >>> (32 - s))) + b; }; md5._gg = function (a, b, c, d, x, s, t) { var n = a + (b & d | c & ~d) + (x >>> 0) + t; return ((n << s) | (n >>> (32 - s))) + b; }; md5._hh = function (a, b, c, d, x, s, t) { var n = a + (b ^ c ^ d) + (x >>> 0) + t; return ((n << s) | (n >>> (32 - s))) + b; }; md5._ii = function (a, b, c, d, x, s, t) { var n = a + (c ^ (b | ~d)) + (x >>> 0) + t; return ((n << s) | (n >>> (32 - s))) + b; }; // Package private blocksize md5._blocksize = 16; md5._digestsize = 16; module.exports = function (message, options) { if (message === undefined || message === null) throw new Error('Illegal argument ' + message); var digestbytes = crypt.wordsToBytes(md5(message, options)); return options && options.asBytes ? digestbytes : options && options.asString ? bin.bytesToString(digestbytes) : crypt.bytesToHex(digestbytes); }; })(); /***/ }), /* 249 */ /***/ (function(module, exports) { (function() { var base64map = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', crypt = { // Bit-wise rotation left rotl: function(n, b) { return (n << b) | (n >>> (32 - b)); }, // Bit-wise rotation right rotr: function(n, b) { return (n << (32 - b)) | (n >>> b); }, // Swap big-endian to little-endian and vice versa endian: function(n) { // If number given, swap endian if (n.constructor == Number) { return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00; } // Else, assume array and swap all items for (var i = 0; i < n.length; i++) n[i] = crypt.endian(n[i]); return n; }, // Generate an array of any length of random bytes randomBytes: function(n) { for (var bytes = []; n > 0; n--) bytes.push(Math.floor(Math.random() * 256)); return bytes; }, // Convert a byte array to big-endian 32-bit words bytesToWords: function(bytes) { for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8) words[b >>> 5] |= bytes[i] << (24 - b % 32); return words; }, // Convert big-endian 32-bit words to a byte array wordsToBytes: function(words) { for (var bytes = [], b = 0; b < words.length * 32; b += 8) bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF); return bytes; }, // Convert a byte array to a hex string bytesToHex: function(bytes) { for (var hex = [], i = 0; i < bytes.length; i++) { hex.push((bytes[i] >>> 4).toString(16)); hex.push((bytes[i] & 0xF).toString(16)); } return hex.join(''); }, // Convert a hex string to a byte array hexToBytes: function(hex) { for (var bytes = [], c = 0; c < hex.length; c += 2) bytes.push(parseInt(hex.substr(c, 2), 16)); return bytes; }, // Convert a byte array to a base-64 string bytesToBase64: function(bytes) { for (var base64 = [], i = 0; i < bytes.length; i += 3) { var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2]; for (var j = 0; j < 4; j++) if (i * 8 + j * 6 <= bytes.length * 8) base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F)); else base64.push('='); } return base64.join(''); }, // Convert a base-64 string to a byte array base64ToBytes: function(base64) { // Remove non-base-64 characters base64 = base64.replace(/[^A-Z0-9+\/]/ig, ''); for (var bytes = [], i = 0, imod4 = 0; i < base64.length; imod4 = ++i % 4) { if (imod4 == 0) continue; bytes.push(((base64map.indexOf(base64.charAt(i - 1)) & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2)) | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2))); } return bytes; } }; module.exports = crypt; })(); /***/ }), /* 250 */ /***/ (function(module, exports) { var charenc = { // UTF-8 encoding utf8: { // Convert a string to a byte array stringToBytes: function(str) { return charenc.bin.stringToBytes(unescape(encodeURIComponent(str))); }, // Convert a byte array to a string bytesToString: function(bytes) { return decodeURIComponent(escape(charenc.bin.bytesToString(bytes))); } }, // Binary encoding bin: { // Convert a string to a byte array stringToBytes: function(str) { for (var bytes = [], i = 0; i < str.length; i++) bytes.push(str.charCodeAt(i) & 0xFF); return bytes; }, // Convert a byte array to a string bytesToString: function(bytes) { for (var str = [], i = 0; i < bytes.length; i++) str.push(String.fromCharCode(bytes[i])); return str.join(''); } } }; module.exports = charenc; /***/ }), /* 251 */ /***/ (function(module, exports) { /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ // The _isBuffer check is for Safari 5-7 support, because it's missing // Object.prototype.constructor. Remove this eventually module.exports = function (obj) { return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) } function isBuffer (obj) { return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) } // For Node v0.10 support. Remove this eventually. function isSlowBuffer (obj) { return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) } /***/ }), /* 252 */, /* 253 */, /* 254 */, /* 255 */, /* 256 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 257 */, /* 258 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 259 */ /***/ (function(module, exports, __webpack_require__) { var toString = __webpack_require__(108); /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); /** * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped string. * @example * * _.escapeRegExp('[lodash](https://lodash.com/)'); * // => '\[lodash\]\(https://lodash\.com/\)' */ function escapeRegExp(string) { string = toString(string); return (string && reHasRegExpChar.test(string)) ? string.replace(reRegExpChar, '\\$&') : string; } module.exports = escapeRegExp; /***/ }), /* 260 */, /* 261 */, /* 262 */, /* 263 */, /* 264 */, /* 265 */, /* 266 */, /* 267 */, /* 268 */, /* 269 */, /* 270 */, /* 271 */, /* 272 */, /* 273 */, /* 274 */, /* 275 */, /* 276 */, /* 277 */, /* 278 */, /* 279 */, /* 280 */, /* 281 */, /* 282 */, /* 283 */, /* 284 */, /* 285 */, /* 286 */, /* 287 */, /* 288 */, /* 289 */, /* 290 */, /* 291 */, /* 292 */, /* 293 */, /* 294 */, /* 295 */, /* 296 */, /* 297 */ /***/ (function(module, exports, __webpack_require__) { var castPath = __webpack_require__(69), isArguments = __webpack_require__(208), isArray = __webpack_require__(70), isIndex = __webpack_require__(117), isLength = __webpack_require__(214), toKey = __webpack_require__(111); /** * Checks if `path` exists on `object`. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @param {Function} hasFunc The function to check properties. * @returns {boolean} Returns `true` if `path` exists, else `false`. */ function hasPath(object, path, hasFunc) { path = castPath(path, object); var index = -1, length = path.length, result = false; while (++index < length) { var key = toKey(path[index]); if (!(result = object != null && hasFunc(object, key))) { break; } object = object[key]; } if (result || ++index != length) { return result; } length = object == null ? 0 : object.length; return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); } module.exports = hasPath; /***/ }), /* 298 */, /* 299 */, /* 300 */, /* 301 */, /* 302 */, /* 303 */, /* 304 */, /* 305 */, /* 306 */, /* 307 */ /***/ (function(module, exports, __webpack_require__) { var baseHas = __webpack_require__(308), hasPath = __webpack_require__(297); /** * Checks if `path` is a direct property of `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = { 'a': { 'b': 2 } }; * var other = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.has(object, 'a'); * // => true * * _.has(object, 'a.b'); * // => true * * _.has(object, ['a', 'b']); * // => true * * _.has(other, 'a'); * // => false */ function has(object, path) { return object != null && hasPath(object, path, baseHas); } module.exports = has; /***/ }), /* 308 */ /***/ (function(module, exports) { /** Used for built-in method references. */ var objectProto = Object.prototype; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * The base implementation of `_.has` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHas(object, key) { return object != null && hasOwnProperty.call(object, key); } module.exports = baseHas; /***/ }), /* 309 */, /* 310 */, /* 311 */, /* 312 */, /* 313 */, /* 314 */, /* 315 */, /* 316 */, /* 317 */, /* 318 */, /* 319 */, /* 320 */, /* 321 */, /* 322 */, /* 323 */, /* 324 */, /* 325 */, /* 326 */, /* 327 */, /* 328 */, /* 329 */, /* 330 */, /* 331 */, /* 332 */, /* 333 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.EXITING = exports.ENTERED = exports.ENTERING = exports.EXITED = exports.UNMOUNTED = undefined; var _propTypes = __webpack_require__(20); var PropTypes = _interopRequireWildcard(_propTypes); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactDom = __webpack_require__(4); var _reactDom2 = _interopRequireDefault(_reactDom); var _PropTypes = __webpack_require__(335); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } 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 UNMOUNTED = exports.UNMOUNTED = 'unmounted'; var EXITED = exports.EXITED = 'exited'; var ENTERING = exports.ENTERING = 'entering'; var ENTERED = exports.ENTERED = 'entered'; var EXITING = exports.EXITING = 'exiting'; /** * The Transition component lets you describe a transition from one component * state to another _over time_ with a simple declarative API. Most commonly * it's used to animate the mounting and unmounting of a component, but can also * be used to describe in-place transition states as well. * * By default the `Transition` component does not alter the behavior of the * component it renders, it only tracks "enter" and "exit" states for the components. * It's up to you to give meaning and effect to those states. For example we can * add styles to a component when it enters or exits: * * ```jsx * import Transition from 'react-transition-group/Transition'; * * const duration = 300; * * const defaultStyle = { * transition: `opacity ${duration}ms ease-in-out`, * opacity: 0, * } * * const transitionStyles = { * entering: { opacity: 0 }, * entered: { opacity: 1 }, * }; * * const Fade = ({ in: inProp }) => ( * * {(state) => ( *
* I'm A fade Transition! *
* )} *
* ); * ``` * * As noted the `Transition` component doesn't _do_ anything by itself to its child component. * What it does do is track transition states over time so you can update the * component (such as by adding styles or classes) when it changes states. * * There are 4 main states a Transition can be in: * - `ENTERING` * - `ENTERED` * - `EXITING` * - `EXITED` * * Transition state is toggled via the `in` prop. When `true` the component begins the * "Enter" stage. During this stage, the component will shift from its current transition state, * to `'entering'` for the duration of the transition and then to the `'entered'` stage once * it's complete. Let's take the following example: * * ```jsx * state= { in: false }; * * toggleEnterState = () => { * this.setState({ in: true }); * } * * render() { * return ( *
* * *
* ); * } * ``` * * When the button is clicked the component will shift to the `'entering'` state and * stay there for 500ms (the value of `timeout`) when finally switches to `'entered'`. * * When `in` is `false` the same thing happens except the state moves from `'exiting'` to `'exited'`. */ var Transition = function (_React$Component) { _inherits(Transition, _React$Component); function Transition(props, context) { _classCallCheck(this, Transition); var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context)); var parentGroup = context.transitionGroup; // In the context of a TransitionGroup all enters are really appears var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear; var initialStatus = void 0; _this.nextStatus = null; if (props.in) { if (appear) { initialStatus = EXITED; _this.nextStatus = ENTERING; } else { initialStatus = ENTERED; } } else { if (props.unmountOnExit || props.mountOnEnter) { initialStatus = UNMOUNTED; } else { initialStatus = EXITED; } } _this.state = { status: initialStatus }; _this.nextCallback = null; return _this; } Transition.prototype.getChildContext = function getChildContext() { return { transitionGroup: null }; // allows for nested Transitions }; Transition.prototype.componentDidMount = function componentDidMount() { this.updateStatus(true); }; Transition.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { var _ref = this.pendingState || this.state, status = _ref.status; if (nextProps.in) { if (status === UNMOUNTED) { this.setState({ status: EXITED }); } if (status !== ENTERING && status !== ENTERED) { this.nextStatus = ENTERING; } } else { if (status === ENTERING || status === ENTERED) { this.nextStatus = EXITING; } } }; Transition.prototype.componentDidUpdate = function componentDidUpdate() { this.updateStatus(); }; Transition.prototype.componentWillUnmount = function componentWillUnmount() { this.cancelNextCallback(); }; Transition.prototype.getTimeouts = function getTimeouts() { var timeout = this.props.timeout; var exit = void 0, enter = void 0, appear = void 0; exit = enter = appear = timeout; if (timeout != null && typeof timeout !== 'number') { exit = timeout.exit; enter = timeout.enter; appear = timeout.appear; } return { exit: exit, enter: enter, appear: appear }; }; Transition.prototype.updateStatus = function updateStatus() { var mounting = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; var nextStatus = this.nextStatus; if (nextStatus !== null) { this.nextStatus = null; // nextStatus will always be ENTERING or EXITING. this.cancelNextCallback(); var node = _reactDom2.default.findDOMNode(this); if (nextStatus === ENTERING) { this.performEnter(node, mounting); } else { this.performExit(node); } } else if (this.props.unmountOnExit && this.state.status === EXITED) { this.setState({ status: UNMOUNTED }); } }; Transition.prototype.performEnter = function performEnter(node, mounting) { var _this2 = this; var enter = this.props.enter; var appearing = this.context.transitionGroup ? this.context.transitionGroup.isMounting : mounting; var timeouts = this.getTimeouts(); // no enter animation skip right to ENTERED // if we are mounting and running this it means appear _must_ be set if (!mounting && !enter) { this.safeSetState({ status: ENTERED }, function () { _this2.props.onEntered(node); }); return; } this.props.onEnter(node, appearing); this.safeSetState({ status: ENTERING }, function () { _this2.props.onEntering(node, appearing); // FIXME: appear timeout? _this2.onTransitionEnd(node, timeouts.enter, function () { _this2.safeSetState({ status: ENTERED }, function () { _this2.props.onEntered(node, appearing); }); }); }); }; Transition.prototype.performExit = function performExit(node) { var _this3 = this; var exit = this.props.exit; var timeouts = this.getTimeouts(); // no exit animation skip right to EXITED if (!exit) { this.safeSetState({ status: EXITED }, function () { _this3.props.onExited(node); }); return; } this.props.onExit(node); this.safeSetState({ status: EXITING }, function () { _this3.props.onExiting(node); _this3.onTransitionEnd(node, timeouts.exit, function () { _this3.safeSetState({ status: EXITED }, function () { _this3.props.onExited(node); }); }); }); }; Transition.prototype.cancelNextCallback = function cancelNextCallback() { if (this.nextCallback !== null) { this.nextCallback.cancel(); this.nextCallback = null; } }; Transition.prototype.safeSetState = function safeSetState(nextState, callback) { var _this4 = this; // We need to track pending updates for instances where a cWRP fires quickly // after cDM and before the state flushes, which would double trigger a // transition this.pendingState = nextState; // This shouldn't be necessary, but there are weird race conditions with // setState callbacks and unmounting in testing, so always make sure that // we can cancel any pending setState callbacks after we unmount. callback = this.setNextCallback(callback); this.setState(nextState, function () { _this4.pendingState = null; callback(); }); }; Transition.prototype.setNextCallback = function setNextCallback(callback) { var _this5 = this; var active = true; this.nextCallback = function (event) { if (active) { active = false; _this5.nextCallback = null; callback(event); } }; this.nextCallback.cancel = function () { active = false; }; return this.nextCallback; }; Transition.prototype.onTransitionEnd = function onTransitionEnd(node, timeout, handler) { this.setNextCallback(handler); if (node) { if (this.props.addEndListener) { this.props.addEndListener(node, this.nextCallback); } if (timeout != null) { setTimeout(this.nextCallback, timeout); } } else { setTimeout(this.nextCallback, 0); } }; Transition.prototype.render = function render() { var status = this.state.status; if (status === UNMOUNTED) { return null; } var _props = this.props, children = _props.children, childProps = _objectWithoutProperties(_props, ['children']); // filter props for Transtition delete childProps.in; delete childProps.mountOnEnter; delete childProps.unmountOnExit; delete childProps.appear; delete childProps.enter; delete childProps.exit; delete childProps.timeout; delete childProps.addEndListener; delete childProps.onEnter; delete childProps.onEntering; delete childProps.onEntered; delete childProps.onExit; delete childProps.onExiting; delete childProps.onExited; if (typeof children === 'function') { return children(status, childProps); } var child = _react2.default.Children.only(children); return _react2.default.cloneElement(child, childProps); }; return Transition; }(_react2.default.Component); Transition.contextTypes = { transitionGroup: PropTypes.object }; Transition.childContextTypes = { transitionGroup: function transitionGroup() {} }; Transition.propTypes = false ? { /** * A `function` child can be used instead of a React element. * This function is called with the current transition status * ('entering', 'entered', 'exiting', 'exited', 'unmounted'), which can used * to apply context specific props to a component. * * ```jsx * * {(status) => ( * * )} * * ``` */ children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired, /** * Show the component; triggers the enter or exit states */ in: PropTypes.bool, /** * By default the child component is mounted immediately along with * the parent `Transition` component. If you want to "lazy mount" the component on the * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay * mounted, even on "exited", unless you also specify `unmountOnExit`. */ mountOnEnter: PropTypes.bool, /** * By default the child component stays mounted after it reaches the `'exited'` state. * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting. */ unmountOnExit: PropTypes.bool, /** * Normally a component is not transitioned if it is shown when the `` component mounts. * If you want to transition on the first mount set `appear` to `true`, and the * component will transition in as soon as the `` mounts. * * > Note: there are no specific "appear" states. `appear` only adds an additional `enter` transition. */ appear: PropTypes.bool, /** * Enable or disable enter transitions. */ enter: PropTypes.bool, /** * Enable or disable exit transitions. */ exit: PropTypes.bool, /** * The duration of the transition, in milliseconds. * Required unless `addEventListener` is provided * * You may specify a single timeout for all transitions like: `timeout={500}`, * or individually like: * * ```jsx * timeout={{ * enter: 300, * exit: 500, * }} * ``` * * @type {number | { enter?: number, exit?: number }} */ timeout: function timeout(props) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } var pt = _PropTypes.timeoutsShape; if (!props.addEndListener) pt = pt.isRequired; return pt.apply(undefined, [props].concat(args)); }, /** * Add a custom transition end trigger. Called with the transitioning * DOM node and a `done` callback. Allows for more fine grained transition end * logic. **Note:** Timeouts are still used as a fallback if provided. * * ```jsx * addEndListener={(node, done) => { * // use the css transitionend event to mark the finish of a transition * node.addEventListener('transitionend', done, false); * }} * ``` */ addEndListener: PropTypes.func, /** * Callback fired before the "entering" status is applied. An extra parameter * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount * * @type Function(node: HtmlElement, isAppearing: bool) -> void */ onEnter: PropTypes.func, /** * Callback fired after the "entering" status is applied. An extra parameter * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount * * @type Function(node: HtmlElement, isAppearing: bool) */ onEntering: PropTypes.func, /** * Callback fired after the "entered" status is applied. An extra parameter * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount * * @type Function(node: HtmlElement, isAppearing: bool) -> void */ onEntered: PropTypes.func, /** * Callback fired before the "exiting" status is applied. * * @type Function(node: HtmlElement) -> void */ onExit: PropTypes.func, /** * Callback fired after the "exiting" status is applied. * * @type Function(node: HtmlElement) -> void */ onExiting: PropTypes.func, /** * Callback fired after the "exited" status is applied. * * @type Function(node: HtmlElement) -> void */ onExited: PropTypes.func } : {}; // Name the function so it is clearer in the documentation function noop() {} Transition.defaultProps = { in: false, mountOnEnter: false, unmountOnExit: false, appear: false, enter: true, exit: true, onEnter: noop, onEntering: noop, onEntered: noop, onExit: noop, onExiting: noop, onExited: noop }; Transition.UNMOUNTED = 0; Transition.EXITED = 1; Transition.ENTERING = 2; Transition.ENTERED = 3; Transition.EXITING = 4; exports.default = Transition; /***/ }), /* 334 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var punycode = __webpack_require__(916); var util = __webpack_require__(336); exports.parse = urlParse; exports.resolve = urlResolve; exports.resolveObject = urlResolveObject; exports.format = urlFormat; exports.Url = Url; function Url() { this.protocol = null; this.slashes = null; this.auth = null; this.host = null; this.port = null; this.hostname = null; this.hash = null; this.search = null; this.query = null; this.pathname = null; this.path = null; this.href = null; } // Reference: RFC 3986, RFC 1808, RFC 2396 // define these here so at least they only have to be // compiled once on the first module load. var protocolPattern = /^([a-z0-9.+-]+:)/i, portPattern = /:[0-9]*$/, // Special case for a simple path URL simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, // RFC 2396: characters reserved for delimiting URLs. // We actually just auto-escape these. delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], // RFC 2396: characters not allowed for various reasons. unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), // Allowed by RFCs, but cause of XSS attacks. Always escape these. autoEscape = ['\''].concat(unwise), // Characters that are never ever allowed in a hostname. // Note that any invalid chars are also handled, but these // are the ones that are *expected* to be seen, so we fast-path // them. nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), hostEndingChars = ['/', '?', '#'], hostnameMaxLen = 255, hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, // protocols that can allow "unsafe" and "unwise" chars. unsafeProtocol = { 'javascript': true, 'javascript:': true }, // protocols that never have a hostname. hostlessProtocol = { 'javascript': true, 'javascript:': true }, // protocols that always contain a // bit. slashedProtocol = { 'http': true, 'https': true, 'ftp': true, 'gopher': true, 'file': true, 'http:': true, 'https:': true, 'ftp:': true, 'gopher:': true, 'file:': true }, querystring = __webpack_require__(66); function urlParse(url, parseQueryString, slashesDenoteHost) { if (url && util.isObject(url) && url instanceof Url) return url; var u = new Url; u.parse(url, parseQueryString, slashesDenoteHost); return u; } Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { if (!util.isString(url)) { throw new TypeError("Parameter 'url' must be a string, not " + typeof url); } // Copy chrome, IE, opera backslash-handling behavior. // Back slashes before the query string get converted to forward slashes // See: https://code.google.com/p/chromium/issues/detail?id=25916 var queryIndex = url.indexOf('?'), splitter = (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', uSplit = url.split(splitter), slashRegex = /\\/g; uSplit[0] = uSplit[0].replace(slashRegex, '/'); url = uSplit.join(splitter); var rest = url; // trim before proceeding. // This is to support parse stuff like " http://foo.com \n" rest = rest.trim(); if (!slashesDenoteHost && url.split('#').length === 1) { // Try fast path regexp var simplePath = simplePathPattern.exec(rest); if (simplePath) { this.path = rest; this.href = rest; this.pathname = simplePath[1]; if (simplePath[2]) { this.search = simplePath[2]; if (parseQueryString) { this.query = querystring.parse(this.search.substr(1)); } else { this.query = this.search.substr(1); } } else if (parseQueryString) { this.search = ''; this.query = {}; } return this; } } var proto = protocolPattern.exec(rest); if (proto) { proto = proto[0]; var lowerProto = proto.toLowerCase(); this.protocol = lowerProto; rest = rest.substr(proto.length); } // figure out if it's got a host // user@server is *always* interpreted as a hostname, and url // resolution will treat //foo/bar as host=foo,path=bar because that's // how the browser resolves relative URLs. if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { var slashes = rest.substr(0, 2) === '//'; if (slashes && !(proto && hostlessProtocol[proto])) { rest = rest.substr(2); this.slashes = true; } } if (!hostlessProtocol[proto] && (slashes || (proto && !slashedProtocol[proto]))) { // there's a hostname. // the first instance of /, ?, ;, or # ends the host. // // If there is an @ in the hostname, then non-host chars *are* allowed // to the left of the last @ sign, unless some host-ending character // comes *before* the @-sign. // URLs are obnoxious. // // ex: // http://a@b@c/ => user:a@b host:c // http://a@b?@c => user:a host:c path:/?@c // v0.12 TODO(isaacs): This is not quite how Chrome does things. // Review our test case against browsers more comprehensively. // find the first instance of any hostEndingChars var hostEnd = -1; for (var i = 0; i < hostEndingChars.length; i++) { var hec = rest.indexOf(hostEndingChars[i]); if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec; } // at this point, either we have an explicit point where the // auth portion cannot go past, or the last @ char is the decider. var auth, atSign; if (hostEnd === -1) { // atSign can be anywhere. atSign = rest.lastIndexOf('@'); } else { // atSign must be in auth portion. // http://a@b/c@d => host:b auth:a path:/c@d atSign = rest.lastIndexOf('@', hostEnd); } // Now we have a portion which is definitely the auth. // Pull that off. if (atSign !== -1) { auth = rest.slice(0, atSign); rest = rest.slice(atSign + 1); this.auth = decodeURIComponent(auth); } // the host is the remaining to the left of the first non-host char hostEnd = -1; for (var i = 0; i < nonHostChars.length; i++) { var hec = rest.indexOf(nonHostChars[i]); if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec; } // if we still have not hit it, then the entire thing is a host. if (hostEnd === -1) hostEnd = rest.length; this.host = rest.slice(0, hostEnd); rest = rest.slice(hostEnd); // pull out port. this.parseHost(); // we've indicated that there is a hostname, // so even if it's empty, it has to be present. this.hostname = this.hostname || ''; // if hostname begins with [ and ends with ] // assume that it's an IPv6 address. var ipv6Hostname = this.hostname[0] === '[' && this.hostname[this.hostname.length - 1] === ']'; // validate a little. if (!ipv6Hostname) { var hostparts = this.hostname.split(/\./); for (var i = 0, l = hostparts.length; i < l; i++) { var part = hostparts[i]; if (!part) continue; if (!part.match(hostnamePartPattern)) { var newpart = ''; for (var j = 0, k = part.length; j < k; j++) { if (part.charCodeAt(j) > 127) { // we replace non-ASCII char with a temporary placeholder // we need this to make sure size of hostname is not // broken by replacing non-ASCII by nothing newpart += 'x'; } else { newpart += part[j]; } } // we test again with ASCII char only if (!newpart.match(hostnamePartPattern)) { var validParts = hostparts.slice(0, i); var notHost = hostparts.slice(i + 1); var bit = part.match(hostnamePartStart); if (bit) { validParts.push(bit[1]); notHost.unshift(bit[2]); } if (notHost.length) { rest = '/' + notHost.join('.') + rest; } this.hostname = validParts.join('.'); break; } } } } if (this.hostname.length > hostnameMaxLen) { this.hostname = ''; } else { // hostnames are always lower case. this.hostname = this.hostname.toLowerCase(); } if (!ipv6Hostname) { // IDNA Support: Returns a punycoded representation of "domain". // It only converts parts of the domain name that // have non-ASCII characters, i.e. it doesn't matter if // you call it with a domain that already is ASCII-only. this.hostname = punycode.toASCII(this.hostname); } var p = this.port ? ':' + this.port : ''; var h = this.hostname || ''; this.host = h + p; this.href += this.host; // strip [ and ] from the hostname // the host field still retains them, though if (ipv6Hostname) { this.hostname = this.hostname.substr(1, this.hostname.length - 2); if (rest[0] !== '/') { rest = '/' + rest; } } } // now rest is set to the post-host stuff. // chop off any delim chars. if (!unsafeProtocol[lowerProto]) { // First, make 100% sure that any "autoEscape" chars get // escaped, even if encodeURIComponent doesn't think they // need to be. for (var i = 0, l = autoEscape.length; i < l; i++) { var ae = autoEscape[i]; if (rest.indexOf(ae) === -1) continue; var esc = encodeURIComponent(ae); if (esc === ae) { esc = escape(ae); } rest = rest.split(ae).join(esc); } } // chop off from the tail first. var hash = rest.indexOf('#'); if (hash !== -1) { // got a fragment string. this.hash = rest.substr(hash); rest = rest.slice(0, hash); } var qm = rest.indexOf('?'); if (qm !== -1) { this.search = rest.substr(qm); this.query = rest.substr(qm + 1); if (parseQueryString) { this.query = querystring.parse(this.query); } rest = rest.slice(0, qm); } else if (parseQueryString) { // no query string, but parseQueryString still requested this.search = ''; this.query = {}; } if (rest) this.pathname = rest; if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) { this.pathname = '/'; } //to support http.request if (this.pathname || this.search) { var p = this.pathname || ''; var s = this.search || ''; this.path = p + s; } // finally, reconstruct the href based on what has been validated. this.href = this.format(); return this; }; // format a parsed object into a url string function urlFormat(obj) { // ensure it's an object, and not a string url. // If it's an obj, this is a no-op. // this way, you can call url_format() on strings // to clean up potentially wonky urls. if (util.isString(obj)) obj = urlParse(obj); if (!(obj instanceof Url)) return Url.prototype.format.call(obj); return obj.format(); } Url.prototype.format = function() { var auth = this.auth || ''; if (auth) { auth = encodeURIComponent(auth); auth = auth.replace(/%3A/i, ':'); auth += '@'; } var protocol = this.protocol || '', pathname = this.pathname || '', hash = this.hash || '', host = false, query = ''; if (this.host) { host = auth + this.host; } else if (this.hostname) { host = auth + (this.hostname.indexOf(':') === -1 ? this.hostname : '[' + this.hostname + ']'); if (this.port) { host += ':' + this.port; } } if (this.query && util.isObject(this.query) && Object.keys(this.query).length) { query = querystring.stringify(this.query); } var search = this.search || (query && ('?' + query)) || ''; if (protocol && protocol.substr(-1) !== ':') protocol += ':'; // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. // unless they had them to begin with. if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) { host = '//' + (host || ''); if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; } else if (!host) { host = ''; } if (hash && hash.charAt(0) !== '#') hash = '#' + hash; if (search && search.charAt(0) !== '?') search = '?' + search; pathname = pathname.replace(/[?#]/g, function(match) { return encodeURIComponent(match); }); search = search.replace('#', '%23'); return protocol + host + pathname + search + hash; }; function urlResolve(source, relative) { return urlParse(source, false, true).resolve(relative); } Url.prototype.resolve = function(relative) { return this.resolveObject(urlParse(relative, false, true)).format(); }; function urlResolveObject(source, relative) { if (!source) return relative; return urlParse(source, false, true).resolveObject(relative); } Url.prototype.resolveObject = function(relative) { if (util.isString(relative)) { var rel = new Url(); rel.parse(relative, false, true); relative = rel; } var result = new Url(); var tkeys = Object.keys(this); for (var tk = 0; tk < tkeys.length; tk++) { var tkey = tkeys[tk]; result[tkey] = this[tkey]; } // hash is always overridden, no matter what. // even href="" will remove it. result.hash = relative.hash; // if the relative url is empty, then there's nothing left to do here. if (relative.href === '') { result.href = result.format(); return result; } // hrefs like //foo/bar always cut to the protocol. if (relative.slashes && !relative.protocol) { // take everything except the protocol from relative var rkeys = Object.keys(relative); for (var rk = 0; rk < rkeys.length; rk++) { var rkey = rkeys[rk]; if (rkey !== 'protocol') result[rkey] = relative[rkey]; } //urlParse appends trailing / to urls like http://www.example.com if (slashedProtocol[result.protocol] && result.hostname && !result.pathname) { result.path = result.pathname = '/'; } result.href = result.format(); return result; } if (relative.protocol && relative.protocol !== result.protocol) { // if it's a known url protocol, then changing // the protocol does weird things // first, if it's not file:, then we MUST have a host, // and if there was a path // to begin with, then we MUST have a path. // if it is file:, then the host is dropped, // because that's known to be hostless. // anything else is assumed to be absolute. if (!slashedProtocol[relative.protocol]) { var keys = Object.keys(relative); for (var v = 0; v < keys.length; v++) { var k = keys[v]; result[k] = relative[k]; } result.href = result.format(); return result; } result.protocol = relative.protocol; if (!relative.host && !hostlessProtocol[relative.protocol]) { var relPath = (relative.pathname || '').split('/'); while (relPath.length && !(relative.host = relPath.shift())); if (!relative.host) relative.host = ''; if (!relative.hostname) relative.hostname = ''; if (relPath[0] !== '') relPath.unshift(''); if (relPath.length < 2) relPath.unshift(''); result.pathname = relPath.join('/'); } else { result.pathname = relative.pathname; } result.search = relative.search; result.query = relative.query; result.host = relative.host || ''; result.auth = relative.auth; result.hostname = relative.hostname || relative.host; result.port = relative.port; // to support http.request if (result.pathname || result.search) { var p = result.pathname || ''; var s = result.search || ''; result.path = p + s; } result.slashes = result.slashes || relative.slashes; result.href = result.format(); return result; } var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), isRelAbs = ( relative.host || relative.pathname && relative.pathname.charAt(0) === '/' ), mustEndAbs = (isRelAbs || isSourceAbs || (result.host && relative.pathname)), removeAllDots = mustEndAbs, srcPath = result.pathname && result.pathname.split('/') || [], relPath = relative.pathname && relative.pathname.split('/') || [], psychotic = result.protocol && !slashedProtocol[result.protocol]; // if the url is a non-slashed url, then relative // links like ../.. should be able // to crawl up to the hostname, as well. This is strange. // result.protocol has already been set by now. // Later on, put the first path part into the host field. if (psychotic) { result.hostname = ''; result.port = null; if (result.host) { if (srcPath[0] === '') srcPath[0] = result.host; else srcPath.unshift(result.host); } result.host = ''; if (relative.protocol) { relative.hostname = null; relative.port = null; if (relative.host) { if (relPath[0] === '') relPath[0] = relative.host; else relPath.unshift(relative.host); } relative.host = null; } mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); } if (isRelAbs) { // it's absolute. result.host = (relative.host || relative.host === '') ? relative.host : result.host; result.hostname = (relative.hostname || relative.hostname === '') ? relative.hostname : result.hostname; result.search = relative.search; result.query = relative.query; srcPath = relPath; // fall through to the dot-handling below. } else if (relPath.length) { // it's relative // throw away the existing file, and take the new path instead. if (!srcPath) srcPath = []; srcPath.pop(); srcPath = srcPath.concat(relPath); result.search = relative.search; result.query = relative.query; } else if (!util.isNullOrUndefined(relative.search)) { // just pull out the search. // like href='?foo'. // Put this after the other two cases because it simplifies the booleans if (psychotic) { result.hostname = result.host = srcPath.shift(); //occationaly the auth can get stuck only in host //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; if (authInHost) { result.auth = authInHost.shift(); result.host = result.hostname = authInHost.shift(); } } result.search = relative.search; result.query = relative.query; //to support http.request if (!util.isNull(result.pathname) || !util.isNull(result.search)) { result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); } result.href = result.format(); return result; } if (!srcPath.length) { // no path at all. easy. // we've already handled the other stuff above. result.pathname = null; //to support http.request if (result.search) { result.path = '/' + result.search; } else { result.path = null; } result.href = result.format(); return result; } // if a url ENDs in . or .., then it must get a trailing slash. // however, if it ends in anything else non-slashy, // then it must NOT get a trailing slash. var last = srcPath.slice(-1)[0]; var hasTrailingSlash = ( (result.host || relative.host || srcPath.length > 1) && (last === '.' || last === '..') || last === ''); // strip single dots, resolve double dots to parent dir // if the path tries to go above the root, `up` ends up > 0 var up = 0; for (var i = srcPath.length; i >= 0; i--) { last = srcPath[i]; if (last === '.') { srcPath.splice(i, 1); } else if (last === '..') { srcPath.splice(i, 1); up++; } else if (up) { srcPath.splice(i, 1); up--; } } // if the path is allowed to go above the root, restore leading ..s if (!mustEndAbs && !removeAllDots) { for (; up--; up) { srcPath.unshift('..'); } } if (mustEndAbs && srcPath[0] !== '' && (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { srcPath.unshift(''); } if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { srcPath.push(''); } var isAbsolute = srcPath[0] === '' || (srcPath[0] && srcPath[0].charAt(0) === '/'); // put the host back if (psychotic) { result.hostname = result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : ''; //occationaly the auth can get stuck only in host //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; if (authInHost) { result.auth = authInHost.shift(); result.host = result.hostname = authInHost.shift(); } } mustEndAbs = mustEndAbs || (result.host && srcPath.length); if (mustEndAbs && !isAbsolute) { srcPath.unshift(''); } if (!srcPath.length) { result.pathname = null; result.path = null; } else { result.pathname = srcPath.join('/'); } //to support request.http if (!util.isNull(result.pathname) || !util.isNull(result.search)) { result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : ''); } result.auth = relative.auth || result.auth; result.slashes = result.slashes || relative.slashes; result.href = result.format(); return result; }; Url.prototype.parseHost = function() { var host = this.host; var port = portPattern.exec(host); if (port) { port = port[0]; if (port !== ':') { this.port = port.substr(1); } host = host.substr(0, host.length - port.length); } if (host) this.hostname = host; }; /***/ }), /* 335 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.classNamesShape = exports.timeoutsShape = undefined; exports.transitionTimeout = transitionTimeout; var _propTypes = __webpack_require__(20); var _propTypes2 = _interopRequireDefault(_propTypes); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function transitionTimeout(transitionType) { var timeoutPropName = 'transition' + transitionType + 'Timeout'; var enabledPropName = 'transition' + transitionType; return function (props) { // If the transition is enabled if (props[enabledPropName]) { // If no timeout duration is provided if (props[timeoutPropName] == null) { return new Error(timeoutPropName + ' wasn\'t supplied to CSSTransitionGroup: ' + 'this can cause unreliable animations and won\'t be supported in ' + 'a future version of React. See ' + 'https://fb.me/react-animation-transition-group-timeout for more ' + 'information.'); // If the duration isn't a number } else if (typeof props[timeoutPropName] !== 'number') { return new Error(timeoutPropName + ' must be a number (in milliseconds)'); } } return null; }; } var timeoutsShape = exports.timeoutsShape = _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.shape({ enter: _propTypes2.default.number, exit: _propTypes2.default.number }).isRequired]); var classNamesShape = exports.classNamesShape = _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({ enter: _propTypes2.default.string, exit: _propTypes2.default.string, active: _propTypes2.default.string }), _propTypes2.default.shape({ enter: _propTypes2.default.string, enterActive: _propTypes2.default.string, exit: _propTypes2.default.string, exitActive: _propTypes2.default.string })]); /***/ }), /* 336 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = { isString: function(arg) { return typeof(arg) === 'string'; }, isObject: function(arg) { return typeof(arg) === 'object' && arg !== null; }, isNull: function(arg) { return arg === null; }, isNullOrUndefined: function(arg) { return arg == null; } }; /***/ }), /* 337 */, /* 338 */, /* 339 */, /* 340 */, /* 341 */, /* 342 */, /* 343 */, /* 344 */, /* 345 */, /* 346 */, /* 347 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 348 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 349 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 350 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 351 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 352 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 353 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 354 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 355 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 356 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 357 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 358 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 359 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 360 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 361 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 362 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 363 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 364 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 365 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 366 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 367 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 368 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 369 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 370 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 371 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 372 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 373 */, /* 374 */, /* 375 */, /* 376 */, /* 377 */, /* 378 */, /* 379 */, /* 380 */, /* 381 */, /* 382 */, /* 383 */, /* 384 */, /* 385 */, /* 386 */, /* 387 */, /* 388 */, /* 389 */, /* 390 */, /* 391 */, /* 392 */, /* 393 */, /* 394 */, /* 395 */, /* 396 */, /* 397 */, /* 398 */, /* 399 */, /* 400 */, /* 401 */, /* 402 */, /* 403 */, /* 404 */, /* 405 */, /* 406 */, /* 407 */, /* 408 */, /* 409 */, /* 410 */, /* 411 */, /* 412 */, /* 413 */, /* 414 */, /* 415 */, /* 416 */, /* 417 */, /* 418 */, /* 419 */, /* 420 */, /* 421 */, /* 422 */, /* 423 */, /* 424 */, /* 425 */, /* 426 */, /* 427 */, /* 428 */, /* 429 */, /* 430 */, /* 431 */, /* 432 */, /* 433 */, /* 434 */, /* 435 */, /* 436 */, /* 437 */, /* 438 */, /* 439 */, /* 440 */, /* 441 */, /* 442 */, /* 443 */, /* 444 */, /* 445 */, /* 446 */, /* 447 */, /* 448 */, /* 449 */, /* 450 */, /* 451 */, /* 452 */, /* 453 */, /* 454 */, /* 455 */, /* 456 */, /* 457 */, /* 458 */, /* 459 */, /* 460 */, /* 461 */, /* 462 */, /* 463 */, /* 464 */, /* 465 */, /* 466 */, /* 467 */, /* 468 */, /* 469 */, /* 470 */, /* 471 */, /* 472 */, /* 473 */, /* 474 */, /* 475 */, /* 476 */, /* 477 */, /* 478 */, /* 479 */, /* 480 */, /* 481 */, /* 482 */, /* 483 */, /* 484 */, /* 485 */, /* 486 */, /* 487 */, /* 488 */, /* 489 */, /* 490 */, /* 491 */, /* 492 */, /* 493 */, /* 494 */, /* 495 */, /* 496 */, /* 497 */, /* 498 */, /* 499 */, /* 500 */, /* 501 */, /* 502 */, /* 503 */, /* 504 */, /* 505 */, /* 506 */, /* 507 */, /* 508 */, /* 509 */, /* 510 */, /* 511 */, /* 512 */, /* 513 */, /* 514 */, /* 515 */, /* 516 */, /* 517 */, /* 518 */, /* 519 */, /* 520 */, /* 521 */, /* 522 */, /* 523 */, /* 524 */, /* 525 */, /* 526 */, /* 527 */, /* 528 */, /* 529 */, /* 530 */, /* 531 */, /* 532 */, /* 533 */, /* 534 */, /* 535 */, /* 536 */, /* 537 */, /* 538 */, /* 539 */, /* 540 */, /* 541 */, /* 542 */, /* 543 */, /* 544 */, /* 545 */, /* 546 */, /* 547 */, /* 548 */, /* 549 */, /* 550 */, /* 551 */, /* 552 */, /* 553 */, /* 554 */, /* 555 */, /* 556 */, /* 557 */, /* 558 */, /* 559 */, /* 560 */, /* 561 */, /* 562 */, /* 563 */, /* 564 */, /* 565 */, /* 566 */, /* 567 */, /* 568 */, /* 569 */, /* 570 */, /* 571 */, /* 572 */, /* 573 */, /* 574 */, /* 575 */, /* 576 */, /* 577 */, /* 578 */, /* 579 */, /* 580 */, /* 581 */, /* 582 */, /* 583 */, /* 584 */, /* 585 */, /* 586 */, /* 587 */, /* 588 */, /* 589 */, /* 590 */, /* 591 */, /* 592 */, /* 593 */, /* 594 */, /* 595 */, /* 596 */, /* 597 */, /* 598 */, /* 599 */, /* 600 */, /* 601 */, /* 602 */, /* 603 */, /* 604 */, /* 605 */, /* 606 */, /* 607 */, /* 608 */, /* 609 */, /* 610 */, /* 611 */, /* 612 */, /* 613 */, /* 614 */, /* 615 */, /* 616 */, /* 617 */, /* 618 */, /* 619 */, /* 620 */, /* 621 */, /* 622 */, /* 623 */, /* 624 */, /* 625 */, /* 626 */, /* 627 */, /* 628 */, /* 629 */, /* 630 */, /* 631 */, /* 632 */, /* 633 */, /* 634 */, /* 635 */, /* 636 */, /* 637 */, /* 638 */, /* 639 */, /* 640 */, /* 641 */, /* 642 */, /* 643 */, /* 644 */, /* 645 */, /* 646 */, /* 647 */, /* 648 */, /* 649 */, /* 650 */, /* 651 */, /* 652 */, /* 653 */, /* 654 */, /* 655 */, /* 656 */, /* 657 */, /* 658 */, /* 659 */, /* 660 */, /* 661 */, /* 662 */, /* 663 */, /* 664 */, /* 665 */, /* 666 */, /* 667 */, /* 668 */, /* 669 */, /* 670 */, /* 671 */, /* 672 */, /* 673 */, /* 674 */, /* 675 */, /* 676 */, /* 677 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_677__; /***/ }), /* 678 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_678__; /***/ }), /* 679 */, /* 680 */, /* 681 */, /* 682 */, /* 683 */, /* 684 */, /* 685 */, /* 686 */, /* 687 */, /* 688 */, /* 689 */, /* 690 */, /* 691 */, /* 692 */, /* 693 */, /* 694 */, /* 695 */, /* 696 */, /* 697 */, /* 698 */, /* 699 */, /* 700 */, /* 701 */, /* 702 */, /* 703 */, /* 704 */, /* 705 */, /* 706 */, /* 707 */, /* 708 */, /* 709 */, /* 710 */, /* 711 */, /* 712 */, /* 713 */, /* 714 */, /* 715 */, /* 716 */, /* 717 */, /* 718 */, /* 719 */, /* 720 */, /* 721 */, /* 722 */, /* 723 */, /* 724 */, /* 725 */, /* 726 */, /* 727 */, /* 728 */, /* 729 */, /* 730 */, /* 731 */, /* 732 */, /* 733 */, /* 734 */, /* 735 */, /* 736 */, /* 737 */, /* 738 */, /* 739 */, /* 740 */, /* 741 */, /* 742 */, /* 743 */, /* 744 */, /* 745 */, /* 746 */, /* 747 */, /* 748 */, /* 749 */, /* 750 */, /* 751 */, /* 752 */, /* 753 */, /* 754 */, /* 755 */, /* 756 */, /* 757 */, /* 758 */, /* 759 */, /* 760 */, /* 761 */, /* 762 */, /* 763 */, /* 764 */, /* 765 */, /* 766 */, /* 767 */, /* 768 */, /* 769 */, /* 770 */, /* 771 */, /* 772 */, /* 773 */, /* 774 */, /* 775 */, /* 776 */, /* 777 */, /* 778 */, /* 779 */, /* 780 */, /* 781 */, /* 782 */, /* 783 */, /* 784 */, /* 785 */, /* 786 */, /* 787 */, /* 788 */, /* 789 */, /* 790 */, /* 791 */, /* 792 */ /***/ (function(module, exports) { var g; // This works in non-strict mode g = (function() { return this; })(); try { // This works if eval is allowed (see CSP) g = g || Function("return this")() || (1,eval)("this"); } catch(e) { // This works if the window reference is available if(typeof window === "object") g = window; } // g can still be undefined, but nothing to do about it... // We return undefined, instead of nothing here, so it's // easier to handle this case. if(!global) { ...} module.exports = g; /***/ }), /* 793 */ /***/ (function(module, exports) { module.exports = function(module) { if(!module.webpackPolyfill) { module.deprecate = function() {}; module.paths = []; // module.parent = undefined by default if(!module.children) module.children = []; Object.defineProperty(module, "loaded", { enumerable: true, get: function() { return module.l; } }); Object.defineProperty(module, "id", { enumerable: true, get: function() { return module.i; } }); module.webpackPolyfill = 1; } return module; }; /***/ }), /* 794 */, /* 795 */, /* 796 */, /* 797 */, /* 798 */, /* 799 */, /* 800 */, /* 801 */, /* 802 */, /* 803 */, /* 804 */, /* 805 */, /* 806 */ /***/ (function(module, exports) { module.exports = "dojo_square" /***/ }), /* 807 */, /* 808 */, /* 809 */, /* 810 */, /* 811 */, /* 812 */, /* 813 */, /* 814 */, /* 815 */, /* 816 */, /* 817 */, /* 818 */, /* 819 */, /* 820 */, /* 821 */, /* 822 */, /* 823 */, /* 824 */, /* 825 */, /* 826 */, /* 827 */, /* 828 */, /* 829 */, /* 830 */, /* 831 */, /* 832 */, /* 833 */, /* 834 */, /* 835 */, /* 836 */, /* 837 */, /* 838 */, /* 839 */, /* 840 */, /* 841 */, /* 842 */, /* 843 */, /* 844 */, /* 845 */, /* 846 */, /* 847 */, /* 848 */, /* 849 */, /* 850 */, /* 851 */, /* 852 */, /* 853 */, /* 854 */, /* 855 */, /* 856 */, /* 857 */, /* 858 */, /* 859 */, /* 860 */, /* 861 */, /* 862 */, /* 863 */, /* 864 */, /* 865 */, /* 866 */, /* 867 */, /* 868 */, /* 869 */, /* 870 */, /* 871 */, /* 872 */, /* 873 */, /* 874 */, /* 875 */, /* 876 */, /* 877 */, /* 878 */, /* 879 */, /* 880 */, /* 881 */, /* 882 */, /* 883 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(884); var fs = __webpack_require__(118); function Iterator(text) { var pos = 0, length = text.length; this.peek = function(num) { num = num || 0; if(pos + num >= length) { return null; } return text.charAt(pos + num); }; this.next = function(inc) { inc = inc || 1; if(pos >= length) { return null; } return text.charAt((pos += inc) - inc); }; this.pos = function() { return pos; }; } var rWhitespace = /\s/; function isWhitespace(chr) { return rWhitespace.test(chr); } function consumeWhiteSpace(iter) { var start = iter.pos(); while(isWhitespace(iter.peek())) { iter.next(); } return { type: "whitespace", start: start, end: iter.pos() }; } function startsComment(chr) { return chr === "!" || chr === "#"; } function isEOL(chr) { return chr == null || chr === "\n" || chr === "\r"; } function consumeComment(iter) { var start = iter.pos(); while(!isEOL(iter.peek())) { iter.next(); } return { type: "comment", start: start, end: iter.pos() }; } function startsKeyVal(chr) { return !isWhitespace(chr) && !startsComment(chr); } function startsSeparator(chr) { return chr === "=" || chr === ":" || isWhitespace(chr); } function startsEscapedVal(chr) { return chr === "\\"; } function consumeEscapedVal(iter) { var start = iter.pos(); iter.next(); // move past "\" var curChar = iter.next(); if(curChar === "u") { // encoded unicode char iter.next(4); // Read in the 4 hex values } return { type: "escaped-value", start: start, end: iter.pos() }; } function consumeKey(iter) { var start = iter.pos(), children = []; var curChar; while((curChar = iter.peek()) !== null) { if(startsSeparator(curChar)) { break; } if(startsEscapedVal(curChar)) { children.push(consumeEscapedVal(iter)); continue; } iter.next(); } return { type: "key", start: start, end: iter.pos(), children: children }; } function consumeKeyValSeparator(iter) { var start = iter.pos(); var seenHardSep = false, curChar; while((curChar = iter.peek()) !== null) { if(isEOL(curChar)) { break; } if(isWhitespace(curChar)) { iter.next(); continue; } if(seenHardSep) { break; } seenHardSep = (curChar === ":" || curChar === "="); if(seenHardSep) { iter.next(); continue; } break; // curChar is a non-separtor char } return { type: "key-value-separator", start: start, end: iter.pos() }; } function startsLineBreak(iter) { return iter.peek() === "\\" && isEOL(iter.peek(1)); } function consumeLineBreak(iter) { var start = iter.pos(); iter.next(); // consume \ if(iter.peek() === "\r") { iter.next(); } iter.next(); // consume \n var curChar; while((curChar = iter.peek()) !== null) { if(isEOL(curChar)) { break; } if(!isWhitespace(curChar)) { break; } iter.next(); } return { type: "line-break", start: start, end: iter.pos() }; } function consumeVal(iter) { var start = iter.pos(), children = []; var curChar; while((curChar = iter.peek()) !== null) { if(startsLineBreak(iter)) { children.push(consumeLineBreak(iter)); continue; } if(startsEscapedVal(curChar)) { children.push(consumeEscapedVal(iter)); continue; } if(isEOL(curChar)) { break; } iter.next(); } return { type: "value", start: start, end: iter.pos(), children: children }; } function consumeKeyVal(iter) { return { type: "key-value", start: iter.pos(), children: [ consumeKey(iter), consumeKeyValSeparator(iter), consumeVal(iter) ], end: iter.pos() }; } var renderChild = { "escaped-value": function(child, text) { var type = text.charAt(child.start + 1); if(type === "t") { return "\t"; } if(type === "r") { return "\r"; } if(type === "n") { return "\n"; } if(type === "f") { return "\f"; } if(type !== "u") { return type; } return String.fromCharCode(parseInt(text.substr(child.start + 2, 4), 16)); }, "line-break": function (child, text) { return ""; } }; function rangeToBuffer(range, text) { var start = range.start, buffer = []; for(var i = 0; i < range.children.length; i++) { var child = range.children[i]; buffer.push(text.substring(start, child.start)); buffer.push(renderChild[child.type](child, text)); start = child.end; } buffer.push(text.substring(start, range.end)); return buffer; } function rangesToObject(ranges, text) { var obj = Object.create(null); // Creates to a true hash map for(var i = 0; i < ranges.length; i++) { var range = ranges[i]; if(range.type !== "key-value") { continue; } var key = rangeToBuffer(range.children[0], text).join(""); var val = rangeToBuffer(range.children[2], text).join(""); obj[key] = val; } return obj; } function stringToRanges(text) { var iter = new Iterator(text), ranges = []; var curChar; while((curChar = iter.peek()) !== null) { if(isWhitespace(curChar)) { ranges.push(consumeWhiteSpace(iter)); continue; } if(startsComment(curChar)) { ranges.push(consumeComment(iter)); continue; } if(startsKeyVal(curChar)) { ranges.push(consumeKeyVal(iter)); continue; } throw Error("Something crazy happened. text: '" + text + "'; curChar: '" + curChar + "'"); } return ranges; } function isNewLineRange(range) { if(!range) { return false; } if(range.type === "whitespace") { return true; } if(range.type === "literal") { return isWhitespace(range.text) && range.text.indexOf("\n") > -1; } return false; } function escapeMaker(escapes) { return function escapeKey(key) { var zeros = [ "", "0", "00", "000" ]; var buf = []; for(var i = 0; i < key.length; i++) { var chr = key.charAt(i); if(escapes[chr]) { buf.push(escapes[chr]); continue; } var code = chr.codePointAt(0); if(code <= 0x7F) { buf.push(chr); continue; } var hex = code.toString(16); buf.push("\\u"); buf.push(zeros[4 - hex.length]); buf.push(hex); } return buf.join(""); }; } var escapeKey = escapeMaker({ " ": "\\ ", "\n": "\\n", ":": "\\:", "=": "\\=" }); var escapeVal = escapeMaker({ "\n": "\\n" }); function Editor(text, options) { if (typeof text === 'object') { options = text; text = null; } text = text || ""; var path = options.path; var separator = options.separator || '='; var ranges = stringToRanges(text); var obj = rangesToObject(ranges, text); var keyRange = Object.create(null); // Creates to a true hash map for(var i = 0; i < ranges.length; i++) { var range = ranges[i]; if(range.type !== "key-value") { continue; } var key = rangeToBuffer(range.children[0], text).join(""); keyRange[key] = range; } this.addHeadComment = function(comment) { if(comment == null) { return; } ranges.unshift({ type: "literal", text: "# " + comment.replace(/\n/g, "\n# ") + "\n" }); }; this.get = function(key) { return obj[key]; }; this.set = function(key, val, comment) { if(val == null) { this.unset(key); return; } obj[key] = val; var escapedKey = escapeKey(key); var escapedVal = escapeVal(val); var range = keyRange[key]; if(!range) { keyRange[key] = range = { type: "literal", text: escapedKey + separator + escapedVal }; var prevRange = ranges[ranges.length - 1]; if(prevRange != null && !isNewLineRange(prevRange)) { ranges.push({ type: "literal", text: "\n" }); } ranges.push(range); } // comment === null deletes comment. if comment === undefined, it's left alone if(comment !== undefined) { range.comment = comment && "# " + comment.replace(/\n/g, "\n# ") + "\n"; } if(range.type === "literal") { range.text = escapedKey + separator + escapedVal; if(range.comment != null) { range.text = range.comment + range.text; } } else if(range.type === "key-value") { range.children[2] = { type: "literal", text: escapedVal }; } else { throw "Unknown node type: " + range.type; } }; this.unset = function(key) { if(!(key in obj)) { return; } var range = keyRange[key]; var idx = ranges.indexOf(range); ranges.splice(idx, (isNewLineRange(ranges[idx + 1]) ? 2 : 1)); delete keyRange[key]; delete obj[key]; }; this.valueOf = this.toString = function() { var buffer = [], stack = [].concat(ranges); var node; while((node = stack.shift()) != null) { switch(node.type) { case "literal": buffer.push(node.text); break; case "key": case "value": case "comment": case "whitespace": case "key-value-separator": case "escaped-value": case "line-break": buffer.push(text.substring(node.start, node.end)); break; case "key-value": Array.prototype.unshift.apply(stack, node.children); if(node.comment) { stack.unshift({ type: "literal", text: node.comment }); } break; } } return buffer.join(""); }; this.save = function(newPath, callback) { if(typeof newPath === 'function') { callback = newPath; newPath = path; } newPath = newPath || path; if(!newPath) { if (callback) { return callback("Unknown path"); } throw new Error("Unknown path"); } if (callback) { fs.writeFile(newPath, this.toString(), callback); } else { fs.writeFileSync(newPath, this.toString()); } }; } function createEditor(/*path, options, callback*/) { var path, options, callback; var args = Array.prototype.slice.call(arguments); for (var i = 0; i < args.length; i ++) { var arg = args[i]; if (!path && typeof arg === 'string') { path = arg; } else if (!options && typeof arg === 'object') { options = arg; } else if (!callback && typeof arg === 'function') { callback = arg; } } options = options || {}; path = path || options.path; callback = callback || options.callback; options.path = path; if(!path) { return new Editor(options); } if(!callback) { return new Editor(fs.readFileSync(path).toString(), options); } return fs.readFile(path, function(err, text) { if(err) { return callback(err, null); } text = text.toString(); return callback(null, new Editor(text, options)); }); } function parse(text) { text = text.toString(); var ranges = stringToRanges(text); return rangesToObject(ranges, text); } function read(path, callback) { if(!callback) { return parse(fs.readFileSync(path)); } return fs.readFile(path, function(err, data) { if(err) { return callback(err, null); } return callback(null, parse(data)); }); } module.exports = { parse: parse, read: read, createEditor: createEditor }; /***/ }), /* 884 */ /***/ (function(module, exports) { /*! http://mths.be/codepointat v0.2.0 by @mathias */ if (!String.prototype.codePointAt) { (function() { 'use strict'; // needed to support `apply`/`call` with `undefined`/`null` var defineProperty = (function() { // IE 8 only supports `Object.defineProperty` on DOM elements try { var object = {}; var $defineProperty = Object.defineProperty; var result = $defineProperty(object, object, object) && $defineProperty; } catch(error) {} return result; }()); var codePointAt = function(position) { if (this == null) { throw TypeError(); } var string = String(this); var size = string.length; // `ToInteger` var index = position ? Number(position) : 0; if (index != index) { // better `isNaN` index = 0; } // Account for out-of-bounds indices: if (index < 0 || index >= size) { return undefined; } // Get the first code unit var first = string.charCodeAt(index); var second; if ( // check if it’s the start of a surrogate pair first >= 0xD800 && first <= 0xDBFF && // high surrogate size > index + 1 // there is a next code unit ) { second = string.charCodeAt(index + 1); if (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; } } return first; }; if (defineProperty) { defineProperty(String.prototype, 'codePointAt', { 'value': codePointAt, 'configurable': true, 'writable': true }); } else { String.prototype.codePointAt = codePointAt; } }()); } /***/ }), /* 885 */, /* 886 */, /* 887 */, /* 888 */, /* 889 */, /* 890 */, /* 891 */, /* 892 */, /* 893 */, /* 894 */, /* 895 */, /* 896 */, /* 897 */, /* 898 */, /* 899 */, /* 900 */, /* 901 */, /* 902 */, /* 903 */, /* 904 */, /* 905 */, /* 906 */, /* 907 */, /* 908 */, /* 909 */, /* 910 */, /* 911 */, /* 912 */, /* 913 */, /* 914 */, /* 915 */, /* 916 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */ ;(function(root) { /** Detect free variables */ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; var freeModule = typeof module == 'object' && module && !module.nodeType && module; var freeGlobal = typeof global == 'object' && global; if ( freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal ) { root = freeGlobal; } /** * The `punycode` object. * @name punycode * @type Object */ var punycode, /** Highest positive signed 32-bit float value */ maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 /** Bootstring parameters */ base = 36, tMin = 1, tMax = 26, skew = 38, damp = 700, initialBias = 72, initialN = 128, // 0x80 delimiter = '-', // '\x2D' /** Regular expressions */ regexPunycode = /^xn--/, regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators /** Error messages */ errors = { 'overflow': 'Overflow: input needs wider integers to process', 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', 'invalid-input': 'Invalid input' }, /** Convenience shortcuts */ baseMinusTMin = base - tMin, floor = Math.floor, stringFromCharCode = String.fromCharCode, /** Temporary variable */ key; /*--------------------------------------------------------------------------*/ /** * A generic error utility function. * @private * @param {String} type The error type. * @returns {Error} Throws a `RangeError` with the applicable error message. */ function error(type) { throw new RangeError(errors[type]); } /** * A generic `Array#map` utility function. * @private * @param {Array} array The array to iterate over. * @param {Function} callback The function that gets called for every array * item. * @returns {Array} A new array of values returned by the callback function. */ function map(array, fn) { var length = array.length; var result = []; while (length--) { result[length] = fn(array[length]); } return result; } /** * A simple `Array#map`-like wrapper to work with domain name strings or email * addresses. * @private * @param {String} domain The domain name or email address. * @param {Function} callback The function that gets called for every * character. * @returns {Array} A new string of characters returned by the callback * function. */ function mapDomain(string, fn) { var parts = string.split('@'); var result = ''; if (parts.length > 1) { // In email addresses, only the domain name should be punycoded. Leave // the local part (i.e. everything up to `@`) intact. result = parts[0] + '@'; string = parts[1]; } // Avoid `split(regex)` for IE8 compatibility. See #17. string = string.replace(regexSeparators, '\x2E'); var labels = string.split('.'); var encoded = map(labels, fn).join('.'); return result + encoded; } /** * Creates an array containing the numeric code points of each Unicode * character in the string. While JavaScript uses UCS-2 internally, * this function will convert a pair of surrogate halves (each of which * UCS-2 exposes as separate characters) into a single code point, * matching UTF-16. * @see `punycode.ucs2.encode` * @see * @memberOf punycode.ucs2 * @name decode * @param {String} string The Unicode input string (UCS-2). * @returns {Array} The new array of code points. */ function ucs2decode(string) { var output = [], counter = 0, length = string.length, value, extra; while (counter < length) { value = string.charCodeAt(counter++); if (value >= 0xD800 && value <= 0xDBFF && counter < length) { // high surrogate, and there is a next character extra = string.charCodeAt(counter++); if ((extra & 0xFC00) == 0xDC00) { // low surrogate output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); } else { // unmatched surrogate; only append this code unit, in case the next // code unit is the high surrogate of a surrogate pair output.push(value); counter--; } } else { output.push(value); } } return output; } /** * Creates a string based on an array of numeric code points. * @see `punycode.ucs2.decode` * @memberOf punycode.ucs2 * @name encode * @param {Array} codePoints The array of numeric code points. * @returns {String} The new Unicode string (UCS-2). */ function ucs2encode(array) { return map(array, function(value) { var output = ''; if (value > 0xFFFF) { value -= 0x10000; output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); value = 0xDC00 | value & 0x3FF; } output += stringFromCharCode(value); return output; }).join(''); } /** * Converts a basic code point into a digit/integer. * @see `digitToBasic()` * @private * @param {Number} codePoint The basic numeric code point value. * @returns {Number} The numeric value of a basic code point (for use in * representing integers) in the range `0` to `base - 1`, or `base` if * the code point does not represent a value. */ function basicToDigit(codePoint) { if (codePoint - 48 < 10) { return codePoint - 22; } if (codePoint - 65 < 26) { return codePoint - 65; } if (codePoint - 97 < 26) { return codePoint - 97; } return base; } /** * Converts a digit/integer into a basic code point. * @see `basicToDigit()` * @private * @param {Number} digit The numeric value of a basic code point. * @returns {Number} The basic code point whose value (when used for * representing integers) is `digit`, which needs to be in the range * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is * used; else, the lowercase form is used. The behavior is undefined * if `flag` is non-zero and `digit` has no uppercase form. */ function digitToBasic(digit, flag) { // 0..25 map to ASCII a..z or A..Z // 26..35 map to ASCII 0..9 return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); } /** * Bias adaptation function as per section 3.4 of RFC 3492. * https://tools.ietf.org/html/rfc3492#section-3.4 * @private */ function adapt(delta, numPoints, firstTime) { var k = 0; delta = firstTime ? floor(delta / damp) : delta >> 1; delta += floor(delta / numPoints); for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { delta = floor(delta / baseMinusTMin); } return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); } /** * Converts a Punycode string of ASCII-only symbols to a string of Unicode * symbols. * @memberOf punycode * @param {String} input The Punycode string of ASCII-only symbols. * @returns {String} The resulting string of Unicode symbols. */ function decode(input) { // Don't use UCS-2 var output = [], inputLength = input.length, out, i = 0, n = initialN, bias = initialBias, basic, j, index, oldi, w, k, digit, t, /** Cached calculation results */ baseMinusT; // Handle the basic code points: let `basic` be the number of input code // points before the last delimiter, or `0` if there is none, then copy // the first basic code points to the output. basic = input.lastIndexOf(delimiter); if (basic < 0) { basic = 0; } for (j = 0; j < basic; ++j) { // if it's not a basic code point if (input.charCodeAt(j) >= 0x80) { error('not-basic'); } output.push(input.charCodeAt(j)); } // Main decoding loop: start just after the last delimiter if any basic code // points were copied; start at the beginning otherwise. for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { // `index` is the index of the next character to be consumed. // Decode a generalized variable-length integer into `delta`, // which gets added to `i`. The overflow checking is easier // if we increase `i` as we go, then subtract off its starting // value at the end to obtain `delta`. for (oldi = i, w = 1, k = base; /* no condition */; k += base) { if (index >= inputLength) { error('invalid-input'); } digit = basicToDigit(input.charCodeAt(index++)); if (digit >= base || digit > floor((maxInt - i) / w)) { error('overflow'); } i += digit * w; t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); if (digit < t) { break; } baseMinusT = base - t; if (w > floor(maxInt / baseMinusT)) { error('overflow'); } w *= baseMinusT; } out = output.length + 1; bias = adapt(i - oldi, out, oldi == 0); // `i` was supposed to wrap around from `out` to `0`, // incrementing `n` each time, so we'll fix that now: if (floor(i / out) > maxInt - n) { error('overflow'); } n += floor(i / out); i %= out; // Insert `n` at position `i` of the output output.splice(i++, 0, n); } return ucs2encode(output); } /** * Converts a string of Unicode symbols (e.g. a domain name label) to a * Punycode string of ASCII-only symbols. * @memberOf punycode * @param {String} input The string of Unicode symbols. * @returns {String} The resulting Punycode string of ASCII-only symbols. */ function encode(input) { var n, delta, handledCPCount, basicLength, bias, j, m, q, k, t, currentValue, output = [], /** `inputLength` will hold the number of code points in `input`. */ inputLength, /** Cached calculation results */ handledCPCountPlusOne, baseMinusT, qMinusT; // Convert the input in UCS-2 to Unicode input = ucs2decode(input); // Cache the length inputLength = input.length; // Initialize the state n = initialN; delta = 0; bias = initialBias; // Handle the basic code points for (j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue < 0x80) { output.push(stringFromCharCode(currentValue)); } } handledCPCount = basicLength = output.length; // `handledCPCount` is the number of code points that have been handled; // `basicLength` is the number of basic code points. // Finish the basic string - if it is not empty - with a delimiter if (basicLength) { output.push(delimiter); } // Main encoding loop: while (handledCPCount < inputLength) { // All non-basic code points < n have been handled already. Find the next // larger one: for (m = maxInt, j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue >= n && currentValue < m) { m = currentValue; } } // Increase `delta` enough to advance the decoder's state to , // but guard against overflow handledCPCountPlusOne = handledCPCount + 1; if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { error('overflow'); } delta += (m - n) * handledCPCountPlusOne; n = m; for (j = 0; j < inputLength; ++j) { currentValue = input[j]; if (currentValue < n && ++delta > maxInt) { error('overflow'); } if (currentValue == n) { // Represent delta as a generalized variable-length integer for (q = delta, k = base; /* no condition */; k += base) { t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); if (q < t) { break; } qMinusT = q - t; baseMinusT = base - t; output.push( stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) ); q = floor(qMinusT / baseMinusT); } output.push(stringFromCharCode(digitToBasic(q, 0))); bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); delta = 0; ++handledCPCount; } } ++delta; ++n; } return output.join(''); } /** * Converts a Punycode string representing a domain name or an email address * to Unicode. Only the Punycoded parts of the input will be converted, i.e. * it doesn't matter if you call it on a string that has already been * converted to Unicode. * @memberOf punycode * @param {String} input The Punycoded domain name or email address to * convert to Unicode. * @returns {String} The Unicode representation of the given Punycode * string. */ function toUnicode(input) { return mapDomain(input, function(string) { return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; }); } /** * Converts a Unicode string representing a domain name or an email address to * Punycode. Only the non-ASCII parts of the domain name will be converted, * i.e. it doesn't matter if you call it with a domain that's already in * ASCII. * @memberOf punycode * @param {String} input The domain name or email address to convert, as a * Unicode string. * @returns {String} The Punycode representation of the given domain name or * email address. */ function toASCII(input) { return mapDomain(input, function(string) { return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; }); } /*--------------------------------------------------------------------------*/ /** Define the public API */ punycode = { /** * A string representing the current Punycode.js version number. * @memberOf punycode * @type String */ 'version': '1.4.1', /** * An object of methods to convert from JavaScript's internal character * representation (UCS-2) to Unicode code points, and back. * @see * @memberOf punycode * @type Object */ 'ucs2': { 'decode': ucs2decode, 'encode': ucs2encode }, 'decode': decode, 'encode': encode, 'toASCII': toASCII, 'toUnicode': toUnicode }; /** Expose `punycode` */ // Some AMD build optimizers, like r.js, check for specific condition patterns // like the following: if ( true ) { !(__WEBPACK_AMD_DEFINE_RESULT__ = function() { return punycode; }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else if (freeExports && freeModule) { if (module.exports == freeExports) { // in Node.js, io.js, or RingoJS v0.8.0+ freeModule.exports = punycode; } else { // in Narwhal or RingoJS v0.7.0- for (key in punycode) { punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); } } } else { // in Rhino or a web browser root.punycode = punycode; } }(this)); /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(793)(module), __webpack_require__(792))) /***/ }), /* 917 */, /* 918 */, /* 919 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 920 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 921 */, /* 922 */, /* 923 */, /* 924 */, /* 925 */, /* 926 */, /* 927 */, /* 928 */, /* 929 */, /* 930 */, /* 931 */, /* 932 */, /* 933 */, /* 934 */, /* 935 */, /* 936 */, /* 937 */, /* 938 */, /* 939 */, /* 940 */, /* 941 */, /* 942 */, /* 943 */, /* 944 */, /* 945 */, /* 946 */, /* 947 */, /* 948 */, /* 949 */, /* 950 */, /* 951 */, /* 952 */, /* 953 */, /* 954 */, /* 955 */, /* 956 */, /* 957 */, /* 958 */, /* 959 */, /* 960 */ /***/ (function(module, exports) { module.exports = "# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this\n# file, You can obtain one at http://mozilla.org/MPL/2.0/.\n\n# LOCALIZATION NOTE These strings are used inside the Debugger\n# which is available from the Web Developer sub-menu -> 'Debugger'.\n# The correct localization of this file might be to keep it in\n# English, or another language commonly spoken among web developers.\n# You want to make that choice consistent across the developer tools.\n# A good criteria is the language in which you'd find the best\n# documentation on web development on the web.\n\n# LOCALIZATION NOTE (collapsePanes): This is the tooltip for the button\n# that collapses the left and right panes in the debugger UI.\ncollapsePanes=Collapse panes\n\n# LOCALIZATION NOTE (copySource): This is the text that appears in the\n# context menu to copy the selected source of file open.\ncopySource=Copy\ncopySource.accesskey=y\n\n# LOCALIZATION NOTE (copySourceUri2): This is the text that appears in the\n# context menu to copy the source URI of file open.\ncopySourceUri2=Copy source URI\ncopySourceUri2.accesskey=u\n\n# LOCALIZATION NOTE (setDirectoryRoot): This is the text that appears in the\n# context menu to set a directory as root directory\nsetDirectoryRoot.label=Set directory root\nsetDirectoryRoot.accesskey=r\n\n# LOCALIZATION NOTE (copyFunction): This is the text that appears in the\n# context menu to copy the function the user selected\ncopyFunction.label=Copy function\ncopyFunction.accesskey=F\n\n# LOCALIZATION NOTE (copyStackTrace): This is the text that appears in the\n# context menu to copy the stack trace methods, file names and row number.\ncopyStackTrace=Copy stack trace\ncopyStackTrace.accesskey=c\n\n# LOCALIZATION NOTE (expandPanes): This is the tooltip for the button\n# that expands the left and right panes in the debugger UI.\nexpandPanes=Expand panes\n\n# LOCALIZATION NOTE (pauseButtonTooltip): The tooltip that is displayed for the pause\n# button when the debugger is in a running state.\npauseButtonTooltip=Pause %S\n\n# LOCALIZATION NOTE (pausePendingButtonTooltip): The tooltip that is displayed for\n# the pause button after it's been clicked but before the next JavaScript to run.\npausePendingButtonTooltip=Waiting for next execution\n\n# LOCALIZATION NOTE (resumeButtonTooltip): The label that is displayed on the pause\n# button when the debugger is in a paused state.\nresumeButtonTooltip=Resume %S\n\n# LOCALIZATION NOTE (stepOverTooltip): The label that is displayed on the\n# button that steps over a function call.\nstepOverTooltip=Step over %S\n\n# LOCALIZATION NOTE (stepInTooltip): The label that is displayed on the\n# button that steps into a function call.\nstepInTooltip=Step in %S\n\n# LOCALIZATION NOTE (stepOutTooltip): The label that is displayed on the\n# button that steps out of a function call.\nstepOutTooltip=Step out %S\n\n# LOCALIZATION NOTE (pauseButtonItem): The label that is displayed for the dropdown pause\n# list item when the debugger is in a running state.\npauseButtonItem=Pause on Next Statement\n\n# LOCALIZATION NOTE (ignoreExceptionsItem): The pause on exceptions button description\n# when the debugger will not pause on exceptions.\nignoreExceptionsItem=Ignore exceptions\n\n# LOCALIZATION NOTE (pauseOnUncaughtExceptionsItem): The pause on exceptions dropdown\n# item shown when a user is adding a new breakpoint.\npauseOnUncaughtExceptionsItem=Pause on uncaught exceptions\n\n# LOCALIZATION NOTE (pauseOnExceptionsItem): The pause on exceptions button description\n# when the debugger will pause on all exceptions.\npauseOnExceptionsItem=Pause on all exceptions\n\n# LOCALIZATION NOTE (workersHeader): The text to display in the events\n# header.\nworkersHeader=Workers\n\n# LOCALIZATION NOTE (noWorkersText): The text to display in the workers list\n# when there are no workers.\nnoWorkersText=This page has no workers.\n\n# LOCALIZATION NOTE (noSourcesText): The text to display in the sources list\n# when there are no sources.\nnoSourcesText=This page has no sources.\n\n# LOCALIZATION NOTE (noEventListenersText): The text to display in the events tab\n# when there are no events.\nnoEventListenersText=No event listeners to display.\n\n# LOCALIZATION NOTE (eventListenersHeader): The text to display in the events\n# header.\neventListenersHeader=Event listeners\n\n# LOCALIZATION NOTE (noStackFramesText): The text to display in the call stack tab\n# when there are no stack frames.\nnoStackFramesText=No stack frames to display\n\n# LOCALIZATION NOTE (eventCheckboxTooltip): The tooltip text to display when\n# the user hovers over the checkbox used to toggle an event breakpoint.\neventCheckboxTooltip=Toggle breaking on this event\n\n# LOCALIZATION NOTE (eventOnSelector): The text to display in the events tab\n# for every event item, between the event type and event selector.\neventOnSelector=on\n\n# LOCALIZATION NOTE (eventInSource): The text to display in the events tab\n# for every event item, between the event selector and listener's owner source.\neventInSource=in\n\n# LOCALIZATION NOTE (eventNodes): The text to display in the events tab when\n# an event is listened on more than one target node.\neventNodes=%S nodes\n\n# LOCALIZATION NOTE (eventNative): The text to display in the events tab when\n# a listener is added from plugins, thus getting translated to native code.\neventNative=[native code]\n\n# LOCALIZATION NOTE (*Events): The text to display in the events tab for\n# each group of sub-level event entries.\nanimationEvents=Animation\naudioEvents=Audio\nbatteryEvents=Battery\nclipboardEvents=Clipboard\ncompositionEvents=Composition\ndeviceEvents=Device\ndisplayEvents=Display\ndragAndDropEvents=Drag and Drop\ngamepadEvents=Gamepad\nindexedDBEvents=IndexedDB\ninteractionEvents=Interaction\nkeyboardEvents=Keyboard\nmediaEvents=HTML5 Media\nmouseEvents=Mouse\nmutationEvents=Mutation\nnavigationEvents=Navigation\npointerLockEvents=Pointer Lock\nsensorEvents=Sensor\nstorageEvents=Storage\ntimeEvents=Time\ntouchEvents=Touch\notherEvents=Other\n\n# LOCALIZATION NOTE (blackboxCheckboxTooltip2): The tooltip text to display when\n# the user hovers over the checkbox used to toggle blackboxing its associated\n# source.\nblackboxCheckboxTooltip2=Toggle blackboxing\n\n# LOCALIZATION NOTE (sources.search.key2): Key shortcut to open the search for\n# searching all the source files the debugger has seen.\nsources.search.key2=CmdOrCtrl+P\n\n# LOCALIZATION NOTE (sources.search.alt.key): A second key shortcut to open the\n# search for searching all the source files the debugger has seen.\nsources.search.alt.key=CmdOrCtrl+O\n\n# LOCALIZATION NOTE (projectTextSearch.key): A key shortcut to open the\n# full project text search for searching all the files the debugger has seen.\nprojectTextSearch.key=CmdOrCtrl+Shift+F\n\n# LOCALIZATION NOTE (functionSearch.key): A key shortcut to open the\n# modal for searching functions in a file.\nfunctionSearch.key=CmdOrCtrl+Shift+O\n\n# LOCALIZATION NOTE (toggleBreakpoint.key): A key shortcut to toggle\n# breakpoints.\ntoggleBreakpoint.key=CmdOrCtrl+B\n\n# LOCALIZATION NOTE (toggleCondPanel.key): A key shortcut to toggle\n# the conditional breakpoint panel.\ntoggleCondPanel.key=CmdOrCtrl+Shift+B\n\n# LOCALIZATION NOTE (stepOut.key): A key shortcut to\n# step out.\nstepOut.key=Shift+F11\n\n# LOCALIZATION NOTE (shortcuts.header.editor): Sections header in\n# the shortcuts modal for keyboard shortcuts related to editing.\nshortcuts.header.editor=Editor\n\n# LOCALIZATION NOTE (shortcuts.header.stepping): Sections header in\n# the shortcuts modal for keyboard shortcuts related to stepping.\nshortcuts.header.stepping=Stepping\n\n# LOCALIZATION NOTE (shortcuts.header.search): Sections header in\n# the shortcuts modal for keyboard shortcuts related to search.\nshortcuts.header.search=Search\n\n# LOCALIZATION NOTE (projectTextSearch.placeholder): A placeholder shown\n# when searching across all of the files in a project.\nprojectTextSearch.placeholder=Find in files…\n\n# LOCALIZATION NOTE (projectTextSearch.noResults): The center pane Text Search\n# message when the query did not match any text of all files in a project.\nprojectTextSearch.noResults=No results found\n\n# LOCALIZATION NOTE (sources.noSourcesAvailable): Text shown when the debugger\n# does not have any sources.\nsources.noSourcesAvailable=This page has no sources\n\n# LOCALIZATION NOTE (sourceSearch.search.key2): Key shortcut to open the search\n# for searching within a the currently opened files in the editor\nsourceSearch.search.key2=CmdOrCtrl+F\n\n# LOCALIZATION NOTE (sourceSearch.search.placeholder): placeholder text in\n# the source search input bar\nsourceSearch.search.placeholder=Search in file…\n\n# LOCALIZATION NOTE (sourceSearch.search.again.key2): Key shortcut to highlight\n# the next occurrence of the last search triggered from a source search\nsourceSearch.search.again.key2=CmdOrCtrl+G\n\n# LOCALIZATION NOTE (sourceSearch.search.againPrev.key2): Key shortcut to highlight\n# the previous occurrence of the last search triggered from a source search\nsourceSearch.search.againPrev.key2=CmdOrCtrl+Shift+G\n\n# LOCALIZATION NOTE (sourceSearch.resultsSummary1): Shows a summary of\n# the number of matches for autocomplete\nsourceSearch.resultsSummary1=%d results\n\n# LOCALIZATION NOTE (noMatchingStringsText): The text to display in the\n# global search results when there are no matching strings after filtering.\nnoMatchingStringsText=No matches found\n\n# LOCALIZATION NOTE (emptySearchText): This is the text that appears in the\n# filter text box when it is empty and the scripts container is selected.\nemptySearchText=Search scripts (%S)\n\n# LOCALIZATION NOTE (emptyVariablesFilterText): This is the text that\n# appears in the filter text box for the variables view container.\nemptyVariablesFilterText=Filter variables\n\n# LOCALIZATION NOTE (emptyPropertiesFilterText): This is the text that\n# appears in the filter text box for the editor's variables view bubble.\nemptyPropertiesFilterText=Filter properties\n\n# LOCALIZATION NOTE (searchPanelFilter): This is the text that appears in the\n# filter panel popup for the filter scripts operation.\nsearchPanelFilter=Filter scripts (%S)\n\n# LOCALIZATION NOTE (searchPanelGlobal): This is the text that appears in the\n# filter panel popup for the global search operation.\nsearchPanelGlobal=Search in all files (%S)\n\n# LOCALIZATION NOTE (searchPanelFunction): This is the text that appears in the\n# filter panel popup for the function search operation.\nsearchPanelFunction=Search for function definition (%S)\n\n# LOCALIZATION NOTE (searchPanelToken): This is the text that appears in the\n# filter panel popup for the token search operation.\nsearchPanelToken=Find in this file (%S)\n\n# LOCALIZATION NOTE (searchPanelGoToLine): This is the text that appears in the\n# filter panel popup for the line search operation.\nsearchPanelGoToLine=Go to line (%S)\n\n# LOCALIZATION NOTE (searchPanelVariable): This is the text that appears in the\n# filter panel popup for the variables search operation.\nsearchPanelVariable=Filter variables (%S)\n\n# LOCALIZATION NOTE (breakpointMenuItem): The text for all the elements that\n# are displayed in the breakpoints menu item popup.\nbreakpointMenuItem.setConditional=Configure conditional breakpoint\nbreakpointMenuItem.enableSelf2.label=Enable\nbreakpointMenuItem.enableSelf2.accesskey=E\nbreakpointMenuItem.disableSelf2.label=Disable\nbreakpointMenuItem.disableSelf2.accesskey=D\nbreakpointMenuItem.deleteSelf2.label=Remove\nbreakpointMenuItem.deleteSelf2.accesskey=R\nbreakpointMenuItem.enableOthers2.label=Enable others\nbreakpointMenuItem.enableOthers2.accesskey=o\nbreakpointMenuItem.disableOthers2.label=Disable others\nbreakpointMenuItem.disableOthers2.accesskey=s\nbreakpointMenuItem.deleteOthers2.label=Remove others\nbreakpointMenuItem.deleteOthers2.accesskey=h\nbreakpointMenuItem.enableAll2.label=Enable all\nbreakpointMenuItem.enableAll2.accesskey=b\nbreakpointMenuItem.disableAll2.label=Disable all\nbreakpointMenuItem.disableAll2.accesskey=k\nbreakpointMenuItem.deleteAll2.label=Remove all\nbreakpointMenuItem.deleteAll2.accesskey=a\nbreakpointMenuItem.removeCondition2.label=Remove condition\nbreakpointMenuItem.removeCondition2.accesskey=c\nbreakpointMenuItem.addCondition2.label=Add condition\nbreakpointMenuItem.addCondition2.accesskey=A\nbreakpointMenuItem.editCondition2.label=Edit condition\nbreakpointMenuItem.editCondition2.accesskey=n\nbreakpointMenuItem.enableSelf=Enable breakpoint\nbreakpointMenuItem.enableSelf.accesskey=E\nbreakpointMenuItem.disableSelf=Disable breakpoint\nbreakpointMenuItem.disableSelf.accesskey=D\nbreakpointMenuItem.deleteSelf=Remove breakpoint\nbreakpointMenuItem.deleteSelf.accesskey=R\nbreakpointMenuItem.enableOthers=Enable others\nbreakpointMenuItem.enableOthers.accesskey=o\nbreakpointMenuItem.disableOthers=Disable others\nbreakpointMenuItem.disableOthers.accesskey=s\nbreakpointMenuItem.deleteOthers=Remove others\nbreakpointMenuItem.deleteOthers.accesskey=h\nbreakpointMenuItem.enableAll=Enable all breakpoints\nbreakpointMenuItem.enableAll.accesskey=b\nbreakpointMenuItem.disableAll=Disable all breakpoints\nbreakpointMenuItem.disableAll.accesskey=k\nbreakpointMenuItem.deleteAll=Remove all breakpoints\nbreakpointMenuItem.deleteAll.accesskey=a\nbreakpointMenuItem.removeCondition.label=Remove breakpoint condition\nbreakpointMenuItem.removeCondition.accesskey=c\nbreakpointMenuItem.editCondition.label=Edit breakpoint condition\nbreakpointMenuItem.editCondition.accesskey=n\n\n# LOCALIZATION NOTE (breakpoints.header): Breakpoints right sidebar pane header.\nbreakpoints.header=Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.none): The text that appears when there are\n# no breakpoints present\nbreakpoints.none=No breakpoints\n\n# LOCALIZATION NOTE (breakpoints.enable): The text that may appear as a tooltip\n# when hovering over the 'disable breakpoints' switch button in right sidebar\nbreakpoints.enable=Enable breakpoints\n\n# LOCALIZATION NOTE (breakpoints.disable): The text that may appear as a tooltip\n# when hovering over the 'disable breakpoints' switch button in right sidebar\nbreakpoints.disable=Disable breakpoints\n\n# LOCALIZATION NOTE (breakpoints.removeBreakpointTooltip): The tooltip that is displayed\n# for remove breakpoint button in right sidebar\nbreakpoints.removeBreakpointTooltip=Remove breakpoint\n\n# LOCALIZATION NOTE (callStack.header): Call Stack right sidebar pane header.\ncallStack.header=Call stack\n\n# LOCALIZATION NOTE (callStack.notPaused): Call Stack right sidebar pane\n# message when not paused.\ncallStack.notPaused=Not paused\n\n# LOCALIZATION NOTE (callStack.collapse): Call Stack right sidebar pane\n# message to hide some of the frames that are shown.\ncallStack.collapse=Collapse rows\n\n# LOCALIZATION NOTE (callStack.expand): Call Stack right sidebar pane\n# message to show more of the frames.\ncallStack.expand=Expand rows\n\n# LOCALIZATION NOTE (editor.searchResults): Editor Search bar message\n# for the summarizing the selected search result. e.g. 5 of 10 results.\neditor.searchResults=%d of %d results\n\n# LOCALIZATION NOTE (sourceSearch.singleResult): Copy shown when there is one result.\neditor.singleResult=1 result\n\n# LOCALIZATION NOTE (editor.noResults): Editor Search bar message\n# for when no results found.\neditor.noResults=No results\n\n# LOCALIZATION NOTE (editor.searchResults.nextResult): Editor Search bar\n# tooltip for traversing to the Next Result\neditor.searchResults.nextResult=Next result\n\n# LOCALIZATION NOTE (editor.searchResults.prevResult): Editor Search bar\n# tooltip for traversing to the Previous Result\neditor.searchResults.prevResult=Previous result\n\n# LOCALIZATION NOTE (editor.searchTypeToggleTitle): Search bar title for\n# toggling search type buttons(function search, variable search)\neditor.searchTypeToggleTitle=Search for:\n\n# LOCALIZATION NOTE (editor.continueToHere.label): Editor gutter context\n# menu item for jumping to a new paused location\neditor.continueToHere.label=Continue to here\neditor.continueToHere.accesskey=H\n\n# LOCALIZATION NOTE (editor.addBreakpoint): Editor gutter context menu item\n# for adding a breakpoint on a line.\neditor.addBreakpoint=Add breakpoint\n\n# LOCALIZATION NOTE (editor.disableBreakpoint): Editor gutter context menu item\n# for disabling a breakpoint on a line.\neditor.disableBreakpoint=Disable breakpoint\neditor.disableBreakpoint.accesskey=D\n\n# LOCALIZATION NOTE (editor.enableBreakpoint): Editor gutter context menu item\n# for enabling a breakpoint on a line.\neditor.enableBreakpoint=Enable breakpoint\n\n# LOCALIZATION NOTE (editor.removeBreakpoint): Editor gutter context menu item\n# for removing a breakpoint on a line.\neditor.removeBreakpoint=Remove breakpoint\n\n# LOCALIZATION NOTE (editor.editBreakpoint): Editor gutter context menu item\n# for setting a breakpoint condition on a line.\neditor.editBreakpoint=Edit breakpoint\n\n# LOCALIZATION NOTE (editor.addConditionalBreakpoint): Editor gutter context\n# menu item for adding a breakpoint condition on a line.\neditor.addConditionalBreakpoint=Add conditional breakpoint\neditor.addConditionalBreakpoint.accesskey=c\n\n# LOCALIZATION NOTE (editor.conditionalPanel.placeholder): Placeholder text for\n# input element inside ConditionalPanel component\neditor.conditionalPanel.placeholder=This breakpoint will pause when the expression is true\n\n# LOCALIZATION NOTE (editor.conditionalPanel.placeholder): Tooltip text for\n# close button inside ConditionalPanel component\neditor.conditionalPanel.close=Cancel edit breakpoint and close\n\n# LOCALIZATION NOTE (editor.jumpToMappedLocation1): Context menu item\n# for navigating to a source mapped location\neditor.jumpToMappedLocation1=Jump to %S location\neditor.jumpToMappedLocation1.accesskey=m\n\n# LOCALIZATION NOTE (framework.disableGrouping): This is the text that appears in the\n# context menu to disable framework grouping.\nframework.disableGrouping=Disable framework grouping\nframework.disableGrouping.accesskey=u\n\n# LOCALIZATION NOTE (framework.enableGrouping): This is the text that appears in the\n# context menu to enable framework grouping.\nframework.enableGrouping=Enable framework grouping\nframework.enableGrouping.accesskey=u\n\n# LOCALIZATION NOTE (generated): Source Map term for a server source location\ngenerated=generated\n\n# LOCALIZATION NOTE (original): Source Map term for a debugger UI source location\noriginal=original\n\n# LOCALIZATION NOTE (expressions.placeholder): Placeholder text for expression\n# input element\nexpressions.placeholder=Add watch expression\nexpressions.label=Add watch expression\nexpressions.accesskey=e\n\n# LOCALIZATION NOTE (sourceTabs.closeTab): Editor source tab context menu item\n# for closing the selected tab below the mouse.\nsourceTabs.closeTab=Close tab\nsourceTabs.closeTab.accesskey=c\n\n# LOCALIZATION NOTE (sourceTabs.closeOtherTabs): Editor source tab context menu item\n# for closing the other tabs.\nsourceTabs.closeOtherTabs=Close other tabs\nsourceTabs.closeOtherTabs.accesskey=o\n\n# LOCALIZATION NOTE (sourceTabs.closeTabsToEnd): Editor source tab context menu item\n# for closing the tabs to the end (the right for LTR languages) of the selected tab.\nsourceTabs.closeTabsToEnd=Close tabs to the right\nsourceTabs.closeTabsToEnd.accesskey=e\n\n# LOCALIZATION NOTE (sourceTabs.closeAllTabs): Editor source tab context menu item\n# for closing all tabs.\nsourceTabs.closeAllTabs=Close all tabs\nsourceTabs.closeAllTabs.accesskey=a\n\n# LOCALIZATION NOTE (sourceTabs.revealInTree): Editor source tab context menu item\n# for revealing source in tree.\nsourceTabs.revealInTree=Reveal in tree\nsourceTabs.revealInTree.accesskey=r\n\n# LOCALIZATION NOTE (sourceTabs.prettyPrint): Editor source tab context menu item\n# for pretty printing the source.\nsourceTabs.prettyPrint=Pretty print source\nsourceTabs.prettyPrint.accesskey=p\n\n# LOCALIZATION NOTE (sourceFooter.blackbox): Tooltip text associated\n# with the blackbox button\nsourceFooter.blackbox=Blackbox source\nsourceFooter.blackbox.accesskey=B\n\n# LOCALIZATION NOTE (sourceFooter.unblackbox): Tooltip text associated\n# with the blackbox button\nsourceFooter.unblackbox=Unblackbox source\nsourceFooter.unblackbox.accesskey=b\n\n# LOCALIZATION NOTE (sourceFooter.blackboxed): Text associated\n# with a blackboxed source\nsourceFooter.blackboxed=Blackboxed source\n\n# LOCALIZATION NOTE (sourceFooter.mappedSource): Text associated\n# with a mapped source. %S is replaced by the source map origin.\nsourceFooter.mappedSource=(From %S)\n\n# LOCALIZATION NOTE (sourceFooter.mappedSourceTooltip): Tooltip text associated\n# with a mapped source. %S is replaced by the source map origin.\nsourceFooter.mappedSourceTooltip=(Source mapped from %S)\n\n# LOCALIZATION NOTE (sourceFooter.codeCoverage): Text associated\n# with a code coverage button\nsourceFooter.codeCoverage=Code coverage\n\n# LOCALIZATION NOTE (sourceTabs.closeTabButtonTooltip): The tooltip that is displayed\n# for close tab button in source tabs.\nsourceTabs.closeTabButtonTooltip=Close tab\n\n# LOCALIZATION NOTE (scopes.header): Scopes right sidebar pane header.\nscopes.header=Scopes\n\n# LOCALIZATION NOTE (scopes.notAvailable): Scopes right sidebar pane message\n# for when the debugger is paused, but there isn't pause data.\nscopes.notAvailable=Scopes unavailable\n\n# LOCALIZATION NOTE (scopes.notPaused): Scopes right sidebar pane message\n# for when the debugger is not paused.\nscopes.notPaused=Not paused\n\n# LOCALIZATION NOTE (scopes.block): Refers to a block of code in\n# the scopes pane when the debugger is paused.\nscopes.block=Block\n\n# LOCALIZATION NOTE (sources.header): Sources left sidebar header\nsources.header=Sources\n\n# LOCALIZATION NOTE (outline.header): Outline left sidebar header\noutline.header=Outline\n\n# LOCALIZATION NOTE (outline.noFunctions): Outline text when there are no functions to display\noutline.noFunctions=No functions\n\n# LOCALIZATION NOTE (sources.search): Sources left sidebar prompt\n# e.g. Cmd+P to search. On a mac, we use the command unicode character.\n# On windows, it's ctrl.\nsources.search=%S to search\n\n# LOCALIZATION NOTE (watchExpressions.header): Watch Expressions right sidebar\n# pane header.\nwatchExpressions.header=Watch expressions\n\n# LOCALIZATION NOTE (watchExpressions.refreshButton): Watch Expressions header\n# button for refreshing the expressions.\nwatchExpressions.refreshButton=Refresh\n\n# LOCALIZATION NOTE (welcome.search): The center pane welcome panel's\n# search prompt. e.g. cmd+p to search for files. On windows, it's ctrl, on\n# a mac we use the unicode character.\nwelcome.search=%S to search for sources\n\n# LOCALIZATION NOTE (welcome.findInFiles): The center pane welcome panel's\n# search prompt. e.g. cmd+f to search for files. On windows, it's ctrl+shift+f, on\n# a mac we use the unicode character.\nwelcome.findInFiles=%S to find in files\n\n# LOCALIZATION NOTE (welcome.searchFunction): Label displayed in the welcome\n# panel. %S is replaced by the keyboard shortcut to search for functions.\nwelcome.searchFunction=%S to search for functions in file\n\n# LOCALIZATION NOTE (sourceSearch.search): The center pane Source Search\n# prompt for searching for files.\nsourceSearch.search=Search sources…\n\n# LOCALIZATION NOTE (sourceSearch.noResults): The center pane Source Search\n# message when the query did not match any of the sources.\nsourceSearch.noResults2=No results found\n\n# LOCALIZATION NOTE (ignoreExceptions): The pause on exceptions button tooltip\n# when the debugger will not pause on exceptions.\nignoreExceptions=Ignore exceptions. Click to pause on uncaught exceptions\n\n# LOCALIZATION NOTE (pauseOnUncaughtExceptions): The pause on exceptions button\n# tooltip when the debugger will pause on uncaught exceptions.\npauseOnUncaughtExceptions=Pause on uncaught exceptions. Click to pause on all exceptions\n\n# LOCALIZATION NOTE (pauseOnExceptions): The pause on exceptions button tooltip\n# when the debugger will pause on all exceptions.\npauseOnExceptions=Pause on all exceptions. Click to ignore exceptions\n\n# LOCALIZATION NOTE (loadingText): The text that is displayed in the script\n# editor when the loading process has started but there is no file to display\n# yet.\nloadingText=Loading\\u2026\n\n# LOCALIZATION NOTE (errorLoadingText3): The text that is displayed in the debugger\n# viewer when there is an error loading a file\nerrorLoadingText3=Error loading this URI: %S\n\n# LOCALIZATION NOTE (addWatchExpressionText): The text that is displayed in the\n# watch expressions list to add a new item.\naddWatchExpressionText=Add watch expression\n\n# LOCALIZATION NOTE (addWatchExpressionButton): The button that is displayed in the\n# variables view popup.\naddWatchExpressionButton=Watch\n\n# LOCALIZATION NOTE (emptyVariablesText): The text that is displayed in the\n# variables pane when there are no variables to display.\nemptyVariablesText=No variables to display\n\n# LOCALIZATION NOTE (scopeLabel): The text that is displayed in the variables\n# pane as a header for each variable scope (e.g. \"Global scope, \"With scope\",\n# etc.).\nscopeLabel=%S scope\n\n# LOCALIZATION NOTE (watchExpressionsScopeLabel): The name of the watch\n# expressions scope. This text is displayed in the variables pane as a header for\n# the watch expressions scope.\nwatchExpressionsScopeLabel=Watch expressions\n\n# LOCALIZATION NOTE (globalScopeLabel): The name of the global scope. This text\n# is added to scopeLabel and displayed in the variables pane as a header for\n# the global scope.\nglobalScopeLabel=Global\n\n# LOCALIZATION NOTE (variablesViewErrorStacktrace): This is the text that is\n# shown before the stack trace in an error.\nvariablesViewErrorStacktrace=Stack trace:\n\n# LOCALIZATION NOTE (variablesViewMoreObjects): the text that is displayed\n# when you have an object preview that does not show all of the elements. At the end of the list\n# you see \"N more...\" in the web console output.\n# This is a semi-colon list of plural forms.\n# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals\n# #1 number of remaining items in the object\n# example: 3 more…\nvariablesViewMoreObjects=#1 more…;#1 more…\n\n# LOCALIZATION NOTE (variablesEditableNameTooltip): The text that is displayed\n# in the variables list on an item with an editable name.\nvariablesEditableNameTooltip=Double click to edit\n\n# LOCALIZATION NOTE (variablesEditableValueTooltip): The text that is displayed\n# in the variables list on an item with an editable value.\nvariablesEditableValueTooltip=Click to change value\n\n# LOCALIZATION NOTE (variablesCloseButtonTooltip): The text that is displayed\n# in the variables list on an item which can be removed.\nvariablesCloseButtonTooltip=Click to remove\n\n# LOCALIZATION NOTE (variablesEditButtonTooltip): The text that is displayed\n# in the variables list on a getter or setter which can be edited.\nvariablesEditButtonTooltip=Click to set value\n\n# LOCALIZATION NOTE (variablesEditableValueTooltip): The text that is displayed\n# in a tooltip on the \"open in inspector\" button in the the variables list for a\n# DOMNode item.\nvariablesDomNodeValueTooltip=Click to select the node in the inspector\n\n# LOCALIZATION NOTE (configurable|...|Tooltip): The text that is displayed\n# in the variables list on certain variables or properties as tooltips.\n# Expanations of what these represent can be found at the following links:\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed\n# It's probably best to keep these in English.\nconfigurableTooltip=configurable\nenumerableTooltip=enumerable\nwritableTooltip=writable\nfrozenTooltip=frozen\nsealedTooltip=sealed\nextensibleTooltip=extensible\noverriddenTooltip=overridden\nWebIDLTooltip=WebIDL\n\n# LOCALIZATION NOTE (variablesSeparatorLabel): The text that is displayed\n# in the variables list as a separator between the name and value.\nvariablesSeparatorLabel=:\n\n# LOCALIZATION NOTE (watchExpressionsSeparatorLabel2): The text that is displayed\n# in the watch expressions list as a separator between the code and evaluation.\nwatchExpressionsSeparatorLabel2=\\u0020→\n\n# LOCALIZATION NOTE (functionSearchSeparatorLabel): The text that is displayed\n# in the functions search panel as a separator between function's inferred name\n# and its real name (if available).\nfunctionSearchSeparatorLabel=←\n\n# LOCALIZATION NOTE(gotoLineModal.placeholder): The placeholder\n# text displayed when the user searches for specific lines in a file\ngotoLineModal.placeholder=Go to line…\ngotoLineModal.key=CmdOrCtrl+Shift+;\n\n# LOCALIZATION NOTE(symbolSearch.search.functionsPlaceholder): The placeholder\n# text displayed when the user searches for functions in a file\nsymbolSearch.search.functionsPlaceholder=Search functions…\n\n# LOCALIZATION NOTE(symbolSearch.search.variablesPlaceholder): The placeholder\n# text displayed when the user searches for variables in a file\nsymbolSearch.search.variablesPlaceholder=Search variables…\n\n# LOCALIZATION NOTE(symbolSearch.search.key2): The Key Shortcut for\n# searching for a function or variable\nsymbolSearch.search.key2=CmdOrCtrl+Shift+O\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.modifiersLabel): A label\n# preceding the group of modifiers\nsymbolSearch.searchModifier.modifiersLabel=Modifiers:\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.regex): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.regex=Regex\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.caseSensitive): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.caseSensitive=Case sensitive\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.wholeWord): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.wholeWord=Whole word\n\n# LOCALIZATION NOTE (resumptionOrderPanelTitle): This is the text that appears\n# as a description in the notification panel popup, when multiple debuggers are\n# open in separate tabs and the user tries to resume them in the wrong order.\n# The substitution parameter is the URL of the last paused window that must be\n# resumed first.\nresumptionOrderPanelTitle=There are one or more paused debuggers. Please resume the most-recently paused debugger first at: %S\n\nvariablesViewOptimizedOut=(optimized away)\nvariablesViewUninitialized=(uninitialized)\nvariablesViewMissingArgs=(unavailable)\n\nanonymousSourcesLabel=Anonymous sources\n\nexperimental=This is an experimental feature\n\n# LOCALIZATION NOTE (whyPaused.debuggerStatement): The text that is displayed\n# in a info block explaining how the debugger is currently paused due to a `debugger`\n# statement in the code\nwhyPaused.debuggerStatement=Paused on debugger statement\n\n# LOCALIZATION NOTE (whyPaused.breakpoint): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a breakpoint\nwhyPaused.breakpoint=Paused on breakpoint\n\n# LOCALIZATION NOTE (whyPaused.exception): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an exception\nwhyPaused.exception=Paused on exception\n\n# LOCALIZATION NOTE (whyPaused.resumeLimit): The text that is displayed\n# in a info block explaining how the debugger is currently paused while stepping\n# in or out of the stack\nwhyPaused.resumeLimit=Paused while stepping\n\n# LOCALIZATION NOTE (whyPaused.pauseOnDOMEvents): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# dom event\nwhyPaused.pauseOnDOMEvents=Paused on event listener\n\n# LOCALIZATION NOTE (whyPaused.breakpointConditionThrown): The text that is displayed\n# in an info block when evaluating a conditional breakpoint throws an error\nwhyPaused.breakpointConditionThrown=Error with conditional breakpoint\n\n# LOCALIZATION NOTE (whyPaused.xhr): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an\n# xml http request\nwhyPaused.xhr=Paused on XMLHttpRequest\n\n# LOCALIZATION NOTE (whyPaused.promiseRejection): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# promise rejection\nwhyPaused.promiseRejection=Paused on promise rejection\n\n# LOCALIZATION NOTE (whyPaused.assert): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an\n# assert\nwhyPaused.assert=Paused on assertion\n\n# LOCALIZATION NOTE (whyPaused.debugCommand): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# debugger statement\nwhyPaused.debugCommand=Paused on debugged function\n\n# LOCALIZATION NOTE (whyPaused.other): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an event\n# listener breakpoint set\nwhyPaused.other=Debugger paused\n\n# LOCALIZATION NOTE (ctrl): The text that is used for documenting\n# keyboard shortcuts that use the control key\nctrl=Ctrl\n\n# LOCALIZATION NOTE (anonymous): The text that is displayed when the\n# display name is null.\nanonymous=(anonymous)\n\n# LOCALIZATION NOTE (shortcuts.toggleBreakpoint): text describing\n# keyboard shortcut action for toggling breakpoint\nshortcuts.toggleBreakpoint=Toggle Breakpoint\nshortcuts.toggleBreakpoint.accesskey=B\n\n# LOCALIZATION NOTE (shortcuts.toggleCondPanel): text describing\n# keyboard shortcut action for toggling conditional panel keyboard\nshortcuts.toggleCondPanel=Toggle Conditional Panel\n\n# LOCALIZATION NOTE (shortcuts.pauseOrResume): text describing\n# keyboard shortcut action for pause of resume\nshortcuts.pauseOrResume=Pause/Resume\n\n# LOCALIZATION NOTE (shortcuts.stepOver): text describing\n# keyboard shortcut action for stepping over\nshortcuts.stepOver=Step Over\n\n# LOCALIZATION NOTE (shortcuts.stepIn): text describing\n# keyboard shortcut action for stepping in\nshortcuts.stepIn=Step In\n\n# LOCALIZATION NOTE (shortcuts.stepOut): text describing\n# keyboard shortcut action for stepping out\nshortcuts.stepOut=Step Out\n\n# LOCALIZATION NOTE (shortcuts.fileSearch): text describing\n# keyboard shortcut action for source file search\nshortcuts.fileSearch=Source File Search\n\n# LOCALIZATION NOTE (shortcuts.searchAgain): text describing\n# keyboard shortcut action for searching again\nshortcuts.searchAgain=Search Again\n\n# LOCALIZATION NOTE (shortcuts.projectSearch): text describing\n# keyboard shortcut action for full project search\nshortcuts.projectSearch=Full Project Search\n\n# LOCALIZATION NOTE (shortcuts.functionSearch): text describing\n# keyboard shortcut action for function search\nshortcuts.functionSearch=Function Search\n\n# LOCALIZATION NOTE (shortcuts.buttonName): text describing\n# keyboard shortcut button text\nshortcuts.buttonName=Keyboard shortcuts\n" /***/ }), /* 961 */, /* 962 */, /* 963 */, /* 964 */, /* 965 */ /***/ (function(module, exports) { /** * slice() reference. */ var slice = Array.prototype.slice; /** * Expose `co`. */ module.exports = co['default'] = co.co = co; /** * Wrap the given generator `fn` into a * function that returns a promise. * This is a separate function so that * every `co()` call doesn't create a new, * unnecessary closure. * * @param {GeneratorFunction} fn * @return {Function} * @api public */ co.wrap = function (fn) { createPromise.__generatorFunction__ = fn; return createPromise; function createPromise() { return co.call(this, fn.apply(this, arguments)); } }; /** * Execute the generator function or a generator * and return a promise. * * @param {Function} fn * @return {Promise} * @api public */ function co(gen) { var ctx = this; var args = slice.call(arguments, 1) // we wrap everything in a promise to avoid promise chaining, // which leads to memory leak errors. // see https://github.com/tj/co/issues/180 return new Promise(function(resolve, reject) { if (typeof gen === 'function') gen = gen.apply(ctx, args); if (!gen || typeof gen.next !== 'function') return resolve(gen); onFulfilled(); /** * @param {Mixed} res * @return {Promise} * @api private */ function onFulfilled(res) { var ret; try { ret = gen.next(res); } catch (e) { return reject(e); } next(ret); } /** * @param {Error} err * @return {Promise} * @api private */ function onRejected(err) { var ret; try { ret = gen.throw(err); } catch (e) { return reject(e); } next(ret); } /** * Get the next value in the generator, * return a promise. * * @param {Object} ret * @return {Promise} * @api private */ function next(ret) { if (ret.done) return resolve(ret.value); var value = toPromise.call(ctx, ret.value); if (value && isPromise(value)) return value.then(onFulfilled, onRejected); return onRejected(new TypeError('You may only yield a function, promise, generator, array, or object, ' + 'but the following object was passed: "' + String(ret.value) + '"')); } }); } /** * Convert a `yield`ed value into a promise. * * @param {Mixed} obj * @return {Promise} * @api private */ function toPromise(obj) { if (!obj) return obj; if (isPromise(obj)) return obj; if (isGeneratorFunction(obj) || isGenerator(obj)) return co.call(this, obj); if ('function' == typeof obj) return thunkToPromise.call(this, obj); if (Array.isArray(obj)) return arrayToPromise.call(this, obj); if (isObject(obj)) return objectToPromise.call(this, obj); return obj; } /** * Convert a thunk to a promise. * * @param {Function} * @return {Promise} * @api private */ function thunkToPromise(fn) { var ctx = this; return new Promise(function (resolve, reject) { fn.call(ctx, function (err, res) { if (err) return reject(err); if (arguments.length > 2) res = slice.call(arguments, 1); resolve(res); }); }); } /** * Convert an array of "yieldables" to a promise. * Uses `Promise.all()` internally. * * @param {Array} obj * @return {Promise} * @api private */ function arrayToPromise(obj) { return Promise.all(obj.map(toPromise, this)); } /** * Convert an object of "yieldables" to a promise. * Uses `Promise.all()` internally. * * @param {Object} obj * @return {Promise} * @api private */ function objectToPromise(obj){ var results = new obj.constructor(); var keys = Object.keys(obj); var promises = []; for (var i = 0; i < keys.length; i++) { var key = keys[i]; var promise = toPromise.call(this, obj[key]); if (promise && isPromise(promise)) defer(promise, key); else results[key] = obj[key]; } return Promise.all(promises).then(function () { return results; }); function defer(promise, key) { // predefine the key in the result results[key] = undefined; promises.push(promise.then(function (res) { results[key] = res; })); } } /** * Check if `obj` is a promise. * * @param {Object} obj * @return {Boolean} * @api private */ function isPromise(obj) { return 'function' == typeof obj.then; } /** * Check if `obj` is a generator. * * @param {Mixed} obj * @return {Boolean} * @api private */ function isGenerator(obj) { return 'function' == typeof obj.next && 'function' == typeof obj.throw; } /** * Check if `obj` is a generator function. * * @param {Mixed} obj * @return {Boolean} * @api private */ function isGeneratorFunction(obj) { var constructor = obj.constructor; if (!constructor) return false; if ('GeneratorFunction' === constructor.name || 'GeneratorFunction' === constructor.displayName) return true; return isGenerator(constructor.prototype); } /** * Check for plain object. * * @param {Mixed} val * @return {Boolean} * @api private */ function isObject(val) { return Object == val.constructor; } /***/ }), /* 966 */, /* 967 */, /* 968 */, /* 969 */, /* 970 */, /* 971 */, /* 972 */, /* 973 */, /* 974 */, /* 975 */, /* 976 */, /* 977 */, /* 978 */, /* 979 */, /* 980 */, /* 981 */, /* 982 */, /* 983 */, /* 984 */, /* 985 */, /* 986 */, /* 987 */, /* 988 */, /* 989 */, /* 990 */, /* 991 */, /* 992 */, /* 993 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; exports.defaultMemoize = defaultMemoize; exports.createSelectorCreator = createSelectorCreator; exports.createStructuredSelector = createStructuredSelector; function defaultEqualityCheck(a, b) { return a === b; } function areArgumentsShallowlyEqual(equalityCheck, prev, next) { if (prev === null || next === null || prev.length !== next.length) { return false; } // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible. var length = prev.length; for (var i = 0; i < length; i++) { if (!equalityCheck(prev[i], next[i])) { return false; } } return true; } function defaultMemoize(func) { var equalityCheck = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultEqualityCheck; var lastArgs = null; var lastResult = null; // we reference arguments instead of spreading them for performance reasons return function () { if (!areArgumentsShallowlyEqual(equalityCheck, lastArgs, arguments)) { // apply arguments instead of spreading for performance. lastResult = func.apply(null, arguments); } lastArgs = arguments; return lastResult; }; } function getDependencies(funcs) { var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs; if (!dependencies.every(function (dep) { return typeof dep === 'function'; })) { var dependencyTypes = dependencies.map(function (dep) { return typeof dep; }).join(', '); throw new Error('Selector creators expect all input-selectors to be functions, ' + ('instead received the following types: [' + dependencyTypes + ']')); } return dependencies; } function createSelectorCreator(memoize) { for (var _len = arguments.length, memoizeOptions = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { memoizeOptions[_key - 1] = arguments[_key]; } return function () { for (var _len2 = arguments.length, funcs = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { funcs[_key2] = arguments[_key2]; } var recomputations = 0; var resultFunc = funcs.pop(); var dependencies = getDependencies(funcs); var memoizedResultFunc = memoize.apply(undefined, [function () { recomputations++; // apply arguments instead of spreading for performance. return resultFunc.apply(null, arguments); }].concat(memoizeOptions)); // If a selector is called with the exact same arguments we don't need to traverse our dependencies again. var selector = defaultMemoize(function () { var params = []; var length = dependencies.length; for (var i = 0; i < length; i++) { // apply arguments instead of spreading and mutate a local list of params for performance. params.push(dependencies[i].apply(null, arguments)); } // apply arguments instead of spreading for performance. return memoizedResultFunc.apply(null, params); }); selector.resultFunc = resultFunc; selector.recomputations = function () { return recomputations; }; selector.resetRecomputations = function () { return recomputations = 0; }; return selector; }; } var createSelector = exports.createSelector = createSelectorCreator(defaultMemoize); function createStructuredSelector(selectors) { var selectorCreator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : createSelector; if (typeof selectors !== 'object') { throw new Error('createStructuredSelector expects first argument to be an object ' + ('where each property is a selector, instead received a ' + typeof selectors)); } var objectKeys = Object.keys(selectors); return selectorCreator(objectKeys.map(function (key) { return selectors[key]; }), function () { for (var _len3 = arguments.length, values = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { values[_key3] = arguments[_key3]; } return values.reduce(function (composition, value, index) { composition[objectKeys[index]] = value; return composition; }, {}); }); } /***/ }), /* 994 */, /* 995 */, /* 996 */, /* 997 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 998 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 999 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1000 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1001 */ /***/ (function(module, exports) { module.exports = "icon" /***/ }), /* 1002 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1003 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1004 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1005 */, /* 1006 */, /* 1007 */, /* 1008 */, /* 1009 */, /* 1010 */, /* 1011 */, /* 1012 */, /* 1013 */, /* 1014 */, /* 1015 */, /* 1016 */, /* 1017 */, /* 1018 */, /* 1019 */, /* 1020 */, /* 1021 */, /* 1022 */, /* 1023 */, /* 1024 */, /* 1025 */, /* 1026 */, /* 1027 */, /* 1028 */, /* 1029 */, /* 1030 */, /* 1031 */, /* 1032 */, /* 1033 */, /* 1034 */, /* 1035 */, /* 1036 */, /* 1037 */, /* 1038 */, /* 1039 */, /* 1040 */, /* 1041 */, /* 1042 */, /* 1043 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1044 */ /***/ (function(module, exports) { module.exports = "Created with Sketch." /***/ }), /* 1045 */ /***/ (function(module, exports) { module.exports = "Created with Sketch." /***/ }), /* 1046 */, /* 1047 */, /* 1048 */, /* 1049 */, /* 1050 */, /* 1051 */, /* 1052 */, /* 1053 */, /* 1054 */, /* 1055 */, /* 1056 */, /* 1057 */, /* 1058 */, /* 1059 */, /* 1060 */, /* 1061 */, /* 1062 */, /* 1063 */, /* 1064 */, /* 1065 */, /* 1066 */, /* 1067 */, /* 1068 */, /* 1069 */, /* 1070 */, /* 1071 */, /* 1072 */, /* 1073 */, /* 1074 */, /* 1075 */, /* 1076 */, /* 1077 */, /* 1078 */, /* 1079 */, /* 1080 */, /* 1081 */, /* 1082 */, /* 1083 */, /* 1084 */, /* 1085 */, /* 1086 */, /* 1087 */, /* 1088 */, /* 1089 */, /* 1090 */, /* 1091 */, /* 1092 */, /* 1093 */, /* 1094 */, /* 1095 */, /* 1096 */, /* 1097 */, /* 1098 */, /* 1099 */, /* 1100 */, /* 1101 */, /* 1102 */, /* 1103 */, /* 1104 */, /* 1105 */, /* 1106 */, /* 1107 */, /* 1108 */, /* 1109 */, /* 1110 */, /* 1111 */, /* 1112 */, /* 1113 */, /* 1114 */, /* 1115 */, /* 1116 */, /* 1117 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1118 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1119 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1120 */, /* 1121 */, /* 1122 */, /* 1123 */, /* 1124 */, /* 1125 */, /* 1126 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1127 */, /* 1128 */, /* 1129 */, /* 1130 */, /* 1131 */, /* 1132 */, /* 1133 */, /* 1134 */, /* 1135 */, /* 1136 */, /* 1137 */, /* 1138 */, /* 1139 */, /* 1140 */, /* 1141 */, /* 1142 */, /* 1143 */, /* 1144 */, /* 1145 */, /* 1146 */, /* 1147 */, /* 1148 */, /* 1149 */, /* 1150 */, /* 1151 */, /* 1152 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1153 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1154 */, /* 1155 */, /* 1156 */, /* 1157 */, /* 1158 */, /* 1159 */, /* 1160 */, /* 1161 */, /* 1162 */, /* 1163 */, /* 1164 */, /* 1165 */, /* 1166 */, /* 1167 */, /* 1168 */, /* 1169 */, /* 1170 */, /* 1171 */, /* 1172 */, /* 1173 */, /* 1174 */ /***/ (function(module, exports) { module.exports = "image/svg+xml" /***/ }), /* 1175 */, /* 1176 */, /* 1177 */, /* 1178 */, /* 1179 */, /* 1180 */, /* 1181 */, /* 1182 */, /* 1183 */, /* 1184 */, /* 1185 */, /* 1186 */, /* 1187 */, /* 1188 */, /* 1189 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_Provider__ = __webpack_require__(1195); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_connectAdvanced__ = __webpack_require__(1192); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__connect_connect__ = __webpack_require__(1198); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Provider", function() { return __WEBPACK_IMPORTED_MODULE_0__components_Provider__["b"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "createProvider", function() { return __WEBPACK_IMPORTED_MODULE_0__components_Provider__["a"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "connectAdvanced", function() { return __WEBPACK_IMPORTED_MODULE_1__components_connectAdvanced__["a"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "connect", function() { return __WEBPACK_IMPORTED_MODULE_2__connect_connect__["a"]; }); /***/ }), /* 1190 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = warning; /** * Prints a warning in the console if it exists. * * @param {String} message The warning message. * @returns {void} */ function warning(message) { /* eslint-disable no-console */ if (typeof console !== 'undefined' && typeof console.error === 'function') { console.error(message); } /* eslint-enable no-console */ try { // This error was thrown as a convenience so that if you enable // "break on all exceptions" in your console, // it would pause the execution at this line. throw new Error(message); /* eslint-disable no-empty */ } catch (e) {} /* eslint-enable no-empty */ } /***/ }), /* 1191 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return subscriptionShape; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return storeShape; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types__ = __webpack_require__(20); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_prop_types__); var subscriptionShape = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape({ trySubscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, tryUnsubscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, notifyNestedSubs: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, isSubscribed: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired }); var storeShape = __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.shape({ subscribe: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, dispatch: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired, getState: __WEBPACK_IMPORTED_MODULE_0_prop_types___default.a.func.isRequired }); /***/ }), /* 1192 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = connectAdvanced; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics__ = __webpack_require__(1196); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant__ = __webpack_require__(159); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_invariant__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_Subscription__ = __webpack_require__(1197); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__ = __webpack_require__(1191); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; 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; } function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } var hotReloadingVersion = 0; var dummyState = {}; function noop() {} function makeSelectorStateful(sourceSelector, store) { // wrap the selector in an object that tracks its results between runs. var selector = { run: function runComponentSelector(props) { try { var nextProps = sourceSelector(store.getState(), props); if (nextProps !== selector.props || selector.error) { selector.shouldComponentUpdate = true; selector.props = nextProps; selector.error = null; } } catch (error) { selector.shouldComponentUpdate = true; selector.error = error; } } }; return selector; } function connectAdvanced( /* selectorFactory is a func that is responsible for returning the selector function used to compute new props from state, props, and dispatch. For example: export default connectAdvanced((dispatch, options) => (state, props) => ({ thing: state.things[props.thingId], saveThing: fields => dispatch(actionCreators.saveThing(props.thingId, fields)), }))(YourComponent) Access to dispatch is provided to the factory so selectorFactories can bind actionCreators outside of their selector as an optimization. Options passed to connectAdvanced are passed to the selectorFactory, along with displayName and WrappedComponent, as the second argument. Note that selectorFactory is responsible for all caching/memoization of inbound and outbound props. Do not use connectAdvanced directly without memoizing results between calls to your selector, otherwise the Connect component will re-render on every state or props change. */ selectorFactory) { var _contextTypes, _childContextTypes; var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref$getDisplayName = _ref.getDisplayName, getDisplayName = _ref$getDisplayName === undefined ? function (name) { return 'ConnectAdvanced(' + name + ')'; } : _ref$getDisplayName, _ref$methodName = _ref.methodName, methodName = _ref$methodName === undefined ? 'connectAdvanced' : _ref$methodName, _ref$renderCountProp = _ref.renderCountProp, renderCountProp = _ref$renderCountProp === undefined ? undefined : _ref$renderCountProp, _ref$shouldHandleStat = _ref.shouldHandleStateChanges, shouldHandleStateChanges = _ref$shouldHandleStat === undefined ? true : _ref$shouldHandleStat, _ref$storeKey = _ref.storeKey, storeKey = _ref$storeKey === undefined ? 'store' : _ref$storeKey, _ref$withRef = _ref.withRef, withRef = _ref$withRef === undefined ? false : _ref$withRef, connectOptions = _objectWithoutProperties(_ref, ['getDisplayName', 'methodName', 'renderCountProp', 'shouldHandleStateChanges', 'storeKey', 'withRef']); var subscriptionKey = storeKey + 'Subscription'; var version = hotReloadingVersion++; var contextTypes = (_contextTypes = {}, _contextTypes[storeKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["a" /* storeShape */], _contextTypes[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["b" /* subscriptionShape */], _contextTypes); var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_4__utils_PropTypes__["b" /* subscriptionShape */], _childContextTypes); return function wrapWithConnect(WrappedComponent) { __WEBPACK_IMPORTED_MODULE_1_invariant___default()(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + ('connect. Instead received ' + JSON.stringify(WrappedComponent))); var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component'; var displayName = getDisplayName(wrappedComponentName); var selectorFactoryOptions = _extends({}, connectOptions, { getDisplayName: getDisplayName, methodName: methodName, renderCountProp: renderCountProp, shouldHandleStateChanges: shouldHandleStateChanges, storeKey: storeKey, withRef: withRef, displayName: displayName, wrappedComponentName: wrappedComponentName, WrappedComponent: WrappedComponent }); var Connect = function (_Component) { _inherits(Connect, _Component); function Connect(props, context) { _classCallCheck(this, Connect); var _this = _possibleConstructorReturn(this, _Component.call(this, props, context)); _this.version = version; _this.state = {}; _this.renderCount = 0; _this.store = props[storeKey] || context[storeKey]; _this.propsMode = Boolean(props[storeKey]); _this.setWrappedInstance = _this.setWrappedInstance.bind(_this); __WEBPACK_IMPORTED_MODULE_1_invariant___default()(_this.store, 'Could not find "' + storeKey + '" in either the context or props of ' + ('"' + displayName + '". Either wrap the root component in a , ') + ('or explicitly pass "' + storeKey + '" as a prop to "' + displayName + '".')); _this.initSelector(); _this.initSubscription(); return _this; } Connect.prototype.getChildContext = function getChildContext() { var _ref2; // If this component received store from props, its subscription should be transparent // to any descendants receiving store+subscription from context; it passes along // subscription passed to it. Otherwise, it shadows the parent subscription, which allows // Connect to control ordering of notifications to flow top-down. var subscription = this.propsMode ? null : this.subscription; return _ref2 = {}, _ref2[subscriptionKey] = subscription || this.context[subscriptionKey], _ref2; }; Connect.prototype.componentDidMount = function componentDidMount() { if (!shouldHandleStateChanges) return; // componentWillMount fires during server side rendering, but componentDidMount and // componentWillUnmount do not. Because of this, trySubscribe happens during ...didMount. // Otherwise, unsubscription would never take place during SSR, causing a memory leak. // To handle the case where a child component may have triggered a state change by // dispatching an action in its componentWillMount, we have to re-run the select and maybe // re-render. this.subscription.trySubscribe(); this.selector.run(this.props); if (this.selector.shouldComponentUpdate) this.forceUpdate(); }; Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { this.selector.run(nextProps); }; Connect.prototype.shouldComponentUpdate = function shouldComponentUpdate() { return this.selector.shouldComponentUpdate; }; Connect.prototype.componentWillUnmount = function componentWillUnmount() { if (this.subscription) this.subscription.tryUnsubscribe(); this.subscription = null; this.notifyNestedSubs = noop; this.store = null; this.selector.run = noop; this.selector.shouldComponentUpdate = false; }; Connect.prototype.getWrappedInstance = function getWrappedInstance() { __WEBPACK_IMPORTED_MODULE_1_invariant___default()(withRef, 'To access the wrapped instance, you need to specify ' + ('{ withRef: true } in the options argument of the ' + methodName + '() call.')); return this.wrappedInstance; }; Connect.prototype.setWrappedInstance = function setWrappedInstance(ref) { this.wrappedInstance = ref; }; Connect.prototype.initSelector = function initSelector() { var sourceSelector = selectorFactory(this.store.dispatch, selectorFactoryOptions); this.selector = makeSelectorStateful(sourceSelector, this.store); this.selector.run(this.props); }; Connect.prototype.initSubscription = function initSubscription() { if (!shouldHandleStateChanges) return; // parentSub's source should match where store came from: props vs. context. A component // connected to the store via props shouldn't use subscription from context, or vice versa. var parentSub = (this.propsMode ? this.props : this.context)[subscriptionKey]; this.subscription = new __WEBPACK_IMPORTED_MODULE_3__utils_Subscription__["a" /* default */](this.store, parentSub, this.onStateChange.bind(this)); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in // the middle of the notification loop, where `this.subscription` will then be null. An // extra null check every change can be avoided by copying the method onto `this` and then // replacing it with a no-op on unmount. This can probably be avoided if Subscription's // listeners logic is changed to not call listeners that have been unsubscribed in the // middle of the notification loop. this.notifyNestedSubs = this.subscription.notifyNestedSubs.bind(this.subscription); }; Connect.prototype.onStateChange = function onStateChange() { this.selector.run(this.props); if (!this.selector.shouldComponentUpdate) { this.notifyNestedSubs(); } else { this.componentDidUpdate = this.notifyNestedSubsOnComponentDidUpdate; this.setState(dummyState); } }; Connect.prototype.notifyNestedSubsOnComponentDidUpdate = function notifyNestedSubsOnComponentDidUpdate() { // `componentDidUpdate` is conditionally implemented when `onStateChange` determines it // needs to notify nested subs. Once called, it unimplements itself until further state // changes occur. Doing it this way vs having a permanent `componentDidUpdate` that does // a boolean check every time avoids an extra method call most of the time, resulting // in some perf boost. this.componentDidUpdate = undefined; this.notifyNestedSubs(); }; Connect.prototype.isSubscribed = function isSubscribed() { return Boolean(this.subscription) && this.subscription.isSubscribed(); }; Connect.prototype.addExtraProps = function addExtraProps(props) { if (!withRef && !renderCountProp && !(this.propsMode && this.subscription)) return props; // make a shallow copy so that fields added don't leak to the original selector. // this is especially important for 'ref' since that's a reference back to the component // instance. a singleton memoized selector would then be holding a reference to the // instance, preventing the instance from being garbage collected, and that would be bad var withExtras = _extends({}, props); if (withRef) withExtras.ref = this.setWrappedInstance; if (renderCountProp) withExtras[renderCountProp] = this.renderCount++; if (this.propsMode && this.subscription) withExtras[subscriptionKey] = this.subscription; return withExtras; }; Connect.prototype.render = function render() { var selector = this.selector; selector.shouldComponentUpdate = false; if (selector.error) { throw selector.error; } else { return Object(__WEBPACK_IMPORTED_MODULE_2_react__["createElement"])(WrappedComponent, this.addExtraProps(selector.props)); } }; return Connect; }(__WEBPACK_IMPORTED_MODULE_2_react__["Component"]); Connect.WrappedComponent = WrappedComponent; Connect.displayName = displayName; Connect.childContextTypes = childContextTypes; Connect.contextTypes = contextTypes; Connect.propTypes = contextTypes; if (false) { Connect.prototype.componentWillUpdate = function componentWillUpdate() { var _this2 = this; // We are hot reloading! if (this.version !== version) { this.version = version; this.initSelector(); // If any connected descendants don't hot reload (and resubscribe in the process), their // listeners will be lost when we unsubscribe. Unfortunately, by copying over all // listeners, this does mean that the old versions of connected descendants will still be // notified of state changes; however, their onStateChange function is a no-op so this // isn't a huge deal. var oldListeners = []; if (this.subscription) { oldListeners = this.subscription.listeners.get(); this.subscription.tryUnsubscribe(); } this.initSubscription(); if (shouldHandleStateChanges) { this.subscription.trySubscribe(); oldListeners.forEach(function (listener) { return _this2.subscription.listeners.subscribe(listener); }); } } }; } return __WEBPACK_IMPORTED_MODULE_0_hoist_non_react_statics___default()(Connect, WrappedComponent); }; } /***/ }), /* 1193 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = wrapMapToPropsConstant; /* unused harmony export getDependsOnOwnProps */ /* harmony export (immutable) */ __webpack_exports__["b"] = wrapMapToPropsFunc; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__ = __webpack_require__(1194); function wrapMapToPropsConstant(getConstant) { return function initConstantSelector(dispatch, options) { var constant = getConstant(dispatch, options); function constantSelector() { return constant; } constantSelector.dependsOnOwnProps = false; return constantSelector; }; } // dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args // to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine // whether mapToProps needs to be invoked when props have changed. // // A length of one signals that mapToProps does not depend on props from the parent component. // A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and // therefore not reporting its length accurately.. function getDependsOnOwnProps(mapToProps) { return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1; } // Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction, // this function wraps mapToProps in a proxy function which does several things: // // * Detects whether the mapToProps function being called depends on props, which // is used by selectorFactory to decide if it should reinvoke on props changes. // // * On first call, handles mapToProps if returns another function, and treats that // new function as the true mapToProps for subsequent calls. // // * On first call, verifies the first result is a plain object, in order to warn // the developer that their mapToProps function is not returning a valid result. // function wrapMapToPropsFunc(mapToProps, methodName) { return function initProxySelector(dispatch, _ref) { var displayName = _ref.displayName; var proxy = function mapToPropsProxy(stateOrDispatch, ownProps) { return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch); }; // allow detectFactoryAndVerify to get ownProps proxy.dependsOnOwnProps = true; proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) { proxy.mapToProps = mapToProps; proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps); var props = proxy(stateOrDispatch, ownProps); if (typeof props === 'function') { proxy.mapToProps = props; proxy.dependsOnOwnProps = getDependsOnOwnProps(props); props = proxy(stateOrDispatch, ownProps); } if (false) verifyPlainObject(props, displayName, methodName); return props; }; return proxy; }; } /***/ }), /* 1194 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export default */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__ = __webpack_require__(33); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__warning__ = __webpack_require__(1190); function verifyPlainObject(value, displayName, methodName) { if (!Object(__WEBPACK_IMPORTED_MODULE_0_lodash_es_isPlainObject__["a" /* default */])(value)) { Object(__WEBPACK_IMPORTED_MODULE_1__warning__["a" /* default */])(methodName + '() in ' + displayName + ' must return a plain object. Instead received ' + value + '.'); } } /***/ }), /* 1195 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = createProvider; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(0); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types__ = __webpack_require__(20); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_prop_types__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__ = __webpack_require__(1191); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_warning__ = __webpack_require__(1190); 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 didWarnAboutReceivingStore = false; function warnAboutReceivingStore() { if (didWarnAboutReceivingStore) { return; } didWarnAboutReceivingStore = true; Object(__WEBPACK_IMPORTED_MODULE_3__utils_warning__["a" /* default */])(' does not support changing `store` on the fly. ' + 'It is most likely that you see this error because you updated to ' + 'Redux 2.x and React Redux 2.x which no longer hot reload reducers ' + 'automatically. See https://github.com/reactjs/react-redux/releases/' + 'tag/v2.0.0 for the migration instructions.'); } function createProvider() { var _Provider$childContex; var storeKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'store'; var subKey = arguments[1]; var subscriptionKey = subKey || storeKey + 'Subscription'; var Provider = function (_Component) { _inherits(Provider, _Component); Provider.prototype.getChildContext = function getChildContext() { var _ref; return _ref = {}, _ref[storeKey] = this[storeKey], _ref[subscriptionKey] = null, _ref; }; function Provider(props, context) { _classCallCheck(this, Provider); var _this = _possibleConstructorReturn(this, _Component.call(this, props, context)); _this[storeKey] = props.store; return _this; } Provider.prototype.render = function render() { return __WEBPACK_IMPORTED_MODULE_0_react__["Children"].only(this.props.children); }; return Provider; }(__WEBPACK_IMPORTED_MODULE_0_react__["Component"]); if (false) { Provider.prototype.componentWillReceiveProps = function (nextProps) { if (this[storeKey] !== nextProps.store) { warnAboutReceivingStore(); } }; } Provider.propTypes = { store: __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["a" /* storeShape */].isRequired, children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.element.isRequired }; Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[storeKey] = __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["a" /* storeShape */].isRequired, _Provider$childContex[subscriptionKey] = __WEBPACK_IMPORTED_MODULE_2__utils_PropTypes__["b" /* subscriptionShape */], _Provider$childContex); return Provider; } /* harmony default export */ __webpack_exports__["b"] = (createProvider()); /***/ }), /* 1196 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright 2015, Yahoo! Inc. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */ var REACT_STATICS = { childContextTypes: true, contextTypes: true, defaultProps: true, displayName: true, getDefaultProps: true, mixins: true, propTypes: true, type: true }; var KNOWN_STATICS = { name: true, length: true, prototype: true, caller: true, callee: true, arguments: true, arity: true }; var defineProperty = Object.defineProperty; var getOwnPropertyNames = Object.getOwnPropertyNames; var getOwnPropertySymbols = Object.getOwnPropertySymbols; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var getPrototypeOf = Object.getPrototypeOf; var objectPrototype = getPrototypeOf && getPrototypeOf(Object); module.exports = function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components if (objectPrototype) { var inheritedComponent = getPrototypeOf(sourceComponent); if (inheritedComponent && inheritedComponent !== objectPrototype) { hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); } } var keys = getOwnPropertyNames(sourceComponent); if (getOwnPropertySymbols) { keys = keys.concat(getOwnPropertySymbols(sourceComponent)); } for (var i = 0; i < keys.length; ++i) { var key = keys[i]; if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) { var descriptor = getOwnPropertyDescriptor(sourceComponent, key); try { // Avoid failures from read-only properties defineProperty(targetComponent, key, descriptor); } catch (e) {} } } return targetComponent; } return targetComponent; }; /***/ }), /* 1197 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscription; }); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } // encapsulates the subscription logic for connecting a component to the redux store, as // well as nesting subscriptions of descendant components, so that we can ensure the // ancestor components re-render before descendants var CLEARED = null; var nullListeners = { notify: function notify() {} }; function createListenerCollection() { // the current/next pattern is copied from redux's createStore code. // TODO: refactor+expose that code to be reusable here? var current = []; var next = []; return { clear: function clear() { next = CLEARED; current = CLEARED; }, notify: function notify() { var listeners = current = next; for (var i = 0; i < listeners.length; i++) { listeners[i](); } }, get: function get() { return next; }, subscribe: function subscribe(listener) { var isSubscribed = true; if (next === current) next = current.slice(); next.push(listener); return function unsubscribe() { if (!isSubscribed || current === CLEARED) return; isSubscribed = false; if (next === current) next = current.slice(); next.splice(next.indexOf(listener), 1); }; } }; } var Subscription = function () { function Subscription(store, parentSub, onStateChange) { _classCallCheck(this, Subscription); this.store = store; this.parentSub = parentSub; this.onStateChange = onStateChange; this.unsubscribe = null; this.listeners = nullListeners; } Subscription.prototype.addNestedSub = function addNestedSub(listener) { this.trySubscribe(); return this.listeners.subscribe(listener); }; Subscription.prototype.notifyNestedSubs = function notifyNestedSubs() { this.listeners.notify(); }; Subscription.prototype.isSubscribed = function isSubscribed() { return Boolean(this.unsubscribe); }; Subscription.prototype.trySubscribe = function trySubscribe() { if (!this.unsubscribe) { this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange); this.listeners = createListenerCollection(); } }; Subscription.prototype.tryUnsubscribe = function tryUnsubscribe() { if (this.unsubscribe) { this.unsubscribe(); this.unsubscribe = null; this.listeners.clear(); this.listeners = nullListeners; } }; return Subscription; }(); /***/ }), /* 1198 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export createConnect */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__ = __webpack_require__(1192); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__ = __webpack_require__(1199); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__ = __webpack_require__(1200); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__ = __webpack_require__(1201); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mergeProps__ = __webpack_require__(1202); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__selectorFactory__ = __webpack_require__(1203); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } /* connect is a facade over connectAdvanced. It turns its args into a compatible selectorFactory, which has the signature: (dispatch, options) => (nextState, nextOwnProps) => nextFinalProps connect passes its args to connectAdvanced as options, which will in turn pass them to selectorFactory each time a Connect component instance is instantiated or hot reloaded. selectorFactory returns a final props selector from its mapStateToProps, mapStateToPropsFactories, mapDispatchToProps, mapDispatchToPropsFactories, mergeProps, mergePropsFactories, and pure args. The resulting final props selector is called by the Connect component instance whenever it receives new props or store state. */ function match(arg, factories, name) { for (var i = factories.length - 1; i >= 0; i--) { var result = factories[i](arg); if (result) return result; } return function (dispatch, options) { throw new Error('Invalid value of type ' + typeof arg + ' for ' + name + ' argument when connecting component ' + options.wrappedComponentName + '.'); }; } function strictEqual(a, b) { return a === b; } // createConnect with default args builds the 'official' connect behavior. Calling it with // different options opens up some testing and extensibility scenarios function createConnect() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, _ref$connectHOC = _ref.connectHOC, connectHOC = _ref$connectHOC === undefined ? __WEBPACK_IMPORTED_MODULE_0__components_connectAdvanced__["a" /* default */] : _ref$connectHOC, _ref$mapStateToPropsF = _ref.mapStateToPropsFactories, mapStateToPropsFactories = _ref$mapStateToPropsF === undefined ? __WEBPACK_IMPORTED_MODULE_3__mapStateToProps__["a" /* default */] : _ref$mapStateToPropsF, _ref$mapDispatchToPro = _ref.mapDispatchToPropsFactories, mapDispatchToPropsFactories = _ref$mapDispatchToPro === undefined ? __WEBPACK_IMPORTED_MODULE_2__mapDispatchToProps__["a" /* default */] : _ref$mapDispatchToPro, _ref$mergePropsFactor = _ref.mergePropsFactories, mergePropsFactories = _ref$mergePropsFactor === undefined ? __WEBPACK_IMPORTED_MODULE_4__mergeProps__["a" /* default */] : _ref$mergePropsFactor, _ref$selectorFactory = _ref.selectorFactory, selectorFactory = _ref$selectorFactory === undefined ? __WEBPACK_IMPORTED_MODULE_5__selectorFactory__["a" /* default */] : _ref$selectorFactory; return function connect(mapStateToProps, mapDispatchToProps, mergeProps) { var _ref2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}, _ref2$pure = _ref2.pure, pure = _ref2$pure === undefined ? true : _ref2$pure, _ref2$areStatesEqual = _ref2.areStatesEqual, areStatesEqual = _ref2$areStatesEqual === undefined ? strictEqual : _ref2$areStatesEqual, _ref2$areOwnPropsEqua = _ref2.areOwnPropsEqual, areOwnPropsEqual = _ref2$areOwnPropsEqua === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* default */] : _ref2$areOwnPropsEqua, _ref2$areStatePropsEq = _ref2.areStatePropsEqual, areStatePropsEqual = _ref2$areStatePropsEq === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* default */] : _ref2$areStatePropsEq, _ref2$areMergedPropsE = _ref2.areMergedPropsEqual, areMergedPropsEqual = _ref2$areMergedPropsE === undefined ? __WEBPACK_IMPORTED_MODULE_1__utils_shallowEqual__["a" /* default */] : _ref2$areMergedPropsE, extraOptions = _objectWithoutProperties(_ref2, ['pure', 'areStatesEqual', 'areOwnPropsEqual', 'areStatePropsEqual', 'areMergedPropsEqual']); var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps'); var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps'); var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps'); return connectHOC(selectorFactory, _extends({ // used in error messages methodName: 'connect', // used to compute Connect's displayName from the wrapped component's displayName. getDisplayName: function getDisplayName(name) { return 'Connect(' + name + ')'; }, // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes shouldHandleStateChanges: Boolean(mapStateToProps), // passed through to selectorFactory initMapStateToProps: initMapStateToProps, initMapDispatchToProps: initMapDispatchToProps, initMergeProps: initMergeProps, pure: pure, areStatesEqual: areStatesEqual, areOwnPropsEqual: areOwnPropsEqual, areStatePropsEqual: areStatePropsEqual, areMergedPropsEqual: areMergedPropsEqual }, extraOptions)); }; } /* harmony default export */ __webpack_exports__["a"] = (createConnect()); /***/ }), /* 1199 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = shallowEqual; var hasOwn = Object.prototype.hasOwnProperty; function is(x, y) { if (x === y) { return x !== 0 || y !== 0 || 1 / x === 1 / y; } else { return x !== x && y !== y; } } function shallowEqual(objA, objB) { if (is(objA, objB)) return true; if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { return false; } var keysA = Object.keys(objA); var keysB = Object.keys(objB); if (keysA.length !== keysB.length) return false; for (var i = 0; i < keysA.length; i++) { if (!hasOwn.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { return false; } } return true; } /***/ }), /* 1200 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export whenMapDispatchToPropsIsFunction */ /* unused harmony export whenMapDispatchToPropsIsMissing */ /* unused harmony export whenMapDispatchToPropsIsObject */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_redux__ = __webpack_require__(3); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__ = __webpack_require__(1193); function whenMapDispatchToPropsIsFunction(mapDispatchToProps) { return typeof mapDispatchToProps === 'function' ? Object(__WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["b" /* wrapMapToPropsFunc */])(mapDispatchToProps, 'mapDispatchToProps') : undefined; } function whenMapDispatchToPropsIsMissing(mapDispatchToProps) { return !mapDispatchToProps ? Object(__WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["a" /* wrapMapToPropsConstant */])(function (dispatch) { return { dispatch: dispatch }; }) : undefined; } function whenMapDispatchToPropsIsObject(mapDispatchToProps) { return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? Object(__WEBPACK_IMPORTED_MODULE_1__wrapMapToProps__["a" /* wrapMapToPropsConstant */])(function (dispatch) { return Object(__WEBPACK_IMPORTED_MODULE_0_redux__["bindActionCreators"])(mapDispatchToProps, dispatch); }) : undefined; } /* harmony default export */ __webpack_exports__["a"] = ([whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject]); /***/ }), /* 1201 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export whenMapStateToPropsIsFunction */ /* unused harmony export whenMapStateToPropsIsMissing */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__ = __webpack_require__(1193); function whenMapStateToPropsIsFunction(mapStateToProps) { return typeof mapStateToProps === 'function' ? Object(__WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__["b" /* wrapMapToPropsFunc */])(mapStateToProps, 'mapStateToProps') : undefined; } function whenMapStateToPropsIsMissing(mapStateToProps) { return !mapStateToProps ? Object(__WEBPACK_IMPORTED_MODULE_0__wrapMapToProps__["a" /* wrapMapToPropsConstant */])(function () { return {}; }) : undefined; } /* harmony default export */ __webpack_exports__["a"] = ([whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing]); /***/ }), /* 1202 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export defaultMergeProps */ /* unused harmony export wrapMergePropsFunc */ /* unused harmony export whenMergePropsIsFunction */ /* unused harmony export whenMergePropsIsOmitted */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_verifyPlainObject__ = __webpack_require__(1194); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function defaultMergeProps(stateProps, dispatchProps, ownProps) { return _extends({}, ownProps, stateProps, dispatchProps); } function wrapMergePropsFunc(mergeProps) { return function initMergePropsProxy(dispatch, _ref) { var displayName = _ref.displayName, pure = _ref.pure, areMergedPropsEqual = _ref.areMergedPropsEqual; var hasRunOnce = false; var mergedProps = void 0; return function mergePropsProxy(stateProps, dispatchProps, ownProps) { var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps); if (hasRunOnce) { if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) mergedProps = nextMergedProps; } else { hasRunOnce = true; mergedProps = nextMergedProps; if (false) verifyPlainObject(mergedProps, displayName, 'mergeProps'); } return mergedProps; }; }; } function whenMergePropsIsFunction(mergeProps) { return typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined; } function whenMergePropsIsOmitted(mergeProps) { return !mergeProps ? function () { return defaultMergeProps; } : undefined; } /* harmony default export */ __webpack_exports__["a"] = ([whenMergePropsIsFunction, whenMergePropsIsOmitted]); /***/ }), /* 1203 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export impureFinalPropsSelectorFactory */ /* unused harmony export pureFinalPropsSelectorFactory */ /* harmony export (immutable) */ __webpack_exports__["a"] = finalPropsSelectorFactory; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__verifySubselectors__ = __webpack_require__(1204); function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function impureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch) { return function impureFinalPropsSelector(state, ownProps) { return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps); }; } function pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, _ref) { var areStatesEqual = _ref.areStatesEqual, areOwnPropsEqual = _ref.areOwnPropsEqual, areStatePropsEqual = _ref.areStatePropsEqual; var hasRunAtLeastOnce = false; var state = void 0; var ownProps = void 0; var stateProps = void 0; var dispatchProps = void 0; var mergedProps = void 0; function handleFirstCall(firstState, firstOwnProps) { state = firstState; ownProps = firstOwnProps; stateProps = mapStateToProps(state, ownProps); dispatchProps = mapDispatchToProps(dispatch, ownProps); mergedProps = mergeProps(stateProps, dispatchProps, ownProps); hasRunAtLeastOnce = true; return mergedProps; } function handleNewPropsAndNewState() { stateProps = mapStateToProps(state, ownProps); if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps); mergedProps = mergeProps(stateProps, dispatchProps, ownProps); return mergedProps; } function handleNewProps() { if (mapStateToProps.dependsOnOwnProps) stateProps = mapStateToProps(state, ownProps); if (mapDispatchToProps.dependsOnOwnProps) dispatchProps = mapDispatchToProps(dispatch, ownProps); mergedProps = mergeProps(stateProps, dispatchProps, ownProps); return mergedProps; } function handleNewState() { var nextStateProps = mapStateToProps(state, ownProps); var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps); stateProps = nextStateProps; if (statePropsChanged) mergedProps = mergeProps(stateProps, dispatchProps, ownProps); return mergedProps; } function handleSubsequentCalls(nextState, nextOwnProps) { var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps); var stateChanged = !areStatesEqual(nextState, state); state = nextState; ownProps = nextOwnProps; if (propsChanged && stateChanged) return handleNewPropsAndNewState(); if (propsChanged) return handleNewProps(); if (stateChanged) return handleNewState(); return mergedProps; } return function pureFinalPropsSelector(nextState, nextOwnProps) { return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps); }; } // TODO: Add more comments // If pure is true, the selector returned by selectorFactory will memoize its results, // allowing connectAdvanced's shouldComponentUpdate to return false if final // props have not changed. If false, the selector will always return a new // object and shouldComponentUpdate will always return true. function finalPropsSelectorFactory(dispatch, _ref2) { var initMapStateToProps = _ref2.initMapStateToProps, initMapDispatchToProps = _ref2.initMapDispatchToProps, initMergeProps = _ref2.initMergeProps, options = _objectWithoutProperties(_ref2, ['initMapStateToProps', 'initMapDispatchToProps', 'initMergeProps']); var mapStateToProps = initMapStateToProps(dispatch, options); var mapDispatchToProps = initMapDispatchToProps(dispatch, options); var mergeProps = initMergeProps(dispatch, options); if (false) { verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName); } var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory; return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options); } /***/ }), /* 1204 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export default */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_warning__ = __webpack_require__(1190); function verify(selector, methodName, displayName) { if (!selector) { throw new Error('Unexpected value for ' + methodName + ' in ' + displayName + '.'); } else if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') { if (!selector.hasOwnProperty('dependsOnOwnProps')) { Object(__WEBPACK_IMPORTED_MODULE_0__utils_warning__["a" /* default */])('The selector for ' + methodName + ' of ' + displayName + ' did not specify a value for dependsOnOwnProps.'); } } } function verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, displayName) { verify(mapStateToProps, 'mapStateToProps', displayName); verify(mapDispatchToProps, 'mapDispatchToProps', displayName); verify(mergeProps, 'mergeProps', displayName); } /***/ }), /* 1205 */, /* 1206 */, /* 1207 */, /* 1208 */, /* 1209 */, /* 1210 */, /* 1211 */, /* 1212 */, /* 1213 */, /* 1214 */, /* 1215 */, /* 1216 */, /* 1217 */, /* 1218 */, /* 1219 */, /* 1220 */, /* 1221 */, /* 1222 */, /* 1223 */, /* 1224 */, /* 1225 */, /* 1226 */, /* 1227 */, /* 1228 */, /* 1229 */, /* 1230 */, /* 1231 */, /* 1232 */, /* 1233 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1234 */, /* 1235 */, /* 1236 */, /* 1237 */, /* 1238 */, /* 1239 */, /* 1240 */, /* 1241 */, /* 1242 */, /* 1243 */, /* 1244 */, /* 1245 */, /* 1246 */, /* 1247 */, /* 1248 */, /* 1249 */, /* 1250 */, /* 1251 */, /* 1252 */, /* 1253 */, /* 1254 */, /* 1255 */, /* 1256 */, /* 1257 */, /* 1258 */, /* 1259 */, /* 1260 */, /* 1261 */, /* 1262 */, /* 1263 */, /* 1264 */, /* 1265 */, /* 1266 */, /* 1267 */, /* 1268 */, /* 1269 */, /* 1270 */, /* 1271 */, /* 1272 */, /* 1273 */, /* 1274 */, /* 1275 */, /* 1276 */, /* 1277 */, /* 1278 */, /* 1279 */, /* 1280 */, /* 1281 */, /* 1282 */, /* 1283 */, /* 1284 */, /* 1285 */, /* 1286 */, /* 1287 */, /* 1288 */, /* 1289 */, /* 1290 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1291 */, /* 1292 */, /* 1293 */, /* 1294 */, /* 1295 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1296 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1297 */, /* 1298 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1299 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1300 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1301 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1302 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1303 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1304 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1305 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1306 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1307 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1308 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1309 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1310 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1311 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1312 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1313 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1314 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1315 */, /* 1316 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1317 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1318 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1319 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1320 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1321 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1322 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1323 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1324 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1325 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1326 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1327 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1328 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1329 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1330 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1331 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1332 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1333 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1334 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1335 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1336 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1337 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1338 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1339 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1340 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1341 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1342 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1343 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1344 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1345 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1346 */, /* 1347 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1348 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1349 */, /* 1350 */, /* 1351 */, /* 1352 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ var _expressions = __webpack_require__(1417); var expressions = _interopRequireWildcard(_expressions); var _sources = __webpack_require__(1369); var sources = _interopRequireWildcard(_sources); var _pause = __webpack_require__(1394); var pause = _interopRequireWildcard(_pause); var _debuggee = __webpack_require__(1418); var debuggee = _interopRequireWildcard(_debuggee); var _breakpoints = __webpack_require__(1378); var breakpoints = _interopRequireWildcard(_breakpoints); var _pendingBreakpoints = __webpack_require__(1419); var pendingBreakpoints = _interopRequireWildcard(_pendingBreakpoints); var _eventListeners = __webpack_require__(1420); var eventListeners = _interopRequireWildcard(_eventListeners); var _ui = __webpack_require__(1421); var ui = _interopRequireWildcard(_ui); var _fileSearch = __webpack_require__(1422); var fileSearch = _interopRequireWildcard(_fileSearch); var _ast = __webpack_require__(1383); var ast = _interopRequireWildcard(_ast); var _coverage = __webpack_require__(1423); var coverage = _interopRequireWildcard(_coverage); var _projectTextSearch = __webpack_require__(1424); var projectTextSearch = _interopRequireWildcard(_projectTextSearch); var _quickOpen = __webpack_require__(1635); var quickOpen = _interopRequireWildcard(_quickOpen); var _sourceTree = __webpack_require__(1426); var sourceTree = _interopRequireWildcard(_sourceTree); var _breakpointAtLocation = __webpack_require__(1503); var _breakpointAtLocation2 = _interopRequireDefault(_breakpointAtLocation); var _visibleBreakpoints = __webpack_require__(1427); var _visibleBreakpoints2 = _interopRequireDefault(_visibleBreakpoints); var _isSelectedFrameVisible = __webpack_require__(1505); var _isSelectedFrameVisible2 = _interopRequireDefault(_isSelectedFrameVisible); var _getCallStackFrames = __webpack_require__(1779); var _getCallStackFrames2 = _interopRequireDefault(_getCallStackFrames); var _visibleSelectedFrame = __webpack_require__(1780); var _visibleSelectedFrame2 = _interopRequireDefault(_visibleSelectedFrame); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } /** * @param object - location */ module.exports = _extends({}, expressions, sources, pause, debuggee, breakpoints, pendingBreakpoints, eventListeners, ui, ast, coverage, fileSearch, projectTextSearch, quickOpen, sourceTree, { getBreakpointAtLocation: _breakpointAtLocation2.default, getVisibleBreakpoints: _visibleBreakpoints2.default, isSelectedFrameVisible: _isSelectedFrameVisible2.default, getCallStackFrames: _getCallStackFrames2.default, getVisibleSelectedFrame: _visibleSelectedFrame2.default }); /***/ }), /* 1353 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // Dependencies const React = __webpack_require__(0); const validProtocols = /^(http|https|ftp|data|javascript|resource|chrome):/i; const tokenSplitRegex = /(\s|\'|\"|\\)+/; /** * Returns true if the given object is a grip (see RDP protocol) */ function isGrip(object) { return object && object.actor; } function escapeNewLines(value) { return value.replace(/\r/gm, "\\r").replace(/\n/gm, "\\n"); } // Map from character code to the corresponding escape sequence. \0 // isn't here because it would require special treatment in some // situations. \b, \f, and \v aren't here because they aren't very // common. \' isn't here because there's no need, we only // double-quote strings. const escapeMap = { // Tab. 9: "\\t", // Newline. 0xa: "\\n", // Carriage return. 0xd: "\\r", // Quote. 0x22: "\\\"", // Backslash. 0x5c: "\\\\" }; // Regexp that matches any character we might possibly want to escape. // Note that we over-match here, because it's difficult to, say, match // an unpaired surrogate with a regexp. The details are worked out by // the replacement function; see |escapeString|. const escapeRegexp = new RegExp("[" + // Quote and backslash. "\"\\\\" + // Controls. "\x00-\x1f" + // More controls. "\x7f-\x9f" + // BOM "\ufeff" + // Replacement characters and non-characters. "\ufffc-\uffff" + // Surrogates. "\ud800-\udfff" + // Mathematical invisibles. "\u2061-\u2064" + // Line and paragraph separators. "\u2028-\u2029" + // Private use area. "\ue000-\uf8ff" + "]", "g"); /** * Escape a string so that the result is viewable and valid JS. * Control characters, other invisibles, invalid characters, * backslash, and double quotes are escaped. The resulting string is * surrounded by double quotes. * * @param {String} str * the input * @param {Boolean} escapeWhitespace * if true, TAB, CR, and NL characters will be escaped * @return {String} the escaped string */ function escapeString(str, escapeWhitespace) { return "\"" + str.replace(escapeRegexp, (match, offset) => { let c = match.charCodeAt(0); if (c in escapeMap) { if (!escapeWhitespace && (c === 9 || c === 0xa || c === 0xd)) { return match[0]; } return escapeMap[c]; } if (c >= 0xd800 && c <= 0xdfff) { // Find the full code point containing the surrogate, with a // special case for a trailing surrogate at the start of the // string. if (c >= 0xdc00 && offset > 0) { --offset; } let codePoint = str.codePointAt(offset); if (codePoint >= 0xd800 && codePoint <= 0xdfff) { // Unpaired surrogate. return "\\u" + codePoint.toString(16); } else if (codePoint >= 0xf0000 && codePoint <= 0x10fffd) { // Private use area. Because we visit each pair of a such a // character, return the empty string for one half and the // real result for the other, to avoid duplication. if (c <= 0xdbff) { return "\\u{" + codePoint.toString(16) + "}"; } return ""; } // Other surrogate characters are passed through. return match; } return "\\u" + ("0000" + c.toString(16)).substr(-4); }) + "\""; } /** * Escape a property name, if needed. "Escaping" in this context * means surrounding the property name with quotes. * * @param {String} * name the property name * @return {String} either the input, or the input surrounded by * quotes, properly quoted in JS syntax. */ function maybeEscapePropertyName(name) { // Quote the property name if it needs quoting. This particular // test is an approximation; see // https://mathiasbynens.be/notes/javascript-properties. However, // the full solution requires a fair amount of Unicode data, and so // let's defer that until either it's important, or the \p regexp // syntax lands, see // https://github.com/tc39/proposal-regexp-unicode-property-escapes. if (!/^\w+$/.test(name)) { name = escapeString(name); } return name; } function cropMultipleLines(text, limit) { return escapeNewLines(cropString(text, limit)); } function rawCropString(text, limit, alternativeText) { if (!alternativeText) { alternativeText = "\u2026"; } // Crop the string only if a limit is actually specified. if (!limit || limit <= 0) { return text; } // Set the limit at least to the length of the alternative text // plus one character of the original text. if (limit <= alternativeText.length) { limit = alternativeText.length + 1; } let halfLimit = (limit - alternativeText.length) / 2; if (text.length > limit) { return text.substr(0, Math.ceil(halfLimit)) + alternativeText + text.substr(text.length - Math.floor(halfLimit)); } return text; } function cropString(text, limit, alternativeText) { return rawCropString(sanitizeString(text + ""), limit, alternativeText); } function sanitizeString(text) { // Replace all non-printable characters, except of // (horizontal) tab (HT: \x09) and newline (LF: \x0A, CR: \x0D), // with unicode replacement character (u+fffd). // eslint-disable-next-line no-control-regex let re = new RegExp("[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F]", "g"); return text.replace(re, "\ufffd"); } function parseURLParams(url) { url = new URL(url); return parseURLEncodedText(url.searchParams); } function parseURLEncodedText(text) { let params = []; // In case the text is empty just return the empty parameters if (text == "") { return params; } let searchParams = new URLSearchParams(text); let entries = [...searchParams.entries()]; return entries.map(entry => { return { name: entry[0], value: entry[1] }; }); } function getFileName(url) { let split = splitURLBase(url); return split.name; } function splitURLBase(url) { if (!isDataURL(url)) { return splitURLTrue(url); } return {}; } function getURLDisplayString(url) { return cropString(url); } function isDataURL(url) { return url && url.substr(0, 5) == "data:"; } function splitURLTrue(url) { const reSplitFile = /(.*?):\/{2,3}([^\/]*)(.*?)([^\/]*?)($|\?.*)/; let m = reSplitFile.exec(url); if (!m) { return { name: url, path: url }; } else if (m[4] == "" && m[5] == "") { return { protocol: m[1], domain: m[2], path: m[3], name: m[3] != "/" ? m[3] : m[2] }; } return { protocol: m[1], domain: m[2], path: m[2] + m[3], name: m[4] + m[5] }; } /** * Wrap the provided render() method of a rep in a try/catch block that will render a * fallback rep if the render fails. */ function wrapRender(renderMethod) { const wrappedFunction = function (props) { try { return renderMethod.call(this, props); } catch (e) { console.error(e); return React.DOM.span({ className: "objectBox objectBox-failure", title: "This object could not be rendered, " + "please file a bug on bugzilla.mozilla.org" }, /* Labels have to be hardcoded for reps, see Bug 1317038. */ "Invalid object"); } }; wrappedFunction.propTypes = renderMethod.propTypes; return wrappedFunction; } /** * Get preview items from a Grip. * * @param {Object} Grip from which we want the preview items * @return {Array} Array of the preview items of the grip, or an empty array * if the grip does not have preview items */ function getGripPreviewItems(grip) { if (!grip) { return []; } // Promise resolved value Grip if (grip.promiseState && grip.promiseState.value) { return [grip.promiseState.value]; } // Array Grip if (grip.preview && grip.preview.items) { return grip.preview.items; } // Node Grip if (grip.preview && grip.preview.childNodes) { return grip.preview.childNodes; } // Set or Map Grip if (grip.preview && grip.preview.entries) { return grip.preview.entries.reduce((res, entry) => res.concat(entry), []); } // Event Grip if (grip.preview && grip.preview.target) { let keys = Object.keys(grip.preview.properties); let values = Object.values(grip.preview.properties); return [grip.preview.target, ...keys, ...values]; } // RegEx Grip if (grip.displayString) { return [grip.displayString]; } // Generic Grip if (grip.preview && grip.preview.ownProperties) { let propertiesValues = Object.values(grip.preview.ownProperties).map(property => property.value || property); let propertyKeys = Object.keys(grip.preview.ownProperties); propertiesValues = propertiesValues.concat(propertyKeys); // ArrayBuffer Grip if (grip.preview.safeGetterValues) { propertiesValues = propertiesValues.concat(Object.values(grip.preview.safeGetterValues).map(property => property.getterValue || property)); } return propertiesValues; } return []; } /** * Get the type of an object. * * @param {Object} Grip from which we want the type. * @param {boolean} noGrip true if the object is not a grip. * @return {boolean} */ function getGripType(object, noGrip) { let type = typeof object; if (type == "object" && object instanceof String) { type = "string"; } else if (object && type == "object" && object.type && noGrip !== true) { type = object.type; } if (isGrip(object)) { type = object.class; } return type; } /** * Determines whether a grip is a string containing a URL. * * @param string grip * The grip, which may contain a URL. * @return boolean * Whether the grip is a string containing a URL. */ function containsURL(grip) { if (typeof grip !== "string") { return false; } let tokens = grip.split(tokenSplitRegex); return tokens.some(isURL); } /** * Determines whether a string token is a valid URL. * * @param string token * The token. * @return boolean * Whenther the token is a URL. */ function isURL(token) { try { if (!validProtocols.test(token)) { return false; } new URL(token); return true; } catch (e) { return false; } } module.exports = { isGrip, isURL, cropString, containsURL, rawCropString, sanitizeString, escapeString, wrapRender, cropMultipleLines, parseURLParams, parseURLEncodedText, getFileName, getURLDisplayString, maybeEscapePropertyName, getGripPreviewItems, getGripType, tokenSplitRegex }; /***/ }), /* 1354 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ var _breakpoints = __webpack_require__(1396); var breakpoints = _interopRequireWildcard(_breakpoints); var _expressions = __webpack_require__(1398); var expressions = _interopRequireWildcard(_expressions); var _eventListeners = __webpack_require__(1527); var eventListeners = _interopRequireWildcard(_eventListeners); var _sources = __webpack_require__(1373); var sources = _interopRequireWildcard(_sources); var _pause = __webpack_require__(1639); var pause = _interopRequireWildcard(_pause); var _navigation = __webpack_require__(1529); var navigation = _interopRequireWildcard(_navigation); var _ui = __webpack_require__(1385); var ui = _interopRequireWildcard(_ui); var _fileSearch = __webpack_require__(1530); var fileSearch = _interopRequireWildcard(_fileSearch); var _ast = __webpack_require__(1399); var ast = _interopRequireWildcard(_ast); var _coverage = __webpack_require__(1531); var coverage = _interopRequireWildcard(_coverage); var _projectTextSearch = __webpack_require__(1433); var projectTextSearch = _interopRequireWildcard(_projectTextSearch); var _quickOpen = __webpack_require__(1647); var quickOpen = _interopRequireWildcard(_quickOpen); var _sourceTree = __webpack_require__(1532); var sourceTree = _interopRequireWildcard(_sourceTree); var _loadSourceText = __webpack_require__(1435); var loadSourceText = _interopRequireWildcard(_loadSourceText); var _debuggee = __webpack_require__(1533); var debuggee = _interopRequireWildcard(_debuggee); var _toolbox = __webpack_require__(1534); var toolbox = _interopRequireWildcard(_toolbox); var _preview = __webpack_require__(1786); var preview = _interopRequireWildcard(_preview); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } exports.default = _extends({}, navigation, breakpoints, expressions, eventListeners, sources, pause, ui, fileSearch, ast, coverage, projectTextSearch, quickOpen, sourceTree, loadSourceText, debuggee, toolbox, preview); /***/ }), /* 1355 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const feature = __webpack_require__(1461); module.exports = feature; /***/ }), /* 1356 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isLoading = exports.isLoaded = exports.getMode = exports.getSourceLineCount = exports.getSourcePath = exports.getFileURL = exports.getFilenameFromURL = exports.getFilename = exports.getRawSourceURL = exports.getPrettySourceURL = exports.shouldPrettyPrint = exports.isThirdParty = exports.isPretty = exports.isJavaScript = exports.isMinified = undefined; var _isMinified = __webpack_require__(1778); Object.defineProperty(exports, "isMinified", { enumerable: true, get: function () { return _isMinified.isMinified; } }); var _devtoolsSourceMap = __webpack_require__(1360); var _utils = __webpack_require__(1366); var _path = __webpack_require__(1393); var _url = __webpack_require__(334); /** * Trims the query part or reference identifier of a url string, if necessary. * * @memberof utils/source * @static */ function trimUrlQuery(url) { const length = url.length; const q1 = url.indexOf("?"); const q2 = url.indexOf("&"); const q3 = url.indexOf("#"); const q = Math.min(q1 != -1 ? q1 : length, q2 != -1 ? q2 : length, q3 != -1 ? q3 : length); return url.slice(0, q); } function shouldPrettyPrint(source) { if (!source) { return false; } const _isPretty = isPretty(source); const _isJavaScript = isJavaScript(source); const isOriginal = (0, _devtoolsSourceMap.isOriginalId)(source.get("id")); const hasSourceMap = source.get("sourceMapURL"); if (_isPretty || isOriginal || hasSourceMap || !_isJavaScript) { return false; } return true; } /** * Returns true if the specified url and/or content type are specific to * javascript files. * * @return boolean * True if the source is likely javascript. * * @memberof utils/source * @static */ function isJavaScript(source) { const url = source.get("url"); const contentType = source.get("contentType"); return url && /\.(jsm|js)?$/.test(trimUrlQuery(url)) || !!(contentType && contentType.includes("javascript")); } /** * @memberof utils/source * @static */ function isPretty(source) { const url = source.get("url"); return url ? /formatted$/.test(url) : false; } function isThirdParty(source) { const url = source.get("url"); if (!source || !url) { return false; } return !!url.match(/(node_modules|bower_components)/); } /** * @memberof utils/source * @static */ function getPrettySourceURL(url) { if (!url) { url = ""; } return `${url}:formatted`; } /** * @memberof utils/source * @static */ function getRawSourceURL(url) { return url.replace(/:formatted$/, ""); } function resolveFileURL(url, transformUrl = initialUrl => initialUrl) { url = getRawSourceURL(url || ""); const name = transformUrl(url); return (0, _utils.endTruncateStr)(name, 50); } function getFilenameFromURL(url) { return resolveFileURL(url, initialUrl => (0, _path.basename)(initialUrl) || "(index)"); } function getFormattedSourceId(id) { const sourceId = id.split("/")[1]; return `SOURCE${sourceId}`; } /** * Show a source url's filename. * If the source does not have a url, use the source id. * * @memberof utils/source * @static */ function getFilename(source) { const { url, id } = source; if (!url) { return getFormattedSourceId(id); } let filename = getFilenameFromURL(url); const qMarkIdx = filename.indexOf("?"); if (qMarkIdx > 0) { filename = filename.slice(0, qMarkIdx); } return filename; } /** * Show a source url. * If the source does not have a url, use the source id. * * @memberof utils/source * @static */ function getFileURL(source) { const { url, id } = source; if (!url) { return getFormattedSourceId(id); } return resolveFileURL(url); } const contentTypeModeMap = { "text/javascript": { name: "javascript" }, "text/typescript": { name: "javascript", typescript: true }, "text/coffeescript": "coffeescript", "text/typescript-jsx": { name: "jsx", base: { name: "javascript", typescript: true } }, "text/jsx": "jsx", "text/x-elm": "elm", "text/x-clojure": "clojure", "text/wasm": { name: "text" }, "text/html": { name: "htmlmixed" } }; function getSourcePath(url) { if (!url) { return ""; } const { path, href } = (0, _url.parse)(url); // for URLs like "about:home" the path is null so we pass the full href return path || href; } /** * Returns amount of lines in the source. If source is a WebAssembly binary, * the function returns amount of bytes. */ function getSourceLineCount(source) { if (source.isWasm) { const { binary } = source.text; return binary.length; } return source.text != undefined ? source.text.split("\n").length : 0; } /** * * Checks if a source is minified based on some heuristics * @param key * @param text * @return boolean * @memberof utils/source * @static */ /** * * Returns Code Mirror mode for source content type * @param contentType * @return String * @memberof utils/source * @static */ function getMode(source, sourceMetaData) { const { contentType, text, isWasm, url } = source; if (!text || isWasm) { return { name: "text" }; } if (url && url.match(/\.jsx$/i) || sourceMetaData && sourceMetaData.isReactComponent) { return "jsx"; } const languageMimeMap = [{ ext: ".c", mode: "text/x-csrc" }, { ext: ".kt", mode: "text/x-kotlin" }, { ext: ".cpp", mode: "text/x-c++src" }, { ext: ".m", mode: "text/x-objectivec" }, { ext: ".rs", mode: "text/x-rustsrc" }]; // check for C and other non JS languages if (url) { const result = languageMimeMap.find(({ ext }) => url.endsWith(ext)); if (result !== undefined) { return result.mode; } } // if the url ends with .marko we set the name to Javascript so // syntax highlighting works for marko too if (url && url.match(/\.marko$/i)) { return { name: "javascript" }; } // Use HTML mode for files in which the first non whitespace // character is `<` regardless of extension. const isHTMLLike = text.match(/^\s*. */ var _devtoolsConfig = __webpack_require__(1355); var _sourceDocuments = __webpack_require__(1436); var sourceDocumentUtils = _interopRequireWildcard(_sourceDocuments); var _source = __webpack_require__(1356); var _getTokenLocation = __webpack_require__(1783); var _sourceSearch = __webpack_require__(1526); var sourceSearchUtils = _interopRequireWildcard(_sourceSearch); var _wasm = __webpack_require__(1401); var _ui = __webpack_require__(1439); var _devtoolsSourceEditor = __webpack_require__(1386); var _devtoolsSourceMap = __webpack_require__(1360); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } const { findNext, findPrev } = sourceSearchUtils; function shouldShowPrettyPrint(selectedSource) { if (!selectedSource) { return false; } return (0, _source.shouldPrettyPrint)(selectedSource); } function shouldShowFooter(selectedSource, horizontal) { if (!horizontal) { return true; } if (!selectedSource) { return false; } return shouldShowPrettyPrint(selectedSource) || (0, _devtoolsSourceMap.isOriginalId)(selectedSource.get("id")); } function traverseResults(e, ctx, query, dir, modifiers) { e.stopPropagation(); e.preventDefault(); if (dir == "prev") { findPrev(ctx, query, true, modifiers); } else if (dir == "next") { findNext(ctx, query, true, modifiers); } } function createEditor() { const gutters = ["breakpoints", "hit-markers", "CodeMirror-linenumbers"]; if ((0, _devtoolsConfig.isEnabled)("codeFolding")) { gutters.push("CodeMirror-foldgutter"); } return new _devtoolsSourceEditor.SourceEditor({ mode: "javascript", foldGutter: (0, _devtoolsConfig.isEnabled)("codeFolding"), enableCodeFolding: (0, _devtoolsConfig.isEnabled)("codeFolding"), readOnly: true, lineNumbers: true, theme: "mozilla", styleActiveLine: false, lineWrapping: false, matchBrackets: true, showAnnotationRuler: true, gutters, value: " ", extraKeys: { // Override code mirror keymap to avoid conflicts with split console. Esc: false, "Cmd-F": false, "Cmd-G": false } }); } function toEditorLine(sourceId, lineOrOffset) { if ((0, _wasm.isWasm)(sourceId)) { return (0, _wasm.wasmOffsetToLine)(sourceId, lineOrOffset); } return lineOrOffset ? lineOrOffset - 1 : 1; } function toEditorPosition(location) { return { line: toEditorLine(location.sourceId, location.line), column: (0, _wasm.isWasm)(location.sourceId) || !location.column ? 0 : location.column }; } function toEditorRange(sourceId, location) { const { start, end } = location; return { start: toEditorPosition(_extends({}, start, { sourceId })), end: toEditorPosition(_extends({}, end, { sourceId })) }; } function toSourceLine(sourceId, line) { return (0, _wasm.isWasm)(sourceId) ? (0, _wasm.lineToWasmOffset)(sourceId, line) : line + 1; } function scrollToColumn(codeMirror, line, column) { const { top, left } = codeMirror.charCoords({ line: line, ch: column }, "local"); const scroller = codeMirror.getScrollerElement(); const centeredX = Math.max(left - scroller.offsetWidth / 2, 0); const centeredY = Math.max(top - scroller.offsetHeight / 2, 0); codeMirror.scrollTo(centeredX, centeredY); } function toSourceLocation(sourceId, location) { return { line: toSourceLine(sourceId, location.line), column: (0, _wasm.isWasm)(sourceId) ? undefined : location.column }; } function markText(editor, className, location) { const { start, end } = location; return editor.codeMirror.markText({ ch: start.column, line: start.line }, { ch: end.column, line: end.line }, { className }); } function lineAtHeight(editor, sourceId, event) { const editorLine = editor.codeMirror.lineAtHeight(event.clientY); return toSourceLine(sourceId, editorLine); } function getSourceLocationFromMouseEvent(editor, selectedLocation, e) { const { line, ch } = editor.codeMirror.coordsChar({ left: e.clientX, top: e.clientY }); return { sourceId: selectedLocation.sourceId, line: line + 1, column: ch + 1 }; } module.exports = _extends({}, sourceDocumentUtils, sourceSearchUtils, _devtoolsSourceEditor.SourceEditorUtils, { createEditor, isWasm: _wasm.isWasm, toEditorLine, toEditorPosition, toEditorRange, toSourceLine, scrollToColumn, toSourceLocation, shouldShowPrettyPrint, shouldShowFooter, traverseResults, markText, lineAtHeight, getSourceLocationFromMouseEvent, resizeBreakpointGutter: _ui.resizeBreakpointGutter, getTokenLocation: _getTokenLocation.getTokenLocation }); /***/ }), /* 1359 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _Svg = __webpack_require__(1540); var _Svg2 = _interopRequireDefault(_Svg); __webpack_require__(1310); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ /** * This file maps the SVG React Components in the assets/images directory. */ exports.default = _Svg2.default; /***/ }), /* 1360 */ /***/ (function(module, exports, __webpack_require__) { /* 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/. */ const { originalToGeneratedId, generatedToOriginalId, isGeneratedId, isOriginalId } = __webpack_require__(1389); const { workerUtils: { WorkerDispatcher } } = __webpack_require__(1390); const dispatcher = new WorkerDispatcher(); const getOriginalURLs = dispatcher.task("getOriginalURLs"); const getGeneratedLocation = dispatcher.task("getGeneratedLocation"); const getOriginalLocation = dispatcher.task("getOriginalLocation"); const getLocationScopes = dispatcher.task("getLocationScopes"); const getOriginalSourceText = dispatcher.task("getOriginalSourceText"); const applySourceMap = dispatcher.task("applySourceMap"); const clearSourceMaps = dispatcher.task("clearSourceMaps"); const hasMappedSource = dispatcher.task("hasMappedSource"); module.exports = { originalToGeneratedId, generatedToOriginalId, isGeneratedId, isOriginalId, hasMappedSource, getOriginalURLs, getGeneratedLocation, getOriginalLocation, getLocationScopes, getOriginalSourceText, applySourceMap, clearSourceMaps, startSourceMapWorker: dispatcher.start.bind(dispatcher), stopSourceMapWorker: dispatcher.stop.bind(dispatcher) }; /***/ }), /* 1361 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } /** * Make an immutable record type * * @param spec - the keys and their default values * @return a state record factory function * @memberof utils/makeRecord * @static */ /** * @memberof utils/makeRecord * @static */ function makeRecord(spec) { return I.Record(spec); } /* 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 . */ /** * When Flow 0.29 is released (very soon), we can use this Record type * instead of the builtin immutable.js Record type. This is better * because all the fields are actually typed, unlike the builtin one. * This depends on a performance fix that will go out in 0.29 though; * @module utils/makeRecord */ exports.default = makeRecord; /***/ }), /* 1362 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ /* global window, document, DebuggerConfig */ const { bindActionCreators, combineReducers } = __webpack_require__(3); const { Provider } = __webpack_require__(1189); const { defer } = __webpack_require__(1412); const { debugGlobal } = __webpack_require__(1460); const { setConfig, getValue, isDevelopment } = __webpack_require__(1355); const L10N = __webpack_require__(1462); const { showMenu, buildMenu } = __webpack_require__(1413); setConfig({"environment":"firefox-panel","logging":false,"clientLogging":false,"firefox":{"mcPath":"./firefox"},"workers":{"parserURL":"resource://devtools/client/debugger/new/parser-worker.js","prettyPrintURL":"resource://devtools/client/debugger/new/pretty-print-worker.js","searchURL":"resource://devtools/client/debugger/new/search-worker.js"},"features":{"blackbox":{"enabled":true},"chromeScopes":{"enabled":false},"eventListeners":{"enabled":false},"codeCoverage":{"enabled":false},"codeFolding":{"enabled":false},"searchNav":{"enabled":true},"collapseFrame":{"enabled":true},"outline":{"enabled":true}}}); // Set various flags before requiring app code. if (getValue("logging.client")) { // DevToolsUtils.dumpn.wantLogging = true; } const { firefox, chrome, startDebugging } = __webpack_require__(1470); const Root = __webpack_require__(1476); // Using this static variable allows webpack to know at compile-time // to avoid this require and not include it at all in the output. if (false) { require("devtools-mc-assets/assets/devtools/client/themes/light-theme.css"); require("devtools-mc-assets/assets/devtools/client/themes/dark-theme.css"); require("devtools-mc-assets/assets/devtools/client/themes/firebug-theme.css"); } function updateTheme(className) { if (false) { const theme = getValue("theme"); const root = document.body.parentNode; const appRoot = document.querySelector(".launchpad-root"); root.className = ""; appRoot.className = className; root.classList.add(`theme-${theme}`); appRoot.classList.add(`theme-${theme}`); } } function updatePlatform(className) { if (false) { const root = document.body.parentNode; const appRoot = document.querySelector(".launchpad-root"); const agent = navigator.userAgent.toLowerCase(); const win = agent.indexOf("windows") > -1 ? "win" : "linux"; const platform = agent.indexOf("mac os") > -1 ? "mac" : win; root.classList.add("html"); appRoot.setAttribute("platform", platform); } } function updateDir() { const dir = getValue("dir"); const root = document.body.parentNode; root.dir = dir; } async function updateConfig() { const response = await fetch("/getconfig", { method: "get" }); const config = await response.json(); setConfig(config); return config; } async function initApp() { const configureStore = __webpack_require__(1477); const reducers = __webpack_require__(1486); const LaunchpadApp = __webpack_require__(1489); const createStore = configureStore({ log: getValue("logging.actions"), makeThunkArgs: (args, state) => { return Object.assign({}, args, {}); } }); const store = createStore(combineReducers(reducers)); const actions = bindActionCreators(__webpack_require__(1415), store.dispatch); debugGlobal("launchpadStore", store); if (isDevelopment()) { const config = await updateConfig(); actions.setConfig(config); // AppConstants.DEBUG_JS_MODULES = true; } return { store, actions, LaunchpadApp }; } function renderRoot(_React, _ReactDOM, component, _store, props) { const { createElement } = _React; const mount = document.querySelector("#mount"); // bail in test environments that do not have a mount if (!mount) { return; } const className = "launchpad-root theme-body"; const root = Root(className); mount.appendChild(root); if (isDevelopment()) { updateConfig(); updateTheme(className); updatePlatform(); } if (component.props || component.propTypes) { _ReactDOM.render(createElement(Provider, { store: _store }, createElement(component, props)), root); } else { root.appendChild(component); } } function unmountRoot(_ReactDOM) { const mount = document.querySelector("#mount .launchpad-root"); _ReactDOM.unmountComponentAtNode(mount); } function getTargetFromQuery() { const href = window.location.href; const nodeMatch = href.match(/node-tab=([^&#]*)/); const firefoxMatch = href.match(/firefox-tab=([^&#]*)/); const chromeMatch = href.match(/chrome-tab=([^&#]*)/); if (nodeMatch) { return { type: "node", param: nodeMatch[1] }; } else if (firefoxMatch) { return { type: "firefox", param: firefoxMatch[1] }; } else if (chromeMatch) { return { type: "chrome", param: chromeMatch[1] }; } return null; } async function connectClients(actions) { const firefoxTabs = await firefox.connectClient(); actions.newTabs(firefoxTabs); chrome.connectClient().then(actions.newTabs); chrome.connectNodeClient().then(actions.newTabs); } async function getTabs(actions) { const firefoxTabs = await firefox.connectClient(); const chromeTabs = await chrome.connectClient(); const nodeTabs = await chrome.connectNodeClient(); actions.clearTabs(); actions.newTabs(firefoxTabs); actions.newTabs(chromeTabs); actions.newTabs(nodeTabs); } async function bootstrap(React, ReactDOM) { const connTarget = getTargetFromQuery(); if (connTarget) { const { tab, tabConnection } = await startDebugging(connTarget); await updateConfig(); return { tab, connTarget, tabConnection }; } const { store, actions, LaunchpadApp } = await initApp(); renderRoot(React, ReactDOM, LaunchpadApp, store); await connectClients(actions); setInterval(async () => await getTabs(actions), 3000); return undefined; } module.exports = { bootstrap, buildMenu, debugGlobal, defer, renderRoot, L10N, showMenu, unmountRoot, updateTheme, updateDir }; /***/ }), /* 1363 */ /***/ (function(module, exports, __webpack_require__) { /* 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/. */ const networkRequest = __webpack_require__(1367); const workerUtils = __webpack_require__(1368); module.exports = { networkRequest, workerUtils }; /***/ }), /* 1364 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.findScopeByName = exports.getASTLocation = undefined; var _astBreakpointLocation = __webpack_require__(1416); Object.defineProperty(exports, "getASTLocation", { enumerable: true, get: function () { return _astBreakpointLocation.getASTLocation; } }); Object.defineProperty(exports, "findScopeByName", { enumerable: true, get: function () { return _astBreakpointLocation.findScopeByName; } }); exports.firstString = firstString; exports.locationMoved = locationMoved; exports.makeLocationId = makeLocationId; exports.makePendingLocationId = makePendingLocationId; exports.assertBreakpoint = assertBreakpoint; exports.assertPendingBreakpoint = assertPendingBreakpoint; exports.assertLocation = assertLocation; exports.assertPendingLocation = assertPendingLocation; exports.breakpointAtLocation = breakpointAtLocation; exports.breakpointExists = breakpointExists; exports.createBreakpoint = createBreakpoint; exports.createPendingBreakpoint = createPendingBreakpoint; var _selectors = __webpack_require__(1352); var _assert = __webpack_require__(1384); var _assert2 = _interopRequireDefault(_assert); var _prefs = __webpack_require__(226); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // Return the first argument that is a string, or null if nothing is a // string. function firstString(...args) { for (const arg of args) { if (typeof arg === "string") { return arg; } } return null; } function locationMoved(location, newLocation) { return location.line !== newLocation.line || location.column !== newLocation.column; } function makeLocationId(location) { const { sourceId, line, column } = location; const columnString = column || ""; return `${sourceId}:${line}:${columnString}`; } function makePendingLocationId(location) { assertPendingLocation(location); const { sourceUrl, line, column } = location; const sourceUrlString = sourceUrl || ""; const columnString = column || ""; return `${sourceUrlString}:${line}:${columnString}`; } function assertBreakpoint(breakpoint) { assertLocation(breakpoint.location); assertLocation(breakpoint.generatedLocation); } function assertPendingBreakpoint(pendingBreakpoint) { assertPendingLocation(pendingBreakpoint.location); assertPendingLocation(pendingBreakpoint.generatedLocation); } function assertLocation(location) { assertPendingLocation(location); const { sourceId } = location; (0, _assert2.default)(!!sourceId, "location must have a source id"); } function assertPendingLocation(location) { (0, _assert2.default)(!!location, "location must exist"); const { sourceUrl } = location; // sourceUrl is null when the source does not have a url (0, _assert2.default)(sourceUrl !== undefined, "location must have a source url"); (0, _assert2.default)(location.hasOwnProperty("line"), "location must have a line"); (0, _assert2.default)(location.hasOwnProperty("column") != null, "location must have a column"); } // syncing function breakpointAtLocation(breakpoints, { line, column }) { return breakpoints.find(breakpoint => { const sameLine = breakpoint.location.line === line; if (!sameLine) { return false; } // NOTE: when column breakpoints are disabled we want to find // the first breakpoint if (!_prefs.features.columnBreakpoints) { return true; } return breakpoint.location.column === column; }); } function breakpointExists(state, location) { const currentBp = (0, _selectors.getBreakpoint)(state, location); return currentBp && !currentBp.disabled; } function createBreakpoint(location, overrides = {}) { const { condition, disabled, hidden, generatedLocation, astLocation, id } = overrides; const defaultASTLocation = { name: undefined, offset: location }; const properties = { id, condition: condition || null, disabled: disabled || false, hidden: hidden || false, loading: false, text: "", astLocation: astLocation || defaultASTLocation, generatedLocation: generatedLocation || location, location }; return properties; } function createPendingLocation(location) { const { sourceUrl, line, column } = location; return { sourceUrl, line, column }; } function createPendingBreakpoint(bp) { const pendingLocation = createPendingLocation(bp.location); const pendingGeneratedLocation = createPendingLocation(bp.generatedLocation); assertPendingLocation(pendingLocation); return { condition: bp.condition, disabled: bp.disabled, location: pendingLocation, astLocation: bp.astLocation, generatedLocation: pendingGeneratedLocation }; } /***/ }), /* 1365 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.replaceOriginalVariableName = exports.isReactComponent = exports.hasSyntaxError = exports.clearSources = exports.setSource = exports.hasSource = exports.getEmptyLines = exports.getNextStep = exports.clearASTs = exports.clearScopes = exports.clearSymbols = exports.findOutOfScopeLocations = exports.getVariablesInScope = exports.getScopes = exports.getSymbols = exports.getClosestExpression = exports.stopParserWorker = exports.startParserWorker = undefined; var _devtoolsUtils = __webpack_require__(1363); const { WorkerDispatcher } = _devtoolsUtils.workerUtils; /* 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 . */ const dispatcher = new WorkerDispatcher(); const startParserWorker = exports.startParserWorker = dispatcher.start.bind(dispatcher); const stopParserWorker = exports.stopParserWorker = dispatcher.stop.bind(dispatcher); const getClosestExpression = exports.getClosestExpression = dispatcher.task("getClosestExpression"); const getSymbols = exports.getSymbols = dispatcher.task("getSymbols"); const getScopes = exports.getScopes = dispatcher.task("getScopes"); const getVariablesInScope = exports.getVariablesInScope = dispatcher.task("getVariablesInScope"); const findOutOfScopeLocations = exports.findOutOfScopeLocations = dispatcher.task("findOutOfScopeLocations"); const clearSymbols = exports.clearSymbols = dispatcher.task("clearSymbols"); const clearScopes = exports.clearScopes = dispatcher.task("clearScopes"); const clearASTs = exports.clearASTs = dispatcher.task("clearASTs"); const getNextStep = exports.getNextStep = dispatcher.task("getNextStep"); const getEmptyLines = exports.getEmptyLines = dispatcher.task("getEmptyLines"); const hasSource = exports.hasSource = dispatcher.task("hasSource"); const setSource = exports.setSource = dispatcher.task("setSource"); const clearSources = exports.clearSources = dispatcher.task("clearSources"); const hasSyntaxError = exports.hasSyntaxError = dispatcher.task("hasSyntaxError"); const isReactComponent = exports.isReactComponent = dispatcher.task("isReactComponent"); const replaceOriginalVariableName = exports.replaceOriginalVariableName = dispatcher.task("replaceOriginalVariableName"); /***/ }), /* 1366 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /* 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 . */ /** * Utils for utils, by utils * @module utils/utils */ /** * @memberof utils/utils * @static */ function handleError(err) { console.log("ERROR: ", err); } /** * @memberof utils/utils * @static */ function promisify(context, method, ...args) { return new Promise((resolve, reject) => { args.push(response => { if (response.error) { reject(response); } else { resolve(response); } }); method.apply(context, args); }); } /** * @memberof utils/utils * @static */ function endTruncateStr(str, size) { if (str.length > size) { return `...${str.slice(str.length - size)}`; } return str; } /** * @memberof utils/utils * @static */ /** * @memberof utils/utils * @static */ function throttle(func, ms) { let timeout, _this; return function (...args) { _this = this; if (!timeout) { timeout = setTimeout(() => { func.apply(_this, ...args); timeout = null; }, ms); } }; } function waitForMs(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } exports.handleError = handleError; exports.promisify = promisify; exports.endTruncateStr = endTruncateStr; exports.throttle = throttle; exports.waitForMs = waitForMs; /***/ }), /* 1367 */ /***/ (function(module, exports) { /* 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/. */ function networkRequest(url, opts) { return fetch(url, { cache: opts.loadFromCache ? "default" : "no-cache" }).then(res => { if (res.status >= 200 && res.status < 300) { return res.text().then(text => ({ content: text })); } return Promise.reject(`request failed with status ${res.status}`); }); } module.exports = networkRequest; /***/ }), /* 1368 */ /***/ (function(module, exports) { 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 WorkerDispatcher() { this.msgId = 1; this.worker = null; } /* 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/. */ WorkerDispatcher.prototype = { start(url) { this.worker = new Worker(url); this.worker.onerror = () => { console.error(`Error in worker ${url}`); }; }, stop() { if (!this.worker) { return; } this.worker.terminate(); this.worker = null; }, task(method) { return (...args) => { return new Promise((resolve, reject) => { const id = this.msgId++; this.worker.postMessage({ id, method, args }); const listener = ({ data: result }) => { if (result.id !== id) { return; } if (!this.worker) { return; } this.worker.removeEventListener("message", listener); if (result.error) { reject(result.error); } else { resolve(result.response); } }; this.worker.addEventListener("message", listener); }); }; } }; function workerHandler(publicInterface) { return function (msg) { const { id, method, args } = msg.data; try { const response = publicInterface[method].apply(undefined, args); if (response instanceof Promise) { response.then(val => self.postMessage({ id, response: val }), // Error can't be sent via postMessage, so be sure to // convert to string. err => self.postMessage({ id, error: err.toString() })); } else { self.postMessage({ id, response }); } } catch (error) { // Error can't be sent via postMessage, so be sure to convert to // string. self.postMessage({ id, error: error.toString() }); } }; } function streamingWorkerHandler(publicInterface, { timeout = 100 } = {}, worker = self) { let streamingWorker = (() => { var _ref = _asyncToGenerator(function* (id, tasks) { let isWorking = true; const intervalId = setTimeout(function () { isWorking = false; }, timeout); const results = []; while (tasks.length !== 0 && isWorking) { const { callback, context, args } = tasks.shift(); const result = yield callback.call(context, args); results.push(result); } worker.postMessage({ id, status: "pending", data: results }); clearInterval(intervalId); if (tasks.length !== 0) { yield streamingWorker(id, tasks); } }); return function streamingWorker(_x, _x2) { return _ref.apply(this, arguments); }; })(); return (() => { var _ref2 = _asyncToGenerator(function* (msg) { const { id, method, args } = msg.data; const workerMethod = publicInterface[method]; if (!workerMethod) { console.error(`Could not find ${method} defined in worker.`); } worker.postMessage({ id, status: "start" }); try { const tasks = workerMethod(args); yield streamingWorker(id, tasks); worker.postMessage({ id, status: "done" }); } catch (error) { worker.postMessage({ id, status: "error", error }); } }); return function (_x3) { return _ref2.apply(this, arguments); }; })(); } module.exports = { WorkerDispatcher, workerHandler, streamingWorkerHandler }; /***/ }), /* 1369 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSelectedSourceText = exports.getSelectedSource = exports.getSelectedLocation = exports.getSourcesForTabs = exports.getSearchTabs = exports.getSourceTabs = exports.getSources = undefined; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ /** * Sources reducer * @module reducers/sources */ exports.initialState = initialState; exports.removeSourceFromTabList = removeSourceFromTabList; exports.removeSourcesFromTabList = removeSourcesFromTabList; exports.getNewSelectedSourceId = getNewSelectedSourceId; exports.getSource = getSource; exports.getSourceByURL = getSourceByURL; exports.getGeneratedSource = getGeneratedSource; exports.getPendingSelectedLocation = getPendingSelectedLocation; exports.getPrettySource = getPrettySource; exports.getSourceInSources = getSourceInSources; var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); var _reselect = __webpack_require__(993); var _makeRecord = __webpack_require__(1361); var _makeRecord2 = _interopRequireDefault(_makeRecord); var _source = __webpack_require__(1356); var _devtoolsSourceMap = __webpack_require__(1360); var _prefs = __webpack_require__(226); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function initialState() { return (0, _makeRecord2.default)({ sources: I.Map(), selectedLocation: undefined, pendingSelectedLocation: _prefs.prefs.pendingSelectedLocation, sourcesText: I.Map(), tabs: I.List(restoreTabs()) })(); } function update(state = initialState(), action) { let location = null; switch (action.type) { case "ADD_SOURCE": { return updateSource(state, action.source); } case "ADD_SOURCES": { return action.sources.reduce((newState, source) => updateSource(newState, source), state); } case "SELECT_SOURCE": location = _extends({}, action.location, { url: action.source.url }); _prefs.prefs.pendingSelectedLocation = location; return state.set("selectedLocation", _extends({ sourceId: action.source.id }, action.location)).set("pendingSelectedLocation", location); case "CLEAR_SELECTED_SOURCE": location = { url: "" }; _prefs.prefs.pendingSelectedLocation = location; return state.set("selectedLocation", { sourceId: "" }).set("pendingSelectedLocation", location); case "SELECT_SOURCE_URL": location = { url: action.url, line: action.line }; _prefs.prefs.pendingSelectedLocation = location; return state.set("pendingSelectedLocation", location); case "ADD_TAB": return state.merge({ tabs: updateTabList({ sources: state }, action.source.url) }); case "MOVE_TAB": return state.merge({ tabs: updateTabList({ sources: state }, action.url, action.tabIndex) }); case "CLOSE_TAB": _prefs.prefs.tabs = action.tabs; return state.merge({ tabs: action.tabs }); case "CLOSE_TABS": _prefs.prefs.tabs = action.tabs; return state.merge({ tabs: action.tabs }); case "LOAD_SOURCE_TEXT": return setSourceTextProps(state, action); case "BLACKBOX": if (action.status === "done") { return state.setIn(["sources", action.source.id, "isBlackBoxed"], action.value.isBlackBoxed); } break; case "NAVIGATE": const source = getSelectedSource({ sources: state }); const url = source && source.get("url"); if (!url) { return initialState(); } return initialState().set("pendingSelectedLocation", { url }); } return state; } function getTextPropsFromAction(action) { const { value, sourceId } = action; if (action.status === "start") { return { id: sourceId, loadedState: "loading" }; } else if (action.status === "error") { return { id: sourceId, error: action.error, loadedState: "loaded" }; } return { text: value.text, id: sourceId, contentType: value.contentType, loadedState: "loaded" }; } // TODO: Action is coerced to `any` unfortunately because how we type // asynchronous actions is wrong. The `value` may be null for the // "start" and "error" states but we don't type it like that. We need // to rethink how we type async actions. function setSourceTextProps(state, action) { const text = getTextPropsFromAction(action); return updateSource(state, text); } function updateSource(state, source) { if (!source.id) { return state; } return state.mergeIn(["sources", source.id], source); } function removeSourceFromTabList(tabs, url) { return tabs.filter(tab => tab != url); } function removeSourcesFromTabList(tabs, urls) { return urls.reduce((t, url) => removeSourceFromTabList(t, url), tabs); } function restoreTabs() { const prefsTabs = _prefs.prefs.tabs || []; if (prefsTabs.length == 0) { return; } return prefsTabs; } /** * Adds the new source to the tab list if it is not already there * @memberof reducers/sources * @static */ function updateTabList(state, url, tabIndex) { let tabs = state.sources.get("tabs"); const urlIndex = tabs.indexOf(url); const includesUrl = !!tabs.find(tab => tab == url); if (includesUrl) { if (tabIndex != undefined) { tabs = tabs.delete(urlIndex).insert(tabIndex, url); } } else { tabs = tabs.insert(0, url); } _prefs.prefs.tabs = tabs.toJS(); return tabs; } /** * Gets the next tab to select when a tab closes. Heuristics: * 1. if the selected tab is available, it remains selected * 2. if it is gone, the next available tab to the left should be active * 3. if the first tab is active and closed, select the second tab * * @memberof reducers/sources * @static */ function getNewSelectedSourceId(state, availableTabs) { const selectedLocation = state.sources.selectedLocation; if (!selectedLocation) { return ""; } const selectedTab = state.sources.sources.get(selectedLocation.sourceId); const selectedTabUrl = selectedTab ? selectedTab.get("url") : ""; if (availableTabs.includes(selectedTabUrl)) { const sources = state.sources.sources; if (!sources) { return ""; } const selectedSource = sources.find(source => source.get("url") == selectedTabUrl); if (selectedSource) { return selectedSource.get("id"); } return ""; } const tabUrls = state.sources.tabs.toJS(); const leftNeighborIndex = Math.max(tabUrls.indexOf(selectedTabUrl) - 1, 0); const lastAvailbleTabIndex = availableTabs.size - 1; const newSelectedTabIndex = Math.min(leftNeighborIndex, lastAvailbleTabIndex); const availableTab = availableTabs.toJS()[newSelectedTabIndex]; const tabSource = getSourceByUrlInSources(state.sources.sources, availableTab); if (tabSource) { return tabSource.get("id"); } return ""; } // Selectors // Unfortunately, it's really hard to make these functions accept just // the state that we care about and still type it with Flow. The // problem is that we want to re-export all selectors from a single // module for the UI, and all of those selectors should take the // top-level app state, so we'd have to "wrap" them to automatically // pick off the piece of state we're interested in. It's impossible // (right now) to type those wrapped functions. const getSourcesState = state => state.sources; function getSource(state, id) { return getSourceInSources(getSources(state), id); } function getSourceByURL(state, url) { return getSourceByUrlInSources(state.sources.sources, url); } function getGeneratedSource(state, source) { if (!source || !(0, _devtoolsSourceMap.isOriginalId)(source.id)) { return null; } return getSource(state, (0, _devtoolsSourceMap.originalToGeneratedId)(source.id)); } function getPendingSelectedLocation(state) { return state.sources.pendingSelectedLocation; } function getPrettySource(state, id) { const source = getSource(state, id); if (!source) { return; } return getSourceByURL(state, (0, _source.getPrettySourceURL)(source.get("url"))); } function getSourceByUrlInSources(sources, url) { if (!url) { return null; } return sources.find(source => source.get("url") === url); } function getSourceInSources(sources, id) { return sources.get(id); } const getSources = exports.getSources = (0, _reselect.createSelector)(getSourcesState, sources => sources.sources); const getTabs = (0, _reselect.createSelector)(getSourcesState, sources => sources.tabs); const getSourceTabs = exports.getSourceTabs = (0, _reselect.createSelector)(getTabs, getSources, (tabs, sources) => tabs.filter(tab => getSourceByUrlInSources(sources, tab))); const getSearchTabs = exports.getSearchTabs = (0, _reselect.createSelector)(getTabs, getSources, (tabs, sources) => tabs.filter(tab => !getSourceByUrlInSources(sources, tab))); const getSourcesForTabs = exports.getSourcesForTabs = (0, _reselect.createSelector)(getSourceTabs, getSources, (tabs, sources) => { return tabs.map(tab => getSourceByUrlInSources(sources, tab)).filter(source => source); }); const getSelectedLocation = exports.getSelectedLocation = (0, _reselect.createSelector)(getSourcesState, sources => sources.selectedLocation); const getSelectedSource = exports.getSelectedSource = (0, _reselect.createSelector)(getSelectedLocation, getSources, (selectedLocation, sources) => { if (!selectedLocation) { return; } return sources.get(selectedLocation.sourceId); }); const getSelectedSourceText = exports.getSelectedSourceText = (0, _reselect.createSelector)(getSelectedSource, getSourcesState, (selectedSource, sources) => { const id = selectedSource.get("id"); return id ? sources.sourcesText.get(id) : null; }); exports.default = update; /***/ }), /* 1370 */, /* 1371 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.nodeHasChildren = nodeHasChildren; exports.isExactUrlMatch = isExactUrlMatch; exports.isDirectory = isDirectory; exports.isNotJavaScript = isNotJavaScript; exports.isInvalidUrl = isInvalidUrl; exports.partIsFile = partIsFile; exports.createNode = createNode; exports.createParentMap = createParentMap; exports.getRelativePath = getRelativePath; var _url = __webpack_require__(334); var _source = __webpack_require__(1356); /* 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 . */ const IGNORED_URLS = ["debugger eval code", "XStringBundle"]; function nodeHasChildren(item) { return Array.isArray(item.contents); } function isExactUrlMatch(pathPart, debuggeeUrl) { // compare to hostname with an optional 'www.' prefix const { host } = (0, _url.parse)(debuggeeUrl); if (!host) { return false; } return host.replace(/^www\./, "") === pathPart.replace(/^www\./, ""); } function isDirectory(url) { const parts = url.path.split("/").filter(p => p !== ""); // Assume that all urls point to files except when they end with '/' // Or directory node has children return parts.length === 0 || url.path.slice(-1) === "/" || nodeHasChildren(url); } function isNotJavaScript(source) { const parsedUrl = (0, _url.parse)(source.get("url")).pathname; if (!parsedUrl) { return false; } const parsedExtension = parsedUrl.split(".").pop(); return ["css", "svg", "png"].includes(parsedExtension); } function isInvalidUrl(url, source) { return IGNORED_URLS.indexOf(url) != -1 || !source.get("url") || source.get("loadedState") === "loading" || !url.group || (0, _source.isPretty)(source) || isNotJavaScript(source); } function partIsFile(index, parts, url) { const isLastPart = index === parts.length - 1; return !isDirectory(url) && isLastPart; } function createNode(name, path, contents) { return { name, path, contents }; } function createParentMap(tree) { const map = new WeakMap(); function _traverse(subtree) { if (nodeHasChildren(subtree)) { for (const child of subtree.contents) { map.set(child, subtree); _traverse(child); } } } // Don't link each top-level path to the "root" node because the // user never sees the root tree.contents.forEach(_traverse); return map; } function getRelativePath(url) { const { pathname } = (0, _url.parse)(url); if (!pathname) { return url; } const path = pathname.split("/"); path.shift(); return path.join("/"); } /***/ }), /* 1372 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ __webpack_require__(1324); // Load all existing rep templates const Undefined = __webpack_require__(1560); const Null = __webpack_require__(1561); const StringRep = __webpack_require__(1447); const LongStringRep = __webpack_require__(1562); const Number = __webpack_require__(1563); const ArrayRep = __webpack_require__(1448); const Obj = __webpack_require__(1564); const SymbolRep = __webpack_require__(1565); const InfinityRep = __webpack_require__(1566); const NaNRep = __webpack_require__(1567); const Accessor = __webpack_require__(1568); // DOM types (grips) const Attribute = __webpack_require__(1569); const DateTime = __webpack_require__(1570); const Document = __webpack_require__(1571); const Event = __webpack_require__(1572); const Func = __webpack_require__(1573); const PromiseRep = __webpack_require__(1574); const RegExp = __webpack_require__(1575); const StyleSheet = __webpack_require__(1576); const CommentNode = __webpack_require__(1577); const ElementNode = __webpack_require__(1578); const TextNode = __webpack_require__(1579); const ErrorRep = __webpack_require__(1580); const Window = __webpack_require__(1581); const ObjectWithText = __webpack_require__(1582); const ObjectWithURL = __webpack_require__(1583); const GripArray = __webpack_require__(1450); const GripMap = __webpack_require__(1584); const GripMapEntry = __webpack_require__(1451); const Grip = __webpack_require__(1409); // List of all registered template. // XXX there should be a way for extensions to register a new // or modify an existing rep. let reps = [RegExp, StyleSheet, Event, DateTime, CommentNode, ElementNode, TextNode, Attribute, LongStringRep, Func, PromiseRep, ArrayRep, Document, Window, ObjectWithText, ObjectWithURL, ErrorRep, GripArray, GripMap, GripMapEntry, Grip, Undefined, Null, StringRep, Number, SymbolRep, InfinityRep, NaNRep, Accessor]; /** * Generic rep that is using for rendering native JS types or an object. * The right template used for rendering is picked automatically according * to the current value type. The value must be passed is as 'object' * property. */ const Rep = function (props) { let { object, defaultRep } = props; let rep = getRep(object, defaultRep, props.noGrip); return rep(props); }; // Helpers /** * Return a rep object that is responsible for rendering given * object. * * @param object {Object} Object to be rendered in the UI. This * can be generic JS object as well as a grip (handle to a remote * debuggee object). * * @param defaultObject {React.Component} The default template * that should be used to render given object if none is found. * * @param noGrip {Boolean} If true, will only check reps not made for remote objects. */ function getRep(object, defaultRep = Obj, noGrip = false) { for (let i = 0; i < reps.length; i++) { let rep = reps[i]; try { // supportsObject could return weight (not only true/false // but a number), which would allow to priorities templates and // support better extensibility. if (rep.supportsObject(object, noGrip)) { return rep.rep; } } catch (err) { console.error(err); } } return defaultRep.rep; } module.exports = { Rep, REPS: { Accessor, ArrayRep, Attribute, CommentNode, DateTime, Document, ElementNode, ErrorRep, Event, Func, Grip, GripArray, GripMap, GripMapEntry, InfinityRep, LongStringRep, NaNRep, Null, Number, Obj, ObjectWithText, ObjectWithURL, PromiseRep, RegExp, Rep, StringRep, StyleSheet, SymbolRep, TextNode, Undefined, Window }, // Exporting for tests getRep }; /***/ }), /* 1373 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ /** * Redux actions for the sources state * @module actions/sources */ exports.newSource = newSource; exports.newSources = newSources; exports.selectSourceURL = selectSourceURL; exports.selectSource = selectSource; exports.selectLocation = selectLocation; exports.jumpToMappedLocation = jumpToMappedLocation; exports.addTab = addTab; exports.moveTab = moveTab; exports.closeTab = closeTab; exports.closeTabs = closeTabs; exports.togglePrettyPrint = togglePrettyPrint; exports.toggleBlackBox = toggleBlackBox; exports.loadAllSources = loadAllSources; var _promise = __webpack_require__(1653); var _assert = __webpack_require__(1384); var _assert2 = _interopRequireDefault(_assert); var _breakpoints = __webpack_require__(1396); var _ast = __webpack_require__(1399); var _projectTextSearch = __webpack_require__(1433); var _ui = __webpack_require__(1385); var _source2 = __webpack_require__(1356); var _location = __webpack_require__(1782); var _createPrettySource = __webpack_require__(1523); var _loadSourceText = __webpack_require__(1435); var _prefs = __webpack_require__(226); var _editor = __webpack_require__(1358); var _sourceMaps = __webpack_require__(1397); var _devtoolsSourceMap = __webpack_require__(1360); var _selectors = __webpack_require__(1352); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // If a request has been made to show this source, go ahead and // select it. function checkSelectedSource(source) { return async ({ dispatch, getState }) => { const pendingLocation = (0, _selectors.getPendingSelectedLocation)(getState()); if (pendingLocation && !!source.url && pendingLocation.url === source.url) { await dispatch(selectLocation(_extends({}, pendingLocation, { sourceId: source.id }))); } }; } function checkPendingBreakpoints(sourceId) { return async ({ dispatch, getState }) => { // source may have been modified by selectLocation const source = (0, _selectors.getSource)(getState(), sourceId); const pendingBreakpoints = (0, _selectors.getPendingBreakpointsForSource)(getState(), source.get("url")); if (!pendingBreakpoints.size) { return; } // load the source text if there is a pending breakpoint for it await dispatch((0, _loadSourceText.loadSourceText)(source)); const pendingBreakpointsArray = pendingBreakpoints.valueSeq().toJS(); for (const pendingBreakpoint of pendingBreakpointsArray) { await dispatch((0, _breakpoints.syncBreakpoint)(sourceId, pendingBreakpoint)); } }; } /** * Handler for the debugger client's unsolicited newSource notification. * @memberof actions/sources * @static */ function newSource(source) { return async ({ dispatch, getState }) => { const _source = (0, _selectors.getSource)(getState(), source.id); if (_source) { return; } dispatch({ type: "ADD_SOURCE", source }); if (_prefs.prefs.clientSourceMapsEnabled) { dispatch(loadSourceMap(source)); } dispatch(checkSelectedSource(source)); dispatch(checkPendingBreakpoints(source.id)); }; } function newSources(sources) { return async ({ dispatch, getState }) => { const filteredSources = sources.filter(source => !(0, _selectors.getSource)(getState(), source.id)); if (filteredSources.length == 0) { return; } dispatch({ type: "ADD_SOURCES", sources: filteredSources }); for (const source of filteredSources) { dispatch(checkSelectedSource(source)); dispatch(checkPendingBreakpoints(source.id)); } return Promise.all(filteredSources.map(source => dispatch(loadSourceMap(source)))); }; } function createOriginalSource(originalUrl, generatedSource, sourceMaps) { return { url: originalUrl, id: sourceMaps.generatedToOriginalId(generatedSource.id, originalUrl), isPrettyPrinted: false, isWasm: false, isBlackBoxed: false, loadedState: "unloaded" }; } /** * @memberof actions/sources * @static */ function loadSourceMap(generatedSource) { return async function ({ dispatch, getState, sourceMaps }) { const urls = await sourceMaps.getOriginalURLs(generatedSource); if (!urls) { // If this source doesn't have a sourcemap, do nothing. return; } const originalSources = urls.map(url => createOriginalSource(url, generatedSource, sourceMaps)); // TODO: check if this line is really needed, it introduces // a lot of lag to the application. const generatedSourceRecord = (0, _selectors.getSource)(getState(), generatedSource.id); await dispatch((0, _loadSourceText.loadSourceText)(generatedSourceRecord)); dispatch(newSources(originalSources)); }; } /** * Deterministically select a source that has a given URL. This will * work regardless of the connection status or if the source exists * yet. This exists mostly for external things to interact with the * debugger. * * @memberof actions/sources * @static */ function selectSourceURL(url, options = {}) { return async ({ dispatch, getState }) => { const source = (0, _selectors.getSourceByURL)(getState(), url); if (source) { const sourceId = source.get("id"); const location = (0, _location.createLocation)(_extends({}, options.location, { sourceId })); // flow is unable to comprehend that if an options.location object // exists, that we have a valid Location object, and if it doesnt, // we have a valid { sourceId: string } object. So we are overriding // the error // $FlowIgnore await dispatch(selectLocation(location, options.tabIndex)); } else { dispatch({ type: "SELECT_SOURCE_URL", url: url, tabIndex: options.tabIndex, location: options.location }); } }; } /** * @memberof actions/sources * @static */ function selectSource(sourceId, tabIndex = "") { return async ({ dispatch }) => { const location = (0, _location.createLocation)({ sourceId }); return await dispatch(selectLocation(location, tabIndex)); }; } /** * @memberof actions/sources * @static */ function selectLocation(location, tabIndex = "") { return async ({ dispatch, getState, client }) => { if (!client) { // No connection, do nothing. This happens when the debugger is // shut down too fast and it tries to display a default source. return; } const source = (0, _selectors.getSource)(getState(), location.sourceId); if (!source) { // If there is no source we deselect the current selected source return dispatch({ type: "CLEAR_SELECTED_SOURCE" }); } const activeSearch = (0, _selectors.getActiveSearch)(getState()); if (activeSearch !== "file") { dispatch((0, _ui.closeActiveSearch)()); } dispatch(addTab(source.toJS(), 0)); dispatch({ type: "SELECT_SOURCE", source: source.toJS(), tabIndex, location }); await dispatch((0, _loadSourceText.loadSourceText)(source)); dispatch((0, _ast.setOutOfScopeLocations)()); const src = (0, _selectors.getSource)(getState(), location.sourceId); const { autoPrettyPrint } = _prefs.prefs; if (autoPrettyPrint && (0, _source2.shouldPrettyPrint)(src) && (0, _source2.isMinified)(src)) { await dispatch(togglePrettyPrint(src.get("id"))); } }; } /** * @memberof actions/sources * @static */ function jumpToMappedLocation(sourceLocation) { return async function ({ dispatch, getState, client, sourceMaps }) { if (!client) { return; } const source = (0, _selectors.getSource)(getState(), sourceLocation.sourceId); let pairedLocation; if ((0, _devtoolsSourceMap.isOriginalId)(sourceLocation.sourceId)) { pairedLocation = await (0, _sourceMaps.getGeneratedLocation)(getState(), source.toJS(), sourceLocation, sourceMaps); } else { pairedLocation = await sourceMaps.getOriginalLocation(sourceLocation, source.toJS()); } return dispatch(selectLocation(_extends({}, pairedLocation))); }; } function addTab(source, tabIndex) { return { type: "ADD_TAB", source, tabIndex }; } function moveTab(url, tabIndex) { return { type: "MOVE_TAB", url, tabIndex }; } /** * @memberof actions/sources * @static */ function closeTab(url) { return ({ dispatch, getState, client }) => { (0, _editor.removeDocument)(url); const tabs = (0, _selectors.removeSourceFromTabList)((0, _selectors.getSourceTabs)(getState()), url); const sourceId = (0, _selectors.getNewSelectedSourceId)(getState(), tabs); dispatch({ type: "CLOSE_TAB", url, tabs }); dispatch(selectSource(sourceId)); }; } /** * @memberof actions/sources * @static */ function closeTabs(urls) { return ({ dispatch, getState, client }) => { urls.forEach(url => { const source = (0, _selectors.getSourceByURL)(getState(), url); if (source) { (0, _editor.removeDocument)(source.get("id")); } }); const tabs = (0, _selectors.removeSourcesFromTabList)((0, _selectors.getSourceTabs)(getState()), urls); const sourceId = (0, _selectors.getNewSelectedSourceId)(getState(), tabs); dispatch({ type: "CLOSE_TABS", urls, tabs }); dispatch(selectSource(sourceId)); }; } /** * Toggle the pretty printing of a source's text. All subsequent calls to * |getText| will return the pretty-toggled text. Nothing will happen for * non-javascript files. * * @memberof actions/sources * @static * @param string id The source form from the RDP. * @returns Promise * A promise that resolves to [aSource, prettyText] or rejects to * [aSource, error]. */ function togglePrettyPrint(sourceId) { return async ({ dispatch, getState, client, sourceMaps }) => { const source = (0, _selectors.getSource)(getState(), sourceId); if (!source) { return {}; } if (!(0, _source2.isLoaded)(source)) { await dispatch((0, _loadSourceText.loadSourceText)(source)); } (0, _assert2.default)(sourceMaps.isGeneratedId(sourceId), "Pretty-printing only allowed on generated sources"); const selectedLocation = (0, _selectors.getSelectedLocation)(getState()); const url = (0, _source2.getPrettySourceURL)(source.get("url")); const prettySource = (0, _selectors.getSourceByURL)(getState(), url); const options = {}; if (selectedLocation) { options.location = await sourceMaps.getOriginalLocation(selectedLocation); } if (prettySource) { const _sourceId = prettySource.get("id"); return dispatch(selectLocation(_extends({}, options.location, { sourceId: _sourceId }))); } const newPrettySource = await dispatch((0, _createPrettySource.createPrettySource)(sourceId)); await dispatch((0, _breakpoints.remapBreakpoints)(sourceId)); await dispatch((0, _ast.setEmptyLines)(newPrettySource.id)); await dispatch((0, _ast.setSymbols)(newPrettySource.id)); return dispatch(selectLocation(_extends({}, options.location, { sourceId: newPrettySource.id }))); }; } function toggleBlackBox(source) { return async ({ dispatch, getState, client, sourceMaps }) => { const { isBlackBoxed, id } = source; return dispatch({ type: "BLACKBOX", source, [_promise.PROMISE]: client.blackBox(id, isBlackBoxed) }); }; } /** Load the text for all the available sources * @memberof actions/sources * @static */ function loadAllSources() { return async ({ dispatch, getState }) => { const sources = (0, _selectors.getSources)(getState()); const query = (0, _selectors.getTextSearchQuery)(getState()); for (const [, source] of sources) { if ((0, _source2.isThirdParty)(source)) { continue; } await dispatch((0, _loadSourceText.loadSourceText)(source)); // If there is a current search query we search // each of the source texts as they get loaded if (query) { await dispatch((0, _projectTextSearch.searchSource)(source.get("id"), query)); } } }; } /***/ }), /* 1374 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); __webpack_require__(1312); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ function CloseButton({ handleClick, buttonClass, tooltip }) { return _react2.default.createElement( "div", { className: buttonClass ? `close-btn ${buttonClass}` : "close-btn", onClick: handleClick, title: tooltip }, _react2.default.createElement("img", { className: "close" }) ); } exports.default = CloseButton; /***/ }), /* 1375 */, /* 1376 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const Menu = __webpack_require__(1464); const MenuItem = __webpack_require__(1466); const { PrefsHelper } = __webpack_require__(1467); const Services = __webpack_require__(22); const KeyShortcuts = __webpack_require__(1468); const { ZoomKeys } = __webpack_require__(1469); const EventEmitter = __webpack_require__(1382); module.exports = { KeyShortcuts, Menu, MenuItem, PrefsHelper, Services, ZoomKeys, EventEmitter }; /***/ }), /* 1377 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ /* vim: set ft=javascript ts=2 et sw=2 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/. */ const sidePanelItems = { Firefox: { name: "Firefox", clientType: "firefox", paramName: "firefox-tab", docsUrlPart: "firefox" }, Chrome: { name: "Chrome", clientType: "chrome", paramName: "chrome-tab", docsUrlPart: "chrome", isUnderConstruction: true }, Node: { name: "Node", clientType: "node", paramName: "node-tab", docsUrlPart: "node", isUnderConstruction: true }, Settings: { name: "Settings", clientType: "settings", paramName: "settings-tab", docsUrlPart: "settings" } }; module.exports = { CLEAR_TABS: "CLEAR_TABS", ADD_TABS: "ADD_TABS", SELECT_TAB: "SELECT_TAB", FILTER_TABS: "FILTER_TABS", SET_VALUE: "SET_VALUE", SET_CONFIG: "SET_CONFIG", sidePanelItems }; /***/ }), /* 1378 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ /** * Breakpoints reducer * @module reducers/breakpoints */ exports.initialState = initialState; exports.getBreakpoints = getBreakpoints; exports.getBreakpoint = getBreakpoint; exports.getBreakpointsDisabled = getBreakpointsDisabled; exports.getBreakpointsLoading = getBreakpointsLoading; exports.getBreakpointsForSource = getBreakpointsForSource; exports.getBreakpointForLine = getBreakpointForLine; exports.getHiddenBreakpoint = getHiddenBreakpoint; exports.getHiddenBreakpointLocation = getHiddenBreakpointLocation; var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); var _makeRecord = __webpack_require__(1361); var _makeRecord2 = _interopRequireDefault(_makeRecord); var _devtoolsSourceMap = __webpack_require__(1360); var _breakpoint = __webpack_require__(1364); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function initialState() { return (0, _makeRecord2.default)({ breakpoints: I.Map(), breakpointsDisabled: false })(); } function update(state = initialState(), action) { switch (action.type) { case "ADD_BREAKPOINT": { return addBreakpoint(state, action); } case "SYNC_BREAKPOINT": { return syncBreakpoint(state, action); } case "ENABLE_BREAKPOINT": { return addBreakpoint(state, action); } case "DISABLE_BREAKPOINT": { return updateBreakpoint(state, action); } case "SET_BREAKPOINT_CONDITION": { return updateBreakpoint(state, action); } case "REMOVE_BREAKPOINT": { return removeBreakpoint(state, action); } case "REMAP_BREAKPOINTS": { return remapBreakpoints(state, action); } } return state; } function addBreakpoint(state, action) { if (action.status === "start" && action.breakpoint) { const { breakpoint } = action; const locationId = (0, _breakpoint.makeLocationId)(breakpoint.location); return state.setIn(["breakpoints", locationId], breakpoint); } // when the action completes, we can commit the breakpoint if (action.status === "done") { return syncBreakpoint(state, action.value); } // Remove the optimistic update if (action.status === "error" && action.breakpoint) { const locationId = (0, _breakpoint.makeLocationId)(action.breakpoint.location); return state.deleteIn(["breakpoints", locationId]); } return state; } function syncBreakpoint(state, data) { const { breakpoint, previousLocation } = data; const locationId = (0, _breakpoint.makeLocationId)(breakpoint.location); if (previousLocation) { return state.deleteIn(["breakpoints", (0, _breakpoint.makeLocationId)(previousLocation)]).setIn(["breakpoints", locationId], breakpoint); } return state.setIn(["breakpoints", locationId], breakpoint); } function updateBreakpoint(state, action) { const { breakpoint } = action; const locationId = (0, _breakpoint.makeLocationId)(breakpoint.location); return state.setIn(["breakpoints", locationId], breakpoint); } function remapBreakpoints(state, action) { const breakpoints = action.breakpoints.reduce((updatedBreakpoints, breakpoint) => { const locationId = (0, _breakpoint.makeLocationId)(breakpoint.location); return _extends({}, updatedBreakpoints, { [locationId]: breakpoint }); }, {}); return state.set("breakpoints", I.Map(breakpoints)); } function removeBreakpoint(state, action) { const { breakpoint } = action; const id = (0, _breakpoint.makeLocationId)(breakpoint.location); return state.deleteIn(["breakpoints", id]); } // Selectors // TODO: these functions should be moved out of the reducer function getBreakpoints(state) { return state.breakpoints.breakpoints; } function getBreakpoint(state, location) { const breakpoints = getBreakpoints(state); return breakpoints.get((0, _breakpoint.makeLocationId)(location)); } function getBreakpointsDisabled(state) { return state.breakpoints.breakpoints.every(x => x.disabled); } function getBreakpointsLoading(state) { const breakpoints = getBreakpoints(state); const isLoading = !!breakpoints.valueSeq().filter(bp => bp.loading).first(); return breakpoints.size > 0 && isLoading; } function getBreakpointsForSource(state, sourceId) { if (!sourceId) { return I.Map(); } const isGeneratedSource = (0, _devtoolsSourceMap.isGeneratedId)(sourceId); const breakpoints = getBreakpoints(state); return breakpoints.filter(bp => { const location = isGeneratedSource ? bp.generatedLocation || bp.location : bp.location; return location.sourceId === sourceId; }); } function getBreakpointForLine(state, sourceId, line) { if (!sourceId) { return I.Map(); } const breakpoints = getBreakpointsForSource(state, sourceId); return breakpoints.find(breakpoint => breakpoint.location.line === line); } function getHiddenBreakpoint(state) { return getBreakpoints(state).valueSeq().filter(breakpoint => breakpoint.hidden).first(); } function getHiddenBreakpointLocation(state) { const hiddenBreakpoint = getHiddenBreakpoint(state); if (!hiddenBreakpoint) { return null; } return hiddenBreakpoint.location; } exports.default = update; /***/ }), /* 1379 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _devtoolsConfig = __webpack_require__(1355); var _Svg = __webpack_require__(1359); var _Svg2 = _interopRequireDefault(_Svg); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _Close = __webpack_require__(1374); var _Close2 = _interopRequireDefault(_Close); __webpack_require__(1313); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ const arrowBtn = (onClick, type, className, tooltip) => { const props = { onClick, type, className, title: tooltip, key: type }; return _react2.default.createElement( "button", props, _react2.default.createElement(_Svg2.default, { name: type }) ); }; class SearchInput extends _react.Component { componentDidMount() { this.$input.focus(); if (this.$input.value != "") { this.$input.setSelectionRange(this.$input.value.length + 1, this.$input.value.length + 1); } } componentDidUpdate() { this.$input.focus(); if (this.$input.value != "") { this.$input.setSelectionRange(this.$input.value.length + 1, this.$input.value.length + 1); } } shouldShowErrorEmoji() { const { count, query, showErrorEmoji } = this.props; return count === 0 && query.trim() !== "" && !showErrorEmoji; } renderSvg() { if (this.shouldShowErrorEmoji()) { return _react2.default.createElement(_Svg2.default, { name: "sad-face" }); } return _react2.default.createElement(_Svg2.default, { name: "magnifying-glass" }); } renderArrowButtons() { const { handleNext, handlePrev } = this.props; return [arrowBtn(handleNext, "arrow-down", (0, _classnames2.default)("nav-btn", "next"), L10N.getFormatStr("editor.searchResults.nextResult")), arrowBtn(handlePrev, "arrow-up", (0, _classnames2.default)("nav-btn", "prev"), L10N.getFormatStr("editor.searchResults.prevResult"))]; } renderNav() { if (!(0, _devtoolsConfig.isEnabled)("searchNav")) { return; } const { count, handleNext, handlePrev } = this.props; if (!handleNext && !handlePrev || !count || count == 1) { return; } return _react2.default.createElement( "div", { className: "search-nav-buttons" }, this.renderArrowButtons() ); } render() { const { query, placeholder, summaryMsg, onChange, onKeyDown, onKeyUp, onFocus, onBlur, handleClose, size } = this.props; const inputProps = { className: (0, _classnames2.default)({ empty: this.shouldShowErrorEmoji() }), onChange, onKeyDown, onKeyUp, onFocus, onBlur, placeholder, value: query, spellCheck: false, ref: c => this.$input = c }; return _react2.default.createElement( "div", { className: (0, _classnames2.default)("search-field", size) }, this.renderSvg(), _react2.default.createElement("input", inputProps), _react2.default.createElement( "div", { className: "summary" }, summaryMsg || "" ), this.renderNav(), _react2.default.createElement(_Close2.default, { handleClick: handleClose, buttonClass: size }) ); } } SearchInput.defaultProps = { size: "", showErrorEmoji: true }; exports.default = SearchInput; /***/ }), /* 1380 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ exports.getLibraryFromUrl = getLibraryFromUrl; exports.annotateFrame = annotateFrame; exports.simplifyDisplayName = simplifyDisplayName; exports.formatDisplayName = formatDisplayName; exports.formatCopyName = formatCopyName; exports.collapseFrames = collapseFrames; var _lodash = __webpack_require__(2); var _devtoolsConfig = __webpack_require__(1355); var _utils = __webpack_require__(1366); var _source = __webpack_require__(1356); function getFrameUrl(frame) { return (0, _lodash.get)(frame, "source.url", "") || ""; } const libraryMap = [{ label: "Backbone", pattern: /backbone/i }, { label: "jQuery", pattern: /jquery/i }, { label: "Preact", pattern: /preact/i }, { label: "React", pattern: /react/i }, { label: "Immutable", pattern: /immutable/i }, { label: "Webpack", pattern: /webpack\/bootstrap/i }, { label: "Node", pattern: /(^internal\/|^[^.\/]+\.js)/ }, { label: "Express", pattern: /node_modules\/express/ }, { label: "Pug", pattern: /node_modules\/pug/ }, { label: "ExtJS", pattern: /\/ext-all[\.\-]/ }, { label: "MobX", pattern: /mobx/i }, { label: "Underscore", pattern: /underscore/i }, { label: "Lodash", pattern: /lodash/i }, { label: "Ember", pattern: /ember/i }, { label: "Choo", pattern: /choo/i }, { label: "VueJS", pattern: /vue\.js/i }, { label: "RxJS", pattern: /rxjs/i }, { label: "Angular", pattern: /angular/i }, { label: "Redux", pattern: /redux/i }, { label: "Dojo", pattern: /dojo/i }, { label: "Marko", pattern: /marko/i }, { label: "NuxtJS", pattern: /[\._]nuxt/i }, { label: "Aframe", pattern: /aframe/i }, { label: "NextJS", pattern: /[\._]next/i }]; function getLibraryFromUrl(frame) { // @TODO each of these fns calls getFrameUrl, just call it once // (assuming there's not more complex logic to identify a lib) const frameUrl = getFrameUrl(frame); const match = (0, _lodash.find)(libraryMap, o => frameUrl.match(o.pattern)); return match && match.label; } const displayNameMap = { Backbone: { "extend/child": "Create Class", ".create": "Create Model" }, jQuery: { "jQuery.event.dispatch": "Dispatch Event" }, React: { // eslint-disable-next-line max-len "ReactCompositeComponent._renderValidatedComponentWithoutOwnerOrContext/renderedElement<": "Render", _renderValidatedComponentWithoutOwnerOrContext: "Render" }, VueJS: { "renderMixin/Vue.prototype._render": "Render" }, Webpack: { // eslint-disable-next-line camelcase __webpack_require__: "Bootstrap" } }; function mapDisplayNames(frame, library) { const map = displayNameMap[library]; const { displayName } = frame; return map && map[displayName] || displayName; } function annotateFrame(frame) { if (!(0, _devtoolsConfig.isEnabled)("collapseFrame")) { return frame; } const library = getLibraryFromUrl(frame); if (library) { return _extends({}, frame, { library }); } return frame; } // Decodes an anonymous naming scheme that // spider monkey implements based on "Naming Anonymous JavaScript Functions" // http://johnjbarton.github.io/nonymous/index.html const objectProperty = /([\w\d]+)$/; const arrayProperty = /\[(.*?)\]$/; const functionProperty = /([\w\d]+)[\/\.<]*?$/; const annonymousProperty = /([\w\d]+)\(\^\)$/; function simplifyDisplayName(displayName) { // if the display name has a space it has already been mapped if (/\s/.exec(displayName)) { return displayName; } const scenarios = [objectProperty, arrayProperty, functionProperty, annonymousProperty]; for (const reg of scenarios) { const match = reg.exec(displayName); if (match) { return match[1]; } } return displayName; } function formatDisplayName(frame, { shouldMapDisplayName = true } = {}) { let { displayName, library } = frame; if (library && shouldMapDisplayName) { displayName = mapDisplayNames(frame, library); } displayName = simplifyDisplayName(displayName); return (0, _utils.endTruncateStr)(displayName, 25); } function formatCopyName(frame) { const displayName = formatDisplayName(frame); const fileName = (0, _source.getFilename)(frame.source); const frameLocation = frame.location.line; return `${displayName} (${fileName}#${frameLocation})`; } function collapseFrames(frames) { // We collapse groups of one so that user frames // are not in a group of one function addGroupToList(group, list) { if (!group) { return list; } if (group.length > 1) { list.push(group); } else { list = list.concat(group); } return list; } const { newFrames, lastGroup } = collapseLastFrames(frames); frames = newFrames; let items = []; let currentGroup = null; let prevItem = null; for (const frame of frames) { const prevLibrary = (0, _lodash.get)(prevItem, "library"); if (!currentGroup) { currentGroup = [frame]; } else if (prevLibrary && prevLibrary == frame.library) { currentGroup.push(frame); } else { items = addGroupToList(currentGroup, items); currentGroup = [frame]; } prevItem = frame; } items = addGroupToList(currentGroup, items); items = addGroupToList(lastGroup, items); return items; } function collapseLastFrames(frames) { const index = (0, _lodash.findIndex)(frames, frame => getFrameUrl(frame).match(/webpack\/bootstrap/i)); if (index == -1) { return { newFrames: frames, lastGroup: [] }; } const newFrames = frames.slice(0, index); const lastGroup = frames.slice(index); return { newFrames, lastGroup }; } /***/ }), /* 1381 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // Dependencies const React = __webpack_require__(0); const { maybeEscapePropertyName, wrapRender } = __webpack_require__(1353); const { MODE } = __webpack_require__(1357); // Shortcuts const { span } = React.DOM; /** * Property for Obj (local JS objects), Grip (remote JS objects) * and GripMap (remote JS maps and weakmaps) reps. * It's used to render object properties. */ PropRep.propTypes = { // Property name. name: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.object]).isRequired, // Equal character rendered between property name and value. equal: React.PropTypes.string, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func, // Normally a PropRep will quote a property name that isn't valid // when unquoted; but this flag can be used to suppress the // quoting. suppressQuotes: React.PropTypes.bool }; /** * Function that given a name, a delimiter and an object returns an array * of React elements representing an object property (e.g. `name: value`) * * @param {Object} props * @return {Array} Array of React elements. */ function PropRep(props) { const Grip = __webpack_require__(1409); const { Rep } = __webpack_require__(1372); let { name, mode, equal, suppressQuotes } = props; let key; // The key can be a simple string, for plain objects, // or another object for maps and weakmaps. if (typeof name === "string") { if (!suppressQuotes) { name = maybeEscapePropertyName(name); } key = span({ "className": "nodeName" }, name); } else { key = Rep(Object.assign({}, props, { className: "nodeName", object: name, mode: mode || MODE.TINY, defaultRep: Grip })); } return [key, span({ "className": "objectEqual" }, equal), Rep(Object.assign({}, props))]; } // Exports from this module module.exports = wrapRender(PropRep); /***/ }), /* 1382 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ var EventEmitter = function EventEmitter() {}; module.exports = EventEmitter; const promise = __webpack_require__(1465); /** * Decorate an object with event emitter functionality. * * @param Object aObjectToDecorate * Bind all public methods of EventEmitter to * the aObjectToDecorate object. */ EventEmitter.decorate = function EventEmitter_decorate(aObjectToDecorate) { let emitter = new EventEmitter(); aObjectToDecorate.on = emitter.on.bind(emitter); aObjectToDecorate.off = emitter.off.bind(emitter); aObjectToDecorate.once = emitter.once.bind(emitter); aObjectToDecorate.emit = emitter.emit.bind(emitter); }; EventEmitter.prototype = { /** * Connect a listener. * * @param string aEvent * The event name to which we're connecting. * @param function aListener * Called when the event is fired. */ on: function EventEmitter_on(aEvent, aListener) { if (!this._eventEmitterListeners) this._eventEmitterListeners = new Map(); if (!this._eventEmitterListeners.has(aEvent)) { this._eventEmitterListeners.set(aEvent, []); } this._eventEmitterListeners.get(aEvent).push(aListener); }, /** * Listen for the next time an event is fired. * * @param string aEvent * The event name to which we're connecting. * @param function aListener * (Optional) Called when the event is fired. Will be called at most * one time. * @return promise * A promise which is resolved when the event next happens. The * resolution value of the promise is the first event argument. If * you need access to second or subsequent event arguments (it's rare * that this is needed) then use aListener */ once: function EventEmitter_once(aEvent, aListener) { let deferred = promise.defer(); let handler = (aEvent, aFirstArg, ...aRest) => { this.off(aEvent, handler); if (aListener) { aListener.apply(null, [aEvent, aFirstArg, ...aRest]); } deferred.resolve(aFirstArg); }; handler._originalListener = aListener; this.on(aEvent, handler); return deferred.promise; }, /** * Remove a previously-registered event listener. Works for events * registered with either on or once. * * @param string aEvent * The event name whose listener we're disconnecting. * @param function aListener * The listener to remove. */ off: function EventEmitter_off(aEvent, aListener) { if (!this._eventEmitterListeners) return; let listeners = this._eventEmitterListeners.get(aEvent); if (listeners) { this._eventEmitterListeners.set(aEvent, listeners.filter(l => { return l !== aListener && l._originalListener !== aListener; })); } }, /** * Emit an event. All arguments to this method will * be sent to listener functions. */ emit: function EventEmitter_emit(aEvent) { if (!this._eventEmitterListeners || !this._eventEmitterListeners.has(aEvent)) { return; } let originalListeners = this._eventEmitterListeners.get(aEvent); for (let listener of this._eventEmitterListeners.get(aEvent)) { // If the object was destroyed during event emission, stop // emitting. if (!this._eventEmitterListeners) { break; } // If listeners were removed during emission, make sure the // event handler we're going to fire wasn't removed. if (originalListeners === this._eventEmitterListeners.get(aEvent) || this._eventEmitterListeners.get(aEvent).some(l => l === listener)) { try { listener.apply(null, arguments); } catch (ex) { // Prevent a bad listener from interfering with the others. let msg = ex + ": " + ex.stack; //console.error(msg); console.log(msg); } } } } }; /***/ }), /* 1383 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.initialState = initialState; exports.getSymbols = getSymbols; exports.hasSymbols = hasSymbols; exports.isEmptyLineInSource = isEmptyLineInSource; exports.getEmptyLines = getEmptyLines; exports.getOutOfScopeLocations = getOutOfScopeLocations; exports.getPreview = getPreview; exports.getSourceMetaData = getSourceMetaData; exports.getInScopeLines = getInScopeLines; var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); var _makeRecord = __webpack_require__(1361); var _makeRecord2 = _interopRequireDefault(_makeRecord); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } /* 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 . */ /** * Ast reducer * @module reducers/ast */ function initialState() { return (0, _makeRecord2.default)({ symbols: I.Map(), emptyLines: I.Map(), outOfScopeLocations: null, inScopeLines: null, preview: null, sourceMetaData: I.Map() })(); } function update(state = initialState(), action) { switch (action.type) { case "SET_SYMBOLS": { const { source, symbols } = action; return state.setIn(["symbols", source.id], symbols); } case "SET_EMPTY_LINES": { const { source, emptyLines } = action; return state.setIn(["emptyLines", source.id], emptyLines); } case "OUT_OF_SCOPE_LOCATIONS": { return state.set("outOfScopeLocations", action.locations); } case "IN_SCOPE_LINES": { return state.set("inScopeLines", action.lines); } case "CLEAR_SELECTION": { return state.set("preview", null); } case "SET_PREVIEW": { if (action.status == "start") { return state.set("preview", { updating: true }); } if (!action.value) { return state.set("preview", null); } const { expression, location, result, tokenPos, cursorPos, extra } = action.value; return state.set("preview", { updating: false, expression, location, result, tokenPos, cursorPos, extra }); } case "RESUME": { return state.set("outOfScopeLocations", null); } case "NAVIGATE": { return initialState(); } case "SET_SOURCE_METADATA": { return state.setIn(["sourceMetaData", action.sourceId], action.sourceMetaData); } default: { return state; } } } // NOTE: we'd like to have the app state fully typed // https://github.com/devtools-html/debugger.html/blob/master/src/reducers/sources.js#L179-L185 const emptySymbols = { variables: [], functions: [] }; function getSymbols(state, source) { if (!source) { return emptySymbols; } const symbols = state.ast.getIn(["symbols", source.id]); return symbols || emptySymbols; } function hasSymbols(state, source) { if (!source) { return false; } return !!state.ast.getIn(["symbols", source.id]); } function isEmptyLineInSource(state, line, selectedSource) { const emptyLines = getEmptyLines(state, selectedSource); return emptyLines.includes(line); } function getEmptyLines(state, source) { if (!source) { return []; } return state.ast.getIn(["emptyLines", source.id]) || []; } function getOutOfScopeLocations(state) { return state.ast.get("outOfScopeLocations"); } function getPreview(state) { return state.ast.get("preview"); } const emptySourceMetaData = {}; function getSourceMetaData(state, sourceId) { return state.ast.getIn(["sourceMetaData", sourceId]) || emptySourceMetaData; } function getInScopeLines(state, sourceId) { return state.ast.get("inScopeLines"); } exports.default = update; /***/ }), /* 1384 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = assert; var _devtoolsConfig = __webpack_require__(1355); function assert(condition, message) { if ((0, _devtoolsConfig.isDevelopment)() && !condition) { throw new Error(`Assertion failure: ${message}`); } } /* 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 . */ /***/ }), /* 1385 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setContextMenu = setContextMenu; exports.setPrimaryPaneTab = setPrimaryPaneTab; exports.closeActiveSearch = closeActiveSearch; exports.setActiveSearch = setActiveSearch; exports.toggleFrameworkGrouping = toggleFrameworkGrouping; exports.showSource = showSource; exports.togglePaneCollapse = togglePaneCollapse; exports.highlightLineRange = highlightLineRange; exports.flashLineRange = flashLineRange; exports.clearHighlightLineRange = clearHighlightLineRange; exports.openConditionalPanel = openConditionalPanel; exports.closeConditionalPanel = closeConditionalPanel; exports.setProjectDirectoryRoot = setProjectDirectoryRoot; exports.setOrientation = setOrientation; var _selectors = __webpack_require__(1352); function setContextMenu(type, event) { return ({ dispatch }) => { dispatch({ type: "SET_CONTEXT_MENU", contextMenu: { type, event } }); }; } /* 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 . */ function setPrimaryPaneTab(tabName) { return { type: "SET_PRIMARY_PANE_TAB", tabName }; } function closeActiveSearch() { return { type: "TOGGLE_ACTIVE_SEARCH", value: null }; } function setActiveSearch(activeSearch) { return ({ dispatch, getState }) => { const activeSearchState = (0, _selectors.getActiveSearch)(getState()); if (activeSearchState === activeSearch) { return; } dispatch({ type: "TOGGLE_ACTIVE_SEARCH", value: activeSearch }); }; } function toggleFrameworkGrouping(toggleValue) { return ({ dispatch, getState }) => { dispatch({ type: "TOGGLE_FRAMEWORK_GROUPING", value: toggleValue }); }; } function showSource(sourceId) { return ({ dispatch, getState }) => { const source = (0, _selectors.getSource)(getState(), sourceId); dispatch(setPrimaryPaneTab("sources")); dispatch({ type: "SHOW_SOURCE", sourceUrl: "" }); dispatch({ type: "SHOW_SOURCE", sourceUrl: source.get("url") }); }; } function togglePaneCollapse(position, paneCollapsed) { return ({ dispatch, getState }) => { const prevPaneCollapse = (0, _selectors.getPaneCollapse)(getState(), position); if (prevPaneCollapse === paneCollapsed) { return; } dispatch({ type: "TOGGLE_PANE", position, paneCollapsed }); }; } /** * @memberof actions/sources * @static */ function highlightLineRange(location) { return { type: "HIGHLIGHT_LINES", location }; } function flashLineRange(location) { return ({ dispatch }) => { dispatch(highlightLineRange(location)); setTimeout(() => dispatch(clearHighlightLineRange()), 200); }; } /** * @memberof actions/sources * @static */ function clearHighlightLineRange() { return { type: "CLEAR_HIGHLIGHT_LINES" }; } function openConditionalPanel(line) { if (!line) { return; } return { type: "OPEN_CONDITIONAL_PANEL", line }; } function closeConditionalPanel() { return { type: "CLOSE_CONDITIONAL_PANEL" }; } function setProjectDirectoryRoot(url) { return { type: "SET_PROJECT_DIRECTORY_ROOT", url }; } function setOrientation(orientation) { return { type: "SET_ORIENTATION", orientation }; } /***/ }), /* 1386 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const SourceEditor = __webpack_require__(197); const SourceEditorUtils = __webpack_require__(1524); module.exports = { SourceEditor, SourceEditorUtils }; /***/ }), /* 1387 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formatKeyShortcut = undefined; var _devtoolsModules = __webpack_require__(1376); const { appinfo } = _devtoolsModules.Services; /* 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 . */ /** * Utils for keyboard command strings * @module utils/text */ const isMacOS = appinfo.OS === "Darwin"; /** * Formats key for use in tooltips * For macOS we use the following unicode * * cmd ⌘ = \u2318 * shift ⇧ – \u21E7 * option (alt) ⌥ \u2325 * * For Win/Lin this replaces CommandOrControl or CmdOrCtrl with Ctrl * * @memberof utils/text * @static */ function formatKeyShortcut(shortcut) { if (isMacOS) { return shortcut.replace(/Shift\+/g, "\u21E7 ").replace(/Command\+|Cmd\+/g, "\u2318 ").replace(/CommandOrControl\+|CmdOrCtrl\+/g, "\u2318 ").replace(/Alt\+/g, "\u2325 "); } return shortcut.replace(/CommandOrControl\+|CmdOrCtrl\+/g, `${L10N.getStr("ctrl")} `).replace(/Shift\+/g, "Shift "); } exports.formatKeyShortcut = formatKeyShortcut; /***/ }), /* 1388 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /* 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 . */ /** * Clipboard function taken from * https://dxr.mozilla.org/mozilla-central/source/devtools/shared/platform/content/clipboard.js */ function copyToTheClipboard(string) { const doCopy = function (e) { e.clipboardData.setData("text/plain", string); e.preventDefault(); }; document.addEventListener("copy", doCopy); document.execCommand("copy", false, null); document.removeEventListener("copy", doCopy); } exports.copyToTheClipboard = copyToTheClipboard; /***/ }), /* 1389 */ /***/ (function(module, exports, __webpack_require__) { /* 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/. */ const md5 = __webpack_require__(248); function originalToGeneratedId(originalId) { const match = originalId.match(/(.*)\/originalSource/); return match ? match[1] : ""; } function generatedToOriginalId(generatedId, url) { return `${generatedId}/originalSource-${md5(url)}`; } function isOriginalId(id) { return !!id.match(/\/originalSource/); } function isGeneratedId(id) { return !isOriginalId(id); } /** * Trims the query part or reference identifier of a URL string, if necessary. */ function trimUrlQuery(url) { let length = url.length; let q1 = url.indexOf("?"); let q2 = url.indexOf("&"); let q3 = url.indexOf("#"); let q = Math.min(q1 != -1 ? q1 : length, q2 != -1 ? q2 : length, q3 != -1 ? q3 : length); return url.slice(0, q); } // Map suffix to content type. const contentMap = { "js": "text/javascript", "jsm": "text/javascript", "ts": "text/typescript", "tsx": "text/typescript-jsx", "jsx": "text/jsx", "coffee": "text/coffeescript", "elm": "text/elm", "cljs": "text/x-clojure" }; /** * Returns the content type for the specified URL. If no specific * content type can be determined, "text/plain" is returned. * * @return String * The content type. */ function getContentType(url) { url = trimUrlQuery(url); let dot = url.lastIndexOf("."); if (dot >= 0) { let name = url.substring(dot + 1); if (name in contentMap) { return contentMap[name]; } } return "text/plain"; } module.exports = { originalToGeneratedId, generatedToOriginalId, isOriginalId, isGeneratedId, getContentType, contentMapForTesting: contentMap }; /***/ }), /* 1390 */ /***/ (function(module, exports, __webpack_require__) { /* 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/. */ const networkRequest = __webpack_require__(1391); const workerUtils = __webpack_require__(1392); module.exports = { networkRequest, workerUtils }; /***/ }), /* 1391 */ /***/ (function(module, exports) { /* 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/. */ function networkRequest(url, opts) { return fetch(url, { cache: opts.loadFromCache ? "default" : "no-cache" }).then(res => { if (res.status >= 200 && res.status < 300) { return res.text().then(text => ({ content: text })); } return Promise.reject(`request failed with status ${res.status}`); }); } module.exports = networkRequest; /***/ }), /* 1392 */ /***/ (function(module, exports) { 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 WorkerDispatcher() { this.msgId = 1; this.worker = null; } /* 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/. */ WorkerDispatcher.prototype = { start(url) { this.worker = new Worker(url); this.worker.onerror = () => { console.error(`Error in worker ${url}`); }; }, stop() { if (!this.worker) { return; } this.worker.terminate(); this.worker = null; }, task(method) { return (...args) => { return new Promise((resolve, reject) => { const id = this.msgId++; this.worker.postMessage({ id, method, args }); const listener = ({ data: result }) => { if (result.id !== id) { return; } if (!this.worker) { reject("Oops, The worker has shutdown!"); return; } this.worker.removeEventListener("message", listener); if (result.error) { reject(result.error); } else { resolve(result.response); } }; this.worker.addEventListener("message", listener); }); }; } }; function workerHandler(publicInterface) { return function (msg) { const { id, method, args } = msg.data; try { const response = publicInterface[method].apply(undefined, args); if (response instanceof Promise) { response.then(val => self.postMessage({ id, response: val }), // Error can't be sent via postMessage, so be sure to // convert to string. err => self.postMessage({ id, error: err.toString() })); } else { self.postMessage({ id, response }); } } catch (error) { // Error can't be sent via postMessage, so be sure to convert to // string. self.postMessage({ id, error: error.toString() }); } }; } function streamingWorkerHandler(publicInterface, { timeout = 100 } = {}, worker = self) { let streamingWorker = (() => { var _ref = _asyncToGenerator(function* (id, tasks) { let isWorking = true; const intervalId = setTimeout(function () { isWorking = false; }, timeout); const results = []; while (tasks.length !== 0 && isWorking) { const { callback, context, args } = tasks.shift(); const result = yield callback.call(context, args); results.push(result); } worker.postMessage({ id, status: "pending", data: results }); clearInterval(intervalId); if (tasks.length !== 0) { yield streamingWorker(id, tasks); } }); return function streamingWorker(_x, _x2) { return _ref.apply(this, arguments); }; })(); return (() => { var _ref2 = _asyncToGenerator(function* (msg) { const { id, method, args } = msg.data; const workerMethod = publicInterface[method]; if (!workerMethod) { console.error(`Could not find ${method} defined in worker.`); } worker.postMessage({ id, status: "start" }); try { const tasks = workerMethod(args); yield streamingWorker(id, tasks); worker.postMessage({ id, status: "done" }); } catch (error) { worker.postMessage({ id, status: "error", error }); } }); return function (_x3) { return _ref2.apply(this, arguments); }; })(); } module.exports = { WorkerDispatcher, workerHandler, streamingWorkerHandler }; /***/ }), /* 1393 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /* 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 . */ function basename(path) { return path.split("/").pop(); } function dirname(path) { const idx = path.lastIndexOf("/"); return path.slice(0, idx); } function isURL(str) { return str.indexOf("://") !== -1; } function isAbsolute(str) { return str[0] === "/"; } function join(base, dir) { return `${base}/${dir}`; } exports.basename = basename; exports.dirname = dirname; exports.isURL = isURL; exports.isAbsolute = isAbsolute; exports.join = join; /***/ }), /* 1394 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSelectedFrame = exports.getLoadedObjects = exports.getPause = exports.State = undefined; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ /* eslint complexity: ["error", 30]*/ /** * Pause reducer * @module reducers/pause */ exports.getPauseReason = getPauseReason; exports.isStepping = isStepping; exports.isPaused = isPaused; exports.isEvaluatingExpression = isEvaluatingExpression; exports.getLoadedObject = getLoadedObject; exports.hasLoadingObjects = hasLoadingObjects; exports.getObjectProperties = getObjectProperties; exports.getIsWaitingOnBreak = getIsWaitingOnBreak; exports.getShouldPauseOnExceptions = getShouldPauseOnExceptions; exports.getShouldIgnoreCaughtExceptions = getShouldIgnoreCaughtExceptions; exports.getFrames = getFrames; exports.getFrameScope = getFrameScope; exports.getSelectedScope = getSelectedScope; exports.getScopes = getScopes; exports.getSelectedFrameId = getSelectedFrameId; exports.getDebuggeeUrl = getDebuggeeUrl; exports.getChromeScopes = getChromeScopes; var _reselect = __webpack_require__(993); var _prefs = __webpack_require__(226); var _lodash = __webpack_require__(2); const State = exports.State = () => ({ pause: undefined, why: null, isWaitingOnBreak: false, frames: undefined, selectedFrameId: undefined, frameScopes: {}, loadedObjects: {}, shouldPauseOnExceptions: _prefs.prefs.pauseOnExceptions, shouldIgnoreCaughtExceptions: _prefs.prefs.ignoreCaughtExceptions, debuggeeUrl: "", command: "" }); const emptyPauseState = { pause: null, frames: null, frameScopes: {}, selectedFrameId: null, loadedObjects: {} }; function update(state = State(), action) { switch (action.type) { case "PAUSED": { const { selectedFrameId, frames, loadedObjects, pauseInfo } = action; const { why } = pauseInfo; pauseInfo.isInterrupted = pauseInfo.why.type === "interrupted"; // turn this into an object keyed by object id const objectMap = {}; loadedObjects.forEach(obj => { objectMap[obj.value.objectId] = obj; }); return _extends({}, state, { isWaitingOnBreak: false, pause: pauseInfo, selectedFrameId, frames, frameScopes: {}, loadedObjects: objectMap, why }); } case "ADD_SCOPES": case "MAP_SCOPES": const { frame, scopes } = action; const selectedFrameId = frame.id; const frameScopes = _extends({}, state.frameScopes, { [selectedFrameId]: scopes }); return _extends({}, state, { frameScopes }); case "BREAK_ON_NEXT": return _extends({}, state, { isWaitingOnBreak: true }); case "SELECT_FRAME": return _extends({}, state, { selectedFrameId: action.frame.id }); case "LOAD_OBJECT_PROPERTIES": if (action.status === "start") { return _extends({}, state, { loadedObjects: _extends({}, state.loadedObjects, { [action.objectId]: {} }) }); } if (action.status === "done") { if (!action.value) { return _extends({}, state); } const ownProperties = action.value.ownProperties; const ownSymbols = action.value.ownSymbols || []; const prototype = action.value.prototype; return _extends({}, state, { loadedObjects: _extends({}, state.loadedObjects, { [action.objectId]: { ownProperties, prototype, ownSymbols } }) }); } break; case "CONNECT": return _extends({}, State(), { debuggeeUrl: action.url }); case "PAUSE_ON_EXCEPTIONS": const { shouldPauseOnExceptions, shouldIgnoreCaughtExceptions } = action; _prefs.prefs.pauseOnExceptions = shouldPauseOnExceptions; _prefs.prefs.ignoreCaughtExceptions = shouldIgnoreCaughtExceptions; return _extends({}, state, { shouldPauseOnExceptions, shouldIgnoreCaughtExceptions }); case "COMMAND": return action.status === "start" ? _extends({}, state, emptyPauseState, { command: action.command }) : _extends({}, state, { command: "" }); case "RESUME": // We clear why on resume because we need it to decide if // we shoul re-evaluate watch expressions. return _extends({}, state, { why: null }); case "EVALUATE_EXPRESSION": return _extends({}, state, { command: action.status === "start" ? "expression" : "" }); case "NAVIGATE": return _extends({}, state, emptyPauseState, { debuggeeUrl: action.url }); } return state; } // Selectors // Unfortunately, it's really hard to make these functions accept just // the state that we care about and still type it with Flow. The // problem is that we want to re-export all selectors from a single // module for the UI, and all of those selectors should take the // top-level app state, so we'd have to "wrap" them to automatically // pick off the piece of state we're interested in. It's impossible // (right now) to type those wrapped functions. const getPauseState = state => state.pause; const getPause = exports.getPause = (0, _reselect.createSelector)(getPauseState, pauseWrapper => pauseWrapper.pause); const getLoadedObjects = exports.getLoadedObjects = (0, _reselect.createSelector)(getPauseState, pauseWrapper => pauseWrapper.loadedObjects); function getPauseReason(state) { return state.pause.why; } function isStepping(state) { return ["stepIn", "stepOver", "stepOut"].includes(state.pause.command); } function isPaused(state) { return !!getPause(state); } function isEvaluatingExpression(state) { return state.pause.command === "expression"; } function getLoadedObject(state, objectId) { return getLoadedObjects(state)[objectId]; } function hasLoadingObjects(state) { const objects = getLoadedObjects(state); return Object.values(objects).some(_lodash.isEmpty); } function getObjectProperties(state, parentId) { return getLoadedObjects(state).filter(obj => obj.parentId == parentId); } function getIsWaitingOnBreak(state) { return state.pause.isWaitingOnBreak; } function getShouldPauseOnExceptions(state) { return state.pause.shouldPauseOnExceptions; } function getShouldIgnoreCaughtExceptions(state) { return state.pause.shouldIgnoreCaughtExceptions; } function getFrames(state) { return state.pause.frames; } function getFrameScope(state, frameId) { if (!frameId) { return null; } return state.pause.frameScopes[frameId]; } function getSelectedScope(state) { const frameId = getSelectedFrameId(state); return getFrameScope(state, frameId); } function getScopes(state) { const selectedFrameId = getSelectedFrameId(state); return state.pause.frameScopes[selectedFrameId]; } function getSelectedFrameId(state) { return state.pause.selectedFrameId; } const getSelectedFrame = exports.getSelectedFrame = (0, _reselect.createSelector)(getSelectedFrameId, getFrames, (selectedFrameId, frames) => { if (!frames) { return null; } return frames.find(frame => frame.id == selectedFrameId); }); function getDebuggeeUrl(state) { return state.pause.debuggeeUrl; } // NOTE: currently only used for chrome function getChromeScopes(state) { const frame = getSelectedFrame(state); return frame ? frame.scopeChain : undefined; } exports.default = update; /***/ }), /* 1395 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.findSourceMatches = exports.searchSources = exports.getMatches = exports.stopSearchWorker = exports.startSearchWorker = undefined; var _devtoolsUtils = __webpack_require__(1363); const { WorkerDispatcher } = _devtoolsUtils.workerUtils; /* 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 . */ const dispatcher = new WorkerDispatcher(); const startSearchWorker = exports.startSearchWorker = dispatcher.start.bind(dispatcher); const stopSearchWorker = exports.stopSearchWorker = dispatcher.stop.bind(dispatcher); const getMatches = exports.getMatches = dispatcher.task("getMatches"); const searchSources = exports.searchSources = dispatcher.task("searchSources"); const findSourceMatches = exports.findSourceMatches = dispatcher.task("findSourceMatches"); /***/ }), /* 1396 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ /** * Redux actions for breakpoints * @module actions/breakpoints */ // this will need to be changed so that addCLientBreakpoint is removed exports.syncBreakpoint = syncBreakpoint; exports.addBreakpoint = addBreakpoint; exports.addHiddenBreakpoint = addHiddenBreakpoint; exports.removeBreakpoint = removeBreakpoint; exports.enableBreakpoint = enableBreakpoint; exports.disableBreakpoint = disableBreakpoint; exports.toggleAllBreakpoints = toggleAllBreakpoints; exports.toggleBreakpoints = toggleBreakpoints; exports.removeAllBreakpoints = removeAllBreakpoints; exports.removeBreakpoints = removeBreakpoints; exports.remapBreakpoints = remapBreakpoints; exports.setBreakpointCondition = setBreakpointCondition; exports.toggleBreakpoint = toggleBreakpoint; exports.addOrToggleDisabledBreakpoint = addOrToggleDisabledBreakpoint; exports.toggleDisabledBreakpoint = toggleDisabledBreakpoint; var _promise = __webpack_require__(1653); var _selectors = __webpack_require__(1352); var _breakpoint = __webpack_require__(1364); var _addBreakpoint = __webpack_require__(1519); var _addBreakpoint2 = _interopRequireDefault(_addBreakpoint); var _remapLocations = __webpack_require__(1520); var _remapLocations2 = _interopRequireDefault(_remapLocations); var _ast = __webpack_require__(1383); var _syncBreakpoint = __webpack_require__(1521); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Syncing a breakpoint add breakpoint information that is stored, and * contact the server for more data. * * @memberof actions/breakpoints * @static * @param {String} $1.sourceId String value * @param {PendingBreakpoint} $1.location PendingBreakpoint value */ function syncBreakpoint(sourceId, pendingBreakpoint) { return async ({ dispatch, getState, client, sourceMaps }) => { const { breakpoint, previousLocation } = await (0, _syncBreakpoint.syncClientBreakpoint)(getState, client, sourceMaps, sourceId, pendingBreakpoint); return dispatch({ type: "SYNC_BREAKPOINT", breakpoint, previousLocation }); }; } /** * Add a new breakpoint * * @memberof actions/breakpoints * @static * @param {String} $1.condition Conditional breakpoint condition value * @param {Boolean} $1.disabled Disable value for breakpoint value */ function addBreakpoint(location, { condition, hidden } = {}) { const breakpoint = (0, _breakpoint.createBreakpoint)(location, { condition, hidden }); return ({ dispatch, getState, sourceMaps, client }) => { const action = { type: "ADD_BREAKPOINT", breakpoint }; const promise = (0, _addBreakpoint2.default)(getState, client, sourceMaps, action); return dispatch(_extends({}, action, { [_promise.PROMISE]: promise })); }; } /** * Add a new hidden breakpoint * * @memberOf actions/breakpoints * @param location * @return {function(ThunkArgs)} */ function addHiddenBreakpoint(location) { return ({ dispatch }) => { return dispatch(addBreakpoint(location, { hidden: true })); }; } /** * Remove a single breakpoint * * @memberof actions/breakpoints * @static */ function removeBreakpoint(location) { return ({ dispatch, getState, client }) => { const bp = (0, _selectors.getBreakpoint)(getState(), location); if (!bp || bp.loading) { return; } // If the breakpoint is already disabled, we don't need to communicate // with the server. We just need to dispatch an action // simulating a successful server request if (bp.disabled) { return dispatch({ type: "REMOVE_BREAKPOINT", breakpoint: bp, status: "done" }); } return dispatch({ type: "REMOVE_BREAKPOINT", breakpoint: bp, [_promise.PROMISE]: client.removeBreakpoint(bp.generatedLocation) }); }; } /** * Enabling a breakpoint * will reuse the existing breakpoint information that is stored. * * @memberof actions/breakpoints * @static * @param {Location} $1.location Location value */ function enableBreakpoint(location) { return async ({ dispatch, getState, client, sourceMaps }) => { const breakpoint = (0, _selectors.getBreakpoint)(getState(), location); if (!breakpoint || breakpoint.loading) { return; } const action = { type: "ENABLE_BREAKPOINT", breakpoint }; const promise = (0, _addBreakpoint2.default)(getState, client, sourceMaps, action); return dispatch({ type: "ENABLE_BREAKPOINT", breakpoint, [_promise.PROMISE]: promise }); }; } /** * Disable a single breakpoint * * @memberof actions/breakpoints * @static */ function disableBreakpoint(location) { return async ({ dispatch, getState, client }) => { const bp = (0, _selectors.getBreakpoint)(getState(), location); if (!bp || bp.loading) { return; } await client.removeBreakpoint(bp.generatedLocation); const newBreakpoint = _extends({}, bp, { disabled: true }); return dispatch({ type: "DISABLE_BREAKPOINT", breakpoint: newBreakpoint }); }; } /** * Toggle All Breakpoints * * @memberof actions/breakpoints * @static */ function toggleAllBreakpoints(shouldDisableBreakpoints) { return async ({ dispatch, getState }) => { const breakpoints = (0, _selectors.getBreakpoints)(getState()); for (const [, breakpoint] of breakpoints) { if (shouldDisableBreakpoints) { await dispatch(disableBreakpoint(breakpoint.location)); } else { await dispatch(enableBreakpoint(breakpoint.location)); } } }; } /** * Toggle Breakpoints * * @memberof actions/breakpoints * @static */ function toggleBreakpoints(shouldDisableBreakpoints, breakpoints) { return async ({ dispatch }) => { for (const [, breakpoint] of breakpoints) { if (shouldDisableBreakpoints) { await dispatch(disableBreakpoint(breakpoint.location)); } else { await dispatch(enableBreakpoint(breakpoint.location)); } } }; } /** * Removes all breakpoints * * @memberof actions/breakpoints * @static */ function removeAllBreakpoints() { return async ({ dispatch, getState }) => { const breakpoints = (0, _selectors.getBreakpoints)(getState()); for (const [, breakpoint] of breakpoints) { await dispatch(removeBreakpoint(breakpoint.location)); } }; } /** * Removes breakpoints * * @memberof actions/breakpoints * @static */ function removeBreakpoints(breakpoints) { return async ({ dispatch }) => { for (const [, breakpoint] of breakpoints) { await dispatch(removeBreakpoint(breakpoint.location)); } }; } function remapBreakpoints(sourceId) { return async ({ dispatch, getState, sourceMaps }) => { const breakpoints = (0, _selectors.getBreakpoints)(getState()); const newBreakpoints = await (0, _remapLocations2.default)(breakpoints, sourceId, sourceMaps); return dispatch({ type: "REMAP_BREAKPOINTS", breakpoints: newBreakpoints }); }; } /** * Update the condition of a breakpoint. * * @throws {Error} "not implemented" * @memberof actions/breakpoints * @static * @param {Location} location * @see DebuggerController.Breakpoints.addBreakpoint * @param {string} condition * The condition to set on the breakpoint * @param {Boolean} $1.disabled Disable value for breakpoint value */ function setBreakpointCondition(location, { condition } = {}) { return async ({ dispatch, getState, client, sourceMaps }) => { const bp = (0, _selectors.getBreakpoint)(getState(), location); if (!bp) { return dispatch(addBreakpoint(location, { condition })); } if (bp.loading) { return; } if (bp.disabled) { await dispatch(enableBreakpoint(location)); bp.disabled = !bp.disabled; } await client.setBreakpointCondition(bp.id, location, condition, sourceMaps.isOriginalId(bp.location.sourceId)); const newBreakpoint = _extends({}, bp, { condition }); (0, _breakpoint.assertBreakpoint)(newBreakpoint); return dispatch({ type: "SET_BREAKPOINT_CONDITION", breakpoint: newBreakpoint }); }; } function toggleBreakpoint(line, column) { return ({ dispatch, getState, client, sourceMaps }) => { const state = getState(); const selectedSource = (0, _selectors.getSelectedSource)(state); const bp = (0, _selectors.getBreakpointAtLocation)(state, { line, column }); const isEmptyLine = (0, _ast.isEmptyLineInSource)(state, line, selectedSource.toJS()); if (!bp && isEmptyLine || bp && bp.loading) { return; } if (bp) { // NOTE: it's possible the breakpoint has slid to a column return dispatch(removeBreakpoint({ sourceId: bp.location.sourceId, sourceUrl: bp.location.sourceUrl, line: bp.location.line, column: column || bp.location.column })); } return dispatch(addBreakpoint({ sourceId: selectedSource.get("id"), sourceUrl: selectedSource.get("url"), line: line, column: column })); }; } function addOrToggleDisabledBreakpoint(line, column) { return ({ dispatch, getState, client, sourceMaps }) => { const selectedSource = (0, _selectors.getSelectedSource)(getState()); const bp = (0, _selectors.getBreakpointAtLocation)(getState(), { line, column }); if (bp && bp.loading) { return; } if (bp) { // NOTE: it's possible the breakpoint has slid to a column return dispatch(toggleDisabledBreakpoint(line, column || bp.location.column)); } return dispatch(addBreakpoint({ sourceId: selectedSource.get("id"), sourceUrl: selectedSource.get("url"), line: line, column: column })); }; } function toggleDisabledBreakpoint(line, column) { return ({ dispatch, getState, client, sourceMaps }) => { const bp = (0, _selectors.getBreakpointAtLocation)(getState(), { line, column }); if (!bp || bp.loading) { return; } if (!bp.disabled) { return dispatch(disableBreakpoint(bp.location)); } return dispatch(enableBreakpoint(bp.location)); }; } /***/ }), /* 1397 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getGeneratedLocation = getGeneratedLocation; var _selectors = __webpack_require__(1352); async function getGeneratedLocation(state, source, location, sourceMaps) { if (!sourceMaps.isOriginalId(location.sourceId)) { return location; } const { line, sourceId, column } = await sourceMaps.getGeneratedLocation(location, source); const generatedSource = (0, _selectors.getSource)(state, sourceId); const sourceUrl = generatedSource.get("url"); return { line, sourceId, column: column === 0 ? undefined : column, sourceUrl }; } /* 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 . */ /***/ }), /* 1398 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.addExpression = addExpression; exports.updateExpression = updateExpression; exports.deleteExpression = deleteExpression; exports.evaluateExpressions = evaluateExpressions; exports.getMappedExpression = getMappedExpression; var _selectors = __webpack_require__(1352); var _promise = __webpack_require__(1653); var _devtoolsSourceMap = __webpack_require__(1360); var _expressions = __webpack_require__(1437); var _parser = __webpack_require__(1365); var parser = _interopRequireWildcard(_parser); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } /** * Add expression for debugger to watch * * @param {object} expression * @param {number} expression.id * @memberof actions/pause * @static */ function addExpression(input) { return async ({ dispatch, getState }) => { if (!input) { return; } const expression = (0, _selectors.getExpression)(getState(), input); if (expression) { return dispatch(evaluateExpression(expression)); } dispatch({ type: "ADD_EXPRESSION", input }); const newExpression = (0, _selectors.getExpression)(getState(), input); dispatch(evaluateExpression(newExpression)); }; } /* 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 . */ function updateExpression(input, expression) { return ({ dispatch, getState }) => { if (!input || input == expression.input) { return; } dispatch({ type: "UPDATE_EXPRESSION", expression, input: input }); dispatch(evaluateExpressions()); }; } /** * * @param {object} expression * @param {number} expression.id * @memberof actions/pause * @static */ function deleteExpression(expression) { return ({ dispatch }) => { dispatch({ type: "DELETE_EXPRESSION", input: expression.input }); }; } /** * * @memberof actions/pause * @param {number} selectedFrameId * @static */ function evaluateExpressions() { return async function ({ dispatch, getState, client }) { const expressions = (0, _selectors.getExpressions)(getState()).toJS(); for (const expression of expressions) { await dispatch(evaluateExpression(expression)); } }; } function evaluateExpression(expression) { return async function ({ dispatch, getState, client, sourceMaps }) { if (!expression.input) { console.warn("Expressions should not be empty"); return; } let input = expression.input; const error = await parser.hasSyntaxError(input); if (error) { return dispatch({ type: "EVALUATE_EXPRESSION", input: expression.input, value: { input: expression.input, result: error } }); } const frame = (0, _selectors.getSelectedFrame)(getState()); if (frame) { const { location, generatedLocation } = frame; const source = (0, _selectors.getSource)(getState(), location.sourceId); const sourceId = source.get("id"); if (!(0, _devtoolsSourceMap.isGeneratedId)(sourceId)) { input = await getMappedExpression({ sourceMaps }, generatedLocation, input); } } const frameId = (0, _selectors.getSelectedFrameId)(getState()); return dispatch({ type: "EVALUATE_EXPRESSION", input: expression.input, [_promise.PROMISE]: client.evaluate((0, _expressions.wrapExpression)(input), { frameId }) }); }; } /** * Gets information about original variable names from the source map * and replaces all posible generated names. */ async function getMappedExpression({ sourceMaps }, generatedLocation, expression) { const astScopes = await parser.getScopes(generatedLocation); const generatedScopes = await sourceMaps.getLocationScopes(generatedLocation, astScopes); if (!generatedScopes) { return expression; } return parser.replaceOriginalVariableName(expression, generatedScopes); } /***/ }), /* 1399 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setSourceMetaData = setSourceMetaData; exports.setSymbols = setSymbols; exports.setEmptyLines = setEmptyLines; exports.setOutOfScopeLocations = setOutOfScopeLocations; var _selectors = __webpack_require__(1352); var _setInScopeLines = __webpack_require__(1781); var _parser = __webpack_require__(1365); function setSourceMetaData(sourceId) { return async ({ dispatch, getState }) => { const sourceRecord = (0, _selectors.getSource)(getState(), sourceId); if (!sourceRecord) { return; } const source = sourceRecord.toJS(); if (!source.text || source.isWasm) { return; } const isReactComp = await (0, _parser.isReactComponent)(source); dispatch({ type: "SET_SOURCE_METADATA", sourceId: source.id, sourceMetaData: { isReactComponent: isReactComp } }); }; } /* 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 . */ function setSymbols(sourceId) { return async ({ dispatch, getState }) => { const sourceRecord = (0, _selectors.getSource)(getState(), sourceId); if (!sourceRecord) { return; } const source = sourceRecord.toJS(); if (!source.text || source.isWasm || (0, _selectors.hasSymbols)(getState(), source)) { return; } const symbols = await (0, _parser.getSymbols)(source); dispatch({ type: "SET_SYMBOLS", source, symbols }); dispatch(setEmptyLines(source.id)); dispatch(setSourceMetaData(source.id)); }; } function setEmptyLines(sourceId) { return async ({ dispatch, getState }) => { const sourceRecord = (0, _selectors.getSource)(getState(), sourceId); if (!sourceRecord) { return; } const source = sourceRecord.toJS(); if (!source.text || source.isWasm) { return; } const emptyLines = await (0, _parser.getEmptyLines)(source); dispatch({ type: "SET_EMPTY_LINES", source, emptyLines }); }; } function setOutOfScopeLocations() { return async ({ dispatch, getState }) => { const location = (0, _selectors.getSelectedLocation)(getState()); if (!location) { return; } const source = (0, _selectors.getSource)(getState(), location.sourceId); const locations = !location.line || !source ? null : await (0, _parser.findOutOfScopeLocations)(source.toJS(), location); dispatch({ type: "OUT_OF_SCOPE_LOCATIONS", locations }); dispatch((0, _setInScopeLines.setInScopeLines)()); }; } /***/ }), /* 1400 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; exports.updateFrameLocations = updateFrameLocations; exports.getPauseReason = getPauseReason; exports.getPausedPosition = getPausedPosition; exports.inDebuggerEval = inDebuggerEval; var _lodash = __webpack_require__(2); /* 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 . */ function updateFrameLocations(frames, sourceMaps) { if (!frames || frames.length == 0) { return Promise.resolve(frames); } return Promise.all(frames.map(frame => sourceMaps.getOriginalLocation(frame.location).then(loc => _extends({}, frame, { location: loc, generatedLocation: frame.location })))); } // Map protocol pause "why" reason to a valid L10N key // These are the known unhandled reasons: // "breakpointConditionThrown", "clientEvaluated" // "interrupted", "attached" const reasons = { debuggerStatement: "whyPaused.debuggerStatement", breakpoint: "whyPaused.breakpoint", exception: "whyPaused.exception", resumeLimit: "whyPaused.resumeLimit", pauseOnDOMEvents: "whyPaused.pauseOnDOMEvents", breakpointConditionThrown: "whyPaused.breakpointConditionThrown", // V8 DOM: "whyPaused.breakpoint", EventListener: "whyPaused.pauseOnDOMEvents", XHR: "whyPaused.xhr", promiseRejection: "whyPaused.promiseRejection", assert: "whyPaused.assert", debugCommand: "whyPaused.debugCommand", other: "whyPaused.other" }; function getPauseReason(pauseInfo) { if (!pauseInfo) { return null; } const reasonType = (0, _lodash.get)(pauseInfo, "why.type", null); if (!reasons[reasonType]) { console.log("Please file an issue: reasonType=", reasonType); } return reasons[reasonType]; } async function getPausedPosition(pauseInfo, sourceMaps) { let { frames } = pauseInfo; frames = await updateFrameLocations(frames, sourceMaps); const frame = frames[0]; const { location } = frame; return location; } function inDebuggerEval(why) { if (why && why.type === "exception" && why.exception && why.exception.preview && why.exception.preview.fileName) { return why.exception.preview.fileName === "debugger eval code"; } return false; } /***/ }), /* 1401 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.renderWasmText = exports.clearWasmStates = exports.wasmOffsetToLine = exports.lineToWasmOffset = exports.isWasm = exports.getWasmLineNumberFormatter = exports.getWasmText = undefined; var _WasmParser = __webpack_require__(677); var _WasmDis = __webpack_require__(678); /* 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 . */ var wasmStates = Object.create(null); /** * @memberof utils/wasm * @static */ function getWasmText(sourceId, data) { const parser = new _WasmParser.BinaryReader(); parser.setData(data.buffer, 0, data.length); const dis = new _WasmDis.WasmDisassembler(); dis.addOffsets = true; const done = dis.disassembleChunk(parser); let result = dis.getResult(); if (result.lines.length === 0) { result = { lines: ["No luck with wast conversion"], offsets: [0], done }; } const offsets = result.offsets; const lines = []; for (let i = 0; i < offsets.length; i++) { lines[offsets[i]] = i; } wasmStates[sourceId] = { offsets, lines }; return { lines: result.lines, done: result.done }; } /** * @memberof utils/wasm * @static */ function getWasmLineNumberFormatter(sourceId) { const codeOf0 = 48, codeOfA = 65; const buffer = [codeOf0, codeOf0, codeOf0, codeOf0, codeOf0, codeOf0, codeOf0, codeOf0]; let last0 = 7; return function (number) { const offset = lineToWasmOffset(sourceId, number - 1); if (offset == undefined) { return ""; } let i = 7; for (let n = offset; n !== 0 && i >= 0; n >>= 4, i--) { const nibble = n & 15; buffer[i] = nibble < 10 ? codeOf0 + nibble : codeOfA - 10 + nibble; } for (let j = i; j > last0; j--) { buffer[j] = codeOf0; } last0 = i; return String.fromCharCode.apply(null, buffer); }; } /** * @memberof utils/wasm * @static */ function isWasm(sourceId) { return sourceId in wasmStates; } /** * @memberof utils/wasm * @static */ function lineToWasmOffset(sourceId, number) { const wasmState = wasmStates[sourceId]; if (!wasmState) { return undefined; } let offset = wasmState.offsets[number]; while (offset === undefined && number > 0) { offset = wasmState.offsets[--number]; } return offset; } /** * @memberof utils/wasm * @static */ function wasmOffsetToLine(sourceId, offset) { const wasmState = wasmStates[sourceId]; if (!wasmState) { return undefined; } return wasmState.lines[offset]; } /** * @memberof utils/wasm * @static */ function clearWasmStates() { wasmStates = Object.create(null); } function renderWasmText(sourceId, { binary }) { // binary does not survive as Uint8Array, converting from string const data = new Uint8Array(binary.length); for (let i = 0; i < data.length; i++) { data[i] = binary.charCodeAt(i); } const { lines } = getWasmText(sourceId, data); const MAX_LINES = 1000000; if (lines.length > MAX_LINES) { lines.splice(MAX_LINES, lines.length - MAX_LINES); lines.push(";; .... text is truncated due to the size"); } return lines; } exports.getWasmText = getWasmText; exports.getWasmLineNumberFormatter = getWasmLineNumberFormatter; exports.isWasm = isWasm; exports.lineToWasmOffset = lineToWasmOffset; exports.wasmOffsetToLine = wasmOffsetToLine; exports.clearWasmStates = clearWasmStates; exports.renderWasmText = renderWasmText; /***/ }), /* 1402 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = buildQuery; var _escapeRegExp = __webpack_require__(259); var _escapeRegExp2 = _interopRequireDefault(_escapeRegExp); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Ignore doing outline matches for less than 3 whitespaces * * @memberof utils/source-search * @static */ function ignoreWhiteSpace(str) { return (/^\s{0,2}$/.test(str) ? "(?!\\s*.*)" : str ); } /* 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 . */ function wholeMatch(query, wholeWord) { if (query === "" || !wholeWord) { return query; } return `\\b${query}\\b`; } function buildFlags(caseSensitive, isGlobal) { if (caseSensitive && isGlobal) { return "g"; } if (!caseSensitive && isGlobal) { return "gi"; } if (!caseSensitive && !isGlobal) { return "i"; } return; } function buildQuery(originalQuery, modifiers, { isGlobal = false, ignoreSpaces = false }) { const { caseSensitive, regexMatch, wholeWord } = modifiers; if (originalQuery === "") { return new RegExp(originalQuery); } let query = originalQuery; if (ignoreSpaces) { query = ignoreWhiteSpace(query); } if (!regexMatch) { query = (0, _escapeRegExp2.default)(query); } query = wholeMatch(query, wholeWord); const flags = buildFlags(caseSensitive, isGlobal); if (flags) { return new RegExp(query, flags); } return new RegExp(query); } /***/ }), /* 1403 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Modal = undefined; exports.default = Slide; var _propTypes = __webpack_require__(20); var _propTypes2 = _interopRequireDefault(_propTypes); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _Transition = __webpack_require__(333); var _Transition2 = _interopRequireDefault(_Transition); __webpack_require__(1303); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Modal extends _react2.default.Component { constructor(...args) { var _temp; return _temp = super(...args), this.onClick = e => { e.stopPropagation(); }, _temp; } render() { const { status } = this.props; return _react2.default.createElement( "div", { className: "modal-wrapper", onClick: this.props.handleClose }, _react2.default.createElement( "div", { className: (0, _classnames2.default)("modal", this.props.additionalClass, status), onClick: this.onClick }, this.props.children ) ); } } exports.Modal = Modal; /* 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 . */ Modal.contextTypes = { shortcuts: _propTypes2.default.object }; function Slide({ in: inProp, children, additionalClass, handleClose }) { return _react2.default.createElement( _Transition2.default, { "in": inProp, timeout: 175, appear: true }, status => _react2.default.createElement( Modal, { status: status, additionalClass: additionalClass, handleClose: handleClose }, children ) ); } /***/ }), /* 1404 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); __webpack_require__(1311); var _devtoolsComponents = __webpack_require__(1441); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class ManagedTree extends _react.Component { constructor(props) { super(); this.setExpanded = (item, isExpanded, shouldIncludeChildren) => { const expandItem = i => { const path = this.props.getPath(i); if (isExpanded) { expanded.add(path); } else { expanded.delete(path); } }; const expanded = this.state.expanded; expandItem(item); if (shouldIncludeChildren) { let parents = [item]; while (parents.length) { const children = []; for (const parent of parents) { if (parent.contents && parent.contents.length) { for (const child of parent.contents) { expandItem(child); children.push(child); } } } parents = children; } } this.setState({ expanded }); if (isExpanded && this.props.onExpand) { this.props.onExpand(item, expanded); } else if (!isExpanded && this.props.onCollapse) { this.props.onCollapse(item, expanded); } }; this.focusItem = item => { if (!this.props.disabledFocus && this.state.focusedItem !== item) { this.setState({ focusedItem: item }); if (this.props.onFocus) { this.props.onFocus(item); } } }; this.state = { expanded: props.expanded || new Set(), focusedItem: null }; } componentWillReceiveProps(nextProps) { const listItems = nextProps.listItems; if (listItems && listItems != this.props.listItems && listItems.length) { this.expandListItems(listItems); } const highlightItems = nextProps.highlightItems; if (highlightItems && highlightItems != this.props.highlightItems && highlightItems.length) { this.highlightItem(highlightItems); } if (nextProps.focused && nextProps.focused !== this.props.focused) { this.focusItem(nextProps.focused); } } expandListItems(listItems) { const expanded = this.state.expanded; listItems.forEach(item => expanded.add(this.props.getPath(item))); this.focusItem(listItems[0]); this.setState({ expanded }); } highlightItem(highlightItems) { const expanded = this.state.expanded; // This file is visible, so we highlight it. if (expanded.has(this.props.getPath(highlightItems[0]))) { this.focusItem(highlightItems[0]); } else { // Look at folders starting from the top-level until finds a // closed folder and highlights this folder const index = highlightItems.reverse().findIndex(item => !expanded.has(this.props.getPath(item))); this.focusItem(highlightItems[index]); } } render() { const { expanded, focusedItem } = this.state; const overrides = { isExpanded: item => expanded.has(this.props.getPath(item)), focused: focusedItem, getKey: this.props.getPath, onExpand: item => this.setExpanded(item, true, false), onCollapse: item => this.setExpanded(item, false, false), onFocus: this.focusItem, renderItem: (...args) => this.props.renderItem(...args, { setExpanded: this.setExpanded }) }; const props = _extends({}, this.props, overrides); return _react2.default.createElement( "div", { className: "managed-tree" }, _react2.default.createElement(_devtoolsComponents.Tree, props) ); } } exports.default = ManagedTree; /***/ }), /* 1405 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getFilenameFromPath = getFilenameFromPath; exports.getURL = getURL; var _url = __webpack_require__(334); var _lodash = __webpack_require__(2); /* 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 . */ function getFilenameFromPath(pathname) { let filename = ""; if (pathname) { filename = pathname.substring(pathname.lastIndexOf("/") + 1); // This file does not have a name. Default should be (index). if (filename == "" || !filename.includes(".")) { filename = "(index)"; } } return filename; } const NoDomain = "(no domain)"; function getURL(sourceUrl, debuggeeUrl = "") { const url = sourceUrl; const def = { path: "", group: "", filename: "" }; if (!url) { return def; } const { pathname, protocol, host, path } = (0, _url.parse)(url); const defaultDomain = (0, _url.parse)(debuggeeUrl).host; const filename = getFilenameFromPath(pathname); switch (protocol) { case "javascript:": // Ignore `javascript:` URLs for now return def; case "webpack:": // A Webpack source is a special case return (0, _lodash.merge)(def, { path: path, group: "Webpack", filename: filename }); case "ng:": // An Angular source is a special case return (0, _lodash.merge)(def, { path: path, group: "Angular", filename: filename }); case "about:": // An about page is a special case return (0, _lodash.merge)(def, { path: "/", group: url, filename: filename }); case "data:": return (0, _lodash.merge)(def, { path: "/", group: NoDomain, filename: url }); case null: if (pathname && pathname.startsWith("/")) { // If it's just a URL like "/foo/bar.js", resolve it to the file // protocol return (0, _lodash.merge)(def, { path: path, group: "file://", filename: filename }); } else if (host === null) { // We don't know what group to put this under, and it's a script // with a weird URL. Just group them all under an anonymous group. return (0, _lodash.merge)(def, { path: url, group: defaultDomain, filename: filename }); } break; case "http:": case "https:": return (0, _lodash.merge)(def, { path: pathname, group: host, filename: filename }); } return (0, _lodash.merge)(def, { path: path, group: protocol ? `${protocol}//` : "", filename: filename }); } /***/ }), /* 1406 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.scrollList = undefined; var _devtoolsConfig = __webpack_require__(1355); function scrollList(resultList, index) { if (!resultList.hasOwnProperty(index)) { return; } const resultEl = resultList[index]; if ((0, _devtoolsConfig.isFirefox)()) { resultEl.scrollIntoView({ block: "center", behavior: "smooth" }); } else { chromeScrollList(resultEl, index); } } /* 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 . */ function chromeScrollList(elem, index) { const resultsEl = elem.parentNode; if (!resultsEl || resultsEl.children.length === 0) { return; } const resultsHeight = resultsEl.clientHeight; const itemHeight = resultsEl.children[0].clientHeight; const numVisible = resultsHeight / itemHeight; const positionsToScroll = index - numVisible + 1; const itemOffset = resultsHeight % itemHeight; const scroll = positionsToScroll * (itemHeight + 2) + itemOffset; resultsEl.scrollTop = Math.max(0, scroll); } exports.scrollList = scrollList; /***/ }), /* 1407 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _Svg = __webpack_require__(1359); var _Svg2 = _interopRequireDefault(_Svg); var _CommandBarButton = __webpack_require__(1764); var _CommandBarButton2 = _interopRequireDefault(_CommandBarButton); __webpack_require__(1321); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class PaneToggleButton extends _react.Component { shouldComponentUpdate(nextProps) { const { collapsed, horizontal } = this.props; return horizontal !== nextProps.horizontal || collapsed !== nextProps.collapsed; } render() { const { position, collapsed, horizontal, handleClick } = this.props; const title = !collapsed ? L10N.getStr("expandPanes") : L10N.getStr("collapsePanes"); return _react2.default.createElement( _CommandBarButton2.default, { className: (0, _classnames2.default)("toggle-button", position, { collapsed, vertical: horizontal != null ? !horizontal : false }), onClick: () => handleClick(position, collapsed), title: title }, _react2.default.createElement(_Svg2.default, { name: "togglePanes" }) ); } } /* 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 . */ exports.default = PaneToggleButton; /***/ }), /* 1408 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const { MODE } = __webpack_require__(1357); const { REPS, getRep } = __webpack_require__(1372); const ObjectInspector = __webpack_require__(1585); const ObjectInspectorUtils = __webpack_require__(1452); const { parseURLEncodedText, parseURLParams, maybeEscapePropertyName, getGripPreviewItems } = __webpack_require__(1353); module.exports = { REPS, getRep, MODE, maybeEscapePropertyName, parseURLEncodedText, parseURLParams, getGripPreviewItems, ObjectInspector, ObjectInspectorUtils }; /***/ }), /* 1409 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // ReactJS const React = __webpack_require__(0); // Dependencies const { isGrip, wrapRender } = __webpack_require__(1353); const PropRep = __webpack_require__(1381); const { MODE } = __webpack_require__(1357); // Shortcuts const { span } = React.DOM; /** * Renders generic grip. Grip is client representation * of remote JS object and is used as an input object * for this rep component. */ GripRep.propTypes = { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), isInterestingProp: React.PropTypes.func, title: React.PropTypes.string, onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func, noGrip: React.PropTypes.bool }; const DEFAULT_TITLE = "Object"; function GripRep(props) { let { mode = MODE.SHORT, object } = props; const config = { "data-link-actor-id": object.actor, className: "objectBox objectBox-object" }; if (mode === MODE.TINY) { let propertiesLength = getPropertiesLength(object); const tinyModeItems = []; if (getTitle(props, object) !== DEFAULT_TITLE) { tinyModeItems.push(getTitleElement(props, object)); } else { tinyModeItems.push(span({ className: "objectLeftBrace" }, "{"), propertiesLength > 0 ? span({ key: "more", className: "more-ellipsis", title: "more…" }, "…") : null, span({ className: "objectRightBrace" }, "}")); } return span(config, ...tinyModeItems); } let propsArray = safePropIterator(props, object, maxLengthMap.get(mode)); return span(config, getTitleElement(props, object), span({ className: "objectLeftBrace" }, " { "), ...propsArray, span({ className: "objectRightBrace" }, " }")); } function getTitleElement(props, object) { return span({ className: "objectTitle" }, getTitle(props, object)); } function getTitle(props, object) { return props.title || object.class || DEFAULT_TITLE; } function getPropertiesLength(object) { let propertiesLength = object.preview && object.preview.ownPropertiesLength ? object.preview.ownPropertiesLength : object.ownPropertyLength; if (object.preview && object.preview.safeGetterValues) { propertiesLength += Object.keys(object.preview.safeGetterValues).length; } if (object.preview && object.preview.ownSymbols) { propertiesLength += object.preview.ownSymbolsLength; } return propertiesLength; } function safePropIterator(props, object, max) { max = typeof max === "undefined" ? maxLengthMap.get(MODE.SHORT) : max; try { return propIterator(props, object, max); } catch (err) { console.error(err); } return []; } function propIterator(props, object, max) { if (object.preview && Object.keys(object.preview).includes("wrappedValue")) { const { Rep } = __webpack_require__(1372); return [Rep({ object: object.preview.wrappedValue, mode: props.mode || MODE.TINY, defaultRep: Grip })]; } // Property filter. Show only interesting properties to the user. let isInterestingProp = props.isInterestingProp || ((type, value) => { return type == "boolean" || type == "number" || type == "string" && value.length != 0; }); let properties = object.preview ? object.preview.ownProperties : {}; let propertiesLength = getPropertiesLength(object); if (object.preview && object.preview.safeGetterValues) { properties = Object.assign({}, properties, object.preview.safeGetterValues); } let indexes = getPropIndexes(properties, max, isInterestingProp); if (indexes.length < max && indexes.length < propertiesLength) { // There are not enough props yet. Then add uninteresting props to display them. indexes = indexes.concat(getPropIndexes(properties, max - indexes.length, (t, value, name) => { return !isInterestingProp(t, value, name); })); } // The server synthesizes some property names for a Proxy, like // and ; we don't want to quote these because, // as synthetic properties, they appear more natural when // unquoted. const suppressQuotes = object.class === "Proxy"; let propsArray = getProps(props, properties, indexes, suppressQuotes); // Show symbols. if (object.preview && object.preview.ownSymbols) { const { ownSymbols } = object.preview; const length = max - indexes.length; const symbolsProps = ownSymbols.slice(0, length).map(symbolItem => { return PropRep(Object.assign({}, props, { mode: MODE.TINY, name: symbolItem, object: symbolItem.descriptor.value, equal: ": ", defaultRep: Grip, title: null, suppressQuotes })); }); propsArray.push(...symbolsProps); } if (Object.keys(properties).length > max || propertiesLength > max // When the object has non-enumerable properties, we don't have them in the packet, // but we might want to show there's something in the object. || propertiesLength > propsArray.length) { // There are some undisplayed props. Then display "more...". propsArray.push(span({ key: "more", className: "more-ellipsis", title: "more…" }, "…")); } return unfoldProps(propsArray); } function unfoldProps(items) { return items.reduce((res, item, index) => { if (Array.isArray(item)) { res = res.concat(item); } else { res.push(item); } // Interleave commas between elements if (index !== items.length - 1) { res.push(", "); } return res; }, []); } /** * Get props ordered by index. * * @param {Object} componentProps Grip Component props. * @param {Object} properties Properties of the object the Grip describes. * @param {Array} indexes Indexes of properties. * @param {Boolean} suppressQuotes true if we should suppress quotes * on property names. * @return {Array} Props. */ function getProps(componentProps, properties, indexes, suppressQuotes) { // Make indexes ordered by ascending. indexes.sort(function (a, b) { return a - b; }); const propertiesKeys = Object.keys(properties); return indexes.map(i => { let name = propertiesKeys[i]; let value = getPropValue(properties[name]); return PropRep(Object.assign({}, componentProps, { mode: MODE.TINY, name, object: value, equal: ": ", defaultRep: Grip, title: null, suppressQuotes })); }); } /** * Get the indexes of props in the object. * * @param {Object} properties Props object. * @param {Number} max The maximum length of indexes array. * @param {Function} filter Filter the props you want. * @return {Array} Indexes of interesting props in the object. */ function getPropIndexes(properties, max, filter) { let indexes = []; try { let i = 0; for (let name in properties) { if (indexes.length >= max) { return indexes; } // Type is specified in grip's "class" field and for primitive // values use typeof. let value = getPropValue(properties[name]); let type = value.class || typeof value; type = type.toLowerCase(); if (filter(type, value, name)) { indexes.push(i); } i++; } } catch (err) { console.error(err); } return indexes; } /** * Get the actual value of a property. * * @param {Object} property * @return {Object} Value of the property. */ function getPropValue(property) { let value = property; if (typeof property === "object") { let keys = Object.keys(property); if (keys.includes("value")) { value = property.value; } else if (keys.includes("getterValue")) { value = property.getterValue; } } return value; } // Registration function supportsObject(object, noGrip = false) { if (noGrip === true || !isGrip(object)) { return false; } return object.preview ? typeof object.preview.ownProperties !== "undefined" : typeof object.ownPropertyLength !== "undefined"; } const maxLengthMap = new Map(); maxLengthMap.set(MODE.SHORT, 3); maxLengthMap.set(MODE.LONG, 10); // Grip is used in propIterator and has to be defined here. let Grip = { rep: wrapRender(GripRep), supportsObject, maxLengthMap }; // Exports from this module module.exports = Grip; /***/ }), /* 1410 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const React = __webpack_require__(0); const InlineSVG = __webpack_require__(1789); const svg = { "arrow": __webpack_require__(1152), "open-inspector": __webpack_require__(1153) }; Svg.propTypes = { className: React.PropTypes.string }; function Svg(name, props) { if (!svg[name]) { throw new Error("Unknown SVG: " + name); } let className = name; if (props && props.className) { className = `${name} ${props.className}`; } if (name === "subSettings") { className = ""; } props = Object.assign({}, props, { className, src: svg[name] }); return React.createElement(InlineSVG, props); } module.exports = Svg; /***/ }), /* 1411 */, /* 1412 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ /** * Returns a deferred object, with a resolve and reject property. * https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Promise.jsm/Deferred */ module.exports = function defer() { let resolve, reject; let promise = new Promise(function () { resolve = arguments[0]; reject = arguments[1]; }); return { resolve: resolve, reject: reject, promise: promise }; }; /***/ }), /* 1413 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const { Menu, MenuItem } = __webpack_require__(1767); function inToolbox() { return window.parent.document.documentURI == "about:devtools-toolbox"; } if (!inToolbox()) { __webpack_require__(1301); } function createPopup(doc) { let popup = doc.createElement("menupopup"); popup.className = "landing-popup"; if (popup.openPopupAtScreen) { return popup; } function preventDefault(e) { e.preventDefault(); e.returnValue = false; } let mask = document.querySelector("#contextmenu-mask"); if (!mask) { mask = doc.createElement("div"); mask.id = "contextmenu-mask"; document.body.appendChild(mask); } mask.onclick = () => popup.hidePopup(); popup.openPopupAtScreen = function (clientX, clientY) { this.style.setProperty("left", `${clientX}px`); this.style.setProperty("top", `${clientY}px`); mask = document.querySelector("#contextmenu-mask"); window.onwheel = preventDefault; mask.classList.add("show"); this.dispatchEvent(new Event("popupshown")); this.popupshown; }; popup.hidePopup = function () { this.remove(); mask = document.querySelector("#contextmenu-mask"); mask.classList.remove("show"); window.onwheel = null; }; return popup; } if (!inToolbox()) { Menu.prototype.createPopup = createPopup; } function onShown(menu, popup) { popup.childNodes.forEach((menuItemNode, i) => { let item = menu.items[i]; if (!item.disabled && item.visible) { menuItemNode.onclick = () => { item.click(); popup.hidePopup(); }; showSubMenu(item.submenu, menuItemNode, popup); } }); } function showMenu(evt, items) { if (items.length === 0) { return; } let menu = new Menu(); items.filter(item => item.visible === undefined || item.visible === true).forEach(item => { let menuItem = new MenuItem(item); menuItem.submenu = createSubMenu(item.submenu); menu.append(menuItem); }); if (inToolbox()) { menu.popup(evt.screenX, evt.screenY, { doc: window.parent.document }); return; } menu.on("open", (_, popup) => onShown(menu, popup)); menu.popup(evt.clientX, evt.clientY, { doc: document }); } function createSubMenu(subItems) { if (subItems) { let subMenu = new Menu(); subItems.forEach(subItem => { subMenu.append(new MenuItem(subItem)); }); return subMenu; } return null; } function showSubMenu(subMenu, menuItemNode, popup) { if (subMenu) { let subMenuNode = menuItemNode.querySelector("menupopup"); let { top } = menuItemNode.getBoundingClientRect(); let { left, width } = popup.getBoundingClientRect(); subMenuNode.style.setProperty("left", `${left + width - 1}px`); subMenuNode.style.setProperty("top", `${top}px`); let subMenuItemNodes = menuItemNode.querySelector("menupopup:not(.landing-popup)").childNodes; subMenuItemNodes.forEach((subMenuItemNode, j) => { let subMenuItem = subMenu.items.filter(item => item.visible === undefined || item.visible === true)[j]; if (!subMenuItem.disabled && subMenuItem.visible) { subMenuItemNode.onclick = () => { subMenuItem.click(); popup.hidePopup(); }; } }); } } function buildMenu(items) { return items.map(itm => { const hide = typeof itm.hidden === "function" ? itm.hidden() : itm.hidden; return hide ? null : itm.item; }).filter(itm => itm !== null); } module.exports = { showMenu, buildMenu }; /***/ }), /* 1414 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const Immutable = __webpack_require__(146); // When our app state is fully types, we should be able to get rid of // this function. This is only temporarily necessary to support // converting typed objects to immutable.js, which usually happens in // reducers. function fromJS(value) { if (Array.isArray(value)) { return Immutable.Seq(value).map(fromJS).toList(); } if (value && value.constructor.meta) { // This adds support for tcomb objects which are native JS objects // but are not "plain", so the above checks fail. Since they // behave the same we can use the same constructors, but we need // special checks for them. const kind = value.constructor.meta.kind; if (kind === "struct") { return Immutable.Seq(value).map(fromJS).toMap(); } else if (kind === "list") { return Immutable.Seq(value).map(fromJS).toList(); } } // If it's a primitive type, just return the value. Note `==` check // for null, which is intentionally used to match either `null` or // `undefined`. if (value == null || typeof value !== "object") { return value; } // Otherwise, treat it like an object. We can't reliably detect if // it's a plain object because we might be objects from other JS // contexts so `Object !== Object`. return Immutable.Seq(value).map(fromJS).toMap(); } module.exports = fromJS; /***/ }), /* 1415 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const tabs = __webpack_require__(1497); const config = __webpack_require__(1498); module.exports = Object.assign({}, tabs, config); /***/ }), /* 1416 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.containsPosition = containsPosition; exports.findClosestScope = findClosestScope; exports.getASTLocation = getASTLocation; exports.findScopeByName = findScopeByName; var _parser = __webpack_require__(1365); function containsPosition(a, b) { const startsBefore = a.start.line < b.line || a.start.line === b.line && a.start.column <= b.column; const endsAfter = a.end.line > b.line || a.end.line === b.line && a.end.column >= b.column; return startsBefore && endsAfter; } /* 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 . */ function findClosestScope(functions, location) { return functions.reduce((found, currNode) => { if (currNode.name === "anonymous" || !containsPosition(currNode.location, location)) { return found; } if (!found) { return currNode; } if (found.location.start.line > currNode.location.start.line) { return found; } if (found.location.start.line === currNode.location.start.line && found.location.start.column > currNode.location.start.column) { return found; } return currNode; }, null); } async function getASTLocation(source, location) { if (source.isWasm) { return { name: undefined, offset: location }; } const symbols = await (0, _parser.getSymbols)(source); const functions = [...symbols.functions]; const scope = findClosestScope(functions, location); if (scope) { // we only record the line, but at some point we may // also do column offsets const line = location.line - scope.location.start.line; return { name: scope.name, offset: { line, column: undefined } }; } return { name: undefined, offset: location }; } async function findScopeByName(source, name) { const symbols = await (0, _parser.getSymbols)(source); const functions = symbols.functions; return functions.find(node => node.name === name); } /***/ }), /* 1417 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getExpressions = exports.State = undefined; exports.getExpression = getExpression; var _makeRecord = __webpack_require__(1361); var _makeRecord2 = _interopRequireDefault(_makeRecord); var _immutable = __webpack_require__(146); var _lodash = __webpack_require__(2); var _reselect = __webpack_require__(993); var _prefs = __webpack_require__(226); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const State = exports.State = (0, _makeRecord2.default)({ expressions: (0, _immutable.List)(restoreExpressions()) }); /* 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 . */ /** * Expressions reducer * @module reducers/expressions */ function update(state = State(), action) { switch (action.type) { case "ADD_EXPRESSION": return appendToList(state, ["expressions"], { input: action.input, value: null, updating: true }); case "UPDATE_EXPRESSION": const key = action.expression.input; return updateItemInList(state, ["expressions"], key, { input: action.input, value: null, updating: true }); case "EVALUATE_EXPRESSION": return updateItemInList(state, ["expressions"], action.input, { input: action.input, value: action.value, updating: false }); case "DELETE_EXPRESSION": return deleteExpression(state, action.input); } return state; } function restoreExpressions() { const exprs = _prefs.prefs.expressions; if (exprs.length == 0) { return; } return exprs; } function storeExpressions(state) { const expressions = state.getIn(["expressions"]).map(expression => (0, _lodash.omit)(expression, "value")).toJS(); _prefs.prefs.expressions = expressions; } function appendToList(state, path, value) { const newState = state.updateIn(path, () => { return state.getIn(path).push(value); }); storeExpressions(newState); return newState; } function updateItemInList(state, path, key, value) { const newState = state.updateIn(path, () => { const list = state.getIn(path); const index = list.findIndex(e => e.input == key); return list.update(index, () => value); }); storeExpressions(newState); return newState; } function deleteExpression(state, input) { const index = getExpressions({ expressions: state }).findKey(e => e.input == input); const newState = state.deleteIn(["expressions", index]); storeExpressions(newState); return newState; } const getExpressionsWrapper = state => state.expressions; const getExpressions = exports.getExpressions = (0, _reselect.createSelector)(getExpressionsWrapper, expressions => expressions.get("expressions")); function getExpression(state, input) { return getExpressions(state).find(exp => exp.input == input); } exports.default = update; /***/ }), /* 1418 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getWorkers = exports.State = undefined; exports.default = debuggee; var _reselect = __webpack_require__(993); var _immutable = __webpack_require__(146); var _makeRecord = __webpack_require__(1361); var _makeRecord2 = _interopRequireDefault(_makeRecord); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const State = exports.State = (0, _makeRecord2.default)({ workers: (0, _immutable.List)() }); /* 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 . */ /** * Debuggee reducer * @module reducers/debuggee */ function debuggee(state = State(), action) { switch (action.type) { case "SET_WORKERS": return state.set("workers", (0, _immutable.List)(action.workers.workers)); default: return state; } } const getDebuggeeWrapper = state => state.debuggee; const getWorkers = exports.getWorkers = (0, _reselect.createSelector)(getDebuggeeWrapper, debuggeeState => debuggeeState.get("workers")); /***/ }), /* 1419 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.initialState = initialState; exports.getPendingBreakpoints = getPendingBreakpoints; exports.getPendingBreakpointsForSource = getPendingBreakpointsForSource; var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); var _makeRecord = __webpack_require__(1361); var _makeRecord2 = _interopRequireDefault(_makeRecord); var _breakpoint = __webpack_require__(1364); var _prefs = __webpack_require__(226); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } /* 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 . */ /** * Pending breakpoints reducer * @module reducers/pending-breakpoints */ function initialState() { return (0, _makeRecord2.default)({ pendingBreakpoints: restorePendingBreakpoints() })(); } function update(state = initialState(), action) { switch (action.type) { case "ADD_BREAKPOINT": { if (action.breakpoint.hidden) { return state; } return addBreakpoint(state, action); } case "SYNC_BREAKPOINT": { return syncBreakpoint(state, action); } case "ENABLE_BREAKPOINT": { return addBreakpoint(state, action); } case "DISABLE_BREAKPOINT": { return updateBreakpoint(state, action); } case "SET_BREAKPOINT_CONDITION": { return updateBreakpoint(state, action); } case "REMOVE_BREAKPOINT": { if (action.breakpoint.hidden) { return state; } return removeBreakpoint(state, action); } } return state; } function addBreakpoint(state, action) { if (action.status !== "done") { return state; } // when the action completes, we can commit the breakpoint const { value: { breakpoint } } = action; const locationId = (0, _breakpoint.makePendingLocationId)(breakpoint.location); const pendingBreakpoint = (0, _breakpoint.createPendingBreakpoint)(breakpoint); return state.setIn(["pendingBreakpoints", locationId], pendingBreakpoint); } function syncBreakpoint(state, action) { const { breakpoint, previousLocation } = action; const locationId = (0, _breakpoint.makePendingLocationId)(breakpoint.location); const pendingBreakpoint = (0, _breakpoint.createPendingBreakpoint)(breakpoint); if (previousLocation) { return state.deleteIn(["pendingBreakpoints", (0, _breakpoint.makePendingLocationId)(previousLocation)]).setIn(["pendingBreakpoints", locationId], pendingBreakpoint); } return state.setIn(["pendingBreakpoints", locationId], pendingBreakpoint); } function updateBreakpoint(state, action) { const { breakpoint } = action; const locationId = (0, _breakpoint.makePendingLocationId)(breakpoint.location); const pendingBreakpoint = (0, _breakpoint.createPendingBreakpoint)(breakpoint); return state.setIn(["pendingBreakpoints", locationId], pendingBreakpoint); } function removeBreakpoint(state, action) { const { breakpoint } = action; const locationId = (0, _breakpoint.makePendingLocationId)(breakpoint.location); const pendingBp = state.getIn(["pendingBreakpoints", locationId]); if (!pendingBp && action.status == "start") { return state.set("pendingBreakpoints", I.Map()); } return state.deleteIn(["pendingBreakpoints", locationId]); } // Selectors // TODO: these functions should be moved out of the reducer function getPendingBreakpoints(state) { return state.pendingBreakpoints.pendingBreakpoints; } function getPendingBreakpointsForSource(state, sourceUrl) { const pendingBreakpoints = state.pendingBreakpoints.pendingBreakpoints || []; return pendingBreakpoints.filter(pendingBreakpoint => pendingBreakpoint.location.sourceUrl === sourceUrl); } function restorePendingBreakpoints() { return I.Map(_prefs.prefs.pendingBreakpoints); } exports.default = update; /***/ }), /* 1420 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getEventListeners = getEventListeners; /* 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/. */ /** * Event listeners reducer * @module reducers/event-listeners */ const initialState = { activeEventNames: [], listeners: [], fetchingListeners: false }; function update(state = initialState, action, emit) { switch (action.type) { case "UPDATE_EVENT_BREAKPOINTS": state.activeEventNames = action.eventNames; // emit("activeEventNames", state.activeEventNames); break; case "FETCH_EVENT_LISTENERS": if (action.status === "begin") { state.fetchingListeners = true; } else if (action.status === "done") { state.fetchingListeners = false; state.listeners = action.listeners; } break; case "NAVIGATE": return initialState; } return state; } function getEventListeners(state) { return state.eventListeners.listeners; } exports.default = update; /***/ }), /* 1421 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.State = undefined; exports.getSelectedPrimaryPaneTab = getSelectedPrimaryPaneTab; exports.getActiveSearch = getActiveSearch; exports.getContextMenu = getContextMenu; exports.getFrameworkGroupingState = getFrameworkGroupingState; exports.getShownSource = getShownSource; exports.getPaneCollapse = getPaneCollapse; exports.getHighlightedLineRange = getHighlightedLineRange; exports.getConditionalPanelLine = getConditionalPanelLine; exports.getProjectDirectoryRoot = getProjectDirectoryRoot; exports.getOrientation = getOrientation; var _makeRecord = __webpack_require__(1361); var _makeRecord2 = _interopRequireDefault(_makeRecord); var _prefs = __webpack_require__(226); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ /** * UI reducer * @module reducers/ui */ const State = exports.State = (0, _makeRecord2.default)({ selectedPrimaryPaneTab: "sources", activeSearch: null, contextMenu: {}, shownSource: "", projectDirectoryRoot: "", startPanelCollapsed: _prefs.prefs.startPanelCollapsed, endPanelCollapsed: _prefs.prefs.endPanelCollapsed, frameworkGroupingOn: _prefs.prefs.frameworkGroupingOn, highlightedLineRange: undefined, conditionalPanelLine: null, orientation: "horizontal" }); function update(state = State(), action) { switch (action.type) { case "TOGGLE_ACTIVE_SEARCH": { return state.set("activeSearch", action.value); } case "TOGGLE_FRAMEWORK_GROUPING": { _prefs.prefs.frameworkGroupingOn = action.value; return state.set("frameworkGroupingOn", action.value); } case "SET_CONTEXT_MENU": { return state.set("contextMenu", action.contextMenu); } case "SET_ORIENTATION": { return state.set("orientation", action.orientation); } case "SHOW_SOURCE": { return state.set("shownSource", action.sourceUrl); } case "TOGGLE_PANE": { if (action.position == "start") { _prefs.prefs.startPanelCollapsed = action.paneCollapsed; return state.set("startPanelCollapsed", action.paneCollapsed); } _prefs.prefs.endPanelCollapsed = action.paneCollapsed; return state.set("endPanelCollapsed", action.paneCollapsed); } case "HIGHLIGHT_LINES": const { start, end, sourceId } = action.location; let lineRange = {}; if (start && end && sourceId) { lineRange = { start, end, sourceId }; } return state.set("highlightedLineRange", lineRange); case "CLOSE_QUICK_OPEN": case "CLEAR_HIGHLIGHT_LINES": return state.set("highlightedLineRange", {}); case "OPEN_CONDITIONAL_PANEL": return state.set("conditionalPanelLine", action.line); case "CLOSE_CONDITIONAL_PANEL": return state.set("conditionalPanelLine", null); case "SET_PROJECT_DIRECTORY_ROOT": _prefs.prefs.projectDirectoryRoot = action.url; return state.set("projectDirectoryRoot", action.url); case "SET_PRIMARY_PANE_TAB": return state.set("selectedPrimaryPaneTab", action.tabName); case "CLOSE_PROJECT_SEARCH": { if (state.get("activeSearch") === "project") { return state.set("activeSearch", null); } return state; } default: { return state; } } } // NOTE: we'd like to have the app state fully typed // https://github.com/devtools-html/debugger.html/blob/master/src/reducers/sources.js#L179-L185 function getSelectedPrimaryPaneTab(state) { return state.ui.get("selectedPrimaryPaneTab"); } function getActiveSearch(state) { return state.ui.get("activeSearch"); } function getContextMenu(state) { return state.ui.get("contextMenu"); } function getFrameworkGroupingState(state) { return state.ui.get("frameworkGroupingOn"); } function getShownSource(state) { return state.ui.get("shownSource"); } function getPaneCollapse(state, position) { if (position == "start") { return state.ui.get("startPanelCollapsed"); } return state.ui.get("endPanelCollapsed"); } function getHighlightedLineRange(state) { return state.ui.get("highlightedLineRange"); } function getConditionalPanelLine(state) { return state.ui.get("conditionalPanelLine"); } function getProjectDirectoryRoot(state) { return state.ui.get("projectDirectoryRoot"); } function getOrientation(state) { return state.ui.get("orientation"); } exports.default = update; /***/ }), /* 1422 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.State = undefined; exports.getFileSearchQuery = getFileSearchQuery; exports.getFileSearchModifiers = getFileSearchModifiers; exports.getFileSearchResults = getFileSearchResults; var _makeRecord = __webpack_require__(1361); var _makeRecord2 = _interopRequireDefault(_makeRecord); var _prefs = __webpack_require__(226); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ /** * File Search reducer * @module reducers/fileSearch */ const State = exports.State = (0, _makeRecord2.default)({ query: "", searchResults: { matches: [], matchIndex: -1, index: -1, count: 0 }, modifiers: (0, _makeRecord2.default)({ caseSensitive: _prefs.prefs.fileSearchCaseSensitive, wholeWord: _prefs.prefs.fileSearchWholeWord, regexMatch: _prefs.prefs.fileSearchRegexMatch })() }); function update(state = State(), action) { switch (action.type) { case "UPDATE_FILE_SEARCH_QUERY": { return state.set("query", action.query); } case "UPDATE_SEARCH_RESULTS": { return state.set("searchResults", action.results); } case "TOGGLE_FILE_SEARCH_MODIFIER": { const actionVal = !state.getIn(["modifiers", action.modifier]); if (action.modifier == "caseSensitive") { _prefs.prefs.fileSearchCaseSensitive = actionVal; } if (action.modifier == "wholeWord") { _prefs.prefs.fileSearchWholeWord = actionVal; } if (action.modifier == "regexMatch") { _prefs.prefs.fileSearchRegexMatch = actionVal; } return state.setIn(["modifiers", action.modifier], actionVal); } default: { return state; } } } // NOTE: we'd like to have the app state fully typed // https://github.com/devtools-html/debugger.html/blob/master/src/reducers/sources.js#L179-L185 function getFileSearchQuery(state) { return state.fileSearch.get("query"); } function getFileSearchModifiers(state) { return state.fileSearch.get("modifiers"); } function getFileSearchResults(state) { return state.fileSearch.get("searchResults"); } exports.default = update; /***/ }), /* 1423 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.State = undefined; exports.getHitCountForSource = getHitCountForSource; exports.getCoverageEnabled = getCoverageEnabled; var _makeRecord = __webpack_require__(1361); var _makeRecord2 = _interopRequireDefault(_makeRecord); var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); var _fromJS = __webpack_require__(1502); var _fromJS2 = _interopRequireDefault(_fromJS); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const State = exports.State = (0, _makeRecord2.default)({ coverageOn: false, hitCount: I.Map() }); /* 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 . */ /** * Code coverage reducer * @module reducers/coverage */ function update(state = State(), action) { switch (action.type) { case "RECORD_COVERAGE": return state.mergeIn(["hitCount"], (0, _fromJS2.default)(action.value.coverage)).setIn(["coverageOn"], true); default: { return state; } } } // NOTE: we'd like to have the app state fully typed // https://github.com/devtools-html/debugger.html/blob/master/src/reducers/sources.js#L179-L185 function getHitCountForSource(state, sourceId) { const hitCount = state.coverage.get("hitCount"); return hitCount.get(sourceId); } function getCoverageEnabled(state) { return state.coverage.get("coverageOn"); } exports.default = update; /***/ }), /* 1424 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.statusType = undefined; exports.InitialState = InitialState; exports.getTextSearchResults = getTextSearchResults; exports.getTextSearchStatus = getTextSearchStatus; exports.getTextSearchQuery = getTextSearchQuery; var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); var _makeRecord = __webpack_require__(1361); var _makeRecord2 = _interopRequireDefault(_makeRecord); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } /* 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 . */ // @format /** * Project text search reducer * @module reducers/project-text-search */ const statusType = exports.statusType = { initial: "INITIAL", fetching: "FETCHING", done: "DONE", error: "ERROR" }; function InitialState() { return (0, _makeRecord2.default)({ query: "", results: I.List(), status: statusType.initial })(); } function update(state = InitialState(), action) { switch (action.type) { case "ADD_QUERY": const actionCopy = action; return state.update("query", value => actionCopy.query); case "CLEAR_QUERY": return state.remove("query"); case "ADD_SEARCH_RESULT": const results = state.get("results"); return state.merge({ results: results.push(action.result) }); case "UPDATE_STATUS": return state.merge({ status: action.status }); case "CLEAR_SEARCH_RESULTS": return state.merge({ results: state.get("results").clear() }); case "CLOSE_PROJECT_SEARCH": return state.merge({ query: "", results: state.get("results").clear() }); } return state; } function getTextSearchResults(state) { return state.projectTextSearch.get("results"); } function getTextSearchStatus(state) { return state.projectTextSearch.get("status"); } function getTextSearchQuery(state) { return state.projectTextSearch.get("query"); } exports.default = update; /***/ }), /* 1425 */, /* 1426 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.InitialState = InitialState; exports.default = update; exports.getExpandedState = getExpandedState; var _makeRecord = __webpack_require__(1361); var _makeRecord2 = _interopRequireDefault(_makeRecord); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function InitialState() { return (0, _makeRecord2.default)({ expanded: null })(); } /* 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 . */ /** * Source tree reducer * @module reducers/source-tree */ function update(state = InitialState(), action) { switch (action.type) { case "SET_EXPANDED_STATE": return state.set("expanded", action.expanded); } return state; } function getExpandedState(state) { return state.sourceTree.get("expanded"); } /***/ }), /* 1427 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = getVisibleBreakpoints; var _breakpoints = __webpack_require__(1378); var _sources = __webpack_require__(1369); var _devtoolsSourceMap = __webpack_require__(1360); function getLocation(breakpoint, isGeneratedSource) { return isGeneratedSource ? breakpoint.generatedLocation || breakpoint.location : breakpoint.location; } /* 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 . */ function formatBreakpoint(breakpoint, selectedSource) { const { condition, loading, disabled, hidden } = breakpoint; const sourceId = selectedSource.get("id"); const isGeneratedSource = (0, _devtoolsSourceMap.isGeneratedId)(sourceId); return { location: getLocation(breakpoint, isGeneratedSource), condition, loading, disabled, hidden }; } function isVisible(breakpoint, selectedSource) { const sourceId = selectedSource.get("id"); const isGeneratedSource = (0, _devtoolsSourceMap.isGeneratedId)(sourceId); const location = getLocation(breakpoint, isGeneratedSource); return location.sourceId === sourceId; } /* * Finds the breakpoints, which appear in the selected source. * * This */ function getVisibleBreakpoints(state) { const selectedSource = (0, _sources.getSelectedSource)(state); if (!selectedSource) { return null; } return (0, _breakpoints.getBreakpoints)(state).filter(bp => isVisible(bp, selectedSource)).map(bp => formatBreakpoint(bp, selectedSource)); } /***/ }), /* 1428 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; exports.createFrame = createFrame; exports.createSource = createSource; exports.createPause = createPause; exports.createBreakpointLocation = createBreakpointLocation; /* 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 . */ // This module converts Firefox specific types to the generic types function createFrame(frame) { let title; if (frame.type == "call") { const c = frame.callee; title = c.name || c.userDisplayName || c.displayName || L10N.getStr("anonymous"); } else { title = `(${frame.type})`; } const location = { sourceId: frame.where.source.actor, line: frame.where.line, column: frame.where.column }; return { id: frame.actor, displayName: title, location, generatedLocation: location, this: frame.this, scope: frame.environment }; } function createSource(source, { supportsWasm }) { return { id: source.actor, url: source.url, isPrettyPrinted: false, isWasm: supportsWasm && source.introductionType === "wasm", sourceMapURL: source.sourceMapURL, isBlackBoxed: false, loadedState: "unloaded" }; } function createPause(packet, response) { // NOTE: useful when the debugger is already paused const frame = packet.frame || response.frames[0]; return _extends({}, packet, { frame: createFrame(frame), frames: response.frames.map(createFrame) }); } // Firefox only returns `actualLocation` if it actually changed, // but we want it always to exist. Format `actualLocation` if it // exists, otherwise use `location`. function createBreakpointLocation(location, actualLocation) { if (!actualLocation) { return location; } return { sourceId: actualLocation.source.actor, sourceUrl: actualLocation.source.url, line: actualLocation.line, column: actualLocation.column }; } /***/ }), /* 1429 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fromServerLocation = fromServerLocation; exports.toServerLocation = toServerLocation; exports.createFrame = createFrame; exports.createLoadedObject = createLoadedObject; /* 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 . */ function fromServerLocation(serverLocation) { if (serverLocation) { return { sourceId: serverLocation.scriptId, line: serverLocation.lineNumber + 1, column: serverLocation.columnNumber, sourceUrl: "" }; } } function toServerLocation(location) { return { scriptId: location.sourceId, lineNumber: location.line - 1 }; } function createFrame(frame) { return { id: frame.callFrameId, displayName: frame.functionName, scopeChain: frame.scopeChain, generatedLocation: frame.location, location: fromServerLocation(frame.location) }; } function createLoadedObject(serverObject, parentId) { const { value, name } = serverObject; return { objectId: value.objectId, parentId, name, value }; } /***/ }), /* 1430 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ exports.bootstrapStore = bootstrapStore; exports.bootstrapApp = bootstrapApp; exports.bootstrapWorkers = bootstrapWorkers; exports.teardownWorkers = teardownWorkers; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _redux = __webpack_require__(3); var _reactDom = __webpack_require__(4); var _reactDom2 = _interopRequireDefault(_reactDom); var _devtoolsConfig = __webpack_require__(1355); var _devtoolsLaunchpad = __webpack_require__(1362); var _devtoolsSourceMap = __webpack_require__(1360); var _search = __webpack_require__(1395); var _prettyPrint = __webpack_require__(1431); var _parser = __webpack_require__(1365); var _createStore = __webpack_require__(1658); var _createStore2 = _interopRequireDefault(_createStore); var _reducers = __webpack_require__(1516); var _reducers2 = _interopRequireDefault(_reducers); var _selectors = __webpack_require__(1352); var _selectors2 = _interopRequireDefault(_selectors); var _App = __webpack_require__(1518); var _App2 = _interopRequireDefault(_App); var _prefs = __webpack_require__(226); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function bootstrapStore(client, { services, toolboxActions }) { const createStore = (0, _createStore2.default)({ log: (0, _devtoolsConfig.isTesting)() || (0, _devtoolsConfig.getValue)("logging.actions"), timing: (0, _devtoolsConfig.isDevelopment)(), makeThunkArgs: (args, state) => { return _extends({}, args, { client }, services, toolboxActions); } }); const store = createStore((0, _redux.combineReducers)(_reducers2.default)); store.subscribe(() => updatePrefs(store.getState())); const actions = (0, _redux.bindActionCreators)(__webpack_require__(1354).default, store.dispatch); return { store, actions, selectors: _selectors2.default }; } function bootstrapApp(connection, { store, actions }) { window.appStore = store; // Expose the bound actions so external things can do things like // selecting a source. window.actions = { selectLocation: actions.selectLocation, selectSourceURL: actions.selectSourceURL }; (0, _devtoolsLaunchpad.renderRoot)(_react2.default, _reactDom2.default, _App2.default, store); } function bootstrapWorkers() { if (!(0, _devtoolsConfig.isFirefoxPanel)()) { // When used in Firefox, the toolbox manages the source map worker. (0, _devtoolsSourceMap.startSourceMapWorker)((0, _devtoolsConfig.getValue)("workers.sourceMapURL")); } (0, _prettyPrint.startPrettyPrintWorker)((0, _devtoolsConfig.getValue)("workers.prettyPrintURL")); (0, _parser.startParserWorker)((0, _devtoolsConfig.getValue)("workers.parserURL")); (0, _search.startSearchWorker)((0, _devtoolsConfig.getValue)("workers.searchURL")); } function teardownWorkers() { if (!(0, _devtoolsConfig.isFirefoxPanel)()) { // When used in Firefox, the toolbox manages the source map worker. (0, _devtoolsSourceMap.stopSourceMapWorker)(); } (0, _prettyPrint.stopPrettyPrintWorker)(); (0, _parser.stopParserWorker)(); (0, _search.stopSearchWorker)(); } function updatePrefs(state) { const pendingBreakpoints = _selectors2.default.getPendingBreakpoints(state); if (_prefs.prefs.pendingBreakpoints !== pendingBreakpoints) { _prefs.prefs.pendingBreakpoints = pendingBreakpoints; } } /***/ }), /* 1431 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.stopPrettyPrintWorker = exports.startPrettyPrintWorker = undefined; exports.prettyPrint = prettyPrint; var _devtoolsUtils = __webpack_require__(1363); var _source = __webpack_require__(1356); var _assert = __webpack_require__(1384); var _assert2 = _interopRequireDefault(_assert); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const { WorkerDispatcher } = _devtoolsUtils.workerUtils; /* 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 . */ const dispatcher = new WorkerDispatcher(); const startPrettyPrintWorker = exports.startPrettyPrintWorker = dispatcher.start.bind(dispatcher); const stopPrettyPrintWorker = exports.stopPrettyPrintWorker = dispatcher.stop.bind(dispatcher); const _prettyPrint = dispatcher.task("prettyPrint"); async function prettyPrint({ source, url }) { const indent = 2; (0, _assert2.default)((0, _source.isJavaScript)(source), "Can't prettify non-javascript files."); return await _prettyPrint({ url, indent, sourceText: source.get("text") }); } /***/ }), /* 1432 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.reportException = reportException; exports.executeSoon = executeSoon; var _assert = __webpack_require__(1384); var _assert2 = _interopRequireDefault(_assert); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function reportException(who, exception) { const msg = `${who} threw an exception: `; console.error(msg, exception); } /* 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 . */ function executeSoon(fn) { setTimeout(fn, 0); } exports.default = _assert2.default; /***/ }), /* 1433 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.addSearchQuery = addSearchQuery; exports.clearSearchQuery = clearSearchQuery; exports.clearSearchResults = clearSearchResults; exports.updateSearchStatus = updateSearchStatus; exports.closeProjectSearch = closeProjectSearch; exports.searchSources = searchSources; exports.searchSource = searchSource; var _search = __webpack_require__(1395); var _selectors = __webpack_require__(1352); var _source = __webpack_require__(1356); var _sources = __webpack_require__(1373); var _projectTextSearch = __webpack_require__(1424); function addSearchQuery(query) { return ({ dispatch, getState }) => { dispatch({ type: "ADD_QUERY", query }); }; } /* 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 . */ /** * Redux actions for the search state * @module actions/search */ function clearSearchQuery() { return ({ dispatch, getState }) => { dispatch({ type: "CLEAR_QUERY" }); }; } function clearSearchResults() { return ({ dispatch, getState }) => { dispatch({ type: "CLEAR_SEARCH_RESULTS" }); }; } function updateSearchStatus(status) { return { type: "UPDATE_STATUS", status }; } function closeProjectSearch() { return { type: "CLOSE_PROJECT_SEARCH" }; } function searchSources(query) { return async ({ dispatch, getState }) => { await dispatch(clearSearchResults()); await dispatch(addSearchQuery(query)); dispatch(updateSearchStatus(_projectTextSearch.statusType.fetching)); await dispatch((0, _sources.loadAllSources)()); const sources = (0, _selectors.getSources)(getState()); const validSources = sources.valueSeq().filter(source => (0, _source.isLoaded)(source) && !(0, _source.isThirdParty)(source)); for (const source of validSources) { await dispatch(searchSource(source.get("id"), query)); } }; } function searchSource(sourceId, query) { return async ({ dispatch, getState }) => { const sourceRecord = (0, _selectors.getSource)(getState(), sourceId); if (!sourceRecord) { return; } const matches = await (0, _search.findSourceMatches)(sourceRecord.toJS(), query); dispatch({ type: "ADD_SEARCH_RESULT", result: { sourceId: sourceRecord.get("id"), filepath: sourceRecord.get("url"), matches } }); if (matches.length) { dispatch(updateSearchStatus(_projectTextSearch.statusType.done)); } }; } /***/ }), /* 1434 */, /* 1435 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.loadSourceText = loadSourceText; var _devtoolsSourceMap = __webpack_require__(1360); var _promise = __webpack_require__(1653); var _ast = __webpack_require__(1399); var _selectors = __webpack_require__(1352); var _parser = __webpack_require__(1365); var _source = __webpack_require__(1356); /* 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 . */ const requests = new Map(); async function loadSource(source, { sourceMaps, client }) { const id = source.get("id"); if ((0, _devtoolsSourceMap.isOriginalId)(id)) { return await sourceMaps.getOriginalSourceText(source.toJS()); } const response = await client.sourceContents(id); return { id, text: response.source, contentType: response.contentType || "text/javascript" }; } function defer() { let resolve = () => {}; let reject = () => {}; const promise = new Promise((_res, _rej) => { resolve = _res; reject = _rej; }); return { resolve, reject, promise }; } /** * @memberof actions/sources * @static */ function loadSourceText(source) { return async ({ dispatch, getState, client, sourceMaps }) => { const deferred = defer(); // Fetch the source text only once. if ((0, _source.isLoaded)(source)) { return Promise.resolve(source); } const id = source.get("id"); if ((0, _source.isLoading)(source) || requests.has(id)) { return requests.get(id); } requests.set(id, deferred.promise); await dispatch({ type: "LOAD_SOURCE_TEXT", sourceId: id, [_promise.PROMISE]: loadSource(source, { sourceMaps, client }) }); const newSource = (0, _selectors.getSource)(getState(), source.get("id")).toJS(); if (newSource.isWasm) { return; } if ((0, _devtoolsSourceMap.isOriginalId)(newSource.id)) { const generatedSource = (0, _selectors.getGeneratedSource)(getState(), source.toJS()); await dispatch(loadSourceText(generatedSource)); } await (0, _parser.setSource)(newSource); dispatch((0, _ast.setSymbols)(id)); // signal that the action is finished deferred.resolve(); requests.delete(id); }; } /***/ }), /* 1436 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.showLoading = exports.showSourceText = exports.updateDocument = exports.updateLineNumberFormat = exports.resetLineNumberFormat = exports.clearDocuments = exports.removeDocument = exports.hasDocument = exports.setDocument = exports.getDocument = undefined; var _source = __webpack_require__(1356); var _wasm = __webpack_require__(1401); var _ui = __webpack_require__(1439); let sourceDocs = {}; /* 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 . */ function getDocument(key) { return sourceDocs[key]; } function hasDocument(key) { return !!getDocument(key); } function setDocument(key, doc) { sourceDocs[key] = doc; } function removeDocument(key) { delete sourceDocs[key]; } function clearDocuments() { sourceDocs = {}; } function resetLineNumberFormat(editor) { const cm = editor.codeMirror; cm.setOption("lineNumberFormatter", number => number); (0, _ui.resizeBreakpointGutter)(cm); (0, _ui.resizeToggleButton)(cm); } function updateLineNumberFormat(editor, sourceId) { if (!(0, _wasm.isWasm)(sourceId)) { return resetLineNumberFormat(editor); } const cm = editor.codeMirror; const lineNumberFormatter = (0, _wasm.getWasmLineNumberFormatter)(sourceId); cm.setOption("lineNumberFormatter", lineNumberFormatter); (0, _ui.resizeBreakpointGutter)(cm); (0, _ui.resizeToggleButton)(cm); } function updateDocument(editor, source) { if (!source) { return; } const sourceId = source.get("id"); const doc = getDocument(sourceId) || editor.createDocument(); editor.replaceDocument(doc); updateLineNumberFormat(editor, sourceId); } function showLoading(editor) { if (hasDocument("loading")) { return; } const doc = editor.createDocument(); setDocument("loading", doc); editor.replaceDocument(doc); editor.setText(L10N.getStr("loadingText")); editor.setMode({ name: "text" }); } function setEditorText(editor, source) { const { text, id: sourceId } = source; if (source.isWasm) { const wasmLines = (0, _wasm.renderWasmText)(sourceId, text); // cm will try to split into lines anyway, saving memory const wasmText = { split: () => wasmLines, match: () => false }; editor.setText(wasmText); } else { editor.setText(text); } } /** * Handle getting the source document or creating a new * document with the correct mode and text. */ function showSourceText(editor, source, sourceMetaData) { if (!source) { return; } if (hasDocument(source.id)) { const doc = getDocument(source.id); if (editor.codeMirror.doc === doc) { editor.setMode((0, _source.getMode)(source, sourceMetaData)); return; } editor.replaceDocument(doc); updateLineNumberFormat(editor, source.id); editor.setMode((0, _source.getMode)(source, sourceMetaData)); return doc; } const doc = editor.createDocument(); setDocument(source.id, doc); editor.replaceDocument(doc); setEditorText(editor, source); editor.setMode((0, _source.getMode)(source, sourceMetaData)); updateLineNumberFormat(editor, source.id); } exports.getDocument = getDocument; exports.setDocument = setDocument; exports.hasDocument = hasDocument; exports.removeDocument = removeDocument; exports.clearDocuments = clearDocuments; exports.resetLineNumberFormat = resetLineNumberFormat; exports.updateLineNumberFormat = updateLineNumberFormat; exports.updateDocument = updateDocument; exports.showSourceText = showSourceText; exports.showLoading = showLoading; /***/ }), /* 1437 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.sanitizeInput = sanitizeInput; exports.wrapExpression = wrapExpression; exports.getValue = getValue; var _indentation = __webpack_require__(1438); // replace quotes that could interfere with the evaluation. function sanitizeInput(input) { return input.replace(/"/g, '"'); } /* * wrap the expression input in a try/catch so that it can be safely * evaluated. * * NOTE: we add line after the expression to protect against comments. */ /* 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 . */ function wrapExpression(input) { return (0, _indentation.correctIndentation)(` try { ${sanitizeInput(input)} } catch (e) { e } `); } function getValue(expression) { const value = expression.value; if (!value) { return { path: expression.from, value: { unavailable: true } }; } if (value.exception) { return { path: value.from, value: value.exception }; } if (value.error) { return { path: value.from, value: value.error }; } if (value.result && value.result.class == "Error") { const { name, message } = value.result.preview; const newValue = name === "ReferenceError" ? { unavailable: true } : `${name}: ${message}`; return { path: value.input, value: newValue }; } if (typeof value.result == "object") { return { path: value.result.actor, value: value.result }; } return { path: value.input, value: value.result }; } /***/ }), /* 1438 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.correctIndentation = correctIndentation; /* 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 . */ function getIndentation(lines) { const firstLine = lines[0]; const secondLine = lines[1]; const lastLine = lines[lines.length - 1]; const _getIndentation = line => line && line.match(/^\s*/)[0].length; const indentations = [_getIndentation(firstLine), _getIndentation(secondLine), _getIndentation(lastLine)]; return Math.max(...indentations); } function correctIndentation(text) { const lines = text.trim().split("\n"); const indentation = getIndentation(lines); const formattedLines = lines.map(_line => _line.replace(new RegExp(`^\\s{0,${indentation - 1}}`), "")); return formattedLines.join("\n"); } /***/ }), /* 1439 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isVisible = isVisible; exports.getLineNumberWidth = getLineNumberWidth; exports.resizeBreakpointGutter = resizeBreakpointGutter; exports.resizeToggleButton = resizeToggleButton; /* 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 . */ /* Checks to see if the root element is available and * if the element is visible. We check the width of the element * because it is more reliable than either checking a focus state or * the visibleState or hidden property. */ function isVisible() { const el = document.querySelector("#mount"); return el && el.getBoundingClientRect().width; } /* Gets the line numbers width in the code editor */ function getLineNumberWidth(editor) { const gutters = editor.display.gutters; const lineNumbers = gutters.querySelector(".CodeMirror-linenumbers"); return lineNumbers && lineNumbers.clientWidth; } /** * Forces the breakpoint gutter to be the same size as the line * numbers gutter. Editor CSS will absolutely position the gutter * beneath the line numbers. This makes it easy to be flexible with * how we overlay breakpoints. */ function resizeBreakpointGutter(editor) { const gutters = editor.display.gutters; const breakpoints = gutters.querySelector(".breakpoints"); if (breakpoints) { breakpoints.style.width = `${getLineNumberWidth(editor)}px`; } } /** * Forces the left toggle button in source header to be the same size * as the line numbers gutter. */ function resizeToggleButton(editor) { const toggleButton = document.querySelector(".source-header .toggle-button-start"); if (toggleButton) { toggleButton.style.width = `${getLineNumberWidth(editor)}px`; } } /***/ }), /* 1440 */ /***/ (function(module, exports, __webpack_require__) { const SplitBox = __webpack_require__(1536); module.exports = SplitBox; /***/ }), /* 1441 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const Tree = __webpack_require__(1541); module.exports = { Tree }; /***/ }), /* 1442 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _formatTree = __webpack_require__(1542); Object.defineProperty(exports, "formatTree", { enumerable: true, get: function () { return _formatTree.formatTree; } }); var _addToTree = __webpack_require__(1443); Object.defineProperty(exports, "addToTree", { enumerable: true, get: function () { return _addToTree.addToTree; } }); var _sortTree = __webpack_require__(1544); Object.defineProperty(exports, "sortTree", { enumerable: true, get: function () { return _sortTree.sortTree; } }); Object.defineProperty(exports, "sortEntireTree", { enumerable: true, get: function () { return _sortTree.sortEntireTree; } }); var _collapseTree = __webpack_require__(1444); Object.defineProperty(exports, "collapseTree", { enumerable: true, get: function () { return _collapseTree.collapseTree; } }); var _getDirectories = __webpack_require__(1545); Object.defineProperty(exports, "getDirectories", { enumerable: true, get: function () { return _getDirectories.getDirectories; } }); var _createTree = __webpack_require__(1546); Object.defineProperty(exports, "createTree", { enumerable: true, get: function () { return _createTree.createTree; } }); var _getURL = __webpack_require__(1405); Object.defineProperty(exports, "getURL", { enumerable: true, get: function () { return _getURL.getURL; } }); Object.defineProperty(exports, "getFilenameFromPath", { enumerable: true, get: function () { return _getURL.getFilenameFromPath; } }); var _utils = __webpack_require__(1371); Object.defineProperty(exports, "nodeHasChildren", { enumerable: true, get: function () { return _utils.nodeHasChildren; } }); Object.defineProperty(exports, "isExactUrlMatch", { enumerable: true, get: function () { return _utils.isExactUrlMatch; } }); Object.defineProperty(exports, "isDirectory", { enumerable: true, get: function () { return _utils.isDirectory; } }); Object.defineProperty(exports, "createNode", { enumerable: true, get: function () { return _utils.createNode; } }); Object.defineProperty(exports, "createParentMap", { enumerable: true, get: function () { return _utils.createParentMap; } }); Object.defineProperty(exports, "getRelativePath", { enumerable: true, get: function () { return _utils.getRelativePath; } }); Object.defineProperty(exports, "isNotJavaScript", { enumerable: true, get: function () { return _utils.isNotJavaScript; } }); /***/ }), /* 1443 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.addToTree = addToTree; var _utils = __webpack_require__(1371); var _treeOrder = __webpack_require__(1543); var _getURL = __webpack_require__(1405); function createNodeInTree(part, path, tree, index) { const node = (0, _utils.createNode)(part, path, []); // we are modifying the tree const contents = tree.contents.slice(0); contents.splice(index, 0, node); tree.contents = contents; return node; } /* * Look for the child directory * 1. if it exists return it * 2. if it does not exist create it * 3. if it is a file, replace it with a directory */ /* 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 . */ function findOrCreateNode(parts, subTree, path, part, index, url, debuggeeHost) { const addedPartIsFile = (0, _utils.partIsFile)(index, parts, url); const { found: childFound, index: childIndex } = (0, _treeOrder.findNodeInContents)(subTree, (0, _treeOrder.createTreeNodeMatcher)(part, !addedPartIsFile, debuggeeHost)); // we create and enter the new node if (!childFound) { return createNodeInTree(part, path, subTree, childIndex); } // we found a path with the same name as the part. We need to determine // if this is the correct child, or if we have a naming conflict const child = subTree.contents[childIndex]; const childIsFile = !(0, _utils.nodeHasChildren)(child); // if we have a naming conflict, we'll create a new node if (childIsFile && !addedPartIsFile || !childIsFile && addedPartIsFile) { return createNodeInTree(part, path, subTree, childIndex); } // if there is no naming conflict, we can traverse into the child return child; } /* * walk the source tree to the final node for a given url, * adding new nodes along the way */ function traverseTree(url, tree, debuggeeHost) { url.path = decodeURIComponent(url.path); const parts = url.path.split("/").filter(p => p !== ""); parts.unshift(url.group); let path = ""; return parts.reduce((subTree, part, index) => { path = `${path}/${part}`; const debuggeeHostIfRoot = index === 0 ? debuggeeHost : null; return findOrCreateNode(parts, subTree, path, part, index, url, debuggeeHostIfRoot); }, tree); } /* * Add a source file to a directory node in the tree */ function addSourceToNode(node, url, source) { const isFile = !(0, _utils.isDirectory)(url); // if we have a file, and the subtree has no elements, overwrite the // subtree contents with the source if (isFile) { return source; } const { filename } = url; const { found: childFound, index: childIndex } = (0, _treeOrder.findNodeInContents)(node, (0, _treeOrder.createTreeNodeMatcher)(filename, false, null)); // if we are readding an existing file in the node, overwrite the existing // file and return the node's contents if (childFound) { const existingNode = node.contents[childIndex]; existingNode.contents = source; return node.contents; } // if this is a new file, add the new file; const newNode = (0, _utils.createNode)(filename, source.get("url"), source); const contents = node.contents.slice(0); contents.splice(childIndex, 0, newNode); return contents; } /** * @memberof utils/sources-tree * @static */ function addToTree(tree, source, debuggeeUrl, projectRoot) { const url = (0, _getURL.getURL)(source.get("url"), debuggeeUrl); const debuggeeHost = (0, _treeOrder.getDomain)(debuggeeUrl); if ((0, _utils.isInvalidUrl)(url, source)) { return; } const finalNode = traverseTree(url, tree, debuggeeHost); finalNode.contents = addSourceToNode(finalNode, url, source); } /***/ }), /* 1444 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.collapseTree = collapseTree; var _utils = __webpack_require__(1371); /** * Take an existing source tree, and return a new one with collapsed nodes. */ function collapseTree(node, depth = 0) { // Node is a folder. if (Array.isArray(node.contents)) { // Node is not a root/domain node, and only contains 1 item. if (depth > 1 && node.contents.length === 1) { const next = node.contents[0]; // Do not collapse if the next node is a leaf node. if ((0, _utils.nodeHasChildren)(next)) { return collapseTree((0, _utils.createNode)(`${node.name}/${next.name}`, next.path, next.contents), depth + 1); } } // Map the contents. return (0, _utils.createNode)(node.name, node.path, node.contents.map(next => collapseTree(next, depth + 1))); } // Node is a leaf, not a folder, do not modify it. return node; } /* 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 . */ /***/ }), /* 1445 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); __webpack_require__(1316); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class ResultList extends _react.Component { constructor(props) { super(props); this.renderListItem = this.renderListItem.bind(this); } renderListItem(item, index) { const { selectItem, selected } = this.props; const props = { onClick: event => selectItem(event, item, index), key: `${item.id}${item.value}${index}`, ref: String(index), title: item.value, className: (0, _classnames2.default)("result-item", { selected: index === selected }) }; return _react2.default.createElement( "li", props, _react2.default.createElement( "div", { className: "title" }, item.title ), _react2.default.createElement( "div", { className: "subtitle" }, item.subtitle ) ); } render() { const { size, items } = this.props; return _react2.default.createElement( "ul", { className: (0, _classnames2.default)("result-list", size) }, items.map(this.renderListItem) ); } } exports.default = ResultList; /* 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 . */ ResultList.defaultProps = { size: "small" }; /***/ }), /* 1446 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _lodash = __webpack_require__(2); var _frame = __webpack_require__(1380); __webpack_require__(1320); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ function getFunctionName(func) { const name = func.userDisplayName || func.displayName || func.name; return (0, _frame.simplifyDisplayName)(name); } class PreviewFunction extends _react.Component { renderFunctionName(func) { const name = getFunctionName(func); return _react2.default.createElement( "span", { className: "function-name" }, name ); } renderParams(func) { const { parameterNames = [] } = func; const params = parameterNames.filter(i => i).map(param => _react2.default.createElement( "span", { className: "param", key: param }, param )); const commas = (0, _lodash.times)(params.length - 1).map((_, i) => _react2.default.createElement( "span", { className: "delimiter", key: i }, ", " )); return (0, _lodash.flatten)((0, _lodash.zip)(params, commas)); } render() { return _react2.default.createElement( "span", { className: "function-signature" }, this.renderFunctionName(this.props.func), _react2.default.createElement( "span", { className: "paren" }, "(" ), this.renderParams(this.props.func), _react2.default.createElement( "span", { className: "paren" }, ")" ) ); } } exports.default = PreviewFunction; /***/ }), /* 1447 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // Dependencies const React = __webpack_require__(0); const { containsURL, isURL, escapeString, getGripType, rawCropString, sanitizeString, wrapRender, tokenSplitRegex } = __webpack_require__(1353); // Shortcuts const { a, span } = React.DOM; /** * Renders a string. String value is enclosed within quotes. */ StringRep.propTypes = { useQuotes: React.PropTypes.bool, escapeWhitespace: React.PropTypes.bool, style: React.PropTypes.object, object: React.PropTypes.string.isRequired, member: React.PropTypes.any, cropLimit: React.PropTypes.number, openLink: React.PropTypes.func, omitLinkHref: React.PropTypes.bool }; function StringRep(props) { let { cropLimit, object: text, member, style, useQuotes = true, escapeWhitespace = true, openLink, omitLinkHref = true } = props; let config = { className: "objectBox objectBox-string" }; if (style) { config.style = style; } if (useQuotes) { text = escapeString(text, escapeWhitespace); } else { text = sanitizeString(text); } if ((!member || !member.open) && cropLimit) { text = rawCropString(text, cropLimit); } if (!containsURL(text)) { return span(config, text); } const items = []; // As we walk through the tokens of the source string, we make sure to preserve // the original whitespace that separated the tokens. let tokens = text.split(tokenSplitRegex); let textIndex = 0; let tokenStart; tokens.forEach((token, i) => { tokenStart = text.indexOf(token, textIndex); if (isURL(token)) { items.push(text.slice(textIndex, tokenStart)); textIndex = tokenStart + token.length; items.push(a({ className: "url", title: token, href: omitLinkHref === true ? null : token, draggable: false, onClick: openLink ? e => { e.preventDefault(); openLink(token); } : null }, token)); } }); // Clean up any non-URL text at the end of the source string. items.push(text.slice(textIndex, text.length)); return span(config, ...items); } function supportsObject(object, noGrip = false) { return getGripType(object, noGrip) == "string"; } // Exports from this module module.exports = { rep: wrapRender(StringRep), supportsObject }; /***/ }), /* 1448 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // Dependencies const React = __webpack_require__(0); const { wrapRender } = __webpack_require__(1353); const { MODE } = __webpack_require__(1357); const ModePropType = React.PropTypes.oneOf( // @TODO Change this to Object.values once it's supported in Node's version of V8 Object.keys(MODE).map(key => MODE[key])); // Shortcuts const DOM = React.DOM; /** * Renders an array. The array is enclosed by left and right bracket * and the max number of rendered items depends on the current mode. */ ArrayRep.propTypes = { mode: ModePropType, object: React.PropTypes.array.isRequired }; function ArrayRep(props) { let { object, mode = MODE.SHORT } = props; let items; let brackets; let needSpace = function (space) { return space ? { left: "[ ", right: " ]" } : { left: "[", right: "]" }; }; if (mode === MODE.TINY) { let isEmpty = object.length === 0; if (isEmpty) { items = []; } else { items = [DOM.span({ className: "more-ellipsis", title: "more…" }, "…")]; } brackets = needSpace(false); } else { items = arrayIterator(props, object, maxLengthMap.get(mode)); brackets = needSpace(items.length > 0); } return DOM.span({ className: "objectBox objectBox-array" }, DOM.span({ className: "arrayLeftBracket" }, brackets.left), ...items, DOM.span({ className: "arrayRightBracket" }, brackets.right), DOM.span({ className: "arrayProperties", role: "group" })); } function arrayIterator(props, array, max) { let items = []; for (let i = 0; i < array.length && i < max; i++) { let config = { mode: MODE.TINY, delim: i == array.length - 1 ? "" : ", " }; let item; try { item = ItemRep(Object.assign({}, props, config, { object: array[i] })); } catch (exc) { item = ItemRep(Object.assign({}, props, config, { object: exc })); } items.push(item); } if (array.length > max) { items.push(DOM.span({ className: "more-ellipsis", title: "more…" }, "…")); } return items; } /** * Renders array item. Individual values are separated by a comma. */ ItemRep.propTypes = { object: React.PropTypes.any.isRequired, delim: React.PropTypes.string.isRequired, mode: ModePropType }; function ItemRep(props) { const { Rep } = __webpack_require__(1372); let { object, delim, mode } = props; return DOM.span({}, Rep(Object.assign({}, props, { object: object, mode: mode })), delim); } function supportsObject(object) { return Array.isArray(object) || Object.prototype.toString.call(object) === "[object Arguments]"; } const maxLengthMap = new Map(); maxLengthMap.set(MODE.SHORT, 3); maxLengthMap.set(MODE.LONG, 10); // Exports from this module module.exports = { rep: wrapRender(ArrayRep), supportsObject, maxLengthMap }; /***/ }), /* 1449 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ module.exports = { ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, CDATA_SECTION_NODE: 4, ENTITY_REFERENCE_NODE: 5, ENTITY_NODE: 6, PROCESSING_INSTRUCTION_NODE: 7, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_TYPE_NODE: 10, DOCUMENT_FRAGMENT_NODE: 11, NOTATION_NODE: 12, // DocumentPosition DOCUMENT_POSITION_DISCONNECTED: 0x01, DOCUMENT_POSITION_PRECEDING: 0x02, DOCUMENT_POSITION_FOLLOWING: 0x04, DOCUMENT_POSITION_CONTAINS: 0x08, DOCUMENT_POSITION_CONTAINED_BY: 0x10, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 0x20 }; /***/ }), /* 1450 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // Dependencies const React = __webpack_require__(0); const { getGripType, isGrip, wrapRender } = __webpack_require__(1353); const { MODE } = __webpack_require__(1357); // Shortcuts const { span } = React.DOM; /** * Renders an array. The array is enclosed by left and right bracket * and the max number of rendered items depends on the current mode. */ GripArray.propTypes = { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), provider: React.PropTypes.object, onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func }; function GripArray(props) { let { object, mode = MODE.SHORT } = props; let items; let brackets; let needSpace = function (space) { return space ? { left: "[ ", right: " ]" } : { left: "[", right: "]" }; }; if (mode === MODE.TINY) { let objectLength = getLength(object); let isEmpty = objectLength === 0; if (isEmpty) { items = []; } else { items = [span({ className: "more-ellipsis", title: "more…" }, "…")]; } brackets = needSpace(false); } else { let max = maxLengthMap.get(mode); items = arrayIterator(props, object, max); brackets = needSpace(items.length > 0); } let title = getTitle(props, object); return span({ "data-link-actor-id": object.actor, className: "objectBox objectBox-array" }, title, span({ className: "arrayLeftBracket" }, brackets.left), ...interleaveCommas(items), span({ className: "arrayRightBracket" }, brackets.right), span({ className: "arrayProperties", role: "group" })); } function interleaveCommas(items) { return items.reduce((res, item, index) => { if (index !== items.length - 1) { return res.concat(item, ", "); } return res.concat(item); }, []); } function getLength(grip) { if (!grip.preview) { return 0; } return grip.preview.length || grip.preview.childNodesLength || 0; } function getTitle(props, object) { if (props.mode === MODE.TINY) { return ""; } let title = props.title || object.class || "Array"; return span({ className: "objectTitle" }, title + " "); } function getPreviewItems(grip) { if (!grip.preview) { return null; } return grip.preview.items || grip.preview.childNodes || []; } function arrayIterator(props, grip, max) { let { Rep } = __webpack_require__(1372); let items = []; const gripLength = getLength(grip); if (!gripLength) { return items; } const previewItems = getPreviewItems(grip); let provider = props.provider; let emptySlots = 0; let foldedEmptySlots = 0; items = previewItems.reduce((res, itemGrip) => { if (res.length >= max) { return res; } let object; try { if (!provider && itemGrip === null) { emptySlots++; return res; } object = provider ? provider.getValue(itemGrip) : itemGrip; } catch (exc) { object = exc; } if (emptySlots > 0) { res.push(getEmptySlotsElement(emptySlots)); foldedEmptySlots = foldedEmptySlots + emptySlots - 1; emptySlots = 0; } if (res.length < max) { res.push(Rep(Object.assign({}, props, { object, mode: MODE.TINY, // Do not propagate title to array items reps title: undefined }))); } return res; }, []); // Handle trailing empty slots if there are some. if (items.length < max && emptySlots > 0) { items.push(getEmptySlotsElement(emptySlots)); foldedEmptySlots = foldedEmptySlots + emptySlots - 1; } const itemsShown = items.length + foldedEmptySlots; if (gripLength > itemsShown) { items.push(span({ className: "more-ellipsis", title: "more…" }, "…")); } return items; } function getEmptySlotsElement(number) { // TODO: Use l10N - See https://github.com/devtools-html/reps/issues/141 return `<${number} empty slot${number > 1 ? "s" : ""}>`; } function supportsObject(grip, noGrip = false) { if (noGrip === true || !isGrip(grip)) { return false; } return grip.preview && (grip.preview.kind == "ArrayLike" || getGripType(grip, noGrip) === "DocumentFragment"); } const maxLengthMap = new Map(); maxLengthMap.set(MODE.SHORT, 3); maxLengthMap.set(MODE.LONG, 10); // Exports from this module module.exports = { rep: wrapRender(GripArray), supportsObject, maxLengthMap }; /***/ }), /* 1451 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // Dependencies const React = __webpack_require__(0); // Shortcuts const { span } = React.DOM; const { wrapRender } = __webpack_require__(1353); const PropRep = __webpack_require__(1381); const { MODE } = __webpack_require__(1357); /** * Renders an map entry. A map entry is represented by its key, a column and its value. */ GripMapEntry.propTypes = { object: React.PropTypes.object, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func }; function GripMapEntry(props) { const { object } = props; const { key, value } = object.preview; return span({ className: "objectBox objectBox-map-entry" }, ...PropRep(Object.assign({}, props, { name: key, object: value, equal: " \u2192 ", title: null, suppressQuotes: false }))); } function supportsObject(grip, noGrip = false) { if (noGrip === true) { return false; } return grip && grip.type === "mapEntry" && grip.preview; } function createGripMapEntry(key, value) { return { type: "mapEntry", preview: { key, value } }; } // Exports from this module module.exports = { rep: wrapRender(GripMapEntry), createGripMapEntry, supportsObject }; /***/ }), /* 1452 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const get = __webpack_require__(67); const has = __webpack_require__(307); const { maybeEscapePropertyName } = __webpack_require__(1353); const ArrayRep = __webpack_require__(1448); const GripArrayRep = __webpack_require__(1450); const GripMapEntryRep = __webpack_require__(1451); const NODE_TYPES = { BUCKET: Symbol("[n…n]"), DEFAULT_PROPERTIES: Symbol("[default properties]"), ENTRIES: Symbol(""), GET: Symbol(""), GRIP: Symbol("GRIP"), MAP_ENTRY_KEY: Symbol(""), MAP_ENTRY_VALUE: Symbol(""), PROMISE_REASON: Symbol(""), PROMISE_STATE: Symbol(""), PROMISE_VALUE: Symbol(""), SET: Symbol(""), PROTOTYPE: Symbol("__proto__") }; let WINDOW_PROPERTIES = {}; if (typeof window === "object") { WINDOW_PROPERTIES = Object.getOwnPropertyNames(window); } const SAFE_PATH_PREFIX = "##-"; function getType(item) { return item.type; } function getValue(item) { if (has(item, "contents.value")) { return get(item, "contents.value"); } if (has(item, "contents.getterValue")) { return get(item, "contents.getterValue", undefined); } if (nodeHasAccessors(item)) { return item.contents; } return undefined; } function nodeIsBucket(item) { return getType(item) === NODE_TYPES.BUCKET; } function nodeIsEntries(item) { return getType(item) === NODE_TYPES.ENTRIES; } function nodeIsMapEntry(item) { return GripMapEntryRep.supportsObject(getValue(item)); } function nodeHasChildren(item) { return Array.isArray(item.contents) || nodeIsBucket(item); } function nodeIsObject(item) { const value = getValue(item); return value && value.type === "object"; } function nodeIsArrayLike(item) { const value = getValue(item); return GripArrayRep.supportsObject(value) || ArrayRep.supportsObject(value); } function nodeIsFunction(item) { const value = getValue(item); return value && value.class === "Function"; } function nodeIsOptimizedOut(item) { const value = getValue(item); return !nodeHasChildren(item) && value && value.optimizedOut; } function nodeIsMissingArguments(item) { const value = getValue(item); return !nodeHasChildren(item) && value && value.missingArguments; } function nodeHasProperties(item) { return !nodeHasChildren(item) && nodeIsObject(item); } function nodeIsPrimitive(item) { return !nodeHasChildren(item) && !nodeHasProperties(item) && !nodeIsEntries(item) && !nodeIsMapEntry(item) && !nodeHasAccessors(item); } function nodeIsDefaultProperties(item) { return getType(item) === NODE_TYPES.DEFAULT_PROPERTIES; } function isDefaultWindowProperty(name) { return WINDOW_PROPERTIES.includes(name); } function nodeIsPromise(item) { const value = getValue(item); if (!value) { return false; } return value.class == "Promise"; } function nodeIsPrototype(item) { return getType(item) === NODE_TYPES.PROTOTYPE; } function nodeIsWindow(item) { const value = getValue(item); if (!value) { return false; } return value.class == "Window"; } function nodeIsGetter(item) { return getType(item) === NODE_TYPES.GET; } function nodeIsSetter(item) { return getType(item) === NODE_TYPES.SET; } function nodeHasAccessors(item) { return !!getNodeGetter(item) || !!getNodeSetter(item); } function nodeSupportsBucketing(item) { return nodeIsArrayLike(item) || nodeIsEntries(item); } function nodeHasEntries(item) { const value = getValue(item); if (!value) { return false; } return value.class === "Map" || value.class === "Set" || value.class === "WeakMap" || value.class === "WeakSet"; } function nodeHasAllEntriesInPreview(item) { const { preview } = getValue(item) || {}; if (!preview) { return false; } const { entries, items, length, size } = preview; return entries ? entries.length === size : items.length === length; } function makeNodesForPromiseProperties(item) { const { promiseState: { reason, value, state } } = getValue(item); const properties = []; if (state) { properties.push(createNode(item, "", `${item.path}/${SAFE_PATH_PREFIX}state`, { value: state }, NODE_TYPES.PROMISE_STATE)); } if (reason) { properties.push(createNode(item, "", `${item.path}/${SAFE_PATH_PREFIX}reason`, { value: reason }, NODE_TYPES.PROMISE_REASON)); } if (value) { properties.push(createNode(item, "", `${item.path}/${SAFE_PATH_PREFIX}value`, { value: value }, NODE_TYPES.PROMISE_VALUE)); } return properties; } function makeNodesForEntries(item) { const { path } = item; const { preview } = getValue(item); const nodeName = ""; const entriesPath = `${path}/${SAFE_PATH_PREFIX}entries`; if (nodeHasAllEntriesInPreview(item)) { let entriesNodes = []; if (preview.entries) { entriesNodes = preview.entries.map(([key, value], index) => { return createNode(item, index, `${entriesPath}/${index}`, { value: GripMapEntryRep.createGripMapEntry(key, value) }); }); } else if (preview.items) { entriesNodes = preview.items.map((value, index) => { return createNode(item, index, `${entriesPath}/${index}`, { value }); }); } return createNode(item, nodeName, entriesPath, entriesNodes, NODE_TYPES.ENTRIES); } return createNode(item, nodeName, entriesPath, null, NODE_TYPES.ENTRIES); } function makeNodesForMapEntry(item) { const nodeValue = getValue(item); if (!nodeValue || !nodeValue.preview) { return []; } const { key, value } = nodeValue.preview; const path = item.path; return [createNode(item, "", `${path}/##key`, { value: key }, NODE_TYPES.MAP_ENTRY_KEY), createNode(item, "", `${path}/##value`, { value }, NODE_TYPES.MAP_ENTRY_VALUE)]; } function getNodeGetter(item) { return get(item, "contents.get", undefined); } function getNodeSetter(item) { return get(item, "contents.set", undefined); } function makeNodesForAccessors(item) { const accessors = []; const getter = getNodeGetter(item); if (getter && getter.type !== "undefined") { accessors.push(createNode(item, "", `${item.path}/${SAFE_PATH_PREFIX}get`, { value: getter }, NODE_TYPES.GET)); } const setter = getNodeSetter(item); if (setter && setter.type !== "undefined") { accessors.push(createNode(item, "", `${item.path}/${SAFE_PATH_PREFIX}set`, { value: setter }, NODE_TYPES.SET)); } return accessors; } function sortProperties(properties) { return properties.sort((a, b) => { // Sort numbers in ascending order and sort strings lexicographically const aInt = parseInt(a, 10); const bInt = parseInt(b, 10); if (isNaN(aInt) || isNaN(bInt)) { return a > b ? 1 : -1; } return aInt - bInt; }); } function makeNumericalBuckets(propertiesNames, parent, ownProperties, startIndex = 0) { const parentPath = parent.path; const numProperties = propertiesNames.length; // We want to have at most a hundred slices. const bucketSize = 10 ** Math.max(2, Math.ceil(Math.log10(numProperties)) - 2); const numBuckets = Math.ceil(numProperties / bucketSize); let buckets = []; for (let i = 1; i <= numBuckets; i++) { const minKey = (i - 1) * bucketSize; const maxKey = Math.min(i * bucketSize - 1, numProperties - 1); if (maxKey === minKey) { const name = propertiesNames[maxKey]; buckets.push(createNode(parent, name, `${parentPath}/${name}`, ownProperties[name])); } else { const minIndex = startIndex + minKey; const maxIndex = startIndex + maxKey; const bucketKey = `${SAFE_PATH_PREFIX}bucket_${minIndex}-${maxIndex}`; const bucketName = `[${minIndex}…${maxIndex}]`; const bucketRoot = createNode(parent, bucketName, `${parentPath}/${bucketKey}`, [], NODE_TYPES.BUCKET); const bucketProperties = propertiesNames.slice(minKey, maxKey + 1); let bucketNodes; if (bucketProperties.length <= 100) { bucketNodes = bucketProperties.map(name => createNode(bucketRoot, name, `${parentPath}/${bucketKey}/${name}`, ownProperties[name])); } else { bucketNodes = makeNumericalBuckets(bucketProperties, bucketRoot, ownProperties, minIndex); } setNodeChildren(bucketRoot, bucketNodes); buckets.push(bucketRoot); } } return buckets; } function makeDefaultPropsBucket(propertiesNames, parent, ownProperties) { const parentPath = parent.path; const userPropertiesNames = []; const defaultProperties = []; propertiesNames.forEach(name => { if (isDefaultWindowProperty(name)) { defaultProperties.push(name); } else { userPropertiesNames.push(name); } }); let nodes = makeNodesForOwnProps(userPropertiesNames, parent, ownProperties); if (defaultProperties.length > 0) { const defaultPropertiesNode = createNode(parent, "[default properties]", `${parentPath}/${SAFE_PATH_PREFIX}default`, null, NODE_TYPES.DEFAULT_PROPERTIES); const defaultNodes = defaultProperties.map((name, index) => createNode(defaultPropertiesNode, maybeEscapePropertyName(name), `${parentPath}/${SAFE_PATH_PREFIX}bucket${index}/${name}`, ownProperties[name])); nodes.push(setNodeChildren(defaultPropertiesNode, defaultNodes)); } return nodes; } function makeNodesForOwnProps(propertiesNames, parent, ownProperties) { const parentPath = parent.path; return propertiesNames.map(name => createNode(parent, maybeEscapePropertyName(name), `${parentPath}/${name}`, ownProperties[name])); } function makeNodesForProperties(objProps, parent) { const { ownProperties = {}, ownSymbols, prototype, safeGetterValues } = objProps; const parentPath = parent.path; const parentValue = getValue(parent); let allProperties = Object.assign({}, ownProperties, safeGetterValues); // Ignore properties that are neither non-concrete nor getters/setters. const propertiesNames = sortProperties(Object.keys(allProperties)).filter(name => allProperties[name].hasOwnProperty("value") || allProperties[name].hasOwnProperty("getterValue") || allProperties[name].hasOwnProperty("get") || allProperties[name].hasOwnProperty("set")); const numProperties = propertiesNames.length; let nodes = []; if (nodeSupportsBucketing(parent) && numProperties > 100) { nodes = makeNumericalBuckets(propertiesNames, parent, allProperties); } else if (parentValue && parentValue.class == "Window") { nodes = makeDefaultPropsBucket(propertiesNames, parent, allProperties); } else { nodes = makeNodesForOwnProps(propertiesNames, parent, allProperties); } if (Array.isArray(ownSymbols)) { ownSymbols.forEach((ownSymbol, index) => { nodes.push(createNode(parent, ownSymbol.name, `${parentPath}/${SAFE_PATH_PREFIX}symbol-${index}`, ownSymbol.descriptor)); }, this); } if (nodeIsPromise(parent)) { nodes.push(...makeNodesForPromiseProperties(parent)); } if (nodeHasEntries(parent)) { nodes.push(makeNodesForEntries(parent)); } // Add the prototype if it exists and is not null if (prototype && prototype.type !== "null") { nodes.push(createNode(parent, "__proto__", `${parentPath}/__proto__`, { value: prototype }, NODE_TYPES.PROTOTYPE)); } return nodes; } function createNode(parent, name, path, contents, type = NODE_TYPES.GRIP) { if (contents === undefined) { return null; } // The path is important to uniquely identify the item in the entire // tree. This helps debugging & optimizes React's rendering of large // lists. The path will be separated by property name, // i.e. `{ foo: { bar: { baz: 5 }}}` will have a path of `foo/bar/baz` // for the inner object. return { parent, name, path, contents, type }; } function setNodeChildren(node, children) { node.contents = children; return node; } function getChildren(options) { const { actors = {}, getObjectEntries, getObjectProperties, item } = options; // Nodes can either have children already, or be an object with // properties that we need to go and fetch. if (nodeHasAccessors(item)) { return makeNodesForAccessors(item); } if (nodeIsMapEntry(item)) { return makeNodesForMapEntry(item); } if (nodeHasChildren(item)) { return item.contents; } if (!nodeHasProperties(item) && !nodeIsEntries(item)) { return []; } // Because we are dynamically creating the tree as the user // expands it (not precalculated tree structure), we cache child // arrays. This not only helps performance, but is necessary // because the expanded state depends on instances of nodes // being the same across renders. If we didn't do this, each // node would be a new instance every render. const key = item.path; if (actors && actors[key]) { return actors[key]; } if (nodeIsBucket(item)) { return item.contents.children; } let loadedProps; if (nodeIsEntries(item)) { // If `item` is an node, we need to get the entries // matching the parent node actor. const parent = getParent(item); loadedProps = getObjectEntries(get(getValue(parent), "actor", undefined)); } else { loadedProps = getObjectProperties(get(getValue(item), "actor", undefined)); } const { ownProperties, ownSymbols, safeGetterValues, prototype } = loadedProps || {}; if (!ownProperties && !ownSymbols && !safeGetterValues && !prototype) { return []; } let children = makeNodesForProperties(loadedProps, item); actors[key] = children; return children; } function getParent(item) { return item.parent; } module.exports = { createNode, getChildren, getParent, getValue, makeNodesForEntries, makeNodesForPromiseProperties, makeNodesForProperties, nodeHasAccessors, nodeHasAllEntriesInPreview, nodeHasChildren, nodeHasEntries, nodeHasProperties, nodeIsDefaultProperties, nodeIsEntries, nodeIsFunction, nodeIsGetter, nodeIsMapEntry, nodeIsMissingArguments, nodeIsObject, nodeIsOptimizedOut, nodeIsPrimitive, nodeIsPromise, nodeIsPrototype, nodeIsSetter, nodeIsWindow, nodeSupportsBucketing, setNodeChildren, sortProperties, NODE_TYPES, // Export for testing purpose. SAFE_PATH_PREFIX }; /***/ }), /* 1453 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _Svg = __webpack_require__(1359); var _Svg2 = _interopRequireDefault(_Svg); var _frame = __webpack_require__(1380); var _source = __webpack_require__(1356); var _FrameMenu = __webpack_require__(1454); var _FrameMenu2 = _interopRequireDefault(_FrameMenu); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ function FrameTitle({ frame, options }) { const displayName = (0, _frame.formatDisplayName)(frame, options); return _react2.default.createElement( "div", { className: "title" }, displayName ); } function FrameLocation({ frame }) { if (!frame.source) { return; } if (frame.library) { return _react2.default.createElement( "div", { className: "location" }, frame.library, _react2.default.createElement(_Svg2.default, { name: frame.library.toLowerCase(), className: "annotation-logo" }) ); } const filename = (0, _source.getFilename)(frame.source); return _react2.default.createElement( "div", { className: "location" }, `${filename}: ${frame.location.line}` ); } FrameLocation.displayName = "FrameLocation"; class FrameComponent extends _react.Component { onContextMenu(event) { const { frame, copyStackTrace, toggleFrameworkGrouping, toggleBlackBox, frameworkGroupingOn } = this.props; (0, _FrameMenu2.default)(frame, frameworkGroupingOn, { copyStackTrace, toggleFrameworkGrouping, toggleBlackBox }, event); } onMouseDown(e, frame, selectedFrame) { if (e.nativeEvent.which == 3 || selectedFrame.id === frame.id) { return; } this.props.selectFrame(frame); } onKeyUp(event, frame, selectedFrame) { if (event.key != "Enter" || selectedFrame.id == frame.id) { return; } this.props.selectFrame(frame); } render() { const { frame, selectedFrame, hideLocation, shouldMapDisplayName } = this.props; const className = (0, _classnames2.default)("frame", { selected: selectedFrame && selectedFrame.id === frame.id }); return _react2.default.createElement( "li", { key: frame.id, className: className, onMouseDown: e => this.onMouseDown(e, frame, selectedFrame), onKeyUp: e => this.onKeyUp(e, frame, selectedFrame), onContextMenu: e => this.onContextMenu(e), tabIndex: 0 }, _react2.default.createElement(FrameTitle, { frame: frame, options: { shouldMapDisplayName } }), !hideLocation && _react2.default.createElement(FrameLocation, { frame: frame }) ); } } exports.default = FrameComponent; FrameComponent.defaultProps = { hideLocation: false, shouldMapDisplayName: true }; FrameComponent.displayName = "Frame"; /***/ }), /* 1454 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = FrameMenu; var _devtoolsContextmenu = __webpack_require__(1413); var _clipboard = __webpack_require__(1388); var _lodash = __webpack_require__(2); const blackboxString = "sourceFooter.blackbox"; /* 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 . */ const unblackboxString = "sourceFooter.unblackbox"; function formatMenuElement(labelString, click, disabled = false) { const label = L10N.getStr(labelString); const accesskey = L10N.getStr(`${labelString}.accesskey`); const id = `node-menu-${(0, _lodash.kebabCase)(label)}`; return { id, label, accesskey, disabled, click }; } function copySourceElement(url) { return formatMenuElement("copySourceUri2", () => (0, _clipboard.copyToTheClipboard)(url)); } function copyStackTraceElement(copyStackTrace) { return formatMenuElement("copyStackTrace", () => copyStackTrace()); } function toggleFrameworkGroupingElement(toggleFrameworkGrouping, frameworkGroupingOn) { const actionType = frameworkGroupingOn ? "framework.disableGrouping" : "framework.enableGrouping"; return formatMenuElement(actionType, () => toggleFrameworkGrouping()); } function blackBoxSource(source, toggleBlackBox) { const toggleBlackBoxString = source.isBlackBoxed ? unblackboxString : blackboxString; return formatMenuElement(toggleBlackBoxString, () => toggleBlackBox(source)); } function FrameMenu(frame, frameworkGroupingOn, callbacks, event) { event.stopPropagation(); event.preventDefault(); const menuOptions = []; const source = frame.source; const toggleFrameworkElement = toggleFrameworkGroupingElement(callbacks.toggleFrameworkGrouping, frameworkGroupingOn); menuOptions.push(toggleFrameworkElement); if (source) { const copySourceUri2 = copySourceElement(source.url); menuOptions.push(copySourceUri2); menuOptions.push(blackBoxSource(source, callbacks.toggleBlackBox)); } const copyStackTraceItem = copyStackTraceElement(callbacks.copyStackTrace); menuOptions.push(copyStackTraceItem); (0, _devtoolsContextmenu.showMenu)(event, menuOptions); } /***/ }), /* 1455 */, /* 1456 */, /* 1457 */, /* 1458 */, /* 1459 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactDom = __webpack_require__(4); var _reactDom2 = _interopRequireDefault(_reactDom); var _devtoolsLaunchpad = __webpack_require__(1362); var _devtoolsConfig = __webpack_require__(1355); var _client = __webpack_require__(1499); var _bootstrap = __webpack_require__(1430); var _sourceQueue = __webpack_require__(1795); var _sourceQueue2 = _interopRequireDefault(_sourceQueue); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } if (false) { window.Perf = require("react-addons-perf"); } /* 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 . */ if ((0, _devtoolsConfig.isFirefoxPanel)()) { module.exports = { bootstrap: ({ threadClient, tabTarget, debuggerClient, sourceMaps, toolboxActions }) => { return (0, _client.onConnect)({ tab: { clientType: "firefox" }, tabConnection: { tabTarget, threadClient, debuggerClient } }, { services: { sourceMaps }, toolboxActions }); }, destroy: () => { (0, _devtoolsLaunchpad.unmountRoot)(_reactDom2.default); _sourceQueue2.default.clear(); (0, _bootstrap.teardownWorkers)(); } }; } else { window.L10N = _devtoolsLaunchpad.L10N; // $FlowIgnore: window.L10N.setBundle(__webpack_require__(960)); (0, _devtoolsLaunchpad.bootstrap)(_react2.default, _reactDom2.default).then(connection => { (0, _client.onConnect)(connection, { services: { sourceMaps: __webpack_require__(1360) }, toolboxActions: {} }); }); } /***/ }), /* 1460 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const { isDevelopment, isTesting } = __webpack_require__(1355); function debugGlobal(field, value) { if (isDevelopment() || isTesting()) { window[field] = value; } } module.exports = { debugGlobal }; /***/ }), /* 1461 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const pick = __webpack_require__(67); const put = __webpack_require__(112); const fs = __webpack_require__(118); const path = __webpack_require__(119); let config; const flag = __webpack_require__(52); function isBrowser() { return typeof window == "object" && typeof module == "undefined"; } /** * Gets a config value for a given key * e.g "chrome.webSocketPort" */ function getValue(key) { return pick(config, key); } function setValue(key, value) { return put(config, key, value); } function isEnabled(key) { return config.features && typeof config.features[key] == "object" ? config.features[key].enabled : config.features[key]; } function isDevelopment() { if (isBrowser()) { if (true) { return false; } const href = window.location ? window.location.href : ""; return href.match(/^file:/) || href.match(/localhost:/); } if (isFirefoxPanel()) { // Default to production if compiling for the Firefox panel return "production" === "development"; } return "production" !== "production"; } function isTesting() { return flag.testing; } function isFirefoxPanel() { return "firefox-panel" == "firefox-panel"; } function isApplication() { return "firefox-panel" == "application"; } function isFirefox() { return (/firefox/i.test(navigator.userAgent) ); } function setConfig(value) { config = value; } function getConfig() { return config; } function updateLocalConfig(relativePath) { const localConfigPath = path.resolve(relativePath, "../configs/local.json"); const output = JSON.stringify(config, null, 2); fs.writeFileSync(localConfigPath, output, { flag: "w" }); return output; } module.exports = { isEnabled, getValue, setValue, isDevelopment, isTesting, isFirefoxPanel, isApplication, isFirefox, getConfig, setConfig, updateLocalConfig }; /***/ }), /* 1462 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const { sprintf } = __webpack_require__(1463); const { parse } = __webpack_require__(883); let strings = {}; function setBundle(bundle) { bundle = parse(bundle); strings = Object.assign(strings, bundle); } function getStr(key) { if (!strings[key]) { throw new Error(`L10N key ${key} cannot be found.`); } return strings[key]; } function getFormatStr(name, ...args) { return sprintf(getStr(name), ...args); } function numberWithDecimals(number, decimals = 0) { // If this is an integer, don't do anything special. if (number === (number | 0)) { return number; } // If this isn't a number (and yes, `isNaN(null)` is false), return zero. if (isNaN(number) || number === null) { return "0"; } let localized = number.toLocaleString(); // If no grouping or decimal separators are available, bail out, because // padding with zeros at the end of the string won't make sense anymore. if (!localized.match(/[^\d]/)) { return localized; } return number.toLocaleString(undefined, { maximumFractionDigits: decimals, minimumFractionDigits: decimals }); } module.exports = { setBundle, getStr, getFormatStr, numberWithDecimals }; /***/ }), /* 1463 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __WEBPACK_AMD_DEFINE_RESULT__; /* globals window, exports, define */ (function (window) { 'use strict'; var re = { not_string: /[^s]/, not_bool: /[^t]/, not_type: /[^T]/, not_primitive: /[^v]/, number: /[diefg]/, numeric_arg: /bcdiefguxX/, json: /[j]/, not_json: /[^j]/, text: /^[^\x25]+/, modulo: /^\x25{2}/, placeholder: /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosStTuvxX])/, key: /^([a-z_][a-z_\d]*)/i, key_access: /^\.([a-z_][a-z_\d]*)/i, index_access: /^\[(\d+)\]/, sign: /^[\+\-]/ }; function sprintf() { var key = arguments[0], cache = sprintf.cache; if (!(cache[key] && cache.hasOwnProperty(key))) { cache[key] = sprintf.parse(key); } return sprintf.format.call(null, cache[key], arguments); } sprintf.format = function (parse_tree, argv) { var cursor = 1, tree_length = parse_tree.length, node_type = '', arg, output = [], i, k, match, pad, pad_character, pad_length, is_positive = true, sign = ''; for (i = 0; i < tree_length; i++) { node_type = get_type(parse_tree[i]); if (node_type === 'string') { output[output.length] = parse_tree[i]; } else if (node_type === 'array') { match = parse_tree[i]; // convenience purposes only if (match[2]) { // keyword argument arg = argv[cursor]; for (k = 0; k < match[2].length; k++) { if (!arg.hasOwnProperty(match[2][k])) { throw new Error(sprintf('[sprintf] property "%s" does not exist', match[2][k])); } arg = arg[match[2][k]]; } } else if (match[1]) { // positional argument (explicit) arg = argv[match[1]]; } else { // positional argument (implicit) arg = argv[cursor++]; } if (re.not_type.test(match[8]) && re.not_primitive.test(match[8]) && get_type(arg) == 'function') { arg = arg(); } if (re.numeric_arg.test(match[8]) && get_type(arg) != 'number' && isNaN(arg)) { throw new TypeError(sprintf("[sprintf] expecting number but found %s", get_type(arg))); } if (re.number.test(match[8])) { is_positive = arg >= 0; } switch (match[8]) { case 'b': arg = parseInt(arg, 10).toString(2); break; case 'c': arg = String.fromCharCode(parseInt(arg, 10)); break; case 'd': case 'i': arg = parseInt(arg, 10); break; case 'j': arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0); break; case 'e': arg = match[7] ? parseFloat(arg).toExponential(match[7]) : parseFloat(arg).toExponential(); break; case 'f': arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg); break; case 'g': arg = match[7] ? parseFloat(arg).toPrecision(match[7]) : parseFloat(arg); break; case 'o': arg = arg.toString(8); break; case 's': case 'S': arg = String(arg); arg = match[7] ? arg.substring(0, match[7]) : arg; break; case 't': arg = String(!!arg); arg = match[7] ? arg.substring(0, match[7]) : arg; break; case 'T': arg = get_type(arg); arg = match[7] ? arg.substring(0, match[7]) : arg; break; case 'u': arg = parseInt(arg, 10) >>> 0; break; case 'v': arg = arg.valueOf(); arg = match[7] ? arg.substring(0, match[7]) : arg; break; case 'x': arg = parseInt(arg, 10).toString(16); break; case 'X': arg = parseInt(arg, 10).toString(16).toUpperCase(); break; } if (re.json.test(match[8])) { output[output.length] = arg; } else { if (re.number.test(match[8]) && (!is_positive || match[3])) { sign = is_positive ? '+' : '-'; arg = arg.toString().replace(re.sign, ''); } else { sign = ''; } pad_character = match[4] ? match[4] === '0' ? '0' : match[4].charAt(1) : ' '; pad_length = match[6] - (sign + arg).length; pad = match[6] ? pad_length > 0 ? str_repeat(pad_character, pad_length) : '' : ''; output[output.length] = match[5] ? sign + arg + pad : pad_character === '0' ? sign + pad + arg : pad + sign + arg; } } } return output.join(''); }; sprintf.cache = {}; sprintf.parse = function (fmt) { var _fmt = fmt, match = [], parse_tree = [], arg_names = 0; while (_fmt) { if ((match = re.text.exec(_fmt)) !== null) { parse_tree[parse_tree.length] = match[0]; } else if ((match = re.modulo.exec(_fmt)) !== null) { parse_tree[parse_tree.length] = '%'; } else if ((match = re.placeholder.exec(_fmt)) !== null) { if (match[2]) { arg_names |= 1; var field_list = [], replacement_field = match[2], field_match = []; if ((field_match = re.key.exec(replacement_field)) !== null) { field_list[field_list.length] = field_match[1]; while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') { if ((field_match = re.key_access.exec(replacement_field)) !== null) { field_list[field_list.length] = field_match[1]; } else if ((field_match = re.index_access.exec(replacement_field)) !== null) { field_list[field_list.length] = field_match[1]; } else { throw new SyntaxError("[sprintf] failed to parse named argument key"); } } } else { throw new SyntaxError("[sprintf] failed to parse named argument key"); } match[2] = field_list; } else { arg_names |= 2; } if (arg_names === 3) { throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported"); } parse_tree[parse_tree.length] = match; } else { throw new SyntaxError("[sprintf] unexpected placeholder"); } _fmt = _fmt.substring(match[0].length); } return parse_tree; }; var vsprintf = function (fmt, argv, _argv) { _argv = (argv || []).slice(0); _argv.splice(0, 0, fmt); return sprintf.apply(null, _argv); }; /** * helpers */ function get_type(variable) { if (typeof variable === 'number') { return 'number'; } else if (typeof variable === 'string') { return 'string'; } else { return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase(); } } var preformattedPadding = { '0': ['', '0', '00', '000', '0000', '00000', '000000', '0000000'], ' ': ['', ' ', ' ', ' ', ' ', ' ', ' ', ' '], '_': ['', '_', '__', '___', '____', '_____', '______', '_______'] }; function str_repeat(input, multiplier) { if (multiplier >= 0 && multiplier <= 7 && preformattedPadding[input]) { return preformattedPadding[input][multiplier]; } return Array(multiplier + 1).join(input); } /** * export to either browser or node.js */ if (true) { exports.sprintf = sprintf; exports.vsprintf = vsprintf; } if (typeof window !== 'undefined') { window.sprintf = sprintf; window.vsprintf = vsprintf; if (true) { !(__WEBPACK_AMD_DEFINE_RESULT__ = function () { return { sprintf: sprintf, vsprintf: vsprintf }; }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } } })(typeof window === 'undefined' ? undefined : window); /***/ }), /* 1464 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const EventEmitter = __webpack_require__(1382); function inToolbox() { return window.parent.document.documentURI == "about:devtools-toolbox"; } /** * A partial implementation of the Menu API provided by electron: * https://github.com/electron/electron/blob/master/docs/api/menu.md. * * Extra features: * - Emits an 'open' and 'close' event when the menu is opened/closed * @param String id (non standard) * Needed so tests can confirm the XUL implementation is working */ function Menu({ id = null } = {}) { this.menuitems = []; this.id = id; Object.defineProperty(this, "items", { get() { return this.menuitems; } }); EventEmitter.decorate(this); } /** * Add an item to the end of the Menu * * @param {MenuItem} menuItem */ Menu.prototype.append = function (menuItem) { this.menuitems.push(menuItem); }; /** * Add an item to a specified position in the menu * * @param {int} pos * @param {MenuItem} menuItem */ Menu.prototype.insert = function (pos, menuItem) { throw Error("Not implemented"); }; /** * Show the Menu at a specified location on the screen * * Missing features: * - browserWindow - BrowserWindow (optional) - Default is null. * - positioningItem Number - (optional) OS X * * @param {int} screenX * @param {int} screenY * @param Toolbox toolbox (non standard) * Needed so we in which window to inject XUL */ Menu.prototype.popup = function (screenX, screenY, toolbox) { let doc = toolbox.doc; let popupset = doc.querySelector("popupset"); // See bug 1285229, on Windows, opening the same popup multiple times in a // row ends up duplicating the popup. The newly inserted popup doesn't // dismiss the old one. So remove any previously displayed popup before // opening a new one. let popup = popupset.querySelector("menupopup[menu-api=\"true\"]"); if (popup) { popup.hidePopup(); } popup = this.createPopup(doc); popup.setAttribute("menu-api", "true"); if (this.id) { popup.id = this.id; } this._createMenuItems(popup); // Remove the menu from the DOM once it's hidden. popup.addEventListener("popuphidden", e => { if (e.target === popup) { popup.remove(); this.emit("close", popup); } }); popup.addEventListener("popupshown", e => { if (e.target === popup) { this.emit("open", popup); } }); popupset.appendChild(popup); popup.openPopupAtScreen(screenX, screenY, true); }; Menu.prototype.createPopup = function (doc) { return doc.createElement("menupopup"); }; Menu.prototype._createMenuItems = function (parent) { let doc = parent.ownerDocument; this.menuitems.forEach(item => { if (!item.visible) { return; } if (item.submenu) { let menupopup = doc.createElement("menupopup"); item.submenu._createMenuItems(menupopup); let menuitem = doc.createElement("menuitem"); menuitem.setAttribute("label", item.label); if (!inToolbox()) { menuitem.textContent = item.label; } let menu = doc.createElement("menu"); menu.appendChild(menuitem); menu.appendChild(menupopup); if (item.disabled) { menu.setAttribute("disabled", "true"); } if (item.accesskey) { menu.setAttribute("accesskey", item.accesskey); } if (item.id) { menu.id = item.id; } parent.appendChild(menu); } else if (item.type === "separator") { let menusep = doc.createElement("menuseparator"); parent.appendChild(menusep); } else { let menuitem = doc.createElement("menuitem"); menuitem.setAttribute("label", item.label); if (!inToolbox()) { menuitem.textContent = item.label; } menuitem.addEventListener("command", () => item.click()); if (item.type === "checkbox") { menuitem.setAttribute("type", "checkbox"); } if (item.type === "radio") { menuitem.setAttribute("type", "radio"); } if (item.disabled) { menuitem.setAttribute("disabled", "true"); } if (item.checked) { menuitem.setAttribute("checked", "true"); } if (item.accesskey) { menuitem.setAttribute("accesskey", item.accesskey); } if (item.id) { menuitem.id = item.id; } parent.appendChild(menuitem); } }); }; Menu.setApplicationMenu = () => { throw Error("Not implemented"); }; Menu.sendActionToFirstResponder = () => { throw Error("Not implemented"); }; Menu.buildFromTemplate = () => { throw Error("Not implemented"); }; module.exports = Menu; /***/ }), /* 1465 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ /* * A sham for https://dxr.mozilla.org/mozilla-central/source/toolkit/modules/Promise.jsm */ /** * Promise.jsm is mostly the Promise web API with a `defer` method. Just drop this in here, * and use the native web API (although building with webpack/babel, it may replace this * with it's own version if we want to target environments that do not have `Promise`. */ let p = typeof window != "undefined" ? window.Promise : Promise; p.defer = function defer() { var resolve, reject; var promise = new Promise(function () { resolve = arguments[0]; reject = arguments[1]; }); return { resolve: resolve, reject: reject, promise: promise }; }; module.exports = p; /***/ }), /* 1466 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ /** * A partial implementation of the MenuItem API provided by electron: * https://github.com/electron/electron/blob/master/docs/api/menu-item.md. * * Missing features: * - id String - Unique within a single menu. If defined then it can be used * as a reference to this item by the position attribute. * - role String - Define the action of the menu item; when specified the * click property will be ignored * - sublabel String * - accelerator Accelerator * - icon NativeImage * - position String - This field allows fine-grained definition of the * specific location within a given menu. * * Implemented features: * @param Object options * Function click * Will be called with click(menuItem, browserWindow) when the menu item * is clicked * String type * Can be normal, separator, submenu, checkbox or radio * String label * Boolean enabled * If false, the menu item will be greyed out and unclickable. * Boolean checked * Should only be specified for checkbox or radio type menu items. * Menu submenu * Should be specified for submenu type menu items. If submenu is specified, * the type: 'submenu' can be omitted. If the value is not a Menu then it * will be automatically converted to one using Menu.buildFromTemplate. * Boolean visible * If false, the menu item will be entirely hidden. */ function MenuItem({ accesskey = null, checked = false, click = () => {}, disabled = false, label = "", id = null, submenu = null, type = "normal", visible = true } = {}) { this.accesskey = accesskey; this.checked = checked; this.click = click; this.disabled = disabled; this.id = id; this.label = label; this.submenu = submenu; this.type = type; this.visible = visible; } module.exports = MenuItem; /***/ }), /* 1467 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const Services = __webpack_require__(22); const EventEmitter = __webpack_require__(1382); /** * Shortcuts for lazily accessing and setting various preferences. * Usage: * let prefs = new Prefs("root.path.to.branch", { * myIntPref: ["Int", "leaf.path.to.my-int-pref"], * myCharPref: ["Char", "leaf.path.to.my-char-pref"], * myJsonPref: ["Json", "leaf.path.to.my-json-pref"], * myFloatPref: ["Float", "leaf.path.to.my-float-pref"] * ... * }); * * Get/set: * prefs.myCharPref = "foo"; * let aux = prefs.myCharPref; * * Observe: * prefs.registerObserver(); * prefs.on("pref-changed", (prefName, prefValue) => { * ... * }); * * @param string prefsRoot * The root path to the required preferences branch. * @param object prefsBlueprint * An object containing { accessorName: [prefType, prefName, prefDefault] } keys. */ function PrefsHelper(prefsRoot = "", prefsBlueprint = {}) { EventEmitter.decorate(this); let cache = new Map(); for (let accessorName in prefsBlueprint) { let [prefType, prefName, prefDefault] = prefsBlueprint[accessorName]; map(this, cache, accessorName, prefType, prefsRoot, prefName, prefDefault); } let observer = makeObserver(this, cache, prefsRoot, prefsBlueprint); this.registerObserver = () => observer.register(); this.unregisterObserver = () => observer.unregister(); } /** * Helper method for getting a pref value. * * @param Map cache * @param string prefType * @param string prefsRoot * @param string prefName * @return any */ function get(cache, prefType, prefsRoot, prefName) { let cachedPref = cache.get(prefName); if (cachedPref !== undefined) { return cachedPref; } let value = Services.prefs["get" + prefType + "Pref"]([prefsRoot, prefName].join(".")); cache.set(prefName, value); return value; } /** * Helper method for setting a pref value. * * @param Map cache * @param string prefType * @param string prefsRoot * @param string prefName * @param any value */ function set(cache, prefType, prefsRoot, prefName, value) { Services.prefs["set" + prefType + "Pref"]([prefsRoot, prefName].join("."), value); cache.set(prefName, value); } /** * Maps a property name to a pref, defining lazy getters and setters. * Supported types are "Bool", "Char", "Int", "Float" (sugar around "Char" * type and casting), and "Json" (which is basically just sugar for "Char" * using the standard JSON serializer). * * @param PrefsHelper self * @param Map cache * @param string accessorName * @param string prefType * @param string prefsRoot * @param string prefName * @param string prefDefault * @param array serializer [optional] */ function map(self, cache, accessorName, prefType, prefsRoot, prefName, prefDefault, serializer = { in: e => e, out: e => e }) { if (prefName in self) { throw new Error(`Can't use ${prefName} because it overrides a property` + "on the instance."); } if (prefType == "Json") { map(self, cache, accessorName, "String", prefsRoot, prefName, prefDefault, { in: JSON.parse, out: JSON.stringify }); return; } if (prefType == "Float") { map(self, cache, accessorName, "Char", prefsRoot, prefName, prefDefault, { in: Number.parseFloat, out: n => n + "" }); return; } Object.defineProperty(self, accessorName, { get: () => { try { return serializer.in(get(cache, prefType, prefsRoot, prefName)); } catch (e) { if (typeof prefDefault !== 'undefined') { return prefDefault; } throw e; } }, set: e => set(cache, prefType, prefsRoot, prefName, serializer.out(e)) }); } /** * Finds the accessor for the provided pref, based on the blueprint object * used in the constructor. * * @param PrefsHelper self * @param object prefsBlueprint * @return string */ function accessorNameForPref(somePrefName, prefsBlueprint) { for (let accessorName in prefsBlueprint) { let [, prefName] = prefsBlueprint[accessorName]; if (somePrefName == prefName) { return accessorName; } } return ""; } /** * Creates a pref observer for `self`. * * @param PrefsHelper self * @param Map cache * @param string prefsRoot * @param object prefsBlueprint * @return object */ function makeObserver(self, cache, prefsRoot, prefsBlueprint) { return { register: function () { this._branch = Services.prefs.getBranch(prefsRoot + "."); this._branch.addObserver("", this); }, unregister: function () { this._branch.removeObserver("", this); }, observe: function (subject, topic, prefName) { // If this particular pref isn't handled by the blueprint object, // even though it's in the specified branch, ignore it. let accessorName = accessorNameForPref(prefName, prefsBlueprint); if (!(accessorName in self)) { return; } cache.delete(prefName); self.emit("pref-changed", accessorName, self[accessorName]); } }; } exports.PrefsHelper = PrefsHelper; /***/ }), /* 1468 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const { appinfo } = __webpack_require__(22); const EventEmitter = __webpack_require__(1382); const isOSX = appinfo.OS === "Darwin"; // List of electron keys mapped to DOM API (DOM_VK_*) key code const ElectronKeysMapping = { "F1": "DOM_VK_F1", "F2": "DOM_VK_F2", "F3": "DOM_VK_F3", "F4": "DOM_VK_F4", "F5": "DOM_VK_F5", "F6": "DOM_VK_F6", "F7": "DOM_VK_F7", "F8": "DOM_VK_F8", "F9": "DOM_VK_F9", "F10": "DOM_VK_F10", "F11": "DOM_VK_F11", "F12": "DOM_VK_F12", "F13": "DOM_VK_F13", "F14": "DOM_VK_F14", "F15": "DOM_VK_F15", "F16": "DOM_VK_F16", "F17": "DOM_VK_F17", "F18": "DOM_VK_F18", "F19": "DOM_VK_F19", "F20": "DOM_VK_F20", "F21": "DOM_VK_F21", "F22": "DOM_VK_F22", "F23": "DOM_VK_F23", "F24": "DOM_VK_F24", "Space": "DOM_VK_SPACE", "Backspace": "DOM_VK_BACK_SPACE", "Delete": "DOM_VK_DELETE", "Insert": "DOM_VK_INSERT", "Return": "DOM_VK_RETURN", "Enter": "DOM_VK_RETURN", "Up": "DOM_VK_UP", "Down": "DOM_VK_DOWN", "Left": "DOM_VK_LEFT", "Right": "DOM_VK_RIGHT", "Home": "DOM_VK_HOME", "End": "DOM_VK_END", "PageUp": "DOM_VK_PAGE_UP", "PageDown": "DOM_VK_PAGE_DOWN", "Escape": "DOM_VK_ESCAPE", "Esc": "DOM_VK_ESCAPE", "Tab": "DOM_VK_TAB", "VolumeUp": "DOM_VK_VOLUME_UP", "VolumeDown": "DOM_VK_VOLUME_DOWN", "VolumeMute": "DOM_VK_VOLUME_MUTE", "PrintScreen": "DOM_VK_PRINTSCREEN" }; /** * Helper to listen for keyboard events decribed in .properties file. * * let shortcuts = new KeyShortcuts({ * window * }); * shortcuts.on("Ctrl+F", event => { * // `event` is the KeyboardEvent which relates to the key shortcuts * }); * * @param DOMWindow window * The window object of the document to listen events from. * @param DOMElement target * Optional DOM Element on which we should listen events from. * If omitted, we listen for all events fired on `window`. */ function KeyShortcuts({ window, target }) { this.window = window; this.target = target || window; this.keys = new Map(); this.eventEmitter = new EventEmitter(); this.target.addEventListener("keydown", this); } /* * Parse an electron-like key string and return a normalized object which * allow efficient match on DOM key event. The normalized object matches DOM * API. * * @param DOMWindow window * Any DOM Window object, just to fetch its `KeyboardEvent` object * @param String str * The shortcut string to parse, following this document: * https://github.com/electron/electron/blob/master/docs/api/accelerator.md */ KeyShortcuts.parseElectronKey = function (window, str) { let modifiers = str.split("+"); let key = modifiers.pop(); let shortcut = { ctrl: false, meta: false, alt: false, shift: false, // Set for character keys key: undefined, // Set for non-character keys keyCode: undefined }; for (let mod of modifiers) { if (mod === "Alt") { shortcut.alt = true; } else if (["Command", "Cmd"].includes(mod)) { shortcut.meta = true; } else if (["CommandOrControl", "CmdOrCtrl"].includes(mod)) { if (isOSX) { shortcut.meta = true; } else { shortcut.ctrl = true; } } else if (["Control", "Ctrl"].includes(mod)) { shortcut.ctrl = true; } else if (mod === "Shift") { shortcut.shift = true; } else { console.error("Unsupported modifier:", mod, "from key:", str); return null; } } // Plus is a special case. It's a character key and shouldn't be matched // against a keycode as it is only accessible via Shift/Capslock if (key === "Plus") { key = "+"; } if (typeof key === "string" && key.length === 1) { // Match any single character shortcut.key = key.toLowerCase(); } else if (key in ElectronKeysMapping) { // Maps the others manually to DOM API DOM_VK_* key = ElectronKeysMapping[key]; shortcut.keyCode = window.KeyboardEvent[key]; // Used only to stringify the shortcut shortcut.keyCodeString = key; shortcut.key = key; } else { console.error("Unsupported key:", key); return null; } return shortcut; }; KeyShortcuts.stringify = function (shortcut) { let list = []; if (shortcut.alt) { list.push("Alt"); } if (shortcut.ctrl) { list.push("Ctrl"); } if (shortcut.meta) { list.push("Cmd"); } if (shortcut.shift) { list.push("Shift"); } let key; if (shortcut.key) { key = shortcut.key.toUpperCase(); } else { key = shortcut.keyCodeString; } list.push(key); return list.join("+"); }; KeyShortcuts.prototype = { destroy() { this.target.removeEventListener("keydown", this); this.keys.clear(); }, doesEventMatchShortcut(event, shortcut) { if (shortcut.meta != event.metaKey) { return false; } if (shortcut.ctrl != event.ctrlKey) { return false; } if (shortcut.alt != event.altKey) { return false; } // Shift is a special modifier, it may implicitely be required if the // expected key is a special character accessible via shift. if (shortcut.shift != event.shiftKey && event.key && event.key.match(/[a-zA-Z]/)) { return false; } if (shortcut.keyCode) { return event.keyCode == shortcut.keyCode; } else if (event.key in ElectronKeysMapping) { return ElectronKeysMapping[event.key] === shortcut.key; } // get the key from the keyCode if key is not provided. let key = event.key || String.fromCharCode(event.keyCode); // For character keys, we match if the final character is the expected one. // But for digits we also accept indirect match to please azerty keyboard, // which requires Shift to be pressed to get digits. return key.toLowerCase() == shortcut.key || shortcut.key.match(/^[0-9]$/) && event.keyCode == shortcut.key.charCodeAt(0); }, handleEvent(event) { for (let [key, shortcut] of this.keys) { if (this.doesEventMatchShortcut(event, shortcut)) { this.eventEmitter.emit(key, event); } } }, on(key, listener) { if (typeof listener !== "function") { throw new Error("KeyShortcuts.on() expects a function as " + "second argument"); } if (!this.keys.has(key)) { let shortcut = KeyShortcuts.parseElectronKey(this.window, key); // The key string is wrong and we were unable to compute the key shortcut if (!shortcut) { return; } this.keys.set(key, shortcut); } this.eventEmitter.on(key, listener); }, off(key, listener) { this.eventEmitter.off(key, listener); } }; module.exports = KeyShortcuts; /***/ }), /* 1469 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ /** * Empty shim for "devtools/client/shared/zoom-keys" module * * Based on nsIMarkupDocumentViewer.fullZoom API * https://developer.mozilla.org/en-US/Firefox/Releases/3/Full_page_zoom */ exports.register = function (window) {}; /***/ }), /* 1470 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const firefox = __webpack_require__(1471); const chrome = __webpack_require__(1472); function startDebugging(connTarget) { if (connTarget.type === "node") { return startDebuggingNode(connTarget.param); } return startDebuggingTab(connTarget); } async function startDebuggingNode(tabId) { const clientType = "node"; const tabs = await chrome.connectNodeClient(); if (!tabs) { return {}; } const tab = tabs.find(t => t.id.indexOf(tabId) !== -1); if (!tab) { return {}; } const tabConnection = await chrome.connectNode(tab.tab); chrome.initPage({ clientType, tabConnection }); return { tabs, tab, clientType, client: chrome, tabConnection }; } async function startDebuggingTab(connTarget) { let clientType = connTarget.type; const client = clientType === "chrome" ? chrome : firefox; const tabs = await client.connectClient(); if (!tabs) { return undefined; } const tab = tabs.find(t => t.id.indexOf(connTarget.param) !== -1); if (!tab) { return undefined; } const tabConnection = await client.connectTab(tab.tab); client.initPage({ tab, clientType, tabConnection }); return { tab, tabConnection }; } module.exports = { startDebugging, firefox, chrome }; /***/ }), /* 1471 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const { DebuggerClient, DebuggerTransport, TargetFactory, WebsocketTransport } = __webpack_require__(52); const { getValue } = __webpack_require__(1355); let debuggerClient = null; function lookupTabTarget(tab) { const options = { client: debuggerClient, form: tab, chrome: false }; return TargetFactory.forRemoteTab(options); } function createTabs(tabs) { return tabs.map(tab => { return { title: tab.title, url: tab.url, id: tab.actor, tab, clientType: "firefox" }; }); } async function connectClient() { const useWebSocket = getValue("firefox.webSocketConnection"); const firefoxHost = useWebSocket ? getValue("firefox.host") : "localhost"; const firefoxPort = getValue("firefox.webSocketPort"); const socket = new WebSocket(`ws://${firefoxHost}:${firefoxPort}`); const transport = useWebSocket ? new WebsocketTransport(socket) : new DebuggerTransport(socket); debuggerClient = new DebuggerClient(transport); if (!debuggerClient) { return []; } try { await debuggerClient.connect(); return await getTabs(); } catch (err) { console.log(err); return []; } } async function connectTab(tab) { window.addEventListener("beforeunload", () => { if (tabTarget !== null) { tabTarget.destroy(); } }); const tabTarget = await lookupTabTarget(tab); const [, threadClient] = await tabTarget.activeTab.attachThread({ ignoreFrameEnvironment: true }); threadClient.resume(); return { debuggerClient, threadClient, tabTarget }; } async function getTabs() { if (!debuggerClient || !debuggerClient.mainRoot) { return undefined; } const response = await debuggerClient.listTabs(); return createTabs(response.tabs); } function initPage(options) {} module.exports = { connectClient, connectTab, initPage, getTabs }; /***/ }), /* 1472 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const CDP = __webpack_require__(52); const { getValue } = __webpack_require__(1355); const { networkRequest } = __webpack_require__(1363); let connection; function createTabs(tabs, { type, clientType } = {}) { return tabs.filter(tab => { return tab.type == type; }).map(tab => { return { title: tab.title, url: tab.url, id: tab.id, tab, clientType }; }); } window.criRequest = function (options, callback) { const { host, port, path } = options; const url = `http://${host}:${port}${path}`; networkRequest(url).then(res => callback(null, res.content)).catch(err => callback(err)); }; async function connectClient() { if (!getValue("chrome.debug")) { return createTabs([]); } try { const tabs = await CDP.List({ port: getValue("chrome.port"), host: getValue("chrome.host") }); return createTabs(tabs, { clientType: "chrome", type: "page" }); } catch (e) { return []; } } async function connectNodeClient() { if (!getValue("node.debug")) { return createTabs([]); } let tabs; try { tabs = await CDP.List({ port: getValue("node.port"), host: getValue("node.host") }); } catch (e) { return undefined; } return createTabs(tabs, { clientType: "node", type: "node" }); } async function connectTab(tab) { const tabConnection = await CDP({ tab: tab.webSocketDebuggerUrl }); return tabConnection; } async function connectNode(tab) { const tabConnection = await CDP({ tab: tab.webSocketDebuggerUrl }); window.addEventListener("beforeunload", () => { tabConnection.onclose = function disable() {}; tabConnection.close(); }); return tabConnection; } function initPage({ tab, clientType, tabConnection }) { const { Runtime, Page } = tabConnection; Runtime.enable(); if (clientType == "node") { Runtime.runIfWaitingForDebugger(); } if (clientType == "chrome") { Page.enable(); } return connection; } module.exports = { connectClient, connectNodeClient, connectNode, connectTab, initPage }; /***/ }), /* 1473 */, /* 1474 */, /* 1475 */, /* 1476 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const classnames = __webpack_require__(175); __webpack_require__(1302); module.exports = function (className) { const root = document.createElement("div"); root.className = classnames(className); root.style.setProperty("flex", 1); return root; }; /***/ }), /* 1477 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ /* global window */ const { createStore, applyMiddleware } = __webpack_require__(3); const { waitUntilService } = __webpack_require__(1478); const { log } = __webpack_require__(1479); const { history } = __webpack_require__(1480); const { promise } = __webpack_require__(1481); const { thunk } = __webpack_require__(1485); /** * This creates a dispatcher with all the standard middleware in place * that all code requires. It can also be optionally configured in * various ways, such as logging and recording. * * @param {object} opts: * - log: log all dispatched actions to console * - history: an array to store every action in. Should only be * used in tests. * - middleware: array of middleware to be included in the redux store */ const configureStore = (opts = {}) => { const middleware = [thunk(opts.makeThunkArgs), promise, // Order is important: services must go last as they always // operate on "already transformed" actions. Actions going through // them shouldn't have any special fields like promises, they // should just be normal JSON objects. waitUntilService]; if (opts.history) { middleware.push(history(opts.history)); } if (opts.middleware) { opts.middleware.forEach(fn => middleware.push(fn)); } if (opts.log) { middleware.push(log); } // Hook in the redux devtools browser extension if it exists const devtoolsExt = typeof window === "object" && window.devToolsExtension ? window.devToolsExtension() : f => f; return applyMiddleware(...middleware)(devtoolsExt(createStore)); }; module.exports = configureStore; /***/ }), /* 1478 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ /** * A middleware which acts like a service, because it is stateful * and "long-running" in the background. It provides the ability * for actions to install a function to be run once when a specific * condition is met by an action coming through the system. Think of * it as a thunk that blocks until the condition is met. Example: * * ```js * const services = { WAIT_UNTIL: require('wait-service').NAME }; * * { type: services.WAIT_UNTIL, * predicate: action => action.type === constants.ADD_ITEM, * run: (dispatch, getState, action) => { * // Do anything here. You only need to accept the arguments * // if you need them. `action` is the action that satisfied * // the predicate. * } * } * ``` */ const NAME = exports.NAME = "@@service/waitUntil"; function waitUntilService({ dispatch, getState }) { let pending = []; function checkPending(action) { let readyRequests = []; let stillPending = []; // Find the pending requests whose predicates are satisfied with // this action. Wait to run the requests until after we update the // pending queue because the request handler may synchronously // dispatch again and run this service (that use case is // completely valid). for (let request of pending) { if (request.predicate(action)) { readyRequests.push(request); } else { stillPending.push(request); } } pending = stillPending; for (let request of readyRequests) { request.run(dispatch, getState, action); } } return next => action => { if (action.type === NAME) { pending.push(action); return null; } let result = next(action); checkPending(action); return result; }; } exports.waitUntilService = waitUntilService; /***/ }), /* 1479 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ /** * A middleware that logs all actions coming through the system * to the console. */ function log({ dispatch, getState }) { return next => action => { const actionText = JSON.stringify(action, null, 2); const truncatedActionText = `${actionText.slice(0, 1000)}...`; console.log(`[DISPATCH ${action.type}]`, action, truncatedActionText); next(action); }; } exports.log = log; /***/ }), /* 1480 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const { isDevelopment } = __webpack_require__(1355); /** * A middleware that stores every action coming through the store in the passed * in logging object. Should only be used for tests, as it collects all * action information, which will cause memory bloat. */ exports.history = (log = []) => ({ dispatch, getState }) => { if (isDevelopment()) { console.warn("Using history middleware stores all actions in state for " + "testing and devtools is not currently running in test " + "mode. Be sure this is intentional."); } return next => action => { log.push(action); next(action); }; }; /***/ }), /* 1481 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const { defer } = __webpack_require__(1412); const { entries, toObject } = __webpack_require__(1482); const { executeSoon } = __webpack_require__(1483); const PROMISE = exports.PROMISE = "@@dispatch/promise"; let seqIdVal = 1; function seqIdGen() { return seqIdVal++; } function promiseMiddleware({ dispatch, getState }) { return next => action => { if (!(PROMISE in action)) { return next(action); } const promiseInst = action[PROMISE]; const seqId = seqIdGen().toString(); // Create a new action that doesn't have the promise field and has // the `seqId` field that represents the sequence id action = Object.assign(toObject(entries(action).filter(pair => pair[0] !== PROMISE)), { seqId }); dispatch(Object.assign({}, action, { status: "start" })); // Return the promise so action creators can still compose if they // want to. const deferred = defer(); promiseInst.then(value => { executeSoon(() => { dispatch(Object.assign({}, action, { status: "done", value: value })); deferred.resolve(value); }); }, error => { executeSoon(() => { dispatch(Object.assign({}, action, { status: "error", error: error.message || error })); deferred.reject(error); }); }); return deferred.promise; }; } exports.promise = promiseMiddleware; /***/ }), /* 1482 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ /* vim: set ft=javascript ts=2 et sw=2 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/. */ const co = __webpack_require__(965); function asPaused(client, func) { if (client.state != "paused") { return co(function* () { yield client.interrupt(); let result; try { result = yield func(); } catch (e) { // Try to put the debugger back in a working state by resuming // it yield client.resume(); throw e; } yield client.resume(); return result; }); } return func(); } function handleError(err) { console.log("ERROR: ", err); } function promisify(context, method, ...args) { return new Promise((resolve, reject) => { args.push(response => { if (response.error) { reject(response); } else { resolve(response); } }); method.apply(context, args); }); } function truncateStr(str, size) { if (str.length > size) { return `${str.slice(0, size)}...`; } return str; } function endTruncateStr(str, size) { if (str.length > size) { return `...${str.slice(str.length - size)}`; } return str; } let msgId = 1; function workerTask(worker, method) { return function (...args) { return new Promise((resolve, reject) => { const id = msgId++; worker.postMessage({ id, method, args }); const listener = ({ data: result }) => { if (result.id !== id) { return; } worker.removeEventListener("message", listener); if (result.error) { reject(result.error); } else { resolve(result.response); } }; worker.addEventListener("message", listener); }); }; } /** * Interleaves two arrays element by element, returning the combined array, like * a zip. In the case of arrays with different sizes, undefined values will be * interleaved at the end along with the extra values of the larger array. * * @param Array a * @param Array b * @returns Array * The combined array, in the form [a1, b1, a2, b2, ...] */ function zip(a, b) { if (!b) { return a; } if (!a) { return b; } const pairs = []; for (let i = 0, aLength = a.length, bLength = b.length; i < aLength || i < bLength; i++) { pairs.push([a[i], b[i]]); } return pairs; } /** * Converts an object into an array with 2-element arrays as key/value * pairs of the object. `{ foo: 1, bar: 2}` would become * `[[foo, 1], [bar 2]]` (order not guaranteed); * * @param object obj * @returns array */ function entries(obj) { return Object.keys(obj).map(k => [k, obj[k]]); } function mapObject(obj, iteratee) { return toObject(entries(obj).map(([key, value]) => { return [key, iteratee(key, value)]; })); } /** * Takes an array of 2-element arrays as key/values pairs and * constructs an object using them. */ function toObject(arr) { const obj = {}; for (let pair of arr) { obj[pair[0]] = pair[1]; } return obj; } /** * Composes the given functions into a single function, which will * apply the results of each function right-to-left, starting with * applying the given arguments to the right-most function. * `compose(foo, bar, baz)` === `args => foo(bar(baz(args)` * * @param ...function funcs * @returns function */ function compose(...funcs) { return (...args) => { const initialValue = funcs[funcs.length - 1].apply(null, args); const leftFuncs = funcs.slice(0, -1); return leftFuncs.reduceRight((composed, f) => f(composed), initialValue); }; } function updateObj(obj, fields) { return Object.assign({}, obj, fields); } function throttle(func, ms) { let timeout, _this; return function (...args) { _this = this; if (!timeout) { timeout = setTimeout(() => { func.apply(_this, ...args); timeout = null; }, ms); } }; } module.exports = { asPaused, handleError, promisify, truncateStr, endTruncateStr, workerTask, zip, entries, toObject, mapObject, compose, updateObj, throttle }; /***/ }), /* 1483 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const assert = __webpack_require__(1484); function reportException(who, exception) { let msg = `${who} threw an exception: `; console.error(msg, exception); } function executeSoon(fn) { setTimeout(fn, 0); } module.exports = { reportException, executeSoon, assert }; /***/ }), /* 1484 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ function assert(condition, message) { if (!condition) { throw new Error(`Assertion failure: ${message}`); } } module.exports = assert; /***/ }), /* 1485 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ /** * A middleware that allows thunks (functions) to be dispatched. If * it's a thunk, it is called with an argument that contains * `dispatch`, `getState`, and any additional args passed in via the * middleware constructure. This allows the action to create multiple * actions (most likely asynchronously). */ function thunk(makeArgs) { return ({ dispatch, getState }) => { const args = { dispatch, getState }; return next => action => { return typeof action === "function" ? action(makeArgs ? makeArgs(args, getState()) : args) : next(action); }; }; } exports.thunk = thunk; /***/ }), /* 1486 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const tabs = __webpack_require__(1487); const config = __webpack_require__(1488); module.exports = { tabs, config }; /***/ }), /* 1487 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const constants = __webpack_require__(1377); const Immutable = __webpack_require__(146); const fromJS = __webpack_require__(1414); const initialState = fromJS({ tabs: {}, selectedTab: null, filterString: "" }); function update(state = initialState, action) { switch (action.type) { case constants.CLEAR_TABS: return state.setIn(["tabs"], Immutable.Map()).setIn(["selectedTab"], null); case constants.ADD_TABS: const tabs = action.value; if (!tabs) { return state; } return state.mergeIn(["tabs"], Immutable.Map(tabs.map(tab => { tab = Object.assign({}, tab, { id: getTabId(tab) }); return [tab.id, Immutable.Map(tab)]; }))); case constants.SELECT_TAB: const tabToSelect = state.getIn(["tabs", action.id]); return state.setIn(["selectedTab"], tabToSelect); case constants.FILTER_TABS: return state.setIn(["filterString"], action.value); } return state; } function getTabId(tab) { let id = tab.id; const isFirefox = tab.clientType == "firefox"; // NOTE: we're getting the last part of the actor because // we want to ignore the connection id if (isFirefox) { id = tab.id.split(".").pop(); } return id; } module.exports = update; /***/ }), /* 1488 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const constants = __webpack_require__(1377); const fromJS = __webpack_require__(1414); const I = __webpack_require__(146); const initialState = fromJS({ config: I.Map() }); function update(state = initialState, action) { switch (action.type) { case constants.SET_VALUE: return state.setIn(["config", ...action.path.split(".")], action.value); case constants.SET_CONFIG: return state.setIn(["config"], fromJS(action.config)); } return state; } module.exports = update; /***/ }), /* 1489 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const React = __webpack_require__(0); const { Component } = React; const PropTypes = __webpack_require__(20); const ImPropTypes = __webpack_require__(150); const { connect } = __webpack_require__(1189); const { bindActionCreators } = __webpack_require__(3); const { getTabs, getFilterString, getConfig } = __webpack_require__(1490); const { getValue } = __webpack_require__(1355); const LandingPage = React.createFactory(__webpack_require__(1491)); class LaunchpadApp extends Component { static get propTypes() { return { tabs: ImPropTypes.map.isRequired, filterString: PropTypes.string, actions: PropTypes.object, config: PropTypes.object }; } render() { const { filterString, actions: { setValue, filterTabs }, config } = this.props; return LandingPage({ tabs: this.props.tabs, supportsFirefox: !!getValue("firefox"), supportsChrome: !!getValue("chrome"), title: getValue("title"), filterString, onFilterChange: filterTabs, onTabClick: url => { window.location = url; }, config, setValue }); } } function mapStateToProps(state) { return { tabs: getTabs(state), filterString: getFilterString(state), config: getConfig(state) }; } function mapDispatchToProps(dispatch) { return { actions: bindActionCreators(__webpack_require__(1415), dispatch) }; } module.exports = connect(mapStateToProps, mapDispatchToProps)(LaunchpadApp); /***/ }), /* 1490 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const { score } = __webpack_require__(1774); function getTabs(state) { let tabs = state.tabs.get("tabs"); let filterString = getFilterString(state); if (filterString === "") { return tabs; } return tabs.map(tab => { const _overallScore = score(tab.get("title"), filterString) + score(tab.get("url"), filterString); return tab.set("filteredOut", _overallScore === 0); }); } function getSelectedTab(state) { return state.tabs.get("selectedTab"); } function getFilterString(state) { return state.tabs.get("filterString"); } function getConfig(state) { return state.config.get("config").toJS(); } module.exports = { getTabs, getSelectedTab, getFilterString, getConfig }; /***/ }), /* 1491 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const React = __webpack_require__(0); __webpack_require__(1298); const { Component } = React; const PropTypes = __webpack_require__(20); const dom = __webpack_require__(1758); const ImPropTypes = __webpack_require__(150); const configMap = __webpack_require__(1377).sidePanelItems; const Tabs = React.createFactory(__webpack_require__(1492)); const Sidebar = React.createFactory(__webpack_require__(1493)); const Settings = React.createFactory(__webpack_require__(1496)); const githubUrl = "https://github.com/devtools-html/debugger.html/blob/master"; function getTabsByClientType(tabs, clientType) { return tabs.valueSeq().filter(tab => tab.get("clientType") == clientType); } function firstTimeMessage(title, urlPart) { return dom.div({ className: "footer-note" }, `First time connecting to ${title}? Checkout out the `, dom.a({ href: `${githubUrl}/docs/getting-setup.md#starting-${urlPart}`, target: "_blank" }, "docs"), "."); } class LandingPage extends Component { static get propTypes() { return { tabs: ImPropTypes.map.isRequired, supportsFirefox: PropTypes.bool.isRequired, supportsChrome: PropTypes.bool.isRequired, title: PropTypes.string.isRequired, filterString: PropTypes.string, onFilterChange: PropTypes.func.isRequired, onTabClick: PropTypes.func.isRequired, config: PropTypes.object.isRequired, setValue: PropTypes.func.isRequired }; } constructor(props) { super(props); this.state = { selectedPane: configMap.Firefox.name, firefoxConnected: false, chromeConnected: false }; this.onFilterChange = this.onFilterChange.bind(this); this.onSideBarItemClick = this.onSideBarItemClick.bind(this); this.renderLaunchOptions = this.renderLaunchOptions.bind(this); this.renderLaunchButton = this.renderLaunchButton.bind(this); this.renderExperimentalMessage = this.renderExperimentalMessage.bind(this); this.launchBrowser = this.launchBrowser.bind(this); this.renderEmptyPanel = this.renderEmptyPanel.bind(this); this.renderSettings = this.renderSettings.bind(this); this.renderFilter = this.renderFilter.bind(this); this.renderPanel = this.renderPanel.bind(this); } componentDidUpdate() { if (this.refs.filterInput) { this.refs.filterInput.focus(); } } onFilterChange(newFilterString) { this.props.onFilterChange(newFilterString); } onSideBarItemClick(itemTitle) { if (itemTitle !== this.state.selectedPane) { this.setState({ selectedPane: itemTitle }); } } renderLaunchOptions() { const { selectedPane } = this.state; const { name, isUnderConstruction } = configMap[selectedPane]; const isConnected = name === configMap.Firefox.name ? this.state.firefoxConnected : this.state.chromeConnected; const isNodeSelected = name === configMap.Node.name; if (isNodeSelected) { return dom.div({ className: "launch-action-container" }, dom.h3({}, "Run a node script in the terminal with `--inspect`"), isUnderConstruction ? this.renderExperimentalMessage(name) : null); } const connectedStateText = isNodeSelected ? null : `Please open a tab in ${name}`; return isConnected ? connectedStateText : this.renderLaunchButton(name, isUnderConstruction); } renderLaunchButton(browserName, isUnderConstruction) { return dom.div({ className: "launch-action-container" }, dom.button({ onClick: () => this.launchBrowser(browserName) }, `Launch ${browserName}`), isUnderConstruction ? this.renderExperimentalMessage(browserName) : null); } renderExperimentalMessage(browserName) { const underConstructionMessage = "Debugging is experimental and certain features won't work (i.e, seeing variables, attaching breakpoints)"; // eslint-disable-line max-len return dom.div({ className: "under-construction" }, dom.div({ className: "under-construction-message" }, dom.p({}, underConstructionMessage), dom.img({ src: "/assets/under_construction.png" }), dom.a({ className: "github-link", target: "_blank" }, "Help us make it happen"))); } launchBrowser(browser) { fetch("/launch", { body: JSON.stringify({ browser }), headers: { "Content-Type": "application/json" }, method: "post" }).then(resp => { if (browser === configMap.Firefox.name) { this.setState({ firefoxConnected: true }); } else { this.setState({ chromeConnected: true }); } }).catch(err => { alert(`Error launching ${browser}. ${err.message}`); }); } renderEmptyPanel() { return dom.div({ className: "hero" }, this.renderLaunchOptions()); } renderSettings() { const { config, setValue } = this.props; return dom.div({}, dom.header({}, dom.h1({}, configMap.Settings.name)), Settings({ config, setValue })); } renderFilter() { const { selectedPane } = this.state; const { tabs, filterString = "" } = this.props; const { clientType, paramName } = configMap[selectedPane]; const targets = getTabsByClientType(tabs, clientType); return dom.header({}, dom.input({ ref: "filterInput", placeholder: "Filter tabs", value: filterString, autoFocus: true, type: "search", onChange: e => this.onFilterChange(e.target.value), onKeyDown: e => { if (targets.size === 1 && e.keyCode === 13) { this.onTabClick(targets.first(), paramName); } } })); } renderPanel() { const { onTabClick, tabs } = this.props; const { selectedPane } = this.state; const { name, clientType, paramName } = configMap[selectedPane]; const clientTargets = getTabsByClientType(tabs, clientType); const tabsDetected = clientTargets && clientTargets.count() > 0; const targets = clientTargets.filter(t => !t.get("filteredOut")); const isSettingsPaneSelected = name === configMap.Settings.name; if (isSettingsPaneSelected) { return this.renderSettings(); } if (!tabsDetected) { return this.renderEmptyPanel(); } return dom.div({}, this.renderFilter(), Tabs({ targets, paramName, onTabClick })); } render() { const { supportsFirefox, supportsChrome, title } = this.props; const { selectedPane } = this.state; const { onSideBarItemClick } = this; const { name, docsUrlPart } = configMap[selectedPane]; return dom.div({ className: "landing-page" }, Sidebar({ supportsFirefox, supportsChrome, title, selectedPane, onSideBarItemClick }), dom.main({ className: "panel" }, this.renderPanel(), firstTimeMessage(name, docsUrlPart))); } } module.exports = LandingPage; /***/ }), /* 1492 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const React = __webpack_require__(0); __webpack_require__(1299); const { Component } = React; const dom = __webpack_require__(1758); const PropTypes = __webpack_require__(20); const classnames = __webpack_require__(175); function getTabURL(tab, paramName) { const tabID = tab.get("id"); return `/?react_perf&${paramName}=${tabID}`; } class Tabs extends Component { static get propTypes() { return { targets: PropTypes.object.isRequired, paramName: PropTypes.string.isRequired, onTabClick: PropTypes.func.isRequired }; } constructor(props) { super(props); this.onTabClick = this.onTabClick.bind(this); } onTabClick(tab, paramName) { this.props.onTabClick(getTabURL(tab, paramName)); } render() { const { targets, paramName } = this.props; if (!targets || targets.count() == 0) { return dom.div({}, ""); } let tabClassNames = ["tab"]; if (targets.size === 1) { tabClassNames.push("active"); } return dom.div({ className: "tab-group" }, dom.ul({ className: "tab-list" }, targets.valueSeq().map(tab => dom.li({ className: classnames("tab", { active: targets.size === 1 }), key: tab.get("id"), tabIndex: 0, role: "link", onClick: () => this.onTabClick(tab, paramName), onKeyDown: e => { if (e.keyCode === 13) { this.onTabClick(tab, paramName); } } }, dom.div({ className: "tab-title" }, tab.get("title")), dom.div({ className: "tab-url" }, tab.get("url")))))); } } module.exports = Tabs; /***/ }), /* 1493 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const React = __webpack_require__(0); __webpack_require__(1300); const { Component } = React; const dom = __webpack_require__(1758); const PropTypes = __webpack_require__(20); const classnames = __webpack_require__(175); const Svg = __webpack_require__(1494); class Sidebar extends Component { static get propTypes() { return { supportsFirefox: PropTypes.bool.isRequired, supportsChrome: PropTypes.bool.isRequired, title: PropTypes.string.isRequired, selectedPane: PropTypes.string.isRequired, onSideBarItemClick: PropTypes.func.isRequired }; } constructor(props) { super(props); this.renderTitle = this.renderTitle.bind(this); this.renderItem = this.renderItem.bind(this); } renderTitle(title) { return dom.div({ className: "title-wrapper" }, dom.h1({}, title), dom.div({ className: "launchpad-container" }, Svg({ name: "rocket" }), dom.h2({ className: "launchpad-container-title" }, "Launchpad"))); } renderItem(title) { return dom.li({ className: classnames({ selected: title == this.props.selectedPane }), key: title, tabIndex: 0, role: "button", onClick: () => this.props.onSideBarItemClick(title), onKeyDown: e => { if (e.keyCode === 13) { this.props.onSideBarItemClick(title); } } }, dom.a({}, title)); } render() { let connections = []; if (this.props.supportsFirefox) { connections.push("Firefox"); } if (this.props.supportsChrome) { connections.push("Chrome", "Node"); } return dom.aside({ className: "sidebar" }, this.renderTitle(this.props.title), dom.ul({}, connections.map(title => this.renderItem(title)), this.renderItem("Settings"))); } } module.exports = Sidebar; /***/ }), /* 1494 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const React = __webpack_require__(0); const { default: InlineSVG } = __webpack_require__(1763); const { isDevelopment } = __webpack_require__(1355); const svg = { rocket: __webpack_require__(1126) }; function Svg({ name, className, onClick, "aria-label": ariaLabel }) { className = `${name} ${className || ""}`; const props = { className, onClick, ["aria-label"]: ariaLabel, src: svg[name] }; return React.createElement(InlineSVG, props); } Svg.displayName = "Svg"; module.exports = Svg; /***/ }), /* 1495 */, /* 1496 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const React = __webpack_require__(0); const { Component } = React; const dom = __webpack_require__(1758); const PropTypes = __webpack_require__(20); const { showMenu, buildMenu } = __webpack_require__(1413); class Settings extends Component { static get propTypes() { return { config: PropTypes.object.isRequired, setValue: PropTypes.func.isRequired }; } constructor(props) { super(props); this.onConfigContextMenu = this.onConfigContextMenu.bind(this); this.onInputHandler = this.onInputHandler.bind(this); this.renderConfig = this.renderConfig.bind(this); this.renderFeatures = this.renderFeatures.bind(this); } onConfigContextMenu(event, key) { event.preventDefault(); const { setValue, config } = this.props; const setConfig = (path, value) => { setValue(path, value); }; const ltrMenuItem = { id: "node-menu-ltr", label: "ltr", disabled: config[key] === "ltr", click: () => setConfig(key, "ltr") }; const rtlMenuItem = { id: "node-menu-rtl", label: "rtl", disabled: config[key] === "rtl", click: () => setConfig(key, "rtl") }; const lightMenuItem = { id: "node-menu-light", label: "light", disabled: config[key] === "light", click: () => setConfig(key, "light") }; const darkMenuItem = { id: "node-menu-dark", label: "dark", disabled: config[key] === "dark", click: () => setConfig(key, "dark") }; const firebugMenuItem = { id: "node-menu-firebug", label: "firebug", disabled: config[key] === "firebug", click: () => setConfig(key, "firebug") }; const items = { "dir": [{ item: ltrMenuItem }, { item: rtlMenuItem }], "theme": [{ item: lightMenuItem }, { item: darkMenuItem }, { item: firebugMenuItem }] }; showMenu(event, buildMenu(items[key])); } onInputHandler(e, path) { const { setValue } = this.props; setValue(path, e.target.checked); } renderConfig(config) { const configs = [{ name: "dir", label: "direction" }, { name: "theme", label: "theme" // Hiding hotReloading option for now. See Issue #242 // { name: "hotReloading", label: "hot reloading", bool: true } }]; return dom.ul({ className: "tab-list" }, configs.map(c => { return dom.li({ key: c.name, className: "tab tab-sides" }, dom.div({ className: "tab-title" }, c.label), c.bool ? dom.input({ type: "checkbox", defaultChecked: config[c.name], onChange: e => this.onInputHandler(e, c.name) }, null) : dom.div({ className: "tab-value", onClick: e => this.onConfigContextMenu(e, c.name) }, config[c.name])); })); } renderFeatures(features) { return dom.ul({ className: "tab-list" }, Object.keys(features).map(key => dom.li({ className: "tab tab-sides", key }, dom.div({ className: "tab-title" }, typeof features[key] == "object" ? features[key].label : key), dom.div({ className: "tab-value" }, dom.input({ type: "checkbox", defaultChecked: features[key].enabled, onChange: e => this.onInputHandler(e, `features.${key}.enabled`) }))))); } render() { const { config } = this.props; return dom.div({ className: "tab-group" }, dom.h3({}, "Configurations"), this.renderConfig(config), config.features ? (dom.h3({}, "Features"), this.renderFeatures(config.features)) : null); } } module.exports = Settings; /***/ }), /* 1497 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ /* global window */ /** * Redux actions for the pause state * @module actions/tabs */ const constants = __webpack_require__(1377); /** * @typedef {Object} TabAction * @memberof actions/tabs * @static * @property {number} type The type of Action * @property {number} value The payload of the Action */ /** * @memberof actions/tabs * @static * @returns {TabAction} with type constants.CLEAR_TABS and tabs as value */ function clearTabs() { return { type: constants.CLEAR_TABS }; } /** * @memberof actions/tabs * @static * @param {Array} tabs * @returns {TabAction} with type constants.ADD_TABS and tabs as value */ function newTabs(tabs) { return ({ getState, dispatch }) => { return dispatch({ type: constants.ADD_TABS, value: tabs }); }; } /** * @memberof actions/tabs * @static * @param {String} $0.id Unique ID of the tab to select * @returns {TabAction} */ function selectTab({ id }) { return { type: constants.SELECT_TAB, id: id }; } /** * @memberof actions/tabs * @static * @param {String} value String which should be used to filter tabs * @returns {TabAction} with type constants.FILTER_TABS * and filter string as value */ function filterTabs(value) { return { type: constants.FILTER_TABS, value }; } module.exports = { newTabs, selectTab, filterTabs, clearTabs }; /***/ }), /* 1498 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const { setConfig: _setConfig } = __webpack_require__(1355); const { updateTheme, updateDir } = __webpack_require__(1362); /** * Redux actions for the pause state * @module actions/config */ const constants = __webpack_require__(1377); /** * @typedef {Object} ConfigAction * @memberof actions/config * @static * @property {number} type The type of Action * @property {number} value The payload of the Action */ /** * @memberof actions/config * @static * @param {string} path * @param {string} value * @returns {ConfigAction} with type constants.SET_VALUE and value */ function setValue(path, value) { return async function ({ dispatch }) { const response = await fetch("/setconfig", { method: "post", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ path, value }) }); const config = await response.json(); _setConfig(config); updateTheme(); updateDir(); dispatch({ type: constants.SET_VALUE, path, value }); }; } /** * @memberof actions/config * @static * @param {string} config * @returns {ConfigAction} with type constants.SET_CONFIG and config */ function setConfig(config) { return { type: constants.SET_CONFIG, config }; } module.exports = { setValue, setConfig }; /***/ }), /* 1499 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.onConnect = undefined; var _firefox = __webpack_require__(1500); var firefox = _interopRequireWildcard(_firefox); var _chrome = __webpack_require__(1507); var chrome = _interopRequireWildcard(_chrome); var _prefs = __webpack_require__(226); var _timings = __webpack_require__(1657); var timings = _interopRequireWildcard(_timings); var _devtoolsConfig = __webpack_require__(1355); var _bootstrap = __webpack_require__(1430); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } /* 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 . */ function loadFromPrefs(actions) { const { pauseOnExceptions, ignoreCaughtExceptions } = _prefs.prefs; if (pauseOnExceptions || ignoreCaughtExceptions) { return actions.pauseOnExceptions(pauseOnExceptions, ignoreCaughtExceptions); } } function getClient(connection) { const { tab: { clientType } } = connection; return clientType == "firefox" ? firefox : chrome; } async function onConnect(connection, { services, toolboxActions }) { // NOTE: the landing page does not connect to a JS process if (!connection) { return; } const client = getClient(connection); const commands = client.clientCommands; const { store, actions, selectors } = (0, _bootstrap.bootstrapStore)(commands, { services, toolboxActions }); (0, _bootstrap.bootstrapWorkers)(); const { bpClients } = await client.onConnect(connection, actions); await loadFromPrefs(actions); window.getGlobalsForTesting = () => { return { store, actions, selectors, client: client.clientCommands, prefs: _prefs.prefs, features: _prefs.features, connection, bpClients, services, timings }; }; if (!(0, _devtoolsConfig.isFirefoxPanel)()) { console.group("Development Notes"); const baseUrl = "https://devtools-html.github.io/debugger.html"; const localDevelopmentUrl = `${baseUrl}/docs/local-development.html`; console.log("Debugging Tips", localDevelopmentUrl); console.log("getGlobalsForTesting", window.getGlobalsForTesting()); console.groupEnd(); } (0, _bootstrap.bootstrapApp)(connection, { store, actions }); return { store, actions, selectors, client: commands }; } exports.onConnect = onConnect; /***/ }), /* 1500 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.clientEvents = exports.clientCommands = undefined; exports.onConnect = onConnect; var _commands = __webpack_require__(1501); var _events = __webpack_require__(1506); var _prefs = __webpack_require__(226); async function onConnect(connection, actions) { const { tabConnection: { tabTarget, threadClient, debuggerClient } } = connection; if (!tabTarget || !threadClient || !debuggerClient) { return { bpClients: {} }; } const supportsWasm = _prefs.features.wasm && !!debuggerClient.mainRoot.traits.wasmBinarySource; const { bpClients } = (0, _commands.setupCommands)({ threadClient, tabTarget, debuggerClient, supportsWasm }); if (actions) { (0, _events.setupEvents)({ threadClient, actions, supportsWasm }); } tabTarget.on("will-navigate", actions.willNavigate); tabTarget.on("navigate", actions.navigated); await threadClient.reconfigure({ observeAsmJS: true, wasmBinarySource: supportsWasm }); // NOTE: The Worker and Browser Content toolboxes do not have a parent // with a listWorkers function // TODO: there is a listWorkers property, but it is not a function on the // parent. Investigate what it is if (threadClient._parent && typeof threadClient._parent.listWorkers === "function") { threadClient._parent.listWorkers().then(workers => actions.setWorkers(workers)); } // In Firefox, we need to initially request all of the sources. This // usually fires off individual `newSource` notifications as the // debugger finds them, but there may be existing sources already in // the debugger (if it's paused already, or if loading the page from // bfcache) so explicity fire `newSource` events for all returned // sources. const sources = await _commands.clientCommands.fetchSources(); actions.connect(tabTarget.url); await actions.newSources(sources); // If the threadClient is already paused, make sure to show a // paused state. const pausedPacket = threadClient.getLastPausePacket(); if (pausedPacket) { _events.clientEvents.paused("paused", pausedPacket); } return { bpClients }; } /* 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 . */ exports.clientCommands = _commands.clientCommands; exports.clientEvents = _events.clientEvents; /***/ }), /* 1501 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.clientCommands = exports.setupCommands = undefined; var _breakpoint = __webpack_require__(1364); var _create = __webpack_require__(1428); /* 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 . */ let bpClients; let threadClient; let tabTarget; let debuggerClient; let supportsWasm; function setupCommands(dependencies) { threadClient = dependencies.threadClient; tabTarget = dependencies.tabTarget; debuggerClient = dependencies.debuggerClient; supportsWasm = dependencies.supportsWasm; bpClients = {}; return { bpClients }; } function resume() { return new Promise(resolve => { threadClient.resume(resolve); }); } function stepIn() { return new Promise(resolve => { threadClient.stepIn(resolve); }); } function stepOver() { return new Promise(resolve => { threadClient.stepOver(resolve); }); } function stepOut() { return new Promise(resolve => { threadClient.stepOut(resolve); }); } function breakOnNext() { return threadClient.breakOnNext(); } function sourceContents(sourceId) { const sourceClient = threadClient.source({ actor: sourceId }); return sourceClient.source(); } function getBreakpointByLocation(location) { const id = (0, _breakpoint.makeLocationId)(location); const bpClient = bpClients[id]; if (bpClient) { const { actor, url, line, column, condition } = bpClient.location; return { id: bpClient.actor, condition, actualLocation: { line, column, sourceId: actor, sourceUrl: url } }; } return null; } function setBreakpoint(location, condition, noSliding) { const sourceClient = threadClient.source({ actor: location.sourceId }); return sourceClient.setBreakpoint({ line: location.line, column: location.column, condition, noSliding }).then(([{ actualLocation }, bpClient]) => { actualLocation = (0, _create.createBreakpointLocation)(location, actualLocation); const id = (0, _breakpoint.makeLocationId)(actualLocation); bpClients[id] = bpClient; bpClient.location.line = actualLocation.line; bpClient.location.column = actualLocation.column; bpClient.location.url = actualLocation.sourceUrl || ""; return { id, actualLocation }; }); } function removeBreakpoint(generatedLocation) { try { const id = (0, _breakpoint.makeLocationId)(generatedLocation); const bpClient = bpClients[id]; if (!bpClient) { console.warn("No breakpoint to delete on server"); return Promise.resolve(); } delete bpClients[id]; return bpClient.remove(); } catch (_error) { console.warn("No breakpoint to delete on server"); } } function setBreakpointCondition(breakpointId, location, condition, noSliding) { const bpClient = bpClients[breakpointId]; delete bpClients[breakpointId]; return bpClient.setCondition(threadClient, condition, noSliding).then(_bpClient => { bpClients[breakpointId] = _bpClient; return { id: breakpointId }; }); } function evaluate(script, { frameId }) { const params = frameId ? { frameActor: frameId } : {}; if (!tabTarget || !tabTarget.activeConsole) { return Promise.resolve(); } return new Promise(resolve => { tabTarget.activeConsole.evaluateJS(script, result => resolve(result), params); }); } function debuggeeCommand(script) { tabTarget.activeConsole.evaluateJS(script, () => {}, {}); if (!debuggerClient) { return; } const consoleActor = tabTarget.form.consoleActor; const request = debuggerClient._activeRequests.get(consoleActor); request.emit("json-reply", {}); debuggerClient._activeRequests.delete(consoleActor); return Promise.resolve(); } function navigate(url) { return tabTarget.activeTab.navigateTo(url); } function reload() { return tabTarget.activeTab.reload(); } function getProperties(grip) { const objClient = threadClient.pauseGrip(grip); return objClient.getPrototypeAndProperties().then(resp => { const { ownProperties, safeGetterValues } = resp; for (const name in safeGetterValues) { const { enumerable, writable, getterValue } = safeGetterValues[name]; ownProperties[name] = { enumerable, writable, value: getterValue }; } return resp; }); } async function getFrameScopes(frame) { if (frame.scope) { return frame.scope; } return threadClient.getEnvironment(frame.id); } function pauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) { return threadClient.pauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions); } function prettyPrint(sourceId, indentSize) { const sourceClient = threadClient.source({ actor: sourceId }); return sourceClient.prettyPrint(indentSize); } async function blackBox(sourceId, isBlackBoxed) { const sourceClient = threadClient.source({ actor: sourceId }); if (isBlackBoxed) { await sourceClient.unblackBox(); } else { await sourceClient.blackBox(); } return { isBlackBoxed: !isBlackBoxed }; } function disablePrettyPrint(sourceId) { const sourceClient = threadClient.source({ actor: sourceId }); return sourceClient.disablePrettyPrint(); } function interrupt() { return threadClient.interrupt(); } function eventListeners() { return threadClient.eventListeners(); } function pauseGrip(func) { return threadClient.pauseGrip(func); } async function fetchSources() { const { sources } = await threadClient.getSources(); return sources.map(source => (0, _create.createSource)(source, { supportsWasm })); } const clientCommands = { blackBox, interrupt, eventListeners, pauseGrip, resume, stepIn, stepOut, stepOver, breakOnNext, sourceContents, getBreakpointByLocation, setBreakpoint, removeBreakpoint, setBreakpointCondition, evaluate, debuggeeCommand, navigate, reload, getProperties, getFrameScopes, pauseOnExceptions, prettyPrint, disablePrettyPrint, fetchSources }; exports.setupCommands = setupCommands; exports.clientCommands = clientCommands; /***/ }), /* 1502 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); var _lodash = __webpack_require__(2); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } // hasOwnProperty is defensive because it is possible that the // object that we're creating a map for has a `hasOwnProperty` field /* 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 . */ /** * Immutable JS conversion utils * @deprecated * @module utils/fromJS */ function hasOwnProperty(value, key) { if (value.hasOwnProperty && (0, _lodash.isFunction)(value.hasOwnProperty)) { return value.hasOwnProperty(key); } if (value.prototype && value.prototype.hasOwnProperty) { return value.prototype.hasOwnProperty(key); } return false; } /* creates an immutable map, where each of the value's items are transformed into their own map. NOTE: we guard against `length` being a property because length confuses Immutable's internal algorithm. */ function createMap(value) { const hasLength = hasOwnProperty(value, "length"); const length = value.length; if (hasLength) { value.length = `${value.length}`; } let map = I.Seq(value).map(fromJS).toMap(); if (hasLength) { map = map.set("length", length); value.length = length; } return map; } function createList(value) { return I.Seq(value).map(fromJS).toList(); } /** * When our app state is fully typed, we should be able to get rid of * this function. This is only temporarily necessary to support * converting typed objects to immutable.js, which usually happens in * reducers. * * @memberof utils/fromJS * @static */ function fromJS(value) { if (Array.isArray(value)) { return createList(value); } if (value && value.constructor && value.constructor.meta) { // This adds support for tcomb objects which are native JS objects // but are not "plain", so the above checks fail. Since they // behave the same we can use the same constructors, but we need // special checks for them. const kind = value.constructor.meta.kind; if (kind === "struct") { return createMap(value); } else if (kind === "list") { return createList(value); } } // If it's a primitive type, just return the value. Note `==` check // for null, which is intentionally used to match either `null` or // `undefined`. if (value == null || typeof value !== "object") { return value; } // Otherwise, treat it like an object. We can't reliably detect if // it's a plain object because we might be objects from other JS // contexts so `Object !== Object`. return createMap(value); } module.exports = fromJS; /***/ }), /* 1503 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = getBreakpointAtLocation; var _sources = __webpack_require__(1369); var _breakpoints = __webpack_require__(1378); var _devtoolsSourceMap = __webpack_require__(1360); function isGenerated(selectedSource) { const sourceId = selectedSource.get("id"); return (0, _devtoolsSourceMap.isGeneratedId)(sourceId); } /* 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 . */ function getColumn(column, selectedSource) { if (column) { return column; } return isGenerated(selectedSource) ? undefined : 0; } function getLocation(bp, selectedSource) { return isGenerated(selectedSource) ? bp.generatedLocation || bp.location : bp.location; } function getBreakpointsForSource(state, selectedSource) { const breakpoints = (0, _breakpoints.getBreakpoints)(state); return breakpoints.filter(bp => { const location = getLocation(bp, selectedSource); return location.sourceId === selectedSource.get("id"); }); } function findBreakpointAtLocation(breakpoints, selectedSource, { line, column }) { return breakpoints.find(breakpoint => { const location = getLocation(breakpoint, selectedSource); const sameLine = location.line === line; if (!sameLine) { return false; } if (column === undefined) { return true; } return location.column === getColumn(column, selectedSource); }); } /* * Finds a breakpoint at a location (line, column) of the * selected source. * * This is useful for finding a breakpoint when the * user clicks in the gutter or on a token. */ function getBreakpointAtLocation(state, location) { const selectedSource = (0, _sources.getSelectedSource)(state); const breakpoints = getBreakpointsForSource(state, selectedSource); return findBreakpointAtLocation(breakpoints, selectedSource, location); } /***/ }), /* 1504 */, /* 1505 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = isSelectedFrameVisible; var _pause = __webpack_require__(1394); var _sources = __webpack_require__(1369); /* * Checks to if the selected frame's source is currently * selected. */ /* 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 . */ function isSelectedFrameVisible(state) { const selectedLocation = (0, _sources.getSelectedLocation)(state); const selectedFrame = (0, _pause.getSelectedFrame)(state); return selectedFrame && selectedLocation && selectedFrame.location.sourceId == selectedLocation.sourceId; } /***/ }), /* 1506 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.clientEvents = exports.setupEvents = undefined; var _create = __webpack_require__(1428); var _sourceQueue = __webpack_require__(1795); var _sourceQueue2 = _interopRequireDefault(_sourceQueue); var _devtoolsConfig = __webpack_require__(1355); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ const CALL_STACK_PAGE_SIZE = 1000; let threadClient; let actions; let supportsWasm; let isInterrupted; function setupEvents(dependencies) { threadClient = dependencies.threadClient; actions = dependencies.actions; supportsWasm = dependencies.supportsWasm; _sourceQueue2.default.initialize({ actions, supportsWasm, createSource: _create.createSource }); if (threadClient) { Object.keys(clientEvents).forEach(eventName => { threadClient.addListener(eventName, clientEvents[eventName]); }); } } async function paused(_, packet) { // If paused by an explicit interrupt, which are generated by the // slow script dialog and internal events such as setting // breakpoints, ignore the event. const { why } = packet; if (why.type === "interrupted" && !packet.why.onNext) { isInterrupted = true; return; } // Eagerly fetch the frames const response = await threadClient.getFrames(0, CALL_STACK_PAGE_SIZE); if (why.type != "alreadyPaused") { const pause = (0, _create.createPause)(packet, response); _sourceQueue2.default.flush(); actions.paused(pause); } } function resumed(_, packet) { // NOTE: the client suppresses resumed events while interrupted // to prevent unintentional behavior. // see [client docs](../README.md#interrupted) for more information. if (isInterrupted) { isInterrupted = false; return; } actions.resumed(packet); } function newSource(_, { source }) { _sourceQueue2.default.queue(source); if ((0, _devtoolsConfig.isEnabled)("eventListeners")) { actions.fetchEventListeners(); } } const clientEvents = { paused, resumed, newSource }; exports.setupEvents = setupEvents; exports.clientEvents = clientEvents; /***/ }), /* 1507 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.clientEvents = exports.clientCommands = undefined; exports.onConnect = onConnect; var _commands = __webpack_require__(1508); var _events = __webpack_require__(1509); /* 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 . */ async function onConnect(connection, actions) { const { tabConnection, connTarget: { type } } = connection; const { Debugger, Runtime, Page } = tabConnection; Debugger.enable(); Debugger.setPauseOnExceptions({ state: "none" }); Debugger.setAsyncCallStackDepth({ maxDepth: 0 }); if (type == "chrome") { Page.frameNavigated(_events.pageEvents.frameNavigated); Page.frameStartedLoading(_events.pageEvents.frameStartedLoading); Page.frameStoppedLoading(_events.pageEvents.frameStoppedLoading); } Debugger.scriptParsed(_events.clientEvents.scriptParsed); Debugger.scriptFailedToParse(_events.clientEvents.scriptFailedToParse); Debugger.paused(_events.clientEvents.paused); Debugger.resumed(_events.clientEvents.resumed); (0, _commands.setupCommands)({ Debugger, Runtime, Page }); (0, _events.setupEvents)({ actions, Page, type, Runtime }); return {}; } exports.clientCommands = _commands.clientCommands; exports.clientEvents = _events.clientEvents; /***/ }), /* 1508 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.clientCommands = exports.setupCommands = undefined; var _create = __webpack_require__(1429); let debuggerAgent; /* 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 . */ let runtimeAgent; let pageAgent; function setupCommands({ Debugger, Runtime, Page }) { debuggerAgent = Debugger; runtimeAgent = Runtime; pageAgent = Page; } function resume() { return debuggerAgent.resume(); } function stepIn() { return debuggerAgent.stepInto(); } function stepOver() { return debuggerAgent.stepOver(); } function stepOut() { return debuggerAgent.stepOut(); } function pauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) { if (!shouldPauseOnExceptions) { return debuggerAgent.setPauseOnExceptions({ state: "none" }); } const state = shouldIgnoreCaughtExceptions ? "uncaught" : "all"; return debuggerAgent.setPauseOnExceptions({ state }); } function breakOnNext() { return debuggerAgent.pause(); } function sourceContents(sourceId) { return debuggerAgent.getScriptSource({ scriptId: sourceId }).then(({ scriptSource }) => ({ source: scriptSource, contentType: null })); } async function setBreakpoint(location, condition) { const { breakpointId, serverLocation } = await debuggerAgent.setBreakpoint({ location: (0, _create.toServerLocation)(location), columnNumber: location.column }); const actualLocation = (0, _create.fromServerLocation)(serverLocation) || location; return { id: breakpointId, actualLocation: actualLocation }; } function removeBreakpoint(breakpointId) { return debuggerAgent.removeBreakpoint({ breakpointId }); } async function getProperties(object) { const { result } = await runtimeAgent.getProperties({ objectId: object.objectId }); const loadedObjects = result.map(_create.createLoadedObject); return { loadedObjects }; } function evaluate(script) { return runtimeAgent.evaluate({ expression: script }); } function debuggeeCommand(script) { evaluate(script); return Promise.resolve(); } function navigate(url) { return pageAgent.navigate({ url }); } const clientCommands = { resume, stepIn, stepOut, stepOver, pauseOnExceptions, breakOnNext, sourceContents, setBreakpoint, removeBreakpoint, evaluate, debuggeeCommand, navigate, getProperties }; exports.setupCommands = setupCommands; exports.clientCommands = clientCommands; /***/ }), /* 1509 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.clientEvents = exports.pageEvents = exports.setupEvents = undefined; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ var _create = __webpack_require__(1429); let actions; let pageAgent; let clientType; let runtimeAgent; function setupEvents(dependencies) { actions = dependencies.actions; pageAgent = dependencies.Page; clientType = dependencies.clientType; runtimeAgent = dependencies.Runtime; } // Debugger Events function scriptParsed({ scriptId, url, startLine, startColumn, endLine, endColumn, executionContextId, hash, isContentScript, isInternalScript, isLiveEdit, sourceMapURL, hasSourceURL, deprecatedCommentWasUsed }) { if (isContentScript) { return; } if (clientType == "node") { sourceMapURL = undefined; } actions.newSource({ id: scriptId, url, sourceMapURL, isPrettyPrinted: false }); } function scriptFailedToParse() {} async function paused({ callFrames, reason, data, hitBreakpoints, asyncStackTrace }) { const frames = callFrames.map(_create.createFrame); const frame = frames[0]; const why = _extends({ type: reason }, data); const objectId = frame.scopeChain[0].object.objectId; const { result } = await runtimeAgent.getProperties({ objectId }); const loadedObjects = result.map(_create.createLoadedObject); if (clientType == "chrome") { pageAgent.configureOverlay({ message: "Paused in debugger.html" }); } await actions.paused({ frame, why, frames, loadedObjects }); } function resumed() { if (clientType == "chrome") { pageAgent.configureOverlay({ suspended: false }); } actions.resumed(); } function globalObjectCleared() {} // Page Events function frameNavigated(frame) { actions.navigated(); } function frameStartedLoading() { actions.willNavigate(); } function domContentEventFired() {} function loadEventFired() {} function frameStoppedLoading() {} const clientEvents = { scriptParsed, scriptFailedToParse, paused, resumed, globalObjectCleared }; const pageEvents = { frameNavigated, frameStartedLoading, domContentEventFired, loadEventFired, frameStoppedLoading }; exports.setupEvents = setupEvents; exports.pageEvents = pageEvents; exports.clientEvents = clientEvents; /***/ }), /* 1510 */, /* 1511 */, /* 1512 */, /* 1513 */, /* 1514 */, /* 1515 */, /* 1516 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _expressions = __webpack_require__(1417); var _expressions2 = _interopRequireDefault(_expressions); var _eventListeners = __webpack_require__(1420); var _eventListeners2 = _interopRequireDefault(_eventListeners); var _sources = __webpack_require__(1369); var _sources2 = _interopRequireDefault(_sources); var _breakpoints = __webpack_require__(1378); var _breakpoints2 = _interopRequireDefault(_breakpoints); var _pendingBreakpoints = __webpack_require__(1419); var _pendingBreakpoints2 = _interopRequireDefault(_pendingBreakpoints); var _asyncRequests = __webpack_require__(1517); var _asyncRequests2 = _interopRequireDefault(_asyncRequests); var _pause = __webpack_require__(1394); var _pause2 = _interopRequireDefault(_pause); var _ui = __webpack_require__(1421); var _ui2 = _interopRequireDefault(_ui); var _fileSearch = __webpack_require__(1422); var _fileSearch2 = _interopRequireDefault(_fileSearch); var _ast = __webpack_require__(1383); var _ast2 = _interopRequireDefault(_ast); var _coverage = __webpack_require__(1423); var _coverage2 = _interopRequireDefault(_coverage); var _projectTextSearch = __webpack_require__(1424); var _projectTextSearch2 = _interopRequireDefault(_projectTextSearch); var _quickOpen = __webpack_require__(1635); var _quickOpen2 = _interopRequireDefault(_quickOpen); var _sourceTree = __webpack_require__(1426); var _sourceTree2 = _interopRequireDefault(_sourceTree); var _debuggee = __webpack_require__(1418); var _debuggee2 = _interopRequireDefault(_debuggee); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = { expressions: _expressions2.default, eventListeners: _eventListeners2.default, sources: _sources2.default, breakpoints: _breakpoints2.default, pendingBreakpoints: _pendingBreakpoints2.default, asyncRequests: _asyncRequests2.default, pause: _pause2.default, ui: _ui2.default, fileSearch: _fileSearch2.default, ast: _ast2.default, coverage: _coverage2.default, projectTextSearch: _projectTextSearch2.default, quickOpen: _quickOpen2.default, sourceTree: _sourceTree2.default, debuggee: _debuggee2.default }; /* 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/. */ /** * Reducer index * @module reducers/index */ /***/ }), /* 1517 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /* 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/. */ /** * Async request reducer * @module reducers/async-request */ const initialState = []; function update(state = initialState, action) { const { seqId } = action; if (action.type === "NAVIGATE") { return initialState; } else if (seqId) { let newState; if (action.status === "start") { newState = [...state, seqId]; } else if (action.status === "error" || action.status === "done") { newState = state.filter(id => id !== seqId); } return newState; } return state; } exports.default = update; /***/ }), /* 1518 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _propTypes = __webpack_require__(20); var _propTypes2 = _interopRequireDefault(_propTypes); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _prefs = __webpack_require__(226); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _ShortcutsModal = __webpack_require__(1535); var _selectors = __webpack_require__(1352); var _ui = __webpack_require__(1439); var _devtoolsModules = __webpack_require__(1376); __webpack_require__(1305); __webpack_require__(1306); __webpack_require__(1307); __webpack_require__(1308); var _devtoolsSplitter = __webpack_require__(1440); var _devtoolsSplitter2 = _interopRequireDefault(_devtoolsSplitter); var _ProjectSearch = __webpack_require__(1538); var _ProjectSearch2 = _interopRequireDefault(_ProjectSearch); var _PrimaryPanes = __webpack_require__(1551); var _PrimaryPanes2 = _interopRequireDefault(_PrimaryPanes); var _Editor = __webpack_require__(1554); var _Editor2 = _interopRequireDefault(_Editor); var _SecondaryPanes = __webpack_require__(1599); var _SecondaryPanes2 = _interopRequireDefault(_SecondaryPanes); var _WelcomeBox = __webpack_require__(1613); var _WelcomeBox2 = _interopRequireDefault(_WelcomeBox); var _Tabs = __webpack_require__(1614); var _Tabs2 = _interopRequireDefault(_Tabs); var _QuickOpenModal = __webpack_require__(1652); var _QuickOpenModal2 = _interopRequireDefault(_QuickOpenModal); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ const shortcuts = new _devtoolsModules.KeyShortcuts({ window }); const { appinfo } = _devtoolsModules.Services; const isMacOS = appinfo.OS === "Darwin"; const verticalLayoutBreakpoint = window.matchMedia("(min-width: 800px)"); class App extends _react.Component { constructor(props) { super(props); this.state = { shortcutsModalEnabled: false, startPanelSize: 0, endPanelSize: 0 }; this.getChildContext = this.getChildContext.bind(this); this.onLayoutChange = this.onLayoutChange.bind(this); this.toggleQuickOpenModal = this.toggleQuickOpenModal.bind(this); this.renderEditorPane = this.renderEditorPane.bind(this); this.renderVerticalLayout = this.renderVerticalLayout.bind(this); this.onEscape = this.onEscape.bind(this); this.onCommandSlash = this.onCommandSlash.bind(this); } getChildContext() { return { shortcuts }; } componentDidMount() { verticalLayoutBreakpoint.addListener(this.onLayoutChange); shortcuts.on(L10N.getStr("symbolSearch.search.key2"), (_, e) => this.toggleQuickOpenModal(_, e, "@")); const searchKeys = [L10N.getStr("sources.search.key2"), L10N.getStr("sources.search.alt.key")]; searchKeys.forEach(key => shortcuts.on(key, this.toggleQuickOpenModal)); shortcuts.on(L10N.getStr("gotoLineModal.key"), (_, e) => this.toggleQuickOpenModal(_, e, ":")); shortcuts.on("Escape", this.onEscape); shortcuts.on("Cmd+/", this.onCommandSlash); } componentWillUnmount() { verticalLayoutBreakpoint.removeListener(this.onLayoutChange); shortcuts.off(L10N.getStr("symbolSearch.search.key2"), this.toggleQuickOpenModal); const searchKeys = [L10N.getStr("sources.search.key2"), L10N.getStr("sources.search.alt.key")]; searchKeys.forEach(key => shortcuts.off(key, this.toggleQuickOpenModal)); shortcuts.off(L10N.getStr("gotoLineModal.key"), this.toggleQuickOpenModal); shortcuts.off("Escape", this.onEscape); } onEscape(_, e) { const { activeSearch, quickOpenEnabled, closeActiveSearch, closeQuickOpen } = this.props; if (activeSearch) { e.preventDefault(); closeActiveSearch(); } if (quickOpenEnabled === true) { closeQuickOpen(); } } onCommandSlash() { this.toggleShortcutsModal(); } isHorizontal() { return this.props.orientation === "horizontal"; } toggleQuickOpenModal(_, e, query) { const { quickOpenEnabled, openQuickOpen, closeQuickOpen } = this.props; e.preventDefault(); e.stopPropagation(); if (quickOpenEnabled === true) { closeQuickOpen(); return; } if (query != null) { openQuickOpen(query); return; } openQuickOpen(); return; } onLayoutChange() { const orientation = verticalLayoutBreakpoint.matches ? "horizontal" : "vertical"; if ((0, _ui.isVisible)()) { this.props.setOrientation(orientation); } } renderEditorPane() { const { startPanelCollapsed, endPanelCollapsed } = this.props; const { endPanelSize, startPanelSize } = this.state; const horizontal = this.isHorizontal(); return _react2.default.createElement( "div", { className: "editor-pane" }, _react2.default.createElement( "div", { className: "editor-container" }, _react2.default.createElement(_Tabs2.default, { startPanelCollapsed: startPanelCollapsed, endPanelCollapsed: endPanelCollapsed, horizontal: horizontal, startPanelSize: startPanelSize, endPanelSize: endPanelSize }), _react2.default.createElement(_Editor2.default, { horizontal: horizontal, startPanelSize: startPanelSize, endPanelSize: endPanelSize }), !this.props.selectedSource ? _react2.default.createElement(_WelcomeBox2.default, { horizontal: horizontal }) : null, _react2.default.createElement(_ProjectSearch2.default, null) ) ); } toggleShortcutsModal() { this.setState({ shortcutsModalEnabled: !this.state.shortcutsModalEnabled }); } renderHorizontalLayout() { const { startPanelCollapsed, endPanelCollapsed } = this.props; const horizontal = this.isHorizontal(); const overflowX = endPanelCollapsed ? "hidden" : "auto"; return _react2.default.createElement(_devtoolsSplitter2.default, { style: { width: "100vw" }, initialSize: "250px", minSize: 10, maxSize: "50%", splitterSize: 1, onResizeEnd: size => this.setState({ startPanelSize: size }), startPanel: _react2.default.createElement(_PrimaryPanes2.default, { horizontal: horizontal }), startPanelCollapsed: startPanelCollapsed, endPanel: _react2.default.createElement(_devtoolsSplitter2.default, { style: { overflowX }, initialSize: "300px", minSize: 10, maxSize: "80%", splitterSize: 1, onResizeEnd: size => this.setState({ endPanelSize: size }), endPanelControl: true, startPanel: this.renderEditorPane(), endPanel: _react2.default.createElement(_SecondaryPanes2.default, { horizontal: horizontal, toggleShortcutsModal: () => this.toggleShortcutsModal() }), endPanelCollapsed: endPanelCollapsed, vert: horizontal }) }); } renderVerticalLayout() { const { startPanelCollapsed, endPanelCollapsed } = this.props; const horizontal = this.isHorizontal(); return _react2.default.createElement(_devtoolsSplitter2.default, { style: { width: "100vw" }, initialSize: "300px", minSize: 30, maxSize: "99%", splitterSize: 1, vert: horizontal, startPanel: _react2.default.createElement(_devtoolsSplitter2.default, { style: { width: "100vw" }, initialSize: "250px", minSize: 10, maxSize: "40%", splitterSize: 1, startPanelCollapsed: startPanelCollapsed, startPanel: _react2.default.createElement(_PrimaryPanes2.default, { horizontal: horizontal }), endPanel: this.renderEditorPane() }), endPanel: _react2.default.createElement(_SecondaryPanes2.default, { horizontal: horizontal, toggleShortcutsModal: () => this.toggleShortcutsModal() }), endPanelCollapsed: endPanelCollapsed }); } renderShortcutsModal() { const additionalClass = isMacOS ? "mac" : ""; if (!_prefs.features.shortcuts) { return; } return _react2.default.createElement(_ShortcutsModal.ShortcutsModal, { additionalClass: additionalClass, enabled: this.state.shortcutsModalEnabled, handleClose: () => this.toggleShortcutsModal() }); } render() { const { quickOpenEnabled } = this.props; return _react2.default.createElement( "div", { className: "debugger" }, this.isHorizontal() ? this.renderHorizontalLayout() : this.renderVerticalLayout(), quickOpenEnabled === true && _react2.default.createElement(_QuickOpenModal2.default, null), this.renderShortcutsModal() ); } } App.childContextTypes = { shortcuts: _propTypes2.default.object }; function mapStateToProps(state) { return { selectedSource: (0, _selectors.getSelectedSource)(state), startPanelCollapsed: (0, _selectors.getPaneCollapse)(state, "start"), endPanelCollapsed: (0, _selectors.getPaneCollapse)(state, "end"), activeSearch: (0, _selectors.getActiveSearch)(state), quickOpenEnabled: (0, _selectors.getQuickOpenEnabled)(state), orientation: (0, _selectors.getOrientation)(state) }; } exports.default = (0, _reactRedux.connect)(mapStateToProps, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(App); /***/ }), /* 1519 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ var _breakpoint = __webpack_require__(1364); var _selectors = __webpack_require__(1352); var _sourceMaps = __webpack_require__(1397); exports.default = async function addBreakpoint(getState, client, sourceMaps, { breakpoint }) { const state = getState(); const source = (0, _selectors.getSource)(state, breakpoint.location.sourceId); const sourceRecord = source.toJS(); const location = _extends({}, breakpoint.location, { sourceUrl: source.get("url") }); const generatedLocation = await (0, _sourceMaps.getGeneratedLocation)(state, sourceRecord, location, sourceMaps); (0, _breakpoint.assertLocation)(location); (0, _breakpoint.assertLocation)(generatedLocation); if ((0, _breakpoint.breakpointExists)(state, location)) { const newBreakpoint = _extends({}, breakpoint, { location, generatedLocation }); (0, _breakpoint.assertBreakpoint)(newBreakpoint); return { breakpoint: newBreakpoint }; } const { id, hitCount, actualLocation } = await client.setBreakpoint(generatedLocation, breakpoint.condition, sourceMaps.isOriginalId(location.sourceId)); const newGeneratedLocation = actualLocation || generatedLocation; const newLocation = await sourceMaps.getOriginalLocation(newGeneratedLocation); const astLocation = await (0, _breakpoint.getASTLocation)(sourceRecord, location); const newBreakpoint = { id, disabled: false, hidden: breakpoint.hidden, loading: false, condition: breakpoint.condition, location: newLocation, astLocation, hitCount, generatedLocation: newGeneratedLocation }; (0, _breakpoint.assertBreakpoint)(newBreakpoint); const previousLocation = (0, _breakpoint.locationMoved)(location, newLocation) ? location : null; return { breakpoint: newBreakpoint, previousLocation }; }; /***/ }), /* 1520 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; exports.default = remapLocations; /* 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 . */ function remapLocations(breakpoints, sourceId, sourceMaps) { const sourceBreakpoints = breakpoints.map(async breakpoint => { if (breakpoint.location.sourceId !== sourceId) { return breakpoint; } const location = await sourceMaps.getOriginalLocation(breakpoint.location); return _extends({}, breakpoint, { location }); }); return Promise.all(sourceBreakpoints.valueSeq()); } /***/ }), /* 1521 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ exports.syncClientBreakpoint = syncClientBreakpoint; var _breakpoint = __webpack_require__(1364); var _sourceMaps = __webpack_require__(1397); var _devtoolsSourceMap = __webpack_require__(1360); var _selectors = __webpack_require__(1352); async function makeScopedLocation({ name, offset }, location, source) { const scope = await (0, _breakpoint.findScopeByName)(source, name); // fallback onto the location line, if the scope is not found // note: we may at some point want to delete the breakpoint if the scope // disappears const line = scope ? scope.location.start.line + offset.line : location.line; return { line, column: location.column, sourceUrl: source.url, sourceId: source.id }; } function createSyncData(id, pendingBreakpoint, location, generatedLocation, previousLocation = null) { const overrides = _extends({}, pendingBreakpoint, { generatedLocation, id }); const breakpoint = (0, _breakpoint.createBreakpoint)(location, overrides); (0, _breakpoint.assertBreakpoint)(breakpoint); return { breakpoint, previousLocation }; } // we have three forms of syncing: disabled syncing, existing server syncing // and adding a new breakpoint async function syncClientBreakpoint(getState, client, sourceMaps, sourceId, pendingBreakpoint) { (0, _breakpoint.assertPendingBreakpoint)(pendingBreakpoint); const source = (0, _selectors.getSource)(getState(), sourceId).toJS(); const generatedSourceId = sourceMaps.isOriginalId(sourceId) ? (0, _devtoolsSourceMap.originalToGeneratedId)(sourceId) : sourceId; const { location, astLocation } = pendingBreakpoint; const previousLocation = _extends({}, location, { sourceId }); const scopedLocation = await makeScopedLocation(astLocation, previousLocation, source); const scopedGeneratedLocation = await (0, _sourceMaps.getGeneratedLocation)(getState(), source, scopedLocation, sourceMaps); // this is the generatedLocation of the pending breakpoint, with // the source id updated to reflect the new connection const generatedLocation = _extends({}, pendingBreakpoint.generatedLocation, { sourceId: generatedSourceId }); const isSameLocation = !(0, _breakpoint.locationMoved)(generatedLocation, scopedGeneratedLocation); const existingClient = client.getBreakpointByLocation(generatedLocation); /** ******* CASE 1: No server change ***********/ // early return if breakpoint is disabled or we are in the sameLocation // send update only to redux if (pendingBreakpoint.disabled || existingClient && isSameLocation) { const id = pendingBreakpoint.disabled ? "" : existingClient.id; return createSyncData(id, pendingBreakpoint, scopedLocation, scopedGeneratedLocation); } // clear server breakpoints if they exist and we have moved if (existingClient) { await client.removeBreakpoint(generatedLocation); } /** ******* Case 2: Add New Breakpoint ***********/ // If we are not disabled, set the breakpoint on the server and get // that info so we can set it on our breakpoints. const { id, actualLocation } = await client.setBreakpoint(scopedGeneratedLocation, pendingBreakpoint.condition, sourceMaps.isOriginalId(sourceId)); // the breakpoint might have slid server side, so we want to get the location // based on the server's return value const newGeneratedLocation = actualLocation; const newLocation = await sourceMaps.getOriginalLocation(newGeneratedLocation); return createSyncData(id, pendingBreakpoint, newLocation, newGeneratedLocation, previousLocation); } /***/ }), /* 1522 */, /* 1523 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createPrettySource = createPrettySource; var _selectors = __webpack_require__(1352); var _prettyPrint = __webpack_require__(1431); var _pause = __webpack_require__(1400); var _source = __webpack_require__(1356); /* 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 . */ function createPrettySource(sourceId) { return async ({ dispatch, getState, sourceMaps }) => { const source = (0, _selectors.getSource)(getState(), sourceId); const url = (0, _source.getPrettySourceURL)(source.get("url")); const id = await sourceMaps.generatedToOriginalId(sourceId, url); const { code, mappings } = await (0, _prettyPrint.prettyPrint)({ source, url }); await sourceMaps.applySourceMap(source.get("id"), url, code, mappings); let frames = (0, _selectors.getFrames)(getState()); if (frames) { frames = await (0, _pause.updateFrameLocations)(frames, sourceMaps); } const prettySource = { url, id, isPrettyPrinted: true, text: code, contentType: "text/javascript", frames, loadedState: "loaded" }; dispatch({ type: "ADD_SOURCE", source: prettySource }); return prettySource; }; } /***/ }), /* 1524 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ function forEachLine(codeMirror, iter) { codeMirror.operation(() => { codeMirror.doc.iter(0, codeMirror.lineCount(), iter); }); } function removeLineClass(codeMirror, line, className) { codeMirror.removeLineClass(line, "line", className); } function clearLineClass(codeMirror, className) { forEachLine(codeMirror, line => { removeLineClass(codeMirror, line, className); }); } function getTextForLine(codeMirror, line) { return codeMirror.getLine(line - 1).trim(); } function getCursorLine(codeMirror) { return codeMirror.getCursor().line; } function getTokenLocation(codeMirror, tokenEl) { const lineOffset = 1; const { left, top } = tokenEl.getBoundingClientRect(); const { line, ch } = codeMirror.coordsChar({ left, top }); return { line: line + lineOffset, column: ch }; } module.exports = { removeLineClass, clearLineClass, getTextForLine, getCursorLine, getTokenLocation }; /***/ }), /* 1525 */, /* 1526 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getMatchIndex = exports.removeOverlay = exports.findPrev = exports.findNext = exports.find = exports.buildQuery = undefined; var _buildQuery = __webpack_require__(1402); var _buildQuery2 = _interopRequireDefault(_buildQuery); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * @memberof utils/source-search * @static */ function getSearchCursor(cm, query, pos, modifiers) { const regexQuery = (0, _buildQuery2.default)(query, modifiers, { isGlobal: true }); return cm.getSearchCursor(regexQuery, pos); } /** * @memberof utils/source-search * @static */ /* 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 . */ function SearchState() { this.posFrom = this.posTo = this.query = null; this.overlay = null; this.results = []; } /** * @memberof utils/source-search * @static */ function getSearchState(cm, query, modifiers) { const state = cm.state.search || (cm.state.search = new SearchState()); return state; } function isWhitespace(query) { return !query.match(/\S/); } /** * This returns a mode object used by CoeMirror's addOverlay function * to parse and style tokens in the file. * The mode object contains a tokenizer function (token) which takes * a character stream as input, advances it a character at a time, * and returns style(s) for that token. For more details see * https://codemirror.net/doc/manual.html#modeapi * * Also the token function code is mainly based of work done * by the chrome devtools team. Thanks guys! :) * * @memberof utils/source-search * @static */ function searchOverlay(query, modifiers) { const regexQuery = (0, _buildQuery2.default)(query, modifiers, { ignoreSpaces: true, // regex must be global for the overlay isGlobal: true }); return { token: function (stream, state) { // set the last index to be the current stream position // this acts as an offset regexQuery.lastIndex = stream.pos; const match = regexQuery.exec(stream.string); if (match && match.index === stream.pos) { // if we have a match at the current stream position // set the class for a match stream.pos += match[0].length || 1; return "highlight highlight-full"; } else if (match) { // if we have a match somewhere in the line, go to that point in the // stream stream.pos = match.index; } else { // if we have no matches in this line, skip to the end of the line stream.skipToEnd(); } } }; } /** * @memberof utils/source-search * @static */ function updateOverlay(cm, state, query, modifiers) { cm.removeOverlay(state.overlay); state.overlay = searchOverlay(query, modifiers); cm.addOverlay(state.overlay, { opaque: false }); } function updateCursor(cm, state, keepSelection) { state.posTo = cm.getCursor("anchor"); state.posFrom = cm.getCursor("head"); if (!keepSelection) { state.posTo = { line: 0, ch: 0 }; state.posFrom = { line: 0, ch: 0 }; } } function getMatchIndex(count, currentIndex, rev) { if (!rev) { if (currentIndex == count - 1) { return 0; } return currentIndex + 1; } if (currentIndex == 0) { return count - 1; } return currentIndex - 1; } /** * If there's a saved search, selects the next results. * Otherwise, creates a new search and selects the first * result. * * @memberof utils/source-search * @static */ function doSearch(ctx, rev, query, keepSelection, modifiers) { const { cm } = ctx; if (!cm) { return; } const defaultIndex = { line: -1, ch: -1 }; return cm.operation(function () { if (!query || isWhitespace(query)) { clearSearch(cm, query, modifiers); return; } const state = getSearchState(cm, query, modifiers); const isNewQuery = state.query !== query; state.query = query; updateOverlay(cm, state, query, modifiers); updateCursor(cm, state, keepSelection); const searchLocation = searchNext(ctx, rev, query, isNewQuery, modifiers); return searchLocation ? searchLocation.from : defaultIndex; }); } function getCursorPos(newQuery, rev, state) { if (newQuery) { return rev ? state.posFrom : state.posTo; } return rev ? state.posTo : state.posFrom; } /** * Selects the next result of a saved search. * * @memberof utils/source-search * @static */ function searchNext(ctx, rev, query, newQuery, modifiers) { const { cm, ed } = ctx; let nextMatch; cm.operation(function () { const state = getSearchState(cm, query, modifiers); const pos = getCursorPos(newQuery, rev, state); if (!state.query) { return; } let cursor = getSearchCursor(cm, state.query, pos, modifiers); const location = rev ? { line: cm.lastLine(), ch: null } : { line: cm.firstLine(), ch: 0 }; if (!cursor.find(rev) && state.query) { cursor = getSearchCursor(cm, state.query, location, modifiers); if (!cursor.find(rev)) { return; } } // We don't want to jump the editor // when we're selecting text if (!cm.state.selectingText) { ed.alignLine(cursor.from().line, "center"); cm.setSelection(cursor.from(), cursor.to()); } nextMatch = { from: cursor.from(), to: cursor.to() }; }); return nextMatch; } /** * Remove overlay. * * @memberof utils/source-search * @static */ function removeOverlay(ctx, query, modifiers) { const state = getSearchState(ctx.cm, query, modifiers); ctx.cm.removeOverlay(state.overlay); const { line, ch } = ctx.cm.getCursor(); ctx.cm.doc.setSelection({ line, ch }, { line, ch }, { scroll: false }); } /** * Clears the currently saved search. * * @memberof utils/source-search * @static */ function clearSearch(cm, query, modifiers) { const state = getSearchState(cm, query, modifiers); state.results = []; if (!state.query) { return; } cm.removeOverlay(state.overlay); state.query = null; } /** * Starts a new search. * * @memberof utils/source-search * @static */ function find(ctx, query, keepSelection, modifiers) { clearSearch(ctx.cm, query, modifiers); return doSearch(ctx, false, query, keepSelection, modifiers); } /** * Finds the next item based on the currently saved search. * * @memberof utils/source-search * @static */ function findNext(ctx, query, keepSelection, modifiers) { return doSearch(ctx, false, query, keepSelection, modifiers); } /** * Finds the previous item based on the currently saved search. * * @memberof utils/source-search * @static */ function findPrev(ctx, query, keepSelection, modifiers) { return doSearch(ctx, true, query, keepSelection, modifiers); } exports.buildQuery = _buildQuery2.default; exports.find = find; exports.findNext = findNext; exports.findPrev = findPrev; exports.removeOverlay = removeOverlay; exports.getMatchIndex = getMatchIndex; /***/ }), /* 1527 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fetchEventListeners = fetchEventListeners; exports.updateEventBreakpoints = updateEventBreakpoints; var _DevToolsUtils = __webpack_require__(1432); var _selectors = __webpack_require__(1352); // delay is in ms /* 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/. */ /* global window gThreadClient setNamedTimeout services EVENTS */ /* eslint no-shadow: 0 */ /** * Redux actions for the event listeners state * @module actions/event-listeners */ const FETCH_EVENT_LISTENERS_DELAY = 200; let fetchListenersTimerID; /** * @memberof utils/utils * @static */ async function asPaused(state, client, func) { if (!(0, _selectors.getPause)(state)) { await client.interrupt(); let result; try { result = await func(client); } catch (e) { // Try to put the debugger back in a working state by resuming // it await client.resume(); throw e; } await client.resume(); return result; } return func(client); } /** * @memberof actions/event-listeners * @static */ function fetchEventListeners() { return ({ dispatch, getState, client }) => { // Make sure we"re not sending a batch of closely repeated requests. // This can easily happen whenever new sources are fetched. if (fetchListenersTimerID) { clearTimeout(fetchListenersTimerID); } fetchListenersTimerID = setTimeout(() => { // In case there is still a request of listeners going on (it // takes several RDP round trips right now), make sure we wait // on a currently running request if (getState().eventListeners.fetchingListeners) { dispatch({ type: services.WAIT_UNTIL, predicate: action => action.type === "FETCH_EVENT_LISTENERS" && action.status === "done", run: dispatch => dispatch(fetchEventListeners()) }); return; } dispatch({ type: "FETCH_EVENT_LISTENERS", status: "begin" }); asPaused(getState(), client, _getEventListeners).then(listeners => { dispatch({ type: "FETCH_EVENT_LISTENERS", status: "done", listeners: formatListeners(getState(), listeners) }); }); }, FETCH_EVENT_LISTENERS_DELAY); }; } function formatListeners(state, listeners) { return listeners.map(l => { return { selector: l.node.selector, type: l.type, sourceId: (0, _selectors.getSourceByURL)(state, l.function.location.url).get("id"), line: l.function.location.line }; }); } async function _getEventListeners(threadClient) { const response = await threadClient.eventListeners(); // Make sure all the listeners are sorted by the event type, since // they"re not guaranteed to be clustered together. response.listeners.sort((a, b) => a.type > b.type ? 1 : -1); // Add all the listeners in the debugger view event linsteners container. const fetchedDefinitions = new Map(); const listeners = []; for (const listener of response.listeners) { let definitionSite; if (fetchedDefinitions.has(listener.function.actor)) { definitionSite = fetchedDefinitions.get(listener.function.actor); } else if (listener.function.class == "Function") { definitionSite = await _getDefinitionSite(threadClient, listener.function); if (!definitionSite) { // We don"t know where this listener comes from so don"t show it in // the UI as breaking on it doesn"t work (bug 942899). continue; } fetchedDefinitions.set(listener.function.actor, definitionSite); } listener.function.url = definitionSite; listeners.push(listener); } fetchedDefinitions.clear(); return listeners; } async function _getDefinitionSite(threadClient, func) { const grip = threadClient.pauseGrip(func); let response; try { response = await grip.getDefinitionSite(); } catch (e) { // Don't make this error fatal, it would break the entire events pane. (0, _DevToolsUtils.reportException)("_getDefinitionSite", e); return null; } return response.source.url; } /** * @memberof actions/event-listeners * @static * @param {string} eventNames */ function updateEventBreakpoints(eventNames) { return dispatch => { setNamedTimeout("event-breakpoints-update", 0, () => { gThreadClient.pauseOnDOMEvents(eventNames, () => { // Notify that event breakpoints were added/removed on the server. window.emit(EVENTS.EVENT_BREAKPOINTS_UPDATED); dispatch({ type: "UPDATE_EVENT_BREAKPOINTS", eventNames: eventNames }); }); }); }; } /***/ }), /* 1528 */, /* 1529 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.willNavigate = willNavigate; exports.navigate = navigate; exports.connect = connect; exports.navigated = navigated; var _editor = __webpack_require__(1358); var _sourceQueue = __webpack_require__(1795); var _sourceQueue2 = _interopRequireDefault(_sourceQueue); var _sources = __webpack_require__(1369); var _utils = __webpack_require__(1366); var _sources2 = __webpack_require__(1373); var _parser = __webpack_require__(1365); var _wasm = __webpack_require__(1401); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * Redux actions for the navigation state * @module actions/navigation */ /** * @memberof actions/navigation * @static */ function willNavigate(_, event) { return async function ({ dispatch, getState, client, sourceMaps }) { await sourceMaps.clearSourceMaps(); (0, _wasm.clearWasmStates)(); (0, _editor.clearDocuments)(); (0, _parser.clearSymbols)(); (0, _parser.clearASTs)(); (0, _parser.clearScopes)(); (0, _parser.clearSources)(); _sourceQueue2.default.clear(); dispatch(navigate(event.url)); }; } /* 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 . */ function navigate(url) { return { type: "NAVIGATE", url }; } function connect(url) { return { type: "CONNECT", url }; } /** * @memberof actions/navigation * @static */ function navigated() { return async function ({ dispatch, getState, client }) { await (0, _utils.waitForMs)(100); if ((0, _sources.getSources)(getState()).size == 0) { const sources = await client.fetchSources(); dispatch((0, _sources2.newSources)(sources)); } }; } /***/ }), /* 1530 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.doSearch = doSearch; exports.setFileSearchQuery = setFileSearchQuery; exports.toggleFileSearchModifier = toggleFileSearchModifier; exports.updateSearchResults = updateSearchResults; exports.searchContents = searchContents; exports.traverseResults = traverseResults; exports.closeFileSearch = closeFileSearch; var _editor = __webpack_require__(1358); var _search = __webpack_require__(1395); var _selectors = __webpack_require__(1352); var _ui = __webpack_require__(1385); /* 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 . */ function doSearch(query, editor) { return ({ getState, dispatch }) => { const selectedSource = (0, _selectors.getSelectedSource)(getState()); if (!selectedSource || !selectedSource.get("text")) { return; } dispatch(setFileSearchQuery(query)); dispatch(searchContents(query, editor)); }; } function setFileSearchQuery(query) { return { type: "UPDATE_FILE_SEARCH_QUERY", query }; } function toggleFileSearchModifier(modifier) { return { type: "TOGGLE_FILE_SEARCH_MODIFIER", modifier }; } function updateSearchResults(characterIndex, line, matches) { const matchIndex = matches.findIndex(elm => elm.line === line && elm.ch === characterIndex); return { type: "UPDATE_SEARCH_RESULTS", results: { matches, matchIndex, count: matches.length, index: characterIndex } }; } function searchContents(query, editor) { return async ({ getState, dispatch }) => { const modifiers = (0, _selectors.getFileSearchModifiers)(getState()); const selectedSource = (0, _selectors.getSelectedSource)(getState()); if (!query || !editor || !selectedSource || !selectedSource.get("text") || !modifiers) { return; } const ctx = { ed: editor, cm: editor.codeMirror }; const _modifiers = modifiers.toJS(); const matches = await (0, _search.getMatches)(query, selectedSource.get("text"), _modifiers); const { ch, line } = (0, _editor.find)(ctx, query, true, _modifiers); dispatch(updateSearchResults(ch, line, matches)); }; } function traverseResults(rev, editor) { return async ({ getState, dispatch }) => { if (!editor) { return; } const ctx = { ed: editor, cm: editor.codeMirror }; const query = (0, _selectors.getFileSearchQuery)(getState()); const modifiers = (0, _selectors.getFileSearchModifiers)(getState()); const { matches } = (0, _selectors.getFileSearchResults)(getState()); if (query === "") { dispatch((0, _ui.setActiveSearch)("file")); } if (modifiers) { const matchedLocations = matches || []; const { ch, line } = rev ? (0, _editor.findPrev)(ctx, query, true, modifiers.toJS()) : (0, _editor.findNext)(ctx, query, true, modifiers.toJS()); dispatch(updateSearchResults(ch, line, matchedLocations)); } }; } function closeFileSearch(editor) { return ({ getState, dispatch }) => { const modifiers = (0, _selectors.getFileSearchModifiers)(getState()); const query = (0, _selectors.getFileSearchQuery)(getState()); if (editor && modifiers) { const ctx = { ed: editor, cm: editor.codeMirror }; (0, _editor.removeOverlay)(ctx, query, modifiers.toJS()); } dispatch(setFileSearchQuery("")); dispatch((0, _ui.closeActiveSearch)()); dispatch((0, _ui.clearHighlightLineRange)()); }; } /***/ }), /* 1531 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.recordCoverage = recordCoverage; function recordCoverage() { return async function ({ dispatch, getState, client }) { const { coverage } = await client.recordCoverage(); return dispatch({ type: "RECORD_COVERAGE", value: { coverage } }); }; } /* 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 . */ /***/ }), /* 1532 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setExpandedState = setExpandedState; function setExpandedState(expanded) { return ({ dispatch, getState }) => { dispatch({ type: "SET_EXPANDED_STATE", expanded }); }; } /* 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 . */ /***/ }), /* 1533 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setWorkers = setWorkers; /* 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 . */ function setWorkers(workers) { return { type: "SET_WORKERS", workers }; } /***/ }), /* 1534 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.openLink = openLink; /* 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 . */ const { isDevelopment } = __webpack_require__(1355); /** * @memberof actions/toolbox * @static */ function openLink(url) { return async function ({ openLink: openLinkCommand }) { if (isDevelopment()) { const win = window.open(url, "_blank"); win.focus(); } else { openLinkCommand(url); } }; } /***/ }), /* 1535 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ShortcutsModal = undefined; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _Modal = __webpack_require__(1403); var _Modal2 = _interopRequireDefault(_Modal); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _text = __webpack_require__(1387); __webpack_require__(1304); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class ShortcutsModal extends _react.Component { renderPrettyCombos(combo) { return combo.split(" ").map(c => _react2.default.createElement( "span", { key: c, className: "keystroke" }, c )).reduce((prev, curr) => [prev, " + ", curr]); } renderShorcutItem(title, combo) { return _react2.default.createElement( "li", null, _react2.default.createElement( "span", null, title ), _react2.default.createElement( "span", null, this.renderPrettyCombos(combo) ) ); } renderEditorShortcuts() { return _react2.default.createElement( "ul", { className: "shortcuts-list" }, this.renderShorcutItem(L10N.getStr("shortcuts.toggleBreakpoint"), (0, _text.formatKeyShortcut)(L10N.getStr("toggleBreakpoint.key"))), this.renderShorcutItem(L10N.getStr("shortcuts.toggleCondPanel"), (0, _text.formatKeyShortcut)(L10N.getStr("toggleCondPanel.key"))) ); } renderSteppingShortcuts() { return _react2.default.createElement( "ul", { className: "shortcuts-list" }, this.renderShorcutItem(L10N.getStr("shortcuts.pauseOrResume"), "F8"), this.renderShorcutItem(L10N.getStr("shortcuts.stepOver"), "F10"), this.renderShorcutItem(L10N.getStr("shortcuts.stepIn"), "F11"), this.renderShorcutItem(L10N.getStr("shortcuts.stepOut"), (0, _text.formatKeyShortcut)(L10N.getStr("stepOut.key"))) ); } renderSearchShortcuts() { return _react2.default.createElement( "ul", { className: "shortcuts-list" }, this.renderShorcutItem(L10N.getStr("shortcuts.fileSearch"), (0, _text.formatKeyShortcut)(L10N.getStr("sources.search.key2"))), this.renderShorcutItem(L10N.getStr("shortcuts.searchAgain"), (0, _text.formatKeyShortcut)(L10N.getStr("sourceSearch.search.again.key2"))), this.renderShorcutItem(L10N.getStr("shortcuts.projectSearch"), (0, _text.formatKeyShortcut)(L10N.getStr("projectTextSearch.key"))), this.renderShorcutItem(L10N.getStr("shortcuts.functionSearch"), (0, _text.formatKeyShortcut)(L10N.getStr("functionSearch.key"))) ); } renderShortcutsContent() { return _react2.default.createElement( "div", { className: (0, _classnames2.default)("shortcuts-content", this.props.additionalClass) }, _react2.default.createElement( "div", { className: "shortcuts-section" }, _react2.default.createElement( "h2", null, L10N.getStr("shortcuts.header.editor") ), this.renderEditorShortcuts() ), _react2.default.createElement( "div", { className: "shortcuts-section" }, _react2.default.createElement( "h2", null, L10N.getStr("shortcuts.header.stepping") ), this.renderSteppingShortcuts() ), _react2.default.createElement( "div", { className: "shortcuts-section" }, _react2.default.createElement( "h2", null, L10N.getStr("shortcuts.header.search") ), this.renderSearchShortcuts() ) ); } render() { const { enabled } = this.props; if (!enabled) { return null; } return _react2.default.createElement( _Modal2.default, { "in": enabled, additionalClass: "shortcuts-modal", handleClose: this.props.handleClose }, this.renderShortcutsContent() ); } } exports.ShortcutsModal = ShortcutsModal; /* 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 . */ /***/ }), /* 1536 */ /***/ (function(module, exports, __webpack_require__) { /* 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/. */ const React = __webpack_require__(0); const ReactDOM = __webpack_require__(4); const Draggable = React.createFactory(__webpack_require__(1537)); const { Component } = React; const PropTypes = __webpack_require__(20); const dom = __webpack_require__(1758); __webpack_require__(1309); /** * This component represents a Splitter. The splitter supports vertical * as well as horizontal mode. */ class SplitBox extends Component { static get propTypes() { return { // Custom class name. You can use more names separated by a space. className: PropTypes.string, // Initial size of controlled panel. initialSize: PropTypes.any, // Optional initial width of controlled panel. initialWidth: PropTypes.number, // Optional initial height of controlled panel. initialHeight: PropTypes.number, // Left/top panel startPanel: PropTypes.any, // Left/top panel collapse state. startPanelCollapsed: PropTypes.bool, // Min panel size. minSize: PropTypes.any, // Max panel size. maxSize: PropTypes.any, // Right/bottom panel endPanel: PropTypes.any, // Right/bottom panel collapse state. endPanelCollapsed: PropTypes.bool, // True if the right/bottom panel should be controlled. endPanelControl: PropTypes.bool, // Size of the splitter handle bar. splitterSize: PropTypes.number, // True if the splitter bar is vertical (default is vertical). vert: PropTypes.bool, // Optional style properties passed into the splitbox style: PropTypes.object, // Optional callback when splitbox resize stops onResizeEnd: PropTypes.func }; } static get defaultProps() { return { splitterSize: 5, vert: true, endPanelControl: false, endPanelCollapsed: false, startPanelCollapsed: false }; } constructor(props) { super(props); this.state = { vert: props.vert, // We use integers for these properties width: parseInt(props.initialWidth || props.initialSize, 10), height: parseInt(props.initialHeight || props.initialSize, 10) }; this.onStartMove = this.onStartMove.bind(this); this.onStopMove = this.onStopMove.bind(this); this.onMove = this.onMove.bind(this); this.preparePanelStyles = this.preparePanelStyles.bind(this); } componentWillReceiveProps(nextProps) { if (this.props.vert !== nextProps.vert) { this.setState({ vert: nextProps.vert }); } } // Dragging Events /** * Set 'resizing' cursor on entire document during splitter dragging. * This avoids cursor-flickering that happens when the mouse leaves * the splitter bar area (happens frequently). */ onStartMove() { const splitBox = ReactDOM.findDOMNode(this); const doc = splitBox.ownerDocument; let defaultCursor = doc.documentElement.style.cursor; doc.documentElement.style.cursor = this.state.vert ? "ew-resize" : "ns-resize"; splitBox.classList.add("dragging"); this.setState({ defaultCursor: defaultCursor }); } onStopMove() { const splitBox = ReactDOM.findDOMNode(this); const doc = splitBox.ownerDocument; doc.documentElement.style.cursor = this.state.defaultCursor; splitBox.classList.remove("dragging"); if (this.props.onResizeEnd) { this.props.onResizeEnd(this.state.vert ? this.state.width : this.state.height); } } /** * Adjust size of the controlled panel. Depending on the current * orientation we either remember the width or height of * the splitter box. */ onMove({ movementX, movementY }) { const node = ReactDOM.findDOMNode(this); const doc = node.ownerDocument; if (this.props.endPanelControl) { // For the end panel we need to increase the width/height when the // movement is towards the left/top. movementX = -movementX; movementY = -movementY; } if (this.state.vert) { const isRtl = doc.dir === "rtl"; if (isRtl) { // In RTL we need to reverse the movement again -- but only for vertical // splitters movementX = -movementX; } this.setState((state, props) => ({ width: state.width + movementX })); } else { this.setState((state, props) => ({ height: state.height + movementY })); } } // Rendering preparePanelStyles() { const vert = this.state.vert; const { minSize, maxSize, startPanelCollapsed, endPanelControl, endPanelCollapsed } = this.props; let leftPanelStyle, rightPanelStyle; // Set proper size for panels depending on the current state. if (vert) { let startWidth = endPanelControl ? null : this.state.width, endWidth = endPanelControl ? this.state.width : null; leftPanelStyle = { maxWidth: endPanelControl ? null : maxSize, minWidth: endPanelControl ? null : minSize, width: startPanelCollapsed ? 0 : startWidth }; rightPanelStyle = { maxWidth: endPanelControl ? maxSize : null, minWidth: endPanelControl ? minSize : null, width: endPanelCollapsed ? 0 : endWidth }; } else { let startHeight = endPanelControl ? null : this.state.height, endHeight = endPanelControl ? this.state.height : null; leftPanelStyle = { maxHeight: endPanelControl ? null : maxSize, minHeight: endPanelControl ? null : minSize, height: endPanelCollapsed ? maxSize : startHeight }; rightPanelStyle = { maxHeight: endPanelControl ? maxSize : null, minHeight: endPanelControl ? minSize : null, height: startPanelCollapsed ? maxSize : endHeight }; } return { leftPanelStyle, rightPanelStyle }; } render() { const vert = this.state.vert; const { startPanelCollapsed, startPanel, endPanel, endPanelControl, splitterSize, endPanelCollapsed } = this.props; let style = Object.assign({}, this.props.style); // Calculate class names list. let classNames = ["split-box"]; classNames.push(vert ? "vert" : "horz"); if (this.props.className) { classNames = classNames.concat(this.props.className.split(" ")); } const { leftPanelStyle, rightPanelStyle } = this.preparePanelStyles(); // Calculate splitter size let splitterStyle = { flex: `0 0 ${splitterSize}px` }; return dom.div({ className: classNames.join(" "), style: style }, !startPanelCollapsed ? dom.div({ className: endPanelControl ? "uncontrolled" : "controlled", style: leftPanelStyle }, startPanel) : null, Draggable({ className: "splitter", style: splitterStyle, onStart: this.onStartMove, onStop: this.onStopMove, onMove: this.onMove }), !endPanelCollapsed ? dom.div({ className: endPanelControl ? "controlled" : "uncontrolled", style: rightPanelStyle }, endPanel) : null); } } module.exports = SplitBox; /***/ }), /* 1537 */ /***/ (function(module, exports, __webpack_require__) { /* 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/. */ const React = __webpack_require__(0); const ReactDOM = __webpack_require__(4); const { Component } = React; const PropTypes = __webpack_require__(20); const dom = __webpack_require__(1758); class Draggable extends Component { static get propTypes() { return { onMove: PropTypes.func.isRequired, onStart: PropTypes.func, onStop: PropTypes.func, style: PropTypes.object, className: PropTypes.string }; } constructor(props) { super(props); this.startDragging = this.startDragging.bind(this); this.onMove = this.onMove.bind(this); this.onUp = this.onUp.bind(this); } startDragging(ev) { ev.preventDefault(); const doc = ReactDOM.findDOMNode(this).ownerDocument; doc.addEventListener("mousemove", this.onMove); doc.addEventListener("mouseup", this.onUp); this.props.onStart && this.props.onStart(); } onMove(ev) { ev.preventDefault(); // We pass the whole event because we don't know which properties // the callee needs. this.props.onMove(ev); } onUp(ev) { ev.preventDefault(); const doc = ReactDOM.findDOMNode(this).ownerDocument; doc.removeEventListener("mousemove", this.onMove); doc.removeEventListener("mouseup", this.onUp); this.props.onStop && this.props.onStop(); } render() { return dom.div({ style: this.props.style, className: this.props.className, onMouseDown: this.startDragging }); } } module.exports = Draggable; /***/ }), /* 1538 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _propTypes = __webpack_require__(20); var _propTypes2 = _interopRequireDefault(_propTypes); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _TextSearch = __webpack_require__(1539); var _TextSearch2 = _interopRequireDefault(_TextSearch); var _selectors = __webpack_require__(1352); __webpack_require__(1317); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ class ProjectSearch extends _react.Component { constructor(props) { super(props); this.toggleProjectTextSearch = this.toggleProjectTextSearch.bind(this); } componentDidMount() { const shortcuts = this.context.shortcuts; shortcuts.on(L10N.getStr("projectTextSearch.key"), this.toggleProjectTextSearch); } componentWillUnmount() { const shortcuts = this.context.shortcuts; shortcuts.off(L10N.getStr("projectTextSearch.key"), this.toggleProjectTextSearch); } toggleProjectTextSearch(key, e) { const { closeActiveSearch, setActiveSearch } = this.props; if (e) { e.preventDefault(); } if (this.isProjectSearchEnabled()) { return closeActiveSearch(); } return setActiveSearch("project"); } isProjectSearchEnabled() { return this.props.activeSearch === "project"; } renderTextSearch() { const { sources, results, status, searchSources, closeProjectSearch, selectLocation, textSearchQuery } = this.props; return _react2.default.createElement(_TextSearch2.default, { sources: sources, results: results.toJS(), status: status, searchSources: searchSources, closeProjectSearch: closeProjectSearch, selectLocation: selectLocation, query: textSearchQuery }); } render() { if (!this.isProjectSearchEnabled()) { return null; } return _react2.default.createElement( "div", { className: "search-container" }, this.renderTextSearch() ); } } ProjectSearch.contextTypes = { shortcuts: _propTypes2.default.object }; exports.default = (0, _reactRedux.connect)(state => ({ sources: (0, _selectors.getSources)(state), activeSearch: (0, _selectors.getActiveSearch)(state), results: (0, _selectors.getTextSearchResults)(state), textSearchQuery: (0, _selectors.getTextSearchQuery)(state), status: (0, _selectors.getTextSearchStatus)(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(ProjectSearch); /***/ }), /* 1539 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ var _propTypes = __webpack_require__(20); var _propTypes2 = _interopRequireDefault(_propTypes); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _Svg = __webpack_require__(1359); var _Svg2 = _interopRequireDefault(_Svg); var _ManagedTree = __webpack_require__(1404); var _ManagedTree2 = _interopRequireDefault(_ManagedTree); var _SearchInput = __webpack_require__(1379); var _SearchInput2 = _interopRequireDefault(_SearchInput); __webpack_require__(1314); var _sourcesTree = __webpack_require__(1442); var _highlight = __webpack_require__(1547); var _projectTextSearch = __webpack_require__(1424); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class TextSearch extends _react.Component { constructor(props) { super(props); this.state = { inputValue: this.props.query || "" }; this.focusedItem = null; this.inputFocused = false; this.inputOnChange = this.inputOnChange.bind(this); this.onKeyDown = this.onKeyDown.bind(this); this.onEnterPress = this.onEnterPress.bind(this); this.selectMatchItem = this.selectMatchItem.bind(this); } componentDidMount() { const shortcuts = this.context.shortcuts; shortcuts.on("Enter", this.onEnterPress); } componentWillUnmount() { const shortcuts = this.context.shortcuts; shortcuts.off("Enter", this.onEnterPress); } selectMatchItem(matchItem) { this.props.selectLocation(_extends({}, matchItem)); } getResults() { const { results } = this.props; return results.filter(result => result.filepath && result.matches.length > 0); } getResultCount() { const results = this.getResults(); return results.reduce((count, file) => count + (file.matches ? file.matches.length : 0), 0); } onKeyDown(e) { if (e.key === "Escape") { return; } e.stopPropagation(); if (e.key !== "Enter") { return; } this.focusedItem = null; this.props.searchSources(this.state.inputValue); } onEnterPress() { if (this.focusedItem && !this.inputFocused) { const { setExpanded, file, expanded, match } = this.focusedItem; if (setExpanded) { setExpanded(file, !expanded); } else { this.selectMatchItem(match); } } } inputOnChange(e) { const inputValue = e.target.value; this.setState({ inputValue }); } renderFile(file, focused, expanded, setExpanded) { if (focused) { this.focusedItem = { setExpanded, file, expanded }; } const matchesLength = file.matches.length; const matches = ` (${matchesLength} match${matchesLength > 1 ? "es" : ""})`; return _react2.default.createElement( "div", { className: (0, _classnames2.default)("file-result", { focused }), key: file.sourceId, onClick: e => setExpanded(file, !expanded) }, _react2.default.createElement(_Svg2.default, { name: "arrow", className: (0, _classnames2.default)({ expanded }) }), _react2.default.createElement("img", { className: "file" }), _react2.default.createElement( "span", { className: "file-path" }, (0, _sourcesTree.getRelativePath)(file.filepath) ), _react2.default.createElement( "span", { className: "matches-summary" }, matches ) ); } renderMatch(match, focused) { if (focused) { this.focusedItem = { match }; } return _react2.default.createElement( "div", { className: (0, _classnames2.default)("result", { focused }), onClick: () => setTimeout(() => this.selectMatchItem(match), 50) }, _react2.default.createElement( "span", { className: "line-number", key: match.line }, match.line ), this.renderMatchValue(match) ); } renderMatchValue(lineMatch) { return (0, _highlight.highlightMatches)(lineMatch); } renderResults() { const results = this.getResults().filter(result => result.matches.length > 0); const { status } = this.props; function getFilePath(item, index) { return item.filepath ? `${item.sourceId}-${index}` : `${item.sourceId}-${item.line}-${item.column}-${index}`; } const renderItem = (item, depth, focused, _, expanded, { setExpanded }) => { return item.filepath ? this.renderFile(item, focused, expanded, setExpanded) : this.renderMatch(item, focused); }; if (results.length && status === _projectTextSearch.statusType.done) { return _react2.default.createElement(_ManagedTree2.default, { getRoots: () => results, getChildren: file => file.matches || [], itemHeight: 24, autoExpand: 1, autoExpandDepth: 1, getParent: item => null, getPath: getFilePath, renderItem: renderItem }); } else if (status === _projectTextSearch.statusType.fetching) { return _react2.default.createElement( "div", { className: "no-result-msg absolute-center" }, "Loading..." ); } else if (this.props.query && !results.length) { return _react2.default.createElement( "div", { className: "no-result-msg absolute-center" }, L10N.getStr("projectTextSearch.noResults") ); } } renderInput() { const resultCount = this.getResultCount(); return _react2.default.createElement(_SearchInput2.default, { query: this.state.inputValue, count: resultCount, placeholder: L10N.getStr("projectTextSearch.placeholder"), size: "big", summaryMsg: this.props.query !== "" ? L10N.getFormatStr("sourceSearch.resultsSummary1", resultCount) : "", onChange: e => this.inputOnChange(e), onFocus: () => this.inputFocused = true, onBlur: () => this.inputFocused = false, onKeyDown: e => this.onKeyDown(e), handleClose: this.props.closeProjectSearch, ref: "searchInput" }); } render() { const { searchBottomBar } = this.props; return _react2.default.createElement( "div", { className: "project-text-search" }, _react2.default.createElement( "div", { className: "header" }, this.renderInput(), searchBottomBar ), this.renderResults() ); } } exports.default = TextSearch; TextSearch.contextTypes = { shortcuts: _propTypes2.default.object }; /***/ }), /* 1540 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _svgInlineReact = __webpack_require__(1763); var _svgInlineReact2 = _interopRequireDefault(_svgInlineReact); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const React = __webpack_require__(0); const { isDevelopment } = __webpack_require__(1355); const svg = { "angle-brackets": __webpack_require__(347), angular: __webpack_require__(247), arrow: __webpack_require__(348), backbone: __webpack_require__(997), blackBox: __webpack_require__(349), breakpoint: __webpack_require__(350), "column-breakpoint": __webpack_require__(998), "case-match": __webpack_require__(351), close: __webpack_require__(352), choo: __webpack_require__(1290), dojo: __webpack_require__(806), domain: __webpack_require__(353), file: __webpack_require__(354), folder: __webpack_require__(355), function: __webpack_require__(1787), globe: __webpack_require__(356), jquery: __webpack_require__(999), underscore: __webpack_require__(1117), lodash: __webpack_require__(1118), ember: __webpack_require__(1119), vuejs: __webpack_require__(1174), "magnifying-glass": __webpack_require__(357), "arrow-up": __webpack_require__(919), "arrow-down": __webpack_require__(920), pause: __webpack_require__(358), "pause-exceptions": __webpack_require__(359), plus: __webpack_require__(360), preact: __webpack_require__(1233), aframe: __webpack_require__(1648), prettyPrint: __webpack_require__(361), react: __webpack_require__(1000), "regex-match": __webpack_require__(362), redux: __webpack_require__(256), immutable: __webpack_require__(258), resume: __webpack_require__(363), settings: __webpack_require__(364), stepIn: __webpack_require__(365), stepOut: __webpack_require__(366), stepOver: __webpack_require__(367), subSettings: __webpack_require__(368), toggleBreakpoints: __webpack_require__(369), togglePanes: __webpack_require__(370), "whole-word-match": __webpack_require__(371), worker: __webpack_require__(372), "sad-face": __webpack_require__(1347), refresh: __webpack_require__(1348), webpack: __webpack_require__(1001), node: __webpack_require__(1002), express: __webpack_require__(1003), pug: __webpack_require__(1004), extjs: __webpack_require__(1043), mobx: __webpack_require__(1733), marko: __webpack_require__(1649), nextjs: __webpack_require__(1650), showSources: __webpack_require__(1044), showOutline: __webpack_require__(1045), nuxtjs: __webpack_require__(1651) }; function Svg({ name, className, onClick, "aria-label": ariaLabel }) { if (!svg[name]) { const error = `Unknown SVG: ${name}`; if (isDevelopment()) { throw new Error(error); } console.warn(error); return; } className = `${name} ${className || ""}`; if (name === "subSettings") { className = ""; } const props = { className, onClick, ["aria-label"]: ariaLabel, src: svg[name] }; return React.createElement(_svgInlineReact2.default, props); } Svg.displayName = "Svg"; module.exports = Svg; /***/ }), /* 1541 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const { DOM: dom, createClass, createFactory, PropTypes } = __webpack_require__(0); const AUTO_EXPAND_DEPTH = 0; // depth /** * An arrow that displays whether its node is expanded (▼) or collapsed * (▶). When its node has no children, it is hidden. */ const ArrowExpander = createFactory(createClass({ displayName: "ArrowExpander", shouldComponentUpdate(nextProps, nextState) { return this.props.item !== nextProps.item || this.props.visible !== nextProps.visible || this.props.expanded !== nextProps.expanded; }, render() { const attrs = { className: "arrow theme-twisty", onClick: this.props.expanded ? () => this.props.onCollapse(this.props.item) : e => this.props.onExpand(this.props.item, e.altKey) }; if (this.props.expanded) { attrs.className += " open"; } if (!this.props.visible) { attrs.style = Object.assign({}, this.props.style || {}, { visibility: "hidden" }); } return dom.div(attrs, this.props.children); } })); const TreeNode = createFactory(createClass({ displayName: "TreeNode", componentDidMount() { if (this.props.focused) { this.refs.button.focus(); } }, componentDidUpdate() { if (this.props.focused) { this.refs.button.focus(); } }, shouldComponentUpdate(nextProps) { return this.props.item !== nextProps.item || this.props.focused !== nextProps.focused || this.props.expanded !== nextProps.expanded; }, render() { const arrow = ArrowExpander({ item: this.props.item, expanded: this.props.expanded, visible: this.props.hasChildren, onExpand: this.props.onExpand, onCollapse: this.props.onCollapse }); let isOddRow = this.props.index % 2; return dom.div({ className: `tree-node div ${isOddRow ? "tree-node-odd" : ""}`, onFocus: this.props.onFocus, onClick: this.props.onFocus, onBlur: this.props.onBlur, style: { padding: 0, margin: 0 } }, this.props.renderItem(this.props.item, this.props.depth, this.props.focused, arrow, this.props.expanded), // XXX: OSX won't focus/blur regular elements even if you set tabindex // unless there is an input/button child. dom.button(this._buttonAttrs)); }, _buttonAttrs: { ref: "button", style: { opacity: 0, width: "0 !important", height: "0 !important", padding: "0 !important", outline: "none", MozAppearance: "none", // XXX: Despite resetting all of the above properties (and margin), the // button still ends up with ~79px width, so we set a large negative // margin to completely hide it. MozMarginStart: "-1000px !important" } } })); /** * Create a function that calls the given function `fn` only once per animation * frame. * * @param {Function} fn * @returns {Function} */ function oncePerAnimationFrame(fn) { let animationId = null; let argsToPass = null; return function (...args) { argsToPass = args; if (animationId !== null) { return; } animationId = requestAnimationFrame(() => { fn.call(this, ...argsToPass); animationId = null; argsToPass = null; }); }; } const NUMBER_OF_OFFSCREEN_ITEMS = 1; /** * A generic tree component. See propTypes for the public API. * * @see `devtools/client/memory/components/test/mochitest/head.js` for usage * @see `devtools/client/memory/components/heap.js` for usage */ const Tree = module.exports = createClass({ displayName: "Tree", propTypes: { // Required props // A function to get an item's parent, or null if it is a root. getParent: PropTypes.func.isRequired, // A function to get an item's children. getChildren: PropTypes.func.isRequired, // A function which takes an item and ArrowExpander and returns a // component. renderItem: PropTypes.func.isRequired, // A function which returns the roots of the tree (forest). getRoots: PropTypes.func.isRequired, // A function to get a unique key for the given item. getKey: PropTypes.func.isRequired, // A function to get whether an item is expanded or not. If an item is not // expanded, then it must be collapsed. isExpanded: PropTypes.func.isRequired, // The height of an item in the tree including margin and padding, in // pixels. itemHeight: PropTypes.number.isRequired, // Optional props // The currently focused item, if any such item exists. focused: PropTypes.any, // Handle when a new item is focused. onFocus: PropTypes.func, // The depth to which we should automatically expand new items. autoExpandDepth: PropTypes.number, // Should auto expand all new items or just the new items under the first // root item. autoExpandAll: PropTypes.bool, // Optional event handlers for when items are expanded or collapsed. onExpand: PropTypes.func, onCollapse: PropTypes.func }, getDefaultProps() { return { autoExpandDepth: AUTO_EXPAND_DEPTH, autoExpandAll: true }; }, getInitialState() { return { scroll: 0, height: window.innerHeight, seen: new Set() }; }, componentDidMount() { window.addEventListener("resize", this._updateHeight); this._autoExpand(this.props); this._updateHeight(); }, componentWillUnmount() { window.removeEventListener("resize", this._updateHeight); }, componentWillReceiveProps(nextProps) { this._autoExpand(nextProps); this._updateHeight(); }, _autoExpand(props) { if (!props.autoExpandDepth) { return; } // Automatically expand the first autoExpandDepth levels for new items. Do // not use the usual DFS infrastructure because we don't want to ignore // collapsed nodes. const autoExpand = (item, currentDepth) => { if (currentDepth >= props.autoExpandDepth || this.state.seen.has(item)) { return; } props.onExpand(item); this.state.seen.add(item); const children = props.getChildren(item); const length = children.length; for (let i = 0; i < length; i++) { autoExpand(children[i], currentDepth + 1); } }; const roots = props.getRoots(); const length = roots.length; if (props.autoExpandAll) { for (let i = 0; i < length; i++) { autoExpand(roots[i], 0); } } else if (length != 0) { autoExpand(roots[0], 0); } }, render() { const traversal = this._dfsFromRoots(); const renderItem = i => { let { item, depth } = traversal[i]; return TreeNode({ key: this.props.getKey(item, i), index: i, item: item, depth: depth, renderItem: this.props.renderItem, focused: this.props.focused === item, expanded: this.props.isExpanded(item), hasChildren: !!this.props.getChildren(item).length, onExpand: this._onExpand, onCollapse: this._onCollapse, onFocus: () => this._focus(i, item) }); }; const style = Object.assign({}, this.props.style || {}, { padding: 0, margin: 0 }); return dom.div({ className: `tree ${this.props.className ? this.props.className : ""}`, ref: "tree", onKeyDown: this._onKeyDown, onKeyPress: this._preventArrowKeyScrolling, onKeyUp: this._preventArrowKeyScrolling, onScroll: this._onScroll, style }, traversal.map((v, i) => renderItem(i))); }, _preventArrowKeyScrolling(e) { switch (e.key) { case "ArrowUp": case "ArrowDown": case "ArrowLeft": case "ArrowRight": e.preventDefault(); e.stopPropagation(); if (e.nativeEvent) { if (e.nativeEvent.preventDefault) { e.nativeEvent.preventDefault(); } if (e.nativeEvent.stopPropagation) { e.nativeEvent.stopPropagation(); } } } }, /** * Updates the state's height based on clientHeight. */ _updateHeight() { this.setState({ height: this.refs.tree.clientHeight }); }, /** * Perform a pre-order depth-first search from item. */ _dfs(item, maxDepth = Infinity, traversal = [], _depth = 0) { traversal.push({ item, depth: _depth }); if (!this.props.isExpanded(item)) { return traversal; } const nextDepth = _depth + 1; if (nextDepth > maxDepth) { return traversal; } const children = this.props.getChildren(item); const length = children.length; for (let i = 0; i < length; i++) { this._dfs(children[i], maxDepth, traversal, nextDepth); } return traversal; }, /** * Perform a pre-order depth-first search over the whole forest. */ _dfsFromRoots(maxDepth = Infinity) { const traversal = []; const roots = this.props.getRoots(); const length = roots.length; for (let i = 0; i < length; i++) { this._dfs(roots[i], maxDepth, traversal); } return traversal; }, /** * Expands current row. * * @param {Object} item * @param {Boolean} expandAllChildren */ _onExpand: oncePerAnimationFrame(function (item, expandAllChildren) { if (this.props.onExpand) { this.props.onExpand(item); if (expandAllChildren) { const children = this._dfs(item); const length = children.length; for (let i = 0; i < length; i++) { this.props.onExpand(children[i].item); } } } }), /** * Collapses current row. * * @param {Object} item */ _onCollapse: oncePerAnimationFrame(function (item) { if (this.props.onCollapse) { this.props.onCollapse(item); } }), /** * Sets the passed in item to be the focused item. * * @param {Number} index * The index of the item in a full DFS traversal (ignoring collapsed * nodes). Ignored if `item` is undefined. * * @param {Object|undefined} item * The item to be focused, or undefined to focus no item. */ _focus(index, item) { if (item !== undefined) { const itemStartPosition = index * this.props.itemHeight; const itemEndPosition = (index + 1) * this.props.itemHeight; // Note that if the height of the viewport (this.state.height) is less than // `this.props.itemHeight`, we could accidentally try and scroll both up and // down in a futile attempt to make both the item's start and end positions // visible. Instead, give priority to the start of the item by checking its // position first, and then using an "else if", rather than a separate "if", // for the end position. if (this.state.scroll > itemStartPosition) { this.refs.tree.scrollTop = itemStartPosition; } else if (this.state.scroll + this.state.height < itemEndPosition) { this.refs.tree.scrollTop = itemEndPosition - this.state.height; } } if (this.props.onFocus) { this.props.onFocus(item); } }, /** * Sets the state to have no focused item. */ _onBlur() { this._focus(0, undefined); }, /** * Fired on a scroll within the tree's container, updates * the stored position of the view port to handle virtual view rendering. * * @param {Event} e */ _onScroll: oncePerAnimationFrame(function (e) { this.setState({ scroll: Math.max(this.refs.tree.scrollTop, 0), height: this.refs.tree.clientHeight }); }), /** * Handles key down events in the tree's container. * * @param {Event} e */ _onKeyDown(e) { if (this.props.focused == null) { return; } // Allow parent nodes to use navigation arrows with modifiers. if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) { return; } this._preventArrowKeyScrolling(e); switch (e.key) { case "ArrowUp": this._focusPrevNode(); return; case "ArrowDown": this._focusNextNode(); return; case "ArrowLeft": if (this.props.isExpanded(this.props.focused) && this.props.getChildren(this.props.focused).length) { this._onCollapse(this.props.focused); } else { this._focusParentNode(); } return; case "ArrowRight": if (!this.props.isExpanded(this.props.focused)) { this._onExpand(this.props.focused); } return; } }, /** * Sets the previous node relative to the currently focused item, to focused. */ _focusPrevNode: oncePerAnimationFrame(function () { // Start a depth first search and keep going until we reach the currently // focused node. Focus the previous node in the DFS, if it exists. If it // doesn't exist, we're at the first node already. let prev; let prevIndex; const traversal = this._dfsFromRoots(); const length = traversal.length; for (let i = 0; i < length; i++) { const item = traversal[i].item; if (item === this.props.focused) { break; } prev = item; prevIndex = i; } if (prev === undefined) { return; } this._focus(prevIndex, prev); }), /** * Handles the down arrow key which will focus either the next child * or sibling row. */ _focusNextNode: oncePerAnimationFrame(function () { // Start a depth first search and keep going until we reach the currently // focused node. Focus the next node in the DFS, if it exists. If it // doesn't exist, we're at the last node already. const traversal = this._dfsFromRoots(); const length = traversal.length; let i = 0; while (i < length) { if (traversal[i].item === this.props.focused) { break; } i++; } if (i + 1 < traversal.length) { this._focus(i + 1, traversal[i + 1].item); } }), /** * Handles the left arrow key, going back up to the current rows' * parent row. */ _focusParentNode: oncePerAnimationFrame(function () { const parent = this.props.getParent(this.props.focused); if (!parent) { return; } const traversal = this._dfsFromRoots(); const length = traversal.length; let parentIndex = 0; for (; parentIndex < length; parentIndex++) { if (traversal[parentIndex].item === parent) { break; } } this._focus(parentIndex, parent); }) }); /***/ }), /* 1542 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formatTree = formatTree; function formatTree(tree, depth = 0, str = "") { const whitespace = new Array(depth * 2).join(" "); if (Array.isArray(tree.contents)) { str += `${whitespace} - ${tree.name} path=${tree.path} \n`; tree.contents.forEach(t => { str = formatTree(t, depth + 1, str); }); } else { const id = tree.contents.get("id"); str += `${whitespace} - ${tree.name} path=${tree.path} source_id=${id} \n`; } return str; } /* 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 . */ /***/ }), /* 1543 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getDomain = getDomain; exports.findNodeInContents = findNodeInContents; exports.createTreeNodeMatcher = createTreeNodeMatcher; var _url = __webpack_require__(334); var _utils = __webpack_require__(1371); /* * Gets domain from url (without www prefix) */ /* 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 . */ function getDomain(url) { // TODO: define how files should be ordered on the browser debugger if (!url) { return null; } const { host } = (0, _url.parse)(url); if (!host) { return null; } return host.startsWith("www.") ? host.substr("www.".length) : host; } /* * Checks if node name matches debugger host/domain. */ function isExactDomainMatch(part, debuggeeHost) { return part.startsWith("www.") ? part.substr("www.".length) === debuggeeHost : part === debuggeeHost; } /* * Function to assist with node search for a defined sorted order, see e.g. * `createTreeNodeMatcher`. Returns negative number if the node * stands earlier in sorting order, positive number if the node stands later * in sorting order, or zero if the node is found. */ /* * Performs a binary search to insert a node into contents. Returns positive * number, index of the found child, or negative number, which can be used * to calculate a position where a new node can be inserted (`-index - 1`). * The matcher is a function that returns result of comparision of a node with * lookup value. */ function findNodeInContents(tree, matcher) { const { contents } = tree; if (contents.length === 0) { return { found: false, index: 0 }; } let left = 0; let right = contents.length - 1; while (left < right) { const middle = Math.floor((left + right) / 2); if (matcher(contents[middle]) < 0) { left = middle + 1; } else { right = middle; } } const result = matcher(contents[left]); if (result === 0) { return { found: true, index: left }; } return { found: false, index: result > 0 ? left : left + 1 }; } const IndexName = "(index)"; function createTreeNodeMatcherWithIndex() { return node => node.name === IndexName ? 0 : 1; } function createTreeNodeMatcherWithDebuggeeHost(debuggeeHost) { return node => { if (node.name === IndexName) { return -1; } return isExactDomainMatch(node.name, debuggeeHost) ? 0 : 1; }; } function createTreeNodeMatcherWithNameAndOther(part, isDir, debuggeeHost) { return node => { if (node.name === IndexName) { return -1; } if (debuggeeHost && isExactDomainMatch(node.name, debuggeeHost)) { return -1; } const nodeIsDir = (0, _utils.nodeHasChildren)(node); if (nodeIsDir && !isDir) { return -1; } else if (!nodeIsDir && isDir) { return 1; } return node.name.localeCompare(part); }; } /* * Creates a matcher for findNodeInContents. * The sorting order of nodes during comparison is: * - "(index)" node * - root node with the debuggee host/domain * - hosts/directories (not files) sorted by name * - files sorted by name */ function createTreeNodeMatcher(part, isDir, debuggeeHost) { if (part === IndexName) { // Specialied matcher, when we are looking for "(index)" position. return createTreeNodeMatcherWithIndex(); } if (debuggeeHost && isExactDomainMatch(part, debuggeeHost)) { // Specialied matcher, when we are looking for domain position. return createTreeNodeMatcherWithDebuggeeHost(debuggeeHost); } // Rest of the cases, without mentioned above. return createTreeNodeMatcherWithNameAndOther(part, isDir, debuggeeHost); } /***/ }), /* 1544 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ exports.sortEntireTree = sortEntireTree; exports.sortTree = sortTree; var _utils = __webpack_require__(1371); /** * Look at the nodes in the source tree, and determine the index of where to * insert a new node. The ordering is index -> folder -> file. * @memberof utils/sources-tree * @static */ function sortEntireTree(tree, debuggeeUrl = "") { if ((0, _utils.nodeHasChildren)(tree)) { const contents = sortTree(tree, debuggeeUrl).map(subtree => sortEntireTree(subtree)); return _extends({}, tree, { contents }); } return tree; } /** * Look at the nodes in the source tree, and determine the index of where to * insert a new node. The ordering is index -> folder -> file. * @memberof utils/sources-tree * @static */ function sortTree(tree, debuggeeUrl = "") { return tree.contents.sort((previousNode, currentNode) => { const currentNodeIsDir = (0, _utils.nodeHasChildren)(currentNode); const previousNodeIsDir = (0, _utils.nodeHasChildren)(previousNode); if (currentNode.name === "(index)") { return 1; } else if (previousNode.name === "(index)") { return -1; } else if ((0, _utils.isExactUrlMatch)(currentNode.name, debuggeeUrl)) { return 1; } else if ((0, _utils.isExactUrlMatch)(previousNode.name, debuggeeUrl)) { return -1; // If neither is the case, continue to compare alphabetically } else if (previousNodeIsDir && !currentNodeIsDir) { return -1; } else if (!previousNodeIsDir && currentNodeIsDir) { return 1; } return previousNode.name.localeCompare(currentNode.name); }); } /***/ }), /* 1545 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getDirectories = getDirectories; var _utils = __webpack_require__(1371); var _getURL = __webpack_require__(1405); /* 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 . */ function findSource(sourceTree, sourceUrl) { let returnTarget = null; function _traverse(subtree) { if ((0, _utils.nodeHasChildren)(subtree)) { for (const child of subtree.contents) { _traverse(child); } } else if (!returnTarget) { if (subtree.path.replace(/http(s)?:\//, "") == sourceUrl) { returnTarget = subtree; return; } } } sourceTree.contents.forEach(_traverse); if (!returnTarget) { return sourceTree; } return returnTarget; } function getDirectories(sourceUrl, sourceTree) { const url = (0, _getURL.getURL)(sourceUrl); const fullUrl = `/${url.group}${url.path}`; const parentMap = (0, _utils.createParentMap)(sourceTree); const source = findSource(sourceTree, fullUrl); if (!source) { return []; } let node = source; const directories = []; directories.push(source); while (true) { node = parentMap.get(node); if (!node) { return directories; } directories.push(node); } } /***/ }), /* 1546 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createTree = createTree; var _utils = __webpack_require__(1371); var _collapseTree = __webpack_require__(1444); var _addToTree = __webpack_require__(1443); function createTree(sources, debuggeeUrl, projectRoot) { const uncollapsedTree = (0, _utils.createNode)("root", "", []); for (const source of sources.valueSeq()) { (0, _addToTree.addToTree)(uncollapsedTree, source, debuggeeUrl, projectRoot); } const sourceTree = (0, _collapseTree.collapseTree)(uncollapsedTree); return { uncollapsedTree, sourceTree, parentMap: (0, _utils.createParentMap)(sourceTree), focusedItem: null }; } /* 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 . */ /***/ }), /* 1547 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.highlightMatches = highlightMatches; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function highlightMatches(lineMatch) { const { value, column, match } = lineMatch; const len = match.length; return _react2.default.createElement( "span", { className: "line-value" }, _react2.default.createElement( "span", { className: "line-match", key: 0 }, value.slice(0, column) ), _react2.default.createElement( "span", { className: "query-match", key: 1 }, value.substr(column, len) ), _react2.default.createElement( "span", { className: "line-match", key: 2 }, value.slice(column + len, value.length) ) ); } /* 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 . */ // Maybe reuse file search's functions? /***/ }), /* 1548 */, /* 1549 */, /* 1550 */, /* 1551 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(1189); var _text = __webpack_require__(1387); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(1352); var _devtoolsConfig = __webpack_require__(1355); __webpack_require__(1318); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _Outline = __webpack_require__(1552); var _Outline2 = _interopRequireDefault(_Outline); var _SourcesTree = __webpack_require__(1553); var _SourcesTree2 = _interopRequireDefault(_SourcesTree); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class PrimaryPanes extends _react.Component { constructor(props) { super(props); this.renderShortcut = this.renderShortcut.bind(this); this.showPane = this.showPane.bind(this); this.renderTabs = this.renderTabs.bind(this); } showPane(selectedPane) { this.props.setPrimaryPaneTab(selectedPane); } renderOutlineTabs() { if (!(0, _devtoolsConfig.isEnabled)("outline")) { return; } const sources = (0, _text.formatKeyShortcut)(L10N.getStr("sources.header")); const outline = (0, _text.formatKeyShortcut)(L10N.getStr("outline.header")); return [_react2.default.createElement( "div", { className: (0, _classnames2.default)("tab sources-tab", { active: this.props.selectedTab === "sources" }), onClick: () => this.showPane("sources"), key: "sources-tab" }, sources ), _react2.default.createElement( "div", { className: (0, _classnames2.default)("tab outline-tab", { active: this.props.selectedTab === "outline" }), onClick: () => this.showPane("outline"), key: "outline-tab" }, outline )]; } renderTabs() { return _react2.default.createElement( "div", { className: "source-outline-tabs" }, this.renderOutlineTabs() ); } renderShortcut() { if (this.props.horizontal) { const onClick = () => { if (this.props.sourceSearchOn) { return this.props.closeActiveSearch(); } this.props.setActiveSearch("source"); }; return _react2.default.createElement( "span", { className: "sources-header-info", dir: "ltr", onClick: onClick }, L10N.getFormatStr("sources.search", (0, _text.formatKeyShortcut)(L10N.getStr("sources.search.key2"))) ); } } renderOutline() { const { selectLocation } = this.props; const outlineComp = (0, _devtoolsConfig.isEnabled)("outline") ? _react2.default.createElement(_Outline2.default, { selectLocation: selectLocation }) : null; return outlineComp; } renderSources() { const { sources, selectLocation } = this.props; return _react2.default.createElement(_SourcesTree2.default, { sources: sources, selectLocation: selectLocation }); } render() { const { selectedTab } = this.props; return _react2.default.createElement( "div", { className: "sources-panel" }, this.renderTabs(), selectedTab === "sources" ? this.renderSources() : this.renderOutline() ); } } /* 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 . */ exports.default = (0, _reactRedux.connect)(state => ({ selectedTab: (0, _selectors.getSelectedPrimaryPaneTab)(state), sources: (0, _selectors.getSources)(state), sourceSearchOn: (0, _selectors.getActiveSearch)(state) === "source" }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(PrimaryPanes); /***/ }), /* 1552 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Outline = undefined; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(1189); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(1352); var _Svg = __webpack_require__(1359); var _Svg2 = _interopRequireDefault(_Svg); __webpack_require__(1319); var _PreviewFunction = __webpack_require__(1446); var _PreviewFunction2 = _interopRequireDefault(_PreviewFunction); var _lodash = __webpack_require__(2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Outline extends _react.Component { selectItem(location) { const { selectedSource, selectLocation } = this.props; if (!selectedSource) { return; } const selectedSourceId = selectedSource.get("id"); const startLine = location.start.line; selectLocation({ sourceId: selectedSourceId, line: startLine }); } renderPlaceholder() { return _react2.default.createElement( "div", { className: "outline-pane-info" }, L10N.getStr("outline.noFunctions") ); } renderFunction(func) { const { name, location, parameterNames } = func; return _react2.default.createElement( "li", { key: `${name}:${location.start.line}:${location.start.column}`, className: "outline-list__element", onClick: () => this.selectItem(location) }, _react2.default.createElement(_Svg2.default, { name: "function" }), _react2.default.createElement(_PreviewFunction2.default, { func: { name, parameterNames } }) ); } renderClassFunctions(functions) { const classFunctions = functions.filter(func => func.name != "anonymous" && !!func.klass); if (classFunctions.length == 0) { return null; } const klass = classFunctions[0].klass; const klassFunc = functions.find(func => func.name === klass); return _react2.default.createElement( "div", { className: "outline-list__class" }, _react2.default.createElement( "h2", null, klassFunc ? this.renderFunction(klassFunc) : klass ), _react2.default.createElement( "ul", { className: "outline-list__class-list" }, classFunctions.map(func => this.renderFunction(func)) ) ); } renderFunctions(functions) { const classes = (0, _lodash.uniq)(functions.map(func => func.klass)); const namedFunctions = functions.filter(func => func.name != "anonymous" && !func.klass && !classes.includes(func.name)); return _react2.default.createElement( "ul", { className: "outline-list" }, namedFunctions.map(func => this.renderFunction(func)), this.renderClassFunctions(functions) ); } render() { const { symbols } = this.props; const symbolsToDisplay = symbols.functions.filter(func => func.name != "anonymous"); return _react2.default.createElement( "div", { className: "outline" }, symbolsToDisplay.length > 0 ? this.renderFunctions(symbols.functions) : this.renderPlaceholder() ); } } exports.Outline = Outline; /* 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 . */ exports.default = (0, _reactRedux.connect)(state => { const selectedSource = (0, _selectors.getSelectedSource)(state); return { symbols: (0, _selectors.getSymbols)(state, selectedSource && selectedSource.toJS()), selectedSource }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Outline); /***/ }), /* 1553 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _reactRedux = __webpack_require__(1189); var _selectors = __webpack_require__(1352); var _sourceTree = __webpack_require__(1532); var _sources = __webpack_require__(1373); var _ManagedTree = __webpack_require__(1404); var _ManagedTree2 = _interopRequireDefault(_ManagedTree); var _Svg = __webpack_require__(1359); var _Svg2 = _interopRequireDefault(_Svg); var _sourcesTree = __webpack_require__(1442); var _immutable = __webpack_require__(146); var _devtoolsContextmenu = __webpack_require__(1413); var _clipboard = __webpack_require__(1388); var _utils = __webpack_require__(1366); var _prefs = __webpack_require__(226); var _ui = __webpack_require__(1385); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class SourcesTree extends _react.Component { constructor(props) { super(props); this.state = (0, _sourcesTree.createTree)(this.props.sources, this.props.debuggeeUrl, this.props.projectRoot); this.focusItem = this.focusItem.bind(this); this.selectItem = this.selectItem.bind(this); this.getPath = this.getPath.bind(this); this.getIcon = this.getIcon.bind(this); this.onContextMenu = this.onContextMenu.bind(this); this.renderItem = this.renderItem.bind(this); this.queueUpdate = (0, _utils.throttle)(function () { if (!this.mounted) { return; } this.forceUpdate(); }, 50); } componentDidMount() { this.mounted = true; } componentWillUnMount() { this.mounted = false; } shouldComponentUpdate() { this.queueUpdate(); return false; } componentWillReceiveProps(nextProps) { if (this.props.projectRoot !== nextProps.projectRoot || this.props.debuggeeUrl !== nextProps.debuggeeUrl) { // Recreate tree because the sort order changed this.setState((0, _sourcesTree.createTree)(nextProps.sources, nextProps.debuggeeUrl, nextProps.projectRoot)); return; } if (nextProps.shownSource && nextProps.shownSource != this.props.shownSource) { const listItems = (0, _sourcesTree.getDirectories)(nextProps.shownSource, this.state.sourceTree); if (listItems && listItems[0]) { this.selectItem(listItems[0]); } return this.setState({ listItems }); } if (nextProps.selectedSource && nextProps.selectedSource != this.props.selectedSource) { const highlightItems = (0, _sourcesTree.getDirectories)(nextProps.selectedSource.get("url"), this.state.sourceTree); return this.setState({ highlightItems }); } if (nextProps.sources === this.props.sources) { return; } if (nextProps.sources.size === 0) { // remove all sources this.setState((0, _sourcesTree.createTree)(nextProps.sources, nextProps.debuggeeUrl, nextProps.projectRoot)); return; } // TODO: do not run this every time a source is clicked, // only when a new source is added const next = (0, _immutable.Set)(nextProps.sources.valueSeq()); const prev = (0, _immutable.Set)(this.props.sources.valueSeq()); const newSet = next.subtract(prev); const uncollapsedTree = this.state.uncollapsedTree; // TODO: recreating the tree every time messes with the expanded // state of ManagedTree, because it depends on item instances // being the same. The result is that if a source is added at a // later time, all expanded state is lost. let sourceTree = this.state.sourceTree; if (newSet.size > 0) { for (const source of newSet) { (0, _sourcesTree.addToTree)(uncollapsedTree, source, this.props.debuggeeUrl, this.props.projectRoot); } sourceTree = (0, _sourcesTree.collapseTree)(uncollapsedTree); } this.setState({ uncollapsedTree, sourceTree, parentMap: (0, _sourcesTree.createParentMap)(sourceTree) }); } focusItem(item) { this.setState({ focusedItem: item }); } selectItem(item) { if (!(0, _sourcesTree.nodeHasChildren)(item)) { this.props.selectLocation({ sourceId: item.contents.get("id") }); } } getPath(item) { const { sources } = this.props; const blackBoxedPart = item.contents.get && sources.get(item.contents.get("id")).get("isBlackBoxed") ? "update" : ""; return `${item.path}/${item.name}/${blackBoxedPart}`; } getIcon(sources, item, depth) { const { debuggeeUrl } = this.props; if (item.path === "/Webpack") { return _react2.default.createElement(_Svg2.default, { name: "webpack" }); } if (item.path === "/Angular") { return _react2.default.createElement(_Svg2.default, { name: "angular" }); } if (depth === 0) { return _react2.default.createElement("img", { className: (0, _classnames2.default)("domain", { debuggee: debuggeeUrl && debuggeeUrl.includes(item.name) }) }); } if (!(0, _sourcesTree.nodeHasChildren)(item)) { const source = sources.get(item.contents.get("id")); if (source.get("isBlackBoxed")) { return _react2.default.createElement("img", { className: "blackBox" }); } return _react2.default.createElement("img", { className: "file" }); } return _react2.default.createElement("img", { className: "folder" }); } onContextMenu(event, item) { const copySourceUri2Label = L10N.getStr("copySourceUri2"); const copySourceUri2Key = L10N.getStr("copySourceUri2.accesskey"); const setDirectoryRootLabel = L10N.getStr("setDirectoryRoot.label"); const setDirectoryRootKey = L10N.getStr("setDirectoryRoot.accesskey"); event.stopPropagation(); event.preventDefault(); const menuOptions = []; if (!(0, _sourcesTree.isDirectory)(item)) { const source = item.contents.get("url"); const copySourceUri2 = { id: "node-menu-copy-source", label: copySourceUri2Label, accesskey: copySourceUri2Key, disabled: false, click: () => (0, _clipboard.copyToTheClipboard)(source) }; menuOptions.push(copySourceUri2); } else if (_prefs.features.root) { menuOptions.push({ id: "node-set-directory-root", label: setDirectoryRootLabel, accesskey: setDirectoryRootKey, disabled: false, click: () => (0, _ui.setProjectDirectoryRoot)(item.path) }); } (0, _devtoolsContextmenu.showMenu)(event, menuOptions); } renderItem(item, depth, focused, _, expanded, { setExpanded }) { const arrow = (0, _sourcesTree.nodeHasChildren)(item) ? _react2.default.createElement("img", { className: (0, _classnames2.default)("arrow", { expanded: expanded }), onClick: e => { e.stopPropagation(); setExpanded(item, !expanded, e.altKey); } }) : _react2.default.createElement("i", { className: "no-arrow" }); const { sources } = this.props; const icon = this.getIcon(sources, item, depth); let paddingDir = "paddingRight"; if (document.body && document.body.parentElement) { paddingDir = document.body.parentElement.dir == "ltr" ? "paddingLeft" : "paddingRight"; } return _react2.default.createElement( "div", { className: (0, _classnames2.default)("node", { focused }), style: { [paddingDir]: `${depth * 15 + 5}px` }, key: item.path, onClick: e => { this.selectItem(item); setExpanded(item, !expanded, e.altKey); }, onContextMenu: e => this.onContextMenu(e, item) }, arrow, icon, _react2.default.createElement( "span", { className: "label" }, " ", item.name, " " ) ); } render() { const expanded = this.props.expanded; const { focusedItem, sourceTree, parentMap, listItems, highlightItems } = this.state; const onExpand = (item, expandedState) => { this.props.setExpandedState(expandedState); }; const onCollapse = (item, expandedState) => { this.props.setExpandedState(expandedState); }; const isEmpty = sourceTree.contents.length === 0; const treeProps = { key: isEmpty ? "empty" : "full", getParent: item => parentMap.get(item), getChildren: item => (0, _sourcesTree.nodeHasChildren)(item) ? item.contents : [], getRoots: () => sourceTree.contents, getPath: this.getPath, itemHeight: 21, autoExpandDepth: expanded ? 0 : 1, autoExpandAll: false, onFocus: this.focusItem, listItems, highlightItems, expanded, onExpand, onCollapse, renderItem: this.renderItem }; const tree = _react2.default.createElement(_ManagedTree2.default, treeProps); if (isEmpty) { return _react2.default.createElement( "div", { className: "no-sources-message" }, L10N.getStr("sources.noSourcesAvailable") ); } const onKeyDown = e => { if (e.keyCode === 13 && focusedItem) { this.selectItem(focusedItem); } }; return _react2.default.createElement( "div", { className: "sources-list", onKeyDown: onKeyDown }, tree ); } } // Utils // Components // Types // Redux /* 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 . */ // React const mapStateToProps = state => { return { shownSource: (0, _selectors.getShownSource)(state), selectedSource: (0, _selectors.getSelectedSource)(state), debuggeeUrl: (0, _selectors.getDebuggeeUrl)(state), expanded: (0, _selectors.getExpandedState)(state), projectRoot: (0, _selectors.getProjectDirectoryRoot)(state), sources: (0, _selectors.getSources)(state) }; }; const actionCreators = { setExpandedState: _sourceTree.setExpandedState, selectLocation: _sources.selectLocation }; exports.default = (0, _reactRedux.connect)(mapStateToProps, actionCreators)(SourcesTree); /***/ }), /* 1554 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _propTypes = __webpack_require__(20); var _propTypes2 = _interopRequireDefault(_propTypes); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactDom = __webpack_require__(4); var _reactDom2 = _interopRequireDefault(_reactDom); var _reactRedux = __webpack_require__(1189); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _devtoolsLaunchpad = __webpack_require__(1362); var _source = __webpack_require__(1356); var _devtoolsConfig = __webpack_require__(1355); var _devtoolsSourceEditor = __webpack_require__(1386); var _prefs = __webpack_require__(226); var _selectors = __webpack_require__(1352); var _redux = __webpack_require__(3); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _Footer = __webpack_require__(1555); var _Footer2 = _interopRequireDefault(_Footer); var _SearchBar = __webpack_require__(1556); var _SearchBar2 = _interopRequireDefault(_SearchBar); var _HighlightLines = __webpack_require__(1557); var _HighlightLines2 = _interopRequireDefault(_HighlightLines); var _Preview = __webpack_require__(1558); var _Preview2 = _interopRequireDefault(_Preview); var _Breakpoints = __webpack_require__(1588); var _Breakpoints2 = _interopRequireDefault(_Breakpoints); var _HitMarker = __webpack_require__(1590); var _HitMarker2 = _interopRequireDefault(_HitMarker); var _CallSites = __webpack_require__(1591); var _CallSites2 = _interopRequireDefault(_CallSites); var _DebugLine = __webpack_require__(1593); var _DebugLine2 = _interopRequireDefault(_DebugLine); var _HighlightLine = __webpack_require__(1796); var _HighlightLine2 = _interopRequireDefault(_HighlightLine); var _EmptyLines = __webpack_require__(1594); var _EmptyLines2 = _interopRequireDefault(_EmptyLines); var _GutterMenu = __webpack_require__(1595); var _GutterMenu2 = _interopRequireDefault(_GutterMenu); var _EditorMenu = __webpack_require__(1596); var _EditorMenu2 = _interopRequireDefault(_EditorMenu); var _ConditionalPanel = __webpack_require__(1598); var _ConditionalPanel2 = _interopRequireDefault(_ConditionalPanel); var _editor = __webpack_require__(1358); var _ui = __webpack_require__(1439); __webpack_require__(1332); __webpack_require__(1333); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ const cssVars = { searchbarHeight: "var(--editor-searchbar-height)", secondSearchbarHeight: "var(--editor-second-searchbar-height)", footerHeight: "var(--editor-footer-height)" }; // Redux actions class Editor extends _react.PureComponent { constructor() { super(); this.onToggleBreakpoint = (key, e) => { e.preventDefault(); const { selectedSource, conditionalPanelLine } = this.props; if (!selectedSource) { return; } const line = this.getCurrentLine(); if (e.shiftKey) { this.toggleConditionalPanel(line); } else if (!conditionalPanelLine) { this.props.toggleBreakpoint(line); } else { this.toggleConditionalPanel(line); this.props.toggleBreakpoint(line); } }; this.onEscape = (key, e) => { if (!this.state.editor) { return; } const { codeMirror } = this.state.editor; if (codeMirror.listSelections().length > 1) { codeMirror.execCommand("singleSelection"); e.preventDefault(); } }; this.onSearchAgain = (_, e) => { this.props.traverseResults(e.shiftKey, this.state.editor); }; this.onGutterClick = (cm, line, gutter, ev) => { const { selectedSource, conditionalPanelLine, closeConditionalPanel, addOrToggleDisabledBreakpoint, toggleBreakpoint, continueToHere } = this.props; // ignore right clicks in the gutter if (ev.ctrlKey && ev.button === 0 || ev.which === 3 || selectedSource && selectedSource.get("isBlackBoxed") || !selectedSource) { return; } if (conditionalPanelLine) { return closeConditionalPanel(); } if (gutter === "CodeMirror-foldgutter") { return; } const sourceLine = (0, _editor.toSourceLine)(selectedSource.get("id"), line); if (ev.altKey) { return continueToHere(sourceLine); } if (ev.shiftKey) { return addOrToggleDisabledBreakpoint(sourceLine); } return toggleBreakpoint(sourceLine); }; this.onGutterContextMenu = event => { event.stopPropagation(); event.preventDefault(); return this.props.setContextMenu("Gutter", event); }; this.toggleConditionalPanel = line => { const { conditionalPanelLine, closeConditionalPanel, openConditionalPanel } = this.props; if (!line || isNaN(line)) { line = this.getCurrentLine(); } if (conditionalPanelLine) { return closeConditionalPanel(); } return openConditionalPanel(line); }; this.closeConditionalPanel = () => { return this.props.closeConditionalPanel(); }; this.state = { highlightedLineRange: null, editor: null }; } componentWillReceiveProps(nextProps) { if (!this.state.editor) { return; } (0, _editor.resizeBreakpointGutter)(this.state.editor.codeMirror); (0, _ui.resizeToggleButton)(this.state.editor.codeMirror); } componentWillUpdate(nextProps) { this.setText(nextProps); this.setSize(nextProps); this.scrollToLocation(nextProps); } setupEditor() { const editor = (0, _editor.createEditor)(); // disables the default search shortcuts editor._initShortcuts = () => {}; const node = _reactDom2.default.findDOMNode(this); if (node instanceof HTMLElement) { editor.appendToLocalElement(node.querySelector(".editor-mount")); } const { codeMirror } = editor; const codeMirrorWrapper = codeMirror.getWrapperElement(); (0, _editor.resizeBreakpointGutter)(codeMirror); (0, _ui.resizeToggleButton)(codeMirror); (0, _devtoolsLaunchpad.debugGlobal)("cm", codeMirror); codeMirror.on("gutterClick", this.onGutterClick); // Set code editor wrapper to be focusable codeMirrorWrapper.tabIndex = 0; codeMirrorWrapper.addEventListener("keydown", e => this.onKeyDown(e)); codeMirrorWrapper.addEventListener("click", e => this.onClick(e)); const toggleFoldMarkerVisibility = e => { if (node instanceof HTMLElement) { node.querySelectorAll(".CodeMirror-guttermarker-subtle").forEach(elem => { elem.classList.toggle("visible"); }); } }; const codeMirrorGutter = codeMirror.getGutterElement(); codeMirrorGutter.addEventListener("mouseleave", toggleFoldMarkerVisibility); codeMirrorGutter.addEventListener("mouseenter", toggleFoldMarkerVisibility); if (!(0, _devtoolsConfig.isFirefox)()) { codeMirror.on("gutterContextMenu", (cm, line, eventName, event) => this.onGutterContextMenu(event)); codeMirror.on("contextmenu", (cm, event) => this.openMenu(event)); } else { codeMirrorWrapper.addEventListener("contextmenu", event => this.openMenu(event)); } this.setState({ editor }); return editor; } componentDidMount() { const editor = this.setupEditor(); const { selectedSource } = this.props; const { shortcuts } = this.context; const searchAgainKey = L10N.getStr("sourceSearch.search.again.key2"); const searchAgainPrevKey = L10N.getStr("sourceSearch.search.againPrev.key2"); shortcuts.on(L10N.getStr("toggleBreakpoint.key"), this.onToggleBreakpoint); shortcuts.on(L10N.getStr("toggleCondPanel.key"), this.toggleConditionalPanel); shortcuts.on("Esc", this.onEscape); shortcuts.on(searchAgainPrevKey, this.onSearchAgain); shortcuts.on(searchAgainKey, this.onSearchAgain); (0, _editor.updateDocument)(editor, selectedSource); } componentWillUnmount() { this.state.editor.destroy(); this.setState({ editor: null }); const searchAgainKey = L10N.getStr("sourceSearch.search.again.key2"); const searchAgainPrevKey = L10N.getStr("sourceSearch.search.againPrev.key2"); const shortcuts = this.context.shortcuts; shortcuts.off(L10N.getStr("toggleBreakpoint.key")); shortcuts.off(L10N.getStr("toggleCondPanel.key")); shortcuts.off(searchAgainPrevKey); shortcuts.off(searchAgainKey); } componentDidUpdate(prevProps, prevState) { // NOTE: when devtools are opened, the editor is not set when // the source loads so we need to wait until the editor is // set to update the text and size. if (!prevState.editor && this.state.editor) { this.setText(this.props); this.setSize(this.props); } } getCurrentLine() { const { codeMirror } = this.state.editor; const { selectedSource } = this.props; const line = (0, _editor.getCursorLine)(codeMirror); return (0, _editor.toSourceLine)(selectedSource.get("id"), line); } onKeyDown(e) { const { codeMirror } = this.state.editor; const { key, target } = e; const codeWrapper = codeMirror.getWrapperElement(); const textArea = codeWrapper.querySelector("textArea"); if (key === "Escape" && target == textArea) { e.stopPropagation(); e.preventDefault(); codeWrapper.focus(); } else if (key === "Enter" && target == codeWrapper) { e.preventDefault(); // Focus into editor's text area textArea.focus(); } } /* * The default Esc command is overridden in the CodeMirror keymap to allow * the Esc keypress event to be catched by the toolbox and trigger the * split console. Restore it here, but preventDefault if and only if there * is a multiselection. */ openMenu(event) { event.stopPropagation(); event.preventDefault(); const { setContextMenu } = this.props; if (event.target.classList.contains("CodeMirror-linenumber")) { return setContextMenu("Gutter", event); } return setContextMenu("Editor", event); } onClick(e) { const { selectedLocation, jumpToMappedLocation } = this.props; if (e.metaKey && e.altKey) { const sourceLocation = (0, _editor.getSourceLocationFromMouseEvent)(this.state.editor, selectedLocation, e); jumpToMappedLocation(sourceLocation); } } shouldScrollToLocation(nextProps) { const { selectedLocation, selectedSource } = this.props; const { editor } = this.state; if (!nextProps.selectedSource || !editor || !nextProps.selectedLocation) { return false; } if (!(0, _source.isLoaded)(nextProps.selectedSource)) { return false; } if (!nextProps.selectedLocation.line) { return false; } const isFirstLoad = (!selectedSource || !(0, _source.isLoaded)(selectedSource)) && (0, _source.isLoaded)(nextProps.selectedSource); const locationChanged = selectedLocation !== nextProps.selectedLocation; return isFirstLoad || locationChanged; } scrollToLocation(nextProps) { const { editor } = this.state; if (this.shouldScrollToLocation(nextProps)) { const { line, column } = (0, _editor.toEditorPosition)(nextProps.selectedLocation); (0, _editor.scrollToColumn)(editor.codeMirror, line, column); } } setSize(nextProps) { if (!this.state.editor) { return; } if (nextProps.startPanelSize !== this.props.startPanelSize || nextProps.endPanelSize !== this.props.endPanelSize) { this.state.editor.codeMirror.setSize(); } } setText(props) { const { selectedSource, sourceMetaData } = props; if (!this.state.editor) { return; } if (!selectedSource) { return this.showMessage(""); } if (!(0, _source.isLoaded)(selectedSource)) { return (0, _editor.showLoading)(this.state.editor); } if (selectedSource.get("error")) { return this.showMessage(selectedSource.get("error")); } return (0, _editor.showSourceText)(this.state.editor, selectedSource.toJS(), sourceMetaData); } showMessage(msg) { const { editor } = this.state; if (!editor) { return; } (0, _editor.resetLineNumberFormat)(editor); } getInlineEditorStyles() { const { selectedSource, horizontal, searchOn } = this.props; const subtractions = []; if ((0, _editor.shouldShowFooter)(selectedSource, horizontal)) { subtractions.push(cssVars.footerHeight); } if (searchOn) { subtractions.push(cssVars.searchbarHeight); subtractions.push(cssVars.secondSearchbarHeight); } return { height: subtractions.length === 0 ? "100%" : `calc(100% - ${subtractions.join(" - ")})` }; } renderHitCounts() { const { hitCount, selectedSource } = this.props; if (!selectedSource || !(0, _source.isLoaded)(selectedSource) || !hitCount || !this.state.editor) { return; } return hitCount.filter(marker => marker.get("count") > 0).map(marker => _react2.default.createElement(_HitMarker2.default, { key: marker.get("line"), hitData: marker.toJS(), editor: this.state.editor.codeMirror })); } renderItems() { const { horizontal, selectedSource } = this.props; const { editor } = this.state; if (!editor || !selectedSource) { return null; } return _react2.default.createElement( "div", null, _react2.default.createElement(_DebugLine2.default, null), _react2.default.createElement(_HighlightLine2.default, null), _react2.default.createElement(_EmptyLines2.default, { editor: editor }), _react2.default.createElement(_Breakpoints2.default, { editor: editor }), _react2.default.createElement(_Preview2.default, { editor: editor }), ";", _react2.default.createElement(_Footer2.default, { editor: editor, horizontal: horizontal }), _react2.default.createElement(_HighlightLines2.default, { editor: editor }), _react2.default.createElement(_EditorMenu2.default, { editor: editor }), _react2.default.createElement(_GutterMenu2.default, { editor: editor }), _react2.default.createElement(_ConditionalPanel2.default, { editor: editor }), _prefs.features.columnBreakpoints ? _react2.default.createElement(_CallSites2.default, { editor: editor }) : null, this.renderHitCounts() ); } renderSearchBar() { const { editor } = this.state; if (!editor) { return null; } return _react2.default.createElement(_SearchBar2.default, { editor: editor }); } render() { const { coverageOn } = this.props; return _react2.default.createElement( "div", { className: (0, _classnames2.default)("editor-wrapper", { "coverage-on": coverageOn }) }, this.renderSearchBar(), _react2.default.createElement("div", { className: "editor-mount devtools-monospace", style: this.getInlineEditorStyles() }), this.renderItems() ); } } Editor.contextTypes = { shortcuts: _propTypes2.default.object }; const mapStateToProps = state => { const selectedSource = (0, _selectors.getSelectedSource)(state); const sourceId = selectedSource ? selectedSource.get("id") : ""; return { selectedLocation: (0, _selectors.getSelectedLocation)(state), selectedSource, searchOn: (0, _selectors.getActiveSearch)(state) === "file", hitCount: (0, _selectors.getHitCountForSource)(state, sourceId), coverageOn: (0, _selectors.getCoverageEnabled)(state), conditionalPanelLine: (0, _selectors.getConditionalPanelLine)(state), sourceMetaData: (0, _selectors.getSourceMetaData)(state, sourceId) }; }; exports.default = (0, _reactRedux.connect)(mapStateToProps, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Editor); /***/ }), /* 1555 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(1352); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _devtoolsConfig = __webpack_require__(1355); var _source = __webpack_require__(1356); var _sources = __webpack_require__(1369); var _editor = __webpack_require__(1358); var _PaneToggle = __webpack_require__(1407); var _PaneToggle2 = _interopRequireDefault(_PaneToggle); __webpack_require__(1322); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ class SourceFooter extends _react.PureComponent { prettyPrintButton() { const { selectedSource, togglePrettyPrint } = this.props; const sourceLoaded = selectedSource && (0, _source.isLoaded)(selectedSource); if (!(0, _editor.shouldShowPrettyPrint)(selectedSource)) { return; } const tooltip = L10N.getStr("sourceTabs.prettyPrint"); const type = "prettyPrint"; return _react2.default.createElement( "button", { onClick: () => togglePrettyPrint(selectedSource.get("id")), className: (0, _classnames2.default)("action", type, { active: sourceLoaded, pretty: (0, _source.isPretty)(selectedSource) }), key: type, title: tooltip, "aria-label": tooltip }, _react2.default.createElement("img", { className: type }) ); } blackBoxButton() { const { selectedSource, toggleBlackBox } = this.props; const sourceLoaded = selectedSource && (0, _source.isLoaded)(selectedSource); if (!(0, _devtoolsConfig.isEnabled)("blackbox") || !sourceLoaded) { return; } const blackboxed = selectedSource.get("isBlackBoxed"); const tooltip = L10N.getStr("sourceFooter.blackbox"); const type = "black-box"; return _react2.default.createElement( "button", { onClick: () => toggleBlackBox(selectedSource.toJS()), className: (0, _classnames2.default)("action", type, { active: sourceLoaded, blackboxed: blackboxed }), key: type, title: tooltip, "aria-label": tooltip }, _react2.default.createElement("img", { className: "blackBox" }) ); } blackBoxSummary() { const { selectedSource } = this.props; if (!selectedSource || !selectedSource.get("isBlackBoxed")) { return; } return _react2.default.createElement( "span", { className: "blackbox-summary" }, L10N.getStr("sourceFooter.blackboxed") ); } coverageButton() { const { recordCoverage } = this.props; if (!(0, _devtoolsConfig.isEnabled)("codeCoverage")) { return; } return _react2.default.createElement( "button", { className: "coverage action", title: L10N.getStr("sourceFooter.codeCoverage"), onClick: () => recordCoverage(), "aria-label": L10N.getStr("sourceFooter.codeCoverage") }, "C" ); } renderToggleButton() { if (this.props.horizontal) { return; } return _react2.default.createElement(_PaneToggle2.default, { position: "end", collapsed: !this.props.endPanelCollapsed, horizontal: this.props.horizontal, handleClick: this.props.togglePaneCollapse }); } renderCommands() { return _react2.default.createElement( "div", { className: "commands" }, this.prettyPrintButton(), this.blackBoxButton(), this.blackBoxSummary(), this.coverageButton() ); } renderSourceSummary() { const { mappedSource, jumpToMappedLocation, selectedSource } = this.props; if (mappedSource) { const bundleSource = mappedSource.toJS(); const filename = (0, _source.getFilename)(bundleSource); const tooltip = L10N.getFormatStr("sourceFooter.mappedSourceTooltip", filename); const title = L10N.getFormatStr("sourceFooter.mappedSource", filename); const mappedSourceLocation = { sourceId: selectedSource.get("id"), line: 1, column: 1 }; return _react2.default.createElement( "button", { className: "mapped-source", onClick: () => jumpToMappedLocation(mappedSourceLocation), title: tooltip }, _react2.default.createElement( "span", null, title ) ); } return null; } render() { const { selectedSource, horizontal } = this.props; if (!(0, _editor.shouldShowFooter)(selectedSource, horizontal)) { return null; } return _react2.default.createElement( "div", { className: "source-footer" }, this.renderCommands(), this.renderSourceSummary(), this.renderToggleButton() ); } } exports.default = (0, _reactRedux.connect)(state => { const selectedSource = (0, _selectors.getSelectedSource)(state); const selectedId = selectedSource.get("id"); const source = selectedSource.toJS(); return { selectedSource, mappedSource: (0, _sources.getGeneratedSource)(state, source), prettySource: (0, _selectors.getPrettySource)(state, selectedId), endPanelCollapsed: (0, _selectors.getPaneCollapse)(state, "end") }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(SourceFooter); /***/ }), /* 1556 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _propTypes = __webpack_require__(20); var _propTypes2 = _interopRequireDefault(_propTypes); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _Svg = __webpack_require__(1359); var _Svg2 = _interopRequireDefault(_Svg); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(1352); var _editor = __webpack_require__(1358); var _resultList = __webpack_require__(1406); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _devtoolsSourceEditor = __webpack_require__(1386); var _SearchInput = __webpack_require__(1379); var _SearchInput2 = _interopRequireDefault(_SearchInput); var _lodash = __webpack_require__(2); __webpack_require__(1323); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ function getShortcuts() { const searchAgainKey = L10N.getStr("sourceSearch.search.again.key2"); const searchAgainPrevKey = L10N.getStr("sourceSearch.search.againPrev.key2"); const searchKey = L10N.getStr("sourceSearch.search.key2"); return { shiftSearchAgainShortcut: searchAgainPrevKey, searchAgainShortcut: searchAgainKey, searchShortcut: searchKey }; } class SearchBar extends _react.Component { constructor(props) { super(props); this.onEscape = e => { this.closeSearch(e); }; this.clearSearch = () => { const { editor: ed, query, modifiers } = this.props; if (ed && modifiers) { const ctx = { ed, cm: ed.codeMirror }; (0, _editor.removeOverlay)(ctx, query, modifiers.toJS()); } }; this.closeSearch = e => { const { editor, searchOn } = this.props; if (editor && searchOn) { this.clearSearch(); this.props.closeFileSearch(editor); e.stopPropagation(); e.preventDefault(); } }; this.toggleSearch = e => { e.stopPropagation(); e.preventDefault(); const { editor } = this.props; if (!this.props.searchOn) { this.props.setActiveSearch("file"); } if (this.props.searchOn && editor) { const selection = editor.codeMirror.getSelection(); this.setState({ query: selection }); if (selection !== "") { this.doSearch(selection); } } }; this.doSearch = query => { const { selectedSource } = this.props; if (!selectedSource || !selectedSource.get("text")) { return; } this.props.doSearch(query, this.props.editor); }; this.updateSearchResults = (characterIndex, line, matches) => { const matchIndex = matches.findIndex(elm => elm.line === line && elm.ch === characterIndex); this.props.updateSearchResults({ matches, matchIndex, count: matches.length, index: characterIndex }); }; this.traverseResults = (e, rev) => { e.stopPropagation(); e.preventDefault(); const editor = this.props.editor; if (!editor) { return; } this.props.traverseResults(rev, editor); }; this.onChange = e => { this.setState({ query: e.target.value }); return this.doSearch(e.target.value); }; this.onKeyDown = e => { if (e.key !== "Enter" && e.key !== "F3") { return; } this.traverseResults(e, e.shiftKey); e.preventDefault(); }; this.renderSearchModifiers = () => { const { modifiers, toggleFileSearchModifier } = this.props; function SearchModBtn({ modVal, className, svgName, tooltip }) { const preppedClass = (0, _classnames2.default)(className, { active: modifiers && modifiers.get(modVal) }); return _react2.default.createElement( "button", { className: preppedClass, onClick: () => toggleFileSearchModifier(modVal), title: tooltip }, _react2.default.createElement(_Svg2.default, { name: svgName }) ); } return _react2.default.createElement( "div", { className: "search-modifiers" }, _react2.default.createElement( "span", { className: "search-type-name" }, L10N.getStr("symbolSearch.searchModifier.modifiersLabel") ), _react2.default.createElement(SearchModBtn, { modVal: "regexMatch", className: "regex-match-btn", svgName: "regex-match", tooltip: L10N.getStr("symbolSearch.searchModifier.regex") }), _react2.default.createElement(SearchModBtn, { modVal: "caseSensitive", className: "case-sensitive-btn", svgName: "case-match", tooltip: L10N.getStr("symbolSearch.searchModifier.caseSensitive") }), _react2.default.createElement(SearchModBtn, { modVal: "wholeWord", className: "whole-word-btn", svgName: "whole-word-match", tooltip: L10N.getStr("symbolSearch.searchModifier.wholeWord") }) ); }; this.state = { query: props.query, selectedResultIndex: 0, count: 0, index: -1 }; } componentWillUnmount() { const shortcuts = this.context.shortcuts; const { searchShortcut, searchAgainShortcut, shiftSearchAgainShortcut } = getShortcuts(); shortcuts.off(searchShortcut); shortcuts.off("Escape"); shortcuts.off(searchAgainShortcut); shortcuts.off(shiftSearchAgainShortcut); } componentDidMount() { // overwrite this.doSearch with debounced version to // reduce frequency of queries this.doSearch = (0, _lodash.debounce)(this.doSearch, 100); const shortcuts = this.context.shortcuts; const { searchShortcut, searchAgainShortcut, shiftSearchAgainShortcut } = getShortcuts(); shortcuts.on(searchShortcut, (_, e) => this.toggleSearch(e)); shortcuts.on("Escape", (_, e) => this.onEscape(e)); shortcuts.on(shiftSearchAgainShortcut, (_, e) => this.traverseResults(e, true)); shortcuts.on(searchAgainShortcut, (_, e) => this.traverseResults(e, false)); } componentDidUpdate(prevProps, prevState) { if (this.refs.resultList && this.refs.resultList.refs) { (0, _resultList.scrollList)(this.refs.resultList.refs, this.state.selectedResultIndex); } } // Handlers // Renderers buildSummaryMsg() { const { searchResults: { matchIndex, count, index }, query } = this.props; if (query.trim() == "") { return ""; } if (count == 0) { return L10N.getStr("editor.noResults"); } if (index == -1) { return L10N.getFormatStr("sourceSearch.resultsSummary1", count); } return L10N.getFormatStr("editor.searchResults", matchIndex + 1, count); } render() { const { searchResults: { count }, searchOn } = this.props; if (!searchOn) { return _react2.default.createElement("div", null); } return _react2.default.createElement( "div", { className: "search-bar" }, _react2.default.createElement(_SearchInput2.default, { query: this.state.query, count: count, placeholder: L10N.getStr("sourceSearch.search.placeholder"), summaryMsg: this.buildSummaryMsg(), onChange: this.onChange, onKeyDown: this.onKeyDown, handleNext: e => this.traverseResults(e, false), handlePrev: e => this.traverseResults(e, true), handleClose: this.closeSearch }), _react2.default.createElement( "div", { className: "search-bottom-bar" }, this.renderSearchModifiers() ) ); } } SearchBar.contextTypes = { shortcuts: _propTypes2.default.object }; exports.default = (0, _reactRedux.connect)(state => { return { searchOn: (0, _selectors.getActiveSearch)(state) === "file", selectedSource: (0, _selectors.getSelectedSource)(state), selectedLocation: (0, _selectors.getSelectedLocation)(state), query: (0, _selectors.getFileSearchQuery)(state), modifiers: (0, _selectors.getFileSearchModifiers)(state), highlightedLineRange: (0, _selectors.getHighlightedLineRange)(state), searchResults: (0, _selectors.getFileSearchResults)(state) }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(SearchBar); /***/ }), /* 1557 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _lodash = __webpack_require__(2); var _reactRedux = __webpack_require__(1189); var _selectors = __webpack_require__(1352); class HighlightLines extends _react.Component { constructor() { super(); this.highlightLineRange = this.highlightLineRange.bind(this); } componentDidMount() { this.highlightLineRange(); } componentWillUpdate() { this.clearHighlightRange(); } componentDidUpdate() { this.highlightLineRange(); } componentWillUnmount() { this.clearHighlightRange(); } clearHighlightRange() { const { highlightedLineRange, editor } = this.props; const { codeMirror } = editor; if ((0, _lodash.isEmpty)(highlightedLineRange) || !codeMirror) { return; } const { start, end } = highlightedLineRange; codeMirror.operation(() => { (0, _lodash.range)(start - 1, end).forEach(line => { codeMirror.removeLineClass(line, "line", "highlight-lines"); }); }); } highlightLineRange() { const { highlightedLineRange, editor } = this.props; const { codeMirror } = editor; if ((0, _lodash.isEmpty)(highlightedLineRange) || !codeMirror) { return; } const { start, end } = highlightedLineRange; codeMirror.operation(() => { editor.alignLine(start); (0, _lodash.range)(start - 1, end).forEach(line => { codeMirror.addLineClass(line, "line", "highlight-lines"); }); }); } render() { return null; } } /* 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 . */ exports.default = (0, _reactRedux.connect)(state => ({ highlightedLineRange: (0, _selectors.getHighlightedLineRange)(state) }))(HighlightLines); /***/ }), /* 1558 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _lodash = __webpack_require__(2); var _Popup = __webpack_require__(1559); var _Popup2 = _interopRequireDefault(_Popup); var _selectors = __webpack_require__(1352); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _editor = __webpack_require__(1358); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Preview extends _react.PureComponent { constructor() { super(); const self = this; self.onScroll = this.onScroll.bind(this); self.onMouseOver = (0, _lodash.debounce)(this.onMouseOver, 40); self.onMouseOver = this.onMouseOver.bind(this); self.onMouseUp = this.onMouseUp.bind(this); self.onMouseDown = this.onMouseDown.bind(this); } componentDidMount() { const { codeMirror } = this.props.editor; const codeMirrorWrapper = codeMirror.getWrapperElement(); codeMirror.on("scroll", this.onScroll); codeMirrorWrapper.addEventListener("mouseover", this.onMouseOver); codeMirrorWrapper.addEventListener("mouseup", this.onMouseUp); codeMirrorWrapper.addEventListener("mousedown", this.onMouseDown); } componentWillUnmount() { const codeMirror = this.props.editor.codeMirror; const codeMirrorWrapper = codeMirror.getWrapperElement(); codeMirrorWrapper.removeEventListener("mouseover", this.onMouseOver); codeMirrorWrapper.removeEventListener("mouseup", this.onMouseUp); codeMirrorWrapper.removeEventListener("mousedown", this.onMouseDown); codeMirror.off("scroll", this.onScroll); } onMouseOver(e) { const { target } = e; if (this.props.selectedFrameVisible) { this.props.updatePreview(target, this.props.editor); } } onMouseUp() { this.currentlySelecting = false; } onMouseDown() { this.currentlySelecting = true; } onScroll() { this.props.clearPreview(); } onClose(e) { this.props.clearPreview(); } render() { const { selectedSource, preview } = this.props; if (!this.props.editor || !selectedSource || this.currentlySelecting) { return null; } if (!preview || preview.updating) { return null; } const { result, expression, location, cursorPos, extra } = preview; const value = result; if (typeof value == "undefined" || value.optimizedOut) { return null; } const editorRange = (0, _editor.toEditorRange)(selectedSource.get("id"), location); return _react2.default.createElement(_Popup2.default, { value: value, editor: this.props.editor, range: editorRange, expression: expression, popoverPos: cursorPos, extra: extra, onClose: e => this.onClose(e) }); } } /* 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 . */ const { addExpression, loadObjectProperties, updatePreview, clearPreview } = _actions2.default; exports.default = (0, _reactRedux.connect)(state => ({ preview: (0, _selectors.getPreview)(state), selectedSource: (0, _selectors.getSelectedSource)(state), selectedFrameVisible: (0, _selectors.isSelectedFrameVisible)(state) }), { addExpression, loadObjectProperties, updatePreview, clearPreview })(Preview); /***/ }), /* 1559 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Popup = undefined; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _devtoolsConfig = __webpack_require__(1355); var _devtoolsReps = __webpack_require__(1408); var _devtoolsReps2 = _interopRequireDefault(_devtoolsReps); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(1352); var _Popover = __webpack_require__(1586); var _Popover2 = _interopRequireDefault(_Popover); var _PreviewFunction = __webpack_require__(1446); var _PreviewFunction2 = _interopRequireDefault(_PreviewFunction); var _editor = __webpack_require__(1358); var _Svg = __webpack_require__(1359); var _Svg2 = _interopRequireDefault(_Svg); __webpack_require__(1328); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ const { REPS: { Rep }, MODE, ObjectInspectorUtils } = _devtoolsReps2.default; const { ObjectInspector } = _devtoolsReps2.default; const { getChildren } = ObjectInspectorUtils; function isReactComponent(roots) { return roots.some(root => root.name === "_reactInternalInstance"); } class Popup extends _react.Component { componentDidMount() { const { loadObjectProperties, loadedObjects, value, editor, range } = this.props; this.marker = (0, _editor.markText)(editor, "preview-selection", range); if (!value || !value.type == "object") { return; } if (value.actor && !loadedObjects[value.actor]) { loadObjectProperties(value); } } componentWillUnmount() { if (this.marker) { this.marker.clear(); } } getChildren(root, getObjectProperties) { const actors = {}; const children = getChildren({ getObjectProperties, actors, item: root }); if (children.length > 0) { return children; } return null; } renderFunctionPreview(value, root) { const { selectSourceURL } = this.props; const { location } = value; return _react2.default.createElement( "div", { className: "preview-popup", onClick: () => selectSourceURL(location.url, { line: location.line }) }, _react2.default.createElement(_PreviewFunction2.default, { func: value }) ); } renderObjectPreview(expression, root, extra) { let header = null; const { loadedObjects } = this.props; const { extra: { react, immutable } } = this.props; const getObjectProperties = id => loadedObjects[id]; let roots = this.getChildren(root, getObjectProperties); if (!roots) { return null; } if (isReactComponent(roots)) { const reactHeader = react.displayName || "React Component"; header = _react2.default.createElement( "div", { className: "header-container" }, _react2.default.createElement( "h3", null, reactHeader ) ); roots = roots.filter(r => ["state", "props"].includes(r.name)); } if (immutable.isImmutable) { const immutableHeader = immutable.type || "Immutable"; header = _react2.default.createElement( "div", { className: "header-container" }, _react2.default.createElement(_Svg2.default, { name: "immutable", className: "immutable-logo" }), _react2.default.createElement( "h3", null, immutableHeader ) ); roots = roots.filter(r => ["size"].includes(r.name)); roots.push({ name: "entries", contents: { value: immutable.entries }, path: "entries" }); } return _react2.default.createElement( "div", { className: "preview-popup" }, header, this.renderObjectInspector(roots) ); } renderSimplePreview(value) { const { openLink } = this.props; return _react2.default.createElement( "div", { className: "preview-popup" }, Rep({ object: value, mode: MODE.LONG, openLink }) ); } renderObjectInspector(roots) { const { loadObjectProperties, loadedObjects, openLink } = this.props; const getObjectProperties = id => loadedObjects[id]; return _react2.default.createElement(ObjectInspector, { roots: roots, autoExpandDepth: 0, disableWrap: true, disabledFocus: true, openLink: openLink, getObjectProperties: getObjectProperties, loadObjectProperties: loadObjectProperties // TODO: See https://github.com/devtools-html/debugger.html/issues/3555. , getObjectEntries: actor => {}, loadObjectEntries: grip => {} }); } renderAddToExpressionBar(expression) { if (!(0, _devtoolsConfig.isEnabled)("previewWatch")) { return null; } const { addExpression } = this.props; return _react2.default.createElement( "div", { className: "add-to-expression-bar" }, _react2.default.createElement( "div", { className: "prompt" }, "\xBB" ), _react2.default.createElement( "div", { className: "expression-to-save-label" }, expression ), _react2.default.createElement( "div", { className: "expression-to-save-button", onClick: event => addExpression(event) }, L10N.getStr("addWatchExpressionButton") ) ); } renderPreview(expression, value, extra) { const root = { name: expression, path: expression, contents: { value } }; if (value.class === "Function") { return this.renderFunctionPreview(value, root); } if (value.type === "object") { return _react2.default.createElement( "div", null, this.renderObjectPreview(expression, root, extra), this.renderAddToExpressionBar(expression) ); } return this.renderSimplePreview(value); } getPreviewType(value) { if (typeof value == "number" || typeof value == "boolean" || typeof value == "string" && value.length < 10 || typeof value == "number" && value.toString().length < 10 || value.type == "null" || value.type == "undefined" || value.class === "Function") { return "tooltip"; } return "popover"; } render() { const { popoverPos, onClose, value, expression, extra } = this.props; const type = this.getPreviewType(value); return _react2.default.createElement( _Popover2.default, { targetPosition: popoverPos, onMouseLeave: onClose, type: type }, this.renderPreview(expression, value, extra) ); } } exports.Popup = Popup; const { addExpression, selectSourceURL, selectLocation, loadObjectProperties, openLink } = _actions2.default; exports.default = (0, _reactRedux.connect)(state => ({ loadedObjects: (0, _selectors.getLoadedObjects)(state) }), { addExpression, selectSourceURL, selectLocation, loadObjectProperties, openLink })(Popup); /***/ }), /* 1560 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // Dependencies const React = __webpack_require__(0); const { getGripType, wrapRender } = __webpack_require__(1353); // Shortcuts const { span } = React.DOM; /** * Renders undefined value */ const Undefined = function () { return span({ className: "objectBox objectBox-undefined" }, "undefined"); }; function supportsObject(object, noGrip = false) { if (noGrip === true) { return false; } return object && object.type && object.type == "undefined" || getGripType(object, noGrip) == "undefined"; } // Exports from this module module.exports = { rep: wrapRender(Undefined), supportsObject }; /***/ }), /* 1561 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // Dependencies const React = __webpack_require__(0); const { wrapRender } = __webpack_require__(1353); // Shortcuts const { span } = React.DOM; /** * Renders null value */ function Null(props) { return span({ className: "objectBox objectBox-null" }, "null"); } function supportsObject(object, noGrip = false) { if (noGrip === true) { return false; } if (object && object.type && object.type == "null") { return true; } return object == null; } // Exports from this module module.exports = { rep: wrapRender(Null), supportsObject }; /***/ }), /* 1562 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // Dependencies const React = __webpack_require__(0); const { escapeString, sanitizeString, isGrip, wrapRender } = __webpack_require__(1353); // Shortcuts const { span } = React.DOM; /** * Renders a long string grip. */ LongStringRep.propTypes = { useQuotes: React.PropTypes.bool, escapeWhitespace: React.PropTypes.bool, style: React.PropTypes.object, cropLimit: React.PropTypes.number.isRequired, member: React.PropTypes.string, object: React.PropTypes.object.isRequired }; function LongStringRep(props) { let { cropLimit, member, object, style, useQuotes = true, escapeWhitespace = true } = props; let { fullText, initial, length } = object; let config = { "data-link-actor-id": object.actor, className: "objectBox objectBox-string" }; if (style) { config.style = style; } let string = member && member.open ? fullText || initial : initial.substring(0, cropLimit); if (string.length < length) { string += "\u2026"; } let formattedString = useQuotes ? escapeString(string, escapeWhitespace) : sanitizeString(string); return span(config, formattedString); } function supportsObject(object, noGrip = false) { if (noGrip === true || !isGrip(object)) { return false; } return object.type === "longString"; } // Exports from this module module.exports = { rep: wrapRender(LongStringRep), supportsObject }; /***/ }), /* 1563 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // Dependencies const React = __webpack_require__(0); const { getGripType, wrapRender } = __webpack_require__(1353); // Shortcuts const { span } = React.DOM; /** * Renders a number */ Number.propTypes = { object: React.PropTypes.oneOfType([React.PropTypes.object, React.PropTypes.number, React.PropTypes.bool]).isRequired }; function Number(props) { let value = props.object; return span({ className: "objectBox objectBox-number" }, stringify(value)); } function stringify(object) { let isNegativeZero = Object.is(object, -0) || object.type && object.type == "-0"; return isNegativeZero ? "-0" : String(object); } function supportsObject(object, noGrip = false) { return ["boolean", "number", "-0"].includes(getGripType(object, noGrip)); } // Exports from this module module.exports = { rep: wrapRender(Number), supportsObject }; /***/ }), /* 1564 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // Dependencies const React = __webpack_require__(0); const { wrapRender } = __webpack_require__(1353); const PropRep = __webpack_require__(1381); const { MODE } = __webpack_require__(1357); // Shortcuts const { span } = React.DOM; const DEFAULT_TITLE = "Object"; /** * Renders an object. An object is represented by a list of its * properties enclosed in curly brackets. */ ObjectRep.propTypes = { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), title: React.PropTypes.string }; function ObjectRep(props) { let object = props.object; let propsArray = safePropIterator(props, object); if (props.mode === MODE.TINY) { const tinyModeItems = []; if (getTitle(props, object) !== DEFAULT_TITLE) { tinyModeItems.push(getTitleElement(props, object)); } else { tinyModeItems.push(span({ className: "objectLeftBrace" }, "{"), propsArray.length > 0 ? span({ key: "more", className: "more-ellipsis", title: "more…" }, "…") : null, span({ className: "objectRightBrace" }, "}")); } return span({ className: "objectBox objectBox-object" }, ...tinyModeItems); } return span({ className: "objectBox objectBox-object" }, getTitleElement(props, object), span({ className: "objectLeftBrace" }, " { "), ...propsArray, span({ className: "objectRightBrace" }, " }")); } function getTitleElement(props, object) { return span({ className: "objectTitle" }, getTitle(props, object)); } function getTitle(props, object) { return props.title || object.class || DEFAULT_TITLE; } function safePropIterator(props, object, max) { max = typeof max === "undefined" ? 3 : max; try { return propIterator(props, object, max); } catch (err) { console.error(err); } return []; } function propIterator(props, object, max) { let isInterestingProp = (type, value) => { // Do not pick objects, it could cause recursion. return type == "boolean" || type == "number" || type == "string" && value; }; // Work around https://bugzilla.mozilla.org/show_bug.cgi?id=945377 if (Object.prototype.toString.call(object) === "[object Generator]") { object = Object.getPrototypeOf(object); } // Object members with non-empty values are preferred since it gives the // user a better overview of the object. let interestingObject = getFilteredObject(object, max, isInterestingProp); if (Object.keys(interestingObject).length < max) { // There are not enough props yet (or at least, not enough props to // be able to know whether we should print "more…" or not). // Let's display also empty members and functions. interestingObject = Object.assign({}, interestingObject, getFilteredObject(object, max - Object.keys(interestingObject).length, (type, value) => !isInterestingProp(type, value))); } let propsArray = getPropsArray(interestingObject, props); if (Object.keys(object).length > max) { propsArray.push(span({ className: "more-ellipsis", title: "more…" }, "…")); } return unfoldProps(propsArray); } function unfoldProps(items) { return items.reduce((res, item, index) => { if (Array.isArray(item)) { res = res.concat(item); } else { res.push(item); } // Interleave commas between elements if (index !== items.length - 1) { res.push(", "); } return res; }, []); } /** * Get an array of components representing the properties of the object * * @param {Object} object * @param {Object} props * @return {Array} Array of PropRep. */ function getPropsArray(object, props) { let propsArray = []; if (!object) { return propsArray; } // Hardcode tiny mode to avoid recursive handling. let mode = MODE.TINY; const objectKeys = Object.keys(object); return objectKeys.map((name, i) => PropRep(Object.assign({}, props, { mode, name, object: object[name], equal: ": " }))); } /** * Get a copy of the object filtered by a given predicate. * * @param {Object} object. * @param {Number} max The maximum length of keys array. * @param {Function} filter Filter the props you want. * @return {Object} the filtered object. */ function getFilteredObject(object, max, filter) { let filteredObject = {}; try { for (let name in object) { if (Object.keys(filteredObject).length >= max) { return filteredObject; } let value; try { value = object[name]; } catch (exc) { continue; } let t = typeof value; if (filter(t, value)) { filteredObject[name] = value; } } } catch (err) { console.error(err); } return filteredObject; } function supportsObject(object) { return true; } // Exports from this module module.exports = { rep: wrapRender(ObjectRep), supportsObject }; /***/ }), /* 1565 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // Dependencies const React = __webpack_require__(0); const { getGripType, wrapRender } = __webpack_require__(1353); // Shortcuts const { span } = React.DOM; /** * Renders a symbol. */ SymbolRep.propTypes = { object: React.PropTypes.object.isRequired }; function SymbolRep(props) { let { className = "objectBox objectBox-symbol", object } = props; let { name } = object; return span({ className }, `Symbol(${name || ""})`); } function supportsObject(object, noGrip = false) { return getGripType(object, noGrip) == "symbol"; } // Exports from this module module.exports = { rep: wrapRender(SymbolRep), supportsObject }; /***/ }), /* 1566 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // Dependencies const React = __webpack_require__(0); const { getGripType, wrapRender } = __webpack_require__(1353); // Shortcuts const { span } = React.DOM; /** * Renders a Infinity object */ InfinityRep.propTypes = { object: React.PropTypes.object.isRequired }; function InfinityRep(props) { const { object } = props; return span({ className: "objectBox objectBox-number" }, object.type); } function supportsObject(object, noGrip = false) { const type = getGripType(object, noGrip); return type == "Infinity" || type == "-Infinity"; } // Exports from this module module.exports = { rep: wrapRender(InfinityRep), supportsObject }; /***/ }), /* 1567 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // Dependencies const React = __webpack_require__(0); const { getGripType, wrapRender } = __webpack_require__(1353); // Shortcuts const { span } = React.DOM; /** * Renders a NaN object */ function NaNRep(props) { return span({ className: "objectBox objectBox-nan" }, "NaN"); } function supportsObject(object, noGrip = false) { return getGripType(object, noGrip) == "NaN"; } // Exports from this module module.exports = { rep: wrapRender(NaNRep), supportsObject }; /***/ }), /* 1568 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // Dependencies const React = __webpack_require__(0); const { wrapRender } = __webpack_require__(1353); const { MODE } = __webpack_require__(1357); // Shortcuts const { span } = React.DOM; /** * Renders an object. An object is represented by a list of its * properties enclosed in curly brackets. */ Accessor.propTypes = { object: React.PropTypes.object.isRequired, mode: React.PropTypes.oneOf(Object.values(MODE)) }; function Accessor(props) { const { object } = props; const accessors = []; if (hasGetter(object)) { accessors.push("Getter"); } if (hasSetter(object)) { accessors.push("Setter"); } const title = accessors.join(" & "); return span({ className: "objectBox objectBox-accessor" }, span({ className: "objectTitle" }, title)); } function hasGetter(object) { return object && object.get && object.get.type !== "undefined"; } function hasSetter(object) { return object && object.set && object.set.type !== "undefined"; } function supportsObject(object, noGrip = false) { if (noGrip !== true && (hasGetter(object) || hasSetter(object))) { return true; } return false; } // Exports from this module module.exports = { rep: wrapRender(Accessor), supportsObject }; /***/ }), /* 1569 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // ReactJS const React = __webpack_require__(0); // Reps const { getGripType, isGrip, wrapRender } = __webpack_require__(1353); const { rep: StringRep } = __webpack_require__(1447); // Shortcuts const { span } = React.DOM; /** * Renders DOM attribute */ Attribute.propTypes = { object: React.PropTypes.object.isRequired }; function Attribute(props) { let { object } = props; let value = object.preview.value; return span({ "data-link-actor-id": object.actor, className: "objectLink-Attr" }, span({ className: "attrTitle" }, getTitle(object)), span({ className: "attrEqual" }, "="), StringRep({ object: value })); } function getTitle(grip) { return grip.preview.nodeName; } // Registration function supportsObject(grip, noGrip = false) { if (noGrip === true || !isGrip(grip)) { return false; } return getGripType(grip, noGrip) == "Attr" && grip.preview; } module.exports = { rep: wrapRender(Attribute), supportsObject }; /***/ }), /* 1570 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // ReactJS const React = __webpack_require__(0); // Reps const { getGripType, isGrip, wrapRender } = __webpack_require__(1353); // Shortcuts const { span } = React.DOM; /** * Used to render JS built-in Date() object. */ DateTime.propTypes = { object: React.PropTypes.object.isRequired }; function DateTime(props) { let grip = props.object; let date; try { date = span({ "data-link-actor-id": grip.actor, className: "objectBox" }, getTitle(grip), span({ className: "Date" }, new Date(grip.preview.timestamp).toISOString())); } catch (e) { date = span({ className: "objectBox" }, "Invalid Date"); } return date; } function getTitle(grip) { return span({ className: "objectTitle" }, grip.class + " "); } // Registration function supportsObject(grip, noGrip = false) { if (noGrip === true || !isGrip(grip)) { return false; } return getGripType(grip, noGrip) == "Date" && grip.preview; } // Exports from this module module.exports = { rep: wrapRender(DateTime), supportsObject }; /***/ }), /* 1571 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // ReactJS const React = __webpack_require__(0); // Reps const { getGripType, isGrip, getURLDisplayString, wrapRender } = __webpack_require__(1353); // Shortcuts const { span } = React.DOM; /** * Renders DOM document object. */ Document.propTypes = { object: React.PropTypes.object.isRequired }; function Document(props) { let grip = props.object; return span({ "data-link-actor-id": grip.actor, className: "objectBox objectBox-object" }, getTitle(grip), span({ className: "objectPropValue" }, getLocation(grip))); } function getLocation(grip) { let location = grip.preview.location; return location ? getURLDisplayString(location) : ""; } function getTitle(grip) { return span({ className: "objectTitle" }, grip.class + " "); } // Registration function supportsObject(object, noGrip = false) { if (noGrip === true || !isGrip(object)) { return false; } return object.preview && getGripType(object, noGrip) == "HTMLDocument"; } // Exports from this module module.exports = { rep: wrapRender(Document), supportsObject }; /***/ }), /* 1572 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // ReactJS const React = __webpack_require__(0); // Reps const { isGrip, wrapRender } = __webpack_require__(1353); const { MODE } = __webpack_require__(1357); const { rep } = __webpack_require__(1409); /** * Renders DOM event objects. */ Event.propTypes = { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func }; function Event(props) { // Use `Object.assign` to keep `props` without changes because: // 1. JSON.stringify/JSON.parse is slow. // 2. Immutable.js is planned for the future. let gripProps = Object.assign({}, props, { title: getTitle(props) }); gripProps.object = Object.assign({}, props.object); gripProps.object.preview = Object.assign({}, props.object.preview); gripProps.object.preview.ownProperties = {}; if (gripProps.object.preview.target) { Object.assign(gripProps.object.preview.ownProperties, { target: gripProps.object.preview.target }); } Object.assign(gripProps.object.preview.ownProperties, gripProps.object.preview.properties); delete gripProps.object.preview.properties; gripProps.object.ownPropertyLength = Object.keys(gripProps.object.preview.ownProperties).length; switch (gripProps.object.class) { case "MouseEvent": gripProps.isInterestingProp = (type, value, name) => { return ["target", "clientX", "clientY", "layerX", "layerY"].includes(name); }; break; case "KeyboardEvent": gripProps.isInterestingProp = (type, value, name) => { return ["target", "key", "charCode", "keyCode"].includes(name); }; break; case "MessageEvent": gripProps.isInterestingProp = (type, value, name) => { return ["target", "isTrusted", "data"].includes(name); }; break; default: gripProps.isInterestingProp = (type, value, name) => { // We want to show the properties in the order they are declared. return Object.keys(gripProps.object.preview.ownProperties).includes(name); }; } return rep(gripProps); } function getTitle(props) { let preview = props.object.preview; let title = preview.type; if (preview.eventKind == "key" && preview.modifiers && preview.modifiers.length) { title = `${title} ${preview.modifiers.join("-")}`; } return title; } // Registration function supportsObject(grip, noGrip = false) { if (noGrip === true || !isGrip(grip)) { return false; } return grip.preview && grip.preview.kind == "DOMEvent"; } // Exports from this module module.exports = { rep: wrapRender(Event), supportsObject }; /***/ }), /* 1573 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // ReactJS const React = __webpack_require__(0); // Reps const { getGripType, isGrip, cropString, wrapRender } = __webpack_require__(1353); const { MODE } = __webpack_require__(1357); // Shortcuts const { span } = React.DOM; /** * This component represents a template for Function objects. */ FunctionRep.propTypes = { object: React.PropTypes.object.isRequired, parameterNames: React.PropTypes.array }; function FunctionRep(props) { let grip = props.object; return span({ "data-link-actor-id": grip.actor, className: "objectBox objectBox-function", // Set dir="ltr" to prevent function parentheses from // appearing in the wrong direction dir: "ltr" }, getTitle(grip, props), getFunctionName(grip, props), "(", ...renderParams(props), ")"); } function getTitle(grip, props) { const { mode } = props; if (mode === MODE.TINY && !grip.isGenerator && !grip.isAsync) { return null; } let title = mode === MODE.TINY ? "" : "function "; if (grip.isGenerator) { title = mode === MODE.TINY ? "* " : "function* "; } if (grip.isAsync) { title = "async" + " " + title; } return span({ className: "objectTitle" }, title); } function getFunctionName(grip, props) { let name = grip.userDisplayName || grip.displayName || grip.name || props.functionName || ""; return cropString(name, 100); } function renderParams(props) { const { parameterNames = [] } = props; return parameterNames.filter(param => param).reduce((res, param, index, arr) => { res.push(span({ className: "param" }, param)); if (index < arr.length - 1) { res.push(span({ className: "delimiter" }, ", ")); } return res; }, []); } // Registration function supportsObject(grip, noGrip = false) { const type = getGripType(grip, noGrip); if (noGrip === true || !isGrip(grip)) { return type == "function"; } return type == "Function"; } // Exports from this module module.exports = { rep: wrapRender(FunctionRep), supportsObject }; /***/ }), /* 1574 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // ReactJS const React = __webpack_require__(0); // Dependencies const { getGripType, isGrip, wrapRender } = __webpack_require__(1353); const PropRep = __webpack_require__(1381); const { MODE } = __webpack_require__(1357); // Shortcuts const { span } = React.DOM; /** * Renders a DOM Promise object. */ PromiseRep.propTypes = { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func }; function PromiseRep(props) { const object = props.object; const { promiseState } = object; const config = { "data-link-actor-id": object.actor, className: "objectBox objectBox-object" }; if (props.mode === MODE.TINY) { let { Rep } = __webpack_require__(1372); return span(config, getTitle(object), span({ className: "objectLeftBrace" }, " { "), Rep({ object: promiseState.state }), span({ className: "objectRightBrace" }, " }")); } const propsArray = getProps(props, promiseState); return span(config, getTitle(object), span({ className: "objectLeftBrace" }, " { "), ...propsArray, span({ className: "objectRightBrace" }, " }")); } function getTitle(object) { return span({ className: "objectTitle" }, object.class); } function getProps(props, promiseState) { const keys = ["state"]; if (Object.keys(promiseState).includes("value")) { keys.push("value"); } return keys.reduce((res, key, i) => { let object = promiseState[key]; res = res.concat(PropRep(Object.assign({}, props, { mode: MODE.TINY, name: `<${key}>`, object, equal: ": ", suppressQuotes: true }))); // Interleave commas between elements if (i !== keys.length - 1) { res.push(", "); } return res; }, []); } // Registration function supportsObject(object, noGrip = false) { if (noGrip === true || !isGrip(object)) { return false; } return getGripType(object, noGrip) == "Promise"; } // Exports from this module module.exports = { rep: wrapRender(PromiseRep), supportsObject }; /***/ }), /* 1575 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // ReactJS const React = __webpack_require__(0); // Reps const { getGripType, isGrip, wrapRender } = __webpack_require__(1353); /** * Renders a grip object with regular expression. */ RegExp.propTypes = { object: React.PropTypes.object.isRequired }; function RegExp(props) { let { object } = props; return React.DOM.span({ "data-link-actor-id": object.actor, className: "objectBox objectBox-regexp regexpSource" }, getSource(object)); } function getSource(grip) { return grip.displayString; } // Registration function supportsObject(object, noGrip = false) { if (noGrip === true || !isGrip(object)) { return false; } return getGripType(object, noGrip) == "RegExp"; } // Exports from this module module.exports = { rep: wrapRender(RegExp), supportsObject }; /***/ }), /* 1576 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // ReactJS const React = __webpack_require__(0); // Reps const { getGripType, isGrip, getURLDisplayString, wrapRender } = __webpack_require__(1353); // Shortcuts const { span } = React.DOM; /** * Renders a grip representing CSSStyleSheet */ StyleSheet.propTypes = { object: React.PropTypes.object.isRequired }; function StyleSheet(props) { let grip = props.object; return span({ "data-link-actor-id": grip.actor, className: "objectBox objectBox-object" }, getTitle(grip), span({ className: "objectPropValue" }, getLocation(grip))); } function getTitle(grip) { let title = "StyleSheet "; return span({ className: "objectBoxTitle" }, title); } function getLocation(grip) { // Embedded stylesheets don't have URL and so, no preview. let url = grip.preview ? grip.preview.url : ""; return url ? getURLDisplayString(url) : ""; } // Registration function supportsObject(object, noGrip = false) { if (noGrip === true || !isGrip(object)) { return false; } return getGripType(object, noGrip) == "CSSStyleSheet"; } // Exports from this module module.exports = { rep: wrapRender(StyleSheet), supportsObject }; /***/ }), /* 1577 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // Dependencies const React = __webpack_require__(0); const { isGrip, cropString, cropMultipleLines, wrapRender } = __webpack_require__(1353); const { MODE } = __webpack_require__(1357); const nodeConstants = __webpack_require__(1449); // Shortcuts const { span } = React.DOM; /** * Renders DOM comment node. */ CommentNode.propTypes = { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])) }; function CommentNode(props) { let { object, mode = MODE.SHORT } = props; let { textContent } = object.preview; if (mode === MODE.TINY) { textContent = cropMultipleLines(textContent, 30); } else if (mode === MODE.SHORT) { textContent = cropString(textContent, 50); } return span({ className: "objectBox theme-comment", "data-link-actor-id": object.actor }, ``); } // Registration function supportsObject(object, noGrip = false) { if (noGrip === true || !isGrip(object)) { return false; } return object.preview && object.preview.nodeType === nodeConstants.COMMENT_NODE; } // Exports from this module module.exports = { rep: wrapRender(CommentNode), supportsObject }; /***/ }), /* 1578 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // ReactJS const React = __webpack_require__(0); // Utils const { isGrip, wrapRender } = __webpack_require__(1353); const { MODE } = __webpack_require__(1357); const nodeConstants = __webpack_require__(1449); const Svg = __webpack_require__(1410); // Shortcuts const { span } = React.DOM; /** * Renders DOM element node. */ ElementNode.propTypes = { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func }; function ElementNode(props) { let { object, mode, onDOMNodeMouseOver, onDOMNodeMouseOut, onInspectIconClick } = props; let elements = getElements(object, mode); let isInTree = object.preview && object.preview.isConnected === true; let baseConfig = { "data-link-actor-id": object.actor, className: "objectBox objectBox-node" }; let inspectIcon; if (isInTree) { if (onDOMNodeMouseOver) { Object.assign(baseConfig, { onMouseOver: _ => onDOMNodeMouseOver(object) }); } if (onDOMNodeMouseOut) { Object.assign(baseConfig, { onMouseOut: onDOMNodeMouseOut }); } if (onInspectIconClick) { inspectIcon = Svg("open-inspector", { element: "a", draggable: false, // TODO: Localize this with "openNodeInInspector" when Bug 1317038 lands title: "Click to select the node in the inspector", onClick: e => onInspectIconClick(object, e) }); } } return span(baseConfig, ...elements, inspectIcon); } function getElements(grip, mode) { let { attributes, nodeName } = grip.preview; const nodeNameElement = span({ className: "tag-name theme-fg-color3" }, nodeName); if (mode === MODE.TINY) { let elements = [nodeNameElement]; if (attributes.id) { elements.push(span({ className: "attr-name theme-fg-color2" }, `#${attributes.id}`)); } if (attributes.class) { elements.push(span({ className: "attr-name theme-fg-color2" }, attributes.class.replace(/(^\s+)|(\s+$)/g, "").split(" ").map(cls => `.${cls}`).join(""))); } return elements; } let attributeKeys = Object.keys(attributes); if (attributeKeys.includes("class")) { attributeKeys.splice(attributeKeys.indexOf("class"), 1); attributeKeys.unshift("class"); } if (attributeKeys.includes("id")) { attributeKeys.splice(attributeKeys.indexOf("id"), 1); attributeKeys.unshift("id"); } const attributeElements = attributeKeys.reduce((arr, name, i, keys) => { let value = attributes[name]; let attribute = span({}, span({ className: "attr-name theme-fg-color2" }, `${name}`), `="`, span({ className: "attr-value theme-fg-color6" }, `${value}`), `"`); return arr.concat([" ", attribute]); }, []); return ["<", nodeNameElement, ...attributeElements, ">"]; } // Registration function supportsObject(object, noGrip = false) { if (noGrip === true || !isGrip(object)) { return false; } return object.preview && object.preview.nodeType === nodeConstants.ELEMENT_NODE; } // Exports from this module module.exports = { rep: wrapRender(ElementNode), supportsObject }; /***/ }), /* 1579 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // ReactJS const React = __webpack_require__(0); // Reps const { isGrip, cropString, wrapRender } = __webpack_require__(1353); const { MODE } = __webpack_require__(1357); const Svg = __webpack_require__(1410); // Shortcuts const DOM = React.DOM; /** * Renders DOM #text node. */ TextNode.propTypes = { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func }; function TextNode(props) { let { object: grip, mode = MODE.SHORT, onDOMNodeMouseOver, onDOMNodeMouseOut, onInspectIconClick } = props; let baseConfig = { "data-link-actor-id": grip.actor, className: "objectBox objectBox-textNode" }; let inspectIcon; let isInTree = grip.preview && grip.preview.isConnected === true; if (isInTree) { if (onDOMNodeMouseOver) { Object.assign(baseConfig, { onMouseOver: _ => onDOMNodeMouseOver(grip) }); } if (onDOMNodeMouseOut) { Object.assign(baseConfig, { onMouseOut: onDOMNodeMouseOut }); } if (onInspectIconClick) { inspectIcon = Svg("open-inspector", { element: "a", draggable: false, // TODO: Localize this with "openNodeInInspector" when Bug 1317038 lands title: "Click to select the node in the inspector", onClick: e => onInspectIconClick(grip, e) }); } } if (mode === MODE.TINY) { return DOM.span(baseConfig, getTitle(grip), inspectIcon); } return DOM.span(baseConfig, getTitle(grip), DOM.span({ className: "nodeValue" }, " ", `"${getTextContent(grip)}"`), inspectIcon); } function getTextContent(grip) { return cropString(grip.preview.textContent); } function getTitle(grip) { const title = "#text"; return DOM.span({}, title); } // Registration function supportsObject(grip, noGrip = false) { if (noGrip === true || !isGrip(grip)) { return false; } return grip.preview && grip.class == "Text"; } // Exports from this module module.exports = { rep: wrapRender(TextNode), supportsObject }; /***/ }), /* 1580 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // ReactJS const React = __webpack_require__(0); // Utils const { getGripType, isGrip, wrapRender } = __webpack_require__(1353); const { MODE } = __webpack_require__(1357); // Shortcuts const { span } = React.DOM; /** * Renders Error objects. */ ErrorRep.propTypes = { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])) }; function ErrorRep(props) { let object = props.object; let preview = object.preview; let name = preview && preview.name ? preview.name : "Error"; let content = props.mode === MODE.TINY ? name : `${name}: ${preview.message}`; if (preview.stack && props.mode !== MODE.TINY) { /* * Since Reps are used in the JSON Viewer, we can't localize * the "Stack trace" label (defined in debugger.properties as * "variablesViewErrorStacktrace" property), until Bug 1317038 lands. */ content = `${content}\nStack trace:\n${preview.stack}`; } return span({ "data-link-actor-id": object.actor, className: "objectBox-stackTrace" }, content); } // Registration function supportsObject(object, noGrip = false) { if (noGrip === true || !isGrip(object)) { return false; } return object.preview && getGripType(object, noGrip) === "Error"; } // Exports from this module module.exports = { rep: wrapRender(ErrorRep), supportsObject }; /***/ }), /* 1581 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // ReactJS const React = __webpack_require__(0); // Reps const { getGripType, isGrip, getURLDisplayString, wrapRender } = __webpack_require__(1353); const { MODE } = __webpack_require__(1357); // Shortcuts const { span } = React.DOM; /** * Renders a grip representing a window. */ WindowRep.propTypes = { // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), object: React.PropTypes.object.isRequired }; function WindowRep(props) { let { mode, object } = props; const config = { "data-link-actor-id": object.actor, className: "objectBox objectBox-Window" }; if (mode === MODE.TINY) { return span(config, getTitle(object)); } return span(config, getTitle(object), " ", span({ className: "objectPropValue" }, getLocation(object))); } function getTitle(object) { let title = object.displayClass || object.class || "Window"; return span({ className: "objectBoxTitle" }, title); } function getLocation(object) { return getURLDisplayString(object.preview.url); } // Registration function supportsObject(object, noGrip = false) { if (noGrip === true || !isGrip(object)) { return false; } return object.preview && getGripType(object, noGrip) == "Window"; } // Exports from this module module.exports = { rep: wrapRender(WindowRep), supportsObject }; /***/ }), /* 1582 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // ReactJS const React = __webpack_require__(0); // Reps const { isGrip, wrapRender } = __webpack_require__(1353); // Shortcuts const { span } = React.DOM; /** * Renders a grip object with textual data. */ ObjectWithText.propTypes = { object: React.PropTypes.object.isRequired }; function ObjectWithText(props) { let grip = props.object; return span({ "data-link-actor-id": grip.actor, className: "objectBox objectBox-" + getType(grip) }, span({ className: "objectPropValue" }, getDescription(grip))); } function getType(grip) { return grip.class; } function getDescription(grip) { return "\"" + grip.preview.text + "\""; } // Registration function supportsObject(grip, noGrip = false) { if (noGrip === true || !isGrip(grip)) { return false; } return grip.preview && grip.preview.kind == "ObjectWithText"; } // Exports from this module module.exports = { rep: wrapRender(ObjectWithText), supportsObject }; /***/ }), /* 1583 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // ReactJS const React = __webpack_require__(0); // Reps const { isGrip, getURLDisplayString, wrapRender } = __webpack_require__(1353); // Shortcuts const { span } = React.DOM; /** * Renders a grip object with URL data. */ ObjectWithURL.propTypes = { object: React.PropTypes.object.isRequired }; function ObjectWithURL(props) { let grip = props.object; return span({ "data-link-actor-id": grip.actor, className: "objectBox objectBox-" + getType(grip) }, getTitle(grip), span({ className: "objectPropValue" }, getDescription(grip))); } function getTitle(grip) { return span({ className: "objectTitle" }, getType(grip) + " "); } function getType(grip) { return grip.class; } function getDescription(grip) { return getURLDisplayString(grip.preview.url); } // Registration function supportsObject(grip, noGrip = false) { if (noGrip === true || !isGrip(grip)) { return false; } return grip.preview && grip.preview.kind == "ObjectWithURL"; } // Exports from this module module.exports = { rep: wrapRender(ObjectWithURL), supportsObject }; /***/ }), /* 1584 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ // Dependencies const React = __webpack_require__(0); const { isGrip, wrapRender } = __webpack_require__(1353); const PropRep = __webpack_require__(1381); const { MODE } = __webpack_require__(1357); // Shortcuts const { span } = React.DOM; /** * Renders an map. A map is represented by a list of its * entries enclosed in curly brackets. */ GripMap.propTypes = { object: React.PropTypes.object, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), isInterestingEntry: React.PropTypes.func, onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func, title: React.PropTypes.string }; function GripMap(props) { let { mode, object } = props; const config = { "data-link-actor-id": object.actor, className: "objectBox objectBox-object" }; if (mode === MODE.TINY) { return span(config, getTitle(props, object)); } let propsArray = safeEntriesIterator(props, object, maxLengthMap.get(mode)); return span(config, getTitle(props, object), span({ className: "objectLeftBrace" }, " { "), ...propsArray, span({ className: "objectRightBrace" }, " }")); } function getTitle(props, object) { let title = props.title || (object && object.class ? object.class : "Map"); return span({ className: "objectTitle" }, title); } function safeEntriesIterator(props, object, max) { max = typeof max === "undefined" ? 3 : max; try { return entriesIterator(props, object, max); } catch (err) { console.error(err); } return []; } function entriesIterator(props, object, max) { // Entry filter. Show only interesting entries to the user. let isInterestingEntry = props.isInterestingEntry || ((type, value) => { return type == "boolean" || type == "number" || type == "string" && value.length != 0; }); let mapEntries = object.preview && object.preview.entries ? object.preview.entries : []; let indexes = getEntriesIndexes(mapEntries, max, isInterestingEntry); if (indexes.length < max && indexes.length < mapEntries.length) { // There are not enough entries yet, so we add uninteresting entries. indexes = indexes.concat(getEntriesIndexes(mapEntries, max - indexes.length, (t, value, name) => { return !isInterestingEntry(t, value, name); })); } let entries = getEntries(props, mapEntries, indexes); if (entries.length < object.preview.size) { // There are some undisplayed entries. Then display "…". entries.push(span({ key: "more", className: "more-ellipsis", title: "more…" }, "…")); } return unfoldEntries(entries); } function unfoldEntries(items) { return items.reduce((res, item, index) => { if (Array.isArray(item)) { res = res.concat(item); } else { res.push(item); } // Interleave commas between elements if (index !== items.length - 1) { res.push(", "); } return res; }, []); } /** * Get entries ordered by index. * * @param {Object} props Component props. * @param {Array} entries Entries array. * @param {Array} indexes Indexes of entries. * @return {Array} Array of PropRep. */ function getEntries(props, entries, indexes) { let { onDOMNodeMouseOver, onDOMNodeMouseOut, onInspectIconClick } = props; // Make indexes ordered by ascending. indexes.sort(function (a, b) { return a - b; }); return indexes.map((index, i) => { let [key, entryValue] = entries[index]; let value = entryValue.value !== undefined ? entryValue.value : entryValue; return PropRep({ name: key, equal: " \u2192 ", object: value, mode: MODE.TINY, onDOMNodeMouseOver, onDOMNodeMouseOut, onInspectIconClick }); }); } /** * Get the indexes of entries in the map. * * @param {Array} entries Entries array. * @param {Number} max The maximum length of indexes array. * @param {Function} filter Filter the entry you want. * @return {Array} Indexes of filtered entries in the map. */ function getEntriesIndexes(entries, max, filter) { return entries.reduce((indexes, [key, entry], i) => { if (indexes.length < max) { let value = entry && entry.value !== undefined ? entry.value : entry; // Type is specified in grip's "class" field and for primitive // values use typeof. let type = (value && value.class ? value.class : typeof value).toLowerCase(); if (filter(type, value, key)) { indexes.push(i); } } return indexes; }, []); } function supportsObject(grip, noGrip = false) { if (noGrip === true || !isGrip(grip)) { return false; } return grip.preview && grip.preview.kind == "MapLike"; } const maxLengthMap = new Map(); maxLengthMap.set(MODE.SHORT, 3); maxLengthMap.set(MODE.LONG, 10); // Exports from this module module.exports = { rep: wrapRender(GripMap), supportsObject, maxLengthMap }; /***/ }), /* 1585 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const { Component, createFactory, DOM: dom, PropTypes } = __webpack_require__(0); const Tree = createFactory(__webpack_require__(1441).Tree); __webpack_require__(1325); const classnames = __webpack_require__(175); const Svg = __webpack_require__(1410); const { REPS: { Rep, Grip } } = __webpack_require__(1372); const { MODE } = __webpack_require__(1357); const { getChildren, getParent, getValue, nodeHasAccessors, nodeHasAllEntriesInPreview, nodeHasProperties, nodeIsDefaultProperties, nodeIsEntries, nodeIsGetter, nodeIsMapEntry, nodeIsFunction, nodeIsMissingArguments, nodeIsOptimizedOut, nodeIsPrimitive, nodeIsPrototype, nodeIsSetter, nodeIsWindow } = __webpack_require__(1452); // This implements a component that renders an interactive inspector // for looking at JavaScript objects. It expects descriptions of // objects from the protocol, and will dynamically fetch child // properties as objects are expanded. // // If you want to inspect a single object, pass the name and the // protocol descriptor of it: // // ObjectInspector({ // name: "foo", // desc: { writable: true, ..., { value: { actor: "1", ... }}}, // ... // }) // // If you want multiple top-level objects (like scopes), you can pass // an array of manually constructed nodes as `roots`: // // ObjectInspector({ // roots: [{ name: ... }, ...], // ... // }); // There are 3 types of nodes: a simple node with a children array, an // object that has properties that should be children when they are // fetched, and a primitive value that should be displayed with no // children. class ObjectInspector extends Component { constructor() { super(); this.actors = {}; this.state = { expandedKeys: new Set(), focusedItem: null }; const self = this; self.getChildren = this.getChildren.bind(this); self.renderTreeItem = this.renderTreeItem.bind(this); self.setExpanded = this.setExpanded.bind(this); self.focusItem = this.focusItem.bind(this); self.getRoots = this.getRoots.bind(this); } getChildren(item) { const { getObjectEntries, getObjectProperties } = this.props; const { actors } = this; return getChildren({ getObjectEntries, getObjectProperties, actors, item }); } getRoots() { return this.props.roots; } getKey(item) { return item.path; } setExpanded(item, expand) { const { expandedKeys } = this.state; const key = this.getKey(item); if (expand === true) { expandedKeys.add(key); } else { expandedKeys.delete(key); } this.setState({ expandedKeys }); if (expand === true) { const { getObjectProperties, getObjectEntries, loadObjectProperties, loadObjectEntries } = this.props; const value = getValue(item); const parent = getParent(item); const parentValue = getValue(parent); const parentActor = parentValue ? parentValue.actor : null; if (nodeHasProperties(item) && value && !getObjectProperties(value.actor)) { loadObjectProperties(value); } if (nodeIsEntries(item) && !nodeHasAllEntriesInPreview(parent) && parentActor && !getObjectEntries(parentActor)) { loadObjectEntries(parentValue); } } } focusItem(item) { if (!this.props.disabledFocus && this.state.focusedItem !== item) { this.setState({ focusedItem: item }); if (this.props.onFocus) { this.props.onFocus(item); } } } renderTreeItem(item, depth, focused, arrow, expanded) { let objectValue; let label = item.name; let itemValue = getValue(item); const isPrimitive = nodeIsPrimitive(item); const unavailable = isPrimitive && itemValue && itemValue.hasOwnProperty && itemValue.hasOwnProperty("unavailable"); if (nodeIsOptimizedOut(item)) { objectValue = dom.span({ className: "unavailable" }, "(optimized away)"); } else if (nodeIsMissingArguments(item) || unavailable) { objectValue = dom.span({ className: "unavailable" }, "(unavailable)"); } else if (nodeIsFunction(item) && !nodeIsGetter(item) && !nodeIsSetter(item) && (this.props.mode === MODE.TINY || !this.props.mode)) { objectValue = undefined; label = this.renderGrip(item, Object.assign({}, this.props, { functionName: label })); } else if (nodeHasProperties(item) || nodeHasAccessors(item) || nodeIsMapEntry(item) || isPrimitive) { let repsProp = Object.assign({}, this.props); if (depth > 0) { repsProp.mode = this.props.mode === MODE.LONG ? MODE.SHORT : MODE.TINY; } objectValue = this.renderGrip(item, repsProp); } const hasLabel = label !== null && typeof label !== "undefined"; const hasValue = typeof objectValue !== "undefined"; const SINGLE_INDENT_WIDTH = 15; const indentWidth = (depth + (isPrimitive ? 1 : 0)) * SINGLE_INDENT_WIDTH; const { onDoubleClick, onLabelClick, dimTopLevelWindow } = this.props; return dom.div({ className: classnames("node object-node", { focused, lessen: !expanded && (nodeIsDefaultProperties(item) || nodeIsPrototype(item) || dimTopLevelWindow === true && nodeIsWindow(item) && depth === 0) }), style: { marginLeft: indentWidth }, onClick: isPrimitive === false ? e => { e.stopPropagation(); this.setExpanded(item, !expanded); } : null, onDoubleClick: onDoubleClick ? e => { e.stopPropagation(); onDoubleClick(item, { depth, focused, expanded }); } : null }, isPrimitive === false ? Svg("arrow", { className: classnames({ expanded: expanded }) }) : null, hasLabel ? dom.span({ className: "object-label", onClick: onLabelClick ? event => { event.stopPropagation(); onLabelClick(item, { depth, focused, expanded, setExpanded: this.setExpanded }); } : null }, label) : null, hasLabel && hasValue ? dom.span({ className: "object-delimiter" }, " : ") : null, hasValue ? objectValue : null); } renderGrip(item, props) { const object = getValue(item); return Rep(Object.assign({}, props, { object, mode: props.mode || MODE.TINY, defaultRep: Grip })); } render() { const { autoExpandDepth = 1, autoExpandAll = true, disabledFocus, inline, itemHeight = 20, disableWrap = false } = this.props; const { expandedKeys, focusedItem } = this.state; let roots = this.getRoots(); if (roots.length === 1) { const root = roots[0]; const name = root && root.name; if (nodeIsPrimitive(root) && (name === null || typeof name === "undefined")) { return this.renderGrip(root, this.props); } } return Tree({ className: classnames({ inline, nowrap: disableWrap }), autoExpandAll, autoExpandDepth, disabledFocus, itemHeight, isExpanded: item => expandedKeys.has(this.getKey(item)), focused: focusedItem, getRoots: this.getRoots, getParent, getChildren: this.getChildren, getKey: this.getKey, onExpand: item => this.setExpanded(item, true), onCollapse: item => this.setExpanded(item, false), onFocus: this.focusItem, renderItem: this.renderTreeItem }); } } ObjectInspector.displayName = "ObjectInspector"; ObjectInspector.propTypes = { autoExpandAll: PropTypes.bool, autoExpandDepth: PropTypes.number, disabledFocus: PropTypes.bool, disableWrap: PropTypes.bool, inline: PropTypes.bool, roots: PropTypes.array, getObjectProperties: PropTypes.func.isRequired, loadObjectProperties: PropTypes.func.isRequired, itemHeight: PropTypes.number, mode: PropTypes.oneOf(Object.values(MODE)), onFocus: PropTypes.func, onDoubleClick: PropTypes.func, onLabelClick: PropTypes.func }; module.exports = ObjectInspector; /***/ }), /* 1586 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactDom = __webpack_require__(4); var _reactDom2 = _interopRequireDefault(_reactDom); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _BracketArrow = __webpack_require__(1587); var _BracketArrow2 = _interopRequireDefault(_BracketArrow); __webpack_require__(1327); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Popover extends _react.Component { constructor() { super(); this.onMouseLeave = this.onMouseLeave.bind(this); this.state = { left: 0, top: 0 }; } componentDidMount() { const { type } = this.props; const { left, top, orientation, targetMid } = type == "popover" ? this.getPopoverCoords() : this.getTooltipCoords(); // eslint-disable-next-line react/no-did-mount-set-state this.setState({ left, top, orientation, targetMid }); } calculateLeft(target, editor, popover) { const estimatedLeft = target.left; const estimatedRight = estimatedLeft + popover.width; const isOverflowingRight = estimatedRight > editor.right; if (isOverflowingRight) { const adjustedLeft = editor.right - popover.width - 8; return adjustedLeft; } return estimatedLeft; } calculateVerticalOrientation(target, editor, popover) { const estimatedBottom = target.bottom + popover.height; return estimatedBottom > editor.bottom ? "up" : "down"; } getPopoverCoords() { const popover = _reactDom2.default.findDOMNode(this); const popoverRect = popover.getBoundingClientRect(); const editor = document.querySelector(".editor-wrapper"); const editorRect = editor.getBoundingClientRect(); const targetRect = this.props.targetPosition; const popoverLeft = this.calculateLeft(targetRect, editorRect, popoverRect); const orientation = this.calculateVerticalOrientation(targetRect, editorRect, popoverRect); const top = orientation == "down" ? targetRect.bottom : targetRect.top - popoverRect.height; const targetMid = targetRect.left - popoverLeft + targetRect.width / 2 - 8; return { left: popoverLeft, top, orientation, targetMid }; } getTooltipCoords() { const tooltip = _reactDom2.default.findDOMNode(this); const tooltipRect = tooltip.getBoundingClientRect(); const targetRect = this.props.targetPosition; const editor = document.querySelector(".editor-wrapper"); const editorRect = editor.getBoundingClientRect(); const left = this.calculateLeft(targetRect, editorRect, tooltipRect); const top = targetRect.top - tooltipRect.height; return { left, top, orientation: "up", targetMid: 0 }; } getChildren() { const { children } = this.props; const { orientation } = this.state; const gap = _react2.default.createElement("div", { className: "gap", key: "gap" }); return orientation === "up" ? [children, gap] : [gap, children]; } getPopoverArrow(orientation, left) { const arrowOrientation = orientation === "up" ? "down" : "up"; const arrowProp = arrowOrientation === "up" ? "top" : "bottom"; const arrowPropValue = arrowOrientation === "up" ? -7 : 5; const arrowProps = { orientation: arrowOrientation, left, [arrowProp]: arrowPropValue }; return _react2.default.createElement(_BracketArrow2.default, arrowProps); } onMouseLeave(e) { const { onMouseLeave } = this.props; if (e.target.className.match(/(bracket-arrow|gap)/)) { return; } onMouseLeave(); } renderPopover() { const { top, left, orientation, targetMid } = this.state; const arrow = this.getPopoverArrow(orientation, targetMid); return _react2.default.createElement( "div", { className: (0, _classnames2.default)("popover", { up: orientation === "up" }), onMouseLeave: this.onMouseLeave, style: { top, left } }, arrow, this.getChildren() ); } renderTooltip() { const { onMouseLeave } = this.props; const { top, left } = this.state; return _react2.default.createElement( "div", { className: "tooltip", onMouseLeave: onMouseLeave, style: { top, left } }, this.getChildren() ); } render() { const { type } = this.props; if (type === "tooltip") { return this.renderTooltip(); } return this.renderPopover(); } } /* 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 . */ Popover.defaultProps = { onMouseLeave: () => {}, type: "popover" }; exports.default = Popover; /***/ }), /* 1587 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); __webpack_require__(1326); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const BracketArrow = ({ orientation, left, top, bottom }) => { return _react2.default.createElement("div", { className: (0, _classnames2.default)("bracket-arrow", orientation || "up"), style: { left, top, bottom } }); }; /* 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 . */ exports.default = BracketArrow; /***/ }), /* 1588 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _reactRedux = __webpack_require__(1189); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _Breakpoint = __webpack_require__(1589); var _Breakpoint2 = _interopRequireDefault(_Breakpoint); var _selectors = __webpack_require__(1352); var _visibleBreakpoints = __webpack_require__(1427); var _visibleBreakpoints2 = _interopRequireDefault(_visibleBreakpoints); var _breakpoint = __webpack_require__(1364); var _source = __webpack_require__(1356); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Breakpoints extends _react.Component { shouldComponentUpdate(nextProps) { if (nextProps.selectedSource && !(0, _source.isLoaded)(nextProps.selectedSource)) { return false; } return true; } render() { const { breakpoints, selectedSource, editor } = this.props; if (!selectedSource || !breakpoints || selectedSource.get("isBlackBoxed")) { return null; } return _react2.default.createElement( "div", null, breakpoints.valueSeq().map(bp => { return _react2.default.createElement(_Breakpoint2.default, { key: (0, _breakpoint.makeLocationId)(bp.location), breakpoint: bp, selectedSource: selectedSource, editor: editor }); }) ); } } /* 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 . */ exports.default = (0, _reactRedux.connect)(state => ({ breakpoints: (0, _visibleBreakpoints2.default)(state), selectedSource: (0, _selectors.getSelectedSource)(state) }))(Breakpoints); /***/ }), /* 1589 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _devtoolsConfig = __webpack_require__(1355); var _reactDom = __webpack_require__(4); var _reactDom2 = _interopRequireDefault(_reactDom); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _Svg = __webpack_require__(1359); var _Svg2 = _interopRequireDefault(_Svg); var _editor = __webpack_require__(1358); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ const breakpointSvg = document.createElement("div"); _reactDom2.default.render(_react2.default.createElement(_Svg2.default, { name: "breakpoint" }), breakpointSvg); function makeMarker(isDisabled) { const bp = breakpointSvg.cloneNode(true); bp.className = (0, _classnames2.default)("editor new-breakpoint", { "breakpoint-disabled": isDisabled, "folding-enabled": (0, _devtoolsConfig.isEnabled)("codeFolding") }); return bp; } class Breakpoint extends _react.Component { constructor() { super(); this.addBreakpoint = this.addBreakpoint.bind(this); } addBreakpoint() { const { breakpoint, editor, selectedSource } = this.props; // Hidden Breakpoints are never rendered on the client if (breakpoint.hidden) { return; } // NOTE: we need to wait for the breakpoint to be loaded // to get the generated location if (!selectedSource || breakpoint.loading) { return; } const sourceId = selectedSource.get("id"); const line = (0, _editor.toEditorLine)(sourceId, breakpoint.location.line); editor.codeMirror.setGutterMarker(line, "breakpoints", makeMarker(breakpoint.disabled)); editor.codeMirror.addLineClass(line, "line", "new-breakpoint"); if (breakpoint.condition) { editor.codeMirror.addLineClass(line, "line", "has-condition"); } else { editor.codeMirror.removeLineClass(line, "line", "has-condition"); } } shouldComponentUpdate(nextProps) { const { editor, breakpoint, selectedSource } = this.props; return editor !== nextProps.editor || breakpoint.disabled !== nextProps.breakpoint.disabled || breakpoint.hidden !== nextProps.breakpoint.hidden || breakpoint.condition !== nextProps.breakpoint.condition || breakpoint.loading !== nextProps.breakpoint.loading || selectedSource !== nextProps.selectedSource; } componentDidMount() { this.addBreakpoint(); } componentDidUpdate() { this.addBreakpoint(); } componentWillUnmount() { const { editor, breakpoint, selectedSource } = this.props; if (!selectedSource) { return; } if (breakpoint.loading) { return; } const sourceId = selectedSource.get("id"); const doc = (0, _editor.getDocument)(sourceId); if (!doc) { return; } const line = (0, _editor.toEditorLine)(sourceId, breakpoint.location.line); // NOTE: when we upgrade codemirror we can use `doc.setGutterMarker` if (doc.setGutterMarker) { doc.setGutterMarker(line, "breakpoints", null); } else { editor.codeMirror.setGutterMarker(line, "breakpoints", null); } doc.removeLineClass(line, "line", "new-breakpoint"); doc.removeLineClass(line, "line", "has-condition"); } render() { return null; } } exports.default = Breakpoint; /***/ }), /* 1590 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); const markerEl = document.createElement("div"); /* 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 . */ function makeMarker() { const marker = markerEl.cloneNode(true); marker.className = "editor hit-marker"; return marker; } class HitMarker extends _react.Component { addMarker() { const hitData = this.props.hitData; const line = hitData.line - 1; this.props.editor.setGutterMarker(line, "hit-markers", makeMarker()); this.props.editor.addLineClass(line, "line", "hit-marker"); } shouldComponentUpdate(nextProps) { return this.props.editor !== nextProps.editor || this.props.hitData !== nextProps.hitData; } componentDidMount() { this.addMarker(); } componentDidUpdate() { this.addMarker(); } componentWillUnmount() { const hitData = this.props.hitData; const line = hitData.line - 1; this.props.editor.setGutterMarker(line, "hit-markers", null); this.props.editor.removeLineClass(line, "line", "hit-marker"); } render() { return null; } } exports.default = HitMarker; /***/ }), /* 1591 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _lodash = __webpack_require__(2); var _CallSite = __webpack_require__(1592); var _CallSite2 = _interopRequireDefault(_CallSite); var _selectors = __webpack_require__(1352); var _editor = __webpack_require__(1358); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function getCallSiteAtLocation(callSites, location) { return callSites.find(callSite => (0, _lodash.isEqualWith)(callSite.location, location, (cloc, loc) => { return loc.line === cloc.start.line && loc.column >= cloc.start.column && loc.column <= cloc.end.column; })); } class CallSites extends _react.Component { constructor(props) { super(props); this.onKeyDown = this.onKeyDown.bind(this); this.onKeyUp = this.onKeyUp.bind(this); this.state = { showCallSites: false }; } componentDidMount() { const { editor } = this.props; const codeMirrorWrapper = editor.codeMirror.getWrapperElement(); codeMirrorWrapper.addEventListener("click", e => this.onTokenClick(e)); document.body.addEventListener("keydown", this.onKeyDown); document.body.addEventListener("keyup", this.onKeyUp); } componentWillUnmount() { const { editor } = this.props; const codeMirrorWrapper = editor.codeMirror.getWrapperElement(); codeMirrorWrapper.removeEventListener("click", e => this.onTokenClick(e)); document.body.removeEventListener("keydown", this.onKeyDown); document.body.removeEventListener("keyup", this.onKeyUp); } onKeyUp(e) { if (e.key === "Alt") { e.preventDefault(); this.setState({ showCallSites: false }); } } onKeyDown(e) { if (e.key === "Alt") { e.preventDefault(); this.setState({ showCallSites: true }); } } onTokenClick(e) { const { target } = e; const { editor, selectedLocation } = this.props; if (!e.altKey && !target.classList.contains("call-site-bp") || !target.classList.contains("call-site") && !target.classList.contains("call-site-bp")) { return; } const { sourceId } = selectedLocation; const { line, column } = (0, _editor.getTokenLocation)(editor.codeMirror, target); this.toggleBreakpoint(line, (0, _editor.isWasm)(sourceId) ? undefined : column); } toggleBreakpoint(line, column = undefined) { const { selectedSource, selectedLocation, addBreakpoint, removeBreakpoint, callSites } = this.props; const callSite = getCallSiteAtLocation(callSites, { line, column }); if (!callSite) { return; } const bp = callSite.breakpoint; if (bp && bp.loading || !selectedLocation || !selectedSource) { return; } const { sourceId } = selectedLocation; if (bp) { // NOTE: it's possible the breakpoint has slid to a column column = column || bp.location.column; removeBreakpoint({ sourceId: sourceId, line: line, column }); } else { addBreakpoint({ sourceId: sourceId, sourceUrl: selectedSource.get("url"), line: line, column: column }); } } render() { const { editor, callSites, selectedSource } = this.props; const { showCallSites } = this.state; let sites; if (!callSites) { return null; } editor.codeMirror.operation(() => { const childCallSites = callSites.map((callSite, index) => { const props = { key: index, callSite, editor, source: selectedSource, breakpoint: callSite.breakpoint, showCallSite: showCallSites }; return _react2.default.createElement(_CallSite2.default, props); }); sites = _react2.default.createElement( "div", null, childCallSites ); }); return sites; } } function getCallSites(symbols, breakpoints) { if (!symbols || !symbols.callExpressions) { return; } const callSites = symbols.callExpressions; // NOTE: we create a breakpoint map keyed on location // to speed up the lookups. Hopefully we'll fix the // inconsistency with column offsets so that we can expect // a breakpoint to be added at the beginning of a call expression. const bpLocationMap = (0, _lodash.keyBy)(breakpoints.valueSeq().toJS(), ({ location }) => locationKey(location)); function locationKey({ line, column }) { return `${line}/${column}`; } function findBreakpoint(callSite) { const { location: { start, end } } = callSite; const breakpointId = (0, _lodash.range)(start.column - 1, end.column).map(column => locationKey({ line: start.line, column })).find(key => bpLocationMap[key]); if (breakpointId) { return bpLocationMap[breakpointId]; } } return callSites.filter(({ location }) => location.start.line === location.end.line).map(callSite => _extends({}, callSite, { breakpoint: findBreakpoint(callSite) })); } const { addBreakpoint, removeBreakpoint } = _actions2.default; exports.default = (0, _reactRedux.connect)(state => { const selectedLocation = (0, _selectors.getSelectedLocation)(state); const selectedSource = (0, _selectors.getSelectedSource)(state); const sourceId = selectedLocation && selectedLocation.sourceId; const source = selectedSource && selectedSource.toJS(); const symbols = (0, _selectors.getSymbols)(state, source); const breakpoints = (0, _selectors.getBreakpointsForSource)(state, sourceId); return { selectedLocation, selectedSource, callSites: getCallSites(symbols, breakpoints), breakpoints: breakpoints }; }, { addBreakpoint, removeBreakpoint })(CallSites); /***/ }), /* 1592 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _editor = __webpack_require__(1358); /* 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 . */ __webpack_require__(1329); class CallSite extends _react.Component { constructor() { super(); this.addCallSite = nextProps => { const { editor, callSite, breakpoint, source } = nextProps || this.props; const className = !breakpoint ? "call-site" : "call-site-bp"; const sourceId = source.get("id"); const editorRange = (0, _editor.toEditorRange)(sourceId, callSite.location); this.marker = (0, _editor.markText)(editor, className, editorRange); }; this.clearCallSite = () => { if (this.marker) { this.marker.clear(); this.marker = null; } }; this.marker = undefined; } shouldComponentUpdate(nextProps) { return this.props.editor !== nextProps.editor; } componentDidMount() { const { breakpoint, showCallSite } = this.props; if (!breakpoint && !showCallSite) { return; } this.addCallSite(); } componentWillReceiveProps(nextProps) { const { breakpoint, showCallSite } = this.props; if (nextProps.breakpoint !== breakpoint) { if (this.marker) { this.clearCallSite(); } if (nextProps.showCallSite) { this.addCallSite(nextProps); } } if (nextProps.showCallSite !== showCallSite) { if (nextProps.showCallSite) { if (!this.marker) { this.addCallSite(); } } else if (!nextProps.breakpoint) { this.clearCallSite(); } } } componentWillUnmount() { if (!this.marker) { return; } this.marker.clear(); } render() { return null; } } exports.default = CallSite; /***/ }), /* 1593 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DebugLine = undefined; var _react = __webpack_require__(0); var _editor = __webpack_require__(1358); var _source = __webpack_require__(1356); var _reactRedux = __webpack_require__(1189); var _selectors = __webpack_require__(1352); function isException(pauseInfo) { return pauseInfo && pauseInfo.why.type === "exception"; } /* 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 . */ function isDocumentReady(selectedSource, selectedFrame) { return selectedFrame && (0, _source.isLoaded)(selectedSource) && (0, _editor.hasDocument)(selectedFrame.location.sourceId); } class DebugLine extends _react.Component { componentDidUpdate(prevProps) { const { pauseInfo, selectedFrame, selectedSource } = this.props; this.setDebugLine(pauseInfo, selectedFrame, selectedSource); } componentWillUpdate() { const { pauseInfo, selectedFrame, selectedSource } = this.props; this.clearDebugLine(selectedFrame, selectedSource, pauseInfo); } componentDidMount() { const { pauseInfo, selectedFrame, selectedSource } = this.props; this.setDebugLine(pauseInfo, selectedFrame, selectedSource); } setDebugLine(pauseInfo, selectedFrame, selectedSource) { if (!isDocumentReady(selectedSource, selectedFrame)) { return; } const sourceId = selectedFrame.location.sourceId; const doc = (0, _editor.getDocument)(sourceId); const { line, column } = (0, _editor.toEditorPosition)(selectedFrame.location); const { markTextClass, lineClass } = this.getTextClasses(pauseInfo); doc.addLineClass(line, "line", lineClass); this.debugExpression = doc.markText({ ch: column, line }, { ch: null, line }, { className: markTextClass }); } clearDebugLine(selectedFrame, selectedSource, pause) { if (!isDocumentReady(selectedSource, selectedFrame)) { return; } if (this.debugExpression) { this.debugExpression.clear(); } const sourceId = selectedFrame.location.sourceId; const { line } = (0, _editor.toEditorPosition)(selectedFrame.location); const doc = (0, _editor.getDocument)(sourceId); const { lineClass } = this.getTextClasses(pause); doc.removeLineClass(line, "line", lineClass); } getTextClasses(pause) { if (isException(pause)) { return { markTextClass: "debug-expression-error", lineClass: "new-debug-line-error" }; } return { markTextClass: "debug-expression", lineClass: "new-debug-line" }; } render() { return null; } } exports.DebugLine = DebugLine; exports.default = (0, _reactRedux.connect)(state => { return { selectedFrame: (0, _selectors.getVisibleSelectedFrame)(state), selectedSource: (0, _selectors.getSelectedSource)(state), pauseInfo: (0, _selectors.getPause)(state) }; })(DebugLine); /***/ }), /* 1594 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _reactRedux = __webpack_require__(1189); var _react = __webpack_require__(0); var _selectors = __webpack_require__(1352); var _editor = __webpack_require__(1358); __webpack_require__(1330); class EmptyLines extends _react.Component { componentDidMount() { this.disableEmptyLines(); } componentDidUpdate() { this.disableEmptyLines(); } componentWillUnmount() { const { emptyLines, selectedSource, editor } = this.props; if (!emptyLines) { return; } editor.codeMirror.operation(() => { emptyLines.forEach(emptyLine => { const line = (0, _editor.toEditorLine)(selectedSource.get("id"), emptyLine); editor.codeMirror.removeLineClass(line, "line", "empty-line"); }); }); } disableEmptyLines() { const { emptyLines, selectedSource, editor } = this.props; if (!emptyLines) { return; } editor.codeMirror.operation(() => { emptyLines.forEach(emptyLine => { const line = (0, _editor.toEditorLine)(selectedSource.get("id"), emptyLine); editor.codeMirror.addLineClass(line, "line", "empty-line"); }); }); } render() { return null; } } /* 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 . */ exports.default = (0, _reactRedux.connect)(state => { const selectedSource = (0, _selectors.getSelectedSource)(state); return { selectedSource, emptyLines: selectedSource ? (0, _selectors.getEmptyLines)(state, selectedSource.toJS()) : [] }; })(EmptyLines); /***/ }), /* 1595 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ exports.gutterMenu = gutterMenu; var _react = __webpack_require__(0); var _devtoolsContextmenu = __webpack_require__(1413); var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(1189); var _editor = __webpack_require__(1358); var _selectors = __webpack_require__(1352); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } function gutterMenu({ breakpoint, line, event, pauseData, toggleBreakpoint, openConditionalPanel, toggleDisabledBreakpoint, isCbPanelOpen, closeConditionalPanel, continueToHere }) { event.stopPropagation(); event.preventDefault(); const gutterItems = { addBreakpoint: { id: "node-menu-add-breakpoint", label: L10N.getStr("editor.addBreakpoint") }, addConditional: { id: "node-menu-add-conditional-breakpoint", label: L10N.getStr("editor.addConditionalBreakpoint") }, removeBreakpoint: { id: "node-menu-remove-breakpoint", label: L10N.getStr("editor.removeBreakpoint") }, editConditional: { id: "node-menu-edit-conditional-breakpoint", label: L10N.getStr("editor.editBreakpoint") }, enableBreakpoint: { id: "node-menu-enable-breakpoint", label: L10N.getStr("editor.enableBreakpoint") }, disableBreakpoint: { id: "node-menu-disable-breakpoint", label: L10N.getStr("editor.disableBreakpoint") }, continueToHere: { id: "node-menu-continue-to-here", label: L10N.getStr("editor.continueToHere.label") } }; const toggleBreakpointItem = _extends({ accesskey: L10N.getStr("shortcuts.toggleBreakpoint.accesskey"), disabled: false, click: () => { toggleBreakpoint(line); if (isCbPanelOpen) { closeConditionalPanel(); } } }, breakpoint ? gutterItems.removeBreakpoint : gutterItems.addBreakpoint); const conditionalBreakpoint = _extends({ accesskey: L10N.getStr("editor.addConditionalBreakpoint.accesskey"), disabled: false, click: () => openConditionalPanel(line) }, breakpoint && breakpoint.condition ? gutterItems.editConditional : gutterItems.addConditional); const items = [toggleBreakpointItem, conditionalBreakpoint]; if (pauseData) { const continueToHereItem = _extends({ accesskey: L10N.getStr("editor.continueToHere.accesskey"), disabled: false, click: () => continueToHere(line) }, gutterItems.continueToHere); items.push(continueToHereItem); } if (breakpoint) { const disableBreakpoint = _extends({ accesskey: L10N.getStr("editor.disableBreakpoint.accesskey"), disabled: false, click: () => toggleDisabledBreakpoint(line) }, breakpoint.disabled ? gutterItems.enableBreakpoint : gutterItems.disableBreakpoint); items.push(disableBreakpoint); } (0, _devtoolsContextmenu.showMenu)(event, items); } class GutterContextMenuComponent extends _react.PureComponent { constructor() { super(); } shouldComponentUpdate(nextProps) { return nextProps.contextMenu.type === "Gutter"; } componentWillUpdate(nextProps) { // clear the context menu since it is open this.props.setContextMenu("", null); return this.showMenu(nextProps); } showMenu(nextProps) { const { contextMenu } = nextProps, props = _objectWithoutProperties(nextProps, ["contextMenu"]); const { event } = contextMenu; const sourceId = props.selectedSource ? props.selectedSource.get("id") : ""; const line = (0, _editor.lineAtHeight)(props.editor, sourceId, event); const breakpoint = nextProps.breakpoints.find(bp => bp.location.line === line); if (props.emptyLines.includes(line)) { return; } gutterMenu(_extends({ event, sourceId, line, breakpoint }, props)); } render() { return null; } } exports.default = (0, _reactRedux.connect)(state => { const selectedSource = (0, _selectors.getSelectedSource)(state); return { selectedLocation: (0, _selectors.getSelectedLocation)(state), selectedSource: selectedSource, breakpoints: (0, _selectors.getVisibleBreakpoints)(state), pauseData: (0, _selectors.getPause)(state), contextMenu: (0, _selectors.getContextMenu)(state), emptyLines: selectedSource ? (0, _selectors.getEmptyLines)(state, selectedSource.toJS()) : [] }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(GutterContextMenuComponent); /***/ }), /* 1596 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _reactRedux = __webpack_require__(1189); var _devtoolsLaunchpad = __webpack_require__(1362); var _devtoolsSourceMap = __webpack_require__(1360); var _clipboard = __webpack_require__(1388); var _function = __webpack_require__(1597); var _astBreakpointLocation = __webpack_require__(1416); var _editor = __webpack_require__(1358); var _source = __webpack_require__(1356); var _selectors = __webpack_require__(1352); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } /* 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 . */ function getMenuItems(event, { addExpression, editor, flashLineRange, getFunctionLocation, getFunctionText, hasPrettyPrint, jumpToMappedLocation, onGutterContextMenu, selectedLocation, selectedSource, showSource, toggleBlackBox }) { // variables const hasSourceMap = !!selectedSource.get("sourceMapURL"); const isOriginal = (0, _devtoolsSourceMap.isOriginalId)(selectedLocation.sourceId); const isPrettyPrinted = (0, _source.isPretty)(selectedSource); const isPrettified = isPrettyPrinted || hasPrettyPrint; const isMapped = isOriginal || hasSourceMap; const { line } = editor.codeMirror.coordsChar({ left: event.clientX, top: event.clientY }); const selectionText = editor.codeMirror.getSelection().trim(); const sourceLocation = (0, _editor.getSourceLocationFromMouseEvent)(editor, selectedLocation, event); const textSelected = editor.codeMirror.somethingSelected(); // localizations const blackboxKey = L10N.getStr("sourceFooter.blackbox.accesskey"); const blackboxLabel = L10N.getStr("sourceFooter.blackbox"); const unblackboxLabel = L10N.getStr("sourceFooter.unblackbox"); const toggleBlackBoxLabel = selectedSource.get("isBlackBoxed") ? unblackboxLabel : blackboxLabel; const copyFunctionKey = L10N.getStr("copyFunction.accesskey"); const copyFunctionLabel = L10N.getStr("copyFunction.label"); const copySourceKey = L10N.getStr("copySource.accesskey"); const copySourceLabel = L10N.getStr("copySource"); const copySourceUri2Key = L10N.getStr("copySourceUri2.accesskey"); const copySourceUri2Label = L10N.getStr("copySourceUri2"); const jumpToMappedLocKey = L10N.getStr("editor.jumpToMappedLocation1.accesskey"); const jumpToMappedLocLabel = L10N.getFormatStr("editor.jumpToMappedLocation1", isOriginal ? L10N.getStr("generated") : L10N.getStr("original")); const revealInTreeKey = L10N.getStr("sourceTabs.revealInTree.accesskey"); const revealInTreeLabel = L10N.getStr("sourceTabs.revealInTree"); const watchExpressionKey = L10N.getStr("expressions.accesskey"); const watchExpressionLabel = L10N.getStr("expressions.label"); // menu items const copySourceItem = { id: "node-menu-copy-source", label: copySourceLabel, accesskey: copySourceKey, disabled: selectionText.length === 0, click: () => (0, _clipboard.copyToTheClipboard)(selectionText) }; const copySourceUri2Item = { id: "node-menu-copy-source-url", label: copySourceUri2Label, accesskey: copySourceUri2Key, disabled: false, click: () => (0, _clipboard.copyToTheClipboard)(selectedSource.get("url")) }; const functionText = getFunctionText(line + 1); const copyFunctionItem = { id: "node-menu-copy-function", label: copyFunctionLabel, accesskey: copyFunctionKey, disabled: !functionText, click: () => { const { location: { start, end } } = getFunctionLocation(line); flashLineRange({ start: start.line, end: end.line, sourceId: selectedLocation.sourceId }); return (0, _clipboard.copyToTheClipboard)(functionText); } }; const jumpToMappedLocationItem = { id: "node-menu-jump", label: jumpToMappedLocLabel, accesskey: jumpToMappedLocKey, disabled: !isMapped && !isPrettified, click: () => jumpToMappedLocation(sourceLocation) }; const showSourceMenuItem = { id: "node-menu-show-source", label: revealInTreeLabel, accesskey: revealInTreeKey, disabled: isPrettyPrinted, click: () => showSource(selectedSource.get("id")) }; const blackBoxMenuItem = { id: "node-menu-blackbox", label: toggleBlackBoxLabel, accesskey: blackboxKey, disabled: isOriginal || isPrettyPrinted || hasSourceMap, click: () => toggleBlackBox(selectedSource.toJS()) }; const watchExpressionItem = { id: "node-menu-add-watch-expression", label: watchExpressionLabel, accesskey: watchExpressionKey, click: () => addExpression(editor.codeMirror.getSelection()) }; // construct menu const menuItems = [copySourceItem, copySourceUri2Item, copyFunctionItem, { type: "separator" }, jumpToMappedLocationItem, showSourceMenuItem, blackBoxMenuItem]; // conditionally added items // TODO: Find a new way to only add this for mapped sources? if (textSelected) { menuItems.push(watchExpressionItem); } return menuItems; } class EditorMenu extends _react.PureComponent { constructor() { super(); } shouldComponentUpdate(nextProps) { return nextProps.contextMenu.type === "Editor"; } componentWillUpdate(nextProps) { // clear the context menu since it is open this.props.setContextMenu("", null); return this.showMenu(nextProps); } showMenu(nextProps) { const { contextMenu } = nextProps, options = _objectWithoutProperties(nextProps, ["contextMenu"]); const { event } = contextMenu; (0, _devtoolsLaunchpad.showMenu)(event, getMenuItems(event, options)); } render() { return null; } } const { addExpression, flashLineRange, jumpToMappedLocation, setContextMenu, showSource, toggleBlackBox } = _actions2.default; exports.default = (0, _reactRedux.connect)(state => { const selectedSource = (0, _selectors.getSelectedSource)(state); return { selectedLocation: (0, _selectors.getSelectedLocation)(state), selectedSource, hasPrettyPrint: !!(0, _selectors.getPrettySource)(state, selectedSource.get("id")), contextMenu: (0, _selectors.getContextMenu)(state), getFunctionText: line => (0, _function.findFunctionText)(line, selectedSource.toJS(), (0, _selectors.getSymbols)(state, selectedSource.toJS())), getFunctionLocation: line => (0, _astBreakpointLocation.findClosestScope)((0, _selectors.getSymbols)(state, selectedSource.toJS()).functions, { line, column: Infinity }) }; }, { addExpression, flashLineRange, jumpToMappedLocation, setContextMenu, showSource, toggleBlackBox })(EditorMenu); /***/ }), /* 1597 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.findFunctionText = findFunctionText; var _astBreakpointLocation = __webpack_require__(1416); var _indentation = __webpack_require__(1438); /* 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 . */ function findFunctionText(line, source, symbols) { const func = (0, _astBreakpointLocation.findClosestScope)(symbols.functions, { line, column: Infinity }); if (!func) { return null; } const { location: { start, end } } = func; const lines = source.text.split("\n"); const firstLine = lines[start.line - 1].slice(start.column); const lastLine = lines[end.line - 1].slice(0, end.column); const middle = lines.slice(start.line, end.line - 1); const functionText = [firstLine, ...middle, lastLine].join("\n"); const indentedFunctionText = (0, _indentation.correctIndentation)(functionText); return indentedFunctionText; } /***/ }), /* 1598 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ConditionalPanel = undefined; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactDom = __webpack_require__(4); var _reactDom2 = _interopRequireDefault(_reactDom); var _reactRedux = __webpack_require__(1189); var _Close = __webpack_require__(1374); var _Close2 = _interopRequireDefault(_Close); __webpack_require__(1331); var _editor = __webpack_require__(1358); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(1352); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ class ConditionalPanel extends _react.PureComponent { constructor() { super(); this.saveAndClose = () => { if (this.input) { this.setBreakpoint(this.input.value); } this.props.closeConditionalPanel(); }; this.onKey = e => { if (e.key === "Enter") { this.saveAndClose(); } else if (e.key === "Escape") { this.props.closeConditionalPanel(); } }; this.repositionOnScroll = () => { if (this.panelNode && this.scrollParent) { const { scrollLeft } = this.scrollParent; this.panelNode.style.transform = `translateX(${scrollLeft}px)`; } }; this.cbPanel = null; } keepFocusOnInput() { if (this.input) { this.input.focus(); } } setBreakpoint(condition) { const { selectedLocation, line } = this.props; const sourceId = selectedLocation ? selectedLocation.sourceId : ""; const location = { sourceId, line }; return this.props.setBreakpointCondition(location, { condition }); } clearConditionalPanel() { if (this.cbPanel) { this.cbPanel.clear(); this.cbPanel = null; } if (this.scrollParent) { this.scrollParent.removeEventListener("scroll", this.repositionOnScroll); } } componentWillMount() { if (this.props.line) { return this.renderToWidget(this.props); } } componentWillUpdate(nextProps) { if (nextProps.line) { return this.renderToWidget(nextProps); } return this.clearConditionalPanel(); } componentWillUnmount() { // This is called if CodeMirror is re-initializing itself before the // user closes the conditional panel. Clear the widget, and re-render it // as soon as this component gets remounted return this.clearConditionalPanel(); } renderToWidget(props) { const { selectedLocation, line, editor } = props; const sourceId = selectedLocation ? selectedLocation.sourceId : ""; const editorLine = (0, _editor.toEditorLine)(sourceId, line); this.cbPanel = editor.codeMirror.addLineWidget(editorLine, this.renderConditionalPanel(props), { coverGutter: true, noHScroll: false }); if (this.input) { let parent = this.input.parentNode; while (parent) { if (parent instanceof HTMLElement && parent.classList.contains("CodeMirror-scroll")) { this.scrollParent = parent; break; } parent = parent.parentNode; } if (this.scrollParent) { this.scrollParent.addEventListener("scroll", this.repositionOnScroll); this.repositionOnScroll(); } this.input.focus(); } } renderConditionalPanel(props) { const { breakpoint } = props; const condition = breakpoint ? breakpoint.condition : ""; const panel = document.createElement("div"); _reactDom2.default.render(_react2.default.createElement( "div", { className: "conditional-breakpoint-panel", onClick: () => this.keepFocusOnInput(), onBlur: this.props.closeConditionalPanel, ref: node => this.panelNode = node }, _react2.default.createElement( "div", { className: "prompt" }, "\xBB" ), _react2.default.createElement("input", { defaultValue: condition, placeholder: L10N.getStr("editor.conditionalPanel.placeholder"), onKeyDown: this.onKey, ref: input => this.input = input }), _react2.default.createElement(_Close2.default, { handleClick: this.props.closeConditionalPanel, buttonClass: "big", tooltip: L10N.getStr("editor.conditionalPanel.close") }) ), panel); return panel; } render() { return null; } } exports.ConditionalPanel = ConditionalPanel; const { setBreakpointCondition, openConditionalPanel, closeConditionalPanel } = _actions2.default; exports.default = (0, _reactRedux.connect)(state => { const line = (0, _selectors.getConditionalPanelLine)(state); const selectedLocation = (0, _selectors.getSelectedLocation)(state); return { selectedLocation, breakpoint: (0, _selectors.getBreakpointForLine)(state, selectedLocation.sourceId, line), line }; }, { setBreakpointCondition, openConditionalPanel, closeConditionalPanel })(ConditionalPanel); /***/ }), /* 1599 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _propTypes = __webpack_require__(20); var _propTypes2 = _interopRequireDefault(_propTypes); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _prefs = __webpack_require__(226); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(1352); var _devtoolsConfig = __webpack_require__(1355); var _Svg = __webpack_require__(1359); var _Svg2 = _interopRequireDefault(_Svg); var _Breakpoints = __webpack_require__(1600); var _Breakpoints2 = _interopRequireDefault(_Breakpoints); var _Expressions = __webpack_require__(1601); var _Expressions2 = _interopRequireDefault(_Expressions); var _devtoolsSplitter = __webpack_require__(1440); var _devtoolsSplitter2 = _interopRequireDefault(_devtoolsSplitter); var _Frames = __webpack_require__(1602); var _Frames2 = _interopRequireDefault(_Frames); var _EventListeners = __webpack_require__(1605); var _EventListeners2 = _interopRequireDefault(_EventListeners); var _Workers = __webpack_require__(1606); var _Workers2 = _interopRequireDefault(_Workers); var _Accordion = __webpack_require__(1607); var _Accordion2 = _interopRequireDefault(_Accordion); var _CommandBar = __webpack_require__(1608); var _CommandBar2 = _interopRequireDefault(_CommandBar); var _UtilsBar = __webpack_require__(1609); var _UtilsBar2 = _interopRequireDefault(_UtilsBar); var _BreakpointsDropdown = __webpack_require__(1790); var _BreakpointsDropdown2 = _interopRequireDefault(_BreakpointsDropdown); var _ChromeScopes = __webpack_require__(1610); var _ChromeScopes2 = _interopRequireDefault(_ChromeScopes); var _Scopes2 = __webpack_require__(1611); var _Scopes3 = _interopRequireDefault(_Scopes2); __webpack_require__(1342); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ const Scopes = (0, _devtoolsConfig.isEnabled)("chromeScopes") ? _ChromeScopes2.default : _Scopes3.default; function debugBtn(onClick, type, className, tooltip) { return _react2.default.createElement( "button", { onClick: onClick, className: `${type} ${className}`, key: type, title: tooltip }, _react2.default.createElement(_Svg2.default, { name: type, title: tooltip, "aria-label": tooltip }) ); } class SecondaryPanes extends _react.Component { renderBreakpointsToggle() { const { toggleAllBreakpoints, breakpoints, breakpointsDisabled, breakpointsLoading } = this.props; const isIndeterminate = !breakpointsDisabled && breakpoints.some(x => x.disabled); if (breakpoints.size == 0) { return null; } const inputProps = { type: "checkbox", "aria-label": breakpointsDisabled ? L10N.getStr("breakpoints.enable") : L10N.getStr("breakpoints.disable"), className: "breakpoints-toggle", disabled: breakpointsLoading, key: "breakpoints-toggle", onChange: e => { e.stopPropagation(); toggleAllBreakpoints(!breakpointsDisabled); }, onClick: e => e.stopPropagation(), checked: !breakpointsDisabled && !isIndeterminate, ref: input => { if (input) { input.indeterminate = isIndeterminate; } }, title: breakpointsDisabled ? L10N.getStr("breakpoints.enable") : L10N.getStr("breakpoints.disable") }; return _react2.default.createElement("input", inputProps); } watchExpressionHeaderButtons() { return [debugBtn(evt => { evt.stopPropagation(); this.props.evaluateExpressions(); }, "refresh", "refresh", L10N.getStr("watchExpressions.refreshButton"))]; } getScopeItem() { const isPaused = () => !!this.props.pauseData; return { header: L10N.getStr("scopes.header"), className: "scopes-pane", component: Scopes, opened: _prefs.prefs.scopesVisible, onToggle: opened => { _prefs.prefs.scopesVisible = opened; }, shouldOpen: isPaused }; } getWatchItem() { return { header: L10N.getStr("watchExpressions.header"), className: "watch-expressions-pane", buttons: this.watchExpressionHeaderButtons(), component: _Expressions2.default, opened: true }; } breakpointDropdown() { if (!_prefs.features.breakpointsDropdown) { return; } const { breakOnNext, pauseOnExceptions, shouldPauseOnExceptions, shouldIgnoreCaughtExceptions, isWaitingOnBreak } = this.props; return (0, _BreakpointsDropdown2.default)(breakOnNext, pauseOnExceptions, shouldPauseOnExceptions, shouldIgnoreCaughtExceptions, isWaitingOnBreak); } getStartItems() { const scopesContent = this.props.horizontal ? this.getScopeItem() : null; const items = [{ header: L10N.getStr("breakpoints.header"), className: "breakpoints-pane", buttons: [this.breakpointDropdown(), this.renderBreakpointsToggle()], component: _Breakpoints2.default, opened: true }, { header: L10N.getStr("callStack.header"), className: "call-stack-pane", component: _Frames2.default, opened: _prefs.prefs.callStackVisible, onToggle: opened => { _prefs.prefs.callStackVisible = opened; } }, scopesContent]; if ((0, _devtoolsConfig.isEnabled)("eventListeners")) { items.push({ header: L10N.getStr("eventListenersHeader"), className: "event-listeners-pane", component: _EventListeners2.default }); } if ((0, _devtoolsConfig.isEnabled)("workers")) { items.push({ header: L10N.getStr("workersHeader"), className: "workers-pane", component: _Workers2.default }); } if (this.props.horizontal) { items.unshift(this.getWatchItem()); } return items.filter(item => item); } renderHorizontalLayout() { return _react2.default.createElement(_Accordion2.default, { items: this.getItems() }); } getEndItems() { const items = []; if (!this.props.horizontal) { items.unshift(this.getScopeItem()); } if (!this.props.horizontal) { items.unshift(this.getWatchItem()); } return items; } getItems() { return [...this.getStartItems(), ...this.getEndItems()]; } renderVerticalLayout() { return _react2.default.createElement(_devtoolsSplitter2.default, { initialSize: "300px", minSize: 10, maxSize: "50%", splitterSize: 1, startPanel: _react2.default.createElement(_Accordion2.default, { items: this.getStartItems() }), endPanel: _react2.default.createElement(_Accordion2.default, { items: this.getEndItems() }) }); } renderUtilsBar() { if (!_prefs.features.shortcuts) { return; } return _react2.default.createElement(_UtilsBar2.default, { horizontal: this.props.horizontal, toggleShortcutsModal: this.props.toggleShortcutsModal }); } render() { return _react2.default.createElement( "div", { className: "secondary-panes-wrapper" }, _react2.default.createElement(_CommandBar2.default, { horizontal: this.props.horizontal }), _react2.default.createElement( "div", { className: "secondary-panes" }, this.props.horizontal ? this.renderHorizontalLayout() : this.renderVerticalLayout() ), this.renderUtilsBar() ); } } SecondaryPanes.propTypes = { evaluateExpressions: _propTypes2.default.func.isRequired, pauseData: _propTypes2.default.object, horizontal: _propTypes2.default.bool, breakpoints: _propTypes2.default.object, breakpointsDisabled: _propTypes2.default.bool, breakpointsLoading: _propTypes2.default.bool, toggleAllBreakpoints: _propTypes2.default.func.isRequired, toggleShortcutsModal: _propTypes2.default.func, isWaitingOnBreak: _propTypes2.default.bool, shouldPauseOnExceptions: _propTypes2.default.bool, shouldIgnoreCaughtExceptions: _propTypes2.default.bool }; SecondaryPanes.contextTypes = { shortcuts: _propTypes2.default.object }; exports.default = (0, _reactRedux.connect)(state => ({ pauseData: (0, _selectors.getPause)(state), breakpoints: (0, _selectors.getBreakpoints)(state), breakpointsDisabled: (0, _selectors.getBreakpointsDisabled)(state), breakpointsLoading: (0, _selectors.getBreakpointsLoading)(state), isWaitingOnBreak: (0, _selectors.getIsWaitingOnBreak)(state), shouldPauseOnExceptions: (0, _selectors.getShouldPauseOnExceptions)(state), shouldIgnoreCaughtExceptions: (0, _selectors.getShouldIgnoreCaughtExceptions)(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(SecondaryPanes); /***/ }), /* 1600 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); var _reactRedux = __webpack_require__(1189); var _reselect = __webpack_require__(993); var _redux = __webpack_require__(3); var _prefs = __webpack_require__(226); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(1352); var _breakpoint = __webpack_require__(1364); var _utils = __webpack_require__(1366); var _source = __webpack_require__(1356); var _devtoolsContextmenu = __webpack_require__(1413); var _Close = __webpack_require__(1374); var _Close2 = _interopRequireDefault(_Close); __webpack_require__(1334); var _lodash = __webpack_require__(2); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function isCurrentlyPausedAtBreakpoint(pause, breakpoint) { if (!pause || pause.isInterrupted) { return false; } const bpId = (0, _breakpoint.makeLocationId)(breakpoint.location); const pausedId = (0, _breakpoint.makeLocationId)((0, _lodash.get)(pause, "frame.location")); return bpId === pausedId; } function getBreakpointFilename(source) { return source && source.toJS ? (0, _source.getFilename)(source.toJS()) : ""; } function renderSourceLocation(source, line, column) { const filename = getBreakpointFilename(source); const isWasm = source && source.get("isWasm"); const columnVal = _prefs.features.columnBreakpoints && column ? `:${column}` : ""; const bpLocation = isWasm ? `0x${line.toString(16).toUpperCase()}` : `${line}${columnVal}`; if (!filename) { return null; } return _react2.default.createElement( "div", { className: "location" }, `${(0, _utils.endTruncateStr)(filename, 30)}: ${bpLocation}` ); } class Breakpoints extends _react.PureComponent { shouldComponentUpdate(nextProps, nextState) { const { breakpoints } = this.props; return breakpoints !== nextProps.breakpoints; } handleCheckbox(breakpoint) { if (breakpoint.loading) { return; } if (breakpoint.disabled) { this.props.enableBreakpoint(breakpoint.location); } else { this.props.disableBreakpoint(breakpoint.location); } } showContextMenu(e, breakpoint) { const { removeBreakpoint, removeBreakpoints, removeAllBreakpoints, toggleBreakpoints, toggleAllBreakpoints, toggleDisabledBreakpoint, setBreakpointCondition, openConditionalPanel, breakpoints } = this.props; e.preventDefault(); const deleteSelfLabel = L10N.getStr("breakpointMenuItem.deleteSelf2.label"); const deleteAllLabel = L10N.getStr("breakpointMenuItem.deleteAll2.label"); const deleteOthersLabel = L10N.getStr("breakpointMenuItem.deleteOthers2.label"); const enableSelfLabel = L10N.getStr("breakpointMenuItem.enableSelf2.label"); const enableAllLabel = L10N.getStr("breakpointMenuItem.enableAll2.label"); const enableOthersLabel = L10N.getStr("breakpointMenuItem.enableOthers2.label"); const disableSelfLabel = L10N.getStr("breakpointMenuItem.disableSelf2.label"); const disableAllLabel = L10N.getStr("breakpointMenuItem.disableAll2.label"); const disableOthersLabel = L10N.getStr("breakpointMenuItem.disableOthers2.label"); const removeConditionLabel = L10N.getStr("breakpointMenuItem.removeCondition2.label"); const addConditionLabel = L10N.getStr("breakpointMenuItem.addCondition2.label"); const editConditionLabel = L10N.getStr("breakpointMenuItem.editCondition2.label"); const deleteSelfKey = L10N.getStr("breakpointMenuItem.deleteSelf2.accesskey"); const deleteAllKey = L10N.getStr("breakpointMenuItem.deleteAll2.accesskey"); const deleteOthersKey = L10N.getStr("breakpointMenuItem.deleteOthers2.accesskey"); const enableSelfKey = L10N.getStr("breakpointMenuItem.enableSelf2.accesskey"); const enableAllKey = L10N.getStr("breakpointMenuItem.enableAll2.accesskey"); const enableOthersKey = L10N.getStr("breakpointMenuItem.enableOthers2.accesskey"); const disableSelfKey = L10N.getStr("breakpointMenuItem.disableSelf2.accesskey"); const disableAllKey = L10N.getStr("breakpointMenuItem.disableAll2.accesskey"); const disableOthersKey = L10N.getStr("breakpointMenuItem.disableOthers2.accesskey"); const removeConditionKey = L10N.getStr("breakpointMenuItem.removeCondition2.accesskey"); const editConditionKey = L10N.getStr("breakpointMenuItem.editCondition2.accesskey"); const addConditionKey = L10N.getStr("breakpointMenuItem.addCondition2.accesskey"); const otherBreakpoints = breakpoints.filter(b => b !== breakpoint); const enabledBreakpoints = breakpoints.filter(b => !b.disabled); const disabledBreakpoints = breakpoints.filter(b => b.disabled); const otherEnabledBreakpoints = breakpoints.filter(b => !b.disabled && b !== breakpoint); const otherDisabledBreakpoints = breakpoints.filter(b => b.disabled && b !== breakpoint); const deleteSelf = { id: "node-menu-delete-self", label: deleteSelfLabel, accesskey: deleteSelfKey, disabled: false, click: () => removeBreakpoint(breakpoint.location) }; const deleteAll = { id: "node-menu-delete-all", label: deleteAllLabel, accesskey: deleteAllKey, disabled: false, click: () => removeAllBreakpoints() }; const deleteOthers = { id: "node-menu-delete-other", label: deleteOthersLabel, accesskey: deleteOthersKey, disabled: false, click: () => removeBreakpoints(otherBreakpoints) }; const enableSelf = { id: "node-menu-enable-self", label: enableSelfLabel, accesskey: enableSelfKey, disabled: false, click: () => toggleDisabledBreakpoint(breakpoint.location.line) }; const enableAll = { id: "node-menu-enable-all", label: enableAllLabel, accesskey: enableAllKey, disabled: false, click: () => toggleAllBreakpoints(false) }; const enableOthers = { id: "node-menu-enable-others", label: enableOthersLabel, accesskey: enableOthersKey, disabled: false, click: () => toggleBreakpoints(false, otherDisabledBreakpoints) }; const disableSelf = { id: "node-menu-disable-self", label: disableSelfLabel, accesskey: disableSelfKey, disabled: false, click: () => toggleDisabledBreakpoint(breakpoint.location.line) }; const disableAll = { id: "node-menu-disable-all", label: disableAllLabel, accesskey: disableAllKey, disabled: false, click: () => toggleAllBreakpoints(true) }; const disableOthers = { id: "node-menu-disable-others", label: disableOthersLabel, accesskey: disableOthersKey, click: () => toggleBreakpoints(true, otherEnabledBreakpoints) }; const removeCondition = { id: "node-menu-remove-condition", label: removeConditionLabel, accesskey: removeConditionKey, disabled: false, click: () => setBreakpointCondition(breakpoint.location) }; const addCondition = { id: "node-menu-add-condition", label: addConditionLabel, accesskey: addConditionKey, click: () => { this.selectBreakpoint(breakpoint); openConditionalPanel(breakpoint.location.line); } }; const editCondition = { id: "node-menu-edit-condition", label: editConditionLabel, accesskey: editConditionKey, click: () => { this.selectBreakpoint(breakpoint); openConditionalPanel(breakpoint.location.line); } }; const hideEnableSelf = !breakpoint.disabled; const hideEnableAll = disabledBreakpoints.size === 0; const hideEnableOthers = otherDisabledBreakpoints.size === 0; const hideDisableAll = enabledBreakpoints.size === 0; const hideDisableOthers = otherEnabledBreakpoints.size === 0; const hideDisableSelf = breakpoint.disabled; const items = [{ item: enableSelf, hidden: () => hideEnableSelf }, { item: enableAll, hidden: () => hideEnableAll }, { item: enableOthers, hidden: () => hideEnableOthers }, { item: { type: "separator" }, hidden: () => hideEnableSelf && hideEnableAll && hideEnableOthers }, { item: deleteSelf }, { item: deleteAll }, { item: deleteOthers, hidden: () => breakpoints.size === 1 }, { item: { type: "separator" }, hidden: () => hideDisableSelf && hideDisableAll && hideDisableOthers }, { item: disableSelf, hidden: () => hideDisableSelf }, { item: disableAll, hidden: () => hideDisableAll }, { item: disableOthers, hidden: () => hideDisableOthers }, { item: { type: "separator" } }, { item: addCondition, hidden: () => breakpoint.condition }, { item: editCondition, hidden: () => !breakpoint.condition }, { item: removeCondition, hidden: () => !breakpoint.condition }]; (0, _devtoolsContextmenu.showMenu)(e, (0, _devtoolsContextmenu.buildMenu)(items)); } selectBreakpoint(breakpoint) { this.props.selectLocation(breakpoint.location); } removeBreakpoint(event, breakpoint) { event.stopPropagation(); this.props.removeBreakpoint(breakpoint.location); } renderBreakpoint(breakpoint) { const snippet = breakpoint.text || ""; const locationId = breakpoint.locationId; const line = breakpoint.location.line; const column = breakpoint.location.column; const isCurrentlyPaused = breakpoint.isCurrentlyPaused; const isDisabled = breakpoint.disabled; const isConditional = !!breakpoint.condition; const isHidden = breakpoint.hidden; if (isHidden) { return; } return _react2.default.createElement( "div", { className: (0, _classnames2.default)({ breakpoint, paused: isCurrentlyPaused, disabled: isDisabled, "is-conditional": isConditional }), key: locationId, onClick: () => this.selectBreakpoint(breakpoint), onContextMenu: e => this.showContextMenu(e, breakpoint) }, _react2.default.createElement("input", { type: "checkbox", className: "breakpoint-checkbox", checked: !isDisabled, onChange: () => this.handleCheckbox(breakpoint), onClick: ev => ev.stopPropagation() }), _react2.default.createElement( "label", { className: "breakpoint-label", title: breakpoint.text }, renderSourceLocation(breakpoint.location.source, line, column) ), _react2.default.createElement( "div", { className: "breakpoint-snippet" }, snippet ), _react2.default.createElement(_Close2.default, { handleClick: ev => this.removeBreakpoint(ev, breakpoint), tooltip: L10N.getStr("breakpoints.removeBreakpointTooltip") }) ); } render() { const { breakpoints } = this.props; const children = breakpoints.size === 0 ? _react2.default.createElement( "div", { className: "pane-info" }, L10N.getStr("breakpoints.none") ) : (0, _lodash.sortBy)([...breakpoints.valueSeq()], [bp => getBreakpointFilename(bp.location.source), bp => bp.location.line]).map(bp => this.renderBreakpoint(bp)); return _react2.default.createElement( "div", { className: "pane breakpoints-list" }, children ); } } function updateLocation(sources, pause, bp) { const source = (0, _selectors.getSourceInSources)(sources, bp.location.sourceId); const isCurrentlyPaused = isCurrentlyPausedAtBreakpoint(pause, bp); const locationId = (0, _breakpoint.makeLocationId)(bp.location); const location = _extends({}, bp.location, { source }); const localBP = _extends({}, bp, { location, locationId, isCurrentlyPaused }); return localBP; } const _getBreakpoints = (0, _reselect.createSelector)(_selectors.getBreakpoints, _selectors.getSources, _selectors.getPause, (breakpoints, sources, pause) => breakpoints.map(bp => updateLocation(sources, pause, bp)).filter(bp => bp.location.source && !bp.location.source.get("isBlackBoxed"))); exports.default = (0, _reactRedux.connect)((state, props) => ({ breakpoints: _getBreakpoints(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Breakpoints); /***/ }), /* 1601 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(1352); var _expressions = __webpack_require__(1437); var _Close = __webpack_require__(1374); var _Close2 = _interopRequireDefault(_Close); var _devtoolsReps = __webpack_require__(1408); __webpack_require__(1335); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Expressions extends _react.PureComponent { constructor(...args) { super(...args); this.state = { editing: null }; this.renderExpression = this.renderExpression.bind(this); } componentDidMount() { const { expressions, evaluateExpressions } = this.props; if (expressions.size > 0) { evaluateExpressions(); } } shouldComponentUpdate(nextProps, nextState) { const { editing } = this.state; const { expressions, loadedObjects } = this.props; return expressions !== nextProps.expressions || loadedObjects !== nextProps.loadedObjects || editing !== nextState.editing; } editExpression(expression, { depth }) { if (depth > 0) { return; } this.setState({ editing: expression.input }); } deleteExpression(e, expression) { e.stopPropagation(); const { deleteExpression } = this.props; deleteExpression(expression); } inputKeyPress(e, expression) { if (e.key !== "Enter") { return; } const value = e.target.value; if (value == "") { return; } this.setState({ editing: null }); e.target.value = ""; this.props.updateExpression(value, expression); } renderExpressionEditInput(expression) { return _react2.default.createElement( "span", { className: "expression-input-container", key: expression.input }, _react2.default.createElement("input", { className: "input-expression", type: "text", onKeyPress: e => this.inputKeyPress(e, expression), onBlur: () => this.setState({ editing: null }), defaultValue: expression.input, ref: c => this._input = c }) ); } renderExpression(expression) { const { loadObjectProperties, loadedObjects, openLink } = this.props; const { editing } = this.state; const { input, updating } = expression; if (editing == input) { return this.renderExpressionEditInput(expression); } if (updating) { return; } const { value } = (0, _expressions.getValue)(expression); const root = { name: expression.input, path: input, contents: { value } }; return _react2.default.createElement( "li", { className: "expression-container", key: input }, _react2.default.createElement( "div", { className: "expression-content" }, _react2.default.createElement(_devtoolsReps.ObjectInspector, { roots: [root], autoExpandDepth: 0, disableWrap: true, disabledFocus: true, onDoubleClick: (items, options) => this.editExpression(expression, options), openLink: openLink, getObjectProperties: id => loadedObjects[id], loadObjectProperties: loadObjectProperties // TODO: See https://github.com/devtools-html/debugger.html/issues/3555. , getObjectEntries: actor => {}, loadObjectEntries: grip => {} }), _react2.default.createElement( "div", { className: "expression-container__close-btn" }, _react2.default.createElement(_Close2.default, { handleClick: e => this.deleteExpression(e, expression) }) ) ) ); } componentDidUpdate() { if (this._input) { this._input.focus(); } } renderNewExpressionInput() { const onKeyPress = e => { if (e.key !== "Enter") { return; } const value = e.target.value; if (value == "") { return; } e.stopPropagation(); e.target.value = ""; this.props.addExpression(value); }; return _react2.default.createElement( "li", { className: "expression-input-container" }, _react2.default.createElement("input", { className: "input-expression", type: "text", placeholder: L10N.getStr("expressions.placeholder"), onBlur: e => e.target.value = "", onKeyPress: onKeyPress }) ); } render() { const { expressions } = this.props; return _react2.default.createElement( "ul", { className: "pane expressions-list" }, expressions.map(this.renderExpression), this.renderNewExpressionInput() ); } } /* 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 . */ exports.default = (0, _reactRedux.connect)(state => ({ pauseInfo: (0, _selectors.getPause)(state), expressions: (0, _selectors.getExpressions)(state), loadedObjects: (0, _selectors.getLoadedObjects)(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Expressions); /***/ }), /* 1602 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(1189); var _Frame = __webpack_require__(1453); var _Frame2 = _interopRequireDefault(_Frame); var _Group = __webpack_require__(1603); var _Group2 = _interopRequireDefault(_Group); var _WhyPaused = __webpack_require__(1604); var _WhyPaused2 = _interopRequireDefault(_WhyPaused); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _frame = __webpack_require__(1380); var _clipboard = __webpack_require__(1388); var _selectors = __webpack_require__(1352); __webpack_require__(1338); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const NUM_FRAMES_SHOWN = 7; /* 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 . */ class Frames extends _react.Component { constructor(props) { super(props); this.state = { showAllFrames: false }; this.toggleFramesDisplay = this.toggleFramesDisplay.bind(this); this.copyStackTrace = this.copyStackTrace.bind(this); this.toggleFrameworkGrouping = this.toggleFrameworkGrouping.bind(this); } shouldComponentUpdate(nextProps, nextState) { const { frames, selectedFrame, frameworkGroupingOn } = this.props; const { showAllFrames } = this.state; return frames !== nextProps.frames || selectedFrame !== nextProps.selectedFrame || showAllFrames !== nextState.showAllFrames || frameworkGroupingOn !== nextProps.frameworkGroupingOn; } toggleFramesDisplay() { this.setState({ showAllFrames: !this.state.showAllFrames }); } collapseFrames(frames) { const { frameworkGroupingOn } = this.props; if (!frameworkGroupingOn) { return frames; } return (0, _frame.collapseFrames)(frames); } truncateFrames(frames) { const numFramesToShow = this.state.showAllFrames ? frames.length : NUM_FRAMES_SHOWN; return frames.slice(0, numFramesToShow); } copyStackTrace() { const { frames } = this.props; const framesToCopy = frames.map(f => (0, _frame.formatCopyName)(f)).join("\n"); (0, _clipboard.copyToTheClipboard)(framesToCopy); } toggleFrameworkGrouping() { const { toggleFrameworkGrouping, frameworkGroupingOn } = this.props; toggleFrameworkGrouping(!frameworkGroupingOn); } renderFrames(frames) { const { selectFrame, selectedFrame, toggleBlackBox, frameworkGroupingOn } = this.props; const framesOrGroups = this.truncateFrames(this.collapseFrames(frames)); return _react2.default.createElement( "ul", null, framesOrGroups.map(frameOrGroup => frameOrGroup.id ? _react2.default.createElement(_Frame2.default, { frame: frameOrGroup, toggleFrameworkGrouping: this.toggleFrameworkGrouping, copyStackTrace: this.copyStackTrace, frameworkGroupingOn: frameworkGroupingOn, selectFrame: selectFrame, selectedFrame: selectedFrame, toggleBlackBox: toggleBlackBox, key: String(frameOrGroup.id) }) : _react2.default.createElement(_Group2.default, { group: frameOrGroup, toggleFrameworkGrouping: this.toggleFrameworkGrouping, copyStackTrace: this.copyStackTrace, frameworkGroupingOn: frameworkGroupingOn, selectFrame: selectFrame, selectedFrame: selectedFrame, toggleBlackBox: toggleBlackBox, key: frameOrGroup[0].id })) ); } renderToggleButton(frames) { const buttonMessage = this.state.showAllFrames ? L10N.getStr("callStack.collapse") : L10N.getStr("callStack.expand"); frames = this.collapseFrames(frames); if (frames.length <= NUM_FRAMES_SHOWN) { return null; } return _react2.default.createElement( "div", { className: "show-more", onClick: this.toggleFramesDisplay }, buttonMessage ); } render() { const { frames, pause } = this.props; if (!frames) { return _react2.default.createElement( "div", { className: "pane frames" }, _react2.default.createElement( "div", { className: "pane-info empty" }, L10N.getStr("callStack.notPaused") ) ); } return _react2.default.createElement( "div", { className: "pane frames" }, this.renderFrames(frames), (0, _WhyPaused2.default)({ pause }), this.renderToggleButton(frames) ); } } exports.default = (0, _reactRedux.connect)(state => ({ frames: (0, _selectors.getCallStackFrames)(state), frameworkGroupingOn: (0, _selectors.getFrameworkGroupingState)(state), selectedFrame: (0, _selectors.getSelectedFrame)(state), pause: (0, _selectors.getPause)(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Frames); /***/ }), /* 1603 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _Svg = __webpack_require__(1359); var _Svg2 = _interopRequireDefault(_Svg); var _frame = __webpack_require__(1380); var _FrameMenu = __webpack_require__(1454); var _FrameMenu2 = _interopRequireDefault(_FrameMenu); __webpack_require__(1336); var _Frame = __webpack_require__(1453); var _Frame2 = _interopRequireDefault(_Frame); var _Badge = __webpack_require__(1704); var _Badge2 = _interopRequireDefault(_Badge); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ function FrameLocation({ frame }) { const library = (0, _frame.getLibraryFromUrl)(frame); if (!library) { return null; } return _react2.default.createElement( "div", { className: "location" }, library, _react2.default.createElement(_Svg2.default, { name: library.toLowerCase(), className: "annotation-logo" }) ); } FrameLocation.displayName = "FrameLocation"; class Group extends _react.Component { constructor(...args) { super(...args); this.toggleFrames = () => { this.setState({ expanded: !this.state.expanded }); }; this.state = { expanded: false }; } onContextMenu(event) { const { group, copyStackTrace, toggleFrameworkGrouping, toggleBlackBox, frameworkGroupingOn } = this.props; const frame = group[0]; (0, _FrameMenu2.default)(frame, frameworkGroupingOn, { copyStackTrace, toggleFrameworkGrouping, toggleBlackBox }, event); } renderFrames() { const { group, selectFrame, selectedFrame, toggleFrameworkGrouping, frameworkGroupingOn, toggleBlackBox, copyStackTrace } = this.props; const { expanded } = this.state; if (!expanded) { return null; } return _react2.default.createElement( "div", { className: "frames-list" }, group.map(frame => _react2.default.createElement(_Frame2.default, { copyStackTrace: copyStackTrace, frame: frame, frameworkGroupingOn: frameworkGroupingOn, hideLocation: true, key: frame.id, selectedFrame: selectedFrame, selectFrame: selectFrame, shouldMapDisplayName: false, toggleBlackBox: toggleBlackBox, toggleFrameworkGrouping: toggleFrameworkGrouping })) ); } renderDescription() { const frame = this.props.group[0]; const displayName = (0, _frame.formatDisplayName)(frame); return _react2.default.createElement( "li", { key: frame.id, className: (0, _classnames2.default)("group"), onClick: this.toggleFrames, tabIndex: 0 }, _react2.default.createElement( "div", { className: "d-flex align-items-center min-width-0" }, _react2.default.createElement( "div", { className: "title" }, displayName ), _react2.default.createElement( _Badge2.default, null, this.props.group.length ) ), _react2.default.createElement(FrameLocation, { frame: frame }) ); } render() { const { expanded } = this.state; return _react2.default.createElement( "div", { className: (0, _classnames2.default)("frames-group", { expanded }), onContextMenu: e => this.onContextMenu(e) }, this.renderDescription(), this.renderFrames() ); } } exports.default = Group; Group.displayName = "Group"; /***/ }), /* 1604 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = renderWhyPaused; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _lodash = __webpack_require__(2); var _pause = __webpack_require__(1400); __webpack_require__(1337); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function renderExceptionSummary(exception) { if ((0, _lodash.isString)(exception)) { return exception; } const message = (0, _lodash.get)(exception, "preview.message"); const name = (0, _lodash.get)(exception, "preview.name"); return `${name}: ${message}`; } /* 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 . */ function renderMessage(pauseInfo) { if (!pauseInfo) { return null; } const message = (0, _lodash.get)(pauseInfo, "why.message"); if (message) { return _react2.default.createElement( "div", { className: "message" }, message ); } const exception = (0, _lodash.get)(pauseInfo, "why.exception"); if (exception) { return _react2.default.createElement( "div", { className: "message warning" }, renderExceptionSummary(exception) ); } return null; } function renderWhyPaused({ pause }) { const reason = (0, _pause.getPauseReason)(pause); if (!reason) { return null; } return _react2.default.createElement( "div", { className: "pane why-paused" }, _react2.default.createElement( "div", null, L10N.getStr(reason) ), renderMessage(pause) ); } renderWhyPaused.displayName = "whyPaused"; /***/ }), /* 1605 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(1189); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(1352); var _Close = __webpack_require__(1374); var _Close2 = _interopRequireDefault(_Close); __webpack_require__(1339); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class EventListeners extends _react.Component { constructor(...args) { super(...args); this.renderListener = this.renderListener.bind(this); } renderListener({ type, selector, line, sourceId, breakpoint }) { const checked = breakpoint && !breakpoint.disabled; const location = { sourceId, line }; return _react2.default.createElement( "div", { className: "listener", onClick: () => this.props.selectLocation({ sourceId, line }), key: `${type}.${selector}.${sourceId}.${line}` }, _react2.default.createElement("input", { type: "checkbox", className: "listener-checkbox", checked: checked, onChange: () => this.handleCheckbox(breakpoint, location) }), _react2.default.createElement( "span", { className: "type" }, type ), _react2.default.createElement( "span", { className: "selector" }, selector ), breakpoint ? _react2.default.createElement(_Close2.default, { handleClick: ev => this.removeBreakpoint(ev, breakpoint) }) : "" ); } handleCheckbox(breakpoint, location) { if (!breakpoint) { return this.props.addBreakpoint(location); } if (breakpoint.loading) { return; } if (breakpoint.disabled) { this.props.enableBreakpoint(breakpoint.location); } else { this.props.disableBreakpoint(breakpoint.location); } } removeBreakpoint(event, breakpoint) { event.stopPropagation(); this.props.removeBreakpoint(breakpoint.location); } render() { const { listeners } = this.props; return _react2.default.createElement( "div", { className: "pane event-listeners" }, listeners.map(this.renderListener) ); } } exports.default = (0, _reactRedux.connect)(state => { const listeners = (0, _selectors.getEventListeners)(state).map(l => { return _extends({}, l, { breakpoint: (0, _selectors.getBreakpoint)(state, { sourceId: l.sourceId, line: l.line }) }); }); return { listeners }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(EventListeners); /***/ }), /* 1606 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Workers = undefined; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); __webpack_require__(1340); var _reactRedux = __webpack_require__(1189); var _selectors = __webpack_require__(1352); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ class Workers extends _react.PureComponent { renderWorkers(workers) { return workers.map(w => _react2.default.createElement( "div", { className: "worker", key: w.url }, w.url )); } renderNoWorkersPlaceholder() { return _react2.default.createElement( "div", { className: "pane-info" }, L10N.getStr("noWorkersText") ); } render() { const { workers } = this.props; return _react2.default.createElement( "div", { className: "pane workers-list" }, workers && workers.size > 0 ? this.renderWorkers(workers) : this.renderNoWorkersPlaceholder() ); } } exports.Workers = Workers; function mapStateToProps(state) { return { workers: (0, _selectors.getWorkers)(state) }; } exports.default = (0, _reactRedux.connect)(mapStateToProps)(Workers); /***/ }), /* 1607 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _Svg = __webpack_require__(1359); var _Svg2 = _interopRequireDefault(_Svg); __webpack_require__(1341); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class Accordion extends _react.Component { constructor(props) { super(); this.renderContainer = (item, i) => { const { opened, created } = this.state; return _react2.default.createElement( "div", { className: item.className, key: i }, _react2.default.createElement( "div", { className: "_header", onClick: () => this.handleHeaderClick(i) }, _react2.default.createElement(_Svg2.default, { name: "arrow", className: opened[i] ? "expanded" : "" }), item.header, item.buttons ? _react2.default.createElement( "div", { className: "header-buttons" }, item.buttons ) : null ), created[i] || opened[i] ? _react2.default.createElement( "div", { className: "_content", style: { display: opened[i] ? "block" : "none" } }, (0, _react.createElement)(item.component, item.componentProps || {}) ) : null ); }; this.state = { opened: props.items.map(item => item.opened), created: [] }; } componentWillReceiveProps(nextProps) { const newOpened = this.state.opened.map((isOpen, i) => { const { shouldOpen } = nextProps.items[i]; return isOpen || shouldOpen && shouldOpen(); }); this.setState({ opened: newOpened }); } handleHeaderClick(i) { const opened = [...this.state.opened]; const created = [...this.state.created]; const item = this.props.items[i]; opened[i] = !opened[i]; created[i] = true; if (opened[i] && item.onOpened) { item.onOpened(); } if (item.onToggle) { item.onToggle(opened[i]); } this.setState({ opened, created }); } render() { return _react2.default.createElement( "div", { className: "accordion" }, this.props.items.map(this.renderContainer) ); } } /* 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 . */ exports.default = Accordion; /***/ }), /* 1608 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _propTypes = __webpack_require__(20); var _propTypes2 = _interopRequireDefault(_propTypes); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _prefs = __webpack_require__(226); var _selectors = __webpack_require__(1352); var _text = __webpack_require__(1387); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _CommandBarButton = __webpack_require__(1764); var _CommandBarButton2 = _interopRequireDefault(_CommandBarButton); __webpack_require__(1295); var _devtoolsModules = __webpack_require__(1376); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ const { appinfo } = _devtoolsModules.Services; const isMacOS = appinfo.OS === "Darwin"; const COMMANDS = ["resume", "stepOver", "stepIn", "stepOut"]; const KEYS = { WINNT: { resume: "F8", pause: "F8", stepOver: "F10", stepIn: "F11", stepOut: "Shift+F11" }, Darwin: { resume: "Cmd+\\", pause: "Cmd+\\", stepOver: "Cmd+'", stepIn: "Cmd+;", stepOut: "Cmd+Shift+:", stepOutDisplay: "Cmd+Shift+;" }, Linux: { resume: "F8", pause: "F8", stepOver: "F10", stepIn: "Ctrl+F11", stepOut: "Ctrl+Shift+F11" } }; function getKey(action) { return getKeyForOS(appinfo.OS, action); } function getKeyForOS(os, action) { const osActions = KEYS[os] || KEYS.Linux; return osActions[action]; } function formatKey(action) { const key = getKey(`${action}Display`) || getKey(action); if (isMacOS) { const winKey = getKeyForOS("WINNT", `${action}Display`) || getKeyForOS("WINNT", action); // display both Windows type and Mac specific keys return (0, _text.formatKeyShortcut)([key, winKey].join(" ")); } return (0, _text.formatKeyShortcut)(key); } function debugBtn(onClick, type, className, tooltip, disabled = false, ariaPressed = false) { return _react2.default.createElement( _CommandBarButton2.default, { className: (0, _classnames2.default)(type, className), disabled: disabled, key: type, onClick: onClick, pressed: ariaPressed, title: tooltip }, _react2.default.createElement("img", { className: type }) ); } class CommandBar extends _react.Component { componentWillUnmount() { const shortcuts = this.context.shortcuts; COMMANDS.forEach(action => shortcuts.off(getKey(action))); if (isMacOS) { COMMANDS.forEach(action => shortcuts.off(getKeyForOS("WINNT", action))); } } componentDidMount() { const shortcuts = this.context.shortcuts; COMMANDS.forEach(action => shortcuts.on(getKey(action), (_, e) => this.handleEvent(e, action))); if (isMacOS) { // The Mac supports both the Windows Function keys // as well as the Mac non-Function keys COMMANDS.forEach(action => shortcuts.on(getKeyForOS("WINNT", action), (_, e) => this.handleEvent(e, action))); } } handleEvent(e, action) { e.preventDefault(); e.stopPropagation(); this.props[action](); } renderStepButtons() { const isPaused = this.props.pause; const className = isPaused ? "active" : "disabled"; const isDisabled = !this.props.pause; if (!isPaused && _prefs.features.removeCommandBarOptions) { return; } return [debugBtn(this.props.stepOver, "stepOver", className, L10N.getFormatStr("stepOverTooltip", formatKey("stepOver")), isDisabled), debugBtn(this.props.stepIn, "stepIn", className, L10N.getFormatStr("stepInTooltip", formatKey("stepIn")), isDisabled), debugBtn(this.props.stepOut, "stepOut", className, L10N.getFormatStr("stepOutTooltip", formatKey("stepOut")), isDisabled)]; } renderPauseButton() { const { pause, breakOnNext, isWaitingOnBreak } = this.props; if (pause) { return debugBtn(this.props.resume, "resume", "active", L10N.getFormatStr("resumeButtonTooltip", formatKey("resume"))); } if (_prefs.features.removeCommandBarOptions) { return; } if (isWaitingOnBreak) { return debugBtn(null, "pause", "disabled", L10N.getStr("pausePendingButtonTooltip"), true); } return debugBtn(breakOnNext, "pause", "active", L10N.getFormatStr("pauseButtonTooltip", formatKey("pause"))); } /* * The pause on exception button has three states in this order: * 1. don't pause on exceptions [false, false] * 2. pause on uncaught exceptions [true, true] * 3. pause on all exceptions [true, false] */ renderPauseOnExceptions() { if (_prefs.features.breakpointsDropdown) { return; } const { shouldPauseOnExceptions, shouldIgnoreCaughtExceptions, pauseOnExceptions } = this.props; if (!shouldPauseOnExceptions && !shouldIgnoreCaughtExceptions) { return debugBtn(() => pauseOnExceptions(true, true), "pause-exceptions", "enabled", L10N.getStr("ignoreExceptions"), false, false); } if (shouldPauseOnExceptions && shouldIgnoreCaughtExceptions) { return debugBtn(() => pauseOnExceptions(true, false), "pause-exceptions", "uncaught enabled", L10N.getStr("pauseOnUncaughtExceptions"), false, true); } return debugBtn(() => pauseOnExceptions(false, false), "pause-exceptions", "all enabled", L10N.getStr("pauseOnExceptions"), false, true); } render() { return _react2.default.createElement( "div", { className: (0, _classnames2.default)("command-bar", { vertical: !this.props.horizontal }) }, this.renderPauseButton(), this.renderStepButtons(), this.renderPauseOnExceptions() ); } } CommandBar.contextTypes = { shortcuts: _propTypes2.default.object }; exports.default = (0, _reactRedux.connect)(state => { return { pause: (0, _selectors.getPause)(state), isWaitingOnBreak: (0, _selectors.getIsWaitingOnBreak)(state), shouldPauseOnExceptions: (0, _selectors.getShouldPauseOnExceptions)(state), shouldIgnoreCaughtExceptions: (0, _selectors.getShouldIgnoreCaughtExceptions)(state) }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(CommandBar); /***/ }), /* 1609 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); __webpack_require__(1295); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function debugBtn(onClick, type, className, tooltip, disabled = false) { const props = { onClick, key: type, "aria-label": tooltip, title: tooltip, disabled }; return _react2.default.createElement( "button", _extends({ className: (0, _classnames2.default)(type, className) }, props), "?" ); } class UtilsBar extends _react.Component { renderUtilButtons() { return [debugBtn(this.props.toggleShortcutsModal, "shortcut", "active", L10N.getStr("shortcuts.buttonName"), false)]; } render() { return _react2.default.createElement( "div", { className: (0, _classnames2.default)("command-bar bottom", { vertical: !this.props.horizontal }) }, this.renderUtilButtons() ); } } exports.default = UtilsBar; /***/ }), /* 1610 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(1189); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(1352); var _Svg = __webpack_require__(1359); var _Svg2 = _interopRequireDefault(_Svg); var _ManagedTree = __webpack_require__(1404); var _ManagedTree2 = _interopRequireDefault(_ManagedTree); __webpack_require__(1296); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // check to see if its an object with propertie function nodeHasProperties(item) { return !nodeHasChildren(item) && item.contents.value.type === "object"; } /* 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 . */ function nodeIsPrimitive(item) {} function nodeHasChildren(item) { return Array.isArray(item.contents); } function createNode(name, path, contents) { // The path is important to uniquely identify the item in the entire // tree. This helps debugging & optimizes React's rendering of large // lists. The path will be separated by property name, // i.e. `{ foo: { bar: { baz: 5 }}}` will have a path of `foo/bar/baz` // for the inner object. return { name, path, contents }; } class Scopes extends _react.Component { constructor(...args) { super(...args); // Cache of dynamically built nodes. We shouldn't need to clear // this out ever, since we don't ever "switch out" the object // being inspected. this.objectCache = {}; this.getChildren = this.getChildren.bind(this); this.onExpand = this.onExpand.bind(this); this.renderItem = this.renderItem.bind(this); } makeNodesForProperties(objProps, parentPath) { const { ownProperties, prototype } = objProps; const nodes = Object.keys(ownProperties).sort() // Ignore non-concrete values like getters and setters // for now by making sure we have a value. .filter(name => "value" in ownProperties[name]).map(name => createNode(name, `${parentPath}/${name}`, ownProperties[name])); // Add the prototype if it exists and is not null if (prototype && prototype.type !== "null") { nodes.push(createNode("__proto__", `${parentPath}/__proto__`, { value: prototype })); } return nodes; } renderItem(item, depth, focused, _, expanded, { setExpanded }) { const notEnumberable = false; const objectValue = ""; return _react2.default.createElement( "div", { className: (0, _classnames2.default)("node object-node", { focused: false, "not-enumerable": notEnumberable }), style: { marginLeft: depth * 15 }, key: item.path, onClick: e => { e.stopPropagation(); setExpanded(item, !expanded); } }, _react2.default.createElement(_Svg2.default, { name: "arrow", className: (0, _classnames2.default)({ expanded, hidden: nodeIsPrimitive(item) }) }), _react2.default.createElement( "span", { className: "object-label" }, item.name ), _react2.default.createElement( "span", { className: "object-delimiter" }, objectValue ? ": " : "" ), _react2.default.createElement( "span", { className: "object-value" }, objectValue || "" ) ); } getObjectProperties(item) { this.props.loadedObjects[item.contents.value.objectId]; } getChildren(item) { const obj = item.contents; // Nodes can either have children already, or be an object with // properties that we need to go and fetch. if (nodeHasChildren(item)) { return item.contents; } else if (nodeHasProperties(item)) { const objectId = obj.value.objectId; // Because we are dynamically creating the tree as the user // expands it (not precalcuated tree structure), we cache child // arrays. This not only helps performance, but is necessary // because the expanded state depends on instances of nodes // being the same across renders. If we didn't do this, each // node would be a new instance every render. const key = item.path; if (this.objectCache[key]) { return this.objectCache[key]; } const loadedProps = this.getObjectProperties(item); if (loadedProps) { const children = this.makeNodesForProperties(loadedProps, item.path); this.objectCache[objectId] = children; return children; } return []; } return []; } onExpand(item) { const { loadObjectProperties } = this.props; if (nodeHasProperties(item)) { loadObjectProperties(item.contents.value); } } getRoots() { return this.props.scopes.map(scope => { const name = scope.name || (scope.type == "global" ? "Window" : ""); return { name: name, path: name, contents: { value: scope.object } }; }); } render() { const { pauseInfo } = this.props; if (!pauseInfo) { return _react2.default.createElement( "div", { className: (0, _classnames2.default)("pane", "scopes-list") }, _react2.default.createElement( "div", { className: "pane-info" }, L10N.getStr("scopes.notPaused") ) ); } const roots = this.getRoots(); return _react2.default.createElement( "div", { className: (0, _classnames2.default)("pane", "scopes-list") }, _react2.default.createElement(_ManagedTree2.default, { itemHeight: 20, getParent: item => null, getChildren: this.getChildren, getRoots: () => roots, getPath: item => item.path, autoExpand: 0, autoExpandDepth: 1, autoExpandAll: false, disabledFocus: true, onExpand: this.onExpand, renderItem: this.renderItem }) ); } } exports.default = (0, _reactRedux.connect)(state => ({ pauseInfo: (0, _selectors.getPause)(state), loadedObjects: (0, _selectors.getLoadedObjects)(state), scopes: (0, _selectors.getChromeScopes)(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Scopes); /***/ }), /* 1611 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(1189); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(1352); var _scopes = __webpack_require__(1792); var _devtoolsReps = __webpack_require__(1408); __webpack_require__(1296); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ class Scopes extends _react.PureComponent { constructor(props, ...args) { const { pauseInfo, selectedFrame, frameScopes } = props; super(props, ...args); this.state = { scopes: (0, _scopes.getScopes)(pauseInfo, selectedFrame, frameScopes) }; } componentWillReceiveProps(nextProps) { const { pauseInfo, selectedFrame, frameScopes } = this.props; const pauseInfoChanged = pauseInfo !== nextProps.pauseInfo; const selectedFrameChanged = selectedFrame !== nextProps.selectedFrame; const frameScopesChanged = frameScopes !== nextProps.frameScopes; if (pauseInfoChanged || selectedFrameChanged || frameScopesChanged) { this.setState({ scopes: (0, _scopes.getScopes)(nextProps.pauseInfo, nextProps.selectedFrame, nextProps.frameScopes) }); } } render() { const { pauseInfo, loadObjectProperties, loadedObjects } = this.props; const { scopes } = this.state; if (scopes) { return _react2.default.createElement( "div", { className: "pane scopes-list" }, _react2.default.createElement(_devtoolsReps.ObjectInspector, { roots: scopes, autoExpandAll: false, autoExpandDepth: 1, getObjectProperties: id => loadedObjects[id], loadObjectProperties: loadObjectProperties, disableWrap: true, disabledFocus: true, dimTopLevelWindow: true // TODO: See https://github.com/devtools-html/debugger.html/issues/3555. , getObjectEntries: actor => {}, loadObjectEntries: grip => {} }) ); } return _react2.default.createElement( "div", { className: "pane scopes-list" }, _react2.default.createElement( "div", { className: "pane-info" }, pauseInfo ? L10N.getStr("scopes.notAvailable") : L10N.getStr("scopes.notPaused") ) ); } } exports.default = (0, _reactRedux.connect)(state => { const selectedFrame = (0, _selectors.getSelectedFrame)(state); const frameScopes = selectedFrame ? (0, _selectors.getFrameScope)(state, selectedFrame.id) : null; return { selectedFrame, pauseInfo: (0, _selectors.getPause)(state), frameScopes: frameScopes, loadedObjects: (0, _selectors.getLoadedObjects)(state) }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Scopes); /***/ }), /* 1612 */, /* 1613 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(1352); var _text = __webpack_require__(1387); var _PaneToggle = __webpack_require__(1407); var _PaneToggle2 = _interopRequireDefault(_PaneToggle); __webpack_require__(1343); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ class WelcomeBox extends _react.Component { renderToggleButton() { const { horizontal, endPanelCollapsed, togglePaneCollapse } = this.props; if (horizontal) { return; } return _react2.default.createElement(_PaneToggle2.default, { position: "end", collapsed: !endPanelCollapsed, horizontal: horizontal, handleClick: togglePaneCollapse }); } render() { const searchSourcesShortcut = (0, _text.formatKeyShortcut)(L10N.getStr("sources.search.key2")); const searchProjectShortcut = (0, _text.formatKeyShortcut)(L10N.getStr("projectTextSearch.key")); const searchSourcesLabel = L10N.getStr("welcome.search").substring(2); const searchProjectLabel = L10N.getStr("welcome.findInFiles").substring(2); const { setActiveSearch, openQuickOpen } = this.props; return _react2.default.createElement( "div", { className: "welcomebox" }, _react2.default.createElement( "div", { className: "alignlabel small-size-layout" }, _react2.default.createElement( "div", { className: "shortcutFunction" }, _react2.default.createElement( "p", { onClick: () => openQuickOpen() }, _react2.default.createElement( "span", { className: "shortcutKey" }, searchSourcesShortcut ), searchSourcesLabel ), _react2.default.createElement( "p", { onClick: setActiveSearch.bind(null, "project") }, _react2.default.createElement( "span", { className: "shortcutKey" }, searchProjectShortcut ), searchProjectLabel ) ), this.renderToggleButton() ), _react2.default.createElement( "div", { className: "alignlabel normal-layout" }, _react2.default.createElement( "div", { className: "shortcutKeys" }, _react2.default.createElement( "p", { onClick: () => openQuickOpen() }, searchSourcesShortcut ), _react2.default.createElement( "p", { onClick: setActiveSearch.bind(null, "project") }, searchProjectShortcut ) ), _react2.default.createElement( "div", { className: "shortcutFunction" }, _react2.default.createElement( "p", { onClick: () => openQuickOpen() }, searchSourcesLabel ), _react2.default.createElement( "p", { onClick: setActiveSearch.bind(null, "project") }, searchProjectLabel ) ) ) ); } } exports.default = (0, _reactRedux.connect)(state => ({ endPanelCollapsed: (0, _selectors.getPaneCollapse)(state, "end") }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(WelcomeBox); /***/ }), /* 1614 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _immutable = __webpack_require__(146); var I = _interopRequireWildcard(_immutable); var _selectors = __webpack_require__(1352); var _ui = __webpack_require__(1439); var _source = __webpack_require__(1356); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _Close = __webpack_require__(1374); var _Close2 = _interopRequireDefault(_Close); var _devtoolsContextmenu = __webpack_require__(1413); var _lodash = __webpack_require__(2); __webpack_require__(1344); var _PaneToggle = __webpack_require__(1407); var _PaneToggle2 = _interopRequireDefault(_PaneToggle); var _Dropdown = __webpack_require__(1615); var _Dropdown2 = _interopRequireDefault(_Dropdown); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* * Finds the hidden tabs by comparing the tabs' top offset. * hidden tabs will have a great top offset. * * @param sourceTabs Immutable.list * @param sourceTabEls HTMLCollection * * @returns Immutable.list */ function getHiddenTabs(sourceTabs, sourceTabEls) { sourceTabEls = [].slice.call(sourceTabEls); function getTopOffset() { const topOffsets = sourceTabEls.map(t => t.getBoundingClientRect().top); return Math.min(...topOffsets); } function hasTopOffset(el) { // adding 10px helps account for cases where the tab might be offset by // styling such as selected tabs which don't have a border. const tabTopOffset = getTopOffset(); return el.getBoundingClientRect().top > tabTopOffset + 10; } return sourceTabs.filter((tab, index) => { const element = sourceTabEls[index]; return element && hasTopOffset(element); }); } /** * Clipboard function taken from * https://dxr.mozilla.org/mozilla-central/source/devtools/shared/platform/content/clipboard.js */ /* 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 . */ function copyToTheClipboard(string) { const doCopy = function (e) { e.clipboardData.setData("text/plain", string); e.preventDefault(); }; document.addEventListener("copy", doCopy); document.execCommand("copy", false, null); document.removeEventListener("copy", doCopy); } class SourceTabs extends _react.PureComponent { constructor(props) { super(props); this.state = { dropdownShown: false, hiddenSourceTabs: I.List() }; this.onTabContextMenu = this.onTabContextMenu.bind(this); this.showContextMenu = this.showContextMenu.bind(this); this.updateHiddenSourceTabs = this.updateHiddenSourceTabs.bind(this); this.toggleSourcesDropdown = this.toggleSourcesDropdown.bind(this); this.renderDropdownSource = this.renderDropdownSource.bind(this); this.renderTabs = this.renderTabs.bind(this); this.renderSourceTab = this.renderSourceTab.bind(this); this.renderSearchTab = this.renderSearchTab.bind(this); this.renderDropDown = this.renderDropdown.bind(this); this.renderStartPanelToggleButton = this.renderStartPanelToggleButton.bind(this); this.renderEndPanelToggleButton = this.renderEndPanelToggleButton.bind(this); this.onResize = (0, _lodash.debounce)(() => { this.updateHiddenSourceTabs(); }); } componentDidUpdate(prevProps) { if (!(prevProps === this.props)) { this.updateHiddenSourceTabs(); } } componentDidMount() { this.updateHiddenSourceTabs(); window.addEventListener("resize", this.onResize); } componentWillUnmount() { window.removeEventListener("resize", this.onResize); } onTabContextMenu(event, tab) { event.preventDefault(); this.showContextMenu(event, tab); } showContextMenu(e, tab) { const { closeTab, closeTabs, sourceTabs, showSource, togglePrettyPrint } = this.props; const closeTabLabel = L10N.getStr("sourceTabs.closeTab"); const closeOtherTabsLabel = L10N.getStr("sourceTabs.closeOtherTabs"); const closeTabsToEndLabel = L10N.getStr("sourceTabs.closeTabsToEnd"); const closeAllTabsLabel = L10N.getStr("sourceTabs.closeAllTabs"); const revealInTreeLabel = L10N.getStr("sourceTabs.revealInTree"); const copyLinkLabel = L10N.getStr("copySourceUri2"); const prettyPrintLabel = L10N.getStr("sourceTabs.prettyPrint"); const closeTabKey = L10N.getStr("sourceTabs.closeTab.accesskey"); const closeOtherTabsKey = L10N.getStr("sourceTabs.closeOtherTabs.accesskey"); const closeTabsToEndKey = L10N.getStr("sourceTabs.closeTabsToEnd.accesskey"); const closeAllTabsKey = L10N.getStr("sourceTabs.closeAllTabs.accesskey"); const revealInTreeKey = L10N.getStr("sourceTabs.revealInTree.accesskey"); const copyLinkKey = L10N.getStr("copySourceUri2.accesskey"); const prettyPrintKey = L10N.getStr("sourceTabs.prettyPrint.accesskey"); const tabs = sourceTabs.map(t => t.get("id")); const otherTabs = sourceTabs.filter(t => t.get("id") !== tab); const sourceTab = sourceTabs.find(t => t.get("id") == tab); const tabURLs = sourceTabs.map(thisTab => thisTab.get("url")); const otherTabURLs = otherTabs.map(thisTab => thisTab.get("url")); if (!sourceTab) { return; } const isPrettySource = (0, _source.isPretty)(sourceTab); const closeTabMenuItem = { id: "node-menu-close-tab", label: closeTabLabel, accesskey: closeTabKey, disabled: false, click: () => closeTab(sourceTab.get("url")) }; const closeOtherTabsMenuItem = { id: "node-menu-close-other-tabs", label: closeOtherTabsLabel, accesskey: closeOtherTabsKey, disabled: false, click: () => closeTabs(otherTabURLs) }; const closeTabsToEndMenuItem = { id: "node-menu-close-tabs-to-end", label: closeTabsToEndLabel, accesskey: closeTabsToEndKey, disabled: false, click: () => { const tabIndex = tabs.findIndex(t => t == tab); closeTabs(tabURLs.filter((t, i) => i > tabIndex)); } }; const closeAllTabsMenuItem = { id: "node-menu-close-all-tabs", label: closeAllTabsLabel, accesskey: closeAllTabsKey, disabled: false, click: () => closeTabs(tabURLs) }; const showSourceMenuItem = { id: "node-menu-show-source", label: revealInTreeLabel, accesskey: revealInTreeKey, disabled: false, click: () => showSource(tab) }; const copySourceUri2 = { id: "node-menu-copy-source-url", label: copyLinkLabel, accesskey: copyLinkKey, disabled: false, click: () => copyToTheClipboard(sourceTab.get("url")) }; const prettyPrint = { id: "node-menu-pretty-print", label: prettyPrintLabel, accesskey: prettyPrintKey, disabled: false, click: () => togglePrettyPrint(sourceTab.get("id")) }; const items = [{ item: closeTabMenuItem }, { item: closeOtherTabsMenuItem, hidden: () => tabs.size === 1 }, { item: closeTabsToEndMenuItem, hidden: () => tabs.some((t, i) => t === tab && tabs.size - 1 === i) }, { item: closeAllTabsMenuItem }, { item: { type: "separator" } }, { item: copySourceUri2 }]; if (!isPrettySource) { items.push({ item: showSourceMenuItem }); items.push({ item: prettyPrint }); } (0, _devtoolsContextmenu.showMenu)(e, (0, _devtoolsContextmenu.buildMenu)(items)); } /* * Updates the hiddenSourceTabs state, by * finding the source tabs which are wrapped and are not on the top row. */ updateHiddenSourceTabs() { if (!this.refs.sourceTabs) { return; } const { selectedSource, sourceTabs, moveTab } = this.props; const sourceTabEls = this.refs.sourceTabs.children; const hiddenSourceTabs = getHiddenTabs(sourceTabs, sourceTabEls); if ((0, _ui.isVisible)() && hiddenSourceTabs.indexOf(selectedSource) !== -1) { return moveTab(selectedSource.get("url"), 0); } this.setState({ hiddenSourceTabs }); } toggleSourcesDropdown(e) { this.setState({ dropdownShown: !this.state.dropdownShown }); } getIconClass(source) { if ((0, _source.isPretty)(source)) { return "prettyPrint"; } if (source.get("isBlackBoxed")) { return "blackBox"; } return "file"; } renderDropdownSource(source) { const { selectSource } = this.props; const filename = (0, _source.getFilename)(source.toJS()); const onClick = () => selectSource(source.get("id")); return _react2.default.createElement( "li", { key: source.get("id"), onClick: onClick }, _react2.default.createElement("img", { className: `dropdown-icon ${this.getIconClass(source)}` }), filename ); } renderTabs() { const { sourceTabs } = this.props; if (!sourceTabs) { return; } return _react2.default.createElement( "div", { className: "source-tabs", ref: "sourceTabs" }, sourceTabs.map(this.renderSourceTab) ); } isProjectSearchEnabled() { return this.props.activeSearch === "project"; } isSourceSearchEnabled() { return this.props.activeSearch === "source"; } renderSearchTab(source) { const { closeTab, closeActiveSearch, setActiveSearch } = this.props; function tabName(tab) { return `${tab} search results`; } function onClickClose(ev) { ev.stopPropagation(); closeActiveSearch(); closeTab(source); } const className = (0, _classnames2.default)("source-tab", { active: this.isProjectSearchEnabled() || this.isSourceSearchEnabled(), pretty: false }); return _react2.default.createElement( "div", { className: className, key: source, onClick: () => setActiveSearch(source), onContextMenu: e => this.onTabContextMenu(e, source), title: tabName(source) }, _react2.default.createElement( "div", { className: "filename" }, tabName(source) ), _react2.default.createElement(_Close2.default, { handleClick: onClickClose, tooltip: L10N.getStr("sourceTabs.closeTabButtonTooltip") }) ); } renderSourceTab(source) { const { selectedSource, selectSource, closeTab } = this.props; const filename = (0, _source.getFilename)(source.toJS()); const active = selectedSource && source.get("id") == selectedSource.get("id") && !this.isProjectSearchEnabled() && !this.isSourceSearchEnabled(); const isPrettyCode = (0, _source.isPretty)(source); const sourceAnnotation = this.getSourceAnnotation(source); function onClickClose(ev) { ev.stopPropagation(); closeTab(source.get("url")); } const className = (0, _classnames2.default)("source-tab", { active, pretty: isPrettyCode }); return _react2.default.createElement( "div", { className: className, key: source.get("id"), onClick: () => selectSource(source.get("id")), onContextMenu: e => this.onTabContextMenu(e, source.get("id")), title: (0, _source.getFileURL)(source.toJS()) }, sourceAnnotation, _react2.default.createElement( "div", { className: "filename" }, filename ), _react2.default.createElement(_Close2.default, { handleClick: onClickClose, tooltip: L10N.getStr("sourceTabs.closeTabButtonTooltip") }) ); } renderDropdown() { const hiddenSourceTabs = this.state.hiddenSourceTabs; if (!hiddenSourceTabs || hiddenSourceTabs.size == 0) { return null; } const Panel = _react2.default.createElement( "ul", null, hiddenSourceTabs.map(this.renderDropdownSource) ); return _react2.default.createElement(_Dropdown2.default, { panel: Panel, icon: "»" }); } renderStartPanelToggleButton() { return _react2.default.createElement(_PaneToggle2.default, { position: "start", collapsed: !this.props.startPanelCollapsed, handleClick: this.props.togglePaneCollapse }); } renderEndPanelToggleButton() { if (!this.props.horizontal) { return; } return _react2.default.createElement(_PaneToggle2.default, { position: "end", collapsed: !this.props.endPanelCollapsed, handleClick: this.props.togglePaneCollapse, horizontal: this.props.horizontal }); } getSourceAnnotation(source) { const sourceId = source.get("id"); const sourceMetaData = this.props.sourceTabsMetaData[sourceId]; if (sourceMetaData && sourceMetaData.isReactComponent) { return _react2.default.createElement("img", { className: "react" }); } if ((0, _source.isPretty)(source)) { return _react2.default.createElement("img", { className: "prettyPrint" }); } if (source.get("isBlackBoxed")) { return _react2.default.createElement("img", { className: "blackBox" }); } } render() { return _react2.default.createElement( "div", { className: "source-header" }, this.renderStartPanelToggleButton(), this.renderTabs(), this.renderDropdown(), this.renderEndPanelToggleButton() ); } } exports.default = (0, _reactRedux.connect)(state => { const sourceTabs = (0, _selectors.getSourcesForTabs)(state); const sourceTabsMetaData = {}; sourceTabs.forEach(source => { const sourceId = source ? source.get("id") : ""; sourceTabsMetaData[sourceId] = (0, _selectors.getSourceMetaData)(state, sourceId); }); return { selectedSource: (0, _selectors.getSelectedSource)(state), searchTabs: (0, _selectors.getSearchTabs)(state), sourceTabs: sourceTabs, activeSearch: (0, _selectors.getActiveSearch)(state), searchOn: (0, _selectors.getActiveSearch)(state) === "source", sourceTabsMetaData: sourceTabsMetaData }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(SourceTabs); /***/ }), /* 1615 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); __webpack_require__(1345); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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 . */ class Dropdown extends _react.Component { constructor(props) { super(props); this.state = { dropdownShown: false }; this.toggleDropdown = this.toggleDropdown.bind(this); this.renderPanel = this.renderPanel.bind(this); this.renderButton = this.renderButton.bind(this); this.renderMask = this.renderMask.bind(this); } toggleDropdown(e) { this.setState({ dropdownShown: !this.state.dropdownShown }); } renderPanel() { return _react2.default.createElement( "div", { className: "dropdown", onClick: this.toggleDropdown, style: { display: this.state.dropdownShown ? "block" : "none" } }, this.props.panel ); } renderButton() { return _react2.default.createElement( "button", { className: "dropdown-button", onClick: this.toggleDropdown }, this.props.icon ); } renderMask() { return _react2.default.createElement("div", { className: "dropdown-mask", onClick: this.toggleDropdown, style: { display: this.state.dropdownShown ? "block" : "none" } }); } render() { return _react2.default.createElement( "div", { className: "dropdown-block" }, this.renderPanel(), this.renderButton(), this.renderMask() ); } } exports.default = Dropdown; /***/ }), /* 1616 */, /* 1617 */, /* 1618 */, /* 1619 */, /* 1620 */, /* 1621 */, /* 1622 */, /* 1623 */, /* 1624 */, /* 1625 */, /* 1626 */, /* 1627 */, /* 1628 */, /* 1629 */, /* 1630 */, /* 1631 */, /* 1632 */, /* 1633 */, /* 1634 */, /* 1635 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.State = undefined; exports.default = update; exports.getQuickOpenEnabled = getQuickOpenEnabled; exports.getQuickOpenQuery = getQuickOpenQuery; exports.getQuickOpenType = getQuickOpenType; var _makeRecord = __webpack_require__(1361); var _makeRecord2 = _interopRequireDefault(_makeRecord); var _quickOpen = __webpack_require__(1636); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* 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/. */ /** * Quick Open reducer * @module reducers/quick-open */ const State = exports.State = (0, _makeRecord2.default)({ enabled: false, query: "", searchType: "sources" }); function update(state = State(), action) { switch (action.type) { case "OPEN_QUICK_OPEN": if (action.query != null) { return state.merge({ enabled: true, query: action.query, searchType: (0, _quickOpen.parseQuickOpenQuery)(action.query) }); } return state.set("enabled", true); case "CLOSE_QUICK_OPEN": return State(); case "SET_QUICK_OPEN_QUERY": return state.merge({ query: action.query, searchType: (0, _quickOpen.parseQuickOpenQuery)(action.query) }); default: return state; } } function getQuickOpenEnabled(state) { return state.quickOpen.get("enabled"); } function getQuickOpenQuery(state) { return state.quickOpen.get("query"); } function getQuickOpenType(state) { return state.quickOpen.get("searchType"); } /***/ }), /* 1636 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ exports.parseQuickOpenQuery = parseQuickOpenQuery; exports.parseLineColumn = parseLineColumn; exports.formatSymbol = formatSymbol; exports.formatSymbols = formatSymbols; exports.formatSources = formatSources; var _utils = __webpack_require__(1366); var _source = __webpack_require__(1356); function parseQuickOpenQuery(query) { const modifierPattern = /^@|#|\:$/; const gotoSourcePattern = /^(\w+)\:/; const startsWithModifier = modifierPattern.test(query[0]); const isGotoSource = gotoSourcePattern.test(query); if (startsWithModifier) { const modifiers = { "@": "functions", "#": "variables", ":": "goto" }; const modifier = query[0]; return modifiers[modifier]; } if (isGotoSource) { return "gotoSource"; } return "sources"; } function parseLineColumn(query) { const [, line, column] = query.split(":"); const lineNumber = parseInt(line, 10); const columnNumber = parseInt(column, 10); if (!isNaN(lineNumber)) { return _extends({ line: lineNumber }, !isNaN(columnNumber) ? { column: columnNumber } : null); } } function formatSymbol(symbol) { return { id: `${symbol.name}:${symbol.location.start.line}`, title: symbol.name, subtitle: `${symbol.location.start.line}`, value: symbol.name, location: symbol.location }; } function formatSymbols(symbols) { if (!symbols) { return { variables: [], functions: [] }; } const { variables, functions } = symbols; return { variables: variables.map(formatSymbol), functions: functions.map(formatSymbol) }; } function formatSources(sources) { return sources.valueSeq().filter(source => !(0, _source.isPretty)(source) && !(0, _source.isThirdParty)(source)).map(source => { const sourcePath = (0, _source.getSourcePath)(source.get("url")); return { value: sourcePath, title: sourcePath.split("/").pop(), subtitle: (0, _utils.endTruncateStr)(sourcePath, 100), id: source.get("id") }; }).filter(({ value }) => value != "").toJS(); } /***/ }), /* 1637 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.command = command; exports.stepIn = stepIn; exports.stepOver = stepOver; exports.stepOut = stepOut; exports.resume = resume; exports.astCommand = astCommand; var _selectors = __webpack_require__(1352); var _pause = __webpack_require__(1400); var _promise = __webpack_require__(1653); var _parser = __webpack_require__(1365); var _breakpoints = __webpack_require__(1396); var _prefs = __webpack_require__(226); /** * Debugger commands like stepOver, stepIn, stepUp * * @param string $0.type * @memberof actions/pause * @static */ /* 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 . */ function command(type) { return async ({ dispatch, client }) => { return dispatch({ type: "COMMAND", command: type, [_promise.PROMISE]: client[type]() }); }; } /** * StepIn * @memberof actions/pause * @static * @returns {Function} {@link command} */ function stepIn() { return ({ dispatch, getState }) => { if ((0, _selectors.getPause)(getState())) { return dispatch(command("stepIn")); } }; } /** * stepOver * @memberof actions/pause * @static * @returns {Function} {@link command} */ function stepOver() { return ({ dispatch, getState }) => { if ((0, _selectors.getPause)(getState())) { return dispatch(astCommand("stepOver")); } }; } /** * stepOut * @memberof actions/pause * @static * @returns {Function} {@link command} */ function stepOut() { return ({ dispatch, getState }) => { if ((0, _selectors.getPause)(getState())) { return dispatch(command("stepOut")); } }; } /** * resume * @memberof actions/pause * @static * @returns {Function} {@link command} */ function resume() { return ({ dispatch, getState }) => { if ((0, _selectors.getPause)(getState())) { return dispatch(command("resume")); } }; } /** * @memberOf actions/pause * @static * @param stepType * @returns {function(ThunkArgs)} */ function astCommand(stepType) { return async ({ dispatch, getState, sourceMaps }) => { if (!_prefs.features.asyncStepping) { return dispatch(command(stepType)); } const pauseInfo = (0, _selectors.getPause)(getState()); const source = (0, _selectors.getSelectedSource)(getState()).toJS(); const pausedPosition = await (0, _pause.getPausedPosition)(pauseInfo, sourceMaps); if (stepType == "stepOver") { const nextLocation = await (0, _parser.getNextStep)(source, pausedPosition); if (nextLocation) { await dispatch((0, _breakpoints.addHiddenBreakpoint)(nextLocation)); return dispatch(command("resume")); } } return dispatch(command(stepType)); }; } /***/ }), /* 1638 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.findBestMatchExpression = findBestMatchExpression; /* 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 . */ function findBestMatchExpression(symbols, tokenPos, token) { const { memberExpressions, identifiers } = symbols; const { line, column } = tokenPos; return identifiers.concat(memberExpressions).reduce((found, expression) => { const overlaps = expression.location.start.line == line && expression.location.start.column <= column && expression.location.end.column >= column && !expression.computed; if (overlaps) { return expression; } return found; }, {}); } /***/ }), /* 1639 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _commands = __webpack_require__(1637); Object.defineProperty(exports, "stepIn", { enumerable: true, get: function () { return _commands.stepIn; } }); Object.defineProperty(exports, "stepOver", { enumerable: true, get: function () { return _commands.stepOver; } }); Object.defineProperty(exports, "stepOut", { enumerable: true, get: function () { return _commands.stepOut; } }); Object.defineProperty(exports, "resume", { enumerable: true, get: function () { return _commands.resume; } }); var _fetchScopes = __webpack_require__(1655); Object.defineProperty(exports, "fetchScopes", { enumerable: true, get: function () { return _fetchScopes.fetchScopes; } }); var _paused = __webpack_require__(1640); Object.defineProperty(exports, "paused", { enumerable: true, get: function () { return _paused.paused; } }); var _resumed = __webpack_require__(1641); Object.defineProperty(exports, "resumed", { enumerable: true, get: function () { return _resumed.resumed; } }); var _continueToHere = __webpack_require__(1642); Object.defineProperty(exports, "continueToHere", { enumerable: true, get: function () { return _continueToHere.continueToHere; } }); var _breakOnNext = __webpack_require__(1643); Object.defineProperty(exports, "breakOnNext", { enumerable: true, get: function () { return _breakOnNext.breakOnNext; } }); var _loadObjectProperties = __webpack_require__(1644); Object.defineProperty(exports, "loadObjectProperties", { enumerable: true, get: function () { return _loadObjectProperties.loadObjectProperties; } }); var _pauseOnExceptions = __webpack_require__(1645); Object.defineProperty(exports, "pauseOnExceptions", { enumerable: true, get: function () { return _pauseOnExceptions.pauseOnExceptions; } }); var _selectFrame = __webpack_require__(1646); Object.defineProperty(exports, "selectFrame", { enumerable: true, get: function () { return _selectFrame.selectFrame; } }); /***/ }), /* 1640 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.paused = paused; var _selectors = __webpack_require__(1352); var _pause = __webpack_require__(1400); var _breakpoints = __webpack_require__(1396); var _expressions = __webpack_require__(1398); var _sources = __webpack_require__(1373); var _ui = __webpack_require__(1385); var _fetchScopes = __webpack_require__(1655); /** * Debugger has just paused * * @param {object} pauseInfo * @memberof actions/pause * @static */ function paused(pauseInfo) { return async function ({ dispatch, getState, client, sourceMaps }) { const { frames, why, loadedObjects } = pauseInfo; const mappedFrames = await (0, _pause.updateFrameLocations)(frames, sourceMaps); const frame = mappedFrames[0]; dispatch({ type: "PAUSED", pauseInfo: { why, frame, frames }, frames: mappedFrames, selectedFrameId: frame.id, loadedObjects: loadedObjects || [] }); const hiddenBreakpointLocation = (0, _selectors.getHiddenBreakpointLocation)(getState()); if (hiddenBreakpointLocation) { dispatch((0, _breakpoints.removeBreakpoint)(hiddenBreakpointLocation)); } if (!(0, _selectors.isEvaluatingExpression)(getState())) { dispatch((0, _expressions.evaluateExpressions)()); } await dispatch((0, _sources.selectLocation)(frame.location)); dispatch((0, _ui.togglePaneCollapse)("end", false)); dispatch((0, _fetchScopes.fetchScopes)()); }; } /* 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 . */ /***/ }), /* 1641 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.resumed = resumed; var _selectors = __webpack_require__(1352); var _expressions = __webpack_require__(1398); var _pause = __webpack_require__(1400); /** * Debugger has just resumed * * @memberof actions/pause * @static */ function resumed() { return async ({ dispatch, client, getState }) => { const why = (0, _selectors.getPauseReason)(getState()); const wasPausedInEval = (0, _pause.inDebuggerEval)(why); if (!(0, _selectors.isStepping)(getState()) && !wasPausedInEval) { await dispatch((0, _expressions.evaluateExpressions)()); } dispatch({ type: "RESUME" }); }; } /* 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 . */ /***/ }), /* 1642 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.continueToHere = continueToHere; var _selectors = __webpack_require__(1352); var _breakpoints = __webpack_require__(1396); var _commands = __webpack_require__(1637); function continueToHere(line) { return async function ({ dispatch, getState }) { const source = (0, _selectors.getSelectedSource)(getState()).toJS(); await dispatch((0, _breakpoints.addHiddenBreakpoint)({ line, column: undefined, sourceId: source.id })); dispatch((0, _commands.resume)()); }; } /* 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 . */ /***/ }), /* 1643 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.breakOnNext = breakOnNext; /** * Debugger breakOnNext command. * It's different from the comand action because we also want to * highlight the pause icon. * * @memberof actions/pause * @static */ function breakOnNext() { return ({ dispatch, client }) => { client.breakOnNext(); return dispatch({ type: "BREAK_ON_NEXT", value: true }); }; } /* 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 . */ /***/ }), /* 1644 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.loadObjectProperties = loadObjectProperties; var _promise = __webpack_require__(1653); var _selectors = __webpack_require__(1352); /** * @memberof actions/pause * @static */ /* 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 . */ function loadObjectProperties(object) { return ({ dispatch, client, getState }) => { const objectId = object.actor || object.objectId; if ((0, _selectors.getLoadedObject)(getState(), objectId)) { return; } dispatch({ type: "LOAD_OBJECT_PROPERTIES", objectId, [_promise.PROMISE]: client.getProperties(object) }); }; } /***/ }), /* 1645 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.pauseOnExceptions = pauseOnExceptions; var _promise = __webpack_require__(1653); /** * * @memberof actions/pause * @static */ function pauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) { return ({ dispatch, client }) => { dispatch({ type: "PAUSE_ON_EXCEPTIONS", shouldPauseOnExceptions, shouldIgnoreCaughtExceptions, [_promise.PROMISE]: client.pauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) }); }; } /* 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 . */ /***/ }), /* 1646 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.selectFrame = selectFrame; var _sources = __webpack_require__(1373); var _expressions = __webpack_require__(1398); var _fetchScopes = __webpack_require__(1655); /** * @memberof actions/pause * @static */ function selectFrame(frame) { return async ({ dispatch, client, getState, sourceMaps }) => { dispatch({ type: "SELECT_FRAME", frame }); dispatch((0, _sources.selectLocation)(frame.location)); dispatch((0, _expressions.evaluateExpressions)()); dispatch((0, _fetchScopes.fetchScopes)()); }; } /* 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 . */ /***/ }), /* 1647 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setQuickOpenQuery = setQuickOpenQuery; exports.openQuickOpen = openQuickOpen; exports.closeQuickOpen = closeQuickOpen; function setQuickOpenQuery(query) { return { type: "SET_QUICK_OPEN_QUERY", query }; } /* 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 . */ function openQuickOpen(query) { if (query != null) { return { type: "OPEN_QUICK_OPEN", query }; } return { type: "OPEN_QUICK_OPEN" }; } function closeQuickOpen() { return { type: "CLOSE_QUICK_OPEN" }; } /***/ }), /* 1648 */ /***/ (function(module, exports) { module.exports = "image/svg+xml" /***/ }), /* 1649 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1650 */ /***/ (function(module, exports) { module.exports = "Zeit - Black on white logo" /***/ }), /* 1651 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1652 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.QuickOpenModal = undefined; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _reactRedux = __webpack_require__(1189); var _redux = __webpack_require__(3); var _fuzzaldrinPlus = __webpack_require__(161); var _actions = __webpack_require__(1354); var _actions2 = _interopRequireDefault(_actions); var _selectors = __webpack_require__(1352); var _resultList = __webpack_require__(1406); var _quickOpen = __webpack_require__(1636); var _Modal = __webpack_require__(1403); var _Modal2 = _interopRequireDefault(_Modal); var _SearchInput = __webpack_require__(1379); var _SearchInput2 = _interopRequireDefault(_SearchInput); var _ResultList = __webpack_require__(1445); var _ResultList2 = _interopRequireDefault(_ResultList); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class QuickOpenModal extends _react.Component { constructor(props) { super(props); this.closeModal = () => { this.props.closeQuickOpen(); }; this.searchSources = query => { if (query == "") { const results = this.props.sources; this.setState({ results }); return; } const { searchType } = this.props; if (searchType === "gotoSource") { const [baseQuery] = query.split(":"); const results = (0, _fuzzaldrinPlus.filter)(this.props.sources, baseQuery, { key: "value" }); this.setState({ results }); } else { const results = (0, _fuzzaldrinPlus.filter)(this.props.sources, query, { key: "value" }); this.setState({ results }); } }; this.searchSymbols = query => { const { symbols: { functions, variables }, searchType } = this.props; let results = functions; if (searchType === "variables") { results = variables; } if (query === "@" || query === "#") { this.setState({ results }); return; } results = (0, _fuzzaldrinPlus.filter)(results, query.slice(1), { key: "value" }); this.setState({ results }); }; this.updateResults = query => { if (this.isSymbolSearch()) { return this.searchSymbols(query); } return this.searchSources(query); }; this.selectResultItem = (e, item) => { if (item == null) { return; } const { selectLocation, selectedSource, query, searchType } = this.props; if (this.isSymbolSearch()) { if (selectedSource == null) { return; } const line = item.location && item.location.start ? item.location.start.line : 0; selectLocation({ sourceId: selectedSource.get("id"), line }); } else if (searchType === "gotoSource") { const location = (0, _quickOpen.parseLineColumn)(query); if (location != null) { selectLocation(_extends({}, location, { sourceId: item.id })); } } else { selectLocation({ sourceId: item.id, line: 0 }); } this.closeModal(); }; this.onSelectResultItem = item => { const { selectLocation, selectedSource, highlightLineRange, searchType } = this.props; if (!this.isSymbolSearch() || selectedSource == null) { return; } if (searchType === "variables") { const line = item.location && item.location.start ? item.location.start.line : 0; selectLocation({ sourceId: selectedSource.get("id"), line }); } if (searchType === "functions") { highlightLineRange(_extends({}, item.location != null ? { start: item.location.start.line, end: item.location.end.line } : {}, { sourceId: selectedSource.get("id") })); } }; this.traverseResults = direction => { const { selectedIndex, results } = this.state; const resultCount = this.resultCount(); const index = selectedIndex + direction; const nextIndex = (index + resultCount) % resultCount; this.setState({ selectedIndex: nextIndex }); if (results != null) { this.onSelectResultItem(results[nextIndex]); } }; this.onChange = e => { const { selectedSource, setQuickOpenQuery } = this.props; setQuickOpenQuery(e.target.value); const noSource = !selectedSource || !selectedSource.get("text"); if (this.isSymbolSearch() && noSource) { return; } this.updateResults(e.target.value); }; this.onKeyDown = e => { const { selectLocation, selectedSource, enabled, query, searchType } = this.props; const { results, selectedIndex } = this.state; if (!enabled || !results) { return; } const canTraverse = searchType !== "goto"; if (e.key === "ArrowUp" && canTraverse) { return this.traverseResults(-1); } else if (e.key === "ArrowDown" && canTraverse) { return this.traverseResults(1); } else if (e.key === "Enter") { if (searchType === "goto") { if (!selectedSource) { return; } const location = (0, _quickOpen.parseLineColumn)(query); if (location != null) { selectLocation(_extends({}, location, { sourceId: selectedSource.get("id") })); } } else { this.selectResultItem(e, results[selectedIndex]); } return this.closeModal(); } else if (e.key === "Tab") { return this.closeModal(); } }; this.resultCount = () => { const results = this.state.results; if (results && results.length) { return results.length; } return 0; }; this.isSymbolSearch = () => ["functions", "variables"].includes(this.props.searchType); this.state = { results: null, selectedIndex: 0 }; } componentDidMount() { this.updateResults(this.props.query); } componentDidUpdate(prevProps) { if (this.refs.resultList && this.refs.resultList.refs) { (0, _resultList.scrollList)(this.refs.resultList.refs, this.state.selectedIndex); } const nowEnabled = !prevProps.enabled && this.props.enabled; const queryChanged = prevProps.query !== this.props.query; if (nowEnabled || queryChanged) { this.updateResults(this.props.query); } } renderResults() { const { enabled, searchType } = this.props; const { selectedIndex, results } = this.state; if (!enabled || !results) { return null; } return _react2.default.createElement(_ResultList2.default, _extends({ key: "results", items: results, selected: selectedIndex, selectItem: this.selectResultItem, ref: "resultList" }, searchType === "sources" || searchType === "gotoSource" ? { size: "big" } : {})); } renderInput() { const { query, searchType } = this.props; const summaryMsg = L10N.getFormatStr("sourceSearch.resultsSummary1", this.resultCount()); const showSummary = searchType === "sources" || searchType === "functions" || searchType === "variables"; return _react2.default.createElement( "div", { key: "input", className: "input-wrapper" }, _react2.default.createElement(_SearchInput2.default, _extends({ query: query, count: this.resultCount(), placeholder: L10N.getStr("sourceSearch.search") }, showSummary === true ? { summaryMsg } : {}, { onChange: this.onChange, onKeyDown: this.onKeyDown, handleClose: this.closeModal })) ); } render() { const { enabled } = this.props; if (!enabled) { return null; } return _react2.default.createElement( _Modal2.default, { "in": enabled, handleClose: this.closeModal }, this.renderInput(), this.renderResults() ); } } exports.QuickOpenModal = QuickOpenModal; function mapStateToProps(state) { const selectedSource = (0, _selectors.getSelectedSource)(state); let symbols = null; if (selectedSource != null) { symbols = (0, _selectors.getSymbols)(state, selectedSource.toJS()); } return { enabled: (0, _selectors.getQuickOpenEnabled)(state), sources: (0, _quickOpen.formatSources)((0, _selectors.getSources)(state)), selectedSource, symbols: (0, _quickOpen.formatSymbols)(symbols), query: (0, _selectors.getQuickOpenQuery)(state), searchType: (0, _selectors.getQuickOpenType)(state) }; } exports.default = (0, _reactRedux.connect)(mapStateToProps, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(QuickOpenModal); /***/ }), /* 1653 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.promise = exports.PROMISE = undefined; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ var _lodash = __webpack_require__(2); var _DevToolsUtils = __webpack_require__(1432); let seqIdVal = 1; function seqIdGen() { return seqIdVal++; } function filterAction(action) { return (0, _lodash.fromPairs)((0, _lodash.toPairs)(action).filter(pair => pair[0] !== PROMISE)); } function promiseMiddleware({ dispatch, getState }) { return next => action => { if (!(PROMISE in action)) { return next(action); } const promiseInst = action[PROMISE]; const seqId = seqIdGen().toString(); // Create a new action that doesn't have the promise field and has // the `seqId` field that represents the sequence id action = _extends({}, filterAction(action), { seqId }); dispatch(_extends({}, action, { status: "start" })); // Return the promise so action creators can still compose if they // want to. return new Promise((resolve, reject) => { promiseInst.then(value => { (0, _DevToolsUtils.executeSoon)(() => { dispatch(_extends({}, action, { status: "done", value: value })); resolve(value); }); }, error => { (0, _DevToolsUtils.executeSoon)(() => { dispatch(_extends({}, action, { status: "error", error: error.message || error })); reject(error); }); }); }); }; } const PROMISE = exports.PROMISE = "@@dispatch/promise"; exports.promise = promiseMiddleware; /***/ }), /* 1654 */, /* 1655 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fetchScopes = fetchScopes; var _selectors = __webpack_require__(1352); var _prefs = __webpack_require__(226); var _devtoolsSourceMap = __webpack_require__(1360); var _loadSourceText = __webpack_require__(1435); var _parser = __webpack_require__(1365); var _updateScopeBindings = __webpack_require__(1784); /* 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 . */ function mapScopes(scopes, frame) { return async function ({ dispatch, getState, client, sourceMaps }) { const mappedScopes = await (0, _updateScopeBindings.updateScopeBindings)(scopes, frame.generatedLocation, frame.location, { async getSourceMapsScopes(location) { const astScopes = await (0, _parser.getScopes)(location); return sourceMaps.getLocationScopes(location, astScopes); }, async getOriginalSourceScopes(location) { const source = (0, _selectors.getSource)(getState(), location.sourceId); await dispatch((0, _loadSourceText.loadSourceText)(source)); return (0, _parser.getScopes)(location); } }); dispatch({ type: "MAP_SCOPES", frame, scopes: mappedScopes }); }; } // eslint-disable-next-line max-len function fetchScopes() { return async function ({ dispatch, getState, client, sourceMaps }) { const frame = (0, _selectors.getSelectedFrame)(getState()); if (!frame || (0, _selectors.getFrameScope)(getState(), frame.id)) { return; } const scopes = await client.getFrameScopes(frame); dispatch({ type: "ADD_SCOPES", frame, scopes }); const generatedSourceRecord = (0, _selectors.getSource)(getState(), frame.generatedLocation.sourceId); if (generatedSourceRecord.get("isWasm")) { return; } const sourceRecord = (0, _selectors.getSource)(getState(), frame.location.sourceId); if (sourceRecord.get("isPrettyPrinted")) { return; } if ((0, _devtoolsSourceMap.isGeneratedId)(frame.location.sourceId)) { return; } if (_prefs.features.mapScopes) { dispatch(mapScopes(scopes, frame)); } }; } /***/ }), /* 1656 */, /* 1657 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getAsyncTimes = getAsyncTimes; exports.steppingTimings = steppingTimings; var _lodash = __webpack_require__(2); function getAsyncTimes(name) { return (0, _lodash.zip)(window.performance.getEntriesByName(`${name}_start`), window.performance.getEntriesByName(`${name}_end`)).map(([start, end]) => +(end.startTime - start.startTime).toPrecision(2)); } /* 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 . */ function getTimes(name) { return window.performance.getEntriesByName(name).map(time => +time.duration.toPrecision(2)); } function getStats(times) { if (times.length == 0) { return { times: [], avg: null, median: null }; } const avg = times.reduce((sum, time) => time + sum, 0) / times.length; const sortedtimings = [...times].sort((a, b) => a - b); const median = sortedtimings[times.length / 2]; return { times, avg: +avg.toPrecision(2), median: +median.toPrecision(2) }; } function steppingTimings() { const commandTimings = getAsyncTimes("COMMAND"); const pausedTimings = getTimes("PAUSED"); return { commands: getStats(commandTimings), paused: getStats(pausedTimings) }; } // console.log("..", asyncTimes("COMMAND")); /***/ }), /* 1658 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _redux = __webpack_require__(3); var _waitService = __webpack_require__(1659); var _log = __webpack_require__(1660); var _history = __webpack_require__(1661); var _promise = __webpack_require__(1653); var _thunk = __webpack_require__(1662); var _timing = __webpack_require__(1663); /** * This creates a dispatcher with all the standard middleware in place * that all code requires. It can also be optionally configured in * various ways, such as logging and recording. * * @param {object} opts: * - log: log all dispatched actions to console * - history: an array to store every action in. Should only be * used in tests. * - middleware: array of middleware to be included in the redux store * @memberof utils/create-store * @static */ /** * @memberof utils/create-store * @static */ const configureStore = (opts = {}) => { const middleware = [(0, _thunk.thunk)(opts.makeThunkArgs), _promise.promise, // Order is important: services must go last as they always // operate on "already transformed" actions. Actions going through // them shouldn't have any special fields like promises, they // should just be normal JSON objects. _waitService.waitUntilService]; if (opts.history) { middleware.push((0, _history.history)(opts.history)); } if (opts.middleware) { opts.middleware.forEach(fn => middleware.push(fn)); } if (opts.log) { middleware.push(_log.log); } if (opts.timing) { middleware.push(_timing.timing); } // Hook in the redux devtools browser extension if it exists const devtoolsExt = typeof window === "object" && window.devToolsExtension ? window.devToolsExtension() : f => f; return (0, _redux.applyMiddleware)(...middleware)(devtoolsExt(_redux.createStore)); }; /* 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 . */ /* global window */ /** * Redux store utils * @module utils/create-store */ exports.default = configureStore; /***/ }), /* 1659 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.waitUntilService = waitUntilService; /* 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 . */ /* global window */ /** * A middleware which acts like a service, because it is stateful * and "long-running" in the background. It provides the ability * for actions to install a function to be run once when a specific * condition is met by an action coming through the system. Think of * it as a thunk that blocks until the condition is met. Example: * * ```js * const services = { WAIT_UNTIL: require('wait-service').NAME }; * * { type: services.WAIT_UNTIL, * predicate: action => action.type === "ADD_ITEM", * run: (dispatch, getState, action) => { * // Do anything here. You only need to accept the arguments * // if you need them. `action` is the action that satisfied * // the predicate. * } * } * ``` */ const NAME = exports.NAME = "@@service/waitUntil"; function waitUntilService({ dispatch, getState }) { let pending = []; function checkPending(action) { const readyRequests = []; const stillPending = []; // Find the pending requests whose predicates are satisfied with // this action. Wait to run the requests until after we update the // pending queue because the request handler may synchronously // dispatch again and run this service (that use case is // completely valid). for (const request of pending) { if (request.predicate(action)) { readyRequests.push(request); } else { stillPending.push(request); } } pending = stillPending; for (const request of readyRequests) { request.run(dispatch, getState, action); } } return next => action => { if (action.type === NAME) { pending.push(action); return null; } const result = next(action); checkPending(action); return result; }; } /***/ }), /* 1660 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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/. */ /* global window */ exports.log = log; var _devtoolsConfig = __webpack_require__(1355); const blacklist = ["LOAD_OBJECT_PROPERTIES", "SET_SYMBOLS", "OUT_OF_SCOPE_LOCATIONS"]; function cloneAction(action) { action = action || {}; action = _extends({}, action); // ADD_TAB, ... if (action.source && action.source.text) { const source = _extends({}, action.source, { text: "" }); action.source = source; } // LOAD_SOURCE_TEXT if (action.text) { action.text = ""; } if (action.value && action.value.text) { const value = _extends({}, action.value, { text: "" }); action.value = value; } return action; } function formatFrame(frame) { const { id, location, displayName } = frame; return { id, location, displayName }; } function formatPause(pause) { return _extends({}, pause, { pauseInfo: { why: pause.pauseInfo.why }, scopes: [], frames: pause.frames.map(formatFrame), loadedObjects: [] }); } function serializeAction(action) { try { action = cloneAction(action); if (blacklist.includes(action.type)) { action = {}; } if (action.type === "PAUSED") { action = formatPause(action); } // dump(`> ${action.type}...\n ${JSON.stringify(action)}\n`); return JSON.stringify(action); } catch (e) { console.error(e); } } /** * A middleware that logs all actions coming through the system * to the console. */ function log({ dispatch, getState }) { return next => action => { const asyncMsg = !action.status ? "" : `[${action.status}]`; if ((0, _devtoolsConfig.isTesting)()) { dump(`[ACTION] ${action.type} ${asyncMsg} - ${serializeAction(action)}\n`); } else { console.log(action, asyncMsg); } next(action); }; } /***/ }), /* 1661 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.history = undefined; var _devtoolsConfig = __webpack_require__(1355); /** * A middleware that stores every action coming through the store in the passed * in logging object. Should only be used for tests, as it collects all * action information, which will cause memory bloat. */ const history = exports.history = (log = []) => ({ dispatch, getState }) => { return next => action => { if ((0, _devtoolsConfig.isDevelopment)()) { log.push(action); } return next(action); }; }; /* 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 . */ /* global window */ /***/ }), /* 1662 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.thunk = thunk; /** * A middleware that allows thunks (functions) to be dispatched. If * it's a thunk, it is called with an argument that contains * `dispatch`, `getState`, and any additional args passed in via the * middleware constructure. This allows the action to create multiple * actions (most likely asynchronously). */ function thunk(makeArgs) { return ({ dispatch, getState }) => { const args = { dispatch, getState }; return next => action => { return typeof action === "function" ? action(makeArgs ? makeArgs(args, getState()) : args) : next(action); }; }; } /* 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 . */ /* global window */ /***/ }), /* 1663 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.timing = timing; /* 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/. */ /* global window */ /** * Redux middleware that sets performance markers for all actions such that they * will appear in performance tooling under the User Timing API */ const mark = window.performance && window.performance.mark ? window.performance.mark.bind(window.performance) : () => {}; const measure = window.performance && window.performance.measure ? window.performance.measure.bind(window.performance) : () => {}; function timing(store) { return next => action => { mark(`${action.type}_start`); const result = next(action); mark(`${action.type}_end`); measure(`${action.type}`, `${action.type}_start`, `${action.type}_end`); return result; }; } /***/ }), /* 1664 */, /* 1665 */, /* 1666 */, /* 1667 */, /* 1668 */, /* 1669 */, /* 1670 */, /* 1671 */, /* 1672 */, /* 1673 */, /* 1674 */, /* 1675 */, /* 1676 */, /* 1677 */, /* 1678 */, /* 1679 */, /* 1680 */, /* 1681 */, /* 1682 */, /* 1683 */, /* 1684 */, /* 1685 */, /* 1686 */, /* 1687 */, /* 1688 */, /* 1689 */, /* 1690 */, /* 1691 */, /* 1692 */, /* 1693 */, /* 1694 */, /* 1695 */, /* 1696 */, /* 1697 */, /* 1698 */, /* 1699 */, /* 1700 */, /* 1701 */, /* 1702 */, /* 1703 */, /* 1704 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); __webpack_require__(1705); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const Badge = ({ children }) => _react2.default.createElement( "div", { className: "badge text-white text-center" }, children ); exports.default = Badge; /***/ }), /* 1705 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1706 */, /* 1707 */, /* 1708 */, /* 1709 */, /* 1710 */, /* 1711 */, /* 1712 */, /* 1713 */, /* 1714 */, /* 1715 */, /* 1716 */, /* 1717 */, /* 1718 */, /* 1719 */, /* 1720 */, /* 1721 */, /* 1722 */, /* 1723 */, /* 1724 */, /* 1725 */, /* 1726 */, /* 1727 */, /* 1728 */, /* 1729 */, /* 1730 */, /* 1731 */, /* 1732 */, /* 1733 */ /***/ (function(module, exports) { module.exports = "" /***/ }), /* 1734 */, /* 1735 */, /* 1736 */, /* 1737 */, /* 1738 */, /* 1739 */, /* 1740 */, /* 1741 */, /* 1742 */, /* 1743 */, /* 1744 */, /* 1745 */, /* 1746 */, /* 1747 */, /* 1748 */, /* 1749 */, /* 1750 */, /* 1751 */, /* 1752 */, /* 1753 */, /* 1754 */, /* 1755 */, /* 1756 */, /* 1757 */, /* 1758 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2015-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. */ (function(f) { if (true) { module.exports = f(__webpack_require__(0)); /* global define */ } else if (typeof define === 'function' && define.amd) { define(['react'], f); } else { var g; if (typeof window !== 'undefined') { g = window; } else if (typeof global !== 'undefined') { g = global; } else if (typeof self !== 'undefined') { g = self; } else { g = this; } if (typeof g.React === 'undefined') { throw Error('React module should be required before ReactDOMFactories'); } g.ReactDOMFactories = f(g.React); } })(function(React) { /** * Create a factory that creates HTML tag elements. */ function createDOMFactory(type) { var factory = React.createElement.bind(null, type); // Expose the type on the factory and the prototype so that it can be // easily accessed on elements. E.g. `.type === Foo`. // This should not be named `constructor` since this may not be the function // that created the element, and it may not even be a constructor. factory.type = type; return factory; }; /** * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes. */ var ReactDOMFactories = { a: createDOMFactory('a'), abbr: createDOMFactory('abbr'), address: createDOMFactory('address'), area: createDOMFactory('area'), article: createDOMFactory('article'), aside: createDOMFactory('aside'), audio: createDOMFactory('audio'), b: createDOMFactory('b'), base: createDOMFactory('base'), bdi: createDOMFactory('bdi'), bdo: createDOMFactory('bdo'), big: createDOMFactory('big'), blockquote: createDOMFactory('blockquote'), body: createDOMFactory('body'), br: createDOMFactory('br'), button: createDOMFactory('button'), canvas: createDOMFactory('canvas'), caption: createDOMFactory('caption'), cite: createDOMFactory('cite'), code: createDOMFactory('code'), col: createDOMFactory('col'), colgroup: createDOMFactory('colgroup'), data: createDOMFactory('data'), datalist: createDOMFactory('datalist'), dd: createDOMFactory('dd'), del: createDOMFactory('del'), details: createDOMFactory('details'), dfn: createDOMFactory('dfn'), dialog: createDOMFactory('dialog'), div: createDOMFactory('div'), dl: createDOMFactory('dl'), dt: createDOMFactory('dt'), em: createDOMFactory('em'), embed: createDOMFactory('embed'), fieldset: createDOMFactory('fieldset'), figcaption: createDOMFactory('figcaption'), figure: createDOMFactory('figure'), footer: createDOMFactory('footer'), form: createDOMFactory('form'), h1: createDOMFactory('h1'), h2: createDOMFactory('h2'), h3: createDOMFactory('h3'), h4: createDOMFactory('h4'), h5: createDOMFactory('h5'), h6: createDOMFactory('h6'), head: createDOMFactory('head'), header: createDOMFactory('header'), hgroup: createDOMFactory('hgroup'), hr: createDOMFactory('hr'), html: createDOMFactory('html'), i: createDOMFactory('i'), iframe: createDOMFactory('iframe'), img: createDOMFactory('img'), input: createDOMFactory('input'), ins: createDOMFactory('ins'), kbd: createDOMFactory('kbd'), keygen: createDOMFactory('keygen'), label: createDOMFactory('label'), legend: createDOMFactory('legend'), li: createDOMFactory('li'), link: createDOMFactory('link'), main: createDOMFactory('main'), map: createDOMFactory('map'), mark: createDOMFactory('mark'), menu: createDOMFactory('menu'), menuitem: createDOMFactory('menuitem'), meta: createDOMFactory('meta'), meter: createDOMFactory('meter'), nav: createDOMFactory('nav'), noscript: createDOMFactory('noscript'), object: createDOMFactory('object'), ol: createDOMFactory('ol'), optgroup: createDOMFactory('optgroup'), option: createDOMFactory('option'), output: createDOMFactory('output'), p: createDOMFactory('p'), param: createDOMFactory('param'), picture: createDOMFactory('picture'), pre: createDOMFactory('pre'), progress: createDOMFactory('progress'), q: createDOMFactory('q'), rp: createDOMFactory('rp'), rt: createDOMFactory('rt'), ruby: createDOMFactory('ruby'), s: createDOMFactory('s'), samp: createDOMFactory('samp'), script: createDOMFactory('script'), section: createDOMFactory('section'), select: createDOMFactory('select'), small: createDOMFactory('small'), source: createDOMFactory('source'), span: createDOMFactory('span'), strong: createDOMFactory('strong'), style: createDOMFactory('style'), sub: createDOMFactory('sub'), summary: createDOMFactory('summary'), sup: createDOMFactory('sup'), table: createDOMFactory('table'), tbody: createDOMFactory('tbody'), td: createDOMFactory('td'), textarea: createDOMFactory('textarea'), tfoot: createDOMFactory('tfoot'), th: createDOMFactory('th'), thead: createDOMFactory('thead'), time: createDOMFactory('time'), title: createDOMFactory('title'), tr: createDOMFactory('tr'), track: createDOMFactory('track'), u: createDOMFactory('u'), ul: createDOMFactory('ul'), var: createDOMFactory('var'), video: createDOMFactory('video'), wbr: createDOMFactory('wbr'), // SVG circle: createDOMFactory('circle'), clipPath: createDOMFactory('clipPath'), defs: createDOMFactory('defs'), ellipse: createDOMFactory('ellipse'), g: createDOMFactory('g'), image: createDOMFactory('image'), line: createDOMFactory('line'), linearGradient: createDOMFactory('linearGradient'), mask: createDOMFactory('mask'), path: createDOMFactory('path'), pattern: createDOMFactory('pattern'), polygon: createDOMFactory('polygon'), polyline: createDOMFactory('polyline'), radialGradient: createDOMFactory('radialGradient'), rect: createDOMFactory('rect'), stop: createDOMFactory('stop'), svg: createDOMFactory('svg'), text: createDOMFactory('text'), tspan: createDOMFactory('tspan'), }; // due to wrapper and conditionals at the top, this will either become // `module.exports ReactDOMFactories` if that is available, // otherwise it will be defined via `define(['react'], ReactDOMFactories)` // if that is available, // otherwise it will be defined as global variable. return ReactDOMFactories; }); /***/ }), /* 1759 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ var EventEmitter = function EventEmitter() {}; module.exports = EventEmitter; const promise = __webpack_require__(1769); /** * Decorate an object with event emitter functionality. * * @param Object aObjectToDecorate * Bind all public methods of EventEmitter to * the aObjectToDecorate object. */ EventEmitter.decorate = function EventEmitter_decorate(aObjectToDecorate) { let emitter = new EventEmitter(); aObjectToDecorate.on = emitter.on.bind(emitter); aObjectToDecorate.off = emitter.off.bind(emitter); aObjectToDecorate.once = emitter.once.bind(emitter); aObjectToDecorate.emit = emitter.emit.bind(emitter); }; EventEmitter.prototype = { /** * Connect a listener. * * @param string aEvent * The event name to which we're connecting. * @param function aListener * Called when the event is fired. */ on: function EventEmitter_on(aEvent, aListener) { if (!this._eventEmitterListeners) this._eventEmitterListeners = new Map(); if (!this._eventEmitterListeners.has(aEvent)) { this._eventEmitterListeners.set(aEvent, []); } this._eventEmitterListeners.get(aEvent).push(aListener); }, /** * Listen for the next time an event is fired. * * @param string aEvent * The event name to which we're connecting. * @param function aListener * (Optional) Called when the event is fired. Will be called at most * one time. * @return promise * A promise which is resolved when the event next happens. The * resolution value of the promise is the first event argument. If * you need access to second or subsequent event arguments (it's rare * that this is needed) then use aListener */ once: function EventEmitter_once(aEvent, aListener) { let deferred = promise.defer(); let handler = (aEvent, aFirstArg, ...aRest) => { this.off(aEvent, handler); if (aListener) { aListener.apply(null, [aEvent, aFirstArg, ...aRest]); } deferred.resolve(aFirstArg); }; handler._originalListener = aListener; this.on(aEvent, handler); return deferred.promise; }, /** * Remove a previously-registered event listener. Works for events * registered with either on or once. * * @param string aEvent * The event name whose listener we're disconnecting. * @param function aListener * The listener to remove. */ off: function EventEmitter_off(aEvent, aListener) { if (!this._eventEmitterListeners) return; let listeners = this._eventEmitterListeners.get(aEvent); if (listeners) { this._eventEmitterListeners.set(aEvent, listeners.filter(l => { return l !== aListener && l._originalListener !== aListener; })); } }, /** * Emit an event. All arguments to this method will * be sent to listener functions. */ emit: function EventEmitter_emit(aEvent) { if (!this._eventEmitterListeners || !this._eventEmitterListeners.has(aEvent)) { return; } let originalListeners = this._eventEmitterListeners.get(aEvent); for (let listener of this._eventEmitterListeners.get(aEvent)) { // If the object was destroyed during event emission, stop // emitting. if (!this._eventEmitterListeners) { break; } // If listeners were removed during emission, make sure the // event handler we're going to fire wasn't removed. if (originalListeners === this._eventEmitterListeners.get(aEvent) || this._eventEmitterListeners.get(aEvent).some(l => l === listener)) { try { listener.apply(null, arguments); } catch (ex) { // Prevent a bad listener from interfering with the others. let msg = ex + ": " + ex.stack; //console.error(msg); console.log(msg); } } } } }; /***/ }), /* 1760 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; (function () { var AcronymResult, computeScore, emptyAcronymResult, isAcronymFullWord, isMatch, isSeparator, isWordEnd, isWordStart, miss_coeff, pos_bonus, scoreAcronyms, scoreCharacter, scoreConsecutives, scoreExact, scoreExactMatch, scorePattern, scorePosition, scoreSize, tau_size, wm; wm = 150; pos_bonus = 20; tau_size = 85; miss_coeff = 0.75; exports.score = function (string, query, options) { var allowErrors, preparedQuery, score, string_lw; preparedQuery = options.preparedQuery, allowErrors = options.allowErrors; if (!(allowErrors || isMatch(string, preparedQuery.core_lw, preparedQuery.core_up))) { return 0; } string_lw = string.toLowerCase(); score = computeScore(string, string_lw, preparedQuery); return Math.ceil(score); }; exports.isMatch = isMatch = function (subject, query_lw, query_up) { var i, j, m, n, qj_lw, qj_up, si; m = subject.length; n = query_lw.length; if (!m || n > m) { return false; } i = -1; j = -1; while (++j < n) { qj_lw = query_lw.charCodeAt(j); qj_up = query_up.charCodeAt(j); while (++i < m) { si = subject.charCodeAt(i); if (si === qj_lw || si === qj_up) { break; } } if (i === m) { return false; } } return true; }; exports.computeScore = computeScore = function (subject, subject_lw, preparedQuery) { var acro, acro_score, align, csc_diag, csc_invalid, csc_row, csc_score, i, j, m, miss_budget, miss_left, mm, n, pos, query, query_lw, record_miss, score, score_diag, score_row, score_up, si_lw, start, sz; query = preparedQuery.query; query_lw = preparedQuery.query_lw; m = subject.length; n = query.length; acro = scoreAcronyms(subject, subject_lw, query, query_lw); acro_score = acro.score; if (acro.count === n) { return scoreExact(n, m, acro_score, acro.pos); } pos = subject_lw.indexOf(query_lw); if (pos > -1) { return scoreExactMatch(subject, subject_lw, query, query_lw, pos, n, m); } score_row = new Array(n); csc_row = new Array(n); sz = scoreSize(n, m); miss_budget = Math.ceil(miss_coeff * n) + 5; miss_left = miss_budget; j = -1; while (++j < n) { score_row[j] = 0; csc_row[j] = 0; } i = subject_lw.indexOf(query_lw[0]); if (i > -1) { i--; } mm = subject_lw.lastIndexOf(query_lw[n - 1], m); if (mm > i) { m = mm + 1; } csc_invalid = true; while (++i < m) { si_lw = subject_lw[i]; if (preparedQuery.charCodes[si_lw.charCodeAt(0)] == null) { if (csc_invalid !== true) { j = -1; while (++j < n) { csc_row[j] = 0; } csc_invalid = true; } continue; } score = 0; score_diag = 0; csc_diag = 0; record_miss = true; csc_invalid = false; j = -1; while (++j < n) { score_up = score_row[j]; if (score_up > score) { score = score_up; } csc_score = 0; if (query_lw[j] === si_lw) { start = isWordStart(i, subject, subject_lw); csc_score = csc_diag > 0 ? csc_diag : scoreConsecutives(subject, subject_lw, query, query_lw, i, j, start); align = score_diag + scoreCharacter(i, j, start, acro_score, csc_score); if (align > score) { score = align; miss_left = miss_budget; } else { if (record_miss && --miss_left <= 0) { return score_row[n - 1] * sz; } record_miss = false; } } score_diag = score_up; csc_diag = csc_row[j]; csc_row[j] = csc_score; score_row[j] = score; } } score = score_row[n - 1]; return score * sz; }; exports.isWordStart = isWordStart = function (pos, subject, subject_lw) { var curr_s, prev_s; if (pos === 0) { return true; } curr_s = subject[pos]; prev_s = subject[pos - 1]; return isSeparator(prev_s) || curr_s !== subject_lw[pos] && prev_s === subject_lw[pos - 1]; }; exports.isWordEnd = isWordEnd = function (pos, subject, subject_lw, len) { var curr_s, next_s; if (pos === len - 1) { return true; } curr_s = subject[pos]; next_s = subject[pos + 1]; return isSeparator(next_s) || curr_s === subject_lw[pos] && next_s !== subject_lw[pos + 1]; }; isSeparator = function (c) { return c === ' ' || c === '.' || c === '-' || c === '_' || c === '/' || c === '\\'; }; scorePosition = function (pos) { var sc; if (pos < pos_bonus) { sc = pos_bonus - pos; return 100 + sc * sc; } else { return Math.max(100 + pos_bonus - pos, 0); } }; exports.scoreSize = scoreSize = function (n, m) { return tau_size / (tau_size + Math.abs(m - n)); }; scoreExact = function (n, m, quality, pos) { return 2 * n * (wm * quality + scorePosition(pos)) * scoreSize(n, m); }; exports.scorePattern = scorePattern = function (count, len, sameCase, start, end) { var bonus, sz; sz = count; bonus = 6; if (sameCase === count) { bonus += 2; } if (start) { bonus += 3; } if (end) { bonus += 1; } if (count === len) { if (start) { if (sameCase === len) { sz += 2; } else { sz += 1; } } if (end) { bonus += 1; } } return sameCase + sz * (sz + bonus); }; exports.scoreCharacter = scoreCharacter = function (i, j, start, acro_score, csc_score) { var posBonus; posBonus = scorePosition(i); if (start) { return posBonus + wm * ((acro_score > csc_score ? acro_score : csc_score) + 10); } return posBonus + wm * csc_score; }; exports.scoreConsecutives = scoreConsecutives = function (subject, subject_lw, query, query_lw, i, j, startOfWord) { var k, m, mi, n, nj, sameCase, sz; m = subject.length; n = query.length; mi = m - i; nj = n - j; k = mi < nj ? mi : nj; sameCase = 0; sz = 0; if (query[j] === subject[i]) { sameCase++; } while (++sz < k && query_lw[++j] === subject_lw[++i]) { if (query[j] === subject[i]) { sameCase++; } } if (sz === 1) { return 1 + 2 * sameCase; } return scorePattern(sz, n, sameCase, startOfWord, isWordEnd(i, subject, subject_lw, m)); }; exports.scoreExactMatch = scoreExactMatch = function (subject, subject_lw, query, query_lw, pos, n, m) { var end, i, pos2, sameCase, start; start = isWordStart(pos, subject, subject_lw); if (!start) { pos2 = subject_lw.indexOf(query_lw, pos + 1); if (pos2 > -1) { start = isWordStart(pos2, subject, subject_lw); if (start) { pos = pos2; } } } i = -1; sameCase = 0; while (++i < n) { if (query[pos + i] === subject[i]) { sameCase++; } } end = isWordEnd(pos + n - 1, subject, subject_lw, m); return scoreExact(n, m, scorePattern(n, n, sameCase, start, end), pos); }; AcronymResult = function () { function AcronymResult(score, pos, count) { this.score = score; this.pos = pos; this.count = count; } return AcronymResult; }(); emptyAcronymResult = new AcronymResult(0, 0.1, 0); exports.scoreAcronyms = scoreAcronyms = function (subject, subject_lw, query, query_lw) { var count, fullWord, i, j, m, n, qj_lw, sameCase, score, sepCount, sumPos; m = subject.length; n = query.length; if (!(m > 1 && n > 1)) { return emptyAcronymResult; } count = 0; sepCount = 0; sumPos = 0; sameCase = 0; i = -1; j = -1; while (++j < n) { qj_lw = query_lw[j]; if (isSeparator(qj_lw)) { i = subject_lw.indexOf(qj_lw, i + 1); if (i > -1) { sepCount++; continue; } else { break; } } while (++i < m) { if (qj_lw === subject_lw[i] && isWordStart(i, subject, subject_lw)) { if (query[j] === subject[i]) { sameCase++; } sumPos += i; count++; break; } } if (i === m) { break; } } if (count < 2) { return emptyAcronymResult; } fullWord = count === n ? isAcronymFullWord(subject, subject_lw, query, count) : false; score = scorePattern(count, n, sameCase, true, fullWord); return new AcronymResult(score, sumPos / count, count + sepCount); }; isAcronymFullWord = function (subject, subject_lw, query, nbAcronymInQuery) { var count, i, m, n; m = subject.length; n = query.length; count = 0; if (m > 12 * n) { return false; } i = -1; while (++i < m) { if (isWordStart(i, subject, subject_lw) && ++count > nbAcronymInQuery) { return false; } } return true; }; }).call(undefined); /***/ }), /* 1761 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; (function () { var computeScore, countDir, file_coeff, getExtension, getExtensionScore, isMatch, scorePath, scoreSize, tau_depth, _ref; _ref = __webpack_require__(1760), isMatch = _ref.isMatch, computeScore = _ref.computeScore, scoreSize = _ref.scoreSize; tau_depth = 13; file_coeff = 1.2; exports.score = function (string, query, options) { var allowErrors, preparedQuery, score, string_lw; preparedQuery = options.preparedQuery, allowErrors = options.allowErrors; if (!(allowErrors || isMatch(string, preparedQuery.core_lw, preparedQuery.core_up))) { return 0; } string_lw = string.toLowerCase(); score = computeScore(string, string_lw, preparedQuery); score = scorePath(string, string_lw, score, options); return Math.ceil(score); }; scorePath = function (subject, subject_lw, fullPathScore, options) { var alpha, basePathScore, basePos, depth, end, extAdjust, fileLength, pathSeparator, preparedQuery, useExtensionBonus; if (fullPathScore === 0) { return 0; } preparedQuery = options.preparedQuery, useExtensionBonus = options.useExtensionBonus, pathSeparator = options.pathSeparator; end = subject.length - 1; while (subject[end] === pathSeparator) { end--; } basePos = subject.lastIndexOf(pathSeparator, end); fileLength = end - basePos; extAdjust = 1.0; if (useExtensionBonus) { extAdjust += getExtensionScore(subject_lw, preparedQuery.ext, basePos, end, 2); fullPathScore *= extAdjust; } if (basePos === -1) { return fullPathScore; } depth = preparedQuery.depth; while (basePos > -1 && depth-- > 0) { basePos = subject.lastIndexOf(pathSeparator, basePos - 1); } basePathScore = basePos === -1 ? fullPathScore : extAdjust * computeScore(subject.slice(basePos + 1, end + 1), subject_lw.slice(basePos + 1, end + 1), preparedQuery); alpha = 0.5 * tau_depth / (tau_depth + countDir(subject, end + 1, pathSeparator)); return alpha * basePathScore + (1 - alpha) * fullPathScore * scoreSize(0, file_coeff * fileLength); }; exports.countDir = countDir = function (path, end, pathSeparator) { var count, i; if (end < 1) { return 0; } count = 0; i = -1; while (++i < end && path[i] === pathSeparator) { continue; } while (++i < end) { if (path[i] === pathSeparator) { count++; while (++i < end && path[i] === pathSeparator) { continue; } } } return count; }; exports.getExtension = getExtension = function (str) { var pos; pos = str.lastIndexOf("."); if (pos < 0) { return ""; } else { return str.substr(pos + 1); } }; getExtensionScore = function (candidate, ext, startPos, endPos, maxDepth) { var m, matched, n, pos; if (!ext.length) { return 0; } pos = candidate.lastIndexOf(".", endPos); if (!(pos > startPos)) { return 0; } n = ext.length; m = endPos - pos; if (m < n) { n = m; m = ext.length; } pos++; matched = -1; while (++matched < n) { if (candidate[pos + matched] !== ext[matched]) { break; } } if (matched === 0 && maxDepth > 0) { return 0.9 * getExtensionScore(candidate, ext, startPos, pos - 2, maxDepth - 1); } return matched / m; }; }).call(undefined); /***/ }), /* 1762 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; (function () { var Query, coreChars, countDir, getCharCodes, getExtension, opt_char_re, truncatedUpperCase, _ref; _ref = __webpack_require__(1761), countDir = _ref.countDir, getExtension = _ref.getExtension; module.exports = Query = function () { function Query(query, _arg) { var optCharRegEx, pathSeparator, _ref1; _ref1 = _arg != null ? _arg : {}, optCharRegEx = _ref1.optCharRegEx, pathSeparator = _ref1.pathSeparator; if (!(query && query.length)) { return null; } this.query = query; this.query_lw = query.toLowerCase(); this.core = coreChars(query, optCharRegEx); this.core_lw = this.core.toLowerCase(); this.core_up = truncatedUpperCase(this.core); this.depth = countDir(query, query.length, pathSeparator); this.ext = getExtension(this.query_lw); this.charCodes = getCharCodes(this.query_lw); } return Query; }(); opt_char_re = /[ _\-:\/\\]/g; coreChars = function (query, optCharRegEx) { if (optCharRegEx == null) { optCharRegEx = opt_char_re; } return query.replace(optCharRegEx, ''); }; truncatedUpperCase = function (str) { var char, upper, _i, _len; upper = ""; for (_i = 0, _len = str.length; _i < _len; _i++) { char = str[_i]; upper += char.toUpperCase()[0]; } return upper; }; getCharCodes = function (str) { var charCodes, i, len; len = str.length; i = -1; charCodes = []; while (++i < len) { charCodes[str.charCodeAt(i)] = true; } return charCodes; }; }).call(undefined); /***/ }), /* 1763 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _propTypes = __webpack_require__(20); var _util = __webpack_require__(1777); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } 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 process = process || { env: {} }; var InlineSVG = function (_React$Component) { _inherits(InlineSVG, _React$Component); function InlineSVG() { _classCallCheck(this, InlineSVG); return _possibleConstructorReturn(this, (InlineSVG.__proto__ || Object.getPrototypeOf(InlineSVG)).apply(this, arguments)); } _createClass(InlineSVG, [{ key: 'componentWillReceiveProps', value: function componentWillReceiveProps(_ref) { var children = _ref.children; if ("production" !== process.env.NODE_ENV && children != null) { console.info(': `children` prop will be ignored.'); } } }, { key: 'render', value: function render() { var Element = void 0, __html = void 0, svgProps = void 0; var _props = this.props, element = _props.element, raw = _props.raw, src = _props.src, otherProps = _objectWithoutProperties(_props, ['element', 'raw', 'src']); if (raw === true) { Element = 'svg'; svgProps = (0, _util.extractSVGProps)(src); __html = (0, _util.getSVGFromSource)(src).innerHTML; } __html = __html || src; Element = Element || element; svgProps = svgProps || {}; return _react2.default.createElement(Element, _extends({}, svgProps, otherProps, { src: null, children: null, dangerouslySetInnerHTML: { __html: __html } })); } }]); return InlineSVG; }(_react2.default.Component); exports.default = InlineSVG; InlineSVG.defaultProps = { element: 'i', raw: false, src: '' }; InlineSVG.propTypes = { src: _propTypes.string.isRequired, element: _propTypes.string, raw: _propTypes.bool }; /***/ }), /* 1764 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); __webpack_require__(1788); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } const CommandBarButton = props => { const { children, className, pressed = false } = props, rest = _objectWithoutProperties(props, ["children", "className", "pressed"]); return _react2.default.createElement( "button", _extends({ "aria-pressed": pressed, className: (0, _classnames2.default)("command-bar-button", className) }, rest), children ); }; exports.default = CommandBarButton; /***/ }), /* 1765 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSourceBindingVariables = getSourceBindingVariables; exports.getBindingVariables = getBindingVariables; var _lodash = __webpack_require__(2); // VarAndBindingsPair actually is [name: string, contents: BindingContents] // Scope's bindings field which holds variables and arguments function getSourceBindingVariables(bindings, sourceBindings, parentName) { const result = getBindingVariables(bindings, parentName); const index = Object.create(null); result.forEach(entry => { index[entry.name] = { used: false, entry }; }); // Find and replace variables that is present in sourceBindings. const bound = Object.keys(sourceBindings).map(name => { const generatedName = sourceBindings[name]; const foundMap = index[generatedName]; let contents; if (foundMap) { foundMap.used = true; contents = foundMap.entry.contents; } else { contents = { value: { type: "undefined" } }; } return { name, generatedName, path: `${parentName}/${generatedName}`, contents }; }); // Use rest of them (not found in the sourceBindings) as is. const unused = result.filter(entry => !index[entry.name].used); return bound.concat(unused); } // Create the tree nodes representing all the variables and arguments // for the bindings from a scope. /* eslint max-nested-callbacks: ["error", 4] */ /* 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 . */ function getBindingVariables(bindings, parentName) { const args = bindings.arguments.map(arg => (0, _lodash.toPairs)(arg)[0]); const variables = (0, _lodash.toPairs)(bindings.variables); return args.concat(variables).map(binding => { const name = binding[0]; const contents = binding[1]; return { name, path: `${parentName}/${name}`, contents }; }); } /***/ }), /* 1766 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getFramePopVariables = getFramePopVariables; exports.getThisVariable = getThisVariable; /* 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 . */ function getFramePopVariables(pauseInfo, path) { const vars = []; if (pauseInfo.why && pauseInfo.why.frameFinished) { const frameFinished = pauseInfo.why.frameFinished; // Always display a `throw` property if present, even if it is falsy. if (Object.prototype.hasOwnProperty.call(frameFinished, "throw")) { vars.push({ name: "", path: `${path}/`, contents: { value: frameFinished.throw } }); } if (Object.prototype.hasOwnProperty.call(frameFinished, "return")) { const returned = frameFinished.return; // Do not display undefined. Do display falsy values like 0 and false. The // protocol grip for undefined is a JSON object: { type: "undefined" }. if (typeof returned !== "object" || returned.type !== "undefined") { vars.push({ name: "", path: `${path}/`, contents: { value: returned } }); } } } return vars; } function getThisVariable(frame, path) { const this_ = frame.this; if (!this_) { return null; } return { name: "", path: `${path}/`, contents: { value: this_ } }; } /***/ }), /* 1767 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const Menu = __webpack_require__(1768); const MenuItem = __webpack_require__(1770); const { PrefsHelper } = __webpack_require__(1771); const Services = __webpack_require__(22); const KeyShortcuts = __webpack_require__(1772); const { ZoomKeys } = __webpack_require__(1773); const EventEmitter = __webpack_require__(1759); module.exports = { KeyShortcuts, Menu, MenuItem, PrefsHelper, Services, ZoomKeys, EventEmitter }; /***/ }), /* 1768 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const EventEmitter = __webpack_require__(1759); function inToolbox() { return window.parent.document.documentURI == "about:devtools-toolbox"; } /** * A partial implementation of the Menu API provided by electron: * https://github.com/electron/electron/blob/master/docs/api/menu.md. * * Extra features: * - Emits an 'open' and 'close' event when the menu is opened/closed * @param String id (non standard) * Needed so tests can confirm the XUL implementation is working */ function Menu({ id = null } = {}) { this.menuitems = []; this.id = id; Object.defineProperty(this, "items", { get() { return this.menuitems; } }); EventEmitter.decorate(this); } /** * Add an item to the end of the Menu * * @param {MenuItem} menuItem */ Menu.prototype.append = function (menuItem) { this.menuitems.push(menuItem); }; /** * Add an item to a specified position in the menu * * @param {int} pos * @param {MenuItem} menuItem */ Menu.prototype.insert = function (pos, menuItem) { throw Error("Not implemented"); }; /** * Show the Menu at a specified location on the screen * * Missing features: * - browserWindow - BrowserWindow (optional) - Default is null. * - positioningItem Number - (optional) OS X * * @param {int} screenX * @param {int} screenY * @param Toolbox toolbox (non standard) * Needed so we in which window to inject XUL */ Menu.prototype.popup = function (screenX, screenY, toolbox) { let doc = toolbox.doc; let popupset = doc.querySelector("popupset"); // See bug 1285229, on Windows, opening the same popup multiple times in a // row ends up duplicating the popup. The newly inserted popup doesn't // dismiss the old one. So remove any previously displayed popup before // opening a new one. let popup = popupset.querySelector("menupopup[menu-api=\"true\"]"); if (popup) { popup.hidePopup(); } popup = this.createPopup(doc); popup.setAttribute("menu-api", "true"); if (this.id) { popup.id = this.id; } this._createMenuItems(popup); // Remove the menu from the DOM once it's hidden. popup.addEventListener("popuphidden", e => { if (e.target === popup) { popup.remove(); this.emit("close", popup); } }); popup.addEventListener("popupshown", e => { if (e.target === popup) { this.emit("open", popup); } }); popupset.appendChild(popup); popup.openPopupAtScreen(screenX, screenY, true); }; Menu.prototype.createPopup = function (doc) { return doc.createElement("menupopup"); }; Menu.prototype._createMenuItems = function (parent) { let doc = parent.ownerDocument; this.menuitems.forEach(item => { if (!item.visible) { return; } if (item.submenu) { let menupopup = doc.createElement("menupopup"); item.submenu._createMenuItems(menupopup); let menuitem = doc.createElement("menuitem"); menuitem.setAttribute("label", item.label); if (!inToolbox()) { menuitem.textContent = item.label; } let menu = doc.createElement("menu"); menu.appendChild(menuitem); menu.appendChild(menupopup); if (item.disabled) { menu.setAttribute("disabled", "true"); } if (item.accesskey) { menu.setAttribute("accesskey", item.accesskey); } if (item.id) { menu.id = item.id; } parent.appendChild(menu); } else if (item.type === "separator") { let menusep = doc.createElement("menuseparator"); parent.appendChild(menusep); } else { let menuitem = doc.createElement("menuitem"); menuitem.setAttribute("label", item.label); if (!inToolbox()) { menuitem.textContent = item.label; } menuitem.addEventListener("command", () => item.click()); if (item.type === "checkbox") { menuitem.setAttribute("type", "checkbox"); } if (item.type === "radio") { menuitem.setAttribute("type", "radio"); } if (item.disabled) { menuitem.setAttribute("disabled", "true"); } if (item.checked) { menuitem.setAttribute("checked", "true"); } if (item.accesskey) { menuitem.setAttribute("accesskey", item.accesskey); } if (item.id) { menuitem.id = item.id; } parent.appendChild(menuitem); } }); }; Menu.setApplicationMenu = () => { throw Error("Not implemented"); }; Menu.sendActionToFirstResponder = () => { throw Error("Not implemented"); }; Menu.buildFromTemplate = () => { throw Error("Not implemented"); }; module.exports = Menu; /***/ }), /* 1769 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ /* * A sham for https://dxr.mozilla.org/mozilla-central/source/toolkit/modules/Promise.jsm */ /** * Promise.jsm is mostly the Promise web API with a `defer` method. Just drop this in here, * and use the native web API (although building with webpack/babel, it may replace this * with it's own version if we want to target environments that do not have `Promise`. */ let p = typeof window != "undefined" ? window.Promise : Promise; p.defer = function defer() { var resolve, reject; var promise = new Promise(function () { resolve = arguments[0]; reject = arguments[1]; }); return { resolve: resolve, reject: reject, promise: promise }; }; module.exports = p; /***/ }), /* 1770 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ /** * A partial implementation of the MenuItem API provided by electron: * https://github.com/electron/electron/blob/master/docs/api/menu-item.md. * * Missing features: * - id String - Unique within a single menu. If defined then it can be used * as a reference to this item by the position attribute. * - role String - Define the action of the menu item; when specified the * click property will be ignored * - sublabel String * - accelerator Accelerator * - icon NativeImage * - position String - This field allows fine-grained definition of the * specific location within a given menu. * * Implemented features: * @param Object options * Function click * Will be called with click(menuItem, browserWindow) when the menu item * is clicked * String type * Can be normal, separator, submenu, checkbox or radio * String label * Boolean enabled * If false, the menu item will be greyed out and unclickable. * Boolean checked * Should only be specified for checkbox or radio type menu items. * Menu submenu * Should be specified for submenu type menu items. If submenu is specified, * the type: 'submenu' can be omitted. If the value is not a Menu then it * will be automatically converted to one using Menu.buildFromTemplate. * Boolean visible * If false, the menu item will be entirely hidden. */ function MenuItem({ accesskey = null, checked = false, click = () => {}, disabled = false, label = "", id = null, submenu = null, type = "normal", visible = true } = {}) { this.accesskey = accesskey; this.checked = checked; this.click = click; this.disabled = disabled; this.id = id; this.label = label; this.submenu = submenu; this.type = type; this.visible = visible; } module.exports = MenuItem; /***/ }), /* 1771 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const Services = __webpack_require__(22); const EventEmitter = __webpack_require__(1759); /** * Shortcuts for lazily accessing and setting various preferences. * Usage: * let prefs = new Prefs("root.path.to.branch", { * myIntPref: ["Int", "leaf.path.to.my-int-pref"], * myCharPref: ["Char", "leaf.path.to.my-char-pref"], * myJsonPref: ["Json", "leaf.path.to.my-json-pref"], * myFloatPref: ["Float", "leaf.path.to.my-float-pref"] * ... * }); * * Get/set: * prefs.myCharPref = "foo"; * let aux = prefs.myCharPref; * * Observe: * prefs.registerObserver(); * prefs.on("pref-changed", (prefName, prefValue) => { * ... * }); * * @param string prefsRoot * The root path to the required preferences branch. * @param object prefsBlueprint * An object containing { accessorName: [prefType, prefName, prefDefault] } keys. */ function PrefsHelper(prefsRoot = "", prefsBlueprint = {}) { EventEmitter.decorate(this); let cache = new Map(); for (let accessorName in prefsBlueprint) { let [prefType, prefName, prefDefault] = prefsBlueprint[accessorName]; map(this, cache, accessorName, prefType, prefsRoot, prefName, prefDefault); } let observer = makeObserver(this, cache, prefsRoot, prefsBlueprint); this.registerObserver = () => observer.register(); this.unregisterObserver = () => observer.unregister(); } /** * Helper method for getting a pref value. * * @param Map cache * @param string prefType * @param string prefsRoot * @param string prefName * @return any */ function get(cache, prefType, prefsRoot, prefName) { let cachedPref = cache.get(prefName); if (cachedPref !== undefined) { return cachedPref; } let value = Services.prefs["get" + prefType + "Pref"]([prefsRoot, prefName].join(".")); cache.set(prefName, value); return value; } /** * Helper method for setting a pref value. * * @param Map cache * @param string prefType * @param string prefsRoot * @param string prefName * @param any value */ function set(cache, prefType, prefsRoot, prefName, value) { Services.prefs["set" + prefType + "Pref"]([prefsRoot, prefName].join("."), value); cache.set(prefName, value); } /** * Maps a property name to a pref, defining lazy getters and setters. * Supported types are "Bool", "Char", "Int", "Float" (sugar around "Char" * type and casting), and "Json" (which is basically just sugar for "Char" * using the standard JSON serializer). * * @param PrefsHelper self * @param Map cache * @param string accessorName * @param string prefType * @param string prefsRoot * @param string prefName * @param string prefDefault * @param array serializer [optional] */ function map(self, cache, accessorName, prefType, prefsRoot, prefName, prefDefault, serializer = { in: e => e, out: e => e }) { if (prefName in self) { throw new Error(`Can't use ${prefName} because it overrides a property` + "on the instance."); } if (prefType == "Json") { map(self, cache, accessorName, "String", prefsRoot, prefName, prefDefault, { in: JSON.parse, out: JSON.stringify }); return; } if (prefType == "Float") { map(self, cache, accessorName, "Char", prefsRoot, prefName, prefDefault, { in: Number.parseFloat, out: n => n + "" }); return; } Object.defineProperty(self, accessorName, { get: () => { try { return serializer.in(get(cache, prefType, prefsRoot, prefName)); } catch (e) { if (typeof prefDefault !== 'undefined') { return prefDefault; } throw e; } }, set: e => set(cache, prefType, prefsRoot, prefName, serializer.out(e)) }); } /** * Finds the accessor for the provided pref, based on the blueprint object * used in the constructor. * * @param PrefsHelper self * @param object prefsBlueprint * @return string */ function accessorNameForPref(somePrefName, prefsBlueprint) { for (let accessorName in prefsBlueprint) { let [, prefName] = prefsBlueprint[accessorName]; if (somePrefName == prefName) { return accessorName; } } return ""; } /** * Creates a pref observer for `self`. * * @param PrefsHelper self * @param Map cache * @param string prefsRoot * @param object prefsBlueprint * @return object */ function makeObserver(self, cache, prefsRoot, prefsBlueprint) { return { register: function () { this._branch = Services.prefs.getBranch(prefsRoot + "."); this._branch.addObserver("", this); }, unregister: function () { this._branch.removeObserver("", this); }, observe: function (subject, topic, prefName) { // If this particular pref isn't handled by the blueprint object, // even though it's in the specified branch, ignore it. let accessorName = accessorNameForPref(prefName, prefsBlueprint); if (!(accessorName in self)) { return; } cache.delete(prefName); self.emit("pref-changed", accessorName, self[accessorName]); } }; } exports.PrefsHelper = PrefsHelper; /***/ }), /* 1772 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ const { appinfo } = __webpack_require__(22); const EventEmitter = __webpack_require__(1759); const isOSX = appinfo.OS === "Darwin"; // List of electron keys mapped to DOM API (DOM_VK_*) key code const ElectronKeysMapping = { "F1": "DOM_VK_F1", "F2": "DOM_VK_F2", "F3": "DOM_VK_F3", "F4": "DOM_VK_F4", "F5": "DOM_VK_F5", "F6": "DOM_VK_F6", "F7": "DOM_VK_F7", "F8": "DOM_VK_F8", "F9": "DOM_VK_F9", "F10": "DOM_VK_F10", "F11": "DOM_VK_F11", "F12": "DOM_VK_F12", "F13": "DOM_VK_F13", "F14": "DOM_VK_F14", "F15": "DOM_VK_F15", "F16": "DOM_VK_F16", "F17": "DOM_VK_F17", "F18": "DOM_VK_F18", "F19": "DOM_VK_F19", "F20": "DOM_VK_F20", "F21": "DOM_VK_F21", "F22": "DOM_VK_F22", "F23": "DOM_VK_F23", "F24": "DOM_VK_F24", "Space": "DOM_VK_SPACE", "Backspace": "DOM_VK_BACK_SPACE", "Delete": "DOM_VK_DELETE", "Insert": "DOM_VK_INSERT", "Return": "DOM_VK_RETURN", "Enter": "DOM_VK_RETURN", "Up": "DOM_VK_UP", "Down": "DOM_VK_DOWN", "Left": "DOM_VK_LEFT", "Right": "DOM_VK_RIGHT", "Home": "DOM_VK_HOME", "End": "DOM_VK_END", "PageUp": "DOM_VK_PAGE_UP", "PageDown": "DOM_VK_PAGE_DOWN", "Escape": "DOM_VK_ESCAPE", "Esc": "DOM_VK_ESCAPE", "Tab": "DOM_VK_TAB", "VolumeUp": "DOM_VK_VOLUME_UP", "VolumeDown": "DOM_VK_VOLUME_DOWN", "VolumeMute": "DOM_VK_VOLUME_MUTE", "PrintScreen": "DOM_VK_PRINTSCREEN" }; /** * Helper to listen for keyboard events decribed in .properties file. * * let shortcuts = new KeyShortcuts({ * window * }); * shortcuts.on("Ctrl+F", event => { * // `event` is the KeyboardEvent which relates to the key shortcuts * }); * * @param DOMWindow window * The window object of the document to listen events from. * @param DOMElement target * Optional DOM Element on which we should listen events from. * If omitted, we listen for all events fired on `window`. */ function KeyShortcuts({ window, target }) { this.window = window; this.target = target || window; this.keys = new Map(); this.eventEmitter = new EventEmitter(); this.target.addEventListener("keydown", this); } /* * Parse an electron-like key string and return a normalized object which * allow efficient match on DOM key event. The normalized object matches DOM * API. * * @param DOMWindow window * Any DOM Window object, just to fetch its `KeyboardEvent` object * @param String str * The shortcut string to parse, following this document: * https://github.com/electron/electron/blob/master/docs/api/accelerator.md */ KeyShortcuts.parseElectronKey = function (window, str) { let modifiers = str.split("+"); let key = modifiers.pop(); let shortcut = { ctrl: false, meta: false, alt: false, shift: false, // Set for character keys key: undefined, // Set for non-character keys keyCode: undefined }; for (let mod of modifiers) { if (mod === "Alt") { shortcut.alt = true; } else if (["Command", "Cmd"].includes(mod)) { shortcut.meta = true; } else if (["CommandOrControl", "CmdOrCtrl"].includes(mod)) { if (isOSX) { shortcut.meta = true; } else { shortcut.ctrl = true; } } else if (["Control", "Ctrl"].includes(mod)) { shortcut.ctrl = true; } else if (mod === "Shift") { shortcut.shift = true; } else { console.error("Unsupported modifier:", mod, "from key:", str); return null; } } // Plus is a special case. It's a character key and shouldn't be matched // against a keycode as it is only accessible via Shift/Capslock if (key === "Plus") { key = "+"; } if (typeof key === "string" && key.length === 1) { // Match any single character shortcut.key = key.toLowerCase(); } else if (key in ElectronKeysMapping) { // Maps the others manually to DOM API DOM_VK_* key = ElectronKeysMapping[key]; shortcut.keyCode = window.KeyboardEvent[key]; // Used only to stringify the shortcut shortcut.keyCodeString = key; shortcut.key = key; } else { console.error("Unsupported key:", key); return null; } return shortcut; }; KeyShortcuts.stringify = function (shortcut) { let list = []; if (shortcut.alt) { list.push("Alt"); } if (shortcut.ctrl) { list.push("Ctrl"); } if (shortcut.meta) { list.push("Cmd"); } if (shortcut.shift) { list.push("Shift"); } let key; if (shortcut.key) { key = shortcut.key.toUpperCase(); } else { key = shortcut.keyCodeString; } list.push(key); return list.join("+"); }; KeyShortcuts.prototype = { destroy() { this.target.removeEventListener("keydown", this); this.keys.clear(); }, doesEventMatchShortcut(event, shortcut) { if (shortcut.meta != event.metaKey) { return false; } if (shortcut.ctrl != event.ctrlKey) { return false; } if (shortcut.alt != event.altKey) { return false; } // Shift is a special modifier, it may implicitely be required if the // expected key is a special character accessible via shift. if (shortcut.shift != event.shiftKey && event.key && event.key.match(/[a-zA-Z]/)) { return false; } if (shortcut.keyCode) { return event.keyCode == shortcut.keyCode; } else if (event.key in ElectronKeysMapping) { return ElectronKeysMapping[event.key] === shortcut.key; } // get the key from the keyCode if key is not provided. let key = event.key || String.fromCharCode(event.keyCode); // For character keys, we match if the final character is the expected one. // But for digits we also accept indirect match to please azerty keyboard, // which requires Shift to be pressed to get digits. return key.toLowerCase() == shortcut.key || shortcut.key.match(/^[0-9]$/) && event.keyCode == shortcut.key.charCodeAt(0); }, handleEvent(event) { for (let [key, shortcut] of this.keys) { if (this.doesEventMatchShortcut(event, shortcut)) { this.eventEmitter.emit(key, event); } } }, on(key, listener) { if (typeof listener !== "function") { throw new Error("KeyShortcuts.on() expects a function as " + "second argument"); } if (!this.keys.has(key)) { let shortcut = KeyShortcuts.parseElectronKey(this.window, key); // The key string is wrong and we were unable to compute the key shortcut if (!shortcut) { return; } this.keys.set(key, shortcut); } this.eventEmitter.on(key, listener); }, off(key, listener) { this.eventEmitter.off(key, listener); } }; module.exports = KeyShortcuts; /***/ }), /* 1773 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* 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/. */ /** * Empty shim for "devtools/client/shared/zoom-keys" module * * Based on nsIMarkupDocumentViewer.fullZoom API * https://developer.mozilla.org/en-US/Firefox/Releases/3/Full_page_zoom */ exports.register = function (window) {}; /***/ }), /* 1774 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) { (function () { var Query, defaultPathSeparator, filter, matcher, parseOptions, pathScorer, preparedQueryCache, scorer; filter = __webpack_require__(1775); matcher = __webpack_require__(1776); scorer = __webpack_require__(1760); pathScorer = __webpack_require__(1761); Query = __webpack_require__(1762); preparedQueryCache = null; defaultPathSeparator = (typeof process !== "undefined" && process !== null ? process.platform : void 0) === "win32" ? '\\' : '/'; module.exports = { filter: function (candidates, query, options) { if (options == null) { options = {}; } if (!((query != null ? query.length : void 0) && (candidates != null ? candidates.length : void 0))) { return []; } options = parseOptions(options, query); return filter(candidates, query, options); }, score: function (string, query, options) { if (options == null) { options = {}; } if (!((string != null ? string.length : void 0) && (query != null ? query.length : void 0))) { return 0; } options = parseOptions(options, query); if (options.usePathScoring) { return pathScorer.score(string, query, options); } else { return scorer.score(string, query, options); } }, match: function (string, query, options) { var _i, _ref, _results; if (options == null) { options = {}; } if (!string) { return []; } if (!query) { return []; } if (string === query) { return function () { _results = []; for (var _i = 0, _ref = string.length; 0 <= _ref ? _i < _ref : _i > _ref; 0 <= _ref ? _i++ : _i--) { _results.push(_i); } return _results; }.apply(this); } options = parseOptions(options, query); return matcher.match(string, query, options); }, wrap: function (string, query, options) { if (options == null) { options = {}; } if (!string) { return []; } if (!query) { return []; } options = parseOptions(options, query); return matcher.wrap(string, query, options); }, prepareQuery: function (query, options) { if (options == null) { options = {}; } options = parseOptions(options, query); return options.preparedQuery; } }; parseOptions = function (options, query) { if (options.allowErrors == null) { options.allowErrors = false; } if (options.usePathScoring == null) { options.usePathScoring = true; } if (options.useExtensionBonus == null) { options.useExtensionBonus = false; } if (options.pathSeparator == null) { options.pathSeparator = defaultPathSeparator; } if (options.optCharRegEx == null) { options.optCharRegEx = null; } if (options.wrap == null) { options.wrap = null; } if (options.preparedQuery == null) { options.preparedQuery = preparedQueryCache && preparedQueryCache.query === query ? preparedQueryCache : preparedQueryCache = new Query(query, options); } return options; }; }).call(undefined); /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(120))) /***/ }), /* 1775 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; (function () { var Query, pathScorer, pluckCandidates, scorer, sortCandidates; scorer = __webpack_require__(1760); pathScorer = __webpack_require__(1761); Query = __webpack_require__(1762); pluckCandidates = function (a) { return a.candidate; }; sortCandidates = function (a, b) { return b.score - a.score; }; module.exports = function (candidates, query, options) { var bKey, candidate, key, maxInners, maxResults, score, scoreProvider, scoredCandidates, spotLeft, string, usePathScoring, _i, _len; scoredCandidates = []; key = options.key, maxResults = options.maxResults, maxInners = options.maxInners, usePathScoring = options.usePathScoring; spotLeft = maxInners != null && maxInners > 0 ? maxInners : candidates.length + 1; bKey = key != null; scoreProvider = usePathScoring ? pathScorer : scorer; for (_i = 0, _len = candidates.length; _i < _len; _i++) { candidate = candidates[_i]; string = bKey ? candidate[key] : candidate; if (!string) { continue; } score = scoreProvider.score(string, query, options); if (score > 0) { scoredCandidates.push({ candidate: candidate, score: score }); if (! --spotLeft) { break; } } } scoredCandidates.sort(sortCandidates); candidates = scoredCandidates.map(pluckCandidates); if (maxResults != null) { candidates = candidates.slice(0, maxResults); } return candidates; }; }).call(undefined); /***/ }), /* 1776 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; (function () { var basenameMatch, computeMatch, isMatch, isWordStart, match, mergeMatches, scoreAcronyms, scoreCharacter, scoreConsecutives, _ref; _ref = __webpack_require__(1760), isMatch = _ref.isMatch, isWordStart = _ref.isWordStart, scoreConsecutives = _ref.scoreConsecutives, scoreCharacter = _ref.scoreCharacter, scoreAcronyms = _ref.scoreAcronyms; exports.match = match = function (string, query, options) { var allowErrors, baseMatches, matches, pathSeparator, preparedQuery, string_lw; allowErrors = options.allowErrors, preparedQuery = options.preparedQuery, pathSeparator = options.pathSeparator; if (!(allowErrors || isMatch(string, preparedQuery.core_lw, preparedQuery.core_up))) { return []; } string_lw = string.toLowerCase(); matches = computeMatch(string, string_lw, preparedQuery); if (matches.length === 0) { return matches; } if (string.indexOf(pathSeparator) > -1) { baseMatches = basenameMatch(string, string_lw, preparedQuery, pathSeparator); matches = mergeMatches(matches, baseMatches); } return matches; }; exports.wrap = function (string, query, options) { var matchIndex, matchPos, matchPositions, output, strPos, tagClass, tagClose, tagOpen, _ref1; if (options.wrap != null) { _ref1 = options.wrap, tagClass = _ref1.tagClass, tagOpen = _ref1.tagOpen, tagClose = _ref1.tagClose; } if (tagClass == null) { tagClass = 'highlight'; } if (tagOpen == null) { tagOpen = ''; } if (tagClose == null) { tagClose = ''; } if (string === query) { return tagOpen + string + tagClose; } matchPositions = match(string, query, options); if (matchPositions.length === 0) { return string; } output = ''; matchIndex = -1; strPos = 0; while (++matchIndex < matchPositions.length) { matchPos = matchPositions[matchIndex]; if (matchPos > strPos) { output += string.substring(strPos, matchPos); strPos = matchPos; } while (++matchIndex < matchPositions.length) { if (matchPositions[matchIndex] === matchPos + 1) { matchPos++; } else { matchIndex--; break; } } matchPos++; if (matchPos > strPos) { output += tagOpen; output += string.substring(strPos, matchPos); output += tagClose; strPos = matchPos; } } if (strPos < string.length - 1) { output += string.substring(strPos); } return output; }; basenameMatch = function (subject, subject_lw, preparedQuery, pathSeparator) { var basePos, depth, end; end = subject.length - 1; while (subject[end] === pathSeparator) { end--; } basePos = subject.lastIndexOf(pathSeparator, end); if (basePos === -1) { return []; } depth = preparedQuery.depth; while (depth-- > 0) { basePos = subject.lastIndexOf(pathSeparator, basePos - 1); if (basePos === -1) { return []; } } basePos++; end++; return computeMatch(subject.slice(basePos, end), subject_lw.slice(basePos, end), preparedQuery, basePos); }; mergeMatches = function (a, b) { var ai, bj, i, j, m, n, out; m = a.length; n = b.length; if (n === 0) { return a.slice(); } if (m === 0) { return b.slice(); } i = -1; j = 0; bj = b[j]; out = []; while (++i < m) { ai = a[i]; while (bj <= ai && ++j < n) { if (bj < ai) { out.push(bj); } bj = b[j]; } out.push(ai); } while (j < n) { out.push(b[j++]); } return out; }; computeMatch = function (subject, subject_lw, preparedQuery, offset) { var DIAGONAL, LEFT, STOP, UP, acro_score, align, backtrack, csc_diag, csc_row, csc_score, i, j, m, matches, move, n, pos, query, query_lw, score, score_diag, score_row, score_up, si_lw, start, trace; if (offset == null) { offset = 0; } query = preparedQuery.query; query_lw = preparedQuery.query_lw; m = subject.length; n = query.length; acro_score = scoreAcronyms(subject, subject_lw, query, query_lw).score; score_row = new Array(n); csc_row = new Array(n); STOP = 0; UP = 1; LEFT = 2; DIAGONAL = 3; trace = new Array(m * n); pos = -1; j = -1; while (++j < n) { score_row[j] = 0; csc_row[j] = 0; } i = -1; while (++i < m) { score = 0; score_up = 0; csc_diag = 0; si_lw = subject_lw[i]; j = -1; while (++j < n) { csc_score = 0; align = 0; score_diag = score_up; if (query_lw[j] === si_lw) { start = isWordStart(i, subject, subject_lw); csc_score = csc_diag > 0 ? csc_diag : scoreConsecutives(subject, subject_lw, query, query_lw, i, j, start); align = score_diag + scoreCharacter(i, j, start, acro_score, csc_score); } score_up = score_row[j]; csc_diag = csc_row[j]; if (score > score_up) { move = LEFT; } else { score = score_up; move = UP; } if (align > score) { score = align; move = DIAGONAL; } else { csc_score = 0; } score_row[j] = score; csc_row[j] = csc_score; trace[++pos] = score > 0 ? move : STOP; } } i = m - 1; j = n - 1; pos = i * n + j; backtrack = true; matches = []; while (backtrack && i >= 0 && j >= 0) { switch (trace[pos]) { case UP: i--; pos -= n; break; case LEFT: j--; pos--; break; case DIAGONAL: matches.push(i + offset); j--; i--; pos -= n + 1; break; default: backtrack = false; } } matches.reverse(); return matches; }; }).call(undefined); /***/ }), /* 1777 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.convertReactSVGDOMProperty = convertReactSVGDOMProperty; exports.startsWith = startsWith; exports.serializeAttrs = serializeAttrs; exports.getSVGFromSource = getSVGFromSource; exports.extractSVGProps = extractSVGProps; // Transform DOM prop/attr names applicable to `` element but react-limited function convertReactSVGDOMProperty(str) { return str.replace(/[-|:]([a-z])/g, function (g) { return g[1].toUpperCase(); }); } function startsWith(str, substring) { return str.indexOf(substring) === 0; } var DataPropPrefix = 'data-'; // Serialize `Attr` objects in `NamedNodeMap` function serializeAttrs(map) { var ret = {}; for (var prop, i = 0; i < map.length; i++) { var key = map[i].name; if (!startsWith(key, DataPropPrefix)) { prop = convertReactSVGDOMProperty(key); } ret[prop] = map[i].value; } return ret; } function getSVGFromSource(src) { var svgContainer = document.createElement('div'); svgContainer.innerHTML = src; var svg = svgContainer.firstElementChild; svg.remove(); // deref from parent element return svg; } // get element props function extractSVGProps(src) { var map = getSVGFromSource(src).attributes; return map.length > 0 ? serializeAttrs(map) : null; } /***/ }), /* 1778 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isMinified = isMinified; // Used to detect minification for automatic pretty printing const SAMPLE_SIZE = 50; /* 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 . */ const INDENT_COUNT_THRESHOLD = 5; const CHARACTER_LIMIT = 250; const _minifiedCache = new Map(); function isMinified(source) { if (_minifiedCache.has(source.get("id"))) { return _minifiedCache.get(source.get("id")); } let text = source.get("text"); if (!text) { return false; } let lineEndIndex = 0; let lineStartIndex = 0; let lines = 0; let indentCount = 0; let overCharLimit = false; // Strip comments. text = text.replace(/\/\*[\S\s]*?\*\/|\/\/(.+|\n)/g, ""); while (lines++ < SAMPLE_SIZE) { lineEndIndex = text.indexOf("\n", lineStartIndex); if (lineEndIndex == -1) { break; } if (/^\s+/.test(text.slice(lineStartIndex, lineEndIndex))) { indentCount++; } // For files with no indents but are not minified. if (lineEndIndex - lineStartIndex > CHARACTER_LIMIT) { overCharLimit = true; break; } lineStartIndex = lineEndIndex + 1; } const minified = indentCount / lines * 100 < INDENT_COUNT_THRESHOLD || overCharLimit; _minifiedCache.set(source.id, minified); return minified; } /***/ }), /* 1779 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ exports.formatCallStackFrames = formatCallStackFrames; exports.default = getCallStackFrames; var _sources = __webpack_require__(1369); var _pause = __webpack_require__(1394); var _frame = __webpack_require__(1380); var _devtoolsSourceMap = __webpack_require__(1360); var _lodash = __webpack_require__(2); function getLocation(frame, isGeneratedSource) { return isGeneratedSource ? frame.generatedLocation || frame.location : frame.location; } function getSourceForFrame(sources, frame, isGeneratedSource) { const sourceId = getLocation(frame, isGeneratedSource).sourceId; return (0, _sources.getSourceInSources)(sources, sourceId); } function appendSource(sources, frame, selectedSource) { const isGeneratedSource = selectedSource && !(0, _devtoolsSourceMap.isOriginalId)(selectedSource.get("id")); return _extends({}, frame, { location: getLocation(frame, isGeneratedSource), source: getSourceForFrame(sources, frame, isGeneratedSource).toJS() }); } function formatCallStackFrames(frames, sources, selectedSource) { if (!frames) { return null; } return frames.filter(frame => getSourceForFrame(sources, frame)).map(frame => appendSource(sources, frame, selectedSource)).filter(frame => !(0, _lodash.get)(frame, "source.isBlackBoxed")).map(_frame.annotateFrame); } function getCallStackFrames(state) { const selectedSource = (0, _sources.getSelectedSource)(state); const sources = (0, _sources.getSources)(state); const frames = (0, _pause.getFrames)(state); return formatCallStackFrames(frames, sources, selectedSource); } /***/ }), /* 1780 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _sources = __webpack_require__(1369); var _pause = __webpack_require__(1394); var _devtoolsSourceMap = __webpack_require__(1360); var _reselect = __webpack_require__(993); /* 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 . */ function getLocation(frame, location) { return !(0, _devtoolsSourceMap.isOriginalId)(location.sourceId) ? frame.generatedLocation || frame.location : frame.location; } const getVisibleSelectedFrame = (0, _reselect.createSelector)(_sources.getSelectedLocation, _pause.getSelectedFrame, (selectedLocation, selectedFrame) => { if (!selectedFrame || !selectedLocation) { return null; } const { id } = selectedFrame; return { id, location: getLocation(selectedFrame, selectedLocation) }; }); exports.default = getVisibleSelectedFrame; /***/ }), /* 1781 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setInScopeLines = setInScopeLines; var _selectors = __webpack_require__(1352); var _source = __webpack_require__(1356); var _lodash = __webpack_require__(2); /* 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 . */ function getOutOfScopeLines(outOfScopeLocations) { if (!outOfScopeLocations) { return null; } return (0, _lodash.uniq)((0, _lodash.flatMap)(outOfScopeLocations, location => (0, _lodash.range)(location.start.line, location.end.line))); } function setInScopeLines() { return ({ dispatch, getState }) => { const source = (0, _selectors.getSelectedSource)(getState()); const outOfScopeLocations = (0, _selectors.getOutOfScopeLocations)(getState()); if (!source || !source.get("text")) { return; } const linesOutOfScope = getOutOfScopeLines(outOfScopeLocations, source.toJS()); const sourceNumLines = (0, _source.getSourceLineCount)(source.toJS()); const sourceLines = (0, _lodash.range)(1, sourceNumLines + 1); const inScopeLines = !linesOutOfScope ? sourceLines : (0, _lodash.without)(sourceLines, ...linesOutOfScope); dispatch({ type: "IN_SCOPE_LINES", lines: inScopeLines }); }; } /***/ }), /* 1782 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createLocation = createLocation; function createLocation({ sourceId, line, column, sourceUrl }) { return { sourceId, line, column, sourceUrl: sourceUrl || null }; } /***/ }), /* 1783 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getTokenLocation = getTokenLocation; /* 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 . */ function getTokenLocation(codeMirror, tokenEl) { const { left, top, width, height } = tokenEl.getBoundingClientRect(); const { line, ch } = codeMirror.coordsChar({ left: left + width / 2, top: top + height / 2 }); return { line: line + 1, column: ch }; } /***/ }), /* 1784 */ /***/ (function(module, exports, __webpack_require__) { let updateScopeBindings = (() => { var _ref = _asyncToGenerator(function* (scope, location, originalLocation, scopesDataSource) { const generatedScopes = yield scopesDataSource.getSourceMapsScopes(location); if (!generatedScopes) { return scope; } const originalScopes = yield scopesDataSource.getOriginalSourceScopes(originalLocation); const remapedScopes = remapScopes(originalScopes, generatedScopes); return extendScope(scope, generatedScopes, 0, remapedScopes, 0); }); return function updateScopeBindings(_x, _x2, _x3, _x4) { 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"); }); }; } /* 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/. */ const { remapScopes } = __webpack_require__(1785); function extendScope(scope, generatedScopes, index, remapedScopes, remapedScopesIndex) { if (!scope) { return undefined; } if (index >= generatedScopes.length) { return scope; } let syntheticScopes; if (remapedScopes && remapedScopesIndex < remapedScopes.length) { if (index >= remapedScopes[remapedScopesIndex].end) { remapedScopesIndex++; } if (remapedScopesIndex < remapedScopes.length) { const remapedScope = remapedScopes[remapedScopesIndex]; syntheticScopes = { scopes: remapedScope.scopes, groupIndex: index - remapedScope.start, groupLength: remapedScope.end - remapedScope.start }; } } const parent = extendScope(scope.parent, generatedScopes, index + 1, remapedScopes, remapedScopesIndex); return Object.assign({}, scope, { parent, sourceBindings: generatedScopes[index].bindings, syntheticScopes }); } module.exports = { updateScopeBindings }; /***/ }), /* 1785 */ /***/ (function(module, exports) { // Chunk split source scopes on function/closure boundary /* 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/. */ function rollupFunctionScopes(scopes) { const { result } = scopes.reduce(({ isLast, result }, scope) => { if (isLast) { result.push([]); } result[result.length - 1].push(scope); return { isLast: scope.type === "function", result }; }, { isLast: true, result: [] }); return result; } function getBindingNames(summarizedScopes) { return summarizedScopes.reduce((acc, { bindingsNames }) => acc.concat(bindingsNames), []); } // Performs mapping of the original parsed scopes to the locals mappings // based on the generated source parse and source map data. function remapScopes(scopes, generatedScopes) { if (!scopes || scopes.length === 0) { return null; } const scopeChunks = rollupFunctionScopes(scopes); const { result: assigned } = scopeChunks.reduce(({ result, searchIn, searchOffset }, scopeChunk) => { if (searchIn.length === 0) { return { result, searchIn, searchOffset }; } // Process chunk of original parsed scopes: create used original names // binding summary per scope and entire chunk. const summarizedScopes = scopeChunk.map(({ type, bindings }) => ({ type, bindingsNames: Object.keys(bindings) })); const names = getBindingNames(summarizedScopes); // ... and find these names in the generated scopes (with mapped // original names) -- we need index of the last scope in the searchIn. let foundInMax = names.reduce((max, name) => { const index = searchIn.findIndex(s => name in s.bindings); return index < 0 ? Math.max(index, max) : max; }, 0); // TODO double check if names were not matched/found -- the source maps // and scope parsing can be broken. // Moving to the function bounary (in generated scopes). while (foundInMax + 1 < searchIn.length && searchIn[foundInMax].type !== "function") { foundInMax++; } // We found chunk of the function(s) that contains all/most of // the scopeChunk names -- adding finding to the result. result.push({ scopes: summarizedScopes, start: searchOffset, end: searchOffset + foundInMax + 1 }); // Consuming generated scopes mappings (searchIn). return { result, searchIn: searchIn.slice(foundInMax + 1), searchOffset: searchOffset + foundInMax + 1 }; }, { result: [], searchIn: generatedScopes, searchOffset: 0 }); return assigned; } module.exports = { remapScopes }; /***/ }), /* 1786 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; exports.updatePreview = updatePreview; exports.setPreview = setPreview; exports.clearPreview = clearPreview; var _ast = __webpack_require__(1638); var _editor = __webpack_require__(1358); var _devtoolsSourceMap = __webpack_require__(1360); var _promise = __webpack_require__(1653); var _selectors = __webpack_require__(1352); var _expressions = __webpack_require__(1398); var _lodash = __webpack_require__(2); const extraProps = { react: { displayName: "this._reactInternalInstance.getName()" }, immutable: { isImmutable: exp => `Immutable.Iterable.isIterable(${exp})`, entries: exp => `${exp}.toJS()`, type: exp => `${exp}.constructor.name` } }; function updatePreview(target, editor) { return ({ dispatch, getState, client, sourceMaps }) => { const location = (0, _editor.getTokenLocation)(editor.codeMirror, target); const tokenText = target.innerText ? target.innerText.trim() : ""; const cursorPos = target.getBoundingClientRect(); const preview = (0, _selectors.getPreview)(getState()); if (preview) { // We are mousing over the same token as before if ((0, _lodash.isEqual)(preview.tokenPos, location)) { return; } // We are mousing over a new token that is not in the preview if (!target.classList.contains("debug-expression")) { dispatch(clearPreview()); } } const source = (0, _selectors.getSelectedSource)(getState()); const symbols = (0, _selectors.getSymbols)(getState(), source.toJS()); if (symbols.functions.length == 0) { return; } const invalidToken = tokenText === "" || tokenText.match(/[(){}\|&%,.;=<>\+-/\*\s]/); const invalidTarget = target.parentElement && !target.parentElement.closest(".CodeMirror-line") || cursorPos.top == 0; const isUpdating = preview && preview.updating; const linesInScope = (0, _selectors.getInScopeLines)(getState()); const inScope = linesInScope && linesInScope.includes(location.line); const invaildType = target.className === "cm-string" || target.className === "cm-number" || target.className === "cm-atom"; if (invalidTarget || !inScope || isUpdating || invalidToken || invaildType) { return; } dispatch(setPreview(tokenText, location, cursorPos)); }; } function setPreview(token, tokenPos, cursorPos) { return async ({ dispatch, getState, client, sourceMaps }) => { const currentSelection = (0, _selectors.getPreview)(getState()); if (currentSelection && currentSelection.updating) { return; } await dispatch({ type: "SET_PREVIEW", [_promise.PROMISE]: async function () { let immutableType = null; let immutableEntries = null; const source = (0, _selectors.getSelectedSource)(getState()); const symbols = (0, _selectors.getSymbols)(getState(), source.toJS()); const found = (0, _ast.findBestMatchExpression)(symbols, tokenPos, token); if (!found) { return; } let { expression, location } = found; if (!expression) { return; } const sourceId = source.get("id"); if (location && !(0, _devtoolsSourceMap.isGeneratedId)(sourceId)) { const generatedLocation = await sourceMaps.getGeneratedLocation(_extends({}, location.start, { sourceId }), source.toJS()); expression = await (0, _expressions.getMappedExpression)({ sourceMaps }, generatedLocation, expression); } const selectedFrame = (0, _selectors.getSelectedFrame)(getState()); const { result } = await client.evaluate(expression, { frameId: selectedFrame.id }); const reactDisplayName = await client.evaluate(extraProps.react.displayName, { frameId: selectedFrame.id }); const immutable = await client.evaluate(extraProps.immutable.isImmutable(expression), { frameId: selectedFrame.id }); if (immutable.result === true) { immutableEntries = await client.evaluate(extraProps.immutable.entries(expression), { frameId: selectedFrame.id }); immutableType = await client.evaluate(extraProps.immutable.type(expression), { frameId: selectedFrame.id }); } const extra = { react: { displayName: reactDisplayName.result }, immutable: { isImmutable: immutable.result && immutable.result.type !== "undefined", type: immutableType && immutableType.result, entries: immutableEntries && immutableEntries.result } }; if (result === undefined) { return; } return { expression, result, location, tokenPos, cursorPos, extra }; }() }); }; } function clearPreview() { return ({ dispatch, getState, client }) => { const currentSelection = (0, _selectors.getPreview)(getState()); if (!currentSelection) { return; } return dispatch({ type: "CLEAR_SELECTION" }); }; } /***/ }), /* 1787 */ /***/ (function(module, exports) { module.exports = "Group 2Created with Sketch." /***/ }), /* 1788 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1789 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, '__esModule', { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i];for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } }return target; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ('value' in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); } }return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; }; }(); var _get = function get(_x, _x2, _x3) { var _again = true;_function: while (_again) { var object = _x, property = _x2, receiver = _x3;_again = false;if (object === null) object = Function.prototype;var desc = Object.getOwnPropertyDescriptor(object, property);if (desc === undefined) { var parent = Object.getPrototypeOf(object);if (parent === null) { return undefined; } else { _x = parent;_x2 = property;_x3 = receiver;_again = true;desc = parent = undefined;continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get;if (getter === undefined) { return undefined; }return getter.call(receiver); } } }; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _objectWithoutProperties(obj, keys) { var target = {};for (var i in obj) { if (keys.indexOf(i) >= 0) continue;if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;target[i] = obj[i]; }return target; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } 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 _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var DOMParser = typeof window !== 'undefined' && window.DOMParser; var process = process || {}; process.env = process.env || {}; var parserAvailable = typeof DOMParser !== 'undefined' && DOMParser.prototype != null && DOMParser.prototype.parseFromString != null; function isParsable(src) { // kinda naive but meh, ain't gonna use full-blown parser for this return parserAvailable && typeof src === 'string' && src.trim().substr(0, 4) === '` element but react-limited function switchSVGAttrToReactProp(propName) { switch (propName) { case 'class': return 'className'; default: return propName; } } var InlineSVG = function (_React$Component) { _inherits(InlineSVG, _React$Component); _createClass(InlineSVG, null, [{ key: 'defaultProps', value: { element: 'i', raw: false, src: '' }, enumerable: true }, { key: 'propTypes', value: { src: _react2['default'].PropTypes.string.isRequired, element: _react2['default'].PropTypes.string, raw: _react2['default'].PropTypes.bool }, enumerable: true }]); function InlineSVG(props) { _classCallCheck(this, InlineSVG); _get(Object.getPrototypeOf(InlineSVG.prototype), 'constructor', this).call(this, props); this._extractSVGProps = this._extractSVGProps.bind(this); } // Serialize `Attr` objects in `NamedNodeMap` _createClass(InlineSVG, [{ key: '_serializeAttrs', value: function _serializeAttrs(map) { var ret = {}; var prop = undefined; for (var i = 0; i < map.length; i++) { prop = switchSVGAttrToReactProp(map[i].name); ret[prop] = map[i].value; } return ret; } // get element props }, { key: '_extractSVGProps', value: function _extractSVGProps(src) { var map = parseFromSVGString(src).documentElement.attributes; return map.length > 0 ? this._serializeAttrs(map) : null; } // get content inside element. }, { key: '_stripSVG', value: function _stripSVG(src) { return parseFromSVGString(src).documentElement.innerHTML; } }, { key: 'componentWillReceiveProps', value: function componentWillReceiveProps(_ref) { var children = _ref.children; if ("production" !== process.env.NODE_ENV && children != null) { console.info(': `children` prop will be ignored.'); } } }, { key: 'render', value: function render() { var Element = undefined, __html = undefined, svgProps = undefined; var _props = this.props; var element = _props.element; var raw = _props.raw; var src = _props.src; var otherProps = _objectWithoutProperties(_props, ['element', 'raw', 'src']); if (raw === true && isParsable(src)) { Element = 'svg'; svgProps = this._extractSVGProps(src); __html = this._stripSVG(src); } __html = __html || src; Element = Element || element; svgProps = svgProps || {}; return _react2['default'].createElement(Element, _extends({}, svgProps, otherProps, { src: null, children: null, dangerouslySetInnerHTML: { __html: __html } })); } }]); return InlineSVG; }(_react2['default'].Component); exports['default'] = InlineSVG; module.exports = exports['default']; /***/ }), /* 1790 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = renderBreakpointsDropdown; var _react = __webpack_require__(0); var _react2 = _interopRequireDefault(_react); var _Svg = __webpack_require__(1359); var _Svg2 = _interopRequireDefault(_Svg); var _Dropdown = __webpack_require__(1615); var _Dropdown2 = _interopRequireDefault(_Dropdown); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); __webpack_require__(1791); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function renderPause(isWaitingOnBreak) { const active = isWaitingOnBreak; return _react2.default.createElement( "div", { className: (0, _classnames2.default)("pause-next", { active: active, inactive: !active }) }, _react2.default.createElement("img", { className: "pause-next" }), _react2.default.createElement( "span", { className: "icon-spacer" }, L10N.getStr("pauseButtonItem") ) ); } function renderPauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) { const active = (shouldPauseOnExceptions || shouldIgnoreCaughtExceptions) && (!shouldPauseOnExceptions || !shouldIgnoreCaughtExceptions); return _react2.default.createElement( "div", { className: (0, _classnames2.default)("pause-on-exceptions", { active: active, inactive: !active }) }, _react2.default.createElement("img", { className: "pause-on-exceptions" }), _react2.default.createElement( "span", { className: "icon-spacer" }, L10N.getStr("pauseOnExceptionsItem") ) ); } function renderPauseOnUncaughtExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) { const active = shouldPauseOnExceptions && shouldIgnoreCaughtExceptions; return _react2.default.createElement( "div", { className: (0, _classnames2.default)("pause-uncaught-exceptions", { active: active, inactive: !active }) }, _react2.default.createElement("img", { className: "pause-uncaught-exceptions" }), _react2.default.createElement( "span", { className: "icon-spacer" }, L10N.getStr("pauseOnUncaughtExceptionsItem") ) ); } function renderIgnoreExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) { const active = !shouldPauseOnExceptions && !shouldIgnoreCaughtExceptions; return _react2.default.createElement( "div", { className: (0, _classnames2.default)("ignore-exceptions", { active: active, inactive: !active }) }, _react2.default.createElement("img", { className: "ignore-exceptions" }), _react2.default.createElement( "span", { className: "icon-spacer" }, L10N.getStr("ignoreExceptionsItem") ) ); } function handleClick(e) { e.stopPropagation(); } function renderBreakpointsDropdown(breakOnNext, pauseOnExceptions, shouldPauseOnExceptions, shouldIgnoreCaughtExceptions, isWaitingOnBreak) { const Panel = _react2.default.createElement( "ul", null, _react2.default.createElement( "li", { onClick: () => breakOnNext(), className: "first" }, renderPause(isWaitingOnBreak) ), _react2.default.createElement( "li", { onClick: () => pauseOnExceptions(false, false) }, renderIgnoreExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) ), _react2.default.createElement( "li", { onClick: () => pauseOnExceptions(true, true) }, renderPauseOnUncaughtExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) ), _react2.default.createElement( "li", { onClick: () => pauseOnExceptions(true, false) }, renderPauseOnExceptions(shouldPauseOnExceptions, shouldIgnoreCaughtExceptions) ) ); const active = shouldPauseOnExceptions || shouldIgnoreCaughtExceptions || isWaitingOnBreak; return _react2.default.createElement( "div", { className: "breakpoints-dropdown", onClick: e => handleClick(e), key: "breakpoints-dropdown" }, _react2.default.createElement(_Dropdown2.default, { className: "dropdown", panel: Panel, icon: _react2.default.createElement(_Svg2.default, { name: "plus", className: (0, _classnames2.default)("plus", { active: active, inactive: !active }) }) }) ); } /***/ }), /* 1791 */ /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /* 1792 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getScopes = getScopes; var _synthesizeScopes = __webpack_require__(1793); var _getScope = __webpack_require__(1794); /* 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 . */ function getScopes(pauseInfo, selectedFrame, frameScopes) { if (!pauseInfo || !selectedFrame) { return null; } if (!frameScopes) { return null; } const scopes = []; let scope = frameScopes; let scopeIndex = 1; while (scope) { const { syntheticScopes } = scope; let lastScope = scope; if (!syntheticScopes) { const scopeItem = (0, _getScope.getScope)(scope, selectedFrame, frameScopes, pauseInfo, scopeIndex); if (scopeItem) { scopes.push(scopeItem); } scopeIndex++; } else { scopes.push(...(0, _synthesizeScopes.synthesizeScopes)(scope, selectedFrame, frameScopes, pauseInfo, scopeIndex)); // skip to the next generated scope const scopeDepth = syntheticScopes.groupLength; for (let i = 1; lastScope.parent && i < scopeDepth; i++) { const nextScope = lastScope.parent; lastScope = nextScope; } scope = lastScope; scopeIndex += syntheticScopes.scopes.length; } scope = scope.parent; } return scopes; } /***/ }), /* 1793 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.synthesizeScopes = synthesizeScopes; var _getVariables = __webpack_require__(1765); var _frame = __webpack_require__(1380); var _utils = __webpack_require__(1766); function getSynteticScopeTitle(type, generatedScopes) { if (type === "function") { // FIXME Use original function name here const lastGeneratedScope = generatedScopes[generatedScopes.length - 1]; const isLastGeneratedScopeFn = lastGeneratedScope && lastGeneratedScope.type === "function"; return isLastGeneratedScopeFn && lastGeneratedScope.function.displayName ? (0, _frame.simplifyDisplayName)(lastGeneratedScope.function.displayName) : L10N.getStr("anonymous"); } return L10N.getStr("scopes.block"); } /* 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 . */ function findOriginalBindings(bindingsNames, generatedScopes, key, foundGeneratedNames) { return bindingsNames.reduce((vars, name) => { // Find binding name in the original source bindings const generatedScope = generatedScopes.find(gs => gs.sourceBindings && name in gs.sourceBindings); if (!generatedScope || !generatedScope.sourceBindings) { return vars; } // .. and map it to the generated name const generatedName = generatedScope.sourceBindings[name]; // Skip if we already use the generated name if (generatedName && !foundGeneratedNames[generatedName]) { if (generatedScope.bindings.variables[generatedName]) { vars.push({ name, generatedName, path: `${key}/${generatedName}`, contents: generatedScope.bindings.variables[generatedName] }); foundGeneratedNames[generatedName] = true; return vars; } const arg = generatedScope.bindings.arguments.find(arg_ => arg_[generatedName]); if (arg) { vars.push({ name, generatedName, path: `${key}/${generatedName}`, contents: arg[generatedName] }); foundGeneratedNames[generatedName] = true; return vars; } } vars.push({ name, generatedName, path: `${key}/${generatedName}`, contents: { value: { type: "undefined" } } }); return vars; }, []); } function findUnusedBindings(generatedScopes, foundGeneratedNames, key) { const allGeneratedVars = generatedScopes.reduce((acc, { bindings }) => { return acc.concat((0, _getVariables.getBindingVariables)(bindings, key)); }, []); return allGeneratedVars.filter(v => !foundGeneratedNames[v.name]); } // Create a synthesized scope based on its binding names and // generated/original scopes information. function synthesizeScope(syntheticScope, index, actor, key, scopeIndex, lastScopeIndex, generatedScopes, foundGeneratedNames, scope, frameScopes, selectedFrame, pauseInfo) { const { bindingsNames } = syntheticScope; const isLast = index === lastScopeIndex; let vars = findOriginalBindings(bindingsNames, generatedScopes, key, foundGeneratedNames); if (isLast) { // For the last synthesized scope, apply all generated names we did not use vars = [...vars, ...findUnusedBindings(generatedScopes, foundGeneratedNames, key)]; } if (index === 0) { const isLocalScope = scope.actor === frameScopes.actor; // For the first synthesized scope, add this and other vars. if (isLocalScope) { vars = [...vars, ...(0, _utils.getFramePopVariables)(pauseInfo, key)]; const this_ = (0, _utils.getThisVariable)(selectedFrame, key); if (this_) { vars.push(this_); } } } return vars; } function synthesizeScopes(scope, selectedFrame, frameScopes, pauseInfo, scopeIndex) { const { actor, syntheticScopes } = scope; if (!syntheticScopes) { return []; } // Collect all connected generated scopes. const generatedScopes = []; for (let count = syntheticScopes.groupLength, s = scope; count > 0 && s; count--) { generatedScopes.push(s); s = s.parent; } const foundGeneratedNames = Object.create(null); const lastScopeIndex = syntheticScopes.scopes.length - 1; return syntheticScopes.scopes.reduce((result, syntheticScope, index) => { const key = `${actor}-${scopeIndex + index}`; const bindings = synthesizeScope(syntheticScope, index, actor, key, scopeIndex, lastScopeIndex, generatedScopes, foundGeneratedNames, scope, frameScopes, selectedFrame, pauseInfo); if (bindings && bindings.length) { const title = getSynteticScopeTitle(syntheticScope.type, generatedScopes); bindings.sort((a, b) => a.name.localeCompare(b.name)); result.push({ name: title, path: key, contents: bindings }); } return result; }, []); } /***/ }), /* 1794 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* 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 . */ exports.getScope = getScope; var _getVariables = __webpack_require__(1765); var _utils = __webpack_require__(1766); var _frame = __webpack_require__(1380); function getScopeTitle(type, scope) { if (type === "function") { return scope.function.displayName ? (0, _frame.simplifyDisplayName)(scope.function.displayName) : L10N.getStr("anonymous"); } return L10N.getStr("scopes.block"); } function getScope(scope, selectedFrame, frameScopes, pauseInfo, scopeIndex) { const { type, actor } = scope; const isLocalScope = scope.actor === frameScopes.actor; const key = `${actor}-${scopeIndex}`; if (type === "function" || type === "block") { const bindings = scope.bindings; const sourceBindings = scope.sourceBindings; let vars = sourceBindings ? (0, _getVariables.getSourceBindingVariables)(bindings, sourceBindings, key) : (0, _getVariables.getBindingVariables)(bindings, key); // show exception, return, and this variables in innermost scope if (isLocalScope) { vars = vars.concat((0, _utils.getFramePopVariables)(pauseInfo, key)); const this_ = (0, _utils.getThisVariable)(selectedFrame, key); if (this_) { vars.push(this_); } } if (vars && vars.length) { const title = getScopeTitle(type, scope); vars.sort((a, b) => a.name.localeCompare(b.name)); return { name: title, path: key, contents: vars }; } } else if (type === "object") { let value = scope.object; // If this is the global window scope, mark it as such so that it will // preview Window: Global instead of Window: Window if (value.class === "Window") { value = _extends({}, scope.object, { displayClass: "Global" }); } return { name: scope.object.class, path: key, contents: { value } }; } return null; } /***/ }), /* 1795 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _lodash = __webpack_require__(2); let newSources; let createSource; let queuedSources; let supportsWasm = false; const queue = (0, _lodash.throttle)(() => { if (!newSources || !createSource) { return; } newSources(queuedSources.map(source => { return createSource(source, { supportsWasm }); })); queuedSources = []; }, 100); exports.default = { initialize: options => { newSources = options.actions.newSources; createSource = options.createSource; supportsWasm = options.supportsWasm; queuedSources = []; }, queue: source => { queuedSources.push(source); queue(); }, flush: () => queue.flush(), clear: () => queue.cancel() }; /***/ }), /* 1796 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HighlightLine = undefined; var _react = __webpack_require__(0); var _editor = __webpack_require__(1358); var _sourceDocuments = __webpack_require__(1436); var _source = __webpack_require__(1356); var _reactRedux = __webpack_require__(1189); var _selectors = __webpack_require__(1352); /* 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 . */ function isDebugLine(selectedFrame, selectedLocation) { if (!selectedFrame) { return; } return selectedFrame.location.sourceId == selectedLocation.sourceId && selectedFrame.location.line == selectedLocation.line; } function isDocumentReady(selectedSource, selectedLocation) { return selectedLocation && (0, _source.isLoaded)(selectedSource) && (0, _sourceDocuments.hasDocument)(selectedLocation.sourceId); } class HighlightLine extends _react.PureComponent { componentDidUpdate(prevProps) { const { selectedLocation, selectedFrame, selectedSource } = this.props; this.clearHighlightLine(prevProps.selectedLocation, prevProps.selectedSource); this.setHighlightLine(selectedLocation, selectedFrame, selectedSource); } setHighlightLine(selectedLocation, selectedFrame, selectedSource) { if (!isDocumentReady(selectedSource, selectedLocation)) { return; } const { sourceId, line } = selectedLocation; if (!line || isDebugLine(selectedFrame, selectedLocation)) { return; } const editorLine = (0, _editor.toEditorLine)(sourceId, line); const doc = (0, _sourceDocuments.getDocument)(sourceId); doc.addLineClass(editorLine, "line", "highlight-line"); } clearHighlightLine(selectedLocation, selectedSource) { if (!isDocumentReady(selectedSource, selectedLocation)) { return; } const { line, sourceId } = selectedLocation; const editorLine = (0, _editor.toEditorLine)(sourceId, line); const doc = (0, _sourceDocuments.getDocument)(sourceId); doc.removeLineClass(editorLine, "line", "highlight-line"); } render() { return null; } } exports.HighlightLine = HighlightLine; exports.default = (0, _reactRedux.connect)(state => ({ selectedFrame: (0, _selectors.getVisibleSelectedFrame)(state), selectedLocation: (0, _selectors.getSelectedLocation)(state), selectedSource: (0, _selectors.getSelectedSource)(state) }))(HighlightLine); /***/ }) /******/ ]); });