'use strict';

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

var vue = require('vue');
require('../../../../utils/index.cjs');
var _interface = require('./interface.cjs');
var props = require('../../../../utils/vue/props.cjs');
var _class = require('../../../../utils/dom/class.cjs');

var MobilePopupInner = /* @__PURE__ */ vue.defineComponent({
  compatConfig: {
    MODE: 3
  },
  name: "MobilePopupInner",
  inheritAttrs: false,
  props: _interface.mobileProps,
  emits: ["mouseenter", "mouseleave", "mousedown", "touchstart", "align"],
  setup(props$1, {
    expose,
    slots
  }) {
    const elementRef = vue.ref();
    expose({
      forceAlign: () => {
      },
      getElement: () => elementRef.value
    });
    return () => {
      var _a;
      const {
        zIndex,
        visible,
        prefixCls,
        mobile: {
          popupClassName,
          popupStyle,
          popupMotion = {},
          popupRender
        } = {}
      } = props$1;
      const mergedStyle = {
        zIndex,
        ...popupStyle
      };
      let childNode = props.flattenChildren((_a = slots.default) == null ? void 0 : _a.call(slots));
      if (childNode.length > 1) {
        const _childNode = function() {
          return childNode;
        }();
        childNode = vue.createVNode("div", {
          "class": `${prefixCls}-content`
        }, [childNode]);
      }
      if (popupRender)
        childNode = popupRender(childNode);
      const mergedClassName = _class.classNames(prefixCls, popupClassName);
      return vue.createVNode(vue.Transition, {
        "ref": elementRef,
        ...popupMotion
      }, {
        default: () => [visible ? vue.createVNode("div", {
          "class": mergedClassName,
          "style": mergedStyle
        }, [childNode]) : null]
      });
    };
  }
});

exports.default = MobilePopupInner;
//# sourceMappingURL=MobilePopupInner.cjs.map
