@flamingo-stack/openframe-frontend-core 0.0.618 → 0.0.619-snapshot.20260913210426

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 (171) hide show
  1. package/dist/{chunk-GXUGYZ6H.js → chunk-43JQ3SJS.js} +483 -455
  2. package/dist/chunk-43JQ3SJS.js.map +1 -0
  3. package/dist/{chunk-EJGZIYC7.cjs → chunk-4NKJRJU4.cjs} +6 -6
  4. package/dist/{chunk-EJGZIYC7.cjs.map → chunk-4NKJRJU4.cjs.map} +1 -1
  5. package/dist/{chunk-WVRXDGGP.js → chunk-4SH2L3HO.js} +3 -3
  6. package/dist/{chunk-YCZBCEQO.js → chunk-5AB6QLIQ.js} +4 -4
  7. package/dist/{chunk-VIBREYUK.cjs → chunk-5G3L6327.cjs} +3 -3
  8. package/dist/{chunk-VIBREYUK.cjs.map → chunk-5G3L6327.cjs.map} +1 -1
  9. package/dist/{chunk-BXNSKTEG.cjs → chunk-5NYMTTUB.cjs} +65 -65
  10. package/dist/{chunk-BXNSKTEG.cjs.map → chunk-5NYMTTUB.cjs.map} +1 -1
  11. package/dist/{chunk-GBON2OCG.js → chunk-5WGOAJ4B.js} +3 -2
  12. package/dist/chunk-5WGOAJ4B.js.map +1 -0
  13. package/dist/{chunk-FCN2HN6Q.js → chunk-7FPWMX26.js} +45 -8
  14. package/dist/chunk-7FPWMX26.js.map +1 -0
  15. package/dist/{chunk-GFWKEWEH.js → chunk-BR5PVFWG.js} +4 -4
  16. package/dist/{chunk-GD7CV2JI.js → chunk-CKH4SLD5.js} +8 -8
  17. package/dist/{chunk-E2EGTHYA.cjs → chunk-CS7MVDUF.cjs} +77 -49
  18. package/dist/chunk-CS7MVDUF.cjs.map +1 -0
  19. package/dist/{chunk-MOC7JLEP.cjs → chunk-CSQZMK3O.cjs} +88 -88
  20. package/dist/{chunk-MOC7JLEP.cjs.map → chunk-CSQZMK3O.cjs.map} +1 -1
  21. package/dist/{chunk-UUXLDIK3.js → chunk-DJVN7IW6.js} +3 -3
  22. package/dist/{chunk-UXOOVP77.cjs → chunk-DV7IBKJI.cjs} +4 -4
  23. package/dist/{chunk-UXOOVP77.cjs.map → chunk-DV7IBKJI.cjs.map} +1 -1
  24. package/dist/{chunk-G7NEMLNW.cjs → chunk-ECOJUPXO.cjs} +12 -12
  25. package/dist/{chunk-G7NEMLNW.cjs.map → chunk-ECOJUPXO.cjs.map} +1 -1
  26. package/dist/{chunk-N6CULJYR.cjs → chunk-EG4IKWY4.cjs} +3 -2
  27. package/dist/{chunk-N6CULJYR.cjs.map → chunk-EG4IKWY4.cjs.map} +1 -1
  28. package/dist/{chunk-U6B3MM4U.cjs → chunk-FCMCCPQI.cjs} +20 -20
  29. package/dist/{chunk-U6B3MM4U.cjs.map → chunk-FCMCCPQI.cjs.map} +1 -1
  30. package/dist/{chunk-IW746HJ7.js → chunk-FHR2JU2J.js} +2 -2
  31. package/dist/{chunk-VRN5YYD3.js → chunk-G6LYVK64.js} +3 -3
  32. package/dist/{chunk-2DTZXXY3.js → chunk-GMBETTTE.js} +5 -5
  33. package/dist/{chunk-NUU5ZEEG.js → chunk-GZFVTFMU.js} +4 -4
  34. package/dist/{chunk-7ZEQMFP3.cjs → chunk-HC6FZJMM.cjs} +58 -38
  35. package/dist/chunk-HC6FZJMM.cjs.map +1 -0
  36. package/dist/{chunk-IDMEC4ZK.cjs → chunk-IVFU4RFK.cjs} +22 -22
  37. package/dist/{chunk-IDMEC4ZK.cjs.map → chunk-IVFU4RFK.cjs.map} +1 -1
  38. package/dist/{chunk-5P74E24M.js → chunk-KLAL4FTU.js} +5 -5
  39. package/dist/{chunk-UKFBPJBK.cjs → chunk-KMWB52KV.cjs} +29 -29
  40. package/dist/{chunk-UKFBPJBK.cjs.map → chunk-KMWB52KV.cjs.map} +1 -1
  41. package/dist/{chunk-ANMD7SM4.js → chunk-LNF5W3QJ.js} +3 -3
  42. package/dist/{chunk-XUNFDRMP.js → chunk-POSO6GYC.js} +4 -4
  43. package/dist/{chunk-BGDYSUA2.cjs → chunk-PTANIWHA.cjs} +11 -11
  44. package/dist/{chunk-BGDYSUA2.cjs.map → chunk-PTANIWHA.cjs.map} +1 -1
  45. package/dist/{chunk-RDEFB354.cjs → chunk-RBV63HZO.cjs} +6 -6
  46. package/dist/{chunk-RDEFB354.cjs.map → chunk-RBV63HZO.cjs.map} +1 -1
  47. package/dist/{chunk-EXEXX34Q.cjs → chunk-RSGFPFSM.cjs} +28 -28
  48. package/dist/{chunk-EXEXX34Q.cjs.map → chunk-RSGFPFSM.cjs.map} +1 -1
  49. package/dist/{chunk-PIJK3FV6.cjs → chunk-SGAMQ4G7.cjs} +3 -3
  50. package/dist/{chunk-PIJK3FV6.cjs.map → chunk-SGAMQ4G7.cjs.map} +1 -1
  51. package/dist/{chunk-3FTNQDLP.cjs → chunk-T5ZKUSVJ.cjs} +5 -5
  52. package/dist/{chunk-3FTNQDLP.cjs.map → chunk-T5ZKUSVJ.cjs.map} +1 -1
  53. package/dist/{chunk-J25M43YI.js → chunk-T7FTSJM2.js} +6 -6
  54. package/dist/{chunk-6XJS3WU7.js → chunk-TMGTVVE2.js} +24 -4
  55. package/dist/chunk-TMGTVVE2.js.map +1 -0
  56. package/dist/{chunk-RROIA6WY.js → chunk-UY4EFV3P.js} +2 -2
  57. package/dist/{chunk-TSCIVH7T.js → chunk-VBIFSOPQ.js} +2 -2
  58. package/dist/{chunk-ROQTWRV7.cjs → chunk-VRN27OMD.cjs} +406 -369
  59. package/dist/chunk-VRN27OMD.cjs.map +1 -0
  60. package/dist/{chunk-IPHA3AQ6.js → chunk-XGVWMJQD.js} +8 -8
  61. package/dist/{chunk-K26VN65M.cjs → chunk-YKHVTESH.cjs} +15 -15
  62. package/dist/{chunk-K26VN65M.cjs.map → chunk-YKHVTESH.cjs.map} +1 -1
  63. package/dist/{chunk-E7VXPU3R.cjs → chunk-Z5OZCZYH.cjs} +33 -33
  64. package/dist/{chunk-E7VXPU3R.cjs.map → chunk-Z5OZCZYH.cjs.map} +1 -1
  65. package/dist/{chunk-CWMKY2UJ.js → chunk-ZBXPNBKB.js} +3 -3
  66. package/dist/{chunk-CM6DNLK7.cjs → chunk-ZLILFOPN.cjs} +200 -200
  67. package/dist/{chunk-CM6DNLK7.cjs.map → chunk-ZLILFOPN.cjs.map} +1 -1
  68. package/dist/components/case-studies/index.cjs +11 -11
  69. package/dist/components/case-studies/index.js +5 -5
  70. package/dist/components/chat/entity-cards/ai-prompt-card.d.ts +35 -0
  71. package/dist/components/chat/entity-cards/ai-prompt-card.d.ts.map +1 -0
  72. package/dist/components/chat/entity-cards/dispatch.d.ts +6 -0
  73. package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -1
  74. package/dist/components/chat/entity-cards/index.d.ts +3 -1
  75. package/dist/components/chat/entity-cards/index.d.ts.map +1 -1
  76. package/dist/components/chat/index.cjs +9 -3
  77. package/dist/components/chat/index.cjs.map +1 -1
  78. package/dist/components/chat/index.js +8 -2
  79. package/dist/components/chat/utils/icon-registry.d.ts.map +1 -1
  80. package/dist/components/comment-card.d.ts +26 -24
  81. package/dist/components/comment-card.d.ts.map +1 -1
  82. package/dist/components/comment-thread.d.ts +58 -0
  83. package/dist/components/comment-thread.d.ts.map +1 -0
  84. package/dist/components/contact/index.cjs +6 -6
  85. package/dist/components/contact/index.js +5 -5
  86. package/dist/components/docs/index.cjs +9 -9
  87. package/dist/components/docs/index.js +8 -8
  88. package/dist/components/embeds/index.cjs +6 -6
  89. package/dist/components/embeds/index.js +5 -5
  90. package/dist/components/faq/index.cjs +6 -6
  91. package/dist/components/faq/index.js +5 -5
  92. package/dist/components/features/index.cjs +5 -5
  93. package/dist/components/features/index.js +4 -4
  94. package/dist/components/help-center-pages/index.cjs +27 -27
  95. package/dist/components/help-center-pages/index.js +18 -18
  96. package/dist/components/index.cjs +223 -77
  97. package/dist/components/index.cjs.map +1 -1
  98. package/dist/components/index.d.ts +1 -0
  99. package/dist/components/index.d.ts.map +1 -1
  100. package/dist/components/index.js +340 -194
  101. package/dist/components/index.js.map +1 -1
  102. package/dist/components/meeting-scheduler/index.cjs +40 -40
  103. package/dist/components/meeting-scheduler/index.js +6 -6
  104. package/dist/components/navigation/index.cjs +8 -8
  105. package/dist/components/navigation/index.js +7 -7
  106. package/dist/components/onboarding-guides/index.cjs +8 -8
  107. package/dist/components/onboarding-guides/index.js +7 -7
  108. package/dist/components/related-content/card-registry.d.ts.map +1 -1
  109. package/dist/components/related-content/index.cjs +4 -4
  110. package/dist/components/related-content/index.js +3 -3
  111. package/dist/components/tickets/index.cjs +10 -10
  112. package/dist/components/tickets/index.js +9 -9
  113. package/dist/components/ui/index.cjs +11 -5
  114. package/dist/components/ui/index.cjs.map +1 -1
  115. package/dist/components/ui/index.js +10 -4
  116. package/dist/index.cjs +15 -9
  117. package/dist/index.cjs.map +1 -1
  118. package/dist/index.js +14 -8
  119. package/dist/index.js.map +1 -1
  120. package/dist/types/marketing.d.ts +1 -1
  121. package/dist/types/marketing.d.ts.map +1 -1
  122. package/dist/types/video-processing.d.ts +1 -1
  123. package/dist/types/video-processing.d.ts.map +1 -1
  124. package/dist/utils/content-ref-groups.d.ts.map +1 -1
  125. package/dist/utils/index.cjs +13 -4
  126. package/dist/utils/index.cjs.map +1 -1
  127. package/dist/utils/index.js +14 -5
  128. package/dist/utils/index.js.map +1 -1
  129. package/dist/utils/list-url.d.ts.map +1 -1
  130. package/dist/utils/source-icons.d.ts.map +1 -1
  131. package/package.json +1 -1
  132. package/src/__tests__/chat-card-label.test.tsx +24 -0
  133. package/src/components/chat/entity-cards/ai-prompt-card.tsx +62 -0
  134. package/src/components/chat/entity-cards/dispatch.tsx +43 -5
  135. package/src/components/chat/entity-cards/index.ts +3 -0
  136. package/src/components/chat/utils/icon-registry.ts +3 -0
  137. package/src/components/comment-card.tsx +27 -24
  138. package/src/components/comment-thread.tsx +212 -0
  139. package/src/components/index.ts +1 -0
  140. package/src/components/related-content/__tests__/card-registry.test.tsx +7 -0
  141. package/src/components/related-content/card-registry.tsx +20 -1
  142. package/src/types/marketing.ts +1 -0
  143. package/src/types/video-processing.ts +2 -1
  144. package/src/utils/__tests__/list-url.test.ts +2 -0
  145. package/src/utils/content-ref-groups.ts +1 -0
  146. package/src/utils/list-url.ts +2 -0
  147. package/src/utils/source-icons.ts +6 -0
  148. package/dist/chunk-6XJS3WU7.js.map +0 -1
  149. package/dist/chunk-7ZEQMFP3.cjs.map +0 -1
  150. package/dist/chunk-E2EGTHYA.cjs.map +0 -1
  151. package/dist/chunk-FCN2HN6Q.js.map +0 -1
  152. package/dist/chunk-GBON2OCG.js.map +0 -1
  153. package/dist/chunk-GXUGYZ6H.js.map +0 -1
  154. package/dist/chunk-ROQTWRV7.cjs.map +0 -1
  155. /package/dist/{chunk-WVRXDGGP.js.map → chunk-4SH2L3HO.js.map} +0 -0
  156. /package/dist/{chunk-YCZBCEQO.js.map → chunk-5AB6QLIQ.js.map} +0 -0
  157. /package/dist/{chunk-GFWKEWEH.js.map → chunk-BR5PVFWG.js.map} +0 -0
  158. /package/dist/{chunk-GD7CV2JI.js.map → chunk-CKH4SLD5.js.map} +0 -0
  159. /package/dist/{chunk-UUXLDIK3.js.map → chunk-DJVN7IW6.js.map} +0 -0
  160. /package/dist/{chunk-IW746HJ7.js.map → chunk-FHR2JU2J.js.map} +0 -0
  161. /package/dist/{chunk-VRN5YYD3.js.map → chunk-G6LYVK64.js.map} +0 -0
  162. /package/dist/{chunk-2DTZXXY3.js.map → chunk-GMBETTTE.js.map} +0 -0
  163. /package/dist/{chunk-NUU5ZEEG.js.map → chunk-GZFVTFMU.js.map} +0 -0
  164. /package/dist/{chunk-5P74E24M.js.map → chunk-KLAL4FTU.js.map} +0 -0
  165. /package/dist/{chunk-ANMD7SM4.js.map → chunk-LNF5W3QJ.js.map} +0 -0
  166. /package/dist/{chunk-XUNFDRMP.js.map → chunk-POSO6GYC.js.map} +0 -0
  167. /package/dist/{chunk-J25M43YI.js.map → chunk-T7FTSJM2.js.map} +0 -0
  168. /package/dist/{chunk-RROIA6WY.js.map → chunk-UY4EFV3P.js.map} +0 -0
  169. /package/dist/{chunk-TSCIVH7T.js.map → chunk-VBIFSOPQ.js.map} +0 -0
  170. /package/dist/{chunk-IPHA3AQ6.js.map → chunk-XGVWMJQD.js.map} +0 -0
  171. /package/dist/{chunk-CWMKY2UJ.js.map → chunk-ZBXPNBKB.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-3FTNQDLP.cjs","../src/components/tickets/ticket-live-provider.tsx","../src/components/tickets/types.ts"],"names":[],"mappings":"AAAA,6xBAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACiBA,mDAA+B;AAC/B,4EAAkB;AA2YT,+CAAA;AAjYT,IAAM,uBAAA,EAAyB,qBAAA;AAC/B,IAAM,qBAAA,EAAuB,mBAAA;AAE7B,IAAM,cAAA,EAAqC,EAAE,WAAA,EAAa,CAAA,EAAG,OAAA,EAAS,CAAC,CAAA,EAAG,cAAA,EAAgB,CAAC,EAAE,CAAA;AAM7F,IAAM,QAAA,EAAU,CAAC,KAAA,EAAA,GAA6C;AAC5D,EAAA,GAAA,CAAI,CAAC,KAAA,EAAO,OAAO,CAAA;AACnB,EAAA,MAAM,GAAA,EAAK,IAAA,CAAK,KAAA,CAAM,KAAK,CAAA;AAC3B,EAAA,OAAO,MAAA,CAAO,KAAA,CAAM,EAAE,EAAA,EAAI,EAAA,EAAI,EAAA;AAChC,CAAA;AAIA,IAAM,uBAAA,EAAyB,IAAA;AA6B/B,IAAM,kBAAA,EAAoB,eAAA,CAAM,aAAA,CAA6C,IAAI,CAAA;AAE1E,SAAS,qBAAA,CAAA,EAAuD;AACrE,EAAA,OAAO,eAAA,CAAM,UAAA,CAAW,iBAAiB,CAAA;AAC3C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AAerC,IAAM,WAAA,EAAa;AAAA,EACxB,YAAA,EAAc,EAAE,KAAA,EAAO,eAAA,EAAiB,WAAA,EAAa,uDAAuD,CAAA;AAAA,EAC5G,mBAAA,EAAqB,EAAE,KAAA,EAAO,eAAA,EAAiB,WAAA,EAAa,sDAAiD,CAAA;AAAA,EAC7G,aAAA,EAAe,EAAE,KAAA,EAAO,gBAAgB,CAAA;AAAA,EACxC,cAAA,EAAgB,EAAE,KAAA,EAAO,kBAAkB,CAAA;AAAA,EAC3C,eAAA,EAAiB,EAAE,KAAA,EAAO,gBAAgB,CAAA;AAAA,EAC1C,cAAA,EAAgB,EAAE,KAAA,EAAO,iBAAiB;AAAA;AAE5C,CAAA;AF1DA;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,gVAAC","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-3FTNQDLP.cjs","sourcesContent":[null,"'use client';\n\n/**\n * TicketLiveProvider — the ONE client home for support-ticket realtime.\n *\n * DOMAIN logic only — connection lifecycle (subscribed-confirm, server\n * retry grace, failed-reconnect pacing, hidden-tab suspend/resume) is\n * owned entirely by the common SSE client (`createSseSubscription`);\n * this provider consumes its consolidated `onConnectedChange` signal.\n *\n * Owns:\n * - the unread summary — delivered EXCLUSIVELY by the stream\n * (`ticket-summary` frames on connect + debounced after events) and\n * by `ticket-read` responses. The client holds NO summary fetch\n * path: resync-on-(re)connect is served by the SERVER (every\n * connect pushes a fresh summary);\n * - query invalidation on events (list + open drawer refresh live);\n * - `markRead` with local write-through zeroing for 0-latency,\n * reconciled by the response's server-computed summary;\n * - the ticket-contract `no-stream` (204) retry policy.\n *\n * There is NO polling anywhere and NO summary endpoint. Hosts whose\n * stream endpoint 404s (terminal) or is absent get no unread indication\n * — the indication IS a realtime feature.\n *\n * Invalidation semantics on events — deliberately `invalidateQueries`,\n * NOT `setQueryData` patches: the ticket hooks run `gcTime: 0`, so\n * there is usually no cache entry to patch, and `TicketsCacheSlot`\n * shape rules apply when there is.\n */\n\nimport { useQueryClient } from '@tanstack/react-query';\nimport React from 'react';\nimport { useChatRuntime } from '../../contexts/chat-runtime-context';\nimport { embedAuthedFetch } from '../../utils/embed-authed-fetch';\nimport { createSseSubscription, type SseSubscription, type SseTransportStatus } from '../../utils/sse-subscription';\nimport { useChatIdentity } from '../chat/hooks/use-chat-identity';\nimport type { TicketMessageStreamData, TicketStreamEvent, TicketUnreadSummary } from './types';\n\n// Ticket realtime is its OWN api surface — deliberately NOT under\n// `/api/chat/agent/*` (that prefix is the chat agent's tool surface;\n// ticket streaming/read-receipts are unrelated to chat).\nconst TICKET_STREAM_ENDPOINT = '/api/tickets/stream';\nconst TICKET_READ_ENDPOINT = '/api/tickets/read';\n\nconst EMPTY_SUMMARY: TicketUnreadSummary = { totalUnread: 0, tickets: {}, latestUnreadAt: {} };\n\n/** ISO stamps can carry mixed timezone offsets (server `+00:00` vs an\n * optimistic local `Z`) — lexicographic string comparison mis-orders\n * those, so every stamp comparison goes through parsed epoch ms.\n * Missing/unparseable stamps sort oldest. */\nconst stampMs = (stamp: string | null | undefined): number => {\n if (!stamp) return 0;\n const ms = Date.parse(stamp);\n return Number.isNaN(ms) ? 0 : ms;\n};\n\n/** Trailing debounce for event-burst invalidations (an agent pasting 5\n * messages must not fire 5 list refetches). */\nconst INVALIDATE_DEBOUNCE_MS = 1_500;\n\nexport interface TicketLiveContextValue {\n /** Viewer has a resolved, non-anon chat identity. Surfaces (e.g. the\n * header cell) hide themselves when false — computed here so they\n * don't each spin up their own identity resolution. */\n authed: boolean;\n /** Realtime-subscribed (server-confirmed), not merely HTTP-open. */\n connected: boolean;\n /** Unread total across tickets — drives the header count badge. */\n unreadTotal: number;\n /** Per-ticket unread counts (missing key = 0) — drives row dots.\n * The currently-open ticket is masked to 0. */\n unreadByTicket: Record<string, number>;\n /** The ticket with the NEWEST unread reply (open ticket excluded) —\n * the header cell routes to it via the SSOT deep link\n * (`buildTicketOpenHref`). Null when nothing is unread. */\n nextUnreadTicketId: string | null;\n /** Mark a ticket read: POSTs the receipt, zeroes the ticket locally\n * (0-latency), then applies the response's server-computed summary. */\n markRead: (ticketExternalId: string) => Promise<void>;\n /** Drawer open/close registration — suppresses unread bumps for the\n * open ticket and masks it in the derived map. */\n setOpenTicketId: (ticketExternalId: string | null) => void;\n /** Hint that the viewer just created a ticket — reconnects the stream\n * (fresh ownership set + fresh server-pushed summary). */\n notifyTicketCreated: () => void;\n}\n\nconst TicketLiveContext = React.createContext<TicketLiveContextValue | null>(null);\n\nexport function useOptionalTicketLive(): TicketLiveContextValue | null {\n return React.useContext(TicketLiveContext);\n}\n\nexport function useTicketLive(): TicketLiveContextValue {\n const ctx = React.useContext(TicketLiveContext);\n if (!ctx) {\n throw new Error('useTicketLive must be used within <TicketLiveProvider>');\n }\n return ctx;\n}\n\nfunction isTicketMessageData(value: unknown): value is TicketMessageStreamData {\n return (\n typeof value === 'object' &&\n value !== null &&\n typeof (value as TicketMessageStreamData).ticket_external_id === 'string'\n );\n}\n\nfunction isSummaryData(value: unknown): value is TicketUnreadSummary {\n return (\n typeof value === 'object' &&\n value !== null &&\n typeof (value as TicketUnreadSummary).totalUnread === 'number' &&\n typeof (value as TicketUnreadSummary).tickets === 'object'\n );\n}\n\nexport interface TicketLiveProviderProps {\n children: React.ReactNode;\n /**\n * Whether ticket realtime is available to this host at all (feature flag,\n * session, entitlement). `false` provides NO context — `useOptionalTicketLive()`\n * reads `null`, `useTicketLive()` throws, and no identity or stream request is\n * made: byte-for-byte what a host got by not mounting this at all.\n *\n * It exists so a host never has to mount this CONDITIONALLY. A host that writes\n * `enabled ? <TicketLiveProvider>{children}</TicketLiveProvider> : <>{children}</>`\n * changes the element TYPE at that position the moment its flag answers, and React\n * tears down and remounts everything below. In openframe-frontend that wrapper sat\n * around the whole `AppLayout`, so every cold load remounted the app shell and the\n * page under it — visibly, as a chat drawer opened by a deep link replaying its\n * open animation. Mount it always and pass the answer here instead.\n *\n * One consequence of mounting it always: a `ChatRuntime` must be above it even\n * while disabled. The identity resolver reads one unconditionally (Rules of\n * Hooks) and throws without it; `enabled` gates the request, not the read.\n */\n enabled?: boolean;\n}\n\nexport function TicketLiveProvider({ children, enabled = true }: TicketLiveProviderProps) {\n const runtime = useChatRuntime();\n const identity = useChatIdentity(enabled);\n const queryClient = useQueryClient();\n\n const streamUrl = runtime?.endpoints.ticketStreamUrl ?? TICKET_STREAM_ENDPOINT;\n const readUrl = runtime?.endpoints.ticketReadUrl ?? TICKET_READ_ENDPOINT;\n\n // Gates the stream below (via `streamEnabled`) as well as every surface that\n // reads `authed` — one predicate, so a disabled provider is also a silent one.\n const authed = enabled && identity.authTier !== 'anon' && !!identity.user?.email;\n\n const [connected, setConnected] = React.useState(false);\n // The SINGLE unread source — written ONLY from server-computed\n // summaries (stream frames + markRead responses) plus the two\n // 0-latency optimistic writes (event bump, markRead zero), both\n // reconciled by the next server summary.\n const [summary, setSummary] = React.useState<TicketUnreadSummary>(EMPTY_SUMMARY);\n // State + ref for the open drawer: state drives the derived map,\n // the ref lets stream callbacks read it without re-subscribing.\n const [openTicketIdState, setOpenTicketIdState] = React.useState<string | null>(null);\n const openTicketIdRef = React.useRef<string | null>(null);\n\n // ---- Debounced (trailing) invalidation of ticket queries on events ----\n const pendingTicketIdsRef = React.useRef<Set<string>>(new Set());\n const invalidateTimerRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n const flushInvalidations = React.useCallback(() => {\n invalidateTimerRef.current = null;\n const ids = Array.from(pendingTicketIdsRef.current);\n pendingTicketIdsRef.current.clear();\n void queryClient.invalidateQueries({ queryKey: ['tickets'] });\n for (const id of ids) {\n void queryClient.invalidateQueries({ queryKey: ['ticket-engagements', id] });\n }\n }, [queryClient]);\n const scheduleInvalidation = React.useCallback(\n (ticketId?: string) => {\n if (ticketId) pendingTicketIdsRef.current.add(ticketId);\n if (invalidateTimerRef.current) return;\n invalidateTimerRef.current = setTimeout(flushInvalidations, INVALIDATE_DEBOUNCE_MS);\n },\n [flushInvalidations],\n );\n\n // ---- Optimistic unread writes (reconciled by server summaries) ----\n const bumpUnread = React.useCallback((ticketId: string, createdAt?: string | null) => {\n setSummary(prev => {\n const stamp = createdAt ?? new Date().toISOString();\n const existing = prev.latestUnreadAt[ticketId];\n return {\n totalUnread: prev.totalUnread + 1,\n tickets: { ...prev.tickets, [ticketId]: (prev.tickets[ticketId] ?? 0) + 1 },\n latestUnreadAt: {\n ...prev.latestUnreadAt,\n [ticketId]: existing && stampMs(existing) > stampMs(stamp) ? existing : stamp,\n },\n };\n });\n }, []);\n\n const zeroUnread = React.useCallback((ticketId: string) => {\n setSummary(prev => {\n const current = prev.tickets[ticketId] ?? 0;\n if (current === 0) return prev;\n const tickets = { ...prev.tickets };\n delete tickets[ticketId];\n const latestUnreadAt = { ...prev.latestUnreadAt };\n delete latestUnreadAt[ticketId];\n return { totalUnread: Math.max(0, prev.totalUnread - current), tickets, latestUnreadAt };\n });\n }, []);\n\n // ---- Stream lifecycle (owned by the SSE CLIENT — the provider only\n // consumes its consolidated signals) ----\n const subscriptionRef = React.useRef<SseSubscription | null>(null);\n const noStreamRef = React.useRef(false);\n\n // Stable handler refs so the subscription effect doesn't churn.\n const handlersRef = React.useRef<{\n onEvent: (eventName: string, data: unknown) => void;\n onStatus: (status: SseTransportStatus) => void;\n onConnected: (connected: boolean) => void;\n }>({ onEvent: () => {}, onStatus: () => {}, onConnected: () => {} });\n\n const handleConnected = (isConnected: boolean) => {\n setConnected(isConnected);\n if (isConnected) {\n // Event-gap healing on every (re)connect: the SERVER pushes a\n // fresh summary; the open drawer refetches through the ACL'd path.\n const openId = openTicketIdRef.current;\n if (openId) {\n void queryClient.invalidateQueries({ queryKey: ['ticket-engagements', openId] });\n }\n }\n };\n\n const handleEvent = (eventName: string, data: unknown) => {\n if (eventName === 'ticket-summary') {\n const frame = data as TicketStreamEvent | null;\n if (isSummaryData(frame?.data)) {\n setSummary({\n totalUnread: frame.data.totalUnread,\n tickets: frame.data.tickets ?? {},\n latestUnreadAt: frame.data.latestUnreadAt ?? {},\n });\n }\n return;\n }\n\n if (eventName === 'ticket-resync') {\n // Ownership gained / degraded payload — a fresh ticket-summary\n // frame follows from the server; refresh the query surfaces.\n scheduleInvalidation();\n return;\n }\n\n if (eventName === 'ticket-status') {\n // Meaningful ticket-row change (close/reopen/pipeline move). The\n // server pushes an updated summary right after (closures count as\n // unread server-side); here we just refresh the query surfaces so\n // the status badge flips live.\n const frame = data as TicketStreamEvent | null;\n const ticketId = (frame?.data as { ticket_external_id?: string } | undefined)?.ticket_external_id;\n scheduleInvalidation(ticketId);\n return;\n }\n\n if (eventName === 'ticket-message') {\n const frame = data as TicketStreamEvent | null;\n const payload = frame?.data;\n if (!isTicketMessageData(payload)) {\n scheduleInvalidation();\n return;\n }\n // Always invalidate (own replies from another tab render live);\n // bump unread ONLY on the server-stamped predicate, and never for\n // the ticket whose drawer is open. The server's debounced summary\n // push reconciles moments later.\n scheduleInvalidation(payload.ticket_external_id);\n if (payload.countsAsUnread && payload.ticket_external_id !== openTicketIdRef.current) {\n bumpUnread(payload.ticket_external_id, payload.hubspot_created_at);\n }\n }\n };\n\n const handleStatus = (status: SseTransportStatus) => {\n // The client owns connection lifecycle (confirm timeout, server\n // retry grace, failed-reconnect pacing, hidden-suspend). The only\n // transport status with DOMAIN meaning is the ticket contract's\n // `no-stream` (204 = zero owned tickets): remember it so a domain\n // signal (own create_ticket, window focus) can retry.\n if (status === 'open') noStreamRef.current = false;\n if (status === 'no-stream') noStreamRef.current = true;\n };\n\n // Publish the three handlers into the stable ref. In an unconditional effect\n // rather than in the render body: every caller is an SSE transport callback,\n // which can only fire after a commit, and a render attempt React discards\n // must not be able to leave a handler behind that closes over state the user\n // never saw. Declared BEFORE the subscription effect so it is filled first\n // in the same flush.\n React.useEffect(() => {\n handlersRef.current.onConnected = handleConnected;\n handlersRef.current.onEvent = handleEvent;\n handlersRef.current.onStatus = handleStatus;\n });\n\n // Mount/unmount of the subscription — gated on auth + a usable URL.\n const streamEnabled = authed && !!streamUrl;\n React.useEffect(() => {\n if (!streamEnabled) return undefined;\n if (typeof window === 'undefined') return undefined;\n\n subscriptionRef.current = createSseSubscription({\n url: streamUrl,\n onEvent: (name, data) => handlersRef.current.onEvent(name, data),\n onStatusChange: status => handlersRef.current.onStatus(status),\n onConnectedChange: isConnected => handlersRef.current.onConnected(isConnected),\n // Long-lived per-user stream: suspend while hidden (scale relief),\n // resume + reconnect on visible/online — all inside the client.\n pauseWhenHidden: true,\n });\n\n const retryIfIdle = () => {\n // After a 204 (no-stream), a focus signal is the retry trigger.\n if (noStreamRef.current) {\n noStreamRef.current = false;\n subscriptionRef.current?.reconnectNow();\n }\n };\n window.addEventListener('focus', retryIfIdle);\n\n return () => {\n window.removeEventListener('focus', retryIfIdle);\n if (invalidateTimerRef.current) {\n clearTimeout(invalidateTimerRef.current);\n invalidateTimerRef.current = null;\n }\n subscriptionRef.current?.close();\n subscriptionRef.current = null;\n setConnected(false);\n setSummary(EMPTY_SUMMARY);\n };\n // handlersRef is stable; streamUrl/auth changes remount the stream.\n }, [streamEnabled, streamUrl]);\n\n // ---- Public API ----\n const markRead = React.useCallback(\n async (ticketExternalId: string) => {\n try {\n const response = await embedAuthedFetch(readUrl, {\n method: 'POST',\n body: JSON.stringify({ ticket_id: ticketExternalId }),\n });\n if (!response.ok) return;\n // 0-latency local zero, then reconcile with the response's\n // server-computed summary (THE truth — includes closure\n // accounting and other tickets).\n zeroUnread(ticketExternalId);\n const body = (await response.json().catch(() => null)) as { summary?: TicketUnreadSummary } | null;\n if (isSummaryData(body?.summary)) {\n setSummary({\n totalUnread: body.summary.totalUnread,\n tickets: body.summary.tickets ?? {},\n latestUnreadAt: body.summary.latestUnreadAt ?? {},\n });\n }\n } catch {\n // Non-fatal — the receipt lands on the next markRead; unread\n // state reconciles via the next server summary push.\n }\n },\n [readUrl, zeroUnread],\n );\n\n const setOpenTicketId = React.useCallback((ticketExternalId: string | null) => {\n openTicketIdRef.current = ticketExternalId;\n setOpenTicketIdState(ticketExternalId);\n }, []);\n\n const notifyTicketCreated = React.useCallback(() => {\n // Fresh connect → fresh ownership set + fresh server summary\n // (covers both the no-stream 204 wait state and an already-live\n // stream whose set predates the new ticket).\n noStreamRef.current = false;\n subscriptionRef.current?.reconnectNow();\n }, []);\n\n // Derived unread map — open ticket masked to 0 so a server summary\n // landing inside the markRead debounce window can't transiently\n // re-badge it.\n const value = React.useMemo<TicketLiveContextValue>(() => {\n let unreadByTicket = summary.tickets;\n let unreadTotal = summary.totalUnread;\n if (openTicketIdState && unreadByTicket[openTicketIdState]) {\n const masked = unreadByTicket[openTicketIdState];\n unreadByTicket = { ...unreadByTicket };\n delete unreadByTicket[openTicketIdState];\n unreadTotal = Math.max(0, unreadTotal - masked);\n }\n // Ticket with the NEWEST unread reply (compared as parsed epoch ms\n // via `stampMs` — mixed timezone offsets break string ordering) —\n // header cell routes there. Falls back to any unread key if a\n // timestamp is missing.\n let nextUnreadTicketId: string | null = null;\n let nextStampMs = 0;\n for (const id of Object.keys(unreadByTicket)) {\n const ms = stampMs(summary.latestUnreadAt[id]);\n if (nextUnreadTicketId === null || ms > nextStampMs) {\n nextUnreadTicketId = id;\n nextStampMs = ms;\n }\n }\n return {\n authed,\n connected,\n unreadTotal,\n unreadByTicket,\n nextUnreadTicketId,\n markRead,\n setOpenTicketId,\n notifyTicketCreated,\n };\n }, [summary, authed, connected, openTicketIdState, markRead, setOpenTicketId, notifyTicketCreated]);\n\n return <TicketLiveContext.Provider value={enabled ? value : null}>{children}</TicketLiveContext.Provider>;\n}\n","/**\n * Wire shape of a row returned by `POST /api/chat/agent/find-ticket`.\n * Mirrors the executor's projection at `lib/data/hubspot-tools.ts`\n * (`FIND_TICKET_SELECT` / `FindTicketResult`).\n *\n * Cross-repo duplication is INTENTIONAL: this lib ships independently\n * of the hub, so we can't import `FindTicketResult` from\n * `hubspot-tools.ts` directly. If the server adds a column to\n * `FIND_TICKET_SELECT`, also add it here. The smoke test in §F of the\n * plan covers the happy path; a wire-contract test belongs in the hub.\n *\n * `find-ticket` returns `customer_emails: string[]` (jsonb array), NOT\n * a single `customer_email`. The list is server-self-scoped to the\n * caller's session email; the array is exposed for admin/staff\n * surfaces, which the ticket center doesn't render.\n */\nexport interface TicketData {\n id: string;\n /** HubSpot ticket id (display number, e.g. \"1234\"). */\n external_id: string;\n subject: string | null;\n /** Short (≤400 char) HTML-stripped preview of the ticket body —\n * used for the list-card subtitle when needed. */\n preview: string | null;\n /** Longer (≤4k char) sanitized body. INCLUDES every appended\n * `content_addendum` comment because the `update_ticket` executor\n * reads + re-writes the `content` property server-side with a\n * `---` separator. Render this in the drawer's description block\n * and the user sees both the original message + every comment they\n * (or staff) added. */\n body: string | null;\n /** Canonical OPEN | CLOSED (HubSpot pipeline derived). */\n status: string | null;\n /** Human label like \"New\" / \"Working on it\" / \"Waiting on contact\" /\n * \"Closed\". Drives the badge text; canonical status drives color. */\n pipeline_stage_label: string | null;\n clickup_task_id: string | null;\n /** Snapshot of the linked ClickUp delivery task — populated server-side\n * via the `clickup_tasks` mirror when `clickup_task_id` is set. Drives\n * the \"Linked delivery\" card surface on the ticket drawer (status\n * badge + ClickUp deep link). `null` when no link OR the ClickUp row\n * was deleted / not yet synced. */\n clickup: TicketClickupSummary | null;\n priority: string | null;\n customer_emails: string[];\n customer_company: string | null;\n /** HubSpot contact's display name. Drives the customer attribution\n * on the drawer when the viewer is NOT the customer themselves\n * (admin browsing / multi-contact second viewer). Conversations\n * API messages don't carry per-message sender info on Custom\n * Channels, so this is the only reliable source for \"what's the\n * customer's name.\" */\n customer_name: string | null;\n /** HubSpot owner id of the agent assigned to this ticket. Carried as\n * raw id for debugging; rendering goes through `assignedOwner`. Null\n * when unassigned. */\n assigned_to: string | null;\n /** Resolved assigned-owner profile — name + email + avatar. Populated\n * server-side via `attachOwnerProfiles` which joins through the\n * `hubspot_owners` mirror to `profiles` by email. Drives the\n * \"Assigned to\" attribution in the drawer header. Null when\n * unassigned OR the owner couldn't be resolved (rare — only when\n * the agent was deleted from HubSpot between the ticket update and\n * the next owners reconcile). */\n assignedOwner: TicketAssignedOwner | null;\n hubspot_updated_at: string;\n}\n\n/** Resolved profile of a ticket's assigned agent — surfaced in the\n * drawer header. Subset of the server's `MirroredOwnerProfile`\n * trimmed to just the rendering fields. */\nexport interface TicketAssignedOwner {\n name: string | null;\n email: string | null;\n avatarUrl: string | null;\n}\n\n/** Compact projection of a linked ClickUp task — matches the server's\n * `ClickupSummary` and aligns with `DeliveryItem` so the linked-card\n * on a ticket can render through the same `DeliveryRow` primitive used\n * on `/bug-fixes-and-enhancements`. */\nexport interface TicketClickupSummary {\n /** ClickUp task external_id (e.g. \"86ad4e022\"). Used as the\n * `?focus=<id>` URL param to scroll the public delivery page to\n * this row. */\n external_id: string;\n title: string | null;\n description: string | null;\n /** ClickUp status name — e.g. \"complete\" / \"working\" / \"design approved\"\n * / \"waiting for release\". Used as the badge label. */\n status: string | null;\n /** ClickUp's per-status hex color (e.g. \"#008844\"). Forwarded to the\n * badge so colors match the ClickUp board exactly. */\n status_color: string | null;\n /** Bucket — `'backlog' | 'working' | 'complete' | 'unknown'`. Used as\n * a fallback when status_color is missing. */\n status_category: string | null;\n /** ClickUp custom item label (`'Bug'` / `'Request'`) — drives the\n * type badge (\"BUG-FIX\" / \"ENHANCEMENT\"). */\n task_type: string | null;\n custom_item_id: number | null;\n /** Every ClickUp list the task is associated with. UI joins with \", \". */\n list_names: string[];\n /** Unix-ms timestamps so the row's \"ACTIVE X ago\" subtitle uses the\n * shared `getRelativeTime()` helper. */\n date_opened: number | null;\n date_updated: number | null;\n date_closed: number | null;\n /** Direct https://app.clickup.com/t/<id> deep link. Kept on the wire\n * for admin surfaces; the customer-facing linked card navigates\n * internally instead. */\n clickup_url: string | null;\n /** Composed server-side via the SAME `buildDevSectionUrl` helper the\n * chat-inline delivery card uses. Carries `?search=<id>` so the\n * delivery list filters to that single task on landing. */\n delivery_href: string;\n /** Target platform name for the host's `useNavLink` to decide\n * same-tab vs new-tab on cross-platform links. */\n delivery_target_platform: string;\n /** Release version label set by the delivery team, e.g. \"0.9\" / \"1.0\".\n * Shown beside the status when present. */\n target_version: string | null;\n}\n\n/**\n * Optimistic placeholder a `submitTicket` call prepends to the list\n * BEFORE the server roundtrip resolves. Drawer is hidden until the\n * real id arrives. The wrapper destructures `_optimistic` before\n * forwarding to `<ChatTicketItem>` so the DOM doesn't see an unknown\n * prop.\n */\nexport interface OptimisticTicket extends TicketData {\n _optimistic: true;\n}\n\nexport type AnyTicket = TicketData | OptimisticTicket;\n\nexport function isOptimistic(t: AnyTicket): t is OptimisticTicket {\n return (t as OptimisticTicket)._optimistic === true;\n}\n\n/**\n * Shape of a single `['tickets', …]` TanStack-Query cache slot.\n * Mirrors `FindTicketResponse` in `hooks/use-tickets-list.ts` — kept\n * here because the cache-mutation call sites in `useTicketActions` and\n * `<HelpCenterList>` would otherwise have to redeclare the shape inline.\n *\n * A 2026-05-29 prod regression (`t.map is not a function` on\n * close/reopen) was caused by assuming the cache held a bare\n * `TicketData[]` instead of this wrapper — every helper that calls\n * `queryClient.setQueriesData` / `getQueriesData` on `['tickets']`\n * MUST type the value through this shape and project / reassemble\n * `tickets` explicitly.\n */\nexport interface TicketsCacheSlot {\n tickets?: TicketData[];\n count?: number;\n totalCount?: number;\n page?: number;\n pageSize?: number;\n totalPages?: number;\n scope?: 'self' | 'all';\n}\n\n/**\n * Stable server-side error codes the ticket-action helpers route\n * through `mapTicketActionError`. Anything else is treated as a generic\n * server error.\n *\n * Reply-specific codes (`HUBSPOT_5XX` / `HUBSPOT_400_VALIDATION` /\n * `HUBSPOT_404_THREAD` / `HUBSPOT_REPLY_UNKNOWN`) drive the drawer\n * banner that appears above the composer when a customer reply fails.\n * Distinct from `HUBSPOT_DISCONNECTED` (whole-system) and\n * `TICKET_NOT_FOUND` (terminal-row) — the reply codes are per-attempt\n * + retryable except for `HUBSPOT_404_THREAD`.\n */\nexport type TicketActionErrorCode =\n | 'PROPOSAL_NOT_CLAIMABLE'\n | 'TICKET_NOT_FOUND'\n | 'TICKET_OWNERSHIP_DENIED'\n | 'HUBSPOT_DISCONNECTED'\n | 'RATE_LIMITED'\n | 'INVALID_TOOL_ARGS'\n | 'HUBSPOT_5XX'\n | 'HUBSPOT_400_VALIDATION'\n | 'HUBSPOT_404_THREAD'\n | 'HUBSPOT_REPLY_UNKNOWN'\n | 'UNKNOWN';\n\nexport interface MappedTicketActionError {\n code: TicketActionErrorCode;\n /** Human-readable copy safe to show in a toast. */\n message: string;\n /** When true, the form should disable submit + show the\n * support-down banner. Set only for HUBSPOT_DISCONNECTED. */\n supportSystemDown: boolean;\n /** When true, the helper should remove the affected row optimistically\n * (TICKET_NOT_FOUND). */\n removeRowFromCache: boolean;\n /** Retry hint surfaced from a 429 response. Caller decides whether\n * to mention it in the toast. */\n retryAfterSeconds?: number;\n}\n\n/**\n * Defensive client-side cap on ticket text (initial content + comment\n * addendums). HubSpot Note engagements accept more, but a 100KB paste\n * should fail fast at the UI rather than burning a server round-trip.\n * Both the open-ticket form and the per-row comment textarea import\n * this so a future server-side hardening only touches one place.\n */\nexport const TICKET_TEXT_MAX_CHARS = 5000;\n\n/**\n * Wire contract of the ticket live stream (`GET /api/chat/agent/\n * ticket-stream`, SSE). Producer (the hub route's `mapEvent`) imports\n * THIS type — same producer/consumer SSOT pattern as\n * `ConversationEngagementWire = TicketEngagement`. A schema drift here\n * would be a silent serialization bug; keep one named contract.\n *\n * Frames carry METADATA ONLY — never message bodies. Content is always\n * refetched through the ACL'd `list-engagements` path (one read path).\n *\n * Event names (`eventType`):\n * - `ticket-message` — a message row landed in the mirror for one of\n * the viewer's tickets. `data` carries the metadata.\n * - `ticket-status` — a MEANINGFUL ticket-row change (status /\n * pipeline stage / closure) landed in the mirror. Server-side\n * old-vs-new diffing drops no-op writes (sync stamps). Clients\n * invalidate + refetch the summary (closures count as unread\n * server-side via `closed_at` vs the read receipt).\n * - `ticket-summary` — the server-computed `TicketUnreadSummary`.\n * THE stream is the summary webservice: pushed on connect (server-\n * side resync-on-reconnect) and re-pushed (debounced) after every\n * delivered event. Clients hold NO summary fetch path.\n * - `ticket-resync` — degraded frame: something happened that the\n * server couldn't fully describe (truncated Realtime payload, or\n * the connection's ownership set just gained tickets). A fresh\n * `ticket-summary` follows it; clients invalidate queries.\n *\n * The server also emits `status` frames (`subscribed` / `retrying` /\n * `reconnect_failed`) from the shared SSE utility — clients derive\n * `connected` from those, NOT from the HTTP stream being open.\n */\nexport type TicketStreamEventType = 'ticket-message' | 'ticket-status' | 'ticket-summary' | 'ticket-resync';\n\n/** Metadata payload of a `ticket-message` frame. */\nexport type TicketMessageStreamData = {\n ticket_external_id: string;\n /** Mirror row's HubSpot message id. */\n message_id: string;\n /** Server-stamped via the same direction predicate the wire mapper\n * uses. Clients never re-derive author classification. */\n authorRole: 'customer' | 'support';\n /** Server-stamped via the visibility+direction unread predicate\n * (`countsAsUnread` in the hub's conversations DAL). ONLY frames\n * with `true` may bump client-side unread state. */\n countsAsUnread: boolean;\n hubspot_created_at: string | null;\n};\n\n/** Metadata payload of a `ticket-status` frame. */\nexport type TicketStatusStreamData = {\n ticket_external_id: string;\n /** Canonical OPEN | CLOSED after the change. */\n status: string | null;\n pipeline_stage_label: string | null;\n closed_at: string | null;\n};\n\nexport interface TicketStreamEvent {\n eventType: TicketStreamEventType;\n /** Human-readable label (SSE envelope compat) — clients ignore it. */\n message: string;\n /** `ticket-message` → TicketMessageStreamData; `ticket-status` →\n * TicketStatusStreamData; `ticket-summary` → TicketUnreadSummary;\n * absent on `ticket-resync`. */\n data?: TicketMessageStreamData | TicketStatusStreamData | TicketUnreadSummary;\n}\n\n/**\n * The SINGLE unread source, delivered EXCLUSIVELY over the stream\n * (`ticket-summary` frames on connect + after events) and in\n * `ticket-read` responses. There is no summary fetch endpoint. Header\n * badge total AND per-row dots both read this via the\n * `TicketLiveProvider` map; missing keys mean 0.\n */\nexport type TicketUnreadSummary = {\n totalUnread: number;\n tickets: Record<string, number>;\n /** ISO timestamp of the NEWEST unread message per ticket (same keys as\n * `tickets`). Drives \"route to the most recent update\" on the header\n * cell: the ticket with the max value here is `nextUnreadTicketId`. */\n latestUnreadAt: Record<string, string>;\n};\n\n/**\n * Trailing debounce for `markRead` while the drawer is open and new\n * messages stream in — flushed on drawer close so a fast open/close\n * still persists the receipt. Named beside its sibling cadences so\n * every timing knob lives in one file.\n */\nexport const TICKET_MARK_READ_DEBOUNCE_MS = 2000;\n\n/**\n * Ticket deep-link SSOT — DEFINED in the server-safe param-keys module\n * (`utils/dev-sections/dev-section-param-keys.ts`, beside its sibling\n * `devSectionAnchorId`) because producers span both worlds: the hub's\n * SERVER-side chat-ref builder and the client header cell. Re-exported\n * here so ticket-surface consumers keep one import home.\n */\nexport { TICKET_OPEN_PARAM, buildTicketOpenHref } from '../../utils/dev-sections/dev-section-param-keys';\n\n/**\n * Centralized toast copy. Keep all wording here so QA / localization\n * can find every user-visible string in one file.\n */\nexport const TOAST_COPY = {\n open_success: { title: 'Ticket opened', description: 'We received your message and will follow up shortly.' },\n open_mirror_pending: { title: 'Ticket opened', description: 'Syncing — your ticket will appear momentarily.' },\n close_success: { title: 'Ticket closed' },\n reopen_success: { title: 'Ticket reopened' },\n comment_success: { title: 'Comment added' },\n attach_success: { title: 'Files attached' },\n // Failure variants are constructed dynamically from MappedTicketActionError.\n} as const;\n"]}
1
+ {"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-T5ZKUSVJ.cjs","../src/components/tickets/ticket-live-provider.tsx","../src/components/tickets/types.ts"],"names":[],"mappings":"AAAA,6xBAAY;AACZ;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACiBA,mDAA+B;AAC/B,4EAAkB;AA2YT,+CAAA;AAjYT,IAAM,uBAAA,EAAyB,qBAAA;AAC/B,IAAM,qBAAA,EAAuB,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AA,MACL,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA;AAAA,MACA,cAAA;AAAA,MACA,kBAAA;AAAA,MACA,QAAA;AAAA,MACA,eAAA;AAAA,MACA;AAAA,IACF,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,OAAA,EAAS,MAAA,EAAQ,SAAA,EAAW,iBAAA,EAAmB,QAAA,EAAU,eAAA,EAAiB,mBAAmB,CAAC,CAAA;AAElG,EAAA,uBAAO,6BAAA,iBAAC,CAAkB,QAAA,EAAlB,EAA2B,KAAA,EAAO,QAAA,EAAU,MAAA,EAAQ,IAAA,EAAO,SAAA,CAAS,CAAA;AAC9E;ADjLA;AACA;AEnHO,SAAS,YAAA,CAAa,CAAA,EAAqC;AAChE,EAAA,OAAQ,CAAA,CAAuB,YAAA,IAAgB,IAAA;AACjD;AAwEO,IAAM,sBAAA,EAAwB,GAAA;AA2F9B,IAAM,6BAAA,EAA+B,GAAA;AAerC,IAAM,WAAA,EAAa;AAAA,EACxB,YAAA,EAAc,EAAE,KAAA,EAAO,eAAA,EAAiB,WAAA,EAAa,uDAAuD,CAAA;AAAA,EAC5G,mBAAA,EAAqB,EAAE,KAAA,EAAO,eAAA,EAAiB,WAAA,EAAa,sDAAiD,CAAA;AAAA,EAC7G,aAAA,EAAe,EAAE,KAAA,EAAO,gBAAgB,CAAA;AAAA,EACxC,cAAA,EAAgB,EAAE,KAAA,EAAO,kBAAkB,CAAA;AAAA,EAC3C,eAAA,EAAiB,EAAE,KAAA,EAAO,gBAAgB,CAAA;AAAA,EAC1C,cAAA,EAAgB,EAAE,KAAA,EAAO,iBAAiB;AAAA;AAE5C,CAAA;AF1DA;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,gVAAC","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-T5ZKUSVJ.cjs","sourcesContent":[null,"'use client';\n\n/**\n * TicketLiveProvider — the ONE client home for support-ticket realtime.\n *\n * DOMAIN logic only — connection lifecycle (subscribed-confirm, server\n * retry grace, failed-reconnect pacing, hidden-tab suspend/resume) is\n * owned entirely by the common SSE client (`createSseSubscription`);\n * this provider consumes its consolidated `onConnectedChange` signal.\n *\n * Owns:\n * - the unread summary — delivered EXCLUSIVELY by the stream\n * (`ticket-summary` frames on connect + debounced after events) and\n * by `ticket-read` responses. The client holds NO summary fetch\n * path: resync-on-(re)connect is served by the SERVER (every\n * connect pushes a fresh summary);\n * - query invalidation on events (list + open drawer refresh live);\n * - `markRead` with local write-through zeroing for 0-latency,\n * reconciled by the response's server-computed summary;\n * - the ticket-contract `no-stream` (204) retry policy.\n *\n * There is NO polling anywhere and NO summary endpoint. Hosts whose\n * stream endpoint 404s (terminal) or is absent get no unread indication\n * — the indication IS a realtime feature.\n *\n * Invalidation semantics on events — deliberately `invalidateQueries`,\n * NOT `setQueryData` patches: the ticket hooks run `gcTime: 0`, so\n * there is usually no cache entry to patch, and `TicketsCacheSlot`\n * shape rules apply when there is.\n */\n\nimport { useQueryClient } from '@tanstack/react-query';\nimport React from 'react';\nimport { useChatRuntime } from '../../contexts/chat-runtime-context';\nimport { embedAuthedFetch } from '../../utils/embed-authed-fetch';\nimport { createSseSubscription, type SseSubscription, type SseTransportStatus } from '../../utils/sse-subscription';\nimport { useChatIdentity } from '../chat/hooks/use-chat-identity';\nimport type { TicketMessageStreamData, TicketStreamEvent, TicketUnreadSummary } from './types';\n\n// Ticket realtime is its OWN api surface — deliberately NOT under\n// `/api/chat/agent/*` (that prefix is the chat agent's tool surface;\n// ticket streaming/read-receipts are unrelated to chat).\nconst TICKET_STREAM_ENDPOINT = '/api/tickets/stream';\nconst TICKET_READ_ENDPOINT = '/api/tickets/read';\n\nconst EMPTY_SUMMARY: TicketUnreadSummary = { totalUnread: 0, tickets: {}, latestUnreadAt: {} };\n\n/** ISO stamps can carry mixed timezone offsets (server `+00:00` vs an\n * optimistic local `Z`) — lexicographic string comparison mis-orders\n * those, so every stamp comparison goes through parsed epoch ms.\n * Missing/unparseable stamps sort oldest. */\nconst stampMs = (stamp: string | null | undefined): number => {\n if (!stamp) return 0;\n const ms = Date.parse(stamp);\n return Number.isNaN(ms) ? 0 : ms;\n};\n\n/** Trailing debounce for event-burst invalidations (an agent pasting 5\n * messages must not fire 5 list refetches). */\nconst INVALIDATE_DEBOUNCE_MS = 1_500;\n\nexport interface TicketLiveContextValue {\n /** Viewer has a resolved, non-anon chat identity. Surfaces (e.g. the\n * header cell) hide themselves when false — computed here so they\n * don't each spin up their own identity resolution. */\n authed: boolean;\n /** Realtime-subscribed (server-confirmed), not merely HTTP-open. */\n connected: boolean;\n /** Unread total across tickets — drives the header count badge. */\n unreadTotal: number;\n /** Per-ticket unread counts (missing key = 0) — drives row dots.\n * The currently-open ticket is masked to 0. */\n unreadByTicket: Record<string, number>;\n /** The ticket with the NEWEST unread reply (open ticket excluded) —\n * the header cell routes to it via the SSOT deep link\n * (`buildTicketOpenHref`). Null when nothing is unread. */\n nextUnreadTicketId: string | null;\n /** Mark a ticket read: POSTs the receipt, zeroes the ticket locally\n * (0-latency), then applies the response's server-computed summary. */\n markRead: (ticketExternalId: string) => Promise<void>;\n /** Drawer open/close registration — suppresses unread bumps for the\n * open ticket and masks it in the derived map. */\n setOpenTicketId: (ticketExternalId: string | null) => void;\n /** Hint that the viewer just created a ticket — reconnects the stream\n * (fresh ownership set + fresh server-pushed summary). */\n notifyTicketCreated: () => void;\n}\n\nconst TicketLiveContext = React.createContext<TicketLiveContextValue | null>(null);\n\nexport function useOptionalTicketLive(): TicketLiveContextValue | null {\n return React.useContext(TicketLiveContext);\n}\n\nexport function useTicketLive(): TicketLiveContextValue {\n const ctx = React.useContext(TicketLiveContext);\n if (!ctx) {\n throw new Error('useTicketLive must be used within <TicketLiveProvider>');\n }\n return ctx;\n}\n\nfunction isTicketMessageData(value: unknown): value is TicketMessageStreamData {\n return (\n typeof value === 'object' &&\n value !== null &&\n typeof (value as TicketMessageStreamData).ticket_external_id === 'string'\n );\n}\n\nfunction isSummaryData(value: unknown): value is TicketUnreadSummary {\n return (\n typeof value === 'object' &&\n value !== null &&\n typeof (value as TicketUnreadSummary).totalUnread === 'number' &&\n typeof (value as TicketUnreadSummary).tickets === 'object'\n );\n}\n\nexport interface TicketLiveProviderProps {\n children: React.ReactNode;\n /**\n * Whether ticket realtime is available to this host at all (feature flag,\n * session, entitlement). `false` provides NO context — `useOptionalTicketLive()`\n * reads `null`, `useTicketLive()` throws, and no identity or stream request is\n * made: byte-for-byte what a host got by not mounting this at all.\n *\n * It exists so a host never has to mount this CONDITIONALLY. A host that writes\n * `enabled ? <TicketLiveProvider>{children}</TicketLiveProvider> : <>{children}</>`\n * changes the element TYPE at that position the moment its flag answers, and React\n * tears down and remounts everything below. In openframe-frontend that wrapper sat\n * around the whole `AppLayout`, so every cold load remounted the app shell and the\n * page under it — visibly, as a chat drawer opened by a deep link replaying its\n * open animation. Mount it always and pass the answer here instead.\n *\n * One consequence of mounting it always: a `ChatRuntime` must be above it even\n * while disabled. The identity resolver reads one unconditionally (Rules of\n * Hooks) and throws without it; `enabled` gates the request, not the read.\n */\n enabled?: boolean;\n}\n\nexport function TicketLiveProvider({ children, enabled = true }: TicketLiveProviderProps) {\n const runtime = useChatRuntime();\n const identity = useChatIdentity(enabled);\n const queryClient = useQueryClient();\n\n const streamUrl = runtime?.endpoints.ticketStreamUrl ?? TICKET_STREAM_ENDPOINT;\n const readUrl = runtime?.endpoints.ticketReadUrl ?? TICKET_READ_ENDPOINT;\n\n // Gates the stream below (via `streamEnabled`) as well as every surface that\n // reads `authed` — one predicate, so a disabled provider is also a silent one.\n const authed = enabled && identity.authTier !== 'anon' && !!identity.user?.email;\n\n const [connected, setConnected] = React.useState(false);\n // The SINGLE unread source — written ONLY from server-computed\n // summaries (stream frames + markRead responses) plus the two\n // 0-latency optimistic writes (event bump, markRead zero), both\n // reconciled by the next server summary.\n const [summary, setSummary] = React.useState<TicketUnreadSummary>(EMPTY_SUMMARY);\n // State + ref for the open drawer: state drives the derived map,\n // the ref lets stream callbacks read it without re-subscribing.\n const [openTicketIdState, setOpenTicketIdState] = React.useState<string | null>(null);\n const openTicketIdRef = React.useRef<string | null>(null);\n\n // ---- Debounced (trailing) invalidation of ticket queries on events ----\n const pendingTicketIdsRef = React.useRef<Set<string>>(new Set());\n const invalidateTimerRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n const flushInvalidations = React.useCallback(() => {\n invalidateTimerRef.current = null;\n const ids = Array.from(pendingTicketIdsRef.current);\n pendingTicketIdsRef.current.clear();\n void queryClient.invalidateQueries({ queryKey: ['tickets'] });\n for (const id of ids) {\n void queryClient.invalidateQueries({ queryKey: ['ticket-engagements', id] });\n }\n }, [queryClient]);\n const scheduleInvalidation = React.useCallback(\n (ticketId?: string) => {\n if (ticketId) pendingTicketIdsRef.current.add(ticketId);\n if (invalidateTimerRef.current) return;\n invalidateTimerRef.current = setTimeout(flushInvalidations, INVALIDATE_DEBOUNCE_MS);\n },\n [flushInvalidations],\n );\n\n // ---- Optimistic unread writes (reconciled by server summaries) ----\n const bumpUnread = React.useCallback((ticketId: string, createdAt?: string | null) => {\n setSummary(prev => {\n const stamp = createdAt ?? new Date().toISOString();\n const existing = prev.latestUnreadAt[ticketId];\n return {\n totalUnread: prev.totalUnread + 1,\n tickets: { ...prev.tickets, [ticketId]: (prev.tickets[ticketId] ?? 0) + 1 },\n latestUnreadAt: {\n ...prev.latestUnreadAt,\n [ticketId]: existing && stampMs(existing) > stampMs(stamp) ? existing : stamp,\n },\n };\n });\n }, []);\n\n const zeroUnread = React.useCallback((ticketId: string) => {\n setSummary(prev => {\n const current = prev.tickets[ticketId] ?? 0;\n if (current === 0) return prev;\n const tickets = { ...prev.tickets };\n delete tickets[ticketId];\n const latestUnreadAt = { ...prev.latestUnreadAt };\n delete latestUnreadAt[ticketId];\n return { totalUnread: Math.max(0, prev.totalUnread - current), tickets, latestUnreadAt };\n });\n }, []);\n\n // ---- Stream lifecycle (owned by the SSE CLIENT — the provider only\n // consumes its consolidated signals) ----\n const subscriptionRef = React.useRef<SseSubscription | null>(null);\n const noStreamRef = React.useRef(false);\n\n // Stable handler refs so the subscription effect doesn't churn.\n const handlersRef = React.useRef<{\n onEvent: (eventName: string, data: unknown) => void;\n onStatus: (status: SseTransportStatus) => void;\n onConnected: (connected: boolean) => void;\n }>({ onEvent: () => {}, onStatus: () => {}, onConnected: () => {} });\n\n const handleConnected = (isConnected: boolean) => {\n setConnected(isConnected);\n if (isConnected) {\n // Event-gap healing on every (re)connect: the SERVER pushes a\n // fresh summary; the open drawer refetches through the ACL'd path.\n const openId = openTicketIdRef.current;\n if (openId) {\n void queryClient.invalidateQueries({ queryKey: ['ticket-engagements', openId] });\n }\n }\n };\n\n const handleEvent = (eventName: string, data: unknown) => {\n if (eventName === 'ticket-summary') {\n const frame = data as TicketStreamEvent | null;\n if (isSummaryData(frame?.data)) {\n setSummary({\n totalUnread: frame.data.totalUnread,\n tickets: frame.data.tickets ?? {},\n latestUnreadAt: frame.data.latestUnreadAt ?? {},\n });\n }\n return;\n }\n\n if (eventName === 'ticket-resync') {\n // Ownership gained / degraded payload — a fresh ticket-summary\n // frame follows from the server; refresh the query surfaces.\n scheduleInvalidation();\n return;\n }\n\n if (eventName === 'ticket-status') {\n // Meaningful ticket-row change (close/reopen/pipeline move). The\n // server pushes an updated summary right after (closures count as\n // unread server-side); here we just refresh the query surfaces so\n // the status badge flips live.\n const frame = data as TicketStreamEvent | null;\n const ticketId = (frame?.data as { ticket_external_id?: string } | undefined)?.ticket_external_id;\n scheduleInvalidation(ticketId);\n return;\n }\n\n if (eventName === 'ticket-message') {\n const frame = data as TicketStreamEvent | null;\n const payload = frame?.data;\n if (!isTicketMessageData(payload)) {\n scheduleInvalidation();\n return;\n }\n // Always invalidate (own replies from another tab render live);\n // bump unread ONLY on the server-stamped predicate, and never for\n // the ticket whose drawer is open. The server's debounced summary\n // push reconciles moments later.\n scheduleInvalidation(payload.ticket_external_id);\n if (payload.countsAsUnread && payload.ticket_external_id !== openTicketIdRef.current) {\n bumpUnread(payload.ticket_external_id, payload.hubspot_created_at);\n }\n }\n };\n\n const handleStatus = (status: SseTransportStatus) => {\n // The client owns connection lifecycle (confirm timeout, server\n // retry grace, failed-reconnect pacing, hidden-suspend). The only\n // transport status with DOMAIN meaning is the ticket contract's\n // `no-stream` (204 = zero owned tickets): remember it so a domain\n // signal (own create_ticket, window focus) can retry.\n if (status === 'open') noStreamRef.current = false;\n if (status === 'no-stream') noStreamRef.current = true;\n };\n\n // Publish the three handlers into the stable ref. In an unconditional effect\n // rather than in the render body: every caller is an SSE transport callback,\n // which can only fire after a commit, and a render attempt React discards\n // must not be able to leave a handler behind that closes over state the user\n // never saw. Declared BEFORE the subscription effect so it is filled first\n // in the same flush.\n React.useEffect(() => {\n handlersRef.current.onConnected = handleConnected;\n handlersRef.current.onEvent = handleEvent;\n handlersRef.current.onStatus = handleStatus;\n });\n\n // Mount/unmount of the subscription — gated on auth + a usable URL.\n const streamEnabled = authed && !!streamUrl;\n React.useEffect(() => {\n if (!streamEnabled) return undefined;\n if (typeof window === 'undefined') return undefined;\n\n subscriptionRef.current = createSseSubscription({\n url: streamUrl,\n onEvent: (name, data) => handlersRef.current.onEvent(name, data),\n onStatusChange: status => handlersRef.current.onStatus(status),\n onConnectedChange: isConnected => handlersRef.current.onConnected(isConnected),\n // Long-lived per-user stream: suspend while hidden (scale relief),\n // resume + reconnect on visible/online — all inside the client.\n pauseWhenHidden: true,\n });\n\n const retryIfIdle = () => {\n // After a 204 (no-stream), a focus signal is the retry trigger.\n if (noStreamRef.current) {\n noStreamRef.current = false;\n subscriptionRef.current?.reconnectNow();\n }\n };\n window.addEventListener('focus', retryIfIdle);\n\n return () => {\n window.removeEventListener('focus', retryIfIdle);\n if (invalidateTimerRef.current) {\n clearTimeout(invalidateTimerRef.current);\n invalidateTimerRef.current = null;\n }\n subscriptionRef.current?.close();\n subscriptionRef.current = null;\n setConnected(false);\n setSummary(EMPTY_SUMMARY);\n };\n // handlersRef is stable; streamUrl/auth changes remount the stream.\n }, [streamEnabled, streamUrl]);\n\n // ---- Public API ----\n const markRead = React.useCallback(\n async (ticketExternalId: string) => {\n try {\n const response = await embedAuthedFetch(readUrl, {\n method: 'POST',\n body: JSON.stringify({ ticket_id: ticketExternalId }),\n });\n if (!response.ok) return;\n // 0-latency local zero, then reconcile with the response's\n // server-computed summary (THE truth — includes closure\n // accounting and other tickets).\n zeroUnread(ticketExternalId);\n const body = (await response.json().catch(() => null)) as { summary?: TicketUnreadSummary } | null;\n if (isSummaryData(body?.summary)) {\n setSummary({\n totalUnread: body.summary.totalUnread,\n tickets: body.summary.tickets ?? {},\n latestUnreadAt: body.summary.latestUnreadAt ?? {},\n });\n }\n } catch {\n // Non-fatal — the receipt lands on the next markRead; unread\n // state reconciles via the next server summary push.\n }\n },\n [readUrl, zeroUnread],\n );\n\n const setOpenTicketId = React.useCallback((ticketExternalId: string | null) => {\n openTicketIdRef.current = ticketExternalId;\n setOpenTicketIdState(ticketExternalId);\n }, []);\n\n const notifyTicketCreated = React.useCallback(() => {\n // Fresh connect → fresh ownership set + fresh server summary\n // (covers both the no-stream 204 wait state and an already-live\n // stream whose set predates the new ticket).\n noStreamRef.current = false;\n subscriptionRef.current?.reconnectNow();\n }, []);\n\n // Derived unread map — open ticket masked to 0 so a server summary\n // landing inside the markRead debounce window can't transiently\n // re-badge it.\n const value = React.useMemo<TicketLiveContextValue>(() => {\n let unreadByTicket = summary.tickets;\n let unreadTotal = summary.totalUnread;\n if (openTicketIdState && unreadByTicket[openTicketIdState]) {\n const masked = unreadByTicket[openTicketIdState];\n unreadByTicket = { ...unreadByTicket };\n delete unreadByTicket[openTicketIdState];\n unreadTotal = Math.max(0, unreadTotal - masked);\n }\n // Ticket with the NEWEST unread reply (compared as parsed epoch ms\n // via `stampMs` — mixed timezone offsets break string ordering) —\n // header cell routes there. Falls back to any unread key if a\n // timestamp is missing.\n let nextUnreadTicketId: string | null = null;\n let nextStampMs = 0;\n for (const id of Object.keys(unreadByTicket)) {\n const ms = stampMs(summary.latestUnreadAt[id]);\n if (nextUnreadTicketId === null || ms > nextStampMs) {\n nextUnreadTicketId = id;\n nextStampMs = ms;\n }\n }\n return {\n authed,\n connected,\n unreadTotal,\n unreadByTicket,\n nextUnreadTicketId,\n markRead,\n setOpenTicketId,\n notifyTicketCreated,\n };\n }, [summary, authed, connected, openTicketIdState, markRead, setOpenTicketId, notifyTicketCreated]);\n\n return <TicketLiveContext.Provider value={enabled ? value : null}>{children}</TicketLiveContext.Provider>;\n}\n","/**\n * Wire shape of a row returned by `POST /api/chat/agent/find-ticket`.\n * Mirrors the executor's projection at `lib/data/hubspot-tools.ts`\n * (`FIND_TICKET_SELECT` / `FindTicketResult`).\n *\n * Cross-repo duplication is INTENTIONAL: this lib ships independently\n * of the hub, so we can't import `FindTicketResult` from\n * `hubspot-tools.ts` directly. If the server adds a column to\n * `FIND_TICKET_SELECT`, also add it here. The smoke test in §F of the\n * plan covers the happy path; a wire-contract test belongs in the hub.\n *\n * `find-ticket` returns `customer_emails: string[]` (jsonb array), NOT\n * a single `customer_email`. The list is server-self-scoped to the\n * caller's session email; the array is exposed for admin/staff\n * surfaces, which the ticket center doesn't render.\n */\nexport interface TicketData {\n id: string;\n /** HubSpot ticket id (display number, e.g. \"1234\"). */\n external_id: string;\n subject: string | null;\n /** Short (≤400 char) HTML-stripped preview of the ticket body —\n * used for the list-card subtitle when needed. */\n preview: string | null;\n /** Longer (≤4k char) sanitized body. INCLUDES every appended\n * `content_addendum` comment because the `update_ticket` executor\n * reads + re-writes the `content` property server-side with a\n * `---` separator. Render this in the drawer's description block\n * and the user sees both the original message + every comment they\n * (or staff) added. */\n body: string | null;\n /** Canonical OPEN | CLOSED (HubSpot pipeline derived). */\n status: string | null;\n /** Human label like \"New\" / \"Working on it\" / \"Waiting on contact\" /\n * \"Closed\". Drives the badge text; canonical status drives color. */\n pipeline_stage_label: string | null;\n clickup_task_id: string | null;\n /** Snapshot of the linked ClickUp delivery task — populated server-side\n * via the `clickup_tasks` mirror when `clickup_task_id` is set. Drives\n * the \"Linked delivery\" card surface on the ticket drawer (status\n * badge + ClickUp deep link). `null` when no link OR the ClickUp row\n * was deleted / not yet synced. */\n clickup: TicketClickupSummary | null;\n priority: string | null;\n customer_emails: string[];\n customer_company: string | null;\n /** HubSpot contact's display name. Drives the customer attribution\n * on the drawer when the viewer is NOT the customer themselves\n * (admin browsing / multi-contact second viewer). Conversations\n * API messages don't carry per-message sender info on Custom\n * Channels, so this is the only reliable source for \"what's the\n * customer's name.\" */\n customer_name: string | null;\n /** HubSpot owner id of the agent assigned to this ticket. Carried as\n * raw id for debugging; rendering goes through `assignedOwner`. Null\n * when unassigned. */\n assigned_to: string | null;\n /** Resolved assigned-owner profile — name + email + avatar. Populated\n * server-side via `attachOwnerProfiles` which joins through the\n * `hubspot_owners` mirror to `profiles` by email. Drives the\n * \"Assigned to\" attribution in the drawer header. Null when\n * unassigned OR the owner couldn't be resolved (rare — only when\n * the agent was deleted from HubSpot between the ticket update and\n * the next owners reconcile). */\n assignedOwner: TicketAssignedOwner | null;\n hubspot_updated_at: string;\n}\n\n/** Resolved profile of a ticket's assigned agent — surfaced in the\n * drawer header. Subset of the server's `MirroredOwnerProfile`\n * trimmed to just the rendering fields. */\nexport interface TicketAssignedOwner {\n name: string | null;\n email: string | null;\n avatarUrl: string | null;\n}\n\n/** Compact projection of a linked ClickUp task — matches the server's\n * `ClickupSummary` and aligns with `DeliveryItem` so the linked-card\n * on a ticket can render through the same `DeliveryRow` primitive used\n * on `/bug-fixes-and-enhancements`. */\nexport interface TicketClickupSummary {\n /** ClickUp task external_id (e.g. \"86ad4e022\"). Used as the\n * `?focus=<id>` URL param to scroll the public delivery page to\n * this row. */\n external_id: string;\n title: string | null;\n description: string | null;\n /** ClickUp status name — e.g. \"complete\" / \"working\" / \"design approved\"\n * / \"waiting for release\". Used as the badge label. */\n status: string | null;\n /** ClickUp's per-status hex color (e.g. \"#008844\"). Forwarded to the\n * badge so colors match the ClickUp board exactly. */\n status_color: string | null;\n /** Bucket — `'backlog' | 'working' | 'complete' | 'unknown'`. Used as\n * a fallback when status_color is missing. */\n status_category: string | null;\n /** ClickUp custom item label (`'Bug'` / `'Request'`) — drives the\n * type badge (\"BUG-FIX\" / \"ENHANCEMENT\"). */\n task_type: string | null;\n custom_item_id: number | null;\n /** Every ClickUp list the task is associated with. UI joins with \", \". */\n list_names: string[];\n /** Unix-ms timestamps so the row's \"ACTIVE X ago\" subtitle uses the\n * shared `getRelativeTime()` helper. */\n date_opened: number | null;\n date_updated: number | null;\n date_closed: number | null;\n /** Direct https://app.clickup.com/t/<id> deep link. Kept on the wire\n * for admin surfaces; the customer-facing linked card navigates\n * internally instead. */\n clickup_url: string | null;\n /** Composed server-side via the SAME `buildDevSectionUrl` helper the\n * chat-inline delivery card uses. Carries `?search=<id>` so the\n * delivery list filters to that single task on landing. */\n delivery_href: string;\n /** Target platform name for the host's `useNavLink` to decide\n * same-tab vs new-tab on cross-platform links. */\n delivery_target_platform: string;\n /** Release version label set by the delivery team, e.g. \"0.9\" / \"1.0\".\n * Shown beside the status when present. */\n target_version: string | null;\n}\n\n/**\n * Optimistic placeholder a `submitTicket` call prepends to the list\n * BEFORE the server roundtrip resolves. Drawer is hidden until the\n * real id arrives. The wrapper destructures `_optimistic` before\n * forwarding to `<ChatTicketItem>` so the DOM doesn't see an unknown\n * prop.\n */\nexport interface OptimisticTicket extends TicketData {\n _optimistic: true;\n}\n\nexport type AnyTicket = TicketData | OptimisticTicket;\n\nexport function isOptimistic(t: AnyTicket): t is OptimisticTicket {\n return (t as OptimisticTicket)._optimistic === true;\n}\n\n/**\n * Shape of a single `['tickets', …]` TanStack-Query cache slot.\n * Mirrors `FindTicketResponse` in `hooks/use-tickets-list.ts` — kept\n * here because the cache-mutation call sites in `useTicketActions` and\n * `<HelpCenterList>` would otherwise have to redeclare the shape inline.\n *\n * A 2026-05-29 prod regression (`t.map is not a function` on\n * close/reopen) was caused by assuming the cache held a bare\n * `TicketData[]` instead of this wrapper — every helper that calls\n * `queryClient.setQueriesData` / `getQueriesData` on `['tickets']`\n * MUST type the value through this shape and project / reassemble\n * `tickets` explicitly.\n */\nexport interface TicketsCacheSlot {\n tickets?: TicketData[];\n count?: number;\n totalCount?: number;\n page?: number;\n pageSize?: number;\n totalPages?: number;\n scope?: 'self' | 'all';\n}\n\n/**\n * Stable server-side error codes the ticket-action helpers route\n * through `mapTicketActionError`. Anything else is treated as a generic\n * server error.\n *\n * Reply-specific codes (`HUBSPOT_5XX` / `HUBSPOT_400_VALIDATION` /\n * `HUBSPOT_404_THREAD` / `HUBSPOT_REPLY_UNKNOWN`) drive the drawer\n * banner that appears above the composer when a customer reply fails.\n * Distinct from `HUBSPOT_DISCONNECTED` (whole-system) and\n * `TICKET_NOT_FOUND` (terminal-row) — the reply codes are per-attempt\n * + retryable except for `HUBSPOT_404_THREAD`.\n */\nexport type TicketActionErrorCode =\n | 'PROPOSAL_NOT_CLAIMABLE'\n | 'TICKET_NOT_FOUND'\n | 'TICKET_OWNERSHIP_DENIED'\n | 'HUBSPOT_DISCONNECTED'\n | 'RATE_LIMITED'\n | 'INVALID_TOOL_ARGS'\n | 'HUBSPOT_5XX'\n | 'HUBSPOT_400_VALIDATION'\n | 'HUBSPOT_404_THREAD'\n | 'HUBSPOT_REPLY_UNKNOWN'\n | 'UNKNOWN';\n\nexport interface MappedTicketActionError {\n code: TicketActionErrorCode;\n /** Human-readable copy safe to show in a toast. */\n message: string;\n /** When true, the form should disable submit + show the\n * support-down banner. Set only for HUBSPOT_DISCONNECTED. */\n supportSystemDown: boolean;\n /** When true, the helper should remove the affected row optimistically\n * (TICKET_NOT_FOUND). */\n removeRowFromCache: boolean;\n /** Retry hint surfaced from a 429 response. Caller decides whether\n * to mention it in the toast. */\n retryAfterSeconds?: number;\n}\n\n/**\n * Defensive client-side cap on ticket text (initial content + comment\n * addendums). HubSpot Note engagements accept more, but a 100KB paste\n * should fail fast at the UI rather than burning a server round-trip.\n * Both the open-ticket form and the per-row comment textarea import\n * this so a future server-side hardening only touches one place.\n */\nexport const TICKET_TEXT_MAX_CHARS = 5000;\n\n/**\n * Wire contract of the ticket live stream (`GET /api/chat/agent/\n * ticket-stream`, SSE). Producer (the hub route's `mapEvent`) imports\n * THIS type — same producer/consumer SSOT pattern as\n * `ConversationEngagementWire = TicketEngagement`. A schema drift here\n * would be a silent serialization bug; keep one named contract.\n *\n * Frames carry METADATA ONLY — never message bodies. Content is always\n * refetched through the ACL'd `list-engagements` path (one read path).\n *\n * Event names (`eventType`):\n * - `ticket-message` — a message row landed in the mirror for one of\n * the viewer's tickets. `data` carries the metadata.\n * - `ticket-status` — a MEANINGFUL ticket-row change (status /\n * pipeline stage / closure) landed in the mirror. Server-side\n * old-vs-new diffing drops no-op writes (sync stamps). Clients\n * invalidate + refetch the summary (closures count as unread\n * server-side via `closed_at` vs the read receipt).\n * - `ticket-summary` — the server-computed `TicketUnreadSummary`.\n * THE stream is the summary webservice: pushed on connect (server-\n * side resync-on-reconnect) and re-pushed (debounced) after every\n * delivered event. Clients hold NO summary fetch path.\n * - `ticket-resync` — degraded frame: something happened that the\n * server couldn't fully describe (truncated Realtime payload, or\n * the connection's ownership set just gained tickets). A fresh\n * `ticket-summary` follows it; clients invalidate queries.\n *\n * The server also emits `status` frames (`subscribed` / `retrying` /\n * `reconnect_failed`) from the shared SSE utility — clients derive\n * `connected` from those, NOT from the HTTP stream being open.\n */\nexport type TicketStreamEventType = 'ticket-message' | 'ticket-status' | 'ticket-summary' | 'ticket-resync';\n\n/** Metadata payload of a `ticket-message` frame. */\nexport type TicketMessageStreamData = {\n ticket_external_id: string;\n /** Mirror row's HubSpot message id. */\n message_id: string;\n /** Server-stamped via the same direction predicate the wire mapper\n * uses. Clients never re-derive author classification. */\n authorRole: 'customer' | 'support';\n /** Server-stamped via the visibility+direction unread predicate\n * (`countsAsUnread` in the hub's conversations DAL). ONLY frames\n * with `true` may bump client-side unread state. */\n countsAsUnread: boolean;\n hubspot_created_at: string | null;\n};\n\n/** Metadata payload of a `ticket-status` frame. */\nexport type TicketStatusStreamData = {\n ticket_external_id: string;\n /** Canonical OPEN | CLOSED after the change. */\n status: string | null;\n pipeline_stage_label: string | null;\n closed_at: string | null;\n};\n\nexport interface TicketStreamEvent {\n eventType: TicketStreamEventType;\n /** Human-readable label (SSE envelope compat) — clients ignore it. */\n message: string;\n /** `ticket-message` → TicketMessageStreamData; `ticket-status` →\n * TicketStatusStreamData; `ticket-summary` → TicketUnreadSummary;\n * absent on `ticket-resync`. */\n data?: TicketMessageStreamData | TicketStatusStreamData | TicketUnreadSummary;\n}\n\n/**\n * The SINGLE unread source, delivered EXCLUSIVELY over the stream\n * (`ticket-summary` frames on connect + after events) and in\n * `ticket-read` responses. There is no summary fetch endpoint. Header\n * badge total AND per-row dots both read this via the\n * `TicketLiveProvider` map; missing keys mean 0.\n */\nexport type TicketUnreadSummary = {\n totalUnread: number;\n tickets: Record<string, number>;\n /** ISO timestamp of the NEWEST unread message per ticket (same keys as\n * `tickets`). Drives \"route to the most recent update\" on the header\n * cell: the ticket with the max value here is `nextUnreadTicketId`. */\n latestUnreadAt: Record<string, string>;\n};\n\n/**\n * Trailing debounce for `markRead` while the drawer is open and new\n * messages stream in — flushed on drawer close so a fast open/close\n * still persists the receipt. Named beside its sibling cadences so\n * every timing knob lives in one file.\n */\nexport const TICKET_MARK_READ_DEBOUNCE_MS = 2000;\n\n/**\n * Ticket deep-link SSOT — DEFINED in the server-safe param-keys module\n * (`utils/dev-sections/dev-section-param-keys.ts`, beside its sibling\n * `devSectionAnchorId`) because producers span both worlds: the hub's\n * SERVER-side chat-ref builder and the client header cell. Re-exported\n * here so ticket-surface consumers keep one import home.\n */\nexport { TICKET_OPEN_PARAM, buildTicketOpenHref } from '../../utils/dev-sections/dev-section-param-keys';\n\n/**\n * Centralized toast copy. Keep all wording here so QA / localization\n * can find every user-visible string in one file.\n */\nexport const TOAST_COPY = {\n open_success: { title: 'Ticket opened', description: 'We received your message and will follow up shortly.' },\n open_mirror_pending: { title: 'Ticket opened', description: 'Syncing — your ticket will appear momentarily.' },\n close_success: { title: 'Ticket closed' },\n reopen_success: { title: 'Ticket reopened' },\n comment_success: { title: 'Comment added' },\n attach_success: { title: 'Files attached' },\n // Failure variants are constructed dynamically from MappedTicketActionError.\n} as const;\n"]}
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  ArticleAuthorByline,
4
4
  DetailPageSkeleton
