@flamingo-stack/openframe-frontend-core 0.0.392 → 0.0.393-snapshot.20260709182639
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/{chunk-ZJMOMD4Y.js → chunk-2J6AOHJI.js} +2 -2
- package/dist/{chunk-T5KEAEOT.cjs → chunk-4FT3KQD3.cjs} +15 -15
- package/dist/{chunk-T5KEAEOT.cjs.map → chunk-4FT3KQD3.cjs.map} +1 -1
- package/dist/{chunk-5C3JVWS6.js → chunk-5J3LR56Z.js} +2 -2
- package/dist/{chunk-TY6EPTFG.js → chunk-A7IGCQUD.js} +4 -4
- package/dist/{chunk-APOFENYR.js → chunk-AGTM2H7T.js} +2 -2
- package/dist/{chunk-4OLF4E3M.js → chunk-AQJ5S6RS.js} +2 -2
- package/dist/{chunk-4G2S3PWB.cjs → chunk-CJMM2WZP.cjs} +5 -5
- package/dist/{chunk-4G2S3PWB.cjs.map → chunk-CJMM2WZP.cjs.map} +1 -1
- package/dist/{chunk-WJIKMPKF.cjs → chunk-DFCPMBYN.cjs} +9 -9
- package/dist/{chunk-WJIKMPKF.cjs.map → chunk-DFCPMBYN.cjs.map} +1 -1
- package/dist/{chunk-MNIXKGAB.cjs → chunk-DRSAMA27.cjs} +62 -62
- package/dist/{chunk-MNIXKGAB.cjs.map → chunk-DRSAMA27.cjs.map} +1 -1
- package/dist/{chunk-YCSATEAQ.js → chunk-DXIDOGF4.js} +2 -2
- package/dist/{chunk-DVM5HS6H.cjs → chunk-FIOOW474.cjs} +7 -7
- package/dist/{chunk-DVM5HS6H.cjs.map → chunk-FIOOW474.cjs.map} +1 -1
- package/dist/{chunk-FMCL72KB.js → chunk-FVFPGGDA.js} +4 -4
- package/dist/{chunk-P5UU5S72.js → chunk-G6CNEEZ3.js} +2 -2
- package/dist/{chunk-WEZEOIWI.js → chunk-GAD4OYKN.js} +2 -2
- package/dist/{chunk-VV6VLH54.cjs → chunk-HXDBJR4A.cjs} +59 -59
- package/dist/{chunk-VV6VLH54.cjs.map → chunk-HXDBJR4A.cjs.map} +1 -1
- package/dist/{chunk-VV45SH3F.cjs → chunk-IEKEUSPV.cjs} +31 -31
- package/dist/{chunk-VV45SH3F.cjs.map → chunk-IEKEUSPV.cjs.map} +1 -1
- package/dist/{chunk-X7ECA7BO.cjs → chunk-LP3FQTCB.cjs} +26 -26
- package/dist/{chunk-X7ECA7BO.cjs.map → chunk-LP3FQTCB.cjs.map} +1 -1
- package/dist/{chunk-G7TYNT4T.cjs → chunk-N6SH4ZYN.cjs} +12 -12
- package/dist/{chunk-G7TYNT4T.cjs.map → chunk-N6SH4ZYN.cjs.map} +1 -1
- package/dist/{chunk-N6KORCQJ.js → chunk-NYBMBTBL.js} +7 -7
- package/dist/chunk-NYBMBTBL.js.map +1 -0
- package/dist/{chunk-ONNCKONQ.cjs → chunk-PVMISZQT.cjs} +37 -37
- package/dist/{chunk-ONNCKONQ.cjs.map → chunk-PVMISZQT.cjs.map} +1 -1
- package/dist/{chunk-VQB5AWOI.cjs → chunk-R6PS3AXI.cjs} +7 -7
- package/dist/{chunk-VQB5AWOI.cjs.map → chunk-R6PS3AXI.cjs.map} +1 -1
- package/dist/{chunk-S6JTTDWK.js → chunk-SSZL4QYX.js} +4 -4
- package/dist/{chunk-LQHXLC7F.js → chunk-WAKXAMRC.js} +4 -4
- package/dist/{chunk-OCNXLJS2.cjs → chunk-YIJGUS7V.cjs} +26 -26
- package/dist/{chunk-OCNXLJS2.cjs.map → chunk-YIJGUS7V.cjs.map} +1 -1
- package/dist/components/case-studies/index.cjs +8 -8
- package/dist/components/case-studies/index.js +2 -2
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/docs/index.cjs +5 -5
- package/dist/components/docs/index.js +4 -4
- package/dist/components/embeds/index.cjs +3 -3
- package/dist/components/embeds/index.js +2 -2
- package/dist/components/faq/index.cjs +3 -3
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/help-center-pages/index.cjs +20 -20
- package/dist/components/help-center-pages/index.js +11 -11
- package/dist/components/index.cjs +120 -120
- package/dist/components/index.js +9 -9
- package/dist/components/navigation/app-header.d.ts.map +1 -1
- package/dist/components/navigation/app-layout-drawer.d.ts +3 -1
- package/dist/components/navigation/app-layout-drawer.d.ts.map +1 -1
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/navigation/mobile-burger-menu.d.ts.map +1 -1
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/onboarding-guides/index.js +4 -4
- package/dist/components/related-content/index.cjs +3 -3
- package/dist/components/related-content/index.js +2 -2
- package/dist/components/tickets/index.cjs +5 -5
- package/dist/components/tickets/index.js +4 -4
- package/dist/components/ui/drawer.d.ts +3 -1
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/navigation/app-header.tsx +3 -1
- package/src/components/navigation/app-layout-drawer.tsx +4 -2
- package/src/components/navigation/mobile-burger-menu.tsx +11 -5
- package/src/components/ui/drawer.tsx +4 -2
- package/dist/chunk-N6KORCQJ.js.map +0 -1
- /package/dist/{chunk-ZJMOMD4Y.js.map → chunk-2J6AOHJI.js.map} +0 -0
- /package/dist/{chunk-5C3JVWS6.js.map → chunk-5J3LR56Z.js.map} +0 -0
- /package/dist/{chunk-TY6EPTFG.js.map → chunk-A7IGCQUD.js.map} +0 -0
- /package/dist/{chunk-APOFENYR.js.map → chunk-AGTM2H7T.js.map} +0 -0
- /package/dist/{chunk-4OLF4E3M.js.map → chunk-AQJ5S6RS.js.map} +0 -0
- /package/dist/{chunk-YCSATEAQ.js.map → chunk-DXIDOGF4.js.map} +0 -0
- /package/dist/{chunk-FMCL72KB.js.map → chunk-FVFPGGDA.js.map} +0 -0
- /package/dist/{chunk-P5UU5S72.js.map → chunk-G6CNEEZ3.js.map} +0 -0
- /package/dist/{chunk-WEZEOIWI.js.map → chunk-GAD4OYKN.js.map} +0 -0
- /package/dist/{chunk-S6JTTDWK.js.map → chunk-SSZL4QYX.js.map} +0 -0
- /package/dist/{chunk-LQHXLC7F.js.map → chunk-WAKXAMRC.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-WJIKMPKF.cjs","../src/components/shared/doc-search/format-relative-path.ts","../src/components/shared/doc-search/doc-search-result-row.tsx","../src/components/shared/doc-search/doc-search-bar.tsx","../src/components/shared/doc-search/map-doc-search-results.ts","../src/components/shared/doc-search/resolve-search-result-action.ts","../src/components/shared/doc-search/use-doc-search.ts"],"names":["jsx"],"mappings":"AAAA,6rBAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACZO,SAAS,kBAAA,CAAmB,QAAA,EAA0B;AAC3D,EAAA,GAAA,CAAI,CAAC,QAAA,EAAU,OAAO,EAAA;AACtB,EAAA,MAAM,SAAA,EAAW,QAAA,CAAS,OAAA,CAAQ,OAAA,EAAS,EAAE,CAAA,CAAE,KAAA,CAAM,GAAG,CAAA;AAExD,EAAA,MAAM,eAAA,EAAiB,QAAA,CAAS,OAAA,EAAS,EAAA,EAAI,QAAA,CAAS,KAAA,CAAM,CAAA,EAAG,CAAA,CAAE,EAAA,EAAI,QAAA;AACrE,EAAA,OAAO,cAAA,CACJ,GAAA,CAAI,CAAC,GAAA,EAAA,GAAQ,GAAA,CAAI,MAAA,CAAO,CAAC,CAAA,CAAE,WAAA,CAAY,EAAA,EAAI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A;AACO,QAAA;AAGkB,UAAA;AACxB,YAAA;AAEoD,YAAA;AAC1C,YAAA;AACX,cAAA;AACb,cAAA;AACA,cAAA;AACM,YAAA;AACR,YAAA;AACF,UAAA;AACiB,UAAA;AACC,YAAA;AACmC,YAAA;AACnD,YAAA;AACF,UAAA;AAOiB,UAAA;AAIX,UAAA;AAC4B,UAAA;AACY,UAAA;AAC9C,UAAA;AACF,QAAA;AACK,QAAA;AAIa,UAAA;AACmC,UAAA;AACnD,UAAA;AACG,QAAA;AAMc,UAAA;AACV,UAAA;AAC4D,YAAA;AACnE,UAAA;AACA,UAAA;AACG,QAAA;AAGc,UAAA;AACK,UAAA;AACtB,UAAA;AACG,QAAA;AACH,UAAA;AACJ,MAAA;AACF,IAAA;AAC6D,IAAA;AAC/D,EAAA;AAGgB,EAAA;AACG,IAAA;AACT,EAAA;AAEH,EAAA;AACL,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACkB,IAAA;AACpB,EAAA;AACF;ANyE2H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-WJIKMPKF.cjs","sourcesContent":[null,"/**\n * Format a full document path as a breadcrumb trail.\n * Shows parent folders only (excludes the last segment / filename).\n *\n * @example\n * formatRelativePath('openframe-oss-tenant/architecture/api-controllers.md')\n * // → 'Openframe oss tenant / Architecture'\n */\nexport function formatRelativePath(fullPath: string): string {\n if (!fullPath) return ''\n const segments = fullPath.replace(/\\.md$/, '').split('/')\n // Show only parent path (exclude the filename itself since the title already shows it)\n const parentSegments = segments.length > 1 ? segments.slice(0, -1) : segments\n return parentSegments\n .map((seg) => seg.charAt(0).toUpperCase() + seg.slice(1).replace(/-/g, ' '))\n .join(' / ')\n}\n","'use client'\n\n/**\n * Single row in the `<SearchInput>` dropdown — the standard layout\n * used by every doc-search-backed surface (company-hub data-room\n * search bar, onboarding-guide catalog search, …). Single source of\n * truth for the row appearance so search dropdowns are visually\n * identical everywhere.\n *\n * Resolves the source icon via the same `resolveSourceIcon()`\n * registry the inline chat-card refs use, so a row pointing at e.g.\n * an onboarding-guide surfaces the SAME `<GraduationCap>` glyph the\n * chat card surfaces — no cross-surface drift.\n */\n\nimport { resolveSourceIcon } from '../../chat/utils/source-row-cta'\nimport { formatRelativePath } from './format-relative-path'\n\n/**\n * Minimal result shape this row renders. Compatible with any\n * doc-search hook whose result type exposes `{ title?, path?,\n * metadata? }`. The two hub consumers (onboarding-guide catalog,\n * data-room sidebar) both satisfy this shape via their\n * `useDocSearch` hook result.\n */\nexport interface DocSearchResultRowEntry {\n title?: string\n path?: string\n metadata?: Record<string, unknown>\n}\n\nexport interface DocSearchResultRowProps {\n result: DocSearchResultRowEntry\n isHighlighted: boolean\n}\n\nexport function DocSearchResultRow({\n result,\n isHighlighted,\n}: DocSearchResultRowProps) {\n const docType = (result.metadata?.documentType as string) || undefined\n const sourceRepo = (result.metadata?.sourceRepo as string) || undefined\n const { Icon: SourceIcon, label: iconLabel } = resolveSourceIcon({\n sourceRepo,\n documentType: docType,\n })\n const isGroup = result.metadata?.isGroup as boolean | undefined\n\n return (\n <div className=\"flex items-center gap-3 w-full min-w-0\">\n <span\n className=\"flex-shrink-0 text-ods-text-secondary\"\n title={iconLabel}\n >\n <SourceIcon className=\"size-4\" />\n </span>\n <div className=\"min-w-0 flex-1\">\n <div\n className={`text-sm font-medium leading-5 truncate ${\n isHighlighted ? 'text-ods-accent' : 'text-ods-text-primary'\n }`}\n >\n {result.title || result.path}\n </div>\n {!isGroup && result.path?.includes('/') && (\n <div className=\"text-xs leading-4 text-ods-text-secondary truncate mt-0.5\">\n {formatRelativePath(result.path)}\n </div>\n )}\n </div>\n </div>\n )\n}\n","'use client'\n\n/**\n * `<DocSearchBar>` — the canonical RAG-search dropdown surface.\n *\n * Mounted by every doc-search consumer (data-room sidebar, onboarding-\n * guide catalog, and any future surface that needs typeahead against\n * `/api/docs/search`). Wraps `<SearchInput>` with the lib's standard\n * `<DocSearchResultRow>` so the dropdown looks identical everywhere.\n *\n * ## Why a presentation component, not a \"search bar that owns its\n * own hook\"\n *\n * The data-fetching hook (`useDocSearch`) lives hub-side because it\n * depends on hub-only context (`useDocNavigation`, the rag-table-\n * config registry, the hub's `decideNewTab` helper). Moving the hook\n * would cascade ~5 more file migrations into the lib.\n *\n * Instead, the hook stays hub-side and callers pass its result into\n * this component as plain props. Both consumers shrink to ~5 lines.\n */\n\nimport type { ReactNode } from 'react'\nimport { SearchInput, type SearchResult } from '../../ui/search-input'\nimport { DocSearchResultRow } from './doc-search-result-row'\n\nexport interface DocSearchBarProps {\n placeholder: string\n query: string\n onQueryChange: (value: string) => void\n /** Hook-fetched results. Reuses the lib's `<SearchInput>` `SearchResult`\n * shape directly so callers don't translate. */\n results: SearchResult[]\n isLoading: boolean\n /** Result selection handler. Mirrors `<SearchInput>` — the second\n * `modifiers` argument is preserved so cmd-click / shift-click on\n * a result row still forces new-tab behavior. Hub `useDocSearch`\n * reads these to short-circuit to `window.open()`. */\n onResultSelect: (\n result: SearchResult,\n modifiers?: {\n metaKey?: boolean\n ctrlKey?: boolean\n shiftKey?: boolean\n altKey?: boolean\n button?: number\n },\n ) => void\n /** Lets the caller's hook force the dropdown open after a recent\n * internal action (e.g. result navigation). `undefined` falls back\n * to `<SearchInput>`'s built-in focus/hover heuristics. */\n showDropdown?: boolean\n /** Defaults to 2 — matches the existing data-room and onboarding-\n * guide consumers. Override only if a surface needs different\n * typeahead semantics. */\n minQueryLength?: number\n /** Defaults to 0 — both existing consumers debounce inside the\n * hook, not the input. */\n debounceMs?: number\n className?: string\n /** Optional row-renderer override. Defaults to the lib's standard\n * `<DocSearchResultRow>` (source icon + title + path breadcrumb).\n * Override only when a surface needs custom row chrome. */\n renderResult?: (result: SearchResult, isHighlighted: boolean) => ReactNode\n}\n\nexport function DocSearchBar({\n placeholder,\n query,\n onQueryChange,\n results,\n isLoading,\n onResultSelect,\n showDropdown,\n minQueryLength = 2,\n debounceMs = 0,\n className = 'w-full',\n renderResult,\n}: DocSearchBarProps) {\n return (\n <SearchInput\n placeholder={placeholder}\n value={query}\n onChange={onQueryChange}\n results={results}\n isLoading={isLoading}\n onResultSelect={onResultSelect}\n showDropdown={showDropdown || undefined}\n debounceMs={debounceMs}\n minQueryLength={minQueryLength}\n className={className}\n renderResult={\n renderResult ??\n ((result, isHighlighted) => (\n <DocSearchResultRow result={result} isHighlighted={isHighlighted} />\n ))\n }\n />\n )\n}\n","/**\n * Map RAG `/api/docs/search` wire results into the `<DocSearchBar>`\n * dropdown's row shape, collapsing entity-table rows into grouped\n * results so the dropdown lists ONE \"Cap Table (12 records)\" row\n * instead of 12 individual rows.\n *\n * Pure transform — no telemetry, no navigation, no React deps. Lifted\n * from the hub's `hooks/use-docs.ts:mapDocSearchResults` (the hub's\n * `traceCompose` call was hub-only telemetry and is intentionally\n * dropped — callers that want logging can wrap this helper).\n */\n\nimport type { SearchResult } from '../../ui/search-input'\nimport type { DocSearchResult } from './types'\n\n/** Source repos that should be collapsed into grouped results in the search bar.\n * Only financial tables (all rows link to the same admin page).\n * Content tables (blog, webinar, podcast, etc.) stay individual since each has a unique URL. */\nconst SEARCH_GROUP_REPOS = new Set([\n 'financial-cap-table',\n 'financial-kpis',\n 'financial-pnl',\n 'financial-balance-sheet',\n 'financial-cash-flow',\n])\n\nconst ENTITY_LABELS: Record<string, string> = {\n 'financial-cap-table': 'Cap Table',\n 'financial-kpis': 'Financial KPIs',\n 'financial-pnl': 'Profit & Loss',\n 'financial-balance-sheet': 'Balance Sheets',\n 'financial-cash-flow': 'Cash Flow',\n 'blog-posts': 'Blog Posts',\n 'product-releases': 'Product Releases',\n 'case-studies': 'Case Studies',\n webinars: 'Webinars',\n events: 'Events',\n podcasts: 'Podcasts',\n}\n\nexport function mapDocSearchResults(docs: DocSearchResult[]): SearchResult[] {\n const entityGroups = new Map<string, DocSearchResult[]>()\n // Track insertion order — groups appear where the FIRST row of that\n // repo appeared in the response.\n const order: Array<\n { type: 'entity'; repo: string } | { type: 'doc'; doc: DocSearchResult }\n > = []\n const seenRepos = new Set<string>()\n\n for (const doc of docs) {\n if (doc.sourceRepo && SEARCH_GROUP_REPOS.has(doc.sourceRepo)) {\n const group = entityGroups.get(doc.sourceRepo) || []\n group.push(doc)\n entityGroups.set(doc.sourceRepo, group)\n if (!seenRepos.has(doc.sourceRepo)) {\n seenRepos.add(doc.sourceRepo)\n order.push({ type: 'entity', repo: doc.sourceRepo })\n }\n } else {\n order.push({ type: 'doc', doc })\n }\n }\n\n const results: SearchResult[] = []\n for (const entry of order) {\n if (entry.type === 'entity') {\n const rows = entityGroups.get(entry.repo)!\n const label = ENTITY_LABELS[entry.repo] || entry.repo\n results.push({\n id: `group-${entry.repo}`,\n title: `${label} (${rows.length} ${rows.length === 1 ? 'record' : 'records'})`,\n path: rows[0].path,\n type: 'file',\n metadata: {\n documentType: rows[0].documentType,\n externalUrl: rows[0].externalUrl,\n sourceRepo: entry.repo,\n id: rows[0].entityId,\n isGroup: true,\n items: rows.map((r) => ({\n name: r.name,\n externalUrl: r.externalUrl,\n id: r.entityId,\n sourceRepo: r.sourceRepo,\n documentType: r.documentType,\n })),\n },\n })\n } else {\n const doc = entry.doc\n const isNonMarkdown = doc.documentType && doc.documentType !== 'markdown'\n results.push({\n id: doc.path,\n title: doc.name,\n description: isNonMarkdown ? doc.name : doc.snippet,\n path: doc.path,\n type: doc.type,\n metadata: {\n matchType: doc.matchType,\n ...(doc.documentType ? { documentType: doc.documentType } : {}),\n ...(doc.externalUrl ? { externalUrl: doc.externalUrl } : {}),\n ...(doc.targetPlatform != null\n ? { targetPlatform: doc.targetPlatform }\n : {}),\n ...(doc.sourceRepo ? { sourceRepo: doc.sourceRepo } : {}),\n ...(doc.entityId ? { id: doc.entityId } : {}),\n },\n })\n }\n }\n\n return results\n}\n","/**\n * Resolve what should happen when the user picks a search result.\n * Returns one of five typed actions so the caller is a single switch.\n *\n * Resolution order:\n * 1. `externalUrl` present → use `decideNewTab` to choose same-tab vs\n * new-tab against the row's `targetPlatform`.\n * 2. Row has `id` + `sourceRepo` + `documentType` → synth an Ask-AI\n * action (entity drill-in via primary key, no URL).\n * 3. Row has only `path` → legacy navigation fallback.\n * 4. Nothing actionable → noop.\n *\n * Lifted from the hub's `hooks/use-docs.ts:resolveSearchResultAction`.\n * Pure — no React, no telemetry.\n */\n\nimport type { SearchResult } from '../../ui/search-input'\nimport type { ChatRef } from '../../chat/chat-ref.types'\nimport { decideNewTab } from '../../chat/utils/decide-new-tab'\n\nexport type SearchResultAction =\n | { kind: 'navigate-same-tab'; href: string }\n | { kind: 'navigate-new-tab'; href: string }\n | { kind: 'ask-ai'; detail: { source: string; ref: ChatRef } }\n | { kind: 'route'; path: string }\n | { kind: 'noop' }\n\nexport function resolveSearchResultAction(\n result: SearchResult,\n source: string,\n runtimeMode?: 'host' | 'embed',\n): SearchResultAction {\n const meta = result.metadata ?? {}\n const externalUrl = meta.externalUrl as string | undefined\n if (externalUrl) {\n // Same pure helper `useNavLink` and `useUnifiedNav` call — single\n // decision rule across cards, chips, and autocomplete rows. Thread\n // the caller's `source` as `currentSource` so the platform-vs-\n // platform comparison matches the hub's pre-migration behavior.\n const targetPlatform = meta.targetPlatform as string | null | undefined\n const isNewTab = decideNewTab({\n href: externalUrl,\n targetPlatform,\n surface: 'useUnifiedNav',\n runtimeMode,\n currentSource: source,\n })\n return isNewTab\n ? { kind: 'navigate-new-tab', href: externalUrl }\n : { kind: 'navigate-same-tab', href: externalUrl }\n }\n const rowId = meta.id as string | undefined\n const sourceRepo = meta.sourceRepo as string | undefined\n const documentType = meta.documentType as string | undefined\n if (rowId && sourceRepo && documentType) {\n return {\n kind: 'ask-ai',\n detail: {\n source,\n ref: { type: documentType, id: rowId, title: result.title, url: null },\n },\n }\n }\n if (result.path) {\n return { kind: 'route', path: result.path }\n }\n return { kind: 'noop' }\n}\n","'use client'\n\n/**\n * `useDocSearch` — debounced RAG-search hook against `/api/docs/search`.\n *\n * Pure fetch + navigation glue. Embedders can mount this directly\n * (any host with a reverse-proxy that exposes `/api/docs/search` will\n * work). Hub callers wire it into the lib `<DocSearchBar>` for the\n * canonical typeahead dropdown.\n *\n * ## What moved from hub to lib\n *\n * Lifted from `multi-platform-hub/hooks/use-docs.ts:useDocSearch`. Two\n * hub-only concerns are now optional injection points instead of\n * direct imports:\n *\n * - `useDocNavigation()` (hub's in-page doc-tree swap) → optional\n * `onInPageSwap?: (path: string) => boolean` config callback. When\n * present and returns true, the hook treats a same-origin result\n * click as \"handled in-page\"; when absent or returns false, the\n * hook falls back to `onNavigate(path)` (`router.push` on hub,\n * `window.location.assign` on bare embedders).\n * - `traceCompose` (hub-only telemetry) → dropped. The lib has no\n * equivalent runtime-context yet; bring it back when there is one.\n *\n * Everything else (debounce, `useChatRuntime` for embed-mode short-\n * circuit, embed-shim router, the action-resolver + result-mapper) is\n * now lib-resident.\n */\n\nimport { useState, useEffect, useCallback } from 'react'\nimport { useRouter } from '../../../embed-shims'\nimport { useDebounce } from '../../../hooks/ui/use-debounce'\nimport { useChatRuntime } from '../../../contexts/chat-runtime-context'\nimport { contentFetch } from '../../../utils/embed-content-fetch'\nimport type { SearchResult } from '../../ui/search-input'\nimport {\n resolveExternalNavigation,\n stripSameOriginToPath,\n NEW_TAB_FEATURES,\n} from '../../chat/utils/chat-nav-resolution'\nimport type { DocSearchResult } from './types'\nimport { mapDocSearchResults } from './map-doc-search-results'\nimport { resolveSearchResultAction } from './resolve-search-result-action'\n\nexport interface UseDocSearchConfig {\n /** Discriminator passed to `/api/docs/search?source=` (e.g.\n * `'openframe'`). Embedders set it to whatever discriminator their\n * reverse-proxy expects. */\n source: string\n /** Base route prefix this search lives under (e.g. `'/onboarding-guides'`).\n * When a result's href starts with `${baseRoute}/`, the hook\n * attempts the optional in-page swap path before falling through\n * to a full nav. */\n baseRoute: string\n /** Imperative navigation fallback. Called when no override\n * (in-page swap, new-tab) applies. Hub callers pass\n * `(path) => router.push(path)`; embedders pass an equivalent. */\n onNavigate: (path: string) => void\n /** Optional `RagTableConfig.id` list to narrow the search to specific\n * tables (e.g. `['onboarding-guides']`). Forwarded to\n * `/api/docs/search?tableIds=…` which intersects with the source's\n * standing set. */\n tableIds?: string[]\n /** Optional in-page swap callback. When the result's href is under\n * `baseRoute` AND this callback returns true, the hook treats the\n * click as handled in-page (no router push). Hub's\n * `<DocumentationSection>` wires this to\n * `useDocNavigation().navigate(path)`. */\n onInPageSwap?: (path: string) => boolean\n /** Optional endpoint override. Defaults to `'/api/docs/search'`\n * (the hub's reverse-proxy route). Embedders with a different\n * path can override. */\n searchEndpoint?: string\n}\n\nexport function useDocSearch(config: UseDocSearchConfig) {\n const {\n source,\n baseRoute,\n onNavigate,\n tableIds,\n onInPageSwap,\n searchEndpoint,\n } = config\n const tableIdsKey = tableIds && tableIds.length > 0 ? tableIds.join(',') : ''\n\n const router = useRouter()\n // Optional chat-runtime read — when present and mode='embed' the\n // search-result row click short-circuits to a new-tab open against\n // the absolutized URL. Null/host preserves today's behavior.\n // Also used as the proxy-prefix fallback for `searchEndpoint`, matching\n // how tickets resolves `findTicketUrl`.\n const runtime = useChatRuntime()\n const resolvedSearchEndpoint =\n searchEndpoint ?? runtime?.endpoints.docsSearchUrl ?? '/api/docs/search'\n\n const [query, setQuery] = useState('')\n const [results, setResults] = useState<SearchResult[]>([])\n const [isFetching, setIsFetching] = useState(false)\n const debouncedQuery = useDebounce(query, 300)\n\n useEffect(() => {\n if (!debouncedQuery || debouncedQuery.trim().length < 2) {\n setResults([])\n setIsFetching(false)\n return\n }\n\n let cancelled = false\n\n async function fetchResults() {\n setIsFetching(true)\n try {\n const params = new URLSearchParams({\n q: debouncedQuery,\n source,\n limit: '10',\n })\n if (tableIdsKey) params.set('tableIds', tableIdsKey)\n\n const response = await contentFetch(`${resolvedSearchEndpoint}?${params.toString()}`)\n if (!response.ok) {\n throw new Error(`Search request failed: ${response.status}`)\n }\n\n const json = await response.json()\n\n if (!cancelled && json.success && Array.isArray(json.data)) {\n const mapped = mapDocSearchResults(json.data as DocSearchResult[])\n setResults(mapped)\n }\n } catch (error) {\n console.error('Doc search error:', error)\n if (!cancelled) {\n setResults([])\n }\n } finally {\n if (!cancelled) {\n setIsFetching(false)\n }\n }\n }\n\n fetchResults()\n\n return () => {\n cancelled = true\n }\n }, [debouncedQuery, source, tableIdsKey, resolvedSearchEndpoint])\n\n // Derived loading state — single source of truth for \"should the\n // dropdown show 'Loading...' instead of 'No results found'\":\n const isLoading =\n query.trim().length >= 2 && (query !== debouncedQuery || isFetching)\n\n // Track whether dropdown should stay open (external link opened in new tab).\n const [keepOpen, setKeepOpen] = useState(false)\n\n const handleResultSelect = useCallback(\n (\n result: SearchResult,\n modifiers?: {\n metaKey?: boolean\n ctrlKey?: boolean\n shiftKey?: boolean\n altKey?: boolean\n button?: number\n },\n ) => {\n const action = resolveSearchResultAction(\n result,\n source,\n runtime?.navigation.mode,\n )\n // Modifier / non-primary mouse click → force new tab regardless of\n // same-tab/new-tab decision. The dropdown row is a `<div>`, not an\n // `<a target=\"_blank\">`, so the browser doesn't background-tab\n // natively on cmd-click. Honor it explicitly here for parity with\n // the anchor-based surfaces (cards, chips, related-content). Plain\n // Enter from the keyboard passes `modifiers === undefined`.\n const wantsNewTab =\n modifiers &&\n (modifiers.metaKey ||\n modifiers.ctrlKey ||\n modifiers.shiftKey ||\n modifiers.altKey ||\n (typeof modifiers.button === 'number' && modifiers.button !== 0))\n switch (action.kind) {\n case 'navigate-same-tab': {\n // Embed-mode short-circuit — autocomplete row clicked while\n // the chat panel is hosted inside an embedding app.\n if (runtime?.navigation.mode === 'embed') {\n setKeepOpen(true)\n const targetPlatform =\n (result.metadata?.targetPlatform as string | null | undefined) ?? null\n resolveExternalNavigation({\n href: action.href,\n targetPlatform,\n runtime,\n }).open()\n return\n }\n if (wantsNewTab) {\n setKeepOpen(true)\n window.open(action.href, '_blank', NEW_TAB_FEATURES)\n return\n }\n // Same-origin click:\n // 1. If the href is under the current doc-tree's baseRoute AND\n // an `onInPageSwap` callback is wired AND returns true →\n // consider in-page swap handled.\n // 2. Otherwise → embed-shim `router.push()` (soft RSC nav on\n // Next.js hosts, window.location.assign on bare hosts).\n setKeepOpen(false)\n const path =\n baseRoute && action.href.startsWith(`${baseRoute}/`)\n ? action.href.slice(baseRoute.length + 1)\n : null\n if (path && onInPageSwap?.(path)) return\n router.push(stripSameOriginToPath(action.href))\n return\n }\n case 'navigate-new-tab':\n // Cross-origin (e.g. clicking a flamingo.run release from\n // product-hub) — open in a new tab. Keep dropdown open so the\n // user can pick another result without re-searching.\n setKeepOpen(true)\n window.open(action.href, '_blank', NEW_TAB_FEATURES)\n return\n case 'ask-ai':\n // Row is searchable-but-not-openable (cap_table positions,\n // financial-kpi snapshots, anything backed by\n // `resolveUrl: () => null`). Dispatch a CustomEvent that\n // GlobalAskAI listens for — opens chat + drills via\n // `entityIdFilter` (primary-key only, same as inline-card Ask).\n setKeepOpen(false)\n window.dispatchEvent(\n new CustomEvent('ask-ai:open-with-ref', { detail: action.detail }),\n )\n return\n case 'route':\n // Final fallback: legacy navigation by path. Hits when a row\n // has neither URL nor pk metadata — a mapper/API regression.\n setKeepOpen(false)\n onNavigate(action.path)\n return\n case 'noop':\n return\n }\n },\n [onNavigate, source, baseRoute, router, onInPageSwap, runtime],\n )\n\n // Reset keepOpen when query changes.\n useEffect(() => {\n setKeepOpen(false)\n }, [query])\n\n return {\n query,\n setQuery,\n results,\n isLoading,\n handleResultSelect,\n keepDropdownOpen: keepOpen,\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-DFCPMBYN.cjs","../src/components/shared/doc-search/format-relative-path.ts","../src/components/shared/doc-search/doc-search-result-row.tsx","../src/components/shared/doc-search/doc-search-bar.tsx","../src/components/shared/doc-search/map-doc-search-results.ts","../src/components/shared/doc-search/resolve-search-result-action.ts","../src/components/shared/doc-search/use-doc-search.ts"],"names":["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A;AACkB,IAAA;AACpB,EAAA;AACF;ANyE2H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-DFCPMBYN.cjs","sourcesContent":[null,"/**\n * Format a full document path as a breadcrumb trail.\n * Shows parent folders only (excludes the last segment / filename).\n *\n * @example\n * formatRelativePath('openframe-oss-tenant/architecture/api-controllers.md')\n * // → 'Openframe oss tenant / Architecture'\n */\nexport function formatRelativePath(fullPath: string): string {\n if (!fullPath) return ''\n const segments = fullPath.replace(/\\.md$/, '').split('/')\n // Show only parent path (exclude the filename itself since the title already shows it)\n const parentSegments = segments.length > 1 ? segments.slice(0, -1) : segments\n return parentSegments\n .map((seg) => seg.charAt(0).toUpperCase() + seg.slice(1).replace(/-/g, ' '))\n .join(' / ')\n}\n","'use client'\n\n/**\n * Single row in the `<SearchInput>` dropdown — the standard layout\n * used by every doc-search-backed surface (company-hub data-room\n * search bar, onboarding-guide catalog search, …). Single source of\n * truth for the row appearance so search dropdowns are visually\n * identical everywhere.\n *\n * Resolves the source icon via the same `resolveSourceIcon()`\n * registry the inline chat-card refs use, so a row pointing at e.g.\n * an onboarding-guide surfaces the SAME `<GraduationCap>` glyph the\n * chat card surfaces — no cross-surface drift.\n */\n\nimport { resolveSourceIcon } from '../../chat/utils/source-row-cta'\nimport { formatRelativePath } from './format-relative-path'\n\n/**\n * Minimal result shape this row renders. Compatible with any\n * doc-search hook whose result type exposes `{ title?, path?,\n * metadata? }`. The two hub consumers (onboarding-guide catalog,\n * data-room sidebar) both satisfy this shape via their\n * `useDocSearch` hook result.\n */\nexport interface DocSearchResultRowEntry {\n title?: string\n path?: string\n metadata?: Record<string, unknown>\n}\n\nexport interface DocSearchResultRowProps {\n result: DocSearchResultRowEntry\n isHighlighted: boolean\n}\n\nexport function DocSearchResultRow({\n result,\n isHighlighted,\n}: DocSearchResultRowProps) {\n const docType = (result.metadata?.documentType as string) || undefined\n const sourceRepo = (result.metadata?.sourceRepo as string) || undefined\n const { Icon: SourceIcon, label: iconLabel } = resolveSourceIcon({\n sourceRepo,\n documentType: docType,\n })\n const isGroup = result.metadata?.isGroup as boolean | undefined\n\n return (\n <div className=\"flex items-center gap-3 w-full min-w-0\">\n <span\n className=\"flex-shrink-0 text-ods-text-secondary\"\n title={iconLabel}\n >\n <SourceIcon className=\"size-4\" />\n </span>\n <div className=\"min-w-0 flex-1\">\n <div\n className={`text-sm font-medium leading-5 truncate ${\n isHighlighted ? 'text-ods-accent' : 'text-ods-text-primary'\n }`}\n >\n {result.title || result.path}\n </div>\n {!isGroup && result.path?.includes('/') && (\n <div className=\"text-xs leading-4 text-ods-text-secondary truncate mt-0.5\">\n {formatRelativePath(result.path)}\n </div>\n )}\n </div>\n </div>\n )\n}\n","'use client'\n\n/**\n * `<DocSearchBar>` — the canonical RAG-search dropdown surface.\n *\n * Mounted by every doc-search consumer (data-room sidebar, onboarding-\n * guide catalog, and any future surface that needs typeahead against\n * `/api/docs/search`). Wraps `<SearchInput>` with the lib's standard\n * `<DocSearchResultRow>` so the dropdown looks identical everywhere.\n *\n * ## Why a presentation component, not a \"search bar that owns its\n * own hook\"\n *\n * The data-fetching hook (`useDocSearch`) lives hub-side because it\n * depends on hub-only context (`useDocNavigation`, the rag-table-\n * config registry, the hub's `decideNewTab` helper). Moving the hook\n * would cascade ~5 more file migrations into the lib.\n *\n * Instead, the hook stays hub-side and callers pass its result into\n * this component as plain props. Both consumers shrink to ~5 lines.\n */\n\nimport type { ReactNode } from 'react'\nimport { SearchInput, type SearchResult } from '../../ui/search-input'\nimport { DocSearchResultRow } from './doc-search-result-row'\n\nexport interface DocSearchBarProps {\n placeholder: string\n query: string\n onQueryChange: (value: string) => void\n /** Hook-fetched results. Reuses the lib's `<SearchInput>` `SearchResult`\n * shape directly so callers don't translate. */\n results: SearchResult[]\n isLoading: boolean\n /** Result selection handler. Mirrors `<SearchInput>` — the second\n * `modifiers` argument is preserved so cmd-click / shift-click on\n * a result row still forces new-tab behavior. Hub `useDocSearch`\n * reads these to short-circuit to `window.open()`. */\n onResultSelect: (\n result: SearchResult,\n modifiers?: {\n metaKey?: boolean\n ctrlKey?: boolean\n shiftKey?: boolean\n altKey?: boolean\n button?: number\n },\n ) => void\n /** Lets the caller's hook force the dropdown open after a recent\n * internal action (e.g. result navigation). `undefined` falls back\n * to `<SearchInput>`'s built-in focus/hover heuristics. */\n showDropdown?: boolean\n /** Defaults to 2 — matches the existing data-room and onboarding-\n * guide consumers. Override only if a surface needs different\n * typeahead semantics. */\n minQueryLength?: number\n /** Defaults to 0 — both existing consumers debounce inside the\n * hook, not the input. */\n debounceMs?: number\n className?: string\n /** Optional row-renderer override. Defaults to the lib's standard\n * `<DocSearchResultRow>` (source icon + title + path breadcrumb).\n * Override only when a surface needs custom row chrome. */\n renderResult?: (result: SearchResult, isHighlighted: boolean) => ReactNode\n}\n\nexport function DocSearchBar({\n placeholder,\n query,\n onQueryChange,\n results,\n isLoading,\n onResultSelect,\n showDropdown,\n minQueryLength = 2,\n debounceMs = 0,\n className = 'w-full',\n renderResult,\n}: DocSearchBarProps) {\n return (\n <SearchInput\n placeholder={placeholder}\n value={query}\n onChange={onQueryChange}\n results={results}\n isLoading={isLoading}\n onResultSelect={onResultSelect}\n showDropdown={showDropdown || undefined}\n debounceMs={debounceMs}\n minQueryLength={minQueryLength}\n className={className}\n renderResult={\n renderResult ??\n ((result, isHighlighted) => (\n <DocSearchResultRow result={result} isHighlighted={isHighlighted} />\n ))\n }\n />\n )\n}\n","/**\n * Map RAG `/api/docs/search` wire results into the `<DocSearchBar>`\n * dropdown's row shape, collapsing entity-table rows into grouped\n * results so the dropdown lists ONE \"Cap Table (12 records)\" row\n * instead of 12 individual rows.\n *\n * Pure transform — no telemetry, no navigation, no React deps. Lifted\n * from the hub's `hooks/use-docs.ts:mapDocSearchResults` (the hub's\n * `traceCompose` call was hub-only telemetry and is intentionally\n * dropped — callers that want logging can wrap this helper).\n */\n\nimport type { SearchResult } from '../../ui/search-input'\nimport type { DocSearchResult } from './types'\n\n/** Source repos that should be collapsed into grouped results in the search bar.\n * Only financial tables (all rows link to the same admin page).\n * Content tables (blog, webinar, podcast, etc.) stay individual since each has a unique URL. */\nconst SEARCH_GROUP_REPOS = new Set([\n 'financial-cap-table',\n 'financial-kpis',\n 'financial-pnl',\n 'financial-balance-sheet',\n 'financial-cash-flow',\n])\n\nconst ENTITY_LABELS: Record<string, string> = {\n 'financial-cap-table': 'Cap Table',\n 'financial-kpis': 'Financial KPIs',\n 'financial-pnl': 'Profit & Loss',\n 'financial-balance-sheet': 'Balance Sheets',\n 'financial-cash-flow': 'Cash Flow',\n 'blog-posts': 'Blog Posts',\n 'product-releases': 'Product Releases',\n 'case-studies': 'Case Studies',\n webinars: 'Webinars',\n events: 'Events',\n podcasts: 'Podcasts',\n}\n\nexport function mapDocSearchResults(docs: DocSearchResult[]): SearchResult[] {\n const entityGroups = new Map<string, DocSearchResult[]>()\n // Track insertion order — groups appear where the FIRST row of that\n // repo appeared in the response.\n const order: Array<\n { type: 'entity'; repo: string } | { type: 'doc'; doc: DocSearchResult }\n > = []\n const seenRepos = new Set<string>()\n\n for (const doc of docs) {\n if (doc.sourceRepo && SEARCH_GROUP_REPOS.has(doc.sourceRepo)) {\n const group = entityGroups.get(doc.sourceRepo) || []\n group.push(doc)\n entityGroups.set(doc.sourceRepo, group)\n if (!seenRepos.has(doc.sourceRepo)) {\n seenRepos.add(doc.sourceRepo)\n order.push({ type: 'entity', repo: doc.sourceRepo })\n }\n } else {\n order.push({ type: 'doc', doc })\n }\n }\n\n const results: SearchResult[] = []\n for (const entry of order) {\n if (entry.type === 'entity') {\n const rows = entityGroups.get(entry.repo)!\n const label = ENTITY_LABELS[entry.repo] || entry.repo\n results.push({\n id: `group-${entry.repo}`,\n title: `${label} (${rows.length} ${rows.length === 1 ? 'record' : 'records'})`,\n path: rows[0].path,\n type: 'file',\n metadata: {\n documentType: rows[0].documentType,\n externalUrl: rows[0].externalUrl,\n sourceRepo: entry.repo,\n id: rows[0].entityId,\n isGroup: true,\n items: rows.map((r) => ({\n name: r.name,\n externalUrl: r.externalUrl,\n id: r.entityId,\n sourceRepo: r.sourceRepo,\n documentType: r.documentType,\n })),\n },\n })\n } else {\n const doc = entry.doc\n const isNonMarkdown = doc.documentType && doc.documentType !== 'markdown'\n results.push({\n id: doc.path,\n title: doc.name,\n description: isNonMarkdown ? doc.name : doc.snippet,\n path: doc.path,\n type: doc.type,\n metadata: {\n matchType: doc.matchType,\n ...(doc.documentType ? { documentType: doc.documentType } : {}),\n ...(doc.externalUrl ? { externalUrl: doc.externalUrl } : {}),\n ...(doc.targetPlatform != null\n ? { targetPlatform: doc.targetPlatform }\n : {}),\n ...(doc.sourceRepo ? { sourceRepo: doc.sourceRepo } : {}),\n ...(doc.entityId ? { id: doc.entityId } : {}),\n },\n })\n }\n }\n\n return results\n}\n","/**\n * Resolve what should happen when the user picks a search result.\n * Returns one of five typed actions so the caller is a single switch.\n *\n * Resolution order:\n * 1. `externalUrl` present → use `decideNewTab` to choose same-tab vs\n * new-tab against the row's `targetPlatform`.\n * 2. Row has `id` + `sourceRepo` + `documentType` → synth an Ask-AI\n * action (entity drill-in via primary key, no URL).\n * 3. Row has only `path` → legacy navigation fallback.\n * 4. Nothing actionable → noop.\n *\n * Lifted from the hub's `hooks/use-docs.ts:resolveSearchResultAction`.\n * Pure — no React, no telemetry.\n */\n\nimport type { SearchResult } from '../../ui/search-input'\nimport type { ChatRef } from '../../chat/chat-ref.types'\nimport { decideNewTab } from '../../chat/utils/decide-new-tab'\n\nexport type SearchResultAction =\n | { kind: 'navigate-same-tab'; href: string }\n | { kind: 'navigate-new-tab'; href: string }\n | { kind: 'ask-ai'; detail: { source: string; ref: ChatRef } }\n | { kind: 'route'; path: string }\n | { kind: 'noop' }\n\nexport function resolveSearchResultAction(\n result: SearchResult,\n source: string,\n runtimeMode?: 'host' | 'embed',\n): SearchResultAction {\n const meta = result.metadata ?? {}\n const externalUrl = meta.externalUrl as string | undefined\n if (externalUrl) {\n // Same pure helper `useNavLink` and `useUnifiedNav` call — single\n // decision rule across cards, chips, and autocomplete rows. Thread\n // the caller's `source` as `currentSource` so the platform-vs-\n // platform comparison matches the hub's pre-migration behavior.\n const targetPlatform = meta.targetPlatform as string | null | undefined\n const isNewTab = decideNewTab({\n href: externalUrl,\n targetPlatform,\n surface: 'useUnifiedNav',\n runtimeMode,\n currentSource: source,\n })\n return isNewTab\n ? { kind: 'navigate-new-tab', href: externalUrl }\n : { kind: 'navigate-same-tab', href: externalUrl }\n }\n const rowId = meta.id as string | undefined\n const sourceRepo = meta.sourceRepo as string | undefined\n const documentType = meta.documentType as string | undefined\n if (rowId && sourceRepo && documentType) {\n return {\n kind: 'ask-ai',\n detail: {\n source,\n ref: { type: documentType, id: rowId, title: result.title, url: null },\n },\n }\n }\n if (result.path) {\n return { kind: 'route', path: result.path }\n }\n return { kind: 'noop' }\n}\n","'use client'\n\n/**\n * `useDocSearch` — debounced RAG-search hook against `/api/docs/search`.\n *\n * Pure fetch + navigation glue. Embedders can mount this directly\n * (any host with a reverse-proxy that exposes `/api/docs/search` will\n * work). Hub callers wire it into the lib `<DocSearchBar>` for the\n * canonical typeahead dropdown.\n *\n * ## What moved from hub to lib\n *\n * Lifted from `multi-platform-hub/hooks/use-docs.ts:useDocSearch`. Two\n * hub-only concerns are now optional injection points instead of\n * direct imports:\n *\n * - `useDocNavigation()` (hub's in-page doc-tree swap) → optional\n * `onInPageSwap?: (path: string) => boolean` config callback. When\n * present and returns true, the hook treats a same-origin result\n * click as \"handled in-page\"; when absent or returns false, the\n * hook falls back to `onNavigate(path)` (`router.push` on hub,\n * `window.location.assign` on bare embedders).\n * - `traceCompose` (hub-only telemetry) → dropped. The lib has no\n * equivalent runtime-context yet; bring it back when there is one.\n *\n * Everything else (debounce, `useChatRuntime` for embed-mode short-\n * circuit, embed-shim router, the action-resolver + result-mapper) is\n * now lib-resident.\n */\n\nimport { useState, useEffect, useCallback } from 'react'\nimport { useRouter } from '../../../embed-shims'\nimport { useDebounce } from '../../../hooks/ui/use-debounce'\nimport { useChatRuntime } from '../../../contexts/chat-runtime-context'\nimport { contentFetch } from '../../../utils/embed-content-fetch'\nimport type { SearchResult } from '../../ui/search-input'\nimport {\n resolveExternalNavigation,\n stripSameOriginToPath,\n NEW_TAB_FEATURES,\n} from '../../chat/utils/chat-nav-resolution'\nimport type { DocSearchResult } from './types'\nimport { mapDocSearchResults } from './map-doc-search-results'\nimport { resolveSearchResultAction } from './resolve-search-result-action'\n\nexport interface UseDocSearchConfig {\n /** Discriminator passed to `/api/docs/search?source=` (e.g.\n * `'openframe'`). Embedders set it to whatever discriminator their\n * reverse-proxy expects. */\n source: string\n /** Base route prefix this search lives under (e.g. `'/onboarding-guides'`).\n * When a result's href starts with `${baseRoute}/`, the hook\n * attempts the optional in-page swap path before falling through\n * to a full nav. */\n baseRoute: string\n /** Imperative navigation fallback. Called when no override\n * (in-page swap, new-tab) applies. Hub callers pass\n * `(path) => router.push(path)`; embedders pass an equivalent. */\n onNavigate: (path: string) => void\n /** Optional `RagTableConfig.id` list to narrow the search to specific\n * tables (e.g. `['onboarding-guides']`). Forwarded to\n * `/api/docs/search?tableIds=…` which intersects with the source's\n * standing set. */\n tableIds?: string[]\n /** Optional in-page swap callback. When the result's href is under\n * `baseRoute` AND this callback returns true, the hook treats the\n * click as handled in-page (no router push). Hub's\n * `<DocumentationSection>` wires this to\n * `useDocNavigation().navigate(path)`. */\n onInPageSwap?: (path: string) => boolean\n /** Optional endpoint override. Defaults to `'/api/docs/search'`\n * (the hub's reverse-proxy route). Embedders with a different\n * path can override. */\n searchEndpoint?: string\n}\n\nexport function useDocSearch(config: UseDocSearchConfig) {\n const {\n source,\n baseRoute,\n onNavigate,\n tableIds,\n onInPageSwap,\n searchEndpoint,\n } = config\n const tableIdsKey = tableIds && tableIds.length > 0 ? tableIds.join(',') : ''\n\n const router = useRouter()\n // Optional chat-runtime read — when present and mode='embed' the\n // search-result row click short-circuits to a new-tab open against\n // the absolutized URL. Null/host preserves today's behavior.\n // Also used as the proxy-prefix fallback for `searchEndpoint`, matching\n // how tickets resolves `findTicketUrl`.\n const runtime = useChatRuntime()\n const resolvedSearchEndpoint =\n searchEndpoint ?? runtime?.endpoints.docsSearchUrl ?? '/api/docs/search'\n\n const [query, setQuery] = useState('')\n const [results, setResults] = useState<SearchResult[]>([])\n const [isFetching, setIsFetching] = useState(false)\n const debouncedQuery = useDebounce(query, 300)\n\n useEffect(() => {\n if (!debouncedQuery || debouncedQuery.trim().length < 2) {\n setResults([])\n setIsFetching(false)\n return\n }\n\n let cancelled = false\n\n async function fetchResults() {\n setIsFetching(true)\n try {\n const params = new URLSearchParams({\n q: debouncedQuery,\n source,\n limit: '10',\n })\n if (tableIdsKey) params.set('tableIds', tableIdsKey)\n\n const response = await contentFetch(`${resolvedSearchEndpoint}?${params.toString()}`)\n if (!response.ok) {\n throw new Error(`Search request failed: ${response.status}`)\n }\n\n const json = await response.json()\n\n if (!cancelled && json.success && Array.isArray(json.data)) {\n const mapped = mapDocSearchResults(json.data as DocSearchResult[])\n setResults(mapped)\n }\n } catch (error) {\n console.error('Doc search error:', error)\n if (!cancelled) {\n setResults([])\n }\n } finally {\n if (!cancelled) {\n setIsFetching(false)\n }\n }\n }\n\n fetchResults()\n\n return () => {\n cancelled = true\n }\n }, [debouncedQuery, source, tableIdsKey, resolvedSearchEndpoint])\n\n // Derived loading state — single source of truth for \"should the\n // dropdown show 'Loading...' instead of 'No results found'\":\n const isLoading =\n query.trim().length >= 2 && (query !== debouncedQuery || isFetching)\n\n // Track whether dropdown should stay open (external link opened in new tab).\n const [keepOpen, setKeepOpen] = useState(false)\n\n const handleResultSelect = useCallback(\n (\n result: SearchResult,\n modifiers?: {\n metaKey?: boolean\n ctrlKey?: boolean\n shiftKey?: boolean\n altKey?: boolean\n button?: number\n },\n ) => {\n const action = resolveSearchResultAction(\n result,\n source,\n runtime?.navigation.mode,\n )\n // Modifier / non-primary mouse click → force new tab regardless of\n // same-tab/new-tab decision. The dropdown row is a `<div>`, not an\n // `<a target=\"_blank\">`, so the browser doesn't background-tab\n // natively on cmd-click. Honor it explicitly here for parity with\n // the anchor-based surfaces (cards, chips, related-content). Plain\n // Enter from the keyboard passes `modifiers === undefined`.\n const wantsNewTab =\n modifiers &&\n (modifiers.metaKey ||\n modifiers.ctrlKey ||\n modifiers.shiftKey ||\n modifiers.altKey ||\n (typeof modifiers.button === 'number' && modifiers.button !== 0))\n switch (action.kind) {\n case 'navigate-same-tab': {\n // Embed-mode short-circuit — autocomplete row clicked while\n // the chat panel is hosted inside an embedding app.\n if (runtime?.navigation.mode === 'embed') {\n setKeepOpen(true)\n const targetPlatform =\n (result.metadata?.targetPlatform as string | null | undefined) ?? null\n resolveExternalNavigation({\n href: action.href,\n targetPlatform,\n runtime,\n }).open()\n return\n }\n if (wantsNewTab) {\n setKeepOpen(true)\n window.open(action.href, '_blank', NEW_TAB_FEATURES)\n return\n }\n // Same-origin click:\n // 1. If the href is under the current doc-tree's baseRoute AND\n // an `onInPageSwap` callback is wired AND returns true →\n // consider in-page swap handled.\n // 2. Otherwise → embed-shim `router.push()` (soft RSC nav on\n // Next.js hosts, window.location.assign on bare hosts).\n setKeepOpen(false)\n const path =\n baseRoute && action.href.startsWith(`${baseRoute}/`)\n ? action.href.slice(baseRoute.length + 1)\n : null\n if (path && onInPageSwap?.(path)) return\n router.push(stripSameOriginToPath(action.href))\n return\n }\n case 'navigate-new-tab':\n // Cross-origin (e.g. clicking a flamingo.run release from\n // product-hub) — open in a new tab. Keep dropdown open so the\n // user can pick another result without re-searching.\n setKeepOpen(true)\n window.open(action.href, '_blank', NEW_TAB_FEATURES)\n return\n case 'ask-ai':\n // Row is searchable-but-not-openable (cap_table positions,\n // financial-kpi snapshots, anything backed by\n // `resolveUrl: () => null`). Dispatch a CustomEvent that\n // GlobalAskAI listens for — opens chat + drills via\n // `entityIdFilter` (primary-key only, same as inline-card Ask).\n setKeepOpen(false)\n window.dispatchEvent(\n new CustomEvent('ask-ai:open-with-ref', { detail: action.detail }),\n )\n return\n case 'route':\n // Final fallback: legacy navigation by path. Hits when a row\n // has neither URL nor pk metadata — a mapper/API regression.\n setKeepOpen(false)\n onNavigate(action.path)\n return\n case 'noop':\n return\n }\n },\n [onNavigate, source, baseRoute, router, onInPageSwap, runtime],\n )\n\n // Reset keepOpen when query changes.\n useEffect(() => {\n setKeepOpen(false)\n }, [query])\n\n return {\n query,\n setQuery,\n results,\n isLoading,\n handleResultSelect,\n keepDropdownOpen: keepOpen,\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkLP3FQTCBcjs = require('./chunk-LP3FQTCB.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -10,7 +10,7 @@ var _chunkX7ECA7BOcjs = require('./chunk-X7ECA7BO.cjs');
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunk4FT3KQD3cjs = require('./chunk-4FT3KQD3.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
@@ -37,7 +37,7 @@ var _chunkT5KEAEOTcjs = require('./chunk-T5KEAEOT.cjs');
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _chunkR6PS3AXIcjs = require('./chunk-R6PS3AXI.cjs');
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
|
|
@@ -96,7 +96,7 @@ function TicketOpenForm({
|
|
|
96
96
|
}) {
|
|
97
97
|
const [subject, setSubject] = _react.useState.call(void 0, "");
|
|
98
98
|
const [content, setContent] = _react.useState.call(void 0, "");
|
|
99
|
-
const { attachments, readyAttachments, hasInflightUploads, addFiles, removeAttachment, clear } =
|
|
99
|
+
const { attachments, readyAttachments, hasInflightUploads, addFiles, removeAttachment, clear } = _chunkR6PS3AXIcjs.useChatAttachments.call(void 0, );
|
|
100
100
|
const trimmedSubject = subject.trim();
|
|
101
101
|
const trimmedContent = content.trim();
|
|
102
102
|
const overCap = content.length > TICKET_TEXT_MAX_CHARS;
|
|
@@ -116,7 +116,7 @@ function TicketOpenForm({
|
|
|
116
116
|
clear();
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
119
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkR6PS3AXIcjs.Card, { className: "p-6", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: handleSubmit, className: "flex flex-col md:flex-row gap-6", children: [
|
|
120
120
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex-1 min-w-0 md:max-w-md", children: [
|
|
121
121
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "text-2xl font-semibold text-ods-text-primary mb-2", children: "Need Support?" }),
|
|
122
122
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-ods-text-secondary text-sm", children: "Can't find what you're looking for? Submit a support ticket below \u2014 we'll follow up shortly." }),
|
|
@@ -155,7 +155,7 @@ function TicketOpenForm({
|
|
|
155
155
|
}
|
|
156
156
|
),
|
|
157
157
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
158
|
-
|
|
158
|
+
_chunkR6PS3AXIcjs.Textarea,
|
|
159
159
|
{
|
|
160
160
|
id: "ticket-content",
|
|
161
161
|
placeholder: "Describe your issue or question in detail...",
|
|
@@ -179,7 +179,7 @@ function TicketOpenForm({
|
|
|
179
179
|
)
|
|
180
180
|
] }),
|
|
181
181
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
182
|
-
|
|
182
|
+
_chunkR6PS3AXIcjs.ChatAttachmentChipStrip,
|
|
183
183
|
{
|
|
184
184
|
attachments,
|
|
185
185
|
onRemove: removeAttachment,
|
|
@@ -188,7 +188,7 @@ function TicketOpenForm({
|
|
|
188
188
|
),
|
|
189
189
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-between gap-3", children: [
|
|
190
190
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
191
|
-
|
|
191
|
+
_chunkR6PS3AXIcjs.ChatAttachmentAddButton,
|
|
192
192
|
{
|
|
193
193
|
attachmentsEnabled: !supportSystemDown,
|
|
194
194
|
attachmentsCount: attachments.length,
|
|
@@ -226,7 +226,7 @@ var _usesticktobottom = require('use-stick-to-bottom');
|
|
|
226
226
|
|
|
227
227
|
var LIST_ENGAGEMENTS_ENDPOINT = "/api/chat/agent/list-engagements";
|
|
228
228
|
function useTicketEngagements(externalTicketId, enabled = true, refetchInterval = false) {
|
|
229
|
-
const identity =
|
|
229
|
+
const identity = _chunkR6PS3AXIcjs.useChatIdentity.call(void 0, );
|
|
230
230
|
const identityKey = _nullishCoalesce(_optionalChain([identity, 'access', _2 => _2.user, 'optionalAccess', _3 => _3.email]), () => ( "anon"));
|
|
231
231
|
const listEngagementsEndpoint = _nullishCoalesce(_chunk3KEBI6TPcjs.useRequiredChatRuntime.call(void 0, ).endpoints.listEngagementsUrl, () => ( LIST_ENGAGEMENTS_ENDPOINT));
|
|
232
232
|
const fetchable = enabled && !!externalTicketId && !externalTicketId.startsWith("temp-");
|
|
@@ -308,7 +308,7 @@ function TicketLinkedDeliveryCard({
|
|
|
308
308
|
{
|
|
309
309
|
className: `rounded-md border border-ods-border bg-ods-bg overflow-hidden ${_nullishCoalesce(className, () => ( ""))}`,
|
|
310
310
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
311
|
-
|
|
311
|
+
_chunk4FT3KQD3cjs.DeliveryRow,
|
|
312
312
|
{
|
|
313
313
|
item,
|
|
314
314
|
href: clickup.delivery_href,
|
|
@@ -332,7 +332,7 @@ function TicketReplyComposer({
|
|
|
332
332
|
}) {
|
|
333
333
|
const [resolution, setResolution] = _react.useState.call(void 0, "");
|
|
334
334
|
const [closeDialogOpen, setCloseDialogOpen] = _react.useState.call(void 0, false);
|
|
335
|
-
const attachments =
|
|
335
|
+
const attachments = _chunkR6PS3AXIcjs.useChatAttachments.call(void 0, );
|
|
336
336
|
const ticketRef = { id: ticket.id, external_id: ticket.external_id };
|
|
337
337
|
const hasReadyFiles = attachments.readyAttachments.length > 0;
|
|
338
338
|
const handleSend = _react.useCallback.call(void 0,
|
|
@@ -360,7 +360,7 @@ function TicketReplyComposer({
|
|
|
360
360
|
const disabled = busy || supportSystemDown;
|
|
361
361
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-2", children: [
|
|
362
362
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
363
|
-
|
|
363
|
+
_chunkR6PS3AXIcjs.ChatAttachmentChipStrip,
|
|
364
364
|
{
|
|
365
365
|
attachments: attachments.attachments,
|
|
366
366
|
onRemove: attachments.removeAttachment,
|
|
@@ -369,7 +369,7 @@ function TicketReplyComposer({
|
|
|
369
369
|
}
|
|
370
370
|
),
|
|
371
371
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
372
|
-
|
|
372
|
+
_chunkR6PS3AXIcjs.ChatInput,
|
|
373
373
|
{
|
|
374
374
|
fullWidth: true,
|
|
375
375
|
autoFocus: true,
|
|
@@ -383,7 +383,7 @@ function TicketReplyComposer({
|
|
|
383
383
|
),
|
|
384
384
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2 w-full", children: [
|
|
385
385
|
!supportSystemDown && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
386
|
-
|
|
386
|
+
_chunkR6PS3AXIcjs.ChatAttachmentAddButton,
|
|
387
387
|
{
|
|
388
388
|
attachmentsEnabled: true,
|
|
389
389
|
attachmentsCount: attachments.attachments.length,
|
|
@@ -406,13 +406,13 @@ function TicketReplyComposer({
|
|
|
406
406
|
}
|
|
407
407
|
)
|
|
408
408
|
] }),
|
|
409
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
410
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
411
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
412
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
409
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkR6PS3AXIcjs.AlertDialog, { open: closeDialogOpen, onOpenChange: setCloseDialogOpen, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkR6PS3AXIcjs.AlertDialogContent, { className: "bg-ods-card border-ods-border", children: [
|
|
410
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkR6PS3AXIcjs.AlertDialogHeader, { children: [
|
|
411
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkR6PS3AXIcjs.AlertDialogTitle, { className: "text-ods-text-primary", children: "Close this ticket?" }),
|
|
412
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkR6PS3AXIcjs.AlertDialogDescription, { className: "text-ods-text-secondary", children: "Add an optional resolution note below. You can reopen the ticket later if needed." })
|
|
413
413
|
] }),
|
|
414
414
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
415
|
-
|
|
415
|
+
_chunkR6PS3AXIcjs.Textarea,
|
|
416
416
|
{
|
|
417
417
|
value: resolution,
|
|
418
418
|
onChange: (e) => setResolution(e.target.value),
|
|
@@ -422,9 +422,9 @@ function TicketReplyComposer({
|
|
|
422
422
|
className: "mt-2"
|
|
423
423
|
}
|
|
424
424
|
),
|
|
425
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
425
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkR6PS3AXIcjs.AlertDialogFooter, { children: [
|
|
426
426
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
427
|
-
|
|
427
|
+
_chunkR6PS3AXIcjs.AlertDialogCancel,
|
|
428
428
|
{
|
|
429
429
|
disabled: busy,
|
|
430
430
|
className: "bg-transparent border-ods-border text-ods-text-primary hover:bg-ods-border",
|
|
@@ -432,7 +432,7 @@ function TicketReplyComposer({
|
|
|
432
432
|
}
|
|
433
433
|
),
|
|
434
434
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
435
|
-
|
|
435
|
+
_chunkR6PS3AXIcjs.AlertDialogAction,
|
|
436
436
|
{
|
|
437
437
|
onClick: () => void confirmClose(),
|
|
438
438
|
disabled: busy,
|
|
@@ -502,7 +502,7 @@ var TICKET_FEED_HEIGHT = "h-[60vh] md:h-[420px]";
|
|
|
502
502
|
var TICKET_FEED_INNER = "flex flex-col gap-4 md:gap-6 px-4 md:px-6 py-4 md:py-6";
|
|
503
503
|
var TICKET_FEED_SKELETON_ROWS = 6;
|
|
504
504
|
function TicketTimelinePanel({ ticket }) {
|
|
505
|
-
const identity =
|
|
505
|
+
const identity = _chunkR6PS3AXIcjs.useChatIdentity.call(void 0, );
|
|
506
506
|
const externalId = isOptimistic(ticket) ? null : ticket.external_id;
|
|
507
507
|
const { engagements, isLoading } = useTicketEngagements(
|
|
508
508
|
externalId,
|
|
@@ -522,11 +522,11 @@ function TicketTimelinePanel({ ticket }) {
|
|
|
522
522
|
const customerName = (isViewerTheCustomer ? viewerName : null) || ticketCustomerName || viewerName || _optionalChain([identity, 'access', _19 => _19.user, 'optionalAccess', _20 => _20.email]) || "You";
|
|
523
523
|
const customerAvatar = isViewerTheCustomer ? _nullishCoalesce(_optionalChain([identity, 'access', _21 => _21.user, 'optionalAccess', _22 => _22.avatarUrl]), () => ( void 0)) : void 0;
|
|
524
524
|
if (isLoading) {
|
|
525
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `${TICKET_FEED_FRAME} ${TICKET_FEED_HEIGHT}`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: TICKET_FEED_INNER, children: Array.from({ length: TICKET_FEED_SKELETON_ROWS }, (_, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
525
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `${TICKET_FEED_FRAME} ${TICKET_FEED_HEIGHT}`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: TICKET_FEED_INNER, children: Array.from({ length: TICKET_FEED_SKELETON_ROWS }, (_, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkR6PS3AXIcjs.ChatMessageRowSkeleton, {}, i)) }) });
|
|
526
526
|
}
|
|
527
527
|
if (bodyTurns.length === 0 && engagements.length === 0) {
|
|
528
528
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
529
|
-
|
|
529
|
+
_chunk4FT3KQD3cjs.EmptyState,
|
|
530
530
|
{
|
|
531
531
|
type: "generic",
|
|
532
532
|
title: "No conversation yet",
|
|
@@ -541,7 +541,7 @@ function TicketTimelinePanel({ ticket }) {
|
|
|
541
541
|
const isResolution = turn.startsWith("[Resolution]");
|
|
542
542
|
const text = isResolution ? turn.replace(/^\[Resolution\]\s*/, "") : turn;
|
|
543
543
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
544
|
-
|
|
544
|
+
_chunkR6PS3AXIcjs.ChatMessageRow,
|
|
545
545
|
{
|
|
546
546
|
displayName: customerName,
|
|
547
547
|
avatarUrl: customerAvatar,
|
|
@@ -570,13 +570,13 @@ function TicketTimelinePanel({ ticket }) {
|
|
|
570
570
|
}
|
|
571
571
|
const engAttachments = mapEngagementAttachments(eng.attachments);
|
|
572
572
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
573
|
-
|
|
573
|
+
_chunkR6PS3AXIcjs.ChatMessageRow,
|
|
574
574
|
{
|
|
575
575
|
displayName: author,
|
|
576
576
|
avatarUrl: avatarSrc,
|
|
577
|
-
timeLabel: eng.createdAt ?
|
|
577
|
+
timeLabel: eng.createdAt ? _chunkR6PS3AXIcjs.formatRelativeTime.call(void 0, eng.createdAt) : null,
|
|
578
578
|
body: stripAttachmentsPreamble(_nullishCoalesce(eng.body, () => ( ""))),
|
|
579
|
-
footer: engAttachments.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mt-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
579
|
+
footer: engAttachments.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mt-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkR6PS3AXIcjs.TicketAttachmentsList, { attachments: engAttachments, size: "compact" }) }) : null
|
|
580
580
|
},
|
|
581
581
|
eng.id
|
|
582
582
|
);
|
|
@@ -664,7 +664,7 @@ function AssignedAgentRow({
|
|
|
664
664
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-ods-text-secondary uppercase tracking-wider font-medium", children: "Assigned to" }),
|
|
665
665
|
displayLabel ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1.5 text-ods-text-primary font-medium", children: [
|
|
666
666
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
667
|
-
|
|
667
|
+
_chunkR6PS3AXIcjs.SquareAvatar,
|
|
668
668
|
{
|
|
669
669
|
size: "sm",
|
|
670
670
|
variant: "round",
|
|
@@ -722,7 +722,7 @@ function TicketRow({
|
|
|
722
722
|
// so the badge accurately reflects "Closed" with a checkmark.
|
|
723
723
|
statusLabel: _nullishCoalesce(ticket.pipeline_stage_label, () => ( void 0)),
|
|
724
724
|
category: _nullishCoalesce(ticket.customer_company, () => ( void 0)),
|
|
725
|
-
timeAgo: ticket.hubspot_updated_at ?
|
|
725
|
+
timeAgo: ticket.hubspot_updated_at ? _chunkR6PS3AXIcjs.formatRelativeTime.call(void 0, ticket.hubspot_updated_at) : void 0,
|
|
726
726
|
// Linked-work chip: surfaced whenever the ticket has a linked
|
|
727
727
|
// ClickUp task. Uses the linked task's own status so the chip text
|
|
728
728
|
// reads "Working" / "Waiting on version release" / etc. — useful
|
|
@@ -737,7 +737,7 @@ function TicketRow({
|
|
|
737
737
|
className: "border-b border-ods-border last:border-b-0",
|
|
738
738
|
children: [
|
|
739
739
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
740
|
-
|
|
740
|
+
_chunkR6PS3AXIcjs.ChatTicketItem,
|
|
741
741
|
{
|
|
742
742
|
ticket: tileData,
|
|
743
743
|
onClick: optimistic ? void 0 : handleClick,
|
|
@@ -1307,13 +1307,13 @@ function resolveErrorCode(bodyCode, status) {
|
|
|
1307
1307
|
// src/components/tickets/ticket-center.tsx
|
|
1308
1308
|
|
|
1309
1309
|
function TicketCenter({ toast: toast2 = _chunk743FCO64cjs.toast } = {}) {
|
|
1310
|
-
const identity =
|
|
1310
|
+
const identity = _chunkR6PS3AXIcjs.useChatIdentity.call(void 0, );
|
|
1311
1311
|
if (identity.isLoading) {
|
|
1312
1312
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TicketCenterSkeleton, {});
|
|
1313
1313
|
}
|
|
1314
1314
|
if (identity.authTier === "anon" || !_optionalChain([identity, 'access', _58 => _58.user, 'optionalAccess', _59 => _59.email])) {
|
|
1315
1315
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1316
|
-
|
|
1316
|
+
_chunk4FT3KQD3cjs.EmptyState,
|
|
1317
1317
|
{
|
|
1318
1318
|
type: "generic",
|
|
1319
1319
|
title: "Sign in to manage tickets",
|
|
@@ -1384,7 +1384,7 @@ function TicketCenterAuthed({
|
|
|
1384
1384
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-3 text-xs text-ods-text-secondary", children: [
|
|
1385
1385
|
lastUpdatedAt && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
|
|
1386
1386
|
"Updated ",
|
|
1387
|
-
|
|
1387
|
+
_chunkR6PS3AXIcjs.formatRelativeTime.call(void 0, new Date(lastUpdatedAt))
|
|
1388
1388
|
] }),
|
|
1389
1389
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1390
1390
|
_chunkNYIZVI4Icjs.Button,
|
|
@@ -1400,18 +1400,18 @@ function TicketCenterAuthed({
|
|
|
1400
1400
|
)
|
|
1401
1401
|
] })
|
|
1402
1402
|
] }),
|
|
1403
|
-
isLoading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TicketListSkeleton, {}) : merged.length === 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1404
|
-
|
|
1403
|
+
isLoading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TicketListSkeleton, {}) : merged.length === 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkR6PS3AXIcjs.Card, { className: "p-6", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1404
|
+
_chunk4FT3KQD3cjs.EmptyState,
|
|
1405
1405
|
{
|
|
1406
1406
|
type: "generic",
|
|
1407
1407
|
title: "No tickets yet",
|
|
1408
1408
|
description: "Open one above to start the conversation.",
|
|
1409
1409
|
showCTA: false
|
|
1410
1410
|
}
|
|
1411
|
-
) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1411
|
+
) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkR6PS3AXIcjs.Card, { className: "overflow-hidden", children: merged.map((ticket) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1412
1412
|
TicketRow,
|
|
1413
1413
|
{
|
|
1414
|
-
id:
|
|
1414
|
+
id: _chunkR6PS3AXIcjs.devSectionAnchorId.call(void 0, "ticket", ticket.external_id),
|
|
1415
1415
|
ticket,
|
|
1416
1416
|
expanded: expandedTicketId === ticket.id,
|
|
1417
1417
|
onToggle: toggleRow,
|
|
@@ -1429,7 +1429,7 @@ function TicketCenterAuthed({
|
|
|
1429
1429
|
}
|
|
1430
1430
|
function TicketCenterSkeleton() {
|
|
1431
1431
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-6", children: [
|
|
1432
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1432
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkR6PS3AXIcjs.Card, { className: "p-6", children: [
|
|
1433
1433
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNYIZVI4Icjs.Skeleton, { className: "h-7 w-48 mb-4" }),
|
|
1434
1434
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNYIZVI4Icjs.Skeleton, { className: "h-10 w-full mb-3" }),
|
|
1435
1435
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNYIZVI4Icjs.Skeleton, { className: "h-24 w-full" })
|
|
@@ -1438,7 +1438,7 @@ function TicketCenterSkeleton() {
|
|
|
1438
1438
|
] });
|
|
1439
1439
|
}
|
|
1440
1440
|
function TicketListSkeleton() {
|
|
1441
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1441
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkR6PS3AXIcjs.Card, { className: "overflow-hidden", children: [0, 1, 2].map((i) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "h-20 px-4 flex items-center gap-4 border-b border-ods-border last:border-b-0", children: [
|
|
1442
1442
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex-1 flex flex-col gap-2", children: [
|
|
1443
1443
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNYIZVI4Icjs.Skeleton, { className: "h-4 w-2/3" }),
|
|
1444
1444
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNYIZVI4Icjs.Skeleton, { className: "h-3 w-full" })
|
|
@@ -1451,7 +1451,7 @@ function TicketListSkeleton() {
|
|
|
1451
1451
|
// src/components/tickets/help-center-list.tsx
|
|
1452
1452
|
|
|
1453
1453
|
|
|
1454
|
-
|
|
1454
|
+
_chunk4FT3KQD3cjs.init_unified_pagination.call(void 0, );
|
|
1455
1455
|
|
|
1456
1456
|
// src/components/tickets/help-center-card.tsx
|
|
1457
1457
|
|
|
@@ -1473,7 +1473,7 @@ function HelpCenterCard({
|
|
|
1473
1473
|
const optimistic = isOptimistic(ticket);
|
|
1474
1474
|
const rawStatus = (_nullishCoalesce(ticket.status, () => ( "OPEN"))).toUpperCase();
|
|
1475
1475
|
const priority = (_nullishCoalesce(ticket.priority, () => ( ""))).toUpperCase();
|
|
1476
|
-
const relativeUpdated = ticket.hubspot_updated_at ?
|
|
1476
|
+
const relativeUpdated = ticket.hubspot_updated_at ? _chunkR6PS3AXIcjs.formatRelativeTime.call(void 0, ticket.hubspot_updated_at) : "recently";
|
|
1477
1477
|
const title = (ticket.subject || "").trim() || "(untitled)";
|
|
1478
1478
|
const subtitle = `UPDATED ${relativeUpdated}, #${ticket.external_id || "\u2014"}${ticket.pipeline_stage_label ? `, ${ticket.pipeline_stage_label}` : ""}`;
|
|
1479
1479
|
const description = _nullishCoalesce(_nullishCoalesce(ticket.preview, () => ( ticket.body)), () => ( ""));
|
|
@@ -1494,16 +1494,16 @@ function HelpCenterCard({
|
|
|
1494
1494
|
}, [isExpanded]);
|
|
1495
1495
|
const rightBadges = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1496
1496
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1497
|
-
|
|
1497
|
+
_chunkR6PS3AXIcjs.StatusBadge,
|
|
1498
1498
|
{
|
|
1499
1499
|
text: rawStatus,
|
|
1500
|
-
colorScheme:
|
|
1500
|
+
colorScheme: _chunkR6PS3AXIcjs.getStatusColorScheme.call(void 0, rawStatus),
|
|
1501
1501
|
variant: "card",
|
|
1502
1502
|
className: "border border-ods-border"
|
|
1503
1503
|
}
|
|
1504
1504
|
),
|
|
1505
1505
|
priority && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1506
|
-
|
|
1506
|
+
_chunkR6PS3AXIcjs.StatusBadge,
|
|
1507
1507
|
{
|
|
1508
1508
|
text: priority,
|
|
1509
1509
|
colorScheme: mapPriorityScheme(priority),
|
|
@@ -1531,7 +1531,7 @@ function HelpCenterCard({
|
|
|
1531
1531
|
"aria-controls": isExpanded ? `help-center-drawer-${ticket.id}` : void 0,
|
|
1532
1532
|
className: "w-full text-left p-[12px] md:p-[16px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ods-accent focus-visible:ring-inset disabled:cursor-default",
|
|
1533
1533
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1534
|
-
|
|
1534
|
+
_chunk4FT3KQD3cjs.DevCardRowContent,
|
|
1535
1535
|
{
|
|
1536
1536
|
title,
|
|
1537
1537
|
subtitle,
|
|
@@ -1606,7 +1606,7 @@ function HelpCenterCreateForm({
|
|
|
1606
1606
|
const [subject, setSubject] = _react.useState.call(void 0, "");
|
|
1607
1607
|
const [subjectError, setSubjectError] = _react.useState.call(void 0, null);
|
|
1608
1608
|
const subjectField = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
|
|
1609
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1609
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkR6PS3AXIcjs.Label, { htmlFor: "help-center-subject", children: [
|
|
1610
1610
|
"Subject",
|
|
1611
1611
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-ods-accent", children: "*" })
|
|
1612
1612
|
] }),
|
|
@@ -1638,7 +1638,7 @@ function HelpCenterCreateForm({
|
|
|
1638
1638
|
)
|
|
1639
1639
|
] });
|
|
1640
1640
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1641
|
-
|
|
1641
|
+
_chunkLP3FQTCBcjs.ContactForm,
|
|
1642
1642
|
{
|
|
1643
1643
|
title: "Open a new ticket",
|
|
1644
1644
|
footerText: "The support team typically responds within one business day.",
|
|
@@ -1676,7 +1676,7 @@ function HelpCenterCreateForm({
|
|
|
1676
1676
|
// src/components/tickets/help-center-list.tsx
|
|
1677
1677
|
|
|
1678
1678
|
function HelpCenterList({ toast: toast2 = _chunk743FCO64cjs.toast, backButton, title, shell } = {}) {
|
|
1679
|
-
const identity =
|
|
1679
|
+
const identity = _chunkR6PS3AXIcjs.useChatIdentity.call(void 0, );
|
|
1680
1680
|
const searchParams = _chunkG7UE6RKVcjs.useSearchParams.call(void 0, );
|
|
1681
1681
|
const router = _chunkG7UE6RKVcjs.useRouter.call(void 0, );
|
|
1682
1682
|
const pathname = _chunkG7UE6RKVcjs.usePathname.call(void 0, );
|
|
@@ -1687,20 +1687,20 @@ function HelpCenterList({ toast: toast2 = _chunk743FCO64cjs.toast, backButton, t
|
|
|
1687
1687
|
const page = Number.isFinite(rawPage) && rawPage > 0 ? Math.floor(rawPage) : 1;
|
|
1688
1688
|
if (identity.isLoading) {
|
|
1689
1689
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1690
|
-
|
|
1690
|
+
_chunk4FT3KQD3cjs.DevSectionPage,
|
|
1691
1691
|
{
|
|
1692
1692
|
sectionKey: "tickets",
|
|
1693
1693
|
backButton,
|
|
1694
1694
|
title,
|
|
1695
1695
|
shell,
|
|
1696
1696
|
preControls: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HelpCenterCreateFormSkeleton, {}),
|
|
1697
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1697
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4FT3KQD3cjs.DevCardRowSkeletonList, {})
|
|
1698
1698
|
}
|
|
1699
1699
|
);
|
|
1700
1700
|
}
|
|
1701
1701
|
if (identity.authTier === "anon" || !_optionalChain([identity, 'access', _60 => _60.user, 'optionalAccess', _61 => _61.email])) {
|
|
1702
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1703
|
-
|
|
1702
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4FT3KQD3cjs.DevSectionPage, { sectionKey: "tickets", backButton, title, shell, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1703
|
+
_chunk4FT3KQD3cjs.EmptyState,
|
|
1704
1704
|
{
|
|
1705
1705
|
type: "generic",
|
|
1706
1706
|
title: "Sign in to manage tickets",
|
|
@@ -1832,15 +1832,15 @@ function HelpCenterListAuthed({
|
|
|
1832
1832
|
] }),
|
|
1833
1833
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNYIZVI4Icjs.Button, { type: "button", variant: "accent", onClick: () => refetch(), children: "Retry" })
|
|
1834
1834
|
] }),
|
|
1835
|
-
!error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-full", children: isLoading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1835
|
+
!error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-full", children: isLoading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4FT3KQD3cjs.DevCardRowSkeletonList, {}) : !hasResults && isFetching ? (
|
|
1836
1836
|
// Bridge state — background refetch in flight and the
|
|
1837
1837
|
// optimistic placeholder was just removed by the mutation
|
|
1838
1838
|
// callback. Without this branch "No tickets yet" would flash
|
|
1839
1839
|
// for ~50ms between `removeOptimistic` and the server
|
|
1840
1840
|
// response landing.
|
|
1841
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1841
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4FT3KQD3cjs.DevCardRowSkeletonList, { rows: 1 })
|
|
1842
1842
|
) : !hasResults ? hasActiveFilters ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1843
|
-
|
|
1843
|
+
_chunk4FT3KQD3cjs.EmptyState,
|
|
1844
1844
|
{
|
|
1845
1845
|
type: "search",
|
|
1846
1846
|
title: "No tickets found",
|
|
@@ -1855,7 +1855,7 @@ function HelpCenterListAuthed({
|
|
|
1855
1855
|
}
|
|
1856
1856
|
}
|
|
1857
1857
|
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1858
|
-
|
|
1858
|
+
_chunk4FT3KQD3cjs.EmptyState,
|
|
1859
1859
|
{
|
|
1860
1860
|
type: "generic",
|
|
1861
1861
|
title: "No tickets yet",
|
|
@@ -1874,7 +1874,7 @@ function HelpCenterListAuthed({
|
|
|
1874
1874
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-ods-card border border-ods-border rounded-[6px] overflow-clip w-full", children: merged.map((ticket) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1875
1875
|
HelpCenterCard,
|
|
1876
1876
|
{
|
|
1877
|
-
id:
|
|
1877
|
+
id: _chunkR6PS3AXIcjs.devSectionAnchorId.call(void 0, "ticket", ticket.external_id),
|
|
1878
1878
|
ticket,
|
|
1879
1879
|
expanded: expandedTicketId === ticket.id,
|
|
1880
1880
|
onToggle: toggleRow,
|
|
@@ -1890,9 +1890,9 @@ function HelpCenterListAuthed({
|
|
|
1890
1890
|
ticket.id
|
|
1891
1891
|
)) })
|
|
1892
1892
|
) }),
|
|
1893
|
-
!error && totalPages > 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1893
|
+
!error && totalPages > 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4FT3KQD3cjs.UnifiedPagination, { currentPage: page, totalPages })
|
|
1894
1894
|
] });
|
|
1895
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1895
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4FT3KQD3cjs.DevSectionPage, { sectionKey: "tickets", backButton, title, shell, preControls: form, children: body });
|
|
1896
1896
|
}
|
|
1897
1897
|
|
|
1898
1898
|
|
|
@@ -1913,4 +1913,4 @@ function HelpCenterListAuthed({
|
|
|
1913
1913
|
|
|
1914
1914
|
|
|
1915
1915
|
exports.isOptimistic = isOptimistic; exports.TOAST_COPY = TOAST_COPY; exports.TicketOpenForm = TicketOpenForm; exports.useTicketEngagements = useTicketEngagements; exports.TicketLinkedDeliveryCard = TicketLinkedDeliveryCard; exports.TicketReplyComposer = TicketReplyComposer; exports.TicketDetailDrawer = TicketDetailDrawer; exports.TicketRow = TicketRow; exports.useTicketsList = useTicketsList; exports.useTicketActions = useTicketActions; exports.mapTicketActionError = mapTicketActionError; exports.TicketCenter = TicketCenter; exports.HelpCenterCard = HelpCenterCard; exports.HelpCenterCreateFormSkeleton = HelpCenterCreateFormSkeleton; exports.HelpCenterCreateForm = HelpCenterCreateForm; exports.HelpCenterList = HelpCenterList;
|
|
1916
|
-
//# sourceMappingURL=chunk-
|
|
1916
|
+
//# sourceMappingURL=chunk-DRSAMA27.cjs.map
|