@flamingo-stack/openframe-frontend-core 0.0.534 → 0.0.535-1762.4618.1

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 (95) hide show
  1. package/dist/{chunk-67MWXMNT.cjs → chunk-2AMYXNQ2.cjs} +26 -26
  2. package/dist/{chunk-67MWXMNT.cjs.map → chunk-2AMYXNQ2.cjs.map} +1 -1
  3. package/dist/{chunk-BUVD2OAI.js → chunk-5OPVJBHQ.js} +4 -4
  4. package/dist/{chunk-BSE2UT6L.js → chunk-6OZWDOP5.js} +2 -2
  5. package/dist/{chunk-KZ6PWFHK.js → chunk-7TQDW3PE.js} +2 -2
  6. package/dist/{chunk-H4W4LENJ.js → chunk-A5EA3YO7.js} +5 -5
  7. package/dist/{chunk-JELZAWSM.cjs → chunk-CMIHA6TT.cjs} +3 -3
  8. package/dist/{chunk-JELZAWSM.cjs.map → chunk-CMIHA6TT.cjs.map} +1 -1
  9. package/dist/{chunk-ZKQXE2P4.cjs → chunk-DK6IYFLD.cjs} +9 -9
  10. package/dist/{chunk-ZKQXE2P4.cjs.map → chunk-DK6IYFLD.cjs.map} +1 -1
  11. package/dist/{chunk-ONIYUMTO.js → chunk-DRJC7TTW.js} +2 -2
  12. package/dist/{chunk-MLILEBJU.cjs → chunk-ENOER2QA.cjs} +61 -61
  13. package/dist/{chunk-MLILEBJU.cjs.map → chunk-ENOER2QA.cjs.map} +1 -1
  14. package/dist/{chunk-O6VJZX2N.js → chunk-GBWS62LR.js} +51 -34
  15. package/dist/chunk-GBWS62LR.js.map +1 -0
  16. package/dist/{chunk-NCUKKJRG.cjs → chunk-GF5A23J3.cjs} +87 -87
  17. package/dist/{chunk-NCUKKJRG.cjs.map → chunk-GF5A23J3.cjs.map} +1 -1
  18. package/dist/{chunk-2YJ2CVRC.cjs → chunk-GRGFMXNO.cjs} +31 -31
  19. package/dist/{chunk-2YJ2CVRC.cjs.map → chunk-GRGFMXNO.cjs.map} +1 -1
  20. package/dist/{chunk-MTCU5MQN.js → chunk-GS4R5UQ7.js} +2 -2
  21. package/dist/{chunk-POFCTXNH.js → chunk-HNZDQ4SH.js} +2 -2
  22. package/dist/{chunk-YW2ZU7LC.cjs → chunk-HSRHPF32.cjs} +7 -7
  23. package/dist/{chunk-YW2ZU7LC.cjs.map → chunk-HSRHPF32.cjs.map} +1 -1
  24. package/dist/{chunk-UWB33C6R.cjs → chunk-JW4BTXVH.cjs} +14 -14
  25. package/dist/{chunk-UWB33C6R.cjs.map → chunk-JW4BTXVH.cjs.map} +1 -1
  26. package/dist/{chunk-VYOGAQLM.js → chunk-JWJQHURJ.js} +2 -2
  27. package/dist/{chunk-W4MXOBEW.js → chunk-JWWZFEFI.js} +2 -2
  28. package/dist/{chunk-LBZEPB4Y.cjs → chunk-JZMQQBUC.cjs} +11 -11
  29. package/dist/{chunk-LBZEPB4Y.cjs.map → chunk-JZMQQBUC.cjs.map} +1 -1
  30. package/dist/{chunk-2ALT6CTY.js → chunk-QHOVACZK.js} +2 -2
  31. package/dist/{chunk-LYRGM25P.cjs → chunk-T4GNFVT3.cjs} +51 -34
  32. package/dist/chunk-T4GNFVT3.cjs.map +1 -0
  33. package/dist/{chunk-M5ODB6RQ.cjs → chunk-T743Z3KN.cjs} +37 -37
  34. package/dist/{chunk-M5ODB6RQ.cjs.map → chunk-T743Z3KN.cjs.map} +1 -1
  35. package/dist/{chunk-EBSZWSC5.cjs → chunk-TOWXHZF5.cjs} +4 -4
  36. package/dist/{chunk-EBSZWSC5.cjs.map → chunk-TOWXHZF5.cjs.map} +1 -1
  37. package/dist/{chunk-ZLLXYE2G.js → chunk-URBYMQ4Z.js} +4 -4
  38. package/dist/{chunk-UMDGRL6A.cjs → chunk-WL3PP4D6.cjs} +26 -26
  39. package/dist/{chunk-UMDGRL6A.cjs.map → chunk-WL3PP4D6.cjs.map} +1 -1
  40. package/dist/{chunk-WBYRBTAS.js → chunk-WXRQYGE5.js} +2 -2
  41. package/dist/{chunk-D62VYSTL.js → chunk-XPKCOZQE.js} +6 -6
  42. package/dist/{chunk-RHKH4YUY.cjs → chunk-ZUVBTDLG.cjs} +5 -5
  43. package/dist/{chunk-RHKH4YUY.cjs.map → chunk-ZUVBTDLG.cjs.map} +1 -1
  44. package/dist/components/case-studies/index.cjs +8 -8
  45. package/dist/components/case-studies/index.js +2 -2
  46. package/dist/components/chat/chat-input.d.ts.map +1 -1
  47. package/dist/components/chat/index.cjs +2 -2
  48. package/dist/components/chat/index.js +1 -1
  49. package/dist/components/contact/index.cjs +3 -3
  50. package/dist/components/contact/index.js +2 -2
  51. package/dist/components/docs/index.cjs +5 -5
  52. package/dist/components/docs/index.js +4 -4
  53. package/dist/components/embeds/index.cjs +3 -3
  54. package/dist/components/embeds/index.js +2 -2
  55. package/dist/components/faq/index.cjs +3 -3
  56. package/dist/components/faq/index.js +2 -2
  57. package/dist/components/features/index.cjs +2 -2
  58. package/dist/components/features/index.js +1 -1
  59. package/dist/components/help-center-pages/index.cjs +22 -22
  60. package/dist/components/help-center-pages/index.js +13 -13
  61. package/dist/components/index.cjs +132 -132
  62. package/dist/components/index.js +11 -11
  63. package/dist/components/meeting-scheduler/index.cjs +34 -34
  64. package/dist/components/meeting-scheduler/index.js +3 -3
  65. package/dist/components/navigation/index.cjs +2 -2
  66. package/dist/components/navigation/index.js +1 -1
  67. package/dist/components/onboarding-guides/index.cjs +5 -5
  68. package/dist/components/onboarding-guides/index.js +4 -4
  69. package/dist/components/related-content/index.cjs +3 -3
  70. package/dist/components/related-content/index.js +2 -2
  71. package/dist/components/tickets/index.cjs +6 -6
  72. package/dist/components/tickets/index.js +5 -5
  73. package/dist/components/ui/file-upload.d.ts.map +1 -1
  74. package/dist/components/ui/index.cjs +2 -2
  75. package/dist/components/ui/index.js +1 -1
  76. package/dist/index.cjs +2 -2
  77. package/dist/index.js +1 -1
  78. package/package.json +1 -1
  79. package/src/components/chat/chat-input.tsx +84 -32
  80. package/src/components/ui/file-upload.tsx +5 -1
  81. package/dist/chunk-LYRGM25P.cjs.map +0 -1
  82. package/dist/chunk-O6VJZX2N.js.map +0 -1
  83. /package/dist/{chunk-BUVD2OAI.js.map → chunk-5OPVJBHQ.js.map} +0 -0
  84. /package/dist/{chunk-BSE2UT6L.js.map → chunk-6OZWDOP5.js.map} +0 -0
  85. /package/dist/{chunk-KZ6PWFHK.js.map → chunk-7TQDW3PE.js.map} +0 -0
  86. /package/dist/{chunk-H4W4LENJ.js.map → chunk-A5EA3YO7.js.map} +0 -0
  87. /package/dist/{chunk-ONIYUMTO.js.map → chunk-DRJC7TTW.js.map} +0 -0
  88. /package/dist/{chunk-MTCU5MQN.js.map → chunk-GS4R5UQ7.js.map} +0 -0
  89. /package/dist/{chunk-POFCTXNH.js.map → chunk-HNZDQ4SH.js.map} +0 -0
  90. /package/dist/{chunk-VYOGAQLM.js.map → chunk-JWJQHURJ.js.map} +0 -0
  91. /package/dist/{chunk-W4MXOBEW.js.map → chunk-JWWZFEFI.js.map} +0 -0
  92. /package/dist/{chunk-2ALT6CTY.js.map → chunk-QHOVACZK.js.map} +0 -0
  93. /package/dist/{chunk-ZLLXYE2G.js.map → chunk-URBYMQ4Z.js.map} +0 -0
  94. /package/dist/{chunk-WBYRBTAS.js.map → chunk-WXRQYGE5.js.map} +0 -0
  95. /package/dist/{chunk-D62VYSTL.js.map → chunk-XPKCOZQE.js.map} +0 -0
@@ -12,7 +12,7 @@
12
12
 
13
13
 
14
14
 
15
- var _chunkLYRGM25Pcjs = require('./chunk-LYRGM25P.cjs');
15
+ var _chunkT4GNFVT3cjs = require('./chunk-T4GNFVT3.cjs');
16
16
 
17
17
 
18
18
 
@@ -111,7 +111,7 @@ function ContactForm({
111
111
  successRedirectUrl = "/blog#community",
112
112
  successToastMessage = "Redirecting you to join our community..."
113
113
  } = {}) {
114
- const attachments = _chunkLYRGM25Pcjs.useChatAttachments.call(void 0, );
114
+ const attachments = _chunkT4GNFVT3cjs.useChatAttachments.call(void 0, );
115
115
  const builtInSubmission = _chunkSXLEPNY2cjs.useContactSubmission.call(void 0, {
116
116
  userId,
117
117
  successRedirectUrl,
@@ -173,7 +173,7 @@ function ContactForm({
173
173
  className: `h-full flex flex-col ${!noBorder ? "border border-ods-border rounded-2xl md:rounded-3xl" : ""} ${!noPadding ? "p-6 md:p-8 lg:p-10" : ""}`,
174
174
  children: [
175
175
  (title || subtitle) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mb-6 md:mb-8", children: [
176
- title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: `${_chunkLYRGM25Pcjs.SECTION_HEADING_CLASS} mb-3 md:mb-4`, children: title }),
176
+ title && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: `${_chunkT4GNFVT3cjs.SECTION_HEADING_CLASS} mb-3 md:mb-4`, children: title }),
177
177
  subtitle && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-h4 text-ods-text-primary", children: subtitle })
178
178
  ] }),
179
179
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
@@ -193,11 +193,11 @@ function ContactForm({
193
193
  !showEmail && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "input", { type: "hidden", ...register("email") }),
194
194
  !showHelpCategory && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "input", { type: "hidden", ...register("helpCategory") }),
195
195
  !showMessage && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "input", { type: "hidden", ...register("message") }),
196
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLYRGM25Pcjs.HoneypotField, { ...honeypotInputProps }),
196
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT4GNFVT3cjs.HoneypotField, { ...honeypotInputProps }),
197
197
  extraTopField,
198
198
  showNameEmailRow && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-6", children: [
199
199
  showName && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
200
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLYRGM25Pcjs.Label, { htmlFor: "name", children: [
200
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkT4GNFVT3cjs.Label, { htmlFor: "name", children: [
201
201
  "Your Name",
202
202
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-ods-accent", children: "*" })
203
203
  ] }),
@@ -216,7 +216,7 @@ function ContactForm({
216
216
  errors.name && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { id: "name-error", className: "text-ods-error text-h6 mt-1", children: errors.name.message })
217
217
  ] }),
218
218
  showEmail && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
