@drawbridge/components 0.1.14 → 0.1.16

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 (52) hide show
  1. package/dist/bridge/form-subdomain-missions.js +77 -38
  2. package/dist/bridge/form-subdomain-missions.mjs +76 -38
  3. package/dist/bridge/lib/url.js +3 -3
  4. package/dist/bridge/lib/url.mjs +3 -3
  5. package/dist/bridge/share-button.js +12 -2
  6. package/dist/bridge/share-button.mjs +12 -2
  7. package/dist/bridge/template-layout.js +1 -1
  8. package/dist/bridge/template-layout.mjs +1 -1
  9. package/dist/dashboard/answer-rows.js +77 -0
  10. package/dist/dashboard/answer-rows.mjs +41 -0
  11. package/dist/dashboard/card-campaign-switch.js +55 -43
  12. package/dist/dashboard/card-campaign-switch.mjs +56 -44
  13. package/dist/dashboard/card-order.js +248 -120
  14. package/dist/dashboard/card-order.mjs +248 -120
  15. package/dist/dashboard/connection-workflows.js +13 -4
  16. package/dist/dashboard/connection-workflows.mjs +13 -4
  17. package/dist/dashboard/form-organization-campaign-field-list.js +8 -49
  18. package/dist/dashboard/form-organization-campaign-field-list.mjs +8 -49
  19. package/dist/dashboard/form-organization-campaign-field-select.js +51 -5
  20. package/dist/dashboard/form-organization-campaign-field-select.mjs +51 -5
  21. package/dist/dashboard/form-organization-campaign-field-textarea.js +46 -8
  22. package/dist/dashboard/form-organization-campaign-field-textarea.mjs +46 -8
  23. package/dist/dashboard/form-organization-campaign-section.js +24 -4
  24. package/dist/dashboard/form-organization-campaign-section.mjs +24 -4
  25. package/dist/dashboard/form-organization-workflow.js +195 -56
  26. package/dist/dashboard/form-organization-workflow.mjs +191 -57
  27. package/dist/dashboard/item-row.js +92 -0
  28. package/dist/dashboard/item-row.mjs +63 -0
  29. package/dist/dashboard/lib/sms.js +3 -0
  30. package/dist/dashboard/lib/sms.mjs +2 -0
  31. package/dist/dashboard/order-sections.js +220 -0
  32. package/dist/dashboard/order-sections.mjs +185 -0
  33. package/dist/dashboard/preview.js +29 -2
  34. package/dist/dashboard/preview.mjs +28 -2
  35. package/dist/input-code.js +35 -53
  36. package/dist/input-code.mjs +26 -54
  37. package/dist/shared/button.js +1 -1
  38. package/dist/shared/button.mjs +1 -1
  39. package/dist/shared/lib/campaign.js +9 -3
  40. package/dist/shared/lib/campaign.mjs +7 -2
  41. package/dist/shared/lib/helpers.js +7 -0
  42. package/dist/shared/lib/helpers.mjs +7 -0
  43. package/package.json +19 -4
  44. package/types/bridge/form-subdomain-missions.d.ts +3 -1
  45. package/types/bridge/lib/url.d.ts +5 -4
  46. package/types/dashboard/answer-rows.d.ts +30 -0
  47. package/types/dashboard/card-order.d.ts +18 -3
  48. package/types/dashboard/form-organization-campaign-section.d.ts +2 -0
  49. package/types/dashboard/form-organization-workflow.d.ts +15 -0
  50. package/types/dashboard/item-row.d.ts +25 -0
  51. package/types/dashboard/order-sections.d.ts +36 -0
  52. package/types/shared/lib/helpers.d.ts +1 -1
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  var form_subdomain_missions_exports = {};
30
30
  __export(form_subdomain_missions_exports, {
31
31
  FormSubdomainMissions: () => FormSubdomainMissions,
32
+ bonusText: () => bonusText,
32
33
  default: () => form_subdomain_missions_default,
33
34
  openingScreen: () => openingScreen,
34
35
  pillText: () => pillText,
@@ -46,7 +47,6 @@ var import_check = __toESM(require("../icons/check"));
46
47
  var import_chevron_left = __toESM(require("../icons/chevron-left"));
47
48
  var import_chevron_right = __toESM(require("../icons/chevron-right"));
48
49
  var import_loader = __toESM(require("../icons/loader"));
49
- var import_star = __toESM(require("../icons/star"));
50
50
  var import_input_group = __toESM(require("../input-group"));
51
51
  var import_input_code = __toESM(require("../input-code"));
52
52
  var import_share_button = __toESM(require("./share-button"));
@@ -62,7 +62,12 @@ const screenFor = (type) => {
62
62
  };
63
63
  const openingScreen = (items = [], type) => {
64
64
  const item = items.find((row) => row.type === type);
65
- return item && !item.completed ? screenFor(type) : "missions";
65
+ return item && !item.completed ? screenFor(type) : "start";
66
+ };
67
+ const bonusText = (items = [], completed = items.filter((item) => item.completed).map((item) => item.type)) => {
68
+ const open = items.filter((item) => item.type !== "form" && !completed.includes(item.type));
69
+ const total = open.reduce((sum, item) => sum + Number(item.entries || 0), 0);
70
+ return total ? total + (open.some((item) => item.type === "share") ? "+" : "") : null;
66
71
  };
67
72
  const pillText = (item, completed) => (completed ? "+" : "") + Number((item == null ? void 0 : item.entries) || 0);
68
73
  const Pill = ({ children, style }) => {
@@ -182,10 +187,11 @@ const FormSubdomainMissions = ({
182
187
  setScreen(next);
183
188
  };
184
189
  const back = () => go("missions");
185
- const header = (text) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
190
+ const header = (text, back2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
186
191
  import_form_subdomain_header.FormSubdomainHeader,
187
192
  {
188
193
  ...{
194
+ back: back2,
189
195
  button,
190
196
  style,
191
197
  title: text
@@ -234,7 +240,6 @@ const FormSubdomainMissions = ({
234
240
  header(words.title),
235
241
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Back, { ...{ onClick: back, style } }),
236
242
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Centre, { children: [
237
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Strong, { children: words.heading }),
238
243
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: words.send }),
239
244
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Strong, { ...{ className: "break-all" }, children: contact == null ? void 0 : contact[import_missions.CODE_CHANNELS[manifest == null ? void 0 : manifest.channel]] })
240
245
  ] }),
@@ -278,10 +283,7 @@ const FormSubdomainMissions = ({
278
283
  children: [
279
284
  header(words.title),
280
285
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Back, { ...{ onClick: back, style } }),
281
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Centre, { children: [
282
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Strong, { children: "Enter verification code" }),
283
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: words.sent })
284
- ] }),
286
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Centre, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Strong, { children: words.sent }) }),
285
287
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
286
288
  CodeStep,
