diff --git a/build/plotly.js-react-editor.js b/build/plotly.js-react-editor.js deleted file mode 100644 index 300a0d860..000000000 --- a/build/plotly.js-react-editor.js +++ /dev/null @@ -1,20389 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],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}g.createPlotlyComponent = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;oHello World; - * } - * }); - * - * The class specification supports a specific protocol of methods that have - * special meaning (e.g. `render`). See `ReactClassInterface` for - * more the comprehensive protocol. Any other properties and methods in the - * class specification will be available on the prototype. - * - * @interface ReactClassInterface - * @internal - */ - var ReactClassInterface = { - /** - * An array of Mixin objects to include when defining your component. - * - * @type {array} - * @optional - */ - mixins: 'DEFINE_MANY', - - /** - * An object containing properties and methods that should be defined on - * the component's constructor instead of its prototype (static methods). - * - * @type {object} - * @optional - */ - statics: 'DEFINE_MANY', - - /** - * Definition of prop types for this component. - * - * @type {object} - * @optional - */ - propTypes: 'DEFINE_MANY', - - /** - * Definition of context types for this component. - * - * @type {object} - * @optional - */ - contextTypes: 'DEFINE_MANY', - - /** - * Definition of context types this component sets for its children. - * - * @type {object} - * @optional - */ - childContextTypes: 'DEFINE_MANY', - - // ==== Definition methods ==== - - /** - * Invoked when the component is mounted. Values in the mapping will be set on - * `this.props` if that prop is not specified (i.e. using an `in` check). - * - * This method is invoked before `getInitialState` and therefore cannot rely - * on `this.state` or use `this.setState`. - * - * @return {object} - * @optional - */ - getDefaultProps: 'DEFINE_MANY_MERGED', - - /** - * Invoked once before the component is mounted. The return value will be used - * as the initial value of `this.state`. - * - * getInitialState: function() { - * return { - * isOn: false, - * fooBaz: new BazFoo() - * } - * } - * - * @return {object} - * @optional - */ - getInitialState: 'DEFINE_MANY_MERGED', - - /** - * @return {object} - * @optional - */ - getChildContext: 'DEFINE_MANY_MERGED', - - /** - * Uses props from `this.props` and state from `this.state` to render the - * structure of the component. - * - * No guarantees are made about when or how often this method is invoked, so - * it must not have side effects. - * - * render: function() { - * var name = this.props.name; - * return
Hello, {name}!
; - * } - * - * @return {ReactComponent} - * @required - */ - render: 'DEFINE_ONCE', - - // ==== Delegate methods ==== - - /** - * Invoked when the component is initially created and about to be mounted. - * This may have side effects, but any external subscriptions or data created - * by this method must be cleaned up in `componentWillUnmount`. - * - * @optional - */ - componentWillMount: 'DEFINE_MANY', - - /** - * Invoked when the component has been mounted and has a DOM representation. - * However, there is no guarantee that the DOM node is in the document. - * - * Use this as an opportunity to operate on the DOM when the component has - * been mounted (initialized and rendered) for the first time. - * - * @param {DOMElement} rootNode DOM element representing the component. - * @optional - */ - componentDidMount: 'DEFINE_MANY', - - /** - * Invoked before the component receives new props. - * - * Use this as an opportunity to react to a prop transition by updating the - * state using `this.setState`. Current props are accessed via `this.props`. - * - * componentWillReceiveProps: function(nextProps, nextContext) { - * this.setState({ - * likesIncreasing: nextProps.likeCount > this.props.likeCount - * }); - * } - * - * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop - * transition may cause a state change, but the opposite is not true. If you - * need it, you are probably looking for `componentWillUpdate`. - * - * @param {object} nextProps - * @optional - */ - componentWillReceiveProps: 'DEFINE_MANY', - - /** - * Invoked while deciding if the component should be updated as a result of - * receiving new props, state and/or context. - * - * Use this as an opportunity to `return false` when you're certain that the - * transition to the new props/state/context will not require a component - * update. - * - * shouldComponentUpdate: function(nextProps, nextState, nextContext) { - * return !equal(nextProps, this.props) || - * !equal(nextState, this.state) || - * !equal(nextContext, this.context); - * } - * - * @param {object} nextProps - * @param {?object} nextState - * @param {?object} nextContext - * @return {boolean} True if the component should update. - * @optional - */ - shouldComponentUpdate: 'DEFINE_ONCE', - - /** - * Invoked when the component is about to update due to a transition from - * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState` - * and `nextContext`. - * - * Use this as an opportunity to perform preparation before an update occurs. - * - * NOTE: You **cannot** use `this.setState()` in this method. - * - * @param {object} nextProps - * @param {?object} nextState - * @param {?object} nextContext - * @param {ReactReconcileTransaction} transaction - * @optional - */ - componentWillUpdate: 'DEFINE_MANY', - - /** - * Invoked when the component's DOM representation has been updated. - * - * Use this as an opportunity to operate on the DOM when the component has - * been updated. - * - * @param {object} prevProps - * @param {?object} prevState - * @param {?object} prevContext - * @param {DOMElement} rootNode DOM element representing the component. - * @optional - */ - componentDidUpdate: 'DEFINE_MANY', - - /** - * Invoked when the component is about to be removed from its parent and have - * its DOM representation destroyed. - * - * Use this as an opportunity to deallocate any external resources. - * - * NOTE: There is no `componentDidUnmount` since your component will have been - * destroyed by that point. - * - * @optional - */ - componentWillUnmount: 'DEFINE_MANY', - - // ==== Advanced methods ==== - - /** - * Updates the component's currently mounted DOM representation. - * - * By default, this implements React's rendering and reconciliation algorithm. - * Sophisticated clients may wish to override this. - * - * @param {ReactReconcileTransaction} transaction - * @internal - * @overridable - */ - updateComponent: 'OVERRIDE_BASE' - }; - - /** - * Mapping from class specification keys to special processing functions. - * - * Although these are declared like instance properties in the specification - * when defining classes using `React.createClass`, they are actually static - * and are accessible on the constructor instead of the prototype. Despite - * being static, they must be defined outside of the "statics" key under - * which all other static methods are defined. - */ - var RESERVED_SPEC_KEYS = { - displayName: function(Constructor, displayName) { - Constructor.displayName = displayName; - }, - mixins: function(Constructor, mixins) { - if (mixins) { - for (var i = 0; i < mixins.length; i++) { - mixSpecIntoComponent(Constructor, mixins[i]); - } - } - }, - childContextTypes: function(Constructor, childContextTypes) { - if (process.env.NODE_ENV !== 'production') { - validateTypeDef(Constructor, childContextTypes, 'childContext'); - } - Constructor.childContextTypes = _assign( - {}, - Constructor.childContextTypes, - childContextTypes - ); - }, - contextTypes: function(Constructor, contextTypes) { - if (process.env.NODE_ENV !== 'production') { - validateTypeDef(Constructor, contextTypes, 'context'); - } - Constructor.contextTypes = _assign( - {}, - Constructor.contextTypes, - contextTypes - ); - }, - /** - * Special case getDefaultProps which should move into statics but requires - * automatic merging. - */ - getDefaultProps: function(Constructor, getDefaultProps) { - if (Constructor.getDefaultProps) { - Constructor.getDefaultProps = createMergedResultFunction( - Constructor.getDefaultProps, - getDefaultProps - ); - } else { - Constructor.getDefaultProps = getDefaultProps; - } - }, - propTypes: function(Constructor, propTypes) { - if (process.env.NODE_ENV !== 'production') { - validateTypeDef(Constructor, propTypes, 'prop'); - } - Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes); - }, - statics: function(Constructor, statics) { - mixStaticSpecIntoComponent(Constructor, statics); - }, - autobind: function() {} - }; - - function validateTypeDef(Constructor, typeDef, location) { - for (var propName in typeDef) { - if (typeDef.hasOwnProperty(propName)) { - // use a warning instead of an _invariant so components - // don't show up in prod but only in __DEV__ - if (process.env.NODE_ENV !== 'production') { - warning( - typeof typeDef[propName] === 'function', - '%s: %s type `%s` is invalid; it must be a function, usually from ' + - 'React.PropTypes.', - Constructor.displayName || 'ReactClass', - ReactPropTypeLocationNames[location], - propName - ); - } - } - } - } - - function validateMethodOverride(isAlreadyDefined, name) { - var specPolicy = ReactClassInterface.hasOwnProperty(name) - ? ReactClassInterface[name] - : null; - - // Disallow overriding of base class methods unless explicitly allowed. - if (ReactClassMixin.hasOwnProperty(name)) { - _invariant( - specPolicy === 'OVERRIDE_BASE', - 'ReactClassInterface: You are attempting to override ' + - '`%s` from your class specification. Ensure that your method names ' + - 'do not overlap with React methods.', - name - ); - } - - // Disallow defining methods more than once unless explicitly allowed. - if (isAlreadyDefined) { - _invariant( - specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED', - 'ReactClassInterface: You are attempting to define ' + - '`%s` on your component more than once. This conflict may be due ' + - 'to a mixin.', - name - ); - } - } - - /** - * Mixin helper which handles policy validation and reserved - * specification keys when building React classes. - */ - function mixSpecIntoComponent(Constructor, spec) { - if (!spec) { - if (process.env.NODE_ENV !== 'production') { - var typeofSpec = typeof spec; - var isMixinValid = typeofSpec === 'object' && spec !== null; - - if (process.env.NODE_ENV !== 'production') { - warning( - isMixinValid, - "%s: You're attempting to include a mixin that is either null " + - 'or not an object. Check the mixins included by the component, ' + - 'as well as any mixins they include themselves. ' + - 'Expected object but got %s.', - Constructor.displayName || 'ReactClass', - spec === null ? null : typeofSpec - ); - } - } - - return; - } - - _invariant( - typeof spec !== 'function', - "ReactClass: You're attempting to " + - 'use a component class or function as a mixin. Instead, just use a ' + - 'regular object.' - ); - _invariant( - !isValidElement(spec), - "ReactClass: You're attempting to " + - 'use a component as a mixin. Instead, just use a regular object.' - ); - - var proto = Constructor.prototype; - var autoBindPairs = proto.__reactAutoBindPairs; - - // By handling mixins before any other properties, we ensure the same - // chaining order is applied to methods with DEFINE_MANY policy, whether - // mixins are listed before or after these methods in the spec. - if (spec.hasOwnProperty(MIXINS_KEY)) { - RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins); - } - - for (var name in spec) { - if (!spec.hasOwnProperty(name)) { - continue; - } - - if (name === MIXINS_KEY) { - // We have already handled mixins in a special case above. - continue; - } - - var property = spec[name]; - var isAlreadyDefined = proto.hasOwnProperty(name); - validateMethodOverride(isAlreadyDefined, name); - - if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) { - RESERVED_SPEC_KEYS[name](Constructor, property); - } else { - // Setup methods on prototype: - // The following member methods should not be automatically bound: - // 1. Expected ReactClass methods (in the "interface"). - // 2. Overridden methods (that were mixed in). - var isReactClassMethod = ReactClassInterface.hasOwnProperty(name); - var isFunction = typeof property === 'function'; - var shouldAutoBind = - isFunction && - !isReactClassMethod && - !isAlreadyDefined && - spec.autobind !== false; - - if (shouldAutoBind) { - autoBindPairs.push(name, property); - proto[name] = property; - } else { - if (isAlreadyDefined) { - var specPolicy = ReactClassInterface[name]; - - // These cases should already be caught by validateMethodOverride. - _invariant( - isReactClassMethod && - (specPolicy === 'DEFINE_MANY_MERGED' || - specPolicy === 'DEFINE_MANY'), - 'ReactClass: Unexpected spec policy %s for key %s ' + - 'when mixing in component specs.', - specPolicy, - name - ); - - // For methods which are defined more than once, call the existing - // methods before calling the new property, merging if appropriate. - if (specPolicy === 'DEFINE_MANY_MERGED') { - proto[name] = createMergedResultFunction(proto[name], property); - } else if (specPolicy === 'DEFINE_MANY') { - proto[name] = createChainedFunction(proto[name], property); - } - } else { - proto[name] = property; - if (process.env.NODE_ENV !== 'production') { - // Add verbose displayName to the function, which helps when looking - // at profiling tools. - if (typeof property === 'function' && spec.displayName) { - proto[name].displayName = spec.displayName + '_' + name; - } - } - } - } - } - } - } - - function mixStaticSpecIntoComponent(Constructor, statics) { - if (!statics) { - return; - } - for (var name in statics) { - var property = statics[name]; - if (!statics.hasOwnProperty(name)) { - continue; - } - - var isReserved = name in RESERVED_SPEC_KEYS; - _invariant( - !isReserved, - 'ReactClass: You are attempting to define a reserved ' + - 'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' + - 'as an instance property instead; it will still be accessible on the ' + - 'constructor.', - name - ); - - var isInherited = name in Constructor; - _invariant( - !isInherited, - 'ReactClass: You are attempting to define ' + - '`%s` on your component more than once. This conflict may be ' + - 'due to a mixin.', - name - ); - Constructor[name] = property; - } - } - - /** - * Merge two objects, but throw if both contain the same key. - * - * @param {object} one The first object, which is mutated. - * @param {object} two The second object - * @return {object} one after it has been mutated to contain everything in two. - */ - function mergeIntoWithNoDuplicateKeys(one, two) { - _invariant( - one && two && typeof one === 'object' && typeof two === 'object', - 'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.' - ); - - for (var key in two) { - if (two.hasOwnProperty(key)) { - _invariant( - one[key] === undefined, - 'mergeIntoWithNoDuplicateKeys(): ' + - 'Tried to merge two objects with the same key: `%s`. This conflict ' + - 'may be due to a mixin; in particular, this may be caused by two ' + - 'getInitialState() or getDefaultProps() methods returning objects ' + - 'with clashing keys.', - key - ); - one[key] = two[key]; - } - } - return one; - } - - /** - * Creates a function that invokes two functions and merges their return values. - * - * @param {function} one Function to invoke first. - * @param {function} two Function to invoke second. - * @return {function} Function that invokes the two argument functions. - * @private - */ - function createMergedResultFunction(one, two) { - return function mergedResult() { - var a = one.apply(this, arguments); - var b = two.apply(this, arguments); - if (a == null) { - return b; - } else if (b == null) { - return a; - } - var c = {}; - mergeIntoWithNoDuplicateKeys(c, a); - mergeIntoWithNoDuplicateKeys(c, b); - return c; - }; - } - - /** - * Creates a function that invokes two functions and ignores their return vales. - * - * @param {function} one Function to invoke first. - * @param {function} two Function to invoke second. - * @return {function} Function that invokes the two argument functions. - * @private - */ - function createChainedFunction(one, two) { - return function chainedFunction() { - one.apply(this, arguments); - two.apply(this, arguments); - }; - } - - /** - * Binds a method to the component. - * - * @param {object} component Component whose method is going to be bound. - * @param {function} method Method to be bound. - * @return {function} The bound method. - */ - function bindAutoBindMethod(component, method) { - var boundMethod = method.bind(component); - if (process.env.NODE_ENV !== 'production') { - boundMethod.__reactBoundContext = component; - boundMethod.__reactBoundMethod = method; - boundMethod.__reactBoundArguments = null; - var componentName = component.constructor.displayName; - var _bind = boundMethod.bind; - boundMethod.bind = function(newThis) { - for ( - var _len = arguments.length, - args = Array(_len > 1 ? _len - 1 : 0), - _key = 1; - _key < _len; - _key++ - ) { - args[_key - 1] = arguments[_key]; - } - - // User is trying to bind() an autobound method; we effectively will - // ignore the value of "this" that the user is trying to use, so - // let's warn. - if (newThis !== component && newThis !== null) { - if (process.env.NODE_ENV !== 'production') { - warning( - false, - 'bind(): React component methods may only be bound to the ' + - 'component instance. See %s', - componentName - ); - } - } else if (!args.length) { - if (process.env.NODE_ENV !== 'production') { - warning( - false, - 'bind(): You are binding a component method to the component. ' + - 'React does this for you automatically in a high-performance ' + - 'way, so you can safely remove this call. See %s', - componentName - ); - } - return boundMethod; - } - var reboundMethod = _bind.apply(boundMethod, arguments); - reboundMethod.__reactBoundContext = component; - reboundMethod.__reactBoundMethod = method; - reboundMethod.__reactBoundArguments = args; - return reboundMethod; - }; - } - return boundMethod; - } - - /** - * Binds all auto-bound methods in a component. - * - * @param {object} component Component whose method is going to be bound. - */ - function bindAutoBindMethods(component) { - var pairs = component.__reactAutoBindPairs; - for (var i = 0; i < pairs.length; i += 2) { - var autoBindKey = pairs[i]; - var method = pairs[i + 1]; - component[autoBindKey] = bindAutoBindMethod(component, method); - } - } - - var IsMountedPreMixin = { - componentDidMount: function() { - this.__isMounted = true; - } - }; - - var IsMountedPostMixin = { - componentWillUnmount: function() { - this.__isMounted = false; - } - }; - - /** - * Add more to the ReactClass base class. These are all legacy features and - * therefore not already part of the modern ReactComponent. - */ - var ReactClassMixin = { - /** - * TODO: This will be deprecated because state should always keep a consistent - * type signature and the only use case for this, is to avoid that. - */ - replaceState: function(newState, callback) { - this.updater.enqueueReplaceState(this, newState, callback); - }, - - /** - * Checks whether or not this composite component is mounted. - * @return {boolean} True if mounted, false otherwise. - * @protected - * @final - */ - isMounted: function() { - if (process.env.NODE_ENV !== 'production') { - warning( - this.__didWarnIsMounted, - '%s: isMounted is deprecated. Instead, make sure to clean up ' + - 'subscriptions and pending requests in componentWillUnmount to ' + - 'prevent memory leaks.', - (this.constructor && this.constructor.displayName) || - this.name || - 'Component' - ); - this.__didWarnIsMounted = true; - } - return !!this.__isMounted; - } - }; - - var ReactClassComponent = function() {}; - _assign( - ReactClassComponent.prototype, - ReactComponent.prototype, - ReactClassMixin - ); - - /** - * Creates a composite component class given a class specification. - * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass - * - * @param {object} spec Class specification (which must define `render`). - * @return {function} Component constructor function. - * @public - */ - function createClass(spec) { - // To keep our warnings more understandable, we'll use a little hack here to - // ensure that Constructor.name !== 'Constructor'. This makes sure we don't - // unnecessarily identify a class without displayName as 'Constructor'. - var Constructor = identity(function(props, context, updater) { - // This constructor gets overridden by mocks. The argument is used - // by mocks to assert on what gets mounted. - - if (process.env.NODE_ENV !== 'production') { - warning( - this instanceof Constructor, - 'Something is calling a React component directly. Use a factory or ' + - 'JSX instead. See: https://fb.me/react-legacyfactory' - ); - } - - // Wire up auto-binding - if (this.__reactAutoBindPairs.length) { - bindAutoBindMethods(this); - } - - this.props = props; - this.context = context; - this.refs = emptyObject; - this.updater = updater || ReactNoopUpdateQueue; - - this.state = null; - - // ReactClasses doesn't have constructors. Instead, they use the - // getInitialState and componentWillMount methods for initialization. - - var initialState = this.getInitialState ? this.getInitialState() : null; - if (process.env.NODE_ENV !== 'production') { - // We allow auto-mocks to proceed as if they're returning null. - if ( - initialState === undefined && - this.getInitialState._isMockFunction - ) { - // This is probably bad practice. Consider warning here and - // deprecating this convenience. - initialState = null; - } - } - _invariant( - typeof initialState === 'object' && !Array.isArray(initialState), - '%s.getInitialState(): must return an object or null', - Constructor.displayName || 'ReactCompositeComponent' - ); - - this.state = initialState; - }); - Constructor.prototype = new ReactClassComponent(); - Constructor.prototype.constructor = Constructor; - Constructor.prototype.__reactAutoBindPairs = []; - - injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor)); - - mixSpecIntoComponent(Constructor, IsMountedPreMixin); - mixSpecIntoComponent(Constructor, spec); - mixSpecIntoComponent(Constructor, IsMountedPostMixin); - - // Initialize the defaultProps property after all mixins have been merged. - if (Constructor.getDefaultProps) { - Constructor.defaultProps = Constructor.getDefaultProps(); - } - - if (process.env.NODE_ENV !== 'production') { - // This is a tag to indicate that the use of these method names is ok, - // since it's used with createClass. If it's not, then it's likely a - // mistake so we'll warn you to use the static property, property - // initializer or constructor respectively. - if (Constructor.getDefaultProps) { - Constructor.getDefaultProps.isReactClassApproved = {}; - } - if (Constructor.prototype.getInitialState) { - Constructor.prototype.getInitialState.isReactClassApproved = {}; - } - } - - _invariant( - Constructor.prototype.render, - 'createClass(...): Class specification must implement a `render` method.' - ); - - if (process.env.NODE_ENV !== 'production') { - warning( - !Constructor.prototype.componentShouldUpdate, - '%s has a method called ' + - 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + - 'The name is phrased as a question because the function is ' + - 'expected to return a value.', - spec.displayName || 'A component' - ); - warning( - !Constructor.prototype.componentWillRecieveProps, - '%s has a method called ' + - 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', - spec.displayName || 'A component' - ); - } - - // Reduce time spent doing lookups by setting these on the prototype. - for (var methodName in ReactClassInterface) { - if (!Constructor.prototype[methodName]) { - Constructor.prototype[methodName] = null; - } - } - - return Constructor; - } - - return createClass; -} - -module.exports = factory; - -}).call(this,require('_process')) -},{"_process":187,"fbjs/lib/emptyObject":5,"fbjs/lib/invariant":6,"fbjs/lib/warning":7,"object-assign":173}],3:[function(require,module,exports){ -/** - * inspired by is-number - * but significantly simplified and sped up by ignoring number and string constructors - * ie these return false: - * new Number(1) - * new String('1') - */ - -'use strict'; - -/** - * Is this string all whitespace? - * This solution kind of makes my brain hurt, but it's significantly faster - * than !str.trim() or any other solution I could find. - * - * whitespace codes from: http://en.wikipedia.org/wiki/Whitespace_character - * and verified with: - * - * for(var i = 0; i < 65536; i++) { - * var s = String.fromCharCode(i); - * if(+s===0 && !s.trim()) console.log(i, s); - * } - * - * which counts a couple of these as *not* whitespace, but finds nothing else - * that *is* whitespace. Note that charCodeAt stops at 16 bits, but it appears - * that there are no whitespace characters above this, and code points above - * this do not map onto white space characters. - */ -function allBlankCharCodes(str){ - var l = str.length, - a; - for(var i = 0; i < l; i++) { - a = str.charCodeAt(i); - if((a < 9 || a > 13) && (a !== 32) && (a !== 133) && (a !== 160) && - (a !== 5760) && (a !== 6158) && (a < 8192 || a > 8205) && - (a !== 8232) && (a !== 8233) && (a !== 8239) && (a !== 8287) && - (a !== 8288) && (a !== 12288) && (a !== 65279)) { - return false; - } - } - return true; -} - -module.exports = function(n) { - var type = typeof n; - if(type === 'string') { - var original = n; - n = +n; - // whitespace strings cast to zero - filter them out - if(n===0 && allBlankCharCodes(original)) return false; - } - else if(type !== 'number') return false; - - return n - n < 1; -}; - -},{}],4:[function(require,module,exports){ -"use strict"; - -/** - * Copyright (c) 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. - * - * - */ - -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; -},{}],5:[function(require,module,exports){ -(function (process){ -/** - * Copyright (c) 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. - * - */ - -'use strict'; - -var emptyObject = {}; - -if (process.env.NODE_ENV !== 'production') { - Object.freeze(emptyObject); -} - -module.exports = emptyObject; -}).call(this,require('_process')) -},{"_process":187}],6:[function(require,module,exports){ -(function (process){ -/** - * Copyright (c) 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. - * - */ - -'use strict'; - -/** - * 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 (process.env.NODE_ENV !== 'production') { - 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; -}).call(this,require('_process')) -},{"_process":187}],7:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2014-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 strict'; - -var emptyFunction = require('./emptyFunction'); - -/** - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - -var warning = emptyFunction; - -if (process.env.NODE_ENV !== 'production') { - var printWarning = function printWarning(format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.error(message); - } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) {} - }; - - warning = function warning(condition, format) { - if (format === undefined) { - throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); - } - - if (format.indexOf('Failed Composite propType: ') === 0) { - return; // Ignore CompositeComponent proptype check. - } - - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } - - printWarning.apply(undefined, [format].concat(args)); - } - }; -} - -module.exports = warning; -}).call(this,require('_process')) -},{"./emptyFunction":4,"_process":187}],8:[function(require,module,exports){ -var getNative = require('./_getNative'), - root = require('./_root'); - -/* Built-in method references that are verified to be native. */ -var DataView = getNative(root, 'DataView'); - -module.exports = DataView; - -},{"./_getNative":87,"./_root":128}],9:[function(require,module,exports){ -var hashClear = require('./_hashClear'), - hashDelete = require('./_hashDelete'), - hashGet = require('./_hashGet'), - hashHas = require('./_hashHas'), - hashSet = require('./_hashSet'); - -/** - * 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; - -},{"./_hashClear":95,"./_hashDelete":96,"./_hashGet":97,"./_hashHas":98,"./_hashSet":99}],10:[function(require,module,exports){ -var listCacheClear = require('./_listCacheClear'), - listCacheDelete = require('./_listCacheDelete'), - listCacheGet = require('./_listCacheGet'), - listCacheHas = require('./_listCacheHas'), - listCacheSet = require('./_listCacheSet'); - -/** - * 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; - -},{"./_listCacheClear":109,"./_listCacheDelete":110,"./_listCacheGet":111,"./_listCacheHas":112,"./_listCacheSet":113}],11:[function(require,module,exports){ -var getNative = require('./_getNative'), - root = require('./_root'); - -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'); - -module.exports = Map; - -},{"./_getNative":87,"./_root":128}],12:[function(require,module,exports){ -var mapCacheClear = require('./_mapCacheClear'), - mapCacheDelete = require('./_mapCacheDelete'), - mapCacheGet = require('./_mapCacheGet'), - mapCacheHas = require('./_mapCacheHas'), - mapCacheSet = require('./_mapCacheSet'); - -/** - * 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; - -},{"./_mapCacheClear":114,"./_mapCacheDelete":115,"./_mapCacheGet":116,"./_mapCacheHas":117,"./_mapCacheSet":118}],13:[function(require,module,exports){ -var getNative = require('./_getNative'), - root = require('./_root'); - -/* Built-in method references that are verified to be native. */ -var Promise = getNative(root, 'Promise'); - -module.exports = Promise; - -},{"./_getNative":87,"./_root":128}],14:[function(require,module,exports){ -var getNative = require('./_getNative'), - root = require('./_root'); - -/* Built-in method references that are verified to be native. */ -var Set = getNative(root, 'Set'); - -module.exports = Set; - -},{"./_getNative":87,"./_root":128}],15:[function(require,module,exports){ -var MapCache = require('./_MapCache'), - setCacheAdd = require('./_setCacheAdd'), - setCacheHas = require('./_setCacheHas'); - -/** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ -function SetCache(values) { - var index = -1, - length = values == null ? 0 : values.length; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } -} - -// Add methods to `SetCache`. -SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; -SetCache.prototype.has = setCacheHas; - -module.exports = SetCache; - -},{"./_MapCache":12,"./_setCacheAdd":129,"./_setCacheHas":130}],16:[function(require,module,exports){ -var ListCache = require('./_ListCache'), - stackClear = require('./_stackClear'), - stackDelete = require('./_stackDelete'), - stackGet = require('./_stackGet'), - stackHas = require('./_stackHas'), - stackSet = require('./_stackSet'); - -/** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Stack(entries) { - var data = this.__data__ = new ListCache(entries); - this.size = data.size; -} - -// Add methods to `Stack`. -Stack.prototype.clear = stackClear; -Stack.prototype['delete'] = stackDelete; -Stack.prototype.get = stackGet; -Stack.prototype.has = stackHas; -Stack.prototype.set = stackSet; - -module.exports = Stack; - -},{"./_ListCache":10,"./_stackClear":132,"./_stackDelete":133,"./_stackGet":134,"./_stackHas":135,"./_stackSet":136}],17:[function(require,module,exports){ -var root = require('./_root'); - -/** Built-in value references. */ -var Symbol = root.Symbol; - -module.exports = Symbol; - -},{"./_root":128}],18:[function(require,module,exports){ -var root = require('./_root'); - -/** Built-in value references. */ -var Uint8Array = root.Uint8Array; - -module.exports = Uint8Array; - -},{"./_root":128}],19:[function(require,module,exports){ -var getNative = require('./_getNative'), - root = require('./_root'); - -/* Built-in method references that are verified to be native. */ -var WeakMap = getNative(root, 'WeakMap'); - -module.exports = WeakMap; - -},{"./_getNative":87,"./_root":128}],20:[function(require,module,exports){ -/** - * Adds the key-value `pair` to `map`. - * - * @private - * @param {Object} map The map to modify. - * @param {Array} pair The key-value pair to add. - * @returns {Object} Returns `map`. - */ -function addMapEntry(map, pair) { - // Don't return `map.set` because it's not chainable in IE 11. - map.set(pair[0], pair[1]); - return map; -} - -module.exports = addMapEntry; - -},{}],21:[function(require,module,exports){ -/** - * Adds `value` to `set`. - * - * @private - * @param {Object} set The set to modify. - * @param {*} value The value to add. - * @returns {Object} Returns `set`. - */ -function addSetEntry(set, value) { - // Don't return `set.add` because it's not chainable in IE 11. - set.add(value); - return set; -} - -module.exports = addSetEntry; - -},{}],22:[function(require,module,exports){ -/** - * A specialized version of `_.forEach` 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 `array`. - */ -function arrayEach(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; -} - -module.exports = arrayEach; - -},{}],23:[function(require,module,exports){ -/** - * A specialized version of `_.filter` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ -function arrayFilter(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; - } - } - return result; -} - -module.exports = arrayFilter; - -},{}],24:[function(require,module,exports){ -var baseTimes = require('./_baseTimes'), - isArguments = require('./isArguments'), - isArray = require('./isArray'), - isBuffer = require('./isBuffer'), - isIndex = require('./_isIndex'), - isTypedArray = require('./isTypedArray'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ -function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; - - for (var key in value) { - if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); - } - } - return result; -} - -module.exports = arrayLikeKeys; - -},{"./_baseTimes":57,"./_isIndex":103,"./isArguments":149,"./isArray":150,"./isBuffer":152,"./isTypedArray":160}],25:[function(require,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; - -},{}],26:[function(require,module,exports){ -/** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ -function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; -} - -module.exports = arrayPush; - -},{}],27:[function(require,module,exports){ -/** - * 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 == null ? 0 : array.length; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; -} - -module.exports = arrayReduce; - -},{}],28:[function(require,module,exports){ -/** - * A specialized version of `_.some` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ -function arraySome(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; -} - -module.exports = arraySome; - -},{}],29:[function(require,module,exports){ -var baseAssignValue = require('./_baseAssignValue'), - eq = require('./eq'); - -/** 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; - -},{"./_baseAssignValue":33,"./eq":143}],30:[function(require,module,exports){ -var eq = require('./eq'); - -/** - * 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; - -},{"./eq":143}],31:[function(require,module,exports){ -var copyObject = require('./_copyObject'), - keys = require('./keys'); - -/** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ -function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); -} - -module.exports = baseAssign; - -},{"./_copyObject":72,"./keys":161}],32:[function(require,module,exports){ -var copyObject = require('./_copyObject'), - keysIn = require('./keysIn'); - -/** - * The base implementation of `_.assignIn` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ -function baseAssignIn(object, source) { - return object && copyObject(source, keysIn(source), object); -} - -module.exports = baseAssignIn; - -},{"./_copyObject":72,"./keysIn":162}],33:[function(require,module,exports){ -var defineProperty = require('./_defineProperty'); - -/** - * 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; - -},{"./_defineProperty":78}],34:[function(require,module,exports){ -var Stack = require('./_Stack'), - arrayEach = require('./_arrayEach'), - assignValue = require('./_assignValue'), - baseAssign = require('./_baseAssign'), - baseAssignIn = require('./_baseAssignIn'), - cloneBuffer = require('./_cloneBuffer'), - copyArray = require('./_copyArray'), - copySymbols = require('./_copySymbols'), - copySymbolsIn = require('./_copySymbolsIn'), - getAllKeys = require('./_getAllKeys'), - getAllKeysIn = require('./_getAllKeysIn'), - getTag = require('./_getTag'), - initCloneArray = require('./_initCloneArray'), - initCloneByTag = require('./_initCloneByTag'), - initCloneObject = require('./_initCloneObject'), - isArray = require('./isArray'), - isBuffer = require('./isBuffer'), - isObject = require('./isObject'), - keys = require('./keys'); - -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1, - CLONE_FLAT_FLAG = 2, - CLONE_SYMBOLS_FLAG = 4; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -/** Used to identify `toStringTag` values supported by `_.clone`. */ -var cloneableTags = {}; -cloneableTags[argsTag] = cloneableTags[arrayTag] = -cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = -cloneableTags[boolTag] = cloneableTags[dateTag] = -cloneableTags[float32Tag] = cloneableTags[float64Tag] = -cloneableTags[int8Tag] = cloneableTags[int16Tag] = -cloneableTags[int32Tag] = cloneableTags[mapTag] = -cloneableTags[numberTag] = cloneableTags[objectTag] = -cloneableTags[regexpTag] = cloneableTags[setTag] = -cloneableTags[stringTag] = cloneableTags[symbolTag] = -cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = -cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; -cloneableTags[errorTag] = cloneableTags[funcTag] = -cloneableTags[weakMapTag] = false; - -/** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} bitmask The bitmask flags. - * 1 - Deep clone - * 2 - Flatten inherited properties - * 4 - Clone symbols - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ -function baseClone(value, bitmask, customizer, key, object, stack) { - var result, - isDeep = bitmask & CLONE_DEEP_FLAG, - isFlat = bitmask & CLONE_FLAT_FLAG, - isFull = bitmask & CLONE_SYMBOLS_FLAG; - - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = (isFlat || isFunc) ? {} : initCloneObject(value); - if (!isDeep) { - return isFlat - ? copySymbolsIn(value, baseAssignIn(result, value)) - : copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, baseClone, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); - - var keysFunc = isFull - ? (isFlat ? getAllKeysIn : getAllKeys) - : (isFlat ? keysIn : keys); - - var props = isArr ? undefined : keysFunc(value); - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - return result; -} - -module.exports = baseClone; - -},{"./_Stack":16,"./_arrayEach":22,"./_assignValue":29,"./_baseAssign":31,"./_baseAssignIn":32,"./_cloneBuffer":64,"./_copyArray":71,"./_copySymbols":73,"./_copySymbolsIn":74,"./_getAllKeys":83,"./_getAllKeysIn":84,"./_getTag":92,"./_initCloneArray":100,"./_initCloneByTag":101,"./_initCloneObject":102,"./isArray":150,"./isBuffer":152,"./isObject":155,"./keys":161}],35:[function(require,module,exports){ -var isObject = require('./isObject'); - -/** Built-in value references. */ -var objectCreate = Object.create; - -/** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} proto The object to inherit from. - * @returns {Object} Returns the new object. - */ -var baseCreate = (function() { - function object() {} - return function(proto) { - if (!isObject(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object.prototype = proto; - var result = new object; - object.prototype = undefined; - return result; - }; -}()); - -module.exports = baseCreate; - -},{"./isObject":155}],36:[function(require,module,exports){ -var baseForOwn = require('./_baseForOwn'), - createBaseEach = require('./_createBaseEach'); - -/** - * The base implementation of `_.forEach` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - */ -var baseEach = createBaseEach(baseForOwn); - -module.exports = baseEach; - -},{"./_baseForOwn":38,"./_createBaseEach":76}],37:[function(require,module,exports){ -var createBaseFor = require('./_createBaseFor'); - -/** - * The base implementation of `baseForOwn` which iterates over `object` - * properties returned by `keysFunc` and invokes `iteratee` for each property. - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ -var baseFor = createBaseFor(); - -module.exports = baseFor; - -},{"./_createBaseFor":77}],38:[function(require,module,exports){ -var baseFor = require('./_baseFor'), - keys = require('./keys'); - -/** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ -function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); -} - -module.exports = baseForOwn; - -},{"./_baseFor":37,"./keys":161}],39:[function(require,module,exports){ -var castPath = require('./_castPath'), - toKey = require('./_toKey'); - -/** - * 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; - -},{"./_castPath":62,"./_toKey":138}],40:[function(require,module,exports){ -var arrayPush = require('./_arrayPush'), - isArray = require('./isArray'); - -/** - * The base implementation of `getAllKeys` and `getAllKeysIn` which uses - * `keysFunc` and `symbolsFunc` to get the enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Function} keysFunc The function to get the keys of `object`. - * @param {Function} symbolsFunc The function to get the symbols of `object`. - * @returns {Array} Returns the array of property names and symbols. - */ -function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result = keysFunc(object); - return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); -} - -module.exports = baseGetAllKeys; - -},{"./_arrayPush":26,"./isArray":150}],41:[function(require,module,exports){ -var Symbol = require('./_Symbol'), - getRawTag = require('./_getRawTag'), - objectToString = require('./_objectToString'); - -/** `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; - -},{"./_Symbol":17,"./_getRawTag":89,"./_objectToString":126}],42:[function(require,module,exports){ -/** - * The base implementation of `_.hasIn` 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 baseHasIn(object, key) { - return object != null && key in Object(object); -} - -module.exports = baseHasIn; - -},{}],43:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - isObjectLike = require('./isObjectLike'); - -/** `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; - -},{"./_baseGetTag":41,"./isObjectLike":156}],44:[function(require,module,exports){ -var baseIsEqualDeep = require('./_baseIsEqualDeep'), - isObjectLike = require('./isObjectLike'); - -/** - * The base implementation of `_.isEqual` which supports partial comparisons - * and tracks traversed objects. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {boolean} bitmask The bitmask flags. - * 1 - Unordered comparison - * 2 - Partial comparison - * @param {Function} [customizer] The function to customize comparisons. - * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ -function baseIsEqual(value, other, bitmask, customizer, stack) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); -} - -module.exports = baseIsEqual; - -},{"./_baseIsEqualDeep":45,"./isObjectLike":156}],45:[function(require,module,exports){ -var Stack = require('./_Stack'), - equalArrays = require('./_equalArrays'), - equalByTag = require('./_equalByTag'), - equalObjects = require('./_equalObjects'), - getTag = require('./_getTag'), - isArray = require('./isArray'), - isBuffer = require('./isBuffer'), - isTypedArray = require('./isTypedArray'); - -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - objectTag = '[object Object]'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ -function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = objIsArr ? arrayTag : getTag(object), - othTag = othIsArr ? arrayTag : getTag(other); - - objTag = objTag == argsTag ? objectTag : objTag; - othTag = othTag == argsTag ? objectTag : othTag; - - var objIsObj = objTag == objectTag, - othIsObj = othTag == objectTag, - isSameTag = objTag == othTag; - - if (isSameTag && isBuffer(object)) { - if (!isBuffer(other)) { - return false; - } - objIsArr = true; - objIsObj = false; - } - if (isSameTag && !objIsObj) { - stack || (stack = new Stack); - return (objIsArr || isTypedArray(object)) - ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) - : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); - } - if (!(bitmask & COMPARE_PARTIAL_FLAG)) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - - if (objIsWrapped || othIsWrapped) { - var objUnwrapped = objIsWrapped ? object.value() : object, - othUnwrapped = othIsWrapped ? other.value() : other; - - stack || (stack = new Stack); - return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); - } - } - if (!isSameTag) { - return false; - } - stack || (stack = new Stack); - return equalObjects(object, other, bitmask, customizer, equalFunc, stack); -} - -module.exports = baseIsEqualDeep; - -},{"./_Stack":16,"./_equalArrays":79,"./_equalByTag":80,"./_equalObjects":81,"./_getTag":92,"./isArray":150,"./isBuffer":152,"./isTypedArray":160}],46:[function(require,module,exports){ -var Stack = require('./_Stack'), - baseIsEqual = require('./_baseIsEqual'); - -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; - -/** - * The base implementation of `_.isMatch` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Array} matchData The property names, values, and compare flags to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ -function baseIsMatch(object, source, matchData, customizer) { - var index = matchData.length, - length = index, - noCustomizer = !customizer; - - if (object == null) { - return !length; - } - object = Object(object); - while (index--) { - var data = matchData[index]; - if ((noCustomizer && data[2]) - ? data[1] !== object[data[0]] - : !(data[0] in object) - ) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], - objValue = object[key], - srcValue = data[1]; - - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object)) { - return false; - } - } else { - var stack = new Stack; - if (customizer) { - var result = customizer(objValue, srcValue, key, object, source, stack); - } - if (!(result === undefined - ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) - : result - )) { - return false; - } - } - } - return true; -} - -module.exports = baseIsMatch; - -},{"./_Stack":16,"./_baseIsEqual":44}],47:[function(require,module,exports){ -var isFunction = require('./isFunction'), - isMasked = require('./_isMasked'), - isObject = require('./isObject'), - toSource = require('./_toSource'); - -/** - * 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; - -},{"./_isMasked":106,"./_toSource":139,"./isFunction":153,"./isObject":155}],48:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - isLength = require('./isLength'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -/** Used to identify `toStringTag` values of typed arrays. */ -var typedArrayTags = {}; -typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = -typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = -typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = -typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = -typedArrayTags[uint32Tag] = true; -typedArrayTags[argsTag] = typedArrayTags[arrayTag] = -typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = -typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = -typedArrayTags[errorTag] = typedArrayTags[funcTag] = -typedArrayTags[mapTag] = typedArrayTags[numberTag] = -typedArrayTags[objectTag] = typedArrayTags[regexpTag] = -typedArrayTags[setTag] = typedArrayTags[stringTag] = -typedArrayTags[weakMapTag] = false; - -/** - * The base implementation of `_.isTypedArray` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ -function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; -} - -module.exports = baseIsTypedArray; - -},{"./_baseGetTag":41,"./isLength":154,"./isObjectLike":156}],49:[function(require,module,exports){ -var baseMatches = require('./_baseMatches'), - baseMatchesProperty = require('./_baseMatchesProperty'), - identity = require('./identity'), - isArray = require('./isArray'), - property = require('./property'); - -/** - * The base implementation of `_.iteratee`. - * - * @private - * @param {*} [value=_.identity] The value to convert to an iteratee. - * @returns {Function} Returns the iteratee. - */ -function baseIteratee(value) { - // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. - // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. - if (typeof value == 'function') { - return value; - } - if (value == null) { - return identity; - } - if (typeof value == 'object') { - return isArray(value) - ? baseMatchesProperty(value[0], value[1]) - : baseMatches(value); - } - return property(value); -} - -module.exports = baseIteratee; - -},{"./_baseMatches":53,"./_baseMatchesProperty":54,"./identity":148,"./isArray":150,"./property":166}],50:[function(require,module,exports){ -var isPrototype = require('./_isPrototype'), - nativeKeys = require('./_nativeKeys'); - -/** 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 `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; -} - -module.exports = baseKeys; - -},{"./_isPrototype":107,"./_nativeKeys":123}],51:[function(require,module,exports){ -var isObject = require('./isObject'), - isPrototype = require('./_isPrototype'), - nativeKeysIn = require('./_nativeKeysIn'); - -/** 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 `_.keysIn` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeysIn(object) { - if (!isObject(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), - result = []; - - for (var key in object) { - if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; -} - -module.exports = baseKeysIn; - -},{"./_isPrototype":107,"./_nativeKeysIn":124,"./isObject":155}],52:[function(require,module,exports){ -var baseEach = require('./_baseEach'), - isArrayLike = require('./isArrayLike'); - -/** - * The base implementation of `_.map` without support for iteratee shorthands. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ -function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value, key, collection) { - result[++index] = iteratee(value, key, collection); - }); - return result; -} - -module.exports = baseMap; - -},{"./_baseEach":36,"./isArrayLike":151}],53:[function(require,module,exports){ -var baseIsMatch = require('./_baseIsMatch'), - getMatchData = require('./_getMatchData'), - matchesStrictComparable = require('./_matchesStrictComparable'); - -/** - * The base implementation of `_.matches` which doesn't clone `source`. - * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new spec function. - */ -function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - return matchesStrictComparable(matchData[0][0], matchData[0][1]); - } - return function(object) { - return object === source || baseIsMatch(object, source, matchData); - }; -} - -module.exports = baseMatches; - -},{"./_baseIsMatch":46,"./_getMatchData":86,"./_matchesStrictComparable":120}],54:[function(require,module,exports){ -var baseIsEqual = require('./_baseIsEqual'), - get = require('./get'), - hasIn = require('./hasIn'), - isKey = require('./_isKey'), - isStrictComparable = require('./_isStrictComparable'), - matchesStrictComparable = require('./_matchesStrictComparable'), - toKey = require('./_toKey'); - -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; - -/** - * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. - * - * @private - * @param {string} path The path of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ -function baseMatchesProperty(path, srcValue) { - if (isKey(path) && isStrictComparable(srcValue)) { - return matchesStrictComparable(toKey(path), srcValue); - } - return function(object) { - var objValue = get(object, path); - return (objValue === undefined && objValue === srcValue) - ? hasIn(object, path) - : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); - }; -} - -module.exports = baseMatchesProperty; - -},{"./_baseIsEqual":44,"./_isKey":104,"./_isStrictComparable":108,"./_matchesStrictComparable":120,"./_toKey":138,"./get":146,"./hasIn":147}],55:[function(require,module,exports){ -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - -module.exports = baseProperty; - -},{}],56:[function(require,module,exports){ -var baseGet = require('./_baseGet'); - -/** - * A specialized version of `baseProperty` which supports deep paths. - * - * @private - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new accessor function. - */ -function basePropertyDeep(path) { - return function(object) { - return baseGet(object, path); - }; -} - -module.exports = basePropertyDeep; - -},{"./_baseGet":39}],57:[function(require,module,exports){ -/** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ -function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; -} - -module.exports = baseTimes; - -},{}],58:[function(require,module,exports){ -var Symbol = require('./_Symbol'), - arrayMap = require('./_arrayMap'), - isArray = require('./isArray'), - isSymbol = require('./isSymbol'); - -/** 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; - -},{"./_Symbol":17,"./_arrayMap":25,"./isArray":150,"./isSymbol":159}],59:[function(require,module,exports){ -/** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ -function baseUnary(func) { - return function(value) { - return func(value); - }; -} - -module.exports = baseUnary; - -},{}],60:[function(require,module,exports){ -/** - * Checks if a `cache` value for `key` exists. - * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function cacheHas(cache, key) { - return cache.has(key); -} - -module.exports = cacheHas; - -},{}],61:[function(require,module,exports){ -var identity = require('./identity'); - -/** - * Casts `value` to `identity` if it's not a function. - * - * @private - * @param {*} value The value to inspect. - * @returns {Function} Returns cast function. - */ -function castFunction(value) { - return typeof value == 'function' ? value : identity; -} - -module.exports = castFunction; - -},{"./identity":148}],62:[function(require,module,exports){ -var isArray = require('./isArray'), - isKey = require('./_isKey'), - stringToPath = require('./_stringToPath'), - toString = require('./toString'); - -/** - * 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; - -},{"./_isKey":104,"./_stringToPath":137,"./isArray":150,"./toString":171}],63:[function(require,module,exports){ -var Uint8Array = require('./_Uint8Array'); - -/** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ -function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; -} - -module.exports = cloneArrayBuffer; - -},{"./_Uint8Array":18}],64:[function(require,module,exports){ -var root = require('./_root'); - -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; - -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined, - allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; - -/** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ -function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var length = buffer.length, - result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); - - buffer.copy(result); - return result; -} - -module.exports = cloneBuffer; - -},{"./_root":128}],65:[function(require,module,exports){ -var cloneArrayBuffer = require('./_cloneArrayBuffer'); - -/** - * Creates a clone of `dataView`. - * - * @private - * @param {Object} dataView The data view to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned data view. - */ -function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); -} - -module.exports = cloneDataView; - -},{"./_cloneArrayBuffer":63}],66:[function(require,module,exports){ -var addMapEntry = require('./_addMapEntry'), - arrayReduce = require('./_arrayReduce'), - mapToArray = require('./_mapToArray'); - -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1; - -/** - * Creates a clone of `map`. - * - * @private - * @param {Object} map The map to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned map. - */ -function cloneMap(map, isDeep, cloneFunc) { - var array = isDeep ? cloneFunc(mapToArray(map), CLONE_DEEP_FLAG) : mapToArray(map); - return arrayReduce(array, addMapEntry, new map.constructor); -} - -module.exports = cloneMap; - -},{"./_addMapEntry":20,"./_arrayReduce":27,"./_mapToArray":119}],67:[function(require,module,exports){ -/** Used to match `RegExp` flags from their coerced string values. */ -var reFlags = /\w*$/; - -/** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ -function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; -} - -module.exports = cloneRegExp; - -},{}],68:[function(require,module,exports){ -var addSetEntry = require('./_addSetEntry'), - arrayReduce = require('./_arrayReduce'), - setToArray = require('./_setToArray'); - -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1; - -/** - * Creates a clone of `set`. - * - * @private - * @param {Object} set The set to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned set. - */ -function cloneSet(set, isDeep, cloneFunc) { - var array = isDeep ? cloneFunc(setToArray(set), CLONE_DEEP_FLAG) : setToArray(set); - return arrayReduce(array, addSetEntry, new set.constructor); -} - -module.exports = cloneSet; - -},{"./_addSetEntry":21,"./_arrayReduce":27,"./_setToArray":131}],69:[function(require,module,exports){ -var Symbol = require('./_Symbol'); - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; - -/** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ -function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; -} - -module.exports = cloneSymbol; - -},{"./_Symbol":17}],70:[function(require,module,exports){ -var cloneArrayBuffer = require('./_cloneArrayBuffer'); - -/** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ -function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); -} - -module.exports = cloneTypedArray; - -},{"./_cloneArrayBuffer":63}],71:[function(require,module,exports){ -/** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ -function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; -} - -module.exports = copyArray; - -},{}],72:[function(require,module,exports){ -var assignValue = require('./_assignValue'), - baseAssignValue = require('./_baseAssignValue'); - -/** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property identifiers to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ -function copyObject(source, props, object, customizer) { - var isNew = !object; - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; - - if (newValue === undefined) { - newValue = source[key]; - } - if (isNew) { - baseAssignValue(object, key, newValue); - } else { - assignValue(object, key, newValue); - } - } - return object; -} - -module.exports = copyObject; - -},{"./_assignValue":29,"./_baseAssignValue":33}],73:[function(require,module,exports){ -var copyObject = require('./_copyObject'), - getSymbols = require('./_getSymbols'); - -/** - * Copies own symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ -function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); -} - -module.exports = copySymbols; - -},{"./_copyObject":72,"./_getSymbols":90}],74:[function(require,module,exports){ -var copyObject = require('./_copyObject'), - getSymbolsIn = require('./_getSymbolsIn'); - -/** - * Copies own and inherited symbols of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ -function copySymbolsIn(source, object) { - return copyObject(source, getSymbolsIn(source), object); -} - -module.exports = copySymbolsIn; - -},{"./_copyObject":72,"./_getSymbolsIn":91}],75:[function(require,module,exports){ -var root = require('./_root'); - -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; - -module.exports = coreJsData; - -},{"./_root":128}],76:[function(require,module,exports){ -var isArrayLike = require('./isArrayLike'); - -/** - * Creates a `baseEach` or `baseEachRight` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ -function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee); - } - var length = collection.length, - index = fromRight ? length : -1, - iterable = Object(collection); - - while ((fromRight ? index-- : ++index < length)) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; -} - -module.exports = createBaseEach; - -},{"./isArrayLike":151}],77:[function(require,module,exports){ -/** - * Creates a base function for methods like `_.forIn` and `_.forOwn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ -function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; -} - -module.exports = createBaseFor; - -},{}],78:[function(require,module,exports){ -var getNative = require('./_getNative'); - -var defineProperty = (function() { - try { - var func = getNative(Object, 'defineProperty'); - func({}, '', {}); - return func; - } catch (e) {} -}()); - -module.exports = defineProperty; - -},{"./_getNative":87}],79:[function(require,module,exports){ -var SetCache = require('./_SetCache'), - arraySome = require('./_arraySome'), - cacheHas = require('./_cacheHas'); - -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; - -/** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. - * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ -function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - arrLength = array.length, - othLength = other.length; - - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(array); - if (stacked && stack.get(other)) { - return stacked == other; - } - var index = -1, - result = true, - seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; - - stack.set(array, other); - stack.set(other, array); - - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, arrValue, index, other, array, stack) - : customizer(arrValue, othValue, index, array, other, stack); - } - if (compared !== undefined) { - if (compared) { - continue; - } - result = false; - break; - } - // Recursively compare arrays (susceptible to call stack limits). - if (seen) { - if (!arraySome(other, function(othValue, othIndex) { - if (!cacheHas(seen, othIndex) && - (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { - return seen.push(othIndex); - } - })) { - result = false; - break; - } - } else if (!( - arrValue === othValue || - equalFunc(arrValue, othValue, bitmask, customizer, stack) - )) { - result = false; - break; - } - } - stack['delete'](array); - stack['delete'](other); - return result; -} - -module.exports = equalArrays; - -},{"./_SetCache":15,"./_arraySome":28,"./_cacheHas":60}],80:[function(require,module,exports){ -var Symbol = require('./_Symbol'), - Uint8Array = require('./_Uint8Array'), - eq = require('./eq'), - equalArrays = require('./_equalArrays'), - mapToArray = require('./_mapToArray'), - setToArray = require('./_setToArray'); - -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; - -/** `Object#toString` result references. */ -var boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - mapTag = '[object Map]', - numberTag = '[object Number]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]'; - -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]'; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; - -/** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ -function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { - switch (tag) { - case dataViewTag: - if ((object.byteLength != other.byteLength) || - (object.byteOffset != other.byteOffset)) { - return false; - } - object = object.buffer; - other = other.buffer; - - case arrayBufferTag: - if ((object.byteLength != other.byteLength) || - !equalFunc(new Uint8Array(object), new Uint8Array(other))) { - return false; - } - return true; - - case boolTag: - case dateTag: - case numberTag: - // Coerce booleans to `1` or `0` and dates to milliseconds. - // Invalid dates are coerced to `NaN`. - return eq(+object, +other); - - case errorTag: - return object.name == other.name && object.message == other.message; - - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings, primitives and objects, - // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring - // for more details. - return object == (other + ''); - - case mapTag: - var convert = mapToArray; - - case setTag: - var isPartial = bitmask & COMPARE_PARTIAL_FLAG; - convert || (convert = setToArray); - - if (object.size != other.size && !isPartial) { - return false; - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked) { - return stacked == other; - } - bitmask |= COMPARE_UNORDERED_FLAG; - - // Recursively compare objects (susceptible to call stack limits). - stack.set(object, other); - var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); - stack['delete'](object); - return result; - - case symbolTag: - if (symbolValueOf) { - return symbolValueOf.call(object) == symbolValueOf.call(other); - } - } - return false; -} - -module.exports = equalByTag; - -},{"./_Symbol":17,"./_Uint8Array":18,"./_equalArrays":79,"./_mapToArray":119,"./_setToArray":131,"./eq":143}],81:[function(require,module,exports){ -var getAllKeys = require('./_getAllKeys'); - -/** Used to compose bitmasks for value comparisons. */ -var COMPARE_PARTIAL_FLAG = 1; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. - * @param {Function} customizer The function to customize comparisons. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Object} stack Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ -function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - objProps = getAllKeys(object), - objLength = objProps.length, - othProps = getAllKeys(other), - othLength = othProps.length; - - if (objLength != othLength && !isPartial) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { - return false; - } - } - // Assume cyclic values are equal. - var stacked = stack.get(object); - if (stacked && stack.get(other)) { - return stacked == other; - } - var result = true; - stack.set(object, other); - stack.set(other, object); - - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, objValue, key, other, object, stack) - : customizer(objValue, othValue, key, object, other, stack); - } - // Recursively compare objects (susceptible to call stack limits). - if (!(compared === undefined - ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) - : compared - )) { - result = false; - break; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (result && !skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; - - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - result = false; - } - } - stack['delete'](object); - stack['delete'](other); - return result; -} - -module.exports = equalObjects; - -},{"./_getAllKeys":83}],82:[function(require,module,exports){ -(function (global){ -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -module.exports = freeGlobal; - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],83:[function(require,module,exports){ -var baseGetAllKeys = require('./_baseGetAllKeys'), - getSymbols = require('./_getSymbols'), - keys = require('./keys'); - -/** - * Creates an array of own enumerable property names and symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ -function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); -} - -module.exports = getAllKeys; - -},{"./_baseGetAllKeys":40,"./_getSymbols":90,"./keys":161}],84:[function(require,module,exports){ -var baseGetAllKeys = require('./_baseGetAllKeys'), - getSymbolsIn = require('./_getSymbolsIn'), - keysIn = require('./keysIn'); - -/** - * Creates an array of own and inherited enumerable property names and - * symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names and symbols. - */ -function getAllKeysIn(object) { - return baseGetAllKeys(object, keysIn, getSymbolsIn); -} - -module.exports = getAllKeysIn; - -},{"./_baseGetAllKeys":40,"./_getSymbolsIn":91,"./keysIn":162}],85:[function(require,module,exports){ -var isKeyable = require('./_isKeyable'); - -/** - * 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; - -},{"./_isKeyable":105}],86:[function(require,module,exports){ -var isStrictComparable = require('./_isStrictComparable'), - keys = require('./keys'); - -/** - * Gets the property names, values, and compare flags of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the match data of `object`. - */ -function getMatchData(object) { - var result = keys(object), - length = result.length; - - while (length--) { - var key = result[length], - value = object[key]; - - result[length] = [key, value, isStrictComparable(value)]; - } - return result; -} - -module.exports = getMatchData; - -},{"./_isStrictComparable":108,"./keys":161}],87:[function(require,module,exports){ -var baseIsNative = require('./_baseIsNative'), - getValue = require('./_getValue'); - -/** - * 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; - -},{"./_baseIsNative":47,"./_getValue":93}],88:[function(require,module,exports){ -var overArg = require('./_overArg'); - -/** Built-in value references. */ -var getPrototype = overArg(Object.getPrototypeOf, Object); - -module.exports = getPrototype; - -},{"./_overArg":127}],89:[function(require,module,exports){ -var Symbol = require('./_Symbol'); - -/** 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; - -},{"./_Symbol":17}],90:[function(require,module,exports){ -var arrayFilter = require('./_arrayFilter'), - stubArray = require('./stubArray'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeGetSymbols = Object.getOwnPropertySymbols; - -/** - * Creates an array of the own enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ -var getSymbols = !nativeGetSymbols ? stubArray : function(object) { - if (object == null) { - return []; - } - object = Object(object); - return arrayFilter(nativeGetSymbols(object), function(symbol) { - return propertyIsEnumerable.call(object, symbol); - }); -}; - -module.exports = getSymbols; - -},{"./_arrayFilter":23,"./stubArray":167}],91:[function(require,module,exports){ -var arrayPush = require('./_arrayPush'), - getPrototype = require('./_getPrototype'), - getSymbols = require('./_getSymbols'), - stubArray = require('./stubArray'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeGetSymbols = Object.getOwnPropertySymbols; - -/** - * Creates an array of the own and inherited enumerable symbols of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ -var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { - var result = []; - while (object) { - arrayPush(result, getSymbols(object)); - object = getPrototype(object); - } - return result; -}; - -module.exports = getSymbolsIn; - -},{"./_arrayPush":26,"./_getPrototype":88,"./_getSymbols":90,"./stubArray":167}],92:[function(require,module,exports){ -var DataView = require('./_DataView'), - Map = require('./_Map'), - Promise = require('./_Promise'), - Set = require('./_Set'), - WeakMap = require('./_WeakMap'), - baseGetTag = require('./_baseGetTag'), - toSource = require('./_toSource'); - -/** `Object#toString` result references. */ -var mapTag = '[object Map]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - setTag = '[object Set]', - weakMapTag = '[object WeakMap]'; - -var dataViewTag = '[object DataView]'; - -/** Used to detect maps, sets, and weakmaps. */ -var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); - -/** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -var getTag = baseGetTag; - -// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. -if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = baseGetTag(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : ''; - - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; -} - -module.exports = getTag; - -},{"./_DataView":8,"./_Map":11,"./_Promise":13,"./_Set":14,"./_WeakMap":19,"./_baseGetTag":41,"./_toSource":139}],93:[function(require,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; - -},{}],94:[function(require,module,exports){ -var castPath = require('./_castPath'), - isArguments = require('./isArguments'), - isArray = require('./isArray'), - isIndex = require('./_isIndex'), - isLength = require('./isLength'), - toKey = require('./_toKey'); - -/** - * 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; - -},{"./_castPath":62,"./_isIndex":103,"./_toKey":138,"./isArguments":149,"./isArray":150,"./isLength":154}],95:[function(require,module,exports){ -var nativeCreate = require('./_nativeCreate'); - -/** - * 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; - -},{"./_nativeCreate":122}],96:[function(require,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; - -},{}],97:[function(require,module,exports){ -var nativeCreate = require('./_nativeCreate'); - -/** 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; - -},{"./_nativeCreate":122}],98:[function(require,module,exports){ -var nativeCreate = require('./_nativeCreate'); - -/** 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; - -},{"./_nativeCreate":122}],99:[function(require,module,exports){ -var nativeCreate = require('./_nativeCreate'); - -/** 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; - -},{"./_nativeCreate":122}],100:[function(require,module,exports){ -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ -function initCloneArray(array) { - var length = array.length, - result = array.constructor(length); - - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; -} - -module.exports = initCloneArray; - -},{}],101:[function(require,module,exports){ -var cloneArrayBuffer = require('./_cloneArrayBuffer'), - cloneDataView = require('./_cloneDataView'), - cloneMap = require('./_cloneMap'), - cloneRegExp = require('./_cloneRegExp'), - cloneSet = require('./_cloneSet'), - cloneSymbol = require('./_cloneSymbol'), - cloneTypedArray = require('./_cloneTypedArray'); - -/** `Object#toString` result references. */ -var boolTag = '[object Boolean]', - dateTag = '[object Date]', - mapTag = '[object Map]', - numberTag = '[object Number]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]'; - -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -/** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {Function} cloneFunc The function to clone values. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneByTag(object, tag, cloneFunc, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case dataViewTag: - return cloneDataView(object, isDeep); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return cloneMap(object, isDeep, cloneFunc); - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - return cloneRegExp(object); - - case setTag: - return cloneSet(object, isDeep, cloneFunc); - - case symbolTag: - return cloneSymbol(object); - } -} - -module.exports = initCloneByTag; - -},{"./_cloneArrayBuffer":63,"./_cloneDataView":65,"./_cloneMap":66,"./_cloneRegExp":67,"./_cloneSet":68,"./_cloneSymbol":69,"./_cloneTypedArray":70}],102:[function(require,module,exports){ -var baseCreate = require('./_baseCreate'), - getPrototype = require('./_getPrototype'), - isPrototype = require('./_isPrototype'); - -/** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototype(object)) - : {}; -} - -module.exports = initCloneObject; - -},{"./_baseCreate":35,"./_getPrototype":88,"./_isPrototype":107}],103:[function(require,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; - -},{}],104:[function(require,module,exports){ -var isArray = require('./isArray'), - isSymbol = require('./isSymbol'); - -/** 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; - -},{"./isArray":150,"./isSymbol":159}],105:[function(require,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; - -},{}],106:[function(require,module,exports){ -var coreJsData = require('./_coreJsData'); - -/** 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; - -},{"./_coreJsData":75}],107:[function(require,module,exports){ -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ -function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; -} - -module.exports = isPrototype; - -},{}],108:[function(require,module,exports){ -var isObject = require('./isObject'); - -/** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ -function isStrictComparable(value) { - return value === value && !isObject(value); -} - -module.exports = isStrictComparable; - -},{"./isObject":155}],109:[function(require,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; - -},{}],110:[function(require,module,exports){ -var assocIndexOf = require('./_assocIndexOf'); - -/** 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; - -},{"./_assocIndexOf":30}],111:[function(require,module,exports){ -var assocIndexOf = require('./_assocIndexOf'); - -/** - * 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; - -},{"./_assocIndexOf":30}],112:[function(require,module,exports){ -var assocIndexOf = require('./_assocIndexOf'); - -/** - * 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; - -},{"./_assocIndexOf":30}],113:[function(require,module,exports){ -var assocIndexOf = require('./_assocIndexOf'); - -/** - * 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; - -},{"./_assocIndexOf":30}],114:[function(require,module,exports){ -var Hash = require('./_Hash'), - ListCache = require('./_ListCache'), - Map = require('./_Map'); - -/** - * 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; - -},{"./_Hash":9,"./_ListCache":10,"./_Map":11}],115:[function(require,module,exports){ -var getMapData = require('./_getMapData'); - -/** - * 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; - -},{"./_getMapData":85}],116:[function(require,module,exports){ -var getMapData = require('./_getMapData'); - -/** - * 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; - -},{"./_getMapData":85}],117:[function(require,module,exports){ -var getMapData = require('./_getMapData'); - -/** - * 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; - -},{"./_getMapData":85}],118:[function(require,module,exports){ -var getMapData = require('./_getMapData'); - -/** - * 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; - -},{"./_getMapData":85}],119:[function(require,module,exports){ -/** - * Converts `map` to its key-value pairs. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the key-value pairs. - */ -function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; -} - -module.exports = mapToArray; - -},{}],120:[function(require,module,exports){ -/** - * A specialized version of `matchesProperty` for source values suitable - * for strict equality comparisons, i.e. `===`. - * - * @private - * @param {string} key The key of the property to get. - * @param {*} srcValue The value to match. - * @returns {Function} Returns the new spec function. - */ -function matchesStrictComparable(key, srcValue) { - return function(object) { - if (object == null) { - return false; - } - return object[key] === srcValue && - (srcValue !== undefined || (key in Object(object))); - }; -} - -module.exports = matchesStrictComparable; - -},{}],121:[function(require,module,exports){ -var memoize = require('./memoize'); - -/** 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; - -},{"./memoize":164}],122:[function(require,module,exports){ -var getNative = require('./_getNative'); - -/* Built-in method references that are verified to be native. */ -var nativeCreate = getNative(Object, 'create'); - -module.exports = nativeCreate; - -},{"./_getNative":87}],123:[function(require,module,exports){ -var overArg = require('./_overArg'); - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeKeys = overArg(Object.keys, Object); - -module.exports = nativeKeys; - -},{"./_overArg":127}],124:[function(require,module,exports){ -/** - * This function is like - * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * except that it includes inherited enumerable properties. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function nativeKeysIn(object) { - var result = []; - if (object != null) { - for (var key in Object(object)) { - result.push(key); - } - } - return result; -} - -module.exports = nativeKeysIn; - -},{}],125:[function(require,module,exports){ -var freeGlobal = require('./_freeGlobal'); - -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; - -/** Detect free variable `process` from Node.js. */ -var freeProcess = moduleExports && freeGlobal.process; - -/** Used to access faster Node.js helpers. */ -var nodeUtil = (function() { - try { - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} -}()); - -module.exports = nodeUtil; - -},{"./_freeGlobal":82}],126:[function(require,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; - -},{}],127:[function(require,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; - -},{}],128:[function(require,module,exports){ -var freeGlobal = require('./_freeGlobal'); - -/** 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; - -},{"./_freeGlobal":82}],129:[function(require,module,exports){ -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** - * Adds `value` to the array cache. - * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. - */ -function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; -} - -module.exports = setCacheAdd; - -},{}],130:[function(require,module,exports){ -/** - * Checks if `value` is in the array cache. - * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ -function setCacheHas(value) { - return this.__data__.has(value); -} - -module.exports = setCacheHas; - -},{}],131:[function(require,module,exports){ -/** - * Converts `set` to an array of its values. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. - */ -function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; -} - -module.exports = setToArray; - -},{}],132:[function(require,module,exports){ -var ListCache = require('./_ListCache'); - -/** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ -function stackClear() { - this.__data__ = new ListCache; - this.size = 0; -} - -module.exports = stackClear; - -},{"./_ListCache":10}],133:[function(require,module,exports){ -/** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function stackDelete(key) { - var data = this.__data__, - result = data['delete'](key); - - this.size = data.size; - return result; -} - -module.exports = stackDelete; - -},{}],134:[function(require,module,exports){ -/** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function stackGet(key) { - return this.__data__.get(key); -} - -module.exports = stackGet; - -},{}],135:[function(require,module,exports){ -/** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function stackHas(key) { - return this.__data__.has(key); -} - -module.exports = stackHas; - -},{}],136:[function(require,module,exports){ -var ListCache = require('./_ListCache'), - Map = require('./_Map'), - MapCache = require('./_MapCache'); - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache instance. - */ -function stackSet(key, value) { - var data = this.__data__; - if (data instanceof ListCache) { - var pairs = data.__data__; - if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { - pairs.push([key, value]); - this.size = ++data.size; - return this; - } - data = this.__data__ = new MapCache(pairs); - } - data.set(key, value); - this.size = data.size; - return this; -} - -module.exports = stackSet; - -},{"./_ListCache":10,"./_Map":11,"./_MapCache":12}],137:[function(require,module,exports){ -var memoizeCapped = require('./_memoizeCapped'); - -/** 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; - -},{"./_memoizeCapped":121}],138:[function(require,module,exports){ -var isSymbol = require('./isSymbol'); - -/** 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; - -},{"./isSymbol":159}],139:[function(require,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; - -},{}],140:[function(require,module,exports){ -var baseClone = require('./_baseClone'); - -/** Used to compose bitmasks for cloning. */ -var CLONE_DEEP_FLAG = 1, - CLONE_SYMBOLS_FLAG = 4; - -/** - * This method is like `_.clone` except that it recursively clones `value`. - * - * @static - * @memberOf _ - * @since 1.0.0 - * @category Lang - * @param {*} value The value to recursively clone. - * @returns {*} Returns the deep cloned value. - * @see _.clone - * @example - * - * var objects = [{ 'a': 1 }, { 'b': 2 }]; - * - * var deep = _.cloneDeep(objects); - * console.log(deep[0] === objects[0]); - * // => false - */ -function cloneDeep(value) { - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); -} - -module.exports = cloneDeep; - -},{"./_baseClone":34}],141:[function(require,module,exports){ -var isObject = require('./isObject'), - now = require('./now'), - toNumber = require('./toNumber'); - -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max, - nativeMin = Math.min; - -/** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed `func` invocations and a `flush` method to immediately invoke them. - * Provide `options` to indicate whether `func` should be invoked on the - * leading and/or trailing edge of the `wait` timeout. The `func` is invoked - * with the last arguments provided to the debounced function. Subsequent - * calls to the debounced function return the result of the last `func` - * invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the debounced function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=false] - * Specify invoking on the leading edge of the timeout. - * @param {number} [options.maxWait] - * The maximum time `func` is allowed to be delayed before it's invoked. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // Avoid costly calculations while the window size is in flux. - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // Invoke `sendMail` when clicked, debouncing subsequent calls. - * jQuery(element).on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // Ensure `batchLog` is invoked once after 1 second of debounced calls. - * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); - * var source = new EventSource('/stream'); - * jQuery(source).on('message', debounced); - * - * // Cancel the trailing debounced invocation. - * jQuery(window).on('popstate', debounced.cancel); - */ -function debounce(func, wait, options) { - var lastArgs, - lastThis, - maxWait, - result, - timerId, - lastCallTime, - lastInvokeTime = 0, - leading = false, - maxing = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = toNumber(wait) || 0; - if (isObject(options)) { - leading = !!options.leading; - maxing = 'maxWait' in options; - maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - - function invokeFunc(time) { - var args = lastArgs, - thisArg = lastThis; - - lastArgs = lastThis = undefined; - lastInvokeTime = time; - result = func.apply(thisArg, args); - return result; - } - - function leadingEdge(time) { - // Reset any `maxWait` timer. - lastInvokeTime = time; - // Start the timer for the trailing edge. - timerId = setTimeout(timerExpired, wait); - // Invoke the leading edge. - return leading ? invokeFunc(time) : result; - } - - function remainingWait(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime, - result = wait - timeSinceLastCall; - - return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result; - } - - function shouldInvoke(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime; - - // Either this is the first call, activity has stopped and we're at the - // trailing edge, the system time has gone backwards and we're treating - // it as the trailing edge, or we've hit the `maxWait` limit. - return (lastCallTime === undefined || (timeSinceLastCall >= wait) || - (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); - } - - function timerExpired() { - var time = now(); - if (shouldInvoke(time)) { - return trailingEdge(time); - } - // Restart the timer. - timerId = setTimeout(timerExpired, remainingWait(time)); - } - - function trailingEdge(time) { - timerId = undefined; - - // Only invoke if we have `lastArgs` which means `func` has been - // debounced at least once. - if (trailing && lastArgs) { - return invokeFunc(time); - } - lastArgs = lastThis = undefined; - return result; - } - - function cancel() { - if (timerId !== undefined) { - clearTimeout(timerId); - } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined; - } - - function flush() { - return timerId === undefined ? result : trailingEdge(now()); - } - - function debounced() { - var time = now(), - isInvoking = shouldInvoke(time); - - lastArgs = arguments; - lastThis = this; - lastCallTime = time; - - if (isInvoking) { - if (timerId === undefined) { - return leadingEdge(lastCallTime); - } - if (maxing) { - // Handle invocations in a tight loop. - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); - } - } - if (timerId === undefined) { - timerId = setTimeout(timerExpired, wait); - } - return result; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; -} - -module.exports = debounce; - -},{"./isObject":155,"./now":165,"./toNumber":170}],142:[function(require,module,exports){ -module.exports = require('./forEach'); - -},{"./forEach":144}],143:[function(require,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; - -},{}],144:[function(require,module,exports){ -var arrayEach = require('./_arrayEach'), - baseEach = require('./_baseEach'), - castFunction = require('./_castFunction'), - isArray = require('./isArray'); - -/** - * Iterates over elements of `collection` and invokes `iteratee` for each element. - * The iteratee is invoked with three arguments: (value, index|key, collection). - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" - * property are iterated like arrays. To avoid this behavior use `_.forIn` - * or `_.forOwn` for object iteration. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @alias each - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array|Object} Returns `collection`. - * @see _.forEachRight - * @example - * - * _.forEach([1, 2], function(value) { - * console.log(value); - * }); - * // => Logs `1` then `2`. - * - * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a' then 'b' (iteration order is not guaranteed). - */ -function forEach(collection, iteratee) { - var func = isArray(collection) ? arrayEach : baseEach; - return func(collection, castFunction(iteratee)); -} - -module.exports = forEach; - -},{"./_arrayEach":22,"./_baseEach":36,"./_castFunction":61,"./isArray":150}],145:[function(require,module,exports){ -var baseForOwn = require('./_baseForOwn'), - castFunction = require('./_castFunction'); - -/** - * Iterates over own enumerable string keyed properties of an object and - * invokes `iteratee` for each property. The iteratee is invoked with three - * arguments: (value, key, object). Iteratee functions may exit iteration - * early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @since 0.3.0 - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Object} Returns `object`. - * @see _.forOwnRight - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => Logs 'a' then 'b' (iteration order is not guaranteed). - */ -function forOwn(object, iteratee) { - return object && baseForOwn(object, castFunction(iteratee)); -} - -module.exports = forOwn; - -},{"./_baseForOwn":38,"./_castFunction":61}],146:[function(require,module,exports){ -var baseGet = require('./_baseGet'); - -/** - * 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; - -},{"./_baseGet":39}],147:[function(require,module,exports){ -var baseHasIn = require('./_baseHasIn'), - hasPath = require('./_hasPath'); - -/** - * Checks if `path` is a direct or inherited property of `object`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @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 = _.create({ 'a': _.create({ 'b': 2 }) }); - * - * _.hasIn(object, 'a'); - * // => true - * - * _.hasIn(object, 'a.b'); - * // => true - * - * _.hasIn(object, ['a', 'b']); - * // => true - * - * _.hasIn(object, 'b'); - * // => false - */ -function hasIn(object, path) { - return object != null && hasPath(object, path, baseHasIn); -} - -module.exports = hasIn; - -},{"./_baseHasIn":42,"./_hasPath":94}],148:[function(require,module,exports){ -/** - * This method returns the first argument it receives. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. - * @example - * - * var object = { 'a': 1 }; - * - * console.log(_.identity(object) === object); - * // => true - */ -function identity(value) { - return value; -} - -module.exports = identity; - -},{}],149:[function(require,module,exports){ -var baseIsArguments = require('./_baseIsArguments'), - isObjectLike = require('./isObjectLike'); - -/** 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; - -},{"./_baseIsArguments":43,"./isObjectLike":156}],150:[function(require,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; - -},{}],151:[function(require,module,exports){ -var isFunction = require('./isFunction'), - isLength = require('./isLength'); - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); -} - -module.exports = isArrayLike; - -},{"./isFunction":153,"./isLength":154}],152:[function(require,module,exports){ -var root = require('./_root'), - stubFalse = require('./stubFalse'); - -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; - -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; - -/** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ -var isBuffer = nativeIsBuffer || stubFalse; - -module.exports = isBuffer; - -},{"./_root":128,"./stubFalse":168}],153:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - isObject = require('./isObject'); - -/** `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; - -},{"./_baseGetTag":41,"./isObject":155}],154:[function(require,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; - -},{}],155:[function(require,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; - -},{}],156:[function(require,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; - -},{}],157:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - getPrototype = require('./_getPrototype'), - isObjectLike = require('./isObjectLike'); - -/** `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; - -},{"./_baseGetTag":41,"./_getPrototype":88,"./isObjectLike":156}],158:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - isArray = require('./isArray'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var stringTag = '[object String]'; - -/** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a string, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ -function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); -} - -module.exports = isString; - -},{"./_baseGetTag":41,"./isArray":150,"./isObjectLike":156}],159:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - isObjectLike = require('./isObjectLike'); - -/** `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; - -},{"./_baseGetTag":41,"./isObjectLike":156}],160:[function(require,module,exports){ -var baseIsTypedArray = require('./_baseIsTypedArray'), - baseUnary = require('./_baseUnary'), - nodeUtil = require('./_nodeUtil'); - -/* Node.js helper references. */ -var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - -/** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ -var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - -module.exports = isTypedArray; - -},{"./_baseIsTypedArray":48,"./_baseUnary":59,"./_nodeUtil":125}],161:[function(require,module,exports){ -var arrayLikeKeys = require('./_arrayLikeKeys'), - baseKeys = require('./_baseKeys'), - isArrayLike = require('./isArrayLike'); - -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); -} - -module.exports = keys; - -},{"./_arrayLikeKeys":24,"./_baseKeys":50,"./isArrayLike":151}],162:[function(require,module,exports){ -var arrayLikeKeys = require('./_arrayLikeKeys'), - baseKeysIn = require('./_baseKeysIn'), - isArrayLike = require('./isArrayLike'); - -/** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ -function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); -} - -module.exports = keysIn; - -},{"./_arrayLikeKeys":24,"./_baseKeysIn":51,"./isArrayLike":151}],163:[function(require,module,exports){ -var arrayMap = require('./_arrayMap'), - baseIteratee = require('./_baseIteratee'), - baseMap = require('./_baseMap'), - isArray = require('./isArray'); - -/** - * Creates an array of values by running each element in `collection` thru - * `iteratee`. The iteratee is invoked with three arguments: - * (value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. - * - * The guarded methods are: - * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, - * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, - * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, - * `template`, `trim`, `trimEnd`, `trimStart`, and `words` - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Collection - * @param {Array|Object} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - * @example - * - * function square(n) { - * return n * n; - * } - * - * _.map([4, 8], square); - * // => [16, 64] - * - * _.map({ 'a': 4, 'b': 8 }, square); - * // => [16, 64] (iteration order is not guaranteed) - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * // The `_.property` iteratee shorthand. - * _.map(users, 'user'); - * // => ['barney', 'fred'] - */ -function map(collection, iteratee) { - var func = isArray(collection) ? arrayMap : baseMap; - return func(collection, baseIteratee(iteratee, 3)); -} - -module.exports = map; - -},{"./_arrayMap":25,"./_baseIteratee":49,"./_baseMap":52,"./isArray":150}],164:[function(require,module,exports){ -var MapCache = require('./_MapCache'); - -/** 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; - -},{"./_MapCache":12}],165:[function(require,module,exports){ -var root = require('./_root'); - -/** - * Gets the timestamp of the number of milliseconds that have elapsed since - * the Unix epoch (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Date - * @returns {number} Returns the timestamp. - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => Logs the number of milliseconds it took for the deferred invocation. - */ -var now = function() { - return root.Date.now(); -}; - -module.exports = now; - -},{"./_root":128}],166:[function(require,module,exports){ -var baseProperty = require('./_baseProperty'), - basePropertyDeep = require('./_basePropertyDeep'), - isKey = require('./_isKey'), - toKey = require('./_toKey'); - -/** - * Creates a function that returns the value at `path` of a given object. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Util - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new accessor function. - * @example - * - * var objects = [ - * { 'a': { 'b': 2 } }, - * { 'a': { 'b': 1 } } - * ]; - * - * _.map(objects, _.property('a.b')); - * // => [2, 1] - * - * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); - * // => [1, 2] - */ -function property(path) { - return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); -} - -module.exports = property; - -},{"./_baseProperty":55,"./_basePropertyDeep":56,"./_isKey":104,"./_toKey":138}],167:[function(require,module,exports){ -/** - * This method returns a new empty array. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {Array} Returns the new empty array. - * @example - * - * var arrays = _.times(2, _.stubArray); - * - * console.log(arrays); - * // => [[], []] - * - * console.log(arrays[0] === arrays[1]); - * // => false - */ -function stubArray() { - return []; -} - -module.exports = stubArray; - -},{}],168:[function(require,module,exports){ -/** - * This method returns `false`. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {boolean} Returns `false`. - * @example - * - * _.times(2, _.stubFalse); - * // => [false, false] - */ -function stubFalse() { - return false; -} - -module.exports = stubFalse; - -},{}],169:[function(require,module,exports){ -var debounce = require('./debounce'), - isObject = require('./isObject'); - -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a throttled function that only invokes `func` at most once per - * every `wait` milliseconds. The throttled function comes with a `cancel` - * method to cancel delayed `func` invocations and a `flush` method to - * immediately invoke them. Provide `options` to indicate whether `func` - * should be invoked on the leading and/or trailing edge of the `wait` - * timeout. The `func` is invoked with the last arguments provided to the - * throttled function. Subsequent calls to the throttled function return the - * result of the last `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is - * invoked on the trailing edge of the timeout only if the throttled function - * is invoked more than once during the `wait` timeout. - * - * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred - * until to the next tick, similar to `setTimeout` with a timeout of `0`. - * - * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) - * for details over the differences between `_.throttle` and `_.debounce`. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Function - * @param {Function} func The function to throttle. - * @param {number} [wait=0] The number of milliseconds to throttle invocations to. - * @param {Object} [options={}] The options object. - * @param {boolean} [options.leading=true] - * Specify invoking on the leading edge of the timeout. - * @param {boolean} [options.trailing=true] - * Specify invoking on the trailing edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * // Avoid excessively updating the position while scrolling. - * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); - * - * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. - * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); - * jQuery(element).on('click', throttled); - * - * // Cancel the trailing throttled invocation. - * jQuery(window).on('popstate', throttled.cancel); - */ -function throttle(func, wait, options) { - var leading = true, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (isObject(options)) { - leading = 'leading' in options ? !!options.leading : leading; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - return debounce(func, wait, { - 'leading': leading, - 'maxWait': wait, - 'trailing': trailing - }); -} - -module.exports = throttle; - -},{"./debounce":141,"./isObject":155}],170:[function(require,module,exports){ -var isObject = require('./isObject'), - isSymbol = require('./isSymbol'); - -/** Used as references for various `Number` constants. */ -var NAN = 0 / 0; - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; - -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; - -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; - -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} - -module.exports = toNumber; - -},{"./isObject":155,"./isSymbol":159}],171:[function(require,module,exports){ -var baseToString = require('./_baseToString'); - -/** - * 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; - -},{"./_baseToString":58}],172:[function(require,module,exports){ -(function(root, factory) { - if (typeof define === 'function' && define.amd) { - define([], factory); - } else if (typeof exports === 'object') { - module.exports = factory(); - } else { - root.materialColors = factory(); - } -})(this, function() { - return {"red":{"50":"#ffebee","100":"#ffcdd2","200":"#ef9a9a","300":"#e57373","400":"#ef5350","500":"#f44336","600":"#e53935","700":"#d32f2f","800":"#c62828","900":"#b71c1c","a100":"#ff8a80","a200":"#ff5252","a400":"#ff1744","a700":"#d50000"},"pink":{"50":"#fce4ec","100":"#f8bbd0","200":"#f48fb1","300":"#f06292","400":"#ec407a","500":"#e91e63","600":"#d81b60","700":"#c2185b","800":"#ad1457","900":"#880e4f","a100":"#ff80ab","a200":"#ff4081","a400":"#f50057","a700":"#c51162"},"purple":{"50":"#f3e5f5","100":"#e1bee7","200":"#ce93d8","300":"#ba68c8","400":"#ab47bc","500":"#9c27b0","600":"#8e24aa","700":"#7b1fa2","800":"#6a1b9a","900":"#4a148c","a100":"#ea80fc","a200":"#e040fb","a400":"#d500f9","a700":"#aa00ff"},"deepPurple":{"50":"#ede7f6","100":"#d1c4e9","200":"#b39ddb","300":"#9575cd","400":"#7e57c2","500":"#673ab7","600":"#5e35b1","700":"#512da8","800":"#4527a0","900":"#311b92","a100":"#b388ff","a200":"#7c4dff","a400":"#651fff","a700":"#6200ea"},"indigo":{"50":"#e8eaf6","100":"#c5cae9","200":"#9fa8da","300":"#7986cb","400":"#5c6bc0","500":"#3f51b5","600":"#3949ab","700":"#303f9f","800":"#283593","900":"#1a237e","a100":"#8c9eff","a200":"#536dfe","a400":"#3d5afe","a700":"#304ffe"},"blue":{"50":"#e3f2fd","100":"#bbdefb","200":"#90caf9","300":"#64b5f6","400":"#42a5f5","500":"#2196f3","600":"#1e88e5","700":"#1976d2","800":"#1565c0","900":"#0d47a1","a100":"#82b1ff","a200":"#448aff","a400":"#2979ff","a700":"#2962ff"},"lightBlue":{"50":"#e1f5fe","100":"#b3e5fc","200":"#81d4fa","300":"#4fc3f7","400":"#29b6f6","500":"#03a9f4","600":"#039be5","700":"#0288d1","800":"#0277bd","900":"#01579b","a100":"#80d8ff","a200":"#40c4ff","a400":"#00b0ff","a700":"#0091ea"},"cyan":{"50":"#e0f7fa","100":"#b2ebf2","200":"#80deea","300":"#4dd0e1","400":"#26c6da","500":"#00bcd4","600":"#00acc1","700":"#0097a7","800":"#00838f","900":"#006064","a100":"#84ffff","a200":"#18ffff","a400":"#00e5ff","a700":"#00b8d4"},"teal":{"50":"#e0f2f1","100":"#b2dfdb","200":"#80cbc4","300":"#4db6ac","400":"#26a69a","500":"#009688","600":"#00897b","700":"#00796b","800":"#00695c","900":"#004d40","a100":"#a7ffeb","a200":"#64ffda","a400":"#1de9b6","a700":"#00bfa5"},"green":{"50":"#e8f5e9","100":"#c8e6c9","200":"#a5d6a7","300":"#81c784","400":"#66bb6a","500":"#4caf50","600":"#43a047","700":"#388e3c","800":"#2e7d32","900":"#1b5e20","a100":"#b9f6ca","a200":"#69f0ae","a400":"#00e676","a700":"#00c853"},"lightGreen":{"50":"#f1f8e9","100":"#dcedc8","200":"#c5e1a5","300":"#aed581","400":"#9ccc65","500":"#8bc34a","600":"#7cb342","700":"#689f38","800":"#558b2f","900":"#33691e","a100":"#ccff90","a200":"#b2ff59","a400":"#76ff03","a700":"#64dd17"},"lime":{"50":"#f9fbe7","100":"#f0f4c3","200":"#e6ee9c","300":"#dce775","400":"#d4e157","500":"#cddc39","600":"#c0ca33","700":"#afb42b","800":"#9e9d24","900":"#827717","a100":"#f4ff81","a200":"#eeff41","a400":"#c6ff00","a700":"#aeea00"},"yellow":{"50":"#fffde7","100":"#fff9c4","200":"#fff59d","300":"#fff176","400":"#ffee58","500":"#ffeb3b","600":"#fdd835","700":"#fbc02d","800":"#f9a825","900":"#f57f17","a100":"#ffff8d","a200":"#ffff00","a400":"#ffea00","a700":"#ffd600"},"amber":{"50":"#fff8e1","100":"#ffecb3","200":"#ffe082","300":"#ffd54f","400":"#ffca28","500":"#ffc107","600":"#ffb300","700":"#ffa000","800":"#ff8f00","900":"#ff6f00","a100":"#ffe57f","a200":"#ffd740","a400":"#ffc400","a700":"#ffab00"},"orange":{"50":"#fff3e0","100":"#ffe0b2","200":"#ffcc80","300":"#ffb74d","400":"#ffa726","500":"#ff9800","600":"#fb8c00","700":"#f57c00","800":"#ef6c00","900":"#e65100","a100":"#ffd180","a200":"#ffab40","a400":"#ff9100","a700":"#ff6d00"},"deepOrange":{"50":"#fbe9e7","100":"#ffccbc","200":"#ffab91","300":"#ff8a65","400":"#ff7043","500":"#ff5722","600":"#f4511e","700":"#e64a19","800":"#d84315","900":"#bf360c","a100":"#ff9e80","a200":"#ff6e40","a400":"#ff3d00","a700":"#dd2c00"},"brown":{"50":"#efebe9","100":"#d7ccc8","200":"#bcaaa4","300":"#a1887f","400":"#8d6e63","500":"#795548","600":"#6d4c41","700":"#5d4037","800":"#4e342e","900":"#3e2723"},"grey":{"50":"#fafafa","100":"#f5f5f5","200":"#eeeeee","300":"#e0e0e0","400":"#bdbdbd","500":"#9e9e9e","600":"#757575","700":"#616161","800":"#424242","900":"#212121"},"blueGrey":{"50":"#eceff1","100":"#cfd8dc","200":"#b0bec5","300":"#90a4ae","400":"#78909c","500":"#607d8b","600":"#546e7a","700":"#455a64","800":"#37474f","900":"#263238"},"darkText":{"primary":"rgba(0, 0, 0, 0.87)","secondary":"rgba(0, 0, 0, 0.54)","disabled":"rgba(0, 0, 0, 0.38)","dividers":"rgba(0, 0, 0, 0.12)"},"lightText":{"primary":"rgba(255, 255, 255, 1)","secondary":"rgba(255, 255, 255, 0.7)","disabled":"rgba(255, 255, 255, 0.5)","dividers":"rgba(255, 255, 255, 0.12)"},"darkIcons":{"active":"rgba(0, 0, 0, 0.54)","inactive":"rgba(0, 0, 0, 0.38)"},"lightIcons":{"active":"rgba(255, 255, 255, 1)","inactive":"rgba(255, 255, 255, 0.5)"},"white":"#ffffff","black":"#000000"}; -}); - -},{}],173:[function(require,module,exports){ -/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ - -'use strict'; -/* eslint-disable no-unused-vars */ -var getOwnPropertySymbols = Object.getOwnPropertySymbols; -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line no-new-wrappers - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - - return true; - } catch (err) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} - -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (getOwnPropertySymbols) { - symbols = getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; - -},{}],174:[function(require,module,exports){ -/** -* Copyright 2012-2017, Plotly, Inc. -* All rights reserved. -* -* This source code is licensed under the MIT license found in the -* LICENSE file in the root directory of this source tree. -*/ - -'use strict'; - -var extendFlat = require('../../lib/extend').extendFlat; -var fontAttrs = require('../../plots/font_attributes'); - -module.exports = { - hoverlabel: { - bgcolor: { - valType: 'color', - role: 'style', - arrayOk: true, - description: [ - 'Sets the background color of the hover labels for this trace' - ].join(' ') - }, - bordercolor: { - valType: 'color', - role: 'style', - arrayOk: true, - description: [ - 'Sets the border color of the hover labels for this trace.' - ].join(' ') - }, - font: { - family: extendFlat({}, fontAttrs.family, { arrayOk: true }), - size: extendFlat({}, fontAttrs.size, { arrayOk: true }), - color: extendFlat({}, fontAttrs.color, { arrayOk: true }) - }, - namelength: { - valType: 'integer', - min: -1, - arrayOk: true, - role: 'style', - description: [ - 'Sets the length (in number of characters) of the trace name in', - 'the hover labels for this trace. -1 shows the whole name', - 'regardless of length. 0-3 shows the first 0-3 characters, and', - 'an integer >3 will show the whole name if it is less than that', - 'many characters, but if it is longer, will truncate to', - '`namelength - 3` characters and add an ellipsis.' - ].join(' ') - } - } -}; - -},{"../../lib/extend":175,"../../plots/font_attributes":185}],175:[function(require,module,exports){ -/** -* Copyright 2012-2017, Plotly, Inc. -* All rights reserved. -* -* This source code is licensed under the MIT license found in the -* LICENSE file in the root directory of this source tree. -*/ - - -'use strict'; - -var isPlainObject = require('./is_plain_object.js'); -var isArray = Array.isArray; - -function primitivesLoopSplice(source, target) { - var i, value; - for(i = 0; i < source.length; i++) { - value = source[i]; - if(value !== null && typeof(value) === 'object') { - return false; - } - if(value !== void(0)) { - target[i] = value; - } - } - return true; -} - -exports.extendFlat = function() { - return _extend(arguments, false, false, false); -}; - -exports.extendDeep = function() { - return _extend(arguments, true, false, false); -}; - -exports.extendDeepAll = function() { - return _extend(arguments, true, true, false); -}; - -exports.extendDeepNoArrays = function() { - return _extend(arguments, true, false, true); -}; - -/* - * Inspired by https://github.com/justmoon/node-extend/blob/master/index.js - * All credit to the jQuery authors for perfecting this amazing utility. - * - * API difference with jQuery version: - * - No optional boolean (true -> deep extend) first argument, - * use `extendFlat` for first-level only extend and - * use `extendDeep` for a deep extend. - * - * Other differences with jQuery version: - * - Uses a modern (and faster) isPlainObject routine. - * - Expected to work with object {} and array [] arguments only. - * - Does not check for circular structure. - * FYI: jQuery only does a check across one level. - * Warning: this might result in infinite loops. - * - */ -function _extend(inputs, isDeep, keepAllKeys, noArrayCopies) { - var target = inputs[0], - length = inputs.length; - - var input, key, src, copy, copyIsArray, clone, allPrimitives; - - if(length === 2 && isArray(target) && isArray(inputs[1]) && target.length === 0) { - - allPrimitives = primitivesLoopSplice(inputs[1], target); - - if(allPrimitives) { - return target; - } else { - target.splice(0, target.length); // reset target and continue to next block - } - } - - for(var i = 1; i < length; i++) { - input = inputs[i]; - - for(key in input) { - src = target[key]; - copy = input[key]; - - // Stop early and just transfer the array if array copies are disallowed: - if(noArrayCopies && isArray(copy)) { - target[key] = copy; - } - - // recurse if we're merging plain objects or arrays - else if(isDeep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { - if(copyIsArray) { - copyIsArray = false; - clone = src && isArray(src) ? src : []; - } else { - clone = src && isPlainObject(src) ? src : {}; - } - - // never move original objects, clone them - target[key] = _extend([clone, copy], isDeep, keepAllKeys, noArrayCopies); - } - - // don't bring in undefined values, except for extendDeepAll - else if(typeof copy !== 'undefined' || keepAllKeys) { - target[key] = copy; - } - } - } - - return target; -} - -},{"./is_plain_object.js":177}],176:[function(require,module,exports){ -/** -* Copyright 2012-2017, Plotly, Inc. -* All rights reserved. -* -* This source code is licensed under the MIT license found in the -* LICENSE file in the root directory of this source tree. -*/ - -'use strict'; - -/** - * Return true for arrays, whether they're untyped or not. - */ - -// IE9 fallback -var ab = (typeof ArrayBuffer === 'undefined' || !ArrayBuffer.isView) ? - {isView: function() { return false; }} : - ArrayBuffer; - -module.exports = function isArray(a) { - return Array.isArray(a) || ab.isView(a); -}; - -},{}],177:[function(require,module,exports){ -/** -* Copyright 2012-2017, Plotly, Inc. -* All rights reserved. -* -* This source code is licensed under the MIT license found in the -* LICENSE file in the root directory of this source tree. -*/ - - -'use strict'; - -// more info: http://stackoverflow.com/questions/18531624/isplainobject-thing -module.exports = function isPlainObject(obj) { - - // We need to be a little less strict in the `imagetest` container because - // of how async image requests are handled. - // - // N.B. isPlainObject(new Constructor()) will return true in `imagetest` - if(window && window.process && window.process.versions) { - return Object.prototype.toString.call(obj) === '[object Object]'; - } - - return ( - Object.prototype.toString.call(obj) === '[object Object]' && - Object.getPrototypeOf(obj) === Object.prototype - ); -}; - -},{}],178:[function(require,module,exports){ -/** -* Copyright 2012-2017, Plotly, Inc. -* All rights reserved. -* -* This source code is licensed under the MIT license found in the -* LICENSE file in the root directory of this source tree. -*/ - -'use strict'; - -/* eslint-disable no-console */ - -var config = require('../plot_api/plot_config'); - -var loggers = module.exports = {}; - -/** - * ------------------------------------------ - * debugging tools - * ------------------------------------------ - */ - -loggers.log = function() { - if(config.logging > 1) { - var messages = ['LOG:']; - - for(var i = 0; i < arguments.length; i++) { - messages.push(arguments[i]); - } - - apply(console.trace || console.log, messages); - } -}; - -loggers.warn = function() { - if(config.logging > 0) { - var messages = ['WARN:']; - - for(var i = 0; i < arguments.length; i++) { - messages.push(arguments[i]); - } - - apply(console.trace || console.log, messages); - } -}; - -loggers.error = function() { - if(config.logging > 0) { - var messages = ['ERROR:']; - - for(var i = 0; i < arguments.length; i++) { - messages.push(arguments[i]); - } - - apply(console.error, messages); - } -}; - -/* - * Robust apply, for IE9 where console.log doesn't support - * apply like other functions do - */ -function apply(f, args) { - if(f.apply) { - f.apply(f, args); - } - else { - for(var i = 0; i < args.length; i++) { - f(args[i]); - } - } -} - -},{"../plot_api/plot_config":183}],179:[function(require,module,exports){ -/** -* Copyright 2012-2017, Plotly, Inc. -* All rights reserved. -* -* This source code is licensed under the MIT license found in the -* LICENSE file in the root directory of this source tree. -*/ - - -'use strict'; - -var isNumeric = require('fast-isnumeric'); -var isArray = require('./is_array'); -var isPlainObject = require('./is_plain_object'); -var containerArrayMatch = require('../plot_api/container_array_match'); - -/** - * convert a string s (such as 'xaxis.range[0]') - * representing a property of nested object into set and get methods - * also return the string and object so we don't have to keep track of them - * allows [-1] for an array index, to set a property inside all elements - * of an array - * eg if obj = {arr: [{a: 1}, {a: 2}]} - * you can do p = nestedProperty(obj, 'arr[-1].a') - * but you cannot set the array itself this way, to do that - * just set the whole array. - * eg if obj = {arr: [1, 2, 3]} - * you can't do nestedProperty(obj, 'arr[-1]').set(5) - * but you can do nestedProperty(obj, 'arr').set([5, 5, 5]) - */ -module.exports = function nestedProperty(container, propStr) { - if(isNumeric(propStr)) propStr = String(propStr); - else if(typeof propStr !== 'string' || - propStr.substr(propStr.length - 4) === '[-1]') { - throw 'bad property string'; - } - - var j = 0, - propParts = propStr.split('.'), - indexed, - indices, - i; - - // check for parts of the nesting hierarchy that are numbers (ie array elements) - while(j < propParts.length) { - // look for non-bracket chars, then any number of [##] blocks - indexed = String(propParts[j]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/); - if(indexed) { - if(indexed[1]) propParts[j] = indexed[1]; - // allow propStr to start with bracketed array indices - else if(j === 0) propParts.splice(0, 1); - else throw 'bad property string'; - - indices = indexed[2] - .substr(1, indexed[2].length - 2) - .split(']['); - - for(i = 0; i < indices.length; i++) { - j++; - propParts.splice(j, 0, Number(indices[i])); - } - } - j++; - } - - if(typeof container !== 'object') { - return badContainer(container, propStr, propParts); - } - - return { - set: npSet(container, propParts, propStr), - get: npGet(container, propParts), - astr: propStr, - parts: propParts, - obj: container - }; -}; - -function npGet(cont, parts) { - return function() { - var curCont = cont, - curPart, - allSame, - out, - i, - j; - - for(i = 0; i < parts.length - 1; i++) { - curPart = parts[i]; - if(curPart === -1) { - allSame = true; - out = []; - for(j = 0; j < curCont.length; j++) { - out[j] = npGet(curCont[j], parts.slice(i + 1))(); - if(out[j] !== out[0]) allSame = false; - } - return allSame ? out[0] : out; - } - if(typeof curPart === 'number' && !isArray(curCont)) { - return undefined; - } - curCont = curCont[curPart]; - if(typeof curCont !== 'object' || curCont === null) { - return undefined; - } - } - - // only hit this if parts.length === 1 - if(typeof curCont !== 'object' || curCont === null) return undefined; - - out = curCont[parts[i]]; - if(out === null) return undefined; - return out; - }; -} - -/* - * Can this value be deleted? We can delete any empty object (null, undefined, [], {}) - * EXCEPT empty data arrays, {} inside an array, or anything INSIDE an *args* array. - * - * Info arrays can be safely deleted, but not deleting them has no ill effects other - * than leaving a trace or layout object with some cruft in it. - * - * Deleting data arrays can change the meaning of the object, as `[]` means there is - * data for this attribute, it's just empty right now while `undefined` means the data - * should be filled in with defaults to match other data arrays. - * - * `{}` inside an array means "the default object" which is clearly different from - * popping it off the end of the array, or setting it `undefined` inside the array. - * - * *args* arrays get passed directly to API methods and we should respect precisely - * what the user has put there - although if the whole *args* array is empty it's fine - * to delete that. - * - * So we do some simple tests here to find known non-data arrays but don't worry too - * much about not deleting some arrays that would actually be safe to delete. - */ -var INFO_PATTERNS = /(^|\.)((domain|range)(\.[xy])?|args|parallels)$/; -var ARGS_PATTERN = /(^|\.)args\[/; -function isDeletable(val, propStr) { - if(!emptyObj(val) || - (isPlainObject(val) && propStr.charAt(propStr.length - 1) === ']') || - (propStr.match(ARGS_PATTERN) && val !== undefined) - ) { - return false; - } - if(!isArray(val)) return true; - - if(propStr.match(INFO_PATTERNS)) return true; - - var match = containerArrayMatch(propStr); - // if propStr matches the container array itself, index is an empty string - // otherwise we've matched something inside the container array, which may - // still be a data array. - return match && (match.index === ''); -} - -function npSet(cont, parts, propStr) { - return function(val) { - var curCont = cont, - propPart = '', - containerLevels = [[cont, propPart]], - toDelete = isDeletable(val, propStr), - curPart, - i; - - for(i = 0; i < parts.length - 1; i++) { - curPart = parts[i]; - - if(typeof curPart === 'number' && !isArray(curCont)) { - throw 'array index but container is not an array'; - } - - // handle special -1 array index - if(curPart === -1) { - toDelete = !setArrayAll(curCont, parts.slice(i + 1), val, propStr); - if(toDelete) break; - else return; - } - - if(!checkNewContainer(curCont, curPart, parts[i + 1], toDelete)) { - break; - } - - curCont = curCont[curPart]; - - if(typeof curCont !== 'object' || curCont === null) { - throw 'container is not an object'; - } - - propPart = joinPropStr(propPart, curPart); - - containerLevels.push([curCont, propPart]); - } - - if(toDelete) { - if(i === parts.length - 1) delete curCont[parts[i]]; - pruneContainers(containerLevels); - } - else curCont[parts[i]] = val; - }; -} - -function joinPropStr(propStr, newPart) { - var toAdd = newPart; - if(isNumeric(newPart)) toAdd = '[' + newPart + ']'; - else if(propStr) toAdd = '.' + newPart; - - return propStr + toAdd; -} - -// handle special -1 array index -function setArrayAll(containerArray, innerParts, val, propStr) { - var arrayVal = isArray(val), - allSet = true, - thisVal = val, - thisPropStr = propStr.replace('-1', 0), - deleteThis = arrayVal ? false : isDeletable(val, thisPropStr), - firstPart = innerParts[0], - i; - - for(i = 0; i < containerArray.length; i++) { - thisPropStr = propStr.replace('-1', i); - if(arrayVal) { - thisVal = val[i % val.length]; - deleteThis = isDeletable(thisVal, thisPropStr); - } - if(deleteThis) allSet = false; - if(!checkNewContainer(containerArray, i, firstPart, deleteThis)) { - continue; - } - npSet(containerArray[i], innerParts, propStr.replace('-1', i))(thisVal); - } - return allSet; -} - -/** - * make new sub-container as needed. - * returns false if there's no container and none is needed - * because we're only deleting an attribute - */ -function checkNewContainer(container, part, nextPart, toDelete) { - if(container[part] === undefined) { - if(toDelete) return false; - - if(typeof nextPart === 'number') container[part] = []; - else container[part] = {}; - } - return true; -} - -function pruneContainers(containerLevels) { - var i, - j, - curCont, - propPart, - keys, - remainingKeys; - for(i = containerLevels.length - 1; i >= 0; i--) { - curCont = containerLevels[i][0]; - propPart = containerLevels[i][1]; - - remainingKeys = false; - if(isArray(curCont)) { - for(j = curCont.length - 1; j >= 0; j--) { - if(isDeletable(curCont[j], joinPropStr(propPart, j))) { - if(remainingKeys) curCont[j] = undefined; - else curCont.pop(); - } - else remainingKeys = true; - } - } - else if(typeof curCont === 'object' && curCont !== null) { - keys = Object.keys(curCont); - remainingKeys = false; - for(j = keys.length - 1; j >= 0; j--) { - if(isDeletable(curCont[keys[j]], joinPropStr(propPart, keys[j]))) { - delete curCont[keys[j]]; - } - else remainingKeys = true; - } - } - if(remainingKeys) return; - } -} - -function emptyObj(obj) { - if(obj === undefined || obj === null) return true; - if(typeof obj !== 'object') return false; // any plain value - if(isArray(obj)) return !obj.length; // [] - return !Object.keys(obj).length; // {} -} - -function badContainer(container, propStr, propParts) { - return { - set: function() { throw 'bad container'; }, - get: function() {}, - astr: propStr, - parts: propParts, - obj: container - }; -} - -},{"../plot_api/container_array_match":182,"./is_array":176,"./is_plain_object":177,"fast-isnumeric":3}],180:[function(require,module,exports){ -/** -* Copyright 2012-2017, Plotly, Inc. -* All rights reserved. -* -* This source code is licensed under the MIT license found in the -* LICENSE file in the root directory of this source tree. -*/ - -'use strict'; - -// Simple helper functions -// none of these need any external deps - -module.exports = function noop() {}; - -},{}],181:[function(require,module,exports){ -/** -* Copyright 2012-2017, Plotly, Inc. -* All rights reserved. -* -* This source code is licensed under the MIT license found in the -* LICENSE file in the root directory of this source tree. -*/ - -'use strict'; - -/** - * Push array with unique items - * - * @param {array} array - * array to be filled - * @param {any} item - * item to be or not to be inserted - * @return {array} - * ref to array (now possibly containing one more item) - * - */ -module.exports = function pushUnique(array, item) { - if(item instanceof RegExp) { - var itemStr = item.toString(), - i; - for(i = 0; i < array.length; i++) { - if(array[i] instanceof RegExp && array[i].toString() === itemStr) { - return array; - } - } - array.push(item); - } - else if(item && array.indexOf(item) === -1) array.push(item); - - return array; -}; - -},{}],182:[function(require,module,exports){ -/** -* Copyright 2012-2017, Plotly, Inc. -* All rights reserved. -* -* This source code is licensed under the MIT license found in the -* LICENSE file in the root directory of this source tree. -*/ - - -'use strict'; - -var Registry = require('../registry'); - -/* - * containerArrayMatch: does this attribute string point into a - * layout container array? - * - * @param {String} astr: an attribute string, like *annotations[2].text* - * - * @returns {Object | false} Returns false if `astr` doesn't match a container - * array. If it does, returns: - * {array: {String}, index: {Number}, property: {String}} - * ie the attribute string for the array, the index within the array (or '' - * if the whole array) and the property within that (or '' if the whole array - * or the whole object) - */ -module.exports = function containerArrayMatch(astr) { - var rootContainers = Registry.layoutArrayContainers, - regexpContainers = Registry.layoutArrayRegexes, - rootPart = astr.split('[')[0], - arrayStr, - match; - - // look for regexp matches first, because they may be nested inside root matches - // eg updatemenus[i].buttons is nested inside updatemenus - for(var i = 0; i < regexpContainers.length; i++) { - match = astr.match(regexpContainers[i]); - if(match && match.index === 0) { - arrayStr = match[0]; - break; - } - } - - // now look for root matches - if(!arrayStr) arrayStr = rootContainers[rootContainers.indexOf(rootPart)]; - - if(!arrayStr) return false; - - var tail = astr.substr(arrayStr.length); - if(!tail) return {array: arrayStr, index: '', property: ''}; - - match = tail.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/); - if(!match) return false; - - return {array: arrayStr, index: Number(match[1]), property: match[3] || ''}; -}; - -},{"../registry":186}],183:[function(require,module,exports){ -/** -* Copyright 2012-2017, Plotly, Inc. -* All rights reserved. -* -* This source code is licensed under the MIT license found in the -* LICENSE file in the root directory of this source tree. -*/ - -'use strict'; - -/** - * This will be transferred over to gd and overridden by - * config args to Plotly.plot. - * - * The defaults are the appropriate settings for plotly.js, - * so we get the right experience without any config argument. - */ - -module.exports = { - - // no interactivity, for export or image generation - staticPlot: false, - - // we can edit titles, move annotations, etc - sets all pieces of `edits` - // unless a separate `edits` config item overrides individual parts - editable: false, - edits: { - // annotationPosition: the main anchor of the annotation, which is the - // text (if no arrow) or the arrow (which drags the whole thing leaving - // the arrow length & direction unchanged) - annotationPosition: false, - // just for annotations with arrows, change the length and direction of the arrow - annotationTail: false, - annotationText: false, - axisTitleText: false, - colorbarPosition: false, - colorbarTitleText: false, - legendPosition: false, - // edit the trace name fields from the legend - legendText: false, - shapePosition: false, - // the global `layout.title` - titleText: false - }, - - // DO autosize once regardless of layout.autosize - // (use default width or height values otherwise) - autosizable: false, - - // set the length of the undo/redo queue - queueLength: 0, - - // if we DO autosize, do we fill the container or the screen? - fillFrame: false, - - // if we DO autosize, set the frame margins in percents of plot size - frameMargins: 0, - - // mousewheel or two-finger scroll zooms the plot - scrollZoom: false, - - // double click interaction (false, 'reset', 'autosize' or 'reset+autosize') - doubleClick: 'reset+autosize', - - // new users see some hints about interactivity - showTips: true, - - // enable axis pan/zoom drag handles - showAxisDragHandles: true, - - // enable direct range entry at the pan/zoom drag points (drag handles must be enabled above) - showAxisRangeEntryBoxes: true, - - // link to open this plot in plotly - showLink: false, - - // if we show a link, does it contain data or just link to a plotly file? - sendData: true, - - // text appearing in the sendData link - linkText: 'Edit chart', - - // false or function adding source(s) to linkText - showSources: false, - - // display the mode bar (true, false, or 'hover') - displayModeBar: 'hover', - - // remove mode bar button by name - // (see ./components/modebar/buttons.js for the list of names) - modeBarButtonsToRemove: [], - - // add mode bar button using config objects - // (see ./components/modebar/buttons.js for list of arguments) - modeBarButtonsToAdd: [], - - // fully custom mode bar buttons as nested array, - // where the outer arrays represents button groups, and - // the inner arrays have buttons config objects or names of default buttons - // (see ./components/modebar/buttons.js for more info) - modeBarButtons: false, - - // add the plotly logo on the end of the mode bar - displaylogo: true, - - // increase the pixel ratio for Gl plot images - plotGlPixelRatio: 2, - - // background setting function - // 'transparent' sets the background `layout.paper_color` - // 'opaque' blends bg color with white ensuring an opaque background - // or any other custom function of gd - setBackground: 'transparent', - - // URL to topojson files used in geo charts - topojsonURL: 'https://cdn.plot.ly/', - - // Mapbox access token (required to plot mapbox trace types) - // If using an Mapbox Atlas server, set this option to '', - // so that plotly.js won't attempt to authenticate to the public Mapbox server. - mapboxAccessToken: null, - - // Turn all console logging on or off (errors will be thrown) - // This should ONLY be set via Plotly.setPlotConfig - logging: false, - - // Set global transform to be applied to all traces with no - // specification needed - globalTransforms: [] -}; - -},{}],184:[function(require,module,exports){ -/** -* Copyright 2012-2017, Plotly, Inc. -* All rights reserved. -* -* This source code is licensed under the MIT license found in the -* LICENSE file in the root directory of this source tree. -*/ - -'use strict'; - -var fxAttrs = require('../components/fx/attributes'); - -module.exports = { - type: { - valType: 'enumerated', - role: 'info', - values: [], // listed dynamically - dflt: 'scatter' - }, - visible: { - valType: 'enumerated', - values: [true, false, 'legendonly'], - role: 'info', - dflt: true, - description: [ - 'Determines whether or not this trace is visible.', - 'If *legendonly*, the trace is not drawn,', - 'but can appear as a legend item', - '(provided that the legend itself is visible).' - ].join(' ') - }, - showlegend: { - valType: 'boolean', - role: 'info', - dflt: true, - description: [ - 'Determines whether or not an item corresponding to this', - 'trace is shown in the legend.' - ].join(' ') - }, - legendgroup: { - valType: 'string', - role: 'info', - dflt: '', - description: [ - 'Sets the legend group for this trace.', - 'Traces part of the same legend group hide/show at the same time', - 'when toggling legend items.' - ].join(' ') - }, - opacity: { - valType: 'number', - role: 'style', - min: 0, - max: 1, - dflt: 1, - description: 'Sets the opacity of the trace.' - }, - name: { - valType: 'string', - role: 'info', - description: [ - 'Sets the trace name.', - 'The trace name appear as the legend item and on hover.' - ].join(' ') - }, - uid: { - valType: 'string', - role: 'info', - dflt: '' - }, - ids: { - valType: 'data_array', - description: [ - 'Assigns id labels to each datum.', - 'These ids for object constancy of data points during animation.' - ].join(' ') - }, - customdata: { - valType: 'data_array', - description: [ - 'Assigns extra data each datum.', - 'This may be useful when listening to hover, click and selection events.', - 'Note that, *scatter* traces also appends customdata items in the markers', - 'DOM elements' - ].join(' ') - }, - hoverinfo: { - valType: 'flaglist', - role: 'info', - flags: ['x', 'y', 'z', 'text', 'name'], - extras: ['all', 'none', 'skip'], - arrayOk: true, - dflt: 'all', - description: [ - 'Determines which trace information appear on hover.', - 'If `none` or `skip` are set, no information is displayed upon hovering.', - 'But, if `none` is set, click and hover events are still fired.' - ].join(' ') - }, - hoverlabel: fxAttrs.hoverlabel, - stream: { - token: { - valType: 'string', - noBlank: true, - strict: true, - role: 'info', - description: [ - 'The stream id number links a data trace on a plot with a stream.', - 'See https://plot.ly/settings for more details.' - ].join(' ') - }, - maxpoints: { - valType: 'number', - min: 0, - max: 10000, - dflt: 500, - role: 'info', - description: [ - 'Sets the maximum number of points to keep on the plots from an', - 'incoming stream.', - 'If `maxpoints` is set to *50*, only the newest 50 points will', - 'be displayed on the plot.' - ].join(' ') - } - } -}; - -},{"../components/fx/attributes":174}],185:[function(require,module,exports){ -/** -* Copyright 2012-2017, Plotly, Inc. -* All rights reserved. -* -* This source code is licensed under the MIT license found in the -* LICENSE file in the root directory of this source tree. -*/ - -'use strict'; - - -module.exports = { - family: { - valType: 'string', - role: 'style', - noBlank: true, - strict: true, - description: [ - 'HTML font family - the typeface that will be applied by the web browser.', - 'The web browser will only be able to apply a font if it is available on the system', - 'which it operates. Provide multiple font families, separated by commas, to indicate', - 'the preference in which to apply fonts if they aren\'t available on the system.', - 'The plotly service (at https://plot.ly or on-premise) generates images on a server,', - 'where only a select number of', - 'fonts are installed and supported.', - 'These include *Arial*, *Balto*, *Courier New*, *Droid Sans*,, *Droid Serif*,', - '*Droid Sans Mono*, *Gravitas One*, *Old Standard TT*, *Open Sans*, *Overpass*,', - '*PT Sans Narrow*, *Raleway*, *Times New Roman*.' - ].join(' ') - }, - size: { - valType: 'number', - role: 'style', - min: 1 - }, - color: { - valType: 'color', - role: 'style' - } -}; - -},{}],186:[function(require,module,exports){ -/** -* Copyright 2012-2017, Plotly, Inc. -* All rights reserved. -* -* This source code is licensed under the MIT license found in the -* LICENSE file in the root directory of this source tree. -*/ - - -'use strict'; - -var Loggers = require('./lib/loggers'); -var noop = require('./lib/noop'); -var pushUnique = require('./lib/push_unique'); -var basePlotAttributes = require('./plots/attributes'); - -exports.modules = {}; -exports.allCategories = {}; -exports.allTypes = []; -exports.subplotsRegistry = {}; -exports.transformsRegistry = {}; -exports.componentsRegistry = {}; -exports.layoutArrayContainers = []; -exports.layoutArrayRegexes = []; - -/** - * register a module as the handler for a trace type - * - * @param {object} _module the module that will handle plotting this trace type - * @param {string} thisType - * @param {array of strings} categoriesIn all the categories this type is in, - * tested by calls: traceIs(trace, oneCategory) - * @param {object} meta meta information about the trace type - */ -exports.register = function(_module, thisType, categoriesIn, meta) { - if(exports.modules[thisType]) { - Loggers.log('Type ' + thisType + ' already registered'); - return; - } - - var categoryObj = {}; - for(var i = 0; i < categoriesIn.length; i++) { - categoryObj[categoriesIn[i]] = true; - exports.allCategories[categoriesIn[i]] = true; - } - - exports.modules[thisType] = { - _module: _module, - categories: categoryObj - }; - - if(meta && Object.keys(meta).length) { - exports.modules[thisType].meta = meta; - } - - exports.allTypes.push(thisType); -}; - -/** - * register a subplot type - * - * @param {object} _module subplot module: - * - * @param {string or array of strings} attr - * attribute name in traces and layout - * @param {string or array of strings} idRoot - * root of id (setting the possible value for attrName) - * @param {object} attributes - * attribute(s) for traces of this subplot type - * - * In trace objects `attr` is the object key taking a valid `id` as value - * (the set of all valid ids is generated below and stored in idRegex). - * - * In the layout object, a or several valid `attr` name(s) can be keys linked - * to a nested attribute objects - * (the set of all valid attr names is generated below and stored in attrRegex). - */ -exports.registerSubplot = function(_module) { - var plotType = _module.name; - - if(exports.subplotsRegistry[plotType]) { - Loggers.log('Plot type ' + plotType + ' already registered.'); - return; - } - - // relayout array handling will look for component module methods with this - // name and won't find them because this is a subplot module... but that - // should be fine, it will just fall back on redrawing the plot. - findArrayRegexps(_module); - - // not sure what's best for the 'cartesian' type at this point - exports.subplotsRegistry[plotType] = _module; -}; - -exports.registerComponent = function(_module) { - var name = _module.name; - - exports.componentsRegistry[name] = _module; - - if(_module.layoutAttributes) { - if(_module.layoutAttributes._isLinkedToArray) { - pushUnique(exports.layoutArrayContainers, name); - } - findArrayRegexps(_module); - } -}; - -function findArrayRegexps(_module) { - if(_module.layoutAttributes) { - var arrayAttrRegexps = _module.layoutAttributes._arrayAttrRegexps; - if(arrayAttrRegexps) { - for(var i = 0; i < arrayAttrRegexps.length; i++) { - pushUnique(exports.layoutArrayRegexes, arrayAttrRegexps[i]); - } - } - } -} - -/** - * Get registered module using trace object or trace type - * - * @param {object||string} trace - * trace object with prop 'type' or trace type as a string - * @return {object} - * module object corresponding to trace type - */ -exports.getModule = function(trace) { - if(trace.r !== undefined) { - Loggers.warn('Tried to put a polar trace ' + - 'on an incompatible graph of cartesian ' + - 'data. Ignoring this dataset.', trace - ); - return false; - } - - var _module = exports.modules[getTraceType(trace)]; - if(!_module) return false; - return _module._module; -}; - -/** - * Determine if this trace type is in a given category - * - * @param {object||string} traceType - * a trace (object) or trace type (string) - * @param {string} category - * category in question - * @return {boolean} - */ -exports.traceIs = function(traceType, category) { - traceType = getTraceType(traceType); - - // old plot.ly workspace hack, nothing to see here - if(traceType === 'various') return false; - - var _module = exports.modules[traceType]; - - if(!_module) { - if(traceType && traceType !== 'area') { - Loggers.log('Unrecognized trace type ' + traceType + '.'); - } - - _module = exports.modules[basePlotAttributes.type.dflt]; - } - - return !!_module.categories[category]; -}; - -/** - * Determine if this trace has a transform of the given type and return - * array of matching indices. - * - * @param {object} data - * a trace object (member of data or fullData) - * @param {string} type - * type of trace to test - * @return {array} - * array of matching indices. If none found, returns [] - */ -exports.getTransformIndices = function(data, type) { - var indices = []; - var transforms = data.transforms || []; - for(var i = 0; i < transforms.length; i++) { - if(transforms[i].type === type) { - indices.push(i); - } - } - return indices; -}; - -/** - * Determine if this trace has a transform of the given type - * - * @param {object} data - * a trace object (member of data or fullData) - * @param {string} type - * type of trace to test - * @return {boolean} - */ -exports.hasTransform = function(data, type) { - var transforms = data.transforms || []; - for(var i = 0; i < transforms.length; i++) { - if(transforms[i].type === type) { - return true; - } - } - return false; - -}; - -/** - * Retrieve component module method. Falls back on noop if either the - * module or the method is missing, so the result can always be safely called - * - * @param {string} name - * name of component (as declared in component module) - * @param {string} method - * name of component module method - * @return {function} - */ -exports.getComponentMethod = function(name, method) { - var _module = exports.componentsRegistry[name]; - - if(!_module) return noop; - return _module[method] || noop; -}; - -function getTraceType(traceType) { - if(typeof traceType === 'object') traceType = traceType.type; - return traceType; -} - -},{"./lib/loggers":178,"./lib/noop":180,"./lib/push_unique":181,"./plots/attributes":184}],187:[function(require,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; }; - -},{}],188:[function(require,module,exports){ -(function (process){ -/** - * 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. - */ - -'use strict'; - -if (process.env.NODE_ENV !== 'production') { - var invariant = require('fbjs/lib/invariant'); - var warning = require('fbjs/lib/warning'); - var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); - var loggedTypeFailures = {}; -} - -/** - * Assert that the values match with the type specs. - * Error messages are memorized and will only be shown once. - * - * @param {object} typeSpecs Map of name to a ReactPropType - * @param {object} values Runtime values that need to be type-checked - * @param {string} location e.g. "prop", "context", "child context" - * @param {string} componentName Name of the component for error messages. - * @param {?Function} getStack Returns the component stack. - * @private - */ -function checkPropTypes(typeSpecs, values, location, componentName, getStack) { - if (process.env.NODE_ENV !== 'production') { - for (var typeSpecName in typeSpecs) { - if (typeSpecs.hasOwnProperty(typeSpecName)) { - var error; - // Prop type validation may throw. In case they do, we don't want to - // fail the render phase where it didn't fail before. So we log it. - // After these have been cleaned up, we'll let them throw. - try { - // This is intentionally an invariant that gets caught. It's the same - // behavior as without this statement except with a better message. - invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName); - error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); - } catch (ex) { - error = ex; - } - warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error); - if (error instanceof Error && !(error.message in loggedTypeFailures)) { - // Only monitor this failure once because there tends to be a lot of the - // same error. - loggedTypeFailures[error.message] = true; - - var stack = getStack ? getStack() : ''; - - warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); - } - } - } - } -} - -module.exports = checkPropTypes; - -}).call(this,require('_process')) -},{"./lib/ReactPropTypesSecret":193,"_process":187,"fbjs/lib/invariant":6,"fbjs/lib/warning":7}],189:[function(require,module,exports){ -/** - * 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. - */ - -'use strict'; - -// React 15.5 references this module, and assumes PropTypes are still callable in production. -// Therefore we re-export development-only version with all the PropTypes checks here. -// However if one is migrating to the `prop-types` npm library, they will go through the -// `index.js` entry point, and it will branch depending on the environment. -var factory = require('./factoryWithTypeCheckers'); -module.exports = function(isValidElement) { - // It is still allowed in 15.5. - var throwOnDirectAccess = false; - return factory(isValidElement, throwOnDirectAccess); -}; - -},{"./factoryWithTypeCheckers":191}],190:[function(require,module,exports){ -/** - * 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. - */ - -'use strict'; - -var emptyFunction = require('fbjs/lib/emptyFunction'); -var invariant = require('fbjs/lib/invariant'); -var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); - -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 - }; - - ReactPropTypes.checkPropTypes = emptyFunction; - ReactPropTypes.PropTypes = ReactPropTypes; - - return ReactPropTypes; -}; - -},{"./lib/ReactPropTypesSecret":193,"fbjs/lib/emptyFunction":4,"fbjs/lib/invariant":6}],191:[function(require,module,exports){ -(function (process){ -/** - * 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. - */ - -'use strict'; - -var emptyFunction = require('fbjs/lib/emptyFunction'); -var invariant = require('fbjs/lib/invariant'); -var warning = require('fbjs/lib/warning'); - -var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret'); -var checkPropTypes = require('./checkPropTypes'); - -module.exports = function(isValidElement, throwOnDirectAccess) { - /* global Symbol */ - var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. - - /** - * Returns the iterator method function contained on the iterable object. - * - * Be sure to invoke the function with the iterable as context: - * - * var iteratorFn = getIteratorFn(myIterable); - * if (iteratorFn) { - * var iterator = iteratorFn.call(myIterable); - * ... - * } - * - * @param {?object} maybeIterable - * @return {?function} - */ - function getIteratorFn(maybeIterable) { - var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); - if (typeof iteratorFn === 'function') { - return iteratorFn; - } - } - - /** - * Collection of methods that allow declaration and validation of props that are - * supplied to React components. Example usage: - * - * var Props = require('ReactPropTypes'); - * var MyArticle = React.createClass({ - * propTypes: { - * // An optional string prop named "description". - * description: Props.string, - * - * // A required enum prop named "category". - * category: Props.oneOf(['News','Photos']).isRequired, - * - * // A prop named "dialog" that requires an instance of Dialog. - * dialog: Props.instanceOf(Dialog).isRequired - * }, - * render: function() { ... } - * }); - * - * A more formal specification of how these methods are used: - * - * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) - * decl := ReactPropTypes.{type}(.isRequired)? - * - * Each and every declaration produces a function with the same signature. This - * allows the creation of custom validation functions. For example: - * - * var MyLink = React.createClass({ - * propTypes: { - * // An optional string or URI prop named "href". - * href: function(props, propName, componentName) { - * var propValue = props[propName]; - * if (propValue != null && typeof propValue !== 'string' && - * !(propValue instanceof URI)) { - * return new Error( - * 'Expected a string or an URI for ' + propName + ' in ' + - * componentName - * ); - * } - * } - * }, - * render: function() {...} - * }); - * - * @internal - */ - - var ANONYMOUS = '<>'; - - // Important! - // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. - var ReactPropTypes = { - array: createPrimitiveTypeChecker('array'), - bool: createPrimitiveTypeChecker('boolean'), - func: createPrimitiveTypeChecker('function'), - number: createPrimitiveTypeChecker('number'), - object: createPrimitiveTypeChecker('object'), - string: createPrimitiveTypeChecker('string'), - symbol: createPrimitiveTypeChecker('symbol'), - - any: createAnyTypeChecker(), - arrayOf: createArrayOfTypeChecker, - element: createElementTypeChecker(), - instanceOf: createInstanceTypeChecker, - node: createNodeChecker(), - objectOf: createObjectOfTypeChecker, - oneOf: createEnumTypeChecker, - oneOfType: createUnionTypeChecker, - shape: createShapeTypeChecker - }; - - /** - * inlined Object.is polyfill to avoid requiring consumers ship their own - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - */ - /*eslint-disable no-self-compare*/ - function is(x, y) { - // SameValue algorithm - if (x === y) { - // Steps 1-5, 7-10 - // Steps 6.b-6.e: +0 != -0 - return x !== 0 || 1 / x === 1 / y; - } else { - // Step 6.a: NaN == NaN - return x !== x && y !== y; - } - } - /*eslint-enable no-self-compare*/ - - /** - * We use an Error-like object for backward compatibility as people may call - * PropTypes directly and inspect their output. However, we don't use real - * Errors anymore. We don't inspect their stack anyway, and creating them - * is prohibitively expensive if they are created too often, such as what - * happens in oneOfType() for any type before the one that matched. - */ - function PropTypeError(message) { - this.message = message; - this.stack = ''; - } - // Make `instanceof Error` still work for returned errors. - PropTypeError.prototype = Error.prototype; - - function createChainableTypeChecker(validate) { - if (process.env.NODE_ENV !== 'production') { - var manualPropTypeCallCache = {}; - var manualPropTypeWarningCount = 0; - } - function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { - componentName = componentName || ANONYMOUS; - propFullName = propFullName || propName; - - if (secret !== ReactPropTypesSecret) { - if (throwOnDirectAccess) { - // New behavior only for users of `prop-types` package - 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' - ); - } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') { - // Old behavior for people using React.PropTypes - var cacheKey = componentName + ':' + propName; - if ( - !manualPropTypeCallCache[cacheKey] && - // Avoid spamming the console because they are often not actionable except for lib authors - manualPropTypeWarningCount < 3 - ) { - warning( - false, - 'You are manually calling a React.PropTypes validation ' + - 'function for the `%s` prop on `%s`. This is deprecated ' + - 'and will throw in the standalone `prop-types` package. ' + - 'You may be seeing this warning due to a third-party PropTypes ' + - 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', - propFullName, - componentName - ); - manualPropTypeCallCache[cacheKey] = true; - manualPropTypeWarningCount++; - } - } - } - if (props[propName] == null) { - if (isRequired) { - if (props[propName] === null) { - return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); - } - return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); - } - return null; - } else { - return validate(props, propName, componentName, location, propFullName); - } - } - - var chainedCheckType = checkType.bind(null, false); - chainedCheckType.isRequired = checkType.bind(null, true); - - return chainedCheckType; - } - - function createPrimitiveTypeChecker(expectedType) { - function validate(props, propName, componentName, location, propFullName, secret) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== expectedType) { - // `propValue` being instance of, say, date/regexp, pass the 'object' - // check, but we can offer a more precise error message here rather than - // 'of type `object`'. - var preciseType = getPreciseType(propValue); - - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createAnyTypeChecker() { - return createChainableTypeChecker(emptyFunction.thatReturnsNull); - } - - function createArrayOfTypeChecker(typeChecker) { - function validate(props, propName, componentName, location, propFullName) { - if (typeof typeChecker !== 'function') { - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); - } - var propValue = props[propName]; - if (!Array.isArray(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); - } - for (var i = 0; i < propValue.length; i++) { - var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createElementTypeChecker() { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - if (!isValidElement(propValue)) { - var propType = getPropType(propValue); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createInstanceTypeChecker(expectedClass) { - function validate(props, propName, componentName, location, propFullName) { - if (!(props[propName] instanceof expectedClass)) { - var expectedClassName = expectedClass.name || ANONYMOUS; - var actualClassName = getClassName(props[propName]); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createEnumTypeChecker(expectedValues) { - if (!Array.isArray(expectedValues)) { - process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; - return emptyFunction.thatReturnsNull; - } - - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - for (var i = 0; i < expectedValues.length; i++) { - if (is(propValue, expectedValues[i])) { - return null; - } - } - - var valuesString = JSON.stringify(expectedValues); - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); - } - return createChainableTypeChecker(validate); - } - - function createObjectOfTypeChecker(typeChecker) { - function validate(props, propName, componentName, location, propFullName) { - if (typeof typeChecker !== 'function') { - return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); - } - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); - } - for (var key in propValue) { - if (propValue.hasOwnProperty(key)) { - var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error instanceof Error) { - return error; - } - } - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createUnionTypeChecker(arrayOfTypeCheckers) { - if (!Array.isArray(arrayOfTypeCheckers)) { - process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; - return emptyFunction.thatReturnsNull; - } - - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - if (typeof checker !== 'function') { - warning( - false, - 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' + - 'received %s at index %s.', - getPostfixForTypeWarning(checker), - i - ); - return emptyFunction.thatReturnsNull; - } - } - - function validate(props, propName, componentName, location, propFullName) { - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { - var checker = arrayOfTypeCheckers[i]; - if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { - return null; - } - } - - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); - } - return createChainableTypeChecker(validate); - } - - function createNodeChecker() { - function validate(props, propName, componentName, location, propFullName) { - if (!isNode(props[propName])) { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); - } - return null; - } - return createChainableTypeChecker(validate); - } - - function createShapeTypeChecker(shapeTypes) { - function validate(props, propName, componentName, location, propFullName) { - var propValue = props[propName]; - var propType = getPropType(propValue); - if (propType !== 'object') { - return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); - } - for (var key in shapeTypes) { - var checker = shapeTypes[key]; - if (!checker) { - continue; - } - var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); - if (error) { - return error; - } - } - return null; - } - return createChainableTypeChecker(validate); - } - - function isNode(propValue) { - switch (typeof propValue) { - case 'number': - case 'string': - case 'undefined': - return true; - case 'boolean': - return !propValue; - case 'object': - if (Array.isArray(propValue)) { - return propValue.every(isNode); - } - if (propValue === null || isValidElement(propValue)) { - return true; - } - - var iteratorFn = getIteratorFn(propValue); - if (iteratorFn) { - var iterator = iteratorFn.call(propValue); - var step; - if (iteratorFn !== propValue.entries) { - while (!(step = iterator.next()).done) { - if (!isNode(step.value)) { - return false; - } - } - } else { - // Iterator will provide entry [k,v] tuples rather than values. - while (!(step = iterator.next()).done) { - var entry = step.value; - if (entry) { - if (!isNode(entry[1])) { - return false; - } - } - } - } - } else { - return false; - } - - return true; - default: - return false; - } - } - - function isSymbol(propType, propValue) { - // Native Symbol. - if (propType === 'symbol') { - return true; - } - - // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' - if (propValue['@@toStringTag'] === 'Symbol') { - return true; - } - - // Fallback for non-spec compliant Symbols which are polyfilled. - if (typeof Symbol === 'function' && propValue instanceof Symbol) { - return true; - } - - return false; - } - - // Equivalent of `typeof` but with special handling for array and regexp. - 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 (isSymbol(propType, propValue)) { - return 'symbol'; - } - return propType; - } - - // This handles more types than `getPropType`. Only used for error messages. - // See `createPrimitiveTypeChecker`. - function getPreciseType(propValue) { - if (typeof propValue === 'undefined' || propValue === null) { - return '' + propValue; - } - var propType = getPropType(propValue); - if (propType === 'object') { - if (propValue instanceof Date) { - return 'date'; - } else if (propValue instanceof RegExp) { - return 'regexp'; - } - } - return propType; - } - - // Returns a string that is postfixed to a warning about an invalid type. - // For example, "undefined" or "of type array" - function getPostfixForTypeWarning(value) { - var type = getPreciseType(value); - switch (type) { - case 'array': - case 'object': - return 'an ' + type; - case 'boolean': - case 'date': - case 'regexp': - return 'a ' + type; - default: - return type; - } - } - - // Returns class name of the object, if any. - function getClassName(propValue) { - if (!propValue.constructor || !propValue.constructor.name) { - return ANONYMOUS; - } - return propValue.constructor.name; - } - - ReactPropTypes.checkPropTypes = checkPropTypes; - ReactPropTypes.PropTypes = ReactPropTypes; - - return ReactPropTypes; -}; - -}).call(this,require('_process')) -},{"./checkPropTypes":188,"./lib/ReactPropTypesSecret":193,"_process":187,"fbjs/lib/emptyFunction":4,"fbjs/lib/invariant":6,"fbjs/lib/warning":7}],192:[function(require,module,exports){ -(function (process){ -/** - * 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. - */ - -if (process.env.NODE_ENV !== 'production') { - 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 = require('./factoryWithThrowingShims')(); -} - -}).call(this,require('_process')) -},{"./factoryWithThrowingShims":190,"./factoryWithTypeCheckers":191,"_process":187}],193:[function(require,module,exports){ -/** - * 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. - */ - -'use strict'; - -var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - -module.exports = ReactPropTypesSecret; - -},{}],194:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.AlphaPicker = 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; }; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _common = require('../common'); - -var _AlphaPointer = require('./AlphaPointer'); - -var _AlphaPointer2 = _interopRequireDefault(_AlphaPointer); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var AlphaPicker = exports.AlphaPicker = function AlphaPicker(_ref) { - var rgb = _ref.rgb, - hsl = _ref.hsl, - width = _ref.width, - height = _ref.height, - onChange = _ref.onChange, - direction = _ref.direction, - style = _ref.style, - renderers = _ref.renderers, - pointer = _ref.pointer, - _ref$className = _ref.className, - className = _ref$className === undefined ? '' : _ref$className; - - var styles = (0, _reactcss2.default)({ - 'default': { - picker: { - position: 'relative', - width: width, - height: height - }, - alpha: { - radius: '2px', - style: style - } - } - }); - - return _react2.default.createElement( - 'div', - { style: styles.picker, className: 'alpha-picker ' + className }, - _react2.default.createElement(_common.Alpha, _extends({}, styles.alpha, { - rgb: rgb, - hsl: hsl, - pointer: pointer, - renderers: renderers, - onChange: onChange, - direction: direction - })) - ); -}; - -AlphaPicker.defaultProps = { - width: '316px', - height: '16px', - direction: 'horizontal', - pointer: _AlphaPointer2.default -}; - -exports.default = (0, _common.ColorWrap)(AlphaPicker); -},{"../common":212,"./AlphaPointer":195,"react":269,"reactcss":274}],195:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.AlphaPointer = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var AlphaPointer = exports.AlphaPointer = function AlphaPointer(_ref) { - var direction = _ref.direction; - - var styles = (0, _reactcss2.default)({ - 'default': { - picker: { - width: '18px', - height: '18px', - borderRadius: '50%', - transform: 'translate(-9px, -1px)', - backgroundColor: 'rgb(248, 248, 248)', - boxShadow: '0 1px 4px 0 rgba(0, 0, 0, 0.37)' - } - }, - 'vertical': { - picker: { - transform: 'translate(-3px, -9px)' - } - } - }, { vertical: direction === 'vertical' }); - - return _react2.default.createElement('div', { style: styles.picker }); -}; - -exports.default = AlphaPointer; -},{"react":269,"reactcss":274}],196:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Block = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _color = require('../../helpers/color'); - -var _color2 = _interopRequireDefault(_color); - -var _common = require('../common'); - -var _BlockSwatches = require('./BlockSwatches'); - -var _BlockSwatches2 = _interopRequireDefault(_BlockSwatches); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var Block = exports.Block = function Block(_ref) { - var onChange = _ref.onChange, - onSwatchHover = _ref.onSwatchHover, - hex = _ref.hex, - colors = _ref.colors, - width = _ref.width, - triangle = _ref.triangle, - _ref$className = _ref.className, - className = _ref$className === undefined ? '' : _ref$className; - - var transparent = hex === 'transparent'; - var handleChange = function handleChange(hexCode, e) { - _color2.default.isValidHex(hexCode) && onChange({ - hex: hexCode, - source: 'hex' - }, e); - }; - - var styles = (0, _reactcss2.default)({ - 'default': { - card: { - width: width, - background: '#fff', - boxShadow: '0 1px rgba(0,0,0,.1)', - borderRadius: '6px', - position: 'relative' - }, - head: { - height: '110px', - background: hex, - borderRadius: '6px 6px 0 0', - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - position: 'relative' - }, - body: { - padding: '10px' - }, - label: { - fontSize: '18px', - color: transparent ? 'rgba(0,0,0,0.4)' : '#fff', - position: 'relative' - }, - triangle: { - width: '0px', - height: '0px', - borderStyle: 'solid', - borderWidth: '0 10px 10px 10px', - borderColor: 'transparent transparent ' + hex + ' transparent', - position: 'absolute', - top: '-10px', - left: '50%', - marginLeft: '-10px' - }, - input: { - width: '100%', - fontSize: '12px', - color: '#666', - border: '0px', - outline: 'none', - height: '22px', - boxShadow: 'inset 0 0 0 1px #ddd', - borderRadius: '4px', - padding: '0 7px', - boxSizing: 'border-box' - } - }, - 'hide-triangle': { - triangle: { - display: 'none' - } - } - }, { 'hide-triangle': triangle === 'hide' }); - - return _react2.default.createElement( - 'div', - { style: styles.card, className: 'block-picker ' + className }, - _react2.default.createElement('div', { style: styles.triangle }), - _react2.default.createElement( - 'div', - { style: styles.head }, - transparent && _react2.default.createElement(_common.Checkboard, { borderRadius: '6px 6px 0 0' }), - _react2.default.createElement( - 'div', - { style: styles.label }, - hex - ) - ), - _react2.default.createElement( - 'div', - { style: styles.body }, - _react2.default.createElement(_BlockSwatches2.default, { colors: colors, onClick: handleChange, onSwatchHover: onSwatchHover }), - _react2.default.createElement(_common.EditableInput, { - style: { input: styles.input }, - value: hex, - onChange: handleChange - }) - ) - ); -}; - -Block.propTypes = { - width: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), - colors: _propTypes2.default.arrayOf(_propTypes2.default.string), - triangle: _propTypes2.default.oneOf(['top', 'hide']) -}; - -Block.defaultProps = { - width: 170, - colors: ['#D9E3F0', '#F47373', '#697689', '#37D67A', '#2CCCE4', '#555555', '#dce775', '#ff8a65', '#ba68c8'], - triangle: 'top' -}; - -exports.default = (0, _common.ColorWrap)(Block); -},{"../../helpers/color":240,"../common":212,"./BlockSwatches":197,"prop-types":192,"react":269,"reactcss":274}],197:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.BlockSwatches = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _map = require('lodash/map'); - -var _map2 = _interopRequireDefault(_map); - -var _common = require('../common'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var BlockSwatches = exports.BlockSwatches = function BlockSwatches(_ref) { - var colors = _ref.colors, - onClick = _ref.onClick, - onSwatchHover = _ref.onSwatchHover; - - var styles = (0, _reactcss2.default)({ - 'default': { - swatches: { - marginRight: '-10px' - }, - swatch: { - width: '22px', - height: '22px', - float: 'left', - marginRight: '10px', - marginBottom: '10px', - borderRadius: '4px' - }, - clear: { - clear: 'both' - } - } - }); - - return _react2.default.createElement( - 'div', - { style: styles.swatches }, - (0, _map2.default)(colors, function (c) { - return _react2.default.createElement(_common.Swatch, { - key: c, - color: c, - style: styles.swatch, - onClick: onClick, - onHover: onSwatchHover, - focusStyle: { - boxShadow: '0 0 4px ' + c - } - }); - }), - _react2.default.createElement('div', { style: styles.clear }) - ); -}; - -exports.default = BlockSwatches; -},{"../common":212,"lodash/map":163,"react":269,"reactcss":274}],198:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Chrome = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _common = require('../common'); - -var _ChromeFields = require('./ChromeFields'); - -var _ChromeFields2 = _interopRequireDefault(_ChromeFields); - -var _ChromePointer = require('./ChromePointer'); - -var _ChromePointer2 = _interopRequireDefault(_ChromePointer); - -var _ChromePointerCircle = require('./ChromePointerCircle'); - -var _ChromePointerCircle2 = _interopRequireDefault(_ChromePointerCircle); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var Chrome = exports.Chrome = function Chrome(_ref) { - var onChange = _ref.onChange, - disableAlpha = _ref.disableAlpha, - rgb = _ref.rgb, - hsl = _ref.hsl, - hsv = _ref.hsv, - hex = _ref.hex, - renderers = _ref.renderers, - _ref$className = _ref.className, - className = _ref$className === undefined ? '' : _ref$className; - - var styles = (0, _reactcss2.default)({ - 'default': { - picker: { - background: '#fff', - borderRadius: '2px', - boxShadow: '0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)', - boxSizing: 'initial', - width: '225px', - fontFamily: 'Menlo' - }, - saturation: { - width: '100%', - paddingBottom: '55%', - position: 'relative', - borderRadius: '2px 2px 0 0', - overflow: 'hidden' - }, - Saturation: { - radius: '2px 2px 0 0' - }, - body: { - padding: '16px 16px 12px' - }, - controls: { - display: 'flex' - }, - color: { - width: '32px' - }, - swatch: { - marginTop: '6px', - width: '16px', - height: '16px', - borderRadius: '8px', - position: 'relative', - overflow: 'hidden' - }, - active: { - absolute: '0px 0px 0px 0px', - borderRadius: '8px', - boxShadow: 'inset 0 0 0 1px rgba(0,0,0,.1)', - background: 'rgba(' + rgb.r + ', ' + rgb.g + ', ' + rgb.b + ', ' + rgb.a + ')', - zIndex: '2' - }, - toggles: { - flex: '1' - }, - hue: { - height: '10px', - position: 'relative', - marginBottom: '8px' - }, - Hue: { - radius: '2px' - }, - alpha: { - height: '10px', - position: 'relative' - }, - Alpha: { - radius: '2px' - } - }, - 'disableAlpha': { - color: { - width: '22px' - }, - alpha: { - display: 'none' - }, - hue: { - marginBottom: '0px' - }, - swatch: { - width: '10px', - height: '10px', - marginTop: '0px' - } - } - }, { disableAlpha: disableAlpha }); - - return _react2.default.createElement( - 'div', - { style: styles.picker, className: 'chrome-picker ' + className }, - _react2.default.createElement( - 'div', - { style: styles.saturation }, - _react2.default.createElement(_common.Saturation, { - style: styles.Saturation, - hsl: hsl, - hsv: hsv, - pointer: _ChromePointerCircle2.default, - onChange: onChange - }) - ), - _react2.default.createElement( - 'div', - { style: styles.body }, - _react2.default.createElement( - 'div', - { style: styles.controls, className: 'flexbox-fix' }, - _react2.default.createElement( - 'div', - { style: styles.color }, - _react2.default.createElement( - 'div', - { style: styles.swatch }, - _react2.default.createElement('div', { style: styles.active }), - _react2.default.createElement(_common.Checkboard, { renderers: renderers }) - ) - ), - _react2.default.createElement( - 'div', - { style: styles.toggles }, - _react2.default.createElement( - 'div', - { style: styles.hue }, - _react2.default.createElement(_common.Hue, { - style: styles.Hue, - hsl: hsl, - pointer: _ChromePointer2.default, - onChange: onChange - }) - ), - _react2.default.createElement( - 'div', - { style: styles.alpha }, - _react2.default.createElement(_common.Alpha, { - style: styles.Alpha, - rgb: rgb, - hsl: hsl, - pointer: _ChromePointer2.default, - renderers: renderers, - onChange: onChange - }) - ) - ) - ), - _react2.default.createElement(_ChromeFields2.default, { - rgb: rgb, - hsl: hsl, - hex: hex, - onChange: onChange, - disableAlpha: disableAlpha - }) - ) - ); -}; - -Chrome.propTypes = { - disableAlpha: _propTypes2.default.bool -}; - -Chrome.defaultProps = { - disableAlpha: false -}; - -exports.default = (0, _common.ColorWrap)(Chrome); -},{"../common":212,"./ChromeFields":199,"./ChromePointer":200,"./ChromePointerCircle":201,"prop-types":192,"react":269,"reactcss":274}],199:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ChromeFields = undefined; - -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 = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _color = require('../../helpers/color'); - -var _color2 = _interopRequireDefault(_color); - -var _common = require('../common'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } /* eslint-disable react/no-did-mount-set-state, no-param-reassign */ - -var ChromeFields = exports.ChromeFields = function (_React$Component) { - _inherits(ChromeFields, _React$Component); - - function ChromeFields() { - var _ref; - - var _temp, _this, _ret; - - _classCallCheck(this, ChromeFields); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ChromeFields.__proto__ || Object.getPrototypeOf(ChromeFields)).call.apply(_ref, [this].concat(args))), _this), _this.state = { - view: '' - }, _this.toggleViews = function () { - if (_this.state.view === 'hex') { - _this.setState({ view: 'rgb' }); - } else if (_this.state.view === 'rgb') { - _this.setState({ view: 'hsl' }); - } else if (_this.state.view === 'hsl') { - if (_this.props.hsl.a === 1) { - _this.setState({ view: 'hex' }); - } else { - _this.setState({ view: 'rgb' }); - } - } - }, _this.handleChange = function (data, e) { - if (data.hex) { - _color2.default.isValidHex(data.hex) && _this.props.onChange({ - hex: data.hex, - source: 'hex' - }, e); - } else if (data.r || data.g || data.b) { - _this.props.onChange({ - r: data.r || _this.props.rgb.r, - g: data.g || _this.props.rgb.g, - b: data.b || _this.props.rgb.b, - source: 'rgb' - }, e); - } else if (data.a) { - if (data.a < 0) { - data.a = 0; - } else if (data.a > 1) { - data.a = 1; - } - - _this.props.onChange({ - h: _this.props.hsl.h, - s: _this.props.hsl.s, - l: _this.props.hsl.l, - a: Math.round(data.a * 100) / 100, - source: 'rgb' - }, e); - } else if (data.h || data.s || data.l) { - _this.props.onChange({ - h: data.h || _this.props.hsl.h, - s: data.s && data.s || _this.props.hsl.s, - l: data.l && data.l || _this.props.hsl.l, - source: 'hsl' - }, e); - } - }, _this.showHighlight = function (e) { - e.target.style.background = '#eee'; - }, _this.hideHighlight = function (e) { - e.target.style.background = 'transparent'; - }, _temp), _possibleConstructorReturn(_this, _ret); - } - - _createClass(ChromeFields, [{ - key: 'componentDidMount', - value: function componentDidMount() { - if (this.props.hsl.a === 1 && this.state.view !== 'hex') { - this.setState({ view: 'hex' }); - } else if (this.state.view !== 'rgb' && this.state.view !== 'hsl') { - this.setState({ view: 'rgb' }); - } - } - }, { - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - if (nextProps.hsl.a !== 1 && this.state.view === 'hex') { - this.setState({ view: 'rgb' }); - } - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - var styles = (0, _reactcss2.default)({ - 'default': { - wrap: { - paddingTop: '16px', - display: 'flex' - }, - fields: { - flex: '1', - display: 'flex', - marginLeft: '-6px' - }, - field: { - paddingLeft: '6px', - width: '100%' - }, - alpha: { - paddingLeft: '6px', - width: '100%' - }, - toggle: { - width: '32px', - textAlign: 'right', - position: 'relative' - }, - icon: { - marginRight: '-4px', - marginTop: '12px', - cursor: 'pointer', - position: 'relative' - }, - iconHighlight: { - position: 'absolute', - width: '24px', - height: '28px', - background: '#eee', - borderRadius: '4px', - top: '10px', - left: '12px', - display: 'none' - }, - input: { - fontSize: '11px', - color: '#333', - width: '100%', - borderRadius: '2px', - border: 'none', - boxShadow: 'inset 0 0 0 1px #dadada', - height: '21px', - textAlign: 'center' - }, - label: { - textTransform: 'uppercase', - fontSize: '11px', - lineHeight: '11px', - color: '#969696', - textAlign: 'center', - display: 'block', - marginTop: '12px' - }, - svg: { - width: '24px', - height: '24px', - border: '1px transparent solid', - borderRadius: '5px' - } - }, - 'disableAlpha': { - alpha: { - display: 'none' - } - } - }, this.props, this.state); - - var fields = void 0; - if (this.state.view === 'hex') { - fields = _react2.default.createElement( - 'div', - { style: styles.fields, className: 'flexbox-fix' }, - _react2.default.createElement( - 'div', - { style: styles.field }, - _react2.default.createElement(_common.EditableInput, { - style: { input: styles.input, label: styles.label }, - label: 'hex', value: this.props.hex, - onChange: this.handleChange - }) - ) - ); - } else if (this.state.view === 'rgb') { - fields = _react2.default.createElement( - 'div', - { style: styles.fields, className: 'flexbox-fix' }, - _react2.default.createElement( - 'div', - { style: styles.field }, - _react2.default.createElement(_common.EditableInput, { - style: { input: styles.input, label: styles.label }, - label: 'r', - value: this.props.rgb.r, - onChange: this.handleChange - }) - ), - _react2.default.createElement( - 'div', - { style: styles.field }, - _react2.default.createElement(_common.EditableInput, { - style: { input: styles.input, label: styles.label }, - label: 'g', - value: this.props.rgb.g, - onChange: this.handleChange - }) - ), - _react2.default.createElement( - 'div', - { style: styles.field }, - _react2.default.createElement(_common.EditableInput, { - style: { input: styles.input, label: styles.label }, - label: 'b', - value: this.props.rgb.b, - onChange: this.handleChange - }) - ), - _react2.default.createElement( - 'div', - { style: styles.alpha }, - _react2.default.createElement(_common.EditableInput, { - style: { input: styles.input, label: styles.label }, - label: 'a', - value: this.props.rgb.a, - arrowOffset: 0.01, - onChange: this.handleChange - }) - ) - ); - } else if (this.state.view === 'hsl') { - fields = _react2.default.createElement( - 'div', - { style: styles.fields, className: 'flexbox-fix' }, - _react2.default.createElement( - 'div', - { style: styles.field }, - _react2.default.createElement(_common.EditableInput, { - style: { input: styles.input, label: styles.label }, - label: 'h', - value: Math.round(this.props.hsl.h), - onChange: this.handleChange - }) - ), - _react2.default.createElement( - 'div', - { style: styles.field }, - _react2.default.createElement(_common.EditableInput, { - style: { input: styles.input, label: styles.label }, - label: 's', - value: Math.round(this.props.hsl.s * 100) + '%', - onChange: this.handleChange - }) - ), - _react2.default.createElement( - 'div', - { style: styles.field }, - _react2.default.createElement(_common.EditableInput, { - style: { input: styles.input, label: styles.label }, - label: 'l', - value: Math.round(this.props.hsl.l * 100) + '%', - onChange: this.handleChange - }) - ), - _react2.default.createElement( - 'div', - { style: styles.alpha }, - _react2.default.createElement(_common.EditableInput, { - style: { input: styles.input, label: styles.label }, - label: 'a', - value: this.props.hsl.a, - arrowOffset: 0.01, - onChange: this.handleChange - }) - ) - ); - } - - return _react2.default.createElement( - 'div', - { style: styles.wrap, className: 'flexbox-fix' }, - fields, - _react2.default.createElement( - 'div', - { style: styles.toggle }, - _react2.default.createElement( - 'div', - { style: styles.icon, onClick: this.toggleViews, ref: function ref(icon) { - return _this2.icon = icon; - } }, - _react2.default.createElement( - 'svg', - { - style: styles.svg, - viewBox: '0 0 24 24', - onMouseOver: this.showHighlight, - onMouseEnter: this.showHighlight, - onMouseOut: this.hideHighlight - }, - _react2.default.createElement('path', { - ref: function ref(iconUp) { - return _this2.iconUp = iconUp; - }, - fill: '#333', - d: 'M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z' - }), - _react2.default.createElement('path', { - ref: function ref(iconDown) { - return _this2.iconDown = iconDown; - }, - fill: '#333', - d: 'M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15Z' - }) - ) - ) - ) - ); - } - }]); - - return ChromeFields; -}(_react2.default.Component); - -exports.default = ChromeFields; -},{"../../helpers/color":240,"../common":212,"react":269,"reactcss":274}],200:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ChromePointer = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var ChromePointer = exports.ChromePointer = function ChromePointer() { - var styles = (0, _reactcss2.default)({ - 'default': { - picker: { - width: '12px', - height: '12px', - borderRadius: '6px', - transform: 'translate(-6px, -1px)', - backgroundColor: 'rgb(248, 248, 248)', - boxShadow: '0 1px 4px 0 rgba(0, 0, 0, 0.37)' - } - } - }); - - return _react2.default.createElement('div', { style: styles.picker }); -}; - -exports.default = ChromePointer; -},{"react":269,"reactcss":274}],201:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ChromePointerCircle = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var ChromePointerCircle = exports.ChromePointerCircle = function ChromePointerCircle() { - var styles = (0, _reactcss2.default)({ - 'default': { - picker: { - width: '12px', - height: '12px', - borderRadius: '6px', - boxShadow: 'inset 0 0 0 1px #fff', - transform: 'translate(-6px, -6px)' - } - } - }); - - return _react2.default.createElement('div', { style: styles.picker }); -}; - -exports.default = ChromePointerCircle; -},{"react":269,"reactcss":274}],202:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Circle = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _map = require('lodash/map'); - -var _map2 = _interopRequireDefault(_map); - -var _materialColors = require('material-colors'); - -var material = _interopRequireWildcard(_materialColors); - -var _common = require('../common'); - -var _CircleSwatch = require('./CircleSwatch'); - -var _CircleSwatch2 = _interopRequireDefault(_CircleSwatch); - -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 }; } - -var Circle = exports.Circle = function Circle(_ref) { - var width = _ref.width, - onChange = _ref.onChange, - onSwatchHover = _ref.onSwatchHover, - colors = _ref.colors, - hex = _ref.hex, - circleSize = _ref.circleSize, - circleSpacing = _ref.circleSpacing, - _ref$className = _ref.className, - className = _ref$className === undefined ? '' : _ref$className; - - var styles = (0, _reactcss2.default)({ - 'default': { - card: { - width: width, - display: 'flex', - flexWrap: 'wrap', - marginRight: -circleSpacing, - marginBottom: -circleSpacing - } - } - }); - - var handleChange = function handleChange(hexCode, e) { - return onChange({ hex: hexCode, source: 'hex' }, e); - }; - - return _react2.default.createElement( - 'div', - { style: styles.card, className: 'circle-picker ' + className }, - (0, _map2.default)(colors, function (c) { - return _react2.default.createElement(_CircleSwatch2.default, { - key: c, - color: c, - onClick: handleChange, - onSwatchHover: onSwatchHover, - active: hex === c.toLowerCase(), - circleSize: circleSize, - circleSpacing: circleSpacing - }); - }) - ); -}; - -Circle.propTypes = { - width: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), - circleSize: _propTypes2.default.number, - circleSpacing: _propTypes2.default.number -}; - -Circle.defaultProps = { - width: 252, - circleSize: 28, - circleSpacing: 14, - colors: [material.red['500'], material.pink['500'], material.purple['500'], material.deepPurple['500'], material.indigo['500'], material.blue['500'], material.lightBlue['500'], material.cyan['500'], material.teal['500'], material.green['500'], material.lightGreen['500'], material.lime['500'], material.yellow['500'], material.amber['500'], material.orange['500'], material.deepOrange['500'], material.brown['500'], material.blueGrey['500']] -}; - -exports.default = (0, _common.ColorWrap)(Circle); -},{"../common":212,"./CircleSwatch":203,"lodash/map":163,"material-colors":172,"prop-types":192,"react":269,"reactcss":274}],203:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.CircleSwatch = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _common = require('../common'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var CircleSwatch = exports.CircleSwatch = function CircleSwatch(_ref) { - var color = _ref.color, - onClick = _ref.onClick, - onSwatchHover = _ref.onSwatchHover, - hover = _ref.hover, - active = _ref.active, - circleSize = _ref.circleSize, - circleSpacing = _ref.circleSpacing; - - var styles = (0, _reactcss2.default)({ - 'default': { - swatch: { - width: circleSize, - height: circleSize, - marginRight: circleSpacing, - marginBottom: circleSpacing, - transform: 'scale(1)', - transition: '100ms transform ease' - }, - Swatch: { - borderRadius: '50%', - background: 'transparent', - boxShadow: 'inset 0 0 0 ' + circleSize / 2 + 'px ' + color, - transition: '100ms box-shadow ease' - } - }, - 'hover': { - swatch: { - transform: 'scale(1.2)' - } - }, - 'active': { - Swatch: { - boxShadow: 'inset 0 0 0 3px ' + color - } - } - }, { hover: hover, active: active }); - - return _react2.default.createElement( - 'div', - { style: styles.swatch }, - _react2.default.createElement(_common.Swatch, { - style: styles.Swatch, - color: color, - onClick: onClick, - onHover: onSwatchHover, - focusStyle: { boxShadow: styles.Swatch.boxShadow + ', 0 0 5px ' + color } - }) - ); -}; - -CircleSwatch.defaultProps = { - circleSize: 28, - circleSpacing: 14 -}; - -exports.default = (0, _reactcss.handleHover)(CircleSwatch); -},{"../common":212,"react":269,"reactcss":274}],204:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Alpha = 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; }; - -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 = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _alpha = require('../../helpers/alpha'); - -var alpha = _interopRequireWildcard(_alpha); - -var _Checkboard = require('./Checkboard'); - -var _Checkboard2 = _interopRequireDefault(_Checkboard); - -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 _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 Alpha = exports.Alpha = function (_ref) { - _inherits(Alpha, _ref); - - function Alpha() { - var _ref2; - - var _temp, _this, _ret; - - _classCallCheck(this, Alpha); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref2 = Alpha.__proto__ || Object.getPrototypeOf(Alpha)).call.apply(_ref2, [this].concat(args))), _this), _this.handleChange = function (e, skip) { - var change = alpha.calculateChange(e, skip, _this.props, _this.container); - change && _this.props.onChange && _this.props.onChange(change, e); - }, _this.handleMouseDown = function (e) { - _this.handleChange(e, true); - window.addEventListener('mousemove', _this.handleChange); - window.addEventListener('mouseup', _this.handleMouseUp); - }, _this.handleMouseUp = function () { - _this.unbindEventListeners(); - }, _this.unbindEventListeners = function () { - window.removeEventListener('mousemove', _this.handleChange); - window.removeEventListener('mouseup', _this.handleMouseUp); - }, _temp), _possibleConstructorReturn(_this, _ret); - } - - _createClass(Alpha, [{ - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.unbindEventListeners(); - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - var rgb = this.props.rgb; - var styles = (0, _reactcss2.default)({ - 'default': { - alpha: { - absolute: '0px 0px 0px 0px', - borderRadius: this.props.radius - }, - checkboard: { - absolute: '0px 0px 0px 0px', - overflow: 'hidden' - }, - gradient: { - absolute: '0px 0px 0px 0px', - background: 'linear-gradient(to right, rgba(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ', 0) 0%,\n rgba(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ', 1) 100%)', - boxShadow: this.props.shadow, - borderRadius: this.props.radius - }, - container: { - position: 'relative', - height: '100%', - margin: '0 3px' - }, - pointer: { - position: 'absolute', - left: rgb.a * 100 + '%' - }, - slider: { - width: '4px', - borderRadius: '1px', - height: '8px', - boxShadow: '0 0 2px rgba(0, 0, 0, .6)', - background: '#fff', - marginTop: '1px', - transform: 'translateX(-2px)' - } - }, - 'vertical': { - gradient: { - background: 'linear-gradient(to bottom, rgba(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ', 0) 0%,\n rgba(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ', 1) 100%)' - }, - pointer: { - left: 0, - top: rgb.a * 100 + '%' - } - }, - 'overwrite': _extends({}, this.props.style) - }, { - vertical: this.props.direction === 'vertical', - overwrite: true - }); - - return _react2.default.createElement( - 'div', - { style: styles.alpha }, - _react2.default.createElement( - 'div', - { style: styles.checkboard }, - _react2.default.createElement(_Checkboard2.default, { renderers: this.props.renderers }) - ), - _react2.default.createElement('div', { style: styles.gradient }), - _react2.default.createElement( - 'div', - { - style: styles.container, - ref: function ref(container) { - return _this2.container = container; - }, - onMouseDown: this.handleMouseDown, - onTouchMove: this.handleChange, - onTouchStart: this.handleChange - }, - _react2.default.createElement( - 'div', - { style: styles.pointer }, - this.props.pointer ? _react2.default.createElement(this.props.pointer, this.props) : _react2.default.createElement('div', { style: styles.slider }) - ) - ) - ); - } - }]); - - return Alpha; -}(_react.PureComponent || _react.Component); - -exports.default = Alpha; -},{"../../helpers/alpha":238,"./Checkboard":205,"react":269,"reactcss":274}],205:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Checkboard = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _checkboard = require('../../helpers/checkboard'); - -var checkboard = _interopRequireWildcard(_checkboard); - -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 }; } - -var Checkboard = exports.Checkboard = function Checkboard(_ref) { - var white = _ref.white, - grey = _ref.grey, - size = _ref.size, - renderers = _ref.renderers, - borderRadius = _ref.borderRadius, - boxShadow = _ref.boxShadow; - - var styles = (0, _reactcss2.default)({ - 'default': { - grid: { - borderRadius: borderRadius, - boxShadow: boxShadow, - absolute: '0px 0px 0px 0px', - background: 'url(' + checkboard.get(white, grey, size, renderers.canvas) + ') center left' - } - } - }); - - return _react2.default.createElement('div', { style: styles.grid }); -}; - -Checkboard.defaultProps = { - size: 8, - white: 'transparent', - grey: 'rgba(0,0,0,.08)', - renderers: {} -}; - -exports.default = Checkboard; -},{"../../helpers/checkboard":239,"react":269,"reactcss":274}],206:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ColorWrap = 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; }; - -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 = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _debounce = require('lodash/debounce'); - -var _debounce2 = _interopRequireDefault(_debounce); - -var _color = require('../../helpers/color'); - -var _color2 = _interopRequireDefault(_color); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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 ColorWrap = exports.ColorWrap = function ColorWrap(Picker) { - var ColorPicker = function (_ref) { - _inherits(ColorPicker, _ref); - - function ColorPicker(props) { - _classCallCheck(this, ColorPicker); - - var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this)); - - _this.handleChange = function (data, event) { - var isValidColor = _color2.default.simpleCheckForValidColor(data); - if (isValidColor) { - var colors = _color2.default.toState(data, data.h || _this.state.oldHue); - _this.setState(colors); - _this.props.onChangeComplete && _this.debounce(_this.props.onChangeComplete, colors, event); - _this.props.onChange && _this.props.onChange(colors, event); - } - }; - - _this.handleSwatchHover = function (data, event) { - var isValidColor = _color2.default.simpleCheckForValidColor(data); - if (isValidColor) { - var colors = _color2.default.toState(data, data.h || _this.state.oldHue); - _this.setState(colors); - _this.props.onSwatchHover && _this.props.onSwatchHover(colors, event); - } - }; - - _this.state = _extends({}, _color2.default.toState(props.color, 0)); - - _this.debounce = (0, _debounce2.default)(function (fn, data, event) { - fn(data, event); - }, 100); - return _this; - } - - _createClass(ColorPicker, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - this.setState(_extends({}, _color2.default.toState(nextProps.color, this.state.oldHue))); - } - }, { - key: 'render', - value: function render() { - var optionalEvents = {}; - if (this.props.onSwatchHover) { - optionalEvents.onSwatchHover = this.handleSwatchHover; - } - - return _react2.default.createElement(Picker, _extends({}, this.props, this.state, { - onChange: this.handleChange - }, optionalEvents)); - } - }]); - - return ColorPicker; - }(_react.PureComponent || _react.Component); - - ColorPicker.propTypes = _extends({}, Picker.propTypes); - - ColorPicker.defaultProps = _extends({}, Picker.defaultProps, { - color: { - h: 250, - s: 0.50, - l: 0.20, - a: 1 - } - }); - - return ColorPicker; -}; - -exports.default = ColorWrap; -},{"../../helpers/color":240,"lodash/debounce":141,"react":269}],207:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.EditableInput = undefined; - -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 = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _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 EditableInput = exports.EditableInput = function (_ref) { - _inherits(EditableInput, _ref); - - function EditableInput(props) { - _classCallCheck(this, EditableInput); - - var _this = _possibleConstructorReturn(this, (EditableInput.__proto__ || Object.getPrototypeOf(EditableInput)).call(this)); - - _this.handleBlur = function () { - if (_this.state.blurValue) { - _this.setState({ value: _this.state.blurValue, blurValue: null }); - } - }; - - _this.handleChange = function (e) { - if (_this.props.label) { - _this.props.onChange && _this.props.onChange(_defineProperty({}, _this.props.label, e.target.value), e); - } else { - _this.props.onChange && _this.props.onChange(e.target.value, e); - } - - _this.setState({ value: e.target.value }); - }; - - _this.handleKeyDown = function (e) { - // In case `e.target.value` is a percentage remove the `%` character - // and update accordingly with a percentage - // https://github.com/casesandberg/react-color/issues/383 - var stringValue = String(e.target.value); - var isPercentage = stringValue.indexOf('%') > -1; - var number = Number(stringValue.replace(/%/g, '')); - if (!isNaN(number)) { - var amount = _this.props.arrowOffset || 1; - - // Up - if (e.keyCode === 38) { - if (_this.props.label !== null) { - _this.props.onChange && _this.props.onChange(_defineProperty({}, _this.props.label, number + amount), e); - } else { - _this.props.onChange && _this.props.onChange(number + amount, e); - } - - if (isPercentage) { - _this.setState({ value: number + amount + '%' }); - } else { - _this.setState({ value: number + amount }); - } - } - - // Down - if (e.keyCode === 40) { - if (_this.props.label !== null) { - _this.props.onChange && _this.props.onChange(_defineProperty({}, _this.props.label, number - amount), e); - } else { - _this.props.onChange && _this.props.onChange(number - amount, e); - } - - if (isPercentage) { - _this.setState({ value: number - amount + '%' }); - } else { - _this.setState({ value: number - amount }); - } - } - } - }; - - _this.handleDrag = function (e) { - if (_this.props.dragLabel) { - var newValue = Math.round(_this.props.value + e.movementX); - if (newValue >= 0 && newValue <= _this.props.dragMax) { - _this.props.onChange && _this.props.onChange(_defineProperty({}, _this.props.label, newValue), e); - } - } - }; - - _this.handleMouseDown = function (e) { - if (_this.props.dragLabel) { - e.preventDefault(); - _this.handleDrag(e); - window.addEventListener('mousemove', _this.handleDrag); - window.addEventListener('mouseup', _this.handleMouseUp); - } - }; - - _this.handleMouseUp = function () { - _this.unbindEventListeners(); - }; - - _this.unbindEventListeners = function () { - window.removeEventListener('mousemove', _this.handleDrag); - window.removeEventListener('mouseup', _this.handleMouseUp); - }; - - _this.state = { - value: String(props.value).toUpperCase(), - blurValue: String(props.value).toUpperCase() - }; - return _this; - } - - _createClass(EditableInput, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(nextProps) { - var input = this.input; - if (nextProps.value !== this.state.value) { - if (input === document.activeElement) { - this.setState({ blurValue: String(nextProps.value).toUpperCase() }); - } else { - this.setState({ value: String(nextProps.value).toUpperCase() }); - } - } - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.unbindEventListeners(); - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - var styles = (0, _reactcss2.default)({ - 'default': { - wrap: { - position: 'relative' - } - }, - 'user-override': { - wrap: this.props.style && this.props.style.wrap ? this.props.style.wrap : {}, - input: this.props.style && this.props.style.input ? this.props.style.input : {}, - label: this.props.style && this.props.style.label ? this.props.style.label : {} - }, - 'dragLabel-true': { - label: { - cursor: 'ew-resize' - } - } - }, { - 'user-override': true - }, this.props); - - return _react2.default.createElement( - 'div', - { style: styles.wrap }, - _react2.default.createElement('input', { - style: styles.input, - ref: function ref(input) { - return _this2.input = input; - }, - value: this.state.value, - onKeyDown: this.handleKeyDown, - onChange: this.handleChange, - onBlur: this.handleBlur, - placeholder: this.props.placeholder, - spellCheck: 'false' - }), - this.props.label ? _react2.default.createElement( - 'span', - { style: styles.label, onMouseDown: this.handleMouseDown }, - this.props.label - ) : null - ); - } - }]); - - return EditableInput; -}(_react.PureComponent || _react.Component); - -exports.default = EditableInput; -},{"react":269,"reactcss":274}],208:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Hue = undefined; - -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 = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _hue = require('../../helpers/hue'); - -var hue = _interopRequireWildcard(_hue); - -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 _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 Hue = exports.Hue = function (_ref) { - _inherits(Hue, _ref); - - function Hue() { - var _ref2; - - var _temp, _this, _ret; - - _classCallCheck(this, Hue); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref2 = Hue.__proto__ || Object.getPrototypeOf(Hue)).call.apply(_ref2, [this].concat(args))), _this), _this.handleChange = function (e, skip) { - var change = hue.calculateChange(e, skip, _this.props, _this.container); - change && _this.props.onChange && _this.props.onChange(change, e); - }, _this.handleMouseDown = function (e) { - _this.handleChange(e, true); - window.addEventListener('mousemove', _this.handleChange); - window.addEventListener('mouseup', _this.handleMouseUp); - }, _this.handleMouseUp = function () { - _this.unbindEventListeners(); - }, _temp), _possibleConstructorReturn(_this, _ret); - } - - _createClass(Hue, [{ - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.unbindEventListeners(); - } - }, { - key: 'unbindEventListeners', - value: function unbindEventListeners() { - window.removeEventListener('mousemove', this.handleChange); - window.removeEventListener('mouseup', this.handleMouseUp); - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - var _props$direction = this.props.direction, - direction = _props$direction === undefined ? 'horizontal' : _props$direction; - - - var styles = (0, _reactcss2.default)({ - 'default': { - hue: { - absolute: '0px 0px 0px 0px', - borderRadius: this.props.radius, - boxShadow: this.props.shadow - }, - container: { - padding: '0 2px', - position: 'relative', - height: '100%' - }, - pointer: { - position: 'absolute', - left: this.props.hsl.h * 100 / 360 + '%' - }, - slider: { - marginTop: '1px', - width: '4px', - borderRadius: '1px', - height: '8px', - boxShadow: '0 0 2px rgba(0, 0, 0, .6)', - background: '#fff', - transform: 'translateX(-2px)' - } - }, - 'vertical': { - pointer: { - left: '0px', - top: -(this.props.hsl.h * 100 / 360) + 100 + '%' - } - } - }, { vertical: direction === 'vertical' }); - - return _react2.default.createElement( - 'div', - { style: styles.hue }, - _react2.default.createElement( - 'div', - { - className: 'hue-' + direction, - style: styles.container, - ref: function ref(container) { - return _this2.container = container; - }, - onMouseDown: this.handleMouseDown, - onTouchMove: this.handleChange, - onTouchStart: this.handleChange - }, - _react2.default.createElement( - 'style', - null, - '\n .hue-horizontal {\n background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0\n 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to right, #f00 0%, #ff0\n 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n\n .hue-vertical {\n background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%,\n #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%,\n #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n ' - ), - _react2.default.createElement( - 'div', - { style: styles.pointer }, - this.props.pointer ? _react2.default.createElement(this.props.pointer, this.props) : _react2.default.createElement('div', { style: styles.slider }) - ) - ) - ); - } - }]); - - return Hue; -}(_react.PureComponent || _react.Component); - -exports.default = Hue; -},{"../../helpers/hue":241,"react":269,"reactcss":274}],209:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Raised = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var Raised = exports.Raised = function Raised(_ref) { - var zDepth = _ref.zDepth, - radius = _ref.radius, - background = _ref.background, - children = _ref.children; - - var styles = (0, _reactcss2.default)({ - 'default': { - wrap: { - position: 'relative', - display: 'inline-block' - }, - content: { - position: 'relative' - }, - bg: { - absolute: '0px 0px 0px 0px', - boxShadow: '0 ' + zDepth + 'px ' + zDepth * 4 + 'px rgba(0,0,0,.24)', - borderRadius: radius, - background: background - } - }, - 'zDepth-0': { - bg: { - boxShadow: 'none' - } - }, - - 'zDepth-1': { - bg: { - boxShadow: '0 2px 10px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.16)' - } - }, - 'zDepth-2': { - bg: { - boxShadow: '0 6px 20px rgba(0,0,0,.19), 0 8px 17px rgba(0,0,0,.2)' - } - }, - 'zDepth-3': { - bg: { - boxShadow: '0 17px 50px rgba(0,0,0,.19), 0 12px 15px rgba(0,0,0,.24)' - } - }, - 'zDepth-4': { - bg: { - boxShadow: '0 25px 55px rgba(0,0,0,.21), 0 16px 28px rgba(0,0,0,.22)' - } - }, - 'zDepth-5': { - bg: { - boxShadow: '0 40px 77px rgba(0,0,0,.22), 0 27px 24px rgba(0,0,0,.2)' - } - }, - 'square': { - bg: { - borderRadius: '0' - } - }, - 'circle': { - bg: { - borderRadius: '50%' - } - } - }, { 'zDepth-1': zDepth === 1 }); - - return _react2.default.createElement( - 'div', - { style: styles.wrap }, - _react2.default.createElement('div', { style: styles.bg }), - _react2.default.createElement( - 'div', - { style: styles.content }, - children - ) - ); -}; - -Raised.propTypes = { - background: _propTypes2.default.string, - zDepth: _propTypes2.default.oneOf([0, 1, 2, 3, 4, 5]), - radius: _propTypes2.default.number -}; - -Raised.defaultProps = { - background: '#fff', - zDepth: 1, - radius: 2 -}; - -exports.default = Raised; -},{"prop-types":192,"react":269,"reactcss":274}],210:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Saturation = undefined; - -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 = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _throttle = require('lodash/throttle'); - -var _throttle2 = _interopRequireDefault(_throttle); - -var _saturation = require('../../helpers/saturation'); - -var saturation = _interopRequireWildcard(_saturation); - -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 _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 Saturation = exports.Saturation = function (_ref) { - _inherits(Saturation, _ref); - - function Saturation(props) { - _classCallCheck(this, Saturation); - - var _this = _possibleConstructorReturn(this, (Saturation.__proto__ || Object.getPrototypeOf(Saturation)).call(this, props)); - - _this.handleChange = function (e, skip) { - _this.props.onChange && _this.throttle(_this.props.onChange, saturation.calculateChange(e, skip, _this.props, _this.container), e); - }; - - _this.handleMouseDown = function (e) { - _this.handleChange(e, true); - window.addEventListener('mousemove', _this.handleChange); - window.addEventListener('mouseup', _this.handleMouseUp); - }; - - _this.handleMouseUp = function () { - _this.unbindEventListeners(); - }; - - _this.throttle = (0, _throttle2.default)(function (fn, data, e) { - fn(data, e); - }, 50); - return _this; - } - - _createClass(Saturation, [{ - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this.unbindEventListeners(); - } - }, { - key: 'unbindEventListeners', - value: function unbindEventListeners() { - window.removeEventListener('mousemove', this.handleChange); - window.removeEventListener('mouseup', this.handleMouseUp); - } - }, { - key: 'render', - value: function render() { - var _this2 = this; - - var _ref2 = this.props.style || {}, - color = _ref2.color, - white = _ref2.white, - black = _ref2.black, - pointer = _ref2.pointer, - circle = _ref2.circle; - - var styles = (0, _reactcss2.default)({ - 'default': { - color: { - absolute: '0px 0px 0px 0px', - background: 'hsl(' + this.props.hsl.h + ',100%, 50%)', - borderRadius: this.props.radius - }, - white: { - absolute: '0px 0px 0px 0px', - borderRadius: this.props.radius - }, - black: { - absolute: '0px 0px 0px 0px', - boxShadow: this.props.shadow, - borderRadius: this.props.radius - }, - pointer: { - position: 'absolute', - top: -(this.props.hsv.v * 100) + 100 + '%', - left: this.props.hsv.s * 100 + '%', - cursor: 'default' - }, - circle: { - width: '4px', - height: '4px', - boxShadow: '0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),\n 0 0 1px 2px rgba(0,0,0,.4)', - borderRadius: '50%', - cursor: 'hand', - transform: 'translate(-2px, -2px)' - } - }, - 'custom': { - color: color, - white: white, - black: black, - pointer: pointer, - circle: circle - } - }, { 'custom': !!this.props.style }); - - return _react2.default.createElement( - 'div', - { - style: styles.color, - ref: function ref(container) { - return _this2.container = container; - }, - onMouseDown: this.handleMouseDown, - onTouchMove: this.handleChange, - onTouchStart: this.handleChange - }, - _react2.default.createElement( - 'style', - null, - '\n .saturation-white {\n background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));\n background: linear-gradient(to right, #fff, rgba(255,255,255,0));\n }\n .saturation-black {\n background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));\n background: linear-gradient(to top, #000, rgba(0,0,0,0));\n }\n ' - ), - _react2.default.createElement( - 'div', - { style: styles.white, className: 'saturation-white' }, - _react2.default.createElement('div', { style: styles.black, className: 'saturation-black' }), - _react2.default.createElement( - 'div', - { style: styles.pointer }, - this.props.pointer ? _react2.default.createElement(this.props.pointer, this.props) : _react2.default.createElement('div', { style: styles.circle }) - ) - ) - ); - } - }]); - - return Saturation; -}(_react.PureComponent || _react.Component); - -exports.default = Saturation; -},{"../../helpers/saturation":243,"lodash/throttle":169,"react":269,"reactcss":274}],211:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Swatch = 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; }; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _interaction = require('../../helpers/interaction'); - -var _ = require('./'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var ENTER = 13; - -var Swatch = exports.Swatch = function Swatch(_ref) { - var color = _ref.color, - style = _ref.style, - _ref$onClick = _ref.onClick, - onClick = _ref$onClick === undefined ? function () {} : _ref$onClick, - onHover = _ref.onHover, - _ref$title = _ref.title, - title = _ref$title === undefined ? color : _ref$title, - children = _ref.children, - focus = _ref.focus, - _ref$focusStyle = _ref.focusStyle, - focusStyle = _ref$focusStyle === undefined ? {} : _ref$focusStyle; - - var transparent = color === 'transparent'; - var styles = (0, _reactcss2.default)({ - default: { - swatch: _extends({ - background: color, - height: '100%', - width: '100%', - cursor: 'pointer', - position: 'relative', - outline: 'none' - }, style, focus ? focusStyle : {}) - } - }); - - var handleClick = function handleClick(e) { - return onClick(color, e); - }; - var handleKeyDown = function handleKeyDown(e) { - return e.keyCode === ENTER && onClick(color, e); - }; - var handleHover = function handleHover(e) { - return onHover(color, e); - }; - - var optionalEvents = {}; - if (onHover) { - optionalEvents.onMouseOver = handleHover; - } - - return _react2.default.createElement( - 'div', - _extends({ - style: styles.swatch, - onClick: handleClick, - title: title, - tabIndex: 0, - onKeyDown: handleKeyDown - }, optionalEvents), - children, - transparent && _react2.default.createElement(_.Checkboard, { - borderRadius: styles.swatch.borderRadius, - boxShadow: 'inset 0 0 0 1px rgba(0,0,0,0.1)' - }) - ); -}; - -exports.default = (0, _interaction.handleFocus)(Swatch); -},{"../../helpers/interaction":242,"./":212,"react":269,"reactcss":274}],212:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _Alpha = require('./Alpha'); - -Object.defineProperty(exports, 'Alpha', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Alpha).default; - } -}); - -var _Checkboard = require('./Checkboard'); - -Object.defineProperty(exports, 'Checkboard', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Checkboard).default; - } -}); - -var _EditableInput = require('./EditableInput'); - -Object.defineProperty(exports, 'EditableInput', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_EditableInput).default; - } -}); - -var _Hue = require('./Hue'); - -Object.defineProperty(exports, 'Hue', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Hue).default; - } -}); - -var _Raised = require('./Raised'); - -Object.defineProperty(exports, 'Raised', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Raised).default; - } -}); - -var _Saturation = require('./Saturation'); - -Object.defineProperty(exports, 'Saturation', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Saturation).default; - } -}); - -var _ColorWrap = require('./ColorWrap'); - -Object.defineProperty(exports, 'ColorWrap', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_ColorWrap).default; - } -}); - -var _Swatch = require('./Swatch'); - -Object.defineProperty(exports, 'Swatch', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Swatch).default; - } -}); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -},{"./Alpha":204,"./Checkboard":205,"./ColorWrap":206,"./EditableInput":207,"./Hue":208,"./Raised":209,"./Saturation":210,"./Swatch":211}],213:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Compact = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _map = require('lodash/map'); - -var _map2 = _interopRequireDefault(_map); - -var _color = require('../../helpers/color'); - -var _color2 = _interopRequireDefault(_color); - -var _common = require('../common'); - -var _CompactColor = require('./CompactColor'); - -var _CompactColor2 = _interopRequireDefault(_CompactColor); - -var _CompactFields = require('./CompactFields'); - -var _CompactFields2 = _interopRequireDefault(_CompactFields); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var Compact = exports.Compact = function Compact(_ref) { - var onChange = _ref.onChange, - onSwatchHover = _ref.onSwatchHover, - colors = _ref.colors, - hex = _ref.hex, - rgb = _ref.rgb, - _ref$className = _ref.className, - className = _ref$className === undefined ? '' : _ref$className; - - var styles = (0, _reactcss2.default)({ - 'default': { - Compact: { - background: '#f6f6f6', - radius: '4px' - }, - compact: { - paddingTop: '5px', - paddingLeft: '5px', - boxSizing: 'initial', - width: '240px' - }, - clear: { - clear: 'both' - } - } - }); - - var handleChange = function handleChange(data, e) { - if (data.hex) { - _color2.default.isValidHex(data.hex) && onChange({ - hex: data.hex, - source: 'hex' - }, e); - } else { - onChange(data, e); - } - }; - - return _react2.default.createElement( - _common.Raised, - { style: styles.Compact }, - _react2.default.createElement( - 'div', - { style: styles.compact, className: 'compact-picker ' + className }, - _react2.default.createElement( - 'div', - null, - (0, _map2.default)(colors, function (c) { - return _react2.default.createElement(_CompactColor2.default, { - key: c, - color: c, - active: c.toLowerCase() === hex, - onClick: handleChange, - onSwatchHover: onSwatchHover - }); - }), - _react2.default.createElement('div', { style: styles.clear }) - ), - _react2.default.createElement(_CompactFields2.default, { hex: hex, rgb: rgb, onChange: handleChange }) - ) - ); -}; - -Compact.propTypes = { - colors: _propTypes2.default.arrayOf(_propTypes2.default.string) -}; - -Compact.defaultProps = { - colors: ['#4D4D4D', '#999999', '#FFFFFF', '#F44E3B', '#FE9200', '#FCDC00', '#DBDF00', '#A4DD00', '#68CCCA', '#73D8FF', '#AEA1FF', '#FDA1FF', '#333333', '#808080', '#cccccc', '#D33115', '#E27300', '#FCC400', '#B0BC00', '#68BC00', '#16A5A5', '#009CE0', '#7B64FF', '#FA28FF', '#000000', '#666666', '#B3B3B3', '#9F0500', '#C45100', '#FB9E00', '#808900', '#194D33', '#0C797D', '#0062B1', '#653294', '#AB149E'] -}; - -exports.default = (0, _common.ColorWrap)(Compact); -},{"../../helpers/color":240,"../common":212,"./CompactColor":214,"./CompactFields":215,"lodash/map":163,"prop-types":192,"react":269,"reactcss":274}],214:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.CompactColor = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _common = require('../common'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var CompactColor = exports.CompactColor = function CompactColor(_ref) { - var color = _ref.color, - _ref$onClick = _ref.onClick, - onClick = _ref$onClick === undefined ? function () {} : _ref$onClick, - onSwatchHover = _ref.onSwatchHover, - active = _ref.active; - - var styles = (0, _reactcss2.default)({ - 'default': { - color: { - background: color, - width: '15px', - height: '15px', - float: 'left', - marginRight: '5px', - marginBottom: '5px', - position: 'relative', - cursor: 'pointer' - }, - dot: { - absolute: '5px 5px 5px 5px', - background: '#fff', - borderRadius: '50%', - opacity: '0' - } - }, - 'active': { - dot: { - opacity: '1' - } - }, - 'color-#FFFFFF': { - color: { - boxShadow: 'inset 0 0 0 1px #ddd' - }, - dot: { - background: '#000' - } - }, - 'transparent': { - dot: { - background: '#000' - } - } - }, { active: active, 'color-#FFFFFF': color === '#FFFFFF', 'transparent': color === 'transparent' }); - - return _react2.default.createElement( - _common.Swatch, - { - style: styles.color, - color: color, - onClick: onClick, - onHover: onSwatchHover, - focusStyle: { boxShadow: '0 0 4px ' + color } - }, - _react2.default.createElement('div', { style: styles.dot }) - ); -}; - -exports.default = CompactColor; -},{"../common":212,"react":269,"reactcss":274}],215:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.CompactFields = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _common = require('../common'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var CompactFields = exports.CompactFields = function CompactFields(_ref) { - var hex = _ref.hex, - rgb = _ref.rgb, - onChange = _ref.onChange; - - var styles = (0, _reactcss2.default)({ - 'default': { - fields: { - display: 'flex', - paddingBottom: '6px', - paddingRight: '5px', - position: 'relative' - }, - active: { - position: 'absolute', - top: '6px', - left: '5px', - height: '9px', - width: '9px', - background: hex - }, - HEXwrap: { - flex: '6', - position: 'relative' - }, - HEXinput: { - width: '80%', - padding: '0px', - paddingLeft: '20%', - border: 'none', - outline: 'none', - background: 'none', - fontSize: '12px', - color: '#333', - height: '16px' - }, - HEXlabel: { - display: 'none' - }, - RGBwrap: { - flex: '3', - position: 'relative' - }, - RGBinput: { - width: '70%', - padding: '0px', - paddingLeft: '30%', - border: 'none', - outline: 'none', - background: 'none', - fontSize: '12px', - color: '#333', - height: '16px' - }, - RGBlabel: { - position: 'absolute', - top: '3px', - left: '0px', - lineHeight: '16px', - textTransform: 'uppercase', - fontSize: '12px', - color: '#999' - } - } - }); - - var handleChange = function handleChange(data, e) { - if (data.r || data.g || data.b) { - onChange({ - r: data.r || rgb.r, - g: data.g || rgb.g, - b: data.b || rgb.b, - source: 'rgb' - }, e); - } else { - onChange({ - hex: data.hex, - source: 'hex' - }, e); - } - }; - - return _react2.default.createElement( - 'div', - { style: styles.fields, className: 'flexbox-fix' }, - _react2.default.createElement('div', { style: styles.active }), - _react2.default.createElement(_common.EditableInput, { - style: { wrap: styles.HEXwrap, input: styles.HEXinput, label: styles.HEXlabel }, - label: 'hex', - value: hex, - onChange: handleChange - }), - _react2.default.createElement(_common.EditableInput, { - style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, - label: 'r', - value: rgb.r, - onChange: handleChange - }), - _react2.default.createElement(_common.EditableInput, { - style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, - label: 'g', - value: rgb.g, - onChange: handleChange - }), - _react2.default.createElement(_common.EditableInput, { - style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, - label: 'b', - value: rgb.b, - onChange: handleChange - }) - ); -}; - -exports.default = CompactFields; -},{"../common":212,"react":269,"reactcss":274}],216:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Github = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _map = require('lodash/map'); - -var _map2 = _interopRequireDefault(_map); - -var _common = require('../common'); - -var _GithubSwatch = require('./GithubSwatch'); - -var _GithubSwatch2 = _interopRequireDefault(_GithubSwatch); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var Github = exports.Github = function Github(_ref) { - var width = _ref.width, - colors = _ref.colors, - onChange = _ref.onChange, - onSwatchHover = _ref.onSwatchHover, - triangle = _ref.triangle, - _ref$className = _ref.className, - className = _ref$className === undefined ? '' : _ref$className; - - var styles = (0, _reactcss2.default)({ - 'default': { - card: { - width: width, - background: '#fff', - border: '1px solid rgba(0,0,0,0.2)', - boxShadow: '0 3px 12px rgba(0,0,0,0.15)', - borderRadius: '4px', - position: 'relative', - padding: '5px', - display: 'flex', - flexWrap: 'wrap' - }, - triangle: { - position: 'absolute', - border: '7px solid transparent', - borderBottomColor: '#fff' - }, - triangleShadow: { - position: 'absolute', - border: '8px solid transparent', - borderBottomColor: 'rgba(0,0,0,0.15)' - } - }, - 'hide-triangle': { - triangle: { - display: 'none' - }, - triangleShadow: { - display: 'none' - } - }, - 'top-left-triangle': { - triangle: { - top: '-14px', - left: '10px' - }, - triangleShadow: { - top: '-16px', - left: '9px' - } - }, - 'top-right-triangle': { - triangle: { - top: '-14px', - right: '10px' - }, - triangleShadow: { - top: '-16px', - right: '9px' - } - }, - 'bottom-right-triangle': { - triangle: { - top: '35px', - right: '10px', - transform: 'rotate(180deg)' - }, - triangleShadow: { - top: '37px', - right: '9px', - transform: 'rotate(180deg)' - } - } - }, { - 'hide-triangle': triangle === 'hide', - 'top-left-triangle': triangle === 'top-left', - 'top-right-triangle': triangle === 'top-right', - 'bottom-right-triangle': triangle === 'bottom-right' - }); - - var handleChange = function handleChange(hex, e) { - return onChange({ hex: hex, source: 'hex' }, e); - }; - - return _react2.default.createElement( - 'div', - { style: styles.card, className: 'github-picker ' + className }, - _react2.default.createElement('div', { style: styles.triangleShadow }), - _react2.default.createElement('div', { style: styles.triangle }), - (0, _map2.default)(colors, function (c) { - return _react2.default.createElement(_GithubSwatch2.default, { - color: c, - key: c, - onClick: handleChange, - onSwatchHover: onSwatchHover - }); - }) - ); -}; - -Github.propTypes = { - width: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), - colors: _propTypes2.default.arrayOf(_propTypes2.default.string), - triangle: _propTypes2.default.oneOf(['hide', 'top-left', 'top-right']) -}; - -Github.defaultProps = { - width: 200, - colors: ['#B80000', '#DB3E00', '#FCCB00', '#008B02', '#006B76', '#1273DE', '#004DCF', '#5300EB', '#EB9694', '#FAD0C3', '#FEF3BD', '#C1E1C5', '#BEDADC', '#C4DEF6', '#BED3F3', '#D4C4FB'], - triangle: 'top-left' -}; - -exports.default = (0, _common.ColorWrap)(Github); -},{"../common":212,"./GithubSwatch":217,"lodash/map":163,"prop-types":192,"react":269,"reactcss":274}],217:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.GithubSwatch = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _common = require('../common'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var GithubSwatch = exports.GithubSwatch = function GithubSwatch(_ref) { - var hover = _ref.hover, - color = _ref.color, - onClick = _ref.onClick, - onSwatchHover = _ref.onSwatchHover; - - var hoverSwatch = { - position: 'relative', - zIndex: '2', - outline: '2px solid #fff', - boxShadow: '0 0 5px 2px rgba(0,0,0,0.25)' - }; - - var styles = (0, _reactcss2.default)({ - 'default': { - swatch: { - width: '25px', - height: '25px', - fontSize: '0' - } - }, - 'hover': { - swatch: hoverSwatch - } - }, { hover: hover }); - - return _react2.default.createElement( - 'div', - { style: styles.swatch }, - _react2.default.createElement(_common.Swatch, { - color: color, - onClick: onClick, - onHover: onSwatchHover, - focusStyle: hoverSwatch - }) - ); -}; - -exports.default = (0, _reactcss.handleHover)(GithubSwatch); -},{"../common":212,"react":269,"reactcss":274}],218:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.HuePicker = 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; }; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _common = require('../common'); - -var _HuePointer = require('./HuePointer'); - -var _HuePointer2 = _interopRequireDefault(_HuePointer); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var HuePicker = exports.HuePicker = function HuePicker(_ref) { - var width = _ref.width, - height = _ref.height, - onChange = _ref.onChange, - hsl = _ref.hsl, - direction = _ref.direction, - pointer = _ref.pointer, - _ref$className = _ref.className, - className = _ref$className === undefined ? '' : _ref$className; - - var styles = (0, _reactcss2.default)({ - 'default': { - picker: { - position: 'relative', - width: width, - height: height - }, - hue: { - radius: '2px' - } - } - }); - - // Overwrite to provide pure hue color - var handleChange = function handleChange(data) { - return onChange({ a: 1, h: data.h, l: 0.5, s: 1 }); - }; - - return _react2.default.createElement( - 'div', - { style: styles.picker, className: 'hue-picker ' + className }, - _react2.default.createElement(_common.Hue, _extends({}, styles.hue, { - hsl: hsl, - pointer: pointer, - onChange: handleChange, - direction: direction - })) - ); -}; - -HuePicker.defaultProps = { - width: '316px', - height: '16px', - direction: 'horizontal', - pointer: _HuePointer2.default -}; - -exports.default = (0, _common.ColorWrap)(HuePicker); -},{"../common":212,"./HuePointer":219,"react":269,"reactcss":274}],219:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.SliderPointer = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var SliderPointer = exports.SliderPointer = function SliderPointer(_ref) { - var direction = _ref.direction; - - var styles = (0, _reactcss2.default)({ - 'default': { - picker: { - width: '18px', - height: '18px', - borderRadius: '50%', - transform: 'translate(-9px, -1px)', - backgroundColor: 'rgb(248, 248, 248)', - boxShadow: '0 1px 4px 0 rgba(0, 0, 0, 0.37)' - } - }, - 'vertical': { - picker: { - transform: 'translate(-3px, -9px)' - } - } - }, { vertical: direction === 'vertical' }); - - return _react2.default.createElement('div', { style: styles.picker }); -}; - -exports.default = SliderPointer; -},{"react":269,"reactcss":274}],220:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Material = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _color = require('../../helpers/color'); - -var _color2 = _interopRequireDefault(_color); - -var _common = require('../common'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var Material = exports.Material = function Material(_ref) { - var onChange = _ref.onChange, - hex = _ref.hex, - rgb = _ref.rgb, - _ref$className = _ref.className, - className = _ref$className === undefined ? '' : _ref$className; - - var styles = (0, _reactcss2.default)({ - 'default': { - material: { - width: '98px', - height: '98px', - padding: '16px', - fontFamily: 'Roboto' - }, - HEXwrap: { - position: 'relative' - }, - HEXinput: { - width: '100%', - marginTop: '12px', - fontSize: '15px', - color: '#333', - padding: '0px', - border: '0px', - borderBottom: '2px solid ' + hex, - outline: 'none', - height: '30px' - }, - HEXlabel: { - position: 'absolute', - top: '0px', - left: '0px', - fontSize: '11px', - color: '#999999', - textTransform: 'capitalize' - }, - Hex: { - style: {} - }, - RGBwrap: { - position: 'relative' - }, - RGBinput: { - width: '100%', - marginTop: '12px', - fontSize: '15px', - color: '#333', - padding: '0px', - border: '0px', - borderBottom: '1px solid #eee', - outline: 'none', - height: '30px' - }, - RGBlabel: { - position: 'absolute', - top: '0px', - left: '0px', - fontSize: '11px', - color: '#999999', - textTransform: 'capitalize' - }, - split: { - display: 'flex', - marginRight: '-10px', - paddingTop: '11px' - }, - third: { - flex: '1', - paddingRight: '10px' - } - } - }); - - var handleChange = function handleChange(data, e) { - if (data.hex) { - _color2.default.isValidHex(data.hex) && onChange({ - hex: data.hex, - source: 'hex' - }, e); - } else if (data.r || data.g || data.b) { - onChange({ - r: data.r || rgb.r, - g: data.g || rgb.g, - b: data.b || rgb.b, - source: 'rgb' - }, e); - } - }; - - return _react2.default.createElement( - _common.Raised, - null, - _react2.default.createElement( - 'div', - { style: styles.material, className: 'material-picker ' + className }, - _react2.default.createElement(_common.EditableInput, { - style: { wrap: styles.HEXwrap, input: styles.HEXinput, label: styles.HEXlabel }, - label: 'hex', - value: hex, - onChange: handleChange - }), - _react2.default.createElement( - 'div', - { style: styles.split, className: 'flexbox-fix' }, - _react2.default.createElement( - 'div', - { style: styles.third }, - _react2.default.createElement(_common.EditableInput, { - style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, - label: 'r', value: rgb.r, - onChange: handleChange - }) - ), - _react2.default.createElement( - 'div', - { style: styles.third }, - _react2.default.createElement(_common.EditableInput, { - style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, - label: 'g', - value: rgb.g, - onChange: handleChange - }) - ), - _react2.default.createElement( - 'div', - { style: styles.third }, - _react2.default.createElement(_common.EditableInput, { - style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, - label: 'b', - value: rgb.b, - onChange: handleChange - }) - ) - ) - ) - ); -}; - -exports.default = (0, _common.ColorWrap)(Material); -},{"../../helpers/color":240,"../common":212,"react":269,"reactcss":274}],221:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Photoshop = undefined; - -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 = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _common = require('../common'); - -var _PhotoshopFields = require('./PhotoshopFields'); - -var _PhotoshopFields2 = _interopRequireDefault(_PhotoshopFields); - -var _PhotoshopPointerCircle = require('./PhotoshopPointerCircle'); - -var _PhotoshopPointerCircle2 = _interopRequireDefault(_PhotoshopPointerCircle); - -var _PhotoshopPointer = require('./PhotoshopPointer'); - -var _PhotoshopPointer2 = _interopRequireDefault(_PhotoshopPointer); - -var _PhotoshopButton = require('./PhotoshopButton'); - -var _PhotoshopButton2 = _interopRequireDefault(_PhotoshopButton); - -var _PhotoshopPreviews = require('./PhotoshopPreviews'); - -var _PhotoshopPreviews2 = _interopRequireDefault(_PhotoshopPreviews); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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 Photoshop = exports.Photoshop = function (_React$Component) { - _inherits(Photoshop, _React$Component); - - function Photoshop(props) { - _classCallCheck(this, Photoshop); - - var _this = _possibleConstructorReturn(this, (Photoshop.__proto__ || Object.getPrototypeOf(Photoshop)).call(this)); - - _this.state = { - currentColor: props.hex - }; - return _this; - } - - _createClass(Photoshop, [{ - key: 'render', - value: function render() { - var _props$className = this.props.className, - className = _props$className === undefined ? '' : _props$className; - - var styles = (0, _reactcss2.default)({ - 'default': { - picker: { - background: '#DCDCDC', - borderRadius: '4px', - boxShadow: '0 0 0 1px rgba(0,0,0,.25), 0 8px 16px rgba(0,0,0,.15)', - boxSizing: 'initial', - width: '513px' - }, - head: { - backgroundImage: 'linear-gradient(-180deg, #F0F0F0 0%, #D4D4D4 100%)', - borderBottom: '1px solid #B1B1B1', - boxShadow: 'inset 0 1px 0 0 rgba(255,255,255,.2), inset 0 -1px 0 0 rgba(0,0,0,.02)', - height: '23px', - lineHeight: '24px', - borderRadius: '4px 4px 0 0', - fontSize: '13px', - color: '#4D4D4D', - textAlign: 'center' - }, - body: { - padding: '15px 15px 0', - display: 'flex' - }, - saturation: { - width: '256px', - height: '256px', - position: 'relative', - border: '2px solid #B3B3B3', - borderBottom: '2px solid #F0F0F0', - overflow: 'hidden' - }, - hue: { - position: 'relative', - height: '256px', - width: '19px', - marginLeft: '10px', - border: '2px solid #B3B3B3', - borderBottom: '2px solid #F0F0F0' - }, - controls: { - width: '180px', - marginLeft: '10px' - }, - top: { - display: 'flex' - }, - previews: { - width: '60px' - }, - actions: { - flex: '1', - marginLeft: '20px' - } - } - }); - - return _react2.default.createElement( - 'div', - { style: styles.picker, className: 'photoshop-picker ' + className }, - _react2.default.createElement( - 'div', - { style: styles.head }, - this.props.header - ), - _react2.default.createElement( - 'div', - { style: styles.body, className: 'flexbox-fix' }, - _react2.default.createElement( - 'div', - { style: styles.saturation }, - _react2.default.createElement(_common.Saturation, { - hsl: this.props.hsl, - hsv: this.props.hsv, - pointer: _PhotoshopPointerCircle2.default, - onChange: this.props.onChange - }) - ), - _react2.default.createElement( - 'div', - { style: styles.hue }, - _react2.default.createElement(_common.Hue, { - direction: 'vertical', - hsl: this.props.hsl, - pointer: _PhotoshopPointer2.default, - onChange: this.props.onChange - }) - ), - _react2.default.createElement( - 'div', - { style: styles.controls }, - _react2.default.createElement( - 'div', - { style: styles.top, className: 'flexbox-fix' }, - _react2.default.createElement( - 'div', - { style: styles.previews }, - _react2.default.createElement(_PhotoshopPreviews2.default, { - rgb: this.props.rgb, - currentColor: this.state.currentColor - }) - ), - _react2.default.createElement( - 'div', - { style: styles.actions }, - _react2.default.createElement(_PhotoshopButton2.default, { label: 'OK', onClick: this.props.onAccept, active: true }), - _react2.default.createElement(_PhotoshopButton2.default, { label: 'Cancel', onClick: this.props.onCancel }), - _react2.default.createElement(_PhotoshopFields2.default, { - onChange: this.props.onChange, - rgb: this.props.rgb, - hsv: this.props.hsv, - hex: this.props.hex - }) - ) - ) - ) - ) - ); - } - }]); - - return Photoshop; -}(_react2.default.Component); - -Photoshop.propTypes = { - header: _propTypes2.default.string -}; - -Photoshop.defaultProps = { - header: 'Color Picker' -}; - -exports.default = (0, _common.ColorWrap)(Photoshop); -},{"../common":212,"./PhotoshopButton":222,"./PhotoshopFields":223,"./PhotoshopPointer":224,"./PhotoshopPointerCircle":225,"./PhotoshopPreviews":226,"prop-types":192,"react":269,"reactcss":274}],222:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.PhotoshopBotton = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var PhotoshopBotton = exports.PhotoshopBotton = function PhotoshopBotton(_ref) { - var onClick = _ref.onClick, - label = _ref.label, - children = _ref.children, - active = _ref.active; - - var styles = (0, _reactcss2.default)({ - 'default': { - button: { - backgroundImage: 'linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)', - border: '1px solid #878787', - borderRadius: '2px', - height: '20px', - boxShadow: '0 1px 0 0 #EAEAEA', - fontSize: '14px', - color: '#000', - lineHeight: '20px', - textAlign: 'center', - marginBottom: '10px', - cursor: 'pointer' - } - }, - 'active': { - button: { - boxShadow: '0 0 0 1px #878787' - } - } - }, { active: active }); - - return _react2.default.createElement( - 'div', - { style: styles.button, onClick: onClick }, - label || children - ); -}; - -exports.default = PhotoshopBotton; -},{"react":269,"reactcss":274}],223:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.PhotoshopPicker = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _color = require('../../helpers/color'); - -var _color2 = _interopRequireDefault(_color); - -var _common = require('../common'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var PhotoshopPicker = exports.PhotoshopPicker = function PhotoshopPicker(_ref) { - var onChange = _ref.onChange, - rgb = _ref.rgb, - hsv = _ref.hsv, - hex = _ref.hex; - - var styles = (0, _reactcss2.default)({ - 'default': { - fields: { - paddingTop: '5px', - paddingBottom: '9px', - width: '80px', - position: 'relative' - }, - divider: { - height: '5px' - }, - RGBwrap: { - position: 'relative' - }, - RGBinput: { - marginLeft: '40%', - width: '40%', - height: '18px', - border: '1px solid #888888', - boxShadow: 'inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC', - marginBottom: '5px', - fontSize: '13px', - paddingLeft: '3px', - marginRight: '10px' - }, - RGBlabel: { - left: '0px', - width: '34px', - textTransform: 'uppercase', - fontSize: '13px', - height: '18px', - lineHeight: '22px', - position: 'absolute' - }, - HEXwrap: { - position: 'relative' - }, - HEXinput: { - marginLeft: '20%', - width: '80%', - height: '18px', - border: '1px solid #888888', - boxShadow: 'inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC', - marginBottom: '6px', - fontSize: '13px', - paddingLeft: '3px' - }, - HEXlabel: { - position: 'absolute', - top: '0px', - left: '0px', - width: '14px', - textTransform: 'uppercase', - fontSize: '13px', - height: '18px', - lineHeight: '22px' - }, - fieldSymbols: { - position: 'absolute', - top: '5px', - right: '-7px', - fontSize: '13px' - }, - symbol: { - height: '20px', - lineHeight: '22px', - paddingBottom: '7px' - } - } - }); - - var handleChange = function handleChange(data, e) { - if (data['#']) { - _color2.default.isValidHex(data['#']) && onChange({ - hex: data['#'], - source: 'hex' - }, e); - } else if (data.r || data.g || data.b) { - onChange({ - r: data.r || rgb.r, - g: data.g || rgb.g, - b: data.b || rgb.b, - source: 'rgb' - }, e); - } else if (data.h || data.s || data.v) { - onChange({ - h: data.h || hsv.h, - s: data.s || hsv.s, - v: data.v || hsv.v, - source: 'hsv' - }, e); - } - }; - - return _react2.default.createElement( - 'div', - { style: styles.fields }, - _react2.default.createElement(_common.EditableInput, { - style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, - label: 'h', - value: Math.round(hsv.h), - onChange: handleChange - }), - _react2.default.createElement(_common.EditableInput, { - style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, - label: 's', - value: Math.round(hsv.s * 100), - onChange: handleChange - }), - _react2.default.createElement(_common.EditableInput, { - style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, - label: 'v', - value: Math.round(hsv.v * 100), - onChange: handleChange - }), - _react2.default.createElement('div', { style: styles.divider }), - _react2.default.createElement(_common.EditableInput, { - style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, - label: 'r', - value: rgb.r, - onChange: handleChange - }), - _react2.default.createElement(_common.EditableInput, { - style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, - label: 'g', - value: rgb.g, - onChange: handleChange - }), - _react2.default.createElement(_common.EditableInput, { - style: { wrap: styles.RGBwrap, input: styles.RGBinput, label: styles.RGBlabel }, - label: 'b', - value: rgb.b, - onChange: handleChange - }), - _react2.default.createElement('div', { style: styles.divider }), - _react2.default.createElement(_common.EditableInput, { - style: { wrap: styles.HEXwrap, input: styles.HEXinput, label: styles.HEXlabel }, - label: '#', - value: hex.replace('#', ''), - onChange: handleChange - }), - _react2.default.createElement( - 'div', - { style: styles.fieldSymbols }, - _react2.default.createElement( - 'div', - { style: styles.symbol }, - '\xB0' - ), - _react2.default.createElement( - 'div', - { style: styles.symbol }, - '%' - ), - _react2.default.createElement( - 'div', - { style: styles.symbol }, - '%' - ) - ) - ); -}; - -exports.default = PhotoshopPicker; -},{"../../helpers/color":240,"../common":212,"react":269,"reactcss":274}],224:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.PhotoshopPointerCircle = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var PhotoshopPointerCircle = exports.PhotoshopPointerCircle = function PhotoshopPointerCircle() { - var styles = (0, _reactcss2.default)({ - 'default': { - triangle: { - width: 0, - height: 0, - borderStyle: 'solid', - borderWidth: '4px 0 4px 6px', - borderColor: 'transparent transparent transparent #fff', - position: 'absolute', - top: '1px', - left: '1px' - }, - triangleBorder: { - width: 0, - height: 0, - borderStyle: 'solid', - borderWidth: '5px 0 5px 8px', - borderColor: 'transparent transparent transparent #555' - }, - - left: { - Extend: 'triangleBorder', - transform: 'translate(-13px, -4px)' - }, - leftInside: { - Extend: 'triangle', - transform: 'translate(-8px, -5px)' - }, - - right: { - Extend: 'triangleBorder', - transform: 'translate(20px, -14px) rotate(180deg)' - }, - rightInside: { - Extend: 'triangle', - transform: 'translate(-8px, -5px)' - } - } - }); - - return _react2.default.createElement( - 'div', - { style: styles.pointer }, - _react2.default.createElement( - 'div', - { style: styles.left }, - _react2.default.createElement('div', { style: styles.leftInside }) - ), - _react2.default.createElement( - 'div', - { style: styles.right }, - _react2.default.createElement('div', { style: styles.rightInside }) - ) - ); -}; - -exports.default = PhotoshopPointerCircle; -},{"react":269,"reactcss":274}],225:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.PhotoshopPointerCircle = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var PhotoshopPointerCircle = exports.PhotoshopPointerCircle = function PhotoshopPointerCircle(_ref) { - var hsl = _ref.hsl; - - var styles = (0, _reactcss2.default)({ - 'default': { - picker: { - width: '12px', - height: '12px', - borderRadius: '6px', - boxShadow: 'inset 0 0 0 1px #fff', - transform: 'translate(-6px, -6px)' - } - }, - 'black-outline': { - picker: { - boxShadow: 'inset 0 0 0 1px #000' - } - } - }, { 'black-outline': hsl.l > 0.5 }); - - return _react2.default.createElement('div', { style: styles.picker }); -}; - -exports.default = PhotoshopPointerCircle; -},{"react":269,"reactcss":274}],226:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.PhotoshopPreviews = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var PhotoshopPreviews = exports.PhotoshopPreviews = function PhotoshopPreviews(_ref) { - var rgb = _ref.rgb, - currentColor = _ref.currentColor; - - var styles = (0, _reactcss2.default)({ - 'default': { - swatches: { - border: '1px solid #B3B3B3', - borderBottom: '1px solid #F0F0F0', - marginBottom: '2px', - marginTop: '1px' - }, - new: { - height: '34px', - background: 'rgb(' + rgb.r + ',' + rgb.g + ', ' + rgb.b + ')', - boxShadow: 'inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000' - }, - current: { - height: '34px', - background: currentColor, - boxShadow: 'inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000' - }, - label: { - fontSize: '14px', - color: '#000', - textAlign: 'center' - } - } - }); - - return _react2.default.createElement( - 'div', - null, - _react2.default.createElement( - 'div', - { style: styles.label }, - 'new' - ), - _react2.default.createElement( - 'div', - { style: styles.swatches }, - _react2.default.createElement('div', { style: styles.new }), - _react2.default.createElement('div', { style: styles.current }) - ), - _react2.default.createElement( - 'div', - { style: styles.label }, - 'current' - ) - ); -}; - -exports.default = PhotoshopPreviews; -},{"react":269,"reactcss":274}],227:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Sketch = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _common = require('../common'); - -var _SketchFields = require('./SketchFields'); - -var _SketchFields2 = _interopRequireDefault(_SketchFields); - -var _SketchPresetColors = require('./SketchPresetColors'); - -var _SketchPresetColors2 = _interopRequireDefault(_SketchPresetColors); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var Sketch = exports.Sketch = function Sketch(_ref) { - var width = _ref.width, - rgb = _ref.rgb, - hex = _ref.hex, - hsv = _ref.hsv, - hsl = _ref.hsl, - onChange = _ref.onChange, - onSwatchHover = _ref.onSwatchHover, - disableAlpha = _ref.disableAlpha, - presetColors = _ref.presetColors, - renderers = _ref.renderers, - _ref$className = _ref.className, - className = _ref$className === undefined ? '' : _ref$className; - - var styles = (0, _reactcss2.default)({ - 'default': { - picker: { - width: width, - padding: '10px 10px 0', - boxSizing: 'initial', - background: '#fff', - borderRadius: '4px', - boxShadow: '0 0 0 1px rgba(0,0,0,.15), 0 8px 16px rgba(0,0,0,.15)' - }, - saturation: { - width: '100%', - paddingBottom: '75%', - position: 'relative', - overflow: 'hidden' - }, - Saturation: { - radius: '3px', - shadow: 'inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)' - }, - controls: { - display: 'flex' - }, - sliders: { - padding: '4px 0', - flex: '1' - }, - color: { - width: '24px', - height: '24px', - position: 'relative', - marginTop: '4px', - marginLeft: '4px', - borderRadius: '3px' - }, - activeColor: { - absolute: '0px 0px 0px 0px', - borderRadius: '2px', - background: 'rgba(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ',' + rgb.a + ')', - boxShadow: 'inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)' - }, - hue: { - position: 'relative', - height: '10px', - overflow: 'hidden' - }, - Hue: { - radius: '2px', - shadow: 'inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)' - }, - - alpha: { - position: 'relative', - height: '10px', - marginTop: '4px', - overflow: 'hidden' - }, - Alpha: { - radius: '2px', - shadow: 'inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)' - } - }, - 'disableAlpha': { - color: { - height: '10px' - }, - hue: { - height: '10px' - }, - alpha: { - display: 'none' - } - } - }, { disableAlpha: disableAlpha }); - - return _react2.default.createElement( - 'div', - { style: styles.picker, className: 'sketch-picker ' + className }, - _react2.default.createElement( - 'div', - { style: styles.saturation }, - _react2.default.createElement(_common.Saturation, { - style: styles.Saturation, - hsl: hsl, - hsv: hsv, - onChange: onChange - }) - ), - _react2.default.createElement( - 'div', - { style: styles.controls, className: 'flexbox-fix' }, - _react2.default.createElement( - 'div', - { style: styles.sliders }, - _react2.default.createElement( - 'div', - { style: styles.hue }, - _react2.default.createElement(_common.Hue, { - style: styles.Hue, - hsl: hsl, - onChange: onChange - }) - ), - _react2.default.createElement( - 'div', - { style: styles.alpha }, - _react2.default.createElement(_common.Alpha, { - style: styles.Alpha, - rgb: rgb, - hsl: hsl, - renderers: renderers, - onChange: onChange - }) - ) - ), - _react2.default.createElement( - 'div', - { style: styles.color }, - _react2.default.createElement(_common.Checkboard, null), - _react2.default.createElement('div', { style: styles.activeColor }) - ) - ), - _react2.default.createElement(_SketchFields2.default, { - rgb: rgb, - hsl: hsl, - hex: hex, - onChange: onChange, - disableAlpha: disableAlpha - }), - _react2.default.createElement(_SketchPresetColors2.default, { - colors: presetColors, - onClick: onChange, - onSwatchHover: onSwatchHover - }) - ); -}; - -Sketch.propTypes = { - disableAlpha: _propTypes2.default.bool, - width: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]) -}; - -Sketch.defaultProps = { - disableAlpha: false, - width: 200, - presetColors: ['#D0021B', '#F5A623', '#F8E71C', '#8B572A', '#7ED321', '#417505', '#BD10E0', '#9013FE', '#4A90E2', '#50E3C2', '#B8E986', '#000000', '#4A4A4A', '#9B9B9B', '#FFFFFF'] -}; - -exports.default = (0, _common.ColorWrap)(Sketch); -},{"../common":212,"./SketchFields":228,"./SketchPresetColors":229,"prop-types":192,"react":269,"reactcss":274}],228:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.SketchFields = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _color = require('../../helpers/color'); - -var _color2 = _interopRequireDefault(_color); - -var _common = require('../common'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* eslint-disable no-param-reassign */ - -var SketchFields = exports.SketchFields = function SketchFields(_ref) { - var onChange = _ref.onChange, - rgb = _ref.rgb, - hsl = _ref.hsl, - hex = _ref.hex, - disableAlpha = _ref.disableAlpha; - - var styles = (0, _reactcss2.default)({ - 'default': { - fields: { - display: 'flex', - paddingTop: '4px' - }, - single: { - flex: '1', - paddingLeft: '6px' - }, - alpha: { - flex: '1', - paddingLeft: '6px' - }, - double: { - flex: '2' - }, - input: { - width: '80%', - padding: '4px 10% 3px', - border: 'none', - boxShadow: 'inset 0 0 0 1px #ccc', - fontSize: '11px' - }, - label: { - display: 'block', - textAlign: 'center', - fontSize: '11px', - color: '#222', - paddingTop: '3px', - paddingBottom: '4px', - textTransform: 'capitalize' - } - }, - 'disableAlpha': { - alpha: { - display: 'none' - } - } - }, { disableAlpha: disableAlpha }); - - var handleChange = function handleChange(data, e) { - if (data.hex) { - _color2.default.isValidHex(data.hex) && onChange({ - hex: data.hex, - source: 'hex' - }, e); - } else if (data.r || data.g || data.b) { - onChange({ - r: data.r || rgb.r, - g: data.g || rgb.g, - b: data.b || rgb.b, - a: rgb.a, - source: 'rgb' - }, e); - } else if (data.a) { - if (data.a < 0) { - data.a = 0; - } else if (data.a > 100) { - data.a = 100; - } - - data.a /= 100; - onChange({ - h: hsl.h, - s: hsl.s, - l: hsl.l, - a: data.a, - source: 'rgb' - }, e); - } - }; - - return _react2.default.createElement( - 'div', - { style: styles.fields, className: 'flexbox-fix' }, - _react2.default.createElement( - 'div', - { style: styles.double }, - _react2.default.createElement(_common.EditableInput, { - style: { input: styles.input, label: styles.label }, - label: 'hex', - value: hex.replace('#', ''), - onChange: handleChange - }) - ), - _react2.default.createElement( - 'div', - { style: styles.single }, - _react2.default.createElement(_common.EditableInput, { - style: { input: styles.input, label: styles.label }, - label: 'r', - value: rgb.r, - onChange: handleChange, - dragLabel: 'true', - dragMax: '255' - }) - ), - _react2.default.createElement( - 'div', - { style: styles.single }, - _react2.default.createElement(_common.EditableInput, { - style: { input: styles.input, label: styles.label }, - label: 'g', - value: rgb.g, - onChange: handleChange, - dragLabel: 'true', - dragMax: '255' - }) - ), - _react2.default.createElement( - 'div', - { style: styles.single }, - _react2.default.createElement(_common.EditableInput, { - style: { input: styles.input, label: styles.label }, - label: 'b', - value: rgb.b, - onChange: handleChange, - dragLabel: 'true', - dragMax: '255' - }) - ), - _react2.default.createElement( - 'div', - { style: styles.alpha }, - _react2.default.createElement(_common.EditableInput, { - style: { input: styles.input, label: styles.label }, - label: 'a', - value: Math.round(rgb.a * 100), - onChange: handleChange, - dragLabel: 'true', - dragMax: '100' - }) - ) - ); -}; - -exports.default = SketchFields; -},{"../../helpers/color":240,"../common":212,"react":269,"reactcss":274}],229:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.SketchPresetColors = 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; }; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _common = require('../common'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var SketchPresetColors = exports.SketchPresetColors = function SketchPresetColors(_ref) { - var colors = _ref.colors, - _ref$onClick = _ref.onClick, - onClick = _ref$onClick === undefined ? function () {} : _ref$onClick, - onSwatchHover = _ref.onSwatchHover; - - var styles = (0, _reactcss2.default)({ - 'default': { - colors: { - margin: '0 -10px', - padding: '10px 0 0 10px', - borderTop: '1px solid #eee', - display: 'flex', - flexWrap: 'wrap', - position: 'relative' - }, - swatchWrap: { - width: '16px', - height: '16px', - margin: '0 10px 10px 0' - }, - swatch: { - borderRadius: '3px', - boxShadow: 'inset 0 0 0 1px rgba(0,0,0,.15)' - } - }, - 'no-presets': { - colors: { - display: 'none' - } - } - }, { - 'no-presets': !colors || !colors.length - }); - - var handleClick = function handleClick(hex, e) { - onClick({ - hex: hex, - source: 'hex' - }, e); - }; - - return _react2.default.createElement( - 'div', - { style: styles.colors, className: 'flexbox-fix' }, - colors.map(function (colorObjOrString) { - var c = typeof colorObjOrString === 'string' ? { color: colorObjOrString } : colorObjOrString; - return _react2.default.createElement( - 'div', - { key: c.color, style: styles.swatchWrap }, - _react2.default.createElement(_common.Swatch, _extends({}, c, { - style: styles.swatch, - onClick: handleClick, - onHover: onSwatchHover, - focusStyle: { - boxShadow: 'inset 0 0 0 1px rgba(0,0,0,.15), 0 0 4px ' + c.color - } - })) - ); - }) - ); -}; - -SketchPresetColors.propTypes = { - colors: _propTypes2.default.arrayOf(_propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({ - color: _propTypes2.default.string, - title: _propTypes2.default.string - })])).isRequired -}; - -exports.default = SketchPresetColors; -},{"../common":212,"prop-types":192,"react":269,"reactcss":274}],230:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Slider = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _common = require('../common'); - -var _SliderSwatches = require('./SliderSwatches'); - -var _SliderSwatches2 = _interopRequireDefault(_SliderSwatches); - -var _SliderPointer = require('./SliderPointer'); - -var _SliderPointer2 = _interopRequireDefault(_SliderPointer); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var Slider = exports.Slider = function Slider(_ref) { - var hsl = _ref.hsl, - onChange = _ref.onChange, - pointer = _ref.pointer, - _ref$className = _ref.className, - className = _ref$className === undefined ? '' : _ref$className; - - var styles = (0, _reactcss2.default)({ - 'default': { - hue: { - height: '12px', - position: 'relative' - }, - Hue: { - radius: '2px' - } - } - }); - - return _react2.default.createElement( - 'div', - { className: 'slider-picker ' + className }, - _react2.default.createElement( - 'div', - { style: styles.hue }, - _react2.default.createElement(_common.Hue, { - style: styles.Hue, - hsl: hsl, - pointer: pointer, - onChange: onChange - }) - ), - _react2.default.createElement( - 'div', - { style: styles.swatches }, - _react2.default.createElement(_SliderSwatches2.default, { hsl: hsl, onClick: onChange }) - ) - ); -}; - -Slider.defaultProps = { - pointer: _SliderPointer2.default -}; - -exports.default = (0, _common.ColorWrap)(Slider); -},{"../common":212,"./SliderPointer":231,"./SliderSwatches":233,"react":269,"reactcss":274}],231:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.SliderPointer = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var SliderPointer = exports.SliderPointer = function SliderPointer() { - var styles = (0, _reactcss2.default)({ - 'default': { - picker: { - width: '14px', - height: '14px', - borderRadius: '6px', - transform: 'translate(-7px, -1px)', - backgroundColor: 'rgb(248, 248, 248)', - boxShadow: '0 1px 4px 0 rgba(0, 0, 0, 0.37)' - } - } - }); - - return _react2.default.createElement('div', { style: styles.picker }); -}; - -exports.default = SliderPointer; -},{"react":269,"reactcss":274}],232:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.SliderSwatch = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var SliderSwatch = exports.SliderSwatch = function SliderSwatch(_ref) { - var hsl = _ref.hsl, - offset = _ref.offset, - _ref$onClick = _ref.onClick, - onClick = _ref$onClick === undefined ? function () {} : _ref$onClick, - active = _ref.active, - first = _ref.first, - last = _ref.last; - - var styles = (0, _reactcss2.default)({ - 'default': { - swatch: { - height: '12px', - background: 'hsl(' + hsl.h + ', 50%, ' + offset * 100 + '%)', - cursor: 'pointer' - } - }, - 'first': { - swatch: { - borderRadius: '2px 0 0 2px' - } - }, - 'last': { - swatch: { - borderRadius: '0 2px 2px 0' - } - }, - 'active': { - swatch: { - transform: 'scaleY(1.8)', - borderRadius: '3.6px/2px' - } - } - }, { active: active, first: first, last: last }); - - var handleClick = function handleClick(e) { - return onClick({ - h: hsl.h, - s: 0.5, - l: offset, - source: 'hsl' - }, e); - }; - - return _react2.default.createElement('div', { style: styles.swatch, onClick: handleClick }); -}; - -exports.default = SliderSwatch; -},{"react":269,"reactcss":274}],233:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.SliderSwatches = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _SliderSwatch = require('./SliderSwatch'); - -var _SliderSwatch2 = _interopRequireDefault(_SliderSwatch); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var SliderSwatches = exports.SliderSwatches = function SliderSwatches(_ref) { - var onClick = _ref.onClick, - hsl = _ref.hsl; - - var styles = (0, _reactcss2.default)({ - 'default': { - swatches: { - marginTop: '20px' - }, - swatch: { - boxSizing: 'border-box', - width: '20%', - paddingRight: '1px', - float: 'left' - }, - clear: { - clear: 'both' - } - } - }); - - return _react2.default.createElement( - 'div', - { style: styles.swatches }, - _react2.default.createElement( - 'div', - { style: styles.swatch }, - _react2.default.createElement(_SliderSwatch2.default, { - hsl: hsl, - offset: '.80', - active: Math.round(hsl.l * 100) / 100 === 0.80 && Math.round(hsl.s * 100) / 100 === 0.50, - onClick: onClick, - first: true - }) - ), - _react2.default.createElement( - 'div', - { style: styles.swatch }, - _react2.default.createElement(_SliderSwatch2.default, { - hsl: hsl, - offset: '.65', - active: Math.round(hsl.l * 100) / 100 === 0.65 && Math.round(hsl.s * 100) / 100 === 0.50, - onClick: onClick - }) - ), - _react2.default.createElement( - 'div', - { style: styles.swatch }, - _react2.default.createElement(_SliderSwatch2.default, { - hsl: hsl, - offset: '.50', - active: Math.round(hsl.l * 100) / 100 === 0.50 && Math.round(hsl.s * 100) / 100 === 0.50, - onClick: onClick - }) - ), - _react2.default.createElement( - 'div', - { style: styles.swatch }, - _react2.default.createElement(_SliderSwatch2.default, { - hsl: hsl, - offset: '.35', - active: Math.round(hsl.l * 100) / 100 === 0.35 && Math.round(hsl.s * 100) / 100 === 0.50, - onClick: onClick - }) - ), - _react2.default.createElement( - 'div', - { style: styles.swatch }, - _react2.default.createElement(_SliderSwatch2.default, { - hsl: hsl, - offset: '.20', - active: Math.round(hsl.l * 100) / 100 === 0.20 && Math.round(hsl.s * 100) / 100 === 0.50, - onClick: onClick, - last: true - }) - ), - _react2.default.createElement('div', { style: styles.clear }) - ); -}; - -exports.default = SliderSwatches; -},{"./SliderSwatch":232,"react":269,"reactcss":274}],234:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Swatches = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _map = require('lodash/map'); - -var _map2 = _interopRequireDefault(_map); - -var _color = require('../../helpers/color'); - -var _color2 = _interopRequireDefault(_color); - -var _materialColors = require('material-colors'); - -var material = _interopRequireWildcard(_materialColors); - -var _common = require('../common'); - -var _SwatchesGroup = require('./SwatchesGroup'); - -var _SwatchesGroup2 = _interopRequireDefault(_SwatchesGroup); - -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 }; } - -var Swatches = exports.Swatches = function Swatches(_ref) { - var width = _ref.width, - height = _ref.height, - onChange = _ref.onChange, - onSwatchHover = _ref.onSwatchHover, - colors = _ref.colors, - hex = _ref.hex, - _ref$className = _ref.className, - className = _ref$className === undefined ? '' : _ref$className; - - var styles = (0, _reactcss2.default)({ - 'default': { - picker: { - width: width, - height: height - }, - overflow: { - height: height, - overflowY: 'scroll' - }, - body: { - padding: '16px 0 6px 16px' - }, - clear: { - clear: 'both' - } - } - }); - - var handleChange = function handleChange(data, e) { - _color2.default.isValidHex(data) && onChange({ - hex: data, - source: 'hex' - }, e); - }; - - return _react2.default.createElement( - 'div', - { style: styles.picker, className: 'swatches-picker ' + className }, - _react2.default.createElement( - _common.Raised, - null, - _react2.default.createElement( - 'div', - { style: styles.overflow }, - _react2.default.createElement( - 'div', - { style: styles.body }, - (0, _map2.default)(colors, function (group) { - return _react2.default.createElement(_SwatchesGroup2.default, { - key: group.toString(), - group: group, - active: hex, - onClick: handleChange, - onSwatchHover: onSwatchHover - }); - }), - _react2.default.createElement('div', { style: styles.clear }) - ) - ) - ) - ); -}; - -Swatches.propTypes = { - width: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), - height: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), - colors: _propTypes2.default.arrayOf(_propTypes2.default.arrayOf(_propTypes2.default.string)) - - /* eslint-disable max-len */ -};Swatches.defaultProps = { - width: 320, - height: 240, - colors: [[material.red['900'], material.red['700'], material.red['500'], material.red['300'], material.red['100']], [material.pink['900'], material.pink['700'], material.pink['500'], material.pink['300'], material.pink['100']], [material.purple['900'], material.purple['700'], material.purple['500'], material.purple['300'], material.purple['100']], [material.deepPurple['900'], material.deepPurple['700'], material.deepPurple['500'], material.deepPurple['300'], material.deepPurple['100']], [material.indigo['900'], material.indigo['700'], material.indigo['500'], material.indigo['300'], material.indigo['100']], [material.blue['900'], material.blue['700'], material.blue['500'], material.blue['300'], material.blue['100']], [material.lightBlue['900'], material.lightBlue['700'], material.lightBlue['500'], material.lightBlue['300'], material.lightBlue['100']], [material.cyan['900'], material.cyan['700'], material.cyan['500'], material.cyan['300'], material.cyan['100']], [material.teal['900'], material.teal['700'], material.teal['500'], material.teal['300'], material.teal['100']], ['#194D33', material.green['700'], material.green['500'], material.green['300'], material.green['100']], [material.lightGreen['900'], material.lightGreen['700'], material.lightGreen['500'], material.lightGreen['300'], material.lightGreen['100']], [material.lime['900'], material.lime['700'], material.lime['500'], material.lime['300'], material.lime['100']], [material.yellow['900'], material.yellow['700'], material.yellow['500'], material.yellow['300'], material.yellow['100']], [material.amber['900'], material.amber['700'], material.amber['500'], material.amber['300'], material.amber['100']], [material.orange['900'], material.orange['700'], material.orange['500'], material.orange['300'], material.orange['100']], [material.deepOrange['900'], material.deepOrange['700'], material.deepOrange['500'], material.deepOrange['300'], material.deepOrange['100']], [material.brown['900'], material.brown['700'], material.brown['500'], material.brown['300'], material.brown['100']], [material.blueGrey['900'], material.blueGrey['700'], material.blueGrey['500'], material.blueGrey['300'], material.blueGrey['100']], ['#000000', '#525252', '#969696', '#D9D9D9', '#FFFFFF']] -}; - -exports.default = (0, _common.ColorWrap)(Swatches); -},{"../../helpers/color":240,"../common":212,"./SwatchesGroup":236,"lodash/map":163,"material-colors":172,"prop-types":192,"react":269,"reactcss":274}],235:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.SwatchesColor = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _common = require('../common'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var SwatchesColor = exports.SwatchesColor = function SwatchesColor(_ref) { - var color = _ref.color, - _ref$onClick = _ref.onClick, - onClick = _ref$onClick === undefined ? function () {} : _ref$onClick, - onSwatchHover = _ref.onSwatchHover, - first = _ref.first, - last = _ref.last, - active = _ref.active; - - var styles = (0, _reactcss2.default)({ - 'default': { - color: { - width: '40px', - height: '24px', - cursor: 'pointer', - background: color, - marginBottom: '1px' - }, - check: { - fill: '#fff', - marginLeft: '8px', - display: 'none' - } - }, - 'first': { - color: { - overflow: 'hidden', - borderRadius: '2px 2px 0 0' - } - }, - 'last': { - color: { - overflow: 'hidden', - borderRadius: '0 0 2px 2px' - } - }, - 'active': { - check: { - display: 'block' - } - }, - 'color-#FFFFFF': { - color: { - boxShadow: 'inset 0 0 0 1px #ddd' - }, - check: { - fill: '#333' - } - }, - 'transparent': { - check: { - fill: '#333' - } - } - }, { - first: first, - last: last, - active: active, - 'color-#FFFFFF': color === '#FFFFFF', - 'transparent': color === 'transparent' - }); - - return _react2.default.createElement( - _common.Swatch, - { - color: color, - style: styles.color, - onClick: onClick, - onHover: onSwatchHover, - focusStyle: { boxShadow: '0 0 4px ' + color } - }, - _react2.default.createElement( - 'div', - { style: styles.check }, - _react2.default.createElement( - 'svg', - { style: { width: '24px', height: '24px' }, viewBox: '0 0 24 24' }, - _react2.default.createElement('path', { d: 'M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z' }) - ) - ) - ); -}; - -exports.default = SwatchesColor; -},{"../common":212,"react":269,"reactcss":274}],236:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.SwatchesGroup = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _map = require('lodash/map'); - -var _map2 = _interopRequireDefault(_map); - -var _SwatchesColor = require('./SwatchesColor'); - -var _SwatchesColor2 = _interopRequireDefault(_SwatchesColor); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var SwatchesGroup = exports.SwatchesGroup = function SwatchesGroup(_ref) { - var onClick = _ref.onClick, - onSwatchHover = _ref.onSwatchHover, - group = _ref.group, - active = _ref.active; - - var styles = (0, _reactcss2.default)({ - 'default': { - group: { - paddingBottom: '10px', - width: '40px', - float: 'left', - marginRight: '10px' - } - } - }); - - return _react2.default.createElement( - 'div', - { style: styles.group }, - (0, _map2.default)(group, function (color, i) { - return _react2.default.createElement(_SwatchesColor2.default, { - key: color, - color: color, - active: color.toLowerCase() === active, - first: i === 0, - last: i === group.length - 1, - onClick: onClick, - onSwatchHover: onSwatchHover - }); - }) - ); -}; - -exports.default = SwatchesGroup; -},{"./SwatchesColor":235,"lodash/map":163,"react":269,"reactcss":274}],237:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.Twitter = undefined; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require('prop-types'); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _reactcss = require('reactcss'); - -var _reactcss2 = _interopRequireDefault(_reactcss); - -var _map = require('lodash/map'); - -var _map2 = _interopRequireDefault(_map); - -var _color = require('../../helpers/color'); - -var _color2 = _interopRequireDefault(_color); - -var _common = require('../common'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var Twitter = exports.Twitter = function Twitter(_ref) { - var onChange = _ref.onChange, - onSwatchHover = _ref.onSwatchHover, - hex = _ref.hex, - colors = _ref.colors, - width = _ref.width, - triangle = _ref.triangle, - _ref$className = _ref.className, - className = _ref$className === undefined ? '' : _ref$className; - - var styles = (0, _reactcss2.default)({ - 'default': { - card: { - width: width, - background: '#fff', - border: '0 solid rgba(0,0,0,0.25)', - boxShadow: '0 1px 4px rgba(0,0,0,0.25)', - borderRadius: '4px', - position: 'relative' - }, - body: { - padding: '15px 9px 9px 15px' - }, - label: { - fontSize: '18px', - color: '#fff' - }, - triangle: { - width: '0px', - height: '0px', - borderStyle: 'solid', - borderWidth: '0 9px 10px 9px', - borderColor: 'transparent transparent #fff transparent', - position: 'absolute' - }, - triangleShadow: { - width: '0px', - height: '0px', - borderStyle: 'solid', - borderWidth: '0 9px 10px 9px', - borderColor: 'transparent transparent rgba(0,0,0,.1) transparent', - position: 'absolute' - }, - hash: { - background: '#F0F0F0', - height: '30px', - width: '30px', - borderRadius: '4px 0 0 4px', - float: 'left', - color: '#98A1A4', - display: 'flex', - alignItems: 'center', - justifyContent: 'center' - }, - input: { - width: '100px', - fontSize: '14px', - color: '#666', - border: '0px', - outline: 'none', - height: '28px', - boxShadow: 'inset 0 0 0 1px #F0F0F0', - boxSizing: 'content-box', - borderRadius: '0 4px 4px 0', - float: 'left', - paddingLeft: '8px' - }, - swatch: { - width: '30px', - height: '30px', - float: 'left', - borderRadius: '4px', - margin: '0 6px 6px 0' - }, - clear: { - clear: 'both' - } - }, - 'hide-triangle': { - triangle: { - display: 'none' - }, - triangleShadow: { - display: 'none' - } - }, - 'top-left-triangle': { - triangle: { - top: '-10px', - left: '12px' - }, - triangleShadow: { - top: '-11px', - left: '12px' - } - }, - 'top-right-triangle': { - triangle: { - top: '-10px', - right: '12px' - }, - triangleShadow: { - top: '-11px', - right: '12px' - } - } - }, { - 'hide-triangle': triangle === 'hide', - 'top-left-triangle': triangle === 'top-left', - 'top-right-triangle': triangle === 'top-right' - }); - - var handleChange = function handleChange(hexcode, e) { - _color2.default.isValidHex(hexcode) && onChange({ - hex: hexcode, - source: 'hex' - }, e); - }; - - return _react2.default.createElement( - 'div', - { style: styles.card, className: 'twitter-picker ' + className }, - _react2.default.createElement('div', { style: styles.triangleShadow }), - _react2.default.createElement('div', { style: styles.triangle }), - _react2.default.createElement( - 'div', - { style: styles.body }, - (0, _map2.default)(colors, function (c, i) { - return _react2.default.createElement(_common.Swatch, { - key: i, - color: c, - hex: c, - style: styles.swatch, - onClick: handleChange, - onHover: onSwatchHover, - focusStyle: { - boxShadow: '0 0 4px ' + c - } - }); - }), - _react2.default.createElement( - 'div', - { style: styles.hash }, - '#' - ), - _react2.default.createElement(_common.EditableInput, { - style: { input: styles.input }, - value: hex.replace('#', ''), - onChange: handleChange - }), - _react2.default.createElement('div', { style: styles.clear }) - ) - ); -}; - -Twitter.propTypes = { - width: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]), - triangle: _propTypes2.default.oneOf(['hide', 'top-left', 'top-right']), - colors: _propTypes2.default.arrayOf(_propTypes2.default.string) -}; - -Twitter.defaultProps = { - width: 276, - colors: ['#FF6900', '#FCB900', '#7BDCB5', '#00D084', '#8ED1FC', '#0693E3', '#ABB8C3', '#EB144C', '#F78DA7', '#9900EF'], - triangle: 'top-left' -}; - -exports.default = (0, _common.ColorWrap)(Twitter); -},{"../../helpers/color":240,"../common":212,"lodash/map":163,"prop-types":192,"react":269,"reactcss":274}],238:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var calculateChange = exports.calculateChange = function calculateChange(e, skip, props, container) { - e.preventDefault(); - var containerWidth = container.clientWidth; - var containerHeight = container.clientHeight; - var x = typeof e.pageX === 'number' ? e.pageX : e.touches[0].pageX; - var y = typeof e.pageY === 'number' ? e.pageY : e.touches[0].pageY; - var left = x - (container.getBoundingClientRect().left + window.pageXOffset); - var top = y - (container.getBoundingClientRect().top + window.pageYOffset); - - if (props.direction === 'vertical') { - var a = void 0; - if (top < 0) { - a = 0; - } else if (top > containerHeight) { - a = 1; - } else { - a = Math.round(top * 100 / containerHeight) / 100; - } - - if (props.hsl.a !== a) { - return { - h: props.hsl.h, - s: props.hsl.s, - l: props.hsl.l, - a: a, - source: 'rgb' - }; - } - } else { - var _a = void 0; - if (left < 0) { - _a = 0; - } else if (left > containerWidth) { - _a = 1; - } else { - _a = Math.round(left * 100 / containerWidth) / 100; - } - - if (props.a !== _a) { - return { - h: props.hsl.h, - s: props.hsl.s, - l: props.hsl.l, - a: _a, - source: 'rgb' - }; - } - } - return null; -}; -},{}],239:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var checkboardCache = {}; - -var render = exports.render = function render(c1, c2, size, serverCanvas) { - if (typeof document === 'undefined' && !serverCanvas) { - return null; - } - var canvas = serverCanvas ? new serverCanvas() : document.createElement('canvas'); - canvas.width = size * 2; - canvas.height = size * 2; - var ctx = canvas.getContext('2d'); - if (!ctx) { - return null; - } // If no context can be found, return early. - ctx.fillStyle = c1; - ctx.fillRect(0, 0, canvas.width, canvas.height); - ctx.fillStyle = c2; - ctx.fillRect(0, 0, size, size); - ctx.translate(size, size); - ctx.fillRect(0, 0, size, size); - return canvas.toDataURL(); -}; - -var get = exports.get = function get(c1, c2, size, serverCanvas) { - var key = c1 + '-' + c2 + '-' + size + (serverCanvas ? '-server' : ''); - var checkboard = render(c1, c2, size, serverCanvas); - - if (checkboardCache[key]) { - return checkboardCache[key]; - } - checkboardCache[key] = checkboard; - return checkboard; -}; -},{}],240:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.red = undefined; - -var _each = require('lodash/each'); - -var _each2 = _interopRequireDefault(_each); - -var _tinycolor = require('tinycolor2'); - -var _tinycolor2 = _interopRequireDefault(_tinycolor); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = { - simpleCheckForValidColor: function simpleCheckForValidColor(data) { - var keysToCheck = ['r', 'g', 'b', 'a', 'h', 's', 'l', 'v']; - var checked = 0; - var passed = 0; - (0, _each2.default)(keysToCheck, function (letter) { - if (data[letter]) { - checked += 1; - if (!isNaN(data[letter])) { - passed += 1; - } - } - }); - return checked === passed ? data : false; - }, - toState: function toState(data, oldHue) { - var color = data.hex ? (0, _tinycolor2.default)(data.hex) : (0, _tinycolor2.default)(data); - var hsl = color.toHsl(); - var hsv = color.toHsv(); - var rgb = color.toRgb(); - var hex = color.toHex(); - if (hsl.s === 0) { - hsl.h = oldHue || 0; - hsv.h = oldHue || 0; - } - var transparent = hex === '000000' && rgb.a === 0; - - return { - hsl: hsl, - hex: transparent ? 'transparent' : '#' + hex, - rgb: rgb, - hsv: hsv, - oldHue: data.h || oldHue || hsl.h, - source: data.source - }; - }, - isValidHex: function isValidHex(hex) { - return (0, _tinycolor2.default)(hex).isValid(); - } -}; -var red = exports.red = { - hsl: { a: 1, h: 0, l: 0.5, s: 1 }, - hex: '#ff0000', - rgb: { r: 255, g: 0, b: 0, a: 1 }, - hsv: { h: 0, s: 1, v: 1, a: 1 } -}; -},{"lodash/each":142,"tinycolor2":277}],241:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var calculateChange = exports.calculateChange = function calculateChange(e, skip, props, container) { - e.preventDefault(); - var containerWidth = container.clientWidth; - var containerHeight = container.clientHeight; - var x = typeof e.pageX === 'number' ? e.pageX : e.touches[0].pageX; - var y = typeof e.pageY === 'number' ? e.pageY : e.touches[0].pageY; - var left = x - (container.getBoundingClientRect().left + window.pageXOffset); - var top = y - (container.getBoundingClientRect().top + window.pageYOffset); - - if (props.direction === 'vertical') { - var h = void 0; - if (top < 0) { - h = 359; - } else if (top > containerHeight) { - h = 0; - } else { - var percent = -(top * 100 / containerHeight) + 100; - h = 360 * percent / 100; - } - - if (props.hsl.h !== h) { - return { - h: h, - s: props.hsl.s, - l: props.hsl.l, - a: props.hsl.a, - source: 'rgb' - }; - } - } else { - var _h = void 0; - if (left < 0) { - _h = 0; - } else if (left > containerWidth) { - _h = 359; - } else { - var _percent = left * 100 / containerWidth; - _h = 360 * _percent / 100; - } - - if (props.hsl.h !== _h) { - return { - h: _h, - s: props.hsl.s, - l: props.hsl.l, - a: props.hsl.a, - source: 'rgb' - }; - } - } - return null; -}; -},{}],242:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.handleFocus = 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; }; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } /* eslint-disable no-invalid-this */ - - -var handleFocus = exports.handleFocus = function handleFocus(Component) { - var Span = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'span'; - return function (_React$Component) { - _inherits(Focus, _React$Component); - - function Focus() { - var _ref; - - var _temp, _this, _ret; - - _classCallCheck(this, Focus); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Focus.__proto__ || Object.getPrototypeOf(Focus)).call.apply(_ref, [this].concat(args))), _this), _this.state = { focus: false }, _this.handleFocus = function () { - return _this.setState({ focus: true }); - }, _this.handleBlur = function () { - return _this.setState({ focus: false }); - }, _this.render = function () { - return _react2.default.createElement( - Span, - { onFocus: _this.handleFocus, onBlur: _this.handleBlur }, - _react2.default.createElement(Component, _extends({}, _this.props, _this.state)) - ); - }, _temp), _possibleConstructorReturn(_this, _ret); - } - - return Focus; - }(_react2.default.Component); -}; -},{"react":269}],243:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var calculateChange = exports.calculateChange = function calculateChange(e, skip, props, container) { - e.preventDefault(); - - var _container$getBoundin = container.getBoundingClientRect(), - containerWidth = _container$getBoundin.width, - containerHeight = _container$getBoundin.height; - - var x = typeof e.pageX === 'number' ? e.pageX : e.touches[0].pageX; - var y = typeof e.pageY === 'number' ? e.pageY : e.touches[0].pageY; - var left = x - (container.getBoundingClientRect().left + window.pageXOffset); - var top = y - (container.getBoundingClientRect().top + window.pageYOffset); - - if (left < 0) { - left = 0; - } else if (left > containerWidth) { - left = containerWidth; - } else if (top < 0) { - top = 0; - } else if (top > containerHeight) { - top = containerHeight; - } - - var saturation = left * 100 / containerWidth; - var bright = -(top * 100 / containerHeight) + 100; - - return { - h: props.hsl.h, - s: saturation, - v: bright, - a: props.hsl.a, - source: 'rgb' - }; -}; -},{}],244:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.CustomPicker = exports.TwitterPicker = exports.SwatchesPicker = exports.SliderPicker = exports.SketchPicker = exports.PhotoshopPicker = exports.MaterialPicker = exports.HuePicker = exports.GithubPicker = exports.CompactPicker = exports.ChromePicker = exports.default = exports.CirclePicker = exports.BlockPicker = exports.AlphaPicker = undefined; - -var _Alpha = require('./components/alpha/Alpha'); - -Object.defineProperty(exports, 'AlphaPicker', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Alpha).default; - } -}); - -var _Block = require('./components/block/Block'); - -Object.defineProperty(exports, 'BlockPicker', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Block).default; - } -}); - -var _Circle = require('./components/circle/Circle'); - -Object.defineProperty(exports, 'CirclePicker', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Circle).default; - } -}); - -var _Chrome = require('./components/chrome/Chrome'); - -Object.defineProperty(exports, 'ChromePicker', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Chrome).default; - } -}); - -var _Compact = require('./components/compact/Compact'); - -Object.defineProperty(exports, 'CompactPicker', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Compact).default; - } -}); - -var _Github = require('./components/github/Github'); - -Object.defineProperty(exports, 'GithubPicker', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Github).default; - } -}); - -var _Hue = require('./components/hue/Hue'); - -Object.defineProperty(exports, 'HuePicker', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Hue).default; - } -}); - -var _Material = require('./components/material/Material'); - -Object.defineProperty(exports, 'MaterialPicker', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Material).default; - } -}); - -var _Photoshop = require('./components/photoshop/Photoshop'); - -Object.defineProperty(exports, 'PhotoshopPicker', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Photoshop).default; - } -}); - -var _Sketch = require('./components/sketch/Sketch'); - -Object.defineProperty(exports, 'SketchPicker', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Sketch).default; - } -}); - -var _Slider = require('./components/slider/Slider'); - -Object.defineProperty(exports, 'SliderPicker', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Slider).default; - } -}); - -var _Swatches = require('./components/swatches/Swatches'); - -Object.defineProperty(exports, 'SwatchesPicker', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Swatches).default; - } -}); - -var _Twitter = require('./components/twitter/Twitter'); - -Object.defineProperty(exports, 'TwitterPicker', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_Twitter).default; - } -}); - -var _ColorWrap = require('./components/common/ColorWrap'); - -Object.defineProperty(exports, 'CustomPicker', { - enumerable: true, - get: function get() { - return _interopRequireDefault(_ColorWrap).default; - } -}); - -var _Chrome2 = _interopRequireDefault(_Chrome); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = _Chrome2.default; -},{"./components/alpha/Alpha":194,"./components/block/Block":196,"./components/chrome/Chrome":198,"./components/circle/Circle":202,"./components/common/ColorWrap":206,"./components/compact/Compact":213,"./components/github/Github":216,"./components/hue/Hue":218,"./components/material/Material":220,"./components/photoshop/Photoshop":221,"./components/sketch/Sketch":227,"./components/slider/Slider":230,"./components/swatches/Swatches":234,"./components/twitter/Twitter":237}],245:[function(require,module,exports){ -/** - * 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. - * - * - */ - -'use strict'; - -/** - * Escape and wrap key so it is safe to use as a reactid - * - * @param {string} key to be escaped. - * @return {string} the escaped key. - */ - -function escape(key) { - var escapeRegex = /[=:]/g; - var escaperLookup = { - '=': '=0', - ':': '=2' - }; - var escapedString = ('' + key).replace(escapeRegex, function (match) { - return escaperLookup[match]; - }); - - return '$' + escapedString; -} - -/** - * Unescape and unwrap key for human-readable display - * - * @param {string} key to unescape. - * @return {string} the unescaped key. - */ -function unescape(key) { - var unescapeRegex = /(=0|=2)/g; - var unescaperLookup = { - '=0': '=', - '=2': ':' - }; - var keySubstring = key[0] === '.' && key[1] === '$' ? key.substring(2) : key.substring(1); - - return ('' + keySubstring).replace(unescapeRegex, function (match) { - return unescaperLookup[match]; - }); -} - -var KeyEscapeUtils = { - escape: escape, - unescape: unescape -}; - -module.exports = KeyEscapeUtils; -},{}],246:[function(require,module,exports){ -(function (process){ -/** - * 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. - * - * - */ - -'use strict'; - -var _prodInvariant = require('./reactProdInvariant'); - -var invariant = require('fbjs/lib/invariant'); - -/** - * Static poolers. Several custom versions for each potential number of - * arguments. A completely generic pooler is easy to implement, but would - * require accessing the `arguments` object. In each of these, `this` refers to - * the Class itself, not an instance. If any others are needed, simply add them - * here, or in their own files. - */ -var oneArgumentPooler = function (copyFieldsFrom) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, copyFieldsFrom); - return instance; - } else { - return new Klass(copyFieldsFrom); - } -}; - -var twoArgumentPooler = function (a1, a2) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, a1, a2); - return instance; - } else { - return new Klass(a1, a2); - } -}; - -var threeArgumentPooler = function (a1, a2, a3) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, a1, a2, a3); - return instance; - } else { - return new Klass(a1, a2, a3); - } -}; - -var fourArgumentPooler = function (a1, a2, a3, a4) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - Klass.call(instance, a1, a2, a3, a4); - return instance; - } else { - return new Klass(a1, a2, a3, a4); - } -}; - -var standardReleaser = function (instance) { - var Klass = this; - !(instance instanceof Klass) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Trying to release an instance into a pool of a different type.') : _prodInvariant('25') : void 0; - instance.destructor(); - if (Klass.instancePool.length < Klass.poolSize) { - Klass.instancePool.push(instance); - } -}; - -var DEFAULT_POOL_SIZE = 10; -var DEFAULT_POOLER = oneArgumentPooler; - -/** - * Augments `CopyConstructor` to be a poolable class, augmenting only the class - * itself (statically) not adding any prototypical fields. Any CopyConstructor - * you give this may have a `poolSize` property, and will look for a - * prototypical `destructor` on instances. - * - * @param {Function} CopyConstructor Constructor that can be used to reset. - * @param {Function} pooler Customizable pooler. - */ -var addPoolingTo = function (CopyConstructor, pooler) { - // Casting as any so that flow ignores the actual implementation and trusts - // it to match the type we declared - var NewKlass = CopyConstructor; - NewKlass.instancePool = []; - NewKlass.getPooled = pooler || DEFAULT_POOLER; - if (!NewKlass.poolSize) { - NewKlass.poolSize = DEFAULT_POOL_SIZE; - } - NewKlass.release = standardReleaser; - return NewKlass; -}; - -var PooledClass = { - addPoolingTo: addPoolingTo, - oneArgumentPooler: oneArgumentPooler, - twoArgumentPooler: twoArgumentPooler, - threeArgumentPooler: threeArgumentPooler, - fourArgumentPooler: fourArgumentPooler -}; - -module.exports = PooledClass; -}).call(this,require('_process')) -},{"./reactProdInvariant":267,"_process":187,"fbjs/lib/invariant":6}],247:[function(require,module,exports){ -(function (process){ -/** - * 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. - * - */ - -'use strict'; - -var _assign = require('object-assign'); - -var ReactBaseClasses = require('./ReactBaseClasses'); -var ReactChildren = require('./ReactChildren'); -var ReactDOMFactories = require('./ReactDOMFactories'); -var ReactElement = require('./ReactElement'); -var ReactPropTypes = require('./ReactPropTypes'); -var ReactVersion = require('./ReactVersion'); - -var createReactClass = require('./createClass'); -var onlyChild = require('./onlyChild'); - -var createElement = ReactElement.createElement; -var createFactory = ReactElement.createFactory; -var cloneElement = ReactElement.cloneElement; - -if (process.env.NODE_ENV !== 'production') { - var lowPriorityWarning = require('./lowPriorityWarning'); - var canDefineProperty = require('./canDefineProperty'); - var ReactElementValidator = require('./ReactElementValidator'); - var didWarnPropTypesDeprecated = false; - createElement = ReactElementValidator.createElement; - createFactory = ReactElementValidator.createFactory; - cloneElement = ReactElementValidator.cloneElement; -} - -var __spread = _assign; -var createMixin = function (mixin) { - return mixin; -}; - -if (process.env.NODE_ENV !== 'production') { - var warnedForSpread = false; - var warnedForCreateMixin = false; - __spread = function () { - lowPriorityWarning(warnedForSpread, 'React.__spread is deprecated and should not be used. Use ' + 'Object.assign directly or another helper function with similar ' + 'semantics. You may be seeing this warning due to your compiler. ' + 'See https://fb.me/react-spread-deprecation for more details.'); - warnedForSpread = true; - return _assign.apply(null, arguments); - }; - - createMixin = function (mixin) { - lowPriorityWarning(warnedForCreateMixin, 'React.createMixin is deprecated and should not be used. ' + 'In React v16.0, it will be removed. ' + 'You can use this mixin directly instead. ' + 'See https://fb.me/createmixin-was-never-implemented for more info.'); - warnedForCreateMixin = true; - return mixin; - }; -} - -var React = { - // Modern - - Children: { - map: ReactChildren.map, - forEach: ReactChildren.forEach, - count: ReactChildren.count, - toArray: ReactChildren.toArray, - only: onlyChild - }, - - Component: ReactBaseClasses.Component, - PureComponent: ReactBaseClasses.PureComponent, - - createElement: createElement, - cloneElement: cloneElement, - isValidElement: ReactElement.isValidElement, - - // Classic - - PropTypes: ReactPropTypes, - createClass: createReactClass, - createFactory: createFactory, - createMixin: createMixin, - - // This looks DOM specific but these are actually isomorphic helpers - // since they are just generating DOM strings. - DOM: ReactDOMFactories, - - version: ReactVersion, - - // Deprecated hook for JSX spread, don't use this for anything. - __spread: __spread -}; - -if (process.env.NODE_ENV !== 'production') { - var warnedForCreateClass = false; - if (canDefineProperty) { - Object.defineProperty(React, 'PropTypes', { - get: function () { - lowPriorityWarning(didWarnPropTypesDeprecated, 'Accessing PropTypes via the main React package is deprecated,' + ' and will be removed in React v16.0.' + ' Use the latest available v15.* prop-types package from npm instead.' + ' For info on usage, compatibility, migration and more, see ' + 'https://fb.me/prop-types-docs'); - didWarnPropTypesDeprecated = true; - return ReactPropTypes; - } - }); - - Object.defineProperty(React, 'createClass', { - get: function () { - lowPriorityWarning(warnedForCreateClass, 'Accessing createClass via the main React package is deprecated,' + ' and will be removed in React v16.0.' + " Use a plain JavaScript class instead. If you're not yet " + 'ready to migrate, create-react-class v15.* is available ' + 'on npm as a temporary, drop-in replacement. ' + 'For more info see https://fb.me/react-create-class'); - warnedForCreateClass = true; - return createReactClass; - } - }); - } - - // React.DOM factories are deprecated. Wrap these methods so that - // invocations of the React.DOM namespace and alert users to switch - // to the `react-dom-factories` package. - React.DOM = {}; - var warnedForFactories = false; - Object.keys(ReactDOMFactories).forEach(function (factory) { - React.DOM[factory] = function () { - if (!warnedForFactories) { - lowPriorityWarning(false, 'Accessing factories like React.DOM.%s has been deprecated ' + 'and will be removed in v16.0+. Use the ' + 'react-dom-factories package instead. ' + ' Version 1.0 provides a drop-in replacement.' + ' For more info, see https://fb.me/react-dom-factories', factory); - warnedForFactories = true; - } - return ReactDOMFactories[factory].apply(ReactDOMFactories, arguments); - }; - }); -} - -module.exports = React; -}).call(this,require('_process')) -},{"./ReactBaseClasses":248,"./ReactChildren":249,"./ReactDOMFactories":252,"./ReactElement":253,"./ReactElementValidator":255,"./ReactPropTypes":258,"./ReactVersion":260,"./canDefineProperty":261,"./createClass":263,"./lowPriorityWarning":265,"./onlyChild":266,"_process":187,"object-assign":173}],248:[function(require,module,exports){ -(function (process){ -/** - * 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. - * - */ - -'use strict'; - -var _prodInvariant = require('./reactProdInvariant'), - _assign = require('object-assign'); - -var ReactNoopUpdateQueue = require('./ReactNoopUpdateQueue'); - -var canDefineProperty = require('./canDefineProperty'); -var emptyObject = require('fbjs/lib/emptyObject'); -var invariant = require('fbjs/lib/invariant'); -var lowPriorityWarning = require('./lowPriorityWarning'); - -/** - * Base class helpers for the updating state of a component. - */ -function ReactComponent(props, context, updater) { - this.props = props; - this.context = context; - this.refs = emptyObject; - // We initialize the default updater but the real one gets injected by the - // renderer. - this.updater = updater || ReactNoopUpdateQueue; -} - -ReactComponent.prototype.isReactComponent = {}; - -/** - * Sets a subset of the state. Always use this to mutate - * state. You should treat `this.state` as immutable. - * - * There is no guarantee that `this.state` will be immediately updated, so - * accessing `this.state` after calling this method may return the old value. - * - * There is no guarantee that calls to `setState` will run synchronously, - * as they may eventually be batched together. You can provide an optional - * callback that will be executed when the call to setState is actually - * completed. - * - * When a function is provided to setState, it will be called at some point in - * the future (not synchronously). It will be called with the up to date - * component arguments (state, props, context). These values can be different - * from this.* because your function may be called after receiveProps but before - * shouldComponentUpdate, and this new state, props, and context will not yet be - * assigned to this. - * - * @param {object|function} partialState Next partial state or function to - * produce next partial state to be merged with current state. - * @param {?function} callback Called after state is updated. - * @final - * @protected - */ -ReactComponent.prototype.setState = function (partialState, callback) { - !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : _prodInvariant('85') : void 0; - this.updater.enqueueSetState(this, partialState); - if (callback) { - this.updater.enqueueCallback(this, callback, 'setState'); - } -}; - -/** - * Forces an update. This should only be invoked when it is known with - * certainty that we are **not** in a DOM transaction. - * - * You may want to call this when you know that some deeper aspect of the - * component's state has changed but `setState` was not called. - * - * This will not invoke `shouldComponentUpdate`, but it will invoke - * `componentWillUpdate` and `componentDidUpdate`. - * - * @param {?function} callback Called after update is complete. - * @final - * @protected - */ -ReactComponent.prototype.forceUpdate = function (callback) { - this.updater.enqueueForceUpdate(this); - if (callback) { - this.updater.enqueueCallback(this, callback, 'forceUpdate'); - } -}; - -/** - * Deprecated APIs. These APIs used to exist on classic React classes but since - * we would like to deprecate them, we're not going to move them over to this - * modern base class. Instead, we define a getter that warns if it's accessed. - */ -if (process.env.NODE_ENV !== 'production') { - var deprecatedAPIs = { - isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], - replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'] - }; - var defineDeprecationWarning = function (methodName, info) { - if (canDefineProperty) { - Object.defineProperty(ReactComponent.prototype, methodName, { - get: function () { - lowPriorityWarning(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]); - return undefined; - } - }); - } - }; - for (var fnName in deprecatedAPIs) { - if (deprecatedAPIs.hasOwnProperty(fnName)) { - defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); - } - } -} - -/** - * Base class helpers for the updating state of a component. - */ -function ReactPureComponent(props, context, updater) { - // Duplicated from ReactComponent. - this.props = props; - this.context = context; - this.refs = emptyObject; - // We initialize the default updater but the real one gets injected by the - // renderer. - this.updater = updater || ReactNoopUpdateQueue; -} - -function ComponentDummy() {} -ComponentDummy.prototype = ReactComponent.prototype; -ReactPureComponent.prototype = new ComponentDummy(); -ReactPureComponent.prototype.constructor = ReactPureComponent; -// Avoid an extra prototype jump for these methods. -_assign(ReactPureComponent.prototype, ReactComponent.prototype); -ReactPureComponent.prototype.isPureReactComponent = true; - -module.exports = { - Component: ReactComponent, - PureComponent: ReactPureComponent -}; -}).call(this,require('_process')) -},{"./ReactNoopUpdateQueue":256,"./canDefineProperty":261,"./lowPriorityWarning":265,"./reactProdInvariant":267,"_process":187,"fbjs/lib/emptyObject":5,"fbjs/lib/invariant":6,"object-assign":173}],249:[function(require,module,exports){ -/** - * 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. - * - */ - -'use strict'; - -var PooledClass = require('./PooledClass'); -var ReactElement = require('./ReactElement'); - -var emptyFunction = require('fbjs/lib/emptyFunction'); -var traverseAllChildren = require('./traverseAllChildren'); - -var twoArgumentPooler = PooledClass.twoArgumentPooler; -var fourArgumentPooler = PooledClass.fourArgumentPooler; - -var userProvidedKeyEscapeRegex = /\/+/g; -function escapeUserProvidedKey(text) { - return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/'); -} - -/** - * PooledClass representing the bookkeeping associated with performing a child - * traversal. Allows avoiding binding callbacks. - * - * @constructor ForEachBookKeeping - * @param {!function} forEachFunction Function to perform traversal with. - * @param {?*} forEachContext Context to perform context with. - */ -function ForEachBookKeeping(forEachFunction, forEachContext) { - this.func = forEachFunction; - this.context = forEachContext; - this.count = 0; -} -ForEachBookKeeping.prototype.destructor = function () { - this.func = null; - this.context = null; - this.count = 0; -}; -PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler); - -function forEachSingleChild(bookKeeping, child, name) { - var func = bookKeeping.func, - context = bookKeeping.context; - - func.call(context, child, bookKeeping.count++); -} - -/** - * Iterates through children that are typically specified as `props.children`. - * - * See https://facebook.github.io/react/docs/top-level-api.html#react.children.foreach - * - * The provided forEachFunc(child, index) will be called for each - * leaf child. - * - * @param {?*} children Children tree container. - * @param {function(*, int)} forEachFunc - * @param {*} forEachContext Context for forEachContext. - */ -function forEachChildren(children, forEachFunc, forEachContext) { - if (children == null) { - return children; - } - var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext); - traverseAllChildren(children, forEachSingleChild, traverseContext); - ForEachBookKeeping.release(traverseContext); -} - -/** - * PooledClass representing the bookkeeping associated with performing a child - * mapping. Allows avoiding binding callbacks. - * - * @constructor MapBookKeeping - * @param {!*} mapResult Object containing the ordered map of results. - * @param {!function} mapFunction Function to perform mapping with. - * @param {?*} mapContext Context to perform mapping with. - */ -function MapBookKeeping(mapResult, keyPrefix, mapFunction, mapContext) { - this.result = mapResult; - this.keyPrefix = keyPrefix; - this.func = mapFunction; - this.context = mapContext; - this.count = 0; -} -MapBookKeeping.prototype.destructor = function () { - this.result = null; - this.keyPrefix = null; - this.func = null; - this.context = null; - this.count = 0; -}; -PooledClass.addPoolingTo(MapBookKeeping, fourArgumentPooler); - -function mapSingleChildIntoContext(bookKeeping, child, childKey) { - var result = bookKeeping.result, - keyPrefix = bookKeeping.keyPrefix, - func = bookKeeping.func, - context = bookKeeping.context; - - - var mappedChild = func.call(context, child, bookKeeping.count++); - if (Array.isArray(mappedChild)) { - mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument); - } else if (mappedChild != null) { - if (ReactElement.isValidElement(mappedChild)) { - mappedChild = ReactElement.cloneAndReplaceKey(mappedChild, - // Keep both the (mapped) and old keys if they differ, just as - // traverseAllChildren used to do for objects as children - keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey); - } - result.push(mappedChild); - } -} - -function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) { - var escapedPrefix = ''; - if (prefix != null) { - escapedPrefix = escapeUserProvidedKey(prefix) + '/'; - } - var traverseContext = MapBookKeeping.getPooled(array, escapedPrefix, func, context); - traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); - MapBookKeeping.release(traverseContext); -} - -/** - * Maps children that are typically specified as `props.children`. - * - * See https://facebook.github.io/react/docs/top-level-api.html#react.children.map - * - * The provided mapFunction(child, key, index) will be called for each - * leaf child. - * - * @param {?*} children Children tree container. - * @param {function(*, int)} func The map function. - * @param {*} context Context for mapFunction. - * @return {object} Object containing the ordered map of results. - */ -function mapChildren(children, func, context) { - if (children == null) { - return children; - } - var result = []; - mapIntoWithKeyPrefixInternal(children, result, null, func, context); - return result; -} - -function forEachSingleChildDummy(traverseContext, child, name) { - return null; -} - -/** - * Count the number of children that are typically specified as - * `props.children`. - * - * See https://facebook.github.io/react/docs/top-level-api.html#react.children.count - * - * @param {?*} children Children tree container. - * @return {number} The number of children. - */ -function countChildren(children, context) { - return traverseAllChildren(children, forEachSingleChildDummy, null); -} - -/** - * Flatten a children object (typically specified as `props.children`) and - * return an array with appropriately re-keyed children. - * - * See https://facebook.github.io/react/docs/top-level-api.html#react.children.toarray - */ -function toArray(children) { - var result = []; - mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument); - return result; -} - -var ReactChildren = { - forEach: forEachChildren, - map: mapChildren, - mapIntoWithKeyPrefixInternal: mapIntoWithKeyPrefixInternal, - count: countChildren, - toArray: toArray -}; - -module.exports = ReactChildren; -},{"./PooledClass":246,"./ReactElement":253,"./traverseAllChildren":268,"fbjs/lib/emptyFunction":4}],250:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2016-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. - * - * - */ - -'use strict'; - -var _prodInvariant = require('./reactProdInvariant'); - -var ReactCurrentOwner = require('./ReactCurrentOwner'); - -var invariant = require('fbjs/lib/invariant'); -var warning = require('fbjs/lib/warning'); - -function isNative(fn) { - // Based on isNative() from Lodash - var funcToString = Function.prototype.toString; - var hasOwnProperty = Object.prototype.hasOwnProperty; - var reIsNative = RegExp('^' + funcToString - // Take an example native function source for comparison - .call(hasOwnProperty - // Strip regex characters so we can use it for regex - ).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&' - // Remove hasOwnProperty from the template to make it generic - ).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); - try { - var source = funcToString.call(fn); - return reIsNative.test(source); - } catch (err) { - return false; - } -} - -var canUseCollections = -// Array.from -typeof Array.from === 'function' && -// Map -typeof Map === 'function' && isNative(Map) && -// Map.prototype.keys -Map.prototype != null && typeof Map.prototype.keys === 'function' && isNative(Map.prototype.keys) && -// Set -typeof Set === 'function' && isNative(Set) && -// Set.prototype.keys -Set.prototype != null && typeof Set.prototype.keys === 'function' && isNative(Set.prototype.keys); - -var setItem; -var getItem; -var removeItem; -var getItemIDs; -var addRoot; -var removeRoot; -var getRootIDs; - -if (canUseCollections) { - var itemMap = new Map(); - var rootIDSet = new Set(); - - setItem = function (id, item) { - itemMap.set(id, item); - }; - getItem = function (id) { - return itemMap.get(id); - }; - removeItem = function (id) { - itemMap['delete'](id); - }; - getItemIDs = function () { - return Array.from(itemMap.keys()); - }; - - addRoot = function (id) { - rootIDSet.add(id); - }; - removeRoot = function (id) { - rootIDSet['delete'](id); - }; - getRootIDs = function () { - return Array.from(rootIDSet.keys()); - }; -} else { - var itemByKey = {}; - var rootByKey = {}; - - // Use non-numeric keys to prevent V8 performance issues: - // https://github.com/facebook/react/pull/7232 - var getKeyFromID = function (id) { - return '.' + id; - }; - var getIDFromKey = function (key) { - return parseInt(key.substr(1), 10); - }; - - setItem = function (id, item) { - var key = getKeyFromID(id); - itemByKey[key] = item; - }; - getItem = function (id) { - var key = getKeyFromID(id); - return itemByKey[key]; - }; - removeItem = function (id) { - var key = getKeyFromID(id); - delete itemByKey[key]; - }; - getItemIDs = function () { - return Object.keys(itemByKey).map(getIDFromKey); - }; - - addRoot = function (id) { - var key = getKeyFromID(id); - rootByKey[key] = true; - }; - removeRoot = function (id) { - var key = getKeyFromID(id); - delete rootByKey[key]; - }; - getRootIDs = function () { - return Object.keys(rootByKey).map(getIDFromKey); - }; -} - -var unmountedIDs = []; - -function purgeDeep(id) { - var item = getItem(id); - if (item) { - var childIDs = item.childIDs; - - removeItem(id); - childIDs.forEach(purgeDeep); - } -} - -function describeComponentFrame(name, source, ownerName) { - return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : ''); -} - -function getDisplayName(element) { - if (element == null) { - return '#empty'; - } else if (typeof element === 'string' || typeof element === 'number') { - return '#text'; - } else if (typeof element.type === 'string') { - return element.type; - } else { - return element.type.displayName || element.type.name || 'Unknown'; - } -} - -function describeID(id) { - var name = ReactComponentTreeHook.getDisplayName(id); - var element = ReactComponentTreeHook.getElement(id); - var ownerID = ReactComponentTreeHook.getOwnerID(id); - var ownerName; - if (ownerID) { - ownerName = ReactComponentTreeHook.getDisplayName(ownerID); - } - process.env.NODE_ENV !== 'production' ? warning(element, 'ReactComponentTreeHook: Missing React element for debugID %s when ' + 'building stack', id) : void 0; - return describeComponentFrame(name, element && element._source, ownerName); -} - -var ReactComponentTreeHook = { - onSetChildren: function (id, nextChildIDs) { - var item = getItem(id); - !item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0; - item.childIDs = nextChildIDs; - - for (var i = 0; i < nextChildIDs.length; i++) { - var nextChildID = nextChildIDs[i]; - var nextChild = getItem(nextChildID); - !nextChild ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected hook events to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('140') : void 0; - !(nextChild.childIDs != null || typeof nextChild.element !== 'object' || nextChild.element == null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onSetChildren() to fire for a container child before its parent includes it in onSetChildren().') : _prodInvariant('141') : void 0; - !nextChild.isMounted ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onMountComponent() to fire for the child before its parent includes it in onSetChildren().') : _prodInvariant('71') : void 0; - if (nextChild.parentID == null) { - nextChild.parentID = id; - // TODO: This shouldn't be necessary but mounting a new root during in - // componentWillMount currently causes not-yet-mounted components to - // be purged from our tree data so their parent id is missing. - } - !(nextChild.parentID === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Expected onBeforeMountComponent() parent and onSetChildren() to be consistent (%s has parents %s and %s).', nextChildID, nextChild.parentID, id) : _prodInvariant('142', nextChildID, nextChild.parentID, id) : void 0; - } - }, - onBeforeMountComponent: function (id, element, parentID) { - var item = { - element: element, - parentID: parentID, - text: null, - childIDs: [], - isMounted: false, - updateCount: 0 - }; - setItem(id, item); - }, - onBeforeUpdateComponent: function (id, element) { - var item = getItem(id); - if (!item || !item.isMounted) { - // We may end up here as a result of setState() in componentWillUnmount(). - // In this case, ignore the element. - return; - } - item.element = element; - }, - onMountComponent: function (id) { - var item = getItem(id); - !item ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Item must have been set') : _prodInvariant('144') : void 0; - item.isMounted = true; - var isRoot = item.parentID === 0; - if (isRoot) { - addRoot(id); - } - }, - onUpdateComponent: function (id) { - var item = getItem(id); - if (!item || !item.isMounted) { - // We may end up here as a result of setState() in componentWillUnmount(). - // In this case, ignore the element. - return; - } - item.updateCount++; - }, - onUnmountComponent: function (id) { - var item = getItem(id); - if (item) { - // We need to check if it exists. - // `item` might not exist if it is inside an error boundary, and a sibling - // error boundary child threw while mounting. Then this instance never - // got a chance to mount, but it still gets an unmounting event during - // the error boundary cleanup. - item.isMounted = false; - var isRoot = item.parentID === 0; - if (isRoot) { - removeRoot(id); - } - } - unmountedIDs.push(id); - }, - purgeUnmountedComponents: function () { - if (ReactComponentTreeHook._preventPurging) { - // Should only be used for testing. - return; - } - - for (var i = 0; i < unmountedIDs.length; i++) { - var id = unmountedIDs[i]; - purgeDeep(id); - } - unmountedIDs.length = 0; - }, - isMounted: function (id) { - var item = getItem(id); - return item ? item.isMounted : false; - }, - getCurrentStackAddendum: function (topElement) { - var info = ''; - if (topElement) { - var name = getDisplayName(topElement); - var owner = topElement._owner; - info += describeComponentFrame(name, topElement._source, owner && owner.getName()); - } - - var currentOwner = ReactCurrentOwner.current; - var id = currentOwner && currentOwner._debugID; - - info += ReactComponentTreeHook.getStackAddendumByID(id); - return info; - }, - getStackAddendumByID: function (id) { - var info = ''; - while (id) { - info += describeID(id); - id = ReactComponentTreeHook.getParentID(id); - } - return info; - }, - getChildIDs: function (id) { - var item = getItem(id); - return item ? item.childIDs : []; - }, - getDisplayName: function (id) { - var element = ReactComponentTreeHook.getElement(id); - if (!element) { - return null; - } - return getDisplayName(element); - }, - getElement: function (id) { - var item = getItem(id); - return item ? item.element : null; - }, - getOwnerID: function (id) { - var element = ReactComponentTreeHook.getElement(id); - if (!element || !element._owner) { - return null; - } - return element._owner._debugID; - }, - getParentID: function (id) { - var item = getItem(id); - return item ? item.parentID : null; - }, - getSource: function (id) { - var item = getItem(id); - var element = item ? item.element : null; - var source = element != null ? element._source : null; - return source; - }, - getText: function (id) { - var element = ReactComponentTreeHook.getElement(id); - if (typeof element === 'string') { - return element; - } else if (typeof element === 'number') { - return '' + element; - } else { - return null; - } - }, - getUpdateCount: function (id) { - var item = getItem(id); - return item ? item.updateCount : 0; - }, - - - getRootIDs: getRootIDs, - getRegisteredIDs: getItemIDs, - - pushNonStandardWarningStack: function (isCreatingElement, currentSource) { - if (typeof console.reactStack !== 'function') { - return; - } - - var stack = []; - var currentOwner = ReactCurrentOwner.current; - var id = currentOwner && currentOwner._debugID; - - try { - if (isCreatingElement) { - stack.push({ - name: id ? ReactComponentTreeHook.getDisplayName(id) : null, - fileName: currentSource ? currentSource.fileName : null, - lineNumber: currentSource ? currentSource.lineNumber : null - }); - } - - while (id) { - var element = ReactComponentTreeHook.getElement(id); - var parentID = ReactComponentTreeHook.getParentID(id); - var ownerID = ReactComponentTreeHook.getOwnerID(id); - var ownerName = ownerID ? ReactComponentTreeHook.getDisplayName(ownerID) : null; - var source = element && element._source; - stack.push({ - name: ownerName, - fileName: source ? source.fileName : null, - lineNumber: source ? source.lineNumber : null - }); - id = parentID; - } - } catch (err) { - // Internal state is messed up. - // Stop building the stack (it's just a nice to have). - } - - console.reactStack(stack); - }, - popNonStandardWarningStack: function () { - if (typeof console.reactStackEnd !== 'function') { - return; - } - console.reactStackEnd(); - } -}; - -module.exports = ReactComponentTreeHook; -}).call(this,require('_process')) -},{"./ReactCurrentOwner":251,"./reactProdInvariant":267,"_process":187,"fbjs/lib/invariant":6,"fbjs/lib/warning":7}],251:[function(require,module,exports){ -/** - * 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. - * - * - */ - -'use strict'; - -/** - * Keeps track of the current owner. - * - * The current owner is the component who should own any components that are - * currently being constructed. - */ -var ReactCurrentOwner = { - /** - * @internal - * @type {ReactComponent} - */ - current: null -}; - -module.exports = ReactCurrentOwner; -},{}],252:[function(require,module,exports){ -(function (process){ -/** - * 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. - * - */ - -'use strict'; - -var ReactElement = require('./ReactElement'); - -/** - * Create a factory that creates HTML tag elements. - * - * @private - */ -var createDOMFactory = ReactElement.createFactory; -if (process.env.NODE_ENV !== 'production') { - var ReactElementValidator = require('./ReactElementValidator'); - createDOMFactory = ReactElementValidator.createFactory; -} - -/** - * Creates a mapping from supported HTML tags to `ReactDOMComponent` classes. - * - * @public - */ -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') -}; - -module.exports = ReactDOMFactories; -}).call(this,require('_process')) -},{"./ReactElement":253,"./ReactElementValidator":255,"_process":187}],253:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2014-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. - * - */ - -'use strict'; - -var _assign = require('object-assign'); - -var ReactCurrentOwner = require('./ReactCurrentOwner'); - -var warning = require('fbjs/lib/warning'); -var canDefineProperty = require('./canDefineProperty'); -var hasOwnProperty = Object.prototype.hasOwnProperty; - -var REACT_ELEMENT_TYPE = require('./ReactElementSymbol'); - -var RESERVED_PROPS = { - key: true, - ref: true, - __self: true, - __source: true -}; - -var specialPropKeyWarningShown, specialPropRefWarningShown; - -function hasValidRef(config) { - if (process.env.NODE_ENV !== 'production') { - if (hasOwnProperty.call(config, 'ref')) { - var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; - if (getter && getter.isReactWarning) { - return false; - } - } - } - return config.ref !== undefined; -} - -function hasValidKey(config) { - if (process.env.NODE_ENV !== 'production') { - if (hasOwnProperty.call(config, 'key')) { - var getter = Object.getOwnPropertyDescriptor(config, 'key').get; - if (getter && getter.isReactWarning) { - return false; - } - } - } - return config.key !== undefined; -} - -function defineKeyPropWarningGetter(props, displayName) { - var warnAboutAccessingKey = function () { - if (!specialPropKeyWarningShown) { - specialPropKeyWarningShown = true; - process.env.NODE_ENV !== 'production' ? warning(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0; - } - }; - warnAboutAccessingKey.isReactWarning = true; - Object.defineProperty(props, 'key', { - get: warnAboutAccessingKey, - configurable: true - }); -} - -function defineRefPropWarningGetter(props, displayName) { - var warnAboutAccessingRef = function () { - if (!specialPropRefWarningShown) { - specialPropRefWarningShown = true; - process.env.NODE_ENV !== 'production' ? warning(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName) : void 0; - } - }; - warnAboutAccessingRef.isReactWarning = true; - Object.defineProperty(props, 'ref', { - get: warnAboutAccessingRef, - configurable: true - }); -} - -/** - * Factory method to create a new React element. This no longer adheres to - * the class pattern, so do not use new to call it. Also, no instanceof check - * will work. Instead test $$typeof field against Symbol.for('react.element') to check - * if something is a React Element. - * - * @param {*} type - * @param {*} key - * @param {string|object} ref - * @param {*} self A *temporary* helper to detect places where `this` is - * different from the `owner` when React.createElement is called, so that we - * can warn. We want to get rid of owner and replace string `ref`s with arrow - * functions, and as long as `this` and owner are the same, there will be no - * change in behavior. - * @param {*} source An annotation object (added by a transpiler or otherwise) - * indicating filename, line number, and/or other information. - * @param {*} owner - * @param {*} props - * @internal - */ -var ReactElement = function (type, key, ref, self, source, owner, props) { - var element = { - // This tag allow us to uniquely identify this as a React Element - $$typeof: REACT_ELEMENT_TYPE, - - // Built-in properties that belong on the element - type: type, - key: key, - ref: ref, - props: props, - - // Record the component responsible for creating this element. - _owner: owner - }; - - if (process.env.NODE_ENV !== 'production') { - // The validation flag is currently mutative. We put it on - // an external backing store so that we can freeze the whole object. - // This can be replaced with a WeakMap once they are implemented in - // commonly used development environments. - element._store = {}; - - // To make comparing ReactElements easier for testing purposes, we make - // the validation flag non-enumerable (where possible, which should - // include every environment we run tests in), so the test framework - // ignores it. - if (canDefineProperty) { - Object.defineProperty(element._store, 'validated', { - configurable: false, - enumerable: false, - writable: true, - value: false - }); - // self and source are DEV only properties. - Object.defineProperty(element, '_self', { - configurable: false, - enumerable: false, - writable: false, - value: self - }); - // Two elements created in two different places should be considered - // equal for testing purposes and therefore we hide it from enumeration. - Object.defineProperty(element, '_source', { - configurable: false, - enumerable: false, - writable: false, - value: source - }); - } else { - element._store.validated = false; - element._self = self; - element._source = source; - } - if (Object.freeze) { - Object.freeze(element.props); - Object.freeze(element); - } - } - - return element; -}; - -/** - * Create and return a new ReactElement of the given type. - * See https://facebook.github.io/react/docs/top-level-api.html#react.createelement - */ -ReactElement.createElement = function (type, config, children) { - var propName; - - // Reserved names are extracted - var props = {}; - - var key = null; - var ref = null; - var self = null; - var source = null; - - if (config != null) { - if (hasValidRef(config)) { - ref = config.ref; - } - if (hasValidKey(config)) { - key = '' + config.key; - } - - self = config.__self === undefined ? null : config.__self; - source = config.__source === undefined ? null : config.__source; - // Remaining properties are added to a new props object - for (propName in config) { - if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { - props[propName] = config[propName]; - } - } - } - - // Children can be more than one argument, and those are transferred onto - // the newly allocated props object. - var childrenLength = arguments.length - 2; - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = Array(childrenLength); - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 2]; - } - if (process.env.NODE_ENV !== 'production') { - if (Object.freeze) { - Object.freeze(childArray); - } - } - props.children = childArray; - } - - // Resolve default props - if (type && type.defaultProps) { - var defaultProps = type.defaultProps; - for (propName in defaultProps) { - if (props[propName] === undefined) { - props[propName] = defaultProps[propName]; - } - } - } - if (process.env.NODE_ENV !== 'production') { - if (key || ref) { - if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) { - var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; - if (key) { - defineKeyPropWarningGetter(props, displayName); - } - if (ref) { - defineRefPropWarningGetter(props, displayName); - } - } - } - } - return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); -}; - -/** - * Return a function that produces ReactElements of a given type. - * See https://facebook.github.io/react/docs/top-level-api.html#react.createfactory - */ -ReactElement.createFactory = function (type) { - var factory = ReactElement.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. - // Legacy hook TODO: Warn if this is accessed - factory.type = type; - return factory; -}; - -ReactElement.cloneAndReplaceKey = function (oldElement, newKey) { - var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); - - return newElement; -}; - -/** - * Clone and return a new ReactElement using element as the starting point. - * See https://facebook.github.io/react/docs/top-level-api.html#react.cloneelement - */ -ReactElement.cloneElement = function (element, config, children) { - var propName; - - // Original props are copied - var props = _assign({}, element.props); - - // Reserved names are extracted - var key = element.key; - var ref = element.ref; - // Self is preserved since the owner is preserved. - var self = element._self; - // Source is preserved since cloneElement is unlikely to be targeted by a - // transpiler, and the original source is probably a better indicator of the - // true owner. - var source = element._source; - - // Owner will be preserved, unless ref is overridden - var owner = element._owner; - - if (config != null) { - if (hasValidRef(config)) { - // Silently steal the ref from the parent. - ref = config.ref; - owner = ReactCurrentOwner.current; - } - if (hasValidKey(config)) { - key = '' + config.key; - } - - // Remaining properties override existing props - var defaultProps; - if (element.type && element.type.defaultProps) { - defaultProps = element.type.defaultProps; - } - for (propName in config) { - if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { - if (config[propName] === undefined && defaultProps !== undefined) { - // Resolve default props - props[propName] = defaultProps[propName]; - } else { - props[propName] = config[propName]; - } - } - } - } - - // Children can be more than one argument, and those are transferred onto - // the newly allocated props object. - var childrenLength = arguments.length - 2; - if (childrenLength === 1) { - props.children = children; - } else if (childrenLength > 1) { - var childArray = Array(childrenLength); - for (var i = 0; i < childrenLength; i++) { - childArray[i] = arguments[i + 2]; - } - props.children = childArray; - } - - return ReactElement(element.type, key, ref, self, source, owner, props); -}; - -/** - * Verifies the object is a ReactElement. - * See https://facebook.github.io/react/docs/top-level-api.html#react.isvalidelement - * @param {?object} object - * @return {boolean} True if `object` is a valid component. - * @final - */ -ReactElement.isValidElement = function (object) { - return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; -}; - -module.exports = ReactElement; -}).call(this,require('_process')) -},{"./ReactCurrentOwner":251,"./ReactElementSymbol":254,"./canDefineProperty":261,"_process":187,"fbjs/lib/warning":7,"object-assign":173}],254:[function(require,module,exports){ -/** - * Copyright 2014-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. - * - * - */ - -'use strict'; - -// The Symbol used to tag the ReactElement type. If there is no native Symbol -// nor polyfill, then a plain number is used for performance. - -var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7; - -module.exports = REACT_ELEMENT_TYPE; -},{}],255:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2014-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. - * - */ - -/** - * ReactElementValidator provides a wrapper around a element factory - * which validates the props passed to the element. This is intended to be - * used only in DEV and could be replaced by a static type checker for languages - * that support it. - */ - -'use strict'; - -var ReactCurrentOwner = require('./ReactCurrentOwner'); -var ReactComponentTreeHook = require('./ReactComponentTreeHook'); -var ReactElement = require('./ReactElement'); - -var checkReactTypeSpec = require('./checkReactTypeSpec'); - -var canDefineProperty = require('./canDefineProperty'); -var getIteratorFn = require('./getIteratorFn'); -var warning = require('fbjs/lib/warning'); -var lowPriorityWarning = require('./lowPriorityWarning'); - -function getDeclarationErrorAddendum() { - if (ReactCurrentOwner.current) { - var name = ReactCurrentOwner.current.getName(); - if (name) { - return ' Check the render method of `' + name + '`.'; - } - } - return ''; -} - -function getSourceInfoErrorAddendum(elementProps) { - if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) { - var source = elementProps.__source; - var fileName = source.fileName.replace(/^.*[\\\/]/, ''); - var lineNumber = source.lineNumber; - return ' Check your code at ' + fileName + ':' + lineNumber + '.'; - } - return ''; -} - -/** - * Warn if there's no key explicitly set on dynamic arrays of children or - * object keys are not valid. This allows us to keep track of children between - * updates. - */ -var ownerHasKeyUseWarning = {}; - -function getCurrentComponentErrorInfo(parentType) { - var info = getDeclarationErrorAddendum(); - - if (!info) { - var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; - if (parentName) { - info = ' Check the top-level render call using <' + parentName + '>.'; - } - } - return info; -} - -/** - * Warn if the element doesn't have an explicit key assigned to it. - * This element is in an array. The array could grow and shrink or be - * reordered. All children that haven't already been validated are required to - * have a "key" property assigned to it. Error statuses are cached so a warning - * will only be shown once. - * - * @internal - * @param {ReactElement} element Element that requires a key. - * @param {*} parentType element's parent's type. - */ -function validateExplicitKey(element, parentType) { - if (!element._store || element._store.validated || element.key != null) { - return; - } - element._store.validated = true; - - var memoizer = ownerHasKeyUseWarning.uniqueKey || (ownerHasKeyUseWarning.uniqueKey = {}); - - var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); - if (memoizer[currentComponentErrorInfo]) { - return; - } - memoizer[currentComponentErrorInfo] = true; - - // Usually the current owner is the offender, but if it accepts children as a - // property, it may be the creator of the child that's responsible for - // assigning it a key. - var childOwner = ''; - if (element && element._owner && element._owner !== ReactCurrentOwner.current) { - // Give the component that originally created this child. - childOwner = ' It was passed a child from ' + element._owner.getName() + '.'; - } - - process.env.NODE_ENV !== 'production' ? warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, ReactComponentTreeHook.getCurrentStackAddendum(element)) : void 0; -} - -/** - * Ensure that every element either is passed in a static location, in an - * array with an explicit keys property defined, or in an object literal - * with valid key property. - * - * @internal - * @param {ReactNode} node Statically passed child of any type. - * @param {*} parentType node's parent's type. - */ -function validateChildKeys(node, parentType) { - if (typeof node !== 'object') { - return; - } - if (Array.isArray(node)) { - for (var i = 0; i < node.length; i++) { - var child = node[i]; - if (ReactElement.isValidElement(child)) { - validateExplicitKey(child, parentType); - } - } - } else if (ReactElement.isValidElement(node)) { - // This element was passed in a valid location. - if (node._store) { - node._store.validated = true; - } - } else if (node) { - var iteratorFn = getIteratorFn(node); - // Entry iterators provide implicit keys. - if (iteratorFn) { - if (iteratorFn !== node.entries) { - var iterator = iteratorFn.call(node); - var step; - while (!(step = iterator.next()).done) { - if (ReactElement.isValidElement(step.value)) { - validateExplicitKey(step.value, parentType); - } - } - } - } - } -} - -/** - * Given an element, validate that its props follow the propTypes definition, - * provided by the type. - * - * @param {ReactElement} element - */ -function validatePropTypes(element) { - var componentClass = element.type; - if (typeof componentClass !== 'function') { - return; - } - var name = componentClass.displayName || componentClass.name; - if (componentClass.propTypes) { - checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name, element, null); - } - if (typeof componentClass.getDefaultProps === 'function') { - process.env.NODE_ENV !== 'production' ? warning(componentClass.getDefaultProps.isReactClassApproved, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0; - } -} - -var ReactElementValidator = { - createElement: function (type, props, children) { - var validType = typeof type === 'string' || typeof type === 'function'; - // We warn in this case but don't throw. We expect the element creation to - // succeed and there will likely be errors in render. - if (!validType) { - if (typeof type !== 'function' && typeof type !== 'string') { - var info = ''; - if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { - info += ' You likely forgot to export your component from the file ' + "it's defined in."; - } - - var sourceInfo = getSourceInfoErrorAddendum(props); - if (sourceInfo) { - info += sourceInfo; - } else { - info += getDeclarationErrorAddendum(); - } - - info += ReactComponentTreeHook.getCurrentStackAddendum(); - - var currentSource = props !== null && props !== undefined && props.__source !== undefined ? props.__source : null; - ReactComponentTreeHook.pushNonStandardWarningStack(true, currentSource); - process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0; - ReactComponentTreeHook.popNonStandardWarningStack(); - } - } - - var element = ReactElement.createElement.apply(this, arguments); - - // The result can be nullish if a mock or a custom function is used. - // TODO: Drop this when these are no longer allowed as the type argument. - if (element == null) { - return element; - } - - // Skip key warning if the type isn't valid since our key validation logic - // doesn't expect a non-string/function type and can throw confusing errors. - // We don't want exception behavior to differ between dev and prod. - // (Rendering will throw with a helpful message and as soon as the type is - // fixed, the key warnings will appear.) - if (validType) { - for (var i = 2; i < arguments.length; i++) { - validateChildKeys(arguments[i], type); - } - } - - validatePropTypes(element); - - return element; - }, - - createFactory: function (type) { - var validatedFactory = ReactElementValidator.createElement.bind(null, type); - // Legacy hook TODO: Warn if this is accessed - validatedFactory.type = type; - - if (process.env.NODE_ENV !== 'production') { - if (canDefineProperty) { - Object.defineProperty(validatedFactory, 'type', { - enumerable: false, - get: function () { - lowPriorityWarning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); - Object.defineProperty(this, 'type', { - value: type - }); - return type; - } - }); - } - } - - return validatedFactory; - }, - - cloneElement: function (element, props, children) { - var newElement = ReactElement.cloneElement.apply(this, arguments); - for (var i = 2; i < arguments.length; i++) { - validateChildKeys(arguments[i], newElement.type); - } - validatePropTypes(newElement); - return newElement; - } -}; - -module.exports = ReactElementValidator; -}).call(this,require('_process')) -},{"./ReactComponentTreeHook":250,"./ReactCurrentOwner":251,"./ReactElement":253,"./canDefineProperty":261,"./checkReactTypeSpec":262,"./getIteratorFn":264,"./lowPriorityWarning":265,"_process":187,"fbjs/lib/warning":7}],256:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2015-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. - * - */ - -'use strict'; - -var warning = require('fbjs/lib/warning'); - -function warnNoop(publicInstance, callerName) { - if (process.env.NODE_ENV !== 'production') { - var constructor = publicInstance.constructor; - process.env.NODE_ENV !== 'production' ? warning(false, '%s(...): Can only update a mounted or mounting component. ' + 'This usually means you called %s() on an unmounted component. ' + 'This is a no-op. Please check the code for the %s component.', callerName, callerName, constructor && (constructor.displayName || constructor.name) || 'ReactClass') : void 0; - } -} - -/** - * This is the abstract API for an update queue. - */ -var ReactNoopUpdateQueue = { - /** - * Checks whether or not this composite component is mounted. - * @param {ReactClass} publicInstance The instance we want to test. - * @return {boolean} True if mounted, false otherwise. - * @protected - * @final - */ - isMounted: function (publicInstance) { - return false; - }, - - /** - * Enqueue a callback that will be executed after all the pending updates - * have processed. - * - * @param {ReactClass} publicInstance The instance to use as `this` context. - * @param {?function} callback Called after state is updated. - * @internal - */ - enqueueCallback: function (publicInstance, callback) {}, - - /** - * Forces an update. This should only be invoked when it is known with - * certainty that we are **not** in a DOM transaction. - * - * You may want to call this when you know that some deeper aspect of the - * component's state has changed but `setState` was not called. - * - * This will not invoke `shouldComponentUpdate`, but it will invoke - * `componentWillUpdate` and `componentDidUpdate`. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @internal - */ - enqueueForceUpdate: function (publicInstance) { - warnNoop(publicInstance, 'forceUpdate'); - }, - - /** - * Replaces all of the state. Always use this or `setState` to mutate state. - * You should treat `this.state` as immutable. - * - * There is no guarantee that `this.state` will be immediately updated, so - * accessing `this.state` after calling this method may return the old value. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @param {object} completeState Next state. - * @internal - */ - enqueueReplaceState: function (publicInstance, completeState) { - warnNoop(publicInstance, 'replaceState'); - }, - - /** - * Sets a subset of the state. This only exists because _pendingState is - * internal. This provides a merging strategy that is not available to deep - * properties which is confusing. TODO: Expose pendingState or don't use it - * during the merge. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @param {object} partialState Next partial state to be merged with state. - * @internal - */ - enqueueSetState: function (publicInstance, partialState) { - warnNoop(publicInstance, 'setState'); - } -}; - -module.exports = ReactNoopUpdateQueue; -}).call(this,require('_process')) -},{"_process":187,"fbjs/lib/warning":7}],257:[function(require,module,exports){ -(function (process){ -/** - * 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. - * - * - */ - -'use strict'; - -var ReactPropTypeLocationNames = {}; - -if (process.env.NODE_ENV !== 'production') { - ReactPropTypeLocationNames = { - prop: 'prop', - context: 'context', - childContext: 'child context' - }; -} - -module.exports = ReactPropTypeLocationNames; -}).call(this,require('_process')) -},{"_process":187}],258:[function(require,module,exports){ -/** - * 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. - * - */ - -'use strict'; - -var _require = require('./ReactElement'), - isValidElement = _require.isValidElement; - -var factory = require('prop-types/factory'); - -module.exports = factory(isValidElement); -},{"./ReactElement":253,"prop-types/factory":189}],259:[function(require,module,exports){ -/** - * 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. - * - * - */ - -'use strict'; - -var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; - -module.exports = ReactPropTypesSecret; -},{}],260:[function(require,module,exports){ -/** - * 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. - * - */ - -'use strict'; - -module.exports = '15.6.1'; -},{}],261:[function(require,module,exports){ -(function (process){ -/** - * 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. - * - * - */ - -'use strict'; - -var canDefineProperty = false; -if (process.env.NODE_ENV !== 'production') { - try { - // $FlowFixMe https://github.com/facebook/flow/issues/285 - Object.defineProperty({}, 'x', { get: function () {} }); - canDefineProperty = true; - } catch (x) { - // IE will fail on defineProperty - } -} - -module.exports = canDefineProperty; -}).call(this,require('_process')) -},{"_process":187}],262:[function(require,module,exports){ -(function (process){ -/** - * 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. - * - */ - -'use strict'; - -var _prodInvariant = require('./reactProdInvariant'); - -var ReactPropTypeLocationNames = require('./ReactPropTypeLocationNames'); -var ReactPropTypesSecret = require('./ReactPropTypesSecret'); - -var invariant = require('fbjs/lib/invariant'); -var warning = require('fbjs/lib/warning'); - -var ReactComponentTreeHook; - -if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'test') { - // Temporary hack. - // Inline requires don't work well with Jest: - // https://github.com/facebook/react/issues/7240 - // Remove the inline requires when we don't need them anymore: - // https://github.com/facebook/react/pull/7178 - ReactComponentTreeHook = require('./ReactComponentTreeHook'); -} - -var loggedTypeFailures = {}; - -/** - * Assert that the values match with the type specs. - * Error messages are memorized and will only be shown once. - * - * @param {object} typeSpecs Map of name to a ReactPropType - * @param {object} values Runtime values that need to be type-checked - * @param {string} location e.g. "prop", "context", "child context" - * @param {string} componentName Name of the component for error messages. - * @param {?object} element The React element that is being type-checked - * @param {?number} debugID The React component instance that is being type-checked - * @private - */ -function checkReactTypeSpec(typeSpecs, values, location, componentName, element, debugID) { - for (var typeSpecName in typeSpecs) { - if (typeSpecs.hasOwnProperty(typeSpecName)) { - var error; - // Prop type validation may throw. In case they do, we don't want to - // fail the render phase where it didn't fail before. So we log it. - // After these have been cleaned up, we'll let them throw. - try { - // This is intentionally an invariant that gets caught. It's the same - // behavior as without this statement except with a better message. - !(typeof typeSpecs[typeSpecName] === 'function') ? process.env.NODE_ENV !== 'production' ? invariant(false, '%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : _prodInvariant('84', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName) : void 0; - error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); - } catch (ex) { - error = ex; - } - process.env.NODE_ENV !== 'production' ? warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', ReactPropTypeLocationNames[location], typeSpecName, typeof error) : void 0; - if (error instanceof Error && !(error.message in loggedTypeFailures)) { - // Only monitor this failure once because there tends to be a lot of the - // same error. - loggedTypeFailures[error.message] = true; - - var componentStackInfo = ''; - - if (process.env.NODE_ENV !== 'production') { - if (!ReactComponentTreeHook) { - ReactComponentTreeHook = require('./ReactComponentTreeHook'); - } - if (debugID !== null) { - componentStackInfo = ReactComponentTreeHook.getStackAddendumByID(debugID); - } else if (element !== null) { - componentStackInfo = ReactComponentTreeHook.getCurrentStackAddendum(element); - } - } - - process.env.NODE_ENV !== 'production' ? warning(false, 'Failed %s type: %s%s', location, error.message, componentStackInfo) : void 0; - } - } - } -} - -module.exports = checkReactTypeSpec; -}).call(this,require('_process')) -},{"./ReactComponentTreeHook":250,"./ReactPropTypeLocationNames":257,"./ReactPropTypesSecret":259,"./reactProdInvariant":267,"_process":187,"fbjs/lib/invariant":6,"fbjs/lib/warning":7}],263:[function(require,module,exports){ -/** - * 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. - * - */ - -'use strict'; - -var _require = require('./ReactBaseClasses'), - Component = _require.Component; - -var _require2 = require('./ReactElement'), - isValidElement = _require2.isValidElement; - -var ReactNoopUpdateQueue = require('./ReactNoopUpdateQueue'); -var factory = require('create-react-class/factory'); - -module.exports = factory(Component, isValidElement, ReactNoopUpdateQueue); -},{"./ReactBaseClasses":248,"./ReactElement":253,"./ReactNoopUpdateQueue":256,"create-react-class/factory":2}],264:[function(require,module,exports){ -/** - * 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. - * - * - */ - -'use strict'; - -/* global Symbol */ - -var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; -var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. - -/** - * Returns the iterator method function contained on the iterable object. - * - * Be sure to invoke the function with the iterable as context: - * - * var iteratorFn = getIteratorFn(myIterable); - * if (iteratorFn) { - * var iterator = iteratorFn.call(myIterable); - * ... - * } - * - * @param {?object} maybeIterable - * @return {?function} - */ -function getIteratorFn(maybeIterable) { - var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); - if (typeof iteratorFn === 'function') { - return iteratorFn; - } -} - -module.exports = getIteratorFn; -},{}],265:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2014-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 strict'; - -/** - * Forked from fbjs/warning: - * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js - * - * Only change is we use console.warn instead of console.error, - * and do nothing when 'console' is not supported. - * This really simplifies the code. - * --- - * Similar to invariant but only logs a warning if the condition is not met. - * This can be used to log issues in development environments in critical - * paths. Removing the logging code for production environments will keep the - * same logic and follow the same code paths. - */ - -var lowPriorityWarning = function () {}; - -if (process.env.NODE_ENV !== 'production') { - var printWarning = function (format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - var argIndex = 0; - var message = 'Warning: ' + format.replace(/%s/g, function () { - return args[argIndex++]; - }); - if (typeof console !== 'undefined') { - console.warn(message); - } - try { - // --- Welcome to debugging React --- - // This error was thrown as a convenience so that you can use this stack - // to find the callsite that caused this warning to fire. - throw new Error(message); - } catch (x) {} - }; - - lowPriorityWarning = function (condition, format) { - if (format === undefined) { - throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); - } - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { - args[_key2 - 2] = arguments[_key2]; - } - - printWarning.apply(undefined, [format].concat(args)); - } - }; -} - -module.exports = lowPriorityWarning; -}).call(this,require('_process')) -},{"_process":187}],266:[function(require,module,exports){ -(function (process){ -/** - * 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. - * - */ -'use strict'; - -var _prodInvariant = require('./reactProdInvariant'); - -var ReactElement = require('./ReactElement'); - -var invariant = require('fbjs/lib/invariant'); - -/** - * Returns the first child in a collection of children and verifies that there - * is only one child in the collection. - * - * See https://facebook.github.io/react/docs/top-level-api.html#react.children.only - * - * The current implementation of this function assumes that a single child gets - * passed without a wrapper, but the purpose of this helper function is to - * abstract away the particular structure of children. - * - * @param {?object} children Child collection structure. - * @return {ReactElement} The first and only `ReactElement` contained in the - * structure. - */ -function onlyChild(children) { - !ReactElement.isValidElement(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React.Children.only expected to receive a single React element child.') : _prodInvariant('143') : void 0; - return children; -} - -module.exports = onlyChild; -}).call(this,require('_process')) -},{"./ReactElement":253,"./reactProdInvariant":267,"_process":187,"fbjs/lib/invariant":6}],267:[function(require,module,exports){ -/** - * Copyright (c) 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. - * - * - */ -'use strict'; - -/** - * WARNING: DO NOT manually require this module. - * This is a replacement for `invariant(...)` used by the error code system - * and will _only_ be required by the corresponding babel pass. - * It always throws. - */ - -function reactProdInvariant(code) { - var argCount = arguments.length - 1; - - var message = 'Minified React error #' + code + '; visit ' + 'http://facebook.github.io/react/docs/error-decoder.html?invariant=' + code; - - for (var argIdx = 0; argIdx < argCount; argIdx++) { - message += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]); - } - - message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.'; - - var error = new Error(message); - error.name = 'Invariant Violation'; - error.framesToPop = 1; // we don't care about reactProdInvariant's own frame - - throw error; -} - -module.exports = reactProdInvariant; -},{}],268:[function(require,module,exports){ -(function (process){ -/** - * 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. - * - */ - -'use strict'; - -var _prodInvariant = require('./reactProdInvariant'); - -var ReactCurrentOwner = require('./ReactCurrentOwner'); -var REACT_ELEMENT_TYPE = require('./ReactElementSymbol'); - -var getIteratorFn = require('./getIteratorFn'); -var invariant = require('fbjs/lib/invariant'); -var KeyEscapeUtils = require('./KeyEscapeUtils'); -var warning = require('fbjs/lib/warning'); - -var SEPARATOR = '.'; -var SUBSEPARATOR = ':'; - -/** - * This is inlined from ReactElement since this file is shared between - * isomorphic and renderers. We could extract this to a - * - */ - -/** - * TODO: Test that a single child and an array with one item have the same key - * pattern. - */ - -var didWarnAboutMaps = false; - -/** - * Generate a key string that identifies a component within a set. - * - * @param {*} component A component that could contain a manual key. - * @param {number} index Index that is used if a manual key is not provided. - * @return {string} - */ -function getComponentKey(component, index) { - // Do some typechecking here since we call this blindly. We want to ensure - // that we don't block potential future ES APIs. - if (component && typeof component === 'object' && component.key != null) { - // Explicit key - return KeyEscapeUtils.escape(component.key); - } - // Implicit key determined by the index in the set - return index.toString(36); -} - -/** - * @param {?*} children Children tree container. - * @param {!string} nameSoFar Name of the key path so far. - * @param {!function} callback Callback to invoke with each child found. - * @param {?*} traverseContext Used to pass information throughout the traversal - * process. - * @return {!number} The number of children in this subtree. - */ -function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) { - var type = typeof children; - - if (type === 'undefined' || type === 'boolean') { - // All of the above are perceived as null. - children = null; - } - - if (children === null || type === 'string' || type === 'number' || - // The following is inlined from ReactElement. This means we can optimize - // some checks. React Fiber also inlines this logic for similar purposes. - type === 'object' && children.$$typeof === REACT_ELEMENT_TYPE) { - callback(traverseContext, children, - // If it's the only child, treat the name as if it was wrapped in an array - // so that it's consistent if the number of children grows. - nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar); - return 1; - } - - var child; - var nextName; - var subtreeCount = 0; // Count of children found in the current subtree. - var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; - - if (Array.isArray(children)) { - for (var i = 0; i < children.length; i++) { - child = children[i]; - nextName = nextNamePrefix + getComponentKey(child, i); - subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); - } - } else { - var iteratorFn = getIteratorFn(children); - if (iteratorFn) { - var iterator = iteratorFn.call(children); - var step; - if (iteratorFn !== children.entries) { - var ii = 0; - while (!(step = iterator.next()).done) { - child = step.value; - nextName = nextNamePrefix + getComponentKey(child, ii++); - subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); - } - } else { - if (process.env.NODE_ENV !== 'production') { - var mapsAsChildrenAddendum = ''; - if (ReactCurrentOwner.current) { - var mapsAsChildrenOwnerName = ReactCurrentOwner.current.getName(); - if (mapsAsChildrenOwnerName) { - mapsAsChildrenAddendum = ' Check the render method of `' + mapsAsChildrenOwnerName + '`.'; - } - } - process.env.NODE_ENV !== 'production' ? warning(didWarnAboutMaps, 'Using Maps as children is not yet fully supported. It is an ' + 'experimental feature that might be removed. Convert it to a ' + 'sequence / iterable of keyed ReactElements instead.%s', mapsAsChildrenAddendum) : void 0; - didWarnAboutMaps = true; - } - // Iterator will provide entry [k,v] tuples rather than values. - while (!(step = iterator.next()).done) { - var entry = step.value; - if (entry) { - child = entry[1]; - nextName = nextNamePrefix + KeyEscapeUtils.escape(entry[0]) + SUBSEPARATOR + getComponentKey(child, 0); - subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext); - } - } - } - } else if (type === 'object') { - var addendum = ''; - if (process.env.NODE_ENV !== 'production') { - addendum = ' If you meant to render a collection of children, use an array ' + 'instead or wrap the object using createFragment(object) from the ' + 'React add-ons.'; - if (children._isReactElement) { - addendum = " It looks like you're using an element created by a different " + 'version of React. Make sure to use only one copy of React.'; - } - if (ReactCurrentOwner.current) { - var name = ReactCurrentOwner.current.getName(); - if (name) { - addendum += ' Check the render method of `' + name + '`.'; - } - } - } - var childrenString = String(children); - !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : _prodInvariant('31', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum) : void 0; - } - } - - return subtreeCount; -} - -/** - * Traverses children that are typically specified as `props.children`, but - * might also be specified through attributes: - * - * - `traverseAllChildren(this.props.children, ...)` - * - `traverseAllChildren(this.props.leftPanelChildren, ...)` - * - * The `traverseContext` is an optional argument that is passed through the - * entire traversal. It can be used to store accumulations or anything else that - * the callback might find relevant. - * - * @param {?*} children Children tree object. - * @param {!function} callback To invoke upon traversing each child. - * @param {?*} traverseContext Context for traversal. - * @return {!number} The number of children in this subtree. - */ -function traverseAllChildren(children, callback, traverseContext) { - if (children == null) { - return 0; - } - - return traverseAllChildrenImpl(children, '', callback, traverseContext); -} - -module.exports = traverseAllChildren; -}).call(this,require('_process')) -},{"./KeyEscapeUtils":245,"./ReactCurrentOwner":251,"./ReactElementSymbol":254,"./getIteratorFn":264,"./reactProdInvariant":267,"_process":187,"fbjs/lib/invariant":6,"fbjs/lib/warning":7}],269:[function(require,module,exports){ -'use strict'; - -module.exports = require('./lib/React'); - -},{"./lib/React":247}],270:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.autoprefix = undefined; - -var _forOwn2 = require('lodash/forOwn'); - -var _forOwn3 = _interopRequireDefault(_forOwn2); - -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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var transforms = { - borderRadius: function borderRadius(value) { - return { - msBorderRadius: value, - MozBorderRadius: value, - OBorderRadius: value, - WebkitBorderRadius: value, - borderRadius: value - }; - }, - boxShadow: function boxShadow(value) { - return { - msBoxShadow: value, - MozBoxShadow: value, - OBoxShadow: value, - WebkitBoxShadow: value, - boxShadow: value - }; - }, - userSelect: function userSelect(value) { - return { - WebkitTouchCallout: value, - KhtmlUserSelect: value, - MozUserSelect: value, - msUserSelect: value, - WebkitUserSelect: value, - userSelect: value - }; - }, - - flex: function flex(value) { - return { - WebkitBoxFlex: value, - MozBoxFlex: value, - WebkitFlex: value, - msFlex: value, - flex: value - }; - }, - flexBasis: function flexBasis(value) { - return { - WebkitFlexBasis: value, - flexBasis: value - }; - }, - justifyContent: function justifyContent(value) { - return { - WebkitJustifyContent: value, - justifyContent: value - }; - }, - - transition: function transition(value) { - return { - msTransition: value, - MozTransition: value, - OTransition: value, - WebkitTransition: value, - transition: value - }; - }, - - transform: function transform(value) { - return { - msTransform: value, - MozTransform: value, - OTransform: value, - WebkitTransform: value, - transform: value - }; - }, - absolute: function absolute(value) { - var direction = value && value.split(' '); - return { - position: 'absolute', - top: direction && direction[0], - right: direction && direction[1], - bottom: direction && direction[2], - left: direction && direction[3] - }; - }, - extend: function extend(name, otherElementStyles) { - var otherStyle = otherElementStyles[name]; - if (otherStyle) { - return otherStyle; - } - return { - 'extend': name - }; - } -}; - -var autoprefix = exports.autoprefix = function autoprefix(elements) { - var prefixed = {}; - (0, _forOwn3.default)(elements, function (styles, element) { - var expanded = {}; - (0, _forOwn3.default)(styles, function (value, key) { - var transform = transforms[key]; - if (transform) { - expanded = _extends({}, expanded, transform(value)); - } else { - expanded[key] = value; - } - }); - prefixed[element] = expanded; - }); - return prefixed; -}; - -exports.default = autoprefix; -},{"lodash/forOwn":145}],271:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.active = 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; }; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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 active = exports.active = function active(Component) { - var Span = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'span'; - - return function (_React$Component) { - _inherits(Active, _React$Component); - - function Active() { - var _ref; - - var _temp, _this, _ret; - - _classCallCheck(this, Active); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Active.__proto__ || Object.getPrototypeOf(Active)).call.apply(_ref, [this].concat(args))), _this), _this.state = { active: false }, _this.handleMouseDown = function () { - return _this.setState({ active: true }); - }, _this.handleMouseUp = function () { - return _this.setState({ active: false }); - }, _this.render = function () { - return _react2.default.createElement( - Span, - { onMouseDown: _this.handleMouseDown, onMouseUp: _this.handleMouseUp }, - _react2.default.createElement(Component, _extends({}, _this.props, _this.state)) - ); - }, _temp), _possibleConstructorReturn(_this, _ret); - } - - return Active; - }(_react2.default.Component); -}; - -exports.default = active; -},{"react":269}],272:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.hover = 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; }; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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 hover = exports.hover = function hover(Component) { - var Span = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'span'; - - return function (_React$Component) { - _inherits(Hover, _React$Component); - - function Hover() { - var _ref; - - var _temp, _this, _ret; - - _classCallCheck(this, Hover); - - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Hover.__proto__ || Object.getPrototypeOf(Hover)).call.apply(_ref, [this].concat(args))), _this), _this.state = { hover: false }, _this.handleMouseOver = function () { - return _this.setState({ hover: true }); - }, _this.handleMouseOut = function () { - return _this.setState({ hover: false }); - }, _this.render = function () { - return _react2.default.createElement( - Span, - { onMouseOver: _this.handleMouseOver, onMouseOut: _this.handleMouseOut }, - _react2.default.createElement(Component, _extends({}, _this.props, _this.state)) - ); - }, _temp), _possibleConstructorReturn(_this, _ret); - } - - return Hover; - }(_react2.default.Component); -}; - -exports.default = hover; -},{"react":269}],273:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.flattenNames = undefined; - -var _isString2 = require('lodash/isString'); - -var _isString3 = _interopRequireDefault(_isString2); - -var _forOwn2 = require('lodash/forOwn'); - -var _forOwn3 = _interopRequireDefault(_forOwn2); - -var _isPlainObject2 = require('lodash/isPlainObject'); - -var _isPlainObject3 = _interopRequireDefault(_isPlainObject2); - -var _map2 = require('lodash/map'); - -var _map3 = _interopRequireDefault(_map2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var flattenNames = exports.flattenNames = function flattenNames() { - var things = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - - var names = []; - - (0, _map3.default)(things, function (thing) { - if (Array.isArray(thing)) { - flattenNames(thing).map(function (name) { - return names.push(name); - }); - } else if ((0, _isPlainObject3.default)(thing)) { - (0, _forOwn3.default)(thing, function (value, key) { - value === true && names.push(key); - names.push(key + '-' + value); - }); - } else if ((0, _isString3.default)(thing)) { - names.push(thing); - } - }); - - return names; -}; - -exports.default = flattenNames; -},{"lodash/forOwn":145,"lodash/isPlainObject":157,"lodash/isString":158,"lodash/map":163}],274:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.ReactCSS = exports.loop = exports.handleActive = exports.handleHover = exports.hover = undefined; - -var _flattenNames = require('./flattenNames'); - -var _flattenNames2 = _interopRequireDefault(_flattenNames); - -var _mergeClasses = require('./mergeClasses'); - -var _mergeClasses2 = _interopRequireDefault(_mergeClasses); - -var _autoprefix = require('./autoprefix'); - -var _autoprefix2 = _interopRequireDefault(_autoprefix); - -var _hover2 = require('./components/hover'); - -var _hover3 = _interopRequireDefault(_hover2); - -var _active = require('./components/active'); - -var _active2 = _interopRequireDefault(_active); - -var _loop2 = require('./loop'); - -var _loop3 = _interopRequireDefault(_loop2); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.hover = _hover3.default; -exports.handleHover = _hover3.default; -exports.handleActive = _active2.default; -exports.loop = _loop3.default; -var ReactCSS = exports.ReactCSS = function ReactCSS(classes) { - for (var _len = arguments.length, activations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - activations[_key - 1] = arguments[_key]; - } - - var activeNames = (0, _flattenNames2.default)(activations); - var merged = (0, _mergeClasses2.default)(classes, activeNames); - return (0, _autoprefix2.default)(merged); -}; - -exports.default = ReactCSS; -},{"./autoprefix":270,"./components/active":271,"./components/hover":272,"./flattenNames":273,"./loop":275,"./mergeClasses":276}],275:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -var loopable = function loopable(i, length) { - var props = {}; - var setProp = function setProp(name) { - var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - - props[name] = value; - }; - - i === 0 && setProp('first-child'); - i === length - 1 && setProp('last-child'); - (i === 0 || i % 2 === 0) && setProp('even'); - Math.abs(i % 2) === 1 && setProp('odd'); - setProp('nth-child', i); - - return props; -}; - -exports.default = loopable; -},{}],276:[function(require,module,exports){ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.mergeClasses = undefined; - -var _forOwn2 = require('lodash/forOwn'); - -var _forOwn3 = _interopRequireDefault(_forOwn2); - -var _cloneDeep2 = require('lodash/cloneDeep'); - -var _cloneDeep3 = _interopRequireDefault(_cloneDeep2); - -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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var mergeClasses = exports.mergeClasses = function mergeClasses(classes) { - var activeNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - - var styles = classes.default && (0, _cloneDeep3.default)(classes.default) || {}; - activeNames.map(function (name) { - var toMerge = classes[name]; - if (toMerge) { - (0, _forOwn3.default)(toMerge, function (value, key) { - if (!styles[key]) { - styles[key] = {}; - } - - styles[key] = _extends({}, styles[key], toMerge[key]); - }); - } - - return name; - }); - return styles; -}; - -exports.default = mergeClasses; -},{"lodash/cloneDeep":140,"lodash/forOwn":145}],277:[function(require,module,exports){ -// TinyColor v1.4.1 -// https://github.com/bgrins/TinyColor -// Brian Grinstead, MIT License - -(function(Math) { - -var trimLeft = /^\s+/, - trimRight = /\s+$/, - tinyCounter = 0, - mathRound = Math.round, - mathMin = Math.min, - mathMax = Math.max, - mathRandom = Math.random; - -function tinycolor (color, opts) { - - color = (color) ? color : ''; - opts = opts || { }; - - // If input is already a tinycolor, return itself - if (color instanceof tinycolor) { - return color; - } - // If we are called as a function, call using new instead - if (!(this instanceof tinycolor)) { - return new tinycolor(color, opts); - } - - var rgb = inputToRGB(color); - this._originalInput = color, - this._r = rgb.r, - this._g = rgb.g, - this._b = rgb.b, - this._a = rgb.a, - this._roundA = mathRound(100*this._a) / 100, - this._format = opts.format || rgb.format; - this._gradientType = opts.gradientType; - - // Don't let the range of [0,255] come back in [0,1]. - // Potentially lose a little bit of precision here, but will fix issues where - // .5 gets interpreted as half of the total, instead of half of 1 - // If it was supposed to be 128, this was already taken care of by `inputToRgb` - if (this._r < 1) { this._r = mathRound(this._r); } - if (this._g < 1) { this._g = mathRound(this._g); } - if (this._b < 1) { this._b = mathRound(this._b); } - - this._ok = rgb.ok; - this._tc_id = tinyCounter++; -} - -tinycolor.prototype = { - isDark: function() { - return this.getBrightness() < 128; - }, - isLight: function() { - return !this.isDark(); - }, - isValid: function() { - return this._ok; - }, - getOriginalInput: function() { - return this._originalInput; - }, - getFormat: function() { - return this._format; - }, - getAlpha: function() { - return this._a; - }, - getBrightness: function() { - //http://www.w3.org/TR/AERT#color-contrast - var rgb = this.toRgb(); - return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000; - }, - getLuminance: function() { - //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef - var rgb = this.toRgb(); - var RsRGB, GsRGB, BsRGB, R, G, B; - RsRGB = rgb.r/255; - GsRGB = rgb.g/255; - BsRGB = rgb.b/255; - - if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);} - if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);} - if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);} - return (0.2126 * R) + (0.7152 * G) + (0.0722 * B); - }, - setAlpha: function(value) { - this._a = boundAlpha(value); - this._roundA = mathRound(100*this._a) / 100; - return this; - }, - toHsv: function() { - var hsv = rgbToHsv(this._r, this._g, this._b); - return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a }; - }, - toHsvString: function() { - var hsv = rgbToHsv(this._r, this._g, this._b); - var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100); - return (this._a == 1) ? - "hsv(" + h + ", " + s + "%, " + v + "%)" : - "hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")"; - }, - toHsl: function() { - var hsl = rgbToHsl(this._r, this._g, this._b); - return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a }; - }, - toHslString: function() { - var hsl = rgbToHsl(this._r, this._g, this._b); - var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100); - return (this._a == 1) ? - "hsl(" + h + ", " + s + "%, " + l + "%)" : - "hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")"; - }, - toHex: function(allow3Char) { - return rgbToHex(this._r, this._g, this._b, allow3Char); - }, - toHexString: function(allow3Char) { - return '#' + this.toHex(allow3Char); - }, - toHex8: function(allow4Char) { - return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char); - }, - toHex8String: function(allow4Char) { - return '#' + this.toHex8(allow4Char); - }, - toRgb: function() { - return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a }; - }, - toRgbString: function() { - return (this._a == 1) ? - "rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" : - "rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")"; - }, - toPercentageRgb: function() { - return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a }; - }, - toPercentageRgbString: function() { - return (this._a == 1) ? - "rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" : - "rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")"; - }, - toName: function() { - if (this._a === 0) { - return "transparent"; - } - - if (this._a < 1) { - return false; - } - - return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false; - }, - toFilter: function(secondColor) { - var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a); - var secondHex8String = hex8String; - var gradientType = this._gradientType ? "GradientType = 1, " : ""; - - if (secondColor) { - var s = tinycolor(secondColor); - secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a); - } - - return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")"; - }, - toString: function(format) { - var formatSet = !!format; - format = format || this._format; - - var formattedString = false; - var hasAlpha = this._a < 1 && this._a >= 0; - var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name"); - - if (needsAlphaFormat) { - // Special case for "transparent", all other non-alpha formats - // will return rgba when there is transparency. - if (format === "name" && this._a === 0) { - return this.toName(); - } - return this.toRgbString(); - } - if (format === "rgb") { - formattedString = this.toRgbString(); - } - if (format === "prgb") { - formattedString = this.toPercentageRgbString(); - } - if (format === "hex" || format === "hex6") { - formattedString = this.toHexString(); - } - if (format === "hex3") { - formattedString = this.toHexString(true); - } - if (format === "hex4") { - formattedString = this.toHex8String(true); - } - if (format === "hex8") { - formattedString = this.toHex8String(); - } - if (format === "name") { - formattedString = this.toName(); - } - if (format === "hsl") { - formattedString = this.toHslString(); - } - if (format === "hsv") { - formattedString = this.toHsvString(); - } - - return formattedString || this.toHexString(); - }, - clone: function() { - return tinycolor(this.toString()); - }, - - _applyModification: function(fn, args) { - var color = fn.apply(null, [this].concat([].slice.call(args))); - this._r = color._r; - this._g = color._g; - this._b = color._b; - this.setAlpha(color._a); - return this; - }, - lighten: function() { - return this._applyModification(lighten, arguments); - }, - brighten: function() { - return this._applyModification(brighten, arguments); - }, - darken: function() { - return this._applyModification(darken, arguments); - }, - desaturate: function() { - return this._applyModification(desaturate, arguments); - }, - saturate: function() { - return this._applyModification(saturate, arguments); - }, - greyscale: function() { - return this._applyModification(greyscale, arguments); - }, - spin: function() { - return this._applyModification(spin, arguments); - }, - - _applyCombination: function(fn, args) { - return fn.apply(null, [this].concat([].slice.call(args))); - }, - analogous: function() { - return this._applyCombination(analogous, arguments); - }, - complement: function() { - return this._applyCombination(complement, arguments); - }, - monochromatic: function() { - return this._applyCombination(monochromatic, arguments); - }, - splitcomplement: function() { - return this._applyCombination(splitcomplement, arguments); - }, - triad: function() { - return this._applyCombination(triad, arguments); - }, - tetrad: function() { - return this._applyCombination(tetrad, arguments); - } -}; - -// If input is an object, force 1 into "1.0" to handle ratios properly -// String input requires "1.0" as input, so 1 will be treated as 1 -tinycolor.fromRatio = function(color, opts) { - if (typeof color == "object") { - var newColor = {}; - for (var i in color) { - if (color.hasOwnProperty(i)) { - if (i === "a") { - newColor[i] = color[i]; - } - else { - newColor[i] = convertToPercentage(color[i]); - } - } - } - color = newColor; - } - - return tinycolor(color, opts); -}; - -// Given a string or object, convert that input to RGB -// Possible string inputs: -// -// "red" -// "#f00" or "f00" -// "#ff0000" or "ff0000" -// "#ff000000" or "ff000000" -// "rgb 255 0 0" or "rgb (255, 0, 0)" -// "rgb 1.0 0 0" or "rgb (1, 0, 0)" -// "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1" -// "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1" -// "hsl(0, 100%, 50%)" or "hsl 0 100% 50%" -// "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1" -// "hsv(0, 100%, 100%)" or "hsv 0 100% 100%" -// -function inputToRGB(color) { - - var rgb = { r: 0, g: 0, b: 0 }; - var a = 1; - var s = null; - var v = null; - var l = null; - var ok = false; - var format = false; - - if (typeof color == "string") { - color = stringInputToObject(color); - } - - if (typeof color == "object") { - if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) { - rgb = rgbToRgb(color.r, color.g, color.b); - ok = true; - format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb"; - } - else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) { - s = convertToPercentage(color.s); - v = convertToPercentage(color.v); - rgb = hsvToRgb(color.h, s, v); - ok = true; - format = "hsv"; - } - else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) { - s = convertToPercentage(color.s); - l = convertToPercentage(color.l); - rgb = hslToRgb(color.h, s, l); - ok = true; - format = "hsl"; - } - - if (color.hasOwnProperty("a")) { - a = color.a; - } - } - - a = boundAlpha(a); - - return { - ok: ok, - format: color.format || format, - r: mathMin(255, mathMax(rgb.r, 0)), - g: mathMin(255, mathMax(rgb.g, 0)), - b: mathMin(255, mathMax(rgb.b, 0)), - a: a - }; -} - - -// Conversion Functions -// -------------------- - -// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from: -// - -// `rgbToRgb` -// Handle bounds / percentage checking to conform to CSS color spec -// -// *Assumes:* r, g, b in [0, 255] or [0, 1] -// *Returns:* { r, g, b } in [0, 255] -function rgbToRgb(r, g, b){ - return { - r: bound01(r, 255) * 255, - g: bound01(g, 255) * 255, - b: bound01(b, 255) * 255 - }; -} - -// `rgbToHsl` -// Converts an RGB color value to HSL. -// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1] -// *Returns:* { h, s, l } in [0,1] -function rgbToHsl(r, g, b) { - - r = bound01(r, 255); - g = bound01(g, 255); - b = bound01(b, 255); - - var max = mathMax(r, g, b), min = mathMin(r, g, b); - var h, s, l = (max + min) / 2; - - if(max == min) { - h = s = 0; // achromatic - } - else { - var d = max - min; - s = l > 0.5 ? d / (2 - max - min) : d / (max + min); - switch(max) { - case r: h = (g - b) / d + (g < b ? 6 : 0); break; - case g: h = (b - r) / d + 2; break; - case b: h = (r - g) / d + 4; break; - } - - h /= 6; - } - - return { h: h, s: s, l: l }; -} - -// `hslToRgb` -// Converts an HSL color value to RGB. -// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100] -// *Returns:* { r, g, b } in the set [0, 255] -function hslToRgb(h, s, l) { - var r, g, b; - - h = bound01(h, 360); - s = bound01(s, 100); - l = bound01(l, 100); - - function hue2rgb(p, q, t) { - if(t < 0) t += 1; - if(t > 1) t -= 1; - if(t < 1/6) return p + (q - p) * 6 * t; - if(t < 1/2) return q; - if(t < 2/3) return p + (q - p) * (2/3 - t) * 6; - return p; - } - - if(s === 0) { - r = g = b = l; // achromatic - } - else { - var q = l < 0.5 ? l * (1 + s) : l + s - l * s; - var p = 2 * l - q; - r = hue2rgb(p, q, h + 1/3); - g = hue2rgb(p, q, h); - b = hue2rgb(p, q, h - 1/3); - } - - return { r: r * 255, g: g * 255, b: b * 255 }; -} - -// `rgbToHsv` -// Converts an RGB color value to HSV -// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1] -// *Returns:* { h, s, v } in [0,1] -function rgbToHsv(r, g, b) { - - r = bound01(r, 255); - g = bound01(g, 255); - b = bound01(b, 255); - - var max = mathMax(r, g, b), min = mathMin(r, g, b); - var h, s, v = max; - - var d = max - min; - s = max === 0 ? 0 : d / max; - - if(max == min) { - h = 0; // achromatic - } - else { - switch(max) { - case r: h = (g - b) / d + (g < b ? 6 : 0); break; - case g: h = (b - r) / d + 2; break; - case b: h = (r - g) / d + 4; break; - } - h /= 6; - } - return { h: h, s: s, v: v }; -} - -// `hsvToRgb` -// Converts an HSV color value to RGB. -// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100] -// *Returns:* { r, g, b } in the set [0, 255] - function hsvToRgb(h, s, v) { - - h = bound01(h, 360) * 6; - s = bound01(s, 100); - v = bound01(v, 100); - - var i = Math.floor(h), - f = h - i, - p = v * (1 - s), - q = v * (1 - f * s), - t = v * (1 - (1 - f) * s), - mod = i % 6, - r = [v, q, p, p, t, v][mod], - g = [t, v, v, q, p, p][mod], - b = [p, p, t, v, v, q][mod]; - - return { r: r * 255, g: g * 255, b: b * 255 }; -} - -// `rgbToHex` -// Converts an RGB color to hex -// Assumes r, g, and b are contained in the set [0, 255] -// Returns a 3 or 6 character hex -function rgbToHex(r, g, b, allow3Char) { - - var hex = [ - pad2(mathRound(r).toString(16)), - pad2(mathRound(g).toString(16)), - pad2(mathRound(b).toString(16)) - ]; - - // Return a 3 character hex if possible - if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) { - return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0); - } - - return hex.join(""); -} - -// `rgbaToHex` -// Converts an RGBA color plus alpha transparency to hex -// Assumes r, g, b are contained in the set [0, 255] and -// a in [0, 1]. Returns a 4 or 8 character rgba hex -function rgbaToHex(r, g, b, a, allow4Char) { - - var hex = [ - pad2(mathRound(r).toString(16)), - pad2(mathRound(g).toString(16)), - pad2(mathRound(b).toString(16)), - pad2(convertDecimalToHex(a)) - ]; - - // Return a 4 character hex if possible - if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) { - return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0); - } - - return hex.join(""); -} - -// `rgbaToArgbHex` -// Converts an RGBA color to an ARGB Hex8 string -// Rarely used, but required for "toFilter()" -function rgbaToArgbHex(r, g, b, a) { - - var hex = [ - pad2(convertDecimalToHex(a)), - pad2(mathRound(r).toString(16)), - pad2(mathRound(g).toString(16)), - pad2(mathRound(b).toString(16)) - ]; - - return hex.join(""); -} - -// `equals` -// Can be called with any tinycolor input -tinycolor.equals = function (color1, color2) { - if (!color1 || !color2) { return false; } - return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString(); -}; - -tinycolor.random = function() { - return tinycolor.fromRatio({ - r: mathRandom(), - g: mathRandom(), - b: mathRandom() - }); -}; - - -// Modification Functions -// ---------------------- -// Thanks to less.js for some of the basics here -// - -function desaturate(color, amount) { - amount = (amount === 0) ? 0 : (amount || 10); - var hsl = tinycolor(color).toHsl(); - hsl.s -= amount / 100; - hsl.s = clamp01(hsl.s); - return tinycolor(hsl); -} - -function saturate(color, amount) { - amount = (amount === 0) ? 0 : (amount || 10); - var hsl = tinycolor(color).toHsl(); - hsl.s += amount / 100; - hsl.s = clamp01(hsl.s); - return tinycolor(hsl); -} - -function greyscale(color) { - return tinycolor(color).desaturate(100); -} - -function lighten (color, amount) { - amount = (amount === 0) ? 0 : (amount || 10); - var hsl = tinycolor(color).toHsl(); - hsl.l += amount / 100; - hsl.l = clamp01(hsl.l); - return tinycolor(hsl); -} - -function brighten(color, amount) { - amount = (amount === 0) ? 0 : (amount || 10); - var rgb = tinycolor(color).toRgb(); - rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100)))); - rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100)))); - rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100)))); - return tinycolor(rgb); -} - -function darken (color, amount) { - amount = (amount === 0) ? 0 : (amount || 10); - var hsl = tinycolor(color).toHsl(); - hsl.l -= amount / 100; - hsl.l = clamp01(hsl.l); - return tinycolor(hsl); -} - -// Spin takes a positive or negative amount within [-360, 360] indicating the change of hue. -// Values outside of this range will be wrapped into this range. -function spin(color, amount) { - var hsl = tinycolor(color).toHsl(); - var hue = (hsl.h + amount) % 360; - hsl.h = hue < 0 ? 360 + hue : hue; - return tinycolor(hsl); -} - -// Combination Functions -// --------------------- -// Thanks to jQuery xColor for some of the ideas behind these -// - -function complement(color) { - var hsl = tinycolor(color).toHsl(); - hsl.h = (hsl.h + 180) % 360; - return tinycolor(hsl); -} - -function triad(color) { - var hsl = tinycolor(color).toHsl(); - var h = hsl.h; - return [ - tinycolor(color), - tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }), - tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l }) - ]; -} - -function tetrad(color) { - var hsl = tinycolor(color).toHsl(); - var h = hsl.h; - return [ - tinycolor(color), - tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }), - tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }), - tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l }) - ]; -} - -function splitcomplement(color) { - var hsl = tinycolor(color).toHsl(); - var h = hsl.h; - return [ - tinycolor(color), - tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}), - tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l}) - ]; -} - -function analogous(color, results, slices) { - results = results || 6; - slices = slices || 30; - - var hsl = tinycolor(color).toHsl(); - var part = 360 / slices; - var ret = [tinycolor(color)]; - - for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) { - hsl.h = (hsl.h + part) % 360; - ret.push(tinycolor(hsl)); - } - return ret; -} - -function monochromatic(color, results) { - results = results || 6; - var hsv = tinycolor(color).toHsv(); - var h = hsv.h, s = hsv.s, v = hsv.v; - var ret = []; - var modification = 1 / results; - - while (results--) { - ret.push(tinycolor({ h: h, s: s, v: v})); - v = (v + modification) % 1; - } - - return ret; -} - -// Utility Functions -// --------------------- - -tinycolor.mix = function(color1, color2, amount) { - amount = (amount === 0) ? 0 : (amount || 50); - - var rgb1 = tinycolor(color1).toRgb(); - var rgb2 = tinycolor(color2).toRgb(); - - var p = amount / 100; - - var rgba = { - r: ((rgb2.r - rgb1.r) * p) + rgb1.r, - g: ((rgb2.g - rgb1.g) * p) + rgb1.g, - b: ((rgb2.b - rgb1.b) * p) + rgb1.b, - a: ((rgb2.a - rgb1.a) * p) + rgb1.a - }; - - return tinycolor(rgba); -}; - - -// Readability Functions -// --------------------- -// false -// tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false -tinycolor.isReadable = function(color1, color2, wcag2) { - var readability = tinycolor.readability(color1, color2); - var wcag2Parms, out; - - out = false; - - wcag2Parms = validateWCAG2Parms(wcag2); - switch (wcag2Parms.level + wcag2Parms.size) { - case "AAsmall": - case "AAAlarge": - out = readability >= 4.5; - break; - case "AAlarge": - out = readability >= 3; - break; - case "AAAsmall": - out = readability >= 7; - break; - } - return out; - -}; - -// `mostReadable` -// Given a base color and a list of possible foreground or background -// colors for that base, returns the most readable color. -// Optionally returns Black or White if the most readable color is unreadable. -// *Example* -// tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255" -// tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff" -// tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3" -// tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff" -tinycolor.mostReadable = function(baseColor, colorList, args) { - var bestColor = null; - var bestScore = 0; - var readability; - var includeFallbackColors, level, size ; - args = args || {}; - includeFallbackColors = args.includeFallbackColors ; - level = args.level; - size = args.size; - - for (var i= 0; i < colorList.length ; i++) { - readability = tinycolor.readability(baseColor, colorList[i]); - if (readability > bestScore) { - bestScore = readability; - bestColor = tinycolor(colorList[i]); - } - } - - if (tinycolor.isReadable(baseColor, bestColor, {"level":level,"size":size}) || !includeFallbackColors) { - return bestColor; - } - else { - args.includeFallbackColors=false; - return tinycolor.mostReadable(baseColor,["#fff", "#000"],args); - } -}; - - -// Big List of Colors -// ------------------ -// -var names = tinycolor.names = { - aliceblue: "f0f8ff", - antiquewhite: "faebd7", - aqua: "0ff", - aquamarine: "7fffd4", - azure: "f0ffff", - beige: "f5f5dc", - bisque: "ffe4c4", - black: "000", - blanchedalmond: "ffebcd", - blue: "00f", - blueviolet: "8a2be2", - brown: "a52a2a", - burlywood: "deb887", - burntsienna: "ea7e5d", - cadetblue: "5f9ea0", - chartreuse: "7fff00", - chocolate: "d2691e", - coral: "ff7f50", - cornflowerblue: "6495ed", - cornsilk: "fff8dc", - crimson: "dc143c", - cyan: "0ff", - darkblue: "00008b", - darkcyan: "008b8b", - darkgoldenrod: "b8860b", - darkgray: "a9a9a9", - darkgreen: "006400", - darkgrey: "a9a9a9", - darkkhaki: "bdb76b", - darkmagenta: "8b008b", - darkolivegreen: "556b2f", - darkorange: "ff8c00", - darkorchid: "9932cc", - darkred: "8b0000", - darksalmon: "e9967a", - darkseagreen: "8fbc8f", - darkslateblue: "483d8b", - darkslategray: "2f4f4f", - darkslategrey: "2f4f4f", - darkturquoise: "00ced1", - darkviolet: "9400d3", - deeppink: "ff1493", - deepskyblue: "00bfff", - dimgray: "696969", - dimgrey: "696969", - dodgerblue: "1e90ff", - firebrick: "b22222", - floralwhite: "fffaf0", - forestgreen: "228b22", - fuchsia: "f0f", - gainsboro: "dcdcdc", - ghostwhite: "f8f8ff", - gold: "ffd700", - goldenrod: "daa520", - gray: "808080", - green: "008000", - greenyellow: "adff2f", - grey: "808080", - honeydew: "f0fff0", - hotpink: "ff69b4", - indianred: "cd5c5c", - indigo: "4b0082", - ivory: "fffff0", - khaki: "f0e68c", - lavender: "e6e6fa", - lavenderblush: "fff0f5", - lawngreen: "7cfc00", - lemonchiffon: "fffacd", - lightblue: "add8e6", - lightcoral: "f08080", - lightcyan: "e0ffff", - lightgoldenrodyellow: "fafad2", - lightgray: "d3d3d3", - lightgreen: "90ee90", - lightgrey: "d3d3d3", - lightpink: "ffb6c1", - lightsalmon: "ffa07a", - lightseagreen: "20b2aa", - lightskyblue: "87cefa", - lightslategray: "789", - lightslategrey: "789", - lightsteelblue: "b0c4de", - lightyellow: "ffffe0", - lime: "0f0", - limegreen: "32cd32", - linen: "faf0e6", - magenta: "f0f", - maroon: "800000", - mediumaquamarine: "66cdaa", - mediumblue: "0000cd", - mediumorchid: "ba55d3", - mediumpurple: "9370db", - mediumseagreen: "3cb371", - mediumslateblue: "7b68ee", - mediumspringgreen: "00fa9a", - mediumturquoise: "48d1cc", - mediumvioletred: "c71585", - midnightblue: "191970", - mintcream: "f5fffa", - mistyrose: "ffe4e1", - moccasin: "ffe4b5", - navajowhite: "ffdead", - navy: "000080", - oldlace: "fdf5e6", - olive: "808000", - olivedrab: "6b8e23", - orange: "ffa500", - orangered: "ff4500", - orchid: "da70d6", - palegoldenrod: "eee8aa", - palegreen: "98fb98", - paleturquoise: "afeeee", - palevioletred: "db7093", - papayawhip: "ffefd5", - peachpuff: "ffdab9", - peru: "cd853f", - pink: "ffc0cb", - plum: "dda0dd", - powderblue: "b0e0e6", - purple: "800080", - rebeccapurple: "663399", - red: "f00", - rosybrown: "bc8f8f", - royalblue: "4169e1", - saddlebrown: "8b4513", - salmon: "fa8072", - sandybrown: "f4a460", - seagreen: "2e8b57", - seashell: "fff5ee", - sienna: "a0522d", - silver: "c0c0c0", - skyblue: "87ceeb", - slateblue: "6a5acd", - slategray: "708090", - slategrey: "708090", - snow: "fffafa", - springgreen: "00ff7f", - steelblue: "4682b4", - tan: "d2b48c", - teal: "008080", - thistle: "d8bfd8", - tomato: "ff6347", - turquoise: "40e0d0", - violet: "ee82ee", - wheat: "f5deb3", - white: "fff", - whitesmoke: "f5f5f5", - yellow: "ff0", - yellowgreen: "9acd32" -}; - -// Make it easy to access colors via `hexNames[hex]` -var hexNames = tinycolor.hexNames = flip(names); - - -// Utilities -// --------- - -// `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }` -function flip(o) { - var flipped = { }; - for (var i in o) { - if (o.hasOwnProperty(i)) { - flipped[o[i]] = i; - } - } - return flipped; -} - -// Return a valid alpha value [0,1] with all invalid values being set to 1 -function boundAlpha(a) { - a = parseFloat(a); - - if (isNaN(a) || a < 0 || a > 1) { - a = 1; - } - - return a; -} - -// Take input from [0, n] and return it as [0, 1] -function bound01(n, max) { - if (isOnePointZero(n)) { n = "100%"; } - - var processPercent = isPercentage(n); - n = mathMin(max, mathMax(0, parseFloat(n))); - - // Automatically convert percentage into number - if (processPercent) { - n = parseInt(n * max, 10) / 100; - } - - // Handle floating point rounding errors - if ((Math.abs(n - max) < 0.000001)) { - return 1; - } - - // Convert into [0, 1] range if it isn't already - return (n % max) / parseFloat(max); -} - -// Force a number between 0 and 1 -function clamp01(val) { - return mathMin(1, mathMax(0, val)); -} - -// Parse a base-16 hex value into a base-10 integer -function parseIntFromHex(val) { - return parseInt(val, 16); -} - -// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1 -// -function isOnePointZero(n) { - return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1; -} - -// Check to see if string passed in is a percentage -function isPercentage(n) { - return typeof n === "string" && n.indexOf('%') != -1; -} - -// Force a hex value to have 2 characters -function pad2(c) { - return c.length == 1 ? '0' + c : '' + c; -} - -// Replace a decimal with it's percentage value -function convertToPercentage(n) { - if (n <= 1) { - n = (n * 100) + "%"; - } - - return n; -} - -// Converts a decimal to a hex value -function convertDecimalToHex(d) { - return Math.round(parseFloat(d) * 255).toString(16); -} -// Converts a hex value to a decimal -function convertHexToDecimal(h) { - return (parseIntFromHex(h) / 255); -} - -var matchers = (function() { - - // - var CSS_INTEGER = "[-\\+]?\\d+%?"; - - // - var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?"; - - // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome. - var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")"; - - // Actual matching. - // Parentheses and commas are optional, but not required. - // Whitespace can take the place of commas or opening paren - var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; - var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; - - return { - CSS_UNIT: new RegExp(CSS_UNIT), - rgb: new RegExp("rgb" + PERMISSIVE_MATCH3), - rgba: new RegExp("rgba" + PERMISSIVE_MATCH4), - hsl: new RegExp("hsl" + PERMISSIVE_MATCH3), - hsla: new RegExp("hsla" + PERMISSIVE_MATCH4), - hsv: new RegExp("hsv" + PERMISSIVE_MATCH3), - hsva: new RegExp("hsva" + PERMISSIVE_MATCH4), - hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, - hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, - hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, - hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ - }; -})(); - -// `isValidCSSUnit` -// Take in a single string / number and check to see if it looks like a CSS unit -// (see `matchers` above for definition). -function isValidCSSUnit(color) { - return !!matchers.CSS_UNIT.exec(color); -} - -// `stringInputToObject` -// Permissive string parsing. Take in a number of formats, and output an object -// based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}` -function stringInputToObject(color) { - - color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase(); - var named = false; - if (names[color]) { - color = names[color]; - named = true; - } - else if (color == 'transparent') { - return { r: 0, g: 0, b: 0, a: 0, format: "name" }; - } - - // Try to match string input using regular expressions. - // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360] - // Just return an object and let the conversion functions handle that. - // This way the result will be the same whether the tinycolor is initialized with string or object. - var match; - if ((match = matchers.rgb.exec(color))) { - return { r: match[1], g: match[2], b: match[3] }; - } - if ((match = matchers.rgba.exec(color))) { - return { r: match[1], g: match[2], b: match[3], a: match[4] }; - } - if ((match = matchers.hsl.exec(color))) { - return { h: match[1], s: match[2], l: match[3] }; - } - if ((match = matchers.hsla.exec(color))) { - return { h: match[1], s: match[2], l: match[3], a: match[4] }; - } - if ((match = matchers.hsv.exec(color))) { - return { h: match[1], s: match[2], v: match[3] }; - } - if ((match = matchers.hsva.exec(color))) { - return { h: match[1], s: match[2], v: match[3], a: match[4] }; - } - if ((match = matchers.hex8.exec(color))) { - return { - r: parseIntFromHex(match[1]), - g: parseIntFromHex(match[2]), - b: parseIntFromHex(match[3]), - a: convertHexToDecimal(match[4]), - format: named ? "name" : "hex8" - }; - } - if ((match = matchers.hex6.exec(color))) { - return { - r: parseIntFromHex(match[1]), - g: parseIntFromHex(match[2]), - b: parseIntFromHex(match[3]), - format: named ? "name" : "hex" - }; - } - if ((match = matchers.hex4.exec(color))) { - return { - r: parseIntFromHex(match[1] + '' + match[1]), - g: parseIntFromHex(match[2] + '' + match[2]), - b: parseIntFromHex(match[3] + '' + match[3]), - a: convertHexToDecimal(match[4] + '' + match[4]), - format: named ? "name" : "hex8" - }; - } - if ((match = matchers.hex3.exec(color))) { - return { - r: parseIntFromHex(match[1] + '' + match[1]), - g: parseIntFromHex(match[2] + '' + match[2]), - b: parseIntFromHex(match[3] + '' + match[3]), - format: named ? "name" : "hex" - }; - } - - return false; -} - -function validateWCAG2Parms(parms) { - // return valid WCAG2 parms for isReadable. - // If input parms are invalid, return {"level":"AA", "size":"small"} - var level, size; - parms = parms || {"level":"AA", "size":"small"}; - level = (parms.level || "AA").toUpperCase(); - size = (parms.size || "small").toLowerCase(); - if (level !== "AA" && level !== "AAA") { - level = "AA"; - } - if (size !== "small" && size !== "large") { - size = "small"; - } - return {"level":level, "size":size}; -} - -// Node: Export function -if (typeof module !== "undefined" && module.exports) { - module.exports = tinycolor; -} -// AMD/requirejs: Define the module -else if (typeof define === 'function' && define.amd) { - define(function () {return tinycolor;}); -} -// Browser: Expose to window -else { - window.tinycolor = tinycolor; -} - -})(Math); - -},{}],278:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.bem = bem; -exports.setLocale = setLocale; -exports._ = _; -exports.clamp = clamp; - -var _constants = require("./constants"); - -var _constants2 = _interopRequireDefault(_constants); - -var _dictionaries = require("./dictionaries"); - -var _dictionaries2 = _interopRequireDefault(_dictionaries); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* -* BEM helper -* -* bem() => 'plotly-editor' -* bem('foo') => 'plotly-editor__foo' -* bem('foo', 'bar') => 'plotly-editor__foo__bar' -* bem('foo', ['mod']) => 'plotly-editor__foo plotly-editor__foo--mod' -* bem('foo', 'bar', ['mod']) => 'plotly-editor__foo__bar plotly-editor__foo__bar--mod' -* bem('foo', ['mod1', mod2']) => 'plotly-editor__foo plotly-editor__foo--mod1 plotly-editor__foo--mod2' -*/ -function bem(block, element, modifiers) { - var i, modifier; - var out = []; - var c = _constants2.default.baseClass; - - if (Array.isArray(block)) { - modifiers = block; - block = null; - element = null; - } else if (Array.isArray(element)) { - modifiers = element; - element = null; - } - - if (block && block.length) { - c += "__" + block; - } - - if (element && element.length) { - c += "__" + element; - } - - out.push(c); - if (modifiers) { - for (i = 0; i < modifiers.length; i++) { - modifier = modifiers[i]; - if (modifier && modifier.length) { - out.push(c + "--" + modifier); - } - } - } - - return out.join(" "); -} - -var state = {}; - -function setLocale(locale) { - state.locale = locale; - state.dictionary = _dictionaries2.default[locale]; -} - -function _(str) { - var parts = str.split("."); - - var ref = state.dictionary; - - for (var i = 0; i < parts.length; i++) { - if (ref[parts[i]]) { - ref = ref[parts[i]]; - } else { - return str; - } - } - - return ref; -} - -function clamp(value, min, max) { - return Math.max(min, Math.min(max, value)); -} - -},{"./constants":296,"./dictionaries":297}],279:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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 = (window.React); - -var _react2 = _interopRequireDefault(_react); - -var _Field2 = require("./Field"); - -var _Field3 = _interopRequireDefault(_Field2); - -var _ColorPicker = require("./widgets/ColorPicker"); - -var _ColorPicker2 = _interopRequireDefault(_ColorPicker); - -var _common = require("../common"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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 Numeric = function (_Field) { - _inherits(Numeric, _Field); - - function Numeric() { - _classCallCheck(this, Numeric); - - return _possibleConstructorReturn(this, (Numeric.__proto__ || Object.getPrototypeOf(Numeric)).apply(this, arguments)); - } - - _createClass(Numeric, [{ - key: "render", - value: function render() { - return _react2.default.createElement( - "div", - { className: (0, _common.bem)("field") }, - _react2.default.createElement( - "div", - { className: (0, _common.bem)("field", "title") }, - _react2.default.createElement( - "div", - { className: (0, _common.bem)("field", "title-text") }, - this.props.label - ) - ), - _react2.default.createElement( - "div", - { className: (0, _common.bem)("field", "widget") }, - _react2.default.createElement(_ColorPicker2.default, { - selectedColor: this.state.value, - onColorChange: this.updatePlot - }) - ) - ); - } - }]); - - return Numeric; -}(_Field3.default); - -exports.default = Numeric; - -},{"../common":278,"./Field":281,"./widgets/ColorPicker":290}],280:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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 = (window.React); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require("prop-types"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _common = require("../common"); - -var _TraceAccordion = require("./TraceAccordion"); - -var _TraceAccordion2 = _interopRequireDefault(_TraceAccordion); - -var _Panel = require("./Panel"); - -var _Panel2 = _interopRequireDefault(_Panel); - -var _Select = require("./Select"); - -var _Select2 = _interopRequireDefault(_Select); - -var _Numeric = require("./Numeric"); - -var _Numeric2 = _interopRequireDefault(_Numeric); - -var _Color = require("./Color"); - -var _Color2 = _interopRequireDefault(_Color); - -var _Section = require("./Section"); - -var _Section2 = _interopRequireDefault(_Section); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -/* - * These are the built-in panels for the editor. If the editor has children specified, - * those panels will override these. - */ -var DefaultPanels = function (_Component) { - _inherits(DefaultPanels, _Component); - - function DefaultPanels(props, context) { - _classCallCheck(this, DefaultPanels); - - var _this = _possibleConstructorReturn(this, (DefaultPanels.__proto__ || Object.getPrototypeOf(DefaultPanels)).call(this, props)); - - _this.dataSources = context.dataSources; - _this.dataSourceNames = context.dataSourceNames; - return _this; - } - - _createClass(DefaultPanels, [{ - key: "render", - value: function render() { - var _this2 = this; - - return _react2.default.createElement( - "div", - null, - _react2.default.createElement( - _Panel2.default, - { name: "graph-create" }, - _react2.default.createElement(_TraceAccordion2.default, { - render: function render() { - return _react2.default.createElement( - "div", - null, - _react2.default.createElement(_Select2.default, { - label: "Plot Type", - attr: "mode", - options: [{ label: "Line", value: "lines" }, { label: "Scatter", value: "markers" }, { label: "Scatter line", value: "lines+markers" }] - }), - _react2.default.createElement(_Select2.default, { label: "X", attr: "xsrc", options: _this2.dataSourceNames }), - _react2.default.createElement(_Select2.default, { label: "Y", attr: "ysrc", options: _this2.dataSourceNames }), - _react2.default.createElement(_Numeric2.default, { label: (0, _common._)("Marker Size"), attr: "marker.size" }) - ); - } - }) - ), - _react2.default.createElement( - _Panel2.default, - { name: "style-traces" }, - _react2.default.createElement(_TraceAccordion2.default, { - render: function render() { - return _react2.default.createElement( - "div", - null, - _react2.default.createElement( - _Section2.default, - { heading: (0, _common._)("style.traces.trace") }, - _react2.default.createElement(_Numeric2.default, { - label: (0, _common._)("style.traces.opacity"), - min: 0, - max: 1, - step: 0.1, - attr: "opacity" - }) - ), - _react2.default.createElement(_Section2.default, { heading: (0, _common._)("style.traces.display") }), - _react2.default.createElement( - _Section2.default, - { heading: (0, _common._)("style.traces.points") }, - _react2.default.createElement(_Numeric2.default, { - label: (0, _common._)("style.traces.marker-opacity"), - min: 0, - max: 1, - step: 0.1, - attr: "marker.opacity" - }), - _react2.default.createElement(_Color2.default, { label: (0, _common._)("Marker Color"), attr: "marker.color" }), - _react2.default.createElement(_Numeric2.default, { - label: (0, _common._)("style.traces.marker-size"), - min: 0, - attr: "marker.size" - }), - _react2.default.createElement(_Numeric2.default, { - label: (0, _common._)("style.traces.marker-line-width"), - min: 0, - attr: "marker.line.width" - }) - ), - _react2.default.createElement( - _Section2.default, - { heading: (0, _common._)("style.traces.lines") }, - _react2.default.createElement(_Numeric2.default, { - label: (0, _common._)("style.traces.line-width"), - min: 0, - step: 1.0, - attr: "line.width" - }), - _react2.default.createElement(_Color2.default, { label: (0, _common._)("Line color"), attr: "line.color" }) - ) - ); - } - }) - ) - ); - } - }]); - - return DefaultPanels; -}(_react.Component); - -DefaultPanels.contextTypes = { - dataSources: _propTypes2.default.object, - dataSourceNames: _propTypes2.default.array -}; - -exports.default = DefaultPanels; - -},{"../common":278,"./Color":279,"./Numeric":285,"./Panel":286,"./Section":287,"./Select":288,"./TraceAccordion":289,"prop-types":192}],281:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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 = (window.React); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require("prop-types"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _nested_property = require("plotly.js/src/lib/nested_property"); - -var _nested_property2 = _interopRequireDefault(_nested_property); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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 SRC_ATTR_PATTERN = /src$/; - -var Field = function (_Component) { - _inherits(Field, _Component); - - function Field(props, context) { - _classCallCheck(this, Field); - - var _this = _possibleConstructorReturn(this, (Field.__proto__ || Object.getPrototypeOf(Field)).call(this, props)); - - _this._index = context.traceIndex; - _this._data = context.data[_this._index]; - _this._fullData = context.fullData[_this._index]; - _this._property = (0, _nested_property2.default)(_this._data, _this.props.attr); - _this._fullProperty = (0, _nested_property2.default)(_this._fullData, _this.props.attr); - _this.updatePlot = _this.updatePlot.bind(_this); - _this._contextUpdate = context.handleUpdate; - _this.dataSources = context.dataSources; - _this.dataSourceNames = context.dataSourceNames; - - _this.state = { - value: _this.fullValue - }; - return _this; - } - - _createClass(Field, [{ - key: "componentWillReceiveProps", - value: function componentWillReceiveProps(nextProps, nextContext) { - this._index = nextContext.traceIndex; - this._contextUpdate = nextContext.handleUpdate; - - if (nextContext.data) { - this._data = nextContext.data[this._index]; - } else { - this._data = []; - } - - if (nextContext.fullData) { - this._fullData = nextContext.fullData[this._index]; - } else { - this._fullData = []; - } - } - }, { - key: "updatePlot", - value: function updatePlot(value) { - this.value = value; - this.setState({ value: value }); - this._contextUpdate && this._contextUpdate(this.props.attr, this.value); - } - }, { - key: "value", - get: function get() { - return this._property.get(); - }, - set: function set(newValue) { - this._property.set(newValue); - - this._contextUpdate(gd, this._data, this.props.attr, newValue); - } - }, { - key: "fullValue", - get: function get() { - if (SRC_ATTR_PATTERN.test(this.props.attr)) { - return this._property.get(); - } else { - return this._fullProperty.get(); - } - } - }]); - - return Field; -}(_react.Component); - -Field.contextTypes = { - data: _propTypes2.default.array, - fullData: _propTypes2.default.array, - layout: _propTypes2.default.object, - fullLayout: _propTypes2.default.object, - handleUpdate: _propTypes2.default.func, - traceIndex: _propTypes2.default.number -}; - -exports.default = Field; - -},{"plotly.js/src/lib/nested_property":179,"prop-types":192}],282:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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 = (window.React); - -var _react2 = _interopRequireDefault(_react); - -var _common = require("../common"); - -var _ModeMenuSection = require("./ModeMenuSection"); - -var _ModeMenuSection2 = _interopRequireDefault(_ModeMenuSection); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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 ModeMenu = function (_Component) { - _inherits(ModeMenu, _Component); - - function ModeMenu() { - _classCallCheck(this, ModeMenu); - - return _possibleConstructorReturn(this, (ModeMenu.__proto__ || Object.getPrototypeOf(ModeMenu)).apply(this, arguments)); - } - - _createClass(ModeMenu, [{ - key: "render", - value: function render() { - return _react2.default.createElement( - "div", - { className: (0, _common.bem)("mode-menu") }, - _react2.default.createElement(_ModeMenuSection2.default, { - label: "Graph", - section: "graph", - expanded: true, - onChangeSection: this.props.onChangeSection, - currentSection: this.props.currentSection, - sections: ["Create", "Filter", "Group"] - }), - _react2.default.createElement(_ModeMenuSection2.default, { - label: "Style", - section: "style", - expanded: true, - onChangeSection: this.props.onChangeSection, - currentSection: this.props.currentSection, - sections: ["Traces", "Layout", "Notes", "Axes", "Legend", "Shapes", "Images"] - }) - ); - } - }]); - - return ModeMenu; -}(_react.Component); - -exports.default = ModeMenu; - -},{"../common":278,"./ModeMenuSection":284}],283:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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 = (window.React); - -var _react2 = _interopRequireDefault(_react); - -var _common = require("../common"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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 ModeMenuItem = function (_Component) { - _inherits(ModeMenuItem, _Component); - - function ModeMenuItem() { - _classCallCheck(this, ModeMenuItem); - - return _possibleConstructorReturn(this, (ModeMenuItem.__proto__ || Object.getPrototypeOf(ModeMenuItem)).apply(this, arguments)); - } - - _createClass(ModeMenuItem, [{ - key: "render", - value: function render() { - return _react2.default.createElement( - "div", - { - onClick: this.props.onClick, - className: (0, _common.bem)("mode-menu-item", [this.props.active ? "is-active" : ""]) - }, - this.props.label - ); - } - }]); - - return ModeMenuItem; -}(_react.Component); - -exports.default = ModeMenuItem; - -},{"../common":278}],284:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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 = (window.React); - -var _react2 = _interopRequireDefault(_react); - -var _common = require("../common"); - -var _ModeMenuItem = require("./ModeMenuItem"); - -var _ModeMenuItem2 = _interopRequireDefault(_ModeMenuItem); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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 ModeMenuSection = function (_Component) { - _inherits(ModeMenuSection, _Component); - - function ModeMenuSection(props) { - _classCallCheck(this, ModeMenuSection); - - var _this = _possibleConstructorReturn(this, (ModeMenuSection.__proto__ || Object.getPrototypeOf(ModeMenuSection)).call(this, props)); - - _this.state = { - expanded: props.expanded - }; - - _this.toggleExpanded = _this.toggleExpanded.bind(_this); - _this.onChangeSection = _this.onChangeSection.bind(_this); - _this.renderSubItem = _this.renderSubItem.bind(_this); - return _this; - } - - _createClass(ModeMenuSection, [{ - key: "toggleExpanded", - value: function toggleExpanded() { - this.setState({ expanded: !this.state.expanded }); - } - }, { - key: "onChangeSection", - value: function onChangeSection(item) { - this.props.onChangeSection(this.props.label + "-" + item); - } - }, { - key: "renderSubItem", - value: function renderSubItem(item, i) { - var _this2 = this; - - var isActive = this.props.currentSection === this.props.label + "-" + item; - - return _react2.default.createElement(_ModeMenuItem2.default, { - key: "subitem-" + i, - active: isActive, - onClick: function onClick() { - return _this2.onChangeSection(item); - }, - label: item - }); - } - }, { - key: "render", - value: function render() { - return _react2.default.createElement( - "div", - { - className: (0, _common.bem)("mode-menu-section", [this.state.expanded ? "is-expanded" : ""]) - }, - _react2.default.createElement( - "div", - { - onClick: this.toggleExpanded, - className: (0, _common.bem)("mode-menu-section", "title") - }, - this.props.label - ), - this.state.expanded && this.props.sections.map(this.renderSubItem) - ); - } - }]); - - return ModeMenuSection; -}(_react.Component); - -exports.default = ModeMenuSection; - - -ModeMenuSection.defaultProps = { - expanded: false -}; - -},{"../common":278,"./ModeMenuItem":283}],285:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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 = (window.React); - -var _react2 = _interopRequireDefault(_react); - -var _Field2 = require("./Field"); - -var _Field3 = _interopRequireDefault(_Field2); - -var _NumericInputStatefulWrapper = require("./widgets/NumericInputStatefulWrapper"); - -var _NumericInputStatefulWrapper2 = _interopRequireDefault(_NumericInputStatefulWrapper); - -var _common = require("../common"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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 Numeric = function (_Field) { - _inherits(Numeric, _Field); - - function Numeric() { - _classCallCheck(this, Numeric); - - return _possibleConstructorReturn(this, (Numeric.__proto__ || Object.getPrototypeOf(Numeric)).apply(this, arguments)); - } - - _createClass(Numeric, [{ - key: "render", - value: function render() { - return _react2.default.createElement( - "div", - { className: (0, _common.bem)("field") }, - _react2.default.createElement( - "div", - { className: (0, _common.bem)("field", "title") }, - _react2.default.createElement( - "div", - { className: (0, _common.bem)("field", "title-text") }, - this.props.label - ) - ), - _react2.default.createElement( - "div", - { className: (0, _common.bem)("field", "widget") }, - _react2.default.createElement(_NumericInputStatefulWrapper2.default, { - value: this.state.value, - step: this.props.step, - min: this.props.min, - max: this.props.max, - onChange: this.updatePlot, - onUpdate: this.updatePlot, - showArrows: true - }) - ) - ); - } - }]); - - return Numeric; -}(_Field3.default); - -exports.default = Numeric; - -},{"../common":278,"./Field":281,"./widgets/NumericInputStatefulWrapper":293}],286:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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 = (window.React); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require("prop-types"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _common = require("../common"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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 Panel = function (_Component) { - _inherits(Panel, _Component); - - function Panel(props, context) { - _classCallCheck(this, Panel); - - var _this = _possibleConstructorReturn(this, (Panel.__proto__ || Object.getPrototypeOf(Panel)).call(this, props)); - - _this.section = context.section; - return _this; - } - - _createClass(Panel, [{ - key: "componentWillReceiveProps", - value: function componentWillReceiveProps(nextProps, nextContext) { - this.section = nextContext.section; - } - }, { - key: "render", - value: function render() { - if (this.props.name === this.section) { - return _react2.default.createElement( - "div", - { className: (0, _common.bem)("panel") }, - this.props.children - ); - } else { - return _react2.default.createElement("div", null); - } - } - }]); - - return Panel; -}(_react.Component); - -Panel.contextTypes = { - section: _propTypes2.default.string -}; - -exports.default = Panel; - -},{"../common":278,"prop-types":192}],287:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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 = (window.React); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require("prop-types"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _common = require("../common"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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 Section = function (_Component) { - _inherits(Section, _Component); - - function Section(props, context) { - _classCallCheck(this, Section); - - var _this = _possibleConstructorReturn(this, (Section.__proto__ || Object.getPrototypeOf(Section)).call(this, props)); - - _this.section = context.section; - return _this; - } - - _createClass(Section, [{ - key: "componentWillReceiveProps", - value: function componentWillReceiveProps(nextProps, nextContext) { - this.section = nextContext.section; - } - }, { - key: "render", - value: function render() { - return _react2.default.createElement( - "div", - { className: (0, _common.bem)("section") }, - _react2.default.createElement( - "div", - { className: (0, _common.bem)("section", "heading") }, - this.props.heading - ), - this.props.children - ); - } - }]); - - return Section; -}(_react.Component); - -Section.contextTypes = { - heading: _propTypes2.default.string -}; - -exports.default = Section; - -},{"../common":278,"prop-types":192}],288:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = (window.React); - -var _react2 = _interopRequireDefault(_react); - -var _Field2 = require("./Field"); - -var _Field3 = _interopRequireDefault(_Field2); - -var _common = require("../common"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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 Select = function (_Field) { - _inherits(Select, _Field); - - function Select() { - _classCallCheck(this, Select); - - return _possibleConstructorReturn(this, (Select.__proto__ || Object.getPrototypeOf(Select)).apply(this, arguments)); - } - - _createClass(Select, [{ - key: "renderOption", - value: function renderOption(attrs, i) { - return _react2.default.createElement( - "option", - { key: "option-" + i, value: attrs.value }, - attrs.label - ); - } - }, { - key: "render", - value: function render() { - var _this2 = this; - - var options = this.props.options; - - for (var i = 0; i < options.length; i++) { - var opt = options[i]; - if ((typeof opt === "undefined" ? "undefined" : _typeof(opt)) !== "object") { - options[i] = { - label: opt, - value: opt - }; - } - } - - return _react2.default.createElement( - "label", - { className: (0, _common.bem)("field") }, - _react2.default.createElement( - "span", - { className: (0, _common.bem)("field", "title") }, - this.props.label - ), - _react2.default.createElement( - "select", - { - value: this.state.value, - className: (0, _common.bem)("field", "control"), - onChange: function onChange(e) { - return _this2.updatePlot(e.target.value); - } - }, - options.map(this.renderOption) - ) - ); - } - }]); - - return Select; -}(_Field3.default); - -exports.default = Select; - -},{"../common":278,"./Field":281}],289:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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 = (window.React); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require("prop-types"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _common = require("../common"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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 TracePanel = function (_Component) { - _inherits(TracePanel, _Component); - - function TracePanel() { - _classCallCheck(this, TracePanel); - - return _possibleConstructorReturn(this, (TracePanel.__proto__ || Object.getPrototypeOf(TracePanel)).apply(this, arguments)); - } - - _createClass(TracePanel, [{ - key: "getChildContext", - value: function getChildContext() { - return { - traceIndex: this.props.index - }; - } - }, { - key: "render", - value: function render() { - return _react2.default.createElement( - "div", - null, - _react2.default.createElement( - "div", - { className: (0, _common.bem)("trace-panel", "top", ["active"]) }, - "Trace ", - this.props.index - ), - _react2.default.createElement( - "div", - { className: (0, _common.bem)("trace-panel", "panel") }, - this.props.children - ) - ); - } - }]); - - return TracePanel; -}(_react.Component); - -TracePanel.childContextTypes = { - traceIndex: _propTypes2.default.number -}; - -var TraceAccordion = function (_Component2) { - _inherits(TraceAccordion, _Component2); - - function TraceAccordion(props, context) { - _classCallCheck(this, TraceAccordion); - - var _this2 = _possibleConstructorReturn(this, (TraceAccordion.__proto__ || Object.getPrototypeOf(TraceAccordion)).call(this, props)); - - _this2.data = context.data; - _this2.renderPanel = _this2.renderPanel.bind(_this2); - return _this2; - } - - _createClass(TraceAccordion, [{ - key: "renderPanel", - value: function renderPanel(d, i) { - return _react2.default.createElement( - TracePanel, - { key: i, index: i }, - this.props.render() - ); - } - }, { - key: "render", - value: function render() { - return _react2.default.createElement( - "div", - { className: "tracePanel" }, - this.data.map(this.renderPanel) - ); - } - }]); - - return TraceAccordion; -}(_react.Component); - -TraceAccordion.contextTypes = { - data: _propTypes2.default.array -}; - -exports.default = TraceAccordion; - -},{"../common":278,"prop-types":192}],290:[function(require,module,exports){ -"use strict"; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = (window.React); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require("prop-types"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _TieredColorPicker = require("./TieredColorPicker"); - -var _TieredColorPicker2 = _interopRequireDefault(_TieredColorPicker); - -var _tinycolor = require("tinycolor2"); - -var _tinycolor2 = _interopRequireDefault(_tinycolor); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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 ColorPicker = function (_Component) { - _inherits(ColorPicker, _Component); - - function ColorPicker(props) { - _classCallCheck(this, ColorPicker); - - var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this, props)); - - _this.state = { - selectedColor: (0, _tinycolor2.default)(props.selectedColor), - isVisible: false - }; - - _this.onSelectedColorChange = _this.onSelectedColorChange.bind(_this); - _this.toColorBuffer = _this.toColorBuffer.bind(_this); - _this.toggleVisible = _this.toggleVisible.bind(_this); - return _this; - } - - _createClass(ColorPicker, [{ - key: "componentWillReceiveProps", - value: function componentWillReceiveProps(nextProps) { - var newColor = (0, _tinycolor2.default)(nextProps.selectedColor); - var selectedColor = this.state.selectedColor; - - - if (newColor.toRgbString() !== selectedColor.toRgbString()) { - this.setState({ selectedColor: newColor }); - } - } - }, { - key: "toColorBuffer", - value: function toColorBuffer(color) { - // @param {obj} c, an object that contains rgba field. Either it - // has a field called 'rgb' that contains a rgba object or it is a rgba - // object - // - // @returns {obj} returns c.rgb if it exits if it doesn't exist, it - // measn that the object itself is a rgba object - var extractRGB = function extractRGB(c) { - return c.rgb || c; - }; - - // If it contains rgb info, we extract its rgb object, else we return - // its hex - var getColorSource = function getColorSource(c) { - return c.source === "rgb" ? extractRGB(c) : c.hex; - }; - - return (0, _tinycolor2.default)(getColorSource(color)); - } - - // Note: this handler cannot be used alone without being decorated by tiered - // decorator - // - // @param {obj} color, object from tinycolor - // - // @returns {void} calls restyle - - }, { - key: "onSelectedColorChange", - value: function onSelectedColorChange(color) { - this.setState({ selectedColor: color }); - - var newColor = color.toRgbString(); - - // Call whatever onColorChange was passed in with the same value! - // relayout call only wants a RGB String - this.props.onColorChange(newColor); - } - }, { - key: "toggleVisible", - value: function toggleVisible() { - this.setState({ isVisible: !this.state.isVisible }); - } - }, { - key: "render", - value: function render() { - var selectedColor = this.state.selectedColor; - - - var colorText = selectedColor.toHexString(); - - // We need inline style here to assign the background color - // dynamically. - var swatchStyle = { - backgroundColor: selectedColor.toRgbString() - }; - - return _react2.default.createElement( - "div", - { className: "colorpicker-container js-colorpicker-container" }, - _react2.default.createElement( - "div", - { className: "colorpicker" }, - _react2.default.createElement("div", { - ref: "swatch", - className: "colorpicker-swatch +cursor-clickable js-colorpicker-swatch", - style: swatchStyle, - onClick: this.toggleVisible - }) - ), - _react2.default.createElement( - "div", - { - ref: "selectedColorText", - className: "colorpicker-selected-color +hover-grey", - onClick: this.toggleVisible - }, - colorText - ), - this.state.isVisible ? _react2.default.createElement( - "div", - { className: "color-picker__popover js-color-picker-popover" }, - _react2.default.createElement("div", { className: "color-picker__cover", onClick: this.toggleVisible }), - _react2.default.createElement(_TieredColorPicker2.default, { - ref: "react-color", - color: selectedColor.toRgbString(), - onChangeComplete: this.onSelectedColorChange - }) - ) : null - ); - } - }]); - - return ColorPicker; -}(_react.Component); - -ColorPicker.propTypes = { - onColorChange: _propTypes2.default.func.isRequired, - selectedColor: _propTypes2.default.string -}; - -module.exports = ColorPicker; - -},{"./TieredColorPicker":294,"prop-types":192,"tinycolor2":277}],291:[function(require,module,exports){ -"use strict"; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = (window.React); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require("prop-types"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -// A generic component to handle text that can be edited when the user -// clicks on it. -var EditableText = function (_Component) { - _inherits(EditableText, _Component); - - function EditableText(props) { - _classCallCheck(this, EditableText); - - var _this = _possibleConstructorReturn(this, (EditableText.__proto__ || Object.getPrototypeOf(EditableText)).call(this, props)); - - _this.handleClick = _this.handleClick.bind(_this); - _this.handleChange = _this.handleChange.bind(_this); - _this.handleUpdate = _this.handleUpdate.bind(_this); - _this.handleKeyPress = _this.handleKeyPress.bind(_this); - return _this; - } - - _createClass(EditableText, [{ - key: "getRef", - value: function getRef(c) { - this._ref = c; - } - - // Selects/highlights all of the text in the filename input - - }, { - key: "handleClick", - value: function handleClick(event) { - event.target.select(); - } - }, { - key: "handleChange", - value: function handleChange(event) { - var onChange = this.props.onChange; - - - if (onChange) { - onChange(event.target.value); - } - } - }, { - key: "handleUpdate", - value: function handleUpdate(event) { - var onUpdate = this.props.onUpdate; - - - if (onUpdate) { - onUpdate(event.target.value); - } - } - }, { - key: "handleKeyPress", - value: function handleKeyPress(event) { - // This will force handleUpdate to be called via the input's onBlur - if ((event.keyCode || event.which) === 13) { - this._ref.blur(); - } - } - }, { - key: "render", - value: function render() { - var _this2 = this; - - var _props = this.props, - type = _props.type, - className = _props.className, - text = _props.text, - disable = _props.disable, - autoFocus = _props.autoFocus, - onKeyDown = _props.onKeyDown, - placeholder = _props.placeholder, - readOnly = _props.readOnly, - size = _props.size; - - return _react2.default.createElement("input", { - ref: function ref(c) { - return _this2.getRef; - }, - type: type, - className: className || "", - value: text, - onClick: this.handleClick, - onChange: this.handleChange, - onBlur: this.handleUpdate, - disabled: disable, - autoFocus: autoFocus, - onKeyPress: this.handleKeyPress, - onKeyDown: onKeyDown, - placeholder: placeholder, - readOnly: readOnly, - size: size - }); - } - }]); - - return EditableText; -}(_react.Component); - -EditableText.propTypes = { - // Called with input value on changes (as the user types) - onChange: _propTypes2.default.func, - - // Called with input value on blur (and enter if no onEnter is given) - onUpdate: _propTypes2.default.func, - - // Called on input keyDown events - onKeyDown: _propTypes2.default.func, - - // Input value property - text: _propTypes2.default.string, - - // Input properties - placeholder: _propTypes2.default.string, - className: _propTypes2.default.string, - disable: _propTypes2.default.bool, - autoFocus: _propTypes2.default.bool, - readOnly: _propTypes2.default.bool, - type: _propTypes2.default.oneOf(["text", "password"]), - size: _propTypes2.default.number -}; - -EditableText.defaultProps = { - readOnly: false, - type: "text" -}; - -module.exports = EditableText; - -},{"prop-types":192}],292:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.TEST_SELECTOR_CLASS = exports.DOWN_ARROW = exports.UP_ARROW = undefined; - -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 _EditableText = require("./EditableText"); - -var _EditableText2 = _interopRequireDefault(_EditableText); - -var _react = (window.React); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require("prop-types"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _fastIsnumeric = require("fast-isnumeric"); - -var _fastIsnumeric2 = _interopRequireDefault(_fastIsnumeric); - -var _classnames = require("classnames"); - -var _classnames2 = _interopRequireDefault(_classnames); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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 UP_ARROW = exports.UP_ARROW = 38; -var DOWN_ARROW = exports.DOWN_ARROW = 40; -var TEST_SELECTOR_CLASS = exports.TEST_SELECTOR_CLASS = "js-NumericInput"; - -var NumericInput = function (_Component) { - _inherits(NumericInput, _Component); - - function NumericInput(props) { - _classCallCheck(this, NumericInput); - - var _this = _possibleConstructorReturn(this, (NumericInput.__proto__ || Object.getPrototypeOf(NumericInput)).call(this, props)); - - _this.onKeyDown = _this.onKeyDown.bind(_this); - _this.incrementValue = _this.incrementValue.bind(_this); - return _this; - } - - _createClass(NumericInput, [{ - key: "onKeyDown", - value: function onKeyDown(e) { - switch (e.keyCode) { - case UP_ARROW: - return this.incrementValue("increase"); - case DOWN_ARROW: - return this.incrementValue("decrease"); - default: - break; - } - } - }, { - key: "incrementValue", - value: function incrementValue(direction) { - var step = this.props.step || 1; - var currentValue = this.props.value; - - if ((0, _fastIsnumeric2.default)(this.props.value)) { - if (direction === "increase") { - currentValue = currentValue + step; - } else { - currentValue = currentValue - step; - } - } - - // incrementers blur the line between blur and onChange. - if (this.props.onUpdate) { - this.props.onUpdate(currentValue); - } else { - this.props.onChange(currentValue); - } - } - }, { - key: "renderArrows", - value: function renderArrows() { - if (!this.props.showArrows) { - return; - } - - return _react2.default.createElement( - "div", - { className: "numeric-input__caret-box" }, - _react2.default.createElement( - "div", - { - className: "numeric-input__caret js-numeric-increase", - onClick: this.incrementValue.bind(this, "increase") - }, - _react2.default.createElement("i", { className: "icon-caret-up numeric-top-caret-modifier" }) - ), - _react2.default.createElement( - "div", - { - className: "numeric-input__caret js-numeric-decrease", - onClick: this.incrementValue.bind(this, "decrease") - }, - _react2.default.createElement("i", { className: "icon-caret-down numeric-bottom-caret-modifier" }) - ) - ); - } - }, { - key: "render", - value: function render() { - var wrapperClassName = (0, _classnames2.default)("numeric-input__wrapper"); - - var editableClass = (0, _classnames2.default)("numeric-input__number", this.props.editableClassName, TEST_SELECTOR_CLASS); - - return _react2.default.createElement( - "div", - { className: wrapperClassName }, - _react2.default.createElement(_EditableText2.default, { - className: editableClass, - text: String(this.props.value), - type: "text", - onChange: this.props.onChange, - onUpdate: this.props.onUpdate, - onKeyDown: this.onKeyDown - }), - this.renderArrows() - ); - } - }]); - - return NumericInput; -}(_react.Component); - -/*NumericInput.propTypes = { - value: customPropTypes.customOneOfType([ - PropTypes.string, - customPropTypes.isNumeric, - customPropTypes.isNull, - ]).isDefined, - onChange: PropTypes.func.isRequired, - onUpdate: PropTypes.func, - step: PropTypes.number, - showArrows: PropTypes.bool, - editableClassName: PropTypes.string, -};*/ - -exports.default = NumericInput; -NumericInput.defaultProps = { - showError: false, - showArrows: true -}; - -},{"./EditableText":291,"classnames":1,"fast-isnumeric":3,"prop-types":192}],293:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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 _NumericInput = require("./NumericInput"); - -var _NumericInput2 = _interopRequireDefault(_NumericInput); - -var _react = (window.React); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require("prop-types"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _fastIsnumeric = require("fast-isnumeric"); - -var _fastIsnumeric2 = _interopRequireDefault(_fastIsnumeric); - -var _workspaceConstants = require("../workspace-constants"); - -var _common = require("../../common"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -// mapPropsToState, What is this absurdity?!? NumericInputStatefulWrapper -// maintains state so that users can muck around in the inner NumericInput -// input box. We don't want to fire updates() each time a user enters a -// character. Only when the user blurs do we want the update method to be fired. -// So why map props onto state? The internal state is mapped to the inputbox -// and with MIXED_VALUE mode we need a way to forcibly change the characters in -// the inputbox. So incoming props update state but the user is then permitted -// to make textual changes to the inputbox outside of the knowledge of the -// Store. Then onBlur we fire onUpdate and the Store can decide whether to keep -// the value the user inputed or change it to something else. There is also -// an edge case where we are in mixedMode and showing some special character in -// the inputbox "-" and the user tries to manually edit the input box with -// garbage and move on. To make it clear that we are still in mixedMode and that -// no other inputs have been changed we revert their garbage back to "-". -// This requires a setState inside the onUpdate method. -function mapPropsToState(_ref) { - var propValue = _ref.value, - _ref$defaultValue = _ref.defaultValue, - defaultValue = _ref$defaultValue === undefined ? 0 : _ref$defaultValue; - - var value = void 0; - var mixedMode = propValue === _workspaceConstants.MIXED_VALUES; - - if (mixedMode) { - // MixedMode is useful when indicating to the user that there - // is another source of value coming from somewhere else in the - // app which renders this control optional. For example a user - // may have selected a value for xaxis range and is now exploring - // the UI for applying ranges to "all axes". In this case a - // mixedValue is shown so the user has some visual information that - // applying a value to "all axes" will somehow supercede some related - // value elsewhere. WS2 also provides a more helpful message in these - // cases than just the MIXED_MODE_VALUE - value = _workspaceConstants.MIXED_MODE_VALUE; - } else if (propValue === null) { - // Null is used throughout the App to represent "no value." - // This may be an unfortunate decision but NumericInput supports - // null by showing the user that the value is actually - // "defaultValue" or 0. - // Actually it would be nice to take this chunk of code out. - value = defaultValue; - } else { - value = propValue; - } - - return { value: value, mixedMode: mixedMode }; -} - -var NumericInputStatefulWrapper = function (_Component) { - _inherits(NumericInputStatefulWrapper, _Component); - - function NumericInputStatefulWrapper(props) { - _classCallCheck(this, NumericInputStatefulWrapper); - - var _this = _possibleConstructorReturn(this, (NumericInputStatefulWrapper.__proto__ || Object.getPrototypeOf(NumericInputStatefulWrapper)).call(this, props)); - - _this.state = mapPropsToState(props); - - _this.onChange = _this.onChange.bind(_this); - _this.onUpdate = _this.onUpdate.bind(_this); - return _this; - } - - _createClass(NumericInputStatefulWrapper, [{ - key: "componentWillReceiveProps", - value: function componentWillReceiveProps(nextProps) { - if (nextProps.value !== this.state.value) { - this.setState(mapPropsToState(nextProps)); - } - } - }, { - key: "onChange", - value: function onChange(value) { - /* - * Mixed Mode is preserved until new props are sent down from - * upstream components - */ - this.setState({ value: value }); - } - }, { - key: "onUpdate", - value: function onUpdate(value) { - var _props = this.props, - defaultValue = _props.defaultValue, - integerOnly = _props.integerOnly, - max = _props.max, - min = _props.min; - - // defaultValue is truthy or numeric (account for falsey 0) - - var hasDefaultValue = defaultValue || (0, _fastIsnumeric2.default)(defaultValue); - var updatedValue = value; - - // If we are in mixed mode and receive the placeholder value then - // the user is attempting to increment or decrement. If we are in - // mixed mode and receive some other value then the user has entered - // this value explicitly in the inputbox and is bluring away. - // In the case of incrementing and decrementing we set the updatedValue - // to the default value or min or 0. If the value is set explicitly and - // is numeric we do the same --- call onUpdate. This allows upstream - // components to send in new props that toggle this component out of - // mixedValue state. If it is set explicitly in the input box but is not - // numeric onUpdate is not called and mixedMode is maintained. - // In this case we also force MIXED_MODE_VALUE so the user is aware that - // no settings have actually been changed. - if (this.state.mixedMode && updatedValue === _workspaceConstants.MIXED_MODE_VALUE) { - var fallbackValue = min || 0; - updatedValue = hasDefaultValue ? defaultValue : fallbackValue; - } else if (this.state.mixedMode && !(0, _fastIsnumeric2.default)(updatedValue)) { - // mixed mode takes precedence over showing default values when - // empty strings are input. We return early to bypass that logic. - this.setState({ value: _workspaceConstants.MIXED_MODE_VALUE }); - return; - } - // If supplied a default value use it when the user blurs on an - // empty string or string made up of spaces. - if (typeof updatedValue === "string" && hasDefaultValue) { - updatedValue = updatedValue.replace(/^\s+/g, ""); - - if (updatedValue.length === 0) { - updatedValue = defaultValue; - } - } - - // When correct input is supplied by the user constrain it to be within - // [max, min] if max and min are supplied. Ditto for forcing an - // integer value. We take the floor instead of rounding - // as that is/(may be) less confusing to the user visually. - var numericBounds = (0, _fastIsnumeric2.default)(min) && (0, _fastIsnumeric2.default)(max); - if ((0, _fastIsnumeric2.default)(updatedValue)) { - updatedValue = Number(updatedValue); - - if (integerOnly) { - updatedValue = Math.floor(updatedValue); - } - - if (numericBounds) { - updatedValue = (0, _common.clamp)(updatedValue, min, max); - } else if ((0, _fastIsnumeric2.default)(min)) { - updatedValue = Math.max(min, updatedValue); - } else if ((0, _fastIsnumeric2.default)(max)) { - updatedValue = Math.min(max, updatedValue); - } - - this.props.onUpdate(updatedValue); - } - } - }, { - key: "render", - value: function render() { - return _react2.default.createElement(_NumericInput2.default, { - value: this.state.value, - onUpdate: this.onUpdate, - onChange: this.onChange, - step: this.props.step, - showArrows: this.props.showArrows, - editableClassName: this.props.editableClassName - }); - } - }]); - - return NumericInputStatefulWrapper; -}(_react.Component); - -exports.default = NumericInputStatefulWrapper; - - -NumericInputStatefulWrapper.propTypes = { - // defaultValue is default value used when - // A) a user leaves the input empty or filled with spaces. - // B) a user is moving out of mixed mode. - // C) a `null` value is supplied to this component. - defaultValue: _propTypes2.default.number, - editableClassName: _propTypes2.default.string, - - // When integerOnly flag is set any numeric input supplied by - // the user is constrained to be a whole integer number. - // Math.floor is used for this operation. - integerOnly: _propTypes2.default.bool, - - // If min is supplied and defaultValue is *not* supplied the min - // value will be used when the user moves out of mixed mode. - // If both min and max are supplied they are used to constrain - // numeric input from the user to be within this range. - max: _propTypes2.default.number, - min: _propTypes2.default.number, - - // Handler run onBlur and called with the updated value. - onUpdate: _propTypes2.default.func.isRequired, - - // showArrows is a flag that will show or hide the increment and - // decrement buttons on the side of the inputbox. Defaults to true. - showArrows: _propTypes2.default.bool, - - // If incrementors are present step size controls the numeric step taken - // when incrementing and decrementing. - step: _propTypes2.default.number, - - value: _propTypes2.default.any - /*value: customPropTypes.customOneOfType([ - PropTypes.string, - customPropTypes.isNumeric, - customPropTypes.isNull, - ]).isDefined,*/ -}; - -NumericInputStatefulWrapper.defaultProps = { - showArrows: true -}; - -},{"../../common":278,"../workspace-constants":295,"./NumericInput":292,"fast-isnumeric":3,"prop-types":192}],294:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.defaultColors = 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; }; - -var _react = (window.React); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require("prop-types"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _SketchFields = require("react-color/lib/components/sketch/SketchFields"); - -var _SketchFields2 = _interopRequireDefault(_SketchFields); - -var _SketchPresetColors = require("react-color/lib/components/sketch/SketchPresetColors"); - -var _SketchPresetColors2 = _interopRequireDefault(_SketchPresetColors); - -var _common = require("react-color/lib/components/common"); - -var _reactColor = require("react-color"); - -var _common2 = require("../../common"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// Plotly JS default colors. -var defaultColors = exports.defaultColors = ["#444444", "#ffffff", "#1f77b4", // muted blue -"#ff7f0e", // safety orange -"#2ca02c", // cooked asparagus green -"#d62728", // brick red -"#9467bd", // muted purple -"#8c564b", // chestnut brown -"#e377c2", // raspberry yogurt pink -"#7f7f7f", // middle gray -"#bcbd22", // curry yellow-green -"#17becf"]; - -function TieredColorPicker(props) { - var rgb = props.rgb, - onChangeComplete = props.onChangeComplete; - var r = rgb.r, - g = rgb.g, - b = rgb.b, - a = rgb.a; - - - var activeColor = { - backgroundColor: "rgba(" + r + ", " + g + ", " + b + ", " + a + ")" - }; - - return _react2.default.createElement( - "div", - null, - _react2.default.createElement( - "div", - null, - _react2.default.createElement( - "p", - { className: "color-picker-title" }, - (0, _common2._)("Custom colors") - ), - _react2.default.createElement( - "div", - { className: "color-picker-saturation" }, - _react2.default.createElement(_common.Saturation, props) - ), - _react2.default.createElement( - "div", - { className: "color-picker-controls +flex" }, - _react2.default.createElement( - "div", - { className: "color-picker-sliders" }, - _react2.default.createElement( - "div", - { className: "color-picker-slider" }, - _react2.default.createElement(_common.Hue, props) - ), - _react2.default.createElement( - "div", - { className: "color-picker-slider" }, - _react2.default.createElement(_common.Alpha, props) - ) - ), - _react2.default.createElement( - "div", - { className: "color-picker-active" }, - _react2.default.createElement(_common.Checkboard, null), - _react2.default.createElement("div", { style: activeColor, className: "color-picker-active-swatch" }) - ) - ), - _react2.default.createElement( - "div", - { className: "color-picker-custom-input" }, - _react2.default.createElement(_SketchFields2.default, _extends({}, props, { onChange: onChangeComplete })) - ) - ), - _react2.default.createElement( - "div", - null, - _react2.default.createElement( - "p", - { className: "color-picker-title" }, - (0, _common2._)("Default colors") - ), - _react2.default.createElement( - "div", - { className: "color-picker-preset-colors js-color-picker-preset-colors" }, - _react2.default.createElement(_SketchPresetColors2.default, { colors: defaultColors, onClick: onChangeComplete }) - ) - ) - ); -} - -TieredColorPicker.propTypes = { - color: _propTypes2.default.string.isRequired, - rgb: _propTypes2.default.shape({ - r: _propTypes2.default.number, - g: _propTypes2.default.number, - b: _propTypes2.default.number, - a: _propTypes2.default.number - }).isRequired, - onChangeComplete: _propTypes2.default.func.isRequired -}; - -exports.default = (0, _reactColor.CustomPicker)(TieredColorPicker); - -},{"../../common":278,"prop-types":192,"react-color":244,"react-color/lib/components/common":212,"react-color/lib/components/sketch/SketchFields":228,"react-color/lib/components/sketch/SketchPresetColors":229}],295:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -var CLEAR_WORKSPACE = exports.CLEAR_WORKSPACE = "WORKSPACE_CLEAR_WORKSPACE"; - -var EDIT_MODE = exports.EDIT_MODE = { - ANALYSIS: "WORKSPACE_EDIT_MODE_ANALYSIS", - GRAPH: "WORKSPACE_EDIT_MODE_GRAPH", - STYLE: "WORKSPACE_EDIT_MODE_STYLE", - SHARE: "WORKSPACE_EDIT_MODE_SHARE", - EXPORT: "WORKSPACE_EDIT_MODE_EXPORT", - JSON: "WORKSPACE_EDIT_MODE_JSON" -}; - -var STYLE_MODE = exports.STYLE_MODE = { - TRACES: "WORKSPACE_STYLE_MODE_TRACES", - LAYOUT: "WORKSPACE_STYLE_MODE_LAYOUT", - NOTES: "WORKSPACE_STYLE_MODE_NOTES", - AXES: "WORKSPACE_STYLE_MODE_AXES", - LEGEND: "WORKSPACE_STYLE_MODE_LEGEND", - COLOR_BARS: "WORKSPACE_STYLE_MODE_COLOR_BARS", - SHAPES: "WORKSPACE_STYLE_MODE_SHAPES", - MAPBOX_LAYERS: "WORKSPACE_STYLE_MODE_MAPBOX_LAYERS", - IMAGES: "WORKSPACE_STYLE_MODE_IMAGES", - MOBILE: "WORKSPACE_STYLE_MODE_MOBILE" -}; - -var GRAPH_MODE = exports.GRAPH_MODE = { - CREATE: "WORKSPACE_GRAPH_MODE_CREATE", - FILTER: "WORKSPACE_GRAPH_MODE_FILTER", - GROUPBY: "WORKSPACE_GRAPH_MODE_GROUPBY" -}; - -var ADD_PLOT_ID = exports.ADD_PLOT_ID = "WORKSPACE_ADD_PLOT_ID"; -var ADD_PLOT_SOURCE = exports.ADD_PLOT_SOURCE = "WORKSPACE_ADD_PLOT_SOURCE"; -var ADD_PLOT_SOURCE_SHARE_KEY = exports.ADD_PLOT_SOURCE_SHARE_KEY = "WORKSPACE_ADD_PLOT_SOURCE_SHARE_KEY"; -var UPDATE_PLOT_DIRTY = exports.UPDATE_PLOT_DIRTY = "WORKSPACE_UPDATE_PLOT_DIRTY"; - -var ADD_SHARE_FID = exports.ADD_SHARE_FID = "WORKSPACE_ADD_SHARE_FID"; - -// Spec used to create the EditModeMenu Buttons -var EDIT_MODE_MENU_ITEMS = exports.EDIT_MODE_MENU_ITEMS = [{ - mode: EDIT_MODE.GRAPH, - text: "Graph", - refName: "graphModeToggle" -}, { - mode: EDIT_MODE.STYLE, - text: "Style", - refName: "styleModeToggle" -}, { - mode: EDIT_MODE.ANALYSIS, - text: "Analysis", - refName: "analysisModeToggle" -}, { - mode: EDIT_MODE.JSON, - text: "JSON", - refName: "jsonModeToggle" -}, { - mode: EDIT_MODE.EXPORT, - text: "Export", - refName: "exportModeToggle" -}]; - -var STYLE_MODE_MENU_ITEMS = exports.STYLE_MODE_MENU_ITEMS = [{ - mode: STYLE_MODE.TRACES, - text: "Traces", - refName: "tracesStyleModeToggle" -}, { - mode: STYLE_MODE.LAYOUT, - text: "Layout", - refName: "layoutStyleModeToggle" -}, { - mode: STYLE_MODE.NOTES, - text: "Notes", - refName: "notesStyleModeToggle" -}, { - mode: STYLE_MODE.AXES, - text: "Axes", - refName: "axesStyleModeToggle" -}, { - mode: STYLE_MODE.LEGEND, - text: "Legend", - refName: "legendStyleModeToggle" -}, { - mode: STYLE_MODE.COLOR_BARS, - text: "Color Bars", - refName: "colorBarsStyleModeToggle" -}, { - mode: STYLE_MODE.SHAPES, - text: "Shapes", - refName: "shapesStyleModeToggle" -}, { - mode: STYLE_MODE.MAPBOX_LAYERS, - text: "GeoJSON", - refName: "mapboxLayersToggle" -}, { - mode: STYLE_MODE.IMAGES, - text: "Images", - refName: "imagesStyleModeToggle" -}, { - mode: STYLE_MODE.MOBILE, - text: "Mobile", - refName: "MobileStyleModeToggle" -}]; - -var GRAPH_MODE_MENU_ITEMS = exports.GRAPH_MODE_MENU_ITEMS = [{ - mode: GRAPH_MODE.CREATE, - text: "create", - refName: "createGraphModeToggle" -}, { - mode: GRAPH_MODE.FILTER, - text: "filter", - refName: "filterGraphModeToggle" -}, { - mode: GRAPH_MODE.GROUPBY, - text: "group", - refName: "groupbyGraphModeToggle" -}]; - -// temp / saved state of fids and column uids -var UPDATE_COLUMN_ID_MAP = exports.UPDATE_COLUMN_ID_MAP = "WORKSPACE_UPDATE_COLUMN_ID_MAP"; -var UPDATE_FID_MAP = exports.UPDATE_FID_MAP = "WORKSPACE_UPDATE_FID_MAP"; -var UPDATE_LAST_SAVED = exports.UPDATE_LAST_SAVED = "WORKSPACE_UPDATE_LAST_SAVED"; -var MARK_FID_AS_UNSAVED = exports.MARK_FID_AS_UNSAVED = "WORKSPACE_MARK_FID_AS_UNSAVED"; -var REMOVE_COLUMN_IDS_FROM_COLUMN_ID_MAP = exports.REMOVE_COLUMN_IDS_FROM_COLUMN_ID_MAP = "WORKSPACE_REMOVE_COLUMN_IDS_FROM_COLUMN_ID_MAP"; - -// panels -var EDIT_MODES = exports.EDIT_MODES = Object.keys(EDIT_MODE).map(function (k) { - return EDIT_MODE[k]; -}); -var STYLE_MODES = exports.STYLE_MODES = Object.keys(STYLE_MODE).map(function (k) { - return STYLE_MODE[k]; -}); -var GRAPH_MODES = exports.GRAPH_MODES = Object.keys(GRAPH_MODE).map(function (k) { - return GRAPH_MODE[k]; -}); -var SELECT_EDIT_MODE = exports.SELECT_EDIT_MODE = "WORKSPACE_SELECT_EDIT_MODE"; -var SELECT_STYLE_MODE = exports.SELECT_STYLE_MODE = "WORKSPACE_SELECT_STYLE_MODE"; -var SELECT_GRAPH_MODE = exports.SELECT_GRAPH_MODE = "WORKSPACE_SELECT_GRAPH_MODE"; - -// figure -var ADD_BREAKPOINT = exports.ADD_BREAKPOINT = "WORKSPACE_ADD_BREAKPOINT"; -var DELETE_BREAKPOINT = exports.DELETE_BREAKPOINT = "WORKSPACE_DELETE_BREAKPOINT"; -var PLOTLY_RELAYOUT = exports.PLOTLY_RELAYOUT = "WORKSPACE_RELAYOUT"; -var PLOTLY_RESTYLE = exports.PLOTLY_RESTYLE = "WORKSPACE_RESTYLE"; -var PLOTLY_NEW_PLOT = exports.PLOTLY_NEW_PLOT = "WORKSPACE_NEW_PLOT"; -var PLOTLY_ADD_FRAMES = exports.PLOTLY_ADD_FRAMES = "WORKSPACE_ADD_FRAMES"; -var PLOTLY_DELETE_FRAMES = exports.PLOTLY_DELETE_FRAMES = "WORKSPACE_DELETE_FRAMES"; -var SELECT_FRAME = exports.SELECT_FRAME = "WORKSPACE_SELECT_FRAME"; -var SET_BASE_LAYOUT = exports.SET_BASE_LAYOUT = "WORKSPACE_SET_BASE_LAYOUT"; -var SET_BREAKPOINT = exports.SET_BREAKPOINT = "WORKSPACE_SET_BREAKPOINT"; - -// annotations -var INLINE_STYLE_LINK = exports.INLINE_STYLE_LINK = "LINK"; -var INLINE_STYLE_SUPER = exports.INLINE_STYLE_SUPER = "SUPERSCRIPT"; -var INLINE_STYLE_SUB = exports.INLINE_STYLE_SUB = "SUBSCRIPT"; - -// columns and tables -var MERGE_COLUMNS_AND_TABLES = exports.MERGE_COLUMNS_AND_TABLES = "WORKSPACE_MERGE_COLUMNS_AND_TABLES"; -var UPDATE_TABLE = exports.UPDATE_TABLE = "UPDATE_TABLE"; -var ADD_EMPTY_TABLE = exports.ADD_EMPTY_TABLE = "WORKSPACE_ADD_EMTPY_TABLE"; -var SELECT_TABLE = exports.SELECT_TABLE = "WORKSPACE_SELECT_TABLE"; -var OVERWRITE_SOURCE = exports.OVERWRITE_SOURCE = "WORKSPACE_OVERWRITE_SOURCE"; -var REMOVE_TABLE = exports.REMOVE_TABLE = "WORKSPACE_REMOVE_TABLE"; -var REMOVE_COLUMNS_FROM_TABLE = exports.REMOVE_COLUMNS_FROM_TABLE = "WORKSPACE_REMOVE_COLUMNS_FROM_TABLE"; - -// encoding -var ASSIGN_COLUMN = exports.ASSIGN_COLUMN = "WORKSPACE_ASSIGN_COLUMN"; -var SWITCH_CHART_TYPE = exports.SWITCH_CHART_TYPE = "WORKSPACE_SWITCH_CHART_TYPE"; -var NEW_ENCODING_LAYER = exports.NEW_ENCODING_LAYER = "WORKSPACE_NEW_ENCODING_LAYER"; -var REMOVE_ENCODING_LAYER = exports.REMOVE_ENCODING_LAYER = "WORKSPACE_REMOVE_ENCODING_LAYER"; -var SET_ENCODING = exports.SET_ENCODING = "WORKSPACE_SET_ENCODING"; -var DEFAULT_ENCODING_TYPE = exports.DEFAULT_ENCODING_TYPE = "scatter"; - -// analyses -var UPDATE_ANALYSIS = exports.UPDATE_ANALYSIS = "WORKSPACE_UPDATE_ANALYSIS"; -var ADD_ANALYSIS = exports.ADD_ANALYSIS = "WORKSPACE_ADD_ANALYSIS"; -var REMOVE_ANALYSIS = exports.REMOVE_ANALYSIS = "WORKSPACE_REMOVE_ANALYSIS"; -var UPDATE_ANALYSIS_META = exports.UPDATE_ANALYSIS_META = "WORKSPACE_UPDATE_ANALYSIS_META"; - -// HOT -var MAX_HOT_ROWS = exports.MAX_HOT_ROWS = 5000; -var CONTEXT_MENU_SOURCE = exports.CONTEXT_MENU_SOURCE = "WORKSPACE_CONTEXT_MENU_SOURCE"; -var SORT_SOURCE = exports.SORT_SOURCE = "WORKSPACE_SORT_SOURCE"; -var INSERT_HEADERS_ABOVE_SOURCE = exports.INSERT_HEADERS_ABOVE_SOURCE = "WORKSPACE_INSERT_HEADERS_ABOVE_SOURCE"; -var CONTEXT_MENU_KEYS = exports.CONTEXT_MENU_KEYS = { - CLEAR_HEADERS: "WORKSPACE_CONTEXT_MENU_KEYS_CLEAR_HEADERS", - COL_LEFT: "WORKSPACE_CONTEXT_MENU_KEYS_COL_LEFT", - COL_RIGHT: "WORKSPACE_CONTEXT_MENU_KEYS_COL_RIGHT", - INSERT_HEADERS_ABOVE: "WORKSPACE_CONTEXT_MENU_KEYS_INSERT_HEADERS_ABOVE", - REMOVE_COL: "WORKSPACE_CONTEXT_MENU_KEYS_REMOVE_COL", - REMOVE_ROW: "WORKSPACE_CONTEXT_MENU_KEYS_REMOVE_ROW", - RENAME_HEADER: "WORKSPACE_CONTEXT_MENU_KEYS_RENAME_HEADER", - RESET_SORT: "WORKSPACE_CONTEXT_MENU_KEYS_RESET_SORT", - ROW_ABOVE: "WORKSPACE_CONTEXT_MENU_KEYS_ROW_ABOVE", - ROW_BELOW: "WORKSPACE_CONTEXT_MENU_KEYS_ROW_BELOW", - SET_HEADERS: "WORKSPACE_CONTEXT_MENU_KEYS_SET_HEADERS", - SORT_ASCENDING: "WORKSPACE_CONTEXT_MENU_KEYS_SORT_ASCENDING", - SORT_DESCENDING: "WORKSPACE_CONTEXT_MENU_KEYS_SORT_DESCENDING", - TRANSPOSE_TABLE: "WORKSPACE_CONTEXT_MENU_KEYS_TRANSPOSE_TABLE" -}; - -// style panels -var CONTROL_TYPES = exports.CONTROL_TYPES = { - FONT: "FONT", - COLOR: "COLOR", - ANCHOR_SELECTOR: "ANCHOR_SELECTOR", - DASH: "DASH", - SYMBOL: "SYMBOL", - RADIO: "RADIO", - TEXTAREA: "TEXTAREA", - ANNOTATION_EDITOR: "ANNOTATION_EDITOR", - MAPBOX_ACCESS_TOKEN: "MAPBOX_ACCESS_TOKEN", - NUMERIC_INPUT: "NUMERIC_INPUT", - FLAGLIST_CHECKBOX: "FLAGLIST_CHECKBOX", - COLUMN_INPUT: "COLUMN_INPUT", - COLOR_PALETTE: "COLOR_PALETTE", - DATETIME_INPUT: "DATETIME_INPUT", - DATETIME_DURATION: "DATETIME_DURATION", - DROPDOWN_SELECTOR: "DROPDOWN_SELECTOR", - DROPDOWN_WITH_TEXT_INPUT: "DROPDOWN_WITH_TEXT_INPUT", - RANGE: "RANGE", - SLIDER: "SLIDER", - INPUT_SLIDER: "INPUT_SLIDER", - BUTTON: "BUTTON", - RANGE_SELECTOR_BUTTONS: "RANGE_SELECTOR_BUTTONS", - TEXT_INPUT: "TEXT_INPUT", - UPLOAD_SHAPE_FILE: "UPLOAD_SHAPE_FILE", - UPLOAD_IMAGE_FILE: "UPLOAD_IMAGE_FILE", - REF_CONTROL: "REF_CONTROL", - ANCHOR: "ANCHOR", - MAPBOX_STYLE_URL: "MAPBOX_STYLE_URL", - ORIENTATION: "ORIENTATION", - NOTE: "NOTE", - ARROW: "ARROW" -}; - -// encoding panel -var ENCODING_ATTRIBUTE_TYPES = exports.ENCODING_ATTRIBUTE_TYPES = { - PLOTLYJS: "PLOTLYJS", - ENCODING: "ENCODING" -}; - -/* - * Control represents multiple settings (like for several axes) - * and the values are different. - * - * Because this is sometimes used in contexts where users can enter freeform - * strings, we include a non-printable character (ESC) so it's not something - * people could type. - */ -var MIXED_VALUES = exports.MIXED_VALUES = "\x1bMIXED_VALUES"; - -// how mixed values are represented in text inputs -var MIXED_MODE_VALUE = exports.MIXED_MODE_VALUE = "-"; - -// import modal -var IMPORT_MODES = exports.IMPORT_MODES = { - EXAMPLES: "EXAMPLES", - SQL: "SQL", - URL: "URL", - UPLOAD: "UPLOAD" -}; - -var ORG_IMPORT_MODES = exports.ORG_IMPORT_MODES = { - DATASET: "DATASET", - NOTEBOOK: "NOTEBOOK", - PRESENTATION: "PRESENTATION" -}; - -var IMPORT_EXAMPLE_URL = exports.IMPORT_EXAMPLE_URL = "https://raw.githubusercontent.com/plotly/datasets/master/iris.csv"; - -var CHART_TYPE_ICON = exports.CHART_TYPE_ICON = { - animation: "icon-animation", - area: "icon-plot-area", - bar: "icon-plot-bar", - box: "icon-plot-box", - candlestick: "icon-candlestick", - cartesianArea: "icon-plot-area", - choropleth: "icon-choropleth", - contour: "icon-contour", - errorbars: "icon-error-bars", - heatmap: "icon-plot-heatmap", - histogram2d: "icon-plot-2d-hist", - histogram2dcontour: "icon-plot-2d-hist", - histogram: "icon-plot-hist", - line: "icon-plot-line", - mesh3d: "icon-mesh3d", - ohlc: "icon-ohlc", - pie: "icon-pie-chart", - scatter3d: "icon-plot-3d-scatter", - line3d: "icon-plot-3d-line", - scatter: "icon-plot-scatter", - scattergeo: "icon-scatter-chart", - scattermapbox: "icon-scatter-chart", - scatterternary: "icon-ternary-scatter", - surface: "icon-plot-3d-surface", - timeseries: "icon-time-series" -}; - -var ALL_AXES = exports.ALL_AXES = [{ - axisTypeIdentifier: "AxesSpec", - typeQuery: "cartesian", - identifier: "xaxis", - defaultAxis: "xaxis", - options: [{ value: "allaxes", label: "All", title: "All Axes" }, { value: "xaxis", label: "X", title: "X Axes", singular: "X axis" }, { value: "yaxis", label: "Y", title: "Y Axes", singular: "Y axis" }] -}, { - axisTypeIdentifier: "AxesSpec", - typeQuery: "gl2d", - identifier: "xaxis", - defaultAxis: "xaxis", - options: [{ value: "allaxes", label: "All", title: "All Axes" }, { value: "xaxis", label: "X", title: "X Axes", singular: "X axis" }, { value: "yaxis", label: "Y", title: "Y Axes", singular: "Y axis" }] -}, { - axisTypeIdentifier: "GeoSpec", - typeQuery: "geo", - identifier: "geo", - defaultAxis: "lonaxis", - options: [{ value: "lataxis", label: "Latitude", title: "Latitude" }, { value: "lonaxis", label: "Longitude", title: "Longitude" }] -}, { - axisTypeIdentifier: "SceneSpec", - typeQuery: "gl3d", - identifier: "scene", - defaultAxis: "xaxis", - options: [{ value: "allaxes", label: "All", title: "All Axes" }, { value: "xaxis", label: "X", title: "X Axes", singular: "X axis" }, { value: "yaxis", label: "Y", title: "Y Axes", singular: "Y axis" }, { value: "zaxis", label: "Z", title: "Z Axes", singular: "Z axis" }] -}, { - axisTypeIdentifier: "TernarySpec", - typeQuery: "ternary", - identifier: "ternary", - defaultAxis: "aaxis", - options: [{ value: "aaxis", label: "A", title: "A Axes", singular: "A Axis" }, { value: "baxis", label: "B", title: "B Axes", singular: "B Axis" }, { value: "caxis", label: "C", title: "C Axes", singular: "C Axis" }] -}, { - typeQuery: "pie", - options: "NO_AXES" -}]; - -// Layout specification for CategorizedSelectTrace -var CHART_CATEGORY = exports.CHART_CATEGORY = { - BUSINESS: "BUSINESS", - SCIENCE: "SCIENCE", - CHARTS_3D: "CHARTS_3D", - FINANCIAL: "FINANCIAL", - STATISTICS: "STATISTICS", - MAPS: "MAPS" -}; - -var CATEGORY_LAYOUT = exports.CATEGORY_LAYOUT = [{ category: CHART_CATEGORY.BUSINESS, label: "Business" }, { category: CHART_CATEGORY.SCIENCE, label: "Science" }, { category: CHART_CATEGORY.CHARTS_3D, label: "3d charts" }, { category: CHART_CATEGORY.FINANCIAL, label: "Finance" }, { category: CHART_CATEGORY.STATISTICS, label: "Statistics" }, { category: CHART_CATEGORY.MAPS, label: "Maps" }]; - -// ShareModalTabs -var SHARE_MODAL_TAB_OPTIONS = exports.SHARE_MODAL_TAB_OPTIONS = { - LINK_AND_PRIVACY: "Link & Privacy", - COLLABORATORS: "Collaborate", - EMBED: "Embed" -}; - -var SHARE_MODAL_TABS = exports.SHARE_MODAL_TABS = Object.keys(SHARE_MODAL_TAB_OPTIONS).map(function (k) { - return SHARE_MODAL_TAB_OPTIONS[k]; -}); - -// 1x1px transparent gif: https://css-tricks.com/snippets/html/base64-encode-of-1x1px-transparent-gif/ -var IMAGE_PLACEHOLDER = exports.IMAGE_PLACEHOLDER = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"; - -var MAPBOX_ERROR_TYPES = exports.MAPBOX_ERROR_TYPES = { - INVALID_JSON: "INVALID_JSON", - FAILED_REQUEST: "FAILED_REQUEST", - FAILED_PARSING: "FAILED_PARSING", - UNKNOWN: "UNKNOWN" -}; - -var WORKSPACE_PLOT_ID = exports.WORKSPACE_PLOT_ID = "js-main-plotly-workspace-plot"; - -var WORKSPACE_CONTAINER = exports.WORKSPACE_CONTAINER = document.getElementById("main"); -var WORKSPACE_PLACEHOLDER = exports.WORKSPACE_PLACEHOLDER = document.getElementById("placeholderworkspace"); - -var IS_TRANSFORM = true; - -// quadruplet containing [CONSTANT_NAME TYPE LABEL IS_TRANSFORM]. -var ANALYSES = exports.ANALYSES = [["DESCRIPTIVE", "descriptive-statistics", "Descriptive statistics", !IS_TRANSFORM], ["ANOVA_TEST", "anova", "ANOVA", !IS_TRANSFORM], ["CHI_SQUARED_TEST", "chi-squared-test", "Chi-squared test", !IS_TRANSFORM], ["T_TEST", "t-test", "T-test (two-tailed, independent)", !IS_TRANSFORM], ["CORRELATION", "column-correlation", "Column correlation", !IS_TRANSFORM], ["FIT", "fit", "Curve fitting", IS_TRANSFORM], ["AVERAGE", "average", "Average", IS_TRANSFORM], ["MOVING_AVERAGE", "moving-average", "Moving average", IS_TRANSFORM]]; - -var ANALYSES_TYPES = exports.ANALYSES_TYPES = ANALYSES.reduce(function (accum, _ref) { - var _ref2 = _slicedToArray(_ref, 2), - name = _ref2[0], - type = _ref2[1]; - - accum[name] = type; - return accum; -}, {}); - -var ANALYSES_TYPES_TO_LABELS = exports.ANALYSES_TYPES_TO_LABELS = ANALYSES.reduce(function (accum, _ref3) { - var _ref4 = _slicedToArray(_ref3, 3), - type = _ref4[1], - label = _ref4[2]; - - accum[type] = label; - return accum; -}, {}); - -// used by WorkspaceActions to search for linked transforms inside traces -var TRANSFORM_TYPES = exports.TRANSFORM_TYPES = ANALYSES.filter(function (_ref5) { - var _ref6 = _slicedToArray(_ref5, 4), - isTransform = _ref6[3]; - - return isTransform; -}).map(function (_ref7) { - var _ref8 = _slicedToArray(_ref7, 2), - type = _ref8[1]; - - return type; -}); - -/* - * Constants relating to the user interface - */ - -var RETURN_KEY = exports.RETURN_KEY = "Enter"; -var ESCAPE_KEY = exports.ESCAPE_KEY = "Escape"; -var COMMAND_KEY = exports.COMMAND_KEY = "Meta"; -var CONTROL_KEY = exports.CONTROL_KEY = "Control"; - -},{}],296:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = { - baseClass: "plotly-editor" -}; - -},{}],297:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = { - en: { - style: { - traces: { - display: "Display", - trace: "Trace", - opacity: "Opacity", - points: "Points", - lines: "Lines", - "marker-opacity": "Marker Opacity", - "marker-size": "Diameter", - "line-width": "Line Width", - "marker-line-width": "Border-width" - } - } - }, - es: { - style: { - traces: { - display: "Visualización", - trace: "Rastro", - opacity: "Opacidad", - points: "Puntos", - lines: "Líneas", - "marker-opacity": "opacidad del marcador", - "marker-size": "diámetro", - "line-width": "ancho de línea", - "marker-line-width": "ancho del borde" - } - } - } -}; - -},{}],298:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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 = (window.React); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require("prop-types"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _constants = require("./constants"); - -var _constants2 = _interopRequireDefault(_constants); - -var _common = require("./common"); - -var _Panel = require("./components/Panel"); - -var _Panel2 = _interopRequireDefault(_Panel); - -var _ModeMenu = require("./components/ModeMenu"); - -var _ModeMenu2 = _interopRequireDefault(_ModeMenu); - -var _Select = require("./components/Select"); - -var _Select2 = _interopRequireDefault(_Select); - -var _DefaultPanels = require("./components/DefaultPanels"); - -var _DefaultPanels2 = _interopRequireDefault(_DefaultPanels); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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 PlotlyReactEditor = function (_Component) { - _inherits(PlotlyReactEditor, _Component); - - function PlotlyReactEditor(props) { - _classCallCheck(this, PlotlyReactEditor); - - var _this = _possibleConstructorReturn(this, (PlotlyReactEditor.__proto__ || Object.getPrototypeOf(PlotlyReactEditor)).call(this, props)); - - _this.state = { - section: "Style-Traces" - }; - (0, _common.setLocale)(props.locale || "en"); - - _this.setSection = _this.setSection.bind(_this); - return _this; - } - - _createClass(PlotlyReactEditor, [{ - key: "setSection", - value: function setSection(section) { - this.setState({ section: section }); - } - }, { - key: "getChildContext", - value: function getChildContext() { - var gd = this.props.graphDiv || {}; - var dataSourceNames = Object.keys(this.props.dataSources || {}); - return { - data: gd.data, - fullData: gd._fullData, - layout: gd.layout, - fullLayout: gd._fullLayout, - handleUpdate: this.updateProp.bind(this), - section: this.state.section.toLowerCase(), - dataSources: this.props.dataSources, - dataSourceNames: dataSourceNames - }; - } - }, { - key: "updateProp", - value: function updateProp(attr, value) { - this.props.onUpdate && this.props.onUpdate(this.props.graphDiv, attr, value); - } - }, { - key: "render", - value: function render() { - return _react2.default.createElement( - "div", - { className: (0, _common.bem)() }, - _react2.default.createElement(_ModeMenu2.default, { - currentSection: this.state.section, - onChangeSection: this.setSection - }), - this.props.graphDiv && (this.props.children ? this.props.children : _react2.default.createElement(_DefaultPanels2.default, null)) - ); - } - }]); - - return PlotlyReactEditor; -}(_react.Component); - -exports.default = PlotlyReactEditor; - - -PlotlyReactEditor.childContextTypes = { - dataSources: _propTypes2.default.object, - dataSourceNames: _propTypes2.default.array, - data: _propTypes2.default.array, - fullData: _propTypes2.default.array, - layout: _propTypes2.default.object, - fullLayout: _propTypes2.default.object, - handleUpdate: _propTypes2.default.func, - section: _propTypes2.default.string -}; - -},{"./common":278,"./components/DefaultPanels":280,"./components/ModeMenu":282,"./components/Panel":286,"./components/Select":288,"./constants":296,"prop-types":192}]},{},[298])(298) -}); \ No newline at end of file diff --git a/build/plotly.js-react-editor.min.js b/build/plotly.js-react-editor.min.js deleted file mode 100644 index e7092d102..000000000 --- a/build/plotly.js-react-editor.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).createPlotlyComponent=e()}}(function(){return function e(t,r,n){function o(i,l){if(!r[i]){if(!t[i]){var s="function"==typeof require&&require;if(!l&&s)return s(i,!0);if(a)return a(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[i]={exports:{}};t[i][0].call(u.exports,function(e){var r=t[i][1][e];return o(r||e)},u,u.exports,e,t,r,n)}return r[i].exports}for(var a="function"==typeof require&&require,i=0;i1?s-1:0),u=1;u13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}t.exports=function(e){var t=typeof e;if("string"===t){var r=e;if(0===(e=+e)&&n(r))return!1}else if("number"!==t)return!1;return e-e<1}},{}],4:[function(e,t,r){"use strict";function n(e){return function(){return e}}var o=function(){};o.thatReturns=n,o.thatReturnsFalse=n(!1),o.thatReturnsTrue=n(!0),o.thatReturnsNull=n(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},t.exports=o},{}],5:[function(e,t,r){(function(e){"use strict";var r={};"production"!==e.env.NODE_ENV&&Object.freeze(r),t.exports=r}).call(this,e("_process"))},{_process:187}],6:[function(e,t,r){(function(e){"use strict";var r=function(e){};"production"!==e.env.NODE_ENV&&(r=function(e){if(void 0===e)throw new Error("invariant requires an error message argument")}),t.exports=function(e,t,n,o,a,i,l,s){if(r(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,o,a,i,l,s],f=0;(c=new Error(t.replace(/%s/g,function(){return u[f++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}}).call(this,e("_process"))},{_process:187}],7:[function(e,t,r){(function(r){"use strict";var n=e("./emptyFunction");if("production"!==r.env.NODE_ENV){var o=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n2?r-2:0),a=2;ap))return!1;var h=u.get(e);if(h&&u.get(t))return h==t;var b=-1,y=!0,v=r&l?new n:void 0;for(u.set(e,t),u.set(t,e);++b-1&&e%1==0&&e-1}},{"./_assocIndexOf":30}],113:[function(e,t,r){var n=e("./_assocIndexOf");t.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},{"./_assocIndexOf":30}],114:[function(e,t,r){var n=e("./_Hash"),o=e("./_ListCache"),a=e("./_Map");t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||o),string:new n}}},{"./_Hash":9,"./_ListCache":10,"./_Map":11}],115:[function(e,t,r){var n=e("./_getMapData");t.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},{"./_getMapData":85}],116:[function(e,t,r){var n=e("./_getMapData");t.exports=function(e){return n(this,e).get(e)}},{"./_getMapData":85}],117:[function(e,t,r){var n=e("./_getMapData");t.exports=function(e){return n(this,e).has(e)}},{"./_getMapData":85}],118:[function(e,t,r){var n=e("./_getMapData");t.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},{"./_getMapData":85}],119:[function(e,t,r){t.exports=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}},{}],120:[function(e,t,r){t.exports=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}}},{}],121:[function(e,t,r){var n=e("./memoize"),o=500;t.exports=function(e){var t=n(e,function(e){return r.size===o&&r.clear(),e}),r=t.cache;return t}},{"./memoize":164}],122:[function(e,t,r){var n=e("./_getNative")(Object,"create");t.exports=n},{"./_getNative":87}],123:[function(e,t,r){var n=e("./_overArg")(Object.keys,Object);t.exports=n},{"./_overArg":127}],124:[function(e,t,r){t.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},{}],125:[function(e,t,r){var n=e("./_freeGlobal"),o="object"==typeof r&&r&&!r.nodeType&&r,a=o&&"object"==typeof t&&t&&!t.nodeType&&t,i=a&&a.exports===o&&n.process,l=function(){try{return i&&i.binding&&i.binding("util")}catch(e){}}();t.exports=l},{"./_freeGlobal":82}],126:[function(e,t,r){var n=Object.prototype.toString;t.exports=function(e){return n.call(e)}},{}],127:[function(e,t,r){t.exports=function(e,t){return function(r){return e(t(r))}}},{}],128:[function(e,t,r){var n=e("./_freeGlobal"),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();t.exports=a},{"./_freeGlobal":82}],129:[function(e,t,r){var n="__lodash_hash_undefined__";t.exports=function(e){return this.__data__.set(e,n),this}},{}],130:[function(e,t,r){t.exports=function(e){return this.__data__.has(e)}},{}],131:[function(e,t,r){t.exports=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}},{}],132:[function(e,t,r){var n=e("./_ListCache");t.exports=function(){this.__data__=new n,this.size=0}},{"./_ListCache":10}],133:[function(e,t,r){t.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},{}],134:[function(e,t,r){t.exports=function(e){return this.__data__.get(e)}},{}],135:[function(e,t,r){t.exports=function(e){return this.__data__.has(e)}},{}],136:[function(e,t,r){var n=e("./_ListCache"),o=e("./_Map"),a=e("./_MapCache"),i=200;t.exports=function(e,t){var r=this.__data__;if(r instanceof n){var l=r.__data__;if(!o||l.length=t||r<0||w&&n>=g}function d(){var e=o();if(p(e))return h(e);_=setTimeout(d,f(e))}function h(e){return _=void 0,S&&y?c(e):(y=v=void 0,m)}function b(){var e=o(),r=p(e);if(y=arguments,v=this,E=e,r){if(void 0===_)return u(E);if(w)return _=setTimeout(d,t),c(E)}return void 0===_&&(_=setTimeout(d,t)),m}var y,v,g,m,_,E,x=0,O=!1,w=!1,S=!0;if("function"!=typeof e)throw new TypeError(i);return t=a(t)||0,n(r)&&(O=!!r.leading,g=(w="maxWait"in r)?l(a(r.maxWait)||0,t):g,S="trailing"in r?!!r.trailing:S),b.cancel=function(){void 0!==_&&clearTimeout(_),x=0,y=E=v=_=void 0},b.flush=function(){return void 0===_?m:h(o())},b}},{"./isObject":155,"./now":165,"./toNumber":170}],142:[function(e,t,r){t.exports=e("./forEach")},{"./forEach":144}],143:[function(e,t,r){t.exports=function(e,t){return e===t||e!==e&&t!==t}},{}],144:[function(e,t,r){var n=e("./_arrayEach"),o=e("./_baseEach"),a=e("./_castFunction"),i=e("./isArray");t.exports=function(e,t){return(i(e)?n:o)(e,a(t))}},{"./_arrayEach":22,"./_baseEach":36,"./_castFunction":61,"./isArray":150}],145:[function(e,t,r){var n=e("./_baseForOwn"),o=e("./_castFunction");t.exports=function(e,t){return e&&n(e,o(t))}},{"./_baseForOwn":38,"./_castFunction":61}],146:[function(e,t,r){var n=e("./_baseGet");t.exports=function(e,t,r){var o=null==e?void 0:n(e,t);return void 0===o?r:o}},{"./_baseGet":39}],147:[function(e,t,r){var n=e("./_baseHasIn"),o=e("./_hasPath");t.exports=function(e,t){return null!=e&&o(e,t,n)}},{"./_baseHasIn":42,"./_hasPath":94}],148:[function(e,t,r){t.exports=function(e){return e}},{}],149:[function(e,t,r){var n=e("./_baseIsArguments"),o=e("./isObjectLike"),a=Object.prototype,i=a.hasOwnProperty,l=a.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(e){return o(e)&&i.call(e,"callee")&&!l.call(e,"callee")};t.exports=s},{"./_baseIsArguments":43,"./isObjectLike":156}],150:[function(e,t,r){var n=Array.isArray;t.exports=n},{}],151:[function(e,t,r){var n=e("./isFunction"),o=e("./isLength");t.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},{"./isFunction":153,"./isLength":154}],152:[function(e,t,r){var n=e("./_root"),o=e("./stubFalse"),a="object"==typeof r&&r&&!r.nodeType&&r,i=a&&"object"==typeof t&&t&&!t.nodeType&&t,l=i&&i.exports===a?n.Buffer:void 0,s=(l?l.isBuffer:void 0)||o;t.exports=s},{"./_root":128,"./stubFalse":168}],153:[function(e,t,r){var n=e("./_baseGetTag"),o=e("./isObject"),a="[object AsyncFunction]",i="[object Function]",l="[object GeneratorFunction]",s="[object Proxy]";t.exports=function(e){if(!o(e))return!1;var t=n(e);return t==i||t==l||t==a||t==s}},{"./_baseGetTag":41,"./isObject":155}],154:[function(e,t,r){var n=9007199254740991;t.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}},{}],155:[function(e,t,r){t.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},{}],156:[function(e,t,r){t.exports=function(e){return null!=e&&"object"==typeof e}},{}],157:[function(e,t,r){var n=e("./_baseGetTag"),o=e("./_getPrototype"),a=e("./isObjectLike"),i="[object Object]",l=Function.prototype,s=Object.prototype,c=l.toString,u=s.hasOwnProperty,f=c.call(Object);t.exports=function(e){if(!a(e)||n(e)!=i)return!1;var t=o(e);if(null===t)return!0;var r=u.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&c.call(r)==f}},{"./_baseGetTag":41,"./_getPrototype":88,"./isObjectLike":156}],158:[function(e,t,r){var n=e("./_baseGetTag"),o=e("./isArray"),a=e("./isObjectLike"),i="[object String]";t.exports=function(e){return"string"==typeof e||!o(e)&&a(e)&&n(e)==i}},{"./_baseGetTag":41,"./isArray":150,"./isObjectLike":156}],159:[function(e,t,r){var n=e("./_baseGetTag"),o=e("./isObjectLike"),a="[object Symbol]";t.exports=function(e){return"symbol"==typeof e||o(e)&&n(e)==a}},{"./_baseGetTag":41,"./isObjectLike":156}],160:[function(e,t,r){var n=e("./_baseIsTypedArray"),o=e("./_baseUnary"),a=e("./_nodeUtil"),i=a&&a.isTypedArray,l=i?o(i):n;t.exports=l},{"./_baseIsTypedArray":48,"./_baseUnary":59,"./_nodeUtil":125}],161:[function(e,t,r){var n=e("./_arrayLikeKeys"),o=e("./_baseKeys"),a=e("./isArrayLike");t.exports=function(e){return a(e)?n(e):o(e)}},{"./_arrayLikeKeys":24,"./_baseKeys":50,"./isArrayLike":151}],162:[function(e,t,r){var n=e("./_arrayLikeKeys"),o=e("./_baseKeysIn"),a=e("./isArrayLike");t.exports=function(e){return a(e)?n(e,!0):o(e)}},{"./_arrayLikeKeys":24,"./_baseKeysIn":51,"./isArrayLike":151}],163:[function(e,t,r){var n=e("./_arrayMap"),o=e("./_baseIteratee"),a=e("./_baseMap"),i=e("./isArray");t.exports=function(e,t){return(i(e)?n:a)(e,o(t,3))}},{"./_arrayMap":25,"./_baseIteratee":49,"./_baseMap":52,"./isArray":150}],164:[function(e,t,r){function n(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(a);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(n.Cache||o),r}var o=e("./_MapCache"),a="Expected a function";n.Cache=o,t.exports=n},{"./_MapCache":12}],165:[function(e,t,r){var n=e("./_root");t.exports=function(){return n.Date.now()}},{"./_root":128}],166:[function(e,t,r){var n=e("./_baseProperty"),o=e("./_basePropertyDeep"),a=e("./_isKey"),i=e("./_toKey");t.exports=function(e){return a(e)?n(i(e)):o(e)}},{"./_baseProperty":55,"./_basePropertyDeep":56,"./_isKey":104,"./_toKey":138}],167:[function(e,t,r){t.exports=function(){return[]}},{}],168:[function(e,t,r){t.exports=function(){return!1}},{}],169:[function(e,t,r){var n=e("./debounce"),o=e("./isObject"),a="Expected a function";t.exports=function(e,t,r){var i=!0,l=!0;if("function"!=typeof e)throw new TypeError(a);return o(r)&&(i="leading"in r?!!r.leading:i,l="trailing"in r?!!r.trailing:l),n(e,t,{leading:i,maxWait:t,trailing:l})}},{"./debounce":141,"./isObject":155}],170:[function(e,t,r){var n=e("./isObject"),o=e("./isSymbol"),a=NaN,i=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;t.exports=function(e){if("number"==typeof e)return e;if(o(e))return a;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var r=s.test(e);return r||c.test(e)?u(e.slice(2),r?2:8):l.test(e)?a:+e}},{"./isObject":155,"./isSymbol":159}],171:[function(e,t,r){var n=e("./_baseToString");t.exports=function(e){return null==e?"":n(e)}},{"./_baseToString":58}],172:[function(e,t,r){!function(e,n){"object"==typeof r?t.exports={red:{50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",a100:"#ff8a80",a200:"#ff5252",a400:"#ff1744",a700:"#d50000"},pink:{50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",a100:"#ff80ab",a200:"#ff4081",a400:"#f50057",a700:"#c51162"},purple:{50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",a100:"#ea80fc",a200:"#e040fb",a400:"#d500f9",a700:"#aa00ff"},deepPurple:{50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",a100:"#b388ff",a200:"#7c4dff",a400:"#651fff",a700:"#6200ea"},indigo:{50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",a100:"#8c9eff",a200:"#536dfe",a400:"#3d5afe",a700:"#304ffe"},blue:{50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",a100:"#82b1ff",a200:"#448aff",a400:"#2979ff",a700:"#2962ff"},lightBlue:{50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",a100:"#80d8ff",a200:"#40c4ff",a400:"#00b0ff",a700:"#0091ea"},cyan:{50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",a100:"#84ffff",a200:"#18ffff",a400:"#00e5ff",a700:"#00b8d4"},teal:{50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",a100:"#a7ffeb",a200:"#64ffda",a400:"#1de9b6",a700:"#00bfa5"},green:{50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",a100:"#b9f6ca",a200:"#69f0ae",a400:"#00e676",a700:"#00c853"},lightGreen:{50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",a100:"#ccff90",a200:"#b2ff59",a400:"#76ff03",a700:"#64dd17"},lime:{50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",a100:"#f4ff81",a200:"#eeff41",a400:"#c6ff00",a700:"#aeea00"},yellow:{50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",a100:"#ffff8d",a200:"#ffff00",a400:"#ffea00",a700:"#ffd600"},amber:{50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",a100:"#ffe57f",a200:"#ffd740",a400:"#ffc400",a700:"#ffab00"},orange:{50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",a100:"#ffd180",a200:"#ffab40",a400:"#ff9100",a700:"#ff6d00"},deepOrange:{50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",a100:"#ff9e80",a200:"#ff6e40",a400:"#ff3d00",a700:"#dd2c00"},brown:{50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723"},grey:{50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121"},blueGrey:{50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238"},darkText:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",dividers:"rgba(0, 0, 0, 0.12)"},lightText:{primary:"rgba(255, 255, 255, 1)",secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",dividers:"rgba(255, 255, 255, 0.12)"},darkIcons:{active:"rgba(0, 0, 0, 0.54)",inactive:"rgba(0, 0, 0, 0.38)"},lightIcons:{active:"rgba(255, 255, 255, 1)",inactive:"rgba(255, 255, 255, 0.5)"},white:"#ffffff",black:"#000000"}:e.materialColors={red:{50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",a100:"#ff8a80",a200:"#ff5252",a400:"#ff1744",a700:"#d50000"},pink:{50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",a100:"#ff80ab",a200:"#ff4081",a400:"#f50057",a700:"#c51162"},purple:{50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",a100:"#ea80fc",a200:"#e040fb",a400:"#d500f9",a700:"#aa00ff"},deepPurple:{50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",a100:"#b388ff",a200:"#7c4dff",a400:"#651fff",a700:"#6200ea"},indigo:{50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",a100:"#8c9eff",a200:"#536dfe",a400:"#3d5afe",a700:"#304ffe"},blue:{50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",a100:"#82b1ff",a200:"#448aff",a400:"#2979ff",a700:"#2962ff"},lightBlue:{50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",a100:"#80d8ff",a200:"#40c4ff",a400:"#00b0ff",a700:"#0091ea"},cyan:{50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",a100:"#84ffff",a200:"#18ffff",a400:"#00e5ff",a700:"#00b8d4"},teal:{50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",a100:"#a7ffeb",a200:"#64ffda",a400:"#1de9b6",a700:"#00bfa5"},green:{50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",a100:"#b9f6ca",a200:"#69f0ae",a400:"#00e676",a700:"#00c853"},lightGreen:{50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",a100:"#ccff90",a200:"#b2ff59",a400:"#76ff03",a700:"#64dd17"},lime:{50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",a100:"#f4ff81",a200:"#eeff41",a400:"#c6ff00",a700:"#aeea00"},yellow:{50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",a100:"#ffff8d",a200:"#ffff00",a400:"#ffea00",a700:"#ffd600"},amber:{50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",a100:"#ffe57f",a200:"#ffd740",a400:"#ffc400",a700:"#ffab00"},orange:{50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",a100:"#ffd180",a200:"#ffab40",a400:"#ff9100",a700:"#ff6d00"},deepOrange:{50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",a100:"#ff9e80",a200:"#ff6e40",a400:"#ff3d00",a700:"#dd2c00"},brown:{50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723"},grey:{50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121"},blueGrey:{50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238"},darkText:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",dividers:"rgba(0, 0, 0, 0.12)"},lightText:{primary:"rgba(255, 255, 255, 1)",secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",dividers:"rgba(255, 255, 255, 0.12)"},darkIcons:{active:"rgba(0, 0, 0, 0.54)",inactive:"rgba(0, 0, 0, 0.38)"},lightIcons:{active:"rgba(255, 255, 255, 1)",inactive:"rgba(255, 255, 255, 0.5)"},white:"#ffffff",black:"#000000"}}(this)},{}],173:[function(e,t,r){"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var o=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,l,s=n(e),c=1;c3 will show the whole name if it is less than that","many characters, but if it is longer, will truncate to","`namelength - 3` characters and add an ellipsis."].join(" ")}}}},{"../../lib/extend":175,"../../plots/font_attributes":185}],175:[function(e,t,r){"use strict";function n(e,t){var r,n;for(r=0;r1){for(var e=["LOG:"],t=0;t0){for(var e=["WARN:"],t=0;t0){for(var e=["ERROR:"],t=0;t=0;t--){if(n=e[t][0],a=e[t][1],s=!1,d(n))for(r=n.length-1;r>=0;r--)o(n[r],i(a,r))?s?n[r]=void 0:n.pop():s=!0;else if("object"==typeof n&&null!==n)for(s=!1,r=(l=Object.keys(n)).length-1;r>=0;r--)o(n[l[r]],i(a,l[r]))?delete n[l[r]]:s=!0;if(s)return}}function u(e){return void 0===e||null===e||"object"==typeof e&&(d(e)?!e.length:!Object.keys(e).length)}function f(e,t,r){return{set:function(){throw"bad container"},get:function(){},astr:t,parts:r,obj:e}}var p=e("fast-isnumeric"),d=e("./is_array"),h=e("./is_plain_object"),b=e("../plot_api/container_array_match");t.exports=function(e,t){if(p(t))t=String(t);else if("string"!=typeof t||"[-1]"===t.substr(t.length-4))throw"bad property string";for(var r,o,i,l=0,s=t.split(".");l1)for(var r=1;r1&&(e.a=1),n.props.onChange({h:n.props.hsl.h,s:n.props.hsl.s,l:n.props.hsl.l,a:Math.round(100*e.a)/100,source:"rgb"},t)):(e.h||e.s||e.l)&&n.props.onChange({h:e.h||n.props.hsl.h,s:e.s&&e.s||n.props.hsl.s,l:e.l&&e.l||n.props.hsl.l,source:"hsl"},t)},n.showHighlight=function(e){e.target.style.background="#eee"},n.hideHighlight=function(e){e.target.style.background="transparent"},i=r,a(n,i)}return i(t,s.default.Component),l(t,[{key:"componentDidMount",value:function(){1===this.props.hsl.a&&"hex"!==this.state.view?this.setState({view:"hex"}):"rgb"!==this.state.view&&"hsl"!==this.state.view&&this.setState({view:"rgb"})}},{key:"componentWillReceiveProps",value:function(e){1!==e.hsl.a&&"hex"===this.state.view&&this.setState({view:"rgb"})}},{key:"render",value:function(){var e=this,t=(0,c.default)({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),r=void 0;return"hex"===this.state.view?r=s.default.createElement("div",{style:t.fields,className:"flexbox-fix"},s.default.createElement("div",{style:t.field},s.default.createElement(f.EditableInput,{style:{input:t.input,label:t.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):"rgb"===this.state.view?r=s.default.createElement("div",{style:t.fields,className:"flexbox-fix"},s.default.createElement("div",{style:t.field},s.default.createElement(f.EditableInput,{style:{input:t.input,label:t.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),s.default.createElement("div",{style:t.field},s.default.createElement(f.EditableInput,{style:{input:t.input,label:t.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),s.default.createElement("div",{style:t.field},s.default.createElement(f.EditableInput,{style:{input:t.input,label:t.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),s.default.createElement("div",{style:t.alpha},s.default.createElement(f.EditableInput,{style:{input:t.input,label:t.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):"hsl"===this.state.view&&(r=s.default.createElement("div",{style:t.fields,className:"flexbox-fix"},s.default.createElement("div",{style:t.field},s.default.createElement(f.EditableInput,{style:{input:t.input,label:t.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),s.default.createElement("div",{style:t.field},s.default.createElement(f.EditableInput,{style:{input:t.input,label:t.label},label:"s",value:Math.round(100*this.props.hsl.s)+"%",onChange:this.handleChange})),s.default.createElement("div",{style:t.field},s.default.createElement(f.EditableInput,{style:{input:t.input,label:t.label},label:"l",value:Math.round(100*this.props.hsl.l)+"%",onChange:this.handleChange})),s.default.createElement("div",{style:t.alpha},s.default.createElement(f.EditableInput,{style:{input:t.input,label:t.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),s.default.createElement("div",{style:t.wrap,className:"flexbox-fix"},r,s.default.createElement("div",{style:t.toggle},s.default.createElement("div",{style:t.icon,onClick:this.toggleViews,ref:function(t){return e.icon=t}},s.default.createElement("svg",{style:t.svg,viewBox:"0 0 24 24",onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight},s.default.createElement("path",{ref:function(t){return e.iconUp=t},fill:"#333",d:"M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}),s.default.createElement("path",{ref:function(t){return e.iconDown=t},fill:"#333",d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15Z"})))))}}]),t}();r.default=p},{"../../helpers/color":240,"../common":212,react:269,reactcss:274}],200:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.ChromePointer=void 0;var o=n(e("react")),a=n(e("reactcss")),i=r.ChromePointer=function(){var e=(0,a.default)({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return o.default.createElement("div",{style:e.picker})};r.default=i},{react:269,reactcss:274}],201:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.ChromePointerCircle=void 0;var o=n(e("react")),a=n(e("reactcss")),i=r.ChromePointerCircle=function(){var e=(0,a.default)({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return o.default.createElement("div",{style:e.picker})};r.default=i},{react:269,reactcss:274}],202:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.Circle=void 0;var o=n(e("react")),a=n(e("prop-types")),i=n(e("reactcss")),l=n(e("lodash/map")),s=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(e("material-colors")),c=e("../common"),u=n(e("./CircleSwatch")),f=r.Circle=function(e){var t=e.width,r=e.onChange,n=e.onSwatchHover,a=e.colors,s=e.hex,c=e.circleSize,f=e.circleSpacing,p=e.className,d=void 0===p?"":p,h=(0,i.default)({default:{card:{width:t,display:"flex",flexWrap:"wrap",marginRight:-f,marginBottom:-f}}}),b=function(e,t){return r({hex:e,source:"hex"},t)};return o.default.createElement("div",{style:h.card,className:"circle-picker "+d},(0,l.default)(a,function(e){return o.default.createElement(u.default,{key:e,color:e,onClick:b,onSwatchHover:n,active:s===e.toLowerCase(),circleSize:c,circleSpacing:f})}))};f.propTypes={width:a.default.oneOfType([a.default.string,a.default.number]),circleSize:a.default.number,circleSpacing:a.default.number},f.defaultProps={width:252,circleSize:28,circleSpacing:14,colors:[s.red[500],s.pink[500],s.purple[500],s.deepPurple[500],s.indigo[500],s.blue[500],s.lightBlue[500],s.cyan[500],s.teal[500],s.green[500],s.lightGreen[500],s.lime[500],s.yellow[500],s.amber[500],s.orange[500],s.deepOrange[500],s.brown[500],s.blueGrey[500]]},r.default=(0,c.ColorWrap)(f)},{"../common":212,"./CircleSwatch":203,"lodash/map":163,"material-colors":172,"prop-types":192,react:269,reactcss:274}],203:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.CircleSwatch=void 0;var o=n(e("react")),a=e("reactcss"),i=n(a),l=e("../common"),s=r.CircleSwatch=function(e){var t=e.color,r=e.onClick,n=e.onSwatchHover,a=e.hover,s=e.active,c=e.circleSize,u=e.circleSpacing,f=(0,i.default)({default:{swatch:{width:c,height:c,marginRight:u,marginBottom:u,transform:"scale(1)",transition:"100ms transform ease"},Swatch:{borderRadius:"50%",background:"transparent",boxShadow:"inset 0 0 0 "+c/2+"px "+t,transition:"100ms box-shadow ease"}},hover:{swatch:{transform:"scale(1.2)"}},active:{Swatch:{boxShadow:"inset 0 0 0 3px "+t}}},{hover:a,active:s});return o.default.createElement("div",{style:f.swatch},o.default.createElement(l.Swatch,{style:f.Swatch,color:t,onClick:r,onHover:n,focusStyle:{boxShadow:f.Swatch.boxShadow+", 0 0 5px "+t}}))};s.defaultProps={circleSize:28,circleSpacing:14},r.default=(0,a.handleHover)(s)},{"../common":212,react:269,reactcss:274}],204:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0}),r.Alpha=void 0;var l=Object.assign||function(e){for(var t=1;t-1,a=Number(t.replace(/%/g,""));if(!isNaN(a)){var i=r.props.arrowOffset||1;38===e.keyCode&&(null!==r.props.label?r.props.onChange&&r.props.onChange(o({},r.props.label,a+i),e):r.props.onChange&&r.props.onChange(a+i,e),n?r.setState({value:a+i+"%"}):r.setState({value:a+i})),40===e.keyCode&&(null!==r.props.label?r.props.onChange&&r.props.onChange(o({},r.props.label,a-i),e):r.props.onChange&&r.props.onChange(a-i,e),n?r.setState({value:a-i+"%"}):r.setState({value:a-i}))}},r.handleDrag=function(e){if(r.props.dragLabel){var t=Math.round(r.props.value+e.movementX);t>=0&&t<=r.props.dragMax&&r.props.onChange&&r.props.onChange(o({},r.props.label,t),e)}},r.handleMouseDown=function(e){r.props.dragLabel&&(e.preventDefault(),r.handleDrag(e),window.addEventListener("mousemove",r.handleDrag),window.addEventListener("mouseup",r.handleMouseUp))},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleDrag),window.removeEventListener("mouseup",r.handleMouseUp)},r.state={value:String(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},r}return l(t,c.PureComponent||c.Component),s(t,[{key:"componentWillReceiveProps",value:function(e){var t=this.input;e.value!==this.state.value&&(t===document.activeElement?this.setState({blurValue:String(e.value).toUpperCase()}):this.setState({value:String(e.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var e=this,t=(0,f.default)({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return u.default.createElement("div",{style:t.wrap},u.default.createElement("input",{style:t.input,ref:function(t){return e.input=t},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label?u.default.createElement("span",{style:t.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}();r.default=p},{react:269,reactcss:274}],208:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0}),r.Hue=void 0;var l=function(){function e(e,t){for(var r=0;r.5});return o.default.createElement("div",{style:r.picker})};r.default=i},{react:269,reactcss:274}],226:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.PhotoshopPreviews=void 0;var o=n(e("react")),a=n(e("reactcss")),i=r.PhotoshopPreviews=function(e){var t=e.rgb,r=e.currentColor,n=(0,a.default)({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+t.r+","+t.g+", "+t.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:r,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return o.default.createElement("div",null,o.default.createElement("div",{style:n.label},"new"),o.default.createElement("div",{style:n.swatches},o.default.createElement("div",{style:n.new}),o.default.createElement("div",{style:n.current})),o.default.createElement("div",{style:n.label},"current"))};r.default=i},{react:269,reactcss:274}],227:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.Sketch=void 0;var o=n(e("react")),a=n(e("prop-types")),i=n(e("reactcss")),l=e("../common"),s=n(e("./SketchFields")),c=n(e("./SketchPresetColors")),u=r.Sketch=function(e){var t=e.width,r=e.rgb,n=e.hex,a=e.hsv,u=e.hsl,f=e.onChange,p=e.onSwatchHover,d=e.disableAlpha,h=e.presetColors,b=e.renderers,y=e.className,v=void 0===y?"":y,g=(0,i.default)({default:{picker:{width:t,padding:"10px 10px 0",boxSizing:"initial",background:"#fff",borderRadius:"4px",boxShadow:"0 0 0 1px rgba(0,0,0,.15), 0 8px 16px rgba(0,0,0,.15)"},saturation:{width:"100%",paddingBottom:"75%",position:"relative",overflow:"hidden"},Saturation:{radius:"3px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},controls:{display:"flex"},sliders:{padding:"4px 0",flex:"1"},color:{width:"24px",height:"24px",position:"relative",marginTop:"4px",marginLeft:"4px",borderRadius:"3px"},activeColor:{absolute:"0px 0px 0px 0px",borderRadius:"2px",background:"rgba("+r.r+","+r.g+","+r.b+","+r.a+")",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},hue:{position:"relative",height:"10px",overflow:"hidden"},Hue:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},alpha:{position:"relative",height:"10px",marginTop:"4px",overflow:"hidden"},Alpha:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"}},disableAlpha:{color:{height:"10px"},hue:{height:"10px"},alpha:{display:"none"}}},{disableAlpha:d});return o.default.createElement("div",{style:g.picker,className:"sketch-picker "+v},o.default.createElement("div",{style:g.saturation},o.default.createElement(l.Saturation,{style:g.Saturation,hsl:u,hsv:a,onChange:f})),o.default.createElement("div",{style:g.controls,className:"flexbox-fix"},o.default.createElement("div",{style:g.sliders},o.default.createElement("div",{style:g.hue},o.default.createElement(l.Hue,{style:g.Hue,hsl:u,onChange:f})),o.default.createElement("div",{style:g.alpha},o.default.createElement(l.Alpha,{style:g.Alpha,rgb:r,hsl:u,renderers:b,onChange:f}))),o.default.createElement("div",{style:g.color},o.default.createElement(l.Checkboard,null),o.default.createElement("div",{style:g.activeColor}))),o.default.createElement(s.default,{rgb:r,hsl:u,hex:n,onChange:f,disableAlpha:d}),o.default.createElement(c.default,{colors:h,onClick:f,onSwatchHover:p}))};u.propTypes={disableAlpha:a.default.bool,width:a.default.oneOfType([a.default.string,a.default.number])},u.defaultProps={disableAlpha:!1,width:200,presetColors:["#D0021B","#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"]},r.default=(0,l.ColorWrap)(u)},{"../common":212,"./SketchFields":228,"./SketchPresetColors":229,"prop-types":192,react:269,reactcss:274}],228:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.SketchFields=void 0;var o=n(e("react")),a=n(e("reactcss")),i=n(e("../../helpers/color")),l=e("../common"),s=r.SketchFields=function(e){var t=e.onChange,r=e.rgb,n=e.hsl,s=e.hex,c=e.disableAlpha,u=(0,a.default)({default:{fields:{display:"flex",paddingTop:"4px"},single:{flex:"1",paddingLeft:"6px"},alpha:{flex:"1",paddingLeft:"6px"},double:{flex:"2"},input:{width:"80%",padding:"4px 10% 3px",border:"none",boxShadow:"inset 0 0 0 1px #ccc",fontSize:"11px"},label:{display:"block",textAlign:"center",fontSize:"11px",color:"#222",paddingTop:"3px",paddingBottom:"4px",textTransform:"capitalize"}},disableAlpha:{alpha:{display:"none"}}},{disableAlpha:c}),f=function(e,o){e.hex?i.default.isValidHex(e.hex)&&t({hex:e.hex,source:"hex"},o):e.r||e.g||e.b?t({r:e.r||r.r,g:e.g||r.g,b:e.b||r.b,a:r.a,source:"rgb"},o):e.a&&(e.a<0?e.a=0:e.a>100&&(e.a=100),e.a/=100,t({h:n.h,s:n.s,l:n.l,a:e.a,source:"rgb"},o))};return o.default.createElement("div",{style:u.fields,className:"flexbox-fix"},o.default.createElement("div",{style:u.double},o.default.createElement(l.EditableInput,{style:{input:u.input,label:u.label},label:"hex",value:s.replace("#",""),onChange:f})),o.default.createElement("div",{style:u.single},o.default.createElement(l.EditableInput,{style:{input:u.input,label:u.label},label:"r",value:r.r,onChange:f,dragLabel:"true",dragMax:"255"})),o.default.createElement("div",{style:u.single},o.default.createElement(l.EditableInput,{style:{input:u.input,label:u.label},label:"g",value:r.g,onChange:f,dragLabel:"true",dragMax:"255"})),o.default.createElement("div",{style:u.single},o.default.createElement(l.EditableInput,{style:{input:u.input,label:u.label},label:"b",value:r.b,onChange:f,dragLabel:"true",dragMax:"255"})),o.default.createElement("div",{style:u.alpha},o.default.createElement(l.EditableInput,{style:{input:u.input,label:u.label},label:"a",value:Math.round(100*r.a),onChange:f,dragLabel:"true",dragMax:"100"})))};r.default=s},{"../../helpers/color":240,"../common":212,react:269,reactcss:274}],229:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.SketchPresetColors=void 0;var o=Object.assign||function(e){for(var t=1;ta?1:Math.round(100*c/a)/100,r.hsl.a!==u)return{h:r.hsl.h,s:r.hsl.s,l:r.hsl.l,a:u,source:"rgb"}}else{var f=void 0;if(f=s<0?0:s>o?1:Math.round(100*s/o)/100,r.a!==f)return{h:r.hsl.h,s:r.hsl.s,l:r.hsl.l,a:f,source:"rgb"}}return null}},{}],239:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={},o=r.render=function(e,t,r,n){if("undefined"==typeof document&&!n)return null;var o=n?new n:document.createElement("canvas");o.width=2*r,o.height=2*r;var a=o.getContext("2d");return a?(a.fillStyle=e,a.fillRect(0,0,o.width,o.height),a.fillStyle=t,a.fillRect(0,0,r,r),a.translate(r,r),a.fillRect(0,0,r,r),o.toDataURL()):null};r.get=function(e,t,r,a){var i=e+"-"+t+"-"+r+(a?"-server":""),l=o(e,t,r,a);return n[i]?n[i]:(n[i]=l,l)}},{}],240:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.red=void 0;var o=n(e("lodash/each")),a=n(e("tinycolor2"));r.default={simpleCheckForValidColor:function(e){var t=["r","g","b","a","h","s","l","v"],r=0,n=0;return(0,o.default)(t,function(t){e[t]&&(r+=1,isNaN(e[t])||(n+=1))}),r===n&&e},toState:function(e,t){var r=e.hex?(0,a.default)(e.hex):(0,a.default)(e),n=r.toHsl(),o=r.toHsv(),i=r.toRgb(),l=r.toHex();return 0===n.s&&(n.h=t||0,o.h=t||0),{hsl:n,hex:"000000"===l&&0===i.a?"transparent":"#"+l,rgb:i,hsv:o,oldHue:e.h||t||n.h,source:e.source}},isValidHex:function(e){return(0,a.default)(e).isValid()}};r.red={hsl:{a:1,h:0,l:.5,s:1},hex:"#ff0000",rgb:{r:255,g:0,b:0,a:1},hsv:{h:0,s:1,v:1,a:1}}},{"lodash/each":142,tinycolor2:277}],241:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.calculateChange=function(e,t,r,n){e.preventDefault();var o=n.clientWidth,a=n.clientHeight,i="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,l="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,s=i-(n.getBoundingClientRect().left+window.pageXOffset),c=l-(n.getBoundingClientRect().top+window.pageYOffset);if("vertical"===r.direction){var u=void 0;if(u=c<0?359:c>a?0:360*(-100*c/a+100)/100,r.hsl.h!==u)return{h:u,s:r.hsl.s,l:r.hsl.l,a:r.hsl.a,source:"rgb"}}else{var f=void 0;if(f=s<0?0:s>o?359:360*(100*s/o)/100,r.hsl.h!==f)return{h:f,s:r.hsl.s,l:r.hsl.l,a:r.hsl.a,source:"rgb"}}return null}},{}],242:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0}),r.handleFocus=void 0;var i=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"span";return function(r){function s(){var r,a,c,u;n(this,s);for(var f=arguments.length,p=Array(f),d=0;da?c=a:u<0?u=0:u>i&&(u=i);var f=100*c/a,p=-100*u/i+100;return{h:r.hsl.h,s:f,v:p,a:r.hsl.a,source:"rgb"}}},{}],244:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.CustomPicker=r.TwitterPicker=r.SwatchesPicker=r.SliderPicker=r.SketchPicker=r.PhotoshopPicker=r.MaterialPicker=r.HuePicker=r.GithubPicker=r.CompactPicker=r.ChromePicker=r.default=r.CirclePicker=r.BlockPicker=r.AlphaPicker=void 0;var o=e("./components/alpha/Alpha");Object.defineProperty(r,"AlphaPicker",{enumerable:!0,get:function(){return n(o).default}});var a=e("./components/block/Block");Object.defineProperty(r,"BlockPicker",{enumerable:!0,get:function(){return n(a).default}});var i=e("./components/circle/Circle");Object.defineProperty(r,"CirclePicker",{enumerable:!0,get:function(){return n(i).default}});var l=e("./components/chrome/Chrome");Object.defineProperty(r,"ChromePicker",{enumerable:!0,get:function(){return n(l).default}});var s=e("./components/compact/Compact");Object.defineProperty(r,"CompactPicker",{enumerable:!0,get:function(){return n(s).default}});var c=e("./components/github/Github");Object.defineProperty(r,"GithubPicker",{enumerable:!0,get:function(){return n(c).default}});var u=e("./components/hue/Hue");Object.defineProperty(r,"HuePicker",{enumerable:!0,get:function(){return n(u).default}});var f=e("./components/material/Material");Object.defineProperty(r,"MaterialPicker",{enumerable:!0,get:function(){return n(f).default}});var p=e("./components/photoshop/Photoshop");Object.defineProperty(r,"PhotoshopPicker",{enumerable:!0,get:function(){return n(p).default}});var d=e("./components/sketch/Sketch");Object.defineProperty(r,"SketchPicker",{enumerable:!0,get:function(){return n(d).default}});var h=e("./components/slider/Slider");Object.defineProperty(r,"SliderPicker",{enumerable:!0,get:function(){return n(h).default}});var b=e("./components/swatches/Swatches");Object.defineProperty(r,"SwatchesPicker",{enumerable:!0,get:function(){return n(b).default}});var y=e("./components/twitter/Twitter");Object.defineProperty(r,"TwitterPicker",{enumerable:!0,get:function(){return n(y).default}});var v=e("./components/common/ColorWrap");Object.defineProperty(r,"CustomPicker",{enumerable:!0,get:function(){return n(v).default}});var g=n(l);r.default=g.default},{"./components/alpha/Alpha":194,"./components/block/Block":196,"./components/chrome/Chrome":198,"./components/circle/Circle":202,"./components/common/ColorWrap":206,"./components/compact/Compact":213,"./components/github/Github":216,"./components/hue/Hue":218,"./components/material/Material":220,"./components/photoshop/Photoshop":221,"./components/sketch/Sketch":227,"./components/slider/Slider":230,"./components/swatches/Swatches":234,"./components/twitter/Twitter":237}],245:[function(e,t,r){"use strict";var n={escape:function(e){var t=/[=:]/g,r={"=":"=0",":":"=2"};return"$"+(""+e).replace(t,function(e){return r[e]})},unescape:function(e){var t=/(=0|=2)/g,r={"=0":"=","=2":":"};return(""+("."===e[0]&&"$"===e[1]?e.substring(2):e.substring(1))).replace(t,function(e){return r[e]})}};t.exports=n},{}],246:[function(e,t,r){(function(r){"use strict";var n=e("./reactProdInvariant"),o=e("fbjs/lib/invariant"),a=function(e){var t=this;if(t.instancePool.length){var r=t.instancePool.pop();return t.call(r,e),r}return new t(e)},i=function(e){var t=this;e instanceof t||("production"!==r.env.NODE_ENV?o(!1,"Trying to release an instance into a pool of a different type."):n("25")),e.destructor(),t.instancePool.length1){for(var _=Array(m),E=0;E1){for(var m=Array(g),_=0;_.")}return t}function i(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=v.uniqueKey||(v.uniqueKey={}),o=a(t);if(!n[o]){n[o]=!0;var i="";e&&e._owner&&e._owner!==c.current&&(i=" It was passed a child from "+e._owner.getName()+"."),"production"!==r.env.NODE_ENV&&b(!1,'Each child in an array or iterator should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.%s',o,i,u.getCurrentStackAddendum(e))}}}function l(e,t){if("object"==typeof e)if(Array.isArray(e))for(var r=0;r1?t-1:0),n=1;n2?r-2:0),a=2;a1&&void 0!==arguments[1]?arguments[1]:"span";return function(r){function s(){var r,a,c,u;n(this,s);for(var f=arguments.length,p=Array(f),d=0;d1&&void 0!==arguments[1]?arguments[1]:"span";return function(r){function s(){var r,a,c,u;n(this,s);for(var f=arguments.length,p=Array(f),d=0;d0&&void 0!==arguments[0]?arguments[0]:[],r=[];return(0,l.default)(t,function(t){Array.isArray(t)?e(t).map(function(e){return r.push(e)}):(0,i.default)(t)?(0,a.default)(t,function(e,t){!0===e&&r.push(t),r.push(t+"-"+e)}):(0,o.default)(t)&&r.push(t)}),r};r.default=s},{"lodash/forOwn":145,"lodash/isPlainObject":157,"lodash/isString":158,"lodash/map":163}],274:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.ReactCSS=r.loop=r.handleActive=r.handleHover=r.hover=void 0;var o=n(e("./flattenNames")),a=n(e("./mergeClasses")),i=n(e("./autoprefix")),l=n(e("./components/hover")),s=n(e("./components/active")),c=n(e("./loop"));r.hover=l.default,r.handleHover=l.default,r.handleActive=s.default,r.loop=c.default;var u=r.ReactCSS=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n1&&void 0!==arguments[1])||arguments[1];r[e]=t};return 0===e&&n("first-child"),e===t-1&&n("last-child"),(0===e||e%2==0)&&n("even"),1===Math.abs(e%2)&&n("odd"),n("nth-child",e),r}},{}],276:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.mergeClasses=void 0;var o=n(e("lodash/forOwn")),a=n(e("lodash/cloneDeep")),i=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:[],r=e.default&&(0,a.default)(e.default)||{};return t.map(function(t){var n=e[t];return n&&(0,o.default)(n,function(e,t){r[t]||(r[t]={}),r[t]=i({},r[t],n[t])}),t}),r};r.default=l},{"lodash/cloneDeep":140,"lodash/forOwn":145}],277:[function(e,t,r){!function(e){function r(e,t){if(e=e||"",t=t||{},e instanceof r)return e;if(!(this instanceof r))return new r(e,t);var o=n(e);this._originalInput=e,this._r=o.r,this._g=o.g,this._b=o.b,this._a=o.a,this._roundA=H(100*this._a)/100,this._format=t.format||o.format,this._gradientType=t.gradientType,this._r<1&&(this._r=H(this._r)),this._g<1&&(this._g=H(this._g)),this._b<1&&(this._b=H(this._b)),this._ok=o.ok,this._tc_id=U++}function n(e){var t={r:0,g:0,b:0},r=1,n=null,a=null,l=null,c=!1,u=!1;return"string"==typeof e&&(e=I(e)),"object"==typeof e&&(D(e.r)&&D(e.g)&&D(e.b)?(t=o(e.r,e.g,e.b),c=!0,u="%"===String(e.r).substr(-1)?"prgb":"rgb"):D(e.h)&&D(e.s)&&D(e.v)?(n=k(e.s),a=k(e.v),t=s(e.h,n,a),c=!0,u="hsv"):D(e.h)&&D(e.s)&&D(e.l)&&(n=k(e.s),l=k(e.l),t=i(e.h,n,l),c=!0,u="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=S(r),{ok:c,format:e.format||u,r:W(255,V(t.r,0)),g:W(255,V(t.g,0)),b:W(255,V(t.b,0)),a:r}}function o(e,t,r){return{r:255*C(e,255),g:255*C(t,255),b:255*C(r,255)}}function a(e,t,r){e=C(e,255),t=C(t,255),r=C(r,255);var n,o,a=V(e,t,r),i=W(e,t,r),l=(a+i)/2;if(a==i)n=o=0;else{var s=a-i;switch(o=l>.5?s/(2-a-i):s/(a+i),a){case e:n=(t-r)/s+(t1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}var o,a,i;if(e=C(e,360),t=C(t,100),r=C(r,100),0===t)o=a=i=r;else{var l=r<.5?r*(1+t):r+t-r*t,s=2*r-l;o=n(s,l,e+1/3),a=n(s,l,e),i=n(s,l,e-1/3)}return{r:255*o,g:255*a,b:255*i}}function l(e,t,r){e=C(e,255),t=C(t,255),r=C(r,255);var n,o,a=V(e,t,r),i=W(e,t,r),l=a,s=a-i;if(o=0===a?0:s/a,a==i)n=0;else{switch(a){case e:n=(t-r)/s+(t>1)+720)%360;--t;)o.h=(o.h+a)%360,i.push(r(o));return i}function w(e,t){t=t||6;for(var n=r(e).toHsv(),o=n.h,a=n.s,i=n.v,l=[],s=1/t;t--;)l.push(r({h:o,s:a,v:i})),i=(i+s)%1;return l}function S(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function C(t,r){R(t)&&(t="100%");var n=T(t);return t=W(r,V(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function A(e){return W(1,V(0,e))}function P(e){return parseInt(e,16)}function R(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)}function T(e){return"string"==typeof e&&-1!=e.indexOf("%")}function j(e){return 1==e.length?"0"+e:""+e}function k(e){return e<=1&&(e=100*e+"%"),e}function N(t){return e.round(255*parseFloat(t)).toString(16)}function M(e){return P(e)/255}function D(e){return!!z.CSS_UNIT.exec(e)}function I(e){e=e.replace(B,"").replace(F,"").toLowerCase();var t=!1;if(K[e])e=K[e],t=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=z.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=z.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=z.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=z.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=z.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=z.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=z.hex8.exec(e))?{r:P(r[1]),g:P(r[2]),b:P(r[3]),a:M(r[4]),format:t?"name":"hex8"}:(r=z.hex6.exec(e))?{r:P(r[1]),g:P(r[2]),b:P(r[3]),format:t?"name":"hex"}:(r=z.hex4.exec(e))?{r:P(r[1]+""+r[1]),g:P(r[2]+""+r[2]),b:P(r[3]+""+r[3]),a:M(r[4]+""+r[4]),format:t?"name":"hex8"}:!!(r=z.hex3.exec(e))&&{r:P(r[1]+""+r[1]),g:P(r[2]+""+r[2]),b:P(r[3]+""+r[3]),format:t?"name":"hex"}}function L(e){var t,r;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:t,size:r}}var B=/^\s+/,F=/\s+$/,U=0,H=e.round,W=e.min,V=e.max,G=e.random;r.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,o,a,i,l=this.toRgb();return t=l.r/255,r=l.g/255,n=l.b/255,o=t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4),a=r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4),i=n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4),.2126*o+.7152*a+.0722*i},setAlpha:function(e){return this._a=S(e),this._roundA=H(100*this._a)/100,this},toHsv:function(){var e=l(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=l(this._r,this._g,this._b),t=H(360*e.h),r=H(100*e.s),n=H(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=a(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=a(this._r,this._g,this._b),t=H(360*e.h),r=H(100*e.s),n=H(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return c(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return u(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:H(this._r),g:H(this._g),b:H(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+H(this._r)+", "+H(this._g)+", "+H(this._b)+")":"rgba("+H(this._r)+", "+H(this._g)+", "+H(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:H(100*C(this._r,255))+"%",g:H(100*C(this._g,255))+"%",b:H(100*C(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+H(100*C(this._r,255))+"%, "+H(100*C(this._g,255))+"%, "+H(100*C(this._b,255))+"%)":"rgba("+H(100*C(this._r,255))+"%, "+H(100*C(this._g,255))+"%, "+H(100*C(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(Y[c(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+f(this._r,this._g,this._b,this._a),n=t,o=this._gradientType?"GradientType = 1, ":"";if(e){var a=r(e);n="#"+f(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return r(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(b,arguments)},brighten:function(){return this._applyModification(y,arguments)},darken:function(){return this._applyModification(v,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(d,arguments)},greyscale:function(){return this._applyModification(h,arguments)},spin:function(){return this._applyModification(g,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(O,arguments)},complement:function(){return this._applyCombination(m,arguments)},monochromatic:function(){return this._applyCombination(w,arguments)},splitcomplement:function(){return this._applyCombination(x,arguments)},triad:function(){return this._applyCombination(_,arguments)},tetrad:function(){return this._applyCombination(E,arguments)}},r.fromRatio=function(e,t){if("object"==typeof e){var n={};for(var o in e)e.hasOwnProperty(o)&&(n[o]="a"===o?e[o]:k(e[o]));e=n}return r(e,t)},r.equals=function(e,t){return!(!e||!t)&&r(e).toRgbString()==r(t).toRgbString()},r.random=function(){return r.fromRatio({r:G(),g:G(),b:G()})},r.mix=function(e,t,n){n=0===n?0:n||50;var o=r(e).toRgb(),a=r(t).toRgb(),i=n/100;return r({r:(a.r-o.r)*i+o.r,g:(a.g-o.g)*i+o.g,b:(a.b-o.b)*i+o.b,a:(a.a-o.a)*i+o.a})},r.readability=function(t,n){var o=r(t),a=r(n);return(e.max(o.getLuminance(),a.getLuminance())+.05)/(e.min(o.getLuminance(),a.getLuminance())+.05)},r.isReadable=function(e,t,n){var o,a,i=r.readability(e,t);switch(a=!1,(o=L(n)).level+o.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7}return a},r.mostReadable=function(e,t,n){var o,a,i,l,s=null,c=0;a=(n=n||{}).includeFallbackColors,i=n.level,l=n.size;for(var u=0;uc&&(c=o,s=r(t[u]));return r.isReadable(e,s,{level:i,size:l})||!a?s:(n.includeFallbackColors=!1,r.mostReadable(e,["#fff","#000"],n))};var K=r.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Y=r.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(K),z=function(){var e="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",t="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",r="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+t),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+t),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+t),hsva:new RegExp("hsva"+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();void 0!==t&&t.exports?t.exports=r:window.tinycolor=r}(Math)},{}],278:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.bem=function(e,t,r){var n,a,i=[],l=o.default.baseClass;if(Array.isArray(e)?(r=e,e=null,t=null):Array.isArray(t)&&(r=t,t=null),e&&e.length&&(l+="__"+e),t&&t.length&&(l+="__"+t),i.push(l),r)for(n=0;n\n \n \n \n\n \n\n \n \n \n\n \n \n
\n \n
\n\n
\n \n
\n\n
\n \n\n \n\n \n\n \n
\n\n
\n \n\n \n\n \n
\n
\n
\n \n );\n }\n}\n\nexport default DefaultEditor;\n"]} \ No newline at end of file +{"version":3,"sources":["../src/DefaultEditor.js"],"names":["DefaultEditor","props","context","dataSources","dataSourceNames","_","localize","label","value","contextTypes","object","array"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AACA;;AAEA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;;;AAEA;AACA;IACMA,a;;;AACJ,yBAAYC,KAAZ,EAAmBC,OAAnB,EAA4B;AAAA;;AAAA,8HACpBD,KADoB,EACbC,OADa;;AAE1B,UAAKC,WAAL,GAAmBD,QAAQC,WAA3B;AACA,UAAKC,eAAL,GAAuBF,QAAQE,eAA/B;AAH0B;AAI3B;;;;6BAEQ;AACP,UAAMC,IAAI,KAAKJ,KAAL,CAAWK,QAArB;;AAEA,aACE;AAAA;AAAA;AACE;AAAA;AAAA,YAAO,SAAQ,OAAf,EAAuB,MAAK,QAA5B;AACE;AAAA;AAAA,cAAgB,YAAhB;AACE;AACE,qBAAM,WADR;AAEE,oBAAK,MAFP;AAGE,uBAAS,CACP,EAAEC,OAAO,MAAT,EAAiBC,OAAO,OAAxB,EADO,EAEP,EAAED,OAAO,SAAT,EAAoBC,OAAO,SAA3B,EAFO,EAGP,EAAED,OAAO,cAAT,EAAyBC,OAAO,eAAhC,EAHO;AAHX,cADF;AAWE;AACE,qBAAM,GADR;AAEE,oBAAK,MAFP;AAGE,uBAAS,KAAKJ,eAHhB;AAIE,wBAJF;AAKE;AALF,cAXF;AAmBE;AACE,qBAAM,GADR;AAEE,oBAAK,MAFP;AAGE,uBAAS,KAAKA,eAHhB;AAIE,wBAJF;AAKE;AALF;AAnBF;AADF,SADF;AA+BE;AAAA;AAAA,YAAO,SAAQ,OAAf,EAAuB,MAAK,QAA5B;AACE;AAAA;AAAA;AACE;AAAA;AAAA,gBAAS,SAASC,EAAE,OAAF,CAAlB;AACE;AACE,uBAAOA,EAAE,SAAF,CADT;AAEE,qBAAK,CAFP;AAGE,qBAAK,CAHP;AAIE,sBAAM,GAJR;AAKE,sBAAK;AALP;AADF,aADF;AAWE;AAAA;AAAA,gBAAS,SAASA,EAAE,SAAF,CAAlB;AACE;AACE,sBAAK,MADP;AAEE,yBAAS,CACP,EAAEE,OAAO,OAAT,EAAkBC,OAAO,OAAzB,EADO,EAEP,EAAED,OAAO,QAAT,EAAmBC,OAAO,SAA1B,EAFO;AAFX;AADF,aAXF;AAqBE;AAAA;AAAA,gBAAS,SAASH,EAAE,QAAF,CAAlB;AACE;AACE,uBAAOA,EAAE,gBAAF,CADT;AAEE,qBAAK,CAFP;AAGE,qBAAK,CAHP;AAIE,sBAAM,GAJR;AAKE,sBAAK;AALP,gBADF;AASE,+DAAa,OAAOA,EAAE,cAAF,CAApB,EAAuC,MAAK,cAA5C,GATF;AAWE,iEAAS,OAAOA,EAAE,MAAF,CAAhB,EAA2B,KAAK,CAAhC,EAAmC,MAAK,aAAxC,GAXF;AAaE;AACE,uBAAOA,EAAE,YAAF,CADT;AAEE,qBAAK,CAFP;AAGE,sBAAK;AAHP;AAbF,aArBF;AAyCE;AAAA;AAAA,gBAAS,SAASA,EAAE,OAAF,CAAlB;AACE;AACE,uBAAOA,EAAE,OAAF,CADT;AAEE,qBAAK,CAFP;AAGE,sBAAM,GAHR;AAIE,sBAAK;AAJP,gBADF;AAQE,+DAAa,OAAOA,EAAE,YAAF,CAApB,EAAqC,MAAK,YAA1C,GARF;AAUE;AACE,uBAAOA,EAAE,cAAF,CADT;AAEE,sBAAK,aAFP;AAGE,yBAAS,CACP,EAAEG,OAAO,IAAT,EAAeD,OAAO,SAAtB,EADO,EAEP,EAAEC,OAAO,KAAT,EAAgBD,OAAO,OAAvB,EAFO;AAHX;AAVF;AAzCF;AADF;AA/BF,OADF;AAiGD;;;;;;AAGHP,cAAcS,YAAd,GAA6B;AAC3BN,eAAa,oBAAUO,MADI;AAE3BN,mBAAiB,oBAAUO;AAFA,CAA7B;;kBAKe,mBAASX,aAAT,C","file":"DefaultEditor.js","sourcesContent":["import React, { Component } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { localize } from \"./lib\";\n\nimport TraceAccordion from \"./components/TraceAccordion\";\nimport Panel from \"./components/Panel\";\nimport Select from \"./components/Select\";\nimport Numeric from \"./components/Numeric\";\nimport ColorPicker from \"./components/Color\";\nimport Section from \"./components/Section\";\nimport Flaglist from \"./components/Flaglist\";\nimport Radio from \"./components/Radio\";\nimport PanelMenuWrapper from \"./components/PanelMenuWrapper\";\n\n// These are the built-in panels for the editor. If the editor has children specified,\n// those panels will override these.\nclass DefaultEditor extends Component {\n constructor(props, context) {\n super(props, context);\n this.dataSources = context.dataSources;\n this.dataSourceNames = context.dataSourceNames;\n }\n\n render() {\n const _ = this.props.localize;\n\n return (\n \n \n \n \n\n \n\n \n \n \n\n \n \n
\n \n
\n\n
\n \n
\n\n
\n \n\n \n\n \n\n \n
\n\n
\n \n\n \n\n \n
\n
\n
\n
\n );\n }\n}\n\nDefaultEditor.contextTypes = {\n dataSources: PropTypes.object,\n dataSourceNames: PropTypes.array,\n};\n\nexport default localize(DefaultEditor);\n"]} \ No newline at end of file diff --git a/lib/DefaultPanels.js b/lib/DefaultPanels.js deleted file mode 100644 index 232de72cd..000000000 --- a/lib/DefaultPanels.js +++ /dev/null @@ -1,130 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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 = require("react"); - -var _react2 = _interopRequireDefault(_react); - -var _propTypes = require("prop-types"); - -var _propTypes2 = _interopRequireDefault(_propTypes); - -var _components = require("./components"); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -// These are the built-in panels for the editor. If the editor has children specified, -// those panels will override these. -var DefaultEditor = function (_PlotlyEditorBase) { - _inherits(DefaultEditor, _PlotlyEditorBase); - - function DefaultEditor() { - _classCallCheck(this, DefaultEditor); - - return _possibleConstructorReturn(this, (DefaultEditor.__proto__ || Object.getPrototypeOf(DefaultEditor)).apply(this, arguments)); - } - - _createClass(DefaultEditor, [{ - key: "render", - value: function render() { - var _ = this._; - - return _react2.default.createElement( - _components.PanelsWithModeMenu, - null, - _react2.default.createElement( - _components.Panel, - { section: "Graph", name: "Create" }, - _react2.default.createElement( - _components.TraceAccordion, - null, - _react2.default.createElement(_components.Select, { - label: "Plot Type", - attr: "mode", - options: [{ label: "Line", value: "lines" }, { label: "Scatter", value: "markers" }, { label: "Scatter line", value: "lines+markers" }] - }), - _react2.default.createElement(_components.Select, { label: "X", attr: "xsrc", options: this.dataSourceNames }), - _react2.default.createElement(_components.Select, { label: "Y", attr: "ysrc", options: this.dataSourceNames }), - _react2.default.createElement(_components.Numeric, { label: _("Marker Size"), attr: "marker.size" }) - ) - ), - _react2.default.createElement( - _components.Panel, - { section: "Style", name: "Traces" }, - _react2.default.createElement( - _components.TraceAccordion, - null, - _react2.default.createElement( - _components.Section, - { heading: _("Trace") }, - _react2.default.createElement(_components.Numeric, { - label: _("Opacity"), - min: 0, - max: 1, - step: 0.1, - attr: "opacity" - }) - ), - _react2.default.createElement( - _components.Section, - { heading: _("Display") }, - _react2.default.createElement(_components.Flaglist, { - attr: "mode", - options: [{ label: "Lines", value: "lines" }, { label: "Points", value: "markers" }] - }) - ), - _react2.default.createElement( - _components.Section, - { heading: _("Points") }, - _react2.default.createElement(_components.Numeric, { - label: _("Marker Opacity"), - min: 0, - max: 1, - step: 0.1, - attr: "marker.opacity" - }), - _react2.default.createElement(_components.ColorPicker, { label: _("Marker Color"), attr: "marker.color" }), - _react2.default.createElement(_components.Numeric, { label: _("Size"), min: 0, attr: "marker.size" }), - _react2.default.createElement(_components.Numeric, { - label: _("Line width"), - min: 0, - attr: "marker.line.width" - }) - ), - _react2.default.createElement( - _components.Section, - { heading: _("Lines") }, - _react2.default.createElement(_components.Numeric, { - label: _("Width"), - min: 0, - step: 1.0, - attr: "line.width" - }), - _react2.default.createElement(_components.ColorPicker, { label: _("Line color"), attr: "line.color" }), - _react2.default.createElement(_components.Radio, { label: _("Connect Gaps"), attr: "connectgaps" }) - ) - ) - ) - ); - } - }]); - - return DefaultEditor; -}(_components.PlotlyEditorBase); - -DefaultEditor.contextTypes = _components.PlotlyEditorBase.contextTypes; - -exports.default = DefaultEditor; -module.exports = exports["default"]; -//# sourceMappingURL=DefaultPanels.js.map \ No newline at end of file diff --git a/lib/DefaultPanels.js.map b/lib/DefaultPanels.js.map deleted file mode 100644 index 0bf271d1b..000000000 --- a/lib/DefaultPanels.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/DefaultPanels.js"],"names":["DefaultEditor","_","label","value","dataSourceNames","contextTypes"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AAEA;;;;;;;;;;AAcA;AACA;IACMA,a;;;;;;;;;;;6BACK;AACP,UAAMC,IAAI,KAAKA,CAAf;;AAEA,aACE;AAAA;AAAA;AACE;AAAA;AAAA,YAAO,SAAQ,OAAf,EAAuB,MAAK,QAA5B;AACE;AAAA;AAAA;AACE;AACE,qBAAM,WADR;AAEE,oBAAK,MAFP;AAGE,uBAAS,CACP,EAAEC,OAAO,MAAT,EAAiBC,OAAO,OAAxB,EADO,EAEP,EAAED,OAAO,SAAT,EAAoBC,OAAO,SAA3B,EAFO,EAGP,EAAED,OAAO,cAAT,EAAyBC,OAAO,eAAhC,EAHO;AAHX,cADF;AAWE,gEAAQ,OAAM,GAAd,EAAkB,MAAK,MAAvB,EAA8B,SAAS,KAAKC,eAA5C,GAXF;AAaE,gEAAQ,OAAM,GAAd,EAAkB,MAAK,MAAvB,EAA8B,SAAS,KAAKA,eAA5C,GAbF;AAeE,iEAAS,OAAOH,EAAE,aAAF,CAAhB,EAAkC,MAAK,aAAvC;AAfF;AADF,SADF;AAqBE;AAAA;AAAA,YAAO,SAAQ,OAAf,EAAuB,MAAK,QAA5B;AACE;AAAA;AAAA;AACE;AAAA;AAAA,gBAAS,SAASA,EAAE,OAAF,CAAlB;AACE;AACE,uBAAOA,EAAE,SAAF,CADT;AAEE,qBAAK,CAFP;AAGE,qBAAK,CAHP;AAIE,sBAAM,GAJR;AAKE,sBAAK;AALP;AADF,aADF;AAWE;AAAA;AAAA,gBAAS,SAASA,EAAE,SAAF,CAAlB;AACE;AACE,sBAAK,MADP;AAEE,yBAAS,CACP,EAAEC,OAAO,OAAT,EAAkBC,OAAO,OAAzB,EADO,EAEP,EAAED,OAAO,QAAT,EAAmBC,OAAO,SAA1B,EAFO;AAFX;AADF,aAXF;AAqBE;AAAA;AAAA,gBAAS,SAASF,EAAE,QAAF,CAAlB;AACE;AACE,uBAAOA,EAAE,gBAAF,CADT;AAEE,qBAAK,CAFP;AAGE,qBAAK,CAHP;AAIE,sBAAM,GAJR;AAKE,sBAAK;AALP,gBADF;AASE,uEAAa,OAAOA,EAAE,cAAF,CAApB,EAAuC,MAAK,cAA5C,GATF;AAWE,mEAAS,OAAOA,EAAE,MAAF,CAAhB,EAA2B,KAAK,CAAhC,EAAmC,MAAK,aAAxC,GAXF;AAaE;AACE,uBAAOA,EAAE,YAAF,CADT;AAEE,qBAAK,CAFP;AAGE,sBAAK;AAHP;AAbF,aArBF;AAyCE;AAAA;AAAA,gBAAS,SAASA,EAAE,OAAF,CAAlB;AACE;AACE,uBAAOA,EAAE,OAAF,CADT;AAEE,qBAAK,CAFP;AAGE,sBAAM,GAHR;AAIE,sBAAK;AAJP,gBADF;AAQE,uEAAa,OAAOA,EAAE,YAAF,CAApB,EAAqC,MAAK,YAA1C,GARF;AAUE,iEAAO,OAAOA,EAAE,cAAF,CAAd,EAAiC,MAAK,aAAtC;AAVF;AAzCF;AADF;AArBF,OADF;AAgFD;;;;;;AAGHD,cAAcK,YAAd,GAA6B,6BAAiBA,YAA9C;;kBAEeL,a","file":"DefaultPanels.js","sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport {\n Base,\n TraceAccordion,\n Panel,\n Select,\n Numeric,\n ColorPicker,\n Section,\n Flaglist,\n Radio,\n PanelsWithModeMenu,\n PlotlyEditorBase\n} from './components'\n\n// These are the built-in panels for the editor. If the editor has children specified,\n// those panels will override these.\nclass DefaultEditor extends PlotlyEditorBase {\n render() {\n const _ = this._;\n\n return (\n \n \n \n \n\n \n\n \n \n \n\n \n \n
\n \n
\n\n
\n \n
\n\n
\n \n\n \n\n \n\n \n
\n\n
\n \n\n \n\n \n
\n
\n
\n
\n );\n }\n}\n\nDefaultEditor.contextTypes = PlotlyEditorBase.contextTypes;\n\nexport default DefaultEditor;\n"]} \ No newline at end of file diff --git a/lib/PlotlyReactEditor.js b/lib/PlotlyEditor.js similarity index 75% rename from lib/PlotlyReactEditor.js rename to lib/PlotlyEditor.js index fbdbb2bb9..3bccc7c4f 100644 --- a/lib/PlotlyReactEditor.js +++ b/lib/PlotlyEditor.js @@ -18,15 +18,11 @@ var _constants = require("./lib/constants"); var _constants2 = _interopRequireDefault(_constants); -var _common = require("./lib/common"); +var _lib = require("./lib"); -var _i18n = require("./i18n"); +var _locales = require("./locales"); -var _i18n2 = _interopRequireDefault(_i18n); - -var _components = require("./components"); - -var _components2 = _interopRequireDefault(_components); +var _locales2 = _interopRequireDefault(_locales); var _DefaultEditor = require("./DefaultEditor"); @@ -40,69 +36,68 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen 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 PlotlyReactEditor = function (_Component) { - _inherits(PlotlyReactEditor, _Component); +var PlotlyEditor = function (_Component) { + _inherits(PlotlyEditor, _Component); - function PlotlyReactEditor() { - _classCallCheck(this, PlotlyReactEditor); + function PlotlyEditor() { + _classCallCheck(this, PlotlyEditor); - return _possibleConstructorReturn(this, (PlotlyReactEditor.__proto__ || Object.getPrototypeOf(PlotlyReactEditor)).apply(this, arguments)); + return _possibleConstructorReturn(this, (PlotlyEditor.__proto__ || Object.getPrototypeOf(PlotlyEditor)).apply(this, arguments)); } - _createClass(PlotlyReactEditor, [{ + _createClass(PlotlyEditor, [{ key: "getChildContext", value: function getChildContext() { var gd = this.props.graphDiv || {}; var dataSourceNames = Object.keys(this.props.dataSources || {}); return { + graphDiv: gd, locale: this.props.locale, - dictionaries: _i18n2.default, + dictionaries: _locales2.default, data: gd.data, fullData: gd._fullData, layout: gd.layout, fullLayout: gd._fullLayout, - handleUpdate: this.updateProp.bind(this), + onUpdate: this.updateProp.bind(this), dataSources: this.props.dataSources, dataSourceNames: dataSourceNames }; } }, { key: "updateProp", - value: function updateProp(attr, value) { - this.props.onUpdate && this.props.onUpdate(this.props.graphDiv, attr, value); + value: function updateProp(updates, traces, type) { + this.props.onUpdate && this.props.onUpdate(this.props.graphDiv, updates, traces, type); } }, { key: "render", value: function render() { return _react2.default.createElement( "div", - { className: (0, _common.bem)() }, + { className: (0, _lib.bem)() }, this.props.graphDiv && (this.props.children ? this.props.children : _react2.default.createElement(_DefaultEditor2.default, null)) ); } }]); - return PlotlyReactEditor; + return PlotlyEditor; }(_react.Component); -PlotlyReactEditor.defaultProps = { +PlotlyEditor.defaultProps = { locale: "en" }; -PlotlyReactEditor.childContextTypes = { +PlotlyEditor.childContextTypes = { locale: _propTypes2.default.string, dictionaries: _propTypes2.default.object, + graphDiv: _propTypes2.default.any, dataSources: _propTypes2.default.object, dataSourceNames: _propTypes2.default.array, data: _propTypes2.default.array, fullData: _propTypes2.default.array, layout: _propTypes2.default.object, fullLayout: _propTypes2.default.object, - handleUpdate: _propTypes2.default.func + onUpdate: _propTypes2.default.func }; - -Object.assign(PlotlyReactEditor, _components2.default); - -exports.default = PlotlyReactEditor; +exports.default = PlotlyEditor; module.exports = exports["default"]; -//# sourceMappingURL=PlotlyReactEditor.js.map \ No newline at end of file +//# sourceMappingURL=PlotlyEditor.js.map \ No newline at end of file diff --git a/lib/PlotlyEditor.js.map b/lib/PlotlyEditor.js.map new file mode 100644 index 000000000..3cdfb3c64 --- /dev/null +++ b/lib/PlotlyEditor.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/PlotlyEditor.js"],"names":["PlotlyEditor","gd","props","graphDiv","dataSourceNames","Object","keys","dataSources","locale","dictionaries","data","fullData","_fullData","layout","fullLayout","_fullLayout","onUpdate","updateProp","bind","updates","traces","type","children","defaultProps","childContextTypes","string","object","any","array","func"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AAEA;;;;AACA;;AACA;;;;AAEA;;;;;;;;;;;;IAEMA,Y;;;;;;;;;;;sCACc;AAChB,UAAIC,KAAK,KAAKC,KAAL,CAAWC,QAAX,IAAuB,EAAhC;AACA,UAAIC,kBAAkBC,OAAOC,IAAP,CAAY,KAAKJ,KAAL,CAAWK,WAAX,IAA0B,EAAtC,CAAtB;AACA,aAAO;AACLJ,kBAAUF,EADL;AAELO,gBAAQ,KAAKN,KAAL,CAAWM,MAFd;AAGLC,uCAHK;AAILC,cAAMT,GAAGS,IAJJ;AAKLC,kBAAUV,GAAGW,SALR;AAMLC,gBAAQZ,GAAGY,MANN;AAOLC,oBAAYb,GAAGc,WAPV;AAQLC,kBAAU,KAAKC,UAAL,CAAgBC,IAAhB,CAAqB,IAArB,CARL;AASLX,qBAAa,KAAKL,KAAL,CAAWK,WATnB;AAULH,yBAAiBA;AAVZ,OAAP;AAYD;;;+BAEUe,O,EAASC,M,EAAQC,I,EAAM;AAChC,WAAKnB,KAAL,CAAWc,QAAX,IACE,KAAKd,KAAL,CAAWc,QAAX,CAAoB,KAAKd,KAAL,CAAWC,QAA/B,EAAyCgB,OAAzC,EAAkDC,MAAlD,EAA0DC,IAA1D,CADF;AAED;;;6BAEQ;AACP,aACE;AAAA;AAAA,UAAK,WAAW,eAAhB;AACG,aAAKnB,KAAL,CAAWC,QAAX,KACE,KAAKD,KAAL,CAAWoB,QAAX,GAAsB,KAAKpB,KAAL,CAAWoB,QAAjC,GAA4C,4DAD9C;AADH,OADF;AAMD;;;;;;AAGHtB,aAAauB,YAAb,GAA4B;AAC1Bf,UAAQ;AADkB,CAA5B;;AAIAR,aAAawB,iBAAb,GAAiC;AAC/BhB,UAAQ,oBAAUiB,MADa;AAE/BhB,gBAAc,oBAAUiB,MAFO;AAG/BvB,YAAU,oBAAUwB,GAHW;AAI/BpB,eAAa,oBAAUmB,MAJQ;AAK/BtB,mBAAiB,oBAAUwB,KALI;AAM/BlB,QAAM,oBAAUkB,KANe;AAO/BjB,YAAU,oBAAUiB,KAPW;AAQ/Bf,UAAQ,oBAAUa,MARa;AAS/BZ,cAAY,oBAAUY,MATS;AAU/BV,YAAU,oBAAUa;AAVW,CAAjC;kBAYe7B,Y","file":"PlotlyEditor.js","sourcesContent":["import React, { Component } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport constants from \"./lib/constants\";\nimport { bem } from \"./lib\";\nimport dictionaries from \"./locales\";\n\nimport DefaultEditor from \"./DefaultEditor\";\n\nclass PlotlyEditor extends Component {\n getChildContext() {\n var gd = this.props.graphDiv || {};\n var dataSourceNames = Object.keys(this.props.dataSources || {});\n return {\n graphDiv: gd,\n locale: this.props.locale,\n dictionaries: dictionaries,\n data: gd.data,\n fullData: gd._fullData,\n layout: gd.layout,\n fullLayout: gd._fullLayout,\n onUpdate: this.updateProp.bind(this),\n dataSources: this.props.dataSources,\n dataSourceNames: dataSourceNames,\n };\n }\n\n updateProp(updates, traces, type) {\n this.props.onUpdate &&\n this.props.onUpdate(this.props.graphDiv, updates, traces, type);\n }\n\n render() {\n return (\n
\n {this.props.graphDiv &&\n (this.props.children ? this.props.children : )}\n
\n );\n }\n}\n\nPlotlyEditor.defaultProps = {\n locale: \"en\",\n};\n\nPlotlyEditor.childContextTypes = {\n locale: PropTypes.string,\n dictionaries: PropTypes.object,\n graphDiv: PropTypes.any,\n dataSources: PropTypes.object,\n dataSourceNames: PropTypes.array,\n data: PropTypes.array,\n fullData: PropTypes.array,\n layout: PropTypes.object,\n fullLayout: PropTypes.object,\n onUpdate: PropTypes.func,\n};\nexport default PlotlyEditor;\n"]} \ No newline at end of file diff --git a/lib/PlotlyReactEditor.js.map b/lib/PlotlyReactEditor.js.map deleted file mode 100644 index 6e79fa34e..000000000 --- a/lib/PlotlyReactEditor.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/PlotlyReactEditor.js"],"names":["PlotlyReactEditor","gd","props","graphDiv","dataSourceNames","Object","keys","dataSources","locale","dictionaries","data","fullData","_fullData","layout","fullLayout","_fullLayout","handleUpdate","updateProp","bind","attr","value","onUpdate","children","defaultProps","childContextTypes","string","object","array","func","assign"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;AAEA;;;;AACA;;AACA;;;;AACA;;;;AAEA;;;;;;;;;;;;IAEMA,iB;;;;;;;;;;;sCACc;AAChB,UAAIC,KAAK,KAAKC,KAAL,CAAWC,QAAX,IAAuB,EAAhC;AACA,UAAIC,kBAAkBC,OAAOC,IAAP,CAAY,KAAKJ,KAAL,CAAWK,WAAX,IAA0B,EAAtC,CAAtB;AACA,aAAO;AACLC,gBAAQ,KAAKN,KAAL,CAAWM,MADd;AAELC,oCAFK;AAGLC,cAAMT,GAAGS,IAHJ;AAILC,kBAAUV,GAAGW,SAJR;AAKLC,gBAAQZ,GAAGY,MALN;AAMLC,oBAAYb,GAAGc,WANV;AAOLC,sBAAc,KAAKC,UAAL,CAAgBC,IAAhB,CAAqB,IAArB,CAPT;AAQLX,qBAAa,KAAKL,KAAL,CAAWK,WARnB;AASLH,yBAAiBA;AATZ,OAAP;AAWD;;;+BAEUe,I,EAAMC,K,EAAO;AACtB,WAAKlB,KAAL,CAAWmB,QAAX,IACE,KAAKnB,KAAL,CAAWmB,QAAX,CAAoB,KAAKnB,KAAL,CAAWC,QAA/B,EAAyCgB,IAAzC,EAA+CC,KAA/C,CADF;AAED;;;6BAEQ;AACP,aACE;AAAA;AAAA,UAAK,WAAW,kBAAhB;AACG,aAAKlB,KAAL,CAAWC,QAAX,KACE,KAAKD,KAAL,CAAWoB,QAAX,GAAsB,KAAKpB,KAAL,CAAWoB,QAAjC,GAA4C,4DAD9C;AADH,OADF;AAMD;;;;;;AAGHtB,kBAAkBuB,YAAlB,GAAiC;AAC/Bf,UAAQ;AADuB,CAAjC;;AAIAR,kBAAkBwB,iBAAlB,GAAsC;AACpChB,UAAQ,oBAAUiB,MADkB;AAEpChB,gBAAc,oBAAUiB,MAFY;AAGpCnB,eAAa,oBAAUmB,MAHa;AAIpCtB,mBAAiB,oBAAUuB,KAJS;AAKpCjB,QAAM,oBAAUiB,KALoB;AAMpChB,YAAU,oBAAUgB,KANgB;AAOpCd,UAAQ,oBAAUa,MAPkB;AAQpCZ,cAAY,oBAAUY,MARc;AASpCV,gBAAc,oBAAUY;AATY,CAAtC;;AAYAvB,OAAOwB,MAAP,CAAc7B,iBAAd;;kBAEeA,iB","file":"PlotlyReactEditor.js","sourcesContent":["import React, { Component } from \"react\";\nimport PropTypes from \"prop-types\";\n\nimport constants from \"./lib/constants\";\nimport { bem } from \"./lib/common\";\nimport dictionaries from \"./i18n\";\nimport components from \"./components\";\n\nimport DefaultEditor from \"./DefaultEditor\";\n\nclass PlotlyReactEditor extends Component {\n getChildContext() {\n var gd = this.props.graphDiv || {};\n var dataSourceNames = Object.keys(this.props.dataSources || {});\n return {\n locale: this.props.locale,\n dictionaries: dictionaries,\n data: gd.data,\n fullData: gd._fullData,\n layout: gd.layout,\n fullLayout: gd._fullLayout,\n handleUpdate: this.updateProp.bind(this),\n dataSources: this.props.dataSources,\n dataSourceNames: dataSourceNames,\n };\n }\n\n updateProp(attr, value) {\n this.props.onUpdate &&\n this.props.onUpdate(this.props.graphDiv, attr, value);\n }\n\n render() {\n return (\n
\n {this.props.graphDiv &&\n (this.props.children ? this.props.children : )}\n
\n );\n }\n}\n\nPlotlyReactEditor.defaultProps = {\n locale: \"en\",\n};\n\nPlotlyReactEditor.childContextTypes = {\n locale: PropTypes.string,\n dictionaries: PropTypes.object,\n dataSources: PropTypes.object,\n dataSourceNames: PropTypes.array,\n data: PropTypes.array,\n fullData: PropTypes.array,\n layout: PropTypes.object,\n fullLayout: PropTypes.object,\n handleUpdate: PropTypes.func,\n};\n\nObject.assign(PlotlyReactEditor, components);\n\nexport default PlotlyReactEditor;\n"]} \ No newline at end of file diff --git a/lib/common.js b/lib/common.js deleted file mode 100644 index d7ec1e822..000000000 --- a/lib/common.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.bem = bem; -exports._ = _; -exports.clamp = clamp; - -var _constants = require("./constants"); - -var _constants2 = _interopRequireDefault(_constants); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* -* BEM helper -* -* bem() => 'plotly-editor' -* bem('foo') => 'plotly-editor__foo' -* bem('foo', 'bar') => 'plotly-editor__foo__bar' -* bem('foo', ['mod']) => 'plotly-editor__foo plotly-editor__foo--mod' -* bem('foo', 'bar', ['mod']) => 'plotly-editor__foo__bar plotly-editor__foo__bar--mod' -* bem('foo', ['mod1', mod2']) => 'plotly-editor__foo plotly-editor__foo--mod1 plotly-editor__foo--mod2' -*/ -function bem(block, element, modifiers) { - var i, modifier; - var out = []; - var c = _constants2.default.baseClass; - - if (Array.isArray(block)) { - modifiers = block; - block = null; - element = null; - } else if (Array.isArray(element)) { - modifiers = element; - element = null; - } - - if (block && block.length) { - c += "__" + block; - } - - if (element && element.length) { - c += "__" + element; - } - - out.push(c); - if (modifiers) { - for (i = 0; i < modifiers.length; i++) { - modifier = modifiers[i]; - if (modifier && modifier.length) { - out.push(c + "--" + modifier); - } - } - } - - return out.join(" "); -} - -function _(dictionaries, locale, key) { - var dict = dictionaries[locale]; - if (dict && dict.hasOwnProperty(key)) { - return dict[key]; - } else { - return key; - } -} - -function clamp(value, min, max) { - return Math.max(min, Math.min(max, value)); -} -//# sourceMappingURL=common.js.map \ No newline at end of file diff --git a/lib/common.js.map b/lib/common.js.map deleted file mode 100644 index 9e8dd7e2e..000000000 --- a/lib/common.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/common.js"],"names":["bem","_","clamp","block","element","modifiers","i","modifier","out","c","baseClass","Array","isArray","length","push","join","dictionaries","locale","key","dict","hasOwnProperty","value","min","max","Math"],"mappings":";;;;;QAYgBA,G,GAAAA,G;QAmCAC,C,GAAAA,C;QASAC,K,GAAAA,K;;AAxDhB;;;;;;AAEA;;;;;;;;;;AAUO,SAASF,GAAT,CAAaG,KAAb,EAAoBC,OAApB,EAA6BC,SAA7B,EAAwC;AAC7C,MAAIC,CAAJ,EAAOC,QAAP;AACA,MAAIC,MAAM,EAAV;AACA,MAAIC,IAAI,oBAAUC,SAAlB;;AAEA,MAAIC,MAAMC,OAAN,CAAcT,KAAd,CAAJ,EAA0B;AACxBE,gBAAYF,KAAZ;AACAA,YAAQ,IAAR;AACAC,cAAU,IAAV;AACD,GAJD,MAIO,IAAIO,MAAMC,OAAN,CAAcR,OAAd,CAAJ,EAA4B;AACjCC,gBAAYD,OAAZ;AACAA,cAAU,IAAV;AACD;;AAED,MAAID,SAASA,MAAMU,MAAnB,EAA2B;AACzBJ,SAAK,OAAON,KAAZ;AACD;;AAED,MAAIC,WAAWA,QAAQS,MAAvB,EAA+B;AAC7BJ,SAAK,OAAOL,OAAZ;AACD;;AAEDI,MAAIM,IAAJ,CAASL,CAAT;AACA,MAAIJ,SAAJ,EAAe;AACb,SAAKC,IAAI,CAAT,EAAYA,IAAID,UAAUQ,MAA1B,EAAkCP,GAAlC,EAAuC;AACrCC,iBAAWF,UAAUC,CAAV,CAAX;AACA,UAAIC,YAAYA,SAASM,MAAzB,EAAiC;AAC/BL,YAAIM,IAAJ,CAASL,IAAI,IAAJ,GAAWF,QAApB;AACD;AACF;AACF;;AAED,SAAOC,IAAIO,IAAJ,CAAS,GAAT,CAAP;AACD;;AAEM,SAASd,CAAT,CAAWe,YAAX,EAAyBC,MAAzB,EAAiCC,GAAjC,EAAsC;AAC3C,MAAMC,OAAOH,aAAaC,MAAb,CAAb;AACA,MAAIE,QAAQA,KAAKC,cAAL,CAAoBF,GAApB,CAAZ,EAAsC;AACpC,WAAOC,KAAKD,GAAL,CAAP;AACD,GAFD,MAEO;AACL,WAAOA,GAAP;AACD;AACF;;AAEM,SAAShB,KAAT,CAAemB,KAAf,EAAsBC,GAAtB,EAA2BC,GAA3B,EAAgC;AACrC,SAAOC,KAAKD,GAAL,CAASD,GAAT,EAAcE,KAAKF,GAAL,CAASC,GAAT,EAAcF,KAAd,CAAd,CAAP;AACD","file":"common.js","sourcesContent":["import constants from \"./constants\";\n\n/*\n* BEM helper\n*\n* bem() => 'plotly-editor'\n* bem('foo') => 'plotly-editor__foo'\n* bem('foo', 'bar') => 'plotly-editor__foo__bar'\n* bem('foo', ['mod']) => 'plotly-editor__foo plotly-editor__foo--mod'\n* bem('foo', 'bar', ['mod']) => 'plotly-editor__foo__bar plotly-editor__foo__bar--mod'\n* bem('foo', ['mod1', mod2']) => 'plotly-editor__foo plotly-editor__foo--mod1 plotly-editor__foo--mod2'\n*/\nexport function bem(block, element, modifiers) {\n var i, modifier;\n var out = [];\n var c = constants.baseClass;\n\n if (Array.isArray(block)) {\n modifiers = block;\n block = null;\n element = null;\n } else if (Array.isArray(element)) {\n modifiers = element;\n element = null;\n }\n\n if (block && block.length) {\n c += \"__\" + block;\n }\n\n if (element && element.length) {\n c += \"__\" + element;\n }\n\n out.push(c);\n if (modifiers) {\n for (i = 0; i < modifiers.length; i++) {\n modifier = modifiers[i];\n if (modifier && modifier.length) {\n out.push(c + \"--\" + modifier);\n }\n }\n }\n\n return out.join(\" \");\n}\n\nexport function _(dictionaries, locale, key) {\n const dict = dictionaries[locale];\n if (dict && dict.hasOwnProperty(key)) {\n return dict[key];\n } else {\n return key;\n }\n}\n\nexport function clamp(value, min, max) {\n return Math.max(min, Math.min(max, value));\n}\n"]} \ No newline at end of file diff --git a/lib/components/AccordionMenu.js b/lib/components/AccordionMenu.js deleted file mode 100644 index 69d27fa0c..000000000 --- a/lib/components/AccordionMenu.js +++ /dev/null @@ -1,502 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.DropdownAddMenu = exports.SimpleAddMenu = undefined; - -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 _AccordionMenuItem = require('./AccordionMenuItem'); - -var _AccordionMenuItem2 = _interopRequireDefault(_AccordionMenuItem); - -var _Dropdown = require('@workspace/components/widgets/Dropdown'); - -var _Dropdown2 = _interopRequireDefault(_Dropdown); - -var _ramda = require('ramda'); - -var _ramda2 = _interopRequireDefault(_ramda); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _classnames = require('classnames'); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _customPropTypes = require('@workspace/utils/customPropTypes'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _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 SimpleAddMenu = exports.SimpleAddMenu = function (_Component) { - _inherits(SimpleAddMenu, _Component); - - function SimpleAddMenu() { - _classCallCheck(this, SimpleAddMenu); - - return _possibleConstructorReturn(this, (SimpleAddMenu.__proto__ || Object.getPrototypeOf(SimpleAddMenu)).apply(this, arguments)); - } - - _createClass(SimpleAddMenu, [{ - key: 'render', - value: function render() { - var _props = this.props, - addNewMenuClass = _props.addNewMenuClass, - disableAddMenu = _props.disableAddMenu, - addNewMenuHandler = _props.addNewMenuHandler; - - - var className = (0, _classnames2.default)('btnbase', 'btn--primary', 'js-test-add-new-layer', '+float-right', addNewMenuClass, { '--disabled': disableAddMenu }); - var buttonText = this.props.addMenuText || ''; - - return _react2.default.createElement( - 'div', - { className: className, - onClick: addNewMenuHandler - }, - '+ ' + buttonText - ); - } - }]); - - return SimpleAddMenu; -}(_react.Component); - -/* - * See the main AccordionMenu component PropTypes section for more information. - */ - - -SimpleAddMenu.propTypes = { - addNewMenuClass: _react.PropTypes.string, - addNewMenuHandler: _react.PropTypes.func, - disableAddMenu: _react.PropTypes.bool, - addMenuText: _react.PropTypes.string -}; - -var DropdownAddMenu = exports.DropdownAddMenu = function (_Component2) { - _inherits(DropdownAddMenu, _Component2); - - function DropdownAddMenu(props) { - _classCallCheck(this, DropdownAddMenu); - - return _possibleConstructorReturn(this, (DropdownAddMenu.__proto__ || Object.getPrototypeOf(DropdownAddMenu)).call(this, props)); - } - - _createClass(DropdownAddMenu, [{ - key: 'render', - value: function render() { - var _props$addNewMenuConf = this.props.addNewMenuConfig, - title = _props$addNewMenuConf.title, - options = _props$addNewMenuConf.options; - - - var simpleAddMenuPlaceholder = _react2.default.createElement(SimpleAddMenu, { - addMenuText: title - }); - - /* - * Always display `+` (SimpleAddMenu) and show a - * dropdown when you click on it. - * We're always displaying the `+` by returning SimpleAddMenu in - * the valueRenderer and the placeholder - */ - return _react2.default.createElement( - 'div', - { className: '+float-right js-dropdown-add-menu' }, - _react2.default.createElement(_Dropdown2.default, { - className: this.props.addNewMenuClass + ' accordion-menu-dropdown-button', - style: { width: null }, - options: options, - clearable: false, - onChange: this.props.addNewMenuHandler, - placeholder: simpleAddMenuPlaceholder, - valueRenderer: function valueRenderer() { - return simpleAddMenuPlaceholder; - } - }) - ); - } - }]); - - return DropdownAddMenu; -}(_react.Component); - -/* - * See the main AccordionMenu component PropTypes section for more information. - */ - - -DropdownAddMenu.propTypes = { - addNewMenuConfig: _react.PropTypes.shape({ - title: _react.PropTypes.string.isRequired, - options: _react.PropTypes.arrayOf(_customPropTypes.dropdownOptionShape).isRequired - }), - addNewMenuClass: _react.PropTypes.string, - addNewMenuHandler: _react.PropTypes.func -}; - -function idOrIndex(id, index) { - if (typeof id === 'string') { - return id; - } - - return String(index); -} - -/* - * Each AccordionMenuItem is passed in as an object and its content - * as an element - * The expand and collapse buttons set the state of each submenu - */ - -var AccordionMenu = function (_Component3) { - _inherits(AccordionMenu, _Component3); - - function AccordionMenu(props) { - _classCallCheck(this, AccordionMenu); - - var _this3 = _possibleConstructorReturn(this, (AccordionMenu.__proto__ || Object.getPrototypeOf(AccordionMenu)).call(this, props)); - - _this3.state = _this3.initialState(props); - - _this3.toggleAllHandler = _this3.toggleAll.bind(_this3); - - // Used to construct a collapse/expand handler for each sub-menu. - var makeHandler = function makeHandler(index) { - return _this3.toggleSubMenu(index); - }; - _this3.toggleSubMenuHandlerConstructor = makeHandler.bind(_this3); - return _this3; - } - - _createClass(AccordionMenu, [{ - key: 'componentWillReceiveProps', - value: function componentWillReceiveProps(newProps) { - var newSubmenuStates = this.initialState(newProps).subMenuStates; - - /* - * Only update openess state when adding a new AccordionMenuItem - * e.g for +Trace / +Filter / +Note - */ - if (this.props.assignOpenState && newProps.subMenus.length !== Object.keys(this.state.subMenuStates).length) { - this.setState({ - subMenuStates: newSubmenuStates - }); - return; - } - - // Only update sub-menu states of those that are newly added. - this.setState({ - subMenuStates: _ramda2.default.merge(newSubmenuStates, this.state.subMenuStates) - }); - } - }, { - key: 'initialState', - value: function initialState(props) { - var subMenuStates = {}; - props.subMenus.forEach(function (subMenu, i) { - var id = idOrIndex(subMenu.id, i); - subMenuStates[id] = subMenu.isOpen; - }); - - return { subMenuStates: subMenuStates }; - } - - /** - * Check if any sub-menu is open. - * @return {Boolean} True if all sub-menus are closed. - */ - - }, { - key: 'anySubMenusOpen', - value: function anySubMenusOpen() { - return _ramda2.default.any(_ramda2.default.identity, this.getMenuStates()); - } - - /** - * Set all the sub-menus to a given state. - * @param {Boolean} state the collapse state for all sub-menus - */ - - }, { - key: 'setMenuStates', - value: function setMenuStates(state) { - var subMenuStates = {}; - var setState = function setState(menu, index) { - var id = idOrIndex(menu.id, index); - subMenuStates[id] = state; - }; - this.props.subMenus.forEach(setState); - this.setState({ subMenuStates: subMenuStates }); - } - - /** - * Get all the sub-menu collapse states. - * @return {Boolean[]} state: the collapse state for all sub-menus - */ - - }, { - key: 'getMenuStates', - value: function getMenuStates() { - var _this4 = this; - - var getState = function getState(id) { - return _this4.state.subMenuStates[id]; - }; - var menuStates = Object.keys(this.state.subMenuStates).map(getState); - return menuStates; - } - - /** - * Given the state of all menus, expand or collapse all menus at once. - */ - - }, { - key: 'toggleAll', - value: function toggleAll() { - /* - * If any sub-menu is open, collapse all sub-menus - * Else expand all sub-menus - */ - - if (this.anySubMenusOpen()) { - this.setMenuStates(false); - } else { - this.setMenuStates(true); - } - } - - /** - * Toggle an individual submenu - * @param {Number} id: The sub-menu ref id. - */ - - }, { - key: 'toggleSubMenu', - value: function toggleSubMenu(id) { - this.setState({ - subMenuStates: _ramda2.default.merge(this.state.subMenuStates, _defineProperty({}, id, !this.state.subMenuStates[id])) - }); - } - - /** - * Renders each sub-menu in the accordion menu. - * @return {AccordionMenuItem[]} sub-menu DOM elements - */ - - }, { - key: 'renderSubmenuItems', - value: function renderSubmenuItems() { - var _this5 = this; - - return this.props.subMenus.map(function (subMenuConfig, i) { - var title = subMenuConfig.title, - titleColor = subMenuConfig.titleColor, - iconClass = subMenuConfig.iconClass, - content = subMenuConfig.content; - - - var isRemovable = _ramda2.default.pathOr(_ramda2.default.has('removeMenuHandler', _this5.props), ['isRemovable'], subMenuConfig); - - var id = idOrIndex(subMenuConfig.id, i); - - return _react2.default.createElement( - _AccordionMenuItem2.default, - { - title: title, - titleColor: titleColor, - iconClass: iconClass, - key: id, - id: id, - ref: id, - isOpen: _this5.state.subMenuStates[id], - isRemovable: isRemovable, - removeMenuHandler: _this5.props.removeMenuHandler, - onToggle: function onToggle() { - return _this5.toggleSubMenuHandlerConstructor(id); - }, - accordionMenuModifier: _this5.props.accordionMenuModifier || null - }, - content - ); - }); - } - }, { - key: 'render', - value: function render() { - var _props2 = this.props, - addNewMenuHandler = _props2.addNewMenuHandler, - addNewMenuConfig = _props2.addNewMenuConfig, - header = _props2.header; - - /* - * If the developer passes in a handler we are going to set up - * an add new menu UI. - */ - - var doAddMenu = typeof addNewMenuHandler === 'function'; - - /* - * if the developer doesn't pass in options we just call the handler - * when the user clicks on a "+" button. - */ - var doSimpleAddMenu = doAddMenu && !addNewMenuConfig; - - /* - * if the developer passes in options we are going to set up a - * standalone box with a dropdown and a "+" button. - */ - var doDropdownAddMenu = doAddMenu && Boolean(addNewMenuConfig); - - /* - * Only render the components when needed. - */ - var simpleAddMenu = doSimpleAddMenu ? _react2.default.createElement(SimpleAddMenu, { - addNewMenuClass: this.props.addNewMenuClass, - addNewMenuHandler: this.props.addNewMenuHandler, - disableAddMenu: this.props.disableAddMenu, - addMenuText: this.props.addMenuText - }) : null; - - var dropdownAddMenu = doDropdownAddMenu ? _react2.default.createElement(DropdownAddMenu, { - addNewMenuClass: this.props.addNewMenuClass, - addNewMenuHandler: this.props.addNewMenuHandler, - addNewMenuConfig: this.props.addNewMenuConfig - }) : null; - - var collapseButtonText = void 0; - if (this.anySubMenusOpen()) { - collapseButtonText = 'Collapse All'; - } else { - collapseButtonText = 'Expand All'; - } - - var collapseButton = this.props.subMenus.length > 0 ? _react2.default.createElement( - 'div', - { className: 'accordion-menu-button +float-left js-test-collapse-text', - ref: 'collapse', - onClick: this.toggleAllHandler - }, - this.anySubMenusOpen() ? _react2.default.createElement('i', { className: 'icon-resize-down +soft-quarter-right' }) : _react2.default.createElement('i', { className: 'icon-resize-expand +soft-quarter-right' }), - collapseButtonText - ) : null; - - var accordionClassName = (0, _classnames2.default)('accordion-menu__button-area', '+clearfix'); - - return _react2.default.createElement( - 'div', - { className: this.props.parentClassName }, - _react2.default.createElement( - 'div', - { className: accordionClassName }, - collapseButton, - simpleAddMenu, - dropdownAddMenu - ), - header, - _react2.default.createElement( - 'div', - null, - this.props.subMenus && this.props.subMenus.length > 0 ? this.renderSubmenuItems() : this.props.placeholder && this.props.placeholder() - ) - ); - } - }]); - - return AccordionMenu; -}(_react.Component); - -exports.default = AccordionMenu; - - -AccordionMenu.defaultProps = { - assignOpenState: false -}; - -AccordionMenu.propTypes = { - subMenus: _react.PropTypes.arrayOf(_react.PropTypes.shape({ - title: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.node]).isRequired, - titleColor: _react.PropTypes.string, - isOpen: _react.PropTypes.bool, - iconClass: _react.PropTypes.string, - content: _react.PropTypes.element, - id: _react.PropTypes.string, - isRemovable: _react.PropTypes.bool - })), - - /* - * If this handler is passed in as a prop the Accordion menu - * will have a "+" button in the top right with a click handler - * set to the this function. - */ - addNewMenuHandler: _react.PropTypes.func, - - // Make add layer button unclickable - disableAddMenu: _react.PropTypes.bool, - - /* - * A class in which to style the "+" button (if it is shown) - */ - addNewMenuClass: _react.PropTypes.string, - - /* - * Text to include in the "+" button (if it is shown) - */ - addMenuText: _react.PropTypes.string, - - /* - * If this object is present the accordian menu will show a "create - * new menu" box with a dropdown consisting of the options - * given in the list instead of the simple "+" button. The - * addNewMenuClass handler will be passed the value in the dropdown - * once the user clicks the plus button. - */ - addNewMenuConfig: _react.PropTypes.shape({ - title: _react.PropTypes.string.isRequired, - options: _react.PropTypes.arrayOf(_customPropTypes.dropdownOptionShape).isRequired - }), - - /* - * If this handler is passed in submenus will show an 'x' - * which when called evokes this function with the id - * of the submenu. - */ - removeMenuHandler: _react.PropTypes.func, - - /* - * Optionally display a generic header item at the top of the AccordionMenu - */ - - header: _react.PropTypes.element, - - parentClassName: _react.PropTypes.string, - - /* - * On first render get open state from parent Component - */ - assignOpenState: _react.PropTypes.bool, - - /* - * Class to modify default look of accoridon menu - */ - accordionMenuModifier: _react.PropTypes.string, - - /* - * Optional method to render a placeholder when no subMenus present - */ - placeholder: _react.PropTypes.func - -}; -//# sourceMappingURL=AccordionMenu.js.map \ No newline at end of file diff --git a/lib/components/AccordionMenu.js.map b/lib/components/AccordionMenu.js.map deleted file mode 100644 index fa0fb03be..000000000 --- a/lib/components/AccordionMenu.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/components/AccordionMenu.js"],"names":["SimpleAddMenu","props","addNewMenuClass","disableAddMenu","addNewMenuHandler","className","buttonText","addMenuText","propTypes","string","func","bool","DropdownAddMenu","addNewMenuConfig","title","options","simpleAddMenuPlaceholder","width","shape","isRequired","arrayOf","idOrIndex","id","index","String","AccordionMenu","state","initialState","toggleAllHandler","toggleAll","bind","makeHandler","toggleSubMenu","toggleSubMenuHandlerConstructor","newProps","newSubmenuStates","subMenuStates","assignOpenState","subMenus","length","Object","keys","setState","merge","forEach","subMenu","i","isOpen","any","identity","getMenuStates","menu","getState","menuStates","map","anySubMenusOpen","setMenuStates","subMenuConfig","titleColor","iconClass","content","isRemovable","pathOr","has","removeMenuHandler","accordionMenuModifier","header","doAddMenu","doSimpleAddMenu","doDropdownAddMenu","Boolean","simpleAddMenu","dropdownAddMenu","collapseButtonText","collapseButton","accordionClassName","parentClassName","renderSubmenuItems","placeholder","defaultProps","oneOfType","node","element"],"mappings":";;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;;;;;;;IAEaA,a,WAAAA,a;;;;;;;;;;;iCACA;AAAA,yBACwD,KAAKC,KAD7D;AAAA,gBACEC,eADF,UACEA,eADF;AAAA,gBACmBC,cADnB,UACmBA,cADnB;AAAA,gBACmCC,iBADnC,UACmCA,iBADnC;;;AAGL,gBAAMC,YAAY,0BACd,SADc,EAEd,cAFc,EAGd,uBAHc,EAId,cAJc,EAKdH,eALc,EAMd,EAAC,cAAcC,cAAf,EANc,CAAlB;AAQA,gBAAMG,aAAa,KAAKL,KAAL,CAAWM,WAAX,IAA0B,EAA7C;;AAEA,mBACI;AAAA;AAAA,kBAAK,WAAWF,SAAhB;AACK,6BAASD;AADd;AAGK,uBAAOE;AAHZ,aADJ;AAOH;;;;;;AAGL;;;;;AAGAN,cAAcQ,SAAd,GAA0B;AACtBN,qBAAiB,iBAAUO,MADL;AAEtBL,uBAAmB,iBAAUM,IAFP;AAGtBP,oBAAgB,iBAAUQ,IAHJ;AAItBJ,iBAAa,iBAAUE;AAJD,CAA1B;;IAOaG,e,WAAAA,e;;;AACT,6BAAYX,KAAZ,EAAmB;AAAA;;AAAA,iIACTA,KADS;AAElB;;;;iCAEQ;AAAA,wCACoB,KAAKA,KAAL,CAAWY,gBAD/B;AAAA,gBACEC,KADF,yBACEA,KADF;AAAA,gBACSC,OADT,yBACSA,OADT;;;AAGL,gBAAMC,2BACF,8BAAC,aAAD;AACI,6BAAaF;AADjB,cADJ;;AAMA;;;;;;AAMA,mBACI;AAAA;AAAA,kBAAK,WAAU,mCAAf;AACI;AACI,+BAAc,KAAKb,KAAL,CAAWC,eAAzB,oCADJ;AAEI,2BAAO,EAACe,OAAO,IAAR,EAFX;AAGI,6BAASF,OAHb;AAII,+BAAW,KAJf;AAKI,8BAAU,KAAKd,KAAL,CAAWG,iBALzB;AAMI,iCAAaY,wBANjB;AAOI,mCAAe;AAAA,+BAAMA,wBAAN;AAAA;AAPnB;AADJ,aADJ;AAcH;;;;;;AAGL;;;;;AAGAJ,gBAAgBJ,SAAhB,GAA4B;AACxBK,sBAAkB,iBAAUK,KAAV,CAAgB;AAC9BJ,eAAO,iBAAUL,MAAV,CAAiBU,UADM;AAE9BJ,iBAAS,iBAAUK,OAAV,uCAAuCD;AAFlB,KAAhB,CADM;AAKxBjB,qBAAiB,iBAAUO,MALH;AAMxBL,uBAAmB,iBAAUM;AANL,CAA5B;;AAUA,SAASW,SAAT,CAAmBC,EAAnB,EAAuBC,KAAvB,EAA8B;AAC1B,QAAI,OAAOD,EAAP,KAAc,QAAlB,EAA4B;AACxB,eAAOA,EAAP;AACH;;AAED,WAAOE,OAAOD,KAAP,CAAP;AACH;;AAED;;;;;;IAKqBE,a;;;AAEjB,2BAAYxB,KAAZ,EAAmB;AAAA;;AAAA,mIACTA,KADS;;AAEf,eAAKyB,KAAL,GAAa,OAAKC,YAAL,CAAkB1B,KAAlB,CAAb;;AAEA,eAAK2B,gBAAL,GAAwB,OAAKC,SAAL,CAAeC,IAAf,QAAxB;;AAEA;AACA,YAAMC,cAAc,SAAdA,WAAc;AAAA,mBAAS,OAAKC,aAAL,CAAmBT,KAAnB,CAAT;AAAA,SAApB;AACA,eAAKU,+BAAL,GAAuCF,YAAYD,IAAZ,QAAvC;AARe;AASlB;;;;kDAEyBI,Q,EAAU;AAChC,gBAAMC,mBAAmB,KAAKR,YAAL,CAAkBO,QAAlB,EAA4BE,aAArD;;AAEA;;;;AAIA,gBAAI,KAAKnC,KAAL,CAAWoC,eAAX,IACAH,SAASI,QAAT,CAAkBC,MAAlB,KACIC,OAAOC,IAAP,CAAY,KAAKf,KAAL,CAAWU,aAAvB,EAAsCG,MAF9C,EAGE;AACE,qBAAKG,QAAL,CAAc;AACVN,mCAAeD;AADL,iBAAd;AAGA;AACH;;AAED;AACA,iBAAKO,QAAL,CAAc;AACVN,+BAAe,gBAAEO,KAAF,CAAQR,gBAAR,EAA0B,KAAKT,KAAL,CAAWU,aAArC;AADL,aAAd;AAGH;;;qCAEYnC,K,EAAO;AAChB,gBAAMmC,gBAAgB,EAAtB;AACAnC,kBAAMqC,QAAN,CAAeM,OAAf,CAAuB,UAACC,OAAD,EAAUC,CAAV,EAAgB;AACnC,oBAAMxB,KAAKD,UAAUwB,QAAQvB,EAAlB,EAAsBwB,CAAtB,CAAX;AACAV,8BAAcd,EAAd,IAAoBuB,QAAQE,MAA5B;AACH,aAHD;;AAKA,mBAAO,EAACX,4BAAD,EAAP;AACH;;AAED;;;;;;;0CAIkB;AACd,mBAAO,gBAAEY,GAAF,CAAM,gBAAEC,QAAR,EAAkB,KAAKC,aAAL,EAAlB,CAAP;AACH;;AAED;;;;;;;sCAIcxB,K,EAAO;AACjB,gBAAMU,gBAAgB,EAAtB;AACA,gBAAMM,WAAW,SAAXA,QAAW,CAACS,IAAD,EAAO5B,KAAP,EAAiB;AAC9B,oBAAMD,KAAKD,UAAU8B,KAAK7B,EAAf,EAAmBC,KAAnB,CAAX;AACAa,8BAAcd,EAAd,IAAoBI,KAApB;AACH,aAHD;AAIA,iBAAKzB,KAAL,CAAWqC,QAAX,CAAoBM,OAApB,CAA4BF,QAA5B;AACA,iBAAKA,QAAL,CAAc,EAACN,4BAAD,EAAd;AACH;;AAED;;;;;;;wCAIgB;AAAA;;AACZ,gBAAMgB,WAAW,SAAXA,QAAW;AAAA,uBAAM,OAAK1B,KAAL,CAAWU,aAAX,CAAyBd,EAAzB,CAAN;AAAA,aAAjB;AACA,gBAAM+B,aAAab,OAAOC,IAAP,CAAY,KAAKf,KAAL,CAAWU,aAAvB,EAAsCkB,GAAtC,CAA0CF,QAA1C,CAAnB;AACA,mBAAOC,UAAP;AACH;;AAED;;;;;;oCAGY;AACR;;;;;AAKA,gBAAI,KAAKE,eAAL,EAAJ,EAA4B;AACxB,qBAAKC,aAAL,CAAmB,KAAnB;AACH,aAFD,MAEO;AACH,qBAAKA,aAAL,CAAmB,IAAnB;AACH;AACJ;;AAED;;;;;;;sCAIclC,E,EAAI;AACd,iBAAKoB,QAAL,CAAc;AACVN,+BAAe,gBAAEO,KAAF,CAAQ,KAAKjB,KAAL,CAAWU,aAAnB,sBACVd,EADU,EACL,CAAC,KAAKI,KAAL,CAAWU,aAAX,CAAyBd,EAAzB,CADI;AADL,aAAd;AAKH;;AAED;;;;;;;6CAIqB;AAAA;;AAEjB,mBAAO,KAAKrB,KAAL,CAAWqC,QAAX,CAAoBgB,GAApB,CAAwB,UAACG,aAAD,EAAgBX,CAAhB,EAAsB;AAAA,oBAE7ChC,KAF6C,GAM7C2C,aAN6C,CAE7C3C,KAF6C;AAAA,oBAG7C4C,UAH6C,GAM7CD,aAN6C,CAG7CC,UAH6C;AAAA,oBAI7CC,SAJ6C,GAM7CF,aAN6C,CAI7CE,SAJ6C;AAAA,oBAK7CC,OAL6C,GAM7CH,aAN6C,CAK7CG,OAL6C;;;AAQjD,oBAAMC,cAAc,gBAAEC,MAAF,CAChB,gBAAEC,GAAF,CAAM,mBAAN,EAA2B,OAAK9D,KAAhC,CADgB,EAEhB,CAAC,aAAD,CAFgB,EAGhBwD,aAHgB,CAApB;;AAMA,oBAAMnC,KAAKD,UAAUoC,cAAcnC,EAAxB,EAA4BwB,CAA5B,CAAX;;AAEA,uBACI;AAAA;AAAA;AACI,+BAAOhC,KADX;AAEI,oCAAY4C,UAFhB;AAGI,mCAAWC,SAHf;AAII,6BAAKrC,EAJT;AAKI,4BAAIA,EALR;AAMI,6BAAKA,EANT;AAOI,gCAAQ,OAAKI,KAAL,CAAWU,aAAX,CAAyBd,EAAzB,CAPZ;AAQI,qCAAauC,WARjB;AASI,2CAAmB,OAAK5D,KAAL,CAAW+D,iBATlC;AAUI,kCAAU;AAAA,mCAAM,OAAK/B,+BAAL,CAAqCX,EAArC,CAAN;AAAA,yBAVd;AAWI,+CAAuB,OAAKrB,KAAL,CAAWgE,qBAAX,IAAoC;AAX/D;AAaKL;AAbL,iBADJ;AAiBH,aAjCM,CAAP;AAkCH;;;iCAEQ;AAAA,0BAEiD,KAAK3D,KAFtD;AAAA,gBAEEG,iBAFF,WAEEA,iBAFF;AAAA,gBAEqBS,gBAFrB,WAEqBA,gBAFrB;AAAA,gBAEuCqD,MAFvC,WAEuCA,MAFvC;;AAIL;;;;;AAIA,gBAAMC,YAAY,OAAO/D,iBAAP,KAA6B,UAA/C;;AAEA;;;;AAIA,gBAAMgE,kBAAkBD,aAAa,CAACtD,gBAAtC;;AAEA;;;;AAIA,gBAAMwD,oBAAoBF,aAAaG,QAAQzD,gBAAR,CAAvC;;AAEA;;;AAGA,gBAAM0D,gBAAgBH,kBAClB,8BAAC,aAAD;AACI,iCAAiB,KAAKnE,KAAL,CAAWC,eADhC;AAEI,mCAAmB,KAAKD,KAAL,CAAWG,iBAFlC;AAGI,gCAAgB,KAAKH,KAAL,CAAWE,cAH/B;AAII,6BAAa,KAAKF,KAAL,CAAWM;AAJ5B,cADkB,GAOlB,IAPJ;;AASA,gBAAMiE,kBAAkBH,oBACpB,8BAAC,eAAD;AACI,iCAAiB,KAAKpE,KAAL,CAAWC,eADhC;AAEI,mCAAmB,KAAKD,KAAL,CAAWG,iBAFlC;AAGI,kCAAkB,KAAKH,KAAL,CAAWY;AAHjC,cADoB,GAMpB,IANJ;;AAQA,gBAAI4D,2BAAJ;AACA,gBAAI,KAAKlB,eAAL,EAAJ,EAA4B;AACxBkB,qCAAqB,cAArB;AACH,aAFD,MAEO;AACHA,qCAAqB,YAArB;AACH;;AAED,gBAAMC,iBAAiB,KAAKzE,KAAL,CAAWqC,QAAX,CAAoBC,MAApB,GAA6B,CAA7B,GACnB;AAAA;AAAA,kBAAK,WAAU,yDAAf;AACK,yBAAI,UADT;AAEK,6BAAS,KAAKX;AAFnB;AAIK,qBAAK2B,eAAL,KACG,qCAAG,WAAU,sCAAb,GADH,GAGG,qCAAG,WAAU,wCAAb,GAPR;AASKkB;AATL,aADmB,GAYnB,IAZJ;;AAcA,gBAAME,qBAAqB,0BACvB,6BADuB,EAEvB,WAFuB,CAA3B;;AAKA,mBACI;AAAA;AAAA,kBAAK,WAAW,KAAK1E,KAAL,CAAW2E,eAA3B;AACI;AAAA;AAAA,sBAAK,WAAWD,kBAAhB;AACKD,kCADL;AAEKH,iCAFL;AAGKC;AAHL,iBADJ;AAMKN,sBANL;AAOI;AAAA;AAAA;AACK,yBAAKjE,KAAL,CAAWqC,QAAX,IAAuB,KAAKrC,KAAL,CAAWqC,QAAX,CAAoBC,MAApB,GAA6B,CAApD,GACG,KAAKsC,kBAAL,EADH,GAGG,KAAK5E,KAAL,CAAW6E,WAAX,IAA0B,KAAK7E,KAAL,CAAW6E,WAAX;AAJlC;AAPJ,aADJ;AAiBH;;;;;;kBAzOgBrD,a;;;AA4OrBA,cAAcsD,YAAd,GAA6B;AACzB1C,qBAAiB;AADQ,CAA7B;;AAIAZ,cAAcjB,SAAd,GAA0B;AACtB8B,cAAU,iBAAUlB,OAAV,CAAkB,iBAAUF,KAAV,CAAgB;AACxCJ,eAAO,iBAAUkE,SAAV,CAAoB,CAAC,iBAAUvE,MAAX,EAAmB,iBAAUwE,IAA7B,CAApB,EAAwD9D,UADvB;AAExCuC,oBAAY,iBAAUjD,MAFkB;AAGxCsC,gBAAQ,iBAAUpC,IAHsB;AAIxCgD,mBAAW,iBAAUlD,MAJmB;AAKxCmD,iBAAS,iBAAUsB,OALqB;AAMxC5D,YAAI,iBAAUb,MAN0B;AAOxCoD,qBAAa,iBAAUlD;AAPiB,KAAhB,CAAlB,CADY;;AAWtB;;;;;AAKAP,uBAAmB,iBAAUM,IAhBP;;AAkBtB;AACAP,oBAAgB,iBAAUQ,IAnBJ;;AAqBtB;;;AAGAT,qBAAiB,iBAAUO,MAxBL;;AA2BtB;;;AAGAF,iBAAa,iBAAUE,MA9BD;;AAgCtB;;;;;;;AAOAI,sBAAkB,iBAAUK,KAAV,CAAgB;AAC9BJ,eAAO,iBAAUL,MAAV,CAAiBU,UADM;AAE9BJ,iBAAS,iBAAUK,OAAV,uCAAuCD;AAFlB,KAAhB,CAvCI;;AA4CtB;;;;;AAKA6C,uBAAmB,iBAAUtD,IAjDP;;AAmDtB;;;;AAIAwD,YAAQ,iBAAUgB,OAvDI;;AAyDtBN,qBAAiB,iBAAUnE,MAzDL;;AA2DtB;;;AAGA4B,qBAAiB,iBAAU1B,IA9DL;;AAgEtB;;;AAGAsD,2BAAuB,iBAAUxD,MAnEX;;AAqEtB;;;AAGAqE,iBAAa,iBAAUpE;;AAxED,CAA1B","file":"AccordionMenu.js","sourcesContent":["import AccordionMenuItem from './AccordionMenuItem';\nimport Dropdown from '@workspace/components/widgets/Dropdown';\nimport R from 'ramda';\nimport React, {Component, PropTypes} from 'react';\nimport classnames from 'classnames';\nimport {dropdownOptionShape} from '@workspace/utils/customPropTypes';\n\nexport class SimpleAddMenu extends Component {\n render() {\n const {addNewMenuClass, disableAddMenu, addNewMenuHandler} = this.props;\n\n const className = classnames(\n 'btnbase',\n 'btn--primary',\n 'js-test-add-new-layer',\n '+float-right',\n addNewMenuClass,\n {'--disabled': disableAddMenu}\n );\n const buttonText = this.props.addMenuText || '';\n\n return (\n
\n {'+ ' + buttonText}\n
\n );\n }\n}\n\n/*\n * See the main AccordionMenu component PropTypes section for more information.\n */\nSimpleAddMenu.propTypes = {\n addNewMenuClass: PropTypes.string,\n addNewMenuHandler: PropTypes.func,\n disableAddMenu: PropTypes.bool,\n addMenuText: PropTypes.string\n};\n\nexport class DropdownAddMenu extends Component {\n constructor(props) {\n super(props);\n }\n\n render() {\n const {title, options} = this.props.addNewMenuConfig;\n\n const simpleAddMenuPlaceholder = (\n \n );\n\n /*\n * Always display `+` (SimpleAddMenu) and show a\n * dropdown when you click on it.\n * We're always displaying the `+` by returning SimpleAddMenu in\n * the valueRenderer and the placeholder\n */\n return (\n
\n simpleAddMenuPlaceholder}\n />\n
\n );\n\n }\n}\n\n/*\n * See the main AccordionMenu component PropTypes section for more information.\n */\nDropdownAddMenu.propTypes = {\n addNewMenuConfig: PropTypes.shape({\n title: PropTypes.string.isRequired,\n options: PropTypes.arrayOf(dropdownOptionShape).isRequired\n }),\n addNewMenuClass: PropTypes.string,\n addNewMenuHandler: PropTypes.func\n};\n\n\nfunction idOrIndex(id, index) {\n if (typeof id === 'string') {\n return id;\n }\n\n return String(index);\n}\n\n/*\n * Each AccordionMenuItem is passed in as an object and its content\n * as an element\n * The expand and collapse buttons set the state of each submenu\n */\nexport default class AccordionMenu extends Component {\n\n constructor(props) {\n super(props);\n this.state = this.initialState(props);\n\n this.toggleAllHandler = this.toggleAll.bind(this);\n\n // Used to construct a collapse/expand handler for each sub-menu.\n const makeHandler = index => this.toggleSubMenu(index);\n this.toggleSubMenuHandlerConstructor = makeHandler.bind(this);\n }\n\n componentWillReceiveProps(newProps) {\n const newSubmenuStates = this.initialState(newProps).subMenuStates;\n\n /*\n * Only update openess state when adding a new AccordionMenuItem\n * e.g for +Trace / +Filter / +Note\n */\n if (this.props.assignOpenState &&\n newProps.subMenus.length !==\n Object.keys(this.state.subMenuStates).length\n ) {\n this.setState({\n subMenuStates: newSubmenuStates\n });\n return;\n }\n\n // Only update sub-menu states of those that are newly added.\n this.setState({\n subMenuStates: R.merge(newSubmenuStates, this.state.subMenuStates)\n });\n }\n\n initialState(props) {\n const subMenuStates = {};\n props.subMenus.forEach((subMenu, i) => {\n const id = idOrIndex(subMenu.id, i);\n subMenuStates[id] = subMenu.isOpen;\n });\n\n return {subMenuStates};\n }\n\n /**\n * Check if any sub-menu is open.\n * @return {Boolean} True if all sub-menus are closed.\n */\n anySubMenusOpen() {\n return R.any(R.identity, this.getMenuStates());\n }\n\n /**\n * Set all the sub-menus to a given state.\n * @param {Boolean} state the collapse state for all sub-menus\n */\n setMenuStates(state) {\n const subMenuStates = {};\n const setState = (menu, index) => {\n const id = idOrIndex(menu.id, index);\n subMenuStates[id] = state;\n };\n this.props.subMenus.forEach(setState);\n this.setState({subMenuStates});\n }\n\n /**\n * Get all the sub-menu collapse states.\n * @return {Boolean[]} state: the collapse state for all sub-menus\n */\n getMenuStates() {\n const getState = id => this.state.subMenuStates[id];\n const menuStates = Object.keys(this.state.subMenuStates).map(getState);\n return menuStates;\n }\n\n /**\n * Given the state of all menus, expand or collapse all menus at once.\n */\n toggleAll() {\n /*\n * If any sub-menu is open, collapse all sub-menus\n * Else expand all sub-menus\n */\n\n if (this.anySubMenusOpen()) {\n this.setMenuStates(false);\n } else {\n this.setMenuStates(true);\n }\n }\n\n /**\n * Toggle an individual submenu\n * @param {Number} id: The sub-menu ref id.\n */\n toggleSubMenu(id) {\n this.setState({\n subMenuStates: R.merge(this.state.subMenuStates, {\n [id]: !this.state.subMenuStates[id]\n })\n });\n }\n\n /**\n * Renders each sub-menu in the accordion menu.\n * @return {AccordionMenuItem[]} sub-menu DOM elements\n */\n renderSubmenuItems() {\n\n return this.props.subMenus.map((subMenuConfig, i) => {\n const {\n title,\n titleColor,\n iconClass,\n content\n } = subMenuConfig;\n\n const isRemovable = R.pathOr(\n R.has('removeMenuHandler', this.props),\n ['isRemovable'],\n subMenuConfig\n );\n\n const id = idOrIndex(subMenuConfig.id, i);\n\n return (\n this.toggleSubMenuHandlerConstructor(id)}\n accordionMenuModifier={this.props.accordionMenuModifier || null}\n >\n {content}\n \n );\n });\n }\n\n render() {\n\n const {addNewMenuHandler, addNewMenuConfig, header} = this.props;\n\n /*\n * If the developer passes in a handler we are going to set up\n * an add new menu UI.\n */\n const doAddMenu = typeof addNewMenuHandler === 'function';\n\n /*\n * if the developer doesn't pass in options we just call the handler\n * when the user clicks on a \"+\" button.\n */\n const doSimpleAddMenu = doAddMenu && !addNewMenuConfig;\n\n /*\n * if the developer passes in options we are going to set up a\n * standalone box with a dropdown and a \"+\" button.\n */\n const doDropdownAddMenu = doAddMenu && Boolean(addNewMenuConfig);\n\n /*\n * Only render the components when needed.\n */\n const simpleAddMenu = doSimpleAddMenu ? (\n \n ) : null;\n\n const dropdownAddMenu = doDropdownAddMenu ? (\n \n ) : null;\n\n let collapseButtonText;\n if (this.anySubMenusOpen()) {\n collapseButtonText = 'Collapse All';\n } else {\n collapseButtonText = 'Expand All';\n }\n\n const collapseButton = this.props.subMenus.length > 0 ? (\n
\n {this.anySubMenusOpen() ?\n \n :\n \n }\n {collapseButtonText}\n
\n ) : null;\n\n const accordionClassName = classnames(\n 'accordion-menu__button-area',\n '+clearfix'\n );\n\n return (\n
\n
\n {collapseButton}\n {simpleAddMenu}\n {dropdownAddMenu}\n
\n {header}\n
\n {this.props.subMenus && this.props.subMenus.length > 0 ? (\n this.renderSubmenuItems()\n ) : (\n this.props.placeholder && this.props.placeholder()\n )}\n
\n
\n );\n }\n}\n\nAccordionMenu.defaultProps = {\n assignOpenState: false\n};\n\nAccordionMenu.propTypes = {\n subMenus: PropTypes.arrayOf(PropTypes.shape({\n title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,\n titleColor: PropTypes.string,\n isOpen: PropTypes.bool,\n iconClass: PropTypes.string,\n content: PropTypes.element,\n id: PropTypes.string,\n isRemovable: PropTypes.bool\n })),\n\n /*\n * If this handler is passed in as a prop the Accordion menu\n * will have a \"+\" button in the top right with a click handler\n * set to the this function.\n */\n addNewMenuHandler: PropTypes.func,\n\n // Make add layer button unclickable\n disableAddMenu: PropTypes.bool,\n\n /*\n * A class in which to style the \"+\" button (if it is shown)\n */\n addNewMenuClass: PropTypes.string,\n\n\n /*\n * Text to include in the \"+\" button (if it is shown)\n */\n addMenuText: PropTypes.string,\n\n /*\n * If this object is present the accordian menu will show a \"create\n * new menu\" box with a dropdown consisting of the options\n * given in the list instead of the simple \"+\" button. The\n * addNewMenuClass handler will be passed the value in the dropdown\n * once the user clicks the plus button.\n */\n addNewMenuConfig: PropTypes.shape({\n title: PropTypes.string.isRequired,\n options: PropTypes.arrayOf(dropdownOptionShape).isRequired\n }),\n\n /*\n * If this handler is passed in submenus will show an 'x'\n * which when called evokes this function with the id\n * of the submenu.\n */\n removeMenuHandler: PropTypes.func,\n\n /*\n * Optionally display a generic header item at the top of the AccordionMenu\n */\n\n header: PropTypes.element,\n\n parentClassName: PropTypes.string,\n\n /*\n * On first render get open state from parent Component\n */\n assignOpenState: PropTypes.bool,\n\n /*\n * Class to modify default look of accoridon menu\n */\n accordionMenuModifier: PropTypes.string,\n\n /*\n * Optional method to render a placeholder when no subMenus present\n */\n placeholder: PropTypes.func\n\n};\n"]} \ No newline at end of file diff --git a/lib/components/AccordionMenuItem.js b/lib/components/AccordionMenuItem.js deleted file mode 100644 index cb5e35fc2..000000000 --- a/lib/components/AccordionMenuItem.js +++ /dev/null @@ -1,172 +0,0 @@ -'use strict'; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _classnames = require('classnames'); - -var _classnames2 = _interopRequireDefault(_classnames); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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 AccordionMenuItem = function (_Component) { - _inherits(AccordionMenuItem, _Component); - - function AccordionMenuItem(props) { - _classCallCheck(this, AccordionMenuItem); - - var _this = _possibleConstructorReturn(this, (AccordionMenuItem.__proto__ || Object.getPrototypeOf(AccordionMenuItem)).call(this, props)); - - _this.handleRemoveMenu = _this.handleRemoveMenu.bind(_this); - _this.renderMenuContent = _this.renderMenuContent.bind(_this); - return _this; - } - - _createClass(AccordionMenuItem, [{ - key: 'handleRemoveMenu', - value: function handleRemoveMenu(event) { - var _props = this.props, - removeMenuHandler = _props.removeMenuHandler, - id = _props.id; - - - event.stopPropagation(); - - if (typeof removeMenuHandler === 'function') { - removeMenuHandler(id); - } - } - }, { - key: 'renderMenuContent', - value: function renderMenuContent() { - var _props2 = this.props, - isOpen = _props2.isOpen, - children = _props2.children, - id = _props2.id, - accordionMenuModifier = _props2.accordionMenuModifier; - - - var subMenuDisplay = (0, _classnames2.default)('accordion-item__content', 'js-accordion-menu-content-' + id, accordionMenuModifier); - - if (!isOpen) { - return _react2.default.createElement( - 'div', - { className: subMenuDisplay, style: { display: 'none' } }, - children - ); - } - - return _react2.default.createElement( - 'div', - { className: subMenuDisplay }, - children - ); - } - }, { - key: 'render', - value: function render() { - var _props3 = this.props, - isOpen = _props3.isOpen, - removeMenuHandler = _props3.removeMenuHandler, - titleColor = _props3.titleColor, - onToggle = _props3.onToggle, - iconClass = _props3.iconClass, - title = _props3.title, - isRemovable = _props3.isRemovable; - - - var subMenuOpen = (0, _classnames2.default)(['accordion-item__top', 'js-test-menu-item-click'], { - 'accordion-item__top--active': isOpen - }); - - var iconDirection = (0, _classnames2.default)('accordion-item__top__arrow', { - '+rotate-90 ': !isOpen - }); - - var topIcon = (0, _classnames2.default)('accordion-item__top__icon', { - 'accordion-item__top__icon_active': isOpen - }); - - var titleClass = (0, _classnames2.default)('js-test-title', 'accordion-item__top__title', { - 'accordion-item__top__title_active': isOpen - }); - - var closeClass = (0, _classnames2.default)('icon-close-thin', 'accordion-item__top__close', 'js-accordion-menu-item-close'); - - var closeIcon = null; - if (isRemovable && typeof removeMenuHandler === 'function') { - closeIcon = _react2.default.createElement('i', { - className: closeClass, - onClick: this.handleRemoveMenu - }); - } - - var titleStyling = { color: titleColor || '' }; - - return _react2.default.createElement( - 'div', - { className: 'accordion-item js-accordion-layer' }, - _react2.default.createElement( - 'div', - { ref: 'toggle', - className: subMenuOpen, - onClick: onToggle - }, - _react2.default.createElement( - 'span', - { className: '+float-left' }, - _react2.default.createElement( - 'div', - { className: iconDirection }, - _react2.default.createElement('i', { className: 'icon-angle-down' }) - ), - iconClass ? _react2.default.createElement( - 'div', - { className: topIcon }, - _react2.default.createElement('i', { className: iconClass, - style: titleStyling - }) - ) : null, - _react2.default.createElement( - 'div', - { - ref: 'title', - className: titleClass - }, - title - ) - ), - closeIcon - ), - this.renderMenuContent() - ); - } - }]); - - return AccordionMenuItem; -}(_react.Component); - -AccordionMenuItem.propTypes = { - children: _react.PropTypes.element.isRequired, - iconClass: _react.PropTypes.string, - id: _react.PropTypes.string.isRequired, - isOpen: _react.PropTypes.bool, - onToggle: _react.PropTypes.func, - removeMenuHandler: _react.PropTypes.func, - title: _react.PropTypes.string.isRequired, - titleColor: _react.PropTypes.string, - accordionMenuModifier: _react.PropTypes.string, - isRemovable: _react.PropTypes.bool -}; - -module.exports = AccordionMenuItem; -//# sourceMappingURL=AccordionMenuItem.js.map \ No newline at end of file diff --git a/lib/components/AccordionMenuItem.js.map b/lib/components/AccordionMenuItem.js.map deleted file mode 100644 index b62cceeaa..000000000 --- a/lib/components/AccordionMenuItem.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/components/AccordionMenuItem.js"],"names":["AccordionMenuItem","props","handleRemoveMenu","bind","renderMenuContent","event","removeMenuHandler","id","stopPropagation","isOpen","children","accordionMenuModifier","subMenuDisplay","display","titleColor","onToggle","iconClass","title","isRemovable","subMenuOpen","iconDirection","topIcon","titleClass","closeClass","closeIcon","titleStyling","color","propTypes","element","isRequired","string","bool","func","module","exports"],"mappings":";;;;AAAA;;;;AACA;;;;;;;;;;;;IAEMA,iB;;;AACF,+BAAYC,KAAZ,EAAmB;AAAA;;AAAA,0IACTA,KADS;;AAEf,cAAKC,gBAAL,GAAwB,MAAKA,gBAAL,CAAsBC,IAAtB,OAAxB;AACA,cAAKC,iBAAL,GAAyB,MAAKA,iBAAL,CAAuBD,IAAvB,OAAzB;AAHe;AAIlB;;;;yCAEgBE,K,EAAO;AAAA,yBACY,KAAKJ,KADjB;AAAA,gBACbK,iBADa,UACbA,iBADa;AAAA,gBACMC,EADN,UACMA,EADN;;;AAGpBF,kBAAMG,eAAN;;AAEA,gBAAI,OAAOF,iBAAP,KAA6B,UAAjC,EAA6C;AACzCA,kCAAkBC,EAAlB;AACH;AACJ;;;4CAEmB;AAAA,0BACsC,KAAKN,KAD3C;AAAA,gBACTQ,MADS,WACTA,MADS;AAAA,gBACDC,QADC,WACDA,QADC;AAAA,gBACSH,EADT,WACSA,EADT;AAAA,gBACaI,qBADb,WACaA,qBADb;;;AAGhB,gBAAMC,iBAAiB,0BACnB,yBADmB,iCAEUL,EAFV,EAGlBI,qBAHkB,CAAvB;;AAMA,gBAAI,CAACF,MAAL,EAAa;AACT,uBACI;AAAA;AAAA,sBAAK,WAAWG,cAAhB,EAAgC,OAAO,EAACC,SAAS,MAAV,EAAvC;AACKH;AADL,iBADJ;AAKH;;AAED,mBACI;AAAA;AAAA,kBAAK,WAAWE,cAAhB;AACKF;AADL,aADJ;AAKH;;;iCAEQ;AAAA,0BAGD,KAAKT,KAHJ;AAAA,gBACEQ,MADF,WACEA,MADF;AAAA,gBACUH,iBADV,WACUA,iBADV;AAAA,gBAC6BQ,UAD7B,WAC6BA,UAD7B;AAAA,gBAEGC,QAFH,WAEGA,QAFH;AAAA,gBAEaC,SAFb,WAEaA,SAFb;AAAA,gBAEwBC,KAFxB,WAEwBA,KAFxB;AAAA,gBAE+BC,WAF/B,WAE+BA,WAF/B;;;AAKL,gBAAMC,cAAc,0BAAW,CAC3B,qBAD2B,EAE3B,yBAF2B,CAAX,EAEY;AACxB,+CAA+BV;AADP,aAFZ,CAApB;;AAMA,gBAAMW,gBAAgB,0BAAW,4BAAX,EAAyC;AAC3D,+BAAe,CAACX;AAD2C,aAAzC,CAAtB;;AAIA,gBAAMY,UAAU,0BACZ,2BADY,EACiB;AACzB,oDAAoCZ;AADX,aADjB,CAAhB;;AAKA,gBAAMa,aAAa,0BACf,eADe,EAEf,4BAFe,EAEe;AAC1B,qDAAqCb;AADX,aAFf,CAAnB;;AAMA,gBAAMc,aAAa,0BACf,iBADe,EAEf,4BAFe,EAGf,8BAHe,CAAnB;;AAMA,gBAAIC,YAAY,IAAhB;AACA,gBAAIN,eAAe,OAAOZ,iBAAP,KAA6B,UAAhD,EAA4D;AACxDkB,4BACI;AACI,+BAAWD,UADf;AAEI,6BAAS,KAAKrB;AAFlB,kBADJ;AAMH;;AAED,gBAAMuB,eAAe,EAACC,OAAOZ,cAAc,EAAtB,EAArB;;AAEA,mBACI;AAAA;AAAA,kBAAK,WAAU,mCAAf;AACI;AAAA;AAAA,sBAAK,KAAI,QAAT;AACI,mCAAWK,WADf;AAEI,iCAASJ;AAFb;AAII;AAAA;AAAA,0BAAM,WAAU,aAAhB;AACI;AAAA;AAAA,8BAAK,WAAWK,aAAhB;AACI,iEAAG,WAAU,iBAAb;AADJ,yBADJ;AAKMJ,oCACE;AAAA;AAAA,8BAAK,WAAWK,OAAhB;AACI,iEAAG,WAAWL,SAAd;AACI,uCAAOS;AADX;AADJ,yBADF,GAME,IAXR;AAaI;AAAA;AAAA;AACI,qCAAI,OADR;AAEI,2CAAWH;AAFf;AAIKL;AAJL;AAbJ,qBAJJ;AAwBKO;AAxBL,iBADJ;AA2BK,qBAAKpB,iBAAL;AA3BL,aADJ;AA+BH;;;;;;AAGLJ,kBAAkB2B,SAAlB,GAA8B;AAC1BjB,cAAU,iBAAUkB,OAAV,CAAkBC,UADF;AAE1Bb,eAAW,iBAAUc,MAFK;AAG1BvB,QAAI,iBAAUuB,MAAV,CAAiBD,UAHK;AAI1BpB,YAAQ,iBAAUsB,IAJQ;AAK1BhB,cAAU,iBAAUiB,IALM;AAM1B1B,uBAAmB,iBAAU0B,IANH;AAO1Bf,WAAO,iBAAUa,MAAV,CAAiBD,UAPE;AAQ1Bf,gBAAY,iBAAUgB,MARI;AAS1BnB,2BAAuB,iBAAUmB,MATP;AAU1BZ,iBAAa,iBAAUa;AAVG,CAA9B;;AAaAE,OAAOC,OAAP,GAAiBlC,iBAAjB","file":"AccordionMenuItem.js","sourcesContent":["import React, {Component, PropTypes} from 'react';\nimport classnames from 'classnames';\n\nclass AccordionMenuItem extends Component {\n constructor(props) {\n super(props);\n this.handleRemoveMenu = this.handleRemoveMenu.bind(this);\n this.renderMenuContent = this.renderMenuContent.bind(this);\n }\n\n handleRemoveMenu(event) {\n const {removeMenuHandler, id} = this.props;\n\n event.stopPropagation();\n\n if (typeof removeMenuHandler === 'function') {\n removeMenuHandler(id);\n }\n }\n\n renderMenuContent() {\n const {isOpen, children, id, accordionMenuModifier} = this.props;\n\n const subMenuDisplay = classnames(\n 'accordion-item__content',\n `js-accordion-menu-content-${id}`,\n accordionMenuModifier\n );\n\n if (!isOpen) {\n return (\n
\n {children}\n
\n );\n }\n\n return (\n
\n {children}\n
\n );\n }\n\n render() {\n const {isOpen, removeMenuHandler, titleColor,\n onToggle, iconClass, title, isRemovable\n } = this.props;\n\n const subMenuOpen = classnames([\n 'accordion-item__top',\n 'js-test-menu-item-click'], {\n 'accordion-item__top--active': isOpen\n });\n\n const iconDirection = classnames('accordion-item__top__arrow', {\n '+rotate-90 ': !isOpen\n });\n\n const topIcon = classnames(\n 'accordion-item__top__icon', {\n 'accordion-item__top__icon_active': isOpen\n });\n\n const titleClass = classnames(\n 'js-test-title',\n 'accordion-item__top__title', {\n 'accordion-item__top__title_active': isOpen\n });\n\n const closeClass = classnames(\n 'icon-close-thin',\n 'accordion-item__top__close',\n 'js-accordion-menu-item-close'\n );\n\n let closeIcon = null;\n if (isRemovable && typeof removeMenuHandler === 'function') {\n closeIcon = (\n
\n );\n }\n\n const titleStyling = {color: titleColor || ''};\n\n return (\n
\n
\n \n
\n \n
\n\n { iconClass ? (\n
\n \n
\n ) : null }\n\n \n {title}\n
\n \n {closeIcon}\n
\n {this.renderMenuContent()}\n \n );\n }\n}\n\nAccordionMenuItem.propTypes = {\n children: PropTypes.element.isRequired,\n iconClass: PropTypes.string,\n id: PropTypes.string.isRequired,\n isOpen: PropTypes.bool,\n onToggle: PropTypes.func,\n removeMenuHandler: PropTypes.func,\n title: PropTypes.string.isRequired,\n titleColor: PropTypes.string,\n accordionMenuModifier: PropTypes.string,\n isRemovable: PropTypes.bool\n};\n\nmodule.exports = AccordionMenuItem;\n"]} \ No newline at end of file diff --git a/lib/components/Anchor.js b/lib/components/Anchor.js deleted file mode 100644 index 1f28c2a77..000000000 --- a/lib/components/Anchor.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _Dropdown = require('@workspace/components/widgets/Dropdown'); - -var _Dropdown2 = _interopRequireDefault(_Dropdown); - -var _connectWorkspacePlot = require('@workspace/utils/connectWorkspacePlot'); - -var _connectWorkspacePlot2 = _interopRequireDefault(_connectWorkspacePlot); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/* - * The Anchor component is a control for specifing the `anchor` axis property - * in plotly.js: https://plot.ly/javascript/reference/#layout-xaxis-anchor - */ - -var Anchor = function Anchor(_ref) { - var options = _ref.options, - onChange = _ref.onChange, - value = _ref.value; - return _react2.default.createElement(_Dropdown2.default, { - options: options, - value: value, - onChange: onChange, - minWidth: '110px' - }); -}; - -Anchor.propTypes = { - value: _react.PropTypes.string.isRequired, - onChange: _react.PropTypes.func.isRequired, - options: _react.PropTypes.array.isRequired, - axisLetter: _react.PropTypes.oneOf(['x', 'y']) -}; - -function mapPlotToProps(plot, props) { - var axisLetter = props.axisLetter; - - var options = plot.keysAtPath(['_fullLayout']).filter(function (key) { - return key.startsWith(axisLetter + 'axis'); - }).map(function (axisName) { - return { - label: axisName, - value: axisName.replace('axis', '') - }; - }); - options.unshift({ label: 'Unanchored', value: 'free' }); - return { options: options }; -} - -module.exports = (0, _connectWorkspacePlot2.default)(mapPlotToProps)(Anchor); -//# sourceMappingURL=Anchor.js.map \ No newline at end of file diff --git a/lib/components/Anchor.js.map b/lib/components/Anchor.js.map deleted file mode 100644 index 9e751329e..000000000 --- a/lib/components/Anchor.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/components/Anchor.js"],"names":["Anchor","options","onChange","value","propTypes","string","isRequired","func","array","axisLetter","oneOf","mapPlotToProps","plot","props","keysAtPath","filter","key","startsWith","map","label","axisName","replace","unshift","module","exports"],"mappings":";;AAAA;;;;AACA;;;;AACA;;;;;;AAEA;;;;;AAKA,IAAMA,SAAS,SAATA,MAAS;AAAA,QAAEC,OAAF,QAAEA,OAAF;AAAA,QAAWC,QAAX,QAAWA,QAAX;AAAA,QAAqBC,KAArB,QAAqBA,KAArB;AAAA,WACX;AACI,iBAASF,OADb;AAEI,eAAOE,KAFX;AAGI,kBAAUD,QAHd;AAII,kBAAU;AAJd,MADW;AAAA,CAAf;;AASAF,OAAOI,SAAP,GAAmB;AACfD,WAAO,iBAAUE,MAAV,CAAiBC,UADT;AAEfJ,cAAU,iBAAUK,IAAV,CAAeD,UAFV;AAGfL,aAAS,iBAAUO,KAAV,CAAgBF,UAHV;AAIfG,gBAAY,iBAAUC,KAAV,CAAgB,CAAC,GAAD,EAAM,GAAN,CAAhB;AAJG,CAAnB;;AAOA,SAASC,cAAT,CAAwBC,IAAxB,EAA8BC,KAA9B,EAAqC;AAAA,QAC1BJ,UAD0B,GACZI,KADY,CAC1BJ,UAD0B;;AAEjC,QAAMR,UAAUW,KAAKE,UAAL,CAAgB,CAAC,aAAD,CAAhB,EACXC,MADW,CACJ;AAAA,eAAOC,IAAIC,UAAJ,CAAkBR,UAAlB,UAAP;AAAA,KADI,EAEXS,GAFW,CAEP;AAAA,eAAa;AACdC,mBAAOC,QADO;AAEdjB,mBAAOiB,SAASC,OAAT,CAAiB,MAAjB,EAAyB,EAAzB;AAFO,SAAb;AAAA,KAFO,CAAhB;AAMApB,YAAQqB,OAAR,CAAgB,EAACH,OAAO,YAAR,EAAsBhB,OAAO,MAA7B,EAAhB;AACA,WAAO,EAACF,gBAAD,EAAP;AACH;;AAEDsB,OAAOC,OAAP,GAAiB,oCAAqBb,cAArB,EAAqCX,MAArC,CAAjB","file":"Anchor.js","sourcesContent":["import React, {PropTypes} from 'react';\nimport Dropdown from '@workspace/components/widgets/Dropdown';\nimport connectWorkspacePlot from '@workspace/utils/connectWorkspacePlot';\n\n/*\n * The Anchor component is a control for specifing the `anchor` axis property\n * in plotly.js: https://plot.ly/javascript/reference/#layout-xaxis-anchor\n */\n\nconst Anchor = ({options, onChange, value}) => (\n \n);\n\nAnchor.propTypes = {\n value: PropTypes.string.isRequired,\n onChange: PropTypes.func.isRequired,\n options: PropTypes.array.isRequired,\n axisLetter: PropTypes.oneOf(['x', 'y'])\n};\n\nfunction mapPlotToProps(plot, props) {\n const {axisLetter} = props;\n const options = plot.keysAtPath(['_fullLayout'])\n .filter(key => key.startsWith(`${axisLetter}axis`))\n .map(axisName => ({\n label: axisName,\n value: axisName.replace('axis', '')\n }));\n options.unshift({label: 'Unanchored', value: 'free'});\n return {options};\n}\n\nmodule.exports = connectWorkspacePlot(mapPlotToProps)(Anchor);\n"]} \ No newline at end of file diff --git a/lib/components/AnchorPositioning.js b/lib/components/AnchorPositioning.js deleted file mode 100644 index 6d76abacd..000000000 --- a/lib/components/AnchorPositioning.js +++ /dev/null @@ -1,154 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -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 = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _hat = require('hat'); - -var _hat2 = _interopRequireDefault(_hat); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -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; } - -/* - * Anchor Positioning. - * Positions: top left, top center, top right, middle left, middle center, - * middle right, bottom left, bottom center, bottom right - */ - -var AnchorPositioning = function (_Component) { - _inherits(AnchorPositioning, _Component); - - function AnchorPositioning(props) { - _classCallCheck(this, AnchorPositioning); - - var _this = _possibleConstructorReturn(this, (AnchorPositioning.__proto__ || Object.getPrototypeOf(AnchorPositioning)).call(this, props)); - - _this.state = { - uid: (0, _hat2.default)() - }; - - _this.renderRadio = _this.renderRadio.bind(_this); - _this.handleChange = _this.handleChange.bind(_this); - return _this; - } - - _createClass(AnchorPositioning, [{ - key: 'handleChange', - value: function handleChange(e) { - var newActiveOption = e.target.value; - this.props.onOptionChange(newActiveOption); - } - }, { - key: 'renderRadio', - value: function renderRadio(value) { - var label = value; - var activeRadio = this.props.activeOption ? this.props.activeOption : 'middle center'; - var defaultActive = activeRadio === value; - - return _react2.default.createElement( - 'span', - { className: 'anchor-item' }, - _react2.default.createElement( - 'span', - { key: label }, - _react2.default.createElement( - 'label', - { className: '+inline-block radio-item' }, - _react2.default.createElement('input', { className: '+inline-block radio-item__input', - type: 'radio', - checked: defaultActive, - onChange: this.handleChange, - ref: label, - name: this.state.uid, - value: value - }), - _react2.default.createElement('div', { className: 'radio-item__content' }) - ) - ) - ); - } - }, { - key: 'render', - value: function render() { - - return _react2.default.createElement( - 'div', - { className: 'anchor' }, - _react2.default.createElement( - 'div', - { className: 'anchor-background' }, - _react2.default.createElement( - 'div', - { className: 'anchor-background-section' }, - _react2.default.createElement('div', { className: 'anchor-background-subsection' }) - ), - _react2.default.createElement( - 'div', - { className: 'anchor-background-section +border-none' }, - _react2.default.createElement('div', { className: 'anchor-background-subsection' }) - ) - ), - _react2.default.createElement( - 'div', - { className: 'anchor-text-background' }, - this.props.backgroundText - ), - _react2.default.createElement( - 'div', - { className: 'anchor-container' }, - _react2.default.createElement( - 'div', - { className: 'anchor-line' }, - this.renderRadio('top left'), - this.renderRadio('top center'), - this.renderRadio('top right') - ), - _react2.default.createElement( - 'div', - { className: 'anchor-line' }, - this.renderRadio('middle left'), - this.renderRadio('middle center'), - this.renderRadio('middle right') - ), - _react2.default.createElement( - 'div', - { className: 'anchor-line' }, - this.renderRadio('bottom left'), - this.renderRadio('bottom center'), - this.renderRadio('bottom right') - ) - ) - ); - } - }]); - - return AnchorPositioning; -}(_react.Component); - -exports.default = AnchorPositioning; - - -AnchorPositioning.propTypes = { - onOptionChange: _react.PropTypes.func.isRequired, - activeOption: _react.PropTypes.string, - backgroundText: _react.PropTypes.string -}; - -AnchorPositioning.defaultProps = { - backgroundText: 'Text...' -}; -module.exports = exports['default']; -//# sourceMappingURL=AnchorPositioning.js.map \ No newline at end of file diff --git a/lib/components/AnchorPositioning.js.map b/lib/components/AnchorPositioning.js.map deleted file mode 100644 index 8cef57c8d..000000000 --- a/lib/components/AnchorPositioning.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/components/AnchorPositioning.js"],"names":["AnchorPositioning","props","state","uid","renderRadio","bind","handleChange","e","newActiveOption","target","value","onOptionChange","label","activeRadio","activeOption","defaultActive","backgroundText","propTypes","func","isRequired","string","defaultProps"],"mappings":";;;;;;;;AAAA;;;;AACA;;;;;;;;;;;;AAEA;;;;;;IAMqBA,iB;;;AACjB,+BAAYC,KAAZ,EAAmB;AAAA;;AAAA,0IACTA,KADS;;AAEf,cAAKC,KAAL,GAAa;AACTC,iBAAK;AADI,SAAb;;AAIA,cAAKC,WAAL,GAAmB,MAAKA,WAAL,CAAiBC,IAAjB,OAAnB;AACA,cAAKC,YAAL,GAAoB,MAAKA,YAAL,CAAkBD,IAAlB,OAApB;AAPe;AAQlB;;;;qCAEYE,C,EAAG;AACZ,gBAAMC,kBAAkBD,EAAEE,MAAF,CAASC,KAAjC;AACA,iBAAKT,KAAL,CAAWU,cAAX,CAA0BH,eAA1B;AACH;;;oCAEWE,K,EAAO;AACf,gBAAME,QAAQF,KAAd;AACA,gBAAMG,cAAc,KAAKZ,KAAL,CAAWa,YAAX,GAA0B,KAAKb,KAAL,CAAWa,YAArC,GAAoD,eAAxE;AACA,gBAAMC,gBAAgBF,gBAAgBH,KAAtC;;AAEA,mBACI;AAAA;AAAA,kBAAM,WAAU,aAAhB;AACI;AAAA;AAAA,sBAAM,KAAKE,KAAX;AACI;AAAA;AAAA,0BAAO,WAAU,0BAAjB;AACI,iEAAO,WAAU,iCAAjB;AACO,kCAAK,OADZ;AAEO,qCAASG,aAFhB;AAGO,sCAAU,KAAKT,YAHtB;AAIO,iCAAKM,KAJZ;AAKO,kCAAM,KAAKV,KAAL,CAAWC,GALxB;AAMO,mCAAOO;AANd,0BADJ;AASI,+DAAK,WAAU,qBAAf;AATJ;AADJ;AADJ,aADJ;AAiBH;;;iCAEQ;;AAEL,mBACI;AAAA;AAAA,kBAAK,WAAU,QAAf;AACI;AAAA;AAAA,sBAAK,WAAU,mBAAf;AACI;AAAA;AAAA,0BAAK,WAAU,2BAAf;AACI,+DAAK,WAAU,8BAAf;AADJ,qBADJ;AAII;AAAA;AAAA,0BAAK,WAAU,wCAAf;AACI,+DAAK,WAAU,8BAAf;AADJ;AAJJ,iBADJ;AASI;AAAA;AAAA,sBAAK,WAAU,wBAAf;AACK,yBAAKT,KAAL,CAAWe;AADhB,iBATJ;AAYI;AAAA;AAAA,sBAAK,WAAU,kBAAf;AACI;AAAA;AAAA,0BAAK,WAAU,aAAf;AACK,6BAAKZ,WAAL,CAAiB,UAAjB,CADL;AAEK,6BAAKA,WAAL,CAAiB,YAAjB,CAFL;AAGK,6BAAKA,WAAL,CAAiB,WAAjB;AAHL,qBADJ;AAMI;AAAA;AAAA,0BAAK,WAAU,aAAf;AACK,6BAAKA,WAAL,CAAiB,aAAjB,CADL;AAEK,6BAAKA,WAAL,CAAiB,eAAjB,CAFL;AAGK,6BAAKA,WAAL,CAAiB,cAAjB;AAHL,qBANJ;AAWI;AAAA;AAAA,0BAAK,WAAU,aAAf;AACK,6BAAKA,WAAL,CAAiB,aAAjB,CADL;AAEK,6BAAKA,WAAL,CAAiB,eAAjB,CAFL;AAGK,6BAAKA,WAAL,CAAiB,cAAjB;AAHL;AAXJ;AAZJ,aADJ;AAgCH;;;;;;kBA1EgBJ,iB;;;AA6ErBA,kBAAkBiB,SAAlB,GAA8B;AAC1BN,oBAAgB,iBAAUO,IAAV,CAAeC,UADL;AAE1BL,kBAAc,iBAAUM,MAFE;AAG1BJ,oBAAgB,iBAAUI;AAHA,CAA9B;;AAMApB,kBAAkBqB,YAAlB,GAAiC;AAC7BL,oBAAgB;AADa,CAAjC","file":"AnchorPositioning.js","sourcesContent":["import React, {Component, PropTypes} from 'react';\nimport hat from 'hat';\n\n/*\n * Anchor Positioning.\n * Positions: top left, top center, top right, middle left, middle center,\n * middle right, bottom left, bottom center, bottom right\n */\n\nexport default class AnchorPositioning extends Component {\n constructor(props) {\n super(props);\n this.state = {\n uid: hat()\n };\n\n this.renderRadio = this.renderRadio.bind(this);\n this.handleChange = this.handleChange.bind(this);\n }\n\n handleChange(e) {\n const newActiveOption = e.target.value;\n this.props.onOptionChange(newActiveOption);\n }\n\n renderRadio(value) {\n const label = value;\n const activeRadio = this.props.activeOption ? this.props.activeOption : 'middle center';\n const defaultActive = activeRadio === value;\n\n return (\n \n \n