219
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLYRGM25Pcjs.Label, { htmlFor: "email", children: [
219
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkT4GNFVT3cjs.Label, { htmlFor: "email", children: [
220
220
  "Email",
221
221
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-ods-accent", children: "*" })
222
222
  ] }),
@@ -237,46 +237,46 @@ function ContactForm({
237
237
  ] }),
238
238
  (showCompanySize || showReferralSource) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-6", children: [
239
239
  showCompanySize && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
240
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLYRGM25Pcjs.Label, { htmlFor: "companySize", children: "Company Size" }),
240
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT4GNFVT3cjs.Label, { htmlFor: "companySize", children: "Company Size" }),
241
241
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
242
242
  _reacthookform.Controller,
243
243
  {
244
244
  control,
245
245
  name: "companySize",
246
- render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLYRGM25Pcjs.Select, { onValueChange: field.onChange, defaultValue: field.value, children: [
246
+ render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkT4GNFVT3cjs.Select, { onValueChange: field.onChange, defaultValue: field.value, children: [
247
247
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
248
- _chunkLYRGM25Pcjs.SelectTrigger,
248
+ _chunkT4GNFVT3cjs.SelectTrigger,
249
249
  {
250
250
  id: "companySize",
251
251
  "aria-label": "Company Size",
252
252
  className: "bg-ods-card border-ods-border text-ods-text-primary h-12 px-3",
253
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLYRGM25Pcjs.SelectValue, { placeholder: "Select company size" })
253
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT4GNFVT3cjs.SelectValue, { placeholder: "Select company size" })
254
254
  }
255
255
  ),
256
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLYRGM25Pcjs.SelectContent, { children: companySizeOptions.map((opt) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLYRGM25Pcjs.SelectItem, { value: opt, children: opt }, opt)) })
256
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT4GNFVT3cjs.SelectContent, { children: companySizeOptions.map((opt) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT4GNFVT3cjs.SelectItem, { value: opt, children: opt }, opt)) })
257
257
  ] })
258
258
  }
259
259
  ),
260
260
  errors.companySize && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { id: "companySize-error", className: "text-ods-error text-h6 mt-1", children: errors.companySize.message })
261
261
  ] }),
262
262
  showReferralSource && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
263
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLYRGM25Pcjs.Label, { htmlFor: "referralSource", children: "How did you hear about us?" }),
263
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT4GNFVT3cjs.Label, { htmlFor: "referralSource", children: "How did you hear about us?" }),
264
264
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
265
265
  _reacthookform.Controller,
266
266
  {
267
267
  control,
268
268
  name: "referralSource",
269
- render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLYRGM25Pcjs.Select, { onValueChange: field.onChange, defaultValue: field.value, children: [
269
+ render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkT4GNFVT3cjs.Select, { onValueChange: field.onChange, defaultValue: field.value, children: [
270
270
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
271
- _chunkLYRGM25Pcjs.SelectTrigger,
271
+ _chunkT4GNFVT3cjs.SelectTrigger,
272
272
  {
273
273
  id: "referralSource",
274
274
  "aria-label": "Referral Source",
275
275
  className: "bg-ods-card border-ods-border text-ods-text-primary h-12 px-3",
276
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLYRGM25Pcjs.SelectValue, { placeholder: "Select an option" })
276
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT4GNFVT3cjs.SelectValue, { placeholder: "Select an option" })
277
277
  }
278
278
  ),
279
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLYRGM25Pcjs.SelectContent, { children: referralSourceOptions.map((opt) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLYRGM25Pcjs.SelectItem, { value: opt, children: opt }, opt)) })
279
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT4GNFVT3cjs.SelectContent, { children: referralSourceOptions.map((opt) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT4GNFVT3cjs.SelectItem, { value: opt, children: opt }, opt)) })
280
280
  ] })
281
281
  }
282
282
  ),
@@ -284,7 +284,7 @@ function ContactForm({
284
284
  ] })
285
285
  ] }),
286
286
  showHelpCategory && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
287
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLYRGM25Pcjs.Label, { htmlFor: "helpCategory", children: [
287
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkT4GNFVT3cjs.Label, { htmlFor: "helpCategory", children: [
288
288
  "Choose your main interest",
289
289
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-ods-accent", children: "*" })
290
290
  ] }),
@@ -293,29 +293,29 @@ function ContactForm({
293
293
  {
294
294
  control,
295
295
  name: "helpCategory",
296
- render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLYRGM25Pcjs.Select, { onValueChange: field.onChange, defaultValue: field.value, children: [
296
+ render: ({ field }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkT4GNFVT3cjs.Select, { onValueChange: field.onChange, defaultValue: field.value, children: [
297
297
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
298
- _chunkLYRGM25Pcjs.SelectTrigger,
298
+ _chunkT4GNFVT3cjs.SelectTrigger,
299
299
  {
300
300
  id: "helpCategory",
301
301
  "aria-label": "Help Category",
302
302
  className: "bg-ods-card border-ods-border text-ods-text-primary h-12 px-3",
303
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLYRGM25Pcjs.SelectValue, { placeholder: "Choose your main interest" })
303
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT4GNFVT3cjs.SelectValue, { placeholder: "Choose your main interest" })
304
304
  }
305
305
  ),
306
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLYRGM25Pcjs.SelectContent, { children: helpCategoryOptions.map((opt) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLYRGM25Pcjs.SelectItem, { value: opt, children: opt }, opt)) })
306
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT4GNFVT3cjs.SelectContent, { children: helpCategoryOptions.map((opt) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT4GNFVT3cjs.SelectItem, { value: opt, children: opt }, opt)) })
307
307
  ] })
308
308
  }
309
309
  ),
310
310
  errors.helpCategory && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { id: "helpCategory-error", className: "text-ods-error text-h6 mt-1", children: errors.helpCategory.message })
311
311
  ] }),
312
312
  showMessage && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col flex-grow", children: [
