Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
feat: add multiple brands
Marc Seitz9b8f3c030201
diff --git a/app/api/views-dataroom/route.ts b/app/api/views-dataroom/route.tsindex b4e2dfef..dcfb6f04 100644--- a/app/api/views-dataroom/route.ts+++ b/app/api/views-dataroom/route.ts@@ -170,6 +170,7 @@ export async function POST(request: NextRequest) {allowDownload: true,enableConversation: true,teamId: true,+ brandId: true,team: {select: {plan: true,@@ -191,6 +192,7 @@ export async function POST(request: NextRequest) {agentsEnabled: true,isFrozen: true,name: true,+ brandId: true,},},visitorGroups: {@@ -584,6 +586,10 @@ export async function POST(request: NextRequest) {otpCode,true,link.teamId!,+ {+ linkBrandId: link.brandId,+ dataroomBrandId: link.dataroom?.brandId,+ },),);return NextResponse.json(diff --git a/app/api/views/route.ts b/app/api/views/route.tsindex 172125fc..9bef3363 100644--- a/app/api/views/route.ts+++ b/app/api/views/route.ts@@ -138,6 +138,7 @@ export async function POST(request: NextRequest) {enableWatermark: true,watermarkConfig: true,teamId: true,+ brandId: true,team: {select: {plan: true,@@ -490,6 +491,7 @@ export async function POST(request: NextRequest) {otpCode,false,link.teamId!,+ { linkBrandId: link.brandId },),);return NextResponse.json({diff --git a/components/links/link-sheet/brand-section.tsx b/components/links/link-sheet/brand-section.tsxnew file mode 100644index 00000000..9d206079--- /dev/null+++ b/components/links/link-sheet/brand-section.tsx@@ -0,0 +1,172 @@+import {+ CUSTOM_DATAROOM_BRAND,+ CUSTOM_DATAROOM_BRAND_LABEL,+} from "@/ee/features/branding/lib/resolve-dataroom-displayed-brand";+import { LinkType } from "@prisma/client";++import { useBrands, useDataroomBrand } from "@/lib/swr/use-brand";++import { Label } from "@/components/ui/label";+import {+ Select,+ SelectContent,+ SelectGroup,+ SelectItem,+ SelectLabel,+ SelectSeparator,+ SelectTrigger,+ SelectValue,+} from "@/components/ui/select";++import { DEFAULT_LINK_TYPE } from ".";++const INHERIT_TEAM_DEFAULT = "inherit-team-default";++function BrandOptionLabel({+ title,+ subtitle,+}: {+ title: string;+ subtitle: string;+}) {+ return (+ <span className="flex min-w-0 items-center gap-2 overflow-hidden">+ <span className="truncate">{title}</span>+ <span className="min-w-0 truncate text-xs font-normal text-muted-foreground">+ {subtitle}+ </span>+ </span>+ );+}++export function BrandSection({+ data,+ setData,+ linkType,+ dataroomId,+}: {+ data: DEFAULT_LINK_TYPE;+ setData: React.Dispatch<React.SetStateAction<DEFAULT_LINK_TYPE>>;+ linkType: Omit<LinkType, "WORKFLOW_LINK">;+ dataroomId?: string;+}) {+ const { brands, defaultBrandId } = useBrands();+ const isDataroomLink = linkType === "DATAROOM_LINK" || Boolean(dataroomId);+ const {+ dataroomBrandId: fetchedDataroomBrandId,+ loading: dataroomBrandLoading,+ } = useDataroomBrand({+ dataroomId: isDataroomLink ? dataroomId : undefined,+ });++ if (brands.length === 0) {+ return null;+ }+ if (!isDataroomLink && brands.length <= 1) {+ return null;+ }++ const teamDefaultId = defaultBrandId ?? brands[0]?.id ?? null;+ const defaultTeamBrandName =+ brands.find((brand) => brand.id === teamDefaultId)?.name ?? "Default";+ const dataroomTeamBrandId = dataroomBrandLoading+ ? data.dataroomBrandId+ : fetchedDataroomBrandId !== undefined+ ? fetchedDataroomBrandId+ : data.dataroomBrandId;+ const currentDataroomBrandName =+ typeof dataroomTeamBrandId === "string" && dataroomTeamBrandId.length > 0+ ? (brands.find((brand) => brand.id === dataroomTeamBrandId)?.name ??+ CUSTOM_DATAROOM_BRAND_LABEL)+ : CUSTOM_DATAROOM_BRAND_LABEL;++ const selectedValue = (() => {+ if (data.brandId == null) {+ return isDataroomLink ? CUSTOM_DATAROOM_BRAND : INHERIT_TEAM_DEFAULT;+ }+ if (isDataroomLink && data.brandId === teamDefaultId) {+ return INHERIT_TEAM_DEFAULT;+ }+ return data.brandId;+ })();++ return (+ <div className="pb-3">+ <div className="flex items-center justify-between gap-x-2">+ <Label+ htmlFor="link-team-brand"+ className="text-sm font-medium leading-6"+ >+ Link brand+ </Label>+ <Select+ value={selectedValue}+ onValueChange={(value) => {+ if (value === CUSTOM_DATAROOM_BRAND) {+ setData({ ...data, brandId: null });+ return;+ }+ if (value === INHERIT_TEAM_DEFAULT) {+ setData({+ ...data,+ brandId: isDataroomLink ? teamDefaultId : null,+ });+ return;+ }+ setData({ ...data, brandId: value });+ }}+ >+ <SelectTrigger+ id="link-team-brand"+ className="w-64 [&>span]:min-w-0 [&>span]:truncate"+ >+ <SelectValue placeholder="Inherit team default" />+ </SelectTrigger>+ <SelectContent align="end">+ {isDataroomLink ? (+ <>+ <SelectItem value={CUSTOM_DATAROOM_BRAND}>+ <BrandOptionLabel+ title="Dataroom brand"+ subtitle={currentDataroomBrandName}+ />+ </SelectItem>+ <SelectSeparator />+ <SelectGroup>+ <SelectLabel className="text-xs font-normal text-muted-foreground">+ Team brands+ </SelectLabel>+ <SelectItem value={INHERIT_TEAM_DEFAULT}>+ <BrandOptionLabel+ title={defaultTeamBrandName}+ subtitle="Team default"+ />+ </SelectItem>+ {brands.map((brand) => (+ <SelectItem key={brand.id} value={brand.id}>+ <span className="block truncate">{brand.name}</span>+ </SelectItem>+ ))}+ </SelectGroup>+ </>+ ) : (+ <>+ <SelectItem value={INHERIT_TEAM_DEFAULT}>+ <BrandOptionLabel+ title="Inherit team default"+ subtitle={defaultTeamBrandName}+ />+ </SelectItem>+ {brands.map((brand) => (+ <SelectItem key={brand.id} value={brand.id} className="pr-16">+ <span className="block truncate">{brand.name}</span>+ </SelectItem>+ ))}+ </>+ )}+ </SelectContent>+ </Select>+ </div>+ </div>+ );+}diff --git a/components/links/link-sheet/index.tsx b/components/links/link-sheet/index.tsxindex d45b977f..13464085 100644--- a/components/links/link-sheet/index.tsx+++ b/components/links/link-sheet/index.tsx@@ -85,6 +85,8 @@ export const DEFAULT_LINK_PROPS = (metaImage: null,metaFavicon: null,welcomeMessage: null,+ brandId: null,+ dataroomBrandId: null,enableQuestion: false,questionText: null,questionType: null,@@ -131,6 +133,8 @@ export type DEFAULT_LINK_TYPE = {metaImage: string | null; // metatagsmetaFavicon: string | null; // metaFaviconwelcomeMessage: string | null; // custom welcome message+ brandId: string | null;+ dataroomBrandId: string | null;enableQuestion?: boolean; // feedback questionquestionText: string | null;questionType: string | null;diff --git a/components/links/link-sheet/link-options.tsx b/components/links/link-sheet/link-options.tsxindex 017e398b..ea471991 100644--- a/components/links/link-sheet/link-options.tsx+++ b/components/links/link-sheet/link-options.tsx@@ -35,6 +35,7 @@ import { Separator } from "@/components/ui/separator";import AgreementSection from "./agreement-section";import AIAgentsSection from "./ai-agents-section";+import { BrandSection } from "./brand-section";import ConversationSection from "./conversation-section";import CustomFieldsSection from "./custom-fields-section";import IndexFileSection from "./index-file-section";@@ -318,8 +319,17 @@ export const LinkOptions = ({)}{/* Custom Branding Section */}- <CollapsibleSection title="Custom branding" defaultOpen={defaultExpandSections}>+ <CollapsibleSection+ title="Custom branding"+ defaultOpen={defaultExpandSections}+ ><div>+ <BrandSection+ data={data}+ setData={setData}+ linkType={linkType}+ dataroomId={linkType === "DATAROOM_LINK" ? targetId : undefined}+ /><CustomFieldsSection{...{ data, setData }}isAllowed={diff --git a/components/links/links-table.tsx b/components/links/links-table.tsxindex f998390b..153ceba0 100644--- a/components/links/links-table.tsx+++ b/components/links/links-table.tsx@@ -24,6 +24,7 @@ import {FileSlidersIcon,FileSpreadsheetIcon,LinkIcon,+ RefreshCwIcon,SendIcon,Settings2Icon,Square,@@ -37,9 +38,9 @@ import { toast } from "sonner";import { mutate } from "swr";import { useFeatureFlags } from "@/lib/hooks/use-feature-flags";+import { buildLinkFormData } from "@/lib/links/build-link-form-data";import { usePlan } from "@/lib/swr/use-billing";import useLimits from "@/lib/swr/use-limits";-import { buildLinkFormData } from "@/lib/links/build-link-form-data";import { LinkWithViews, WatermarkConfig } from "@/lib/types";import { cn, copyToClipboard, nFormatter, timeAgo } from "@/lib/utils";import { useMediaQuery } from "@/lib/utils/use-media-query";@@ -84,7 +85,6 @@ import { Label } from "../ui/label";import { ButtonTooltip } from "../ui/tooltip";import { useDeleteLinkModal } from "./delete-link-modal";import EmbedCodeModal from "./embed-code-modal";-import { useTransferLinkModal } from "./transfer-link-modal";import LinkActiveControls, {countActiveSettings,} from "./link-active-controls";@@ -95,6 +95,7 @@ import LinkSheet, {import { DataroomLinkSheet } from "./link-sheet/dataroom-link-sheet";import { TagColumn } from "./link-sheet/tags/tag-details";import LinksVisitors from "./links-visitors";+import { useTransferLinkModal } from "./transfer-link-modal";const BulkImportLinksModal = dynamic(() =>@@ -521,6 +522,37 @@ export default function LinksTable({setIsInviteModalOpen(true);};+ const handleRevalidateLinkCache = (link: LinkWithViews) => {+ if (!currentTeamId) {+ toast.error("Failed to revalidate link cache");+ return;+ }++ toast.promise(+ fetch(`/api/links/${link.id}/revalidate`, {+ method: "POST",+ headers: {+ "Content-Type": "application/json",+ },+ body: JSON.stringify({+ teamId: currentTeamId,+ }),+ }).then(async (response) => {+ if (!response.ok) {+ const data = await response.json().catch(() => null);+ throw new Error(+ data?.error || `HTTP error! status: ${response.status}`,+ );+ }+ }),+ {+ loading: "Revalidating link cache...",+ success: "Link cache revalidated",+ error: "Failed to revalidate link cache",+ },+ );+ };+const handleEditPermissions = (link: LinkWithViews) => {// Open the link sheet directly on the file permissions panel so editing// file access happens in the same place as creating a link.@@ -1039,9 +1071,7 @@ export default function LinksTable({setSelectedEmbedLink({id: link.id,name: link.name || `Link #${link.id.slice(-5)}`,- domain: link.domainId- ? link.domainSlug- : null,+ domain: link.domainId ? link.domainSlug : null,slug: link.domainId ? link.slug : null,});setEmbedModalOpen(true);@@ -1050,6 +1080,12 @@ export default function LinksTable({<Code2Icon className="mr-2 h-4 w-4" />Get Embed Code</DropdownMenuItem>+ <DropdownMenuItem+ onClick={() => handleRevalidateLinkCache(link)}+ >+ <RefreshCwIcon className="mr-2 h-4 w-4" />+ Revalidate link cache+ </DropdownMenuItem>{!isFree && (<><DropdownMenuSeparator />diff --git a/lib/api/auth/with-session-team.ts b/lib/api/auth/with-session-team.tsindex 476162ee..c0b73794 100644--- a/lib/api/auth/with-session-team.ts+++ b/lib/api/auth/with-session-team.ts@@ -73,6 +73,14 @@ export interface WithSessionTeamOptions {params: Record<string, string | string[] | undefined>;req: NextRequest | NextApiRequest;}) => Promise<string | null | undefined> | string | null | undefined;+ /**+ * Custom resolver for the team id when it is not in the route params+ * (e.g. sent in the request body). Used only when `params.teamId` is absent.+ */+ resolveTeamId?: (args: {+ params: Record<string, string | string[] | undefined>;+ req: NextRequest | NextApiRequest;+ }) => Promise<string | null | undefined> | string | null | undefined;}type AuthError = { status: number; message: string };@@ -99,7 +107,7 @@ function firstString(v: string | string[] | undefined): string | undefined {*/async function resolveSessionTeam({session,- teamId,+ teamId: teamIdInput,params,req,opts,@@ -113,6 +121,15 @@ async function resolveSessionTeam({if (!session || !session.user) {return { status: 401, message: "Unauthorized" };}++ let teamId = teamIdInput;+ if (!teamId && opts.resolveTeamId) {+ const resolved = await opts.resolveTeamId({ params, req });+ if (typeof resolved === "string" && resolved.length > 0) {+ teamId = resolved;+ }+ }+if (!teamId) {return { status: 400, message: "Missing teamId" };}diff --git a/lib/api/links/link-data.ts b/lib/api/links/link-data.tsindex 57d99dbe..da77df58 100644--- a/lib/api/links/link-data.ts+++ b/lib/api/links/link-data.ts@@ -1,4 +1,13 @@-import { mergeBrandLogoFields } from "@/ee/features/branding/lib/brand-logo";+import {+ resolveBaseBrand,+ teamBrandOgSelect,+ teamBrandViewerSelect,+ teamBrandWorkflowSelect,+} from "@/ee/features/branding/lib/resolve-base-brand";+import {+ inheritsTeamBrand,+ resolveDisplayedDataroomBrand,+} from "@/ee/features/branding/lib/resolve-dataroom-displayed-brand";import { resolvePublicLinkMeta } from "@/ee/features/branding/lib/resolve-public-link-meta";import type { ResolvedPublicLinkMeta } from "@/ee/features/branding/lib/resolve-public-link-meta";import {@@ -67,6 +76,7 @@ const linkSelect = {metaImage: true,metaFavicon: true,welcomeMessage: true,+ brandId: true,enableQuestion: true,linkType: true,feedback: {@@ -84,6 +94,11 @@ const linkSelect = {permissionGroupId: true,audienceType: true,dataroomId: true,+ dataroom: {+ select: {+ brandId: true,+ },+ },teamId: true,team: {select: {@@ -216,12 +231,14 @@ export async function fetchDataroomLinkData({const linkData = await prisma.link.findUnique({where: { id: linkId, teamId },select: {+ brandId: true,dataroom: {select: {id: true,name: true,description: true,teamId: true,+ brandId: true,isFrozen: true,allowBulkDownload: true,showLastUpdated: true,@@ -334,75 +351,23 @@ export async function fetchDataroomLinkData({},});- const teamBrand = await prisma.brand.findFirst({- where: { teamId: linkData.dataroom.teamId },- select: {- logo: true,- hideLogo: true,- banner: true,- brandColor: true,- accentColor: true,- accentButtonColor: true,- applyAccentColorToDataroomView: true,- welcomeMessage: true,- ctaLabel: true,- ctaUrl: true,- cardLayout: true,- showFolderTree: true,- viewerLayoutPreset: true,- viewerHeaderStyle: true,- hideFolderIconsInMain: true,- defaultLanguage: true,- privacyPolicyUrl: true,- },+ const inheritTeamBrand = inheritsTeamBrand({+ linkBrandId: linkData.brandId,+ dataroomBrandId: linkData.dataroom.brandId,+ hasDataroomBrand: Boolean(dataroomBrand),+ });+ const teamBrand = await resolveBaseBrand({+ teamId: linkData.dataroom.teamId,+ linkBrandId: linkData.brandId,+ dataroomBrandId: linkData.dataroom.brandId,+ select: teamBrandViewerSelect,});- const brand = {- ...mergeBrandLogoFields({- dataroom: dataroomBrand,- team: teamBrand,- }),- banner: dataroomBrand?.banner || teamBrand?.banner || null,- brandColor: dataroomBrand?.brandColor || teamBrand?.brandColor,- accentColor: dataroomBrand?.accentColor || teamBrand?.accentColor,- accentButtonColor:- dataroomBrand?.accentButtonColor || teamBrand?.accentButtonColor || null,- applyAccentColorToDataroomView:- dataroomBrand?.applyAccentColorToDataroomView ??- teamBrand?.applyAccentColorToDataroomView ??- false,- welcomeMessage: dataroomBrand?.welcomeMessage || teamBrand?.welcomeMessage,- // Layout fields cascade: dataroom override → team default → enum default.- // Per-dataroom rows always win once present (matches accentColor pattern).- cardLayout:- dataroomBrand?.cardLayout ?? (teamBrand as any)?.cardLayout ?? "LIST",- showFolderTree:- dataroomBrand?.showFolderTree ??- (teamBrand as any)?.showFolderTree ??- true,- viewerLayoutPreset:- dataroomBrand?.viewerLayoutPreset ??- (teamBrand as any)?.viewerLayoutPreset ??- "STANDARD",- viewerHeaderStyle:- dataroomBrand?.viewerHeaderStyle ??- (teamBrand as any)?.viewerHeaderStyle ??- "DEFAULT",- hideFolderIconsInMain:- dataroomBrand?.hideFolderIconsInMain ??- (teamBrand as any)?.hideFolderIconsInMain ??- false,- ctaLabel: dataroomBrand?.ctaLabel ?? teamBrand?.ctaLabel ?? null,- ctaUrl: dataroomBrand?.ctaUrl ?? teamBrand?.ctaUrl ?? null,- // Viewer i18n: dataroom-level setting wins, else team-level, else en.- // Read by `buildViewerI18nPageProps` to pick the locale + bundles.- defaultLanguage:- (dataroomBrand as any)?.defaultLanguage ??- (teamBrand as any)?.defaultLanguage ??- "en",- // Team-level only; `processLinkData` strips it again when it doesn't apply.- privacyPolicyUrl: (teamBrand as any)?.privacyPolicyUrl ?? null,- };+ const brand = resolveDisplayedDataroomBrand({+ dataroomBrand,+ teamBrand,+ inheritTeamBrand,+ });// Extract access controls from either ViewerGroup or PermissionGroupconst accessControls =@@ -480,12 +445,14 @@ export async function fetchDataroomDocumentLinkData({const linkData = await prisma.link.findUnique({where: { id: linkId, teamId, linkType: "DATAROOM_LINK", deletedAt: null },select: {+ brandId: true,dataroom: {select: {id: true,name: true,description: true,teamId: true,+ brandId: true,isFrozen: true,allowBulkDownload: true,showLastUpdated: true,@@ -549,71 +516,23 @@ export async function fetchDataroomDocumentLinkData({},});- const teamBrand = await prisma.brand.findFirst({- where: { teamId: linkData.dataroom.teamId },- select: {- logo: true,- hideLogo: true,- banner: true,- brandColor: true,- accentColor: true,- accentButtonColor: true,- applyAccentColorToDataroomView: true,- welcomeMessage: true,- ctaLabel: true,- ctaUrl: true,- cardLayout: true,- showFolderTree: true,- viewerLayoutPreset: true,- viewerHeaderStyle: true,- hideFolderIconsInMain: true,- defaultLanguage: true,- privacyPolicyUrl: true,- },+ const inheritTeamBrand = inheritsTeamBrand({+ linkBrandId: linkData.brandId,+ dataroomBrandId: linkData.dataroom.brandId,+ hasDataroomBrand: Boolean(dataroomBrand),+ });+ const teamBrand = await resolveBaseBrand({+ teamId: linkData.dataroom.teamId,+ linkBrandId: linkData.brandId,+ dataroomBrandId: linkData.dataroom.brandId,+ select: teamBrandViewerSelect,});- const brand = {- ...mergeBrandLogoFields({- dataroom: dataroomBrand,- team: teamBrand,- }),- banner: dataroomBrand?.banner || teamBrand?.banner || null,- brandColor: dataroomBrand?.brandColor || teamBrand?.brandColor,- accentColor: dataroomBrand?.accentColor || teamBrand?.accentColor,- accentButtonColor:- dataroomBrand?.accentButtonColor || teamBrand?.accentButtonColor || null,- applyAccentColorToDataroomView:- dataroomBrand?.applyAccentColorToDataroomView ??- teamBrand?.applyAccentColorToDataroomView ??- false,- welcomeMessage: dataroomBrand?.welcomeMessage || teamBrand?.welcomeMessage,- cardLayout:- dataroomBrand?.cardLayout ?? (teamBrand as any)?.cardLayout ?? "LIST",- showFolderTree:- dataroomBrand?.showFolderTree ??- (teamBrand as any)?.showFolderTree ??- true,- viewerLayoutPreset:- dataroomBrand?.viewerLayoutPreset ??- (teamBrand as any)?.viewerLayoutPreset ??- "STANDARD",- viewerHeaderStyle:- dataroomBrand?.viewerHeaderStyle ??- (teamBrand as any)?.viewerHeaderStyle ??- "DEFAULT",- hideFolderIconsInMain:- dataroomBrand?.hideFolderIconsInMain ??- (teamBrand as any)?.hideFolderIconsInMain ??- false,- ctaLabel: dataroomBrand?.ctaLabel ?? teamBrand?.ctaLabel ?? null,- ctaUrl: dataroomBrand?.ctaUrl ?? teamBrand?.ctaUrl ?? null,- defaultLanguage:- (dataroomBrand as any)?.defaultLanguage ??- (teamBrand as any)?.defaultLanguage ??- "en",- // Team-level only; `processLinkData` strips it again when it doesn't apply.- privacyPolicyUrl: (teamBrand as any)?.privacyPolicyUrl ?? null,- };+ const brand = resolveDisplayedDataroomBrand({+ dataroomBrand,+ teamBrand,+ inheritTeamBrand,+ });return { linkData, brand };}@@ -628,6 +547,7 @@ export async function fetchDocumentLinkData({const linkData = await prisma.link.findUnique({where: { id: linkId, teamId, deletedAt: null },select: {+ brandId: true,document: {select: {id: true,@@ -660,20 +580,10 @@ export async function fetchDocumentLinkData({throw new Error("Document not found");}- const brand = await prisma.brand.findFirst({- where: { teamId: linkData.document.teamId },- select: {- logo: true,- hideLogo: true,- brandColor: true,- accentColor: true,- accentButtonColor: true,- welcomeMessage: true,- ctaLabel: true,- ctaUrl: true,- defaultLanguage: true,- privacyPolicyUrl: true,- },+ const brand = await resolveBaseBrand({+ teamId: linkData.document.teamId,+ linkBrandId: linkData.brandId,+ select: teamBrandViewerSelect,});return { linkData, brand };@@ -729,16 +639,10 @@ async function processLinkData(if (linkType === "WORKFLOW_LINK") {let brand: Partial<Brand> | null = null;if (link.teamId) {- const teamBrand = await prisma.brand.findUnique({- where: { teamId: link.teamId },- select: {- logo: true,- hideLogo: true,- brandColor: true,- accentColor: true,- defaultLanguage: true,- privacyPolicyUrl: true,- },+ const teamBrand = await resolveBaseBrand({+ teamId: link.teamId,+ linkBrandId: link.brandId,+ select: teamBrandWorkflowSelect,});brand = await applyPrivacyPolicyUrlVisibility(teamBrand, {teamId: link.teamId,@@ -919,15 +823,11 @@ async function processLinkData((linkType === "DOCUMENT_LINK" || linkType === "DATAROOM_LINK")) {const [teamBrandLp, dataroomBrandLp] = await Promise.all([- prisma.brand.findFirst({- where: { teamId: link.teamId },- select: {- customLinkPreviewEnabled: true,- linkPreviewTitle: true,- linkPreviewDescription: true,- linkPreviewImage: true,- linkPreviewFavicon: true,- },+ resolveBaseBrand({+ teamId: link.teamId,+ linkBrandId: link.brandId,+ dataroomBrandId: link.dataroom?.brandId,+ select: teamBrandOgSelect,}),linkType === "DATAROOM_LINK" && link.dataroomId? prisma.dataroomBrand.findFirst({@@ -956,6 +856,11 @@ async function processLinkData(}}+ const inheritTeamBrand = inheritsTeamBrand({+ linkBrandId: link.brandId,+ dataroomBrandId: link.dataroom?.brandId,+ hasDataroomBrand: Boolean(dataroomBrandLp),+ });publicMeta = resolvePublicLinkMeta({link: {enableCustomMetatag: !!link.enableCustomMetatag,@@ -964,8 +869,8 @@ async function processLinkData(metaImage: link.metaImage,metaFavicon: link.metaFavicon,},- teamBrand: teamBrandLp,- dataroomBrand: dataroomBrandLp,+ teamBrand: inheritTeamBrand ? teamBrandLp : null,+ dataroomBrand: inheritTeamBrand ? null : dataroomBrandLp,defaultTitle,});}diff --git a/lib/api/links/revalidate.ts b/lib/api/links/revalidate.tsindex 4298603e..d4986aaf 100644--- a/lib/api/links/revalidate.ts+++ b/lib/api/links/revalidate.ts@@ -25,7 +25,7 @@ function getRevalidateConfig(): RevalidateConfig | null {async function revalidateSingleLink(link: LinkForRevalidation,config: RevalidateConfig,-): Promise<void> {+): Promise<boolean> {const controller = new AbortController();const timeout = setTimeout(() => controller.abort(),@@ -42,9 +42,13 @@ async function revalidateSingleLink(console.error(`Error revalidating link ${link.id}: unexpected status ${response.status}`,);+ return false;}++ return true;} catch (error) {console.error(`Error revalidating link ${link.id}:`, error);+ return false;} finally {clearTimeout(timeout);}@@ -71,19 +75,24 @@ async function revalidateLinks(links: LinkForRevalidation[]): Promise<void> {/*** Trigger ISR revalidation for a single link by ID.*/-export async function revalidateLinkById(linkId: string): Promise<void> {- try {- const link = await prisma.link.findUnique({- where: { id: linkId },- select: { id: true, domainId: true },- });-- if (!link) return;+export async function revalidateLinkById(linkId: string): Promise<boolean> {+ const link = await prisma.link.findUnique({+ where: { id: linkId },+ select: { id: true, domainId: true },+ });++ if (!link) {+ console.error(`Error revalidating link ${linkId}: link not found`);+ return false;+ }- await revalidateLinks([link]);- } catch (error) {- console.error(`Error revalidating link ${linkId}:`, error);+ const config = getRevalidateConfig();+ if (!config) {+ console.error(`Error revalidating link ${linkId}: missing revalidate config`);+ return false;}++ return revalidateSingleLink(link, config);}/**diff --git a/lib/api/rbac/permissions.ts b/lib/api/rbac/permissions.tsindex 25002778..31641a16 100644--- a/lib/api/rbac/permissions.ts+++ b/lib/api/rbac/permissions.ts@@ -26,6 +26,7 @@ export type PermissionAction =| "tokens.write"| "webhooks.write"| "domains.write"+ | "branding.read"| "branding.write"// SAML / SSO configuration (admin only).| "sso.write";@@ -45,6 +46,7 @@ const ALL_PERMISSIONS: PermissionAction[] = ["tokens.write","webhooks.write","domains.write",+ "branding.read","branding.write","sso.write",];@@ -74,6 +76,8 @@ const DATAROOM_MEMBER_PERMISSIONS: PermissionAction[] = ["links.read","links.write","analytics.read",+ // Read team brands when picking one for an assigned room or link.+ "branding.read",];/**diff --git a/lib/emails/send-email-otp-verification.ts b/lib/emails/send-email-otp-verification.tsindex 5d9ddc2c..b85d640a 100644--- a/lib/emails/send-email-otp-verification.ts+++ b/lib/emails/send-email-otp-verification.ts@@ -1,4 +1,8 @@-import { type ResolvedBrandLogo } from "@/ee/features/branding/lib/brand-logo";+import {+ resolveBrandLogo,+ type ResolvedBrandLogo,+} from "@/ee/features/branding/lib/brand-logo";+import { resolveBaseBrand } from "@/ee/features/branding/lib/resolve-base-brand";import { getCustomEmail } from "@/lib/edge-config/custom-email";import { readCachedBrandLogo } from "@/lib/redis/brand-logo-cache";@@ -6,11 +10,17 @@ import { sendEmail } from "@/lib/resend";import OtpEmailVerification from "@/components/emails/otp-verification";+export type OtpBrandContext = {+ linkBrandId?: string | null;+ dataroomBrandId?: string | null;+};+export const sendOtpVerificationEmail = async (email: string,code: string,isDataroom: boolean = false,teamId: string,+ brandContext?: OtpBrandContext,) => {let logo: ResolvedBrandLogo | undefined;let from: string | undefined;@@ -19,7 +29,20 @@ export const sendOtpVerificationEmail = async (if (customEmail && teamId) {from = customEmail;- logo = await readCachedBrandLogo(teamId);+ const hasOverride = !!(+ brandContext?.linkBrandId || brandContext?.dataroomBrandId+ );+ if (hasOverride) {+ const brand = await resolveBaseBrand({+ teamId,+ linkBrandId: brandContext?.linkBrandId,+ dataroomBrandId: brandContext?.dataroomBrandId,+ select: { logo: true, hideLogo: true },+ });+ logo = resolveBrandLogo(brand);+ } else {+ logo = await readCachedBrandLogo(teamId);+ }}const emailTemplate = OtpEmailVerification({diff --git a/lib/links/build-link-form-data.ts b/lib/links/build-link-form-data.tsindex 56c00bc2..e30119aa 100644--- a/lib/links/build-link-form-data.ts+++ b/lib/links/build-link-form-data.ts@@ -1,14 +1,12 @@-import { DEFAULT_LINK_TYPE } from "@/components/links/link-sheet";-import { LinkWithViews, WatermarkConfig } from "@/lib/types";+import { DEFAULT_LINK_TYPE } from "@/components/links/link-sheet";+/*** Maps a saved link onto the shape the link sheet edits, so any surface that* can name a link can also open it for editing.*/-export const buildLinkFormData = (- link: LinkWithViews,-): DEFAULT_LINK_TYPE => ({+export const buildLinkFormData = (link: LinkWithViews): DEFAULT_LINK_TYPE => ({id: link.id,name: link.name || `Link #${link.id.slice(-5)}`,domain: link.domainSlug,@@ -24,9 +22,7 @@ export const buildLinkFormData = (link.visitorGroups?.map((vg: { visitorGroupId: string }) => vg.visitorGroupId,) || [],- enableNotification: link.enableNotification- ? link.enableNotification- : false,+ enableNotification: link.enableNotification ? link.enableNotification : false,enableFeedback: link.enableFeedback ? link.enableFeedback : false,enableScreenshotProtection: link.enableScreenshotProtection? link.enableScreenshotProtection@@ -59,11 +55,11 @@ export const buildLinkFormData = (uploadFolderIds: Array.isArray(link.uploadFolderIds)? link.uploadFolderIds: [],- uploadFolders: Array.isArray(link.uploadFolders)- ? link.uploadFolders- : [],+ uploadFolders: Array.isArray(link.uploadFolders) ? link.uploadFolders : [],enableIndexFile: link.enableIndexFile ?? false,permissionGroupId: link.permissionGroupId ?? null,welcomeMessage: link.welcomeMessage ?? null,+ brandId: link.brandId ?? null,+ dataroomBrandId: link.dataroom?.brandId ?? null,enableAIAgents: link.enableAIAgents ?? false,});diff --git a/lib/swr/use-brand.ts b/lib/swr/use-brand.tsindex 22b06d9d..7bb84f56 100644--- a/lib/swr/use-brand.ts+++ b/lib/swr/use-brand.ts@@ -1,13 +1,14 @@-import { useRouter } from "next/router";--import { useMemo } from "react";-import { useTeam } from "@/context/team-context";import { Brand, DataroomBrand } from "@prisma/client";import useSWR from "swr";import { fetcher } from "@/lib/utils";+export type TeamBrandsResponse = {+ brands: Brand[];+ defaultBrandId: string | null;+};+export function useBrand() {const teamInfo = useTeam();@@ -23,7 +24,62 @@ export function useBrand() {return {brand,error,- loading: !brand && !error,+ loading: !error && brand === undefined,+ };+}++export function useBrands() {+ const teamInfo = useTeam();+ const teamId = teamInfo?.currentTeam?.id;++ const { data, error, mutate } = useSWR<TeamBrandsResponse>(+ teamId && `/api/teams/${teamId}/brands`,+ fetcher,+ {+ dedupingInterval: 0,+ refreshInterval: 0,+ revalidateOnMount: true,+ revalidateOnFocus: true,+ },+ );++ return {+ brands: data?.brands ?? [],+ defaultBrandId: data?.defaultBrandId ?? null,+ error,+ loading: !data && !error,+ mutate,+ };+}++export type DataroomBrandResponse = {+ brand: DataroomBrand | null;+ dataroomBrandId: string | null;+};++function readDataroomBrandResponse(+ data: DataroomBrandResponse | DataroomBrand | null | undefined,+): {+ brand: DataroomBrand | null | undefined;+ dataroomBrandId: string | null | undefined;+} {+ if (data === undefined) {+ return { brand: undefined, dataroomBrandId: undefined };+ }+ if (data === null) {+ return { brand: null, dataroomBrandId: null };+ }+ if ("brand" in data && !("dataroomId" in data)) {+ return {+ brand: data.brand,+ dataroomBrandId: data.dataroomBrandId ?? null,+ };+ }+ const row = data as DataroomBrand & { dataroomBrandId?: string | null };+ return {+ brand: row,+ dataroomBrandId:+ "dataroomBrandId" in row ? (row.dataroomBrandId ?? null) : undefined,};}@@ -35,7 +91,7 @@ export function useDataroomBrand({const teamInfo = useTeam();const teamId = teamInfo?.currentTeam?.id;- const { data: brand, error } = useSWR<DataroomBrand>(+ const { data, error } = useSWR<DataroomBrandResponse | DataroomBrand | null>(teamId &&dataroomId &&`/api/teams/${teamId}/datarooms/${dataroomId}/branding`,@@ -45,9 +101,12 @@ export function useDataroomBrand({},);+ const { brand, dataroomBrandId } = readDataroomBrandResponse(data);+return {brand,+ dataroomBrandId,error,- loading: !brand && !error,+ loading: Boolean(teamId && dataroomId) && !error && data === undefined,};}diff --git a/lib/types.ts b/lib/types.tsindex 7f564647..e55524ec 100644--- a/lib/types.ts+++ b/lib/types.ts@@ -68,6 +68,7 @@ export interface LinkWithViews extends Link {tags: TagProps[];uploadFolders?: { id: string; name: string; path: string | null }[];visitorGroups?: { visitorGroupId: string }[];+ dataroom?: { brandId: string | null } | null;}export interface LinkWithDocument extends Link {diff --git a/package-lock.json b/package-lock.jsonindex 4a49d769..182de81f 100644--- a/package-lock.json+++ b/package-lock.json@@ -3415,9 +3415,9 @@}},"node_modules/@emnapi/runtime": {- "version": "1.10.0",- "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz",- "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==",+ "version": "1.11.3",+ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz",+ "integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==","license": "MIT","optional": true,"dependencies": {@@ -3435,9 +3435,9 @@}},"node_modules/@esbuild/aix-ppc64": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.0.tgz",- "integrity": "sha512-lhRUCeuOyJQURhTxl4WkpFTjIsbDayJHih5kZC1giwE+MhIzAb7mEsQMqMf18rHLsrb5qI1tafG20mLxEWcWlA==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz",+ "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==","cpu": ["ppc64"],@@ -3451,9 +3451,9 @@}},"node_modules/@esbuild/android-arm": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.0.tgz",- "integrity": "sha512-wqh0ByljabXLKHeWXYLqoJ5jKC4XBaw6Hk08OfMrCRd2nP2ZQ5eleDZC41XHyCNgktBGYMbqnrJKq/K/lzPMSQ==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz",+ "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==","cpu": ["arm"],@@ -3467,9 +3467,9 @@}},"node_modules/@esbuild/android-arm64": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.0.tgz",- "integrity": "sha512-+WzIXQOSaGs33tLEgYPYe/yQHf0WTU0X42Jca3y8NWMbUVhp7rUnw+vAsRC/QiDrdD31IszMrZy+qwPOPjd+rw==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz",+ "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==","cpu": ["arm64"],@@ -3483,9 +3483,9 @@}},"node_modules/@esbuild/android-x64": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.0.tgz",- "integrity": "sha512-+VJggoaKhk2VNNqVL7f6S189UzShHC/mR9EE8rDdSkdpN0KflSwWY/gWjDrNxxisg8Fp1ZCD9jLMo4m0OUfeUA==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz",+ "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==","cpu": ["x64"],@@ -3499,9 +3499,9 @@}},"node_modules/@esbuild/darwin-arm64": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.0.tgz",- "integrity": "sha512-0T+A9WZm+bZ84nZBtk1ckYsOvyA3x7e2Acj1KdVfV4/2tdG4fzUp91YHx+GArWLtwqp77pBXVCPn2We7Letr0Q==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz",+ "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==","cpu": ["arm64"],@@ -3515,9 +3515,9 @@}},"node_modules/@esbuild/darwin-x64": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.0.tgz",- "integrity": "sha512-fyzLm/DLDl/84OCfp2f/XQ4flmORsjU7VKt8HLjvIXChJoFFOIL6pLJPH4Yhd1n1gGFF9mPwtlN5Wf82DZs+LQ==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz",+ "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==","cpu": ["x64"],@@ -3531,9 +3531,9 @@}},"node_modules/@esbuild/freebsd-arm64": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.0.tgz",- "integrity": "sha512-l9GeW5UZBT9k9brBYI+0WDffcRxgHQD8ShN2Ur4xWq/NFzUKm3k5lsH4PdaRgb2w7mI9u61nr2gI2mLI27Nh3Q==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz",+ "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==","cpu": ["arm64"],@@ -3547,9 +3547,9 @@}},"node_modules/@esbuild/freebsd-x64": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.0.tgz",- "integrity": "sha512-BXoQai/A0wPO6Es3yFJ7APCiKGc1tdAEOgeTNy3SsB491S3aHn4S4r3e976eUnPdU+NbdtmBuLncYir2tMU9Nw==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz",+ "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==","cpu": ["x64"],@@ -3563,9 +3563,9 @@}},"node_modules/@esbuild/linux-arm": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.0.tgz",- "integrity": "sha512-CjaaREJagqJp7iTaNQjjidaNbCKYcd4IDkzbwwxtSvjI7NZm79qiHc8HqciMddQ6CKvJT6aBd8lO9kN/ZudLlw==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz",+ "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==","cpu": ["arm"],@@ -3579,9 +3579,9 @@}},"node_modules/@esbuild/linux-arm64": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.0.tgz",- "integrity": "sha512-RVyzfb3FWsGA55n6WY0MEIEPURL1FcbhFE6BffZEMEekfCzCIMtB5yyDcFnVbTnwk+CLAgTujmV/Lgvih56W+A==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz",+ "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==","cpu": ["arm64"],@@ -3595,9 +3595,9 @@}},"node_modules/@esbuild/linux-ia32": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.0.tgz",- "integrity": "sha512-KBnSTt1kxl9x70q+ydterVdl+Cn0H18ngRMRCEQfrbqdUuntQQ0LoMZv47uB97NljZFzY6HcfqEZ2SAyIUTQBQ==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz",+ "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==","cpu": ["ia32"],@@ -3611,9 +3611,9 @@}},"node_modules/@esbuild/linux-loong64": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.0.tgz",- "integrity": "sha512-zpSlUce1mnxzgBADvxKXX5sl8aYQHo2ezvMNI8I0lbblJtp8V4odlm3Yzlj7gPyt3T8ReksE6bK+pT3WD+aJRg==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz",+ "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==","cpu": ["loong64"],@@ -3627,9 +3627,9 @@}},"node_modules/@esbuild/linux-mips64el": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.0.tgz",- "integrity": "sha512-2jIfP6mmjkdmeTlsX/9vmdmhBmKADrWqN7zcdtHIeNSCH1SqIoNI63cYsjQR8J+wGa4Y5izRcSHSm8K3QWmk3w==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz",+ "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==","cpu": ["mips64el"],@@ -3643,9 +3643,9 @@}},"node_modules/@esbuild/linux-ppc64": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.0.tgz",- "integrity": "sha512-bc0FE9wWeC0WBm49IQMPSPILRocGTQt3j5KPCA8os6VprfuJ7KD+5PzESSrJ6GmPIPJK965ZJHTUlSA6GNYEhg==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz",+ "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==","cpu": ["ppc64"],@@ -3659,9 +3659,9 @@}},"node_modules/@esbuild/linux-riscv64": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.0.tgz",- "integrity": "sha512-SQPZOwoTTT/HXFXQJG/vBX8sOFagGqvZyXcgLA3NhIqcBv1BJU1d46c0rGcrij2B56Z2rNiSLaZOYW5cUk7yLQ==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz",+ "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==","cpu": ["riscv64"],@@ -3675,9 +3675,9 @@}},"node_modules/@esbuild/linux-s390x": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.0.tgz",- "integrity": "sha512-SCfR0HN8CEEjnYnySJTd2cw0k9OHB/YFzt5zgJEwa+wL/T/raGWYMBqwDNAC6dqFKmJYZoQBRfHjgwLHGSrn3Q==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz",+ "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==","cpu": ["s390x"],@@ -3691,9 +3691,9 @@}},"node_modules/@esbuild/linux-x64": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.0.tgz",- "integrity": "sha512-us0dSb9iFxIi8srnpl931Nvs65it/Jd2a2K3qs7fz2WfGPHqzfzZTfec7oxZJRNPXPnNYZtanmRc4AL/JwVzHQ==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz",+ "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==","cpu": ["x64"],@@ -3707,9 +3707,9 @@}},"node_modules/@esbuild/netbsd-arm64": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.0.tgz",- "integrity": "sha512-CR/RYotgtCKwtftMwJlUU7xCVNg3lMYZ0RzTmAHSfLCXw3NtZtNpswLEj/Kkf6kEL3Gw+BpOekRX0BYCtklhUw==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz",+ "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==","cpu": ["arm64"],@@ -3723,9 +3723,9 @@}},"node_modules/@esbuild/netbsd-x64": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.0.tgz",- "integrity": "sha512-nU1yhmYutL+fQ71Kxnhg8uEOdC0pwEW9entHykTgEbna2pw2dkbFSMeqjjyHZoCmt8SBkOSvV+yNmm94aUrrqw==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz",+ "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==","cpu": ["x64"],@@ -3739,9 +3739,9 @@}},"node_modules/@esbuild/openbsd-arm64": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.0.tgz",- "integrity": "sha512-cXb5vApOsRsxsEl4mcZ1XY3D4DzcoMxR/nnc4IyqYs0rTI8ZKmW6kyyg+11Z8yvgMfAEldKzP7AdP64HnSC/6g==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz",+ "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==","cpu": ["arm64"],@@ -3755,9 +3755,9 @@}},"node_modules/@esbuild/openbsd-x64": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.0.tgz",- "integrity": "sha512-8wZM2qqtv9UP3mzy7HiGYNH/zjTA355mpeuA+859TyR+e+Tc08IHYpLJuMsfpDJwoLo1ikIJI8jC3GFjnRClzA==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz",+ "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==","cpu": ["x64"],@@ -3771,9 +3771,9 @@}},"node_modules/@esbuild/openharmony-arm64": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.0.tgz",- "integrity": "sha512-FLGfyizszcef5C3YtoyQDACyg95+dndv79i2EekILBofh5wpCa1KuBqOWKrEHZg3zrL3t5ouE5jgr94vA+Wb2w==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz",+ "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==","cpu": ["arm64"],@@ -3787,9 +3787,9 @@}},"node_modules/@esbuild/sunos-x64": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.0.tgz",- "integrity": "sha512-1ZgjUoEdHZZl/YlV76TSCz9Hqj9h9YmMGAgAPYd+q4SicWNX3G5GCyx9uhQWSLcbvPW8Ni7lj4gDa1T40akdlw==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz",+ "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==","cpu": ["x64"],@@ -3803,9 +3803,9 @@}},"node_modules/@esbuild/win32-arm64": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.0.tgz",- "integrity": "sha512-Q9StnDmQ/enxnpxCCLSg0oo4+34B9TdXpuyPeTedN/6+iXBJ4J+zwfQI28u/Jl40nOYAxGoNi7mFP40RUtkmUA==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz",+ "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==","cpu": ["arm64"],@@ -3819,9 +3819,9 @@}},"node_modules/@esbuild/win32-ia32": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.0.tgz",- "integrity": "sha512-zF3ag/gfiCe6U2iczcRzSYJKH1DCI+ByzSENHlM2FcDbEeo5Zd2C86Aq0tKUYAJJ1obRP84ymxIAksZUcdztHA==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz",+ "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==","cpu": ["ia32"],@@ -3835,9 +3835,9 @@}},"node_modules/@esbuild/win32-x64": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.0.tgz",- "integrity": "sha512-pEl1bO9mfAmIC+tW5btTmrKaujg3zGtUmWNdCw/xs70FBjwAL3o9OEKNHvNmnyylD6ubxUERiEhdsL0xBQ9efw==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz",+ "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==","cpu": ["x64"],@@ -3895,7 +3895,9 @@}},"node_modules/@eslint/eslintrc/node_modules/brace-expansion": {- "version": "1.1.14",+ "version": "1.1.18",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz",+ "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==","license": "MIT","dependencies": {"balanced-match": "^1.0.0",@@ -4094,7 +4096,9 @@}},"node_modules/@hono/node-server": {- "version": "1.19.14",+ "version": "1.19.17",+ "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.17.tgz",+ "integrity": "sha512-dSneS5qhiauZWGDCeK4o695Xd9nUNjviSZCMQrj10eetr8Uln1ucn6bbphOM6UynAMMtNIzZNSpL9vnASJwrPQ==","license": "MIT","engines": {"node": ">=18.14.1"@@ -4126,7 +4130,9 @@}},"node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": {- "version": "1.1.14",+ "version": "1.1.18",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz",+ "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==","license": "MIT","dependencies": {"balanced-match": "^1.0.0",@@ -4183,9 +4189,9 @@}},"node_modules/@img/sharp-darwin-arm64": {- "version": "0.34.5",- "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz",- "integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==",+ "version": "0.35.3",+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.3.tgz",+ "integrity": "sha512-RMnFX7YQsMoh7lWfcM4NEHHymBX/rLuKNPVM84XE9ONPcaSCDgE7CHIHpSgPcO2xcRthgBy1HfNO319mwhIAkg==","cpu": ["arm64"],@@ -4196,19 +4202,19 @@"darwin"],"engines": {- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ "node": ">=20.9.0"},"funding": {"url": "https://opencollective.com/libvips"},"optionalDependencies": {- "@img/sharp-libvips-darwin-arm64": "1.2.4"+ "@img/sharp-libvips-darwin-arm64": "1.3.2"}},"node_modules/@img/sharp-darwin-x64": {- "version": "0.34.5",- "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz",- "integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==",+ "version": "0.35.3",+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.3.tgz",+ "integrity": "sha512-Xo+5uFBtLN0BKqieTxiFzFPQAUlBbbH5iBKyRX/z1JrbnYsHTfKJnUfL8+p2TPXr1pXqao4eeL4Rl144uDpK9w==","cpu": ["x64"],@@ -4219,19 +4225,39 @@"darwin"],"engines": {- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ "node": ">=20.9.0"},"funding": {"url": "https://opencollective.com/libvips"},"optionalDependencies": {- "@img/sharp-libvips-darwin-x64": "1.2.4"+ "@img/sharp-libvips-darwin-x64": "1.3.2"+ }+ },+ "node_modules/@img/sharp-freebsd-wasm32": {+ "version": "0.35.3",+ "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.3.tgz",+ "integrity": "sha512-lUxcqWIj2wMQ9BrwNjngcr1gWUr5xgaGThBRqPPalIC2n67Cqj1uPh8NnA/ZhAg8hUbKl+kVHKwgUIwe6ZYPrg==",+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "dependencies": {+ "@img/sharp-wasm32": "0.35.3"+ },+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"}},"node_modules/@img/sharp-libvips-darwin-arm64": {- "version": "1.2.4",- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz",- "integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==",+ "version": "1.3.2",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.2.tgz",+ "integrity": "sha512-9J6ypZFpQBj4YnePGoq/S38w6nz+vqg5WZLrLGY4YuSemdMq47GMLBPO42MzwdGwpg/agZ7xzZcFHa48xlywfg==","cpu": ["arm64"],@@ -4246,9 +4272,9 @@}},"node_modules/@img/sharp-libvips-darwin-x64": {- "version": "1.2.4",- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz",- "integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==",+ "version": "1.3.2",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.2.tgz",+ "integrity": "sha512-m2pW1n6cns9VaubNwsZ+c3CRYjxNQWgJ5gPlnL1nbBcpkBvFm6SCFN5o0psFHI8w9n11NKhFkeEDns98tiqbEw==","cpu": ["x64"],@@ -4263,13 +4289,16 @@}},"node_modules/@img/sharp-libvips-linux-arm": {- "version": "1.2.4",- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz",- "integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==",+ "version": "1.3.2",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.2.tgz",+ "integrity": "sha512-1eMLzy92I4J6rmi4mAT8yC3HxOtniyGELlzGbNMLLeqe052ahFQ0h6LFq+lh5DsDIdYViIDst08abvSbcEdLXQ==","cpu": ["arm"],"dev": true,+ "libc": [+ "glibc"+ ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -4280,13 +4309,16 @@}},"node_modules/@img/sharp-libvips-linux-arm64": {- "version": "1.2.4",- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz",- "integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==",+ "version": "1.3.2",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.2.tgz",+ "integrity": "sha512-dqVSFynCox4C/J8kT16V7SIFAns0IjgLwkvYT7p8LQVmJ5OS5b6tI9IGflxTeuBS//zXeFIUbwt5dwxyZ17cnA==","cpu": ["arm64"],"dev": true,+ "libc": [+ "glibc"+ ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -4297,13 +4329,16 @@}},"node_modules/@img/sharp-libvips-linux-ppc64": {- "version": "1.2.4",- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz",- "integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==",+ "version": "1.3.2",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.2.tgz",+ "integrity": "sha512-3z0NHDxD6n5I9gc05U1eW1AyRm+Gznzq3naMrthPNqE6oYykcogW0l/jfpJdjYnuNl8R7yI9pNbE1XiUeyq0Aw==","cpu": ["ppc64"],"dev": true,+ "libc": [+ "glibc"+ ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -4314,13 +4349,16 @@}},"node_modules/@img/sharp-libvips-linux-riscv64": {- "version": "1.2.4",- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz",- "integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==",+ "version": "1.3.2",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.2.tgz",+ "integrity": "sha512-bsb4rI+NldGOsXuej2r8OdSS8+zXDVaCWxyWrcv6kneTOlgAHtZABRzBBCwdsPiD90J4myNJuHpg6kA20ImW/w==","cpu": ["riscv64"],"dev": true,+ "libc": [+ "glibc"+ ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -4331,13 +4369,16 @@}},"node_modules/@img/sharp-libvips-linux-s390x": {- "version": "1.2.4",- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz",- "integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==",+ "version": "1.3.2",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.2.tgz",+ "integrity": "sha512-/ABshyj8gCpyIrNXnHn4LorDJ0HHm1VhXPBlxZ8zAtfVPAaSafXPGn+sUSIRiwaSBy0mmFjSjiXI5mkcwdChKQ==","cpu": ["s390x"],"dev": true,+ "libc": [+ "glibc"+ ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -4348,13 +4389,16 @@}},"node_modules/@img/sharp-libvips-linux-x64": {- "version": "1.2.4",- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz",- "integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==",+ "version": "1.3.2",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.2.tgz",+ "integrity": "sha512-ITPEtgffGJ0S6G9dRyw/366tJQqFRcHWPHhC+Stpg3Z8AEMrDrTr2lhdz4f/Y/HMbRh//7Z5mBzEpVdi62Oc3w==","cpu": ["x64"],"dev": true,+ "libc": [+ "glibc"+ ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -4365,13 +4409,16 @@}},"node_modules/@img/sharp-libvips-linuxmusl-arm64": {- "version": "1.2.4",- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz",- "integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==",+ "version": "1.3.2",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.2.tgz",+ "integrity": "sha512-zE9EdiUzUmg5mDT5a1rk5fYJ6GWPloTwWBYDS14naqHsL+EaMpDj1AWnpLgh3u0YCORv2Tt50wrcrpYqkP97Kw==","cpu": ["arm64"],"dev": true,+ "libc": [+ "musl"+ ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -4382,13 +4429,16 @@}},"node_modules/@img/sharp-libvips-linuxmusl-x64": {- "version": "1.2.4",- "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz",- "integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==",+ "version": "1.3.2",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.2.tgz",+ "integrity": "sha512-m0lrLiUt+lBYnCFr8qV/65yMR4E/c7/wf78I5eKTdkEakFAlZ9QlzEM3QIhhAwVeUhLAHLcCq7a7Vszq/oFNZQ==","cpu": ["x64"],"dev": true,+ "libc": [+ "musl"+ ],"license": "LGPL-3.0-or-later","optional": true,"os": [@@ -4399,213 +4449,254 @@}},"node_modules/@img/sharp-linux-arm": {- "version": "0.34.5",- "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz",- "integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==",+ "version": "0.35.3",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.3.tgz",+ "integrity": "sha512-affVWCTLooy8TSxbDx2qkzuDeaWLNVBA+P//FNBirHsXpP2fuBhk5AuboYUnrDnzoXes8GFjpTx0SBFOCRg+FA==","cpu": ["arm"],"dev": true,+ "libc": [+ "glibc"+ ],"license": "Apache-2.0","optional": true,"os": ["linux"],"engines": {- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ "node": ">=20.9.0"},"funding": {"url": "https://opencollective.com/libvips"},"optionalDependencies": {- "@img/sharp-libvips-linux-arm": "1.2.4"+ "@img/sharp-libvips-linux-arm": "1.3.2"}},"node_modules/@img/sharp-linux-arm64": {- "version": "0.34.5",- "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz",- "integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==",+ "version": "0.35.3",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.3.tgz",+ "integrity": "sha512-QgKDspHPnrU+GQ55XPhGwyhC8acLVOOSyAvo1oVfFmrIXLkDNmGWzAfDZ4xK8oSA1qBQrALcHX0G5UZni/SuFQ==","cpu": ["arm64"],"dev": true,+ "libc": [+ "glibc"+ ],"license": "Apache-2.0","optional": true,"os": ["linux"],"engines": {- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ "node": ">=20.9.0"},"funding": {"url": "https://opencollective.com/libvips"},"optionalDependencies": {- "@img/sharp-libvips-linux-arm64": "1.2.4"+ "@img/sharp-libvips-linux-arm64": "1.3.2"}},"node_modules/@img/sharp-linux-ppc64": {- "version": "0.34.5",- "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz",- "integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==",+ "version": "0.35.3",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.3.tgz",+ "integrity": "sha512-sMd8rDxmpLOwv/7N44klFjOD5DUO7FLdjiXDI0hoxYaf7Ar262dQIEkosE98bps+5HPLtp/EvNqeqQtOycP/IA==","cpu": ["ppc64"],"dev": true,+ "libc": [+ "glibc"+ ],"license": "Apache-2.0","optional": true,"os": ["linux"],"engines": {- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ "node": ">=20.9.0"},"funding": {"url": "https://opencollective.com/libvips"},"optionalDependencies": {- "@img/sharp-libvips-linux-ppc64": "1.2.4"+ "@img/sharp-libvips-linux-ppc64": "1.3.2"}},"node_modules/@img/sharp-linux-riscv64": {- "version": "0.34.5",- "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz",- "integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==",+ "version": "0.35.3",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.3.tgz",+ "integrity": "sha512-0Eob78yjlYPfL5vMNWAW55l3R9Y6BQS/gOfe0ZcP9mEz9ohhKSt4im1hayiknXgf8AWrFqMvJcKIdmLmEe7yeQ==","cpu": ["riscv64"],"dev": true,+ "libc": [+ "glibc"+ ],"license": "Apache-2.0","optional": true,"os": ["linux"],"engines": {- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ "node": ">=20.9.0"},"funding": {"url": "https://opencollective.com/libvips"},"optionalDependencies": {- "@img/sharp-libvips-linux-riscv64": "1.2.4"+ "@img/sharp-libvips-linux-riscv64": "1.3.2"}},"node_modules/@img/sharp-linux-s390x": {- "version": "0.34.5",- "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz",- "integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==",+ "version": "0.35.3",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.3.tgz",+ "integrity": "sha512-KgAxQ0DxpNOq1rG2t5cgTgShJFGSuU7XO45cqC+1NVOuZnP6tlgZRuSYOfNupGkHID0o3cJOsw4DVeJpMovcGw==","cpu": ["s390x"],"dev": true,+ "libc": [+ "glibc"+ ],"license": "Apache-2.0","optional": true,"os": ["linux"],"engines": {- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ "node": ">=20.9.0"},"funding": {"url": "https://opencollective.com/libvips"},"optionalDependencies": {- "@img/sharp-libvips-linux-s390x": "1.2.4"+ "@img/sharp-libvips-linux-s390x": "1.3.2"}},"node_modules/@img/sharp-linux-x64": {- "version": "0.34.5",- "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz",- "integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==",+ "version": "0.35.3",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.3.tgz",+ "integrity": "sha512-8pqvxubL2PGdhlPy6GLqzDYMUjyRmKAwKHYKixpdJYBUK7PJ0C029XdsnpFIdgRZG68fZiGdHVWcKPvtiPB4cA==","cpu": ["x64"],"dev": true,+ "libc": [+ "glibc"+ ],"license": "Apache-2.0","optional": true,"os": ["linux"],"engines": {- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ "node": ">=20.9.0"},"funding": {"url": "https://opencollective.com/libvips"},"optionalDependencies": {- "@img/sharp-libvips-linux-x64": "1.2.4"+ "@img/sharp-libvips-linux-x64": "1.3.2"}},"node_modules/@img/sharp-linuxmusl-arm64": {- "version": "0.34.5",- "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz",- "integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==",+ "version": "0.35.3",+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.3.tgz",+ "integrity": "sha512-Vz0iQjzzcSX3HCbfwFfCSG/9SCIqyO0mH2sXyiHaAYfBk0cRsCWXRyQYX0ovCK/PAQBbTzQ0dsPQHh5MAFL59w==","cpu": ["arm64"],"dev": true,+ "libc": [+ "musl"+ ],"license": "Apache-2.0","optional": true,"os": ["linux"],"engines": {- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ "node": ">=20.9.0"},"funding": {"url": "https://opencollective.com/libvips"},"optionalDependencies": {- "@img/sharp-libvips-linuxmusl-arm64": "1.2.4"+ "@img/sharp-libvips-linuxmusl-arm64": "1.3.2"}},"node_modules/@img/sharp-linuxmusl-x64": {- "version": "0.34.5",- "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz",- "integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==",+ "version": "0.35.3",+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.3.tgz",+ "integrity": "sha512-6O1NPKcDVj9QEdg7Hx549EX8U0rp6yXQERqru6yRN7fGBn32UvIRJUlWnk+8xDCiG76hXVBbX82NZ/ZKr0euIg==","cpu": ["x64"],"dev": true,+ "libc": [+ "musl"+ ],"license": "Apache-2.0","optional": true,"os": ["linux"],"engines": {- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ "node": ">=20.9.0"},"funding": {"url": "https://opencollective.com/libvips"},"optionalDependencies": {- "@img/sharp-libvips-linuxmusl-x64": "1.2.4"+ "@img/sharp-libvips-linuxmusl-x64": "1.3.2"}},"node_modules/@img/sharp-wasm32": {- "version": "0.34.5",- "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz",- "integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==",+ "version": "0.35.3",+ "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.3.tgz",+ "integrity": "sha512-cZ0XkcYGpHZkqW6iCkqTcmUC0CD9DhD5d/qeZlZkfRBn6GnHniZXLUo5+9xw8Iv76YE6LQFN9YNBlKREcCG76w==",+ "dev": true,+ "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",+ "optional": true,+ "dependencies": {+ "@emnapi/runtime": "^1.11.1"+ },+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-webcontainers-wasm32": {+ "version": "0.35.3",+ "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.3.tgz",+ "integrity": "sha512-2rnq7bX3NzeR2T4YWgz8qiG4h3TSdMe+vN1iQXpJleSJ3SM5zQ8Fy2SyyXAWlbxpEZ2Y+Z4u1BePgJEYbSy80Q==","cpu": ["wasm32"],"dev": true,- "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",+ "license": "Apache-2.0","optional": true,"dependencies": {- "@emnapi/runtime": "^1.7.0"+ "@img/sharp-wasm32": "0.35.3"},"engines": {- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ "node": ">=20.9.0"},"funding": {"url": "https://opencollective.com/libvips"}},"node_modules/@img/sharp-win32-arm64": {- "version": "0.34.5",- "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz",- "integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==",+ "version": "0.35.3",+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.3.tgz",+ "integrity": "sha512-4bPwFdMbeC4JQ8L8LOyWp6nsHcboP5fxkp6iPOXz2Vg49R42TuMs2whkJ5OAP4/Ul035qOzy0AecOF9VOscn4w==","cpu": ["arm64"],@@ -4616,16 +4707,16 @@"win32"],"engines": {- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ "node": ">=20.9.0"},"funding": {"url": "https://opencollective.com/libvips"}},"node_modules/@img/sharp-win32-ia32": {- "version": "0.34.5",- "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz",- "integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==",+ "version": "0.35.3",+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.3.tgz",+ "integrity": "sha512-r53mXsBN6lFUDiST764SvgwUdHAqM4rPAiDzAmf4fLoB6X/rkfyTrLCg6+g17wJJiCmB3JYgHuUldCWUIRFSXw==","cpu": ["ia32"],@@ -4636,16 +4727,16 @@"win32"],"engines": {- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ "node": "^20.9.0"},"funding": {"url": "https://opencollective.com/libvips"}},"node_modules/@img/sharp-win32-x64": {- "version": "0.34.5",- "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz",- "integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==",+ "version": "0.35.3",+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.3.tgz",+ "integrity": "sha512-D4y1vNeZrIIJCN+uHaWVtH86B+aCrdMYYjicy9pXHvbGZeGYLLSd3wdVuC37FxVXlU1ARsk84eKWfWMXGYEqvA==","cpu": ["x64"],@@ -4656,7 +4747,7 @@"win32"],"engines": {- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ "node": ">=20.9.0"},"funding": {"url": "https://opencollective.com/libvips"@@ -4969,12 +5060,12 @@}},"node_modules/@mermaid-js/parser": {- "version": "1.1.1",- "resolved": "https://registry.npmjs.org/@mermaid-js/parser/-/parser-1.1.1.tgz",- "integrity": "sha512-VuHdsYMK1bT6X2JbcAaWAhugTRvRBRyuZgd+c22swUeI9g/ntaxF7CY7dYarhZovofCbUNO0G7JesfmNtjYOCw==",+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/@mermaid-js/parser/-/parser-1.2.1.tgz",+ "integrity": "sha512-n12NohV3mrUyUL2o93IgG/ifeW9FTyeJn3zDxkhwa8MJ9Fxg3HQMlA3RiGmD/3UnJvheztkjjQAjA2T4LmUcpw==","license": "MIT","dependencies": {- "@chevrotain/types": "~11.1.1"+ "@chevrotain/types": "~11.1.2"}},"node_modules/@microsoft/fetch-event-source": {@@ -6014,19 +6105,29 @@"node": ">=14"}},+ "node_modules/@posthog/browser-common": {+ "version": "0.5.0",+ "resolved": "https://registry.npmjs.org/@posthog/browser-common/-/browser-common-0.5.0.tgz",+ "integrity": "sha512-8DaxVZS1bQPbA514RePurLNbYjei3P4jhnC206DwVv5XThmZM3QdlsXenI2ujE3pLbgQ79hYn9o1Kda8I3WK/Q==",+ "license": "MIT",+ "dependencies": {+ "@posthog/core": "^1.47.0",+ "@posthog/types": "^1.402.2"+ }+ },"node_modules/@posthog/core": {- "version": "1.29.9",- "resolved": "https://registry.npmjs.org/@posthog/core/-/core-1.29.9.tgz",- "integrity": "sha512-DjvuIyBZ2Z/gBhtZlITlM2D8PlnMsHSQ1D78dbUYoVsgGguvanpJTobZObjLlFkybyvfZFYkpoJkFNI/2Pw4IQ==",+ "version": "1.48.6",+ "resolved": "https://registry.npmjs.org/@posthog/core/-/core-1.48.6.tgz",+ "integrity": "sha512-lvSO1nrxxakrAfB51fetHC29gSqdDtT+AyRrGlnc5nDSWhiBGtyqKNjDqsbnlTQoj14bAaWXS7RtzuGoTo5IsQ==","license": "MIT","dependencies": {- "@posthog/types": "1.376.0"+ "@posthog/types": "^1.405.0"}},"node_modules/@posthog/types": {- "version": "1.376.0",- "resolved": "https://registry.npmjs.org/@posthog/types/-/types-1.376.0.tgz",- "integrity": "sha512-gbFfxCuZDs/D4QZMwdE+smD1jsuqgGpS6yKGHZZ19foxMy8RYHsU1E47iG1b88n/uN02fAabLibVwuxLtq8juw==",+ "version": "1.405.0",+ "resolved": "https://registry.npmjs.org/@posthog/types/-/types-1.405.0.tgz",+ "integrity": "sha512-4rZ/taVXKQxs9Jrf7ZjlCRgrOSL69oKAgIWJQa5kRNJ6wll1UANbrJTSY+Su1e88LIG4zZVjKKKjyQHCkHdHcw==","license": "MIT"},"node_modules/@prisma/client": {@@ -6107,6 +6208,8 @@},"node_modules/@protobufjs/aspromise": {"version": "1.1.2",+ "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",+ "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==","license": "BSD-3-Clause"},"node_modules/@protobufjs/base64": {@@ -6120,27 +6223,24 @@"license": "BSD-3-Clause"},"node_modules/@protobufjs/eventemitter": {- "version": "1.1.0",+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.1.tgz",+ "integrity": "sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==","license": "BSD-3-Clause"},"node_modules/@protobufjs/fetch": {- "version": "1.1.0",+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.1.tgz",+ "integrity": "sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==","license": "BSD-3-Clause","dependencies": {- "@protobufjs/aspromise": "^1.1.1",- "@protobufjs/inquire": "^1.1.0"+ "@protobufjs/aspromise": "^1.1.1"}},"node_modules/@protobufjs/float": {"version": "1.0.2","license": "BSD-3-Clause"},- "node_modules/@protobufjs/inquire": {- "version": "1.1.1",- "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.1.tgz",- "integrity": "sha512-mnzgDV26ueAvk7rsbt9L7bE0SuAoqyuys/sMMrmVcN5x9VsxpcG3rqAUSgDyLp0UZlmNfIbQ4fHfCtreVBk8Ew==",- "license": "BSD-3-Clause"- },"node_modules/@protobufjs/path": {"version": "1.1.2","license": "BSD-3-Clause"@@ -7659,27 +7759,27 @@}},"node_modules/@react-email/ui": {- "version": "6.3.2",- "resolved": "https://registry.npmjs.org/@react-email/ui/-/ui-6.3.2.tgz",- "integrity": "sha512-wjwbl6/I8S1Ictt0G3VflvJi5PyTI05jSRqC7LbHkivAoIpymEe/WJwxtGbKXoMlX4II7aYBpilsc2o5Lbo2pw==",+ "version": "6.9.2",+ "resolved": "https://registry.npmjs.org/@react-email/ui/-/ui-6.9.2.tgz",+ "integrity": "sha512-nCE8uZJuhNB7E6j8Prq6tfcswHMbiNwM4a+t2Q83AjgkDUhki1TwvKjQ9yfLLSquQuu9oFKNaTvYUNZ8yTdGNw==","dev": true,"license": "MIT","dependencies": {- "esbuild": "0.28.0",- "next": "16.2.6"+ "esbuild": "0.28.1",+ "next": "16.3.0"}},"node_modules/@react-email/ui/node_modules/@next/env": {- "version": "16.2.6",- "resolved": "https://registry.npmjs.org/@next/env/-/env-16.2.6.tgz",- "integrity": "sha512-gd8HoHN4ufj73WmR3JmVolrpJR47ILK6LouP5xElPglaVxir6e1a7VzvTvDWkOoPXT9rkkTzyCxBu4yeZfZwcw==",+ "version": "16.3.0",+ "resolved": "https://registry.npmjs.org/@next/env/-/env-16.3.0.tgz",+ "integrity": "sha512-o9r1S0BNiNreHP9Vs+Qnqd9kviDkJh8xIACY7UFZSmiGbbQRzPBBosvHzAU4TULHOIuOj/18RSsyz2qrREmIFw==","dev": true,"license": "MIT"},"node_modules/@react-email/ui/node_modules/@next/swc-darwin-arm64": {- "version": "16.2.6",- "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.2.6.tgz",- "integrity": "sha512-ZJGkkcNfYgrrMkqOdZ7zoLa1TOy0qpcMfk/z4Mh/FKUz40gVO+HNQWqmLxf67Z5WB64DRp0dhEbyHfel+6sJUg==",+ "version": "16.3.0",+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.3.0.tgz",+ "integrity": "sha512-55hpqq18bEVAlxedlTt3tFqZmKg2nUXT1kn1G/BGEy0R13h3LwtwHPVzzjG6P4LLeOHE32PFDQUVaJEWvBEZBw==","cpu": ["arm64"],@@ -7694,9 +7794,9 @@}},"node_modules/@react-email/ui/node_modules/@next/swc-darwin-x64": {- "version": "16.2.6",- "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.2.6.tgz",- "integrity": "sha512-v/YLBHIY132Ced3puBJ7YJKw1lqsCrgcNo2aRJlCEyQrrCeRJlvGlnmxhPxNQI3KE3N1DN5r9TPNPvka3nq5RQ==",+ "version": "16.3.0",+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.3.0.tgz",+ "integrity": "sha512-SOi96kSaF5T+0wW4koiM1bWzSPwjzTesC1p3df+FjdOi5LIQkBK/blxh7HdoKnNuI4PURF1OO7TZqtfnbWDSgw==","cpu": ["x64"],@@ -7711,13 +7811,16 @@}},"node_modules/@react-email/ui/node_modules/@next/swc-linux-arm64-gnu": {- "version": "16.2.6",- "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.2.6.tgz",- "integrity": "sha512-RPOvqlYBbcQjkz9VQQDZ2T2bARIjXZV1KFlt+V2Mr6SW/e4I9fcKsaA0hdyf2FHoTlsV2xnBd5Y912rP/1Ce6w==",+ "version": "16.3.0",+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.3.0.tgz",+ "integrity": "sha512-P0gZAoPMF4dyTRzhmkV4PrqVzSOB6t4mC1oI3c4dqijJ+OVEVx5clIXAKR4/uQpsqw2KKM/0D5tVumcR2r5blg==","cpu": ["arm64"],"dev": true,+ "libc": [+ "glibc"+ ],"license": "MIT","optional": true,"os": [@@ -7728,13 +7831,16 @@}},"node_modules/@react-email/ui/node_modules/@next/swc-linux-arm64-musl": {- "version": "16.2.6",- "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.2.6.tgz",- "integrity": "sha512-URUTu1+dMkxJsPFgm+OeEvq9wf5sujw0EvgYy80TDGHTSLTnIHeqb0Eu8A3sC95IRgjejQL+kC4mw+4yPxiAXA==",+ "version": "16.3.0",+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.3.0.tgz",+ "integrity": "sha512-tXXGKJw0m37O0eKJARVTX/TheKPhz0QFVtVVZXmOig+9YKLQOSP6hvf2pxv5DO7CLEJyTHx3Pg043CDQkv1G4Q==","cpu": ["arm64"],"dev": true,+ "libc": [+ "musl"+ ],"license": "MIT","optional": true,"os": [@@ -7745,13 +7851,16 @@}},"node_modules/@react-email/ui/node_modules/@next/swc-linux-x64-gnu": {- "version": "16.2.6",- "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.2.6.tgz",- "integrity": "sha512-DOj182mPV8G3UkrayLoREM5YEYI+Dk5wv7Ox9xl1fFibAELEsFD0lDPfHIeILlutMMfdyhlzYPELG3peuKaurw==",+ "version": "16.3.0",+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.3.0.tgz",+ "integrity": "sha512-pjGxK5EY7yWml78ALejFkWmgHsU7wbFQrISiugpH6FbUJhgEvw3xFZ/EBAtLl7QtL0WdQKiG9eWJ3mOKGTukHw==","cpu": ["x64"],"dev": true,+ "libc": [+ "glibc"+ ],"license": "MIT","optional": true,"os": [@@ -7762,13 +7871,16 @@}},"node_modules/@react-email/ui/node_modules/@next/swc-linux-x64-musl": {- "version": "16.2.6",- "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.2.6.tgz",- "integrity": "sha512-HKQ5SP/V/ub73UvF7n/zeJlxk2kLmtL7Wzrg4WfmkjmNos5onJ2tKu7yZOPdL18A6Svfn3max29ym+ry7NkK4g==",+ "version": "16.3.0",+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.3.0.tgz",+ "integrity": "sha512-sjo++Xx+lomlPs3HRsHWhVDyGG6ms1kGW5EtHLERdII8AyG1i+f6aq68xHREO6AEMlhjTNEWBSmfJfqm9orf7g==","cpu": ["x64"],"dev": true,+ "libc": [+ "musl"+ ],"license": "MIT","optional": true,"os": [@@ -7779,9 +7891,9 @@}},"node_modules/@react-email/ui/node_modules/@next/swc-win32-arm64-msvc": {- "version": "16.2.6",- "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.2.6.tgz",- "integrity": "sha512-LZXpTlPyS5v7HhSmnvsLGP3iIYgYOBnc8r8ArlT55sGHV89bR2HlDdBjWQ+PY6SJMmk8TuVGFuxalnP3k/0Dwg==",+ "version": "16.3.0",+ "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.3.0.tgz",+ "integrity": "sha512-C5JSgiO54wURdaxdEUIXqkz04uMqC9UmPX1gtDrV/5Tf1UowdWYI8uA5hfFbPolTlp0q4KZ60xlHePNibf0VIw==","cpu": ["arm64"],@@ -7796,9 +7908,9 @@}},"node_modules/@react-email/ui/node_modules/@next/swc-win32-x64-msvc": {- "version": "16.2.6",- "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.2.6.tgz",- "integrity": "sha512-F0+4i0h9J6C4eE3EAPWsoCk7UW/dbzOjyzxY0qnDUOYFu6FFmdZ6l97/XdV3/Nz3VYyO7UWjyEJUXkGqcoXfMA==",+ "version": "16.3.0",+ "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.3.0.tgz",+ "integrity": "sha512-fDOggsweNb5SSw0ZKVk6U+gxSyGFFlIBY/LBc1r8GUj4u/6t6oArL+Pmkg0MBnsgR+KkdsURilVH4F3GXUGepA==","cpu": ["x64"],@@ -7823,9 +7935,9 @@}},"node_modules/@react-email/ui/node_modules/nanoid": {- "version": "3.3.12",- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz",- "integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==",+ "version": "3.3.18",+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz",+ "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==","dev": true,"funding": [{@@ -7842,17 +7954,17 @@}},"node_modules/@react-email/ui/node_modules/next": {- "version": "16.2.6",- "resolved": "https://registry.npmjs.org/next/-/next-16.2.6.tgz",- "integrity": "sha512-qOVgKJg1+At15NpeUP+eJgCHvTCgXsogweq87Ri/Ix7PkqQHg4sdaXmSFqKlgaIXE4kW0g25LE68W87UANlHtw==",+ "version": "16.3.0",+ "resolved": "https://registry.npmjs.org/next/-/next-16.3.0.tgz",+ "integrity": "sha512-NEdGOzH+08eTXMUp9UYkA99Nhi5N6Thrhc1jgFOQgfgnGK/dA2hRwBpXep+exdFQrnwlRf/3Wixyp8lLBUpE2A==","dev": true,"license": "MIT","dependencies": {- "@next/env": "16.2.6",+ "@next/env": "16.3.0","@swc/helpers": "0.5.15","baseline-browser-mapping": "^2.9.19","caniuse-lite": "^1.0.30001579",- "postcss": "8.4.31",+ "postcss": "8.5.23","styled-jsx": "5.1.6"},"bin": {@@ -7862,15 +7974,15 @@"node": ">=20.9.0"},"optionalDependencies": {- "@next/swc-darwin-arm64": "16.2.6",- "@next/swc-darwin-x64": "16.2.6",- "@next/swc-linux-arm64-gnu": "16.2.6",- "@next/swc-linux-arm64-musl": "16.2.6",- "@next/swc-linux-x64-gnu": "16.2.6",- "@next/swc-linux-x64-musl": "16.2.6",- "@next/swc-win32-arm64-msvc": "16.2.6",- "@next/swc-win32-x64-msvc": "16.2.6",- "sharp": "^0.34.5"+ "@next/swc-darwin-arm64": "16.3.0",+ "@next/swc-darwin-x64": "16.3.0",+ "@next/swc-linux-arm64-gnu": "16.3.0",+ "@next/swc-linux-arm64-musl": "16.3.0",+ "@next/swc-linux-x64-gnu": "16.3.0",+ "@next/swc-linux-x64-musl": "16.3.0",+ "@next/swc-win32-arm64-msvc": "16.3.0",+ "@next/swc-win32-x64-msvc": "16.3.0",+ "sharp": "^0.35.3"},"peerDependencies": {"@opentelemetry/api": "^1.1.0",@@ -7896,9 +8008,9 @@}},"node_modules/@react-email/ui/node_modules/postcss": {- "version": "8.4.31",- "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz",- "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==",+ "version": "8.5.23",+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.23.tgz",+ "integrity": "sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg==","dev": true,"funding": [{@@ -7916,9 +8028,9 @@],"license": "MIT","dependencies": {- "nanoid": "^3.3.6",- "picocolors": "^1.0.0",- "source-map-js": "^1.0.2"+ "nanoid": "^3.3.16",+ "picocolors": "^1.1.1",+ "source-map-js": "^1.2.1"},"engines": {"node": "^10 || ^12 || >=14"@@ -10730,15 +10842,15 @@}},"node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {- "version": "5.0.6",- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz",- "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==",+ "version": "5.0.9",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",+ "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==","license": "MIT","dependencies": {"balanced-match": "^4.0.2"},"engines": {- "node": "18 || 20 || >=22"+ "node": "20 || >=22"}},"node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {@@ -12036,18 +12148,20 @@"license": "MIT"},"node_modules/body-parser": {- "version": "2.2.2",+ "version": "2.3.0",+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz",+ "integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==","license": "MIT","dependencies": {"bytes": "^3.1.2",- "content-type": "^1.0.5",+ "content-type": "^2.0.0","debug": "^4.4.3",- "http-errors": "^2.0.0",- "iconv-lite": "^0.7.0",+ "http-errors": "^2.0.1",+ "iconv-lite": "^0.7.2","on-finished": "^2.4.1",- "qs": "^6.14.1",- "raw-body": "^3.0.1",- "type-is": "^2.0.1"+ "qs": "^6.15.2",+ "raw-body": "^3.0.2",+ "type-is": "^2.1.0"},"engines": {"node": ">=18"@@ -12057,6 +12171,19 @@"url": "https://opencollective.com/express"}},+ "node_modules/body-parser/node_modules/content-type": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz",+ "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==",+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },"node_modules/body-parser/node_modules/iconv-lite": {"version": "0.7.2","license": "MIT",@@ -12890,7 +13017,9 @@"license": "ISC"},"node_modules/cytoscape": {- "version": "3.33.2",+ "version": "3.34.1",+ "resolved": "https://registry.npmjs.org/cytoscape/-/cytoscape-3.34.1.tgz",+ "integrity": "sha512-Lr0RvH9H75y9ar8h9Toy6u4lxRSCcxUq+hHcQ26sVWo6BnaQp1gwEZOYqwuYTZhyW7npyKnNLP8oJ2p1/3OZ7g==","license": "MIT","engines": {"node": ">=0.10"@@ -13376,7 +13505,9 @@}},"node_modules/dayjs": {- "version": "1.11.20",+ "version": "1.11.23",+ "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.23.tgz",+ "integrity": "sha512-QDTCU0M0MxR3hQfnlDJfwekQiaanm1ubOD231u73WBckQ/fsamwRLiE2GBz6D3a/xF1NgfiDLJjXBa1hYOYTtQ==","license": "MIT"},"node_modules/debounce": {@@ -13689,7 +13820,9 @@}},"node_modules/dompurify": {- "version": "3.4.0",+ "version": "3.4.14",+ "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.14.tgz",+ "integrity": "sha512-dVoH9z+MY+C9IilgGCk3YfFqjLi3fChm2OiKJMzh6axrJ5qwxqWaZamgmHrpv22CN/KdbZJuGEGgfQoL00LTdg==","license": "(MPL-2.0 OR Apache-2.0)","optionalDependencies": {"@types/trusted-types": "^2.0.7"@@ -14202,9 +14335,9 @@]},"node_modules/esbuild": {- "version": "0.28.0",- "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.0.tgz",- "integrity": "sha512-sNR9MHpXSUV/XB4zmsFKN+QgVG82Cc7+/aaxJ8Adi8hyOac+EXptIp45QBPaVyX3N70664wRbTcLTOemCAnyqw==",+ "version": "0.28.1",+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz",+ "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==","hasInstallScript": true,"license": "MIT","bin": {@@ -14214,32 +14347,32 @@"node": ">=18"},"optionalDependencies": {- "@esbuild/aix-ppc64": "0.28.0",- "@esbuild/android-arm": "0.28.0",- "@esbuild/android-arm64": "0.28.0",- "@esbuild/android-x64": "0.28.0",- "@esbuild/darwin-arm64": "0.28.0",- "@esbuild/darwin-x64": "0.28.0",- "@esbuild/freebsd-arm64": "0.28.0",- "@esbuild/freebsd-x64": "0.28.0",- "@esbuild/linux-arm": "0.28.0",- "@esbuild/linux-arm64": "0.28.0",- "@esbuild/linux-ia32": "0.28.0",- "@esbuild/linux-loong64": "0.28.0",- "@esbuild/linux-mips64el": "0.28.0",- "@esbuild/linux-ppc64": "0.28.0",- "@esbuild/linux-riscv64": "0.28.0",- "@esbuild/linux-s390x": "0.28.0",- "@esbuild/linux-x64": "0.28.0",- "@esbuild/netbsd-arm64": "0.28.0",- "@esbuild/netbsd-x64": "0.28.0",- "@esbuild/openbsd-arm64": "0.28.0",- "@esbuild/openbsd-x64": "0.28.0",- "@esbuild/openharmony-arm64": "0.28.0",- "@esbuild/sunos-x64": "0.28.0",- "@esbuild/win32-arm64": "0.28.0",- "@esbuild/win32-ia32": "0.28.0",- "@esbuild/win32-x64": "0.28.0"+ "@esbuild/aix-ppc64": "0.28.1",+ "@esbuild/android-arm": "0.28.1",+ "@esbuild/android-arm64": "0.28.1",+ "@esbuild/android-x64": "0.28.1",+ "@esbuild/darwin-arm64": "0.28.1",+ "@esbuild/darwin-x64": "0.28.1",+ "@esbuild/freebsd-arm64": "0.28.1",+ "@esbuild/freebsd-x64": "0.28.1",+ "@esbuild/linux-arm": "0.28.1",+ "@esbuild/linux-arm64": "0.28.1",+ "@esbuild/linux-ia32": "0.28.1",+ "@esbuild/linux-loong64": "0.28.1",+ "@esbuild/linux-mips64el": "0.28.1",+ "@esbuild/linux-ppc64": "0.28.1",+ "@esbuild/linux-riscv64": "0.28.1",+ "@esbuild/linux-s390x": "0.28.1",+ "@esbuild/linux-x64": "0.28.1",+ "@esbuild/netbsd-arm64": "0.28.1",+ "@esbuild/netbsd-x64": "0.28.1",+ "@esbuild/openbsd-arm64": "0.28.1",+ "@esbuild/openbsd-x64": "0.28.1",+ "@esbuild/openharmony-arm64": "0.28.1",+ "@esbuild/sunos-x64": "0.28.1",+ "@esbuild/win32-arm64": "0.28.1",+ "@esbuild/win32-ia32": "0.28.1",+ "@esbuild/win32-x64": "0.28.1"}},"node_modules/esbuild-register": {@@ -14505,7 +14638,9 @@}},"node_modules/eslint-plugin-import/node_modules/brace-expansion": {- "version": "1.1.14",+ "version": "1.1.18",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz",+ "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==","license": "MIT","dependencies": {"balanced-match": "^1.0.0",@@ -14574,7 +14709,9 @@}},"node_modules/eslint-plugin-jsx-a11y/node_modules/brace-expansion": {- "version": "1.1.14",+ "version": "1.1.18",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz",+ "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==","license": "MIT","dependencies": {"balanced-match": "^1.0.0",@@ -14632,7 +14769,9 @@}},"node_modules/eslint-plugin-react/node_modules/brace-expansion": {- "version": "1.1.14",+ "version": "1.1.18",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz",+ "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==","license": "MIT","dependencies": {"balanced-match": "^1.0.0",@@ -14725,7 +14864,9 @@}},"node_modules/eslint/node_modules/brace-expansion": {- "version": "1.1.14",+ "version": "1.1.18",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz",+ "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==","license": "MIT","dependencies": {"balanced-match": "^1.0.0",@@ -14981,7 +15122,9 @@}},"node_modules/exceljs/node_modules/brace-expansion": {- "version": "1.1.14",+ "version": "1.1.18",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz",+ "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==","license": "MIT","dependencies": {"balanced-match": "^1.0.0",@@ -15349,9 +15492,9 @@"license": "Unlicense"},"node_modules/fast-uri": {- "version": "3.1.2",- "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.2.tgz",- "integrity": "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==",+ "version": "3.1.5",+ "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.5.tgz",+ "integrity": "sha512-gHwA1O9LDIcKunMKhObS/HimwtehO1nPUECKAu5TpKgaO19fcWEl4bliWe1jWxVFvIXztJjjQ4L8XQ1EU9f7Jw==","funding": [{"type": "github",@@ -15430,6 +15573,15 @@"xml-naming": "^0.3.0"}},+ "node_modules/fastdom": {+ "version": "1.0.12",+ "resolved": "https://registry.npmjs.org/fastdom/-/fastdom-1.0.12.tgz",+ "integrity": "sha512-LB+xjSTEbjHE1cWsxu+tN2Xqr1kpi+V9aADI7sVM5ZMaXyYGPHULQMzpJMYqOTULK/73pUkWVzzObFRBkPr+hg==",+ "license": "MIT",+ "dependencies": {+ "strictdom": "^1.0.1"+ }+ },"node_modules/fastq": {"version": "1.20.1","license": "ISC",@@ -15629,14 +15781,16 @@}},"node_modules/form-data": {- "version": "4.0.5",+ "version": "4.0.6",+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz",+ "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==","license": "MIT","dependencies": {"asynckit": "^0.4.0","combined-stream": "^1.0.8","es-set-tostringtag": "^2.1.0",- "hasown": "^2.0.2",- "mime-types": "^2.1.12"+ "hasown": "^2.0.4",+ "mime-types": "^2.1.35"},"engines": {"node": ">= 6"@@ -15767,7 +15921,9 @@}},"node_modules/fstream/node_modules/brace-expansion": {- "version": "1.1.14",+ "version": "1.1.18",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz",+ "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==","license": "MIT","dependencies": {"balanced-match": "^1.0.0",@@ -16272,7 +16428,9 @@"license": "MIT"},"node_modules/hasown": {- "version": "2.0.3",+ "version": "2.0.4",+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz",+ "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==","license": "MIT","dependencies": {"function-bind": "^1.1.2"@@ -16436,9 +16594,9 @@}},"node_modules/hono": {- "version": "4.12.18",- "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.18.tgz",- "integrity": "sha512-RWzP96k/yv0PQfyXnWjs6zot20TqfpfsNXhOnev8d1InAxubW93L11/oNUc3tQqn2G0bSdAOBpX+2uDFHV7kdQ==",+ "version": "4.13.3",+ "resolved": "https://registry.npmjs.org/hono/-/hono-4.13.3.tgz",+ "integrity": "sha512-r8AO2mYHoLxSHkgafNeC/BXyb2vWRxD3jem4Ts+ptav8oTG5FIRifAjuJEmZI4bSvvc2ns0GxmIYiZnHqN3mMw==","license": "MIT","engines": {"node": ">=16.9.0"@@ -16513,6 +16671,7 @@},"node_modules/htmlparser2": {"version": "10.1.0",+ "dev": true,"funding": ["https://github.com/fb55/htmlparser2?sponsor=1",{@@ -16530,6 +16689,7 @@},"node_modules/htmlparser2/node_modules/entities": {"version": "7.0.1",+ "dev": true,"license": "BSD-2-Clause","engines": {"node": ">=0.12"@@ -16837,9 +16997,9 @@}},"node_modules/ip-address": {- "version": "10.2.0",- "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.2.0.tgz",- "integrity": "sha512-/+S6j4E9AHvW9SWMSEY9Xfy66O5PWvVEJ08O0y5JGyEKQpojb0K0GKpz/v5HJ/G0vi3D2sjGK78119oXZeE0qA==",+ "version": "10.5.0",+ "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.5.0.tgz",+ "integrity": "sha512-R5SnVLJmgYYvf2F2ZgwSBnelz5G4q5AxIC277GDfUaNbrZKNANcBC7RHqYYePlszf4kBolVkJauG0ZjHHFh55g==","license": "MIT","engines": {"node": ">= 12"@@ -17459,7 +17619,19 @@"license": "MIT"},"node_modules/js-yaml": {- "version": "4.1.1",+ "version": "4.3.1",+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.1.tgz",+ "integrity": "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/puzrin"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/nodeca"+ }+ ],"license": "MIT","dependencies": {"argparse": "^2.0.1"@@ -17660,7 +17832,9 @@}},"node_modules/katex": {- "version": "0.16.21",+ "version": "0.18.4",+ "resolved": "https://registry.npmjs.org/katex/-/katex-0.18.4.tgz",+ "integrity": "sha512-IMPntbRLOU+eu88XDiFKqQ8Akhr9Tv7jDMXqPhjG9SI1JMA4DIgXk4x9k4skJz2NZJXBRbC+2pYBLj9olqcZow==","funding": ["https://opencollective.com/katex","https://github.com/sponsors/katex"@@ -18456,26 +18630,27 @@}},"node_modules/mermaid": {- "version": "11.15.0",- "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-11.15.0.tgz",- "integrity": "sha512-pTMbcf3rWdtLiYGpmoTjHEpeY8seiy6sR+9nD7LOs8KfUbHE4lOUAprTRqRAcWSQ6MQpdX+YEsxShtGsINtPtw==",+ "version": "11.17.0",+ "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-11.17.0.tgz",+ "integrity": "sha512-Jo9N377Wb4MSnHFPTbLi2SxFpsQl4eVHoxnW5U1Md9EazvgMp3s+4ohDxr81YNTgbn5Kj7HJ3yslrSJ52kwpbA==","license": "MIT","dependencies": {- "@braintree/sanitize-url": "^7.1.1",+ "@braintree/sanitize-url": "^7.1.2","@iconify/utils": "^3.0.2",- "@mermaid-js/parser": "^1.1.1",+ "@mermaid-js/parser": "^1.2.1","@types/d3": "^7.4.3","@upsetjs/venn.js": "^2.0.0",- "cytoscape": "^3.33.1",+ "cytoscape": "^3.34.0","cytoscape-cose-bilkent": "^4.1.0","cytoscape-fcose": "^2.2.0","d3": "^7.9.0","d3-sankey": "^0.12.3","dagre-d3-es": "7.0.14",- "dayjs": "^1.11.19",- "dompurify": "^3.3.1",+ "dayjs": "^1.11.21",+ "dompurify": "^3.3.3","es-toolkit": "^1.45.1",- "katex": "^0.16.25",+ "fastdom": "1.0.12",+ "katex": "^0.16.47","khroma": "^2.1.0","marked": "^16.3.0","roughjs": "^4.6.6",@@ -18486,13 +18661,17 @@},"node_modules/mermaid/node_modules/commander": {"version": "8.3.0",+ "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",+ "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==","license": "MIT","engines": {"node": ">= 12"}},"node_modules/mermaid/node_modules/katex": {- "version": "0.16.45",+ "version": "0.16.47",+ "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.47.tgz",+ "integrity": "sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg==","funding": ["https://opencollective.com/katex","https://github.com/sponsors/katex"@@ -19349,9 +19528,9 @@"optional": true},"node_modules/nanoid": {- "version": "5.1.11",- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.11.tgz",- "integrity": "sha512-v+KEsUv2ps74PaSKv0gHTxTCgMXOIfBEbaqa6w6ISIGC7ZsvHN4N9oJ8d4cmf0n5oTzQz2SLmThbQWhjd/8eKg==",+ "version": "5.1.16",+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.16.tgz",+ "integrity": "sha512-kVrnsrJqMR8+oLJnGEmSWw9BivK5mt7H3FZatVRjrc5wGqFYuBxX1yG7+A7Gi5AefkX6t/oCkizcQgpu0cY1dQ==","funding": [{"type": "github",@@ -19454,7 +19633,9 @@}},"node_modules/next-auth": {- "version": "4.24.14",+ "version": "4.24.15",+ "resolved": "https://registry.npmjs.org/next-auth/-/next-auth-4.24.15.tgz",+ "integrity": "sha512-NnjYtjrSOAx/TIVFGTX4IfI/9yHnNpi4B7FuLUwuV20v2Zxgr2OGP/YN0ynJuI7y8QOnTBPitfOdEXZrVvhIuA==","license": "ISC","dependencies": {"@babel/runtime": "^7.20.13",@@ -19465,7 +19646,7 @@"openid-client": "^5.4.0","preact": "^10.6.3","preact-render-to-string": "^5.1.19",- "uuid": "^8.3.2"+ "uuid": "^11.1.1"},"peerDependencies": {"@auth/core": "0.34.3",@@ -19520,13 +19701,6 @@"url": "https://github.com/sponsors/panva"}},- "node_modules/next-auth/node_modules/uuid": {- "version": "8.3.2",- "license": "MIT",- "bin": {- "uuid": "dist/bin/uuid"- }- },"node_modules/next-themes": {"version": "0.4.6","license": "MIT",@@ -19544,7 +19718,9 @@}},"node_modules/next/node_modules/nanoid": {- "version": "3.3.11",+ "version": "3.3.18",+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz",+ "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==","funding": [{"type": "github",@@ -20820,9 +20996,9 @@"license": "MIT"},"node_modules/postcss/node_modules/nanoid": {- "version": "3.3.17",- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.17.tgz",- "integrity": "sha512-xQLf0A3HOMlgHq0n247/LRuAOYmB7dXJ/DvAxGvsSBij45XtBSmQycu+F8ODbHwns/XyFZagyL1+J0Offw1E0g==",+ "version": "3.3.18",+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz",+ "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==","funding": [{"type": "github",@@ -20869,163 +21045,39 @@}},"node_modules/posthog-js": {- "version": "1.376.0",- "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.376.0.tgz",- "integrity": "sha512-YGfQ6gSmqmEh287PHjXRDJ9zML3Su1UIt1+xjRy7Yk6yW43Sc7sFK3CpCkLchCGhIA4x6VaqK+LaqB+7+MCo7A==",- "license": "SEE LICENSE IN LICENSE",- "dependencies": {- "@opentelemetry/api": "^1.9.0",- "@opentelemetry/api-logs": "^0.208.0",- "@opentelemetry/exporter-logs-otlp-http": "^0.208.0",- "@opentelemetry/resources": "^2.2.0",- "@opentelemetry/sdk-logs": "^0.208.0",- "@posthog/core": "1.29.9",- "@posthog/types": "1.376.0",- "core-js": "^3.38.1",- "dompurify": "^3.3.2",+ "version": "1.418.7",+ "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.418.7.tgz",+ "integrity": "sha512-Odq14kIy6CpZHq+22WVbcl25vUNgyBGH+vH+95vnEVO8RhG1U1j6DBYHDweFRFJ9yRVsQb5ejCYAOnpkRFXISA==",+ "license": "(Apache-2.0 AND MIT)",+ "dependencies": {+ "@posthog/browser-common": "^0.5.0",+ "@posthog/core": "^1.48.6",+ "@posthog/types": "^1.405.0",+ "core-js": "^3.49.0",+ "dompurify": "^3.4.13","fflate": "^0.4.8",- "preact": "^10.28.2",+ "preact": "^10.29.3","query-selector-shadow-dom": "^1.0.1",- "web-vitals": "^5.1.0"- }- },- "node_modules/posthog-js/node_modules/@opentelemetry/api-logs": {- "version": "0.208.0",- "license": "Apache-2.0",- "dependencies": {- "@opentelemetry/api": "^1.3.0"- },- "engines": {- "node": ">=8.0.0"- }- },- "node_modules/posthog-js/node_modules/@opentelemetry/core": {- "version": "2.2.0",- "license": "Apache-2.0",- "dependencies": {- "@opentelemetry/semantic-conventions": "^1.29.0"- },- "engines": {- "node": "^18.19.0 || >=20.6.0"- },- "peerDependencies": {- "@opentelemetry/api": ">=1.0.0 <1.10.0"- }- },- "node_modules/posthog-js/node_modules/@opentelemetry/exporter-logs-otlp-http": {- "version": "0.208.0",- "license": "Apache-2.0",- "dependencies": {- "@opentelemetry/api-logs": "0.208.0",- "@opentelemetry/core": "2.2.0",- "@opentelemetry/otlp-exporter-base": "0.208.0",- "@opentelemetry/otlp-transformer": "0.208.0",- "@opentelemetry/sdk-logs": "0.208.0"- },- "engines": {- "node": "^18.19.0 || >=20.6.0"- },- "peerDependencies": {- "@opentelemetry/api": "^1.3.0"- }- },- "node_modules/posthog-js/node_modules/@opentelemetry/otlp-exporter-base": {- "version": "0.208.0",- "license": "Apache-2.0",- "dependencies": {- "@opentelemetry/core": "2.2.0",- "@opentelemetry/otlp-transformer": "0.208.0"- },- "engines": {- "node": "^18.19.0 || >=20.6.0"- },- "peerDependencies": {- "@opentelemetry/api": "^1.3.0"- }- },- "node_modules/posthog-js/node_modules/@opentelemetry/otlp-transformer": {- "version": "0.208.0",- "license": "Apache-2.0",- "dependencies": {- "@opentelemetry/api-logs": "0.208.0",- "@opentelemetry/core": "2.2.0",- "@opentelemetry/resources": "2.2.0",- "@opentelemetry/sdk-logs": "0.208.0",- "@opentelemetry/sdk-metrics": "2.2.0",- "@opentelemetry/sdk-trace-base": "2.2.0",- "protobufjs": "^7.3.0"- },- "engines": {- "node": "^18.19.0 || >=20.6.0"- },- "peerDependencies": {- "@opentelemetry/api": "^1.3.0"- }- },- "node_modules/posthog-js/node_modules/@opentelemetry/resources": {- "version": "2.2.0",- "license": "Apache-2.0",- "dependencies": {- "@opentelemetry/core": "2.2.0",- "@opentelemetry/semantic-conventions": "^1.29.0"- },- "engines": {- "node": "^18.19.0 || >=20.6.0"- },- "peerDependencies": {- "@opentelemetry/api": ">=1.3.0 <1.10.0"- }- },- "node_modules/posthog-js/node_modules/@opentelemetry/sdk-logs": {- "version": "0.208.0",- "license": "Apache-2.0",- "dependencies": {- "@opentelemetry/api-logs": "0.208.0",- "@opentelemetry/core": "2.2.0",- "@opentelemetry/resources": "2.2.0"- },- "engines": {- "node": "^18.19.0 || >=20.6.0"- },- "peerDependencies": {- "@opentelemetry/api": ">=1.4.0 <1.10.0"- }- },- "node_modules/posthog-js/node_modules/@opentelemetry/sdk-metrics": {- "version": "2.2.0",- "license": "Apache-2.0",- "dependencies": {- "@opentelemetry/core": "2.2.0",- "@opentelemetry/resources": "2.2.0"- },- "engines": {- "node": "^18.19.0 || >=20.6.0"- },- "peerDependencies": {- "@opentelemetry/api": ">=1.9.0 <1.10.0"- }- },- "node_modules/posthog-js/node_modules/@opentelemetry/sdk-trace-base": {- "version": "2.2.0",- "license": "Apache-2.0",- "dependencies": {- "@opentelemetry/core": "2.2.0",- "@opentelemetry/resources": "2.2.0",- "@opentelemetry/semantic-conventions": "^1.29.0"- },- "engines": {- "node": "^18.19.0 || >=20.6.0"- },- "peerDependencies": {- "@opentelemetry/api": ">=1.3.0 <1.10.0"+ "web-vitals": "^5.3.0",+ "web-vitals-soft-navs": "npm:[email protected]"}},"node_modules/preact": {- "version": "10.29.1",+ "version": "10.29.8",+ "resolved": "https://registry.npmjs.org/preact/-/preact-10.29.8.tgz",+ "integrity": "sha512-ej2aVZ+vZ8WO7tvlQWRM9N63A0KzF9q4mWJfDUHgYaIofWY9hu74QdnQrjoPMmZi2/nZ5gN0bJCQF49xQqx09Q==","license": "MIT","funding": {"type": "opencollective","url": "https://opencollective.com/preact"+ },+ "peerDependencies": {+ "preact-render-to-string": ">=5"+ },+ "peerDependenciesMeta": {+ "preact-render-to-string": {+ "optional": true+ }}},"node_modules/preact-render-to-string": {@@ -21390,24 +21442,23 @@}},"node_modules/protobufjs": {- "version": "7.5.8",- "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.8.tgz",- "integrity": "sha512-dvpCIeLPbXZS/Ete7yLaO7RenOdken2NHKykBXbsaGxZT0UTltcarBciw+A78SRQs9iMAAVpsYA+l8b1hTePIA==",+ "version": "7.6.5",+ "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.6.5.tgz",+ "integrity": "sha512-/FPD0nUc9jH6rfFjji9IBqOz4pcSE3CsT1m7Ep6Mdb0LxSUMj8hgl6GomOvZzpNpAqqGaXA0P3VSrZLFzIhQrw==","hasInstallScript": true,"license": "BSD-3-Clause","dependencies": {"@protobufjs/aspromise": "^1.1.2","@protobufjs/base64": "^1.1.2","@protobufjs/codegen": "^2.0.5",- "@protobufjs/eventemitter": "^1.1.0",- "@protobufjs/fetch": "^1.1.0",+ "@protobufjs/eventemitter": "^1.1.1",+ "@protobufjs/fetch": "^1.1.1","@protobufjs/float": "^1.0.2",- "@protobufjs/inquire": "^1.1.1","@protobufjs/path": "^1.1.2","@protobufjs/pool": "^1.1.0","@protobufjs/utf8": "^1.1.1","@types/node": ">=13.7.0",- "long": "^5.0.0"+ "long": "^5.3.2"},"engines": {"node": ">=12.0.0"@@ -21766,15 +21817,15 @@}},"node_modules/react-email/node_modules/brace-expansion": {- "version": "5.0.6",- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz",- "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==",+ "version": "5.0.9",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",+ "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==","license": "MIT","dependencies": {"balanced-match": "^4.0.2"},"engines": {- "node": "18 || 20 || >=22"+ "node": "20 || >=22"}},"node_modules/react-email/node_modules/commander": {@@ -21785,9 +21836,9 @@}},"node_modules/react-email/node_modules/engine.io": {- "version": "6.6.8",- "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.8.tgz",- "integrity": "sha512-2agL3ueZhqxoVrfmntO8yuVj+uNSlIOnhykYHk3Cq0ShYPdUjjUiSJrQvXjq01I9jAuI0Zl2YO8Evv5Mqytm5g==",+ "version": "6.6.9",+ "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.9.tgz",+ "integrity": "sha512-clKkw4C7nJ22mGgoVcCg6V/W/TxdNyIOTr89k2ONZu81qqkddPFDF0LXcbAwhzPD8DjkiRCjzuiO6Y+fkpD4vg==","license": "MIT","dependencies": {"@types/cors": "^2.8.12",@@ -21799,7 +21850,7 @@"cors": "~2.8.5","debug": "~4.4.1","engine.io-parser": "~5.2.1",- "ws": "~8.20.1"+ "ws": "~8.21.0"},"engines": {"node": ">=10.2.0"@@ -21905,27 +21956,6 @@"node": ">=6"}},- "node_modules/react-email/node_modules/ws": {- "version": "8.20.1",- "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.1.tgz",- "integrity": "sha512-It4dO0K5v//JtTXuPkfEOaI3uUN87iYPnqo/ZzqCoG3g8uhA66QUMs/SrM0YK7/NAu+r4LMh/9dq2A7k+rHs+w==",- "license": "MIT",- "engines": {- "node": ">=10.0.0"- },- "peerDependencies": {- "bufferutil": "^4.0.1",- "utf-8-validate": ">=5.0.2"- },- "peerDependenciesMeta": {- "bufferutil": {- "optional": true- },- "utf-8-validate": {- "optional": true- }- }- },"node_modules/react-fast-compare": {"version": "3.2.2","license": "MIT"@@ -21947,9 +21977,9 @@}},"node_modules/react-hotkeys-hook": {- "version": "5.3.2",- "resolved": "https://registry.npmjs.org/react-hotkeys-hook/-/react-hotkeys-hook-5.3.2.tgz",- "integrity": "sha512-DDDy9xK6mbTQ6aPlQvIl0dA/a90T/AWml4Rm21JXFDLlRHalIg4/Rv3equUQYs5xPTWq+oEl6RD7mi/nBpU3Uw==",+ "version": "5.3.3",+ "resolved": "https://registry.npmjs.org/react-hotkeys-hook/-/react-hotkeys-hook-5.3.3.tgz",+ "integrity": "sha512-aswgyWUnE25hmhzHTfKDmKzsaSE5DJ4LKaU/o6rQSXkDd/1Bh9TfAFQbHkf6fLy11HvlYkp+cDDarGdhmCDhoQ==","license": "MIT","workspaces": ["packages/*"@@ -22058,19 +22088,21 @@}},"node_modules/react-notion-x": {- "version": "7.10.0",+ "version": "7.12.1",+ "resolved": "https://registry.npmjs.org/react-notion-x/-/react-notion-x-7.12.1.tgz",+ "integrity": "sha512-AgCRIzlDWuVT2U21mUggJK2qm+KNcIBl4GDWFBjz5x2rORz0vBy1XUEzUB1c4qfpD7M5kFoPe/DOusOtxBYtTQ==","license": "MIT","dependencies": {"@fisch0920/medium-zoom": "^1.0.7","@matejmazur/react-katex": "^3.1.3",- "katex": "0.16.21",- "notion-types": "7.10.0",- "notion-utils": "7.10.0",+ "katex": "0.18.4",+ "notion-types": "7.12.1",+ "notion-utils": "7.12.1","prismjs": "^1.30.0","react-fast-compare": "^3.2.0",- "react-hotkeys-hook": "^4.5.1",+ "react-hotkeys-hook": "^5.3.3","react-image": "^4.0.3",- "react-intersection-observer": "^9.16.0",+ "react-intersection-observer": "^11.0.0","react-modal": "^3.16.3","unionize": "^3.1.0"},@@ -22078,25 +22110,97 @@"node": ">=18"},"optionalDependencies": {- "react-pdf": "^9.2.1"+ "react-pdf": "^10.4.1"},"peerDependencies": {"react": ">=18","react-dom": ">=18"}},- "node_modules/react-notion-x/node_modules/react-hotkeys-hook": {- "version": "4.6.2",+ "node_modules/react-notion-x/node_modules/memoize": {+ "version": "11.0.0",+ "resolved": "https://registry.npmjs.org/memoize/-/memoize-11.0.0.tgz",+ "integrity": "sha512-cjsfZaC9b1clqPeIVMbb5dLHSXgdgGWGxdAU3oTUUkHiwWTKTBNnSmcqWJncNjYtBi3S8Rp0c5GIiyGztR8TRA==","license": "MIT",- "peerDependencies": {- "react": ">=16.8.1",- "react-dom": ">=16.8.1"+ "dependencies": {+ "mimic-function": "^5.0.1"+ },+ "engines": {+ "node": ">=22"+ },+ "funding": {+ "url": "https://github.com/sindresorhus/memoize?sponsor=1"+ }+ },+ "node_modules/react-notion-x/node_modules/normalize-url": {+ "version": "9.0.1",+ "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-9.0.1.tgz",+ "integrity": "sha512-ARftfC5HdUNu9jJeL8pHj8debUIHA2b91FizCoMzY4lG6dDX13jdvTK0TBe24IBDRf2HvJSzzwEPvmbkQWHRSg==",+ "license": "MIT",+ "engines": {+ "node": ">=20"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/react-notion-x/node_modules/notion-types": {+ "version": "7.12.1",+ "resolved": "https://registry.npmjs.org/notion-types/-/notion-types-7.12.1.tgz",+ "integrity": "sha512-QDeHECIR1RZJzZ+baqWTKRAHIKU05G9iNmno9I0+y/NOLmCyfqTZv7xct0JtIvXw0A7ndGoR7cYthFFPbgje+w==",+ "license": "MIT",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/react-notion-x/node_modules/notion-utils": {+ "version": "7.12.1",+ "resolved": "https://registry.npmjs.org/notion-utils/-/notion-utils-7.12.1.tgz",+ "integrity": "sha512-Zu8jbeHBzoSjszbj6yjkkODCH7ckhMWIWbSLqrfA9smCJ/4kwhfIch26pPaxmAG/7TjH1wykMoTis1ELVHTmuQ==",+ "license": "MIT",+ "dependencies": {+ "is-url-superb": "^6.1.0",+ "memoize": "^11.0.0",+ "normalize-url": "^9.0.1",+ "notion-types": "7.12.1",+ "p-queue": "^9.3.3"+ },+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/react-notion-x/node_modules/p-queue": {+ "version": "9.3.3",+ "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-9.3.3.tgz",+ "integrity": "sha512-NXAOdnEe5FsZJfT4oK84lE1Y5cFFdWlRuOo5tww8DyNMxyRXwn39fIkUtNLKppcPC+UYU/bXujNCUGDv01y7CA==",+ "license": "MIT",+ "dependencies": {+ "eventemitter3": "^5.0.4",+ "p-timeout": "^7.0.0"+ },+ "engines": {+ "node": ">=20"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/react-notion-x/node_modules/p-timeout": {+ "version": "7.0.1",+ "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-7.0.1.tgz",+ "integrity": "sha512-AxTM2wDGORHGEkPCt8yqxOTMgpfbEHqF51f/5fJCmwFC3C/zNcGT63SymH2ttOAaiIws2zVg4+izQCjrakcwHg==",+ "license": "MIT",+ "engines": {+ "node": ">=20"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"}},"node_modules/react-notion-x/node_modules/react-intersection-observer": {- "version": "9.16.0",- "resolved": "https://registry.npmjs.org/react-intersection-observer/-/react-intersection-observer-9.16.0.tgz",- "integrity": "sha512-w9nJSEp+DrW9KmQmeWHQyfaP6b03v+TdXynaoA964Wxt7mdR3An11z4NNCQgL4gKSK7y1ver2Fq+JKH6CWEzUA==",+ "version": "11.0.0",+ "resolved": "https://registry.npmjs.org/react-intersection-observer/-/react-intersection-observer-11.0.0.tgz",+ "integrity": "sha512-tF2PjXa//GcUmkCIcZR2qGsj6HwnuunFQdgeJ89BwFE6epB7E9yIzdr018H1khxG7DiMpIDvAne1GKQMFwn+fw==","license": "MIT","peerDependencies": {"react": "^17.0.0 || ^18.0.0 || ^19.0.0",@@ -22722,7 +22826,9 @@}},"node_modules/rimraf/node_modules/brace-expansion": {- "version": "1.1.14",+ "version": "1.1.18",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz",+ "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==","license": "MIT","dependencies": {"balanced-match": "^1.0.0",@@ -22960,18 +23066,100 @@"license": "MIT"},"node_modules/sanitize-html": {- "version": "2.17.4",- "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-2.17.4.tgz",- "integrity": "sha512-2HW7v2ol/uAM7sX4hbD8Z59OGWmAPrvjL8E71UWlBcj6m+kcF6ilQBLny+cIgY214QJeJT5tQuxKKqX0SQqjGQ==",+ "version": "2.17.7",+ "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-2.17.7.tgz",+ "integrity": "sha512-PGtEkc9cbnedU3s9TmzDbpsZ8w086g/0Q8k8/oIO1NLNU3i5k9yn835CrjJSajp1KMmkisbO1qPXxNKO3welAg==","license": "MIT","dependencies": {"deepmerge": "^4.2.2","escape-string-regexp": "^4.0.0",- "htmlparser2": "^10.1.0",+ "htmlparser2": "^12.0.0","is-plain-object": "^5.0.0","launder": "^1.7.1","parse-srcset": "^1.0.2","postcss": "^8.3.11"+ },+ "engines": {+ "node": ">=22.12.0"+ }+ },+ "node_modules/sanitize-html/node_modules/dom-serializer": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-3.1.1.tgz",+ "integrity": "sha512-4MEa38/QexBob6gFNwu+EGdWvhJ1OKuNwdYY3Y3NyeWDQfnGeDYQUDfIRzWu5B5gsv03so2Uxd28YC6zrsx3Lw==",+ "license": "MIT",+ "dependencies": {+ "domelementtype": "^3.0.0",+ "domhandler": "^6.0.0",+ "entities": "^8.0.0"+ },+ "engines": {+ "node": ">=20.19.0"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1"+ }+ },+ "node_modules/sanitize-html/node_modules/domelementtype": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-3.0.0.tgz",+ "integrity": "sha512-umCQid3jKbDmVjx8jGaW7uUykm4DEUeyV21hPxNMo2nV955DhUThwqyOIDtreepP31hl84X7G5U9ZfsWvIB3Pg==",+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/fb55"+ }+ ],+ "license": "BSD-2-Clause",+ "engines": {+ "node": ">=20.19.0"+ }+ },+ "node_modules/sanitize-html/node_modules/domhandler": {+ "version": "6.0.1",+ "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-6.0.1.tgz",+ "integrity": "sha512-gYzvtM72ZtxQO0T048kd6HWSbbGCNOUwcnfQ01cqIJ4X2IYKFFHZ5mKvrQETcFXxsRObZulDaKmy//R7TPtsBg==",+ "license": "BSD-2-Clause",+ "dependencies": {+ "domelementtype": "^3.0.0"+ },+ "engines": {+ "node": ">=20.19.0"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/fb55/domhandler?sponsor=1"+ }+ },+ "node_modules/sanitize-html/node_modules/domutils": {+ "version": "4.0.2",+ "resolved": "https://registry.npmjs.org/domutils/-/domutils-4.0.2.tgz",+ "integrity": "sha512-qI4JLRKnSzqFqr7hAlS5xQDusBCjKSEG4t4+7aNrIQMHBcsC2TGEhuyABJdYkgSewL57PNLYEiibY2iPKhKpaA==",+ "license": "BSD-2-Clause",+ "dependencies": {+ "dom-serializer": "^3.0.0",+ "domelementtype": "^3.0.0",+ "domhandler": "^6.0.0"+ },+ "engines": {+ "node": ">=20.19.0"+ },+ "funding": {+ "type": "github",+ "url": "https://github.com/fb55/domutils?sponsor=1"+ }+ },+ "node_modules/sanitize-html/node_modules/entities": {+ "version": "8.0.0",+ "resolved": "https://registry.npmjs.org/entities/-/entities-8.0.0.tgz",+ "integrity": "sha512-zwfzJecQ/Uej6tusMqwAqU/6KL2XaB2VZ2Jg54Je6ahNBGNH6Ek6g3jjNCF0fG9EWQKGZNddNjU5F1ZQn/sBnA==",+ "license": "BSD-2-Clause",+ "engines": {+ "node": ">=20.19.0"+ },+ "funding": {+ "url": "https://github.com/fb55/entities?sponsor=1"}},"node_modules/sanitize-html/node_modules/escape-string-regexp": {@@ -22984,6 +23172,28 @@"url": "https://github.com/sponsors/sindresorhus"}},+ "node_modules/sanitize-html/node_modules/htmlparser2": {+ "version": "12.0.0",+ "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-12.0.0.tgz",+ "integrity": "sha512-Tz7u1i95/g2x2jz81+x0FBVhBhY5aRTvD3tXXdFaljuNdzDLJ8UGNRrTcj2cgQvAg3iW/h77Fz15nLW0L0CrZw==",+ "funding": [+ "https://github.com/fb55/htmlparser2?sponsor=1",+ {+ "type": "github",+ "url": "https://github.com/sponsors/fb55"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "domelementtype": "^3.0.0",+ "domhandler": "^6.0.0",+ "domutils": "^4.0.2",+ "entities": "^8.0.0"+ },+ "engines": {+ "node": ">=20.19.0"+ }+ },"node_modules/sax": {"version": "1.6.0","license": "BlueOak-1.0.0",@@ -23019,7 +23229,9 @@}},"node_modules/semver": {- "version": "7.7.4",+ "version": "7.8.5",+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",+ "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==","license": "ISC","bin": {"semver": "bin/semver.js"@@ -23150,49 +23362,54 @@}},"node_modules/sharp": {- "version": "0.34.5",- "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.34.5.tgz",- "integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==",+ "version": "0.35.3",+ "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.3.tgz",+ "integrity": "sha512-ej0zVHuZGHCiABXcNxeYhpRnPNPAcvbG8RMdBAhDAxLKkCRVSpK3Iyu7qbqw3JMzoj0REeM6f3tJLtVwl0023Q==","dev": true,- "hasInstallScript": true,"license": "Apache-2.0","optional": true,"dependencies": {- "@img/colour": "^1.0.0",+ "@img/colour": "^1.1.0","detect-libc": "^2.1.2",- "semver": "^7.7.3"+ "semver": "^7.8.5"},"engines": {- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"+ "node": ">=20.9.0"},"funding": {"url": "https://opencollective.com/libvips"},"optionalDependencies": {- "@img/sharp-darwin-arm64": "0.34.5",- "@img/sharp-darwin-x64": "0.34.5",- "@img/sharp-libvips-darwin-arm64": "1.2.4",- "@img/sharp-libvips-darwin-x64": "1.2.4",- "@img/sharp-libvips-linux-arm": "1.2.4",- "@img/sharp-libvips-linux-arm64": "1.2.4",- "@img/sharp-libvips-linux-ppc64": "1.2.4",- "@img/sharp-libvips-linux-riscv64": "1.2.4",- "@img/sharp-libvips-linux-s390x": "1.2.4",- "@img/sharp-libvips-linux-x64": "1.2.4",- "@img/sharp-libvips-linuxmusl-arm64": "1.2.4",- "@img/sharp-libvips-linuxmusl-x64": "1.2.4",- "@img/sharp-linux-arm": "0.34.5",- "@img/sharp-linux-arm64": "0.34.5",- "@img/sharp-linux-ppc64": "0.34.5",- "@img/sharp-linux-riscv64": "0.34.5",- "@img/sharp-linux-s390x": "0.34.5",- "@img/sharp-linux-x64": "0.34.5",- "@img/sharp-linuxmusl-arm64": "0.34.5",- "@img/sharp-linuxmusl-x64": "0.34.5",- "@img/sharp-wasm32": "0.34.5",- "@img/sharp-win32-arm64": "0.34.5",- "@img/sharp-win32-ia32": "0.34.5",- "@img/sharp-win32-x64": "0.34.5"+ "@img/sharp-darwin-arm64": "0.35.3",+ "@img/sharp-darwin-x64": "0.35.3",+ "@img/sharp-freebsd-wasm32": "0.35.3",+ "@img/sharp-libvips-darwin-arm64": "1.3.2",+ "@img/sharp-libvips-darwin-x64": "1.3.2",+ "@img/sharp-libvips-linux-arm": "1.3.2",+ "@img/sharp-libvips-linux-arm64": "1.3.2",+ "@img/sharp-libvips-linux-ppc64": "1.3.2",+ "@img/sharp-libvips-linux-riscv64": "1.3.2",+ "@img/sharp-libvips-linux-s390x": "1.3.2",+ "@img/sharp-libvips-linux-x64": "1.3.2",+ "@img/sharp-libvips-linuxmusl-arm64": "1.3.2",+ "@img/sharp-libvips-linuxmusl-x64": "1.3.2",+ "@img/sharp-linux-arm": "0.35.3",+ "@img/sharp-linux-arm64": "0.35.3",+ "@img/sharp-linux-ppc64": "0.35.3",+ "@img/sharp-linux-riscv64": "0.35.3",+ "@img/sharp-linux-s390x": "0.35.3",+ "@img/sharp-linux-x64": "0.35.3",+ "@img/sharp-linuxmusl-arm64": "0.35.3",+ "@img/sharp-linuxmusl-x64": "0.35.3",+ "@img/sharp-webcontainers-wasm32": "0.35.3",+ "@img/sharp-win32-arm64": "0.35.3",+ "@img/sharp-win32-ia32": "0.35.3",+ "@img/sharp-win32-x64": "0.35.3"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ }}},"node_modules/shebang-command": {@@ -23378,34 +23595,13 @@}},"node_modules/socket.io-adapter": {- "version": "2.5.7",- "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.7.tgz",- "integrity": "sha512-e0LyK91f3cUxTmv95/KzoLg47+zF+s/sbxRGDNsyG4dmIP8ZSX8ax6byOxfJXeNNtS/8AZlfD+uP7gBeR7DLlg==",+ "version": "2.5.8",+ "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.8.tgz",+ "integrity": "sha512-6Oy52pbg+kvdCVvjcN+FnY7BvxZ7cIHNScbvztT/It5d0vbwoJoVZmF2gjJmnV0/4WlXRfG15zc45ySk9Ah8bw==","license": "MIT","dependencies": {"debug": "~4.4.1",- "ws": "~8.20.1"- }- },- "node_modules/socket.io-adapter/node_modules/ws": {- "version": "8.20.1",- "resolved": "https://registry.npmjs.org/ws/-/ws-8.20.1.tgz",- "integrity": "sha512-It4dO0K5v//JtTXuPkfEOaI3uUN87iYPnqo/ZzqCoG3g8uhA66QUMs/SrM0YK7/NAu+r4LMh/9dq2A7k+rHs+w==",- "license": "MIT",- "engines": {- "node": ">=10.0.0"- },- "peerDependencies": {- "bufferutil": "^4.0.1",- "utf-8-validate": ">=5.0.2"- },- "peerDependenciesMeta": {- "bufferutil": {- "optional": true- },- "utf-8-validate": {- "optional": true- }+ "ws": "~8.21.0"}},"node_modules/socket.io-client": {@@ -23441,7 +23637,9 @@}},"node_modules/socket.io-parser": {- "version": "4.2.6",+ "version": "4.2.7",+ "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.7.tgz",+ "integrity": "sha512-IH/iSeO9T6gz1KkFleGDWkG9N3dl4jXVYUtMhIqH10Md0ttMer8nUNWiP1DKuNrybD2xBrixLJdCC9J6ECoYkg==","license": "MIT","dependencies": {"@socket.io/component-emitter": "~3.1.0",@@ -23673,6 +23871,12 @@"text-decoder": "^1.1.0"}},+ "node_modules/strictdom": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/strictdom/-/strictdom-1.0.1.tgz",+ "integrity": "sha512-cEmp9QeXXRmjj/rVp9oyiqcvyocWab/HaoN4+bwFeZ7QzykJD6L3yD4v12K1x0tHpqRqVpJevN3gW7kyM39Bqg==",+ "license": "MIT"+ },"node_modules/string_decoder": {"version": "1.3.0","license": "MIT",@@ -24463,7 +24667,9 @@}},"node_modules/tmp": {- "version": "0.2.5",+ "version": "0.2.7",+ "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.7.tgz",+ "integrity": "sha512-e0votIpp4Uo2AJYSzVHV6xCcawuiez3DzqDAbrTc3YxBkplN6e+dM13ZeIcZnDg/QpSuU2zfZ3rzwY8ukEnaXw==","license": "MIT","engines": {"node": ">=14.14"@@ -24685,15 +24891,34 @@}},"node_modules/type-is": {- "version": "2.0.1",+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz",+ "integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==","license": "MIT","dependencies": {- "content-type": "^1.0.5",+ "content-type": "^2.0.0","media-typer": "^1.1.0","mime-types": "^3.0.0"},"engines": {- "node": ">= 0.6"+ "node": ">= 18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/type-is/node_modules/content-type": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz",+ "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==",+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"}},"node_modules/typed-array-buffer": {@@ -24967,7 +25192,9 @@"license": "MIT"},"node_modules/undici": {- "version": "6.25.0",+ "version": "6.28.0",+ "resolved": "https://registry.npmjs.org/undici/-/undici-6.28.0.tgz",+ "integrity": "sha512-LIY910g9TI13YS95lrMFrs8Rm/u/irgHeTWoKCoteeJ04CUJ92eEfj0rVn+7VKMPBpUPiUoBKfhNyLI23EE/KA==","license": "MIT","engines": {"node": ">=18.17"@@ -25926,7 +26153,16 @@}},"node_modules/web-vitals": {- "version": "5.2.0",+ "version": "5.3.0",+ "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-5.3.0.tgz",+ "integrity": "sha512-q6LWsLatGYZp5VGBIOvbTj6JBV2nOmC8KvWztXBmwJcfFAzhwKwbOxhUH306XY3CcaZDUlSmSuNPBsCn0bFu+g==",+ "license": "Apache-2.0"+ },+ "node_modules/web-vitals-soft-navs": {+ "name": "web-vitals",+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-6.0.0.tgz",+ "integrity": "sha512-Guaibvy/+uNtL6Bsu4jmMJGzuSl91oeRH5iO9pPRbYftnFUr3yqT1TUNX/OE4o9HexuEMU3Kb/Wg7iKhlffZUA==","license": "Apache-2.0"},"node_modules/webidl-conversions": {diff --git a/pages/api/links/[id]/index.ts b/pages/api/links/[id]/index.tsindex 274eb788..a5ab5210 100644--- a/pages/api/links/[id]/index.ts+++ b/pages/api/links/[id]/index.ts@@ -1,5 +1,6 @@import { NextApiRequest, NextApiResponse } from "next";+import { resolveOwnedBrandId } from "@/ee/features/branding/lib/resolve-base-brand";import { LinkAudienceType } from "@prisma/client";import { customAlphabet } from "nanoid";import { getServerSession } from "next-auth/next";@@ -374,6 +375,11 @@ export default async function handle(}}+ const nextBrandId =+ linkData.brandId === undefined+ ? undefined+ : await resolveOwnedBrandId(teamId, linkData.brandId);+const updatedLink = await prisma.$transaction(async (tx) => {const link = await tx.link.update({where: { id, teamId },@@ -406,6 +412,7 @@ export default async function handle(metaImage: linkData.metaImage || null,metaFavicon: linkData.metaFavicon || null,welcomeMessage: linkData.welcomeMessage || null,+ ...(nextBrandId !== undefined && { brandId: nextBrandId }),...(linkData.customFields && {customFields: {deleteMany: {}, // Delete all existing custom fieldsdiff --git a/pages/api/links/download/verify.ts b/pages/api/links/download/verify.tsindex 64a4554f..3cf6defc 100644--- a/pages/api/links/download/verify.ts+++ b/pages/api/links/download/verify.ts@@ -63,7 +63,13 @@ export default async function handler(dataroomId: true,viewerId: true,viewerEmail: true,- link: { select: { teamId: true } },+ link: {+ select: {+ teamId: true,+ brandId: true,+ dataroom: { select: { brandId: true } },+ },+ },},}): await prisma.view.findFirst({@@ -77,7 +83,13 @@ export default async function handler(dataroomId: true,viewerId: true,viewerEmail: true,- link: { select: { teamId: true } },+ link: {+ select: {+ teamId: true,+ brandId: true,+ dataroom: { select: { brandId: true } },+ },+ },},orderBy: { viewedAt: "desc" },});@@ -133,7 +145,10 @@ export default async function handler(},});- await sendOtpVerificationEmail(email, otpCode, true, view.link.teamId);+ await sendOtpVerificationEmail(email, otpCode, true, view.link.teamId, {+ linkBrandId: view.link.brandId,+ dataroomBrandId: view.link.dataroom?.brandId,+ });return res.status(200).json({type: "email-verification",diff --git a/pages/api/links/index.ts b/pages/api/links/index.tsindex 50a31656..32033822 100644--- a/pages/api/links/index.ts+++ b/pages/api/links/index.ts@@ -1,6 +1,7 @@import { NextApiRequest, NextApiResponse } from "next";import { isTeamPausedById } from "@/ee/features/billing/cancellation/lib/is-team-paused";+import { resolveOwnedBrandId } from "@/ee/features/branding/lib/resolve-base-brand";import { LinkAudienceType, Tag } from "@prisma/client";import { waitUntil } from "@vercel/functions";import { getServerSession } from "next-auth/next";@@ -271,8 +272,7 @@ export default async function handler(if (validGroups.length !== linkData.visitorGroupIds.length) {return res.status(400).json({- error:- "One or more visitor group IDs do not belong to this team.",+ error: "One or more visitor group IDs do not belong to this team.",});}}@@ -326,6 +326,8 @@ export default async function handler(}}+ const resolvedBrandId = await resolveOwnedBrandId(teamId, linkData.brandId);+// Fetch the link and its related document from the databaseconst updatedLink = await prisma.$transaction(async (tx) => {const link = await tx.link.create({@@ -358,6 +360,7 @@ export default async function handler(metaImage: linkData.metaImage || null,metaFavicon: linkData.metaFavicon || null,welcomeMessage: linkData.welcomeMessage || null,+ brandId: resolvedBrandId,allowList: linkData.allowList,denyList: linkData.denyList,audienceType: linkData.audienceType,diff --git a/pages/api/teams/[teamId]/branding.ts b/pages/api/teams/[teamId]/branding.tsindex 960f3651..117e1464 100644--- a/pages/api/teams/[teamId]/branding.ts+++ b/pages/api/teams/[teamId]/branding.ts@@ -1,34 +1,35 @@import { NextApiRequest, NextApiResponse } from "next";-import { del } from "@vercel/blob";-import { getServerSession } from "next-auth";-import { z } from "zod";-import {- DataroomCardLayoutSchema,- DataroomViewerHeaderStyleSchema,- DataroomViewerLayoutPresetSchema,type DataroomCardLayout,+ DataroomCardLayoutSchema,type DataroomViewerHeaderStyle,+ DataroomViewerHeaderStyleSchema,type DataroomViewerLayoutPreset,+ DataroomViewerLayoutPresetSchema,} from "@/ee/features/branding/lib/dataroom-viewer-layout";+import { deleteTeamBrand } from "@/ee/features/branding/lib/delete-team-brand";+import {+ findDefaultBrand,+ persistDefaultBrand,+} from "@/ee/features/branding/lib/resolve-base-brand";+import { z } from "zod";++import { withTeamApi } from "@/lib/api/auth/with-session-team";+import { validateRedirectUrl } from "@/lib/api/domains/validate-redirect-url";import {teamPlanAllowsCustomWelcomeAndCta,teamPlanAllowsLayoutCustomization,} from "@/lib/billing/team-plan-custom-messaging";-import { validateRedirectUrl } from "@/lib/api/domains/validate-redirect-url";-import { errorhandler } from "@/lib/errorHandler";import { getFeatureFlags } from "@/lib/featureFlags";import prisma from "@/lib/prisma";import {clearCachedBrandLogo,writeCachedBrandLogo,} from "@/lib/redis/brand-logo-cache";-import { CustomUser } from "@/lib/types";--import { authOptions } from "../../auth/[...nextauth]";const updateBrandingSchema = z.object({+ name: z.string().trim().min(1).max(80).optional(),logo: z.string().nullable().optional(),hideLogo: z.boolean().optional(),banner: z.string().nullable().optional(),@@ -124,75 +125,23 @@ async function resolvePrivacyPolicyUrl(return { ok: true, url: validation.url || null };}-function maybeDeleteBlobAsset(url: string | null | undefined): Promise<void> {- if (!url || url === "no-banner") return Promise.resolve();- if (url.startsWith("/") || url.startsWith("data:")) return Promise.resolve();- return del(url).catch(() => {});-}--export default async function handle(- req: NextApiRequest,- res: NextApiResponse,-) {- const session = await getServerSession(req, res, authOptions);- if (!session) {- return res.status(401).end("Unauthorized");- }-- const { teamId } = req.query as { teamId: string };-- try {- const team = await prisma.team.findUnique({- where: {- id: teamId,- },- select: {- id: true,- users: { select: { userId: true } },- },- });-- // check that the user is member of the team, otherwise return 403- const teamUsers = team?.users;- const isUserPartOfTeam = teamUsers?.some(- (user) => user.userId === (session.user as CustomUser).id,- );- if (!isUserPartOfTeam) {- return res.status(403).end("Unauthorized to access this team");- }- } catch (error) {- errorhandler(error, res);- }-- if (req.method === "GET") {- // GET /api/teams/:teamId/branding- const brand = await prisma.brand.findUnique({- where: {- teamId: teamId,- },- });+const getHandler = withTeamApi(+ async ({ res, teamId }) => {+ const brand = await findDefaultBrand(teamId);if (!brand) {return res.status(200).json(null);}return res.status(200).json(brand);- } else if (req.method === "POST") {- // POST /api/teams/:teamId/branding- const teamAuth = await prisma.team.findFirst({- where: {- id: teamId,- users: {- some: { userId: (session.user as CustomUser).id },- },- },- select: { plan: true },- });- if (!teamAuth) {- return res.status(403).end("Unauthorized to access this team");- }- const messagingAllowed = teamPlanAllowsCustomWelcomeAndCta(teamAuth.plan);- const layoutAllowed = teamPlanAllowsLayoutCustomization(teamAuth.plan);+ },+ { requiredPermissions: ["branding.read"] },+);++const postHandler = withTeamApi(+ async ({ req, res, teamId, team }) => {+ const messagingAllowed = teamPlanAllowsCustomWelcomeAndCta(team.plan);+ const layoutAllowed = teamPlanAllowsLayoutCustomization(team.plan);const parsed = updateBrandingSchema.safeParse(req.body);if (!parsed.success) {@@ -234,12 +183,10 @@ export default async function handle(return res.status(400).json({ message: privacyPolicy.message });}- // Use upsert so POST is idempotent: clients can hit POST even when a- // Brand row already exists (e.g. SWR cache is stale and `brand` is- // falsy on the client) without tripping the unique-teamId constraint.- const brand = await prisma.brand.upsert({- where: { teamId },+ const brand = await persistDefaultBrand({+ teamId,create: {+ name: body.name ?? "Default",logo: body.logo,hideLogo: body.hideLogo ?? false,banner: body.banner,@@ -248,29 +195,30 @@ export default async function handle(accentButtonColor: body.accentButtonColor ?? undefined,applyAccentColorToDataroomView:body.applyAccentColorToDataroomView ?? false,- welcomeMessage: messagingAllowed ? body.welcomeMessage ?? null : null,+ welcomeMessage: messagingAllowed ? (body.welcomeMessage ?? null) : null,customLinkPreviewEnabled: messagingAllowed- ? body.customLinkPreviewEnabled ?? false+ ? (body.customLinkPreviewEnabled ?? false): false,linkPreviewTitle: messagingAllowed- ? body.linkPreviewTitle ?? undefined+ ? (body.linkPreviewTitle ?? undefined): undefined,linkPreviewDescription: messagingAllowed- ? body.linkPreviewDescription ?? undefined+ ? (body.linkPreviewDescription ?? undefined): undefined,linkPreviewImage: messagingAllowed- ? body.linkPreviewImage ?? undefined+ ? (body.linkPreviewImage ?? undefined): undefined,linkPreviewFavicon: messagingAllowed- ? body.linkPreviewFavicon ?? undefined+ ? (body.linkPreviewFavicon ?? undefined): undefined,- ctaLabel: messagingAllowed ? body.ctaLabel ?? undefined : undefined,- ctaUrl: messagingAllowed ? validatedCtaUrl ?? undefined : undefined,+ ctaLabel: messagingAllowed ? (body.ctaLabel ?? undefined) : undefined,+ ctaUrl: messagingAllowed ? (validatedCtaUrl ?? undefined) : undefined,privacyPolicyUrl: privacyPolicy.url ?? undefined,...layoutData,teamId: teamId,},update: {+ name: body.name,logo: body.logo,hideLogo: body.hideLogo,banner: body.banner,@@ -279,7 +227,9 @@ export default async function handle(accentButtonColor: body.accentButtonColor ?? null,applyAccentColorToDataroomView:body.applyAccentColorToDataroomView ?? false,- welcomeMessage: messagingAllowed ? body.welcomeMessage ?? null : undefined,+ welcomeMessage: messagingAllowed+ ? (body.welcomeMessage ?? null)+ : undefined,privacyPolicyUrl: privacyPolicy.url,customLinkPreviewEnabled: messagingAllowed? body.customLinkPreviewEnabled@@ -301,22 +251,14 @@ export default async function handle(await writeCachedBrandLogo(teamId, brand);return res.status(200).json(brand);- } else if (req.method === "PUT") {- // PUT /api/teams/:teamId/branding- const teamAuth = await prisma.team.findFirst({- where: {- id: teamId,- users: {- some: { userId: (session.user as CustomUser).id },- },- },- select: { plan: true },- });- if (!teamAuth) {- return res.status(403).end("Unauthorized to access this team");- }- const messagingAllowed = teamPlanAllowsCustomWelcomeAndCta(teamAuth.plan);- const layoutAllowed = teamPlanAllowsLayoutCustomization(teamAuth.plan);+ },+ { requiredPermissions: ["branding.write"] },+);++const putHandler = withTeamApi(+ async ({ req, res, teamId, team }) => {+ const messagingAllowed = teamPlanAllowsCustomWelcomeAndCta(team.plan);+ const layoutAllowed = teamPlanAllowsLayoutCustomization(team.plan);const parsed = updateBrandingSchema.safeParse(req.body);if (!parsed.success) {@@ -327,9 +269,7 @@ export default async function handle(}const body = parsed.data;- const existingBrand = await prisma.brand.findUnique({- where: { teamId },- });+ const existingBrand = await findDefaultBrand(teamId);let validatedCtaUrl: string | null | undefined = body.ctaUrl;if (messagingAllowed && typeof body.ctaUrl === "string") {@@ -349,13 +289,13 @@ export default async function handle(}const resolvedWelcome = messagingAllowed- ? body.welcomeMessage ?? null+ ? body.welcomeMessage: (existingBrand?.welcomeMessage ?? null);const resolvedCtaLabel = messagingAllowed- ? body.ctaLabel ?? null+ ? body.ctaLabel: (existingBrand?.ctaLabel ?? null);const resolvedCtaUrl = messagingAllowed- ? validatedCtaUrl ?? null+ ? validatedCtaUrl: (existingBrand?.ctaUrl ?? null);const layoutData = layoutAllowed@@ -368,11 +308,10 @@ export default async function handle(}): {};- const brand = await prisma.brand.upsert({- where: {- teamId: teamId,- },+ const brand = await persistDefaultBrand({+ teamId,create: {+ name: body.name ?? "Default",logo: body.logo,hideLogo: body.hideLogo ?? false,banner: body.banner,@@ -380,29 +319,30 @@ export default async function handle(accentColor: body.accentColor,accentButtonColor: body.accentButtonColor ?? undefined,applyAccentColorToDataroomView: !!body.applyAccentColorToDataroomView,- welcomeMessage: messagingAllowed ? body.welcomeMessage ?? null : null,+ welcomeMessage: messagingAllowed ? (body.welcomeMessage ?? null) : null,customLinkPreviewEnabled: messagingAllowed? !!body.customLinkPreviewEnabled: false,linkPreviewTitle: messagingAllowed- ? body.linkPreviewTitle ?? undefined+ ? (body.linkPreviewTitle ?? undefined): undefined,linkPreviewDescription: messagingAllowed- ? body.linkPreviewDescription ?? undefined+ ? (body.linkPreviewDescription ?? undefined): undefined,linkPreviewImage: messagingAllowed- ? body.linkPreviewImage ?? undefined+ ? (body.linkPreviewImage ?? undefined): undefined,linkPreviewFavicon: messagingAllowed- ? body.linkPreviewFavicon ?? undefined+ ? (body.linkPreviewFavicon ?? undefined): undefined,- ctaLabel: messagingAllowed ? body.ctaLabel ?? undefined : undefined,- ctaUrl: messagingAllowed ? validatedCtaUrl ?? undefined : undefined,+ ctaLabel: messagingAllowed ? (body.ctaLabel ?? undefined) : undefined,+ ctaUrl: messagingAllowed ? (validatedCtaUrl ?? undefined) : undefined,privacyPolicyUrl: privacyPolicy.url ?? undefined,...layoutData,teamId: teamId,},update: {+ name: body.name,logo: body.logo,hideLogo: body.hideLogo,banner: body.banner,@@ -437,34 +377,46 @@ export default async function handle(await writeCachedBrandLogo(teamId, brand);return res.status(200).json(brand);- } else if (req.method === "DELETE") {- // DELETE /api/teams/:teamId/branding- const brand = await prisma.brand.findFirst({- where: {- teamId: teamId,- },- select: { id: true, logo: true, banner: true, linkPreviewImage: true, linkPreviewFavicon: true },- });+ },+ { requiredPermissions: ["branding.write"] },+);++const deleteHandler = withTeamApi(+ async ({ res, teamId }) => {+ const brand = await findDefaultBrand(teamId);if (brand) {- await Promise.all([- maybeDeleteBlobAsset(brand.logo),- maybeDeleteBlobAsset(brand.banner),- maybeDeleteBlobAsset((brand as any).linkPreviewImage),- maybeDeleteBlobAsset((brand as any).linkPreviewFavicon),- ]);+ await deleteTeamBrand({ teamId, brand });+ } else {+ await prisma.team.update({+ where: { id: teamId },+ data: { defaultBrandId: null },+ });+ await clearCachedBrandLogo(teamId);}- await prisma.brand.deleteMany({- where: { teamId },- });-- await clearCachedBrandLogo(teamId);-return res.status(204).end();- } else {- // We only allow GET and DELETE requests- res.setHeader("Allow", ["GET", "POST", "PUT", "DELETE"]);- return res.status(405).end(`Method ${req.method} Not Allowed`);+ },+ { requiredPermissions: ["branding.write"] },+);++export default async function handle(+ req: NextApiRequest,+ res: NextApiResponse,+) {+ if (req.method === "GET") {+ return getHandler(req, res);}+ if (req.method === "POST") {+ return postHandler(req, res);+ }+ if (req.method === "PUT") {+ return putHandler(req, res);+ }+ if (req.method === "DELETE") {+ return deleteHandler(req, res);+ }++ res.setHeader("Allow", ["GET", "POST", "PUT", "DELETE"]);+ return res.status(405).end(`Method ${req.method} Not Allowed`);}diff --git a/pages/api/teams/[teamId]/brands/[brandId]/default.ts b/pages/api/teams/[teamId]/brands/[brandId]/default.tsnew file mode 100644index 00000000..87b4db75--- /dev/null+++ b/pages/api/teams/[teamId]/brands/[brandId]/default.ts@@ -0,0 +1,44 @@+import { NextApiRequest, NextApiResponse } from "next";++import { withTeamApi } from "@/lib/api/auth/with-session-team";+import { errorhandler } from "@/lib/errorHandler";+import prisma from "@/lib/prisma";+import { writeCachedBrandLogo } from "@/lib/redis/brand-logo-cache";++const postHandler = withTeamApi(+ async ({ req, res, teamId }) => {+ const { brandId } = req.query as { brandId: string };++ try {+ const brand = await prisma.brand.findFirst({+ where: { id: brandId, teamId },+ });+ if (!brand) {+ return res.status(404).json({ message: "Brand not found" });+ }++ await prisma.team.update({+ where: { id: teamId },+ data: { defaultBrandId: brand.id },+ });+ await writeCachedBrandLogo(teamId, brand);++ return res.status(200).json(brand);+ } catch (error) {+ errorhandler(error, res);+ }+ },+ { requiredPermissions: ["branding.write"] },+);++export default async function handle(+ req: NextApiRequest,+ res: NextApiResponse,+) {+ if (req.method !== "POST") {+ res.setHeader("Allow", ["POST"]);+ return res.status(405).end(`Method ${req.method} Not Allowed`);+ }++ return postHandler(req, res);+}diff --git a/pages/api/teams/[teamId]/brands/[brandId]/index.ts b/pages/api/teams/[teamId]/brands/[brandId]/index.tsnew file mode 100644index 00000000..4accd81a--- /dev/null+++ b/pages/api/teams/[teamId]/brands/[brandId]/index.ts@@ -0,0 +1,117 @@+import { NextApiRequest, NextApiResponse } from "next";++import { deleteTeamBrand } from "@/ee/features/branding/lib/delete-team-brand";+import { prepareBrandWrite } from "@/ee/features/branding/lib/prepare-brand-write";++import { withTeamApi } from "@/lib/api/auth/with-session-team";+import { errorhandler } from "@/lib/errorHandler";+import prisma from "@/lib/prisma";+import { writeCachedBrandLogo } from "@/lib/redis/brand-logo-cache";++async function findOwnedBrand(teamId: string, brandId: string) {+ return prisma.brand.findFirst({+ where: { id: brandId, teamId },+ });+}++const getHandler = withTeamApi(+ async ({ req, res, teamId }) => {+ const { brandId } = req.query as { brandId: string };+ const brand = await findOwnedBrand(teamId, brandId);+ if (!brand) {+ return res.status(404).json({ message: "Brand not found" });+ }+ return res.status(200).json(brand);+ },+ { requiredPermissions: ["branding.read"] },+);++const putHandler = withTeamApi(+ async ({ req, res, teamId, team }) => {+ const { brandId } = req.query as { brandId: string };+ const brand = await findOwnedBrand(teamId, brandId);+ if (!brand) {+ return res.status(404).json({ message: "Brand not found" });+ }++ const prepared = await prepareBrandWrite({+ body: req.body,+ teamId,+ plan: team.plan,+ });+ if (!prepared.ok) {+ return res.status(prepared.status).json({+ message: prepared.message,+ errors: prepared.errors,+ });+ }++ try {+ const [updated, teamMeta] = await Promise.all([+ prisma.brand.update({+ where: { id: brand.id },+ data: prepared.data,+ }),+ prisma.team.findUnique({+ where: { id: teamId },+ select: { defaultBrandId: true },+ }),+ ]);++ if (teamMeta?.defaultBrandId === updated.id) {+ await writeCachedBrandLogo(teamId, updated);+ }++ return res.status(200).json(updated);+ } catch (error) {+ if (+ typeof error === "object" &&+ error &&+ "code" in error &&+ error.code === "P2002"+ ) {+ return res+ .status(409)+ .json({ message: "A brand with this name already exists" });+ }+ throw error;+ }+ },+ { requiredPermissions: ["branding.write"] },+);++const deleteHandler = withTeamApi(+ async ({ req, res, teamId }) => {+ const { brandId } = req.query as { brandId: string };+ const brand = await findOwnedBrand(teamId, brandId);+ if (!brand) {+ return res.status(404).json({ message: "Brand not found" });+ }++ try {+ await deleteTeamBrand({ teamId, brand });+ return res.status(204).end();+ } catch (error) {+ errorhandler(error, res);+ }+ },+ { requiredPermissions: ["branding.write"] },+);++export default async function handle(+ req: NextApiRequest,+ res: NextApiResponse,+) {+ if (req.method === "GET") {+ return getHandler(req, res);+ }+ if (req.method === "PUT") {+ return putHandler(req, res);+ }+ if (req.method === "DELETE") {+ return deleteHandler(req, res);+ }++ res.setHeader("Allow", ["GET", "PUT", "DELETE"]);+ return res.status(405).end(`Method ${req.method} Not Allowed`);+}diff --git a/pages/api/teams/[teamId]/brands/index.ts b/pages/api/teams/[teamId]/brands/index.tsnew file mode 100644index 00000000..0557a4d2--- /dev/null+++ b/pages/api/teams/[teamId]/brands/index.ts@@ -0,0 +1,107 @@+import { NextApiRequest, NextApiResponse } from "next";++import { prepareBrandWrite } from "@/ee/features/branding/lib/prepare-brand-write";++import { withTeamApi } from "@/lib/api/auth/with-session-team";+import prisma from "@/lib/prisma";+import { writeCachedBrandLogo } from "@/lib/redis/brand-logo-cache";++const getHandler = withTeamApi(+ async ({ res, teamId }) => {+ const [brands, team] = await Promise.all([+ prisma.brand.findMany({+ where: { teamId },+ orderBy: { createdAt: "asc" },+ }),+ prisma.team.findUnique({+ where: { id: teamId },+ select: { defaultBrandId: true },+ }),+ ]);++ return res.status(200).json({+ brands,+ defaultBrandId: team?.defaultBrandId ?? brands[0]?.id ?? null,+ });+ },+ { requiredPermissions: ["branding.read"] },+);++const postHandler = withTeamApi(+ async ({ req, res, teamId, team }) => {+ const prepared = await prepareBrandWrite({+ body: req.body,+ teamId,+ plan: team.plan,+ nameRequired: true,+ });+ if (!prepared.ok) {+ return res.status(prepared.status).json({+ message: prepared.message,+ errors: prepared.errors,+ });+ }++ try {+ const { brand, becameDefault } = await prisma.$transaction(async (tx) => {+ const existingBrand = await tx.brand.findFirst({+ where: { teamId },+ orderBy: { createdAt: "asc" },+ select: { id: true },+ });++ const created = await tx.brand.create({+ data: {+ teamId,+ ...prepared.data,+ name: prepared.data.name,+ },+ });++ const shouldDefault = !existingBrand;+ if (shouldDefault) {+ await tx.team.update({+ where: { id: teamId },+ data: { defaultBrandId: created.id },+ });+ }++ return { brand: created, becameDefault: shouldDefault };+ });++ if (becameDefault) {+ await writeCachedBrandLogo(teamId, brand);+ }++ return res.status(201).json(brand);+ } catch (error) {+ if (+ typeof error === "object" &&+ error &&+ "code" in error &&+ error.code === "P2002"+ ) {+ return res+ .status(409)+ .json({ message: "A brand with this name already exists" });+ }+ throw error;+ }+ },+ { requiredPermissions: ["branding.write"] },+);++export default async function handle(+ req: NextApiRequest,+ res: NextApiResponse,+) {+ if (req.method === "GET") {+ return getHandler(req, res);+ }+ if (req.method === "POST") {+ return postHandler(req, res);+ }++ res.setHeader("Allow", ["GET", "POST"]);+ return res.status(405).end(`Method ${req.method} Not Allowed`);+}diff --git a/pages/api/teams/[teamId]/datarooms/[id]/branding.ts b/pages/api/teams/[teamId]/datarooms/[id]/branding.tsindex b0437609..df213be3 100644--- a/pages/api/teams/[teamId]/datarooms/[id]/branding.ts+++ b/pages/api/teams/[teamId]/datarooms/[id]/branding.ts@@ -1,27 +1,28 @@import { NextApiRequest, NextApiResponse } from "next";-import { authOptions } from "@/pages/api/auth/[...nextauth]";-import { del } from "@vercel/blob";-import { getServerSession } from "next-auth";-import { z } from "zod";-import {- DataroomCardLayoutSchema,- DataroomViewerHeaderStyleSchema,- DataroomViewerLayoutPresetSchema,type DataroomCardLayout,+ DataroomCardLayoutSchema,type DataroomViewerHeaderStyle,+ DataroomViewerHeaderStyleSchema,type DataroomViewerLayoutPreset,+ DataroomViewerLayoutPresetSchema,} from "@/ee/features/branding/lib/dataroom-viewer-layout";+import { upsertDataroomBrandAndClearInherited } from "@/ee/features/branding/lib/upsert-dataroom-brand";+import { authOptions } from "@/pages/api/auth/[...nextauth]";+import { del } from "@vercel/blob";+import { getServerSession } from "next-auth";+import { z } from "zod";+import { validateRedirectUrl } from "@/lib/api/domains/validate-redirect-url";import { enforceDataroomMemberScope } from "@/lib/api/rbac/guard";-import { DEFAULT_LOCALE, SUPPORTED_LOCALE_CODES } from "@/lib/i18n/locales";import {teamPlanAllowsCustomWelcomeAndCta,teamPlanAllowsLayoutCustomization,teamPlanAllowsVisitorLanguage,} from "@/lib/billing/team-plan-custom-messaging";import { errorhandler } from "@/lib/errorHandler";+import { DEFAULT_LOCALE, SUPPORTED_LOCALE_CODES } from "@/lib/i18n/locales";import prisma from "@/lib/prisma";import { CustomUser } from "@/lib/types";@@ -131,37 +132,26 @@ export default async function handle(return;}+ let roomBrandId: string | null = null;try {- const team = await prisma.team.findUnique({- where: {- id: teamId,- users: {- some: {- userId: (session.user as CustomUser).id,- },- },- },- select: {- id: true,- },- });-- if (!team) {- return res.status(403).end("Unauthorized to access this team");- }-const dataroom = await prisma.dataroom.findUnique({where: {id: dataroomId,teamId: teamId,},+ select: {+ id: true,+ brandId: true,+ },});if (!dataroom) {return res.status(404).end("Dataroom not found");}+ roomBrandId = dataroom.brandId;} catch (error) {errorhandler(error, res);+ return;}if (req.method === "GET") {@@ -171,12 +161,10 @@ export default async function handle(dataroomId,},});-- if (!brand) {- return res.status(200).json(null);- }-- return res.status(200).json(brand);+ return res.status(200).json({+ brand,+ dataroomBrandId: roomBrandId,+ });} else if (req.method === "POST") {// POST /api/teams/:teamId/datarooms/:id/brandingconst teamAuth = await prisma.team.findFirst({@@ -230,7 +218,9 @@ export default async function handle(validatedCtaUrl = ctaValidation.url;}- const brand = await prisma.dataroomBrand.create({+ const brand = await upsertDataroomBrandAndClearInherited({+ dataroomId,+ teamId,data: {logo: body.logo ?? undefined,hideLogo: body.hideLogo,@@ -243,27 +233,26 @@ export default async function handle(? body.applyAccentColorToDataroomView: undefined,welcomeMessage: messagingAllowed ? body.welcomeMessage : null,- ctaLabel: messagingAllowed ? body.ctaLabel ?? undefined : undefined,- ctaUrl: messagingAllowed ? validatedCtaUrl ?? undefined : undefined,+ ctaLabel: messagingAllowed ? (body.ctaLabel ?? undefined) : undefined,+ ctaUrl: messagingAllowed ? (validatedCtaUrl ?? undefined) : undefined,customLinkPreviewEnabled:messagingAllowed && typeof body.customLinkPreviewEnabled === "boolean"? body.customLinkPreviewEnabled: false,linkPreviewTitle: messagingAllowed- ? body.linkPreviewTitle ?? undefined+ ? (body.linkPreviewTitle ?? undefined): undefined,linkPreviewDescription: messagingAllowed- ? body.linkPreviewDescription ?? undefined+ ? (body.linkPreviewDescription ?? undefined): undefined,linkPreviewImage: messagingAllowed- ? body.linkPreviewImage ?? undefined+ ? (body.linkPreviewImage ?? undefined): undefined,linkPreviewFavicon: messagingAllowed- ? body.linkPreviewFavicon ?? undefined+ ? (body.linkPreviewFavicon ?? undefined): undefined,...layoutData,...languageData,- dataroomId,},});@@ -335,10 +324,9 @@ export default async function handle(? { defaultLanguage: body.defaultLanguage }: {};- const brand = await prisma.dataroomBrand.update({- where: {- dataroomId,- },+ const brand = await upsertDataroomBrandAndClearInherited({+ dataroomId,+ teamId,data: {logo: body.logo,hideLogo: body.hideLogo,diff --git a/pages/api/teams/[teamId]/datarooms/[id]/duplicate.ts b/pages/api/teams/[teamId]/datarooms/[id]/duplicate.tsindex 7cfb7e19..2e935965 100644--- a/pages/api/teams/[teamId]/datarooms/[id]/duplicate.ts+++ b/pages/api/teams/[teamId]/datarooms/[id]/duplicate.ts@@ -187,6 +187,7 @@ const postHandler = withTeamApi(pId: pId,name: dataroomContents.name + " (Copy)",teamId: dataroomContents.teamId,+ brandId: dataroomContents.brandId,documents: {create: dataroomContents.documents.map((doc) => ({documentId: doc.documentId,@@ -208,6 +209,7 @@ const postHandler = withTeamApi(dataroomContents.brand.applyAccentColorToDataroomView ??false,welcomeMessage: dataroomContents.brand.welcomeMessage,+ defaultLanguage: dataroomContents.brand.defaultLanguage,cardLayout: dataroomContents.brand.cardLayout ?? undefined,showFolderTree:dataroomContents.brand.showFolderTree ?? undefined,diff --git a/pages/api/teams/[teamId]/datarooms/[id]/groups/[groupId]/links.ts b/pages/api/teams/[teamId]/datarooms/[id]/groups/[groupId]/links.tsindex 45358da9..e3993c91 100644--- a/pages/api/teams/[teamId]/datarooms/[id]/groups/[groupId]/links.ts+++ b/pages/api/teams/[teamId]/datarooms/[id]/groups/[groupId]/links.ts@@ -83,6 +83,9 @@ export default async function handle(visitorGroups: {select: { visitorGroupId: true },},+ dataroom: {+ select: { brandId: true },+ },_count: {select: { views: { where: { viewType: "DATAROOM_VIEW" } } },},diff --git a/pages/api/teams/[teamId]/datarooms/[id]/index.ts b/pages/api/teams/[teamId]/datarooms/[id]/index.tsindex 0137b22a..f3e4e1bb 100644--- a/pages/api/teams/[teamId]/datarooms/[id]/index.ts+++ b/pages/api/teams/[teamId]/datarooms/[id]/index.ts@@ -1,5 +1,6 @@import { NextApiRequest, NextApiResponse } from "next";+import { resolveOwnedBrandId } from "@/ee/features/branding/lib/resolve-base-brand";import { DefaultPermissionStrategy, RootItemAccess } from "@prisma/client";import { withTeamApi } from "@/lib/api/auth/with-session-team";@@ -79,6 +80,7 @@ const patchHandler = withTeamApi(introductionEnabled,introductionContent,requestListEnabled,+ brandId,} = req.body as {name?: string;internalName?: string | null;@@ -95,6 +97,7 @@ const patchHandler = withTeamApi(introductionEnabled?: boolean;introductionContent?: any;requestListEnabled?: boolean;+ brandId?: string | null;};const featureFlags = await getFeatureFlags({ teamId: team.id });@@ -145,6 +148,11 @@ const patchHandler = withTeamApi(}}+ const nextBrandId =+ brandId === undefined+ ? undefined+ : await resolveOwnedBrandId(team.id, brandId);+const updatedDataroom = await prisma.$transaction(async (tx) => {const dataroom = await tx.dataroom.update({where: {@@ -152,6 +160,7 @@ const patchHandler = withTeamApi(teamId: team.id,},data: {+ ...(nextBrandId !== undefined && { brandId: nextBrandId }),...(name && { name }),...(internalName !== undefined && {internalName:diff --git a/pages/api/teams/[teamId]/datarooms/[id]/links.ts b/pages/api/teams/[teamId]/datarooms/[id]/links.tsindex e4df94d0..7b481104 100644--- a/pages/api/teams/[teamId]/datarooms/[id]/links.ts+++ b/pages/api/teams/[teamId]/datarooms/[id]/links.ts@@ -74,6 +74,9 @@ export default async function handle(visitorGroups: {select: { visitorGroupId: true },},+ dataroom: {+ select: { brandId: true },+ },_count: {select: { views: { where: { viewType: "DATAROOM_VIEW" } } },},diff --git a/pages/api/teams/[teamId]/datarooms/create-from-folder.ts b/pages/api/teams/[teamId]/datarooms/create-from-folder.tsindex d35220c7..9674ecf1 100644--- a/pages/api/teams/[teamId]/datarooms/create-from-folder.ts+++ b/pages/api/teams/[teamId]/datarooms/create-from-folder.ts@@ -1,5 +1,6 @@import { NextApiRequest, NextApiResponse } from "next";+import { resolveDefaultBrandId } from "@/ee/features/branding/lib/resolve-base-brand";import { getLimits } from "@/ee/limits/server";import { authOptions } from "@/pages/api/auth/[...nextauth]";import { DataroomFolder, Document, Folder } from "@prisma/client";@@ -209,16 +210,18 @@ export default async function handle(.json({ message: "You need a Business plan to create a data room" });}- // Fetch the folder structure- const folderContents = await fetchFolderContents(folderId, teamId);+ const [folderContents, defaultBrandId] = await Promise.all([+ fetchFolderContents(folderId, teamId),+ resolveDefaultBrandId(teamId),+ ]);- // Create the data roomconst pId = newId("dataroom");const dataroom = await prisma.dataroom.create({data: {pId: pId,name: folderContents.name,teamId: teamId,+ brandId: defaultBrandId,documents: {create: folderContents.documents.map((doc) => ({documentId: doc.id,diff --git a/pages/api/teams/[teamId]/datarooms/generate-ai.ts b/pages/api/teams/[teamId]/datarooms/generate-ai.tsindex 5b7cf5ee..531fac8c 100644--- a/pages/api/teams/[teamId]/datarooms/generate-ai.ts+++ b/pages/api/teams/[teamId]/datarooms/generate-ai.ts@@ -1,6 +1,7 @@import type { NextApiRequest, NextApiResponse } from "next";import { isTeamPausedById } from "@/ee/features/billing/cancellation/lib/is-team-paused";+import { resolveDefaultBrandId } from "@/ee/features/branding/lib/resolve-base-brand";import { FolderTemplate } from "@/ee/features/templates/constants/dataroom-templates";import { getLimits } from "@/ee/limits/server";import { authOptions } from "@/pages/api/auth/[...nextauth]";@@ -170,6 +171,9 @@ export default async function handle(}const dataroomName = name.trim();+ const defaultBrandId = existingDataroomId+ ? null+ : await resolveDefaultBrandId(teamId);// Create the dataroom and folders in a transaction to prevent hanging resultsconst dataroom = await prisma.$transaction(async (tx) => {@@ -201,6 +205,7 @@ export default async function handle(name: dataroomName,teamId: teamId,pId: pId,+ brandId: defaultBrandId,},});}diff --git a/pages/api/teams/[teamId]/datarooms/index.ts b/pages/api/teams/[teamId]/datarooms/index.tsindex b1ea8e11..8975b363 100644--- a/pages/api/teams/[teamId]/datarooms/index.ts+++ b/pages/api/teams/[teamId]/datarooms/index.ts@@ -1,6 +1,7 @@import { NextApiRequest, NextApiResponse } from "next";import { isTeamPausedById } from "@/ee/features/billing/cancellation/lib/is-team-paused";+import { resolveDefaultBrandId } from "@/ee/features/branding/lib/resolve-base-brand";import { getLimits } from "@/ee/limits/server";import { Prisma } from "@prisma/client";@@ -229,14 +230,15 @@ const postHandler = withTeamApi(});}- // Limits: Check if the user has reached the limit of datarooms in the team- const dataroomCount = await prisma.dataroom.count({- where: {- teamId: teamId,- },- });-- const limits = await getLimits({ teamId, userId });+ const [dataroomCount, limits, defaultBrandId] = await Promise.all([+ prisma.dataroom.count({+ where: {+ teamId: teamId,+ },+ }),+ getLimits({ teamId, userId }),+ resolveDefaultBrandId(teamId),+ ]);if (limits &&@@ -255,6 +257,7 @@ const postHandler = withTeamApi(name: name,teamId: teamId,pId: pId,+ brandId: defaultBrandId,...(internalName && { internalName: internalName.trim() }),},});diff --git a/pages/api/teams/[teamId]/datarooms/trial.ts b/pages/api/teams/[teamId]/datarooms/trial.tsindex 63059029..14f90e4e 100644--- a/pages/api/teams/[teamId]/datarooms/trial.ts+++ b/pages/api/teams/[teamId]/datarooms/trial.ts@@ -5,6 +5,7 @@ import {sendDataroomTrialExpiredEmailTask,sendDataroomTrialInfoEmailTask,} from "@/ee/features/billing/dataroom-trial/lib/trigger/send-scheduled-email";+import { resolveDefaultBrandId } from "@/ee/features/branding/lib/resolve-base-brand";import { authOptions } from "@/pages/api/auth/[...nextauth]";import { waitUntil } from "@vercel/functions";import { getServerSession } from "next-auth/next";@@ -103,22 +104,26 @@ export default async function handle(? companyTeamName(companyName): "";- await prisma.team.update({- where: { id: teamId },- data: {- plan: `${team.plan}+drtrial`,- ...(renamed ? { name: renamed } : {}),- },- });-const pId = newId("dataroom");-- const dataroom = await prisma.dataroom.create({- data: {- name: name,- teamId: teamId,- pId: pId,- },+ const defaultBrandId = await resolveDefaultBrandId(teamId);++ const dataroom = await prisma.$transaction(async (tx) => {+ await tx.team.update({+ where: { id: teamId },+ data: {+ plan: `${team.plan}+drtrial`,+ ...(renamed ? { name: renamed } : {}),+ },+ });++ return tx.dataroom.create({+ data: {+ name: name,+ teamId: teamId,+ pId: pId,+ brandId: defaultBrandId,+ },+ });});const dataroomWithCount = {diff --git a/pages/api/webhooks/services/[...path]/index.ts b/pages/api/webhooks/services/[...path]/index.tsindex 27f664d9..11686197 100644--- a/pages/api/webhooks/services/[...path]/index.ts+++ b/pages/api/webhooks/services/[...path]/index.ts@@ -1,6 +1,7 @@import { NextApiRequest, NextApiResponse } from "next";import { isTeamPausedById } from "@/ee/features/billing/cancellation/lib/is-team-paused";+import { resolveDefaultBrandId } from "@/ee/features/branding/lib/resolve-base-brand";import { LinkPreset } from "@prisma/client";import { put } from "@vercel/blob";import { waitUntil } from "@vercel/functions";@@ -1493,12 +1494,14 @@ async function handleDataroomCreate(// Generate unique public ID for the dataroomconst pId = newId("dataroom");- // Create dataroom with link if requested+ const defaultBrandId = await resolveDefaultBrandId(teamId);+let createData: any = {name,description,teamId,pId,+ brandId: defaultBrandId,};if (createLink && link) {diff --git a/pages/branding.tsx b/pages/branding.tsxindex 140f877b..1e87c7b3 100644--- a/pages/branding.tsx+++ b/pages/branding.tsx@@ -8,6 +8,11 @@ import { BrandingLinkPreviewForm } from "@/ee/features/branding/components/brandimport { BrandingPreviewChrome } from "@/ee/features/branding/components/branding-preview-chrome";import { CollapsibleBrandingSection } from "@/ee/features/branding/components/collapsible-branding-section";import { DataroomLayoutPresetCards } from "@/ee/features/branding/components/dataroom-layout-preset-cards";+import {+ DRAFT_TEAM_BRAND_ID,+ TeamBrandSwitcher,+ nextTeamBrandName,+} from "@/ee/features/branding/components/team-brand-switcher";import {AUTO_FILL_NOT_FOUND_MESSAGE,autoFillHasBrandAssets,@@ -31,7 +36,7 @@ import { useDebounce } from "use-debounce";import { useFeatureFlags } from "@/lib/hooks/use-feature-flags";import { usePlan } from "@/lib/swr/use-billing";-import { useBrand } from "@/lib/swr/use-brand";+import { useBrand, useBrands } from "@/lib/swr/use-brand";import { cn, convertDataUrlToFile, uploadImage } from "@/lib/utils";import { UpgradePlanModal } from "@/components/billing/upgrade-plan-modal";@@ -59,6 +64,22 @@ import { DataroomBannerMedia } from "@/components/view/dataroom/dataroom-banner-export default function Branding() {const teamInfo = useTeam();const { brand } = useBrand();+ const {+ brands,+ defaultBrandId,+ loading: brandsLoading,+ mutate: mutateBrands,+ } = useBrands();+ const [selectedBrandId, setSelectedBrandId] = useState<string | null>(null);+ const [brandName, setBrandName] = useState("Default");+ const isDraftBrand = selectedBrandId === DRAFT_TEAM_BRAND_ID;+ const persistedBrandId = isDraftBrand ? null : selectedBrandId;+ const selectedBrand = isDraftBrand+ ? null+ : persistedBrandId+ ? (brands.find((item) => item.id === persistedBrandId) ??+ (brand?.id === persistedBrandId ? brand : null))+ : (brand ?? null);const { plan, isTrial, isBusiness, isDatarooms, isDataroomsPlus } = usePlan();const { isFeatureEnabled } = useFeatureFlags();const customPrivacyUrlEnabled = isFeatureEnabled("customPrivacyUrl");@@ -358,31 +379,78 @@ export default function Branding() {}, [bannerBlobUrl]);useEffect(() => {- // undefined = SWR still loading; null = no Brand row (treat as reset defaults)- if (brand === undefined) return;+ if (!selectedBrandId && defaultBrandId) {+ setSelectedBrandId(defaultBrandId);+ }+ }, [defaultBrandId, selectedBrandId]);++ const applyEmptyBrandForm = (name: string) => {+ setBrandName(name);+ setBrandColor("#000000");+ setAccentColor("#030712");+ setAccentButtonColor("#000000");+ setLogo(null);+ setHideLogo(false);+ setBanner(null);+ setApplyAccentColorToDataroomView(false);+ setCtaEnabled(false);+ setCtaLabel("");+ setCtaUrl("");+ setPrivacyPolicyEnabled(false);+ setPrivacyPolicyUrl("");+ setPrivacyPolicyUrlError(null);+ setWelcomeMessage(DEFAULT_WELCOME_MESSAGE);+ setWelcomeEnabled(false);+ setWelcomeMessageError(null);+ setLinkPreviewEnabled(false);+ setLinkPreviewTitle("");+ setLinkPreviewDescription("");+ setLinkPreviewImage(null);+ setLinkPreviewFavicon(null);+ setCardLayout("LIST");+ setShowFolderTree(true);+ setViewerHeaderStyle("DEFAULT");+ setHideFolderIconsInMain(false);+ setFileError(null);+ setBannerError(null);+ initialLayoutSnapshotRef.current = {+ cardLayout: "LIST",+ showFolderTree: true,+ viewerHeaderStyle: "DEFAULT",+ hideFolderIconsInMain: false,+ };+ };- if (brand) {- setBrandColor(brand.brandColor || "#000000");- setAccentColor(brand.accentColor || "#FFFFFF");+ useEffect(() => {+ if (isDraftBrand) return;+ if (brandsLoading && brand === undefined) return;+ if (persistedBrandId && !selectedBrand) return;++ if (selectedBrand) {+ setBrandName(selectedBrand.name || "Default");+ setBrandColor(selectedBrand.brandColor || "#000000");+ setAccentColor(selectedBrand.accentColor || "#FFFFFF");setAccentButtonColor(- (brand as any)?.accentButtonColor || brand.brandColor || "#000000",+ selectedBrand.accentButtonColor ||+ selectedBrand.brandColor ||+ "#000000",);- setLogo(brand.logo || null);- setHideLogo(!!brand.hideLogo);- setBanner(brand.banner || null);+ setLogo(selectedBrand.logo || null);+ setHideLogo(!!selectedBrand.hideLogo);+ setBanner(selectedBrand.banner || null);setApplyAccentColorToDataroomView(- (brand as any)?.applyAccentColorToDataroomView ?? false,+ selectedBrand.applyAccentColorToDataroomView ?? false,);- const initialCtaLabel = (brand as any)?.ctaLabel ?? "";- const initialCtaUrl = (brand as any)?.ctaUrl ?? "";+ const initialCtaLabel = selectedBrand.ctaLabel ?? "";+ const initialCtaUrl = selectedBrand.ctaUrl ?? "";setCtaLabel(initialCtaLabel);setCtaUrl(initialCtaUrl);setCtaEnabled(!!(initialCtaLabel || initialCtaUrl));- const initialPrivacyPolicyUrl = (brand as any)?.privacyPolicyUrl ?? "";+ const initialPrivacyPolicyUrl = selectedBrand.privacyPolicyUrl ?? "";setPrivacyPolicyUrl(initialPrivacyPolicyUrl);setPrivacyPolicyEnabled(!!initialPrivacyPolicyUrl);setPrivacyPolicyUrlError(null);- const savedMessage = brand.welcomeMessage ?? null;+ const savedMessage = selectedBrand.welcomeMessage ?? null;const message = savedMessage || DEFAULT_WELCOME_MESSAGE;setWelcomeMessage(message);setWelcomeEnabled(@@ -391,20 +459,19 @@ export default function Branding() {// Validate existing messageconst error = validateWelcomeMessage(message);setWelcomeMessageError(error);- setLinkPreviewEnabled((brand as any)?.customLinkPreviewEnabled === true);- setLinkPreviewTitle((brand as any)?.linkPreviewTitle ?? "");- setLinkPreviewDescription((brand as any)?.linkPreviewDescription ?? "");- setLinkPreviewImage((brand as any)?.linkPreviewImage ?? null);- setLinkPreviewFavicon((brand as any)?.linkPreviewFavicon ?? null);-- const loadedCardLayout = asDataroomCardLayout((brand as any)?.cardLayout);- const loadedShowFolderTree =- ((brand as any)?.showFolderTree as boolean | undefined) ?? true;+ setLinkPreviewEnabled(selectedBrand.customLinkPreviewEnabled === true);+ setLinkPreviewTitle(selectedBrand.linkPreviewTitle ?? "");+ setLinkPreviewDescription(selectedBrand.linkPreviewDescription ?? "");+ setLinkPreviewImage(selectedBrand.linkPreviewImage ?? null);+ setLinkPreviewFavicon(selectedBrand.linkPreviewFavicon ?? null);++ const loadedCardLayout = asDataroomCardLayout(selectedBrand.cardLayout);+ const loadedShowFolderTree = selectedBrand.showFolderTree ?? true;const loadedHeaderStyle = asDataroomViewerHeaderStyle(- (brand as any)?.viewerHeaderStyle,+ selectedBrand.viewerHeaderStyle,);const loadedHideFolderIcons =- ((brand as any)?.hideFolderIconsInMain as boolean | undefined) ?? false;+ selectedBrand.hideFolderIconsInMain ?? false;setCardLayout(loadedCardLayout);setShowFolderTree(loadedShowFolderTree);setViewerHeaderStyle(loadedHeaderStyle);@@ -418,38 +485,8 @@ export default function Branding() {return;}- setBrandColor("#000000");- setAccentColor("#030712");- setAccentButtonColor("#000000");- setLogo(null);- setHideLogo(false);- setBanner(null);- setApplyAccentColorToDataroomView(false);- setCtaEnabled(false);- setCtaLabel("");- setCtaUrl("");- setPrivacyPolicyEnabled(false);- setPrivacyPolicyUrl("");- setPrivacyPolicyUrlError(null);- setWelcomeMessage(DEFAULT_WELCOME_MESSAGE);- setWelcomeEnabled(false);- setWelcomeMessageError(null);- setLinkPreviewEnabled(false);- setLinkPreviewTitle("");- setLinkPreviewDescription("");- setLinkPreviewImage(null);- setLinkPreviewFavicon(null);- setCardLayout("LIST");- setShowFolderTree(true);- setViewerHeaderStyle("DEFAULT");- setHideFolderIconsInMain(false);- initialLayoutSnapshotRef.current = {- cardLayout: "LIST",- showFolderTree: true,- viewerHeaderStyle: "DEFAULT",- hideFolderIconsInMain: false,- };- }, [brand]);+ applyEmptyBrandForm("Default");+ }, [brand, brandsLoading, isDraftBrand, persistedBrandId, selectedBrand]);// Mirrors the server-side check in `validateRedirectUrl`: HTTPS only.const validatePrivacyPolicyUrl = (url: string): string | null => {@@ -560,11 +597,12 @@ export default function Branding() {}const data = {+ name: brandName.trim() || "Default",welcomeMessage: hasBusinessMessagingAccess? welcomeEnabled? welcomeMessage.trim() || DEFAULT_WELCOME_MESSAGE: null- : ((brand as any)?.welcomeMessage ?? null),+ : (selectedBrand?.welcomeMessage ?? null),brandColor: brandColor,accentColor: accentColor,accentButtonColor: accentButtonColor,@@ -575,43 +613,40 @@ export default function Branding() {? ctaEnabled? ctaLabel.trim() || null: null- : ((brand as any)?.ctaLabel ?? null),+ : (selectedBrand?.ctaLabel ?? null),ctaUrl: hasBusinessMessagingAccess? ctaEnabled? ctaUrl.trim() || null: null- : ((brand as any)?.ctaUrl ?? null),+ : (selectedBrand?.ctaUrl ?? null),...(customPrivacyUrlEnabled && {privacyPolicyUrl: privacyPolicyEnabled? privacyPolicyUrl.trim() || null: null,}),- // Custom Link Preview — only writable when the team plan grants the- // Business messaging tier. Otherwise we mirror back what's already- // persisted so the API doesn't clear it out from a lower tier.customLinkPreviewEnabled: hasBusinessMessagingAccess? linkPreviewEnabled- : !!(brand as any)?.customLinkPreviewEnabled,+ : !!selectedBrand?.customLinkPreviewEnabled,linkPreviewTitle: hasBusinessMessagingAccess? linkPreviewEnabled? linkPreviewTitle.trim() || null: null- : ((brand as any)?.linkPreviewTitle ?? null),+ : (selectedBrand?.linkPreviewTitle ?? null),linkPreviewDescription: hasBusinessMessagingAccess? linkPreviewEnabled? linkPreviewDescription.trim() || null: null- : ((brand as any)?.linkPreviewDescription ?? null),+ : (selectedBrand?.linkPreviewDescription ?? null),linkPreviewImage: hasBusinessMessagingAccess? linkPreviewEnabled? linkPreviewImageUrl: null- : ((brand as any)?.linkPreviewImage ?? null),+ : (selectedBrand?.linkPreviewImage ?? null),linkPreviewFavicon: hasBusinessMessagingAccess? linkPreviewEnabled? linkPreviewFaviconUrl: null- : ((brand as any)?.linkPreviewFavicon ?? null),+ : (selectedBrand?.linkPreviewFavicon ?? null),// Only include banner if user has dataroom access (Business+)...(hasDataroomAccess && { banner: bannerBlobUrl }),// Layout fields are only included when the plan can persist them. The@@ -626,10 +661,15 @@ export default function Branding() {}),};+ const teamId = teamInfo?.currentTeam?.id;const res = await fetch(- `/api/teams/${teamInfo?.currentTeam?.id}/branding`,+ persistedBrandId+ ? `/api/teams/${teamId}/brands/${persistedBrandId}`+ : isDraftBrand+ ? `/api/teams/${teamId}/brands`+ : `/api/teams/${teamId}/branding`,{- method: brand ? "PUT" : "POST",+ method: persistedBrandId ? "PUT" : "POST",body: JSON.stringify(data),headers: {"Content-Type": "application/json",@@ -638,7 +678,12 @@ export default function Branding() {);if (res.ok) {- mutate(`/api/teams/${teamInfo?.currentTeam?.id}/branding`);+ const saved = await res.json().catch(() => null);+ if (saved?.id) {+ setSelectedBrandId(saved.id);+ }+ mutate(`/api/teams/${teamId}/branding`);+ void mutateBrands();if (hasLayoutSaveAccess) {initialLayoutSnapshotRef.current = {cardLayout,@@ -661,10 +706,44 @@ export default function Branding() {}};+ const handleCreateBrand = () => {+ setSelectedBrandId(DRAFT_TEAM_BRAND_ID);+ applyEmptyBrandForm(nextTeamBrandName(brands));+ };++ const handleSetDefaultBrand = async () => {+ const teamId = teamInfo?.currentTeam?.id;+ if (!teamId || !persistedBrandId) return;+ setIsLoading(true);+ try {+ const res = await fetch(+ `/api/teams/${teamId}/brands/${persistedBrandId}/default`,+ { method: "POST" },+ );+ if (!res.ok) {+ toast.error("Failed to set default brand");+ return;+ }+ await mutateBrands();+ mutate(`/api/teams/${teamId}/branding`);+ toast.success("Default brand updated");+ } finally {+ setIsLoading(false);+ }+ };+const handleDelete = async () => {+ if (isDraftBrand) {+ setSelectedBrandId(defaultBrandId);+ return;+ }+setIsLoading(true);+ const teamId = teamInfo?.currentTeam?.id;const res = await fetch(- `/api/teams/${teamInfo?.currentTeam?.id}/branding`,+ persistedBrandId+ ? `/api/teams/${teamId}/brands/${persistedBrandId}`+ : `/api/teams/${teamId}/branding`,{method: "DELETE",headers: {@@ -674,9 +753,9 @@ export default function Branding() {);if (res.ok) {- await mutate(`/api/teams/${teamInfo?.currentTeam?.id}/branding`, null, {- revalidate: false,- });+ await mutate(`/api/teams/${teamId}/branding`);+ const next = await mutateBrands();+ setSelectedBrandId(next?.defaultBrandId ?? null);setLogo(null);setHideLogo(false);setBanner(null);@@ -709,10 +788,10 @@ export default function Branding() {hideFolderIconsInMain: false,};setIsLoading(false);- toast.success("Branding reset successfully");+ toast.success("Brand deleted");} else {setIsLoading(false);- toast.error("Failed to reset branding");+ toast.error("Failed to delete brand");}};@@ -724,12 +803,11 @@ export default function Branding() {<div className="mb-4 flex items-start justify-between gap-4 md:mb-6 lg:shrink-0"><div className="max-w-3xl space-y-1"><h1 className="text-2xl font-semibold tracking-tight text-foreground">- Global Branding+ Branding</h1><div className="text-sm text-muted-foreground">- All direct links to documents and data rooms will have your- branding applied. You can overwrite the branding for each data- room individually.{" "}+ The default brand applies to every document and data room link+ unless you pick another brand on that link or room.{" "}<BadgeTooltiplinkText="Click here"content="How to customize document branding?"@@ -745,7 +823,19 @@ export default function Branding() {</Button></div>- {/* Main Layout */}+ <TeamBrandSwitcher+ brands={brands}+ selectedBrandId={selectedBrandId}+ defaultBrandId={defaultBrandId}+ brandName={brandName}+ onBrandNameChange={setBrandName}+ onSelect={setSelectedBrandId}+ onCreate={handleCreateBrand}+ onSetDefault={handleSetDefaultBrand}+ onDelete={handleDelete}+ disabled={isLoading}+ />+<div className="flex w-full flex-col gap-6 lg:min-h-0 lg:flex-1 lg:flex-row lg:gap-8">{/* Settings Column */}<div className="flex w-full flex-col gap-6 lg:min-h-0 lg:w-[420px] lg:shrink-0">@@ -1745,7 +1835,11 @@ export default function Branding() {Save changes</Button>)}- <Button variant="ghost" onClick={handleDelete} disabled={!brand}>+ <Button+ variant="ghost"+ onClick={handleDelete}+ disabled={!selectedBrand && !isDraftBrand}+ >Reset branding</Button></div>diff --git a/pages/datarooms/[id]/branding/index.tsx b/pages/datarooms/[id]/branding/index.tsxindex 0338a5c5..91e6ead5 100644--- a/pages/datarooms/[id]/branding/index.tsx+++ b/pages/datarooms/[id]/branding/index.tsx@@ -12,7 +12,6 @@ import {AUTO_FILL_NOT_FOUND_MESSAGE,autoFillHasBrandAssets,} from "@/ee/features/branding/lib/auto-fill-result";-import { mergeBrandLogoFields } from "@/ee/features/branding/lib/brand-logo";import {CARD_LAYOUT_OPTIONS,type DataroomCardLayout,@@ -22,6 +21,10 @@ import {asDataroomViewerHeaderStyle,inferDataroomViewerLayoutPreset,} from "@/ee/features/branding/lib/dataroom-viewer-layout";+import {+ CUSTOM_DATAROOM_BRAND,+ CUSTOM_DATAROOM_BRAND_LABEL,+} from "@/ee/features/branding/lib/resolve-dataroom-displayed-brand";import { PlanEnum } from "@/ee/stripe/constants";import { Check, CircleHelpIcon, CrownIcon, UploadIcon } from "lucide-react";import { HexColorInput, HexColorPicker } from "react-colorful";@@ -36,12 +39,13 @@ import {asSupportedLocale,} from "@/lib/i18n/locales";import { usePlan } from "@/lib/swr/use-billing";-import { useBrand, useDataroomBrand } from "@/lib/swr/use-brand";+import { useBrands, useDataroomBrand } from "@/lib/swr/use-brand";import { useDataroom } from "@/lib/swr/use-dataroom";import { cn, convertDataUrlToFile, uploadImage } from "@/lib/utils";import { UpgradePlanModal } from "@/components/billing/upgrade-plan-modal";import AppLayout from "@/components/layouts/app";+import { Badge } from "@/components/ui/badge";import { Button } from "@/components/ui/button";import { Card, CardContent } from "@/components/ui/card";import { Checkbox } from "@/components/ui/checkbox";@@ -54,6 +58,16 @@ import {PopoverTrigger,} from "@/components/ui/popover";import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";+import {+ Select,+ SelectContent,+ SelectGroup,+ SelectItem,+ SelectLabel,+ SelectSeparator,+ SelectTrigger,+ SelectValue,+} from "@/components/ui/select";import { Switch } from "@/components/ui/switch";import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";import { Textarea } from "@/components/ui/textarea";@@ -63,6 +77,62 @@ import { DataroomBannerMedia } from "@/components/view/dataroom/dataroom-banner-const DEFAULT_BANNER_IMAGE = "/_static/papermark-banner.png";+type BrandEditorSnapshot = {+ brandColor: string;+ accentColor: string;+ accentButtonColor: string;+ applyAccentColorToDataroomView: boolean;+ logo: string | null;+ hideLogo: boolean;+ banner: string | null;+ welcomeMessage: string;+ welcomeEnabled: boolean;+ cardLayout: DataroomCardLayout;+ showFolderTree: boolean;+ viewerHeaderStyle: DataroomViewerHeaderStyle;+ hideFolderIconsInMain: boolean;+ ctaLabel: string;+ ctaUrl: string;+ ctaEnabled: boolean;+ linkPreviewEnabled: boolean;+ linkPreviewTitle: string;+ linkPreviewDescription: string;+ linkPreviewImage: string | null;+ linkPreviewFavicon: string | null;+ defaultLanguage: SupportedLocaleCode;+};++function brandEditorSnapshotsEqual(+ left: BrandEditorSnapshot,+ right: BrandEditorSnapshot,+) {+ return (+ left.brandColor === right.brandColor &&+ left.accentColor === right.accentColor &&+ left.accentButtonColor === right.accentButtonColor &&+ left.applyAccentColorToDataroomView ===+ right.applyAccentColorToDataroomView &&+ left.logo === right.logo &&+ left.hideLogo === right.hideLogo &&+ left.banner === right.banner &&+ left.welcomeMessage === right.welcomeMessage &&+ left.welcomeEnabled === right.welcomeEnabled &&+ left.cardLayout === right.cardLayout &&+ left.showFolderTree === right.showFolderTree &&+ left.viewerHeaderStyle === right.viewerHeaderStyle &&+ left.hideFolderIconsInMain === right.hideFolderIconsInMain &&+ left.ctaLabel === right.ctaLabel &&+ left.ctaUrl === right.ctaUrl &&+ left.ctaEnabled === right.ctaEnabled &&+ left.linkPreviewEnabled === right.linkPreviewEnabled &&+ left.linkPreviewTitle === right.linkPreviewTitle &&+ left.linkPreviewDescription === right.linkPreviewDescription &&+ left.linkPreviewImage === right.linkPreviewImage &&+ left.linkPreviewFavicon === right.linkPreviewFavicon &&+ left.defaultLanguage === right.defaultLanguage+ );+}+export default function DataroomBrandPage() {const teamInfo = useTeam();const { isDatarooms, isDataroomsPlus, isTrial, isBusiness } = usePlan();@@ -74,7 +144,12 @@ export default function DataroomBrandPage() {const { brand: dataroomBrand } = useDataroomBrand({dataroomId: dataroom?.id,});- const { brand: globalBrand } = useBrand();+ const { brands, defaultBrandId } = useBrands();+ const isCustomBrand = !dataroom?.brandId;+ const selectedTeamBrand = useMemo(+ () => brands.find((item) => item.id === dataroom?.brandId) ?? null,+ [brands, dataroom?.brandId],+ );const [brandColor, setBrandColor] = useState<string>("#000000");const [accentColor, setAccentColor] = useState<string>("#FFFFFF");@@ -82,10 +157,8 @@ export default function DataroomBrandPage() {const [applyAccentColorToDataroomView, setApplyAccentColorToDataroomView] =useState<boolean>(false);const [logo, setLogo] = useState<string | null>(null);- // Null keeps this data room on the team setting. Only an explicit click sends- // a boolean, so saving unrelated branding never pins the inherited value.const [hideLogoOverride, setHideLogoOverride] = useState<boolean | null>(- null,+ false,);const [banner, setBanner] = useState<string | null>(null);const [originalBanner, setOriginalBanner] = useState<string | null>(null);@@ -104,8 +177,7 @@ export default function DataroomBrandPage() {null,);const [previewTab, setPreviewTab] = useState<string>("dataroom-view");- // What visitors of this data room actually get, for the control and previews.- const hideLogo = hideLogoOverride ?? Boolean(globalBrand?.hideLogo);+ const hideLogo = Boolean(hideLogoOverride);// Layout customization stateconst [showFolderTree, setShowFolderTree] = useState<boolean>(true);@@ -146,7 +218,6 @@ export default function DataroomBrandPage() {const [autoFillLoading, setAutoFillLoading] = useState<boolean>(false);const [ctaEnabled, setCtaEnabled] = useState<boolean>(false);- const hasSeededNullDataroomFromGlobalRef = useRef(false);const lastVisibleBannerRef = useRef<string | null>(null);// Snapshot of layout fields at last load, used to detect "unsaved layout changes"@@ -159,6 +230,7 @@ export default function DataroomBrandPage() {} | null>(null);const initialLanguageRef = useRef<SupportedLocaleCode | null>(null);+ const sourceBrandSnapshotRef = useRef<BrandEditorSnapshot | null>(null);const [upgradeLayoutsModalOpen, setUpgradeLayoutsModalOpen] =useState<boolean>(false);@@ -270,10 +342,6 @@ export default function DataroomBrandPage() {}};- useEffect(() => {- hasSeededNullDataroomFromGlobalRef.current = false;- }, [dataroom?.id]);-const handleAutoFill = async () => {if (!autoFillUrl.trim()) return;setAutoFillLoading(true);@@ -394,201 +462,217 @@ export default function DataroomBrandPage() {[setBanner],);- useEffect(() => {- if (dataroomBrand === undefined) return;+ const applyEmptyCustomBrand = () => {+ setBrandColor("#000000");+ setAccentColor("#FFFFFF");+ setAccentButtonColor("#000000");+ setApplyAccentColorToDataroomView(false);+ setLogo(null);+ setHideLogoOverride(false);+ setBanner(DEFAULT_BANNER_IMAGE);+ setOriginalBanner(DEFAULT_BANNER_IMAGE);+ setWelcomeMessage(DEFAULT_WELCOME_MESSAGE);+ setWelcomeEnabled(false);+ setWelcomeMessageError(null);+ setShowFolderTree(true);+ setCardLayout("LIST");+ setViewerHeaderStyle("DEFAULT");+ setHideFolderIconsInMain(false);+ initialLayoutSnapshotRef.current = {+ cardLayout: "LIST",+ showFolderTree: true,+ viewerHeaderStyle: "DEFAULT",+ hideFolderIconsInMain: false,+ };+ setCtaLabel("");+ setCtaUrl("");+ setCtaEnabled(false);+ setLinkPreviewEnabled(false);+ setLinkPreviewTitle("");+ setLinkPreviewDescription("");+ setLinkPreviewImage(null);+ setLinkPreviewFavicon(null);+ setDefaultLanguage(DEFAULT_LOCALE);+ initialLanguageRef.current = DEFAULT_LOCALE;+ sourceBrandSnapshotRef.current = {+ brandColor: "#000000",+ accentColor: "#FFFFFF",+ accentButtonColor: "#000000",+ applyAccentColorToDataroomView: false,+ logo: null,+ hideLogo: false,+ banner: DEFAULT_BANNER_IMAGE,+ welcomeMessage: DEFAULT_WELCOME_MESSAGE,+ welcomeEnabled: false,+ cardLayout: "LIST",+ showFolderTree: true,+ viewerHeaderStyle: "DEFAULT",+ hideFolderIconsInMain: false,+ ctaLabel: "",+ ctaUrl: "",+ ctaEnabled: false,+ linkPreviewEnabled: false,+ linkPreviewTitle: "",+ linkPreviewDescription: "",+ linkPreviewImage: null,+ linkPreviewFavicon: null,+ defaultLanguage: DEFAULT_LOCALE,+ };+ };- if (dataroomBrand) {- setBrandColor(- dataroomBrand.brandColor || globalBrand?.brandColor || "#000000",- );- setAccentColor(- dataroomBrand.accentColor || globalBrand?.accentColor || "#FFFFFF",- );- setAccentButtonColor(- (dataroomBrand as any)?.accentButtonColor ||- (globalBrand as any)?.accentButtonColor ||- dataroomBrand.brandColor ||- globalBrand?.brandColor ||- "#000000",- );- setApplyAccentColorToDataroomView(- (dataroomBrand as any)?.applyAccentColorToDataroomView ??- (globalBrand as any)?.applyAccentColorToDataroomView ??- false,- );- const logoFields = mergeBrandLogoFields({- dataroom: dataroomBrand,- team: globalBrand,- });- setLogo(logoFields.logo);- setHideLogoOverride(dataroomBrand.hideLogo ?? null);- const bannerValue = dataroomBrand.banner || globalBrand?.banner || null;- setBanner(bannerValue);- setOriginalBanner(bannerValue);- const savedMessage =- dataroomBrand.welcomeMessage ?? globalBrand?.welcomeMessage ?? null;- const message = savedMessage || DEFAULT_WELCOME_MESSAGE;- setWelcomeMessage(message);- setWelcomeEnabled(+ const applySourceBrand = (source: {+ logo?: string | null;+ hideLogo?: boolean | null;+ banner?: string | null;+ brandColor?: string | null;+ accentColor?: string | null;+ accentButtonColor?: string | null;+ applyAccentColorToDataroomView?: boolean | null;+ welcomeMessage?: string | null;+ cardLayout?: string | null;+ showFolderTree?: boolean | null;+ viewerHeaderStyle?: string | null;+ hideFolderIconsInMain?: boolean | null;+ ctaLabel?: string | null;+ ctaUrl?: string | null;+ customLinkPreviewEnabled?: boolean | null;+ linkPreviewTitle?: string | null;+ linkPreviewDescription?: string | null;+ linkPreviewImage?: string | null;+ linkPreviewFavicon?: string | null;+ defaultLanguage?: string | null;+ }) => {+ setBrandColor(source.brandColor || "#000000");+ setAccentColor(source.accentColor || "#FFFFFF");+ setAccentButtonColor(+ source.accentButtonColor || source.brandColor || "#000000",+ );+ setApplyAccentColorToDataroomView(+ source.applyAccentColorToDataroomView ?? false,+ );+ setLogo(source.logo || null);+ setHideLogoOverride(source.hideLogo ?? false);+ const bannerValue = source.banner || DEFAULT_BANNER_IMAGE;+ setBanner(bannerValue);+ setOriginalBanner(bannerValue);+ const savedMessage = source.welcomeMessage ?? null;+ const message = savedMessage || DEFAULT_WELCOME_MESSAGE;+ setWelcomeMessage(message);+ setWelcomeEnabled(+ !!savedMessage && savedMessage !== DEFAULT_WELCOME_MESSAGE,+ );+ setWelcomeMessageError(validateWelcomeMessage(message));+ const nextCardLayout = asDataroomCardLayout(source.cardLayout);+ const nextShowFolderTree = source.showFolderTree ?? true;+ const nextViewerHeaderStyle = asDataroomViewerHeaderStyle(+ source.viewerHeaderStyle,+ );+ const nextHideFolderIconsInMain = Boolean(source.hideFolderIconsInMain);+ setShowFolderTree(nextShowFolderTree);+ setCardLayout(nextCardLayout);+ setViewerHeaderStyle(nextViewerHeaderStyle);+ setHideFolderIconsInMain(nextHideFolderIconsInMain);+ initialLayoutSnapshotRef.current = {+ cardLayout: nextCardLayout,+ showFolderTree: nextShowFolderTree,+ viewerHeaderStyle: nextViewerHeaderStyle,+ hideFolderIconsInMain: nextHideFolderIconsInMain,+ };+ const nextCtaLabel = source.ctaLabel ?? "";+ const nextCtaUrl = source.ctaUrl ?? "";+ setCtaLabel(nextCtaLabel);+ setCtaUrl(nextCtaUrl);+ setCtaEnabled(!!(nextCtaLabel || nextCtaUrl));+ setLinkPreviewEnabled(source.customLinkPreviewEnabled === true);+ setLinkPreviewTitle(source.linkPreviewTitle ?? "");+ setLinkPreviewDescription(source.linkPreviewDescription ?? "");+ setLinkPreviewImage(source.linkPreviewImage ?? null);+ setLinkPreviewFavicon(source.linkPreviewFavicon ?? null);+ const nextLanguage =+ asSupportedLocale(source.defaultLanguage) ?? DEFAULT_LOCALE;+ setDefaultLanguage(nextLanguage);+ initialLanguageRef.current = nextLanguage;+ sourceBrandSnapshotRef.current = {+ brandColor: source.brandColor || "#000000",+ accentColor: source.accentColor || "#FFFFFF",+ accentButtonColor:+ source.accentButtonColor || source.brandColor || "#000000",+ applyAccentColorToDataroomView:+ source.applyAccentColorToDataroomView ?? false,+ logo: source.logo || null,+ hideLogo: source.hideLogo ?? false,+ banner: source.banner || DEFAULT_BANNER_IMAGE,+ welcomeMessage: message,+ welcomeEnabled:!!savedMessage && savedMessage !== DEFAULT_WELCOME_MESSAGE,- );- const error = validateWelcomeMessage(message);- setWelcomeMessageError(error);- const initialShowFolderTree = dataroomBrand.showFolderTree ?? true;- const initialCardLayout = asDataroomCardLayout(dataroomBrand.cardLayout);- const initialViewerHeaderStyle = asDataroomViewerHeaderStyle(- (dataroomBrand as any).viewerHeaderStyle,- );- const initialHideFolderIconsInMain = Boolean(- (dataroomBrand as any).hideFolderIconsInMain,- );- setShowFolderTree(initialShowFolderTree);- setCardLayout(initialCardLayout);- setViewerHeaderStyle(initialViewerHeaderStyle);- setHideFolderIconsInMain(initialHideFolderIconsInMain);- initialLayoutSnapshotRef.current = {- cardLayout: initialCardLayout,- showFolderTree: initialShowFolderTree,- viewerHeaderStyle: initialViewerHeaderStyle,- hideFolderIconsInMain: initialHideFolderIconsInMain,- };- const initialCtaLabel =- dataroomBrand.ctaLabel ?? (globalBrand as any)?.ctaLabel ?? "";- const initialCtaUrl =- dataroomBrand.ctaUrl ?? (globalBrand as any)?.ctaUrl ?? "";- setCtaLabel(initialCtaLabel);- setCtaUrl(initialCtaUrl);- setCtaEnabled(!!(initialCtaLabel || initialCtaUrl));- setLinkPreviewEnabled(- (dataroomBrand as any)?.customLinkPreviewEnabled === true,- );- setLinkPreviewTitle((dataroomBrand as any)?.linkPreviewTitle ?? "");- setLinkPreviewDescription(- (dataroomBrand as any)?.linkPreviewDescription ?? "",- );- setLinkPreviewImage((dataroomBrand as any)?.linkPreviewImage ?? null);- setLinkPreviewFavicon((dataroomBrand as any)?.linkPreviewFavicon ?? null);- const initialLanguage =- asSupportedLocale((dataroomBrand as any)?.defaultLanguage) ??- asSupportedLocale((globalBrand as any)?.defaultLanguage) ??- DEFAULT_LOCALE;- setDefaultLanguage(initialLanguage);- initialLanguageRef.current = initialLanguage;- return;- }-- // No dataroom row yet (or cleared). Wait for team brand so we do not flash- // empty values before global defaults are known.- if (globalBrand === undefined) return;+ cardLayout: nextCardLayout,+ showFolderTree: nextShowFolderTree,+ viewerHeaderStyle: nextViewerHeaderStyle,+ hideFolderIconsInMain: nextHideFolderIconsInMain,+ ctaLabel: nextCtaLabel,+ ctaUrl: nextCtaUrl,+ ctaEnabled: !!(nextCtaLabel || nextCtaUrl),+ linkPreviewEnabled: source.customLinkPreviewEnabled === true,+ linkPreviewTitle: source.linkPreviewTitle ?? "",+ linkPreviewDescription: source.linkPreviewDescription ?? "",+ linkPreviewImage: source.linkPreviewImage ?? null,+ linkPreviewFavicon: source.linkPreviewFavicon ?? null,+ defaultLanguage: nextLanguage,+ };+ };- if (hasSeededNullDataroomFromGlobalRef.current) return;- hasSeededNullDataroomFromGlobalRef.current = true;+ const brandSourceKey = isCustomBrand+ ? dataroomBrand === undefined+ ? null+ : (dataroomBrand?.id ?? "empty")+ : (selectedTeamBrand?.id ?? null);- if (globalBrand) {- const logoFields = mergeBrandLogoFields({- dataroom: null,- team: globalBrand,- });- setBrandColor(globalBrand.brandColor || "#000000");- setAccentColor(globalBrand.accentColor || "#FFFFFF");- setAccentButtonColor(- (globalBrand as any)?.accentButtonColor ||- globalBrand.brandColor ||- "#000000",- );- setApplyAccentColorToDataroomView(- (globalBrand as any)?.applyAccentColorToDataroomView ?? false,- );- setLogo(logoFields.logo);- setHideLogoOverride(null);- const bannerValue = globalBrand.banner || null;- setBanner(bannerValue);- setOriginalBanner(bannerValue);- const savedMessage = globalBrand.welcomeMessage ?? null;- const message = savedMessage || DEFAULT_WELCOME_MESSAGE;- setWelcomeMessage(message);- setWelcomeEnabled(- !!savedMessage && savedMessage !== DEFAULT_WELCOME_MESSAGE,- );- setWelcomeMessageError(validateWelcomeMessage(message));- // Layouts inherit from the team brand exactly like colors / logo / CTA.- // Once the user saves anything here a DataroomBrand row is created and- // those persisted values win, but until then we mirror the team- // defaults so a new dataroom doesn't reset to "Standard".- const inheritedCardLayout = asDataroomCardLayout(- (globalBrand as any)?.cardLayout,- );- const inheritedShowFolderTree =- (globalBrand as any)?.showFolderTree ?? true;- const inheritedViewerHeaderStyle = asDataroomViewerHeaderStyle(- (globalBrand as any)?.viewerHeaderStyle,- );- const inheritedHideFolderIconsInMain = Boolean(- (globalBrand as any)?.hideFolderIconsInMain,- );- setShowFolderTree(inheritedShowFolderTree);- setCardLayout(inheritedCardLayout);- setViewerHeaderStyle(inheritedViewerHeaderStyle);- setHideFolderIconsInMain(inheritedHideFolderIconsInMain);- initialLayoutSnapshotRef.current = {- cardLayout: inheritedCardLayout,- showFolderTree: inheritedShowFolderTree,- viewerHeaderStyle: inheritedViewerHeaderStyle,- hideFolderIconsInMain: inheritedHideFolderIconsInMain,- };- const initialCtaLabel = (globalBrand as any)?.ctaLabel ?? "";- const initialCtaUrl = (globalBrand as any)?.ctaUrl ?? "";- setCtaLabel(initialCtaLabel);- setCtaUrl(initialCtaUrl);- setCtaEnabled(!!(initialCtaLabel || initialCtaUrl));- setLinkPreviewEnabled(- (globalBrand as any)?.customLinkPreviewEnabled === true,- );- setLinkPreviewTitle((globalBrand as any)?.linkPreviewTitle ?? "");- setLinkPreviewDescription(- (globalBrand as any)?.linkPreviewDescription ?? "",- );- setLinkPreviewImage((globalBrand as any)?.linkPreviewImage ?? null);- setLinkPreviewFavicon((globalBrand as any)?.linkPreviewFavicon ?? null);- const inheritedLanguage =- asSupportedLocale((globalBrand as any)?.defaultLanguage) ??- DEFAULT_LOCALE;- setDefaultLanguage(inheritedLanguage);- initialLanguageRef.current = inheritedLanguage;- } else {- setBrandColor("#000000");- setAccentColor("#FFFFFF");- setAccentButtonColor("#000000");- setApplyAccentColorToDataroomView(false);- setLogo(null);- setHideLogoOverride(null);- setBanner(DEFAULT_BANNER_IMAGE);- setOriginalBanner(DEFAULT_BANNER_IMAGE);- setWelcomeMessage(DEFAULT_WELCOME_MESSAGE);- setWelcomeEnabled(false);- setWelcomeMessageError(null);- setShowFolderTree(true);- setCardLayout("LIST");- setViewerHeaderStyle("DEFAULT");- setHideFolderIconsInMain(false);- initialLayoutSnapshotRef.current = {- cardLayout: "LIST",- showFolderTree: true,- viewerHeaderStyle: "DEFAULT",- hideFolderIconsInMain: false,- };- setCtaLabel("");- setCtaUrl("");- setCtaEnabled(false);- setLinkPreviewEnabled(false);- setLinkPreviewTitle("");- setLinkPreviewDescription("");- setLinkPreviewImage(null);- setLinkPreviewFavicon(null);- setDefaultLanguage(DEFAULT_LOCALE);- initialLanguageRef.current = DEFAULT_LOCALE;+ // Re-apply only when the selected brand identity changes so SWR refreshes+ // of the same brand do not wipe in-progress edits.+ useEffect(() => {+ if (!brandSourceKey) return;+ if (isCustomBrand) {+ if (dataroomBrand) {+ applySourceBrand(dataroomBrand);+ return;+ }+ applyEmptyCustomBrand();+ return;}- }, [dataroomBrand, globalBrand]);++ if (!selectedTeamBrand) return;+ applySourceBrand(selectedTeamBrand);+ }, [brandSourceKey]);++ const inheritedSnapshot = sourceBrandSnapshotRef.current;+ const hasInheritedEdits =+ !isCustomBrand &&+ inheritedSnapshot !== null &&+ !brandEditorSnapshotsEqual(inheritedSnapshot, {+ brandColor,+ accentColor,+ accentButtonColor,+ applyAccentColorToDataroomView,+ logo,+ hideLogo,+ banner,+ welcomeMessage,+ welcomeEnabled,+ cardLayout,+ showFolderTree,+ viewerHeaderStyle,+ hideFolderIconsInMain,+ ctaLabel,+ ctaUrl,+ ctaEnabled,+ linkPreviewEnabled,+ linkPreviewTitle,+ linkPreviewDescription,+ linkPreviewImage,+ linkPreviewFavicon,+ defaultLanguage,+ });+ const canSaveBranding = isCustomBrand || hasInheritedEdits;useEffect(() => {if (!linkPreviewEnabled && previewTab === "shared-link-preview") {@@ -610,6 +694,10 @@ export default function DataroomBrandPage() {const saveBranding = async (e: any) => {e.preventDefault();+ if (!canSaveBranding) {+ return;+ }+// Block save and prompt for upgrade if the user changed any layout or// language settings without an eligible plan. Branding-only changes// (colors, banner, logo) still flow through.@@ -630,105 +718,123 @@ export default function DataroomBrandPage() {setIsLoading(true);- // Upload the image if it's a data URL- let blobUrl: string | null = logo && logo.startsWith("data:") ? null : logo;- if (logo && logo.startsWith("data:")) {- // Convert the data URL to a blob- const blob = convertDataUrlToFile({ dataUrl: logo });- // Upload the blob to vercel storage- blobUrl = await uploadImage(blob);- setLogo(blobUrl);- }+ try {+ // Upload the image if it's a data URL+ let blobUrl: string | null = logo && logo.startsWith("data:") ? null : logo;+ if (logo && logo.startsWith("data:")) {+ // Convert the data URL to a blob+ const blob = convertDataUrlToFile({ dataUrl: logo });+ // Upload the blob to vercel storage+ blobUrl = await uploadImage(blob);+ setLogo(blobUrl);+ }- let bannerBlobUrl: string | null =- banner && banner.startsWith("data:") ? null : banner;- // Don't upload if banner is set to hide- if (banner && banner.startsWith("data:")) {- // Convert the data URL to a blob- const blob = convertDataUrlToFile({ dataUrl: banner });- // Upload the blob to vercel storage- bannerBlobUrl = await uploadImage(blob);- setBanner(bannerBlobUrl);- } else if (banner === "no-banner") {- // Use the special value to hide the banner- bannerBlobUrl = "no-banner";- }+ let bannerBlobUrl: string | null =+ banner && banner.startsWith("data:") ? null : banner;+ // Don't upload if banner is set to hide+ if (banner && banner.startsWith("data:")) {+ // Convert the data URL to a blob+ const blob = convertDataUrlToFile({ dataUrl: banner });+ // Upload the blob to vercel storage+ bannerBlobUrl = await uploadImage(blob);+ setBanner(bannerBlobUrl);+ } else if (banner === "no-banner") {+ // Use the special value to hide the banner+ bannerBlobUrl = "no-banner";+ }- let linkPreviewImageUrl: string | null =- linkPreviewImage && linkPreviewImage.startsWith("data:")- ? null- : linkPreviewImage;- if (linkPreviewImage?.startsWith("data:")) {- const blob = convertDataUrlToFile({ dataUrl: linkPreviewImage });- linkPreviewImageUrl = await uploadImage(blob);- setLinkPreviewImage(linkPreviewImageUrl);- }+ let linkPreviewImageUrl: string | null =+ linkPreviewImage && linkPreviewImage.startsWith("data:")+ ? null+ : linkPreviewImage;+ if (linkPreviewImage?.startsWith("data:")) {+ const blob = convertDataUrlToFile({ dataUrl: linkPreviewImage });+ linkPreviewImageUrl = await uploadImage(blob);+ setLinkPreviewImage(linkPreviewImageUrl);+ }- let linkPreviewFaviconUrl: string | null =- linkPreviewFavicon && linkPreviewFavicon.startsWith("data:")- ? null- : linkPreviewFavicon;- if (linkPreviewFavicon?.startsWith("data:")) {- const blob = convertDataUrlToFile({ dataUrl: linkPreviewFavicon });- linkPreviewFaviconUrl = await uploadImage(blob);- setLinkPreviewFavicon(linkPreviewFaviconUrl);- }+ let linkPreviewFaviconUrl: string | null =+ linkPreviewFavicon && linkPreviewFavicon.startsWith("data:")+ ? null+ : linkPreviewFavicon;+ if (linkPreviewFavicon?.startsWith("data:")) {+ const blob = convertDataUrlToFile({ dataUrl: linkPreviewFavicon });+ linkPreviewFaviconUrl = await uploadImage(blob);+ setLinkPreviewFavicon(linkPreviewFaviconUrl);+ }- const data = {- welcomeMessage: hasBusinessMessagingAccess- ? welcomeEnabled- ? welcomeMessage.trim() || DEFAULT_WELCOME_MESSAGE- : null- : ((dataroomBrand as any)?.welcomeMessage ?? null),- brandColor: brandColor,- accentColor: accentColor,- accentButtonColor: accentButtonColor,- applyAccentColorToDataroomView,- logo: blobUrl,- hideLogo: hideLogoOverride,- banner: bannerBlobUrl,- cardLayout,- showFolderTree,- viewerLayoutPreset: derivedLayoutPreset,- viewerHeaderStyle,- hideFolderIconsInMain,- ctaLabel: hasBusinessMessagingAccess- ? ctaEnabled- ? ctaLabel.trim() || null- : null- : ((dataroomBrand as any)?.ctaLabel ?? null),- ctaUrl: hasBusinessMessagingAccess- ? ctaEnabled- ? ctaUrl.trim() || null- : null- : ((dataroomBrand as any)?.ctaUrl ?? null),- customLinkPreviewEnabled: linkPreviewEnabled,- linkPreviewTitle: linkPreviewEnabled- ? linkPreviewTitle.trim() || null- : null,- linkPreviewDescription: linkPreviewEnabled- ? linkPreviewDescription.trim() || null- : null,- linkPreviewImage: linkPreviewEnabled ? linkPreviewImageUrl : null,- linkPreviewFavicon: linkPreviewEnabled ? linkPreviewFaviconUrl : null,- defaultLanguage,- };+ const data = {+ welcomeMessage: hasBusinessMessagingAccess+ ? welcomeEnabled+ ? welcomeMessage.trim() || DEFAULT_WELCOME_MESSAGE+ : null+ : ((dataroomBrand as any)?.welcomeMessage ?? null),+ brandColor: brandColor,+ accentColor: accentColor,+ accentButtonColor: accentButtonColor,+ applyAccentColorToDataroomView,+ logo: blobUrl,+ hideLogo: hideLogo,+ banner: bannerBlobUrl,+ cardLayout,+ showFolderTree,+ viewerLayoutPreset: derivedLayoutPreset,+ viewerHeaderStyle,+ hideFolderIconsInMain,+ ctaLabel: hasBusinessMessagingAccess+ ? ctaEnabled+ ? ctaLabel.trim() || null+ : null+ : ((dataroomBrand as any)?.ctaLabel ?? null),+ ctaUrl: hasBusinessMessagingAccess+ ? ctaEnabled+ ? ctaUrl.trim() || null+ : null+ : ((dataroomBrand as any)?.ctaUrl ?? null),+ customLinkPreviewEnabled: linkPreviewEnabled,+ linkPreviewTitle: linkPreviewEnabled+ ? linkPreviewTitle.trim() || null+ : null,+ linkPreviewDescription: linkPreviewEnabled+ ? linkPreviewDescription.trim() || null+ : null,+ linkPreviewImage: linkPreviewEnabled ? linkPreviewImageUrl : null,+ linkPreviewFavicon: linkPreviewEnabled ? linkPreviewFaviconUrl : null,+ defaultLanguage,+ };- const res = await fetch(- `/api/teams/${teamInfo?.currentTeam?.id}/datarooms/${dataroom.id}/branding`,- {+ const brandingUrl = `/api/teams/${teamInfo?.currentTeam?.id}/datarooms/${dataroom.id}/branding`;+ const dataroomUrl = `/api/teams/${teamInfo?.currentTeam?.id}/datarooms/${dataroom.id}`;+ const res = await fetch(brandingUrl, {method: dataroomBrand ? "PUT" : "POST",body: JSON.stringify(data),headers: {"Content-Type": "application/json",},- },- );- if (res.ok) {- mutate(- `/api/teams/${teamInfo?.currentTeam?.id}/datarooms/${dataroom.id}/branding`,- );- // Update the original banner state to the new saved value+ });+ if (!res.ok) {+ toast.error("Failed to update branding");+ return;+ }++ await mutate(brandingUrl);++ if (!isCustomBrand) {+ const unstickRes = await fetch(dataroomUrl, {+ method: "PATCH",+ headers: { "Content-Type": "application/json" },+ body: JSON.stringify({ brandId: null }),+ });+ if (!unstickRes.ok) {+ toast.error(+ "Saved branding, but failed to switch to a custom brand",+ );+ return;+ }+ await mutate(dataroomUrl);+ await mutate(brandingUrl);+ }+setOriginalBanner(data.banner);initialLanguageRef.current = defaultLanguage;initialLayoutSnapshotRef.current = {@@ -737,8 +843,37 @@ export default function DataroomBrandPage() {viewerHeaderStyle,hideFolderIconsInMain,};+ sourceBrandSnapshotRef.current = {+ brandColor,+ accentColor,+ accentButtonColor,+ applyAccentColorToDataroomView,+ logo: data.logo,+ hideLogo,+ banner: data.banner,+ welcomeMessage,+ welcomeEnabled,+ cardLayout,+ showFolderTree,+ viewerHeaderStyle,+ hideFolderIconsInMain,+ ctaLabel,+ ctaUrl,+ ctaEnabled,+ linkPreviewEnabled,+ linkPreviewTitle,+ linkPreviewDescription,+ linkPreviewImage: data.linkPreviewImage,+ linkPreviewFavicon: data.linkPreviewFavicon,+ defaultLanguage,+ };+ toast.success(+ isCustomBrand+ ? "Branding updated successfully"+ : "Saved as custom brand",+ );+ } finally {setIsLoading(false);- toast.success("Branding updated successfully");}};@@ -755,85 +890,12 @@ export default function DataroomBrandPage() {},);if (res.ok) {- hasSeededNullDataroomFromGlobalRef.current = true;await mutate(`/api/teams/${teamInfo?.currentTeam?.id}/datarooms/${dataroom.id}/branding`,null,{ revalidate: false },);-- // Rehydrate from the team/global brand instead of fixed defaults so the- // UI mirrors inherited branding immediately after the dataroom row is- // cleared (matches the seed-from-global effect above).- const inheritedBanner = globalBrand?.banner ?? DEFAULT_BANNER_IMAGE;- const inheritedCardLayout = asDataroomCardLayout(- (globalBrand as any)?.cardLayout,- );- const inheritedShowFolderTree =- (globalBrand as any)?.showFolderTree ?? true;- const inheritedViewerHeaderStyle = asDataroomViewerHeaderStyle(- (globalBrand as any)?.viewerHeaderStyle,- );- const inheritedHideFolderIconsInMain = Boolean(- (globalBrand as any)?.hideFolderIconsInMain,- );- const inheritedCtaLabel = (globalBrand as any)?.ctaLabel ?? "";- const inheritedCtaUrl = (globalBrand as any)?.ctaUrl ?? "";- const inheritedWelcomeSaved = globalBrand?.welcomeMessage ?? null;- const inheritedWelcomeMessage =- inheritedWelcomeSaved || DEFAULT_WELCOME_MESSAGE;- const inheritedLogoFields = mergeBrandLogoFields({- dataroom: null,- team: globalBrand,- });-- setLogo(inheritedLogoFields.logo);- setHideLogoOverride(null);- setBanner(inheritedBanner);- setOriginalBanner(inheritedBanner);- setBrandColor(globalBrand?.brandColor ?? "#000000");- setAccentColor(globalBrand?.accentColor ?? "#FFFFFF");- setAccentButtonColor(- (globalBrand as any)?.accentButtonColor ??- globalBrand?.brandColor ??- "#000000",- );- setApplyAccentColorToDataroomView(- (globalBrand as any)?.applyAccentColorToDataroomView ?? false,- );- setShowFolderTree(inheritedShowFolderTree);- setCardLayout(inheritedCardLayout);- setViewerHeaderStyle(inheritedViewerHeaderStyle);- setHideFolderIconsInMain(inheritedHideFolderIconsInMain);- initialLayoutSnapshotRef.current = {- cardLayout: inheritedCardLayout,- showFolderTree: inheritedShowFolderTree,- viewerHeaderStyle: inheritedViewerHeaderStyle,- hideFolderIconsInMain: inheritedHideFolderIconsInMain,- };- setCtaLabel(inheritedCtaLabel);- setCtaUrl(inheritedCtaUrl);- setCtaEnabled(!!(inheritedCtaLabel || inheritedCtaUrl));- setWelcomeMessage(inheritedWelcomeMessage);- setWelcomeEnabled(- !!inheritedWelcomeSaved &&- inheritedWelcomeSaved !== DEFAULT_WELCOME_MESSAGE,- );- setWelcomeMessageError(validateWelcomeMessage(inheritedWelcomeMessage));- setLinkPreviewEnabled(- (globalBrand as any)?.customLinkPreviewEnabled === true,- );- setLinkPreviewTitle((globalBrand as any)?.linkPreviewTitle ?? "");- setLinkPreviewDescription(- (globalBrand as any)?.linkPreviewDescription ?? "",- );- setLinkPreviewImage((globalBrand as any)?.linkPreviewImage ?? null);- setLinkPreviewFavicon((globalBrand as any)?.linkPreviewFavicon ?? null);- const resetLanguage =- asSupportedLocale((globalBrand as any)?.defaultLanguage) ??- DEFAULT_LOCALE;- setDefaultLanguage(resetLanguage);- initialLanguageRef.current = resetLanguage;+ applyEmptyCustomBrand();setIsLoading(false);toast.success("Branding reset successfully");} else {@@ -899,7 +961,82 @@ export default function DataroomBrandPage() {</div></div>- {/* Main Layout */}+ {brands.length > 0 ? (+ <div className="mb-4 max-w-md space-y-1">+ <Label>Brand</Label>+ <Select+ value={dataroom?.brandId ?? CUSTOM_DATAROOM_BRAND}+ onValueChange={async (value) => {+ const teamId = teamInfo?.currentTeam?.id;+ if (!teamId || !dataroom?.id) return;+ const res = await fetch(+ `/api/teams/${teamId}/datarooms/${dataroom.id}`,+ {+ method: "PATCH",+ headers: { "Content-Type": "application/json" },+ body: JSON.stringify({+ brandId: value === CUSTOM_DATAROOM_BRAND ? null : value,+ }),+ },+ );+ if (!res.ok) {+ toast.error("Failed to update brand");+ return;+ }+ const nextBrandId =+ value === CUSTOM_DATAROOM_BRAND ? null : value;+ await mutate(+ `/api/teams/${teamId}/datarooms/${dataroom.id}`,+ (current) =>+ current ? { ...current, brandId: nextBrandId } : current,+ { revalidate: true },+ );+ await mutate(+ `/api/teams/${teamId}/datarooms/${dataroom.id}/branding`,+ );+ toast.success(+ value === CUSTOM_DATAROOM_BRAND+ ? "Using custom brand"+ : "Using team brand",+ );+ }}+ >+ <SelectTrigger>+ <SelectValue placeholder={CUSTOM_DATAROOM_BRAND_LABEL} />+ </SelectTrigger>+ <SelectContent>+ <SelectItem value={CUSTOM_DATAROOM_BRAND}>+ {CUSTOM_DATAROOM_BRAND_LABEL}+ </SelectItem>+ <SelectSeparator />+ <SelectGroup>+ <SelectLabel className="text-xs font-normal text-muted-foreground">+ Inherit from team brands+ </SelectLabel>+ {brands.map((item) => (+ <SelectItem+ key={item.id}+ value={item.id}+ className={+ item.id === defaultBrandId ? "pr-16" : undefined+ }+ >+ {item.name}+ </SelectItem>+ ))}+ </SelectGroup>+ </SelectContent>+ </Select>+ {isCustomBrand ? null : (+ <p className="text-xs text-muted-foreground">+ {hasInheritedEdits+ ? "Saving will switch this data room to a custom brand based on the selected team brand."+ : "This data room is using a team brand. Edit any setting and save to override it with a custom brand."}+ </p>+ )}+ </div>+ ) : null}+<div className="flex w-full flex-col gap-6 lg:min-h-0 lg:flex-1 lg:flex-row lg:gap-8">{/* Settings Column */}<div className="flex w-full flex-col gap-6 lg:min-h-0 lg:w-[420px] lg:shrink-0">@@ -1084,8 +1221,9 @@ export default function DataroomBrandPage() {Show no logo</Label><p className="text-xs text-muted-foreground">- Overrides the team logo setting for this data- room.+ {isCustomBrand || hasInheritedEdits+ ? "Visitors see no logo at all, not even the Papermark logo."+ : "This setting comes from the selected team brand."}</p></div></div>@@ -1805,7 +1943,7 @@ export default function DataroomBrandPage() {{/* Action Buttons - Always Visible */}<div className="flex items-center gap-4 border-t bg-background pt-4 lg:sticky lg:bottom-0 lg:z-10 lg:shrink-0 lg:pb-2">- {blocksSave ? (+ {blocksSave && canSaveBranding ? (<UpgradeButtontext={languageBlocksSave ? "save changes" : "Save changes"}clickedPlan={@@ -1828,16 +1966,21 @@ export default function DataroomBrandPage() {<ButtononClick={saveBranding}loading={isLoading}- disabled={hasBusinessMessagingAccess && !!welcomeMessageError}+ disabled={+ !canSaveBranding ||+ (hasBusinessMessagingAccess && !!welcomeMessageError)+ }className="bg-black text-white hover:bg-gray-800">- Save changes+ {hasInheritedEdits+ ? "Override custom brand"+ : "Save changes"}</Button>)}<Buttonvariant="ghost"onClick={handleDelete}- disabled={!dataroomBrand}+ disabled={!isCustomBrand || !dataroomBrand}>Reset branding</Button>diff --git a/prisma/migrations/20260820000000_add_multiple_team_brands/migration.sql b/prisma/migrations/20260820000000_add_multiple_team_brands/migration.sqlnew file mode 100644index 00000000..fa57fd61--- /dev/null+++ b/prisma/migrations/20260820000000_add_multiple_team_brands/migration.sql@@ -0,0 +1,42 @@+-- Named team brands: drop the 1:1 unique, add a default pointer, and+-- let links and datarooms select a Brand row.++ALTER TABLE "Brand" ADD COLUMN "name" TEXT NOT NULL DEFAULT 'Default';++ALTER TABLE "Team" ADD COLUMN "defaultBrandId" TEXT;++UPDATE "Team" AS t+SET "defaultBrandId" = b.id+FROM "Brand" AS b+WHERE b."teamId" = t.id;++ALTER TABLE "Link" ADD COLUMN "brandId" TEXT;++ALTER TABLE "Dataroom" ADD COLUMN "brandId" TEXT;++DROP INDEX "Brand_teamId_key";++CREATE INDEX "Brand_teamId_idx" ON "Brand"("teamId");++CREATE UNIQUE INDEX "Brand_teamId_name_key" ON "Brand"("teamId", "name");++CREATE INDEX "Team_defaultBrandId_idx" ON "Team"("defaultBrandId");++CREATE INDEX "Link_brandId_idx" ON "Link"("brandId");++CREATE INDEX "Dataroom_brandId_idx" ON "Dataroom"("brandId");++ALTER TABLE "Team"+ADD CONSTRAINT "Team_defaultBrandId_fkey"+FOREIGN KEY ("defaultBrandId") REFERENCES "Brand"("id")+ON DELETE SET NULL ON UPDATE CASCADE;++ALTER TABLE "Link"+ADD CONSTRAINT "Link_brandId_fkey"+FOREIGN KEY ("brandId") REFERENCES "Brand"("id")+ON DELETE SET NULL ON UPDATE CASCADE;++ALTER TABLE "Dataroom"+ADD CONSTRAINT "Dataroom_brandId_fkey"+FOREIGN KEY ("brandId") REFERENCES "Brand"("id")+ON DELETE SET NULL ON UPDATE CASCADE;diff --git a/prisma/schema/brand.prisma b/prisma/schema/brand.prismanew file mode 100644index 00000000..e59c5c26--- /dev/null+++ b/prisma/schema/brand.prisma@@ -0,0 +1,45 @@+model Brand {+ id String @id @default(cuid())+ logo String? // This should be a reference to where the file is stored (S3, Google Cloud Storage, etc.)+ hideLogo Boolean @default(false) // Show no logo at all in the viewer, not even the Papermark fallback+ banner String? // Banner image for dataroom view (fallback)+ brandColor String? // This should be a reference to the brand color+ accentColor String? // This should be a reference to the accent color (front-page background)+ accentButtonColor String? // Color used for CTA buttons (separate from brand/background)+ applyAccentColorToDataroomView Boolean @default(false) // Global default for whether accentColor applies to dataroom list/tree viewer background+ welcomeMessage String? // This should be a reference to the welcome message+ ctaLabel String? // Default CTA button label (inherited by datarooms unless overridden)+ ctaUrl String? // Default CTA button URL (inherited by datarooms unless overridden)+ privacyPolicyUrl String? // Access screen privacy link, custom domains only++ cardLayout String @default("LIST")+ showFolderTree Boolean @default(true)+ viewerLayoutPreset String @default("STANDARD")+ viewerHeaderStyle String @default("DEFAULT")+ hideFolderIconsInMain Boolean @default(false)++ // Default Open Graph / social preview for shared links (per-link settings override)+ customLinkPreviewEnabled Boolean @default(false)+ linkPreviewTitle String?+ linkPreviewDescription String?+ linkPreviewImage String?+ linkPreviewFavicon String?++ // Visitor-side language (i18n) settings — applies to the access form and+ // document viewer chrome shown to people who open a shared link.+ defaultLanguage String @default("en") // BCP-47 tag from SUPPORTED_LOCALES; admin-chosen viewer language++ name String @default("Default")++ teamId String+ team Team @relation("TeamBrands", fields: [teamId], references: [id], onDelete: Cascade)+ defaultForTeam Team[] @relation("TeamDefaultBrand")+ links Link[]+ datarooms Dataroom[] @relation("DataroomBaseBrand")++ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt++ @@unique([teamId, name])+ @@index([teamId])+}diff --git a/prisma/schema/dataroom.prisma b/prisma/schema/dataroom.prismaindex eaf6fee2..f312ae8b 100644--- a/prisma/schema/dataroom.prisma+++ b/prisma/schema/dataroom.prisma@@ -13,6 +13,8 @@ model Dataroom {viewers Viewer[]viewerGroups ViewerGroup[]brand DataroomBrand?+ brandId String?+ baseBrand Brand? @relation("DataroomBaseBrand", fields: [brandId], references: [id], onDelete: SetNull)// Internal team members scoped to this dataroom (DATAROOM_MEMBER role).userDatarooms UserDataroom[]@@ -89,6 +91,7 @@ model Dataroom {updatedAt DateTime @updatedAt@@index([teamId])+ @@index([brandId])}// =============================================================================diff --git a/prisma/schema/link.prisma b/prisma/schema/link.prismaindex c2bc70e7..471ea8d6 100644--- a/prisma/schema/link.prisma+++ b/prisma/schema/link.prisma@@ -95,6 +95,9 @@ model Link {teamId String?team Team? @relation(fields: [teamId], references: [id], onDelete: Cascade)+ brandId String?+ brand Brand? @relation(fields: [brandId], references: [id], onDelete: SetNull)+ownerId String?owner User? @relation("LinkOwner", fields: [ownerId], references: [id], onDelete: SetNull)@@ -119,6 +122,7 @@ model Link {@@index([permissionGroupId]) // Performance optimization for permission group queries@@index([deletedAt]) // Performance optimization for filtering deleted links@@index([ownerId]) // Performance optimization for link owner queries+ @@index([brandId])}model LinkPreset {diff --git a/prisma/schema/schema.prisma b/prisma/schema/schema.prismaindex e484d746..2a8d73dc 100644--- a/prisma/schema/schema.prisma+++ b/prisma/schema/schema.prisma@@ -94,44 +94,6 @@ model User {referralInvites ReferralInvite[]}-model Brand {- id String @id @default(cuid())- logo String? // This should be a reference to where the file is stored (S3, Google Cloud Storage, etc.)- hideLogo Boolean @default(false) // Show no logo at all in the viewer, not even the Papermark fallback- banner String? // Banner image for dataroom view (fallback)- brandColor String? // This should be a reference to the brand color- accentColor String? // This should be a reference to the accent color (front-page background)- accentButtonColor String? // Color used for CTA buttons (separate from brand/background)- applyAccentColorToDataroomView Boolean @default(false) // Global default for whether accentColor applies to dataroom list/tree viewer background- welcomeMessage String? // This should be a reference to the welcome message- ctaLabel String? // Default CTA button label (inherited by datarooms unless overridden)- ctaUrl String? // Default CTA button URL (inherited by datarooms unless overridden)- privacyPolicyUrl String? // Access screen privacy link, custom domains only-- cardLayout String @default("LIST")- showFolderTree Boolean @default(true)- viewerLayoutPreset String @default("STANDARD")- viewerHeaderStyle String @default("DEFAULT")- hideFolderIconsInMain Boolean @default(false)-- // Default Open Graph / social preview for shared links (per-link settings override)- customLinkPreviewEnabled Boolean @default(false)- linkPreviewTitle String?- linkPreviewDescription String?- linkPreviewImage String?- linkPreviewFavicon String?-- // Visitor-side language (i18n) settings — applies to the access form and- // document viewer chrome shown to people who open a shared link.- defaultLanguage String @default("en") // BCP-47 tag from SUPPORTED_LOCALES; admin-chosen viewer language-- teamId String @unique- team Team @relation(fields: [teamId], references: [id], onDelete: Cascade)-- createdAt DateTime @default(now())- updatedAt DateTime @updatedAt-}-model VerificationToken {identifier Stringtoken String @uniquediff --git a/prisma/schema/team.prisma b/prisma/schema/team.prismaindex 548e0c89..b52444e9 100644--- a/prisma/schema/team.prisma+++ b/prisma/schema/team.prisma@@ -9,7 +9,9 @@ model Team {domains Domain[]invitations Invitation[]sentEmails SentEmail[]- brand Brand?+ brands Brand[] @relation("TeamBrands")+ defaultBrandId String?+ defaultBrand Brand? @relation("TeamDefaultBrand", fields: [defaultBrandId], references: [id], onDelete: SetNull)datarooms Dataroom[]agreements Agreement[]viewerGroups ViewerGroup[]@@ -93,6 +95,8 @@ model Team {referralTrackSelectedAt DateTime?referralProfile Json?referralInvites ReferralInvite[]++ @@index([defaultBrandId])}enum Role {