'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-140bcbcd.js');
require('./Token-8c5ba5d9.js');
const Message = require('./Message-f462d297.js');
const Trigger = require('./Trigger-a1c9ba71.js');

const styleCss = ".sc-smoothly-trigger-source-h{display:block}[hidden].sc-smoothly-trigger-source-h{display:none}";

const SmoothlyTriggerSource = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.trigger = index.createEvent(this, "trigger", 7);
    this.message = index.createEvent(this, "message", 7);
  }
  componentDidLoad() {
    Message.Message.listen(this.listen, (destination, content) => {
      if (Trigger.Trigger.is(content))
        this.trigger.emit(content);
      else
        this.message.emit({ destination, content });
    }, window);
  }
  render() {
    return index.h("slot", null);
  }
  get element() { return index.getElement(this); }
};
SmoothlyTriggerSource.style = styleCss;

exports.smoothly_trigger_source = SmoothlyTriggerSource;
