"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/hooks/useQueryParams.tsx
var _react = require('react');
var _reactrouterdom = require('react-router-dom');
function useQueryParams() {
  const { search } = _reactrouterdom.useLocation.call(void 0, );
  return _react.useMemo.call(void 0, () => new URLSearchParams(search), [search]);
}
function useQueryParamBoolean(param) {
  const queryParams = useQueryParams();
  return _react.useMemo.call(void 0, () => queryParams.get(param) === "1", [queryParams, param]);
}
function useQueryParamBooleans(params) {
  const queryParams = useQueryParams();
  const prevParams = _react.useRef.call(void 0, params);
  const memoizedParams = _react.useMemo.call(void 0, () => {
    if (JSON.stringify(params) !== JSON.stringify(prevParams.current)) {
      prevParams.current = params;
    }
    return prevParams.current;
  }, [params]);
  const value = _react.useMemo.call(void 0, () => {
    const result = {};
    for (const key in memoizedParams) {
      const param = memoizedParams[key];
      const value2 = queryParams.get(param);
      if (value2 === "1" || value2 === "true") {
        result[key] = true;
      } else if (value2 === "0" || value2 === "false") {
        result[key] = false;
      } else if (value2 === "") {
        result[key] = true;
      } else {
        result[key] = void 0;
      }
    }
    return result;
  }, [queryParams, memoizedParams]);
  return value;
}





exports.useQueryParams = useQueryParams; exports.useQueryParamBoolean = useQueryParamBoolean; exports.useQueryParamBooleans = useQueryParamBooleans;
