function maskToken(token) {
  if (!token) {
    return "";
  }
  if (token.length < 8) {
    return "••••";
  }
  if (token.length <= 10) {
    return `${token.slice(0, 2)}…${token.slice(-2)}`;
  }
  return `${token.slice(0, 6)}…${token.slice(-4)}`;
}
function toDeviceListItem(record) {
  return {
    appEnv: record.appEnv,
    deviceId: record.deviceId,
    failureCount: record.failureCount,
    friendlyName: record.friendlyName,
    id: record.id,
    isActive: record.isActive,
    lastSeenAt: record.lastSeenAt,
    platform: record.platform,
    registeredAt: record.registeredAt,
    tokenMasked: maskToken(record.token)
  };
}

export { maskToken as m, toDeviceListItem as t };
//# sourceMappingURL=device-format-DTgEz4Yr.js.map
