@arbidocs/blocks 0.4.7 → 0.4.9

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.
Files changed (75) hide show
  1. package/dist/chat/AssistantToaster.d.ts +8 -0
  2. package/dist/chat/index.cjs +123 -117
  3. package/dist/chat/index.d.ts +1 -0
  4. package/dist/chat/index.js +4 -2
  5. package/dist/{chunk-MGUHR3JI.cjs → chunk-22T6KHGB.cjs} +10 -2
  6. package/dist/chunk-22T6KHGB.cjs.map +1 -0
  7. package/dist/chunk-5LUI4G5R.js +34 -0
  8. package/dist/chunk-5LUI4G5R.js.map +1 -0
  9. package/dist/{chunk-LRUCMZK6.cjs → chunk-D6XY3C4O.cjs} +4 -15
  10. package/dist/chunk-D6XY3C4O.cjs.map +1 -0
  11. package/dist/chunk-FX3K6LNZ.cjs +47 -0
  12. package/dist/chunk-FX3K6LNZ.cjs.map +1 -0
  13. package/dist/{chunk-QXEJXIP4.js → chunk-H7OD4CHN.js} +5 -16
  14. package/dist/chunk-H7OD4CHN.js.map +1 -0
  15. package/dist/{chunk-7OCFHEE6.js → chunk-IMA6I73C.js} +10 -3
  16. package/dist/chunk-IMA6I73C.js.map +1 -0
  17. package/dist/{chunk-QMDLPO3M.cjs → chunk-LXC5PTTI.cjs} +2 -2
  18. package/dist/{chunk-QMDLPO3M.cjs.map → chunk-LXC5PTTI.cjs.map} +1 -1
  19. package/dist/{chunk-G2E3O3HI.js → chunk-OJSWQM4G.js} +158 -5
  20. package/dist/chunk-OJSWQM4G.js.map +1 -0
  21. package/dist/{chunk-5SLLMK5K.cjs → chunk-PRVKJ5XL.cjs} +3 -3
  22. package/dist/chunk-PRVKJ5XL.cjs.map +1 -0
  23. package/dist/{chunk-JG4TFS3Z.cjs → chunk-RGHQFJOL.cjs} +160 -2
  24. package/dist/chunk-RGHQFJOL.cjs.map +1 -0
  25. package/dist/{chunk-UHVNYKV2.js → chunk-S74WZNK7.js} +3 -3
  26. package/dist/{chunk-UHVNYKV2.js.map → chunk-S74WZNK7.js.map} +1 -1
  27. package/dist/chunk-SLSBJRWW.js +41 -0
  28. package/dist/chunk-SLSBJRWW.js.map +1 -0
  29. package/dist/chunk-TO4FAMQP.cjs +37 -0
  30. package/dist/chunk-TO4FAMQP.cjs.map +1 -0
  31. package/dist/{chunk-G2T3KTZ3.js → chunk-UVIOQUJA.js} +4 -4
  32. package/dist/chunk-UVIOQUJA.js.map +1 -0
  33. package/dist/{chunk-EY2RJW27.js → chunk-ZJ6RIPFS.js} +2 -2
  34. package/dist/{chunk-EY2RJW27.js.map → chunk-ZJ6RIPFS.js.map} +1 -1
  35. package/dist/{chunk-23XL6SVZ.cjs → chunk-ZPOLKYR2.cjs} +4 -4
  36. package/dist/{chunk-23XL6SVZ.cjs.map → chunk-ZPOLKYR2.cjs.map} +1 -1
  37. package/dist/collaboration/contacts/ContactCard.d.ts +43 -0
  38. package/dist/collaboration/contacts/index.d.ts +2 -0
  39. package/dist/collaboration/contacts/vcard.d.ts +26 -0
  40. package/dist/collaboration/index.cjs +56 -36
  41. package/dist/collaboration/index.js +1 -1
  42. package/dist/connect/index.cjs +20 -20
  43. package/dist/connect/index.js +3 -3
  44. package/dist/facts/index.cjs +4 -3
  45. package/dist/facts/index.cjs.map +1 -1
  46. package/dist/facts/index.js +2 -1
  47. package/dist/facts/index.js.map +1 -1
  48. package/dist/files/index.cjs +7 -6
  49. package/dist/files/index.cjs.map +1 -1
  50. package/dist/files/index.js +3 -2
  51. package/dist/files/index.js.map +1 -1
  52. package/dist/index.cjs +249 -195
  53. package/dist/index.cjs.map +1 -1
  54. package/dist/index.js +6 -4
  55. package/dist/index.js.map +1 -1
  56. package/dist/lib/use-media-query.d.ts +32 -0
  57. package/dist/shell/Toaster.d.ts +28 -0
  58. package/dist/shell/index.cjs +72 -42
  59. package/dist/shell/index.d.ts +2 -0
  60. package/dist/shell/index.js +3 -1
  61. package/dist/studio/index.cjs +4 -4
  62. package/dist/studio/index.js +2 -2
  63. package/dist/workspaces/index.cjs +10 -3
  64. package/dist/workspaces/index.cjs.map +1 -1
  65. package/dist/workspaces/index.js +11 -4
  66. package/dist/workspaces/index.js.map +1 -1
  67. package/package.json +3 -3
  68. package/dist/chunk-5SLLMK5K.cjs.map +0 -1
  69. package/dist/chunk-7OCFHEE6.js.map +0 -1
  70. package/dist/chunk-G2E3O3HI.js.map +0 -1
  71. package/dist/chunk-G2T3KTZ3.js.map +0 -1
  72. package/dist/chunk-JG4TFS3Z.cjs.map +0 -1
  73. package/dist/chunk-LRUCMZK6.cjs.map +0 -1
  74. package/dist/chunk-MGUHR3JI.cjs.map +0 -1
  75. package/dist/chunk-QXEJXIP4.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunk5SLLMK5K_cjs = require('./chunk-5SLLMK5K.cjs');
4
+ var chunkPRVKJ5XL_cjs = require('./chunk-PRVKJ5XL.cjs');
5
5
  var react$1 = require('react');
6
6
  var react = require('@arbidocs/react');
7
7
  var jsxRuntime = require('react/jsx-runtime');
@@ -223,7 +223,7 @@ function useConnectedChat(options) {
223
223
  }
224
224
  function ConnectedAssistantDock(props) {
225
225
  const chat = useConnectedChat();
226
- return /* @__PURE__ */ jsxRuntime.jsx(chunk5SLLMK5K_cjs.AssistantDock, { ...props, chat });
226
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkPRVKJ5XL_cjs.AssistantDock, { ...props, chat });
227
227
  }
228
228
 
