"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const vue = require("vue");
const OLoading_vue_vue_type_script_setup_true_lang = require("./OLoading.vue.js");
let vLoadingOption = {};
const setVLoadingOption = (option) => {
  vLoadingOption = option;
};
const vLoading = {
  mounted(el, binding) {
    const vnode = vue.h(
      OLoading_vue_vue_type_script_setup_true_lang,
      Object.assign(vLoadingOption, {
        visible: binding.value,
        wrapper: binding.modifiers.body ? "body" : null,
        mask: !binding.modifiers.nomask
      })
    );
    if (binding.modifiers.body) {
      vue.render(vnode, document.body);
    } else {
      vue.render(vnode, el);
    }
    const vm = vnode.component;
    el.__loading_data = {
      instance: vm
    };
  },
  updated(el, binding) {
    if (binding.value !== binding.oldValue) {
      const data = el.__loading_data;
      if (data) {
        data.instance.exposed.toggle(!!binding.value);
      }
    }
  }
};
exports.setVLoadingOption = setVLoadingOption;
exports.vLoading = vLoading;
