@sesionario/blocks 1.16.0 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -284,6 +284,10 @@ type PlatformAccountMenuOrg = {
284
284
  id: string;
285
285
  name: string;
286
286
  slug: string;
287
+ logo?: string | null;
288
+ };
289
+ type MergedPlatformAccountOrg = PlatformAccountMenuOrg & {
290
+ canManage: boolean;
287
291
  };
288
292
  type PlatformAccountMenuUrls = {
289
293
  authAppUrl: string;
@@ -306,8 +310,13 @@ type PlatformAccountMenuLabels = {
306
310
  /** @deprecated Unused; kept so apps can pass labels without breaking. */
307
311
  orgManagement: string;
308
312
  backoffice: string;
313
+ /** @deprecated Unused; kept so apps can pass labels without breaking. */
309
314
  memberOrgs: string;
315
+ /** @deprecated Unused; kept so apps can pass labels without breaking. */
310
316
  managementOrgs: string;
317
+ showMoreOrgs: string;
318
+ showLessOrgs: string;
319
+ manageOrg: string;
311
320
  language: string;
312
321
  theme: string;
313
322
  themeLight: string;
@@ -318,6 +327,13 @@ type PlatformAccountMenuLabels = {
318
327
  signingOut: string;
319
328
  accountSettings: string;
320
329
  };
330
+ /** Visible org rows before “Show more”. */
331
+ declare const PLATFORM_ACCOUNT_ORG_COLLAPSE_AT = 4;
332
+ /**
333
+ * Union member + manageable orgs by id (member order first, then manageable-only).
334
+ * `canManage` is true when the org appears in `manageableOrgs`.
335
+ */
336
+ declare function mergePlatformAccountOrgs(memberOrgs: PlatformAccountMenuOrg[], manageableOrgs: PlatformAccountMenuOrg[]): MergedPlatformAccountOrg[];
321
337
  type PlatformAccountMenuProps = {
322
338
  variant?: PlatformAccountMenuVariant;
323
339
  /** While session is resolving. */
@@ -1254,4 +1270,4 @@ declare function useRealtimeChannel({ getWsUrl, onEvent, enabled, reconnectDelay
1254
1270
 
1255
1271
  declare function cn(...inputs: ClassValue[]): string;
1256
1272
 
1257
- export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ConversationKind, type DescribedPlaybackError, DropdownMenuItem, DropdownMenuSeparator, type EmojiCategoryData, type EmojiCategoryKey, type EmojiDatum, EmojiInput, type EmojiInputProps, EmojiPicker, type EmojiPickerLabels, type EmojiPickerLocale, EmojiPickerPopover, type EmojiPickerPopoverProps, type EmojiPickerProps, type EmojiSkinTone, EmojiTextarea, type EmojiTextareaProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, ExpandableText, type ExpandableTextProps, type FeatureEntry, type FindOrCreateConversationInput, type HlsPlayerMode, ImageLightbox, type ImageLightboxLabels, type ImageLightboxProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, Message, MessageAvatar, MessageComposer, type MessageComposerProps, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, type MexicoMapProps, type MexicoState, type MexicoStateId, type OpenThreadRequest, OrgSwitcher, type OrgSwitcherLabels, type OrgSwitcherProps, type OrgSwitcherTenant, PhoneInput, type PhoneInputProps, PlatformAccountMenu, type PlatformAccountMenuLabels, type PlatformAccountMenuOrg, type PlatformAccountMenuProps, type PlatformAccountMenuUrls, type PlatformAccountMenuUser, type PlatformAccountMenuVariant, PlatformNavbar, type PlatformNavbarProps, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type ProfessionalVerificationStatus, type QualityLevel, type RealtimeEvent, type ScrollFadeXEdges, SearchCommand, type SearchCommandLabels, type SearchCommandProps, type SearchCommandSelection, type SearchHit, SearchablePicker, type SearchablePickerCreateOption, type SearchablePickerLabels, type SearchablePickerMultipleProps, type SearchablePickerPinned, type SearchablePickerProps, type SearchablePickerSingleProps, type SupportChatClient, type SupportConversation, type SupportMessage, type SupportMessengerItem, type SupportMessengerLabels, SupportMessengerProvider, type SupportMessengerProviderProps, type SupportMessengerTab, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, type UseRealtimeChannelOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, type UseSupportConversationOptions, type UseSupportConversationResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, fuzzyMatch, insertAtCaret, markerVariants, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
1273
+ export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ConversationKind, type DescribedPlaybackError, DropdownMenuItem, DropdownMenuSeparator, type EmojiCategoryData, type EmojiCategoryKey, type EmojiDatum, EmojiInput, type EmojiInputProps, EmojiPicker, type EmojiPickerLabels, type EmojiPickerLocale, EmojiPickerPopover, type EmojiPickerPopoverProps, type EmojiPickerProps, type EmojiSkinTone, EmojiTextarea, type EmojiTextareaProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, ExpandableText, type ExpandableTextProps, type FeatureEntry, type FindOrCreateConversationInput, type HlsPlayerMode, ImageLightbox, type ImageLightboxLabels, type ImageLightboxProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, type MergedPlatformAccountOrg, Message, MessageAvatar, MessageComposer, type MessageComposerProps, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, type MexicoMapProps, type MexicoState, type MexicoStateId, type OpenThreadRequest, OrgSwitcher, type OrgSwitcherLabels, type OrgSwitcherProps, type OrgSwitcherTenant, PLATFORM_ACCOUNT_ORG_COLLAPSE_AT, PhoneInput, type PhoneInputProps, PlatformAccountMenu, type PlatformAccountMenuLabels, type PlatformAccountMenuOrg, type PlatformAccountMenuProps, type PlatformAccountMenuUrls, type PlatformAccountMenuUser, type PlatformAccountMenuVariant, PlatformNavbar, type PlatformNavbarProps, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type ProfessionalVerificationStatus, type QualityLevel, type RealtimeEvent, type ScrollFadeXEdges, SearchCommand, type SearchCommandLabels, type SearchCommandProps, type SearchCommandSelection, type SearchHit, SearchablePicker, type SearchablePickerCreateOption, type SearchablePickerLabels, type SearchablePickerMultipleProps, type SearchablePickerPinned, type SearchablePickerProps, type SearchablePickerSingleProps, type SupportChatClient, type SupportConversation, type SupportMessage, type SupportMessengerItem, type SupportMessengerLabels, SupportMessengerProvider, type SupportMessengerProviderProps, type SupportMessengerTab, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, type UseRealtimeChannelOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, type UseSupportConversationOptions, type UseSupportConversationResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, fuzzyMatch, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
package/dist/index.d.ts CHANGED
@@ -284,6 +284,10 @@ type PlatformAccountMenuOrg = {
284
284
  id: string;
285
285
  name: string;
286
286
  slug: string;
287
+ logo?: string | null;
288
+ };
289
+ type MergedPlatformAccountOrg = PlatformAccountMenuOrg & {
290
+ canManage: boolean;
287
291
  };
288
292
  type PlatformAccountMenuUrls = {
289
293
  authAppUrl: string;
@@ -306,8 +310,13 @@ type PlatformAccountMenuLabels = {
306
310
  /** @deprecated Unused; kept so apps can pass labels without breaking. */
307
311
  orgManagement: string;
308
312
  backoffice: string;
313
+ /** @deprecated Unused; kept so apps can pass labels without breaking. */
309
314
  memberOrgs: string;
315
+ /** @deprecated Unused; kept so apps can pass labels without breaking. */
310
316
  managementOrgs: string;
317
+ showMoreOrgs: string;
318
+ showLessOrgs: string;
319
+ manageOrg: string;
311
320
  language: string;
312
321
  theme: string;
313
322
  themeLight: string;
@@ -318,6 +327,13 @@ type PlatformAccountMenuLabels = {
318
327
  signingOut: string;
319
328
  accountSettings: string;
320
329
  };
330
+ /** Visible org rows before “Show more”. */
331
+ declare const PLATFORM_ACCOUNT_ORG_COLLAPSE_AT = 4;
332
+ /**
333
+ * Union member + manageable orgs by id (member order first, then manageable-only).
334
+ * `canManage` is true when the org appears in `manageableOrgs`.
335
+ */
336
+ declare function mergePlatformAccountOrgs(memberOrgs: PlatformAccountMenuOrg[], manageableOrgs: PlatformAccountMenuOrg[]): MergedPlatformAccountOrg[];
321
337
  type PlatformAccountMenuProps = {
322
338
  variant?: PlatformAccountMenuVariant;
323
339
  /** While session is resolving. */
@@ -1254,4 +1270,4 @@ declare function useRealtimeChannel({ getWsUrl, onEvent, enabled, reconnectDelay
1254
1270
 
1255
1271
  declare function cn(...inputs: ClassValue[]): string;
1256
1272
 
1257
- export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ConversationKind, type DescribedPlaybackError, DropdownMenuItem, DropdownMenuSeparator, type EmojiCategoryData, type EmojiCategoryKey, type EmojiDatum, EmojiInput, type EmojiInputProps, EmojiPicker, type EmojiPickerLabels, type EmojiPickerLocale, EmojiPickerPopover, type EmojiPickerPopoverProps, type EmojiPickerProps, type EmojiSkinTone, EmojiTextarea, type EmojiTextareaProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, ExpandableText, type ExpandableTextProps, type FeatureEntry, type FindOrCreateConversationInput, type HlsPlayerMode, ImageLightbox, type ImageLightboxLabels, type ImageLightboxProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, Message, MessageAvatar, MessageComposer, type MessageComposerProps, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, type MexicoMapProps, type MexicoState, type MexicoStateId, type OpenThreadRequest, OrgSwitcher, type OrgSwitcherLabels, type OrgSwitcherProps, type OrgSwitcherTenant, PhoneInput, type PhoneInputProps, PlatformAccountMenu, type PlatformAccountMenuLabels, type PlatformAccountMenuOrg, type PlatformAccountMenuProps, type PlatformAccountMenuUrls, type PlatformAccountMenuUser, type PlatformAccountMenuVariant, PlatformNavbar, type PlatformNavbarProps, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type ProfessionalVerificationStatus, type QualityLevel, type RealtimeEvent, type ScrollFadeXEdges, SearchCommand, type SearchCommandLabels, type SearchCommandProps, type SearchCommandSelection, type SearchHit, SearchablePicker, type SearchablePickerCreateOption, type SearchablePickerLabels, type SearchablePickerMultipleProps, type SearchablePickerPinned, type SearchablePickerProps, type SearchablePickerSingleProps, type SupportChatClient, type SupportConversation, type SupportMessage, type SupportMessengerItem, type SupportMessengerLabels, SupportMessengerProvider, type SupportMessengerProviderProps, type SupportMessengerTab, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, type UseRealtimeChannelOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, type UseSupportConversationOptions, type UseSupportConversationResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, fuzzyMatch, insertAtCaret, markerVariants, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
1273
+ export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ConversationKind, type DescribedPlaybackError, DropdownMenuItem, DropdownMenuSeparator, type EmojiCategoryData, type EmojiCategoryKey, type EmojiDatum, EmojiInput, type EmojiInputProps, EmojiPicker, type EmojiPickerLabels, type EmojiPickerLocale, EmojiPickerPopover, type EmojiPickerPopoverProps, type EmojiPickerProps, type EmojiSkinTone, EmojiTextarea, type EmojiTextareaProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, ExpandableText, type ExpandableTextProps, type FeatureEntry, type FindOrCreateConversationInput, type HlsPlayerMode, ImageLightbox, type ImageLightboxLabels, type ImageLightboxProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, type MergedPlatformAccountOrg, Message, MessageAvatar, MessageComposer, type MessageComposerProps, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, type MexicoMapProps, type MexicoState, type MexicoStateId, type OpenThreadRequest, OrgSwitcher, type OrgSwitcherLabels, type OrgSwitcherProps, type OrgSwitcherTenant, PLATFORM_ACCOUNT_ORG_COLLAPSE_AT, PhoneInput, type PhoneInputProps, PlatformAccountMenu, type PlatformAccountMenuLabels, type PlatformAccountMenuOrg, type PlatformAccountMenuProps, type PlatformAccountMenuUrls, type PlatformAccountMenuUser, type PlatformAccountMenuVariant, PlatformNavbar, type PlatformNavbarProps, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type ProfessionalVerificationStatus, type QualityLevel, type RealtimeEvent, type ScrollFadeXEdges, SearchCommand, type SearchCommandLabels, type SearchCommandProps, type SearchCommandSelection, type SearchHit, SearchablePicker, type SearchablePickerCreateOption, type SearchablePickerLabels, type SearchablePickerMultipleProps, type SearchablePickerPinned, type SearchablePickerProps, type SearchablePickerSingleProps, type SupportChatClient, type SupportConversation, type SupportMessage, type SupportMessengerItem, type SupportMessengerLabels, SupportMessengerProvider, type SupportMessengerProviderProps, type SupportMessengerTab, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, type UseRealtimeChannelOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, type UseSupportConversationOptions, type UseSupportConversationResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, fuzzyMatch, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import * as React7 from 'react';
3
- import { createContext, useContext, useState, useRef, useEffect, useLayoutEffect, useCallback, useId, useMemo } from 'react';
4
- import { ChevronsUpDown, CheckIcon, Smile, SearchIcon, Search, Clock, Flag, Hash, Lightbulb, Trophy, Plane, Apple, Leaf, Hand, Loader2, AlertTriangle, Inbox, X, ChevronLeft, ChevronRight, Monitor, Sun, Moon, Building2, Check, Plus, Languages, BadgeCheck, Settings, User, Activity, Users, LayoutDashboard, LogOut, LogIn, Upload, Move, ZoomOut, ZoomIn, RotateCcw, RotateCw, Grid3X3, RefreshCw, Pencil, Play, AlertCircle, VolumeX, Pause, Volume1, Volume2, PictureInPicture2, Minimize, Maximize, ArrowDownIcon, MessageCircleDashedIcon, MessageCircle, ChevronRightIcon, XIcon, CircleIcon } from 'lucide-react';
3
+ import { createContext, useContext, useState, useRef, useEffect, useLayoutEffect, useCallback, useMemo, useId } from 'react';
4
+ import { ChevronsUpDown, CheckIcon, Smile, SearchIcon, Search, Clock, Flag, Hash, Lightbulb, Trophy, Plane, Apple, Leaf, Hand, Loader2, AlertTriangle, Inbox, X, ChevronLeft, ChevronRight, Monitor, Sun, Moon, Building2, Check, Plus, Languages, BadgeCheck, Settings, User, Activity, LayoutDashboard, LogOut, LogIn, Upload, Move, ZoomOut, ZoomIn, RotateCcw, RotateCw, Grid3X3, RefreshCw, Pencil, Play, AlertCircle, VolumeX, Pause, Volume1, Volume2, PictureInPicture2, Minimize, Maximize, ArrowDownIcon, MessageCircleDashedIcon, MessageCircle, ChevronUp, ChevronDown, XIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
5
5
  import { clsx } from 'clsx';
6
6
  import { twMerge } from 'tailwind-merge';
7
7
  import { cva } from 'class-variance-authority';
@@ -1805,6 +1805,9 @@ var defaultLabels3 = {
1805
1805
  backoffice: "Backoffice",
1806
1806
  memberOrgs: "My organizations",
1807
1807
  managementOrgs: "Management team",
1808
+ showMoreOrgs: "Show more",
1809
+ showLessOrgs: "Show less",
1810
+ manageOrg: "Manage organization",
1808
1811
  language: "Language",
1809
1812
  theme: "Theme",
1810
1813
  themeLight: "Light",
@@ -1815,6 +1818,30 @@ var defaultLabels3 = {
1815
1818
  signingOut: "Signing out\u2026",
1816
1819
  accountSettings: "Account settings"
1817
1820
  };
1821
+ var PLATFORM_ACCOUNT_ORG_COLLAPSE_AT = 4;
1822
+ function mergePlatformAccountOrgs(memberOrgs, manageableOrgs) {
1823
+ const manageableIds = new Set(manageableOrgs.map((org) => org.id));
1824
+ const byId = /* @__PURE__ */ new Map();
1825
+ for (const org of memberOrgs) {
1826
+ byId.set(org.id, {
1827
+ ...org,
1828
+ canManage: manageableIds.has(org.id)
1829
+ });
1830
+ }
1831
+ for (const org of manageableOrgs) {
1832
+ const existing = byId.get(org.id);
1833
+ if (existing) {
1834
+ byId.set(org.id, {
1835
+ ...existing,
1836
+ canManage: true,
1837
+ logo: existing.logo ?? org.logo
1838
+ });
1839
+ } else {
1840
+ byId.set(org.id, { ...org, canManage: true });
1841
+ }
1842
+ }
1843
+ return Array.from(byId.values());
1844
+ }
1818
1845
  function MenuAvatar({
1819
1846
  name,
1820
1847
  image,
@@ -1882,6 +1909,85 @@ function LanguageThemeSubs({
1882
1909
  ] })
1883
1910
  ] });
1884
1911
  }
1912
+ function OrgMenuRows({
1913
+ orgs,
1914
+ appUrl,
1915
+ adminUrl,
1916
+ labels
1917
+ }) {
1918
+ const [expanded, setExpanded] = useState(false);
1919
+ const collapsible = orgs.length > PLATFORM_ACCOUNT_ORG_COLLAPSE_AT;
1920
+ const visibleOrgs = collapsible && !expanded ? orgs.slice(0, PLATFORM_ACCOUNT_ORG_COLLAPSE_AT) : orgs;
1921
+ if (orgs.length === 0) return null;
1922
+ return /* @__PURE__ */ jsxs(
1923
+ "div",
1924
+ {
1925
+ className: cn(
1926
+ expanded && orgs.length > PLATFORM_ACCOUNT_ORG_COLLAPSE_AT ? "max-h-64 overflow-y-auto scroll-fade-b" : void 0
1927
+ ),
1928
+ "data-testid": "platform-account-orgs",
1929
+ children: [
1930
+ visibleOrgs.map((org) => {
1931
+ const orgHomeHref = `${appUrl}/o/${org.slug}`;
1932
+ const manageHref = `${adminUrl}/api/auth/org/select?id=${encodeURIComponent(org.id)}`;
1933
+ return /* @__PURE__ */ jsxs(
1934
+ "div",
1935
+ {
1936
+ className: "relative flex items-center",
1937
+ "data-testid": `platform-account-org-${org.id}`,
1938
+ children: [
1939
+ /* @__PURE__ */ jsx(
1940
+ DropdownMenuItem,
1941
+ {
1942
+ asChild: true,
1943
+ className: cn("min-w-0 flex-1 gap-2", org.canManage && "pr-9"),
1944
+ children: /* @__PURE__ */ jsxs("a", { href: orgHomeHref, children: [
1945
+ /* @__PURE__ */ jsx(
1946
+ MenuAvatar,
1947
+ {
1948
+ name: org.name,
1949
+ image: org.logo,
1950
+ sizeClass: "size-6"
1951
+ }
1952
+ ),
1953
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: org.name })
1954
+ ] })
1955
+ }
1956
+ ),
1957
+ org.canManage ? /* @__PURE__ */ jsx(
1958
+ DropdownMenuItem,
1959
+ {
1960
+ asChild: true,
1961
+ className: "absolute right-1 top-1/2 size-7 -translate-y-1/2 p-0",
1962
+ children: /* @__PURE__ */ jsx("a", { href: manageHref, "aria-label": labels.manageOrg, children: /* @__PURE__ */ jsx(Settings, { className: "size-3.5" }) })
1963
+ }
1964
+ ) : null
1965
+ ]
1966
+ },
1967
+ org.id
1968
+ );
1969
+ }),
1970
+ collapsible ? /* @__PURE__ */ jsx(
1971
+ DropdownMenuItem,
1972
+ {
1973
+ className: "gap-2",
1974
+ onSelect: (event) => {
1975
+ event.preventDefault();
1976
+ setExpanded((value) => !value);
1977
+ },
1978
+ children: expanded ? /* @__PURE__ */ jsxs(Fragment, { children: [
1979
+ /* @__PURE__ */ jsx(ChevronUp, { className: "size-4" }),
1980
+ labels.showLessOrgs
1981
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1982
+ /* @__PURE__ */ jsx(ChevronDown, { className: "size-4" }),
1983
+ labels.showMoreOrgs
1984
+ ] })
1985
+ }
1986
+ ) : null
1987
+ ]
1988
+ }
1989
+ );
1990
+ }
1885
1991
  function PlatformAccountMenu({
1886
1992
  variant = "platform",
1887
1993
  isPending = false,
@@ -1906,6 +2012,10 @@ function PlatformAccountMenu({
1906
2012
  }) {
1907
2013
  const labels = { ...defaultLabels3, ...labelsProp };
1908
2014
  const [signingOut, setSigningOut] = useState(false);
2015
+ const mergedOrgs = useMemo(
2016
+ () => mergePlatformAccountOrgs(memberOrgs, manageableOrgs),
2017
+ [memberOrgs, manageableOrgs]
2018
+ );
1909
2019
  const loginHref = `${urls.authAppUrl}${urls.loginPath ?? "/login"}`;
1910
2020
  const accountHref = `${urls.authAppUrl}${urls.accountPath ?? "/account"}`;
1911
2021
  const activityHref = `${urls.authAppUrl}${urls.activityPath ?? "/account/activity"}`;
@@ -1997,26 +2107,15 @@ function PlatformAccountMenu({
1997
2107
  /* @__PURE__ */ jsx(User, { className: "size-4" }),
1998
2108
  labels.professionalProfile
1999
2109
  ] }) }),
2000
- memberOrgs.length > 0 ? /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [
2001
- /* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { className: "gap-2", children: [
2002
- /* @__PURE__ */ jsx(Users, { className: "size-4" }),
2003
- labels.memberOrgs
2004
- ] }),
2005
- /* @__PURE__ */ jsx(DropdownMenuSubContent, { className: "min-w-48 max-h-64 overflow-y-auto scroll-fade-b", children: memberOrgs.map((org) => /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsx("a", { href: `${urls.appUrl}/o/${org.slug}`, children: org.name }) }, org.id)) })
2006
- ] }) : null,
2007
- manageableOrgs.length > 0 ? /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [
2008
- /* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { className: "gap-2", children: [
2009
- /* @__PURE__ */ jsx(Building2, { className: "size-4" }),
2010
- labels.managementOrgs
2011
- ] }),
2012
- /* @__PURE__ */ jsx(DropdownMenuSubContent, { className: "min-w-48 max-h-64 overflow-y-auto scroll-fade-b", children: manageableOrgs.map((org) => /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsx(
2013
- "a",
2014
- {
2015
- href: `${urls.adminUrl}/api/auth/org/select?id=${encodeURIComponent(org.id)}`,
2016
- children: org.name
2017
- }
2018
- ) }, org.id)) })
2019
- ] }) : null,
2110
+ /* @__PURE__ */ jsx(
2111
+ OrgMenuRows,
2112
+ {
2113
+ orgs: mergedOrgs,
2114
+ appUrl: urls.appUrl,
2115
+ adminUrl: urls.adminUrl,
2116
+ labels
2117
+ }
2118
+ ),
2020
2119
  extraItems,