5
- } from "./chunk-ANMD7SM4.js";
5
+ } from "./chunk-LNF5W3QJ.js";
6
6
  import {
7
7
  DocSearchBar,
8
8
  useDocSearch
9
- } from "./chunk-NUU5ZEEG.js";
9
+ } from "./chunk-GZFVTFMU.js";
10
10
  import {
11
11
  useSelfFetch
12
12
  } from "./chunk-F2KBCLUG.js";
@@ -18,13 +18,13 @@ import {
18
18
  PageShell,
19
19
  RichMarkdownRenderer,
20
20
  resolveContentHref
21
- } from "./chunk-YCZBCEQO.js";
21
+ } from "./chunk-5AB6QLIQ.js";
22
22
  import {
23
23
  EntityVideoSection,
24
24
  VideoBitesStrip,
25
25
  useCaptions,
26
26
  useVideoWarmup
27
- } from "./chunk-FCN2HN6Q.js";
27
+ } from "./chunk-7FPWMX26.js";
28
28
  import {
29
29
  useRouter,
30
30
  useSearchParams
@@ -34,7 +34,7 @@ import {
34
34
  OnboardingGuideCard,
35
35
  OnboardingGuideCardSkeleton,
36
36
  toStripProfile
37
- } from "./chunk-GXUGYZ6H.js";
37
+ } from "./chunk-43JQ3SJS.js";
38
38
  import {
39
39
  buildOgPlaceholderUrl
40
40
  } from "./chunk-FKBM6U43.js";
