"use client";
'use strict';

var ABQUS43J = require('./ABQUS43J.cjs');
var SK3NAZA3 = require('./SK3NAZA3.cjs');
var _3YLGPPWQ = require('./3YLGPPWQ.cjs');
var React = require('react');
var jsxRuntime = require('react/jsx-runtime');

function _interopNamespaceDefault(e) {
  var n = Object.create(null);
  if (e) {
    Object.keys(e).forEach(function (k) {
      if (k !== 'default') {
        var d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: function () { return e[k]; }
        });
      }
    });
  }
  n.default = e;
  return Object.freeze(n);
}

var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);

function forwardRef2(render) {
  const Role = React__namespace.forwardRef((props, ref) => render(_3YLGPPWQ.__spreadProps(_3YLGPPWQ.__spreadValues({}, props), { ref })));
  Role.displayName = render.displayName || render.name;
  return Role;
}
function memo2(Component, propsAreEqual) {
  return React__namespace.memo(Component, propsAreEqual);
}
function createElement(Type, props) {
  const _a = props, { wrapElement, render } = _a, rest = _3YLGPPWQ.__objRest(_a, ["wrapElement", "render"]);
  const mergedRef = ABQUS43J.useMergeRefs(props.ref, SK3NAZA3.getRefProperty(render));
  let element;
  if (React__namespace.isValidElement(render)) {
    const renderProps = _3YLGPPWQ.__spreadProps(_3YLGPPWQ.__spreadValues({}, render.props), { ref: mergedRef });
    element = React__namespace.cloneElement(render, SK3NAZA3.mergeProps(rest, renderProps));
  } else if (render) {
    element = render(rest);
  } else {
    element = /* @__PURE__ */ jsxRuntime.jsx(Type, _3YLGPPWQ.__spreadValues({}, rest));
  }
  if (wrapElement) {
    return wrapElement(element);
  }
  return element;
}
function createHook(useProps) {
  const useRole = (props = {}) => {
    return useProps(props);
  };
  useRole.displayName = useProps.name;
  return useRole;
}
function createStoreContext(providers = [], scopedProviders = []) {
  const context = React__namespace.createContext(void 0);
  const scopedContext = React__namespace.createContext(void 0);
  const useContext2 = () => React__namespace.useContext(context);
  const useScopedContext = (onlyScoped = false) => {
    const scoped = React__namespace.useContext(scopedContext);
    const store = useContext2();
    if (onlyScoped) return scoped;
    return scoped || store;
  };
  const useProviderContext = () => {
    const scoped = React__namespace.useContext(scopedContext);
    const store = useContext2();
    if (scoped && scoped === store) return;
    return store;
  };
  const ContextProvider = (props) => {
    return providers.reduceRight(
      (children, Provider) => /* @__PURE__ */ jsxRuntime.jsx(Provider, _3YLGPPWQ.__spreadProps(_3YLGPPWQ.__spreadValues({}, props), { children })),
      /* @__PURE__ */ jsxRuntime.jsx(context.Provider, _3YLGPPWQ.__spreadValues({}, props))
    );
  };
  const ScopedContextProvider = (props) => {
    return /* @__PURE__ */ jsxRuntime.jsx(ContextProvider, _3YLGPPWQ.__spreadProps(_3YLGPPWQ.__spreadValues({}, props), { children: scopedProviders.reduceRight(
      (children, Provider) => /* @__PURE__ */ jsxRuntime.jsx(Provider, _3YLGPPWQ.__spreadProps(_3YLGPPWQ.__spreadValues({}, props), { children })),
      /* @__PURE__ */ jsxRuntime.jsx(scopedContext.Provider, _3YLGPPWQ.__spreadValues({}, props))
    ) }));
  };
  return {
    context,
    scopedContext,
    useContext: useContext2,
    useScopedContext,
    useProviderContext,
    ContextProvider,
    ScopedContextProvider
  };
}

exports.createElement = createElement;
exports.createHook = createHook;
exports.createStoreContext = createStoreContext;
exports.forwardRef = forwardRef2;
exports.memo = memo2;
//# sourceMappingURL=LMDWO4NN.cjs.map