2021
2120
  isAdmin && urls.backofficeUrl ? /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: urls.backofficeUrl, children: [
2022
2121
  /* @__PURE__ */ jsx(LayoutDashboard, { className: "size-4" }),
@@ -7596,6 +7695,6 @@ function useRealtimeChannel({
7596
7695
  }, [enabled, reconnectDelayMs]);
7597
7696
  }
7598
7697
 
7599
- export { AvatarEditor, AvatarEditorDialog, Bubble, BubbleContent, BubbleGroup, BubbleReactions, ChatMessageList, ConfirmDestructiveDialog, DropdownMenuItem, DropdownMenuSeparator, EmojiInput, EmojiPicker, EmojiPickerPopover, EmojiTextarea, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, ErrorState, ExpandableText, ImageLightbox, LanguageContext, LanguageSwitcher, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, Message, MessageAvatar, MessageComposer, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, OrgSwitcher, PhoneInput, PlatformAccountMenu, PlatformNavbar, SearchCommand, SearchablePicker, SupportMessengerProvider, ThemeSwitcher, VerifiedProfessionalBadge, VideoPlayer, avatarFallbackStyle, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, fuzzyMatch, getAvatarColors, getInitials, insertAtCaret, markerVariants, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, useMediaQuery2 as useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
7698
+ export { AvatarEditor, AvatarEditorDialog, Bubble, BubbleContent, BubbleGroup, BubbleReactions, ChatMessageList, ConfirmDestructiveDialog, DropdownMenuItem, DropdownMenuSeparator, EmojiInput, EmojiPicker, EmojiPickerPopover, EmojiTextarea, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, ErrorState, ExpandableText, ImageLightbox, LanguageContext, LanguageSwitcher, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, Message, MessageAvatar, MessageComposer, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, OrgSwitcher, PLATFORM_ACCOUNT_ORG_COLLAPSE_AT, PhoneInput, PlatformAccountMenu, PlatformNavbar, SearchCommand, SearchablePicker, SupportMessengerProvider, ThemeSwitcher, VerifiedProfessionalBadge, VideoPlayer, avatarFallbackStyle, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, fuzzyMatch, getAvatarColors, getInitials, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, useMediaQuery2 as useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
7600
7699
  //# sourceMappingURL=index.js.map
7601
7700
  //# sourceMappingURL=index.js.map