@@ -389,4 +389,4 @@ export {
389
389
  useOnboardingGuide,
390
390
  useOnboardingGuideSections
391
391
  };
392
- //# sourceMappingURL=chunk-J25M43YI.js.map
392
+ //# sourceMappingURL=chunk-T7FTSJM2.js.map
@@ -8,11 +8,13 @@ import {
8
8
  buildSuggestionUrl,
9
9
  getContentRefLabelOrTitleCase,
10
10
  orderContentRefTypes
11
- } from "./chunk-GBON2OCG.js";
11
+ } from "./chunk-5WGOAJ4B.js";
12
12
  import {
13
13
  pageCount
14
14
  } from "./chunk-BVQEU5JB.js";
15
15
  import {
16
+ AiPromptCard,
17
+ AiPromptCardSkeleton,
16
18
  BlogCard,
17
19
  BlogCardSkeleton,
18
20
  CaseStudyCard,
@@ -39,7 +41,7 @@ import {
39
41
  decideNewTab,
40
42
  extractItemId,
41
43
  extractItems
42
- } from "./chunk-GXUGYZ6H.js";
44
+ } from "./chunk-43JQ3SJS.js";
43
45
 
44
46
  // src/components/related-content/related-content-section.tsx
45
47
  import { useEffect, useMemo, useRef, useState } from "react";
