text: 'use strict';
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.init = init;
  exports.setOptions = setOptions;
  
  var _addons = require('@storybook/addons');
  
  var _addons2 = _interopRequireDefault(_addons);
  
  var _shared = require('../shared');
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  // init function will be executed once when the storybook loads for the
  // first time. This is a good place to add global listeners on channel.
  function init() {}
  // NOTE nothing to do here
  
  
  // setOptions function will send Storybook UI options when the channel is
  // ready. If called before, options will be cached until it can be sent.
  function setOptions(options) {
    var channel = _addons2.default.getChannel();
    if (!channel) {
      throw new Error('Failed to find addon channel. This may be due to https://github.com/storybooks/storybook/issues/1192.');
    }
    channel.emit(_shared.EVENT_ID, { options: options });
  }