'use strict';

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

var vue = require('vue');
var index = require('../../_util/props-util/index.js');
var classNames = require('../../_util/classNames.js');
var _interface = require('./interface.js');

var MobilePopupInner = /* @__PURE__ */ vue.defineComponent({
  compatConfig: {
    MODE: 3
  },
  name: "MobilePopupInner",
  inheritAttrs: false,
  props: _interface.mobileProps,
  emits: ["mouseenter", "mouseleave", "mousedown", "touchstart", "align"],
  setup(props, {
    expose,
    slots
  }) {
    const elementRef = vue.ref();
    expose({
      forceAlign: () => {
      },
      getElement: () => elementRef.value
    });
    return () => {
      var _a;
      const {
        zIndex,
        visible,
        prefixCls,
        mobile: {
          popupClassName,
          popupStyle,
          popupMotion = {},
          popupRender
        } = {}
      } = props;
      const mergedStyle = {
        zIndex,
        ...popupStyle
      };
      let childNode = index.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 = classNames.default(prefixCls, popupClassName);
      return vue.createVNode(vue.Transition, vue.mergeProps({
        "ref": elementRef
      }, popupMotion), {
        default: () => [visible ? vue.createVNode("div", {
          "class": mergedClassName,
          "style": mergedStyle
        }, [childNode]) : null]
      });
    };
  }
});

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