@@ -391,6 +393,8 @@ function decodeProgramRow(row) {
391
393
  }
392
394
  function decodeEmployeeEntryRow(row) {
393
395
  const record = asRecord(row);
396
+ const department = asRecord(record.department);
397
+ const stepCount = record.step_count;
394
398
  return {
395
399
  title: strOrNull(record, "title"),
396
400
  summary: strOrNull(record, "summary"),
@@ -400,7 +404,10 @@ function decodeEmployeeEntryRow(row) {
400
404
  author: decodeEntityAuthor(record.author),
401
405
  entry_month: strOrNull(record, "entry_month"),
402
406
  session_date: strOrNull(record, "session_date"),
403
- discipline: strOrNull(record, "discipline")
407
+ discipline: strOrNull(record, "discipline"),
408
+ published_at: strOrNull(record, "published_at"),
409
+ department: record.department ? { name: strOrNull(department, "name") } : null,
410
+ step_count: typeof stepCount === "number" ? stepCount : null
404
411
  };
405
412
  }
406
413
  function cardEntry(definition) {
@@ -588,6 +595,19 @@ var RELATED_CARD_REGISTRY = {
588
595
  }
589
596
  )
590
597
  }),
598
+ /** Same shared employee-entry shape + anchor contract as What I Shipped. */
599
+ ai_prompt: cardEntry({
600
+ skeleton: () => /* @__PURE__ */ jsx(AiPromptCardSkeleton, {}),
601
+ decode: decodeEmployeeEntryRow,
602
+ render: (entry, ctx) => /* @__PURE__ */ jsx(
603
+ AiPromptCard,
604
+ {
605
+ entry,
606
+ placeholderUrl: ctx.placeholderUrl,
607
+ anchorProps: ctx.linkProps ?? (ctx.href ? { href: ctx.href, ...ctx.anchorAttrs } : void 0)
608
+ }
609
+ )
610
+ }),
591
611
  roadmap_item: roadmapEntry("roadmap_item"),
