"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.toastEventBus = exports.createToastService = exports.ToastPlugin = void 0;
var _utils = require("@grozav/utils");
var _inkline = require("@inkline/inkline");
const toastEventBus = (0, _utils.createEventBus)();
exports.toastEventBus = toastEventBus;
const createToastService = () => ({
  show: options => {
    toastEventBus.emit("show", options);
  },
  hide: options => {
    toastEventBus.emit("hide", options);
  },
  hideAll: () => {
    toastEventBus.emit("hideAll", {});
  }
});
exports.createToastService = createToastService;
const ToastPlugin = {
  install: app => {
    const toastService = createToastService();
    app.config.globalProperties.$toast = toastService;
    app.provide(_inkline.InklineToastKey, toastService);
  }
};
exports.ToastPlugin = ToastPlugin;