import { uuid as r } from "../../../utils/random/uuid.js";
import { parseDate as a } from "../../../utils/datetime/main.js";
function s(t) {
  const n = Array.from(t, (e) => String.fromCodePoint(e)).join("");
  return btoa(n);
}
const d = (t) => {
  try {
    const n = JSON.stringify(t), e = s(new TextEncoder().encode(n)), o = new URLSearchParams();
    return o.set("data", e), o;
  } catch {
    return null;
  }
}, m = () => r(), f = (t) => {
  const n = a(t) ?? Date.now();
  return Math.floor(n / 1e3);
};
export {
  s as bytesToBase64,
  d as encodeAnalyticsEvent,
  m as getEventInsertId,
  f as getEventTime
};
