function createThemeProvider() {
  var _class, _temp2;

  var CHANNEL = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : __WEBPACK_IMPORTED_MODULE_4__channel__["a" /* default */];

  return _temp2 = _class = function (_React$Component) {
    _inherits(ThemeProvider, _React$Component);

    function ThemeProvider() {
      var _ref;

      var _temp, _this, _ret;

      _classCallCheck(this, ThemeProvider);

      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }

      return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ThemeProvider.__proto__ || Object.getPrototypeOf(ThemeProvider)).call.apply(_ref, [this].concat(args))), _this), _this.broadcast = Object(__WEBPACK_IMPORTED_MODULE_5_brcast__["default"])(_this.getTheme()), _this.setOuterTheme = function (theme) {
        _this.outerTheme = theme;
      }, _temp), _possibleConstructorReturn(_this, _ret);
    }

    _createClass(ThemeProvider, [{
      key: 'getTheme',


      // Get the theme from the props, supporting both (outerTheme) => {} as well as object notation
      value: function getTheme(passedTheme) {
        var theme = passedTheme || this.props.theme;
        if (__WEBPACK_IMPORTED_MODULE_2_is_function___default()(theme)) {
          var mergedTheme = theme(this.outerTheme);
          if (!__WEBPACK_IMPORTED_MODULE_3_is_plain_object___default()(mergedTheme)) {
            throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!');
          }
          return mergedTheme;
        }
        if (!__WEBPACK_IMPORTED_MODULE_3_is_plain_object___default()(theme)) {
          throw new Error('[ThemeProvider] Please make your theme prop a plain object');
        }

        if (!this.outerTheme) {
          return theme;
        }

        return _extends({}, this.outerTheme, theme);
      }
    }, {
      key: 'getChildContext',
      value: function getChildContext() {
        return _defineProperty({}, CHANNEL, this.broadcast);
      }
    }, {
      key: 'componentDidMount',
      value: function componentDidMount() {
        // create a new subscription for keeping track of outer theme, if present
        if (this.context[CHANNEL]) {
          this.subscriptionId = this.context[CHANNEL].subscribe(this.setOuterTheme);
        }
      }

      // set broadcast state by merging outer theme with own

    }, {
      key: 'componentWillMount',
      value: function componentWillMount() {
        if (this.context[CHANNEL]) {
          this.setOuterTheme(this.context[CHANNEL].getState());
          this.broadcast.setState(this.getTheme());
        }
      }
    }, {
      key: 'componentWillReceiveProps',
      value: function componentWillReceiveProps(nextProps) {
        if (this.props.theme !== nextProps.theme) {
          this.broadcast.setState(this.getTheme(nextProps.theme));
        }
      }
    }, {
      key: 'componentWillUnmount',
      value: function componentWillUnmount() {
        if (this.subscriptionId !== undefined) {
          this.context[CHANNEL].unsubscribe(this.subscriptionId);
          delete this.subscriptionId;
        }
      }
    }, {
      key: 'render',
      value: function render() {
        if (!this.props.children) {
          return null;
        }
        return __WEBPACK_IMPORTED_MODULE_0_react___default.a.Children.only(this.props.children);
      }
    }]);

    return ThemeProvider;
  }(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component), _class.propTypes = {
    children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.element,
    theme: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({}), __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func]).isRequired
  }, _class.childContextTypes = _defineProperty({}, CHANNEL, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired), _class.contextTypes = _defineProperty({}, CHANNEL, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object), _temp2;
}
/**
 * Provide a theme to an entire react component tree via context
 * and event listeners (have to do both context
 * and event emitter as pure components block context updates)
 */
