(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("devtools/client/shared/vendor/react"), require("Services"), require("devtools/shared/flags"), require("devtools/client/sourceeditor/editor")); else if(typeof define === 'function' && define.amd) define(["devtools/client/shared/vendor/react", "Services", "devtools/shared/flags", "devtools/client/sourceeditor/editor"], factory); else { var a = typeof exports === 'object' ? factory(require("devtools/client/shared/vendor/react"), require("Services"), require("devtools/shared/flags"), require("devtools/client/sourceeditor/editor")) : factory(root["devtools/client/shared/vendor/react"], root["Services"], root["devtools/shared/flags"], root["devtools/client/sourceeditor/editor"]); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_29__, __WEBPACK_EXTERNAL_MODULE_121__, __WEBPACK_EXTERNAL_MODULE_995__) { 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] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ // Flag the module as loaded /******/ module.loaded = 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; /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/assets/build"; /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { module.exports = __webpack_require__(1); /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var React = __webpack_require__(2); var ReactDOM = __webpack_require__(22); // // if (process.env.NODE_ENV !== "production") { // const Perf = require("react-addons-perf"); // window.Perf = Perf; // } var _require = __webpack_require__(131), bootstrap = _require.bootstrap, L10N = _require.L10N, unmountRoot = _require.unmountRoot; var _require2 = __webpack_require__(828), isFirefoxPanel = _require2.isFirefoxPanel; var _require3 = __webpack_require__(888), onConnect = _require3.onConnect; var _require4 = __webpack_require__(897), teardownWorkers = _require4.teardownWorkers; if (isFirefoxPanel()) { module.exports = { bootstrap: (_ref) => { var threadClient = _ref.threadClient, tabTarget = _ref.tabTarget, debuggerClient = _ref.debuggerClient, sourceMaps = _ref.sourceMaps; return onConnect({ tab: { clientType: "firefox" }, tabConnection: { tabTarget, threadClient, debuggerClient } }, { sourceMaps }); }, destroy: () => { unmountRoot(ReactDOM); teardownWorkers(); } }; } else { window.L10N = L10N; // $FlowIgnore: window.L10N.setBundle(__webpack_require__(960)); bootstrap(React, ReactDOM).then(connection => { onConnect(connection, { sourceMaps: __webpack_require__(898) }); }); } /***/ }, /* 2 */ /***/ function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_2__; /***/ }, /* 3 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; exports.__esModule = true; exports.compose = exports.applyMiddleware = exports.bindActionCreators = exports.combineReducers = exports.createStore = undefined; var _createStore = __webpack_require__(4); var _createStore2 = _interopRequireDefault(_createStore); var _combineReducers = __webpack_require__(17); var _combineReducers2 = _interopRequireDefault(_combineReducers); var _bindActionCreators = __webpack_require__(19); var _bindActionCreators2 = _interopRequireDefault(_bindActionCreators); var _applyMiddleware = __webpack_require__(20); var _applyMiddleware2 = _interopRequireDefault(_applyMiddleware); var _compose = __webpack_require__(21); var _compose2 = _interopRequireDefault(_compose); var _warning = __webpack_require__(18); var _warning2 = _interopRequireDefault(_warning); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /* * 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) { (0, _warning2["default"])('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.'); } exports.createStore = _createStore2["default"]; exports.combineReducers = _combineReducers2["default"]; exports.bindActionCreators = _bindActionCreators2["default"]; exports.applyMiddleware = _applyMiddleware2["default"]; exports.compose = _compose2["default"]; /***/ }, /* 4 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; exports.__esModule = true; exports.ActionTypes = undefined; exports["default"] = createStore; var _isPlainObject = __webpack_require__(5); var _isPlainObject2 = _interopRequireDefault(_isPlainObject); var _symbolObservable = __webpack_require__(15); var _symbolObservable2 = _interopRequireDefault(_symbolObservable); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /** * 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 = exports.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} [initialState] 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, initialState, enhancer) { var _ref2; if (typeof initialState === 'function' && typeof enhancer === 'undefined') { enhancer = initialState; initialState = undefined; } if (typeof enhancer !== 'undefined') { if (typeof enhancer !== 'function') { throw new Error('Expected the enhancer to be a function.'); } return enhancer(createStore)(reducer, initialState); } if (typeof reducer !== 'function') { throw new Error('Expected the reducer to be a function.'); } var currentReducer = reducer; var currentState = initialState; 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 (!(0, _isPlainObject2["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++) { listeners[i](); } 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/zenparsing/es-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[_symbolObservable2["default"]] = 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[_symbolObservable2["default"]] = observable, _ref2; } /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { var baseGetTag = __webpack_require__(6), getPrototype = __webpack_require__(12), isObjectLike = __webpack_require__(14); /** `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 (!isObjectLike(value) || baseGetTag(value) != objectTag) { return false; } var proto = getPrototype(value); if (proto === null) { return true; } var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } module.exports = isPlainObject; /***/ }, /* 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 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, (function() { return this; }()))) /***/ }, /* 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 */ /***/ function(module, exports, __webpack_require__) { var overArg = __webpack_require__(13); /** Built-in value references. */ var getPrototype = overArg(Object.getPrototypeOf, Object); module.exports = getPrototype; /***/ }, /* 13 */ /***/ function(module, exports) { /** * 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)); }; } module.exports = overArg; /***/ }, /* 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__) { /* WEBPACK VAR INJECTION */(function(global) {/* global window */ 'use strict'; module.exports = __webpack_require__(16)(global || window || this); /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ }, /* 16 */ /***/ function(module, exports) { 'use strict'; module.exports = 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; }; /***/ }, /* 17 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; exports.__esModule = true; exports["default"] = combineReducers; var _createStore = __webpack_require__(4); var _isPlainObject = __webpack_require__(5); var _isPlainObject2 = _interopRequireDefault(_isPlainObject); var _warning = __webpack_require__(18); var _warning2 = _interopRequireDefault(_warning); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } 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.'; } function getUnexpectedStateShapeWarningMessage(inputState, reducers, action) { var reducerKeys = Object.keys(reducers); var argumentName = action && action.type === _createStore.ActionTypes.INIT ? 'initialState 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 (!(0, _isPlainObject2["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); }); 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 assertReducerSanity(reducers) { Object.keys(reducers).forEach(function (key) { var reducer = reducers[key]; var initialState = reducer(undefined, { type: _createStore.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.'); } 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 ' + _createStore.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.'); } }); } /** * 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 (typeof reducers[key] === 'function') { finalReducers[key] = reducers[key]; } } var finalReducerKeys = Object.keys(finalReducers); var sanityError; try { assertReducerSanity(finalReducers); } catch (e) { sanityError = e; } return function combination() { var state = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; var action = arguments[1]; if (sanityError) { throw sanityError; } if (false) { var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action); if (warningMessage) { (0, _warning2["default"])(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; }; } /***/ }, /* 18 */ /***/ function(module, exports) { 'use strict'; exports.__esModule = true; exports["default"] = 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 */ } /***/ }, /* 19 */ /***/ function(module, exports) { 'use strict'; exports.__esModule = true; exports["default"] = 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; } /***/ }, /* 20 */ /***/ function(module, exports, __webpack_require__) { 'use strict'; exports.__esModule = 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"] = applyMiddleware; var _compose = __webpack_require__(21); var _compose2 = _interopRequireDefault(_compose); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /** * 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, initialState, enhancer) { var store = createStore(reducer, initialState, 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 = _compose2["default"].apply(undefined, chain)(store.dispatch); return _extends({}, store, { dispatch: _dispatch }); }; }; } /***/ }, /* 21 */ /***/ function(module, exports) { "use strict"; exports.__esModule = true; exports["default"] = 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; }; } else { var _ret = function () { var last = funcs[funcs.length - 1]; var rest = funcs.slice(0, -1); return { v: function v() { return rest.reduceRight(function (composed, f) { return f(composed); }, last.apply(undefined, arguments)); } }; }(); if (typeof _ret === "object") return _ret.v; } } /***/ }, /* 22 */ /***/ function(module, exports, __webpack_require__) { /** * ReactDOM v15.3.2 * * Copyright 2013-present, 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. * */ // Based off https://github.com/ForbesLindesay/umd/blob/master/template.js ;(function(f) { // CommonJS if (true) { module.exports = f(__webpack_require__(2)); // RequireJS } else if (typeof define === "function" && define.amd) { define(['react'], f); // " /***/ }, /* 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 */ /***/ function(module, exports) { // removed by extract-text-webpack-plugin /***/ }, /* 1006 */, /* 1007 */ /***/ function(module, exports, __webpack_require__) { "use strict"; var Tree = __webpack_require__(1008); module.exports = { Tree }; /***/ }, /* 1008 */ /***/ function(module, exports, __webpack_require__) { "use strict"; function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var _require = __webpack_require__(2), dom = _require.DOM, createClass = _require.createClass, createFactory = _require.createFactory, PropTypes = _require.PropTypes; var 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. */ var 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() { var 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); } })); var 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() { var arrow = ArrowExpander({ item: this.props.item, expanded: this.props.expanded, visible: this.props.hasChildren, onExpand: this.props.onExpand, onCollapse: this.props.onCollapse }); var 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) { var animationId = null; var argsToPass = null; return function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } argsToPass = args; if (animationId !== null) { return; } animationId = requestAnimationFrame(() => { fn.call.apply(fn, [this].concat(_toConsumableArray(argsToPass))); animationId = null; argsToPass = null; }); }; } var 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 */ var 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. var autoExpand = (item, currentDepth) => { if (currentDepth >= props.autoExpandDepth || this.state.seen.has(item)) { return; } props.onExpand(item); this.state.seen.add(item); var children = props.getChildren(item); var length = children.length; for (var i = 0; i < length; i++) { autoExpand(children[i], currentDepth + 1); } }; var roots = props.getRoots(); var length = roots.length; if (props.autoExpandAll) { for (var i = 0; i < length; i++) { autoExpand(roots[i], 0); } } else if (length != 0) { autoExpand(roots[0], 0); } }, render() { var traversal = this._dfsFromRoots(); var renderItem = i => { var _traversal$i = traversal[i], item = _traversal$i.item, depth = _traversal$i.depth; 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) }); }; var style = Object.assign({}, this.props.style || {}, { padding: 0, margin: 0 }); return dom.div({ className: "tree", 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) { var maxDepth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity; var traversal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; var _depth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; traversal.push({ item, depth: _depth }); if (!this.props.isExpanded(item)) { return traversal; } var nextDepth = _depth + 1; if (nextDepth > maxDepth) { return traversal; } var children = this.props.getChildren(item); var length = children.length; for (var 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() { var maxDepth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Infinity; var traversal = []; var roots = this.props.getRoots(); var length = roots.length; for (var 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) { var children = this._dfs(item); var length = children.length; for (var 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) { var itemStartPosition = index * this.props.itemHeight; var 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. var prev = void 0; var prevIndex = void 0; var traversal = this._dfsFromRoots(); var length = traversal.length; for (var i = 0; i < length; i++) { var 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. var traversal = this._dfsFromRoots(); var length = traversal.length; var 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 () { var parent = this.props.getParent(this.props.focused); if (!parent) { return; } var traversal = this._dfsFromRoots(); var length = traversal.length; var parentIndex = 0; for (; parentIndex < length; parentIndex++) { if (traversal[parentIndex].item === parent) { break; } } this._focus(parentIndex, parent); }) }); /***/ }, /* 1009 */ /***/ function(module, exports) { // removed by extract-text-webpack-plugin /***/ }, /* 1010 */, /* 1011 */ /***/ function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(2); var _devtoolsConfig = __webpack_require__(828); var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var ReactDOM = __webpack_require__(22); var breakpointSvg = document.createElement("span"); ReactDOM.render((0, _Svg2.default)("column-breakpoint"), breakpointSvg); function makeBookmark(isDisabled) { var bp = breakpointSvg.cloneNode(true); bp.className = (0, _classnames2.default)("editor column-breakpoint", { "breakpoint-disabled": isDisabled }); return bp; } class ColumnBreakpoint extends _react.Component { constructor() { super(); this.bookmark = undefined; var self = this; self.addBreakpoint = this.addBreakpoint.bind(this); } addBreakpoint() { if (!(0, _devtoolsConfig.isEnabled)("columnBreakpoints")) { return; } var bp = this.props.breakpoint; var line = bp.location.line - 1; var column = bp.location.column; var editor = this.props.editor; var widget = makeBookmark(bp.disabled); var bookmark = editor.setBookmark({ line, ch: column }, { widget }); this.bookmark = bookmark; } shouldComponentUpdate(nextProps) { return this.props.editor !== nextProps.editor || this.props.breakpoint.disabled !== nextProps.breakpoint.disabled || this.props.breakpoint.condition !== nextProps.breakpoint.condition; } componentDidMount() { if (!this.props.editor) { return; } this.addBreakpoint(); } componentDidUpdate() { if (this.bookmark) { this.bookmark.clear(); } this.addBreakpoint(); } componentWillUnmount() { if (!this.props.editor || !this.bookmark) { return; } this.bookmark.clear(); } render() { return null; } } ColumnBreakpoint.displayName = "ColumnBreakpoint"; exports.default = ColumnBreakpoint; /***/ }, /* 1012 */ /***/ function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getAndProcessFrames = getAndProcessFrames; var _react = __webpack_require__(2); var _redux = __webpack_require__(3); var _reactRedux = __webpack_require__(151); var _reselect = __webpack_require__(993); var _get = __webpack_require__(67); var _get2 = _interopRequireDefault(_get); var _Frame = __webpack_require__(1013); var _Frame2 = _interopRequireDefault(_Frame); var _Group2 = __webpack_require__(1015); var _Group3 = _interopRequireDefault(_Group2); var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); var _frame = __webpack_require__(1014); var _clipboard = __webpack_require__(423); var _selectors = __webpack_require__(242); __webpack_require__(1018); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var FrameComponent = (0, _react.createFactory)(_Frame2.default); var Group = (0, _react.createFactory)(_Group3.default); var NUM_FRAMES_SHOWN = 7; class Frames extends _react.Component { collapseFrames(frames) { var frameworkGroupingOn = this.props.frameworkGroupingOn; if (!frameworkGroupingOn) { return frames; } return (0, _frame.collapseFrames)(frames); } constructor() { super(...arguments); 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) { var _props = this.props, frames = _props.frames, selectedFrame = _props.selectedFrame, frameworkGroupingOn = _props.frameworkGroupingOn; var showAllFrames = this.state.showAllFrames; return frames !== nextProps.frames || selectedFrame !== nextProps.selectedFrame || showAllFrames !== nextState.showAllFrames || frameworkGroupingOn !== nextProps.frameworkGroupingOn; } toggleFramesDisplay() { this.setState({ showAllFrames: !this.state.showAllFrames }); } truncateFrames(frames) { var numFramesToShow = this.state.showAllFrames ? frames.length : NUM_FRAMES_SHOWN; return frames.slice(0, numFramesToShow); } copyStackTrace() { var frames = this.props.frames; var framesToCopy = frames.map(f => (0, _frame.formatCopyName)(f)).join("\n"); (0, _clipboard.copyToTheClipboard)(framesToCopy); } toggleFrameworkGrouping() { var _props2 = this.props, toggleFrameworkGrouping = _props2.toggleFrameworkGrouping, frameworkGroupingOn = _props2.frameworkGroupingOn; toggleFrameworkGrouping(!frameworkGroupingOn); } renderFrames(frames) { var _props3 = this.props, selectFrame = _props3.selectFrame, selectedFrame = _props3.selectedFrame, toggleBlackBox = _props3.toggleBlackBox, frameworkGroupingOn = _props3.frameworkGroupingOn; var framesOrGroups = this.truncateFrames(this.collapseFrames(frames)); return _react.DOM.ul({}, framesOrGroups.map(frameOrGroup => frameOrGroup.id ? FrameComponent({ frame: frameOrGroup, toggleFrameworkGrouping: this.toggleFrameworkGrouping, copyStackTrace: this.copyStackTrace, frameworkGroupingOn, selectFrame, selectedFrame, toggleBlackBox, key: frameOrGroup.id }) : Group({ group: frameOrGroup, toggleFrameworkGrouping: this.toggleFrameworkGrouping, copyStackTrace: this.copyStackTrace, frameworkGroupingOn, selectFrame, selectedFrame, toggleBlackBox, key: frameOrGroup[0].id }))); } renderToggleButton(frames) { var buttonMessage = this.state.showAllFrames ? L10N.getStr("callStack.collapse") : L10N.getStr("callStack.expand"); frames = (0, _frame.collapseFrames)(frames); if (frames.length < NUM_FRAMES_SHOWN) { return null; } return _react.DOM.div({ className: "show-more", onClick: this.toggleFramesDisplay }, buttonMessage); } render() { var frames = this.props.frames; if (!frames) { return _react.DOM.div({ className: "pane frames" }, _react.DOM.div({ className: "pane-info empty" }, L10N.getStr("callStack.notPaused"))); } return _react.DOM.div({ className: "pane frames" }, this.renderFrames(frames), this.renderToggleButton(frames)); } } Frames.propTypes = { frames: _react.PropTypes.array, frameworkGroupingOn: _react.PropTypes.bool.isRequired, toggleFrameworkGrouping: _react.PropTypes.func.isRequired, selectedFrame: _react.PropTypes.object, selectFrame: _react.PropTypes.func.isRequired, toggleBlackBox: _react.PropTypes.func }; Frames.displayName = "Frames"; function getSourceForFrame(sources, frame) { return (0, _selectors.getSourceInSources)(sources, frame.location.sourceId); } function appendSource(sources, frame) { return Object.assign({}, frame, { source: getSourceForFrame(sources, frame).toJS() }); } function getAndProcessFrames(frames, sources) { if (!frames) { return null; } var processedFrames = frames.filter(frame => getSourceForFrame(sources, frame)).map(frame => appendSource(sources, frame)).filter(frame => !(0, _get2.default)(frame, "source.isBlackBoxed")).map(_frame.annotateFrame); return processedFrames; } var getAndProcessFramesSelector = (0, _reselect.createSelector)(_selectors.getFrames, _selectors.getSources, getAndProcessFrames); exports.default = (0, _reactRedux.connect)(state => ({ frames: getAndProcessFramesSelector(state), frameworkGroupingOn: (0, _selectors.getFrameworkGroupingState)(state), selectedFrame: (0, _selectors.getSelectedFrame)(state) }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Frames); /***/ }, /* 1013 */ /***/ function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(2); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); var _frame = __webpack_require__(1014); var _source = __webpack_require__(233); var _FrameMenu = __webpack_require__(1032); var _FrameMenu2 = _interopRequireDefault(_FrameMenu); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function renderFrameTitle(frame, options) { var displayName = (0, _frame.formatDisplayName)(frame, options); return _react.DOM.div({ className: "title" }, displayName); } function renderFrameLocation(_ref) { var source = _ref.source, location = _ref.location, library = _ref.library; if (!source) { return; } if (library) { return _react.DOM.div({ className: "location" }, library, (0, _Svg2.default)(library.toLowerCase(), { className: "annotation-logo" })); } var filename = (0, _source.getFilename)(source); return _react.DOM.div({ className: "location" }, `${filename}: ${location.line}`); } class FrameComponent extends _react.Component { constructor() { super(); } onContextMenu(event) { var _props = this.props, frame = _props.frame, copyStackTrace = _props.copyStackTrace, toggleFrameworkGrouping = _props.toggleFrameworkGrouping, toggleBlackBox = _props.toggleBlackBox, frameworkGroupingOn = _props.frameworkGroupingOn; (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() { var _props2 = this.props, frame = _props2.frame, selectedFrame = _props2.selectedFrame, hideLocation = _props2.hideLocation, shouldMapDisplayName = _props2.shouldMapDisplayName; return _react.DOM.li({ key: frame.id, className: (0, _classnames2.default)("frame", { selected: selectedFrame && selectedFrame.id === frame.id }), onMouseDown: e => this.onMouseDown(e, frame, selectedFrame), onKeyUp: e => this.onKeyUp(e, frame, selectedFrame), onContextMenu: e => this.onContextMenu(e), tabIndex: 0 }, renderFrameTitle(frame, { shouldMapDisplayName }), !hideLocation ? renderFrameLocation(frame) : null); } } exports.default = FrameComponent; FrameComponent.defaultProps = { hideLocation: false, shouldMapDisplayName: true }; FrameComponent.displayName = "Frame"; /***/ }, /* 1014 */ /***/ function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getLibraryFromUrl = getLibraryFromUrl; exports.annotateFrame = annotateFrame; exports.simplifyDisplayName = simplifyDisplayName; exports.formatDisplayName = formatDisplayName; exports.formatCopyName = formatCopyName; exports.collapseFrames = collapseFrames; var _get = __webpack_require__(67); var _get2 = _interopRequireDefault(_get); var _devtoolsConfig = __webpack_require__(828); var _utils = __webpack_require__(234); var _source = __webpack_require__(233); var _findIndex = __webpack_require__(262); var _findIndex2 = _interopRequireDefault(_findIndex); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function getFrameUrl(frame) { return (0, _get2.default)(frame, "source.url", "") || ""; } function isBackbone(frame) { return getFrameUrl(frame).match(/backbone/i); } function isJQuery(frame) { return getFrameUrl(frame).match(/jquery/i); } function isReact(frame) { return getFrameUrl(frame).match(/react/i); } function isWebpack(frame) { return getFrameUrl(frame).match(/webpack\/bootstrap/i); } function isNodeInternal(frame) { // starts with "internal/" OR no path, just "timers.js", "url.js" etc // (normally frameUrl will be a FQ pathname) return (/(^internal\/|^[^.\/]+\.js)/.test(getFrameUrl(frame)) ); } function isExpress(frame) { return (/node_modules\/express/.test(getFrameUrl(frame)) ); } function isPug(frame) { return (/node_modules\/pug/.test(getFrameUrl(frame)) ); } function isExtJs(frame) { return (/\/ext-all[\.\-]/.test(getFrameUrl(frame)) ); } 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) if (isBackbone(frame)) { return "Backbone"; } if (isJQuery(frame)) { return "jQuery"; } if (isReact(frame)) { return "React"; } if (isWebpack(frame)) { return "Webpack"; } if (isNodeInternal(frame)) { return "Node"; } if (isExpress(frame)) { return "Express"; } if (isPug(frame)) { return "Pug"; } if (isExtJs(frame)) { return "ExtJS"; } } var 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" }, Webpack: { // eslint-disable-next-line camelcase __webpack_require__: "Bootstrap" } }; function mapDisplayNames(frame, library) { var map = displayNameMap[library]; var displayName = frame.displayName; return map && map[displayName] || displayName; } function annotateFrame(frame) { if (!(0, _devtoolsConfig.isEnabled)("collapseFrame")) { return frame; } var library = getLibraryFromUrl(frame); if (library) { return Object.assign({}, 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 var objectProperty = /([\w\d]+)$/; var arrayProperty = /\[(.*?)\]$/; var functionProperty = /([\w\d]+)[\/\.<]*?$/; var annonymousProperty = /([\w\d]+)\(\^\)$/; function simplifyDisplayName(displayName) { // if the display name has a space it has already been mapped if (/\s/.exec(displayName)) { return displayName; } var scenarios = [objectProperty, arrayProperty, functionProperty, annonymousProperty]; for (var reg of scenarios) { var match = reg.exec(displayName); if (match) { return match[1]; } } return displayName; } function formatDisplayName(frame) { var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref$shouldMapDisplay = _ref.shouldMapDisplayName, shouldMapDisplayName = _ref$shouldMapDisplay === undefined ? true : _ref$shouldMapDisplay; var displayName = frame.displayName, library = frame.library; if (library && shouldMapDisplayName) { displayName = mapDisplayNames(frame, library); } displayName = simplifyDisplayName(displayName); return (0, _utils.endTruncateStr)(displayName, 25); } function formatCopyName(frame) { var displayName = formatDisplayName(frame); var fileName = (0, _source.getFilename)(frame.source); var 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; } var _collapseLastFrames = collapseLastFrames(frames), newFrames = _collapseLastFrames.newFrames, lastGroup = _collapseLastFrames.lastGroup; frames = newFrames; var items = []; var currentGroup = null; var prevItem = null; for (var frame of frames) { var prevLibrary = (0, _get2.default)(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) { var index = (0, _findIndex2.default)(frames, isWebpack); if (index == -1) { return { newFrames: frames, lastGroup: [] }; } var newFrames = frames.slice(0, index); var lastGroup = frames.slice(index); return { newFrames, lastGroup }; } /***/ }, /* 1015 */ /***/ function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(2); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); var _frame = __webpack_require__(1014); var _FrameMenu = __webpack_require__(1032); var _FrameMenu2 = _interopRequireDefault(_FrameMenu); __webpack_require__(1016); var _Frame = __webpack_require__(1013); var _Frame2 = _interopRequireDefault(_Frame); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var FrameComponent = (0, _react.createFactory)(_Frame2.default); function renderFrameLocation(frame) { var library = (0, _frame.getLibraryFromUrl)(frame); if (!library) { return null; } return _react.DOM.div({ className: "location" }, library, (0, _Svg2.default)(library.toLowerCase(), { className: "annotation-logo" })); } class Group extends _react.Component { constructor() { super(...arguments); this.state = { expanded: false }; var self = this; self.toggleFrames = this.toggleFrames.bind(this); } onContextMenu(event) { var _props = this.props, group = _props.group, copyStackTrace = _props.copyStackTrace, toggleFrameworkGrouping = _props.toggleFrameworkGrouping, toggleBlackBox = _props.toggleBlackBox, frameworkGroupingOn = _props.frameworkGroupingOn; var frame = group[0]; (0, _FrameMenu2.default)(frame, frameworkGroupingOn, { copyStackTrace, toggleFrameworkGrouping, toggleBlackBox }, event); } toggleFrames() { this.setState({ expanded: !this.state.expanded }); } renderFrames() { var _props2 = this.props, group = _props2.group, selectFrame = _props2.selectFrame, selectedFrame = _props2.selectedFrame, toggleFrameworkGrouping = _props2.toggleFrameworkGrouping, frameworkGroupingOn = _props2.frameworkGroupingOn, toggleBlackBox = _props2.toggleBlackBox, copyStackTrace = _props2.copyStackTrace; var expanded = this.state.expanded; if (!expanded) { return null; } return _react.DOM.div({ className: "frames-list" }, group.map(frame => FrameComponent({ frame, copyStackTrace, toggleFrameworkGrouping, frameworkGroupingOn, selectFrame, selectedFrame, toggleBlackBox, key: frame.id, hideLocation: true, shouldMapDisplayName: false }))); } renderDescription() { var frame = this.props.group[0]; var displayName = (0, _frame.formatDisplayName)(frame); return _react.DOM.li({ key: frame.id, className: (0, _classnames2.default)("group"), onClick: this.toggleFrames, tabIndex: 0 }, _react.DOM.div({ className: "title" }, displayName), renderFrameLocation(frame)); } render() { var expanded = this.state.expanded; return _react.DOM.div({ className: (0, _classnames2.default)("frames-group", { expanded }), onContextMenu: e => this.onContextMenu(e) }, this.renderDescription(), this.renderFrames()); } } exports.default = Group; Group.displayName = "Group"; /***/ }, /* 1016 */ /***/ function(module, exports) { // removed by extract-text-webpack-plugin /***/ }, /* 1017 */, /* 1018 */ /***/ function(module, exports) { // removed by extract-text-webpack-plugin /***/ }, /* 1019 */, /* 1020 */, /* 1021 */, /* 1022 */, /* 1023 */, /* 1024 */, /* 1025 */ /***/ function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(2); var _range = __webpack_require__(1026); var _range2 = _interopRequireDefault(_range); var _isEmpty = __webpack_require__(963); var _isEmpty2 = _interopRequireDefault(_isEmpty); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } class HighlightLines extends _react.Component { constructor() { super(); this.highlightLineRange = this.highlightLineRange.bind(this); } componentDidMount() { if (!this.props.editor) { return; } this.highlightLineRange(); } componentWillUpdate() { this.clearHighlightRange(); } componentDidUpdate() { this.highlightLineRange(); } componentWillUnmount() { this.clearHighlightRange(); } clearHighlightRange() { var _props = this.props, highlightedLineRange = _props.highlightedLineRange, editor = _props.editor; if (!editor) { return; } var codeMirror = editor.codeMirror; if ((0, _isEmpty2.default)(highlightedLineRange) || !editor || !codeMirror) { return; } var start = highlightedLineRange.start, end = highlightedLineRange.end; (0, _range2.default)(start - 1, end).forEach(line => { codeMirror.removeLineClass(line, "line", "highlight-lines"); }); } highlightLineRange() { var _props2 = this.props, highlightedLineRange = _props2.highlightedLineRange, editor = _props2.editor; if (!editor) { return; } var codeMirror = editor.codeMirror; if ((0, _isEmpty2.default)(highlightedLineRange) || !codeMirror) { return; } var start = highlightedLineRange.start, end = highlightedLineRange.end; editor.alignLine(start); (0, _range2.default)(start - 1, end).forEach(line => { codeMirror.addLineClass(line, "line", "highlight-lines"); }); } render() { return null; } } HighlightLines.displayName = "HighlightLines"; exports.default = HighlightLines; /***/ }, /* 1026 */ /***/ function(module, exports, __webpack_require__) { var createRange = __webpack_require__(1027); /** * Creates an array of numbers (positive and/or negative) progressing from * `start` up to, but not including, `end`. A step of `-1` is used if a negative * `start` is specified without an `end` or `step`. If `end` is not specified, * it's set to `start` with `start` then set to `0`. * * **Note:** JavaScript follows the IEEE-754 standard for resolving * floating-point values which can produce unexpected results. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. * @param {number} [step=1] The value to increment or decrement by. * @returns {Array} Returns the range of numbers. * @see _.inRange, _.rangeRight * @example * * _.range(4); * // => [0, 1, 2, 3] * * _.range(-4); * // => [0, -1, -2, -3] * * _.range(1, 5); * // => [1, 2, 3, 4] * * _.range(0, 20, 5); * // => [0, 5, 10, 15] * * _.range(0, -4, -1); * // => [0, -1, -2, -3] * * _.range(1, 4, 0); * // => [1, 1, 1] * * _.range(0); * // => [] */ var range = createRange(); module.exports = range; /***/ }, /* 1027 */ /***/ function(module, exports, __webpack_require__) { var baseRange = __webpack_require__(1028), isIterateeCall = __webpack_require__(418), toFinite = __webpack_require__(303); /** * Creates a `_.range` or `_.rangeRight` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new range function. */ function createRange(fromRight) { return function(start, end, step) { if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { end = step = undefined; } // Ensure the sign of `-0` is preserved. start = toFinite(start); if (end === undefined) { end = start; start = 0; } else { end = toFinite(end); } step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); return baseRange(start, end, step, fromRight); }; } module.exports = createRange; /***/ }, /* 1028 */ /***/ function(module, exports) { /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil, nativeMax = Math.max; /** * The base implementation of `_.range` and `_.rangeRight` which doesn't * coerce arguments. * * @private * @param {number} start The start of the range. * @param {number} end The end of the range. * @param {number} step The value to increment or decrement by. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Array} Returns the range of numbers. */ function baseRange(start, end, step, fromRight) { var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result = Array(length); while (length--) { result[fromRight ? length : ++index] = start; start += step; } return result; } module.exports = baseRange; /***/ }, /* 1029 */ /***/ function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _react = __webpack_require__(2); var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); __webpack_require__(1030); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var BracketArrow = (_ref) => { var orientation = _ref.orientation, left = _ref.left, top = _ref.top, bottom = _ref.bottom; return _react.DOM.div({ className: (0, _classnames2.default)("bracket-arrow", orientation || "up"), style: { left, top, bottom } }, ""); }; BracketArrow.propTypes = { orientation: _react.PropTypes.string, left: _react.PropTypes.number, top: _react.PropTypes.number, bottom: _react.PropTypes.number }; BracketArrow.displayName = "BracketArrow"; exports.default = BracketArrow; /***/ }, /* 1030 */ /***/ function(module, exports) { // removed by extract-text-webpack-plugin /***/ }, /* 1031 */, /* 1032 */ /***/ function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = FrameMenu; var _devtoolsLaunchpad = __webpack_require__(131); var _clipboard = __webpack_require__(423); var _lodash = __webpack_require__(1048); var _lodash2 = _interopRequireDefault(_lodash); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var blackboxString = "sourceFooter.blackbox"; var unblackboxString = "sourceFooter.unblackbox"; function formatMenuElement(labelString, click) { var disabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var label = L10N.getStr(labelString); var accesskey = L10N.getStr(`${labelString}.accesskey`); var id = `node-menu-${(0, _lodash2.default)(label)}`; return { id, label, accesskey, disabled, click }; } function copySourceElement(url) { return formatMenuElement("copySourceUrl", () => (0, _clipboard.copyToTheClipboard)(url)); } function copyStackTraceElement(copyStackTrace) { return formatMenuElement("copyStackTrace", () => copyStackTrace()); } function toggleFrameworkGroupingElement(toggleFrameworkGrouping, frameworkGroupingOn) { var actionType = frameworkGroupingOn ? "framework.disableGrouping" : "framework.enableGrouping"; return formatMenuElement(actionType, () => toggleFrameworkGrouping()); } function blackBoxSource(source, toggleBlackBox) { var toggleBlackBoxString = source.isBlackBoxed ? unblackboxString : blackboxString; return formatMenuElement(toggleBlackBoxString, () => toggleBlackBox(source)); } function FrameMenu(frame, frameworkGroupingOn, callbacks, event) { event.stopPropagation(); event.preventDefault(); var menuOptions = []; var source = frame.source; var toggleFrameworkElement = toggleFrameworkGroupingElement(callbacks.toggleFrameworkGrouping, frameworkGroupingOn); menuOptions.push(toggleFrameworkElement); if (source) { var copySourceUrl = copySourceElement(source.url); menuOptions.push(copySourceUrl); menuOptions.push(blackBoxSource(source, callbacks.toggleBlackBox)); } var copyStackTraceItem = copyStackTraceElement(callbacks.copyStackTrace); menuOptions.push(copyStackTraceItem); (0, _devtoolsLaunchpad.showMenu)(event, menuOptions); } /***/ }, /* 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 */ /***/ function(module, exports) { // removed by extract-text-webpack-plugin /***/ }, /* 1047 */, /* 1048 */ /***/ function(module, exports) { /* WEBPACK VAR INJECTION */(function(global) {/** * lodash (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** `Object#toString` result references. */ var symbolTag = '[object Symbol]'; /** Used to match words composed of alphanumeric characters. */ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; /** Used to match Latin Unicode letters (excluding mathematical operators). */ var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; /** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff', rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', rsComboSymbolsRange = '\\u20d0-\\u20f0', rsDingbatRange = '\\u2700-\\u27bf', rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', rsPunctuationRange = '\\u2000-\\u206f', rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', rsVarRange = '\\ufe0e\\ufe0f', rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; /** Used to compose unicode capture groups. */ var rsApos = "['\u2019]", rsBreak = '[' + rsBreakRange + ']', rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', rsDigits = '\\d+', rsDingbat = '[' + rsDingbatRange + ']', rsLower = '[' + rsLowerRange + ']', rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', rsFitz = '\\ud83c[\\udffb-\\udfff]', rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', rsNonAstral = '[^' + rsAstralRange + ']', rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', rsUpper = '[' + rsUpperRange + ']', rsZWJ = '\\u200d'; /** Used to compose unicode regexes. */ var rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')', rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')', rsOptLowerContr = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', rsOptUpperContr = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', reOptMod = rsModifier + '?', rsOptVar = '[' + rsVarRange + ']?', rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq; /** Used to match apostrophes. */ var reApos = RegExp(rsApos, 'g'); /** * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). */ var reComboMark = RegExp(rsCombo, 'g'); /** Used to match complex or compound words. */ var reUnicodeWord = RegExp([ rsUpper + '?' + rsLower + '+' + rsOptLowerContr + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', rsUpperMisc + '+' + rsOptUpperContr + '(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')', rsUpper + '?' + rsLowerMisc + '+' + rsOptLowerContr, rsUpper + '+' + rsOptUpperContr, rsDigits, rsEmoji ].join('|'), 'g'); /** Used to detect strings that need a more robust regexp to match words. */ var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; /** Used to map Latin Unicode letters to basic Latin letters. */ var deburredLetters = { // Latin-1 Supplement block. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', '\xc7': 'C', '\xe7': 'c', '\xd0': 'D', '\xf0': 'd', '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', '\xd1': 'N', '\xf1': 'n', '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', '\xc6': 'Ae', '\xe6': 'ae', '\xde': 'Th', '\xfe': 'th', '\xdf': 'ss', // Latin Extended-A block. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', '\u0134': 'J', '\u0135': 'j', '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', '\u0163': 't', '\u0165': 't', '\u0167': 't', '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', '\u0174': 'W', '\u0175': 'w', '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', '\u0132': 'IJ', '\u0133': 'ij', '\u0152': 'Oe', '\u0153': 'oe', '\u0149': "'n", '\u017f': 'ss' }; /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; /** 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')(); /** * A specialized version of `_.reduce` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the first element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, length = array ? array.length : 0; if (initAccum && length) { accumulator = array[++index]; } while (++index < length) { accumulator = iteratee(accumulator, array[index], index, array); } return accumulator; } /** * Splits an ASCII `string` into an array of its words. * * @private * @param {string} The string to inspect. * @returns {Array} Returns the words of `string`. */ function asciiWords(string) { return string.match(reAsciiWord) || []; } /** * The base implementation of `_.propertyOf` without support for deep paths. * * @private * @param {Object} object The object to query. * @returns {Function} Returns the new accessor function. */ function basePropertyOf(object) { return function(key) { return object == null ? undefined : object[key]; }; } /** * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A * letters to basic Latin letters. * * @private * @param {string} letter The matched letter to deburr. * @returns {string} Returns the deburred letter. */ var deburrLetter = basePropertyOf(deburredLetters); /** * Checks if `string` contains a word composed of Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a word is found, else `false`. */ function hasUnicodeWord(string) { return reHasUnicodeWord.test(string); } /** * Splits a Unicode `string` into an array of its words. * * @private * @param {string} The string to inspect. * @returns {Array} Returns the words of `string`. */ function unicodeWords(string) { return string.match(reUnicodeWord) || []; } /** 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 objectToString = objectProto.toString; /** Built-in value references. */ var Symbol = root.Symbol; /** 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 (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * Creates a function like `_.camelCase`. * * @private * @param {Function} callback The function to combine each word. * @returns {Function} Returns the new compounder function. */ function createCompounder(callback) { return function(string) { return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); }; } /** * 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 && typeof value == 'object'; } /** * 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) && objectToString.call(value) == symbolTag); } /** * 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 process. * @returns {string} Returns the string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ function toString(value) { return value == null ? '' : baseToString(value); } /** * Deburrs `string` by converting * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) * letters to basic Latin letters and removing * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to deburr. * @returns {string} Returns the deburred string. * @example * * _.deburr('déjà vu'); * // => 'deja vu' */ function deburr(string) { string = toString(string); return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); } /** * Converts `string` to * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the kebab cased string. * @example * * _.kebabCase('Foo Bar'); * // => 'foo-bar' * * _.kebabCase('fooBar'); * // => 'foo-bar' * * _.kebabCase('__FOO_BAR__'); * // => 'foo-bar' */ var kebabCase = createCompounder(function(result, word, index) { return result + (index ? '-' : '') + word.toLowerCase(); }); /** * Splits `string` into an array of its words. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {RegExp|string} [pattern] The pattern to match words. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the words of `string`. * @example * * _.words('fred, barney, & pebbles'); * // => ['fred', 'barney', 'pebbles'] * * _.words('fred, barney, & pebbles', /[^, ]+/g); * // => ['fred', 'barney', '&', 'pebbles'] */ function words(string, pattern, guard) { string = toString(string); pattern = guard ? undefined : pattern; if (pattern === undefined) { return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); } return string.match(pattern) || []; } module.exports = kebabCase; /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) /***/ } /******/ ]) }); ;