287
289
  {
@@ -408,6 +410,71 @@ const FormSubdomainMissions = ({
408
410
  ]
409
411
  }
410
412
  );
413
+ if (screen === "start") {
414
+ const bonus = bonusText(items, completed);
415
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
416
+ "div",
417
+ {
418
+ ...{
419
+ className: "space-y-6"
420
+ },
421
+ children: [
422
+ header(title),
423
+ message && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
424
+ "p",
425
+ {
426
+ ...{
427
+ "aria-live": "polite",
428
+ className: "text-center",
429
+ role: "alert"
430
+ },
431
+ children: message
432
+ }
433
+ ),
434
+ bonus && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
435
+ import_button.default,
436
+ {
437
+ ...{
438
+ onClick: () => go("missions"),
439
+ variant: "link"
440
+ },
441
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
442
+ "span",
443
+ {
444
+ ...{
445
+ className: "flex w-full items-center gap-4 px-4 py-3 border text-left",
446
+ style: (0, import_styles.inputStyle)(style)
447
+ },
448
+ children: [
449
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Pill, { ...{ style }, children: bonus }),
450
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
451
+ "span",
452
+ {
453
+ ...{
454
+ className: "flex-1"
455
+ },
456
+ children: "Bonus entries available"
457
+ }
458
+ ),
459
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
460
+ import_chevron_right.default,
461
+ {
462
+ ...{
463
+ "aria-hidden": true,
464
+ className: "w-4 h-4"
465
+ }
466
+ }
467
+ )
468
+ ]
469
+ }
470
+ )
471
+ }
472
+ ),
473
+ advertisements
474
+ ]
475
+ }
476
+ );
477
+ }
411
478
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
412
479
  "div",