313
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkLYRGM25Pcjs.Label, { htmlFor: "message", children: [
313
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkT4GNFVT3cjs.Label, { htmlFor: "message", children: [
314
314
  "Your Message",
315
315
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-ods-accent", children: "*" })
316
316
  ] }),
317
317
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
318
- _chunkLYRGM25Pcjs.Textarea,
318
+ _chunkT4GNFVT3cjs.Textarea,
319
319
  {
320
320
  id: "message",
321
321
  ...register("message"),
@@ -329,7 +329,7 @@ function ContactForm({
329
329
  ] }),
330
330
  attachmentsEnabled && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-2", children: [
331
331
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
332
- _chunkLYRGM25Pcjs.ChatAttachmentChipStrip,
332
+ _chunkT4GNFVT3cjs.ChatAttachmentChipStrip,
333
333
  {
334
334
  attachments: attachments.attachments,
335
335
  onRemove: attachments.removeAttachment,
@@ -338,7 +338,7 @@ function ContactForm({
338
338
  ),
339
339
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
340
340
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
341
- _chunkLYRGM25Pcjs.ChatAttachmentAddButton,
341
+ _chunkT4GNFVT3cjs.ChatAttachmentAddButton,
342
342
  {
343
343
  attachmentsEnabled: true,
344
344
  attachmentsCount: attachments.attachments.length,
@@ -374,4 +374,4 @@ function ContactForm({
374
374
 
375
375
 
376
376
  exports.ContactForm = ContactForm;
377
- //# sourceMappingURL=chunk-67MWXMNT.cjs.map
377
+ //# sourceMappingURL=chunk-2AMYXNQ2.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-67MWXMNT.cjs","../src/components/contact/contact-form.tsx","../src/schemas/contact-schema.ts"],"names":[],"mappings":"AAAA,6rBAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACHA,8BAAyC;AACzC,gDAAoC;AACpC,8CAA4B;ADK5B;AACA;AE/BA,2BAAkB;AAKX,IAAM,mBAAA,EAAqB;AAAA,EAChC,MAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA;AAEO,IAAM,sBAAA,EAAwB;AAAA,EACnC,QAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EACA,oBAAA;AAAA,EACA;AACF,CAAA;AAKO,IAAM,2BAAA,EAA6B;AAAA,EACxC,0BAAA;AAAA,EACA,uBAAA;AAAA,EACA,oBAAA;AAAA,EACA,cAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAA;AAWO,IAAM,kBAAA,EAAoB,OAAA,CAC9B,MAAA,CAAO,CAAA,CACP,GAAA,CAAI,EAAE,OAAA,EAAS,oCAAoC,CAAC,CAAA,CACpD,MAAA;AAAA,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AAA;AAAC,kBAAA;AAAA,kBAAA;AACM,oBAAA;AACI,oBAAA;AAI4B,oBAAA;AAE5B,oBAAA;AACqC,oBAAA;AAEZ,oBAAA;AAAA,kBAAA;AACpC,gBAAA;AACF,cAAA;AAAA,YAAA;AAAA,UAAA;AACF,QAAA;AAAA,MAAA;AAAA,IAAA;AACF,EAAA;AAEJ;AD1J0J;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-67MWXMNT.cjs","sourcesContent":[null,"'use client'\n\n/**\n * `<ContactForm />` — the canonical contact form used by every public\n * surface (TMCG join, case-study pitch, generic /contact, Help Center\n * ticket creation, etc.).\n *\n * Self-contained inside the lib — host-specific values (user id for\n * tracking, platform-specific contact reasons, reddit-click attribution\n * id) flow IN via props. The hub passes them via a thin\n * `<ContactForm>` wrapper that resolves them from `useAuth` /\n * `getAppConfig` / `getStoredRedditClickId`. Other embedders pass\n * whatever they have (or omit).\n *\n * Field-hide + custom-submit + extra-top-field knobs let one form\n * serve both contact and ticket-creation flows without forking:\n * - Contact page: rendered with all fields visible, built-in submit\n * flow to `/api/contact` via `useContactSubmission`.\n * - Ticket page: hides name/email/companySize/referralSource/\n * helpCategory; supplies `extraTopField` (a Subject input) +\n * `onCustomSubmit` wired to `useTicketActions.submitTicket`.\n */\n\nimport { useState, type ReactNode } from 'react'\nimport { useForm, Controller } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n ContactSchema,\n type ContactFormData,\n companySizeOptions,\n referralSourceOptions,\n defaultHelpCategoryOptions,\n} from '../../schemas/contact-schema'\nimport { SECTION_HEADING_CLASS } from '../layout/page-heading'\nimport {\n Button,\n type ButtonProps,\n Input,\n Textarea,\n Select,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectItem,\n Label,\n} from '../ui'\nimport { useContactSubmission } from '../../hooks/use-contact-submission'\nimport { useHumanitySignals } from '../../hooks/use-humanity-signals'\nimport { HoneypotField } from '../ui/honeypot-field'\nimport {\n ChatAttachmentAddButton,\n ChatAttachmentChipStrip,\n} from '../chat/chat-attachment-bar'\nimport { useChatAttachments } from '../chat/hooks/use-chat-attachments'\nimport type { ChatAttachment } from '../chat/utils/chat-attachment-markdown'\n\n/**\n * Fields the caller can suppress. Six values — every primary form\n * field plus `name` and `email` (newly hideable so ticket-creation\n * surfaces can hide them; they still need to validate, so the caller\n * MUST supply pre-filled values via `defaultValues` when hiding them).\n */\nexport type ContactFormHideableField =\n | 'name'\n | 'email'\n | 'companySize'\n | 'referralSource'\n | 'helpCategory'\n | 'message'\n\nexport interface ContactFormProps {\n /** Host-side user id passed to `useContactSubmission` for attribution.\n * Hub wrapper passes `useAuth().user?.id`; lib's Help Center surface\n * passes `useChatIdentity().user?.id`. Omit for anon flows. */\n userId?: string\n /** Platform-specific help-category dropdown options. Hub wrapper\n * passes `getAppConfig().contact.contactReasons`. Defaults to the\n * lib's `defaultHelpCategoryOptions`. */\n helpCategoryOptions?: readonly string[]\n /** Reddit click attribution id. Caller resolves from wherever they\n * stash it (hub: sessionStorage via `getStoredRedditClickId`). When\n * set, it's spread into the submission payload. */\n rdtCid?: string\n /** Called after a successful submit so the caller can clear their\n * attribution storage (hub wrapper calls `clearStoredRedditClickId`).\n * Fires for BOTH the built-in and custom submit paths. */\n onSubmitSuccess?: () => void\n\n prefilledReason?: string\n prefilledMessage?: string\n hideFields?: ContactFormHideableField[]\n /** Authoritative pre-fill for any field the caller hides. Merged\n * into react-hook-form's `defaultValues` AFTER the legacy\n * `prefilledReason` / `prefilledMessage` props (caller-supplied\n * wins). REQUIRED when hiding `name` / `email` / `helpCategory` —\n * those fields are still validated by Zod even when not rendered. */\n defaultValues?: Partial<ContactFormData>\n /** Optional custom submit handler. When provided, the form bypasses\n * the built-in `useContactSubmission` flow (no /api/contact call,\n * no success-redirect, no built-in toast) — the caller owns the\n * entire side-effect chain. Reset + `onSubmitSuccess` still fire\n * on a successful await.\n *\n * Receives the schema-validated form payload PLUS the ready\n * attachments array (empty when `attachmentsEnabled === false` or\n * the user hasn't picked any). Caller forwards `attachments` to\n * whichever sink owns the upload (e.g. `actions.submitTicket`'s\n * `attachments` field for HubSpot Note engagements). */\n onCustomSubmit?: (data: ContactFormData, attachments: ChatAttachment[]) => Promise<void>\n /** Turn on the attachments bar (file `+` button + chip strip) using\n * the same lib primitives the chat composer uses\n * (`<ChatAttachmentAddButton>` + `<ChatAttachmentChipStrip>` +\n * `useChatAttachments`). When `false` (the default), the form\n * doesn't render the bar AND the attachments array passed to\n * `onCustomSubmit` is always empty. */\n attachmentsEnabled?: boolean\n /** Render slot for an EXTRA field at the very top of the form,\n * ABOVE the name/email row. Use this for ticket surfaces that need\n * a Subject input — the field is NOT part of `ContactSchema`, so\n * the caller manages its own state + validation and reads the\n * value back inside `onCustomSubmit`. */\n extraTopField?: ReactNode\n\n title?: string\n subtitle?: string\n footerText?: string\n noBorder?: boolean\n noPadding?: boolean\n buttonVariant?: ButtonProps['variant']\n buttonClassName?: string\n /** Submit-button label. Defaults to \"Send Message\". Override for\n * ticket surfaces (e.g. \"Open ticket\"). */\n submitLabel?: string\n /** Success-state submit-button label (shown briefly after submit on\n * the built-in flow). Defaults to \"Message Sent!\". Has no effect\n * when `onCustomSubmit` is provided — the caller owns success UX. */\n submitSuccessLabel?: string\n successRedirectUrl?: string\n successToastMessage?: string\n}\n\nexport function ContactForm({\n userId,\n helpCategoryOptions = defaultHelpCategoryOptions,\n rdtCid,\n onSubmitSuccess,\n prefilledReason,\n prefilledMessage,\n hideFields = [],\n defaultValues: defaultValuesProp,\n onCustomSubmit,\n extraTopField,\n attachmentsEnabled = false,\n title = 'Hit Us Up',\n subtitle,\n footerText = 'We typically respond within 24 hours. We respect your privacy – no spam, ever.',\n noBorder = false,\n noPadding = false,\n buttonVariant = 'accent',\n buttonClassName = '',\n submitLabel = 'Send Message',\n submitSuccessLabel = 'Message Sent!',\n successRedirectUrl = '/blog#community',\n successToastMessage = 'Redirecting you to join our community...',\n}: ContactFormProps = {}) {\n // Attachments staging — same hook the chat composer + ticket\n // detail-drawer composer use. Files upload to Supabase as soon as\n // the user picks them; `readyAttachments` is the wire-shape array\n // ready for the next submit. `hasInflightUploads` disables Send\n // until every upload settles.\n const attachments = useChatAttachments()\n // Built-in contact-API flow. Hook is called unconditionally (rules\n // of hooks); we just don't dispatch its `submit` when the caller\n // passes `onCustomSubmit`. The hook owns its own toast + redirect\n // chain so bypassing it cleanly hands all side-effects to the caller.\n const builtInSubmission = useContactSubmission({\n userId,\n successRedirectUrl,\n successToastMessage,\n })\n // Independent in-flight tracker for the custom path — we can't reuse\n // `builtInSubmission.isSubmitting` because that hook never sees a\n // request when `onCustomSubmit` is active.\n const [customSubmitting, setCustomSubmitting] = useState(false)\n\n // Invisible bot-protection signals (honeypot + timing). Spread into the\n // submit payload for BOTH the built-in and custom paths; reset on success.\n const { honeypotInputProps, getSignals, resetSignals } = useHumanitySignals()\n\n const isSubmitting = onCustomSubmit ? customSubmitting : builtInSubmission.isSubmitting\n // `isSuccess` only ever fires on the built-in path; custom callers\n // own their own UX (no \"Message Sent!\" button-label flicker).\n const isSuccess = onCustomSubmit ? false : builtInSubmission.isSuccess\n\n const {\n register,\n handleSubmit,\n control,\n formState: { errors },\n reset,\n } = useForm<ContactFormData>({\n resolver: zodResolver(ContactSchema),\n defaultValues: {\n ...(prefilledReason && { helpCategory: prefilledReason }),\n ...(prefilledMessage && { message: prefilledMessage }),\n // Caller-supplied defaults win over the legacy `prefilled*` props\n // (they're the authoritative seed for hidden fields).\n ...defaultValuesProp,\n },\n })\n\n const handleFormSubmit = async (data: ContactFormData) => {\n if (isSubmitting) return\n if (attachmentsEnabled && attachments.hasInflightUploads) return\n try {\n const payload = { ...data, ...(rdtCid && { rdt_cid: rdtCid }), ...getSignals() }\n const readyAttachments = attachmentsEnabled ? attachments.readyAttachments : []\n if (onCustomSubmit) {\n setCustomSubmitting(true)\n try {\n await onCustomSubmit(payload, readyAttachments)\n } finally {\n setCustomSubmitting(false)\n }\n } else {\n await builtInSubmission.submit(payload)\n }\n onSubmitSuccess?.()\n reset()\n resetSignals()\n if (attachmentsEnabled) attachments.clear()\n } catch {\n // Error toast is owned by the active flow:\n // - built-in: `useContactSubmission` toasts inside `submit()`.\n // - custom: the caller toasts inside `onCustomSubmit`.\n // Either way we swallow here so a thrown error doesn't crash the\n // form tree (react-hook-form's onSubmit handler rejects upward).\n }\n }\n\n const showName = !hideFields.includes('name')\n const showEmail = !hideFields.includes('email')\n const showNameEmailRow = showName || showEmail\n const showCompanySize = !hideFields.includes('companySize')\n const showReferralSource = !hideFields.includes('referralSource')\n const showHelpCategory = !hideFields.includes('helpCategory')\n const showMessage = !hideFields.includes('message')\n\n return (\n <div\n className={`h-full flex flex-col ${!noBorder ? 'border border-ods-border rounded-2xl md:rounded-3xl' : ''} ${!noPadding ? 'p-6 md:p-8 lg:p-10' : ''}`}\n >\n {(title || subtitle) && (\n <div className=\"mb-6 md:mb-8\">\n {title && (\n <h2 className={`${SECTION_HEADING_CLASS} mb-3 md:mb-4`}>\n {title}\n </h2>\n )}\n {subtitle && (\n <p className=\"text-h4 text-ods-text-primary\">\n {subtitle}\n </p>\n )}\n </div>\n )}\n\n <form\n onSubmit={handleSubmit(handleFormSubmit, (validationErrors) => {\n // When validation fails on a HIDDEN field (e.g. ticket form\n // hides name/email/helpCategory and seeds them via\n // `defaultValues`), there's no visible error UI for the user\n // — the submit button just appears dead. Log so the broken\n // defaultValues wiring is at least discoverable in DevTools.\n // eslint-disable-next-line no-console\n console.warn(\n '[ContactForm] submit blocked by validation:',\n Object.fromEntries(\n Object.entries(validationErrors).map(([k, v]) => [k, v?.message ?? v]),\n ),\n )\n })}\n className=\"flex flex-col flex-grow space-y-4 md:space-y-6\"\n >\n {/* Hidden inputs for fields that are required by `ContactSchema`\n but suppressed from the visible UI via `hideFields`. Without\n these, `register('name')` never runs, react-hook-form skips\n the field at submit time, and Zod's required-string check\n fails silently — the user clicks Submit and NOTHING visible\n happens (no error, no network call). The caller-supplied\n `defaultValues` seed the values; the hidden inputs just tell\n RHF to include them in the submit payload. */}\n {!showName && <input type=\"hidden\" {...register('name')} />}\n {!showEmail && <input type=\"hidden\" {...register('email')} />}\n {!showHelpCategory && <input type=\"hidden\" {...register('helpCategory')} />}\n {!showMessage && <input type=\"hidden\" {...register('message')} />}\n\n {/* Invisible honeypot — real users never fill it; bots that fill every field trip it. */}\n <HoneypotField {...honeypotInputProps} />\n\n {/* Extra top field (e.g. Subject for ticket forms). Rendered\n outside the schema-driven layout so the caller fully owns\n label / placeholder / state. */}\n {extraTopField}\n\n {showNameEmailRow && (\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-6\">\n {showName && (\n <div className=\"flex flex-col\">\n <Label htmlFor=\"name\">\n Your Name<span className=\"text-ods-accent\">*</span>\n </Label>\n <Input\n id=\"name\"\n type=\"text\"\n {...register('name')}\n placeholder=\"Jane Doe\"\n aria-invalid={!!errors.name}\n aria-describedby=\"name-error\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary placeholder-ods-text-secondary px-3 h-12\"\n />\n {errors.name && (\n <span id=\"name-error\" className=\"text-ods-error text-h6 mt-1\">\n {errors.name.message}\n </span>\n )}\n </div>\n )}\n {showEmail && (\n <div className=\"flex flex-col\">\n <Label htmlFor=\"email\">\n Email<span className=\"text-ods-accent\">*</span>\n </Label>\n <Input\n id=\"email\"\n type=\"email\"\n {...register('email')}\n placeholder=\"jane@company.com\"\n aria-invalid={!!errors.email}\n aria-describedby=\"email-error\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary placeholder-ods-text-secondary px-3 h-12\"\n />\n {errors.email && (\n <span id=\"email-error\" className=\"text-ods-error text-h6 mt-1\">\n {errors.email.message}\n </span>\n )}\n </div>\n )}\n </div>\n )}\n\n {(showCompanySize || showReferralSource) && (\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-6\">\n {showCompanySize && (\n <div className=\"flex flex-col\">\n <Label htmlFor=\"companySize\">Company Size</Label>\n <Controller\n control={control}\n name=\"companySize\"\n render={({ field }) => (\n <Select onValueChange={field.onChange} defaultValue={field.value}>\n <SelectTrigger\n id=\"companySize\"\n aria-label=\"Company Size\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary h-12 px-3\"\n >\n <SelectValue placeholder=\"Select company size\" />\n </SelectTrigger>\n <SelectContent>\n {companySizeOptions.map((opt) => (\n <SelectItem key={opt} value={opt}>\n {opt}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n />\n {errors.companySize && (\n <span id=\"companySize-error\" className=\"text-ods-error text-h6 mt-1\">\n {errors.companySize.message}\n </span>\n )}\n </div>\n )}\n {showReferralSource && (\n <div className=\"flex flex-col\">\n <Label htmlFor=\"referralSource\">How did you hear about us?</Label>\n <Controller\n control={control}\n name=\"referralSource\"\n render={({ field }) => (\n <Select onValueChange={field.onChange} defaultValue={field.value}>\n <SelectTrigger\n id=\"referralSource\"\n aria-label=\"Referral Source\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary h-12 px-3\"\n >\n <SelectValue placeholder=\"Select an option\" />\n </SelectTrigger>\n <SelectContent>\n {referralSourceOptions.map((opt) => (\n <SelectItem key={opt} value={opt}>\n {opt}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n />\n {errors.referralSource && (\n <span id=\"referralSource-error\" className=\"text-ods-error text-h6 mt-1\">\n {errors.referralSource.message}\n </span>\n )}\n </div>\n )}\n </div>\n )}\n\n {showHelpCategory && (\n <div className=\"flex flex-col\">\n <Label htmlFor=\"helpCategory\">\n Choose your main interest<span className=\"text-ods-accent\">*</span>\n </Label>\n <Controller\n control={control}\n name=\"helpCategory\"\n render={({ field }) => (\n <Select onValueChange={field.onChange} defaultValue={field.value}>\n <SelectTrigger\n id=\"helpCategory\"\n aria-label=\"Help Category\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary h-12 px-3\"\n >\n <SelectValue placeholder=\"Choose your main interest\" />\n </SelectTrigger>\n <SelectContent>\n {helpCategoryOptions.map((opt) => (\n <SelectItem key={opt} value={opt}>\n {opt}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n />\n {errors.helpCategory && (\n <span id=\"helpCategory-error\" className=\"text-ods-error text-h6 mt-1\">\n {errors.helpCategory.message}\n </span>\n )}\n </div>\n )}\n\n {showMessage && (\n <div className=\"flex flex-col flex-grow\">\n <Label htmlFor=\"message\">\n Your Message<span className=\"text-ods-accent\">*</span>\n </Label>\n <Textarea\n id=\"message\"\n {...register('message')}\n placeholder=\"Share your current challenges or questions about open-source alternatives...\"\n aria-invalid={!!errors.message}\n aria-describedby=\"message-error\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary placeholder-ods-text-secondary h-full flex-grow\"\n />\n {errors.message && (\n <span id=\"message-error\" className=\"text-ods-error text-h6 mt-1\">\n {errors.message.message}\n </span>\n )}\n </div>\n )}\n\n {/* Attachments — only renders when `attachmentsEnabled` is on.\n Uses the SAME chip strip + add button + staging hook the\n chat composer and ticket-drawer composer use, so the visual\n chip styling + upload-progress UX are identical everywhere\n attachments appear. */}\n {attachmentsEnabled && (\n <div className=\"flex flex-col gap-2\">\n <ChatAttachmentChipStrip\n attachments={attachments.attachments}\n onRemove={attachments.removeAttachment}\n disabled={isSubmitting}\n />\n <div className=\"flex items-center gap-2\">\n <ChatAttachmentAddButton\n attachmentsEnabled\n attachmentsCount={attachments.attachments.length}\n onAddFiles={attachments.addFiles}\n disabled={isSubmitting}\n />\n <span className=\"text-h6 text-ods-text-secondary\">\n Attach files (optional)\n </span>\n </div>\n </div>\n )}\n\n <div className=\"flex flex-col md:flex-row gap-4 md:gap-6 items-center justify-end w-full pt-2 mt-auto\">\n {footerText && (\n <p className=\"text-h6 text-ods-text-secondary text-center md:text-left\">\n {footerText}\n </p>\n )}\n <Button\n type=\"submit\"\n loading={isSubmitting}\n disabled={\n isSubmitting ||\n isSuccess ||\n (attachmentsEnabled && attachments.hasInflightUploads)\n }\n variant={buttonVariant}\n className={`w-full md:w-auto ${buttonClassName}`}\n >\n {isSuccess ? submitSuccessLabel : submitLabel}\n </Button>\n </div>\n </form>\n </div>\n )\n}\n","import { z } from 'zod';\n\n// Dropdown option constants — re-exported by `<ContactForm>` consumers\n// that want to surface their own custom Select widgets keyed on the\n// same allowed-value set.\nexport const companySizeOptions = [\n '1-10',\n '11-50',\n '51-200',\n '201-500',\n '501-1000',\n '1001+',\n] as const;\n\nexport const referralSourceOptions = [\n 'Google',\n 'LinkedIn',\n 'Twitter/X',\n 'Reddit',\n 'Friend / Colleague',\n 'Other',\n] as const;\n\n// Default fallback options — used when the embedder doesn't supply\n// platform-specific help-category options via the `helpCategoryOptions`\n// prop on `<ContactForm>`.\nexport const defaultHelpCategoryOptions = [\n 'Open-Source Alternatives',\n 'Vendor Cost Reduction',\n 'MSP Best Practices',\n 'Partnerships',\n 'Press',\n 'Other',\n] as const;\n\n// Reusable LinkedIn URL validator — the single source of truth. Every\n// public form schema, every admin update schema, every HubSpot push\n// validator MUST reference this so validation rules cannot drift\n// across boundaries.\n//\n// Host validation parses the URL and checks the hostname suffix so an\n// adversarial input like `https://evil.com/linkedin.com/x` is rejected\n// (substring match would have accepted it — CodeQL alert\n// \"Incomplete URL substring sanitization\").\nexport const LinkedInUrlSchema = z\n .string()\n .url({ message: 'Please enter a valid LinkedIn URL' })\n .refine(\n (url) => {\n try {\n const host = new URL(url).hostname.toLowerCase()\n return host === 'linkedin.com' || host.endsWith('.linkedin.com')\n } catch {\n return false\n }\n },\n {\n message: 'Please enter a valid LinkedIn profile URL',\n },\n )\n .optional()\n .or(z.literal(''));\n\n/**\n * Base schema — fields shared by every contact-style form (main contact\n * form, TMCG join, data-room request, case-study pitch, etc.). Any\n * field that exists on a form but NOT on this schema is silently\n * stripped by `safeParse` — that's exactly the bug the LinkedIn field\n * hit historically.\n */\nexport const ContactBaseSchema = z.object({\n name: z\n .string()\n .min(2, { message: 'Name must be at least 2 characters' })\n .max(255, { message: 'Name is too long' }),\n email: z\n .string()\n .email({ message: 'Please enter a valid email address' })\n .max(255),\n linkedin_url: LinkedInUrlSchema,\n helpCategory: z\n .string()\n .min(1, { message: 'Please select what we can help you with' })\n .max(255, { message: 'Help category is too long' }),\n message: z\n .string()\n .min(10, { message: 'Message must be at least 10 characters' })\n .max(5000, { message: 'Message is too long (5,000 character limit)' }),\n rdt_cid: z.string().optional(),\n});\n\n// Public POST /api/contact validator — base + dropdown fields used by\n// the generic contact form. Other form-specific schemas extend\n// `ContactBaseSchema`.\nexport const ContactSchema = ContactBaseSchema.extend({\n companySize: z\n .string()\n .optional()\n .refine((val) => !val || companySizeOptions.includes(val as (typeof companySizeOptions)[number]), {\n message: 'Please select a valid company size',\n }),\n referralSource: z\n .string()\n .optional()\n .refine((val) => !val || referralSourceOptions.includes(val as (typeof referralSourceOptions)[number]), {\n message: 'Please select a valid referral source',\n }),\n});\n\nexport type ContactFormData = z.infer<typeof ContactSchema>;\n\nexport interface ContactApiResponse {\n success: boolean;\n error?: string;\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-2AMYXNQ2.cjs","../src/components/contact/contact-form.tsx","../src/schemas/contact-schema.ts"],"names":[],"mappings":"AAAA,6rBAAY;AACZ;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACHA,8BAAyC;AACzC,gDAAoC;AACpC,8CAA4B;ADK5B;AACA;AE/BA,2BAAkB;AAKX,IAAM,mBAAA,EAAqB;AAAA,EAChC,MAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA;AAEO,IAAM,sBAAA,EAAwB;AAAA,EACnC,QAAA;AAAA,EACA,UAAA;AAAA,EACA,W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tB,cAAA;AAUE,cAAA;AAAA,gCAAA;AAAC,kBAAA;AAAA,kBAAA;AAC0B,oBAAA;AACH,oBAAA;AACZ,oBAAA;AAAA,kBAAA;AACZ,gBAAA;AAEE,gCAAA;AAAA,kCAAA;AAAC,oBAAA;AAAA,oBAAA;AACmB,sBAAA;AACwB,sBAAA;AAClB,sBAAA;AACd,sBAAA;AAAA,oBAAA;AACZ,kBAAA;AAGA,kCAAA;AACF,gBAAA;AACF,cAAA;AAIC,8BAAA;AAGC,gBAAA;AAEF,gCAAA;AAAC,kBAAA;AAAA,kBAAA;AACM,oBAAA;AACI,oBAAA;AAI4B,oBAAA;AAE5B,oBAAA;AACqC,oBAAA;AAEZ,oBAAA;AAAA,kBAAA;AACpC,gBAAA;AACF,cAAA;AAAA,YAAA;AAAA,UAAA;AACF,QAAA;AAAA,MAAA;AAAA,IAAA;AACF,EAAA;AAEJ;AD1J0J;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-2AMYXNQ2.cjs","sourcesContent":[null,"'use client'\n\n/**\n * `<ContactForm />` — the canonical contact form used by every public\n * surface (TMCG join, case-study pitch, generic /contact, Help Center\n * ticket creation, etc.).\n *\n * Self-contained inside the lib — host-specific values (user id for\n * tracking, platform-specific contact reasons, reddit-click attribution\n * id) flow IN via props. The hub passes them via a thin\n * `<ContactForm>` wrapper that resolves them from `useAuth` /\n * `getAppConfig` / `getStoredRedditClickId`. Other embedders pass\n * whatever they have (or omit).\n *\n * Field-hide + custom-submit + extra-top-field knobs let one form\n * serve both contact and ticket-creation flows without forking:\n * - Contact page: rendered with all fields visible, built-in submit\n * flow to `/api/contact` via `useContactSubmission`.\n * - Ticket page: hides name/email/companySize/referralSource/\n * helpCategory; supplies `extraTopField` (a Subject input) +\n * `onCustomSubmit` wired to `useTicketActions.submitTicket`.\n */\n\nimport { useState, type ReactNode } from 'react'\nimport { useForm, Controller } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n ContactSchema,\n type ContactFormData,\n companySizeOptions,\n referralSourceOptions,\n defaultHelpCategoryOptions,\n} from '../../schemas/contact-schema'\nimport { SECTION_HEADING_CLASS } from '../layout/page-heading'\nimport {\n Button,\n type ButtonProps,\n Input,\n Textarea,\n Select,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectItem,\n Label,\n} from '../ui'\nimport { useContactSubmission } from '../../hooks/use-contact-submission'\nimport { useHumanitySignals } from '../../hooks/use-humanity-signals'\nimport { HoneypotField } from '../ui/honeypot-field'\nimport {\n ChatAttachmentAddButton,\n ChatAttachmentChipStrip,\n} from '../chat/chat-attachment-bar'\nimport { useChatAttachments } from '../chat/hooks/use-chat-attachments'\nimport type { ChatAttachment } from '../chat/utils/chat-attachment-markdown'\n\n/**\n * Fields the caller can suppress. Six values — every primary form\n * field plus `name` and `email` (newly hideable so ticket-creation\n * surfaces can hide them; they still need to validate, so the caller\n * MUST supply pre-filled values via `defaultValues` when hiding them).\n */\nexport type ContactFormHideableField =\n | 'name'\n | 'email'\n | 'companySize'\n | 'referralSource'\n | 'helpCategory'\n | 'message'\n\nexport interface ContactFormProps {\n /** Host-side user id passed to `useContactSubmission` for attribution.\n * Hub wrapper passes `useAuth().user?.id`; lib's Help Center surface\n * passes `useChatIdentity().user?.id`. Omit for anon flows. */\n userId?: string\n /** Platform-specific help-category dropdown options. Hub wrapper\n * passes `getAppConfig().contact.contactReasons`. Defaults to the\n * lib's `defaultHelpCategoryOptions`. */\n helpCategoryOptions?: readonly string[]\n /** Reddit click attribution id. Caller resolves from wherever they\n * stash it (hub: sessionStorage via `getStoredRedditClickId`). When\n * set, it's spread into the submission payload. */\n rdtCid?: string\n /** Called after a successful submit so the caller can clear their\n * attribution storage (hub wrapper calls `clearStoredRedditClickId`).\n * Fires for BOTH the built-in and custom submit paths. */\n onSubmitSuccess?: () => void\n\n prefilledReason?: string\n prefilledMessage?: string\n hideFields?: ContactFormHideableField[]\n /** Authoritative pre-fill for any field the caller hides. Merged\n * into react-hook-form's `defaultValues` AFTER the legacy\n * `prefilledReason` / `prefilledMessage` props (caller-supplied\n * wins). REQUIRED when hiding `name` / `email` / `helpCategory` —\n * those fields are still validated by Zod even when not rendered. */\n defaultValues?: Partial<ContactFormData>\n /** Optional custom submit handler. When provided, the form bypasses\n * the built-in `useContactSubmission` flow (no /api/contact call,\n * no success-redirect, no built-in toast) — the caller owns the\n * entire side-effect chain. Reset + `onSubmitSuccess` still fire\n * on a successful await.\n *\n * Receives the schema-validated form payload PLUS the ready\n * attachments array (empty when `attachmentsEnabled === false` or\n * the user hasn't picked any). Caller forwards `attachments` to\n * whichever sink owns the upload (e.g. `actions.submitTicket`'s\n * `attachments` field for HubSpot Note engagements). */\n onCustomSubmit?: (data: ContactFormData, attachments: ChatAttachment[]) => Promise<void>\n /** Turn on the attachments bar (file `+` button + chip strip) using\n * the same lib primitives the chat composer uses\n * (`<ChatAttachmentAddButton>` + `<ChatAttachmentChipStrip>` +\n * `useChatAttachments`). When `false` (the default), the form\n * doesn't render the bar AND the attachments array passed to\n * `onCustomSubmit` is always empty. */\n attachmentsEnabled?: boolean\n /** Render slot for an EXTRA field at the very top of the form,\n * ABOVE the name/email row. Use this for ticket surfaces that need\n * a Subject input — the field is NOT part of `ContactSchema`, so\n * the caller manages its own state + validation and reads the\n * value back inside `onCustomSubmit`. */\n extraTopField?: ReactNode\n\n title?: string\n subtitle?: string\n footerText?: string\n noBorder?: boolean\n noPadding?: boolean\n buttonVariant?: ButtonProps['variant']\n buttonClassName?: string\n /** Submit-button label. Defaults to \"Send Message\". Override for\n * ticket surfaces (e.g. \"Open ticket\"). */\n submitLabel?: string\n /** Success-state submit-button label (shown briefly after submit on\n * the built-in flow). Defaults to \"Message Sent!\". Has no effect\n * when `onCustomSubmit` is provided — the caller owns success UX. */\n submitSuccessLabel?: string\n successRedirectUrl?: string\n successToastMessage?: string\n}\n\nexport function ContactForm({\n userId,\n helpCategoryOptions = defaultHelpCategoryOptions,\n rdtCid,\n onSubmitSuccess,\n prefilledReason,\n prefilledMessage,\n hideFields = [],\n defaultValues: defaultValuesProp,\n onCustomSubmit,\n extraTopField,\n attachmentsEnabled = false,\n title = 'Hit Us Up',\n subtitle,\n footerText = 'We typically respond within 24 hours. We respect your privacy – no spam, ever.',\n noBorder = false,\n noPadding = false,\n buttonVariant = 'accent',\n buttonClassName = '',\n submitLabel = 'Send Message',\n submitSuccessLabel = 'Message Sent!',\n successRedirectUrl = '/blog#community',\n successToastMessage = 'Redirecting you to join our community...',\n}: ContactFormProps = {}) {\n // Attachments staging — same hook the chat composer + ticket\n // detail-drawer composer use. Files upload to Supabase as soon as\n // the user picks them; `readyAttachments` is the wire-shape array\n // ready for the next submit. `hasInflightUploads` disables Send\n // until every upload settles.\n const attachments = useChatAttachments()\n // Built-in contact-API flow. Hook is called unconditionally (rules\n // of hooks); we just don't dispatch its `submit` when the caller\n // passes `onCustomSubmit`. The hook owns its own toast + redirect\n // chain so bypassing it cleanly hands all side-effects to the caller.\n const builtInSubmission = useContactSubmission({\n userId,\n successRedirectUrl,\n successToastMessage,\n })\n // Independent in-flight tracker for the custom path — we can't reuse\n // `builtInSubmission.isSubmitting` because that hook never sees a\n // request when `onCustomSubmit` is active.\n const [customSubmitting, setCustomSubmitting] = useState(false)\n\n // Invisible bot-protection signals (honeypot + timing). Spread into the\n // submit payload for BOTH the built-in and custom paths; reset on success.\n const { honeypotInputProps, getSignals, resetSignals } = useHumanitySignals()\n\n const isSubmitting = onCustomSubmit ? customSubmitting : builtInSubmission.isSubmitting\n // `isSuccess` only ever fires on the built-in path; custom callers\n // own their own UX (no \"Message Sent!\" button-label flicker).\n const isSuccess = onCustomSubmit ? false : builtInSubmission.isSuccess\n\n const {\n register,\n handleSubmit,\n control,\n formState: { errors },\n reset,\n } = useForm<ContactFormData>({\n resolver: zodResolver(ContactSchema),\n defaultValues: {\n ...(prefilledReason && { helpCategory: prefilledReason }),\n ...(prefilledMessage && { message: prefilledMessage }),\n // Caller-supplied defaults win over the legacy `prefilled*` props\n // (they're the authoritative seed for hidden fields).\n ...defaultValuesProp,\n },\n })\n\n const handleFormSubmit = async (data: ContactFormData) => {\n if (isSubmitting) return\n if (attachmentsEnabled && attachments.hasInflightUploads) return\n try {\n const payload = { ...data, ...(rdtCid && { rdt_cid: rdtCid }), ...getSignals() }\n const readyAttachments = attachmentsEnabled ? attachments.readyAttachments : []\n if (onCustomSubmit) {\n setCustomSubmitting(true)\n try {\n await onCustomSubmit(payload, readyAttachments)\n } finally {\n setCustomSubmitting(false)\n }\n } else {\n await builtInSubmission.submit(payload)\n }\n onSubmitSuccess?.()\n reset()\n resetSignals()\n if (attachmentsEnabled) attachments.clear()\n } catch {\n // Error toast is owned by the active flow:\n // - built-in: `useContactSubmission` toasts inside `submit()`.\n // - custom: the caller toasts inside `onCustomSubmit`.\n // Either way we swallow here so a thrown error doesn't crash the\n // form tree (react-hook-form's onSubmit handler rejects upward).\n }\n }\n\n const showName = !hideFields.includes('name')\n const showEmail = !hideFields.includes('email')\n const showNameEmailRow = showName || showEmail\n const showCompanySize = !hideFields.includes('companySize')\n const showReferralSource = !hideFields.includes('referralSource')\n const showHelpCategory = !hideFields.includes('helpCategory')\n const showMessage = !hideFields.includes('message')\n\n return (\n <div\n className={`h-full flex flex-col ${!noBorder ? 'border border-ods-border rounded-2xl md:rounded-3xl' : ''} ${!noPadding ? 'p-6 md:p-8 lg:p-10' : ''}`}\n >\n {(title || subtitle) && (\n <div className=\"mb-6 md:mb-8\">\n {title && (\n <h2 className={`${SECTION_HEADING_CLASS} mb-3 md:mb-4`}>\n {title}\n </h2>\n )}\n {subtitle && (\n <p className=\"text-h4 text-ods-text-primary\">\n {subtitle}\n </p>\n )}\n </div>\n )}\n\n <form\n onSubmit={handleSubmit(handleFormSubmit, (validationErrors) => {\n // When validation fails on a HIDDEN field (e.g. ticket form\n // hides name/email/helpCategory and seeds them via\n // `defaultValues`), there's no visible error UI for the user\n // — the submit button just appears dead. Log so the broken\n // defaultValues wiring is at least discoverable in DevTools.\n // eslint-disable-next-line no-console\n console.warn(\n '[ContactForm] submit blocked by validation:',\n Object.fromEntries(\n Object.entries(validationErrors).map(([k, v]) => [k, v?.message ?? v]),\n ),\n )\n })}\n className=\"flex flex-col flex-grow space-y-4 md:space-y-6\"\n >\n {/* Hidden inputs for fields that are required by `ContactSchema`\n but suppressed from the visible UI via `hideFields`. Without\n these, `register('name')` never runs, react-hook-form skips\n the field at submit time, and Zod's required-string check\n fails silently — the user clicks Submit and NOTHING visible\n happens (no error, no network call). The caller-supplied\n `defaultValues` seed the values; the hidden inputs just tell\n RHF to include them in the submit payload. */}\n {!showName && <input type=\"hidden\" {...register('name')} />}\n {!showEmail && <input type=\"hidden\" {...register('email')} />}\n {!showHelpCategory && <input type=\"hidden\" {...register('helpCategory')} />}\n {!showMessage && <input type=\"hidden\" {...register('message')} />}\n\n {/* Invisible honeypot — real users never fill it; bots that fill every field trip it. */}\n <HoneypotField {...honeypotInputProps} />\n\n {/* Extra top field (e.g. Subject for ticket forms). Rendered\n outside the schema-driven layout so the caller fully owns\n label / placeholder / state. */}\n {extraTopField}\n\n {showNameEmailRow && (\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-6\">\n {showName && (\n <div className=\"flex flex-col\">\n <Label htmlFor=\"name\">\n Your Name<span className=\"text-ods-accent\">*</span>\n </Label>\n <Input\n id=\"name\"\n type=\"text\"\n {...register('name')}\n placeholder=\"Jane Doe\"\n aria-invalid={!!errors.name}\n aria-describedby=\"name-error\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary placeholder-ods-text-secondary px-3 h-12\"\n />\n {errors.name && (\n <span id=\"name-error\" className=\"text-ods-error text-h6 mt-1\">\n {errors.name.message}\n </span>\n )}\n </div>\n )}\n {showEmail && (\n <div className=\"flex flex-col\">\n <Label htmlFor=\"email\">\n Email<span className=\"text-ods-accent\">*</span>\n </Label>\n <Input\n id=\"email\"\n type=\"email\"\n {...register('email')}\n placeholder=\"jane@company.com\"\n aria-invalid={!!errors.email}\n aria-describedby=\"email-error\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary placeholder-ods-text-secondary px-3 h-12\"\n />\n {errors.email && (\n <span id=\"email-error\" className=\"text-ods-error text-h6 mt-1\">\n {errors.email.message}\n </span>\n )}\n </div>\n )}\n </div>\n )}\n\n {(showCompanySize || showReferralSource) && (\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-6\">\n {showCompanySize && (\n <div className=\"flex flex-col\">\n <Label htmlFor=\"companySize\">Company Size</Label>\n <Controller\n control={control}\n name=\"companySize\"\n render={({ field }) => (\n <Select onValueChange={field.onChange} defaultValue={field.value}>\n <SelectTrigger\n id=\"companySize\"\n aria-label=\"Company Size\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary h-12 px-3\"\n >\n <SelectValue placeholder=\"Select company size\" />\n </SelectTrigger>\n <SelectContent>\n {companySizeOptions.map((opt) => (\n <SelectItem key={opt} value={opt}>\n {opt}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n />\n {errors.companySize && (\n <span id=\"companySize-error\" className=\"text-ods-error text-h6 mt-1\">\n {errors.companySize.message}\n </span>\n )}\n </div>\n )}\n {showReferralSource && (\n <div className=\"flex flex-col\">\n <Label htmlFor=\"referralSource\">How did you hear about us?</Label>\n <Controller\n control={control}\n name=\"referralSource\"\n render={({ field }) => (\n <Select onValueChange={field.onChange} defaultValue={field.value}>\n <SelectTrigger\n id=\"referralSource\"\n aria-label=\"Referral Source\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary h-12 px-3\"\n >\n <SelectValue placeholder=\"Select an option\" />\n </SelectTrigger>\n <SelectContent>\n {referralSourceOptions.map((opt) => (\n <SelectItem key={opt} value={opt}>\n {opt}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n />\n {errors.referralSource && (\n <span id=\"referralSource-error\" className=\"text-ods-error text-h6 mt-1\">\n {errors.referralSource.message}\n </span>\n )}\n </div>\n )}\n </div>\n )}\n\n {showHelpCategory && (\n <div className=\"flex flex-col\">\n <Label htmlFor=\"helpCategory\">\n Choose your main interest<span className=\"text-ods-accent\">*</span>\n </Label>\n <Controller\n control={control}\n name=\"helpCategory\"\n render={({ field }) => (\n <Select onValueChange={field.onChange} defaultValue={field.value}>\n <SelectTrigger\n id=\"helpCategory\"\n aria-label=\"Help Category\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary h-12 px-3\"\n >\n <SelectValue placeholder=\"Choose your main interest\" />\n </SelectTrigger>\n <SelectContent>\n {helpCategoryOptions.map((opt) => (\n <SelectItem key={opt} value={opt}>\n {opt}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )}\n />\n {errors.helpCategory && (\n <span id=\"helpCategory-error\" className=\"text-ods-error text-h6 mt-1\">\n {errors.helpCategory.message}\n </span>\n )}\n </div>\n )}\n\n {showMessage && (\n <div className=\"flex flex-col flex-grow\">\n <Label htmlFor=\"message\">\n Your Message<span className=\"text-ods-accent\">*</span>\n </Label>\n <Textarea\n id=\"message\"\n {...register('message')}\n placeholder=\"Share your current challenges or questions about open-source alternatives...\"\n aria-invalid={!!errors.message}\n aria-describedby=\"message-error\"\n className=\"bg-ods-card border-ods-border text-ods-text-primary placeholder-ods-text-secondary h-full flex-grow\"\n />\n {errors.message && (\n <span id=\"message-error\" className=\"text-ods-error text-h6 mt-1\">\n {errors.message.message}\n </span>\n )}\n </div>\n )}\n\n {/* Attachments — only renders when `attachmentsEnabled` is on.\n Uses the SAME chip strip + add button + staging hook the\n chat composer and ticket-drawer composer use, so the visual\n chip styling + upload-progress UX are identical everywhere\n attachments appear. */}\n {attachmentsEnabled && (\n <div className=\"flex flex-col gap-2\">\n <ChatAttachmentChipStrip\n attachments={attachments.attachments}\n onRemove={attachments.removeAttachment}\n disabled={isSubmitting}\n />\n <div className=\"flex items-center gap-2\">\n <ChatAttachmentAddButton\n attachmentsEnabled\n attachmentsCount={attachments.attachments.length}\n onAddFiles={attachments.addFiles}\n disabled={isSubmitting}\n />\n <span className=\"text-h6 text-ods-text-secondary\">\n Attach files (optional)\n </span>\n </div>\n </div>\n )}\n\n <div className=\"flex flex-col md:flex-row gap-4 md:gap-6 items-center justify-end w-full pt-2 mt-auto\">\n {footerText && (\n <p className=\"text-h6 text-ods-text-secondary text-center md:text-left\">\n {footerText}\n </p>\n )}\n <Button\n type=\"submit\"\n loading={isSubmitting}\n disabled={\n isSubmitting ||\n isSuccess ||\n (attachmentsEnabled && attachments.hasInflightUploads)\n }\n variant={buttonVariant}\n className={`w-full md:w-auto ${buttonClassName}`}\n >\n {isSuccess ? submitSuccessLabel : submitLabel}\n </Button>\n </div>\n </form>\n </div>\n )\n}\n","import { z } from 'zod';\n\n// Dropdown option constants — re-exported by `<ContactForm>` consumers\n// that want to surface their own custom Select widgets keyed on the\n// same allowed-value set.\nexport const companySizeOptions = [\n '1-10',\n '11-50',\n '51-200',\n '201-500',\n '501-1000',\n '1001+',\n] as const;\n\nexport const referralSourceOptions = [\n 'Google',\n 'LinkedIn',\n 'Twitter/X',\n 'Reddit',\n 'Friend / Colleague',\n 'Other',\n] as const;\n\n// Default fallback options — used when the embedder doesn't supply\n// platform-specific help-category options via the `helpCategoryOptions`\n// prop on `<ContactForm>`.\nexport const defaultHelpCategoryOptions = [\n 'Open-Source Alternatives',\n 'Vendor Cost Reduction',\n 'MSP Best Practices',\n 'Partnerships',\n 'Press',\n 'Other',\n] as const;\n\n// Reusable LinkedIn URL validator — the single source of truth. Every\n// public form schema, every admin update schema, every HubSpot push\n// validator MUST reference this so validation rules cannot drift\n// across boundaries.\n//\n// Host validation parses the URL and checks the hostname suffix so an\n// adversarial input like `https://evil.com/linkedin.com/x` is rejected\n// (substring match would have accepted it — CodeQL alert\n// \"Incomplete URL substring sanitization\").\nexport const LinkedInUrlSchema = z\n .string()\n .url({ message: 'Please enter a valid LinkedIn URL' })\n .refine(\n (url) => {\n try {\n const host = new URL(url).hostname.toLowerCase()\n return host === 'linkedin.com' || host.endsWith('.linkedin.com')\n } catch {\n return false\n }\n },\n {\n message: 'Please enter a valid LinkedIn profile URL',\n },\n )\n .optional()\n .or(z.literal(''));\n\n/**\n * Base schema — fields shared by every contact-style form (main contact\n * form, TMCG join, data-room request, case-study pitch, etc.). Any\n * field that exists on a form but NOT on this schema is silently\n * stripped by `safeParse` — that's exactly the bug the LinkedIn field\n * hit historically.\n */\nexport const ContactBaseSchema = z.object({\n name: z\n .string()\n .min(2, { message: 'Name must be at least 2 characters' })\n .max(255, { message: 'Name is too long' }),\n email: z\n .string()\n .email({ message: 'Please enter a valid email address' })\n .max(255),\n linkedin_url: LinkedInUrlSchema,\n helpCategory: z\n .string()\n .min(1, { message: 'Please select what we can help you with' })\n .max(255, { message: 'Help category is too long' }),\n message: z\n .string()\n .min(10, { message: 'Message must be at least 10 characters' })\n .max(5000, { message: 'Message is too long (5,000 character limit)' }),\n rdt_cid: z.string().optional(),\n});\n\n// Public POST /api/contact validator — base + dropdown fields used by\n// the generic contact form. Other form-specific schemas extend\n// `ContactBaseSchema`.\nexport const ContactSchema = ContactBaseSchema.extend({\n companySize: z\n .string()\n .optional()\n .refine((val) => !val || companySizeOptions.includes(val as (typeof companySizeOptions)[number]), {\n message: 'Please select a valid company size',\n }),\n referralSource: z\n .string()\n .optional()\n .refine((val) => !val || referralSourceOptions.includes(val as (typeof referralSourceOptions)[number]), {\n message: 'Please select a valid referral source',\n }),\n});\n\nexport type ContactFormData = z.infer<typeof ContactSchema>;\n\nexport interface ContactApiResponse {\n success: boolean;\n error?: string;\n}\n"]}
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  ArticleAuthorByline,
4
4
  DetailPageSkeleton
5
- } from "./chunk-MTCU5MQN.js";
5
+ } from "./chunk-GS4R5UQ7.js";
6
6
  import {
7
7
  DocSearchBar,
8
8
  useDocSearch
9
- } from "./chunk-ONIYUMTO.js";
9
+ } from "./chunk-DRJC7TTW.js";
10
10
  import {
11
11
  useSelfFetch
12
12
  } from "./chunk-RCBRCZUF.js";
@@ -26,7 +26,7 @@ import {
26
26
  resolveContentHref,
27
27
  toStripProfile,
28
28
  useVideoWarmup
29
- } from "./chunk-O6VJZX2N.js";
29
+ } from "./chunk-GBWS62LR.js";
30
30
  import {
31
31
  buildOgPlaceholderUrl
32
32
  } from "./chunk-GS4HJA2G.js";
@@ -396,4 +396,4 @@ export {
396
396
  useOnboardingGuide,
397
397
  useOnboardingGuideSections
398
398
  };
399
- //# sourceMappingURL=chunk-BUVD2OAI.js.map
399
+ //# sourceMappingURL=chunk-5OPVJBHQ.js.map
@@ -12,7 +12,7 @@ import {
12
12
  SelectValue,
13
13
  Textarea,
14
14
  useChatAttachments
15
- } from "./chunk-O6VJZX2N.js";
15
+ } from "./chunk-GBWS62LR.js";
16
16
  import {
17
17
  useContactSubmission,
18
18
  useHumanitySignals
@@ -374,4 +374,4 @@ function ContactForm({
374
374
  export {
375
375
  ContactForm
376
376
  };
377
- //# sourceMappingURL=chunk-BSE2UT6L.js.map
377
+ //# sourceMappingURL=chunk-6OZWDOP5.js.map
@@ -10,7 +10,7 @@ import {
10
10
  TASK_TYPE_LABELS,
11
11
  TASK_TYPE_TEXT_COLORS,
12
12
  getStatusColorScheme
13
- } from "./chunk-O6VJZX2N.js";
13
+ } from "./chunk-GBWS62LR.js";
14
14
  import {
15
15
  init_next_navigation,
16
16
  usePathname,
@@ -262,4 +262,4 @@ export {
262
262
  DevCardRowSkeletonList,
263
263
  DeliveryRow
264
264
  };
265
- //# sourceMappingURL=chunk-KZ6PWFHK.js.map
265
+ //# sourceMappingURL=chunk-7TQDW3PE.js.map
@@ -1,18 +1,18 @@
1
1
  "use client";
2
2
  import {
3
3
  ContactForm
4
- } from "./chunk-BSE2UT6L.js";
4
+ } from "./chunk-6OZWDOP5.js";
5
5
  import {
6
6
  DeliveryRow,
7
7
  DevCardRowContent,
8
8
  DevCardRowSkeletonList,
9
9
  DevSectionPage
10
- } from "./chunk-KZ6PWFHK.js";
10
+ } from "./chunk-7TQDW3PE.js";
11
11
  import {
12
12
  EmptyState,
13
13
  UnifiedPagination,
14
14
  init_unified_pagination
15
- } from "./chunk-WBYRBTAS.js";
15
+ } from "./chunk-WXRQYGE5.js";
16
16
  import {
17
17
  AlertDialog,
18
18
  AlertDialogAction,
@@ -46,7 +46,7 @@ import {
46
46
  useChatAttachments,
47
47
  useChatIdentity,
48
48
  useOptionalTicketLive
49
- } from "./chunk-O6VJZX2N.js";
49
+ } from "./chunk-GBWS62LR.js";
50
50
  import {
51
51
  STICKY_HEADER_OFFSET_PX,
52
52
  embedAuthedFetch,
@@ -1938,4 +1938,4 @@ export {
1938
1938
  HelpCenterCreateForm,
1939
1939
  HelpCenterList
1940
1940
  };
1941
- //# sourceMappingURL=chunk-H4W4LENJ.js.map
1941
+ //# sourceMappingURL=chunk-A5EA3YO7.js.map
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkEBSZWSC5cjs = require('./chunk-EBSZWSC5.cjs');
5
+ var _chunkTOWXHZF5cjs = require('./chunk-TOWXHZF5.cjs');
6
6
 
7
7
 
8
8
 
@@ -112,7 +112,7 @@ function PersistentPaginationWrapper({
112
112
  const displayCurrentPage = hasResults ? currentPage : 1;
113
113
  const isPaginationDisabled = isLoading;
114
114
  const hasNoResults = !hasResults && !isLoading;
115
- const PaginationComponent = (_chunkEBSZWSC5cjs.init_unified_pagination.call(void 0, ), _chunkVRHGVLSLcjs.__toCommonJS.call(void 0, _chunkEBSZWSC5cjs.unified_pagination_exports)).UnifiedPagination;
115
+ const PaginationComponent = (_chunkTOWXHZF5cjs.init_unified_pagination.call(void 0, ), _chunkVRHGVLSLcjs.__toCommonJS.call(void 0, _chunkTOWXHZF5cjs.unified_pagination_exports)).UnifiedPagination;
116
116
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
117
117
  "div",
118
118
  {
@@ -172,4 +172,4 @@ function PersistentPaginationWrapper({
172
172
 
173
173
 
174
174
  exports.PersistentPagination = PersistentPagination; exports.usePaginationLoading = usePaginationLoading; exports.PersistentPaginationWrapper = PersistentPaginationWrapper;
175
- //# sourceMappingURL=chunk-JELZAWSM.cjs.map
175
+ //# sourceMappingURL=chunk-CMIHA6TT.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-JELZAWSM.cjs","../src/components/persistent-pagination.tsx"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACVA,uCAAA,CAAA;AA6FQ,+CAAA;AAhCD,SAAS,oBAAA,CAAqB;AAAA,EACnC,SAAA;AAAA,EACA,QAAA;AAAA,EACA,WAAA;AAAA,EACA,UAAA;AAAA,EACA,SAAA;AAAA,EACA,gBAAA,EAAkB,GAAA;AAAA,EAClB,mBAAA,EAAqB,GAAA;AAAA,EACrB,iBAAA,EAAmB;AACrB,CAAA,EAA8B;AAI5B,EAAA,uBACE,8BAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,kCAAA;AAAA,QACT,qCAAA;AAAA,QACA,kCAAA;AAAA,QACA,UAAA,GAAa,qBAAA;AAAA,QACb;AAAA,MACF,CAAA;AAAA,MACA,KAAA,EAAO;AAAA,QACL,OAAA,EAAS,UAAA,EAAY,gBAAA,EAAkB,CAAA;AAAA,QACvC,kBAAA,EAAoB,CAAA,EAAA;AACtB,MAAA;AACK,MAAA;AACM,MAAA;AACA,MAAA;AACG,MAAA;AAGb,MAAA;AACC,QAAA;AAAC,UAAA;AAAA,UAAA;AACW,YAAA;AACL,YAAA;AACK,YAAA;AACX,YAAA;AAAA,cAAA;AACqD,cAAA;AAAY,cAAA;AAAK,cAAA;AAAA,YAAA;AAAA,UAAA;AACvE,QAAA;AAIF,wBAAA;AAAC,UAAA;AAAA,UAAA;AACY,YAAA;AACT,cAAA;AACa,cAAA;AACf,YAAA;AACO,YAAA;AACL,cAAA;AACF,YAAA;AACa,YAAA;AAEZ,YAAA;AAAA,UAAA;AACH,QAAA;AAAA,MAAA;AAAA,IAAA;AAGF,EAAA;AAEJ;AAKgB;AAKR,EAAA;AAEkB,EAAA;AACT,IAAA;AACG,IAAA;AACK,IAAA;AACD,IAAA;AACtB,EAAA;AAE0B,EAAA;AACT,IAAA;AACU,MAAA;AACzB,IAAA;AACe,IAAA;AACjB,EAAA;AAEO,EAAA;AACL,IAAA;AACA,IAAA;AACA,IAAA;AACF,EAAA;AACF;AAcgB;AACd,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACU,EAAA;AACyB;AACT,EAAA;AACxB,IAAA;AACA,IAAA;AACA,IAAA;AACF,EAAA;AAImB,EAAA;AACO,EAAA;AACC,EAAA;AAErB,EAAA;AACgB,EAAA;AAIhB,EAAA;AAGJ,EAAA;AAAC,IAAA;AAAA,IAAA;AACY,MAAA;AACT,QAAA;AACC,QAAA;AACD,QAAA;AACF,MAAA;AACO,MAAA;AACI,QAAA;AACW,QAAA;AACtB,MAAA;AACK,MAAA;AACM,MAAA;AACA,MAAA;AACG,MAAA;AACI,MAAA;AAGhB,MAAA;AAAc,QAAA;AACb,UAAA;AAAA,UAAA;AACW,YAAA;AACL,YAAA;AACK,YAAA;AAET,YAAA;AAEG,UAAA;AAEN,QAAA;AAIF,wBAAA;AAAC,UAAA;AAAA,UAAA;AACY,YAAA;AACT,cAAA;AACA,cAAA;AACF,YAAA;AACO,YAAA;AACL,cAAA;AACF,YAAA;AACa,YAAA;AAEb,YAAA;AAAC,cAAA;AAAA,cAAA;AACc,gBAAA;AACD,gBAAA;AACZ,gBAAA;AAAiD,gBAAA;AAAA,cAAA;AACnD,YAAA;AAAA,UAAA;AACF,QAAA;AAAA,MAAA;AAAA,IAAA;AAGF,EAAA;AAEJ;AD9E6B;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-JELZAWSM.cjs","sourcesContent":[null,"\"use client\"\n\nimport { ReactNode } from \"react\"\nimport { cn } from \"../utils/cn\"\n\ninterface PersistentPaginationProps {\n /**\n * Whether pagination is currently in a loading state\n */\n isLoading: boolean\n /**\n * The pagination component\n */\n children: ReactNode\n /**\n * Current page number\n */\n currentPage: number\n /**\n * Total number of pages\n */\n totalPages: number\n /**\n * Additional CSS classes\n */\n className?: string\n /**\n * Disabled opacity (0-1)\n */\n disabledOpacity?: number\n /**\n * Transition duration in milliseconds\n */\n transitionDuration?: number\n /**\n * Whether to show loading state in pagination\n */\n showLoadingState?: boolean\n}\n\n/**\n * PersistentPagination\n * \n * A wrapper component that keeps pagination visible during loading states\n * but provides visual feedback that it's temporarily disabled.\n * \n * Features:\n * - Maintains pagination visibility during content loading\n * - Disables interaction but preserves layout\n * - Shows current page context even when loading\n * - Provides accessibility support for loading states\n * - Smooth transitions between enabled/disabled states\n * \n * Usage:\n * ```tsx\n * <PersistentPagination\n * isLoading={isLoadingVendors}\n * currentPage={currentPage}\n * totalPages={totalPages}\n * >\n * <Pagination currentPage={currentPage} totalPages={totalPages} />\n * </PersistentPagination>\n * ```\n */\nexport function PersistentPagination({\n isLoading,\n children,\n currentPage,\n totalPages,\n className,\n disabledOpacity = 0.5,\n transitionDuration = 300,\n showLoadingState = true,\n}: PersistentPaginationProps) {\n // ALWAYS show pagination for predictable layout - just gray it out when not needed\n // Removed condition that hides pagination completely\n\n return (\n <div \n className={cn(\n \"relative transition-all ease-in-out\",\n \"flex justify-center items-center\",\n isLoading && \"pointer-events-none\",\n className\n )}\n style={{\n opacity: isLoading ? disabledOpacity : 1,\n transitionDuration: `${transitionDuration}ms`\n }}\n role=\"navigation\"\n aria-label=\"Pagination\"\n aria-busy={isLoading}\n data-loading={isLoading}\n >\n {/* Loading state announcement for screen readers */}\n {isLoading && (\n <div \n className=\"sr-only\" \n role=\"status\" \n aria-live=\"polite\"\n >\n Pagination temporarily disabled while loading page {currentPage} of {totalPages}\n </div>\n )}\n\n {/* Pagination controls with disabled state */}\n <div \n className={cn(\n \"relative transition-all ease-in-out\",\n isLoading && \"cursor-not-allowed\"\n )}\n style={{\n transitionDuration: `${transitionDuration}ms`\n }}\n aria-hidden={isLoading}\n >\n {children}\n </div>\n\n {/* REMOVED: Loading overlay - only card skeletons should show during loading */}\n </div>\n )\n}\n\n/**\n * Hook for managing pagination loading states\n */\nexport function usePaginationLoading(\n isLoading: boolean,\n currentPage: number,\n totalPages: number\n) {\n const shouldShowPagination = totalPages > 1 || isLoading\n \n const paginationProps = {\n 'aria-busy': isLoading,\n 'data-loading': isLoading,\n 'data-current-page': currentPage,\n 'data-total-pages': totalPages,\n }\n\n const getLoadingMessage = () => {\n if (isLoading) {\n return `Loading page ${currentPage} of ${totalPages}`\n }\n return `Page ${currentPage} of ${totalPages}`\n }\n\n return {\n shouldShowPagination,\n paginationProps,\n getLoadingMessage,\n }\n}\n\n/**\n * Enhanced pagination component that includes loading states\n */\ninterface PersistentPaginationWrapperProps {\n isLoading: boolean\n currentPage: number\n totalPages: number\n onPageChange?: (page: number) => void\n className?: string\n variant?: 'vendor' | 'blog'\n}\n\nexport function PersistentPaginationWrapper({\n isLoading,\n currentPage,\n totalPages,\n onPageChange,\n className,\n variant = 'vendor'\n}: PersistentPaginationWrapperProps) {\n const { getLoadingMessage } = usePaginationLoading(\n isLoading,\n currentPage,\n totalPages\n )\n\n // ALWAYS show pagination for predictable layout\n // For no results (totalPages = 0), show grayed out pagination\n const hasResults = totalPages > 0\n const displayTotalPages = hasResults ? totalPages : 1\n const displayCurrentPage = hasResults ? currentPage : 1\n // Only disable during loading, but still show when no results (just grayed out)\n const isPaginationDisabled = isLoading\n const hasNoResults = !hasResults && !isLoading\n\n // Use UnifiedPagination directly from ui-kit instead of importing from consuming apps\n // Both Pagination and BlogPagination in multi-platform-hub are just wrappers around UnifiedPagination\n const PaginationComponent = require('./unified-pagination').UnifiedPagination\n\n return (\n <div \n className={cn(\n \"relative transition-all ease-in-out flex justify-center items-center\",\n (isPaginationDisabled || hasNoResults) && \"pointer-events-none\",\n className\n )}\n style={{\n opacity: isPaginationDisabled ? 0.3 : hasNoResults ? 0.5 : 1,\n transitionDuration: \"300ms\"\n }}\n role=\"navigation\"\n aria-label=\"Pagination\"\n aria-busy={isLoading}\n data-loading={isLoading}\n data-has-results={hasResults}\n >\n {/* Loading/no results state announcement for screen readers */}\n {(isLoading || !hasResults) && (\n <div \n className=\"sr-only\" \n role=\"status\" \n aria-live=\"polite\"\n >\n {isLoading \n ? `Pagination temporarily disabled while loading page ${displayCurrentPage} of ${displayTotalPages}`\n : `No results available - pagination disabled`\n }\n </div>\n )}\n\n {/* Pagination controls with disabled state */}\n <div \n className={cn(\n \"relative transition-all ease-in-out\",\n isPaginationDisabled && \"cursor-not-allowed\"\n )}\n style={{\n transitionDuration: \"300ms\"\n }}\n aria-hidden={isPaginationDisabled}\n >\n <PaginationComponent\n currentPage={displayCurrentPage}\n totalPages={displayTotalPages}\n onPageChange={hasResults ? onPageChange : () => {}} // Provide empty function instead of undefined\n />\n </div>\n\n {/* REMOVED: Loading overlays - only card skeletons should show during loading */}\n </div>\n )\n} "]}
1
+ {"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-CMIHA6TT.cjs","../src/components/persistent-pagination.tsx"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACVA,uCAAA,CAAA;AA6FQ,+CAAA;AAhCD,SAAS,oBAAA,CAAqB;AAAA,EACnC,SAAA;AAAA,EACA,QAAA;AAAA,EACA,WAAA;AAAA,EACA,UAAA;AAAA,EACA,SAAA;AAAA,EACA,gBAAA,EAAkB,GAAA;AAAA,EAClB,mBAAA,EAAqB,GAAA;AAAA,EACrB,iBAAA,EAAmB;AACrB,CAAA,EAA8B;AAI5B,EA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A;AACO,MAAA;AACI,QAAA;AACW,QAAA;AACtB,MAAA;AACK,MAAA;AACM,MAAA;AACA,MAAA;AACG,MAAA;AACI,MAAA;AAGhB,MAAA;AAAc,QAAA;AACb,UAAA;AAAA,UAAA;AACW,YAAA;AACL,YAAA;AACK,YAAA;AAET,YAAA;AAEG,UAAA;AAEN,QAAA;AAIF,wBAAA;AAAC,UAAA;AAAA,UAAA;AACY,YAAA;AACT,cAAA;AACA,cAAA;AACF,YAAA;AACO,YAAA;AACL,cAAA;AACF,YAAA;AACa,YAAA;AAEb,YAAA;AAAC,cAAA;AAAA,cAAA;AACc,gBAAA;AACD,gBAAA;AACZ,gBAAA;AAAiD,gBAAA;AAAA,cAAA;AACnD,YAAA;AAAA,UAAA;AACF,QAAA;AAAA,MAAA;AAAA,IAAA;AAGF,EAAA;AAEJ;AD9E6B;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-CMIHA6TT.cjs","sourcesContent":[null,"\"use client\"\n\nimport { ReactNode } from \"react\"\nimport { cn } from \"../utils/cn\"\n\ninterface PersistentPaginationProps {\n /**\n * Whether pagination is currently in a loading state\n */\n isLoading: boolean\n /**\n * The pagination component\n */\n children: ReactNode\n /**\n * Current page number\n */\n currentPage: number\n /**\n * Total number of pages\n */\n totalPages: number\n /**\n * Additional CSS classes\n */\n className?: string\n /**\n * Disabled opacity (0-1)\n */\n disabledOpacity?: number\n /**\n * Transition duration in milliseconds\n */\n transitionDuration?: number\n /**\n * Whether to show loading state in pagination\n */\n showLoadingState?: boolean\n}\n\n/**\n * PersistentPagination\n * \n * A wrapper component that keeps pagination visible during loading states\n * but provides visual feedback that it's temporarily disabled.\n * \n * Features:\n * - Maintains pagination visibility during content loading\n * - Disables interaction but preserves layout\n * - Shows current page context even when loading\n * - Provides accessibility support for loading states\n * - Smooth transitions between enabled/disabled states\n * \n * Usage:\n * ```tsx\n * <PersistentPagination\n * isLoading={isLoadingVendors}\n * currentPage={currentPage}\n * totalPages={totalPages}\n * >\n * <Pagination currentPage={currentPage} totalPages={totalPages} />\n * </PersistentPagination>\n * ```\n */\nexport function PersistentPagination({\n isLoading,\n children,\n currentPage,\n totalPages,\n className,\n disabledOpacity = 0.5,\n transitionDuration = 300,\n showLoadingState = true,\n}: PersistentPaginationProps) {\n // ALWAYS show pagination for predictable layout - just gray it out when not needed\n // Removed condition that hides pagination completely\n\n return (\n <div \n className={cn(\n \"relative transition-all ease-in-out\",\n \"flex justify-center items-center\",\n isLoading && \"pointer-events-none\",\n className\n )}\n style={{\n opacity: isLoading ? disabledOpacity : 1,\n transitionDuration: `${transitionDuration}ms`\n }}\n role=\"navigation\"\n aria-label=\"Pagination\"\n aria-busy={isLoading}\n data-loading={isLoading}\n >\n {/* Loading state announcement for screen readers */}\n {isLoading && (\n <div \n className=\"sr-only\" \n role=\"status\" \n aria-live=\"polite\"\n >\n Pagination temporarily disabled while loading page {currentPage} of {totalPages}\n </div>\n )}\n\n {/* Pagination controls with disabled state */}\n <div \n className={cn(\n \"relative transition-all ease-in-out\",\n isLoading && \"cursor-not-allowed\"\n )}\n style={{\n transitionDuration: `${transitionDuration}ms`\n }}\n aria-hidden={isLoading}\n >\n {children}\n </div>\n\n {/* REMOVED: Loading overlay - only card skeletons should show during loading */}\n </div>\n )\n}\n\n/**\n * Hook for managing pagination loading states\n */\nexport function usePaginationLoading(\n isLoading: boolean,\n currentPage: number,\n totalPages: number\n) {\n const shouldShowPagination = totalPages > 1 || isLoading\n \n const paginationProps = {\n 'aria-busy': isLoading,\n 'data-loading': isLoading,\n 'data-current-page': currentPage,\n 'data-total-pages': totalPages,\n }\n\n const getLoadingMessage = () => {\n if (isLoading) {\n return `Loading page ${currentPage} of ${totalPages}`\n }\n return `Page ${currentPage} of ${totalPages}`\n }\n\n return {\n shouldShowPagination,\n paginationProps,\n getLoadingMessage,\n }\n}\n\n/**\n * Enhanced pagination component that includes loading states\n */\ninterface PersistentPaginationWrapperProps {\n isLoading: boolean\n currentPage: number\n totalPages: number\n onPageChange?: (page: number) => void\n className?: string\n variant?: 'vendor' | 'blog'\n}\n\nexport function PersistentPaginationWrapper({\n isLoading,\n currentPage,\n totalPages,\n onPageChange,\n className,\n variant = 'vendor'\n}: PersistentPaginationWrapperProps) {\n const { getLoadingMessage } = usePaginationLoading(\n isLoading,\n currentPage,\n totalPages\n )\n\n // ALWAYS show pagination for predictable layout\n // For no results (totalPages = 0), show grayed out pagination\n const hasResults = totalPages > 0\n const displayTotalPages = hasResults ? totalPages : 1\n const displayCurrentPage = hasResults ? currentPage : 1\n // Only disable during loading, but still show when no results (just grayed out)\n const isPaginationDisabled = isLoading\n const hasNoResults = !hasResults && !isLoading\n\n // Use UnifiedPagination directly from ui-kit instead of importing from consuming apps\n // Both Pagination and BlogPagination in multi-platform-hub are just wrappers around UnifiedPagination\n const PaginationComponent = require('./unified-pagination').UnifiedPagination\n\n return (\n <div \n className={cn(\n \"relative transition-all ease-in-out flex justify-center items-center\",\n (isPaginationDisabled || hasNoResults) && \"pointer-events-none\",\n className\n )}\n style={{\n opacity: isPaginationDisabled ? 0.3 : hasNoResults ? 0.5 : 1,\n transitionDuration: \"300ms\"\n }}\n role=\"navigation\"\n aria-label=\"Pagination\"\n aria-busy={isLoading}\n data-loading={isLoading}\n data-has-results={hasResults}\n >\n {/* Loading/no results state announcement for screen readers */}\n {(isLoading || !hasResults) && (\n <div \n className=\"sr-only\" \n role=\"status\" \n aria-live=\"polite\"\n >\n {isLoading \n ? `Pagination temporarily disabled while loading page ${displayCurrentPage} of ${displayTotalPages}`\n : `No results available - pagination disabled`\n }\n </div>\n )}\n\n {/* Pagination controls with disabled state */}\n <div \n className={cn(\n \"relative transition-all ease-in-out\",\n isPaginationDisabled && \"cursor-not-allowed\"\n )}\n style={{\n transitionDuration: \"300ms\"\n }}\n aria-hidden={isPaginationDisabled}\n >\n <PaginationComponent\n currentPage={displayCurrentPage}\n totalPages={displayTotalPages}\n onPageChange={hasResults ? onPageChange : () => {}} // Provide empty function instead of undefined\n />\n </div>\n\n {/* REMOVED: Loading overlays - only card skeletons should show during loading */}\n </div>\n )\n} "]}
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkLYRGM25Pcjs = require('./chunk-LYRGM25P.cjs');
9
+ var _chunkT4GNFVT3cjs = require('./chunk-T4GNFVT3.cjs');
10
10
 
11
11
 
12
12
 
@@ -34,7 +34,7 @@ function DocSearchResultRow({
34
34
  }) {
35
35
  const docType = _optionalChain([result, 'access', _ => _.metadata, 'optionalAccess', _2 => _2.documentType]) || void 0;
36
36
  const sourceRepo = _optionalChain([result, 'access', _3 => _3.metadata, 'optionalAccess', _4 => _4.sourceRepo]) || void 0;
37
- const { Icon: SourceIcon, label: iconLabel } = _chunkLYRGM25Pcjs.resolveSourceIcon.call(void 0, {
37
+ const { Icon: SourceIcon, label: iconLabel } = _chunkT4GNFVT3cjs.resolveSourceIcon.call(void 0, {
38
38
  sourceRepo,
39
39
  documentType: docType
40
40
  });
@@ -77,7 +77,7 @@ function DocSearchBar({
77
77
  renderResult
78
78
  }) {
79
79
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
80
- _chunkLYRGM25Pcjs.SearchInput,
80
+ _chunkT4GNFVT3cjs.SearchInput,
81
81
  {
82
82
  placeholder,
83
83
  value: query,
@@ -202,7 +202,7 @@ function resolveSearchResultAction(result, source, runtimeMode, composeContentUr
202
202
  if (composed && !isAbsoluteHref(href)) {
203
203
  return { kind: "navigate-same-tab", href };
204
204
  }
205
- const isNewTab = _chunkLYRGM25Pcjs.decideNewTab.call(void 0, {
205
+ const isNewTab = _chunkT4GNFVT3cjs.decideNewTab.call(void 0, {
206
206
  href,
207
207
  targetPlatform: composed ? composed.targetPlatform : targetPlatform,
208
208
  surface: "useUnifiedNav",
@@ -303,27 +303,27 @@ function useDocSearch(config) {
303
303
  case "navigate-same-tab": {
304
304
  if (wantsNewTab) {
305
305
  setKeepOpen(true);
306
- window.open(action.href, "_blank", _chunkLYRGM25Pcjs.NEW_TAB_FEATURES);
306
+ window.open(action.href, "_blank", _chunkT4GNFVT3cjs.NEW_TAB_FEATURES);
307
307
  return;
308
308
  }
309
309
  setKeepOpen(false);
310
310
  const path = baseRoute && action.href.startsWith(`${baseRoute}/`) ? action.href.slice(baseRoute.length + 1) : null;
311
311
  if (path && _optionalChain([onInPageSwap, 'optionalCall', _16 => _16(path)])) return;
312
- router.push(_chunkLYRGM25Pcjs.stripSameOriginToPath.call(void 0, action.href));
312
+ router.push(_chunkT4GNFVT3cjs.stripSameOriginToPath.call(void 0, action.href));
313
313
  return;
314
314
  }
315
315
  case "navigate-new-tab":
316
316
  setKeepOpen(true);
317
317
  if (_optionalChain([runtime, 'optionalAccess', _17 => _17.navigation, 'access', _18 => _18.mode]) === "embed") {
318
318
  const targetPlatform = _nullishCoalesce(_optionalChain([result, 'access', _19 => _19.metadata, 'optionalAccess', _20 => _20.targetPlatform]), () => ( null));
319
- _chunkLYRGM25Pcjs.resolveExternalNavigation.call(void 0, {
319
+ _chunkT4GNFVT3cjs.resolveExternalNavigation.call(void 0, {
320
320
  href: action.href,
321
321
  targetPlatform,
322
322
  runtime
323
323
  }).open();
324
324
  return;
325
325
  }
326
- window.open(action.href, "_blank", _chunkLYRGM25Pcjs.NEW_TAB_FEATURES);
326
+ window.open(action.href, "_blank", _chunkT4GNFVT3cjs.NEW_TAB_FEATURES);
327
327
  return;
328
328
  case "ask-ai":
329
329
  setKeepOpen(false);
@@ -370,4 +370,4 @@ function useDocSearch(config) {
370
370
 
371
371
 
372
372
  exports.formatRelativePath = formatRelativePath; exports.DocSearchResultRow = DocSearchResultRow; exports.DocSearchBar = DocSearchBar; exports.mapDocSearchResults = mapDocSearchResults; exports.resolveSearchResultAction = resolveSearchResultAction; exports.useDocSearch = useDocSearch;
373
- //# sourceMappingURL=chunk-ZKQXE2P4.cjs.map
373
+ //# sourceMappingURL=chunk-DK6IYFLD.cjs.map