@drawbridge/components 0.1.14 → 0.1.15

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 (27) 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/dashboard/card-campaign-switch.js +55 -43
  4. package/dist/dashboard/card-campaign-switch.mjs +56 -44
  5. package/dist/dashboard/card-order.js +216 -31
  6. package/dist/dashboard/card-order.mjs +216 -31
  7. package/dist/dashboard/connection-workflows.js +13 -4
  8. package/dist/dashboard/connection-workflows.mjs +13 -4
  9. package/dist/dashboard/form-organization-campaign-field-select.js +51 -5
  10. package/dist/dashboard/form-organization-campaign-field-select.mjs +51 -5
  11. package/dist/dashboard/form-organization-campaign-field-textarea.js +46 -8
  12. package/dist/dashboard/form-organization-campaign-field-textarea.mjs +46 -8
  13. package/dist/dashboard/form-organization-campaign-section.js +24 -4
  14. package/dist/dashboard/form-organization-campaign-section.mjs +24 -4
  15. package/dist/dashboard/form-organization-workflow.js +222 -33
  16. package/dist/dashboard/form-organization-workflow.mjs +219 -33
  17. package/dist/input-code.js +35 -53
  18. package/dist/input-code.mjs +26 -54
  19. package/dist/shared/button.js +1 -1
  20. package/dist/shared/button.mjs +1 -1
  21. package/dist/shared/lib/campaign.js +9 -3
  22. package/dist/shared/lib/campaign.mjs +7 -2
  23. package/package.json +1 -1
  24. package/types/bridge/form-subdomain-missions.d.ts +3 -1
  25. package/types/dashboard/card-order.d.ts +15 -2
  26. package/types/dashboard/form-organization-campaign-section.d.ts +2 -0
  27. package/types/dashboard/form-organization-workflow.d.ts +13 -0
@@ -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,
@@ -99,46 +99,57 @@ const SwitchLock = ({ disabled, onChange, value }) => /* @__PURE__ */ (0, import
99
99
  ]
100
100
  }
101
101
  );
