"use client";
'use strict';

var _2RSXSRCN = require('./2RSXSRCN.cjs');
var LMDWO4NN = require('./LMDWO4NN.cjs');
var ABQUS43J = require('./ABQUS43J.cjs');
var _3YLGPPWQ = require('./3YLGPPWQ.cjs');
var DTR5TSDJ = require('../../../../../../@ariakit_core@0.4.15/node_modules/@ariakit/core/esm/__chunks/DTR5TSDJ.cjs');
var React = require('react');

var TagName = "button";
var useButton = LMDWO4NN.createHook(
  function useButton2(props) {
    const ref = React.useRef(null);
    const tagName = ABQUS43J.useTagName(ref, TagName);
    const [isNativeButton, setIsNativeButton] = React.useState(
      () => !!tagName && DTR5TSDJ.isButton({ tagName, type: props.type })
    );
    React.useEffect(() => {
      if (!ref.current) return;
      setIsNativeButton(DTR5TSDJ.isButton(ref.current));
    }, []);
    props = _3YLGPPWQ.__spreadProps(_3YLGPPWQ.__spreadValues({
      role: !isNativeButton && tagName !== "a" ? "button" : void 0
    }, props), {
      ref: ABQUS43J.useMergeRefs(ref, props.ref)
    });
    props = _2RSXSRCN.useCommand(props);
    return props;
  }
);
LMDWO4NN.forwardRef(function Button2(props) {
  const htmlProps = useButton(props);
  return LMDWO4NN.createElement(TagName, htmlProps);
});

exports.useButton = useButton;
//# sourceMappingURL=PCKO3OQ5.cjs.map
