import { parse } from "qs"
import { getIsIMPAKTProductMode } from "@/redux/config/configSelector";
export const generateUrlParams = (rootState) => {
  const href = window.location.href
  const query = href.split("?")[1]
  const queryArray = parse(query)
  let appURL = href
  if (getIsIMPAKTProductMode(rootState)) {
    appURL = window.location.origin + window.location.pathname
  }
  return {
    query: queryArray,
    url: href,
    appURL,
  }
}
