"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports.default = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _create = _interopRequireDefault(require("../utils/create"));

var _popup = _interopRequireDefault(require("../mixins/popup"));

var _popup2 = _interopRequireDefault(require("../popup"));

// Mixins
// Components
var _default = (0, _create.default)({
  render: function render() {
    var _vm = this;

    var _h = _vm.$createElement;

    var _c = _vm._self._c || _h;

    return _c('Popup', {
      class: [_vm.b([_vm.type]), _vm.className],
      style: _vm.style,
      attrs: {
        "value": _vm.value,
        "position": "top",
        "overlay": false,
        "duration": _vm.duration,
        "lockScroll": false
      },
      on: {
        "open": function open($event) {
          return _vm.onOpen('open');
        },
        "opened": function opened($event) {
          return _vm.onOpen('opened');
        },
        "close": function close($event) {
          return _vm.onOpen('close');
        }
      }
    }, [_vm._t("default", [_vm._v("\n    " + _vm._s(_vm.message) + "\n  ")])], 2);
  },
  components: {
    Popup: _popup2.default
  },
  name: "notify",
  props: (0, _extends2.default)({}, _popup.default.props, {
    color: String,
    message: [Number, String],
    duration: [Number, String],
    className: String,
    background: String,
    getContainer: [String, Function],
    type: {
      type: String,
      default: "danger"
    }
  }),
  methods: {
    onOpen: function onOpen(name) {
      this.$emit(name);
    }
  },
  computed: {
    style: function style() {
      return {
        color: this.color,
        background: this.background
      };
    }
  }
});

exports.default = _default;