413
480
  {
@@ -415,36 +482,7 @@ const FormSubdomainMissions = ({
415
482
  className: "space-y-6"
416
483
  },
417
484
  children: [
418
- header(title),
419
- message && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
420
- "div",
421
- {
422
- ...{
423
- className: "flex flex-col items-center gap-3 text-center"
424
- },
425
- children: [
426
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
427
- import_star.default,
428
- {
429
- ...{
430
- "aria-hidden": true,
431
- className: "w-7 h-7"
432
- }
433
- }
434
- ),
435
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
436
- "p",
437
- {
438
- ...{
439
- "aria-live": "polite",
440
- role: "alert"
441
- },
442
- children: message
443
- }
444
- )
445
- ]
446
- }
447
- ),
485
+ header("Earn more entries", { onClick: () => go("start") }),
448
486
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
449
487
  "ul",
450
488
  {
@@ -532,6 +570,7 @@ var form_subdomain_missions_default = FormSubdomainMissions;
532
570
  // Annotate the CommonJS export names for ESM import in node:
533
571
  0 && (module.exports = {
534
572
  FormSubdomainMissions,
573
+ bonusText,
535
574
  openingScreen,
536
575
  pillText,
537
576
  screenFor
@@ -10,7 +10,6 @@ import Check from "../icons/check.mjs";
10
10
  import ChevronLeft from "../icons/chevron-left.mjs";
11
11
  import ChevronRight from "../icons/chevron-right.mjs";
12
12
  import Loader from "../icons/loader.mjs";
13
- import Star from "../icons/star.mjs";
14
13
  import InputGroup from "../input-group.mjs";
15
14
  import InputCode from "../input-code.mjs";
16
15
  import ShareButton from "./share-button.mjs";
@@ -26,7 +25,12 @@ const screenFor = (type) => {
26
25
  };
27
26
  const openingScreen = (items = [], type) => {
28
27
  const item = items.find((row) => row.type === type);
29
- return item && !item.completed ? screenFor(type) : "missions";
28
+ return item && !item.completed ? screenFor(type) : "start";
29
+ };
30
+ const bonusText = (items = [], completed = items.filter((item) => item.completed).map((item) => item.type)) => {
31
+ const open = items.filter((item) => item.type !== "form" && !completed.includes(item.type));
32
+ const total = open.reduce((sum, item) => sum + Number(item.entries || 0), 0);
33
+ return total ? total + (open.some((item) => item.type === "share") ? "+" : "") : null;
30
34
  };
31
35
  const pillText = (item, completed) => (completed ? "+" : "") + Number((item == null ? void 0 : item.entries) || 0);
32
36
  const Pill = ({ children, style }) => {
@@ -146,10 +150,11 @@ const FormSubdomainMissions = ({
146
150
  setScreen(next);
147
151
  };
148
152
  const back = () => go("missions");
149
- const header = (text) => /* @__PURE__ */ jsx(
153
+ const header = (text, back2) => /* @__PURE__ */ jsx(
150
154
  FormSubdomainHeader,
151
155
  {
152
156
  ...{
157
+ back: back2,
153
158
  button,
154
159
  style,
155
160
  title: text
@@ -198,7 +203,6 @@ const FormSubdomainMissions = ({
198
203
  header(words.title),
199
204
  /* @__PURE__ */ jsx(Back, { ...{ onClick: back, style } }),
200
205
  /* @__PURE__ */ jsxs(Centre, { children: [
201
- /* @__PURE__ */ jsx(Strong, { children: words.heading }),
202
206
  /* @__PURE__ */ jsx("p", { children: words.send }),
203
207
  /* @__PURE__ */ jsx(Strong, { ...{ className: "break-all" }, children: contact == null ? void 0 : contact[CODE_CHANNELS[manifest == null ? void 0 : manifest.channel]] })
204
208
  ] }),
@@ -242,10 +246,7 @@ const FormSubdomainMissions = ({
242
246
  children: [
243
247
  header(words.title),
244
248
  /* @__PURE__ */ jsx(Back, { ...{ onClick: back, style } }),
245
- /* @__PURE__ */ jsxs(Centre, { children: [
246
- /* @__PURE__ */ jsx(Strong, { children: "Enter verification code" }),
247
- /* @__PURE__ */ jsx("p", { children: words.sent })
248
- ] }),
249
+ /* @__PURE__ */ jsx(Centre, { children: /* @__PURE__ */ jsx(Strong, { children: words.sent }) }),
249
250
  /* @__PURE__ */ jsx(
250
251
  CodeStep,
251
252
  {
@@ -372,6 +373,71 @@ const FormSubdomainMissions = ({
372
373
  ]
373
374
  }
374
375
  );
376
+ if (screen === "start") {
377
+ const bonus = bonusText(items, completed);
378
+ return /* @__PURE__ */ jsxs(
379
+ "div",
380
+ {
381
+ ...{
382
+ className: "space-y-6"
383
+ },
384
+ children: [
385
+ header(title),
386
+ message && /* @__PURE__ */ jsx(
387
+ "p",
388
+ {
389
+ ...{
390
+ "aria-live": "polite",
391
+ className: "text-center",
392
+ role: "alert"
393
+ },
394
+ children: message
395
+ }
396
+ ),
397
+ bonus && /* @__PURE__ */ jsx(
398
+ Button,
399
+ {
400
+ ...{
401
+ onClick: () => go("missions"),
402
+ variant: "link"
403
+ },
404
+ children: /* @__PURE__ */ jsxs(
405
+ "span",
406
+ {
407
+ ...{
408
+ className: "flex w-full items-center gap-4 px-4 py-3 border text-left",
409
+ style: inputStyle(style)
410
+ },
411
+ children: [
412
+ /* @__PURE__ */ jsx(Pill, { ...{ style }, children: bonus }),
413
+ /* @__PURE__ */ jsx(
414
+ "span",
415
+ {
416
+ ...{
417
+ className: "flex-1"
418
+ },
419
+ children: "Bonus entries available"
420
+ }
421
+ ),
422
+ /* @__PURE__ */ jsx(
423
+ ChevronRight,
424
+ {
425
+ ...{
426
+ "aria-hidden": true,
427
+ className: "w-4 h-4"
428
+ }
429
+ }
430
+ )
431
+ ]
432
+ }
433
+ )
434
+ }
435
+ ),
436
+ advertisements
437
+ ]
438
+ }
439
+ );
440
+ }
375
441
  return /* @__PURE__ */ jsxs(
376
442
  "div",
377
443
  {
@@ -379,36 +445,7 @@ const FormSubdomainMissions = ({
379
445
  className: "space-y-6"
380
446
  },
381
447
  children: [
382
- header(title),
383
- message && /* @__PURE__ */ jsxs(
384
- "div",
385
- {
386
- ...{
387
- className: "flex flex-col items-center gap-3 text-center"
388
- },
389
- children: [
390
- /* @__PURE__ */ jsx(
391
- Star,
392
- {
393
- ...{
394
- "aria-hidden": true,
395
- className: "w-7 h-7"
396
- }
397
- }
398
- ),
399
- /* @__PURE__ */ jsx(
400
- "p",
401
- {
402
- ...{
403
- "aria-live": "polite",
404
- role: "alert"
405
- },
406
- children: message
407
- }
408
- )
409
- ]
410
- }
411
- ),
448
+ header("Earn more entries", { onClick: () => go("start") }),
412
449
  /* @__PURE__ */ jsx(
413
450
  "ul",
414
451
  {
@@ -495,6 +532,7 @@ const FormSubdomainMissions = ({
495
532
  var form_subdomain_missions_default = FormSubdomainMissions;
496
533
  export {
497
534
  FormSubdomainMissions,
535
+ bonusText,
498
536
  form_subdomain_missions_default as default,
499
537
  openingScreen,
500
538
  pillText,
@@ -58,9 +58,9 @@ const submissionEndpoint = ({ affiliate, id, slug, subdomain, token }) => {
58
58
  const query = params.toString();
59
59
  return "/subdomain/" + subdomain + "/page/" + slug + "/submission/" + encodeURIComponent(id) + (query ? "?" + query : "");
60
60
  };
61
- const leadEndpoint = ({ lead, slug, subdomain, token }) => {
62
- if (typeof lead !== "string" || !/^[\w-]+\.[\w-]+$/.test(lead)) return null;
63
- return "/subdomain/" + subdomain + "/page/" + slug + "/lead/" + lead + (token ? "?drwbrdg_pre=" + encodeURIComponent(token) : "");
61
+ const leadEndpoint = ({ code, slug, subdomain, token }) => {
62
+ if (typeof code !== "string" || !/^[0-9a-z]{12}$/.test(code)) return null;
63
+ return "/subdomain/" + subdomain + "/page/" + slug + "/lead/" + code + (token ? "?drwbrdg_pre=" + encodeURIComponent(token) : "");
64
64
  };
65
65
  const missionEndpoint = ({ action, slug, subdomain, type }) => "/subdomain/" + subdomain + "/page/" + slug + "/mission/" + type + "/" + action;
66
66
  // Annotate the CommonJS export names for ESM import in node:
@@ -32,9 +32,9 @@ const submissionEndpoint = ({ affiliate, id, slug, subdomain, token }) => {
32
32
  const query = params.toString();
33
33
  return "/subdomain/" + subdomain + "/page/" + slug + "/submission/" + encodeURIComponent(id) + (query ? "?" + query : "");
34
34
  };
35
- const leadEndpoint = ({ lead, slug, subdomain, token }) => {
36
- if (typeof lead !== "string" || !/^[\w-]+\.[\w-]+$/.test(lead)) return null;
37
- return "/subdomain/" + subdomain + "/page/" + slug + "/lead/" + lead + (token ? "?drwbrdg_pre=" + encodeURIComponent(token) : "");
35
+ const leadEndpoint = ({ code, slug, subdomain, token }) => {
36
+ if (typeof code !== "string" || !/^[0-9a-z]{12}$/.test(code)) return null;
37
+ return "/subdomain/" + subdomain + "/page/" + slug + "/lead/" + code + (token ? "?drwbrdg_pre=" + encodeURIComponent(token) : "");
38
38
  };
39
39
  const missionEndpoint = ({ action, slug, subdomain, type }) => "/subdomain/" + subdomain + "/page/" + slug + "/mission/" + type + "/" + action;
40
40
  export {
@@ -50,15 +50,18 @@ const ShareButton = ({
50
50
  const brandButton = style && (0, import_styles.buttonStyle)(style);
51
51
  const icon = {
52
52
  bgStyle: { fill: (brandButton == null ? void 0 : brandButton.backgroundColor) || "var(--color-black)" },
53
+ className: "w-full h-auto max-w-[40px]",
53
54
  iconFillColor: (brandButton == null ? void 0 : brandButton.color) || "var(--color-white)",
54
55
  round: true,
55
56
  size: iconSize
56
57
  };
58
+ const className = "w-full justify-center";
57
59
  const icons = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
58
60
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
59
61
  import_react_share.FacebookShareButton,
60
62
  {
61
63
  ...{
64
+ className,
62
65
  disabled,
63
66
  onClick,
64
67
  url: values == null ? void 0 : values.url
@@ -75,6 +78,7 @@ const ShareButton = ({
75
78
  import_react_share.XShareButton,
76
79
  {
77
80
  ...{
81
+ className,
78
82
  disabled,
79
83
  onClick,
80
84
  title: values == null ? void 0 : values.headline,
@@ -92,6 +96,7 @@ const ShareButton = ({
92
96
  import_react_share.LinkedinShareButton,
93
97
  {
94
98
  ...{
99
+ className,
95
100
  disabled,
96
101
  onClick,
97
102
  summary: values == null ? void 0 : values.description,
@@ -110,6 +115,7 @@ const ShareButton = ({
110
115
  import_react_share.RedditShareButton,
111
116
  {
112
117
  ...{
118
+ className,
113
119
  disabled,
114
120
  onClick,
115
121
  title: values == null ? void 0 : values.headline,
@@ -127,6 +133,7 @@ const ShareButton = ({
127
133
  import_react_share.WhatsappShareButton,
128
134
  {
129
135
  ...{
136
+ className,
130
137
  disabled,
131
138
  onClick,
132
139
  title: values == null ? void 0 : values.headline,
@@ -144,6 +151,7 @@ const ShareButton = ({
144
151
  import_react_share.TelegramShareButton,
145
152
  {
146
153
  ...{
154
+ className,
147
155
  disabled,
148
156
  onClick,
149
157
  title: values == null ? void 0 : values.headline,
@@ -161,6 +169,7 @@ const ShareButton = ({
161
169
  import_react_share.ThreadsShareButton,
162
170
  {
163
171
  ...{
172
+ className,
164
173
  disabled,
165
174
  onClick,
166
175
  title: values == null ? void 0 : values.headline,
@@ -179,6 +188,7 @@ const ShareButton = ({
179
188
  {
180
189
  ...{
181
190
  body: values == null ? void 0 : values.description,
191
+ className,
182
192
  disabled,
183
193
  onClick,
184
194
  subject: values == null ? void 0 : values.headline,
@@ -228,8 +238,8 @@ const ShareButton = ({
228
238
  "div",
229
239
  {
230
240
  ...{
231
- // Eight 40px buttons fit a 400px panel at 11px (11.5px overflowed by half a pixel and clipped the last); narrower, the row scrolls.
232
- className: "flex items-center flex-nowrap gap-[11px] overflow-x-auto hide-scrollbar"
241
+ // Eight equal columns: 40px buttons at 11px on a 400px panel, smaller on a phone, never cut off.
242
+ className: "grid grid-cols-8 items-center gap-[11px]"
233
243
  },
234
244
  children: icons
235
245
  }
@@ -35,15 +35,18 @@ const ShareButton = ({
35
35
  const brandButton = style && buttonStyle(style);
36
36
  const icon = {
37
37
  bgStyle: { fill: (brandButton == null ? void 0 : brandButton.backgroundColor) || "var(--color-black)" },
38
+ className: "w-full h-auto max-w-[40px]",
38
39
  iconFillColor: (brandButton == null ? void 0 : brandButton.color) || "var(--color-white)",
39
40
  round: true,
40
41
  size: iconSize
41
42
  };
43
+ const className = "w-full justify-center";
42
44
  const icons = /* @__PURE__ */ jsxs(Fragment, { children: [
43
45
  /* @__PURE__ */ jsx(
44
46
  FacebookShareButton,
45
47
  {
46
48
  ...{
49
+ className,
47
50
  disabled,
48
51
  onClick,
49
52
  url: values == null ? void 0 : values.url
@@ -60,6 +63,7 @@ const ShareButton = ({
60
63
  XShareButton,
61
64
  {
62
65
  ...{
66
+ className,
63
67
  disabled,
64
68
  onClick,
65
69
  title: values == null ? void 0 : values.headline,
@@ -77,6 +81,7 @@ const ShareButton = ({
77
81
  LinkedinShareButton,
78
82
  {
79
83
  ...{
84
+ className,
80
85
  disabled,
81
86
  onClick,
82
87
  summary: values == null ? void 0 : values.description,
@@ -95,6 +100,7 @@ const ShareButton = ({
95
100
  RedditShareButton,
96
101
  {
97
102
  ...{
103
+ className,
98
104
  disabled,
99
105
  onClick,
100
106
  title: values == null ? void 0 : values.headline,
@@ -112,6 +118,7 @@ const ShareButton = ({
112
118
  WhatsappShareButton,
113
119
  {
114
120
  ...{
121
+ className,
115
122
  disabled,
116
123
  onClick,
117
124
  title: values == null ? void 0 : values.headline,
@@ -129,6 +136,7 @@ const ShareButton = ({
129
136
  TelegramShareButton,
130
137
  {
131
138
  ...{
139
+ className,
132
140
  disabled,
133
141
  onClick,
134
142
  title: values == null ? void 0 : values.headline,
@@ -146,6 +154,7 @@ const ShareButton = ({
146
154
  ThreadsShareButton,
147
155
  {
148
156
  ...{
157
+ className,
149
158
  disabled,
150
159
  onClick,
151
160
  title: values == null ? void 0 : values.headline,
@@ -164,6 +173,7 @@ const ShareButton = ({
164
173
  {
165
174
  ...{
166
175
  body: values == null ? void 0 : values.description,
176
+ className,
167
177
  disabled,
168
178
  onClick,
169
179
  subject: values == null ? void 0 : values.headline,
@@ -213,8 +223,8 @@ const ShareButton = ({
213
223
  "div",
214
224
  {
215
225
  ...{
216
- // Eight 40px buttons fit a 400px panel at 11px (11.5px overflowed by half a pixel and clipped the last); narrower, the row scrolls.
217
- className: "flex items-center flex-nowrap gap-[11px] overflow-x-auto hide-scrollbar"
226
+ // Eight equal columns: 40px buttons at 11px on a 400px panel, smaller on a phone, never cut off.
227
+ className: "grid grid-cols-8 items-center gap-[11px]"
218
228
  },
219
229
  children: icons
220
230
  }
@@ -394,7 +394,7 @@ const TemplateLayout = ({
394
394
  [affiliate, data, params, preview, style]
395
395
  );
396
396
  const leadMission = searchParams.get("mission");
397
- const leadUrl = submissionId ? null : (0, import_url.leadEndpoint)({ lead: searchParams.get("lead"), slug: params == null ? void 0 : params.slug, subdomain: params == null ? void 0 : params.subdomain, token });
397
+ const leadUrl = submissionId ? null : (0, import_url.leadEndpoint)({ code: searchParams.get("m"), slug: params == null ? void 0 : params.slug, subdomain: params == null ? void 0 : params.subdomain, token });
398
398
  (0, import_react.useEffect)(
399
399
  () => {
400
400
  if (!leadUrl) return;
@@ -362,7 +362,7 @@ const TemplateLayout = ({
362
362
  [affiliate, data, params, preview, style]
363
363
  );
364
364
  const leadMission = searchParams.get("mission");
365
- const leadUrl = submissionId ? null : leadEndpoint({ lead: searchParams.get("lead"), slug: params == null ? void 0 : params.slug, subdomain: params == null ? void 0 : params.subdomain, token });
365
+ const leadUrl = submissionId ? null : leadEndpoint({ code: searchParams.get("m"), slug: params == null ? void 0 : params.slug, subdomain: params == null ? void 0 : params.subdomain, token });
366
366
  useEffect(
367
367
  () => {
368
368
  if (!leadUrl) return;
@@ -0,0 +1,77 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var answer_rows_exports = {};
29
+ __export(answer_rows_exports, {
30
+ Removed: () => Removed,
31
+ answerRows: () => answerRows,
32
+ blank: () => blank,
33
+ display: () => display
34
+ });
35
+ module.exports = __toCommonJS(answer_rows_exports);
36
+ var import_jsx_runtime = require("react/jsx-runtime");
37
+ var import_badge = __toESM(require("../shared/badge"));
38
+ const blank = (value) => value === void 0 || value === null || value === "";
39
+ const display = (value) => {
40
+ if (blank(value)) return "\u2014";
41
+ if (value instanceof Object) return Object.values(value).join(", ");
42
+ return String(value);
43
+ };
44
+ const Removed = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
45
+ "span",
46
+ {
47
+ ...{
48
+ className: "flex flex-wrap items-center gap-2"
49
+ },
50
+ children: [
51
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("s", { children }),
52
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
53
+ import_badge.default,
54
+ {
55
+ ...{
56
+ size: "small"
57
+ },
58
+ children: "Removed"
59
+ }
60
+ )
61
+ ]
62
+ }
63
+ );
64
+ const answerRows = (fields = [], answers = []) => {
65
+ const values = Object.fromEntries(answers.map((item) => [item.reference, item.value]));
66
+ return (type) => fields.filter((item) => (item == null ? void 0 : item.type) === type && (!(item == null ? void 0 : item.deleted) || !blank(values[item.id]))).map((item) => ({
67
+ label: item.label,
68
+ value: (item == null ? void 0 : item.deleted) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Removed, { children: display(values[item.id]) }) : display(values[item.id])
69
+ }));
70
+ };
71
+ // Annotate the CommonJS export names for ESM import in node:
72
+ 0 && (module.exports = {
73
+ Removed,
74
+ answerRows,
75
+ blank,
76
+ display
77
+ });
@@ -0,0 +1,41 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import Badge from "../shared/badge.mjs";
3
+ const blank = (value) => value === void 0 || value === null || value === "";
4
+ const display = (value) => {
5
+ if (blank(value)) return "\u2014";
6
+ if (value instanceof Object) return Object.values(value).join(", ");
7
+ return String(value);
8
+ };
9
+ const Removed = ({ children }) => /* @__PURE__ */ jsxs(
10
+ "span",
11
+ {
12
+ ...{
13
+ className: "flex flex-wrap items-center gap-2"
14
+ },
15
+ children: [
16
+ /* @__PURE__ */ jsx("s", { children }),
17
+ /* @__PURE__ */ jsx(
18
+ Badge,
19
+ {
20
+ ...{
21
+ size: "small"
22
+ },
23
+ children: "Removed"
24
+ }
25
+ )
26
+ ]
27
+ }
28
+ );
29
+ const answerRows = (fields = [], answers = []) => {
30
+ const values = Object.fromEntries(answers.map((item) => [item.reference, item.value]));
31
+ return (type) => fields.filter((item) => (item == null ? void 0 : item.type) === type && (!(item == null ? void 0 : item.deleted) || !blank(values[item.id]))).map((item) => ({
32
+ label: item.label,
33
+ value: (item == null ? void 0 : item.deleted) ? /* @__PURE__ */ jsx(Removed, { children: display(values[item.id]) }) : display(values[item.id])
34
+ }));
35
+ };
36
+ export {
37
+ Removed,
38
+ answerRows,
39
+ blank,
40
+ display
41
+ };