"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const tslib_es6 = require("../../../../../tslib@2.8.0/node_modules/tslib/tslib.es6.cjs");
const React = require("react");
const constants = require("../../../../../react-remove-scroll-bar@2.3.6_@types_react@18.3.18_react@18.3.1/node_modules/react-remove-scroll-bar/dist/es2015/constants.cjs");
const medium = require("./medium.cjs");
const useMergeRef = require("../../../../../use-callback-ref@1.3.2_@types_react@18.3.18_react@18.3.1/node_modules/use-callback-ref/dist/es2015/useMergeRef.cjs");
function _interopNamespaceDefault(e) {
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
  if (e) {
    for (const k in e) {
      if (k !== "default") {
        const d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: () => e[k]
        });
      }
    }
  }
  n.default = e;
  return Object.freeze(n);
}
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
var nothing = function() {
  return;
};
var RemoveScroll = React__namespace.forwardRef(function(props, parentRef) {
  var ref = React__namespace.useRef(null);
  var _a = React__namespace.useState({
    onScrollCapture: nothing,
    onWheelCapture: nothing,
    onTouchMoveCapture: nothing
  }), callbacks = _a[0], setCallbacks = _a[1];
  var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? "div" : _b, gapMode = props.gapMode, rest = tslib_es6.__rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
  var SideCar = sideCar;
  var containerRef = useMergeRef.useMergeRefs([ref, parentRef]);
  var containerProps = tslib_es6.__assign(tslib_es6.__assign({}, rest), callbacks);
  return React__namespace.createElement(
    React__namespace.Fragment,
    null,
    enabled && React__namespace.createElement(SideCar, { sideCar: medium.effectCar, removeScrollBar, shards, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
    forwardProps ? React__namespace.cloneElement(React__namespace.Children.only(children), tslib_es6.__assign(tslib_es6.__assign({}, containerProps), { ref: containerRef })) : React__namespace.createElement(Container, tslib_es6.__assign({}, containerProps, { className, ref: containerRef }), children)
  );
});
RemoveScroll.defaultProps = {
  enabled: true,
  removeScrollBar: true,
  inert: false
};
RemoveScroll.classNames = {
  fullWidth: constants.fullWidthClassName,
  zeroRight: constants.zeroRightClassName
};
exports.RemoveScroll = RemoveScroll;
