@drawbridge/components 0.1.33 → 0.1.35
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.
- package/components/styles.css +68 -355
- package/dist/advertisement.js +15 -20
- package/dist/advertisement.mjs +15 -20
- package/dist/bridge/advertisements.js +4 -2
- package/dist/bridge/advertisements.mjs +5 -3
- package/dist/bridge/fields.js +89 -6
- package/dist/bridge/fields.mjs +89 -7
- package/dist/bridge/form-subdomain-agreement.js +165 -0
- package/dist/bridge/form-subdomain-agreement.mjs +132 -0
- package/dist/bridge/form-subdomain-embed.js +5 -1
- package/dist/bridge/form-subdomain-embed.mjs +5 -1
- package/dist/bridge/form-subdomain-header.js +21 -14
- package/dist/bridge/form-subdomain-header.mjs +20 -14
- package/dist/bridge/form-subdomain-issue.js +17 -8
- package/dist/bridge/form-subdomain-issue.mjs +17 -8
- package/dist/bridge/form-subdomain-missions.js +58 -52
- package/dist/bridge/form-subdomain-missions.mjs +60 -54
- package/dist/bridge/form-subdomain.js +223 -94
- package/dist/bridge/form-subdomain.mjs +222 -96
- package/dist/bridge/lib/entry.js +61 -6
- package/dist/bridge/lib/entry.mjs +51 -5
- package/dist/bridge/lib/order.js +23 -0
- package/dist/bridge/lib/order.mjs +20 -0
- package/dist/bridge/template-layout.js +5 -2
- package/dist/bridge/template-layout.mjs +6 -3
- package/dist/bridge/template-modal.js +82 -15
- package/dist/bridge/template-modal.mjs +83 -16
- package/dist/bridge/template-subdomain-gallery.js +126 -75
- package/dist/bridge/template-subdomain-gallery.mjs +122 -75
- package/dist/bridge/template-subdomain.js +16 -14
- package/dist/bridge/template-subdomain.mjs +17 -15
- package/dist/dashboard/avatar.js +5 -0
- package/dist/dashboard/avatar.mjs +5 -0
- package/dist/dashboard/campaign-form.js +1798 -0
- package/dist/dashboard/campaign-form.mjs +1769 -0
- package/dist/dashboard/card-affiliate.js +3 -2
- package/dist/dashboard/card-affiliate.mjs +3 -2
- package/dist/dashboard/card-campaign-agreement.js +172 -0
- package/dist/dashboard/card-campaign-agreement.mjs +139 -0
- package/dist/dashboard/card-campaign-switch.js +34 -9
- package/dist/dashboard/card-campaign-switch.mjs +32 -8
- package/dist/dashboard/card-order.js +6 -14
- package/dist/dashboard/card-order.mjs +6 -14
- package/dist/dashboard/card-section.js +69 -26
- package/dist/dashboard/card-section.mjs +65 -26
- package/dist/dashboard/card-shortcut.js +181 -0
- package/dist/dashboard/card-shortcut.mjs +152 -0
- package/dist/dashboard/card-tile.js +3 -35
- package/dist/dashboard/card-tile.mjs +3 -34
- package/dist/dashboard/document-blocks.js +305 -0
- package/dist/dashboard/document-blocks.mjs +270 -0
- package/dist/dashboard/drawer-subscription.js +52 -14
- package/dist/dashboard/drawer-subscription.mjs +52 -14
- package/dist/dashboard/drawer.js +20 -3
- package/dist/dashboard/drawer.mjs +21 -4
- package/dist/dashboard/dropdown.js +6 -2
- package/dist/dashboard/dropdown.mjs +6 -2
- package/dist/dashboard/form-admin-subscription-custom.js +72 -8
- package/dist/dashboard/form-admin-subscription-custom.mjs +72 -8
- package/dist/dashboard/form-ai.js +0 -148
- package/dist/dashboard/form-ai.mjs +1 -148
- package/dist/dashboard/form-filters-analytics.js +88 -37
- package/dist/dashboard/form-filters-analytics.mjs +85 -38
- package/dist/dashboard/form-organization-brand.js +30 -13
- package/dist/dashboard/form-organization-brand.mjs +30 -13
- package/dist/dashboard/form-organization-campaign-advertisement.js +38 -112
- package/dist/dashboard/form-organization-campaign-advertisement.mjs +38 -112
- package/dist/dashboard/form-organization-campaign-advertisements.js +374 -0
- package/dist/dashboard/form-organization-campaign-advertisements.mjs +345 -0
- package/dist/dashboard/form-organization-campaign-agreement.js +414 -210
- package/dist/dashboard/form-organization-campaign-agreement.mjs +411 -212
- package/dist/dashboard/form-organization-campaign-design.js +258 -0
- package/dist/dashboard/form-organization-campaign-design.mjs +223 -0
- package/dist/dashboard/form-organization-campaign-field-item.js +585 -0
- package/dist/dashboard/form-organization-campaign-field-item.mjs +552 -0
- package/dist/dashboard/form-organization-campaign-field-number.js +48 -7
- package/dist/dashboard/form-organization-campaign-field-number.mjs +48 -7
- package/dist/dashboard/form-organization-campaign-field-select.js +15 -4
- package/dist/dashboard/form-organization-campaign-field-select.mjs +15 -4
- package/dist/dashboard/form-organization-campaign-field-skill.js +359 -0
- package/dist/dashboard/form-organization-campaign-field-skill.mjs +330 -0
- package/dist/dashboard/form-organization-campaign-field-text.js +46 -6
- package/dist/dashboard/form-organization-campaign-field-text.mjs +46 -6
- package/dist/dashboard/form-organization-campaign-field-textarea.js +22 -13
- package/dist/dashboard/form-organization-campaign-field-textarea.mjs +22 -13
- package/dist/dashboard/form-organization-campaign-footer.js +178 -0
- package/dist/dashboard/form-organization-campaign-footer.mjs +149 -0
- package/dist/dashboard/form-organization-campaign-integration-age.js +2 -35
- package/dist/dashboard/form-organization-campaign-integration-age.mjs +2 -35
- package/dist/dashboard/form-organization-campaign-integration-geocode.js +4 -1
- package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +4 -1
- package/dist/dashboard/form-organization-campaign-page-embed.js +1 -1
- package/dist/dashboard/form-organization-campaign-page-embed.mjs +1 -1
- package/dist/dashboard/form-organization-campaign-page-preview.js +1 -2
- package/dist/dashboard/form-organization-campaign-page-preview.mjs +1 -2
- package/dist/dashboard/form-organization-campaign-page-qr.js +2 -2
- package/dist/dashboard/form-organization-campaign-page-qr.mjs +2 -2
- package/dist/dashboard/form-organization-campaign-page-share.js +5 -5
- package/dist/dashboard/form-organization-campaign-page-share.mjs +5 -5
- package/dist/dashboard/form-organization-campaign-page-slug.js +2 -3
- package/dist/dashboard/form-organization-campaign-page-slug.mjs +2 -3
- package/dist/dashboard/form-organization-campaign-page.js +168 -265
- package/dist/dashboard/form-organization-campaign-page.mjs +170 -266
- package/dist/dashboard/form-organization-campaign-section.js +125 -107
- package/dist/dashboard/form-organization-campaign-section.mjs +121 -107
- package/dist/dashboard/form-organization-campaign.js +119 -9
- package/dist/dashboard/form-organization-campaign.mjs +118 -9
- package/dist/dashboard/form-organization-file-frame.js +7 -1
- package/dist/dashboard/form-organization-file-frame.mjs +7 -1
- package/dist/dashboard/form-organization-workflow.js +589 -532
- package/dist/dashboard/form-organization-workflow.mjs +590 -533
- package/dist/dashboard/form-organization.js +22 -0
- package/dist/dashboard/form-organization.mjs +22 -0
- package/dist/dashboard/form-reposition.js +396 -0
- package/dist/dashboard/form-reposition.mjs +359 -0
- package/dist/dashboard/form-support.js +189 -0
- package/dist/dashboard/form-support.mjs +160 -0
- package/dist/dashboard/form-tests.js +683 -0
- package/dist/dashboard/form-tests.mjs +646 -0
- package/dist/dashboard/form-verify-prize.js +114 -34
- package/dist/dashboard/form-verify-prize.mjs +111 -34
- package/dist/dashboard/google.js +8 -1
- package/dist/dashboard/google.mjs +8 -1
- package/dist/dashboard/input-array.js +2 -0
- package/dist/dashboard/input-array.mjs +2 -0
- package/dist/dashboard/input-editor.js +17 -6
- package/dist/dashboard/input-editor.mjs +17 -6
- package/dist/dashboard/input-fields.js +287 -437
- package/dist/dashboard/input-fields.mjs +287 -436
- package/dist/dashboard/input-file.js +70 -2
- package/dist/dashboard/input-file.mjs +70 -2
- package/dist/dashboard/input-font.js +64 -55
- package/dist/dashboard/input-font.mjs +64 -55
- package/dist/dashboard/input-resource.js +4 -1
- package/dist/dashboard/input-resource.mjs +4 -1
- package/dist/dashboard/lib/ab-tests.js +130 -0
- package/dist/dashboard/lib/ab-tests.mjs +94 -0
- package/dist/dashboard/lib/features.js +1 -1
- package/dist/dashboard/lib/features.mjs +1 -1
- package/dist/dashboard/lib/focus.js +93 -0
- package/dist/dashboard/lib/focus.mjs +69 -0
- package/dist/dashboard/lib/form-page.js +203 -0
- package/dist/dashboard/lib/form-page.mjs +155 -0
- package/dist/dashboard/lib/item-list.js +0 -15
- package/dist/dashboard/lib/item-list.mjs +0 -14
- package/dist/dashboard/lib/rail.js +16 -17
- package/dist/dashboard/lib/rail.mjs +15 -16
- package/dist/dashboard/lib/sms.js +8 -2
- package/dist/dashboard/lib/sms.mjs +6 -1
- package/dist/dashboard/list-resource.js +2 -0
- package/dist/dashboard/list-resource.mjs +2 -0
- package/dist/dashboard/menu.js +54 -5
- package/dist/dashboard/menu.mjs +53 -5
- package/dist/dashboard/modal.js +19 -4
- package/dist/dashboard/modal.mjs +20 -5
- package/dist/dashboard/order-sections.js +4 -0
- package/dist/dashboard/order-sections.mjs +4 -0
- package/dist/dashboard/preview.js +838 -324
- package/dist/dashboard/preview.mjs +826 -324
- package/dist/dashboard/provider-ui.js +20 -12
- package/dist/dashboard/provider-ui.mjs +21 -13
- package/dist/dashboard/recharts.js +53 -28
- package/dist/dashboard/recharts.mjs +53 -28
- package/dist/dashboard/swatch.js +35 -0
- package/dist/dashboard/swatch.mjs +31 -0
- package/dist/dashboard/table-contacts.js +6 -10
- package/dist/dashboard/table-contacts.mjs +6 -10
- package/dist/dashboard/table.js +10 -3
- package/dist/dashboard/table.mjs +9 -3
- package/dist/dashboard/template-dashboard.js +12 -7
- package/dist/dashboard/template-dashboard.mjs +11 -7
- package/dist/dashboard/template-design.js +564 -0
- package/dist/dashboard/template-design.mjs +531 -0
- package/dist/dashboard/template-rail.js +198 -126
- package/dist/dashboard/template-rail.mjs +196 -125
- package/dist/dashboard/template-socket.js +0 -3
- package/dist/dashboard/template-socket.mjs +0 -3
- package/dist/dashboard/template-test-page.js +436 -0
- package/dist/dashboard/template-test-page.mjs +407 -0
- package/dist/dashboard/template-tests.js +141 -0
- package/dist/dashboard/template-tests.mjs +112 -0
- package/dist/dashboard/template-ui.js +20 -11
- package/dist/dashboard/template-ui.mjs +22 -13
- package/dist/dashboard/template-variant.js +185 -0
- package/dist/dashboard/template-variant.mjs +156 -0
- package/dist/icons/arrow-down-long.js +47 -0
- package/dist/icons/arrow-down-long.mjs +28 -0
- package/dist/icons/arrows-pointing-out.js +46 -0
- package/dist/icons/arrows-pointing-out.mjs +27 -0
- package/dist/icons/beaker.js +46 -0
- package/dist/icons/beaker.mjs +27 -0
- package/dist/icons/identification.js +46 -0
- package/dist/icons/identification.mjs +27 -0
- package/dist/icons/lifebuoy.js +46 -0
- package/dist/icons/lifebuoy.mjs +27 -0
- package/dist/icons/rectangle-group.js +46 -0
- package/dist/icons/rectangle-group.mjs +27 -0
- package/dist/icons/rectangle-stack.js +46 -0
- package/dist/icons/rectangle-stack.mjs +27 -0
- package/dist/icons/shopping-bag.js +46 -0
- package/dist/icons/shopping-bag.mjs +27 -0
- package/dist/icons/swatch.js +46 -0
- package/dist/icons/swatch.mjs +27 -0
- package/dist/icons/window.js +46 -0
- package/dist/icons/window.mjs +27 -0
- package/dist/icons/zoom-in.js +46 -0
- package/dist/icons/zoom-in.mjs +27 -0
- package/dist/input-answer.js +60 -0
- package/dist/input-answer.mjs +27 -0
- package/dist/input-checkbox.js +7 -1
- package/dist/input-checkbox.mjs +7 -1
- package/dist/input-name.js +3 -3
- package/dist/input-name.mjs +3 -3
- package/dist/input-select.js +3 -1
- package/dist/input-select.mjs +3 -1
- package/dist/provider-font.js +4 -3
- package/dist/provider-font.mjs +4 -3
- package/dist/shared/badge.js +15 -0
- package/dist/shared/badge.mjs +11 -0
- package/dist/shared/carousel.js +11 -7
- package/dist/shared/carousel.mjs +11 -7
- package/dist/shared/document-pieces.js +295 -0
- package/dist/shared/document-pieces.mjs +260 -0
- package/dist/shared/lib/campaign.js +3 -9
- package/dist/shared/lib/campaign.mjs +3 -9
- package/dist/shared/lib/helpers.js +24 -0
- package/dist/shared/lib/helpers.mjs +22 -0
- package/dist/shared/lib/video.js +6 -0
- package/dist/shared/lib/video.mjs +5 -0
- package/dist/shared/sortable.js +27 -10
- package/dist/shared/sortable.mjs +27 -10
- package/dist/shared/tabs.js +1 -1
- package/dist/shared/tabs.mjs +1 -1
- package/dist/video.js +127 -9
- package/dist/video.mjs +125 -11
- package/package.json +176 -20
- package/types/bridge/fields.d.ts +6 -1
- package/types/bridge/form-subdomain-agreement.d.ts +27 -0
- package/types/bridge/form-subdomain-missions.d.ts +2 -0
- package/types/bridge/form-subdomain.d.ts +62 -3
- package/types/bridge/lib/entry.d.ts +44 -7
- package/types/bridge/lib/order.d.ts +13 -2
- package/types/bridge/subdomain-content.d.ts +1 -0
- package/types/bridge/template-subdomain-gallery.d.ts +13 -1
- package/types/dashboard/campaign-form.d.ts +42 -0
- package/types/dashboard/card-campaign-agreement.d.ts +26 -0
- package/types/dashboard/card-campaign-switch.d.ts +20 -1
- package/types/dashboard/card-order.d.ts +2 -2
- package/types/dashboard/card-section.d.ts +9 -1
- package/types/dashboard/card-shortcut.d.ts +38 -0
- package/types/dashboard/card-tile.d.ts +4 -9
- package/types/dashboard/document-blocks.d.ts +14 -0
- package/types/dashboard/drawer.d.ts +3 -0
- package/types/dashboard/form-ai.d.ts +0 -17
- package/types/dashboard/form-organization-brand.d.ts +3 -0
- package/types/dashboard/form-organization-campaign-advertisements.d.ts +15 -0
- package/types/dashboard/form-organization-campaign-agreement.d.ts +53 -10
- package/types/dashboard/form-organization-campaign-design.d.ts +46 -0
- package/types/dashboard/form-organization-campaign-field-item.d.ts +36 -0
- package/types/dashboard/form-organization-campaign-field-number.d.ts +4 -1
- package/types/dashboard/form-organization-campaign-field-select.d.ts +6 -1
- package/types/dashboard/form-organization-campaign-field-skill.d.ts +36 -0
- package/types/dashboard/form-organization-campaign-field-text.d.ts +5 -1
- package/types/dashboard/form-organization-campaign-field-textarea.d.ts +4 -1
- package/types/dashboard/form-organization-campaign-footer.d.ts +23 -0
- package/types/dashboard/form-organization-campaign-integration-age.d.ts +2 -1
- package/types/dashboard/form-organization-campaign-integration-geocode.d.ts +2 -0
- package/types/dashboard/form-organization-campaign-page.d.ts +9 -15
- package/types/dashboard/form-organization-campaign-section.d.ts +24 -8
- package/types/dashboard/form-organization-campaign.d.ts +3 -0
- package/types/dashboard/form-organization-workflow.d.ts +3 -0
- package/types/dashboard/form-organization.d.ts +2 -2
- package/types/dashboard/form-reposition.d.ts +29 -0
- package/types/dashboard/form-support.d.ts +14 -0
- package/types/dashboard/form-tests.d.ts +78 -0
- package/types/dashboard/form-verify-prize.d.ts +30 -3
- package/types/dashboard/input-editor.d.ts +9 -0
- package/types/dashboard/input-fields.d.ts +8 -5
- package/types/dashboard/input-file.d.ts +4 -0
- package/types/dashboard/input-resource.d.ts +1 -0
- package/types/dashboard/lib/ab-tests.d.ts +50 -0
- package/types/dashboard/lib/escape.d.ts +4 -0
- package/types/dashboard/lib/focus.d.ts +16 -0
- package/types/dashboard/lib/form-page.d.ts +25 -0
- package/types/dashboard/lib/item-list.d.ts +10 -5
- package/types/dashboard/lib/rail.d.ts +0 -1
- package/types/dashboard/lib/sms.d.ts +7 -0
- package/types/dashboard/modal.d.ts +3 -1
- package/types/dashboard/preview.d.ts +65 -10
- package/types/dashboard/recharts.d.ts +3 -0
- package/types/dashboard/swatch.d.ts +4 -0
- package/types/dashboard/template-dashboard.d.ts +3 -0
- package/types/dashboard/template-design.d.ts +30 -0
- package/types/dashboard/template-test-page.d.ts +69 -0
- package/types/dashboard/template-tests.d.ts +30 -0
- package/types/dashboard/template-variant.d.ts +18 -0
- package/types/icons/arrow-down-long.d.ts +5 -0
- package/types/icons/arrows-pointing-out.d.ts +5 -0
- package/types/icons/beaker.d.ts +5 -0
- package/types/icons/identification.d.ts +5 -0
- package/types/icons/lifebuoy.d.ts +5 -0
- package/types/icons/rectangle-group.d.ts +5 -0
- package/types/icons/rectangle-stack.d.ts +5 -0
- package/types/icons/shopping-bag.d.ts +5 -0
- package/types/icons/swatch.d.ts +5 -0
- package/types/icons/window.d.ts +5 -0
- package/types/icons/zoom-in.d.ts +5 -0
- package/types/input-answer.d.ts +15 -0
- package/types/input-select.d.ts +2 -0
- package/types/shared/button.d.ts +1 -1
- package/types/shared/document-pieces.d.ts +34 -0
- package/types/shared/lib/helpers.d.ts +22 -1
- package/types/shared/lib/motion.d.ts +2 -0
- package/types/shared/lib/video.d.ts +3 -0
- package/types/shared/sortable.d.ts +6 -0
- package/types/video.d.ts +18 -2
- package/dist/bridge/template-preview.js +0 -208
- package/dist/bridge/template-preview.mjs +0 -173
- package/dist/dashboard/device.js +0 -95
- package/dist/dashboard/device.mjs +0 -72
- package/dist/dashboard/form-organization-campaign-field-list.js +0 -425
- package/dist/dashboard/form-organization-campaign-field-list.mjs +0 -396
- package/dist/dashboard/item-row.js +0 -92
- package/dist/dashboard/item-row.mjs +0 -63
- package/types/bridge/template-preview.d.ts +0 -10
- package/types/dashboard/device.d.ts +0 -12
- package/types/dashboard/form-organization-campaign-field-list.d.ts +0 -36
- package/types/dashboard/item-row.d.ts +0 -25
package/dist/bridge/lib/entry.js
CHANGED
|
@@ -17,14 +17,23 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
var entry_exports = {};
|
|
19
19
|
__export(entry_exports, {
|
|
20
|
+
AFTER: () => AFTER,
|
|
21
|
+
afterOrder: () => afterOrder,
|
|
22
|
+
agreementContent: () => agreementContent,
|
|
23
|
+
agreementShown: () => agreementShown,
|
|
24
|
+
agreementTitles: () => agreementTitles,
|
|
20
25
|
agreementWording: () => agreementWording,
|
|
26
|
+
asksForPhone: () => asksForPhone,
|
|
21
27
|
awardingOn: () => awardingOn,
|
|
28
|
+
buttonState: () => buttonState,
|
|
22
29
|
buttonText: () => buttonText,
|
|
23
30
|
copy: () => copy,
|
|
24
31
|
formOn: () => formOn,
|
|
25
32
|
giveawayOn: () => giveawayOn,
|
|
33
|
+
menuAgreements: () => menuAgreements,
|
|
26
34
|
panelMissions: () => panelMissions,
|
|
27
|
-
|
|
35
|
+
termsOptOut: () => termsOptOut,
|
|
36
|
+
withLocale: () => withLocale
|
|
28
37
|
});
|
|
29
38
|
module.exports = __toCommonJS(entry_exports);
|
|
30
39
|
var import_drawbridge_utils = require("@drawbridge/drawbridge-utils");
|
|
@@ -37,23 +46,69 @@ const agreementWording = {
|
|
|
37
46
|
// The default wording carrier reviewers look for: explicit texts, rates, and STOP.
|
|
38
47
|
sms: "I agree to receive text messages about this campaign. Message and data rates may apply. Reply STOP to opt out."
|
|
39
48
|
};
|
|
40
|
-
const
|
|
49
|
+
const buttonState = (data, open) => !open ? "inactive" : (data == null ? void 0 : data.awarding) === false ? "button" : "active";
|
|
50
|
+
const buttonText = (data, open) => copy(data, buttonState(data, open));
|
|
41
51
|
const formOn = (data) => (data == null ? void 0 : data.form) !== false;
|
|
42
52
|
const giveawayOn = (data) => (data == null ? void 0 : data.giveaway) !== false;
|
|
43
53
|
const awardingOn = (data) => giveawayOn(data) && (data == null ? void 0 : data.awarding) !== false;
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
54
|
+
const AFTER = ["message", "missions", "advertisements"];
|
|
55
|
+
const afterOrder = (data) => {
|
|
56
|
+
var _a;
|
|
57
|
+
const order = (data == null ? void 0 : data.after) || ((_a = data == null ? void 0 : data.form) == null ? void 0 : _a.after);
|
|
58
|
+
return Array.isArray(order) && order.length > 0 ? order : AFTER;
|
|
47
59
|
};
|
|
48
60
|
const panelMissions = (missions = [], repeat = false) => repeat ? (missions || []).filter((item) => (item == null ? void 0 : item.type) !== "form") : missions;
|
|
61
|
+
const agreementTitles = {
|
|
62
|
+
terms: "Terms and conditions",
|
|
63
|
+
privacy: "Privacy",
|
|
64
|
+
marketing: "Marketing terms",
|
|
65
|
+
sms: "SMS terms"
|
|
66
|
+
};
|
|
67
|
+
const agreementContent = (agreement) => {
|
|
68
|
+
if ((agreement == null ? void 0 : agreement.confirmed) === false) return null;
|
|
69
|
+
const type = (agreement == null ? void 0 : agreement.type) || ((agreement == null ? void 0 : agreement.link) ? "link" : "document");
|
|
70
|
+
if (type === "link") return (agreement == null ? void 0 : agreement.link) ? "link" : null;
|
|
71
|
+
return (agreement == null ? void 0 : agreement.document) ? "document" : null;
|
|
72
|
+
};
|
|
73
|
+
const agreementShown = (agreement) => (agreement == null ? void 0 : agreement.confirmed) !== false && (Boolean(agreementContent(agreement)) || (agreement == null ? void 0 : agreement.type) === "link" && Boolean(agreement == null ? void 0 : agreement.confirmed));
|
|
74
|
+
const asksForPhone = (fields) => [
|
|
75
|
+
...((fields == null ? void 0 : fields.sections) || []).flatMap((section) => (section == null ? void 0 : section.fields) || []),
|
|
76
|
+
...(fields == null ? void 0 : fields.lead) || [],
|
|
77
|
+
...(fields == null ? void 0 : fields.additional) || []
|
|
78
|
+
].some((field) => (field == null ? void 0 : field.slug) === "phone");
|
|
79
|
+
const menuAgreements = (data) => Object.keys(agreementTitles).filter((id) => {
|
|
80
|
+
var _a;
|
|
81
|
+
const agreement = (_a = data == null ? void 0 : data.agreements) == null ? void 0 : _a[id];
|
|
82
|
+
if (id === "sms" && (data == null ? void 0 : data.sms) === false) return false;
|
|
83
|
+
return Boolean(agreementContent(agreement)) && Boolean(agreement == null ? void 0 : agreement.enabled) && (id !== "sms" || asksForPhone(data == null ? void 0 : data.fields));
|
|
84
|
+
});
|
|
85
|
+
const withLocale = (agreements = {}, locale = {}) => Object.fromEntries(
|
|
86
|
+
[.../* @__PURE__ */ new Set([...Object.keys(agreements || {}), ...Object.keys(locale || {})])].map((id) => [
|
|
87
|
+
id,
|
|
88
|
+
{
|
|
89
|
+
...agreements == null ? void 0 : agreements[id],
|
|
90
|
+
...locale == null ? void 0 : locale[id]
|
|
91
|
+
}
|
|
92
|
+
])
|
|
93
|
+
);
|
|
94
|
+
const termsOptOut = ({ giveaway, sms } = {}) => giveaway === false ? null : "If you unsubscribe" + (sms !== false ? " or reply STOP" : "") + ", you can't win and won't be told you were selected.";
|
|
49
95
|
// Annotate the CommonJS export names for ESM import in node:
|
|
50
96
|
0 && (module.exports = {
|
|
97
|
+
AFTER,
|
|
98
|
+
afterOrder,
|
|
99
|
+
agreementContent,
|
|
100
|
+
agreementShown,
|
|
101
|
+
agreementTitles,
|
|
51
102
|
agreementWording,
|
|
103
|
+
asksForPhone,
|
|
52
104
|
awardingOn,
|
|
105
|
+
buttonState,
|
|
53
106
|
buttonText,
|
|
54
107
|
copy,
|
|
55
108
|
formOn,
|
|
56
109
|
giveawayOn,
|
|
110
|
+
menuAgreements,
|
|
57
111
|
panelMissions,
|
|
58
|
-
|
|
112
|
+
termsOptOut,
|
|
113
|
+
withLocale
|
|
59
114
|
});
|
|
@@ -8,22 +8,68 @@ const agreementWording = {
|
|
|
8
8
|
// The default wording carrier reviewers look for: explicit texts, rates, and STOP.
|
|
9
9
|
sms: "I agree to receive text messages about this campaign. Message and data rates may apply. Reply STOP to opt out."
|
|
10
10
|
};
|
|
11
|
-
const
|
|
11
|
+
const buttonState = (data, open) => !open ? "inactive" : (data == null ? void 0 : data.awarding) === false ? "button" : "active";
|
|
12
|
+
const buttonText = (data, open) => copy(data, buttonState(data, open));
|
|
12
13
|
const formOn = (data) => (data == null ? void 0 : data.form) !== false;
|
|
13
14
|
const giveawayOn = (data) => (data == null ? void 0 : data.giveaway) !== false;
|
|
14
15
|
const awardingOn = (data) => giveawayOn(data) && (data == null ? void 0 : data.awarding) !== false;
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const AFTER = ["message", "missions", "advertisements"];
|
|
17
|
+
const afterOrder = (data) => {
|
|
18
|
+
var _a;
|
|
19
|
+
const order = (data == null ? void 0 : data.after) || ((_a = data == null ? void 0 : data.form) == null ? void 0 : _a.after);
|
|
20
|
+
return Array.isArray(order) && order.length > 0 ? order : AFTER;
|
|
18
21
|
};
|
|
19
22
|
const panelMissions = (missions = [], repeat = false) => repeat ? (missions || []).filter((item) => (item == null ? void 0 : item.type) !== "form") : missions;
|
|
23
|
+
const agreementTitles = {
|
|
24
|
+
terms: "Terms and conditions",
|
|
25
|
+
privacy: "Privacy",
|
|
26
|
+
marketing: "Marketing terms",
|
|
27
|
+
sms: "SMS terms"
|
|
28
|
+
};
|
|
29
|
+
const agreementContent = (agreement) => {
|
|
30
|
+
if ((agreement == null ? void 0 : agreement.confirmed) === false) return null;
|
|
31
|
+
const type = (agreement == null ? void 0 : agreement.type) || ((agreement == null ? void 0 : agreement.link) ? "link" : "document");
|
|
32
|
+
if (type === "link") return (agreement == null ? void 0 : agreement.link) ? "link" : null;
|
|
33
|
+
return (agreement == null ? void 0 : agreement.document) ? "document" : null;
|
|
34
|
+
};
|
|
35
|
+
const agreementShown = (agreement) => (agreement == null ? void 0 : agreement.confirmed) !== false && (Boolean(agreementContent(agreement)) || (agreement == null ? void 0 : agreement.type) === "link" && Boolean(agreement == null ? void 0 : agreement.confirmed));
|
|
36
|
+
const asksForPhone = (fields) => [
|
|
37
|
+
...((fields == null ? void 0 : fields.sections) || []).flatMap((section) => (section == null ? void 0 : section.fields) || []),
|
|
38
|
+
...(fields == null ? void 0 : fields.lead) || [],
|
|
39
|
+
...(fields == null ? void 0 : fields.additional) || []
|
|
40
|
+
].some((field) => (field == null ? void 0 : field.slug) === "phone");
|
|
41
|
+
const menuAgreements = (data) => Object.keys(agreementTitles).filter((id) => {
|
|
42
|
+
var _a;
|
|
43
|
+
const agreement = (_a = data == null ? void 0 : data.agreements) == null ? void 0 : _a[id];
|
|
44
|
+
if (id === "sms" && (data == null ? void 0 : data.sms) === false) return false;
|
|
45
|
+
return Boolean(agreementContent(agreement)) && Boolean(agreement == null ? void 0 : agreement.enabled) && (id !== "sms" || asksForPhone(data == null ? void 0 : data.fields));
|
|
46
|
+
});
|
|
47
|
+
const withLocale = (agreements = {}, locale = {}) => Object.fromEntries(
|
|
48
|
+
[.../* @__PURE__ */ new Set([...Object.keys(agreements || {}), ...Object.keys(locale || {})])].map((id) => [
|
|
49
|
+
id,
|
|
50
|
+
{
|
|
51
|
+
...agreements == null ? void 0 : agreements[id],
|
|
52
|
+
...locale == null ? void 0 : locale[id]
|
|
53
|
+
}
|
|
54
|
+
])
|
|
55
|
+
);
|
|
56
|
+
const termsOptOut = ({ giveaway, sms } = {}) => giveaway === false ? null : "If you unsubscribe" + (sms !== false ? " or reply STOP" : "") + ", you can't win and won't be told you were selected.";
|
|
20
57
|
export {
|
|
58
|
+
AFTER,
|
|
59
|
+
afterOrder,
|
|
60
|
+
agreementContent,
|
|
61
|
+
agreementShown,
|
|
62
|
+
agreementTitles,
|
|
21
63
|
agreementWording,
|
|
64
|
+
asksForPhone,
|
|
22
65
|
awardingOn,
|
|
66
|
+
buttonState,
|
|
23
67
|
buttonText,
|
|
24
68
|
copy,
|
|
25
69
|
formOn,
|
|
26
70
|
giveawayOn,
|
|
71
|
+
menuAgreements,
|
|
27
72
|
panelMissions,
|
|
28
|
-
|
|
73
|
+
termsOptOut,
|
|
74
|
+
withLocale
|
|
29
75
|
};
|
package/dist/bridge/lib/order.js
CHANGED
|
@@ -19,8 +19,11 @@ var order_exports = {};
|
|
|
19
19
|
__export(order_exports, {
|
|
20
20
|
isLastList: () => isLastList,
|
|
21
21
|
itemCount: () => itemCount,
|
|
22
|
+
itemRuns: () => itemRuns,
|
|
22
23
|
limitMessage: () => limitMessage,
|
|
23
24
|
orderTotal: () => orderTotal,
|
|
25
|
+
priced: () => priced,
|
|
26
|
+
refusedSection: () => refusedSection,
|
|
24
27
|
sectionsOf: () => sectionsOf
|
|
25
28
|
});
|
|
26
29
|
module.exports = __toCommonJS(order_exports);
|
|
@@ -47,6 +50,22 @@ const lines = (fields, answers = {}) => lists(fields).flatMap((field) => {
|
|
|
47
50
|
};
|
|
48
51
|
});
|
|
49
52
|
});
|
|
53
|
+
const priced = (fields) => lines(fields).some(({ item }) => typeof (item == null ? void 0 : item.price) === "number");
|
|
54
|
+
const itemRuns = (fields = []) => fields.reduce((runs, field) => {
|
|
55
|
+
var _a;
|
|
56
|
+
const single = (field == null ? void 0 : field.slug) === "list" && (((_a = field == null ? void 0 : field.settings) == null ? void 0 : _a.items) || []).length === 1;
|
|
57
|
+
const previous = runs.at(-1);
|
|
58
|
+
if (single && (previous == null ? void 0 : previous.single)) {
|
|
59
|
+
previous.fields.push(field);
|
|
60
|
+
} else {
|
|
61
|
+
runs.push({
|
|
62
|
+
fields: [field],
|
|
63
|
+
single
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
;
|
|
67
|
+
return runs;
|
|
68
|
+
}, []);
|
|
50
69
|
const orderTotal = (fields, answers) => Math.round(lines(fields, answers).reduce(
|
|
51
70
|
(sum, { item, quantity }) => sum + (typeof (item == null ? void 0 : item.price) === "number" ? item.price * quantity : 0),
|
|
52
71
|
0
|
|
@@ -61,11 +80,15 @@ const limitMessage = (item, quantity) => {
|
|
|
61
80
|
const max = (_a = item == null ? void 0 : item.attributes) == null ? void 0 : _a.max;
|
|
62
81
|
return max && Number(quantity) >= max ? import_fields_validate.errors.limit(max) : null;
|
|
63
82
|
};
|
|
83
|
+
const refusedSection = (sections = [], refused = {}) => sections.findIndex((section) => ((section == null ? void 0 : section.fields) || []).some((field) => Boolean(refused == null ? void 0 : refused[field == null ? void 0 : field.id])));
|
|
64
84
|
// Annotate the CommonJS export names for ESM import in node:
|
|
65
85
|
0 && (module.exports = {
|
|
66
86
|
isLastList,
|
|
67
87
|
itemCount,
|
|
88
|
+
itemRuns,
|
|
68
89
|
limitMessage,
|
|
69
90
|
orderTotal,
|
|
91
|
+
priced,
|
|
92
|
+
refusedSection,
|
|
70
93
|
sectionsOf
|
|
71
94
|
});
|
|
@@ -21,6 +21,22 @@ const lines = (fields, answers = {}) => lists(fields).flatMap((field) => {
|
|
|
21
21
|
};
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
|
+
const priced = (fields) => lines(fields).some(({ item }) => typeof (item == null ? void 0 : item.price) === "number");
|
|
25
|
+
const itemRuns = (fields = []) => fields.reduce((runs, field) => {
|
|
26
|
+
var _a;
|
|
27
|
+
const single = (field == null ? void 0 : field.slug) === "list" && (((_a = field == null ? void 0 : field.settings) == null ? void 0 : _a.items) || []).length === 1;
|
|
28
|
+
const previous = runs.at(-1);
|
|
29
|
+
if (single && (previous == null ? void 0 : previous.single)) {
|
|
30
|
+
previous.fields.push(field);
|
|
31
|
+
} else {
|
|
32
|
+
runs.push({
|
|
33
|
+
fields: [field],
|
|
34
|
+
single
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
;
|
|
38
|
+
return runs;
|
|
39
|
+
}, []);
|
|
24
40
|
const orderTotal = (fields, answers) => Math.round(lines(fields, answers).reduce(
|
|
25
41
|
(sum, { item, quantity }) => sum + (typeof (item == null ? void 0 : item.price) === "number" ? item.price * quantity : 0),
|
|
26
42
|
0
|
|
@@ -35,10 +51,14 @@ const limitMessage = (item, quantity) => {
|
|
|
35
51
|
const max = (_a = item == null ? void 0 : item.attributes) == null ? void 0 : _a.max;
|
|
36
52
|
return max && Number(quantity) >= max ? errors.limit(max) : null;
|
|
37
53
|
};
|
|
54
|
+
const refusedSection = (sections = [], refused = {}) => sections.findIndex((section) => ((section == null ? void 0 : section.fields) || []).some((field) => Boolean(refused == null ? void 0 : refused[field == null ? void 0 : field.id])));
|
|
38
55
|
export {
|
|
39
56
|
isLastList,
|
|
40
57
|
itemCount,
|
|
58
|
+
itemRuns,
|
|
41
59
|
limitMessage,
|
|
42
60
|
orderTotal,
|
|
61
|
+
priced,
|
|
62
|
+
refusedSection,
|
|
43
63
|
sectionsOf
|
|
44
64
|
};
|
|
@@ -80,9 +80,11 @@ const TemplateLayout = ({
|
|
|
80
80
|
const [panel, setPanel] = (0, import_react.useState)(submissionId ? {
|
|
81
81
|
name: "submission",
|
|
82
82
|
data: {
|
|
83
|
+
// @story public-entry/submit
|
|
84
|
+
// The deep link's panel: the organizer's order, no title ( Pistachio ).
|
|
85
|
+
after: (0, import_entry.afterOrder)(result),
|
|
83
86
|
giveaway: (0, import_entry.awardingOn)(result),
|
|
84
87
|
id: submissionId,
|
|
85
|
-
title: "Keep going",
|
|
86
88
|
preview,
|
|
87
89
|
style,
|
|
88
90
|
...params
|
|
@@ -372,11 +374,12 @@ const TemplateLayout = ({
|
|
|
372
374
|
[iframeMessageResponse, preview, tracking, (_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb, (_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb, userAgent]
|
|
373
375
|
);
|
|
374
376
|
const submission = (0, import_react.useCallback)(
|
|
375
|
-
({ id, lead, message, panel: answer, repeat, title }) => {
|
|
377
|
+
({ after, id, lead, message, panel: answer, repeat, title }) => {
|
|
376
378
|
setPanel({
|
|
377
379
|
name: "submission",
|
|
378
380
|
data: {
|
|
379
381
|
affiliate,
|
|
382
|
+
after,
|
|
380
383
|
giveaway: (0, import_entry.awardingOn)(data),
|
|
381
384
|
id,
|
|
382
385
|
lead,
|
|
@@ -17,7 +17,7 @@ import { request } from "@drawbridge/drawbridge-utils/fetch";
|
|
|
17
17
|
import constants from "./lib/constants.mjs";
|
|
18
18
|
import { checkout as checkoutKit, ensureCheckoutKit } from "./lib/checkout-kit.mjs";
|
|
19
19
|
import { useTracking } from "./provider-analytics.mjs";
|
|
20
|
-
import { awardingOn, buttonText, copy, formOn } from "./lib/entry.mjs";
|
|
20
|
+
import { afterOrder, awardingOn, buttonText, copy, formOn } from "./lib/entry.mjs";
|
|
21
21
|
import { leadEndpoint } from "./lib/url.mjs";
|
|
22
22
|
const TemplateModal = dynamic(() => import("./template-modal.mjs"), { ssr: false });
|
|
23
23
|
const TemplateLayout = ({
|
|
@@ -48,9 +48,11 @@ const TemplateLayout = ({
|
|
|
48
48
|
const [panel, setPanel] = useState(submissionId ? {
|
|
49
49
|
name: "submission",
|
|
50
50
|
data: {
|
|
51
|
+
// @story public-entry/submit
|
|
52
|
+
// The deep link's panel: the organizer's order, no title ( Pistachio ).
|
|
53
|
+
after: afterOrder(result),
|
|
51
54
|
giveaway: awardingOn(result),
|
|
52
55
|
id: submissionId,
|
|
53
|
-
title: "Keep going",
|
|
54
56
|
preview,
|
|
55
57
|
style,
|
|
56
58
|
...params
|
|
@@ -340,11 +342,12 @@ const TemplateLayout = ({
|
|
|
340
342
|
[iframeMessageResponse, preview, tracking, (_b = (_a = style == null ? void 0 : style.background) == null ? void 0 : _a.color) == null ? void 0 : _b.rgb, (_d = (_c = style == null ? void 0 : style.text) == null ? void 0 : _c.color) == null ? void 0 : _d.rgb, userAgent]
|
|
341
343
|
);
|
|
342
344
|
const submission = useCallback(
|
|
343
|
-
({ id, lead, message, panel: answer, repeat, title }) => {
|
|
345
|
+
({ after, id, lead, message, panel: answer, repeat, title }) => {
|
|
344
346
|
setPanel({
|
|
345
347
|
name: "submission",
|
|
346
348
|
data: {
|
|
347
349
|
affiliate,
|
|
350
|
+
after,
|
|
348
351
|
giveaway: awardingOn(data),
|
|
349
352
|
id,
|
|
350
353
|
lead,
|
|
@@ -35,6 +35,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
35
35
|
var import_react = require("react");
|
|
36
36
|
var import_react2 = require("@headlessui/react");
|
|
37
37
|
var import_form_subdomain = __toESM(require("./form-subdomain"));
|
|
38
|
+
var import_form_subdomain_agreement = __toESM(require("./form-subdomain-agreement"));
|
|
38
39
|
var import_form_subdomain_header = __toESM(require("./form-subdomain-header"));
|
|
39
40
|
var import_form_subdomain_issue = __toESM(require("./form-subdomain-issue"));
|
|
40
41
|
var import_form_subdomain_prize = __toESM(require("./form-subdomain-prize"));
|
|
@@ -75,7 +76,7 @@ const TemplateModal = ({
|
|
|
75
76
|
var _a, _b, _c, _d, _e, _f;
|
|
76
77
|
const renderPanel = (0, import_react.useCallback)(
|
|
77
78
|
() => {
|
|
78
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
79
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
79
80
|
const agreements = (data == null ? void 0 : data.agreements) || {};
|
|
80
81
|
switch (panel == null ? void 0 : panel.name) {
|
|
81
82
|
case "cart":
|
|
@@ -108,6 +109,7 @@ const TemplateModal = ({
|
|
|
108
109
|
...{
|
|
109
110
|
agreements,
|
|
110
111
|
button: buttons.close("enter"),
|
|
112
|
+
documents: data == null ? void 0 : data.documents,
|
|
111
113
|
onCheckout: openCheckout,
|
|
112
114
|
onError: ({ message }) => setPanel({
|
|
113
115
|
name: "error",
|
|
@@ -118,24 +120,27 @@ const TemplateModal = ({
|
|
|
118
120
|
onSuccess: ({ created, message, result }) => {
|
|
119
121
|
var _a3;
|
|
120
122
|
return submission({
|
|
123
|
+
// @story public-entry/submit
|
|
124
|
+
// The panel's parts in the organizer's order; it has no title (Pistachio).
|
|
125
|
+
after: (0, import_entry.afterOrder)(data),
|
|
121
126
|
id: (_a3 = result == null ? void 0 : result.submission) == null ? void 0 : _a3.id,
|
|
122
127
|
message: message || (0, import_entry.copy)(data, "confirmation"),
|
|
123
128
|
// @story public-entry/submit
|
|
124
129
|
// The panel's ads and missions ride on the answer: nothing more to ask.
|
|
125
130
|
panel: result == null ? void 0 : result.panel,
|
|
126
131
|
// The api answers a submitter at the limit with created false.
|
|
127
|
-
repeat: created === false
|
|
128
|
-
// @story public-entry/submit
|
|
129
|
-
title: (0, import_entry.panelTitle)(data)
|
|
132
|
+
repeat: created === false
|
|
130
133
|
});
|
|
131
134
|
},
|
|
132
135
|
disabled: !preview && !(data == null ? void 0 : data.valid),
|
|
133
136
|
fields: data == null ? void 0 : data.fields,
|
|
137
|
+
giveaway: (0, import_entry.giveawayOn)(data),
|
|
134
138
|
integrations: data == null ? void 0 : data.integrations,
|
|
135
139
|
params,
|
|
136
140
|
sms: data == null ? void 0 : data.sms,
|
|
137
141
|
preview,
|
|
138
142
|
style,
|
|
143
|
+
submit: (0, import_entry.copy)(data, "submit"),
|
|
139
144
|
tracking
|
|
140
145
|
}
|
|
141
146
|
}
|
|
@@ -223,6 +228,50 @@ const TemplateModal = ({
|
|
|
223
228
|
}
|
|
224
229
|
}
|
|
225
230
|
),
|
|
231
|
+
(0, import_entry.menuAgreements)(data).map(
|
|
232
|
+
(id) => {
|
|
233
|
+
var _a3, _b3, _c3;
|
|
234
|
+
return ((_a3 = agreements[id]) == null ? void 0 : _a3.type) === "link" || !((_b3 = agreements[id]) == null ? void 0 : _b3.type) && ((_c3 = agreements[id]) == null ? void 0 : _c3.link) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
235
|
+
import_template_subdomain_link.default,
|
|
236
|
+
{
|
|
237
|
+
...{
|
|
238
|
+
disabled: iframe,
|
|
239
|
+
element: "a",
|
|
240
|
+
href: agreements[id].link,
|
|
241
|
+
onClick: () => tracking.track({
|
|
242
|
+
name: "link-agreement-" + id
|
|
243
|
+
}),
|
|
244
|
+
rel: "noopener noreferrer",
|
|
245
|
+
svg: import_arrow_right.default,
|
|
246
|
+
target: "_blank",
|
|
247
|
+
text: import_entry.agreementTitles[id]
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
id
|
|
251
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
252
|
+
import_template_subdomain_link.default,
|
|
253
|
+
{
|
|
254
|
+
...{
|
|
255
|
+
disabled: iframe,
|
|
256
|
+
onClick: () => {
|
|
257
|
+
setPanel({
|
|
258
|
+
name: "agreement",
|
|
259
|
+
data: {
|
|
260
|
+
id
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
tracking.track({
|
|
264
|
+
name: "link-agreement-" + id
|
|
265
|
+
});
|
|
266
|
+
},
|
|
267
|
+
svg: import_arrow_right.default,
|
|
268
|
+
text: import_entry.agreementTitles[id]
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
id
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
),
|
|
226
275
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
227
276
|
import_template_subdomain_link.default,
|
|
228
277
|
{
|
|
@@ -246,6 +295,24 @@ const TemplateModal = ({
|
|
|
246
295
|
}
|
|
247
296
|
)
|
|
248
297
|
] });
|
|
298
|
+
// @story public-entry/read-agreement
|
|
299
|
+
// An agreement's document opened from the menu, with Back to the menu.
|
|
300
|
+
case "agreement":
|
|
301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
302
|
+
import_form_subdomain_agreement.default,
|
|
303
|
+
{
|
|
304
|
+
...{
|
|
305
|
+
agreement: agreements == null ? void 0 : agreements[(_f2 = panel == null ? void 0 : panel.data) == null ? void 0 : _f2.id],
|
|
306
|
+
back: () => setPanel({
|
|
307
|
+
name: "menu"
|
|
308
|
+
}),
|
|
309
|
+
button: buttons.close("menu"),
|
|
310
|
+
data: data == null ? void 0 : data.documents,
|
|
311
|
+
style,
|
|
312
|
+
title: import_entry.agreementTitles[(_g = panel == null ? void 0 : panel.data) == null ? void 0 : _g.id]
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
);
|
|
249
316
|
case "prize":
|
|
250
317
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
|
|
251
318
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -259,7 +326,7 @@ const TemplateModal = ({
|
|
|
259
326
|
},
|
|
260
327
|
button: buttons.close("menu"),
|
|
261
328
|
style,
|
|
262
|
-
title: (
|
|
329
|
+
title: (_h = panel == null ? void 0 : panel.data) == null ? void 0 : _h.title
|
|
263
330
|
}
|
|
264
331
|
}
|
|
265
332
|
),
|
|
@@ -270,17 +337,17 @@ const TemplateModal = ({
|
|
|
270
337
|
className: "space-y-6",
|
|
271
338
|
...style && {
|
|
272
339
|
style: {
|
|
273
|
-
borderColor: (
|
|
340
|
+
borderColor: (_j = (_i = style == null ? void 0 : style.text) == null ? void 0 : _i.color) == null ? void 0 : _j.rgb
|
|
274
341
|
}
|
|
275
342
|
}
|
|
276
343
|
},
|
|
277
|
-
children: (((
|
|
344
|
+
children: (((_k = panel == null ? void 0 : panel.data) == null ? void 0 : _k.draws) || []).length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
278
345
|
import_tabs.default,
|
|
279
346
|
{
|
|
280
347
|
...{
|
|
281
348
|
list: [
|
|
282
349
|
{
|
|
283
|
-
title: "Check " + ((
|
|
350
|
+
title: "Check " + ((_m = (_l = data == null ? void 0 : data.fields) == null ? void 0 : _l.primary) == null ? void 0 : _m.slug),
|
|
284
351
|
slug: "verify"
|
|
285
352
|
},
|
|
286
353
|
{
|
|
@@ -301,7 +368,7 @@ const TemplateModal = ({
|
|
|
301
368
|
style,
|
|
302
369
|
tracking,
|
|
303
370
|
values: {
|
|
304
|
-
primary: (
|
|
371
|
+
primary: (_n = data == null ? void 0 : data.fields) == null ? void 0 : _n.primary,
|
|
305
372
|
prize: panel == null ? void 0 : panel.data,
|
|
306
373
|
...params
|
|
307
374
|
}
|
|
@@ -316,11 +383,11 @@ const TemplateModal = ({
|
|
|
316
383
|
className: "divide-y divide-inherit border-y border-inherit",
|
|
317
384
|
...style && {
|
|
318
385
|
style: {
|
|
319
|
-
borderColor: (
|
|
386
|
+
borderColor: (_p = (_o = style == null ? void 0 : style.text) == null ? void 0 : _o.color) == null ? void 0 : _p.rgb
|
|
320
387
|
}
|
|
321
388
|
}
|
|
322
389
|
},
|
|
323
|
-
children: (((
|
|
390
|
+
children: (((_q = panel == null ? void 0 : panel.data) == null ? void 0 : _q.draws) || []).map((draw, key) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
324
391
|
"div",
|
|
325
392
|
{
|
|
326
393
|
...{
|
|
@@ -378,11 +445,11 @@ const TemplateModal = ({
|
|
|
378
445
|
className: "divide-y divide-inherit border-t border-inherit [&>:last-child>span]:pb-0",
|
|
379
446
|
...style && {
|
|
380
447
|
style: {
|
|
381
|
-
borderColor: (
|
|
448
|
+
borderColor: (_s = (_r = style == null ? void 0 : style.text) == null ? void 0 : _r.color) == null ? void 0 : _s.rgb
|
|
382
449
|
}
|
|
383
450
|
}
|
|
384
451
|
},
|
|
385
|
-
children: (
|
|
452
|
+
children: (_t = data == null ? void 0 : data.prizes) == null ? void 0 : _t.items.map((prize, key) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
386
453
|
import_card_prize.default,
|
|
387
454
|
{
|
|
388
455
|
...{
|
|
@@ -413,7 +480,7 @@ const TemplateModal = ({
|
|
|
413
480
|
{
|
|
414
481
|
...{
|
|
415
482
|
cart,
|
|
416
|
-
drawer: !((
|
|
483
|
+
drawer: !((_v = (_u = panel.data) == null ? void 0 : _u.product) == null ? void 0 : _v.sample),
|
|
417
484
|
onLineRemove: onCartLineRemove,
|
|
418
485
|
onLineUpdate: onCartLineUpdate,
|
|
419
486
|
onSuccess: ({ result }) => {
|
|
@@ -470,7 +537,7 @@ const TemplateModal = ({
|
|
|
470
537
|
{
|
|
471
538
|
...{
|
|
472
539
|
button: buttons.close("purchase"),
|
|
473
|
-
message: (
|
|
540
|
+
message: (_w = panel == null ? void 0 : panel.data) == null ? void 0 : _w.message,
|
|
474
541
|
style,
|
|
475
542
|
title: "Purchase complete"
|
|
476
543
|
}
|