import C from "../../@babel/runtime/helpers/esm/extends.mjs";
import u from "../../@babel/runtime/helpers/esm/objectSpread2.mjs";
import K from "../../@babel/runtime/helpers/esm/objectWithoutProperties.mjs";
import * as r from "react";
import P from "../../classnames/index.mjs";
import W from "../../rc-resize-observer/es/index.mjs";
var j = ["prefixCls", "invalidate", "item", "renderItem", "responsive", "responsiveDisabled", "registerSize", "itemKey", "className", "style", "children", "display", "order", "component"], t = void 0;
function F(e, y) {
  var h = e.prefixCls, o = e.invalidate, s = e.item, d = e.renderItem, n = e.responsive, N = e.responsiveDisabled, b = e.registerSize, I = e.itemKey, z = e.className, R = e.style, g = e.children, x = e.display, E = e.order, l = e.component, S = l === void 0 ? "div" : l, p = K(e, j), i = n && !x;
  function m(c) {
    b(I, c);
  }
  r.useEffect(function() {
    return function() {
      m(null);
    };
  }, []);
  var D = d && s !== t ? d(s) : g, f;
  o || (f = {
    opacity: i ? 0 : 1,
    height: i ? 0 : t,
    overflowY: i ? "hidden" : t,
    order: n ? E : t,
    pointerEvents: i ? "none" : t,
    position: i ? "absolute" : t
  });
  var v = {};
  i && (v["aria-hidden"] = !0);
  var a = /* @__PURE__ */ r.createElement(S, C({
    className: P(!o && h, z),
    style: u(u({}, f), R)
  }, v, p, {
    ref: y
  }), D);
  return n && (a = /* @__PURE__ */ r.createElement(W, {
    onResize: function(_) {
      var w = _.offsetWidth;
      m(w);
    },
    disabled: N
  }, a)), a;
}
var H = /* @__PURE__ */ r.forwardRef(F);
H.displayName = "Item";
export {
  H as default
};
