import { __rest as k, __assign as a } from "../../node_modules/tslib/tslib.es6.js";
import * as r from "react";
import { fullWidthClassName as E, zeroRightClassName as I } from "../../../react-remove-scroll-bar/dist/es2015/constants.js";
import { effectCar as Z } from "./medium.js";
import { useMergeRefs as W } from "../../../use-callback-ref/dist/es2015/useMergeRef.js";
var l = function() {
}, m = r.forwardRef(function(e, d) {
  var o = r.useRef(null), n = r.useState({
    onScrollCapture: l,
    onWheelCapture: l,
    onTouchMoveCapture: l
  }), f = n[0], h = n[1], u = e.forwardProps, t = e.children, v = e.className, C = e.removeScrollBar, P = e.enabled, R = e.shards, S = e.sideCar, b = e.noIsolation, w = e.inert, N = e.allowPinchZoom, s = e.as, g = s === void 0 ? "div" : s, _ = k(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]), B = S, i = W([o, d]), c = a(a({}, _), f);
  return r.createElement(
    r.Fragment,
    null,
    P && r.createElement(B, { sideCar: Z, removeScrollBar: C, shards: R, noIsolation: b, inert: w, setCallbacks: h, allowPinchZoom: !!N, lockRef: o }),
    u ? r.cloneElement(r.Children.only(t), a(a({}, c), { ref: i })) : r.createElement(g, a({}, c, { className: v, ref: i }), t)
  );
});
m.defaultProps = {
  enabled: !0,
  removeScrollBar: !0,
  inert: !1
};
m.classNames = {
  fullWidth: E,
  zeroRight: I
};
export {
  m as RemoveScroll
};