229
229
  Object.defineProperty(exports, "redlineStats", {
@@ -247,5 +247,5 @@ exports.useConnectedChat = useConnectedChat;
247
247
  exports.useConnection = useConnection;
248
248
  exports.useSemanticSearch = useSemanticSearch;
249
249
  exports.useWorkspaceDocs = useWorkspaceDocs;
250
- //# sourceMappingURL=chunk-23XL6SVZ.cjs.map
251
- //# sourceMappingURL=chunk-23XL6SVZ.cjs.map
250
+ //# sourceMappingURL=chunk-ZPOLKYR2.cjs.map
251
+ //# sourceMappingURL=chunk-ZPOLKYR2.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/connection/ConnectionProvider.tsx","../src/connection/ai.tsx"],"names":["createContext","useArbi","useState","useRef","useEffect","useCallback","useMemo","jsx","useContext","useKitAiTask","useKitWorkspaceDocs","useKitSemanticSearch","useArbiChat","AssistantDock"],"mappings":";;;;;;;AAqDA,IAAM,iBAAA,GAAoBA,sBAAsC,IAAI,CAAA;AAQpE,IAAM,wBAAA,GAA2B,wBAAA;AACjC,IAAM,mBAAmB,CAAC,KAAA,KAAkB,KAAA,CAAM,IAAA,GAAO,WAAA,EAAY;AAG9D,IAAM,mBAAA,GAAsB,CAAC,MAAA,EAAgB,OAAA,KAClD,CAAA,EAAG,wBAAwB,CAAA,CAAA,EAAI,MAAA,IAAU,MAAM,CAAA,CAAA,EAAI,gBAAA,CAAiB,OAAO,CAAC,CAAA,CAAA;AAG9E,IAAM,4BAA4B,CAAC,MAAA,KACjC,GAAG,wBAAwB,CAAA,CAAA,EAAI,UAAU,MAAM,CAAA,CAAA;AAEjD,SAAS,sBAAA,CAAuB,QAAgB,OAAA,EAAuC;AACrF,EAAA,IAAI,CAAC,SAAS,OAAO,IAAA;AACrB,EAAA,IAAI;AACF,IAAA,OAAO,OAAO,YAAA,CAAa,OAAA,CAAQ,mBAAA,CAAoB,MAAA,EAAQ,OAAO,CAAC,CAAA;AAAA,EACzE,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,IAAA;AAAA,EACT;AACF;AAEA,SAAS,gBAAA,CAAiB,MAAA,EAAgB,OAAA,EAAwB,EAAA,EAAyB;AACzF,EAAA,IAAI,CAAC,OAAA,EAAS;AACd,EAAA,IAAI;AACF,IAAA,IAAI,EAAA,SAAW,YAAA,CAAa,OAAA,CAAQ,oBAAoB,MAAA,EAAQ,OAAO,GAAG,EAAE,CAAA;AAAA,gBAChE,YAAA,CAAa,UAAA,CAAW,mBAAA,CAAoB,MAAA,EAAQ,OAAO,CAAC,CAAA;AACxE,IAAA,MAAA,CAAO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,QAAA,EAAkB,MAAA,EAAkB,IAAA,KACnC,OAAO,QAAA,EAAU,MAAA,EAAQ,EAAE,GAAG,IAAA,EAAM,KAAA,EAAO,IAAA,EAAM,KAAA,IAAS,iBAAiB,CAAA;AAAA,IAC7E,CAAC,QAAQ,eAAe;AAAA,GAC1B;AACA,EAAA,OAAO,EAAE,GAAG,IAAA,EAAM,GAAA,EAAI;AACxB;AAGO,SAAS,gBAAA,GAAmB;AACjC,EAAA,MAAM,EAAE,WAAA,EAAa,mBAAA,EAAoB,GAAI,aAAA,EAAc;AAC3D,EAAA,OAAOK,sBAAA,CAAoB,eAAe,mBAAmB,CAAA;AAC/D;AAGO,SAAS,iBAAA,GAAoB;AAClC,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,gBAAA,EAAiB;AACpC,EAAA,OAAOC,wBAAqB,MAAM,CAAA;AACpC;AAOO,SAAS,iBAAiB,OAAA,EAA6D;AAC5F,EAAA,MAAM,EAAE,WAAA,EAAa,mBAAA,EAAqB,eAAA,KAAoB,aAAA,EAAc;AAC5E,EAAA,OAAOC,iBAAA,CAAY;AAAA,IACjB,GAAG,OAAA;AAAA,IACH,aAAa,WAAA,IAAe,mBAAA;AAAA,IAC5B,KAAA,EAAO,SAAS,KAAA,IAAS;AAAA,GAC1B,CAAA;AACH;AAMO,SAAS,uBAAuB,KAAA,EAAyC;AAC9E,EAAA,MAAM,OAAO,gBAAA,EAAiB;AAC9B,EAAA,uBAAOL,cAAAA,CAACM,+BAAA,EAAA,EAAe,GAAG,OAAO,IAAA,EAAY,CAAA;AAC/C","file":"chunk-23XL6SVZ.cjs","sourcesContent":["/**\n * The demo/live connection layer for a host app. Holds auth + workspace\n * selection state and exposes it via {@link useConnection}, so every surface\n * works identically whether it's talking to a live ARBI backend or the seeded\n * demo workspace. Host-specific values (backend URL, demo identity, default\n * workspace/assistant ids) arrive once through {@link ArbiConnectionConfig}.\n */\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from 'react'\nimport { useArbi, type LoginProfile } from '@arbidocs/react'\nimport type { ArbiMode, ArbiUser, ConnectionStatus, ArbiConnectionConfig } from './types'\n\ninterface ConnectionValue {\n mode: ArbiMode\n status: ConnectionStatus\n user: ArbiUser | null\n workspaceId: string | null\n apiConfigured: boolean\n apiUrl: string\n error: string | null\n /** Default assistant config ext_id (for the AI hooks). */\n assistantConfig?: string\n /** Fallback workspace ext_id when none is actively selected. */\n fallbackWorkspaceId?: string\n /** Authenticate. Live login when a backend is configured, otherwise the demo workspace. */\n login: (email: string, password: string) => Promise<void>\n /** One-click demo entry (no backend required). */\n enterDemo: () => void\n logout: () => void\n /**\n * Affirmatively select a workspace: opens it on the server (via the SDK),\n * updates the app-wide state, and persists the choice so it survives future\n * logins. This is the single entry point for \"the user is now in workspace X\".\n */\n setWorkspace: (id: string) => Promise<void>\n /**\n * Re-assert the selected workspace on the server session (idempotent `/open`).\n * Call before a workspace-scoped write when the session may have lost its open\n * workspace (token re-login, backend restart, session expiry) — the server\n * resolves the workspace from the session, so a dropped `/open` yields\n * \"No active workspace\" until it's re-opened.\n */\n ensureWorkspaceOpen: () => Promise<void>\n}\n\nconst ConnectionContext = createContext<ConnectionValue | null>(null)\n\n/**\n * Persist the affirmatively-selected workspace per backend AND per signed-in user, so a returning\n * user lands back in the workspace they last chose, while the next person on a shared browser\n * never starts from someone else's workspace id. Namespaced by apiUrl so distinct deployments\n * (and the demo workspace) don't clobber each other. Cleared on logout.\n */\nconst WORKSPACE_STORAGE_PREFIX = 'arbi:selectedWorkspace'\nconst normalizeUserKey = (email: string) => email.trim().toLowerCase()\n\n/** Exported for tests. */\nexport const workspaceStorageKey = (apiUrl: string, userKey: string) =>\n `${WORKSPACE_STORAGE_PREFIX}:${apiUrl || 'demo'}:${normalizeUserKey(userKey)}`\n\n/** The pre-isolation key (apiUrl only). Never read: removed so it cannot leak across users. */\nconst legacyWorkspaceStorageKey = (apiUrl: string) =>\n `${WORKSPACE_STORAGE_PREFIX}:${apiUrl || 'demo'}`\n\nfunction readPersistedWorkspace(apiUrl: string, userKey: string | null): string | null {\n if (!userKey) return null\n try {\n return window.localStorage.getItem(workspaceStorageKey(apiUrl, userKey))\n } catch {\n return null\n }\n}\n\nfunction persistWorkspace(apiUrl: string, userKey: string | null, id: string | null): void {\n if (!userKey) return\n try {\n if (id) window.localStorage.setItem(workspaceStorageKey(apiUrl, userKey), id)\n else window.localStorage.removeItem(workspaceStorageKey(apiUrl, userKey))\n window.localStorage.removeItem(legacyWorkspaceStorageKey(apiUrl))\n } catch {\n // Storage unavailable (private mode, SSR) — selection stays in-memory only.\n }\n}\n\n/** Shown on the sign-in screen after the session could not be recovered. */\nexport const SESSION_EXPIRED_MESSAGE = 'Your session expired. Sign in again.'\n\n/** The connection user for a profile: its full name, falling back to the email local part. */\nfunction userFromProfile(profile: LoginProfile, externalId?: string): ArbiUser {\n const fullName = [profile.givenName, profile.familyName]\n .map((part) => part?.trim())\n .filter(Boolean)\n .join(' ')\n return {\n name: fullName || profile.email.split('@')[0],\n email: profile.email,\n externalId,\n picture: profile.picture,\n }\n}\n\nexport function ConnectionProvider({\n config,\n children,\n}: {\n config: ArbiConnectionConfig\n children: ReactNode\n}) {\n const arbi = useArbi()\n const isLiveConfigured = config.apiUrl.length > 0\n const demoWorkspaceId = config.demoWorkspaceId ?? 'demo-workspace'\n\n const [status, setStatus] = useState<ConnectionStatus>('disconnected')\n const [user, setUser] = useState<ArbiUser | null>(null)\n const [workspaceId, setWorkspaceId] = useState<string | null>(null)\n const [mode, setMode] = useState<ArbiMode>('demo')\n const [error, setError] = useState<string | null>(null)\n // Who the persisted workspace belongs to; set at sign-in, cleared at logout.\n const storageUserRef = useRef<string | null>(null)\n\n // The SDK could not recover the session (token refused, workspace not re-openable): drop to\n // 'disconnected' with a plain message, so the host's gate sends the user to sign in instead of\n // every call failing with a raw backend error. The remembered workspace is kept for next login.\n useEffect(\n () =>\n arbi.onSessionExpired?.(() => {\n storageUserRef.current = null\n setUser(null)\n setWorkspaceId(null)\n setStatus('disconnected')\n setError(SESSION_EXPIRED_MESSAGE)\n }),\n [arbi]\n )\n\n // A saved name, picture or email reaches every surface reading `useConnection().user`.\n useEffect(\n () =>\n arbi.user.onProfileChange?.((profile) =>\n setUser((current) => (current ? userFromProfile(profile, current.externalId) : current))\n ),\n [arbi]\n )\n\n const enterDemo = useCallback(() => {\n setMode('demo')\n setStatus('demo')\n setError(null)\n setUser({ name: config.demoUser.name, email: config.demoUser.email })\n setWorkspaceId(demoWorkspaceId)\n }, [config.demoUser.name, config.demoUser.email, demoWorkspaceId])\n\n const login = useCallback(\n async (email: string, password: string) => {\n setError(null)\n // No backend configured → run the seeded demo workspace.\n if (!isLiveConfigured) {\n enterDemo()\n return\n }\n setStatus('connecting')\n setMode('live')\n try {\n await arbi.login(email, password)\n storageUserRef.current = normalizeUserKey(email)\n const workspaces = await arbi.workspaces.list()\n if (workspaces?.length) {\n // Prefer the workspace the user last affirmatively selected (persisted),\n // then the configured workspace (there may be several — e.g. a\n // marketing/KM workspace), then whichever happens to be first. Ternary\n // (not `&&`) so an empty value can't leak `\"\"` into `target`.\n const persisted = readPersistedWorkspace(config.apiUrl, storageUserRef.current)\n const preferred = persisted ?? config.workspaceId\n const target =\n (preferred ? workspaces.find((w) => w.external_id === preferred) : undefined) ??\n workspaces[0]\n await arbi.selectWorkspace(target.external_id)\n setWorkspaceId(target.external_id)\n persistWorkspace(config.apiUrl, storageUserRef.current, target.external_id)\n }\n // The profile (name + avatar) comes with the login response. A session restored without\n // a login has none, so fall back to finding ourselves in the workspace roster; the email\n // local part is only the last resort, never the answer when a profile name exists.\n let resolved: ArbiUser = { name: email.split('@')[0], email }\n const me = arbi.user.identity()\n const profile = arbi.user.profile?.()\n if (profile) {\n resolved = userFromProfile(profile, me?.externalId)\n } else {\n try {\n const members = await arbi.workspaces.listUsers()\n const self = members.find((m) => m.user.external_id === me?.externalId)?.user\n if (self) {\n const fullName = [self.given_name, self.family_name].filter(Boolean).join(' ').trim()\n resolved = {\n name: fullName || email.split('@')[0],\n email: self.email || email,\n externalId: self.external_id,\n picture: self.picture ?? null,\n }\n } else if (me?.externalId) {\n resolved.externalId = me.externalId\n }\n } catch {\n // Roster not available (e.g. no workspace) — keep the fallback identity.\n }\n }\n setUser(resolved)\n setStatus('authenticated')\n } catch (e) {\n // Surface the real error — no silent fallback to a fake session.\n setError(e instanceof Error ? e.message : 'Sign-in failed. Check your credentials.')\n setStatus('error')\n }\n },\n [arbi, enterDemo, isLiveConfigured, config.workspaceId, config.apiUrl]\n )\n\n const logout = useCallback(() => {\n if (mode === 'live') {\n void arbi.logout?.()\n }\n setUser(null)\n setWorkspaceId(null)\n persistWorkspace(config.apiUrl, storageUserRef.current, null)\n storageUserRef.current = null\n setStatus('disconnected')\n setError(null)\n }, [arbi, mode, config.apiUrl])\n\n // Affirmative selection: open the workspace on the server (live), then remember\n // it in state + storage so every surface — and the next login — is in sync.\n const setWorkspace = useCallback(\n async (id: string) => {\n if (mode === 'live' && arbi.isLoggedIn) {\n await arbi.selectWorkspace(id)\n }\n setWorkspaceId(id)\n persistWorkspace(config.apiUrl, storageUserRef.current, id)\n },\n [arbi, mode, config.apiUrl]\n )\n\n // Re-open the selected workspace on the session if the server may have dropped\n // it. Idempotent: re-running `/open` for the already-selected workspace is safe.\n const ensureWorkspaceOpen = useCallback(async () => {\n if (mode !== 'live' || !arbi.isLoggedIn) return\n const id =\n workspaceId ??\n readPersistedWorkspace(config.apiUrl, storageUserRef.current) ??\n config.workspaceId\n if (id) await arbi.selectWorkspace(id)\n }, [arbi, mode, workspaceId, config.apiUrl, config.workspaceId])\n\n const value = useMemo<ConnectionValue>(\n () => ({\n mode,\n status,\n user,\n workspaceId,\n apiConfigured: isLiveConfigured,\n apiUrl: config.apiUrl,\n error,\n assistantConfig: config.assistantConfig,\n fallbackWorkspaceId: config.workspaceId,\n login,\n enterDemo,\n logout,\n setWorkspace,\n ensureWorkspaceOpen,\n }),\n [\n mode,\n status,\n user,\n workspaceId,\n isLiveConfigured,\n config.apiUrl,\n config.assistantConfig,\n config.workspaceId,\n error,\n login,\n enterDemo,\n logout,\n setWorkspace,\n ensureWorkspaceOpen,\n ]\n )\n\n return <ConnectionContext.Provider value={value}>{children}</ConnectionContext.Provider>\n}\n\nexport function useConnection(): ConnectionValue {\n const ctx = useContext(ConnectionContext)\n if (!ctx) throw new Error('useConnection must be used within ConnectionProvider')\n return ctx\n}\n\nexport const isAuthenticated = (s: ConnectionStatus) => s === 'demo' || s === 'authenticated'\n","/**\n * The connected agent hooks — thin adapters over the reusable AI kit in\n * `@arbidocs/react`. The streaming/accumulation/search plumbing lives once in\n * the SDK; these hooks only bind the *workspace source* (from the connection\n * context, falling back to the configured workspace) and inject the host's\n * default assistant *configuration* so call sites needn't know the config\n * ext_id. An explicit `opts.model` still wins.\n */\nimport { useCallback } from 'react'\nimport {\n useAiTask as useKitAiTask,\n useWorkspaceDocs as useKitWorkspaceDocs,\n useSemanticSearch as useKitSemanticSearch,\n useArbiChat,\n type ArbiChat,\n type UseArbiChatOptions,\n type AiRunOptions,\n} from '@arbidocs/react'\nimport { useConnection } from './ConnectionProvider'\nimport { AssistantDock, type AssistantDockProps } from '../chat/AssistantDock'\n\nexport type { AiTaskStatus, AiRunOptions, SearchChunk, ArtifactEvent } from '@arbidocs/react'\n\n/** Client-side redlining, re-exported so a host app has one import surface. */\nexport { toRedlineMarkdown, redlineStats, textToArtifact } from '@arbidocs/react'\n\n/**\n * The kit's `useAiTask` with the host's default assistant configuration\n * injected, so call sites needn't know the config ext_id.\n */\nexport function useConnectedAiTask() {\n const { assistantConfig } = useConnection()\n const task = useKitAiTask()\n const kitRun = task.run\n const run = useCallback(\n (question: string, docIds: string[], opts?: AiRunOptions) =>\n kitRun(question, docIds, { ...opts, model: opts?.model ?? assistantConfig }),\n [kitRun, assistantConfig]\n )\n return { ...task, run }\n}\n\n/** Resolve the active workspace + its document ids (what we ground the agent on). */\nexport function useWorkspaceDocs() {\n const { workspaceId, fallbackWorkspaceId } = useConnection()\n return useKitWorkspaceDocs(workspaceId ?? fallbackWorkspaceId)\n}\n\n/** Search the active workspace's documents and return the top matching passages. */\nexport function useSemanticSearch() {\n const { docIds } = useWorkspaceDocs()\n return useKitSemanticSearch(docIds)\n}\n\n/**\n * The chat controller for `ChatPage` bound to the connection: the active workspace and the host's\n * default assistant configuration are injected, so a host writes\n * `<ChatPage chat={useConnectedChat()} />`.\n */\nexport function useConnectedChat(options?: Omit<UseArbiChatOptions, 'workspaceId'>): ArbiChat {\n const { workspaceId, fallbackWorkspaceId, assistantConfig } = useConnection()\n return useArbiChat({\n ...options,\n workspaceId: workspaceId ?? fallbackWorkspaceId,\n model: options?.model ?? assistantConfig,\n })\n}\n\n/**\n * The assistant dock bound to the connection: mount it once in the layout (`Shell.Root`'s `aside`)\n * and put `AssistantDockToggle` in the topbar. Chat state lives here, so it survives closing the dock.\n */\nexport function ConnectedAssistantDock(props: Omit<AssistantDockProps, 'chat'>) {\n const chat = useConnectedChat()\n return <AssistantDock {...props} chat={chat} />\n}\n"]}
1
+ {"version":3,"sources":["../src/connection/ConnectionProvider.tsx","../src/connection/ai.tsx"],"names":["createContext","useArbi","useState","useRef","useEffect","useCallback","useMemo","jsx","useContext","useKitAiTask","useKitWorkspaceDocs","useKitSemanticSearch","useArbiChat","AssistantDock"],"mappings":";;;;;;;AAqDA,IAAM,iBAAA,GAAoBA,sBAAsC,IAAI,CAAA;AAQpE,IAAM,wBAAA,GAA2B,wBAAA;AACjC,IAAM,mBAAmB,CAAC,KAAA,KAAkB,KAAA,CAAM,IAAA,GAAO,WAAA,EAAY;AAG9D,IAAM,mBAAA,GAAsB,CAAC,MAAA,EAAgB,OAAA,KAClD,CAAA,EAAG,wBAAwB,CAAA,CAAA,EAAI,MAAA,IAAU,MAAM,CAAA,CAAA,EAAI,gBAAA,CAAiB,OAAO,CAAC,CAAA,CAAA;AAG9E,IAAM,4BAA4B,CAAC,MAAA,KACjC,GAAG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MAAM,EAAE,WAAA,EAAa,mBAAA,EAAqB,eAAA,KAAoB,aAAA,EAAc;AAC5E,EAAA,OAAOC,iBAAA,CAAY;AAAA,IACjB,GAAG,OAAA;AAAA,IACH,aAAa,WAAA,IAAe,mBAAA;AAAA,IAC5B,KAAA,EAAO,SAAS,KAAA,IAAS;AAAA,GAC1B,CAAA;AACH;AAMO,SAAS,uBAAuB,KAAA,EAAyC;AAC9E,EAAA,MAAM,OAAO,gBAAA,EAAiB;AAC9B,EAAA,uBAAOL,cAAAA,CAACM,+BAAA,EAAA,EAAe,GAAG,OAAO,IAAA,EAAY,CAAA;AAC/C","file":"chunk-ZPOLKYR2.cjs","sourcesContent":["/**\n * The demo/live connection layer for a host app. Holds auth + workspace\n * selection state and exposes it via {@link useConnection}, so every surface\n * works identically whether it's talking to a live ARBI backend or the seeded\n * demo workspace. Host-specific values (backend URL, demo identity, default\n * workspace/assistant ids) arrive once through {@link ArbiConnectionConfig}.\n */\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from 'react'\nimport { useArbi, type LoginProfile } from '@arbidocs/react'\nimport type { ArbiMode, ArbiUser, ConnectionStatus, ArbiConnectionConfig } from './types'\n\ninterface ConnectionValue {\n mode: ArbiMode\n status: ConnectionStatus\n user: ArbiUser | null\n workspaceId: string | null\n apiConfigured: boolean\n apiUrl: string\n error: string | null\n /** Default assistant config ext_id (for the AI hooks). */\n assistantConfig?: string\n /** Fallback workspace ext_id when none is actively selected. */\n fallbackWorkspaceId?: string\n /** Authenticate. Live login when a backend is configured, otherwise the demo workspace. */\n login: (email: string, password: string) => Promise<void>\n /** One-click demo entry (no backend required). */\n enterDemo: () => void\n logout: () => void\n /**\n * Affirmatively select a workspace: opens it on the server (via the SDK),\n * updates the app-wide state, and persists the choice so it survives future\n * logins. This is the single entry point for \"the user is now in workspace X\".\n */\n setWorkspace: (id: string) => Promise<void>\n /**\n * Re-assert the selected workspace on the server session (idempotent `/open`).\n * Call before a workspace-scoped write when the session may have lost its open\n * workspace (token re-login, backend restart, session expiry) — the server\n * resolves the workspace from the session, so a dropped `/open` yields\n * \"No active workspace\" until it's re-opened.\n */\n ensureWorkspaceOpen: () => Promise<void>\n}\n\nconst ConnectionContext = createContext<ConnectionValue | null>(null)\n\n/**\n * Persist the affirmatively-selected workspace per backend AND per signed-in user, so a returning\n * user lands back in the workspace they last chose, while the next person on a shared browser\n * never starts from someone else's workspace id. Namespaced by apiUrl so distinct deployments\n * (and the demo workspace) don't clobber each other. Cleared on logout.\n */\nconst WORKSPACE_STORAGE_PREFIX = 'arbi:selectedWorkspace'\nconst normalizeUserKey = (email: string) => email.trim().toLowerCase()\n\n/** Exported for tests. */\nexport const workspaceStorageKey = (apiUrl: string, userKey: string) =>\n `${WORKSPACE_STORAGE_PREFIX}:${apiUrl || 'demo'}:${normalizeUserKey(userKey)}`\n\n/** The pre-isolation key (apiUrl only). Never read: removed so it cannot leak across users. */\nconst legacyWorkspaceStorageKey = (apiUrl: string) =>\n `${WORKSPACE_STORAGE_PREFIX}:${apiUrl || 'demo'}`\n\nfunction readPersistedWorkspace(apiUrl: string, userKey: string | null): string | null {\n if (!userKey) return null\n try {\n return window.localStorage.getItem(workspaceStorageKey(apiUrl, userKey))\n } catch {\n return null\n }\n}\n\nfunction persistWorkspace(apiUrl: string, userKey: string | null, id: string | null): void {\n if (!userKey) return\n try {\n if (id) window.localStorage.setItem(workspaceStorageKey(apiUrl, userKey), id)\n else window.localStorage.removeItem(workspaceStorageKey(apiUrl, userKey))\n window.localStorage.removeItem(legacyWorkspaceStorageKey(apiUrl))\n } catch {\n // Storage unavailable (private mode, SSR) — selection stays in-memory only.\n }\n}\n\n/** Shown on the sign-in screen after the session could not be recovered. */\nexport const SESSION_EXPIRED_MESSAGE = 'Your session expired. Sign in again.'\n\n/** The connection user for a profile: its full name, falling back to the email local part. */\nfunction userFromProfile(profile: LoginProfile, externalId?: string): ArbiUser {\n const fullName = [profile.givenName, profile.familyName]\n .map((part) => part?.trim())\n .filter(Boolean)\n .join(' ')\n return {\n name: fullName || profile.email.split('@')[0],\n email: profile.email,\n externalId,\n picture: profile.picture,\n }\n}\n\nexport function ConnectionProvider({\n config,\n children,\n}: {\n config: ArbiConnectionConfig\n children: ReactNode\n}) {\n const arbi = useArbi()\n const isLiveConfigured = config.apiUrl.length > 0\n const demoWorkspaceId = config.demoWorkspaceId ?? 'demo-workspace'\n\n const [status, setStatus] = useState<ConnectionStatus>('disconnected')\n const [user, setUser] = useState<ArbiUser | null>(null)\n const [workspaceId, setWorkspaceId] = useState<string | null>(null)\n const [mode, setMode] = useState<ArbiMode>('demo')\n const [error, setError] = useState<string | null>(null)\n // Who the persisted workspace belongs to; set at sign-in, cleared at logout.\n const storageUserRef = useRef<string | null>(null)\n\n // The SDK could not recover the session (token refused, workspace not re-openable): drop to\n // 'disconnected' with a plain message, so the host's gate sends the user to sign in instead of\n // every call failing with a raw backend error. The remembered workspace is kept for next login.\n useEffect(\n () =>\n arbi.onSessionExpired?.(() => {\n storageUserRef.current = null\n setUser(null)\n setWorkspaceId(null)\n setStatus('disconnected')\n setError(SESSION_EXPIRED_MESSAGE)\n }),\n [arbi]\n )\n\n // A saved name, picture or email reaches every surface reading `useConnection().user`.\n useEffect(\n () =>\n arbi.user.onProfileChange?.((profile) =>\n setUser((current) => (current ? userFromProfile(profile, current.externalId) : current))\n ),\n [arbi]\n )\n\n const enterDemo = useCallback(() => {\n setMode('demo')\n setStatus('demo')\n setError(null)\n setUser({ name: config.demoUser.name, email: config.demoUser.email })\n setWorkspaceId(demoWorkspaceId)\n }, [config.demoUser.name, config.demoUser.email, demoWorkspaceId])\n\n const login = useCallback(\n async (email: string, password: string) => {\n setError(null)\n // No backend configured → run the seeded demo workspace.\n if (!isLiveConfigured) {\n enterDemo()\n return\n }\n setStatus('connecting')\n setMode('live')\n try {\n await arbi.login(email, password)\n storageUserRef.current = normalizeUserKey(email)\n const workspaces = await arbi.workspaces.list()\n if (workspaces?.length) {\n // Prefer the workspace the user last affirmatively selected (persisted),\n // then the configured workspace (there may be several — e.g. a\n // marketing/KM workspace), then whichever happens to be first. Ternary\n // (not `&&`) so an empty value can't leak `\"\"` into `target`.\n const persisted = readPersistedWorkspace(config.apiUrl, storageUserRef.current)\n const preferred = persisted ?? config.workspaceId\n const target =\n (preferred ? workspaces.find((w) => w.external_id === preferred) : undefined) ??\n workspaces[0]\n await arbi.selectWorkspace(target.external_id)\n setWorkspaceId(target.external_id)\n persistWorkspace(config.apiUrl, storageUserRef.current, target.external_id)\n }\n // The profile (name + avatar) comes with the login response. A session restored without\n // a login has none, so fall back to finding ourselves in the workspace roster; the email\n // local part is only the last resort, never the answer when a profile name exists.\n let resolved: ArbiUser = { name: email.split('@')[0], email }\n const me = arbi.user.identity()\n const profile = arbi.user.profile?.()\n if (profile) {\n resolved = userFromProfile(profile, me?.externalId)\n } else {\n try {\n const members = await arbi.workspaces.listUsers()\n const self = members.find((m) => m.user.external_id === me?.externalId)?.user\n if (self) {\n const fullName = [self.given_name, self.family_name].filter(Boolean).join(' ').trim()\n resolved = {\n name: fullName || email.split('@')[0],\n email: self.email || email,\n externalId: self.external_id,\n picture: self.picture ?? null,\n }\n } else if (me?.externalId) {\n resolved.externalId = me.externalId\n }\n } catch {\n // Roster not available (e.g. no workspace) — keep the fallback identity.\n }\n }\n setUser(resolved)\n setStatus('authenticated')\n } catch (e) {\n // Surface the real error — no silent fallback to a fake session.\n setError(e instanceof Error ? e.message : 'Sign-in failed. Check your credentials.')\n setStatus('error')\n }\n },\n [arbi, enterDemo, isLiveConfigured, config.workspaceId, config.apiUrl]\n )\n\n const logout = useCallback(() => {\n if (mode === 'live') {\n void arbi.logout?.()\n }\n setUser(null)\n setWorkspaceId(null)\n persistWorkspace(config.apiUrl, storageUserRef.current, null)\n storageUserRef.current = null\n setStatus('disconnected')\n setError(null)\n }, [arbi, mode, config.apiUrl])\n\n // Affirmative selection: open the workspace on the server (live), then remember\n // it in state + storage so every surface — and the next login — is in sync.\n const setWorkspace = useCallback(\n async (id: string) => {\n if (mode === 'live' && arbi.isLoggedIn) {\n await arbi.selectWorkspace(id)\n }\n setWorkspaceId(id)\n persistWorkspace(config.apiUrl, storageUserRef.current, id)\n },\n [arbi, mode, config.apiUrl]\n )\n\n // Re-open the selected workspace on the session if the server may have dropped\n // it. Idempotent: re-running `/open` for the already-selected workspace is safe.\n const ensureWorkspaceOpen = useCallback(async () => {\n if (mode !== 'live' || !arbi.isLoggedIn) return\n const id =\n workspaceId ??\n readPersistedWorkspace(config.apiUrl, storageUserRef.current) ??\n config.workspaceId\n if (id) await arbi.selectWorkspace(id)\n }, [arbi, mode, workspaceId, config.apiUrl, config.workspaceId])\n\n const value = useMemo<ConnectionValue>(\n () => ({\n mode,\n status,\n user,\n workspaceId,\n apiConfigured: isLiveConfigured,\n apiUrl: config.apiUrl,\n error,\n assistantConfig: config.assistantConfig,\n fallbackWorkspaceId: config.workspaceId,\n login,\n enterDemo,\n logout,\n setWorkspace,\n ensureWorkspaceOpen,\n }),\n [\n mode,\n status,\n user,\n workspaceId,\n isLiveConfigured,\n config.apiUrl,\n config.assistantConfig,\n config.workspaceId,\n error,\n login,\n enterDemo,\n logout,\n setWorkspace,\n ensureWorkspaceOpen,\n ]\n )\n\n return <ConnectionContext.Provider value={value}>{children}</ConnectionContext.Provider>\n}\n\nexport function useConnection(): ConnectionValue {\n const ctx = useContext(ConnectionContext)\n if (!ctx) throw new Error('useConnection must be used within ConnectionProvider')\n return ctx\n}\n\nexport const isAuthenticated = (s: ConnectionStatus) => s === 'demo' || s === 'authenticated'\n","/**\n * The connected agent hooks — thin adapters over the reusable AI kit in\n * `@arbidocs/react`. The streaming/accumulation/search plumbing lives once in\n * the SDK; these hooks only bind the *workspace source* (from the connection\n * context, falling back to the configured workspace) and inject the host's\n * default assistant *configuration* so call sites needn't know the config\n * ext_id. An explicit `opts.model` still wins.\n */\nimport { useCallback } from 'react'\nimport {\n useAiTask as useKitAiTask,\n useWorkspaceDocs as useKitWorkspaceDocs,\n useSemanticSearch as useKitSemanticSearch,\n useArbiChat,\n type ArbiChat,\n type UseArbiChatOptions,\n type AiRunOptions,\n} from '@arbidocs/react'\nimport { useConnection } from './ConnectionProvider'\nimport { AssistantDock, type AssistantDockProps } from '../chat/AssistantDock'\n\nexport type { AiTaskStatus, AiRunOptions, SearchChunk, ArtifactEvent } from '@arbidocs/react'\n\n/** Client-side redlining, re-exported so a host app has one import surface. */\nexport { toRedlineMarkdown, redlineStats, textToArtifact } from '@arbidocs/react'\n\n/**\n * The kit's `useAiTask` with the host's default assistant configuration\n * injected, so call sites needn't know the config ext_id.\n */\nexport function useConnectedAiTask() {\n const { assistantConfig } = useConnection()\n const task = useKitAiTask()\n const kitRun = task.run\n const run = useCallback(\n (question: string, docIds: string[], opts?: AiRunOptions) =>\n kitRun(question, docIds, { ...opts, model: opts?.model ?? assistantConfig }),\n [kitRun, assistantConfig]\n )\n return { ...task, run }\n}\n\n/** Resolve the active workspace + its document ids (what we ground the agent on). */\nexport function useWorkspaceDocs() {\n const { workspaceId, fallbackWorkspaceId } = useConnection()\n return useKitWorkspaceDocs(workspaceId ?? fallbackWorkspaceId)\n}\n\n/** Search the active workspace's documents and return the top matching passages. */\nexport function useSemanticSearch() {\n const { docIds } = useWorkspaceDocs()\n return useKitSemanticSearch(docIds)\n}\n\n/**\n * The chat controller for `ChatPage` bound to the connection: the active workspace and the host's\n * default assistant configuration are injected, so a host writes\n * `<ChatPage chat={useConnectedChat()} />`.\n */\nexport function useConnectedChat(options?: Omit<UseArbiChatOptions, 'workspaceId'>): ArbiChat {\n const { workspaceId, fallbackWorkspaceId, assistantConfig } = useConnection()\n return useArbiChat({\n ...options,\n workspaceId: workspaceId ?? fallbackWorkspaceId,\n model: options?.model ?? assistantConfig,\n })\n}\n\n/**\n * The assistant dock bound to the connection: mount it once in the layout (`Shell.Root`'s `aside`)\n * and put `AssistantDockToggle` in the topbar. Chat state lives here, so it survives closing the dock.\n */\nexport function ConnectedAssistantDock(props: Omit<AssistantDockProps, 'chat'>) {\n const chat = useConnectedChat()\n return <AssistantDock {...props} chat={chat} />\n}\n"]}
@@ -0,0 +1,43 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type VCardContact } from './vcard';
3
+ /** Every fixed string of the contact card. */
4
+ export interface ContactCardLabels {
5
+ /** Accessible name of the menu button. */
6
+ actions: string;
7
+ /** The export menu item. */
8
+ exportVCard: string;
9
+ }
10
+ export declare const DEFAULT_CONTACT_CARD_LABELS: ContactCardLabels;
11
+ /** An extra menu entry a host adds next to the built-in export. */
12
+ export interface ContactCardAction {
13
+ id: string;
14
+ label: string;
15
+ icon?: ReactNode;
16
+ onSelect: () => void;
17
+ destructive?: boolean;
18
+ }
19
+ export interface ContactCardProps {
20
+ contact: VCardContact & {
21
+ avatarUrl?: string;
22
+ };
23
+ /** A badge or status text under the name ("Invitation pending"). */
24
+ status?: ReactNode;
25
+ /**
26
+ * Called when "Save to address book" is chosen. Omit it to use the built-in
27
+ * {@link downloadVCard}; pass your own to log, or to hand the card to a native share sheet.
28
+ */
29
+ onExportVCard?: (contact: VCardContact) => void;
30
+ /** Hide the export item entirely (a contact with no usable details). Default true. */
31
+ exportable?: boolean;
32
+ /** More menu entries, listed after the export. */
33
+ actions?: ContactCardAction[];
34
+ labels?: Partial<ContactCardLabels>;
35
+ className?: string;
36
+ 'data-testid'?: string;
37
+ }
38
+ /**
39
+ * A contact as a card: avatar, name, role, email and phone, and a menu that exports the contact
40
+ * as a vCard. The export is built in ({@link downloadVCard}); `onExportVCard` replaces it, and
41
+ * `actions` adds host entries. Presentational: no SDK, store or router.
42
+ */
43
+ export declare function ContactCard({ contact, status, onExportVCard, exportable, actions, labels, className, 'data-testid': testId, }: ContactCardProps): import("react").JSX.Element;
@@ -1,2 +1,4 @@
1
1
  export { AddContactsForm, AddContactsResults, DEFAULT_ADD_CONTACTS_LABELS, type AddContactsFormProps, type AddContactsResultsProps, type AddContactsResultRow, type AddContactsLabels, } from './AddContactsParts';
2
2
  export { parseEmails, toAddContactsRow, toAddContactsRows, MAX_INVITE_EMAILS, DEFAULT_CONTACT_OUTCOME_LABELS, type ContactOutcomeLabels, } from './parseEmails';
3
+ export { ContactCard, DEFAULT_CONTACT_CARD_LABELS, type ContactCardProps, type ContactCardAction, type ContactCardLabels, } from './ContactCard';
4
+ export { contactToVCard, downloadVCard, vCardFilename, type VCardContact } from './vcard';
@@ -0,0 +1,26 @@
1
+ /**
2
+ * vCard (.vcf) generation for a contact: a real, importable card. No dependencies: it assembles
3
+ * vCard 3.0 text (RFC 2426, understood by every address book) and triggers a Blob download.
4
+ */
5
+ /** What a card can carry. Only `name` is required; empty fields are left out. */
6
+ export interface VCardContact {
7
+ /** Full display name ("Ada Lovelace"). */
8
+ name: string;
9
+ email?: string;
10
+ phone?: string;
11
+ /** Company or organisation. */
12
+ organisation?: string;
13
+ /** Job title or role. */
14
+ title?: string;
15
+ /** One-line postal address. */
16
+ address?: string;
17
+ /** A web page or profile link. */
18
+ url?: string;
19
+ note?: string;
20
+ }
21
+ /** The vCard 3.0 text for a contact, CRLF separated. */
22
+ export declare function contactToVCard(contact: VCardContact): string;
23
+ /** A safe file name for a contact: "ada-lovelace.vcf" ("contact.vcf" when nothing usable is left). */
24
+ export declare function vCardFilename(contact: Pick<VCardContact, 'name'>): string;
25
+ /** Save the contact as a .vcf file through a temporary link click. Browser only. */
26
+ export declare function downloadVCard(contact: VCardContact): void;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkJG4TFS3Z_cjs = require('../chunk-JG4TFS3Z.cjs');
4
+ var chunkRGHQFJOL_cjs = require('../chunk-RGHQFJOL.cjs');
5
5
  require('../chunk-7G2LJMUG.cjs');
6
6
  var chunkVLCY46K6_cjs = require('../chunk-VLCY46K6.cjs');
7
7
  require('../chunk-2ZTONLT5.cjs');
@@ -12,143 +12,163 @@ require('../chunk-MHVNT4J3.cjs');
12
12
 
13
13
  Object.defineProperty(exports, "ActionMenu", {
14
14
  enumerable: true,
15
- get: function () { return chunkJG4TFS3Z_cjs.ActionMenu; }
15
+ get: function () { return chunkRGHQFJOL_cjs.ActionMenu; }
16
16
  });
17
17
  Object.defineProperty(exports, "AddContactsForm", {
18
18
  enumerable: true,
19
- get: function () { return chunkJG4TFS3Z_cjs.AddContactsForm; }
19
+ get: function () { return chunkRGHQFJOL_cjs.AddContactsForm; }
20
20
  });
21
21
  Object.defineProperty(exports, "AddContactsResults", {
22
22
  enumerable: true,
23
- get: function () { return chunkJG4TFS3Z_cjs.AddContactsResults; }
23
+ get: function () { return chunkRGHQFJOL_cjs.AddContactsResults; }
24
+ });
25
+ Object.defineProperty(exports, "ContactCard", {
26
+ enumerable: true,
27
+ get: function () { return chunkRGHQFJOL_cjs.ContactCard; }
24
28
  });
25
29
  Object.defineProperty(exports, "DEFAULT_ADD_CONTACTS_LABELS", {
26
30
  enumerable: true,
27
- get: function () { return chunkJG4TFS3Z_cjs.DEFAULT_ADD_CONTACTS_LABELS; }
31
+ get: function () { return chunkRGHQFJOL_cjs.DEFAULT_ADD_CONTACTS_LABELS; }
32
+ });
33
+ Object.defineProperty(exports, "DEFAULT_CONTACT_CARD_LABELS", {
34
+ enumerable: true,
35
+ get: function () { return chunkRGHQFJOL_cjs.DEFAULT_CONTACT_CARD_LABELS; }
28
36
  });
29
37
  Object.defineProperty(exports, "DEFAULT_CONTACT_OUTCOME_LABELS", {
30
38
  enumerable: true,
31
- get: function () { return chunkJG4TFS3Z_cjs.DEFAULT_CONTACT_OUTCOME_LABELS; }
39
+ get: function () { return chunkRGHQFJOL_cjs.DEFAULT_CONTACT_OUTCOME_LABELS; }
32
40
  });
33
41
  Object.defineProperty(exports, "DEFAULT_DM_ACCESS_REQUEST_BANNER_LABELS", {
34
42
  enumerable: true,
35
- get: function () { return chunkJG4TFS3Z_cjs.DEFAULT_DM_ACCESS_REQUEST_BANNER_LABELS; }
43
+ get: function () { return chunkRGHQFJOL_cjs.DEFAULT_DM_ACCESS_REQUEST_BANNER_LABELS; }
36
44
  });
37
45
  Object.defineProperty(exports, "DEFAULT_DM_GRANT_ACCESS_DIALOG_LABELS", {
38
46
  enumerable: true,
39
- get: function () { return chunkJG4TFS3Z_cjs.DEFAULT_DM_GRANT_ACCESS_DIALOG_LABELS; }
47
+ get: function () { return chunkRGHQFJOL_cjs.DEFAULT_DM_GRANT_ACCESS_DIALOG_LABELS; }
40
48
  });
41
49
  Object.defineProperty(exports, "DEFAULT_DM_INVITE_CHIP_LABELS", {
42
50
  enumerable: true,
43
- get: function () { return chunkJG4TFS3Z_cjs.DEFAULT_DM_INVITE_CHIP_LABELS; }
51
+ get: function () { return chunkRGHQFJOL_cjs.DEFAULT_DM_INVITE_CHIP_LABELS; }
44
52
  });
45
53
  Object.defineProperty(exports, "DEFAULT_DM_THREAD_FRAME_LABELS", {
46
54
  enumerable: true,
47
- get: function () { return chunkJG4TFS3Z_cjs.DEFAULT_DM_THREAD_FRAME_LABELS; }
55
+ get: function () { return chunkRGHQFJOL_cjs.DEFAULT_DM_THREAD_FRAME_LABELS; }
48
56
  });
49
57
  Object.defineProperty(exports, "DEFAULT_MAIL_FOLDER_TREE_LABELS", {
50
58
  enumerable: true,
51
- get: function () { return chunkJG4TFS3Z_cjs.DEFAULT_MAIL_FOLDER_TREE_LABELS; }
59
+ get: function () { return chunkRGHQFJOL_cjs.DEFAULT_MAIL_FOLDER_TREE_LABELS; }
52
60
  });
53
61
  Object.defineProperty(exports, "DEFAULT_RECIPIENT_PICKER_LABELS", {
54
62
  enumerable: true,
55
- get: function () { return chunkJG4TFS3Z_cjs.DEFAULT_RECIPIENT_PICKER_LABELS; }
63
+ get: function () { return chunkRGHQFJOL_cjs.DEFAULT_RECIPIENT_PICKER_LABELS; }
56
64
  });
57
65
  Object.defineProperty(exports, "DmAccessRequestBanner", {
58
66
  enumerable: true,
59
- get: function () { return chunkJG4TFS3Z_cjs.DmAccessRequestBanner; }
67
+ get: function () { return chunkRGHQFJOL_cjs.DmAccessRequestBanner; }
60
68
  });
61
69
  Object.defineProperty(exports, "DmGrantAccessDialogView", {
62
70
  enumerable: true,
63
- get: function () { return chunkJG4TFS3Z_cjs.DmGrantAccessDialogView; }
71
+ get: function () { return chunkRGHQFJOL_cjs.DmGrantAccessDialogView; }
64
72
  });
65
73
  Object.defineProperty(exports, "DmInviteAvatar", {
66
74
  enumerable: true,
67
- get: function () { return chunkJG4TFS3Z_cjs.DmInviteAvatar; }
75
+ get: function () { return chunkRGHQFJOL_cjs.DmInviteAvatar; }
68
76
  });
69
77
  Object.defineProperty(exports, "DmInviteChip", {
70
78
  enumerable: true,
71
- get: function () { return chunkJG4TFS3Z_cjs.DmInviteChip; }
79
+ get: function () { return chunkRGHQFJOL_cjs.DmInviteChip; }
72
80
  });
73
81
  Object.defineProperty(exports, "DmNewTabIcon", {
74
82
  enumerable: true,
75
- get: function () { return chunkJG4TFS3Z_cjs.DmNewTabIcon; }
83
+ get: function () { return chunkRGHQFJOL_cjs.DmNewTabIcon; }
76
84
  });
77
85
  Object.defineProperty(exports, "DmThreadFrame", {
78
86
  enumerable: true,
79
- get: function () { return chunkJG4TFS3Z_cjs.DmThreadFrame; }
87
+ get: function () { return chunkRGHQFJOL_cjs.DmThreadFrame; }
80
88
  });
81
89
  Object.defineProperty(exports, "DmThreadHeader", {
82
90
  enumerable: true,
83
- get: function () { return chunkJG4TFS3Z_cjs.DmThreadHeader; }
91
+ get: function () { return chunkRGHQFJOL_cjs.DmThreadHeader; }
84
92
  });
85
93
  Object.defineProperty(exports, "MAX_INVITE_EMAILS", {
86
94
  enumerable: true,
87
- get: function () { return chunkJG4TFS3Z_cjs.MAX_INVITE_EMAILS; }
95
+ get: function () { return chunkRGHQFJOL_cjs.MAX_INVITE_EMAILS; }
88
96
  });
89
97
  Object.defineProperty(exports, "MailFolderTree", {
90
98
  enumerable: true,
91
- get: function () { return chunkJG4TFS3Z_cjs.MailFolderTree; }
99
+ get: function () { return chunkRGHQFJOL_cjs.MailFolderTree; }
92
100
  });
93
101
  Object.defineProperty(exports, "MemberBulkActions", {
94
102
  enumerable: true,
95
- get: function () { return chunkJG4TFS3Z_cjs.MemberBulkActions; }
103
+ get: function () { return chunkRGHQFJOL_cjs.MemberBulkActions; }
96
104
  });
97
105
  Object.defineProperty(exports, "MemberListLoading", {
98
106
  enumerable: true,
99
- get: function () { return chunkJG4TFS3Z_cjs.MemberListLoading; }
107
+ get: function () { return chunkRGHQFJOL_cjs.MemberListLoading; }
100
108
  });
101
109
  Object.defineProperty(exports, "MemberMutedText", {
102
110
  enumerable: true,
103
- get: function () { return chunkJG4TFS3Z_cjs.MemberMutedText; }
111
+ get: function () { return chunkRGHQFJOL_cjs.MemberMutedText; }
104
112
  });
105
113
  Object.defineProperty(exports, "MemberNameCell", {
106
114
  enumerable: true,
107
- get: function () { return chunkJG4TFS3Z_cjs.MemberNameCell; }
115
+ get: function () { return chunkRGHQFJOL_cjs.MemberNameCell; }
108
116
  });
109
117
  Object.defineProperty(exports, "MemberRoleCell", {
110
118
  enumerable: true,
111
- get: function () { return chunkJG4TFS3Z_cjs.MemberRoleCell; }
119
+ get: function () { return chunkRGHQFJOL_cjs.MemberRoleCell; }
112
120
  });
113
121
  Object.defineProperty(exports, "RecipientPicker", {
114
122
  enumerable: true,
115
- get: function () { return chunkJG4TFS3Z_cjs.RecipientPicker; }
123
+ get: function () { return chunkRGHQFJOL_cjs.RecipientPicker; }
116
124
  });
117
125
  Object.defineProperty(exports, "RoleSelect", {
118
126
  enumerable: true,
119
- get: function () { return chunkJG4TFS3Z_cjs.RoleSelect; }
127
+ get: function () { return chunkRGHQFJOL_cjs.RoleSelect; }
120
128
  });
121
129
  Object.defineProperty(exports, "WorkspaceDeleteButton", {
122
130
  enumerable: true,
123
- get: function () { return chunkJG4TFS3Z_cjs.WorkspaceDeleteButton; }
131
+ get: function () { return chunkRGHQFJOL_cjs.WorkspaceDeleteButton; }
124
132
  });
125
133
  Object.defineProperty(exports, "buildMailFolderTree", {
126
134
  enumerable: true,
127
- get: function () { return chunkJG4TFS3Z_cjs.buildMailFolderTree; }
135
+ get: function () { return chunkRGHQFJOL_cjs.buildMailFolderTree; }
136
+ });
137
+ Object.defineProperty(exports, "contactToVCard", {
138
+ enumerable: true,
139
+ get: function () { return chunkRGHQFJOL_cjs.contactToVCard; }
128
140
  });
129
141
  Object.defineProperty(exports, "descendantFolderIds", {
130
142
  enumerable: true,
131
- get: function () { return chunkJG4TFS3Z_cjs.descendantFolderIds; }
143
+ get: function () { return chunkRGHQFJOL_cjs.descendantFolderIds; }
144
+ });
145
+ Object.defineProperty(exports, "downloadVCard", {
146
+ enumerable: true,
147
+ get: function () { return chunkRGHQFJOL_cjs.downloadVCard; }
132
148
  });
133
149
  Object.defineProperty(exports, "isInboxFolder", {
134
150
  enumerable: true,
135
- get: function () { return chunkJG4TFS3Z_cjs.isInboxFolder; }
151
+ get: function () { return chunkRGHQFJOL_cjs.isInboxFolder; }
136
152
  });
137
153
  Object.defineProperty(exports, "parseEmails", {
138
154
  enumerable: true,
139
- get: function () { return chunkJG4TFS3Z_cjs.parseEmails; }
155
+ get: function () { return chunkRGHQFJOL_cjs.parseEmails; }
140
156
  });
141
157
  Object.defineProperty(exports, "toAddContactsRow", {
142
158
  enumerable: true,
143
- get: function () { return chunkJG4TFS3Z_cjs.toAddContactsRow; }
159
+ get: function () { return chunkRGHQFJOL_cjs.toAddContactsRow; }
144
160
  });
145
161
  Object.defineProperty(exports, "toAddContactsRows", {
146
162
  enumerable: true,
147
- get: function () { return chunkJG4TFS3Z_cjs.toAddContactsRows; }
163
+ get: function () { return chunkRGHQFJOL_cjs.toAddContactsRows; }
148
164
  });
149
165
  Object.defineProperty(exports, "toggleMailFolder", {
150
166
  enumerable: true,
151
- get: function () { return chunkJG4TFS3Z_cjs.toggleMailFolder; }
167
+ get: function () { return chunkRGHQFJOL_cjs.toggleMailFolder; }
168
+ });
169
+ Object.defineProperty(exports, "vCardFilename", {
170
+ enumerable: true,
171
+ get: function () { return chunkRGHQFJOL_cjs.vCardFilename; }
152
172
  });
153
173
  Object.defineProperty(exports, "DEFAULT_SHARE_CONTROL_LABELS", {
154
174
  enumerable: true,
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- export { ActionMenu, AddContactsForm, AddContactsResults, DEFAULT_ADD_CONTACTS_LABELS, DEFAULT_CONTACT_OUTCOME_LABELS, DEFAULT_DM_ACCESS_REQUEST_BANNER_LABELS, DEFAULT_DM_GRANT_ACCESS_DIALOG_LABELS, DEFAULT_DM_INVITE_CHIP_LABELS, DEFAULT_DM_THREAD_FRAME_LABELS, DEFAULT_MAIL_FOLDER_TREE_LABELS, DEFAULT_RECIPIENT_PICKER_LABELS, DmAccessRequestBanner, DmGrantAccessDialogView, DmInviteAvatar, DmInviteChip, DmNewTabIcon, DmThreadFrame, DmThreadHeader, MAX_INVITE_EMAILS, MailFolderTree, MemberBulkActions, MemberListLoading, MemberMutedText, MemberNameCell, MemberRoleCell, RecipientPicker, RoleSelect, WorkspaceDeleteButton, buildMailFolderTree, descendantFolderIds, isInboxFolder, parseEmails, toAddContactsRow, toAddContactsRows, toggleMailFolder } from '../chunk-G2E3O3HI.js';
2
+ export { ActionMenu, AddContactsForm, AddContactsResults, ContactCard, DEFAULT_ADD_CONTACTS_LABELS, DEFAULT_CONTACT_CARD_LABELS, DEFAULT_CONTACT_OUTCOME_LABELS, DEFAULT_DM_ACCESS_REQUEST_BANNER_LABELS, DEFAULT_DM_GRANT_ACCESS_DIALOG_LABELS, DEFAULT_DM_INVITE_CHIP_LABELS, DEFAULT_DM_THREAD_FRAME_LABELS, DEFAULT_MAIL_FOLDER_TREE_LABELS, DEFAULT_RECIPIENT_PICKER_LABELS, DmAccessRequestBanner, DmGrantAccessDialogView, DmInviteAvatar, DmInviteChip, DmNewTabIcon, DmThreadFrame, DmThreadHeader, MAX_INVITE_EMAILS, MailFolderTree, MemberBulkActions, MemberListLoading, MemberMutedText, MemberNameCell, MemberRoleCell, RecipientPicker, RoleSelect, WorkspaceDeleteButton, buildMailFolderTree, contactToVCard, descendantFolderIds, downloadVCard, isInboxFolder, parseEmails, toAddContactsRow, toAddContactsRows, toggleMailFolder, vCardFilename } from '../chunk-OJSWQM4G.js';
3
3
  import '../chunk-NBV56SGU.js';
4
4
  export { DEFAULT_SHARE_CONTROL_LABELS, ShareControl } from '../chunk-K4BGOPGG.js';
5
5
  import '../chunk-CPMNAJLF.js';
@@ -2,9 +2,9 @@
2
2
  'use strict';
3
3
 
4
4
  var chunkYVIOCITQ_cjs = require('../chunk-YVIOCITQ.cjs');
5
- var chunk23XL6SVZ_cjs = require('../chunk-23XL6SVZ.cjs');
5
+ var chunkZPOLKYR2_cjs = require('../chunk-ZPOLKYR2.cjs');
6
6
  require('../chunk-ADOKTJHV.cjs');
7
- require('../chunk-5SLLMK5K.cjs');
7
+ require('../chunk-PRVKJ5XL.cjs');
8
8
  require('../chunk-VGOFFCMT.cjs');
9
9
  require('../chunk-PPCATBOY.cjs');
10
10
  var chunkKDG6FER6_cjs = require('../chunk-KDG6FER6.cjs');
@@ -18,7 +18,7 @@ var lucideReact = require('lucide-react');
18
18
  var ui = require('@arbidocs/react/ui');
19
19
 
20
20
  function ConnectionBoundWebSocket({ children }) {
21
- const { status } = chunk23XL6SVZ_cjs.useConnection();
21
+ const { status } = chunkZPOLKYR2_cjs.useConnection();
22
22
  return /* @__PURE__ */ jsxRuntime.jsx(react$1.ArbiWebSocketProvider, { enabled: status === "authenticated", children });
23
23
  }
24
24
  function ArbiAppProvider({
@@ -31,10 +31,10 @@ function ArbiAppProvider({
31
31
  })
32
32
  );
33
33
  const providerUrl = config.apiUrl || config.demoApiUrl || "https://demo.arbi.local";
34
- return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.ArbiProvider, { url: providerUrl, children: /* @__PURE__ */ jsxRuntime.jsx(chunk23XL6SVZ_cjs.ConnectionProvider, { config, children: /* @__PURE__ */ jsxRuntime.jsx(ConnectionBoundWebSocket, { children }) }) }) });
34
+ return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.ArbiProvider, { url: providerUrl, children: /* @__PURE__ */ jsxRuntime.jsx(chunkZPOLKYR2_cjs.ConnectionProvider, { config, children: /* @__PURE__ */ jsxRuntime.jsx(ConnectionBoundWebSocket, { children }) }) }) });
35
35
  }