592
612
  delivery_item: roadmapEntry("delivery_item"),
593
613
  internal_task: roadmapEntry("internal_task")
@@ -858,4 +878,4 @@ export {
858
878
  GROUP_PAGE_SIZE,
859
879
  RelatedContentSection
860
880
  };
861
- //# sourceMappingURL=chunk-6XJS3WU7.js.map
881
+ //# sourceMappingURL=chunk-TMGTVVE2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/related-content/related-content-section.tsx","../src/components/related-content/card-registry.tsx"],"sourcesContent":["'use client';\n\n/**\n * RelatedContentSection\n *\n * Renders content references grouped by type using the canonical card\n * components. MOVED from the hub (`components/shared/related-content-card.tsx`)\n * so any consuming app can embed it; the hub keeps a thin wrapper that\n * pre-binds its host-specific injections (nav hook, URL recomposition,\n * program configs, admin campaign card).\n *\n * THREE data modes (precedence top-down):\n * 1. CONTROLLED — `contentRefs` provided (even `[]`): render exactly those\n * refs, no suggestion fetch (the original investor-update behavior).\n * 2. SUGGESTION — `entityType` + `entityId` provided: self-fetch\n * `GET {apiBaseUrl}/api/related-content?entityType&entityId[&count][&excludeTypes]`\n * (the generic 5-tier engine's second web service). `minResults` maps to\n * `count`; absent → param not sent (server default applies). Each ref\n * carries a `reason` (data-only — never rendered, matching the\n * FaqSection/FaqWithReason precedent).\n * 3. SSR-HYDRATED suggestion — also pass `initialItems` (the server page\n * called the engine directly); the first client fetch is skipped per the\n * `useSelfFetch` initialData contract.\n *\n * Group layout (list vs grid) + card size (lg vs default) come from\n * `CONTENT_REF_GROUPS` in `../../utils/content-ref-groups` — single source of\n * truth, no per-type logic in this file. Skeletons come from\n * `renderSkeletonForType` so the placeholder height matches the loaded card\n * exactly (zero layout shift on resolve).\n *\n * One API call per content type via the shared list-URL builder\n * (`buildListUrl` — injectable; defaults to the lib's byte-parity-tested\n * builder prefixed with `apiBaseUrl`). Fetching uses `useSelfFetch` (plain\n * fetch, NO react-query) so third-party embedders need no QueryClientProvider;\n * cards are imported via DEEP module paths (not the chat barrel) so this\n * chunk never reaches `@tanstack/react-query`.\n *\n * The per-type card + skeleton dispatch lives in `./card-registry`\n * (`RELATED_CARD_REGISTRY`): ONE entry per content type, each carrying that\n * type's own row type and the `unknown` → row decode, so a fetched row reaches\n * its card concretely typed. This file only picks the entry and builds the\n * shared render context.\n *\n * LOCKSTEP NOTE: that registry is the SIZED sibling of the chat-side\n * `CHAT_CARD_REGISTRY` (`../chat/entity-cards/dispatch.tsx`), which renders\n * compact `size='sm'` cards wired to the chat runtime. Two dispatchers by\n * design — when registering a new fetch-mode content type, add it BOTH there\n * and in `./card-registry` (card + skeleton + list URL).\n */\n\nimport type React from 'react';\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { useSelfFetch } from '../../hooks/use-self-fetch';\nimport type { ContentRef, ContentRefWithReason } from '../../types/content-ref';\nimport {\n CONTENT_REF_GROUPS,\n getContentRefLabelOrTitleCase,\n orderContentRefTypes,\n type ContentRefGroupConfig,\n} from '../../utils/content-ref-groups';\nimport { extractItems, extractItemId } from '../../utils/extract-items';\nimport { buildListUrl as libBuildListUrl, canonicalContentRefType } from '../../utils/list-url';\nimport { pageCount } from '../../utils/search-params';\nimport { buildSuggestionUrl } from '../../utils/suggestion-url';\n// Type-only — erased at build, no runtime dependency on the dispatch module.\nimport type { ChatCardDispatchExtras } from '../chat/entity-cards/dispatch';\nimport { decideNewTab } from '../chat/utils/decide-new-tab';\nimport { Pagination } from '../pagination';\n// The per-type card dispatch — one registry entry per content type, each\n// carrying its OWN row type — plus the DEEP card imports that keep this\n// chunk's source graph free of @tanstack/react-query (the `../chat` barrel\n// reaches it via embeddable-chat; deep paths don't). `CardSize` and\n// `CardLinkAnchorProps` are declared alongside the registry, its primary\n// consumer, and re-exported below so the subpath barrel is unchanged.\nimport {\n RELATED_CARD_REGISTRY,\n rowString,\n type CardLinkAnchorProps,\n type CardSize,\n type RelatedCardRegistryEntry,\n} from './card-registry';\n\nexport type { CardLinkAnchorProps };\n\n/** Render-prop component injection for the navigation decision — keeps hook\n * calls legal (hooks live INSIDE the injected component; `CardForType`\n * itself calls zero hooks). The hub injects a `useNavLink`-backed provider;\n * the default is hook-free (pure `decideNewTab`). MUST be defined at module\n * scope by hosts — an inline arrow would remount every card each render. */\nexport interface CardLinkProviderProps {\n href: string | null;\n targetPlatform: string | null;\n children: (linkProps: CardLinkAnchorProps | null) => React.ReactElement | null;\n}\nexport type CardLinkProvider = React.ComponentType<CardLinkProviderProps>;\n\n/** Default link provider for standalone embeds: relative/-same-origin hrefs\n * stay same-tab, cross-origin pops a new tab (pure `decideNewTab` with no\n * platform context — `currentSource: ''` falls through to the origin\n * check). No router integration, no hooks. */\nfunction DefaultLinkPropsProvider({\n href,\n targetPlatform,\n children,\n}: CardLinkProviderProps): React.ReactElement | null {\n if (!href) return children(null);\n const newTab = decideNewTab({ href, targetPlatform, currentSource: '' });\n return children(newTab ? { href, target: '_blank', rel: 'noopener noreferrer' } : { href });\n}\n\n/** Default href resolution: trust the ref's stored url/targetPlatform as the\n * API composed them. The hub overrides this with its `buildContentURL`\n * re-composition so dev gets localhost and prod gets platform domains. */\nfunction defaultResolveHref(ref: ContentRef): { href: string | null; targetPlatform: string | null } {\n return { href: ref.url || null, targetPlatform: ref.targetPlatform ?? null };\n}\n\n/** Host-injected renderer pair for the admin-only `marketing_campaign` type.\n * Absent (every non-hub embed) → the type renders nothing (its list URL\n * hits `/api/admin`, unreachable outside the hub anyway). */\nexport interface AdminCampaignCardSlot {\n /**\n * The host's own campaign card. Its `campaign` prop is a HOST row type this\n * lib cannot name (the hub's `MarketingCampaign`), and React props are\n * CONTRAVARIANT, so this is the one seam in the rail with no honest type.\n * All three alternatives were compiled against the hub's real\n * `CampaignCardAdmin`:\n *\n * - `unknown` — the host can no longer inject: TS2322, \"Type\n * '{ campaign: unknown }' is not assignable to\n * '{ campaign: MarketingCampaign }'\".\n * - `never` — every host component assigns, but the rail can no longer\n * hand it a row: TS2769, \"Type 'unknown' is not assignable to 'never'\".\n * - a generic on the slot's OWNER (`AdminCampaignCardSlot<TCampaign>`\n * threaded through `RelatedContentSectionProps`) — inference from the\n * host's card works, but the render still fails: TS2769, \"'TCampaign'\n * could be instantiated with an arbitrary type\". The rail holds an\n * unvalidated row; only the HOST knows how to narrow it.\n *\n * Typing this means changing the injection contract (a host-supplied\n * `render(row: unknown)` closure instead of a component), which is a\n * breaking change for every embedder that passes `{ Card, Skeleton }`.\n * Everything the rail renders ITSELF now goes through the per-type\n * `RELATED_CARD_REGISTRY`; this is the only `any` left.\n */\n Card: React.ComponentType<{ campaign: any }>;\n Skeleton: React.ComponentType<{ size?: 'default' | 'sm' }>;\n}\n\n/**\n * Per-type skeleton dispatch — returns the SAME colocated skeleton the\n * resolved card renders, sized to match (zero layout shift on resolve). One\n * lookup through `RELATED_CARD_REGISTRY`, exactly the way the chat-side\n * `CHAT_CARD_REGISTRY` does it via `entry.skeleton()`.\n *\n * `marketing_campaign` is the one type with no registry entry: BOTH its card\n * and its skeleton are host-injected (`AdminCampaignCardSlot`), so there is no\n * lib component to register.\n */\nfunction renderSkeletonForType(\n type: string,\n size: CardSize,\n adminCampaignCard?: AdminCampaignCardSlot,\n): React.ReactNode {\n if (type === 'marketing_campaign') {\n return adminCampaignCard ? <adminCampaignCard.Skeleton size={size === 'sm' ? 'sm' : 'default'} /> : null;\n }\n const entry: RelatedCardRegistryEntry | undefined = RELATED_CARD_REGISTRY[type];\n return entry ? entry.skeleton(size) : null;\n}\n\n/**\n * Per-type card dispatch — ONE lookup through `RELATED_CARD_REGISTRY`, whose\n * entries each pair a skeleton with a card renderer that closes over that\n * type's OWN row type. Sized cards (`'lg'` / `'default'`) are unique to this\n * rail; the chat dispatcher only renders `'sm'`.\n *\n * PURE FUNCTION COMPONENT WITH ZERO HOOK CALLS: the placeholder comes from a\n * plain `extras.buildOgPlaceholderUrl` call (the chat `dispatch.tsx`\n * pattern) and the anchor-prop bundle arrives via the `LinkProvider`\n * render-prop from the parent — so per-card hook legality is owned by the\n * injected provider component, not by this dispatcher.\n *\n * `href` comes from the host's `resolveHref(ref)` (hub: live\n * `buildContentURL` recomposition; default: the ref's stored url).\n */\nfunction CardForType({\n type,\n item,\n size,\n href,\n targetPlatform,\n linkProps,\n extras,\n adminCampaignCard,\n}: {\n type: string;\n /** One fetched row, still unvalidated. Its shape is decided at RUNTIME by\n * `type` (each group fetches from its own per-type list API), so it stays\n * `unknown` right up to the registry entry for that type — which owns the\n * `unknown` → row-type decode and hands its card a concretely typed row. */\n item: unknown;\n size: CardSize;\n href: string;\n targetPlatform: string | null;\n linkProps: CardLinkAnchorProps | null;\n extras?: ChatCardDispatchExtras;\n adminCampaignCard?: AdminCampaignCardSlot;\n}): React.ReactNode {\n // Host-injected admin slot — the only type with no registry entry, because\n // both its card and its skeleton come from the host (see\n // `AdminCampaignCardSlot`). Handled before the lookup so the registry stays\n // a pure lib-card table.\n if (type === 'marketing_campaign') {\n return adminCampaignCard ? <adminCampaignCard.Card campaign={item} /> : null;\n }\n\n const entry: RelatedCardRegistryEntry | undefined = RELATED_CARD_REGISTRY[type];\n if (!entry) return null;\n\n return entry.render(item, {\n size,\n // Most card variants accept only `{default, sm}`. `'lg'` collapses to\n // `'default'` for those. ProductReleaseCard uses its own lg/sm pair.\n legacySize: size === 'sm' ? 'sm' : 'default',\n href,\n targetPlatform,\n linkProps,\n // Top-level target/rel for cards that take them as separate props\n // (BlogCard, CaseStudyCard, …). ProductReleaseCard takes the bundle as a\n // single `anchorProps={...}` and uses `linkProps` directly. When the host\n // didn't surface a URL, `linkProps` is null and the card stays in\n // non-anchor mode.\n anchorAttrs: linkProps ? { target: linkProps.target, rel: linkProps.rel } : {},\n // OG placeholder URL — injected into the pure-presentation cards so they\n // render a branded fallback when the row's featured image is null. Plain\n // function call (NOT a hook). Title is the universal field across all card\n // row shapes used here.\n // `item?.title as string | undefined` claimed a string without checking one:\n // a numeric title reached `buildOgPlaceholderUrl` as a number. `rowString`\n // makes the claim true.\n placeholderUrl: extras?.buildOgPlaceholderUrl?.(rowString(item, 'title') ?? '') ?? undefined,\n extras,\n });\n}\n\n// =============================================================================\n// Fetch all items for a type in ONE server-sorted call, via the injectable\n// list-URL builder. `useSelfFetch` (URL = cache key) replaces the hub's old\n// react-query usage: `enabled` ≙ `url === null`, `!res.ok`/network error ≙\n// `error → items null → group renders nothing`. Accepted deltas vs\n// react-query: no retry/backoff, no focus refetch, no cross-mount cache.\n// =============================================================================\n\nfunction useGroupItems(type: string, refs: ContentRef[], buildUrl: (type: string, ids: string[]) => string | null) {\n const ids = refs.map(r => r.id);\n const url = ids.length > 0 ? buildUrl(type, ids) : null;\n const { data, isLoading } = useSelfFetch<unknown>(url);\n const items = data != null ? extractItems(data) : null;\n return { items, isLoading };\n}\n\n// =============================================================================\n// Per-group renderer — one API call, server-sorted, then render cards via the\n// dispatcher with per-type skeletons + per-type layout from CONTENT_REF_GROUPS.\n// =============================================================================\n\n/** Map columns prop → tailwind grid class. Only consulted for grid-layout\n * groups; list-layout groups stack vertically. */\nfunction gridClassFor(columns: 2 | 3): string {\n return columns === 3\n ? 'grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6'\n : 'grid grid-cols-1 sm:grid-cols-2 gap-6';\n}\n\n/** Resolve the group config for a type, falling back to a grid layout with\n * the default card size for unregistered types so the section still renders\n * rather than silently dropping them. The `label` field on the fallback is\n * intentionally a placeholder — the section heading goes through\n * `getContentRefLabelOrTitleCase(type)` instead so cross-surface labels\n * stay consistent between this rail and the investor-email builder. */\nfunction resolveGroupConfig(type: string): ContentRefGroupConfig {\n return (\n CONTENT_REF_GROUPS[type] ?? {\n label: type,\n order: 999,\n layout: 'grid',\n gridSize: 'default',\n }\n );\n}\n\n/** Items per page within one type group. Groups larger than this paginate\n * with the standard Pagination control (NO nested scrolling — a bounded\n * scrollbox inside the page traps wheel events and hides the sections\n * below it). MUST stay at or above the largest suggestion fill\n * (RELATED_SAME_TYPE_COUNT in the hub's lib/constants/suggestions.ts) so\n * current rails never paginate — only genuinely big groups (author pages)\n * do. Exported through the subpath barrel for the hub's module-load\n * assertion of that relation (entity-suggestion-sections.tsx). */\nexport const GROUP_PAGE_SIZE = 12;\n\nfunction ContentGroup({\n type,\n refs,\n columns,\n buildUrl,\n resolveHref,\n LinkProvider,\n extras,\n adminCampaignCard,\n heading,\n}: {\n type: string;\n refs: ContentRef[];\n columns: 2 | 3;\n buildUrl: (type: string, ids: string[]) => string | null;\n resolveHref: (ref: ContentRef) => { href: string | null; targetPlatform: string | null };\n LinkProvider: CardLinkProvider;\n extras?: ChatCardDispatchExtras;\n adminCampaignCard?: AdminCampaignCardSlot;\n /** Group heading, rendered INSIDE the group so a group that resolves to\n * nothing (fetch miss / unsupported type / missing program config) drops\n * its heading too — no orphaned titles. */\n heading: React.ReactNode;\n}) {\n const { items, isLoading } = useGroupItems(type, refs, buildUrl);\n const config = resolveGroupConfig(type);\n const isListLayout = config.layout === 'list';\n const cardSize = config.gridSize;\n\n // Per-group pagination for big groups (author pages): GROUP_PAGE_SIZE items\n // per page with the standard Pagination control below the group. Client-side\n // slicing — useGroupItems already fetched every row in one batched call, so\n // page flips are instant. Hooks live above every early return (file\n // convention). Page is clamped so a shrinking refs array (suggestion\n // refetch) can never strand the view past the last page, and RESET when the\n // ref set actually changes (shrink→grow must not return to a stale page).\n const [page, setPage] = useState(1);\n const refsKey = refs.map(r => r.id).join('|');\n const prevRefsKeyRef = useRef(refsKey);\n useEffect(() => {\n if (prevRefsKeyRef.current !== refsKey) {\n prevRefsKeyRef.current = refsKey;\n setPage(1);\n }\n }, [refsKey]);\n const totalGroupPages = pageCount(refs.length, GROUP_PAGE_SIZE);\n const safePage = Math.min(page, totalGroupPages);\n const visibleGroupRefs =\n refs.length > GROUP_PAGE_SIZE ? refs.slice((safePage - 1) * GROUP_PAGE_SIZE, safePage * GROUP_PAGE_SIZE) : refs;\n const groupPagination =\n totalGroupPages > 1 ? (\n <Pagination currentPage={safePage} totalPages={totalGroupPages} onPageChange={setPage} />\n ) : null;\n\n // Skeleton gate: `isLoading && !items` — SSR HTML and the client's first\n // paint render identical skeletons (useSelfFetch starts isLoading=true on\n // both sides), and once items exist they are never replaced by skeletons.\n if (isLoading && !items) {\n const skeletons = visibleGroupRefs.map(r => (\n <div key={r.id}>{renderSkeletonForType(type, cardSize, adminCampaignCard)}</div>\n ));\n return (\n <div className=\"space-y-4\">\n {heading}\n {isListLayout ? (\n <div className=\"space-y-4\">{skeletons}</div>\n ) : (\n <div className={gridClassFor(columns)}>{skeletons}</div>\n )}\n </div>\n );\n }\n\n if (!items || items.length === 0) return null;\n\n // Index fetched rows by id, then render in REF order — refs carry the\n // intended sequence (suggestion mode: the engine's tier order, so\n // same-platform/tag-matched items lead; controlled mode: the curated\n // display_order). The list APIs return rows date-sorted, which would\n // otherwise scramble that ordering (same-platform items sinking below\n // newer cross-platform ones).\n // Shared extractor (NOT raw `.id`) — some API shapes key items differently\n // (e.g. external_id types); raw access would silently drop valid items.\n const rowKey = (it: unknown): string => {\n const extracted = extractItemId(type, it);\n if (extracted !== null) return extracted;\n // Fallback for shapes `extractItemId` doesn't recognise — same\n // `String(it?.id)` the untyped version produced.\n return String(typeof it === 'object' && it !== null ? (it as { id?: unknown }).id : undefined);\n };\n const itemById = new Map(items.map(it => [rowKey(it), it]));\n\n const cards = visibleGroupRefs\n .map(contentRef => {\n const itemId = String(contentRef.id);\n const item = itemById.get(itemId);\n if (!item) return null;\n // Re-compose the URL via the host's resolver (hub: buildContentURL so\n // dev gets localhost and prod the right platform domain; default: the\n // ref's stored url as the API composed it).\n const resolved = resolveHref(contentRef);\n const href = resolved.href ?? '';\n const targetPlatform = resolved.targetPlatform ?? contentRef.targetPlatform ?? null;\n return (\n <div key={itemId}>\n <LinkProvider href={href || null} targetPlatform={targetPlatform}>\n {linkProps => (\n <CardForType\n type={type}\n item={item}\n size={cardSize}\n href={href}\n targetPlatform={targetPlatform}\n linkProps={linkProps}\n extras={extras}\n adminCampaignCard={adminCampaignCard}\n />\n )}\n </LinkProvider>\n </div>\n );\n })\n .filter(Boolean);\n\n if (cards.length === 0) {\n // Current PAGE resolved zero cards (rows deleted between the ref fetch\n // and the group fetch, or a stricter list-API gate dropped them). When a\n // pager exists the user must keep the controls to navigate back —\n // dropping the whole group would strand them. A genuinely empty group\n // (no pager) still vanishes with its heading.\n if (groupPagination) {\n return (\n <div className=\"space-y-4\">\n {heading}\n {groupPagination}\n </div>\n );\n }\n return null;\n }\n\n return (\n <div className=\"space-y-4\">\n {heading}\n {isListLayout ? <div className=\"space-y-4\">{cards}</div> : <div className={gridClassFor(columns)}>{cards}</div>}\n {groupPagination}\n </div>\n );\n}\n\n// =============================================================================\n// Main component\n// =============================================================================\n\ninterface RelatedContentResponse {\n refs: ContentRefWithReason[];\n}\n\nexport interface RelatedContentSectionProps {\n /** CONTROLLED mode (the original behavior). When defined — even `[]` — no\n * suggestion fetch runs and exactly these refs render. */\n contentRefs?: ContentRef[];\n /** SUGGESTION mode (with `entityId`): self-fetch suggestions for this host\n * entity from `{apiBaseUrl}/api/related-content`. Ignored when\n * `contentRefs` is provided. */\n entityType?: string;\n entityId?: number | string;\n /** AUTHOR mode: self-fetch ALL published content authored by this profile\n * from `{apiBaseUrl}/api/related-content?authorId=…` (grouped per type,\n * endless within each group). Ignored when `contentRefs` is provided;\n * takes precedence over the entityType/entityId suggestion scope.\n * SSR-hydrate via `initialItems`, same as suggestion mode. */\n authorId?: string;\n /** Maps to the suggestion API's `count` param — the PER-TYPE fill target\n * for every candidate type EXCEPT the host's own. Absent → param not sent\n * (server default applies). */\n minResults?: number;\n /** Maps to the suggestion API's `sameTypeCount` param — the budget for the\n * candidate type MATCHING the host's own `entityType` (same-type boost:\n * a blog post's rail leads with more blog posts). Absent → param not\n * sent (host's type uses the server's `count`). */\n sameTypeMinResults?: number;\n /** SSR hydrate for suggestion mode — the server page ran the engine and\n * drills the refs here; the first client fetch is skipped (useSelfFetch\n * initialData contract). */\n initialItems?: ContentRefWithReason[];\n /** Section title (default: \"Related Content\") */\n title?: string;\n /**\n * Grid columns at desktop. 2 = denser cards / wider summary (original\n * investor-update layout); 3 = more cards per row for dashboards.\n * Only consulted for grid-layout groups. Default: 2.\n */\n columns?: 2 | 3;\n /**\n * ContentRef.type values to exclude. Honored in ALL modes — controlled\n * mode post-filters (original behavior); suggestion mode ALSO forwards the\n * list verbatim as the API's `excludeTypes=` param so excluded types never\n * consume engine fill slots (`minResults` stays honored). The subtraction\n * happens SERVER-side — this component never mirrors the hub's candidate\n * list.\n */\n excludeTypes?: string[];\n /**\n * SUGGESTION-mode allow-list (rail vocabulary): which content types\n * participate in this rail. Sent verbatim as the API's `types=` param —\n * the SERVER intersects it with its own allowed candidate set, and\n * platform policy gates (e.g. internal-only types) ALWAYS win: the client\n * cannot request its way past them. Absent → all server-side candidates.\n */\n includeTypes?: string[];\n /** Fetch-URL prefix for third-party embeds / reverse proxies\n * ('' = same-origin). Applied to BOTH the suggestion fetch and the\n * default per-group list fetches. */\n apiBaseUrl?: string;\n /** Host injection bundle — REUSES the chat dispatcher's\n * `ChatCardDispatchExtras` (programConfigs, buildOgPlaceholderUrl,\n * buildProductReleaseCardProps override). Program groups render nothing\n * when their config is absent. */\n extras?: ChatCardDispatchExtras;\n /** Hub injects its `buildContentURL` recomposition; default uses the\n * ref's stored `url`/`targetPlatform` as the API composed them. */\n resolveHref?: (ref: ContentRef) => { href: string | null; targetPlatform: string | null };\n /** Hub injects its registry-driven entity-list-api builder; default = the\n * lib's `buildListUrl(type, ids, apiBaseUrl)`. */\n buildListUrl?: (type: string, ids: string[]) => string | null;\n /** Hub injects a `useNavLink`-backed render-prop provider; default = pure\n * anchor via `decideNewTab`. MUST be a module-scope component. */\n LinkProvider?: CardLinkProvider;\n /** Renderer pair for the admin-only `marketing_campaign` type. Absent →\n * the type renders nothing. */\n adminCampaignCard?: AdminCampaignCardSlot;\n /** When true, render the section shell (title + an empty-state line) even\n * with ZERO refs, instead of returning null. Default false (the original\n * behavior — empty rail = no shell). Opt-in per host page (e.g. people-hub's\n * \"What I Shipped\", where the section should always be present). */\n showWhenEmpty?: boolean;\n /** Empty-state copy shown under the title when `showWhenEmpty` and no refs.\n * Default: \"No related content yet.\" */\n emptyStateText?: string;\n /** Custom empty-state node (e.g. a hub `<EmptyState/>`) rendered under the\n * title when `showWhenEmpty` and there are no refs — overrides\n * `emptyStateText`. Lets a host match its canonical empty state. */\n emptyState?: React.ReactNode;\n}\n\nexport function RelatedContentSection({\n contentRefs,\n entityType,\n entityId,\n authorId,\n minResults,\n sameTypeMinResults,\n includeTypes,\n initialItems,\n title = 'Related Content',\n columns = 2,\n excludeTypes,\n apiBaseUrl = '',\n extras,\n resolveHref = defaultResolveHref,\n buildListUrl,\n LinkProvider = DefaultLinkPropsProvider,\n adminCampaignCard,\n showWhenEmpty = false,\n emptyStateText = 'No related content yet.',\n emptyState,\n}: RelatedContentSectionProps) {\n // ── Hooks above EVERY early return (the original `if (!contentRefs.length)\n // return null` guard moved below them). ──\n\n // Suggestion-mode fetch URL — null in controlled mode (contentRefs defined,\n // even []) or when the entity scope is incomplete.\n // `includeTypes: []` is an explicit \"nothing participates\" — skip the fetch\n // entirely (an empty-string `types=` param would be dropped by the URL\n // builder and read server-side as \"all candidates\") AND ignore SSR refs.\n const suggestionsDisabled = includeTypes?.length === 0;\n // Shared type-filter params — one spelling for both fetch modes so a future\n // normalization (trim/dedupe) can't diverge between them.\n const typeFilterParams = {\n types: includeTypes !== undefined ? includeTypes.join(',') : undefined,\n excludeTypes: excludeTypes && excludeTypes.length > 0 ? excludeTypes.join(',') : undefined,\n };\n // AUTHOR mode beats suggestion mode: when `authorId` is set the rail lists\n // everything that profile authored (the server returns ALL, no count).\n const authorUrl =\n contentRefs === undefined && authorId && !suggestionsDisabled\n ? buildSuggestionUrl('/api/related-content', {\n apiBaseUrl,\n extraParams: { authorId, ...typeFilterParams },\n })\n : null;\n const suggestUrl =\n authorUrl ??\n (contentRefs === undefined &&\n entityType &&\n entityId !== undefined &&\n entityId !== null &&\n entityId !== '' &&\n !suggestionsDisabled\n ? buildSuggestionUrl('/api/related-content', {\n apiBaseUrl,\n entityType,\n entityId,\n count: minResults,\n extraParams: {\n sameTypeCount: sameTypeMinResults !== undefined ? String(sameTypeMinResults) : undefined,\n ...typeFilterParams,\n },\n })\n : null);\n // Memoize the initialData wrapper — useSelfFetch re-syncs on [initialData],\n // and a fresh per-render object would loop setState under re-rendering\n // parents (the latent FaqSection bug, fixed there in the same change).\n const initialData = useMemo<RelatedContentResponse | undefined>(\n // An explicitly disabled rail (includeTypes: []) must ignore SSR-hydrated\n // refs too — otherwise useSelfFetch(null, {initialData}) keeps serving\n // initialItems and the \"nothing participates\" contract silently breaks.\n () => (!suggestionsDisabled && initialItems ? { refs: initialItems } : undefined),\n [initialItems, suggestionsDisabled],\n );\n const { data, isLoading } = useSelfFetch<RelatedContentResponse>(suggestUrl, { initialData });\n\n // Default group fetcher: the lib's byte-parity-tested builder, prefixed for\n // embeds. Memoized so group-fetch URLs stay value-stable across renders.\n const effectiveBuildListUrl = useMemo(\n () => buildListUrl ?? ((type: string, ids: string[]) => libBuildListUrl(type, ids, apiBaseUrl)),\n [buildListUrl, apiBaseUrl],\n );\n\n const refs: ContentRef[] = contentRefs ?? data?.refs ?? [];\n\n // Per-consumer type gating — drops refs whose `type` is in the exclude\n // list. In suggestion mode the server already subtracted these (the param\n // is forwarded above); the client filter stays as an idempotent guard and\n // IS the mechanism in controlled mode (original behavior).\n const exclude = new Set(excludeTypes || []);\n const visibleRefs = exclude.size > 0 ? refs.filter(r => !exclude.has(r.type)) : refs;\n // Zero refs (still loading in suggestion mode, or genuinely empty). Default:\n // no empty shell. Opt-in (`showWhenEmpty`): render the title + an empty-state\n // line so the section is always present (e.g. people-hub \"What I Shipped\").\n if (!visibleRefs.length) {\n if (!showWhenEmpty) return null; // non-showWhenEmpty consumers stay blank (unchanged)\n // Client-fetch loading (author/suggestion mode, no SSR initialItems): render a\n // SKELETON grid — reserves height + matches the rest of the app's loading, so\n // there's no blank-then-pop jump (the prior `return null` collapsed the tab to\n // zero height during the fetch). SSR controlled mode has isLoading=false → it\n // skips straight to the empty state below. Skeleton type = the requested rail\n // type (author mode passes a single `includeTypes`).\n if (isLoading) {\n const skeletonType = includeTypes?.[0] ?? entityType ?? 'blog_post_existing';\n return (\n <div className=\"space-y-8\">\n <h2 className=\"text-ods-text-primary text-h2\">{title}</h2>\n <div className={gridClassFor(columns)}>\n {Array.from({ length: 3 }).map((_, i) => (\n <div key={i}>{renderSkeletonForType(skeletonType, 'default', adminCampaignCard)}</div>\n ))}\n </div>\n </div>\n );\n }\n return (\n <div className=\"space-y-8\">\n <h2 className=\"text-2xl font-bold text-ods-text-primary\">{title}</h2>\n {emptyState ?? <p className=\"text-ods-text-secondary\">{emptyStateText}</p>}\n </div>\n );\n }\n\n const grouped: Record<string, ContentRef[]> = {};\n for (const ref of visibleRefs) {\n if (!grouped[ref.type]) grouped[ref.type] = [];\n grouped[ref.type].push(ref);\n }\n\n // Registered types in CONTENT_REF_GROUPS order, then any unregistered\n // types appended (same shape the investor-email builder uses — both\n // consume `orderContentRefTypes` so cross-surface ordering matches).\n // SAME-TYPE FIRST: when a host entityType is known (suggestion / SSR\n // modes), its own content-type group is hoisted to the top — a blog\n // post's rail leads with blog posts. Rail group keys are compared via\n // the shared alias canonicalizer (blog_post_existing ↔ blog_post).\n let orderedTypes = orderContentRefTypes(Object.keys(grouped));\n if (entityType) {\n // Canonicalize BOTH sides — hosts pass registry vocab ('blog_post') but\n // rail-vocab aliases ('blog_post_existing') are also legal inputs; a raw\n // comparison would silently lose the same-type-first hoist for aliases.\n const canonicalEntityType = canonicalContentRefType(entityType);\n const sameType = orderedTypes.filter(t => canonicalContentRefType(t) === canonicalEntityType);\n if (sameType.length > 0) {\n orderedTypes = [...sameType, ...orderedTypes.filter(t => canonicalContentRefType(t) !== canonicalEntityType)];\n }\n }\n\n return (\n <div className=\"space-y-8\">\n <h2 className=\"text-ods-text-primary text-h2\">{title}</h2>\n {orderedTypes.map(type => (\n <ContentGroup\n key={type}\n type={type}\n refs={grouped[type]}\n columns={columns}\n buildUrl={effectiveBuildListUrl}\n resolveHref={resolveHref}\n LinkProvider={LinkProvider}\n extras={extras}\n adminCampaignCard={adminCampaignCard}\n heading={\n <h3 className=\"font-semibold text-ods-text-secondary text-h5\">{getContentRefLabelOrTitleCase(type)}</h3>\n }\n />\n ))}\n </div>\n );\n}\n","'use client';\n\n/**\n * Per-type card registry for the related-content rail — the SIZED sibling of\n * the chat side's `CHAT_CARD_REGISTRY` (`../chat/entity-cards/dispatch.tsx`),\n * and built to the same shape: ONE entry per content type, carrying that\n * type's skeleton and its card renderer, dispatched once from\n * `related-content-section.tsx`.\n *\n * WHY THIS FILE EXISTS\n * --------------------\n * The rail fetches one row per ref from that type's public list API. The row\n * arrives as `unknown` (`useSelfFetch<unknown>` → `extractItems`), and its\n * SHAPE is decided at runtime by the ref's `type`. The rail used to bridge\n * that with a single `item: any` threaded through a ten-branch switch, so\n * every `prop={item}` forward was an unchecked promise: a row missing a field\n * reached a card that declared it required, and the card rendered the miss\n * (an empty heading, a version pill reading \"vundefined\").\n *\n * Each entry here closes over its OWN row type instead. `cardEntry<Row>` pairs\n * a `decode` (runtime `unknown` → `Row`) with a `render` that receives `Row`,\n * and erases `Row` from the stored entry — so the registry is homogeneous\n * (`Record<string, RelatedCardRegistryEntry>`) while every branch stays\n * concretely typed. No `any`, no assertions into card row types.\n *\n * ON THE `*_ROW_DEFAULTS` CONSTANTS\n * ---------------------------------\n * Each card declares the FULL entity type as its row prop (`BlogPostSummary`,\n * `CaseStudy`, …) while reading only a handful of fields off it, and the list\n * APIs return projections rather than whole rows. A decoder therefore reads\n * the card's read set from the row and takes every other required field from\n * a `*_ROW_DEFAULTS` literal. Those placeholders are inert BY CONSTRUCTION —\n * the decoded row goes nowhere but its own card, and the card never reads\n * them. They are annotated with the entity type on purpose: a new required\n * field on `CaseStudy` surfaces as a compile error here instead of silently\n * reaching a card as `undefined`, which is the exact failure this file\n * replaces.\n *\n * ADDING A TYPE: one entry below (skeleton + decode + render), plus the chat\n * side's `CHAT_CARD_REGISTRY` and the list-URL builder — see the LOCKSTEP note\n * in `related-content-section.tsx`.\n */\n\nimport type React from 'react';\nimport type { BlogPostSummary } from '../../types/blog';\nimport type { CaseStudy } from '../../types/case-study';\nimport type { CustomerInterview } from '../../types/customer-interview';\nimport type { EntityAuthor } from '../../types/entity-author';\nimport type { MSP } from '../../types/stack';\nimport type { UserProfile } from '../../types/user';\nimport { AiPromptCard, AiPromptCardSkeleton, type AiPromptCardData } from '../chat/entity-cards/ai-prompt-card';\n// DEEP card imports — NOT the `../chat` barrel. See the import note in\n// `related-content-section.tsx`: the barrel statically reaches\n// @tanstack/react-query, deep paths keep this module's source graph free of it.\nimport { BlogCard, BlogCardSkeleton } from '../chat/entity-cards/blog-card';\nimport { CaseStudyCard, CaseStudyCardSkeleton } from '../chat/entity-cards/case-study-card';\nimport { CustomerInterviewCard, CustomerInterviewCardSkeleton } from '../chat/entity-cards/customer-interview-card';\n// Type-only — erased at build, no runtime dependency on the dispatch module.\nimport type { ChatCardDispatchExtras } from '../chat/entity-cards/dispatch';\nimport { HowIWorkCard, HowIWorkCardSkeleton, type HowIWorkCardData } from '../chat/entity-cards/how-i-work-card';\nimport { InvestorUpdateCard, InvestorUpdateCardSkeleton } from '../chat/entity-cards/investor-update-card';\nimport { OnboardingGuideCard, OnboardingGuideCardSkeleton } from '../chat/entity-cards/onboarding-guide-card';\nimport { ProductReleaseCard, ProductReleaseCardSkeleton } from '../chat/entity-cards/product-release-card';\nimport { buildProductReleaseCardProps } from '../chat/entity-cards/product-release-card-defaults';\nimport { ProgramCard, ProgramCardSkeleton } from '../chat/entity-cards/program-card';\nimport { RoadmapCard, RoadmapCardSkeleton } from '../chat/entity-cards/roadmap-card';\nimport {\n WhatIShippedCard,\n WhatIShippedCardSkeleton,\n type WhatIShippedCardData,\n} from '../chat/entity-cards/what-i-shipped-card';\nimport type { InvestorUpdate } from '../chat/types/entities/investor-update';\nimport type { OnboardingGuide } from '../chat/types/entities/onboarding-guide';\nimport type { BaseProgramItem, ProgramHost } from '../chat/types/entities/program-types';\nimport type { RoadmapItem } from '../chat/types/entities/roadmap-item';\n\nexport type CardSize = 'lg' | 'default' | 'sm';\n\n/** Anchor prop bundle the per-card link surface receives — same shape the\n * hub's `useNavLink` returns and the chat dispatcher's anchor builders\n * produce. `null` = non-anchor mode (no URL). */\nexport interface CardLinkAnchorProps {\n href: string;\n target?: '_blank';\n rel?: 'noopener noreferrer';\n onClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;\n}\n\n// =============================================================================\n// Row reading — the ONE place a runtime row is inspected.\n// =============================================================================\n\n/**\n * View an unvalidated row as a keyed bag. This claims nothing about the row's\n * SHAPE — every read below still checks the value's type — it only says \"this\n * is an object I may look keys up on\". A non-object row (null, a string, a\n * number) collapses to `{}`, so every decoder degrades to its defaults instead\n * of throwing.\n */\nfunction asRecord(value: unknown): Record<string, unknown> {\n return typeof value === 'object' && value !== null ? (value as Record<string, unknown>) : {};\n}\n\n/** A STRING field, or `undefined` when missing or wrong-typed. */\nexport function rowString(row: unknown, key: string): string | undefined {\n const value = asRecord(row)[key];\n return typeof value === 'string' ? value : undefined;\n}\n\nfunction str(row: Record<string, unknown>, key: string): string {\n const value = row[key];\n return typeof value === 'string' ? value : '';\n}\n\nfunction strOrNull(row: Record<string, unknown>, key: string): string | null {\n const value = row[key];\n return typeof value === 'string' ? value : null;\n}\n\nfunction numOrNull(row: Record<string, unknown>, key: string): number | null {\n const value = row[key];\n return typeof value === 'number' ? value : null;\n}\n\n/** `Array.isArray` narrows `unknown` to `any[]`; annotating the result keeps\n * the elements `unknown` so nothing downstream inherits `any`. Same guard the\n * shared `extractItems` normalizer uses. */\nfunction arrayOf(value: unknown): unknown[] {\n const list: unknown[] = Array.isArray(value) ? value : [];\n return list;\n}\n\nfunction stringList(value: unknown): string[] {\n return arrayOf(value).filter((entry): entry is string => typeof entry === 'string');\n}\n\n// =============================================================================\n// Shared nested-shape decoders (joins hydrated onto several row types).\n// =============================================================================\n\n/** `{ name, slug }` tag / category joins. Rows that carry only `name` (the\n * chat-side row shape) keep their label and get an empty slug — the cards\n * read `name` and nothing else. */\nfunction namedSlugList(value: unknown): { name: string; slug: string }[] {\n const out: { name: string; slug: string }[] = [];\n for (const entry of arrayOf(value)) {\n const record = asRecord(entry);\n const name = strOrNull(record, 'name');\n if (name === null) continue;\n out.push({ name, slug: str(record, 'slug') });\n }\n return out;\n}\n\nconst USER_PROFILE_DEFAULTS: UserProfile = {\n id: '',\n full_name: null,\n email: '',\n avatar_url: null,\n job_title: null,\n company: null,\n bio: null,\n employee_id: null,\n department_id: null,\n department: null,\n role: 'user',\n msp_id: null,\n created_at: '',\n updated_at: '',\n};\n\n/** The customer/author join on case studies + customer interviews. The cards\n * read `full_name`, `avatar_url` and `job_title`; absent join → `undefined`,\n * which is what those cards already fall back on. */\nfunction decodeUserProfile(value: unknown): UserProfile | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const record = asRecord(value);\n return {\n ...USER_PROFILE_DEFAULTS,\n id: str(record, 'id'),\n full_name: strOrNull(record, 'full_name'),\n avatar_url: strOrNull(record, 'avatar_url'),\n job_title: strOrNull(record, 'job_title'),\n };\n}\n\nconst MSP_DEFAULTS: MSP = { id: '', name: '', seat_count: 0, created_at: '', updated_at: '' };\n\n/** The MSP join — cards read `name` and `icon_url`. */\nfunction decodeMsp(value: unknown): MSP | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const record = asRecord(value);\n return {\n ...MSP_DEFAULTS,\n id: str(record, 'id'),\n name: str(record, 'name'),\n icon_url: rowString(record, 'icon_url'),\n };\n}\n\n/** The shared hydrated-author shape (`EntityAuthor`) — only `full_name` and\n * `avatar_url` are required, so this needs no defaults literal. */\nfunction decodeEntityAuthor(value: unknown): EntityAuthor | undefined {\n if (typeof value !== 'object' || value === null) return undefined;\n const record = asRecord(value);\n return {\n id: rowString(record, 'id'),\n full_name: strOrNull(record, 'full_name'),\n avatar_url: strOrNull(record, 'avatar_url'),\n job_title: strOrNull(record, 'job_title'),\n about: strOrNull(record, 'about'),\n slug: rowString(record, 'slug'),\n };\n}\n\n/** Program hosts / speakers. `name` is the only required field; an entry\n * without one is dropped rather than rendered as a nameless avatar. */\nfunction decodeProgramHosts(value: unknown): ProgramHost[] | null {\n if (value == null) return null;\n const out: ProgramHost[] = [];\n for (const entry of arrayOf(value)) {\n const record = asRecord(entry);\n const name = strOrNull(record, 'name');\n if (name === null) continue;\n out.push({\n name,\n id: rowString(record, 'id'),\n email: rowString(record, 'email'),\n avatar_url: rowString(record, 'avatar_url'),\n bio: rowString(record, 'bio'),\n role: rowString(record, 'role'),\n });\n }\n return out;\n}\n\n// =============================================================================\n// Per-type row decoders. Each reads the fields ITS card renders; every other\n// required field comes from the type-annotated defaults literal above it.\n// =============================================================================\n\nfunction decodeBlogRow(row: unknown): BlogPostSummary {\n const record = asRecord(row);\n return {\n id: numOrNull(record, 'id') ?? 0,\n title: str(record, 'title'),\n slug: str(record, 'slug'),\n summary: strOrNull(record, 'summary'),\n featured_image: strOrNull(record, 'featured_image'),\n published_at: strOrNull(record, 'published_at'),\n author_name: strOrNull(record, 'author_name'),\n author_avatar: strOrNull(record, 'author_avatar'),\n categories: namedSlugList(record.categories),\n tags: namedSlugList(record.tags),\n view_count: numOrNull(record, 'view_count') ?? undefined,\n };\n}\n\nconst CASE_STUDY_ROW_DEFAULTS: CaseStudy = {\n id: 0,\n title: '',\n slug: '',\n summary: null,\n featured_image: null,\n user_id: null,\n challenge: null,\n solution: null,\n results: null,\n testimonial_video_url: null,\n main_video_url: null,\n video_source_type: null,\n video_source: null,\n video_bites: [],\n customer_interview_id: null,\n seo_title: null,\n seo_description: null,\n seo_keywords: null,\n og_image_url: null,\n status: 'published',\n published_at: null,\n author_id: null,\n created_at: '',\n updated_at: '',\n view_count: 0,\n};\n\nfunction decodeCaseStudyRow(row: unknown): CaseStudy {\n const record = asRecord(row);\n return {\n ...CASE_STUDY_ROW_DEFAULTS,\n id: numOrNull(record, 'id') ?? 0,\n title: str(record, 'title'),\n summary: strOrNull(record, 'summary'),\n featured_image: strOrNull(record, 'featured_image'),\n msp: decodeMsp(record.msp),\n user: decodeUserProfile(record.user),\n };\n}\n\nconst CUSTOMER_INTERVIEW_ROW_DEFAULTS: CustomerInterview = {\n id: 0,\n title: '',\n slug: '',\n video_summary: null,\n transcript: null,\n user_id: null,\n main_video_url: null,\n teasers: [],\n case_study_id: null,\n seo_title: null,\n seo_description: null,\n seo_keywords: null,\n og_image_url: null,\n featured_image: null,\n status: 'completed',\n completed_at: null,\n author_id: null,\n custom_instructions: null,\n created_at: '',\n updated_at: '',\n view_count: 0,\n};\n\nfunction decodeCustomerInterviewRow(row: unknown): CustomerInterview {\n const record = asRecord(row);\n return {\n ...CUSTOMER_INTERVIEW_ROW_DEFAULTS,\n id: numOrNull(record, 'id') ?? 0,\n title: str(record, 'title'),\n video_summary: strOrNull(record, 'video_summary'),\n main_video_url: strOrNull(record, 'main_video_url'),\n featured_image: strOrNull(record, 'featured_image'),\n msp: decodeMsp(record.msp),\n user: decodeUserProfile(record.user),\n };\n}\n\nconst INVESTOR_UPDATE_ROW_DEFAULTS: InvestorUpdate = {\n id: '',\n title: '',\n slug: '',\n update_number: null,\n period_start: null,\n period_end: null,\n platform_id: null,\n content: null,\n video_summary: null,\n transcript: null,\n main_video_url: null,\n highlight_video_url: null,\n highlight_video_thumbnail: null,\n main_video_thumbnail: null,\n video_bites: [],\n featured_image: null,\n strategic_update: null,\n financials: {},\n metrics_snapshot: {},\n content_refs: [],\n highlights: null,\n section_visibility: {},\n status: 'published',\n published_at: null,\n author_id: null,\n seo_title: null,\n seo_description: null,\n seo_keywords: null,\n og_image_url: null,\n hubspot_email_id: null,\n custom_instructions: null,\n created_at: '',\n updated_at: '',\n created_by: null,\n updated_by: null,\n};\n\nfunction decodeInvestorUpdateRow(row: unknown): InvestorUpdate {\n const record = asRecord(row);\n return {\n ...INVESTOR_UPDATE_ROW_DEFAULTS,\n id: str(record, 'id'),\n title: str(record, 'title'),\n update_number: numOrNull(record, 'update_number'),\n period_start: strOrNull(record, 'period_start'),\n period_end: strOrNull(record, 'period_end'),\n content: strOrNull(record, 'content'),\n strategic_update: strOrNull(record, 'strategic_update'),\n featured_image: strOrNull(record, 'featured_image'),\n };\n}\n\nconst ONBOARDING_GUIDE_ROW_DEFAULTS: OnboardingGuide = {\n id: '',\n title: '',\n slug: '',\n section: '',\n step_order: 0,\n section_order: 0,\n content: null,\n video_summary: null,\n transcript: null,\n transcript_words_data: null,\n srt_content: null,\n ai_transcript_formatted: null,\n main_video_url: null,\n main_video_thumbnail: null,\n youtube_url: null,\n highlight_video_url: null,\n highlight_video_thumbnail: null,\n highlight_video_duration_ms: null,\n highlight_video_source: null,\n video_bites: [],\n featured_image: null,\n og_image_url: null,\n seo_title: null,\n seo_description: null,\n seo_keywords: null,\n status: 'published',\n published_at: null,\n author_id: null,\n custom_instructions: null,\n config: null,\n ai_effort_score: null,\n created_at: '',\n updated_at: '',\n created_by: null,\n updated_by: null,\n};\n\nfunction decodeOnboardingGuideRow(row: unknown): OnboardingGuide {\n const record = asRecord(row);\n return {\n ...ONBOARDING_GUIDE_ROW_DEFAULTS,\n id: str(record, 'id'),\n title: str(record, 'title'),\n section: str(record, 'section'),\n step_order: numOrNull(record, 'step_order') ?? 0,\n content: strOrNull(record, 'content'),\n video_summary: strOrNull(record, 'video_summary'),\n featured_image: strOrNull(record, 'featured_image'),\n og_image_url: strOrNull(record, 'og_image_url'),\n main_video_thumbnail: strOrNull(record, 'main_video_thumbnail'),\n highlight_video_thumbnail: strOrNull(record, 'highlight_video_thumbnail'),\n highlight_video_duration_ms: numOrNull(record, 'highlight_video_duration_ms'),\n author: decodeEntityAuthor(record.author),\n };\n}\n\n/**\n * `RoadmapItem` is the one row type the card reads WHOLE, so this decoder\n * carries no defaults literal — every field is read off the row.\n *\n * `upvotes` / `downvotes` / `quarter` are required `number`/`string` props the\n * card renders directly. Read off an untyped row they were `any`, so a row\n * without them rendered the miss (a blank vote count). They now fall back to\n * `0` / `''`, matching how the card renders a genuinely zero-vote item.\n */\nfunction decodeRoadmapRow(row: unknown): RoadmapItem {\n const record = asRecord(row);\n const assignees: NonNullable<RoadmapItem['assignees']> = [];\n for (const entry of arrayOf(record.assignees)) {\n const assignee = asRecord(entry);\n assignees.push({\n id: numOrNull(assignee, 'id') ?? 0,\n name: strOrNull(assignee, 'name'),\n avatarUrl: strOrNull(assignee, 'avatarUrl'),\n });\n }\n return {\n id: str(record, 'id'),\n title: str(record, 'title'),\n description: str(record, 'description'),\n status: str(record, 'status'),\n statusColor: str(record, 'statusColor'),\n icon: strOrNull(record, 'icon'),\n figmaUrl: strOrNull(record, 'figmaUrl'),\n screenshots: stringList(record.screenshots),\n targetVersion: strOrNull(record, 'targetVersion'),\n upvotes: numOrNull(record, 'upvotes') ?? 0,\n downvotes: numOrNull(record, 'downvotes') ?? 0,\n quarter: str(record, 'quarter'),\n clickupUrl: str(record, 'clickupUrl'),\n customItemId: numOrNull(record, 'customItemId'),\n assignees,\n };\n}\n\n/**\n * Program rows (podcast / webinar / event) keep their EXTRA columns.\n *\n * `<ProgramCard>` is generic over the item, and the config the rail threads in\n * is an `AnyProgramConfig` — `ProgramConfig<BaseProgramItem &\n * Record<string, unknown>>` — precisely so per-program columns ride along. The\n * card branches on `'duration_seconds' in item` / `'location_name' in item` /\n * `'start_at' in item`, so dropping the unrecognised columns would silently\n * strip a podcast's runtime and an event's venue. The raw row is spread first\n * and the base fields are decoded over it.\n */\nfunction decodeProgramRow(row: unknown): BaseProgramItem & Record<string, unknown> {\n const record = asRecord(row);\n return {\n ...record,\n id: str(record, 'id'),\n title: str(record, 'title'),\n description: strOrNull(record, 'description'),\n cover_url: strOrNull(record, 'cover_url'),\n date: str(record, 'date'),\n external_url: strOrNull(record, 'external_url'),\n hosts: decodeProgramHosts(record.hosts),\n };\n}\n\n/** The two employee-entry cards already declare MINIMAL row shapes\n * (`EmployeeEntryCardData` + one date column each), so their decoders read\n * exactly the card's fields with nothing left over. */\nfunction decodeEmployeeEntryRow(row: unknown): WhatIShippedCardData & HowIWorkCardData & AiPromptCardData {\n const record = asRecord(row);\n const department = asRecord(record.department);\n const stepCount = record.step_count;\n return {\n title: strOrNull(record, 'title'),\n summary: strOrNull(record, 'summary'),\n status: strOrNull(record, 'status'),\n featured_image: strOrNull(record, 'featured_image'),\n main_video_thumbnail: strOrNull(record, 'main_video_thumbnail'),\n author: decodeEntityAuthor(record.author),\n entry_month: strOrNull(record, 'entry_month'),\n session_date: strOrNull(record, 'session_date'),\n discipline: strOrNull(record, 'discipline'),\n published_at: strOrNull(record, 'published_at'),\n department: record.department ? { name: strOrNull(department, 'name') } : null,\n step_count: typeof stepCount === 'number' ? stepCount : null,\n };\n}\n\n// =============================================================================\n// Registry\n// =============================================================================\n\n/** Everything a card branch needs beyond its own row — computed once per card\n * by the rail's dispatcher and shared by every entry. */\nexport interface RelatedCardContext {\n /** Card density for this group, from `CONTENT_REF_GROUPS`. */\n size: CardSize;\n /** `size` with `'lg'` collapsed to `'default'` — most card variants accept\n * only that pair. */\n legacySize: 'default' | 'sm';\n href: string;\n targetPlatform: string | null;\n /** `null` = the host surfaced no URL; the card stays in non-anchor mode. */\n linkProps: CardLinkAnchorProps | null;\n /** `{ target, rel }` for the cards that take them as separate props. */\n anchorAttrs: Pick<CardLinkAnchorProps, 'target' | 'rel'>;\n /** Branded OG fallback for cards whose row has no featured image. */\n placeholderUrl?: string;\n extras?: ChatCardDispatchExtras;\n}\n\n/** One registered content type. `Row` is erased here — `cardEntry` below is\n * what keeps each branch's row type concrete. */\nexport interface RelatedCardRegistryEntry {\n /** Sized to match the resolved card exactly (zero layout shift). */\n skeleton: (size: CardSize) => React.ReactNode;\n render: (row: unknown, ctx: RelatedCardContext) => React.ReactNode;\n}\n\n/**\n * Register one type with its OWN row type.\n *\n * `Row` is bound by the definition object and never escapes: `render` is\n * handed a decoded `Row`, and the stored entry exposes only\n * `(row: unknown) => ReactNode`. That is what lets a single registry hold ten\n * heterogeneous row shapes without a shared supertype — the job `item: any`\n * used to do, minus the promise it could not keep.\n */\nfunction cardEntry<Row>(definition: {\n skeleton: (size: CardSize) => React.ReactNode;\n decode: (row: unknown) => Row;\n render: (row: Row, ctx: RelatedCardContext) => React.ReactNode;\n}): RelatedCardRegistryEntry {\n return {\n skeleton: definition.skeleton,\n render: (row, ctx) => definition.render(definition.decode(row), ctx),\n };\n}\n\n/** Podcast / webinar / event share one card + one skeleton and differ only by\n * which host-supplied `ProgramConfig` they render with. A group whose config\n * the host didn't supply renders nothing (the skeleton still reserves its\n * height, so a rail that never resolves collapses instead of flickering). */\nfunction programEntry(configKey: 'podcast' | 'webinar' | 'event'): RelatedCardRegistryEntry {\n return cardEntry({\n skeleton: size => <ProgramCardSkeleton size={size === 'sm' ? 'sm' : 'default'} />,\n decode: decodeProgramRow,\n render: (item, ctx) => {\n const config = ctx.extras?.programConfigs?.[configKey];\n if (!config) return null;\n return (\n <ProgramCard\n config={config}\n item={item}\n size={ctx.legacySize}\n href={ctx.href}\n targetPlatform={ctx.targetPlatform}\n placeholderUrl={ctx.placeholderUrl}\n {...ctx.anchorAttrs}\n />\n );\n },\n });\n}\n\n/** The three ClickUp-backed types render the same card, distinguished by\n * `cardType` (drives the compact icon slot). */\nfunction roadmapEntry(cardType: 'roadmap_item' | 'delivery_item' | 'internal_task'): RelatedCardRegistryEntry {\n return cardEntry({\n skeleton: size => <RoadmapCardSkeleton size={size === 'sm' ? 'sm' : 'default'} />,\n decode: decodeRoadmapRow,\n render: (item, ctx) => (\n <RoadmapCard\n item={item}\n href={ctx.href}\n targetPlatform={ctx.targetPlatform}\n userVote={null}\n onVote={() => {}}\n size={ctx.legacySize}\n cardType={cardType}\n {...ctx.anchorAttrs}\n />\n ),\n });\n}\n\nexport const RELATED_CARD_REGISTRY: Record<string, RelatedCardRegistryEntry> = {\n blog_post_existing: cardEntry({\n skeleton: size => <BlogCardSkeleton size={size === 'sm' ? 'sm' : 'default'} />,\n decode: decodeBlogRow,\n render: (post, ctx) => (\n <BlogCard\n post={post}\n size={ctx.legacySize}\n href={ctx.href}\n targetPlatform={ctx.targetPlatform}\n placeholderUrl={ctx.placeholderUrl}\n {...ctx.anchorAttrs}\n />\n ),\n }),\n\n case_study: cardEntry({\n skeleton: size => <CaseStudyCardSkeleton size={size === 'sm' ? 'sm' : 'default'} />,\n decode: decodeCaseStudyRow,\n render: (study, ctx) => (\n <CaseStudyCard\n study={study}\n size={ctx.legacySize}\n href={ctx.href}\n targetPlatform={ctx.targetPlatform}\n placeholderUrl={ctx.placeholderUrl}\n {...ctx.anchorAttrs}\n />\n ),\n }),\n\n customer_interview: cardEntry({\n skeleton: size => <CustomerInterviewCardSkeleton size={size === 'sm' ? 'sm' : 'default'} />,\n decode: decodeCustomerInterviewRow,\n render: (interview, ctx) => (\n <CustomerInterviewCard\n interview={interview}\n size={ctx.legacySize}\n href={ctx.href}\n targetPlatform={ctx.targetPlatform}\n placeholderUrl={ctx.placeholderUrl}\n {...ctx.anchorAttrs}\n />\n ),\n }),\n\n /**\n * Product releases derive their whole prop bundle through a HOST seam\n * (`extras.buildProductReleaseCardProps`, defaulting to the lib builder)\n * which already takes `unknown` — so this entry's row type is the bare\n * record, and the three props the rail sets itself are read off it.\n */\n product_release: cardEntry({\n skeleton: size => <ProductReleaseCardSkeleton size={size === 'sm' ? 'sm' : 'lg'} />,\n decode: asRecord,\n render: (release, ctx) => {\n const buildReleaseProps = ctx.extras?.buildProductReleaseCardProps ?? buildProductReleaseCardProps;\n const releaseProps = buildReleaseProps(release);\n return (\n <ProductReleaseCard\n size={ctx.size === 'sm' ? 'sm' : 'lg'}\n // `title` and `version` are REQUIRED `string` props. Read off an\n // untyped row they were `any`, so a release row missing either one\n // rendered an empty heading and a version pill reading \"vundefined\".\n // `summary` is `string | null | undefined` and the card renders\n // `summary ?? ''`, so a dropped one is indistinguishable from null.\n title={str(release, 'title')}\n summary={rowString(release, 'summary')}\n version={str(release, 'version')}\n {...releaseProps}\n // The card wraps in `<a {...anchorProps}>` ONLY when\n // `anchorProps.href` is set — `undefined` (not an empty object)\n // keeps it in non-anchor mode instead of rendering a dead <a>.\n anchorProps={ctx.linkProps ?? undefined}\n />\n );\n },\n }),\n\n podcast: programEntry('podcast'),\n webinar: programEntry('webinar'),\n event: programEntry('event'),\n\n investor_update: cardEntry({\n skeleton: size => <InvestorUpdateCardSkeleton size={size === 'sm' ? 'sm' : 'default'} />,\n decode: decodeInvestorUpdateRow,\n render: (update, ctx) => (\n <InvestorUpdateCard\n update={update}\n size={ctx.legacySize}\n href={ctx.href}\n targetPlatform={ctx.targetPlatform}\n placeholderUrl={ctx.placeholderUrl}\n {...ctx.anchorAttrs}\n />\n ),\n }),\n\n /** The rich CATALOG variant (hero + author grid, clamped description) — the\n * step-numbered 'default' variant is for the guide detail page's \"More in\n * section\" rail, not this full-width row. */\n onboarding_guide: cardEntry({\n skeleton: size => <OnboardingGuideCardSkeleton size={size === 'sm' ? 'sm' : 'catalog'} />,\n decode: decodeOnboardingGuideRow,\n render: (guide, ctx) => (\n <OnboardingGuideCard\n guide={guide}\n size={ctx.size === 'sm' ? 'sm' : 'catalog'}\n href={ctx.href}\n targetPlatform={ctx.targetPlatform}\n placeholderUrl={ctx.placeholderUrl}\n {...ctx.anchorAttrs}\n />\n ),\n }),\n\n /** THE single What I Shipped card — same lib component the people-hub\n * dashboard renders. `anchorProps` makes the whole card a click-through\n * (the rail is read-only — no owner actions). Only pass it with a REAL\n * href: an object with `href: undefined` is still truthy and would wrap the\n * card in a dead <a>. */\n what_i_shipped: cardEntry({\n skeleton: () => <WhatIShippedCardSkeleton />,\n decode: decodeEmployeeEntryRow,\n render: (entry, ctx) => (\n <WhatIShippedCard\n entry={entry}\n placeholderUrl={ctx.placeholderUrl}\n anchorProps={ctx.linkProps ?? (ctx.href ? { href: ctx.href, ...ctx.anchorAttrs } : undefined)}\n />\n ),\n }),\n\n /** Same shared employee-entry shape + anchor contract as What I Shipped. */\n how_i_work: cardEntry({\n skeleton: () => <HowIWorkCardSkeleton />,\n decode: decodeEmployeeEntryRow,\n render: (entry, ctx) => (\n <HowIWorkCard\n entry={entry}\n placeholderUrl={ctx.placeholderUrl}\n anchorProps={ctx.linkProps ?? (ctx.href ? { href: ctx.href, ...ctx.anchorAttrs } : undefined)}\n />\n ),\n }),\n\n /** Same shared employee-entry shape + anchor contract as What I Shipped. */\n ai_prompt: cardEntry({\n skeleton: () => <AiPromptCardSkeleton />,\n decode: decodeEmployeeEntryRow,\n render: (entry, ctx) => (\n <AiPromptCard\n entry={entry}\n placeholderUrl={ctx.placeholderUrl}\n anchorProps={ctx.linkProps ?? (ctx.href ? { href: ctx.href, ...ctx.anchorAttrs } : undefined)}\n />\n ),\n }),\n\n roadmap_item: roadmapEntry('roadmap_item'),\n delivery_item: roadmapEntry('delivery_item'),\n internal_task: roadmapEntry('internal_task'),\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,SAAS,WAAW,SAAS,QAAQ,gBAAgB;;;AC4hB/B;AA5etB,SAAS,SAAS,OAAyC;AACzD,SAAO,OAAO,UAAU,YAAY,UAAU,OAAQ,QAAoC,CAAC;AAC7F;AAGO,SAAS,UAAU,KAAc,KAAiC;AACvE,QAAM,QAAQ,SAAS,GAAG,EAAE,GAAG;AAC/B,SAAO,OAAO,UAAU,WAAW,QAAQ;AAC7C;AAEA,SAAS,IAAI,KAA8B,KAAqB;AAC9D,QAAM,QAAQ,IAAI,GAAG;AACrB,SAAO,OAAO,UAAU,WAAW,QAAQ;AAC7C;AAEA,SAAS,UAAU,KAA8B,KAA4B;AAC3E,QAAM,QAAQ,IAAI,GAAG;AACrB,SAAO,OAAO,UAAU,WAAW,QAAQ;AAC7C;AAEA,SAAS,UAAU,KAA8B,KA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qB,OAAO,KAAK,OAAO,CAAC;AAC5D,MAAI,YAAY;AAId,UAAM,sBAAsB,wBAAwB,UAAU;AAC9D,UAAM,WAAW,aAAa,OAAO,OAAK,wBAAwB,CAAC,MAAM,mBAAmB;AAC5F,QAAI,SAAS,SAAS,GAAG;AACvB,qBAAe,CAAC,GAAG,UAAU,GAAG,aAAa,OAAO,OAAK,wBAAwB,CAAC,MAAM,mBAAmB,CAAC;AAAA,IAC9G;AAAA,EACF;AAEA,SACE,qBAAC,SAAI,WAAU,aACb;AAAA,oBAAAA,KAAC,QAAG,WAAU,iCAAiC,iBAAM;AAAA,IACpD,aAAa,IAAI,UAChB,gBAAAA;AAAA,MAAC;AAAA;AAAA,QAEC;AAAA,QACA,MAAM,QAAQ,IAAI;AAAA,QAClB;AAAA,QACA,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,SACE,gBAAAA,KAAC,QAAG,WAAU,iDAAiD,wCAA8B,IAAI,GAAE;AAAA;AAAA,MAVhG;AAAA,IAYP,CACD;AAAA,KACH;AAEJ;","names":["jsx","buildListUrl"]}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  DEFAULT_FOLDER_INDEX_FILE
4
- } from "./chunk-YCZBCEQO.js";
4
+ } from "./chunk-5AB6QLIQ.js";
5
5
  import {
6
6
  scrollElementIntoView
7
7
  } from "./chunk-5LIDR7HL.js";
@@ -357,4 +357,4 @@ export {
357
357
  MultiLevelNavigation,
358
358
  MobileNavigationDropdown
359
359
  };
360
- //# sourceMappingURL=chunk-RROIA6WY.js.map
360
+ //# sourceMappingURL=chunk-UY4EFV3P.js.map
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  Pagination
4
- } from "./chunk-GBON2OCG.js";
4
+ } from "./chunk-5WGOAJ4B.js";
5
5
  import {
6
6
  withQuery
7
7
  } from "./chunk-BVQEU5JB.js";
@@ -185,4 +185,4 @@ export {
185
185
  EmptyState,
186
186
  UnifiedPagination
187
187
  };
188
- //# sourceMappingURL=chunk-TSCIVH7T.js.map
188
+ //# sourceMappingURL=chunk-VBIFSOPQ.js.map