102
- const Row = ({ description, disabled, onChange, title, value }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
103
- "div",
104
- {
105
- ...{
106
- className: "flex items-center gap-4 py-3 first:pt-0 last:pb-0"
107
- },
108
- children: [
109
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
110
- "div",
111
- {
112
- ...{
113
- className: "flex-1 min-w-0"
114
- },
115
- children: [
116
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: title }),
117
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
118
- "p",
119
- {
120
- ...{
121
- className: "text-sm text-gray-dark"
122
- },
123
- children: description
124
- }
125
- )
126
- ]
127
- }
128
- ),
129
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
130
- SwitchLock,
131
- {
132
- ...{
133
- disabled,
134
- onChange,
135
- value
102
+ const Row = ({ description, lock, onChange, title, value }) => {
103
+ const input = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
104
+ SwitchLock,
105
+ {
106
+ ...{
107
+ disabled: Boolean(lock),
108
+ onChange,
109
+ value
110
+ }
111
+ }
112
+ );
113
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
114
+ "div",
115
+ {
116
+ ...{
117
+ className: "flex items-center gap-4 py-3 first:pt-0 last:pb-0"
118
+ },
119
+ children: [
120
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
121
+ "div",
122
+ {
123
+ ...{
124
+ className: "flex-1 min-w-0"
125
+ },
126
+ children: [
127
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: title }),
128
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
129
+ "p",
130
+ {
131
+ ...{
132
+ className: "text-sm text-gray-dark"
133
+ },
134
+ children: description
135
+ }
136
+ )
137
+ ]
136
138
  }
137
- }
138
- )
139
- ]
140
- }
141
- );
139
+ ),
140
+ lock ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
141
+ import_tooltip.default,
142
+ {
143
+ ...{
144
+ content: lock
145
+ },
146
+ children: input
147
+ }
148
+ ) : input
149
+ ]
150
+ }
151
+ );
152
+ };
142
153
  const HeaderCampaignSwitch = ({
143
154
  campaign,
144
155
  disabled,
@@ -153,12 +164,13 @@ const HeaderCampaignSwitch = ({
153
164
  onError,
154
165
  onSuccess
155
166
  });
167
+ const lock = (0, import_campaign.switchLock)(campaign, which, disabled);
156
168
  const input = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
157
169
  import_input_switch.default,
158
170
  {
159
171
  ...{
160
172
  "aria-label": which === "form" ? "Form" : "Giveaway",
161
- disabled,
173
+ disabled: Boolean(lock),
162
174
  onChange: (value) => flip(which, value),
163
175
  value: Boolean((_a = campaign == null ? void 0 : campaign[which]) == null ? void 0 : _a.enabled)
164
176
  }
@@ -171,11 +183,11 @@ const HeaderCampaignSwitch = ({
171
183
  className: "flex",
172
184
  ...rest
173
185
  },
174
- children: disabled ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
186
+ children: lock ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
175
187
  import_tooltip.default,
176
188
  {
177
189
  ...{
178
- content: "You need Manage on Campaigns to change this"
190
+ content: lock
179
191
  },
180
192
  children: input
181
193
  }
@@ -241,7 +253,7 @@ const CardLeadCapture = ({
241
253
  {
242
254
  ...{
243
255
  description,
244
- disabled,
256
+ lock: (0, import_campaign.switchLock)(campaign, key, disabled),
245
257
  onChange: (value) => flip(key, value),
246
258
  title,
247
259
  value: Boolean((_a = campaign == null ? void 0 : campaign[key]) == null ? void 0 : _a.enabled)
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useQueryClient } from "@tanstack/react-query";
3
3
  import { request } from "@drawbridge/drawbridge-utils/fetch";
4
- import { awardingCard, campaignSwitch } from "../shared/lib/campaign.mjs";
4
+ import { awardingCard, campaignSwitch, switchLock } from "../shared/lib/campaign.mjs";
5
5
  import { useModal } from "./lib/hooks.mjs";
6
6
  import CardSection from "./card-section.mjs";
7
7
  import CardTask from "./card-task.mjs";
@@ -66,46 +66,57 @@ const SwitchLock = ({ disabled, onChange, value }) => /* @__PURE__ */ jsxs(
66
66
  ]
67
67
  }
68
68
  );
69
- const Row = ({ description, disabled, onChange, title, value }) => /* @__PURE__ */ jsxs(
70
- "div",
71
- {
72
- ...{
73
- className: "flex items-center gap-4 py-3 first:pt-0 last:pb-0"
74
- },
75
- children: [
76
- /* @__PURE__ */ jsxs(
77
- "div",
78
- {
79
- ...{
80
- className: "flex-1 min-w-0"
81
- },
82
- children: [
83
- /* @__PURE__ */ jsx("p", { children: title }),
84
- /* @__PURE__ */ jsx(
85
- "p",
86
- {
87
- ...{
88
- className: "text-sm text-gray-dark"
89
- },
90
- children: description
91
- }
92
- )
93
- ]
94
- }
95
- ),
96
- /* @__PURE__ */ jsx(
97
- SwitchLock,
98
- {
99
- ...{
100
- disabled,
101
- onChange,
102
- value
69
+ const Row = ({ description, lock, onChange, title, value }) => {
70
+ const input = /* @__PURE__ */ jsx(
71
+ SwitchLock,
72
+ {
73
+ ...{
74
+ disabled: Boolean(lock),
75
+ onChange,
76
+ value
77
+ }
78
+ }
79
+ );
80
+ return /* @__PURE__ */ jsxs(
81
+ "div",
82
+ {
83
+ ...{
84
+ className: "flex items-center gap-4 py-3 first:pt-0 last:pb-0"
85
+ },
86
+ children: [
87
+ /* @__PURE__ */ jsxs(
88
+ "div",
89
+ {
90
+ ...{
91
+ className: "flex-1 min-w-0"
92
+ },
93
+ children: [
94
+ /* @__PURE__ */ jsx("p", { children: title }),
95
+ /* @__PURE__ */ jsx(
96
+ "p",
97
+ {
98
+ ...{
99
+ className: "text-sm text-gray-dark"
100
+ },
101
+ children: description
102
+ }
103
+ )
104
+ ]
103
105
  }
104
- }
105
- )
106
- ]
107
- }
108
- );
106
+ ),
107
+ lock ? /* @__PURE__ */ jsx(
108
+ Tooltip,
109
+ {
110
+ ...{
111
+ content: lock
112
+ },
113
+ children: input
114
+ }
115
+ ) : input
116
+ ]
117
+ }
118
+ );
119
+ };
109
120
  const HeaderCampaignSwitch = ({
110
121
  campaign,
111
122
  disabled,
@@ -120,12 +131,13 @@ const HeaderCampaignSwitch = ({
120
131
  onError,
121
132
  onSuccess
122
133
  });
134
+ const lock = switchLock(campaign, which, disabled);
123
135
  const input = /* @__PURE__ */ jsx(
124
136
  InputSwitch,
125
137
  {
126
138
  ...{
127
139
  "aria-label": which === "form" ? "Form" : "Giveaway",
128
- disabled,
140
+ disabled: Boolean(lock),
129
141
  onChange: (value) => flip(which, value),
130
142
  value: Boolean((_a = campaign == null ? void 0 : campaign[which]) == null ? void 0 : _a.enabled)
131
143
  }
@@ -138,11 +150,11 @@ const HeaderCampaignSwitch = ({
138
150
  className: "flex",
139
151
  ...rest
140
152
  },
141
- children: disabled ? /* @__PURE__ */ jsx(
153
+ children: lock ? /* @__PURE__ */ jsx(
142
154
  Tooltip,
143
155
  {
144
156
  ...{
145
- content: "You need Manage on Campaigns to change this"
157
+ content: lock
146
158
  },
147
159
  children: input
148
160
  }
@@ -208,7 +220,7 @@ const CardLeadCapture = ({
208
220
  {
209
221
  ...{
210
222
  description,
211
- disabled,
223
+ lock: switchLock(campaign, key, disabled),
212
224
  onChange: (value) => flip(key, value),
213
225
  title,
214
226
  value: Boolean((_a = campaign == null ? void 0 : campaign[key]) == null ? void 0 : _a.enabled)