36
36
  function useConnectedShellWorkspaces(options = {}) {
37
- const { workspaceId, setWorkspace } = chunk23XL6SVZ_cjs.useConnection();
37
+ const { workspaceId, setWorkspace } = chunkZPOLKYR2_cjs.useConnection();
38
38
  const query = react$1.useWorkspaces();
39
39
  return react$1.useShellWorkspaces({
40
40
  ...options,
@@ -59,7 +59,7 @@ function ConnectedProfileCard({ notify, title = "Profile" }) {
59
59
  const updateProfile = react$1.useUpdateProfile();
60
60
  const requestEmailChange = react$1.useRequestEmailChange();
61
61
  const confirmEmailChange = react$1.useConfirmEmailChange();
62
- const { user } = chunk23XL6SVZ_cjs.useConnection();
62
+ const { user } = chunkZPOLKYR2_cjs.useConnection();
63
63
  const name = react$1.useNameEditor({
64
64
  givenName: profile?.givenName,
65
65
  familyName: profile?.familyName,
@@ -297,7 +297,7 @@ function ConnectedLogoutDialog({
297
297
  isOnline = true,
298
298
  renderSessionIcon
299
299
  }) {
300
- const { logout } = chunk23XL6SVZ_cjs.useConnection();
300
+ const { logout } = chunkZPOLKYR2_cjs.useConnection();
301
301
  const sessions = react$1.useSessions({ enabled: open });
302
302
  const logoutAll = react$1.useLogoutAllSessions();
303
303
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -323,7 +323,7 @@ function ConnectedLogoutDialog({
323
323
  function ConnectedDangerZone({ notify, renderSubscriptionLink }) {
324
324
  const [zoneOpen, setZoneOpen] = react.useState(false);
325
325
  const [dialogOpen, setDialogOpen] = react.useState(false);
326
- const { user, logout } = chunk23XL6SVZ_cjs.useConnection();
326
+ const { user, logout } = chunkZPOLKYR2_cjs.useConnection();
327
327
  const remove = react$1.useDeleteAccount();
328
328
  const flow = react$1.useDeleteAccountFlow({
329
329
  userEmail: user?.email ?? "",
@@ -374,51 +374,51 @@ function ConnectedDangerZone({ notify, renderSubscriptionLink }) {
374
374
 
375
375
  Object.defineProperty(exports, "ConnectedAssistantDock", {
376
376
  enumerable: true,
377
- get: function () { return chunk23XL6SVZ_cjs.ConnectedAssistantDock; }
377
+ get: function () { return chunkZPOLKYR2_cjs.ConnectedAssistantDock; }
378
378
  });
379
379
  Object.defineProperty(exports, "ConnectionProvider", {
380
380
  enumerable: true,
381
- get: function () { return chunk23XL6SVZ_cjs.ConnectionProvider; }
381
+ get: function () { return chunkZPOLKYR2_cjs.ConnectionProvider; }
382
382
  });
383
383
  Object.defineProperty(exports, "SESSION_EXPIRED_MESSAGE", {
384
384
  enumerable: true,
385
- get: function () { return chunk23XL6SVZ_cjs.SESSION_EXPIRED_MESSAGE; }
385
+ get: function () { return chunkZPOLKYR2_cjs.SESSION_EXPIRED_MESSAGE; }
386
386
  });
387
387
  Object.defineProperty(exports, "isAuthenticated", {
388
388
  enumerable: true,
389
- get: function () { return chunk23XL6SVZ_cjs.isAuthenticated; }
389
+ get: function () { return chunkZPOLKYR2_cjs.isAuthenticated; }
390
390
  });
391
391
  Object.defineProperty(exports, "redlineStats", {
392
392
  enumerable: true,
393
- get: function () { return chunk23XL6SVZ_cjs.redlineStats; }
393
+ get: function () { return chunkZPOLKYR2_cjs.redlineStats; }
394
394
  });
395
395
  Object.defineProperty(exports, "textToArtifact", {
396
396
  enumerable: true,
397
- get: function () { return chunk23XL6SVZ_cjs.textToArtifact; }
397
+ get: function () { return chunkZPOLKYR2_cjs.textToArtifact; }
398
398
  });
399
399
  Object.defineProperty(exports, "toRedlineMarkdown", {
400
400
  enumerable: true,
401
- get: function () { return chunk23XL6SVZ_cjs.toRedlineMarkdown; }
401
+ get: function () { return chunkZPOLKYR2_cjs.toRedlineMarkdown; }
402
402
  });
403
403
  Object.defineProperty(exports, "useConnectedAiTask", {
404
404
  enumerable: true,
405
- get: function () { return chunk23XL6SVZ_cjs.useConnectedAiTask; }
405
+ get: function () { return chunkZPOLKYR2_cjs.useConnectedAiTask; }
406
406
  });
407
407
  Object.defineProperty(exports, "useConnectedChat", {
408
408
  enumerable: true,
409
- get: function () { return chunk23XL6SVZ_cjs.useConnectedChat; }
409
+ get: function () { return chunkZPOLKYR2_cjs.useConnectedChat; }
410
410
  });
411
411
  Object.defineProperty(exports, "useConnection", {
412
412
  enumerable: true,
413
- get: function () { return chunk23XL6SVZ_cjs.useConnection; }
413
+ get: function () { return chunkZPOLKYR2_cjs.useConnection; }
414
414
  });
415
415
  Object.defineProperty(exports, "useSemanticSearch", {
416
416
  enumerable: true,
417
- get: function () { return chunk23XL6SVZ_cjs.useSemanticSearch; }
417
+ get: function () { return chunkZPOLKYR2_cjs.useSemanticSearch; }
418
418
  });
419
419
  Object.defineProperty(exports, "useWorkspaceDocs", {
420
420
  enumerable: true,
421
- get: function () { return chunk23XL6SVZ_cjs.useWorkspaceDocs; }
421
+ get: function () { return chunkZPOLKYR2_cjs.useWorkspaceDocs; }
422
422
  });
423
423
  exports.ArbiAppProvider = ArbiAppProvider;
424
424
  exports.ConnectedDangerZone = ConnectedDangerZone;
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { SettingsSection, ProfileCard, AvatarPicker, SettingsCard, SettingsActionRow, PasswordChangeDialog, EMAIL_NOTIFICATION_KEYS, EMAIL_NOTIFICATION_CATEGORIES, NotificationCategoryList, toNotificationCategories, toActiveSessionViews, SettingsRow, ActiveSessionsDialog, LogoutDialog, toLogoutSessionViews, SettingsDangerZone, DeleteAccountDialog, toDeleteBlockerViews } from '../chunk-JLOYWXRB.js';
3
- import { ConnectionProvider, useConnection } from '../chunk-UHVNYKV2.js';
4
- export { ConnectedAssistantDock, ConnectionProvider, SESSION_EXPIRED_MESSAGE, isAuthenticated, redlineStats, textToArtifact, toRedlineMarkdown, useConnectedAiTask, useConnectedChat, useConnection, useSemanticSearch, useWorkspaceDocs } from '../chunk-UHVNYKV2.js';
3
+ import { ConnectionProvider, useConnection } from '../chunk-S74WZNK7.js';
4
+ export { ConnectedAssistantDock, ConnectionProvider, SESSION_EXPIRED_MESSAGE, isAuthenticated, redlineStats, textToArtifact, toRedlineMarkdown, useConnectedAiTask, useConnectedChat, useConnection, useSemanticSearch, useWorkspaceDocs } from '../chunk-S74WZNK7.js';
5
5
  import '../chunk-VILAPTCB.js';
6
- import '../chunk-G2T3KTZ3.js';
6
+ import '../chunk-UVIOQUJA.js';
7
7
  import '../chunk-KZJAG7T3.js';
8
8
  import '../chunk-NPLYHR2E.js';
9
9
  import { initials } from '../chunk-OXF2IFXG.js';
@@ -1,11 +1,12 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkLRUCMZK6_cjs = require('../chunk-LRUCMZK6.cjs');
4
+ var chunkD6XY3C4O_cjs = require('../chunk-D6XY3C4O.cjs');
5
5
  var chunkOUW6G4O2_cjs = require('../chunk-OUW6G4O2.cjs');
6
6
  var chunkVPPX5XUF_cjs = require('../chunk-VPPX5XUF.cjs');
7
7
  var chunkV4ISCZJ7_cjs = require('../chunk-V4ISCZJ7.cjs');
8
8
  var chunk5B4PXAKI_cjs = require('../chunk-5B4PXAKI.cjs');
9
+ require('../chunk-FX3K6LNZ.cjs');
9
10
  require('../chunk-C54XEN5T.cjs');
10
11
  var chunkPPCATBOY_cjs = require('../chunk-PPCATBOY.cjs');
11
12
  var chunkKDG6FER6_cjs = require('../chunk-KDG6FER6.cjs');
@@ -502,7 +503,7 @@ function FactsTable({
502
503
  ]
503
504
  );
504
505
  return /* @__PURE__ */ jsxRuntime.jsx(
505
- chunkLRUCMZK6_cjs.GridView,
506
+ chunkD6XY3C4O_cjs.GridView,
506
507
  {
507
508
  testId,
508
509
  items: facts,
@@ -1301,7 +1302,7 @@ function FactsViewToggle({
1301
1302
  testId: testIds?.[o.value]
1302
1303
  }));
1303
1304
  return /* @__PURE__ */ jsxRuntime.jsx(
1304
- chunkLRUCMZK6_cjs.ViewToggle,
1305
+ chunkD6XY3C4O_cjs.ViewToggle,
1305
1306
  {
1306
1307
  options,
1307
1308
  value: viewMode,