Provide a theme to an entire react component tree via context
and event listeners (have to do both context
and event emitter as pure components block context updates)
Provide a theme to an entire react component tree via context and event listeners ( have to do both context and event emitter as pure components block context updates )
function createThemeProvider() {
  var _class, _temp2;
  var CHANNEL = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : __WEBPACK_IMPORTED_MODULE_4__channel__["a" ];
  return _temp2 = _class = function (_React$Component) {
    _inherits(ThemeProvider, _React$Component);
    function ThemeProvider() {
      var _ref;
      var _temp, _this, _ret;
      _classCallCheck(this, ThemeProvider);
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }
      return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ThemeProvider.__proto__ || Object.getPrototypeOf(ThemeProvider)).call.apply(_ref, [this].concat(args))), _this), _this.broadcast = Object(__WEBPACK_IMPORTED_MODULE_5_brcast__["default"])(_this.getTheme()), _this.setOuterTheme = function (theme) {
        _this.outerTheme = theme;
      }, _temp), _possibleConstructorReturn(_this, _ret);
    }
    _createClass(ThemeProvider, [{
      key: 'getTheme',
      value: function getTheme(passedTheme) {
        var theme = passedTheme || this.props.theme;
        if (__WEBPACK_IMPORTED_MODULE_2_is_function___default()(theme)) {
          var mergedTheme = theme(this.outerTheme);
          if (!__WEBPACK_IMPORTED_MODULE_3_is_plain_object___default()(mergedTheme)) {
            throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!');
          }
          return mergedTheme;
        }
        if (!__WEBPACK_IMPORTED_MODULE_3_is_plain_object___default()(theme)) {
          throw new Error('[ThemeProvider] Please make your theme prop a plain object');
        }
        if (!this.outerTheme) {
          return theme;
        }
        return _extends({}, this.outerTheme, theme);
      }
    }, {
      key: 'getChildContext',
      value: function getChildContext() {
        return _defineProperty({}, CHANNEL, this.broadcast);
      }
    }, {
      key: 'componentDidMount',
      value: function componentDidMount() {
        if (this.context[CHANNEL]) {
          this.subscriptionId = this.context[CHANNEL].subscribe(this.setOuterTheme);
        }
      }
    }, {
      key: 'componentWillMount',
      value: function componentWillMount() {
        if (this.context[CHANNEL]) {
          this.setOuterTheme(this.context[CHANNEL].getState());
          this.broadcast.setState(this.getTheme());
        }
      }
    }, {
      key: 'componentWillReceiveProps',
      value: function componentWillReceiveProps(nextProps) {
        if (this.props.theme !== nextProps.theme) {
          this.broadcast.setState(this.getTheme(nextProps.theme));
        }
      }
    }, {
      key: 'componentWillUnmount',
      value: function componentWillUnmount() {
        if (this.subscriptionId !== undefined) {
          this.context[CHANNEL].unsubscribe(this.subscriptionId);
          delete this.subscriptionId;
        }
      }
    }, {
      key: 'render',
      value: function render() {
        if (!this.props.children) {
          return null;
        }
        return __WEBPACK_IMPORTED_MODULE_0_react___default.a.Children.only(this.props.children);
      }
    }]);
    return ThemeProvider;
  }(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component), _class.propTypes = {
    children: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.element,
    theme: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({}), __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func]).isRequired
  }, _class.childContextTypes = _defineProperty({}, CHANNEL, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object.isRequired), _class.contextTypes = _defineProperty({}, CHANNEL, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object), _temp2;
}
function createThemeProvider ( ) { var _class , _temp2 ; var CHANNEL = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : __WEBPACK_IMPORTED_MODULE_4__channel__ [ "a" ] ; return _temp2 = _class = function ( _React$Component ) { _inherits ( ThemeProvider , _React$Component ) ; function ThemeProvider ( ) { var _ref ; var _temp , _this , _ret ; _classCallCheck ( this , ThemeProvider ) ; for ( var _len = arguments . length , args = Array ( _len ) , _key = 0 ; _key < _len ; _key ++ ) { args [ _key ] = arguments [ _key ] ; } return _ret = ( _temp = ( _this = _possibleConstructorReturn ( this , ( _ref = ThemeProvider . __proto__ || Object . getPrototypeOf ( ThemeProvider ) ) . call . apply ( _ref , [ this ] . concat ( args ) ) ) , _this ) , _this . broadcast = Object ( __WEBPACK_IMPORTED_MODULE_5_brcast__ [ "default" ] ) ( _this . getTheme ( ) ) , _this . setOuterTheme = function ( theme ) { _this . outerTheme = theme ; } , _temp ) , _possibleConstructorReturn ( _this , _ret ) ; } _createClass ( ThemeProvider , [ { key : 'getTheme' , value : function getTheme ( passedTheme ) { var theme = passedTheme || this . props . theme ; if ( __WEBPACK_IMPORTED_MODULE_2_is_function___default ( ) ( theme ) ) { var mergedTheme = theme ( this . outerTheme ) ; if ( ! __WEBPACK_IMPORTED_MODULE_3_is_plain_object___default ( ) ( mergedTheme ) ) { throw new Error ( '[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!' ) ; } return mergedTheme ; } if ( ! __WEBPACK_IMPORTED_MODULE_3_is_plain_object___default ( ) ( theme ) ) { throw new Error ( '[ThemeProvider] Please make your theme prop a plain object' ) ; } if ( ! this . outerTheme ) { return theme ; } return _extends ( { } , this . outerTheme , theme ) ; } } , { key : 'getChildContext' , value : function getChildContext ( ) { return _defineProperty ( { } , CHANNEL , this . broadcast ) ; } } , { key : 'componentDidMount' , value : function componentDidMount ( ) { if ( this . context [ CHANNEL ] ) { this . subscriptionId = this . context [ CHANNEL ] . subscribe ( this . setOuterTheme ) ; } } } , { key : 'componentWillMount' , value : function componentWillMount ( ) { if ( this . context [ CHANNEL ] ) { this . setOuterTheme ( this . context [ CHANNEL ] . getState ( ) ) ; this . broadcast . setState ( this . getTheme ( ) ) ; } } } , { key : 'componentWillReceiveProps' , value : function componentWillReceiveProps ( nextProps ) { if ( this . props . theme !== nextProps . theme ) { this . broadcast . setState ( this . getTheme ( nextProps . theme ) ) ; } } } , { key : 'componentWillUnmount' , value : function componentWillUnmount ( ) { if ( this . subscriptionId !== undefined ) { this . context [ CHANNEL ] . unsubscribe ( this . subscriptionId ) ; delete this . subscriptionId ; } } } , { key : 'render' , value : function render ( ) { if ( ! this . props . children ) { return null ; } return __WEBPACK_IMPORTED_MODULE_0_react___default . a . Children . only ( this . props . children ) ; } } ] ) ; return ThemeProvider ; } ( __WEBPACK_IMPORTED_MODULE_0_react___default . a . Component ) , _class . propTypes = { children : __WEBPACK_IMPORTED_MODULE_1_prop_types___default . a . element , theme : __WEBPACK_IMPORTED_MODULE_1_prop_types___default . a . oneOfType ( [ __WEBPACK_IMPORTED_MODULE_1_prop_types___default . a . shape ( { } ) , __WEBPACK_IMPORTED_MODULE_1_prop_types___default . a . func ] ) . isRequired } , _class . childContextTypes = _defineProperty ( { } , CHANNEL , __WEBPACK_IMPORTED_MODULE_1_prop_types___default . a . object . isRequired ) , _class . contextTypes = _defineProperty ( { } , CHANNEL , __WEBPACK_IMPORTED_MODULE_1_prop_types___default . a . object ) , _temp2 ; }
Provide a theme to an entire react component tree via context
 and event listeners (have to do both context
 and event emitter as pure components block context updates)
Provide a theme to an entire react component tree via context and event listeners ( have to do both context and event emitter as pure components block context updates )
/* default */ // Get the theme from the props, supporting both (outerTheme) => {} as well as object notation // create a new subscription for keeping track of outer theme, if present // set broadcast state by merging outer theme with own