"use strict";
const uni_modules_tdesignUniapp_components_common_src_instantiationDecorator = require("../common/src/instantiationDecorator.js");
const uni_modules_tdesignUniapp_components_common_config = require("../common/config.js");
const uni_modules_tdesignUniapp_components_overlay_props = require("./props.js");
const uni_modules_tdesignUniapp_components_mixins_transition = require("../mixins/transition.js");
const uni_modules_tdesignUniapp_components_mixins_usingCustomNavbar = require("../mixins/using-custom-navbar.js");
const uni_modules_tdesignUniapp_components_common_utils_wxs = require("../common/utils.wxs.js");
const common_vendor = require("../../../../common/vendor.js");
const name = `${uni_modules_tdesignUniapp_components_common_config.prefix}-overlay`;
const _sfc_main = uni_modules_tdesignUniapp_components_common_src_instantiationDecorator.uniComponent({
  name,
  options: {
    styleIsolation: "shared"
  },
  mixins: [
    uni_modules_tdesignUniapp_components_mixins_transition.transition(),
    uni_modules_tdesignUniapp_components_mixins_usingCustomNavbar.useCustomNavbarBehavior
  ],
  props: {
    ...uni_modules_tdesignUniapp_components_overlay_props.props
  },
  emits: [
    "click",
    "leaved"
  ],
  data() {
    return {
      prefix: uni_modules_tdesignUniapp_components_common_config.prefix,
      classPrefix: name,
      computedStyle: "",
      _zIndex: 11e3,
      tools: uni_modules_tdesignUniapp_components_common_utils_wxs.tools
    };
  },
  watch: {
    backgroundColor: {
      handler(v) {
        this.computedStyle = v ? `background-color: ${v};` : "";
      },
      immediate: true
    },
    zIndex: {
      handler(v) {
        if (v !== 0) {
          this._zIndex = v;
        }
      },
      immediate: true
    }
  },
  methods: {
    handleClick() {
      this.$emit("click", {
        visible: !this.visible
      });
    },
    noop() {
    }
  }
});
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  return common_vendor.e({
    a: _ctx.realVisible && _ctx.preventScrollThrough
  }, _ctx.realVisible && _ctx.preventScrollThrough ? {
    b: common_vendor.n(_ctx.prefix + "-overlay " + _ctx.transitionClass),
    c: common_vendor.s(_ctx.tools._style(["--td-overlay-transition-duration:" + _ctx.duration + "ms", "z-index:" + _ctx._zIndex, "top:" + _ctx.distanceTop + "px", _ctx.computedStyle, _ctx.customStyle])),
    d: _ctx.ariaRole || "button",
    e: _ctx.ariaLabel || "关闭",
    f: common_vendor.o((...args) => _ctx.handleClick && _ctx.handleClick(...args)),
    g: common_vendor.o((...args) => _ctx.noop && _ctx.noop(...args)),
    h: common_vendor.o((...args) => _ctx.onTransitionEnd && _ctx.onTransitionEnd(...args))
  } : _ctx.realVisible ? {
    j: common_vendor.n(_ctx.prefix + "-overlay " + _ctx.transitionClass),
    k: common_vendor.s(_ctx.tools._style(["z-index:" + _ctx._zIndex, "top:" + _ctx.distanceTop + "px", _ctx.computedStyle, _ctx.customStyle])),
    l: _ctx.ariaRole || "button",
    m: _ctx.ariaLabel || "关闭",
    n: common_vendor.o((...args) => _ctx.handleClick && _ctx.handleClick(...args)),
    o: common_vendor.o((...args) => _ctx.onTransitionEnd && _ctx.onTransitionEnd(...args))
  } : {}, {
    i: _ctx.realVisible
  });
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-8997f975"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/tdesign-uniapp/components/overlay/overlay.js.map
