@flamingo-stack/openframe-frontend-core 0.0.503 → 0.0.504-snapshot.20260801181709

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 (191) hide show
  1. package/dist/{chunk-SGWPW2AO.cjs → chunk-2A74VRAF.cjs} +18 -18
  2. package/dist/{chunk-SGWPW2AO.cjs.map → chunk-2A74VRAF.cjs.map} +1 -1
  3. package/dist/{chunk-LILQJ3UZ.cjs → chunk-3ENGUBJP.cjs} +1 -1
  4. package/dist/chunk-3ENGUBJP.cjs.map +1 -0
  5. package/dist/{chunk-AWDHRIL3.cjs → chunk-4ST2BOWJ.cjs} +75 -75
  6. package/dist/{chunk-AWDHRIL3.cjs.map → chunk-4ST2BOWJ.cjs.map} +1 -1
  7. package/dist/{chunk-SFJRMBJC.js → chunk-5SVNA7IU.js} +2 -2
  8. package/dist/{chunk-OAWFYZZT.js → chunk-7DOSAJDK.js} +3 -3
  9. package/dist/{chunk-J4T5ZBWG.cjs → chunk-BZRP54IO.cjs} +19 -19
  10. package/dist/{chunk-J4T5ZBWG.cjs.map → chunk-BZRP54IO.cjs.map} +1 -1
  11. package/dist/{chunk-BZF63JXP.js → chunk-CRJVO4KO.js} +6 -6
  12. package/dist/{chunk-5RIHLXEP.cjs → chunk-DDVQ5NKK.cjs} +33 -33
  13. package/dist/{chunk-5RIHLXEP.cjs.map → chunk-DDVQ5NKK.cjs.map} +1 -1
  14. package/dist/{chunk-HR6F6IP4.js → chunk-DIKJLAMY.js} +78 -43
  15. package/dist/chunk-DIKJLAMY.js.map +1 -0
  16. package/dist/{chunk-VO2ZONMR.js → chunk-FNTFWP2A.js} +3 -3
  17. package/dist/{chunk-2OXJ6NHI.cjs → chunk-GJZ42TTG.cjs} +7 -7
  18. package/dist/{chunk-2OXJ6NHI.cjs.map → chunk-GJZ42TTG.cjs.map} +1 -1
  19. package/dist/{chunk-JIZJDAXI.cjs → chunk-GXRVBKYX.cjs} +12 -12
  20. package/dist/{chunk-JIZJDAXI.cjs.map → chunk-GXRVBKYX.cjs.map} +1 -1
  21. package/dist/{chunk-F7AD5CUU.js → chunk-H3N4P3CG.js} +3 -3
  22. package/dist/chunk-H3N4P3CG.js.map +1 -0
  23. package/dist/{chunk-VCPTU4IW.js → chunk-HWER6KGU.js} +7 -7
  24. package/dist/{chunk-4SR2QHMB.js → chunk-ITVWX5HX.js} +3 -3
  25. package/dist/{chunk-FFXNRJ5S.cjs → chunk-LOBR7IC6.cjs} +6 -6
  26. package/dist/chunk-LOBR7IC6.cjs.map +1 -0
  27. package/dist/{chunk-72DF3QTA.cjs → chunk-MJQ263KS.cjs} +14 -14
  28. package/dist/{chunk-72DF3QTA.cjs.map → chunk-MJQ263KS.cjs.map} +1 -1
  29. package/dist/{chunk-FTOVZ7O2.js → chunk-NPO6CHCR.js} +7 -7
  30. package/dist/{chunk-XV5SXALY.js → chunk-NT5FX7GZ.js} +3 -3
  31. package/dist/{chunk-UCV4LFUG.cjs → chunk-NY75FKN6.cjs} +40 -40
  32. package/dist/{chunk-UCV4LFUG.cjs.map → chunk-NY75FKN6.cjs.map} +1 -1
  33. package/dist/{chunk-4UNQMYP7.cjs → chunk-O32Y4E4R.cjs} +3 -3
  34. package/dist/{chunk-4UNQMYP7.cjs.map → chunk-O32Y4E4R.cjs.map} +1 -1
  35. package/dist/{chunk-CLQEBWV7.js → chunk-QE55ROZW.js} +4 -4
  36. package/dist/{chunk-WHJGRRK2.js → chunk-QW7SW5HY.js} +52 -43
  37. package/dist/chunk-QW7SW5HY.js.map +1 -0
  38. package/dist/{chunk-JGXAVNZQ.js → chunk-R6CKL7IR.js} +2464 -1886
  39. package/dist/chunk-R6CKL7IR.js.map +1 -0
  40. package/dist/{chunk-L5CI57RM.cjs → chunk-T3BF6JTQ.cjs} +52 -43
  41. package/dist/chunk-T3BF6JTQ.cjs.map +1 -0
  42. package/dist/{chunk-G43CEISB.js → chunk-TA3VJ2QO.js} +4 -4
  43. package/dist/{chunk-7L2RVINX.cjs → chunk-TRS4CIAS.cjs} +35 -35
  44. package/dist/{chunk-7L2RVINX.cjs.map → chunk-TRS4CIAS.cjs.map} +1 -1
  45. package/dist/{chunk-DMXB3VE2.cjs → chunk-U3YLML53.cjs} +1837 -1259
  46. package/dist/chunk-U3YLML53.cjs.map +1 -0
  47. package/dist/{chunk-3T4SMJM5.cjs → chunk-VDKNUC3N.cjs} +181 -146
  48. package/dist/chunk-VDKNUC3N.cjs.map +1 -0
  49. package/dist/{chunk-RR3Z52X5.cjs → chunk-W3QCFQ56.cjs} +42 -42
  50. package/dist/{chunk-RR3Z52X5.cjs.map → chunk-W3QCFQ56.cjs.map} +1 -1
  51. package/dist/{chunk-VYEDTVIZ.js → chunk-XJPMTJAR.js} +4 -4
  52. package/dist/{chunk-6GT557KN.js → chunk-XKIA4XVE.js} +1 -1
  53. package/dist/chunk-XKIA4XVE.js.map +1 -0
  54. package/dist/components/case-studies/index.cjs +11 -11
  55. package/dist/components/case-studies/index.js +5 -5
  56. package/dist/components/chat/index.cjs +5 -5
  57. package/dist/components/chat/index.js +4 -4
  58. package/dist/components/contact/index.cjs +6 -6
  59. package/dist/components/contact/index.js +5 -5
  60. package/dist/components/docs/index.cjs +8 -8
  61. package/dist/components/docs/index.js +7 -7
  62. package/dist/components/embeds/index.cjs +6 -6
  63. package/dist/components/embeds/index.js +5 -5
  64. package/dist/components/faq/index.cjs +7 -7
  65. package/dist/components/faq/index.js +6 -6
  66. package/dist/components/features/index.cjs +5 -5
  67. package/dist/components/features/index.js +4 -4
  68. package/dist/components/help-center-pages/index.cjs +24 -24
  69. package/dist/components/help-center-pages/index.js +15 -15
  70. package/dist/components/index.cjs +169 -165
  71. package/dist/components/index.cjs.map +1 -1
  72. package/dist/components/index.js +17 -13
  73. package/dist/components/index.js.map +1 -1
  74. package/dist/components/navigation/app-header.d.ts +8 -0
  75. package/dist/components/navigation/app-header.d.ts.map +1 -1
  76. package/dist/components/navigation/header-button.d.ts +5 -1
  77. package/dist/components/navigation/header-button.d.ts.map +1 -1
  78. package/dist/components/navigation/header.d.ts.map +1 -1
  79. package/dist/components/navigation/index.cjs +9 -5
  80. package/dist/components/navigation/index.cjs.map +1 -1
  81. package/dist/components/navigation/index.d.ts +4 -0
  82. package/dist/components/navigation/index.d.ts.map +1 -1
  83. package/dist/components/navigation/index.js +8 -4
  84. package/dist/components/navigation/mingo-ai-button.d.ts.map +1 -1
  85. package/dist/components/navigation/navigation-sidebar-item.d.ts.map +1 -1
  86. package/dist/components/navigation/ticket-alerts-button.d.ts +29 -0
  87. package/dist/components/navigation/ticket-alerts-button.d.ts.map +1 -0
  88. package/dist/components/navigation/top-navigation.d.ts +5 -1
  89. package/dist/components/navigation/top-navigation.d.ts.map +1 -1
  90. package/dist/components/navigation/unread-dot.d.ts +19 -0
  91. package/dist/components/navigation/unread-dot.d.ts.map +1 -0
  92. package/dist/components/onboarding-guides/index.cjs +9 -9
  93. package/dist/components/onboarding-guides/index.js +8 -8
  94. package/dist/components/related-content/index.cjs +7 -7
  95. package/dist/components/related-content/index.js +6 -6
  96. package/dist/components/tickets/help-center-card.d.ts.map +1 -1
  97. package/dist/components/tickets/hooks/use-ticket-actions.d.ts.map +1 -1
  98. package/dist/components/tickets/hooks/use-ticket-engagements.d.ts +1 -9
  99. package/dist/components/tickets/hooks/use-ticket-engagements.d.ts.map +1 -1
  100. package/dist/components/tickets/hooks/use-tickets-list.d.ts +0 -7
  101. package/dist/components/tickets/hooks/use-tickets-list.d.ts.map +1 -1
  102. package/dist/components/tickets/index.cjs +15 -8
  103. package/dist/components/tickets/index.cjs.map +1 -1
  104. package/dist/components/tickets/index.d.ts +2 -1
  105. package/dist/components/tickets/index.d.ts.map +1 -1
  106. package/dist/components/tickets/index.js +14 -7
  107. package/dist/components/tickets/ticket-detail-drawer.d.ts.map +1 -1
  108. package/dist/components/tickets/ticket-live-provider.d.ts +58 -0
  109. package/dist/components/tickets/ticket-live-provider.d.ts.map +1 -0
  110. package/dist/components/tickets/types.d.ts +58 -11
  111. package/dist/components/tickets/types.d.ts.map +1 -1
  112. package/dist/components/ui/button/button.d.ts +6 -5
  113. package/dist/components/ui/button/button.d.ts.map +1 -1
  114. package/dist/components/ui/file-manager/index.cjs +50 -50
  115. package/dist/components/ui/file-manager/index.js +1 -1
  116. package/dist/components/ui/index.cjs +5 -5
  117. package/dist/components/ui/index.js +4 -4
  118. package/dist/contexts/chat-runtime-context.d.ts +8 -0
  119. package/dist/contexts/chat-runtime-context.d.ts.map +1 -1
  120. package/dist/contexts/index.cjs +2 -2
  121. package/dist/contexts/index.js +1 -1
  122. package/dist/hooks/index.cjs +3 -3
  123. package/dist/hooks/index.js +2 -2
  124. package/dist/hooks/ui/use-header-height.d.ts.map +1 -1
  125. package/dist/index.cjs +11 -5
  126. package/dist/index.cjs.map +1 -1
  127. package/dist/index.js +10 -4
  128. package/dist/types/navigation.d.ts +10 -0
  129. package/dist/types/navigation.d.ts.map +1 -1
  130. package/dist/utils/index.cjs +171 -0
  131. package/dist/utils/index.cjs.map +1 -1
  132. package/dist/utils/index.d.ts +1 -0
  133. package/dist/utils/index.d.ts.map +1 -1
  134. package/dist/utils/index.js +171 -1
  135. package/dist/utils/index.js.map +1 -1
  136. package/dist/utils/sse-subscription.d.ts +60 -0
  137. package/dist/utils/sse-subscription.d.ts.map +1 -0
  138. package/package.json +1 -1
  139. package/src/components/features/time-tracker/time-tracker-header-button.tsx +1 -1
  140. package/src/components/navigation/app-header.tsx +36 -20
  141. package/src/components/navigation/header-button.tsx +18 -2
  142. package/src/components/navigation/header-mingo-button.tsx +2 -2
  143. package/src/components/navigation/header-skeleton.tsx +4 -4
  144. package/src/components/navigation/header.tsx +41 -21
  145. package/src/components/navigation/index.ts +4 -0
  146. package/src/components/navigation/mingo-ai-button.tsx +23 -22
  147. package/src/components/navigation/mobile-burger-menu.tsx +3 -3
  148. package/src/components/navigation/navigation-sidebar-item.tsx +2 -3
  149. package/src/components/navigation/ticket-alerts-button.tsx +61 -0
  150. package/src/components/navigation/top-navigation.tsx +17 -1
  151. package/src/components/navigation/unread-dot.tsx +34 -0
  152. package/src/components/tickets/.types.md +1 -2
  153. package/src/components/tickets/help-center-card.tsx +16 -0
  154. package/src/components/tickets/help-center-list.tsx +6 -6
  155. package/src/components/tickets/hooks/.use-ticket-engagements.md +3 -12
  156. package/src/components/tickets/hooks/.use-tickets-list.md +0 -2
  157. package/src/components/tickets/hooks/use-ticket-actions.ts +9 -0
  158. package/src/components/tickets/hooks/use-ticket-engagements.ts +4 -13
  159. package/src/components/tickets/hooks/use-tickets-list.ts +2 -13
  160. package/src/components/tickets/index.ts +10 -0
  161. package/src/components/tickets/ticket-detail-drawer.tsx +45 -13
  162. package/src/components/tickets/ticket-live-provider.tsx +474 -0
  163. package/src/components/tickets/types.ts +62 -11
  164. package/src/components/ui/button/button.tsx +165 -133
  165. package/src/contexts/chat-runtime-context.tsx +8 -0
  166. package/src/hooks/ui/use-header-height.ts +3 -1
  167. package/src/stories/TopNavigation.stories.tsx +20 -1
  168. package/src/types/navigation.ts +10 -0
  169. package/src/utils/index.ts +12 -0
  170. package/src/utils/sse-subscription.ts +276 -0
  171. package/dist/chunk-3T4SMJM5.cjs.map +0 -1
  172. package/dist/chunk-6GT557KN.js.map +0 -1
  173. package/dist/chunk-DMXB3VE2.cjs.map +0 -1
  174. package/dist/chunk-F7AD5CUU.js.map +0 -1
  175. package/dist/chunk-FFXNRJ5S.cjs.map +0 -1
  176. package/dist/chunk-HR6F6IP4.js.map +0 -1
  177. package/dist/chunk-JGXAVNZQ.js.map +0 -1
  178. package/dist/chunk-L5CI57RM.cjs.map +0 -1
  179. package/dist/chunk-LILQJ3UZ.cjs.map +0 -1
  180. package/dist/chunk-WHJGRRK2.js.map +0 -1
  181. /package/dist/{chunk-SFJRMBJC.js.map → chunk-5SVNA7IU.js.map} +0 -0
  182. /package/dist/{chunk-OAWFYZZT.js.map → chunk-7DOSAJDK.js.map} +0 -0
  183. /package/dist/{chunk-BZF63JXP.js.map → chunk-CRJVO4KO.js.map} +0 -0
  184. /package/dist/{chunk-VO2ZONMR.js.map → chunk-FNTFWP2A.js.map} +0 -0
  185. /package/dist/{chunk-VCPTU4IW.js.map → chunk-HWER6KGU.js.map} +0 -0
  186. /package/dist/{chunk-4SR2QHMB.js.map → chunk-ITVWX5HX.js.map} +0 -0
  187. /package/dist/{chunk-FTOVZ7O2.js.map → chunk-NPO6CHCR.js.map} +0 -0
  188. /package/dist/{chunk-XV5SXALY.js.map → chunk-NT5FX7GZ.js.map} +0 -0
  189. /package/dist/{chunk-CLQEBWV7.js.map → chunk-QE55ROZW.js.map} +0 -0
  190. /package/dist/{chunk-G43CEISB.js.map → chunk-TA3VJ2QO.js.map} +0 -0
  191. /package/dist/{chunk-VYEDTVIZ.js.map → chunk-XJPMTJAR.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
2
 
3
3
 
4
- var _chunk5RIHLXEPcjs = require('./chunk-5RIHLXEP.cjs');
4
+ var _chunkDDVQ5NKKcjs = require('./chunk-DDVQ5NKK.cjs');
5
5
 
6
6
 
7
7
 
@@ -10,7 +10,7 @@ var _chunk5RIHLXEPcjs = require('./chunk-5RIHLXEP.cjs');
10
10
 
11
11
 
12
12
 
13
- var _chunkJ4T5ZBWGcjs = require('./chunk-J4T5ZBWG.cjs');
13
+ var _chunkBZRP54IOcjs = require('./chunk-BZRP54IO.cjs');
14
14
 
15
15
 
16
16
 
@@ -37,17 +37,18 @@ var _chunkJ4T5ZBWGcjs = require('./chunk-J4T5ZBWG.cjs');
37
37
 
38
38
 
39
39
 
40
- var _chunkDMXB3VE2cjs = require('./chunk-DMXB3VE2.cjs');
41
40
 
41
+ var _chunkU3YLML53cjs = require('./chunk-U3YLML53.cjs');
42
42
 
43
43
 
44
44
 
45
45
 
46
46
 
47
- var _chunkFFXNRJ5Scjs = require('./chunk-FFXNRJ5S.cjs');
48
47
 
48
+ var _chunkLOBR7IC6cjs = require('./chunk-LOBR7IC6.cjs');
49
49
 
50
- var _chunkLILQJ3UZcjs = require('./chunk-LILQJ3UZ.cjs');
50
+
51
+ var _chunk3ENGUBJPcjs = require('./chunk-3ENGUBJP.cjs');
51
52
 
52
53
 
53
54
 
@@ -58,24 +59,24 @@ var _chunkSSJNN5BScjs = require('./chunk-SSJNN5BS.cjs');
58
59
 
59
60
 
60
61
 
61
- var _chunkL5CI57RMcjs = require('./chunk-L5CI57RM.cjs');
62
+ var _chunkT3BF6JTQcjs = require('./chunk-T3BF6JTQ.cjs');
62
63
 
63
64
  // src/components/tickets/ticket-center.tsx
64
65
  var _react = require('react');
65
66
  var _reactquery = require('@tanstack/react-query');
66
- _chunkL5CI57RMcjs.init_button2.call(void 0, );
67
+ _chunkT3BF6JTQcjs.init_button2.call(void 0, );
67
68
  var _lucidereact = require('lucide-react');
68
69
 
69
70
  // src/components/tickets/ticket-open-form.tsx
70
71
 
71
- _chunkL5CI57RMcjs.init_button2.call(void 0, );
72
+ _chunkT3BF6JTQcjs.init_button2.call(void 0, );
72
73
 
73
74
  // src/components/tickets/types.ts
74
75
  function isOptimistic(t) {
75
76
  return t._optimistic === true;
76
77
  }
77
78
  var TICKET_TEXT_MAX_CHARS = 5e3;
78
- var TICKET_LIVE_POLL_MS = 8e3;
79
+ var TICKET_MARK_READ_DEBOUNCE_MS = 2e3;
79
80
  var TOAST_COPY = {
80
81
  open_success: { title: "Ticket opened", description: "We received your message and will follow up shortly." },
81
82
  open_mirror_pending: { title: "Ticket opened", description: "Syncing \u2014 your ticket will appear momentarily." },
@@ -96,7 +97,7 @@ function TicketOpenForm({
96
97
  }) {
97
98
  const [subject, setSubject] = _react.useState.call(void 0, "");
98
99
  const [content, setContent] = _react.useState.call(void 0, "");
99
- const { attachments, readyAttachments, hasInflightUploads, addFiles, removeAttachment, clear } = _chunkDMXB3VE2cjs.useChatAttachments.call(void 0, );
100
+ const { attachments, readyAttachments, hasInflightUploads, addFiles, removeAttachment, clear } = _chunkU3YLML53cjs.useChatAttachments.call(void 0, );
100
101
  const trimmedSubject = subject.trim();
101
102
  const trimmedContent = content.trim();
102
103
  const overCap = content.length > TICKET_TEXT_MAX_CHARS;
@@ -116,7 +117,7 @@ function TicketOpenForm({
116
117
  clear();
117
118
  }
118
119
  };
119
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDMXB3VE2cjs.Card, { className: "p-6", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: handleSubmit, className: "flex flex-col md:flex-row gap-6", children: [
120
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU3YLML53cjs.Card, { className: "p-6", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: handleSubmit, className: "flex flex-col md:flex-row gap-6", children: [
120
121
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex-1 min-w-0 md:max-w-md", children: [
121
122
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "text-h2 text-ods-text-primary mb-2", children: "Need Support?" }),
122
123
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-ods-text-secondary text-h6", children: "Can't find what you're looking for? Submit a support ticket below \u2014 we'll follow up shortly." }),
@@ -133,7 +134,7 @@ function TicketOpenForm({
133
134
  }
134
135
  ),
135
136
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
136
- _chunkL5CI57RMcjs.Input,
137
+ _chunkT3BF6JTQcjs.Input,
137
138
  {
138
139
  id: "ticket-subject",
139
140
  type: "text",
@@ -155,7 +156,7 @@ function TicketOpenForm({
155
156
  }
156
157
  ),
157
158
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
158
- _chunkDMXB3VE2cjs.Textarea,
159
+ _chunkU3YLML53cjs.Textarea,
159
160
  {
160
161
  id: "ticket-content",
161
162
  placeholder: "Describe your issue or question in detail...",
@@ -179,7 +180,7 @@ function TicketOpenForm({
179
180
  )
180
181
  ] }),
181
182
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
182
- _chunkDMXB3VE2cjs.ChatAttachmentChipStrip,
183
+ _chunkU3YLML53cjs.ChatAttachmentChipStrip,
183
184
  {
184
185
  attachments,
185
186
  onRemove: removeAttachment,
@@ -188,7 +189,7 @@ function TicketOpenForm({
188
189
  ),
189
190
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-between gap-3", children: [
190
191
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
191
- _chunkDMXB3VE2cjs.ChatAttachmentAddButton,
192
+ _chunkU3YLML53cjs.ChatAttachmentAddButton,
192
193
  {
193
194
  attachmentsEnabled: !supportSystemDown,
194
195
  attachmentsCount: attachments.length,
@@ -197,7 +198,7 @@ function TicketOpenForm({
197
198
  }
198
199
  ),
199
200
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
200
- _chunkL5CI57RMcjs.Button,
201
+ _chunkT3BF6JTQcjs.Button,
201
202
  {
202
203
  type: "submit",
203
204
  disabled: !canSubmit,
@@ -219,16 +220,17 @@ var Collapsible = CollapsiblePrimitive.Root;
219
220
  var CollapsibleContent2 = CollapsiblePrimitive.CollapsibleContent;
220
221
 
221
222
  // src/components/tickets/ticket-detail-drawer.tsx
222
- _chunkL5CI57RMcjs.init_button2.call(void 0, );
223
+ _chunkT3BF6JTQcjs.init_button2.call(void 0, );
224
+
223
225
  var _usesticktobottom = require('use-stick-to-bottom');
224
226
 
225
227
  // src/components/tickets/hooks/use-ticket-engagements.ts
226
228
 
227
229
  var LIST_ENGAGEMENTS_ENDPOINT = "/api/chat/agent/list-engagements";
228
- function useTicketEngagements(externalTicketId, enabled = true, refetchInterval = false) {
229
- const identity = _chunkDMXB3VE2cjs.useChatIdentity.call(void 0, );
230
+ function useTicketEngagements(externalTicketId, enabled = true) {
231
+ const identity = _chunkU3YLML53cjs.useChatIdentity.call(void 0, );
230
232
  const identityKey = _nullishCoalesce(_optionalChain([identity, 'access', _2 => _2.user, 'optionalAccess', _3 => _3.email]), () => ( "anon"));
231
- const listEngagementsEndpoint = _nullishCoalesce(_chunkLILQJ3UZcjs.useRequiredChatRuntime.call(void 0, ).endpoints.listEngagementsUrl, () => ( LIST_ENGAGEMENTS_ENDPOINT));
233
+ const listEngagementsEndpoint = _nullishCoalesce(_chunk3ENGUBJPcjs.useRequiredChatRuntime.call(void 0, ).endpoints.listEngagementsUrl, () => ( LIST_ENGAGEMENTS_ENDPOINT));
232
234
  const fetchable = enabled && !!externalTicketId && !externalTicketId.startsWith("temp-");
233
235
  const queryEnabled = fetchable && identity.authTier !== "anon" && !!_optionalChain([identity, 'access', _4 => _4.user, 'optionalAccess', _5 => _5.email]);
234
236
  const query = _reactquery.useQuery.call(void 0, {
@@ -241,13 +243,12 @@ function useTicketEngagements(externalTicketId, enabled = true, refetchInterval
241
243
  gcTime: 0,
242
244
  refetchOnMount: "always",
243
245
  refetchOnWindowFocus: true,
244
- // Live conversation: poll while the caller opts in (drawer open). New
245
- // agent replies + attachments appear within one interval without a
246
- // manual refresh. `refetchIntervalInBackground` stays false (default)
247
- // so polling pauses on a hidden tab.
248
- refetchInterval,
246
+ // NO interval polling (deleted 2026-08): new agent replies arrive via
247
+ // `TicketLiveProvider`'s stream-driven invalidation of
248
+ // `['ticket-engagements', id]`; focus/mount refetch is the no-stream
249
+ // fallback.
249
250
  queryFn: async () => {
250
- const response = await _chunkFFXNRJ5Scjs.embedAuthedFetch.call(void 0, listEngagementsEndpoint, {
251
+ const response = await _chunkLOBR7IC6cjs.embedAuthedFetch.call(void 0, listEngagementsEndpoint, {
251
252
  method: "POST",
252
253
  body: JSON.stringify({ ticket_id: externalTicketId })
253
254
  });
@@ -308,7 +309,7 @@ function TicketLinkedDeliveryCard({
308
309
  {
309
310
  className: `rounded-md border border-ods-border bg-ods-bg overflow-hidden ${_nullishCoalesce(className, () => ( ""))}`,
310
311
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
311
- _chunkJ4T5ZBWGcjs.DeliveryRow,
312
+ _chunkBZRP54IOcjs.DeliveryRow,
312
313
  {
313
314
  item,
314
315
  href: clickup.delivery_href,
@@ -320,7 +321,7 @@ function TicketLinkedDeliveryCard({
320
321
  }
321
322
 
322
323
  // src/components/tickets/ticket-reply-composer.tsx
323
- _chunkL5CI57RMcjs.init_button2.call(void 0, );
324
+ _chunkT3BF6JTQcjs.init_button2.call(void 0, );
324
325
 
325
326
 
326
327
  function TicketReplyComposer({
@@ -332,7 +333,7 @@ function TicketReplyComposer({
332
333
  }) {
333
334
  const [resolution, setResolution] = _react.useState.call(void 0, "");
334
335
  const [closeDialogOpen, setCloseDialogOpen] = _react.useState.call(void 0, false);
335
- const attachments = _chunkDMXB3VE2cjs.useChatAttachments.call(void 0, );
336
+ const attachments = _chunkU3YLML53cjs.useChatAttachments.call(void 0, );
336
337
  const ticketRef = { id: ticket.id, external_id: ticket.external_id };
337
338
  const hasReadyFiles = attachments.readyAttachments.length > 0;
338
339
  const handleSend = _react.useCallback.call(void 0,
@@ -360,7 +361,7 @@ function TicketReplyComposer({
360
361
  const disabled = busy || supportSystemDown;
361
362
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-2", children: [
362
363
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
363
- _chunkDMXB3VE2cjs.ChatAttachmentChipStrip,
364
+ _chunkU3YLML53cjs.ChatAttachmentChipStrip,
364
365
  {
365
366
  attachments: attachments.attachments,
366
367
  onRemove: attachments.removeAttachment,
@@ -369,7 +370,7 @@ function TicketReplyComposer({
369
370
  }
370
371
  ),
371
372
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
372
- _chunkDMXB3VE2cjs.ChatInput,
373
+ _chunkU3YLML53cjs.ChatInput,
373
374
  {
374
375
  fullWidth: true,
375
376
  autoFocus: true,
@@ -383,7 +384,7 @@ function TicketReplyComposer({
383
384
  ),
384
385
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2 w-full", children: [
385
386
  !supportSystemDown && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
386
- _chunkDMXB3VE2cjs.ChatAttachmentAddButton,
387
+ _chunkU3YLML53cjs.ChatAttachmentAddButton,
387
388
  {
388
389
  attachmentsEnabled: true,
389
390
  attachmentsCount: attachments.attachments.length,
@@ -394,7 +395,7 @@ function TicketReplyComposer({
394
395
  ),
395
396
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex-1 min-w-0" }),
396
397
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
397
- _chunkL5CI57RMcjs.Button,
398
+ _chunkT3BF6JTQcjs.Button,
398
399
  {
399
400
  type: "button",
400
401
  variant: "transparent",
@@ -406,13 +407,13 @@ function TicketReplyComposer({
406
407
  }
407
408
  )
408
409
  ] }),
409
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDMXB3VE2cjs.AlertDialog, { open: closeDialogOpen, onOpenChange: setCloseDialogOpen, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkDMXB3VE2cjs.AlertDialogContent, { className: "bg-ods-card border-ods-border", children: [
410
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkDMXB3VE2cjs.AlertDialogHeader, { children: [
411
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDMXB3VE2cjs.AlertDialogTitle, { className: "text-ods-text-primary", children: "Close this ticket?" }),
412
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDMXB3VE2cjs.AlertDialogDescription, { className: "text-ods-text-secondary", children: "Add an optional resolution note below. You can reopen the ticket later if needed." })
410
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU3YLML53cjs.AlertDialog, { open: closeDialogOpen, onOpenChange: setCloseDialogOpen, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU3YLML53cjs.AlertDialogContent, { className: "bg-ods-card border-ods-border", children: [
411
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU3YLML53cjs.AlertDialogHeader, { children: [
412
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU3YLML53cjs.AlertDialogTitle, { className: "text-ods-text-primary", children: "Close this ticket?" }),
413
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU3YLML53cjs.AlertDialogDescription, { className: "text-ods-text-secondary", children: "Add an optional resolution note below. You can reopen the ticket later if needed." })
413
414
  ] }),
414
415
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
415
- _chunkDMXB3VE2cjs.Textarea,
416
+ _chunkU3YLML53cjs.Textarea,
416
417
  {
417
418
  value: resolution,
418
419
  onChange: (e) => setResolution(e.target.value),
@@ -422,9 +423,9 @@ function TicketReplyComposer({
422
423
  className: "mt-2"
423
424
  }
424
425
  ),
425
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkDMXB3VE2cjs.AlertDialogFooter, { children: [
426
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU3YLML53cjs.AlertDialogFooter, { children: [
426
427
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
427
- _chunkDMXB3VE2cjs.AlertDialogCancel,
428
+ _chunkU3YLML53cjs.AlertDialogCancel,
428
429
  {
429
430
  disabled: busy,
430
431
  className: "bg-transparent border-ods-border text-ods-text-primary hover:bg-ods-border",
@@ -432,7 +433,7 @@ function TicketReplyComposer({
432
433
  }
433
434
  ),
434
435
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
435
- _chunkDMXB3VE2cjs.AlertDialogAction,
436
+ _chunkU3YLML53cjs.AlertDialogAction,
436
437
  {
437
438
  onClick: () => void confirmClose(),
438
439
  disabled: busy,
@@ -502,31 +503,53 @@ var TICKET_FEED_HEIGHT = "h-[60vh] md:h-[420px]";
502
503
  var TICKET_FEED_INNER = "flex flex-col gap-4 md:gap-6 px-4 md:px-6 py-4 md:py-6";
503
504
  var TICKET_FEED_SKELETON_ROWS = 6;
504
505
  function TicketTimelinePanel({ ticket }) {
505
- const identity = _chunkDMXB3VE2cjs.useChatIdentity.call(void 0, );
506
+ const identity = _chunkU3YLML53cjs.useChatIdentity.call(void 0, );
506
507
  const externalId = isOptimistic(ticket) ? null : ticket.external_id;
507
- const { engagements, isLoading } = useTicketEngagements(
508
- externalId,
509
- !!externalId,
510
- TICKET_LIVE_POLL_MS
511
- );
508
+ const { engagements, isLoading } = useTicketEngagements(externalId, !!externalId);
509
+ const live = _chunkU3YLML53cjs.useOptionalTicketLive.call(void 0, );
510
+ const setOpenTicketId = _optionalChain([live, 'optionalAccess', _6 => _6.setOpenTicketId]);
511
+ const markRead = _optionalChain([live, 'optionalAccess', _7 => _7.markRead]);
512
+ const markReadDebounceRef = _react.useRef.call(void 0, null);
513
+ _react.useEffect.call(void 0, () => {
514
+ if (!externalId || !setOpenTicketId || !markRead) return;
515
+ setOpenTicketId(externalId);
516
+ void markRead(externalId);
517
+ return () => {
518
+ if (markReadDebounceRef.current) {
519
+ clearTimeout(markReadDebounceRef.current);
520
+ markReadDebounceRef.current = null;
521
+ void markRead(externalId);
522
+ }
523
+ setOpenTicketId(null);
524
+ };
525
+ }, [externalId, setOpenTicketId, markRead]);
526
+ const engagementsCount = engagements.length;
527
+ _react.useEffect.call(void 0, () => {
528
+ if (!externalId || !markRead || engagementsCount === 0) return;
529
+ if (markReadDebounceRef.current) clearTimeout(markReadDebounceRef.current);
530
+ markReadDebounceRef.current = setTimeout(() => {
531
+ markReadDebounceRef.current = null;
532
+ void markRead(externalId);
533
+ }, TICKET_MARK_READ_DEBOUNCE_MS);
534
+ }, [engagementsCount, externalId, markRead]);
512
535
  const { scrollRef, contentRef } = _usesticktobottom.useStickToBottom.call(void 0, { initial: "instant", resize: "smooth" });
513
536
  const bodyTurns = ticket.body ? ticket.body.split(TURN_SEPARATOR_RE).map((t) => t.trim()).filter(Boolean) : [];
514
537
  const customerEngagementBodies = new Set(
515
538
  engagements.filter((e) => e.authorRole === "customer").map((e) => (_nullishCoalesce(e.body, () => ( ""))).trim()).filter(Boolean)
516
539
  );
517
540
  const suppressBodyTurnZero = bodyTurns.length > 0 && customerEngagementBodies.has(bodyTurns[0]);
518
- const sessionEmailLower = _nullishCoalesce(_optionalChain([identity, 'access', _6 => _6.user, 'optionalAccess', _7 => _7.email, 'optionalAccess', _8 => _8.trim, 'call', _9 => _9(), 'access', _10 => _10.toLowerCase, 'call', _11 => _11()]), () => ( null));
541
+ const sessionEmailLower = _nullishCoalesce(_optionalChain([identity, 'access', _8 => _8.user, 'optionalAccess', _9 => _9.email, 'optionalAccess', _10 => _10.trim, 'call', _11 => _11(), 'access', _12 => _12.toLowerCase, 'call', _13 => _13()]), () => ( null));
519
542
  const isViewerTheCustomer = !!sessionEmailLower && ticket.customer_emails.some((e) => e.trim().toLowerCase() === sessionEmailLower);
520
- const viewerName = _optionalChain([identity, 'access', _12 => _12.user, 'optionalAccess', _13 => _13.name, 'optionalAccess', _14 => _14.trim, 'call', _15 => _15()]) || null;
521
- const ticketCustomerName = _optionalChain([ticket, 'access', _16 => _16.customer_name, 'optionalAccess', _17 => _17.trim, 'call', _18 => _18()]) || null;
522
- const customerName = (isViewerTheCustomer ? viewerName : null) || ticketCustomerName || viewerName || _optionalChain([identity, 'access', _19 => _19.user, 'optionalAccess', _20 => _20.email]) || "You";
523
- const customerAvatar = isViewerTheCustomer ? _nullishCoalesce(_optionalChain([identity, 'access', _21 => _21.user, 'optionalAccess', _22 => _22.avatarUrl]), () => ( void 0)) : void 0;
543
+ const viewerName = _optionalChain([identity, 'access', _14 => _14.user, 'optionalAccess', _15 => _15.name, 'optionalAccess', _16 => _16.trim, 'call', _17 => _17()]) || null;
544
+ const ticketCustomerName = _optionalChain([ticket, 'access', _18 => _18.customer_name, 'optionalAccess', _19 => _19.trim, 'call', _20 => _20()]) || null;
545
+ const customerName = (isViewerTheCustomer ? viewerName : null) || ticketCustomerName || viewerName || _optionalChain([identity, 'access', _21 => _21.user, 'optionalAccess', _22 => _22.email]) || "You";
546
+ const customerAvatar = isViewerTheCustomer ? _nullishCoalesce(_optionalChain([identity, 'access', _23 => _23.user, 'optionalAccess', _24 => _24.avatarUrl]), () => ( void 0)) : void 0;
524
547
  if (isLoading) {
525
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `${TICKET_FEED_FRAME} ${TICKET_FEED_HEIGHT}`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: TICKET_FEED_INNER, children: Array.from({ length: TICKET_FEED_SKELETON_ROWS }, (_, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDMXB3VE2cjs.ChatMessageRowSkeleton, {}, i)) }) });
548
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `${TICKET_FEED_FRAME} ${TICKET_FEED_HEIGHT}`, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: TICKET_FEED_INNER, children: Array.from({ length: TICKET_FEED_SKELETON_ROWS }, (_, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU3YLML53cjs.ChatMessageRowSkeleton, {}, i)) }) });
526
549
  }
527
550
  if (bodyTurns.length === 0 && engagements.length === 0) {
528
551
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
529
- _chunkJ4T5ZBWGcjs.EmptyState,
552
+ _chunkBZRP54IOcjs.EmptyState,
530
553
  {
531
554
  type: "generic",
532
555
  title: "No conversation yet",
@@ -541,7 +564,7 @@ function TicketTimelinePanel({ ticket }) {
541
564
  const isResolution = turn.startsWith("[Resolution]");
542
565
  const text = isResolution ? turn.replace(/^\[Resolution\]\s*/, "") : turn;
543
566
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
544
- _chunkDMXB3VE2cjs.ChatMessageRow,
567
+ _chunkU3YLML53cjs.ChatMessageRow,
545
568
  {
546
569
  displayName: customerName,
547
570
  avatarUrl: customerAvatar,
@@ -552,12 +575,12 @@ function TicketTimelinePanel({ ticket }) {
552
575
  }),
553
576
  engagements.map((eng) => {
554
577
  const isCustomer = eng.authorRole === "customer";
555
- const isOwnReply = isCustomer && !!eng.authorId && !!_optionalChain([identity, 'access', _23 => _23.user, 'optionalAccess', _24 => _24.email]) && eng.authorId.toLowerCase() === identity.user.email.toLowerCase();
578
+ const isOwnReply = isCustomer && !!eng.authorId && !!_optionalChain([identity, 'access', _25 => _25.user, 'optionalAccess', _26 => _26.email]) && eng.authorId.toLowerCase() === identity.user.email.toLowerCase();
556
579
  let author;
557
580
  let avatarSrc;
558
581
  if (isCustomer && isOwnReply) {
559
- author = _optionalChain([identity, 'access', _25 => _25.user, 'optionalAccess', _26 => _26.name, 'optionalAccess', _27 => _27.trim, 'call', _28 => _28()]) || customerName;
560
- avatarSrc = _nullishCoalesce(_optionalChain([identity, 'access', _29 => _29.user, 'optionalAccess', _30 => _30.avatarUrl]), () => ( void 0));
582
+ author = _optionalChain([identity, 'access', _27 => _27.user, 'optionalAccess', _28 => _28.name, 'optionalAccess', _29 => _29.trim, 'call', _30 => _30()]) || customerName;
583
+ avatarSrc = _nullishCoalesce(_optionalChain([identity, 'access', _31 => _31.user, 'optionalAccess', _32 => _32.avatarUrl]), () => ( void 0));
561
584
  } else if (isCustomer) {
562
585
  author = ticketCustomerName || "Customer";
563
586
  avatarSrc = void 0;
@@ -570,13 +593,13 @@ function TicketTimelinePanel({ ticket }) {
570
593
  }
571
594
  const engAttachments = mapEngagementAttachments(eng.attachments);
572
595
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
573
- _chunkDMXB3VE2cjs.ChatMessageRow,
596
+ _chunkU3YLML53cjs.ChatMessageRow,
574
597
  {
575
598
  displayName: author,
576
599
  avatarUrl: avatarSrc,
577
- timeLabel: eng.createdAt ? _chunkDMXB3VE2cjs.formatRelativeTime.call(void 0, eng.createdAt) : null,
600
+ timeLabel: eng.createdAt ? _chunkU3YLML53cjs.formatRelativeTime.call(void 0, eng.createdAt) : null,
578
601
  body: stripAttachmentsPreamble(_nullishCoalesce(eng.body, () => ( ""))),
579
- footer: engAttachments.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mt-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDMXB3VE2cjs.TicketAttachmentsList, { attachments: engAttachments, size: "compact" }) }) : null
602
+ footer: engAttachments.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mt-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU3YLML53cjs.TicketAttachmentsList, { attachments: engAttachments, size: "compact" }) }) : null
580
603
  },
581
604
  eng.id
582
605
  );
@@ -591,7 +614,7 @@ function mapEngagementAttachments(files) {
591
614
  // Show an inline thumbnail for image attachments (the signed `url` is a
592
615
  // viewable URL). Non-images fall back to the file-type icon. SquareAvatar
593
616
  // degrades to initials on a broken/expired image URL.
594
- thumbnailSrc: f.url && (_nullishCoalesce(_optionalChain([f, 'access', _31 => _31.mime, 'optionalAccess', _32 => _32.startsWith, 'call', _33 => _33("image/")]), () => ( false))) ? f.url : void 0,
617
+ thumbnailSrc: f.url && (_nullishCoalesce(_optionalChain([f, 'access', _33 => _33.mime, 'optionalAccess', _34 => _34.startsWith, 'call', _35 => _35("image/")]), () => ( false))) ? f.url : void 0,
595
618
  onDownload: f.url ? () => window.open(f.url, "_blank", "noopener,noreferrer") : void 0
596
619
  }));
597
620
  }
@@ -615,7 +638,7 @@ function ReopenAction({
615
638
  void await onReopen(ticketRef);
616
639
  };
617
640
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex justify-end", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
618
- _chunkL5CI57RMcjs.Button,
641
+ _chunkT3BF6JTQcjs.Button,
619
642
  {
620
643
  type: "button",
621
644
  variant: "outline",
@@ -640,7 +663,7 @@ function ReplyFailureBanner({
640
663
  children: [
641
664
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "font-medium leading-snug", children: error.message }),
642
665
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
643
- _chunkL5CI57RMcjs.Button,
666
+ _chunkT3BF6JTQcjs.Button,
644
667
  {
645
668
  type: "button",
646
669
  variant: "transparent",
@@ -657,18 +680,18 @@ function ReplyFailureBanner({
657
680
  function AssignedAgentRow({
658
681
  assignedOwner
659
682
  }) {
660
- const trimmedName = _optionalChain([assignedOwner, 'optionalAccess', _34 => _34.name, 'optionalAccess', _35 => _35.trim, 'call', _36 => _36()]) || null;
661
- const emailFallback = _optionalChain([assignedOwner, 'optionalAccess', _37 => _37.email, 'optionalAccess', _38 => _38.trim, 'call', _39 => _39()]) || null;
683
+ const trimmedName = _optionalChain([assignedOwner, 'optionalAccess', _36 => _36.name, 'optionalAccess', _37 => _37.trim, 'call', _38 => _38()]) || null;
684
+ const emailFallback = _optionalChain([assignedOwner, 'optionalAccess', _39 => _39.email, 'optionalAccess', _40 => _40.trim, 'call', _41 => _41()]) || null;
662
685
  const displayLabel = _nullishCoalesce(trimmedName, () => ( (emailFallback ? emailFallback.split("@")[0] : null)));
663
686
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2 text-h6", children: [
664
687
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-h5 text-ods-text-secondary", children: "Assigned to" }),
665
688
  displayLabel ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex items-center gap-1.5 text-ods-text-primary font-medium", children: [
666
689
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
667
- _chunkDMXB3VE2cjs.SquareAvatar,
690
+ _chunkU3YLML53cjs.SquareAvatar,
668
691
  {
669
692
  size: "sm",
670
693
  variant: "round",
671
- src: _nullishCoalesce(_optionalChain([assignedOwner, 'optionalAccess', _40 => _40.avatarUrl]), () => ( void 0)),
694
+ src: _nullishCoalesce(_optionalChain([assignedOwner, 'optionalAccess', _42 => _42.avatarUrl]), () => ( void 0)),
672
695
  alt: displayLabel,
673
696
  fallback: displayLabel
674
697
  }
@@ -696,7 +719,7 @@ function TicketRow({
696
719
  const rowRef = _react.useRef.call(void 0, null);
697
720
  const handleClick = _react.useCallback.call(void 0, () => {
698
721
  onToggle(ticket.id);
699
- _chunkFFXNRJ5Scjs.scrollElementIntoView.call(void 0, rowRef.current, {
722
+ _chunkLOBR7IC6cjs.scrollElementIntoView.call(void 0, rowRef.current, {
700
723
  adjustTargetY: (raw) => {
701
724
  if (!rowRef.current) return raw;
702
725
  const expandedDrawer = document.querySelector(
@@ -722,7 +745,7 @@ function TicketRow({
722
745
  // so the badge accurately reflects "Closed" with a checkmark.
723
746
  statusLabel: _nullishCoalesce(ticket.pipeline_stage_label, () => ( void 0)),
724
747
  category: _nullishCoalesce(ticket.customer_company, () => ( void 0)),
725
- timeAgo: ticket.hubspot_updated_at ? _chunkDMXB3VE2cjs.formatRelativeTime.call(void 0, ticket.hubspot_updated_at) : void 0,
748
+ timeAgo: ticket.hubspot_updated_at ? _chunkU3YLML53cjs.formatRelativeTime.call(void 0, ticket.hubspot_updated_at) : void 0,
726
749
  // Linked-work chip: surfaced whenever the ticket has a linked
727
750
  // ClickUp task. Uses the linked task's own status so the chip text
728
751
  // reads "Working" / "Waiting on version release" / etc. — useful
@@ -737,7 +760,7 @@ function TicketRow({
737
760
  className: "border-b border-ods-border last:border-b-0",
738
761
  children: [
739
762
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
740
- _chunkDMXB3VE2cjs.ChatTicketItem,
763
+ _chunkU3YLML53cjs.ChatTicketItem,
741
764
  {
742
765
  ticket: tileData,
743
766
  onClick: optimistic ? void 0 : handleClick,
@@ -774,7 +797,7 @@ function TicketRow({
774
797
  var FIND_TICKET_ENDPOINT = "/api/chat/agent/find-ticket";
775
798
  var DEFAULT_PAGE_SIZE = 20;
776
799
  function useTicketsList(filters) {
777
- const findTicketEndpoint = _nullishCoalesce(_chunkLILQJ3UZcjs.useRequiredChatRuntime.call(void 0, ).endpoints.findTicketUrl, () => ( FIND_TICKET_ENDPOINT));
800
+ const findTicketEndpoint = _nullishCoalesce(_chunk3ENGUBJPcjs.useRequiredChatRuntime.call(void 0, ).endpoints.findTicketUrl, () => ( FIND_TICKET_ENDPOINT));
778
801
  const customerEmail = filters.customerEmail;
779
802
  const search = (_nullishCoalesce(filters.search, () => ( ""))).trim();
780
803
  const status = (_nullishCoalesce(filters.status, () => ( ""))).trim().toLowerCase();
@@ -783,7 +806,6 @@ function useTicketsList(filters) {
783
806
  const pageSize = Math.max(1, Math.min(100, Math.floor(_nullishCoalesce(filters.pageSize, () => ( DEFAULT_PAGE_SIZE))) || DEFAULT_PAGE_SIZE));
784
807
  const enabled = !!customerEmail;
785
808
  const identityKey = customerEmail || "anon";
786
- const refetchInterval = _nullishCoalesce(filters.refetchInterval, () => ( false));
787
809
  const query = _reactquery.useQuery.call(void 0, {
788
810
  queryKey: ["tickets", "self", identityKey, search, statusFilter, page, pageSize],
789
811
  enabled,
@@ -796,10 +818,8 @@ function useTicketsList(filters) {
796
818
  gcTime: 0,
797
819
  refetchOnMount: "always",
798
820
  refetchOnWindowFocus: true,
799
- // Live status: poll while the caller opts in (drawer open). Defaults to
800
- // false. `refetchIntervalInBackground` stays false (the default) so polling
801
- // pauses on a hidden tab — no wasted requests when the user tabs away.
802
- refetchInterval,
821
+ // NO interval polling (deleted 2026-08): live freshness is push-driven
822
+ // — `TicketLiveProvider` invalidates `['tickets']` on stream events.
803
823
  queryFn: async () => {
804
824
  const body = {
805
825
  query: search,
@@ -807,7 +827,7 @@ function useTicketsList(filters) {
807
827
  pageSize
808
828
  };
809
829
  if (statusFilter) body.status = statusFilter;
810
- const response = await _chunkFFXNRJ5Scjs.embedAuthedFetch.call(void 0, findTicketEndpoint, {
830
+ const response = await _chunkLOBR7IC6cjs.embedAuthedFetch.call(void 0, findTicketEndpoint, {
811
831
  method: "POST",
812
832
  body: JSON.stringify(body)
813
833
  });
@@ -819,12 +839,12 @@ function useTicketsList(filters) {
819
839
  }
820
840
  });
821
841
  const data = query.data;
822
- const totalCount = _nullishCoalesce(_nullishCoalesce(_optionalChain([data, 'optionalAccess', _41 => _41.totalCount]), () => ( _optionalChain([data, 'optionalAccess', _42 => _42.count]))), () => ( (_nullishCoalesce(_optionalChain([data, 'optionalAccess', _43 => _43.tickets, 'optionalAccess', _44 => _44.length]), () => ( 0)))));
823
- const echoedPage = _nullishCoalesce(_optionalChain([data, 'optionalAccess', _45 => _45.page]), () => ( page));
824
- const echoedPageSize = _nullishCoalesce(_optionalChain([data, 'optionalAccess', _46 => _46.pageSize]), () => ( pageSize));
825
- const totalPages = _nullishCoalesce(_optionalChain([data, 'optionalAccess', _47 => _47.totalPages]), () => ( Math.max(1, Math.ceil(totalCount / echoedPageSize))));
842
+ const totalCount = _nullishCoalesce(_nullishCoalesce(_optionalChain([data, 'optionalAccess', _43 => _43.totalCount]), () => ( _optionalChain([data, 'optionalAccess', _44 => _44.count]))), () => ( (_nullishCoalesce(_optionalChain([data, 'optionalAccess', _45 => _45.tickets, 'optionalAccess', _46 => _46.length]), () => ( 0)))));
843
+ const echoedPage = _nullishCoalesce(_optionalChain([data, 'optionalAccess', _47 => _47.page]), () => ( page));
844
+ const echoedPageSize = _nullishCoalesce(_optionalChain([data, 'optionalAccess', _48 => _48.pageSize]), () => ( pageSize));
845
+ const totalPages = _nullishCoalesce(_optionalChain([data, 'optionalAccess', _49 => _49.totalPages]), () => ( Math.max(1, Math.ceil(totalCount / echoedPageSize))));
826
846
  return {
827
- tickets: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _48 => _48.tickets]), () => ( [])),
847
+ tickets: _nullishCoalesce(_optionalChain([data, 'optionalAccess', _50 => _50.tickets]), () => ( [])),
828
848
  // Loading-state-truth = `data === undefined`. TanStack v5's
829
849
  // `isPending` / `isLoading` flags can be `false` in transient
830
850
  // windows where the query is enabled-but-fetch-not-yet-fired
@@ -846,7 +866,7 @@ function useTicketsList(filters) {
846
866
  // - Background refetch with existing data: data !== undefined → no load
847
867
  // - Filter-change refetch landing on empty results: data?.tickets===[]
848
868
  // + isFetching → bridge skeleton (the `||` branch)
849
- isLoading: enabled && (data === void 0 || query.isFetching && (_nullishCoalesce(_optionalChain([data, 'optionalAccess', _49 => _49.tickets]), () => ( []))).length === 0),
869
+ isLoading: enabled && (data === void 0 || query.isFetching && (_nullishCoalesce(_optionalChain([data, 'optionalAccess', _51 => _51.tickets]), () => ( []))).length === 0),
850
870
  isFetching: query.isFetching,
851
871
  error: _nullishCoalesce(query.error, () => ( null)),
852
872
  refetch: () => {
@@ -873,7 +893,9 @@ var REPLY_BANNER_CODES = /* @__PURE__ */ new Set([
873
893
  var MIRROR_SYNC_BACKOFF_MS = [3e3, 6e3, 12e3];
874
894
  function useTicketActions(options) {
875
895
  const queryClient = _reactquery.useQueryClient.call(void 0, );
876
- const ticketActionEndpoint = _nullishCoalesce(_chunkLILQJ3UZcjs.useRequiredChatRuntime.call(void 0, ).endpoints.ticketActionUrl, () => ( TICKET_ACTION_ENDPOINT));
896
+ const ticketActionEndpoint = _nullishCoalesce(_chunk3ENGUBJPcjs.useRequiredChatRuntime.call(void 0, ).endpoints.ticketActionUrl, () => ( TICKET_ACTION_ENDPOINT));
897
+ const ticketLive = _chunkU3YLML53cjs.useOptionalTicketLive.call(void 0, );
898
+ const notifyTicketCreated = _optionalChain([ticketLive, 'optionalAccess', _52 => _52.notifyTicketCreated]);
877
899
  const { prependOptimistic, removeOptimistic, removeTicketFromCache, toast: toast2, onSupportSystemDown } = options;
878
900
  const formInFlightRef = _react.useRef.call(void 0, false);
879
901
  const [isSubmittingForm, setIsSubmittingForm] = _react.useState.call(void 0, false);
@@ -922,7 +944,7 @@ function useTicketActions(options) {
922
944
  }, []);
923
945
  const executeTicketAction = _react.useCallback.call(void 0,
924
946
  async (toolName, args) => {
925
- const res = await _chunkFFXNRJ5Scjs.embedAuthedFetch.call(void 0, ticketActionEndpoint, {
947
+ const res = await _chunkLOBR7IC6cjs.embedAuthedFetch.call(void 0, ticketActionEndpoint, {
926
948
  method: "POST",
927
949
  body: JSON.stringify({ tool_name: toolName, args })
928
950
  });
@@ -1034,7 +1056,7 @@ function useTicketActions(options) {
1034
1056
  const result = await executeTicketAction("create_ticket", {
1035
1057
  subject: input.subject.trim(),
1036
1058
  content: input.content.trim(),
1037
- ..._optionalChain([input, 'access', _50 => _50.attachments, 'optionalAccess', _51 => _51.length]) ? { attachments: input.attachments } : {}
1059
+ ..._optionalChain([input, 'access', _53 => _53.attachments, 'optionalAccess', _54 => _54.length]) ? { attachments: input.attachments } : {}
1038
1060
  });
1039
1061
  if (result.mirror_synced === false) {
1040
1062
  toast2(TOAST_COPY.open_mirror_pending);
@@ -1044,6 +1066,7 @@ function useTicketActions(options) {
1044
1066
  await queryClient.invalidateQueries({ queryKey: ["tickets"] });
1045
1067
  removeOptimistic(placeholderId);
1046
1068
  }
1069
+ _optionalChain([notifyTicketCreated, 'optionalCall', _55 => _55()]);
1047
1070
  return true;
1048
1071
  });
1049
1072
  } catch (err) {
@@ -1063,6 +1086,7 @@ function useTicketActions(options) {
1063
1086
  queryClient,
1064
1087
  toast2,
1065
1088
  watchMirrorSync,
1089
+ notifyTicketCreated,
1066
1090
  surfaceError
1067
1091
  ]
1068
1092
  );
@@ -1146,7 +1170,7 @@ function useTicketActions(options) {
1146
1170
  ticket,
1147
1171
  {
1148
1172
  status: "CLOSED",
1149
- ..._optionalChain([resolution, 'optionalAccess', _52 => _52.trim, 'call', _53 => _53()]) ? { resolution: resolution.trim() } : {}
1173
+ ..._optionalChain([resolution, 'optionalAccess', _56 => _56.trim, 'call', _57 => _57()]) ? { resolution: resolution.trim() } : {}
1150
1174
  },
1151
1175
  TOAST_COPY.close_success,
1152
1176
  "close ticket"
@@ -1219,7 +1243,7 @@ function mapTicketActionError(err) {
1219
1243
  removeRowFromCache: false
1220
1244
  };
1221
1245
  case "RATE_LIMITED": {
1222
- const retryAfterRaw = _optionalChain([err, 'access', _54 => _54.response, 'optionalAccess', _55 => _55.headers, 'access', _56 => _56.get, 'call', _57 => _57("Retry-After")]);
1246
+ const retryAfterRaw = _optionalChain([err, 'access', _58 => _58.response, 'optionalAccess', _59 => _59.headers, 'access', _60 => _60.get, 'call', _61 => _61("Retry-After")]);
1223
1247
  const retryAfterSeconds = retryAfterRaw ? parseInt(retryAfterRaw, 10) : void 0;
1224
1248
  return {
1225
1249
  code: err.code,
@@ -1306,14 +1330,14 @@ function resolveErrorCode(bodyCode, status) {
1306
1330
 
1307
1331
  // src/components/tickets/ticket-center.tsx
1308
1332
 
1309
- function TicketCenter({ toast: toast2 = _chunkFFXNRJ5Scjs.toast } = {}) {
1310
- const identity = _chunkDMXB3VE2cjs.useChatIdentity.call(void 0, );
1333
+ function TicketCenter({ toast: toast2 = _chunkLOBR7IC6cjs.toast } = {}) {
1334
+ const identity = _chunkU3YLML53cjs.useChatIdentity.call(void 0, );
1311
1335
  if (identity.isLoading) {
1312
1336
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TicketCenterSkeleton, {});
1313
1337
  }
1314
- if (identity.authTier === "anon" || !_optionalChain([identity, 'access', _58 => _58.user, 'optionalAccess', _59 => _59.email])) {
1338
+ if (identity.authTier === "anon" || !_optionalChain([identity, 'access', _62 => _62.user, 'optionalAccess', _63 => _63.email])) {
1315
1339
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1316
- _chunkJ4T5ZBWGcjs.EmptyState,
1340
+ _chunkBZRP54IOcjs.EmptyState,
1317
1341
  {
1318
1342
  type: "generic",
1319
1343
  title: "Sign in to manage tickets",
@@ -1384,10 +1408,10 @@ function TicketCenterAuthed({
1384
1408
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-3 text-h6 text-ods-text-secondary", children: [
1385
1409
  lastUpdatedAt && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
1386
1410
  "Updated ",
1387
- _chunkDMXB3VE2cjs.formatRelativeTime.call(void 0, new Date(lastUpdatedAt))
1411
+ _chunkU3YLML53cjs.formatRelativeTime.call(void 0, new Date(lastUpdatedAt))
1388
1412
  ] }),
1389
1413
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1390
- _chunkL5CI57RMcjs.Button,
1414
+ _chunkT3BF6JTQcjs.Button,
1391
1415
  {
1392
1416
  type: "button",
1393
1417
  variant: "transparent",
@@ -1400,18 +1424,18 @@ function TicketCenterAuthed({
1400
1424
  )
1401
1425
  ] })
1402
1426
  ] }),
1403
- isLoading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TicketListSkeleton, {}) : merged.length === 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDMXB3VE2cjs.Card, { className: "p-6", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1404
- _chunkJ4T5ZBWGcjs.EmptyState,
1427
+ isLoading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TicketListSkeleton, {}) : merged.length === 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU3YLML53cjs.Card, { className: "p-6", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1428
+ _chunkBZRP54IOcjs.EmptyState,
1405
1429
  {
1406
1430
  type: "generic",
1407
1431
  title: "No tickets yet",
1408
1432
  description: "Open one above to start the conversation.",
1409
1433
  showCTA: false
1410
1434
  }
1411
- ) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDMXB3VE2cjs.Card, { className: "overflow-hidden", children: merged.map((ticket) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1435
+ ) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU3YLML53cjs.Card, { className: "overflow-hidden", children: merged.map((ticket) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1412
1436
  TicketRow,
1413
1437
  {
1414
- id: _chunkDMXB3VE2cjs.devSectionAnchorId.call(void 0, "ticket", ticket.external_id),
1438
+ id: _chunkU3YLML53cjs.devSectionAnchorId.call(void 0, "ticket", ticket.external_id),
1415
1439
  ticket,
1416
1440
  expanded: expandedTicketId === ticket.id,
1417
1441
  onToggle: toggleRow,
@@ -1429,29 +1453,29 @@ function TicketCenterAuthed({
1429
1453
  }
1430
1454
  function TicketCenterSkeleton() {
1431
1455
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-6", children: [
1432
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkDMXB3VE2cjs.Card, { className: "p-6", children: [
1433
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkL5CI57RMcjs.Skeleton, { className: "h-7 w-48 mb-4" }),
1434
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkL5CI57RMcjs.Skeleton, { className: "h-10 w-full mb-3" }),
1435
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkL5CI57RMcjs.Skeleton, { className: "h-24 w-full" })
1456
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU3YLML53cjs.Card, { className: "p-6", children: [
1457
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT3BF6JTQcjs.Skeleton, { className: "h-7 w-48 mb-4" }),
1458
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT3BF6JTQcjs.Skeleton, { className: "h-10 w-full mb-3" }),
1459
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT3BF6JTQcjs.Skeleton, { className: "h-24 w-full" })
1436
1460
  ] }),
1437
1461
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TicketListSkeleton, {})
1438
1462
  ] });
1439
1463
  }
1440
1464
  function TicketListSkeleton() {
1441
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDMXB3VE2cjs.Card, { className: "overflow-hidden", children: [0, 1, 2].map((i) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "h-20 px-4 flex items-center gap-4 border-b border-ods-border last:border-b-0", children: [
1465
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkU3YLML53cjs.Card, { className: "overflow-hidden", children: [0, 1, 2].map((i) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "h-20 px-4 flex items-center gap-4 border-b border-ods-border last:border-b-0", children: [
1442
1466
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex-1 flex flex-col gap-2", children: [
1443
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkL5CI57RMcjs.Skeleton, { className: "h-4 w-2/3" }),
1444
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkL5CI57RMcjs.Skeleton, { className: "h-3 w-full" })
1467
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT3BF6JTQcjs.Skeleton, { className: "h-4 w-2/3" }),
1468
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT3BF6JTQcjs.Skeleton, { className: "h-3 w-full" })
1445
1469
  ] }),
1446
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkL5CI57RMcjs.Skeleton, { className: "h-8 w-20" }),
1447
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkL5CI57RMcjs.Skeleton, { className: "h-8 w-16" })
1470
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT3BF6JTQcjs.Skeleton, { className: "h-8 w-20" }),
1471
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT3BF6JTQcjs.Skeleton, { className: "h-8 w-16" })
1448
1472
  ] }, i)) });
1449
1473
  }
1450
1474
 
1451
1475
  // src/components/tickets/help-center-list.tsx
1452
1476
 
1453
1477
 
1454
- _chunkJ4T5ZBWGcjs.init_unified_pagination.call(void 0, );
1478
+ _chunkBZRP54IOcjs.init_unified_pagination.call(void 0, );
1455
1479
 
1456
1480
  // src/components/tickets/help-center-card.tsx
1457
1481
 
@@ -1473,7 +1497,7 @@ function HelpCenterCard({
1473
1497
  const optimistic = isOptimistic(ticket);
1474
1498
  const rawStatus = (_nullishCoalesce(ticket.status, () => ( "OPEN"))).toUpperCase();
1475
1499
  const priority = (_nullishCoalesce(ticket.priority, () => ( ""))).toUpperCase();
1476
- const relativeUpdated = ticket.hubspot_updated_at ? _chunkDMXB3VE2cjs.formatRelativeTime.call(void 0, ticket.hubspot_updated_at) : "recently";
1500
+ const relativeUpdated = ticket.hubspot_updated_at ? _chunkU3YLML53cjs.formatRelativeTime.call(void 0, ticket.hubspot_updated_at) : "recently";
1477
1501
  const title = (ticket.subject || "").trim() || "(untitled)";
1478
1502
  const subtitle = `UPDATED ${relativeUpdated}, #${ticket.external_id || "\u2014"}${ticket.pipeline_stage_label ? `, ${ticket.pipeline_stage_label}` : ""}`;
1479
1503
  const description = _nullishCoalesce(_nullishCoalesce(ticket.preview, () => ( ticket.body)), () => ( ""));
@@ -1486,24 +1510,35 @@ function HelpCenterCard({
1486
1510
  _react.useEffect.call(void 0, () => {
1487
1511
  if (!isExpanded) return;
1488
1512
  const raf = requestAnimationFrame(() => {
1489
- _chunkFFXNRJ5Scjs.scrollElementIntoView.call(void 0, rowRef.current, {
1490
- headerOffset: _chunkFFXNRJ5Scjs.STICKY_HEADER_OFFSET_PX
1513
+ _chunkLOBR7IC6cjs.scrollElementIntoView.call(void 0, rowRef.current, {
1514
+ headerOffset: _chunkLOBR7IC6cjs.STICKY_HEADER_OFFSET_PX
1491
1515
  });
1492
1516
  });
1493
1517
  return () => cancelAnimationFrame(raf);
1494
1518
  }, [isExpanded]);
1519
+ const live = _chunkU3YLML53cjs.useOptionalTicketLive.call(void 0, );
1520
+ const unreadCount = !optimistic && ticket.external_id && _optionalChain([live, 'optionalAccess', _64 => _64.unreadByTicket, 'access', _65 => _65[ticket.external_id]]) || 0;
1495
1521
  const rightBadges = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1522
+ unreadCount > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1523
+ _chunkU3YLML53cjs.StatusBadge,
1524
+ {
1525
+ text: `${unreadCount} NEW`,
1526
+ colorScheme: "warning",
1527
+ variant: "card",
1528
+ className: "border border-ods-border"
1529
+ }
1530
+ ),
1496
1531
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1497
- _chunkDMXB3VE2cjs.StatusBadge,
1532
+ _chunkU3YLML53cjs.StatusBadge,
1498
1533
  {
1499
1534
  text: rawStatus,
1500
- colorScheme: _chunkDMXB3VE2cjs.getStatusColorScheme.call(void 0, rawStatus),
1535
+ colorScheme: _chunkU3YLML53cjs.getStatusColorScheme.call(void 0, rawStatus),
1501
1536
  variant: "card",
1502
1537
  className: "border border-ods-border"
1503
1538
  }
1504
1539
  ),
1505
1540
  priority && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1506
- _chunkDMXB3VE2cjs.StatusBadge,
1541
+ _chunkU3YLML53cjs.StatusBadge,
1507
1542
  {
1508
1543
  text: priority,
1509
1544
  colorScheme: mapPriorityScheme(priority),
@@ -1517,7 +1552,7 @@ function HelpCenterCard({
1517
1552
  {
1518
1553
  ref: rowRef,
1519
1554
  id,
1520
- style: { scrollMarginTop: _chunkFFXNRJ5Scjs.STICKY_HEADER_OFFSET_PX },
1555
+ style: { scrollMarginTop: _chunkLOBR7IC6cjs.STICKY_HEADER_OFFSET_PX },
1521
1556
  className: `border-b border-ods-border last:border-b-0 ${optimistic ? "opacity-60" : ""}`,
1522
1557
  "aria-busy": optimistic || void 0,
1523
1558
  children: [
@@ -1531,7 +1566,7 @@ function HelpCenterCard({
1531
1566
  "aria-controls": isExpanded ? `help-center-drawer-${ticket.id}` : void 0,
1532
1567
  className: "w-full text-left p-[12px] md:p-[16px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ods-accent focus-visible:ring-inset disabled:cursor-default",
1533
1568
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1534
- _chunkJ4T5ZBWGcjs.DevCardRowContent,
1569
+ _chunkBZRP54IOcjs.DevCardRowContent,
1535
1570
  {
1536
1571
  title,
1537
1572
  subtitle,
@@ -1606,12 +1641,12 @@ function HelpCenterCreateForm({
1606
1641
  const [subject, setSubject] = _react.useState.call(void 0, "");
1607
1642
  const [subjectError, setSubjectError] = _react.useState.call(void 0, null);
1608
1643
  const subjectField = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
1609
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkDMXB3VE2cjs.Label, { htmlFor: "help-center-subject", children: [
1644
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkU3YLML53cjs.Label, { htmlFor: "help-center-subject", children: [
1610
1645
  "Subject",
1611
1646
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-ods-accent", children: "*" })
1612
1647
  ] }),
1613
1648
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1614
- _chunkL5CI57RMcjs.Input,
1649
+ _chunkT3BF6JTQcjs.Input,
1615
1650
  {
1616
1651
  id: "help-center-subject",
1617
1652
  type: "text",
@@ -1638,7 +1673,7 @@ function HelpCenterCreateForm({
1638
1673
  )
1639
1674
  ] });
1640
1675
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1641
- _chunk5RIHLXEPcjs.ContactForm,
1676
+ _chunkDDVQ5NKKcjs.ContactForm,
1642
1677
  {
1643
1678
  title: "Open a new ticket",
1644
1679
  footerText: "The support team typically responds within one business day.",
@@ -1675,8 +1710,8 @@ function HelpCenterCreateForm({
1675
1710
 
1676
1711
  // src/components/tickets/help-center-list.tsx
1677
1712
 
1678
- function HelpCenterList({ toast: toast2 = _chunkFFXNRJ5Scjs.toast, backButton, title, shell } = {}) {
1679
- const identity = _chunkDMXB3VE2cjs.useChatIdentity.call(void 0, );
1713
+ function HelpCenterList({ toast: toast2 = _chunkLOBR7IC6cjs.toast, backButton, title, shell } = {}) {
1714
+ const identity = _chunkU3YLML53cjs.useChatIdentity.call(void 0, );
1680
1715
  const searchParams = _chunkSSJNN5BScjs.useSearchParams.call(void 0, );
1681
1716
  const router = _chunkSSJNN5BScjs.useRouter.call(void 0, );
1682
1717
  const pathname = _chunkSSJNN5BScjs.usePathname.call(void 0, );
@@ -1687,20 +1722,20 @@ function HelpCenterList({ toast: toast2 = _chunkFFXNRJ5Scjs.toast, backButton, t
1687
1722
  const page = Number.isFinite(rawPage) && rawPage > 0 ? Math.floor(rawPage) : 1;
1688
1723
  if (identity.isLoading) {
1689
1724
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1690
- _chunkJ4T5ZBWGcjs.DevSectionPage,
1725
+ _chunkBZRP54IOcjs.DevSectionPage,
1691
1726
  {
1692
1727
  sectionKey: "tickets",
1693
1728
  backButton,
1694
1729
  title,
1695
1730
  shell,
1696
1731
  preControls: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HelpCenterCreateFormSkeleton, {}),
1697
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJ4T5ZBWGcjs.DevCardRowSkeletonList, {})
1732
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBZRP54IOcjs.DevCardRowSkeletonList, {})
1698
1733
  }
1699
1734
  );
1700
1735
  }
1701
- if (identity.authTier === "anon" || !_optionalChain([identity, 'access', _60 => _60.user, 'optionalAccess', _61 => _61.email])) {
1702
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJ4T5ZBWGcjs.DevSectionPage, { sectionKey: "tickets", backButton, title, shell, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1703
- _chunkJ4T5ZBWGcjs.EmptyState,
1736
+ if (identity.authTier === "anon" || !_optionalChain([identity, 'access', _66 => _66.user, 'optionalAccess', _67 => _67.email])) {
1737
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBZRP54IOcjs.DevSectionPage, { sectionKey: "tickets", backButton, title, shell, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1738
+ _chunkBZRP54IOcjs.EmptyState,
1704
1739
  {
1705
1740
  type: "generic",
1706
1741
  title: "Sign in to manage tickets",
@@ -1709,7 +1744,7 @@ function HelpCenterList({ toast: toast2 = _chunkFFXNRJ5Scjs.toast, backButton, t
1709
1744
  }
1710
1745
  ) });
1711
1746
  }
1712
- const sessionName = [_optionalChain([identity, 'access', _62 => _62.user, 'optionalAccess', _63 => _63.firstName]), _optionalChain([identity, 'access', _64 => _64.user, 'optionalAccess', _65 => _65.lastName])].filter(Boolean).join(" ").trim() || _optionalChain([identity, 'access', _66 => _66.user, 'optionalAccess', _67 => _67.email, 'optionalAccess', _68 => _68.split, 'call', _69 => _69("@"), 'access', _70 => _70[0]]) || "Customer";
1747
+ const sessionName = [_optionalChain([identity, 'access', _68 => _68.user, 'optionalAccess', _69 => _69.firstName]), _optionalChain([identity, 'access', _70 => _70.user, 'optionalAccess', _71 => _71.lastName])].filter(Boolean).join(" ").trim() || _optionalChain([identity, 'access', _72 => _72.user, 'optionalAccess', _73 => _73.email, 'optionalAccess', _74 => _74.split, 'call', _75 => _75("@"), 'access', _76 => _76[0]]) || "Customer";
1713
1748
  const sessionEmail = identity.user.email;
1714
1749
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1715
1750
  HelpCenterListAuthed,
@@ -1768,14 +1803,14 @@ function HelpCenterListAuthed({
1768
1803
  customerEmail: sessionEmail,
1769
1804
  search,
1770
1805
  status,
1771
- page,
1772
- // Live status: while a drawer is open, poll so an out-of-band HubSpot
1773
- // status change (e.g. agent closes the ticket) flips the badge +
1774
- // open/reopen affordance within one interval. Idle (no drawer) → no poll.
1775
- // `ticketParam` (the open ticket's external_id) is the open signal.
1776
- refetchInterval: ticketParam ? TICKET_LIVE_POLL_MS : false
1806
+ page
1807
+ // No interval polling (deleted 2026-08): `TicketLiveProvider`
1808
+ // invalidates `['tickets']` on stream events; focus/mount refetch
1809
+ // covers hosts without a stream. Disclosed trade-off: a bare
1810
+ // status/pipeline change with no accompanying reply has no live
1811
+ // path until the next event/focus/reconnect.
1777
1812
  });
1778
- const expandedTicketId = ticketParam && _optionalChain([tickets, 'access', _71 => _71.find, 'call', _72 => _72((t) => t.external_id === ticketParam), 'optionalAccess', _73 => _73.id]) || null;
1813
+ const expandedTicketId = ticketParam && _optionalChain([tickets, 'access', _77 => _77.find, 'call', _78 => _78((t) => t.external_id === ticketParam), 'optionalAccess', _79 => _79.id]) || null;
1779
1814
  const prependOptimistic = _react.useCallback.call(void 0, (placeholder) => {
1780
1815
  setOptimisticTickets((prev) => [placeholder, ...prev]);
1781
1816
  }, []);
@@ -1806,13 +1841,13 @@ function HelpCenterListAuthed({
1806
1841
  const toggleRow = _react.useCallback.call(void 0,
1807
1842
  (id) => {
1808
1843
  const t = tickets.find((x) => x.id === id);
1809
- if (!_optionalChain([t, 'optionalAccess', _74 => _74.external_id])) return;
1844
+ if (!_optionalChain([t, 'optionalAccess', _80 => _80.external_id])) return;
1810
1845
  setOpenTicket(t.external_id === ticketParam ? null : t.external_id);
1811
1846
  },
1812
1847
  [tickets, ticketParam, setOpenTicket]
1813
1848
  );
1814
1849
  const merged = [...optimisticTickets, ...tickets];
1815
- _chunkFFXNRJ5Scjs.useScrollToHash.call(void 0, tickets, { headerOffset: _chunkFFXNRJ5Scjs.STICKY_HEADER_OFFSET_PX });
1850
+ _chunkLOBR7IC6cjs.useScrollToHash.call(void 0, tickets, { headerOffset: _chunkLOBR7IC6cjs.STICKY_HEADER_OFFSET_PX });
1816
1851
  const hasActiveFilters = search !== "" || status !== "" && status !== "all";
1817
1852
  const hasResults = merged.length > 0;
1818
1853
  const form = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -1830,17 +1865,17 @@ function HelpCenterListAuthed({
1830
1865
  "Couldn\u2019t load your tickets. ",
1831
1866
  error.message
1832
1867
  ] }),
1833
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkL5CI57RMcjs.Button, { type: "button", variant: "accent", onClick: () => refetch(), children: "Retry" })
1868
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT3BF6JTQcjs.Button, { type: "button", variant: "accent", onClick: () => refetch(), children: "Retry" })
1834
1869
  ] }),
1835
- !error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-full", children: isLoading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJ4T5ZBWGcjs.DevCardRowSkeletonList, {}) : !hasResults && isFetching ? (
1870
+ !error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-full", children: isLoading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBZRP54IOcjs.DevCardRowSkeletonList, {}) : !hasResults && isFetching ? (
1836
1871
  // Bridge state — background refetch in flight and the
1837
1872
  // optimistic placeholder was just removed by the mutation
1838
1873
  // callback. Without this branch "No tickets yet" would flash
1839
1874
  // for ~50ms between `removeOptimistic` and the server
1840
1875
  // response landing.
1841
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJ4T5ZBWGcjs.DevCardRowSkeletonList, { rows: 1 })
1876
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBZRP54IOcjs.DevCardRowSkeletonList, { rows: 1 })
1842
1877
  ) : !hasResults ? hasActiveFilters ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1843
- _chunkJ4T5ZBWGcjs.EmptyState,
1878
+ _chunkBZRP54IOcjs.EmptyState,
1844
1879
  {
1845
1880
  type: "search",
1846
1881
  title: "No tickets found",
@@ -1855,7 +1890,7 @@ function HelpCenterListAuthed({
1855
1890
  }
1856
1891
  }
1857
1892
  ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1858
- _chunkJ4T5ZBWGcjs.EmptyState,
1893
+ _chunkBZRP54IOcjs.EmptyState,
1859
1894
  {
1860
1895
  type: "generic",
1861
1896
  title: "No tickets yet",
@@ -1874,7 +1909,7 @@ function HelpCenterListAuthed({
1874
1909
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-ods-card border border-ods-border rounded-[6px] overflow-clip w-full", children: merged.map((ticket) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1875
1910
  HelpCenterCard,
1876
1911
  {
1877
- id: _chunkDMXB3VE2cjs.devSectionAnchorId.call(void 0, "ticket", ticket.external_id),
1912
+ id: _chunkU3YLML53cjs.devSectionAnchorId.call(void 0, "ticket", ticket.external_id),
1878
1913
  ticket,
1879
1914
  expanded: expandedTicketId === ticket.id,
1880
1915
  onToggle: toggleRow,
@@ -1890,9 +1925,9 @@ function HelpCenterListAuthed({
1890
1925
  ticket.id
1891
1926
  )) })
1892
1927
  ) }),
1893
- !error && totalPages > 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJ4T5ZBWGcjs.UnifiedPagination, { currentPage: page, totalPages })
1928
+ !error && totalPages > 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBZRP54IOcjs.UnifiedPagination, { currentPage: page, totalPages })
1894
1929
  ] });
1895
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJ4T5ZBWGcjs.DevSectionPage, { sectionKey: "tickets", backButton, title, shell, preControls: form, children: body });
1930
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBZRP54IOcjs.DevSectionPage, { sectionKey: "tickets", backButton, title, shell, preControls: form, children: body });
1896
1931
  }
1897
1932
 
1898
1933
 
@@ -1913,4 +1948,4 @@ function HelpCenterListAuthed({
1913
1948
 
1914
1949
 
1915
1950
  exports.isOptimistic = isOptimistic; exports.TOAST_COPY = TOAST_COPY; exports.TicketOpenForm = TicketOpenForm; exports.useTicketEngagements = useTicketEngagements; exports.TicketLinkedDeliveryCard = TicketLinkedDeliveryCard; exports.TicketReplyComposer = TicketReplyComposer; exports.TicketDetailDrawer = TicketDetailDrawer; exports.TicketRow = TicketRow; exports.useTicketsList = useTicketsList; exports.useTicketActions = useTicketActions; exports.mapTicketActionError = mapTicketActionError; exports.TicketCenter = TicketCenter; exports.HelpCenterCard = HelpCenterCard; exports.HelpCenterCreateFormSkeleton = HelpCenterCreateFormSkeleton; exports.HelpCenterCreateForm = HelpCenterCreateForm; exports.HelpCenterList = HelpCenterList;
1916
- //# sourceMappingURL=chunk-3T4SMJM5.cjs.map
1951
+ //# sourceMappingURL=chunk-VDKNUC3N.cjs.map