const cleanupData = (data) => {
  const cleanedData = {};
  Object.entries(data).forEach(([key, value]) => {
    cleanedData[key] = value === void 0 || value === null ? "" : value;
  });
  return cleanedData;
};
const logRocket = {
  error: (msg) => {
    if (!msg) return;
    const { message, ...rest } = msg ?? {};
    if (!message) return;
    window.emui?.logRocket?.captureMessage?.(message, {
      extra: rest
    });
  },
  audit: (msg) => {
    const {
      message,
      host,
      environment,
      appName,
      appVersion,
      team,
      location,
      correlationId,
      instanceId,
      customerId,
      userId,
      loanId,
      resourceType,
      resourceId
    } = msg ?? {};
    window.emui?.logRocket?.track?.(
      message,
      cleanupData({
        host,
        environment,
        appName,
        appVersion,
        team,
        location,
        correlationId,
        instanceId,
        customerId,
        userId,
        loanId,
        resourceId,
        resourceType
      })
    );
  }
};
export {
  logRocket
};
