@usgb/forms 1.0.1 → 1.0.2
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/README.md +79 -30
- package/dist/forms-manifest.1.0.2.json +305 -0
- package/dist/forms-manifest.json +67 -13
- package/dist/index.js +596 -579
- package/dist/src/contract/types.d.ts +6 -10
- package/dist/src/contract/types.d.ts.map +1 -1
- package/dist/src/definitions/consents.d.ts +53 -20
- package/dist/src/definitions/consents.d.ts.map +1 -1
- package/dist/src/definitions/index.d.ts +3 -3
- package/dist/src/definitions/index.d.ts.map +1 -1
- package/dist/src/definitions/types.d.ts +9 -4
- package/dist/src/definitions/types.d.ts.map +1 -1
- package/dist/src/form/UsgbForm.d.ts.map +1 -1
- package/dist/src/form/kinds/LeadKindForm.d.ts.map +1 -1
- package/dist/src/form/useUsgbFormSession.d.ts +5 -5
- package/dist/src/form/useUsgbFormSession.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/usgb-forms.1.0.2.js +44 -0
- package/dist/usgb-forms.js +10 -10
- package/forms-manifest.json +67 -13
- package/package.json +2 -2
- package/dist/usgb-forms.1.0.1.js +0 -44
package/dist/index.js
CHANGED
|
@@ -1,68 +1,85 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { validate as
|
|
3
|
-
import { useId as
|
|
4
|
-
import { useForm as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
schemaVersion:
|
|
8
|
-
package: { name: "@usgb/forms", compatiblePackageVersions: "^1.0.
|
|
9
|
-
submissionContract:
|
|
10
|
-
trackingRegistry:
|
|
11
|
-
forms:
|
|
12
|
-
hostAdapterContract:
|
|
13
|
-
},
|
|
14
|
-
function
|
|
15
|
-
return
|
|
1
|
+
import { jsx as l, Fragment as X, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import { validate as ee } from "email-validator";
|
|
3
|
+
import { useId as te, useMemo as D, useState as ne, useEffect as ie, forwardRef as $ } from "react";
|
|
4
|
+
import { useForm as re } from "react-hook-form";
|
|
5
|
+
import P from "classnames";
|
|
6
|
+
const oe = "1.0.0", se = { version: "1.0.0", transport: "server-proxy", payloadShape: "data-and-context" }, ae = { page_url: { destination: "form_submission_url", category: "page", collection: "server", required: !0, states: ["collected", "unavailable"], description: "Canonical landing-page URL at submission time" }, page_title: { destination: "pageName", category: "page", collection: "server", required: !1, states: ["collected", "unavailable"] }, referrer: { destination: "referrer", category: "page", collection: "browser", required: !1, states: ["collected", "unavailable"] }, first_touch_url: { destination: "crossDomain_landing_url", category: "attribution", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, utm_source: { destination: "utm_source", category: "attribution", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, utm_medium: { destination: "utm_medium", category: "attribution", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, utm_campaign: { destination: "utm_campaign", category: "attribution", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, utm_term: { destination: "utm_term", category: "attribution", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, utm_content: { destination: "utm_content", category: "attribution", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, gclid: { destination: "gclid", category: "click-id", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, msclkid: { destination: "msclkid", category: "click-id", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, gbraid: { destination: "gbraid", category: "click-id", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, wbraid: { destination: "wbraid", category: "click-id", collection: "host-adapter", required: !1, states: ["collected", "unavailable"] }, hubspot_utk: { destination: "hubspot_utk", category: "identity", collection: "host-adapter", required: !1, states: ["collected", "unavailable", "consent-withheld"] }, ga_client_id: { destination: "ga_client_id", category: "analytics", collection: "host-adapter", required: !1, states: ["collected", "unavailable", "consent-withheld"] }, ga_session_id: { destination: "session_id_start", category: "analytics", collection: "host-adapter", required: !1, states: ["collected", "unavailable", "consent-withheld"] }, snowplow_id: { destination: "snowplow_id", category: "analytics", collection: "host-adapter", required: !1, states: ["collected", "unavailable", "consent-withheld"] }, vwo_uuid: { destination: "vwo_uuid", category: "experiment", collection: "host-adapter", required: !1, states: ["collected", "unavailable", "consent-withheld"] }, user_agent: { destination: "header_http_client_details", category: "technical", collection: "server", required: !1, states: ["collected", "unavailable"] }, ip_address: { destination: "ipAddress", category: "technical", collection: "server", required: !1, states: ["collected", "unavailable"] } }, le = { "main-investors-kit": { definitionVersion: "1", kind: "lead", flow: { type: "single" }, supportedHosts: ["pwa", "wordpress"], fields: [{ name: "firstname", required: !0, group: "name" }, { name: "lastname", required: !0, group: "name" }, { name: "email", required: !0 }, { name: "phone", required: !1 }], trackingFields: ["page_url", "page_title", "referrer", "first_touch_url", "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content", "gclid", "msclkid", "gbraid", "wbraid", "hubspot_utk", "ga_client_id", "ga_session_id", "snowplow_id", "vwo_uuid", "user_agent", "ip_address"], ctaLabel: "GET MY FREE GUIDE", consents: [{ definitionId: "lead-tcpa", definitionVersion: "1", required: !1 }, { definitionId: "lead-sms", definitionVersion: "1", required: !1 }, { definitionId: "lead-tospp", definitionVersion: "1", required: !1 }], editor: { label: "Main Investors Kit", description: "Standard lead form: name, email, phone, plus optional TCPA, marketing SMS, and terms/privacy checkboxes. Use on full-width landing pages and PWA kit/sidebar placements.", whenToUse: "Default kit request with optional consent checkboxes. Do not use for affiliate landers or IRA-specific leads.", whenNotToUse: "Affiliate pages (separate definition). IRA kit (separate definition when added). Clickwrap-only kit (`main-investors-kit-notice`).", supportedAppearances: ["on-light", "on-dark"], supportedVariants: ["dense", "large", "sidebar", "two-column"] } }, "main-investors-kit-notice": { definitionVersion: "1", kind: "lead", flow: { type: "single" }, supportedHosts: ["pwa", "wordpress"], fields: [{ name: "firstname", required: !0, group: "name" }, { name: "lastname", required: !0, group: "name" }, { name: "email", required: !0 }, { name: "phone", required: !1 }], trackingFields: ["page_url", "page_title", "referrer", "first_touch_url", "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content", "gclid", "msclkid", "gbraid", "wbraid", "hubspot_utk", "ga_client_id", "ga_session_id", "snowplow_id", "vwo_uuid", "user_agent", "ip_address"], ctaLabel: "GET MY FREE GUIDE", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "1" }], editor: { label: "Main Investors Kit (clickwrap)", description: "Same fields as Main Investors Kit with a clickwrap notice only — no consent checkboxes.", whenToUse: "Kit request where submit acknowledges legal docs via notice copy instead of checkboxes.", whenNotToUse: "Placements that need TCPA / marketing SMS / terms checkboxes (`main-investors-kit`).", supportedAppearances: ["on-light", "on-dark"], supportedVariants: ["dense", "large", "sidebar", "two-column"] } }, newsletter: { definitionVersion: "1", kind: "newsletter", flow: { type: "single" }, supportedHosts: ["pwa"], fields: [{ name: "email", required: !0 }], trackingFields: ["page_url", "page_title", "referrer", "utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"], ctaLabel: "SUBSCRIBE", editor: { label: "Newsletter", description: "Email-only newsletter signup. No TCPA consent.", whenToUse: "Footer or landing newsletter capture where only an email is required.", whenNotToUse: "Lead kits that need name, phone, or TCPA consent.", supportedAppearances: ["on-light", "on-dark"], supportedVariants: [] } } }, ce = { hosts: ["pwa", "wordpress"], mayProvide: ["browser cookies", "URL parameters", "page and placement context", "host/store identity"], mustNotDefine: ["new tracking keys", "destination property names", "consent definitions", "form fields", "submission endpoints"] }, de = {
|
|
7
|
+
schemaVersion: oe,
|
|
8
|
+
package: { name: "@usgb/forms", compatiblePackageVersions: "^1.0.2" },
|
|
9
|
+
submissionContract: se,
|
|
10
|
+
trackingRegistry: ae,
|
|
11
|
+
forms: le,
|
|
12
|
+
hostAdapterContract: ce
|
|
13
|
+
}, I = de;
|
|
14
|
+
function ue(t) {
|
|
15
|
+
return I.forms[t];
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
return Object.entries(
|
|
17
|
+
function He() {
|
|
18
|
+
return Object.entries(I.forms).map(([t, e]) => ({
|
|
19
19
|
formId: t,
|
|
20
20
|
definition: e
|
|
21
21
|
}));
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
return typeof t == "
|
|
23
|
+
function j(t, e) {
|
|
24
|
+
return typeof t == "string" ? { content: t, language: t } : t(e);
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
function G(t, e) {
|
|
27
|
+
return `${t}@${e}`;
|
|
28
|
+
}
|
|
29
|
+
function H(t) {
|
|
30
|
+
return (e) => ({
|
|
31
|
+
language: t.map(
|
|
32
|
+
(n) => typeof n == "string" ? n : `${n.label} (${e[n.href] ?? ""})`
|
|
33
|
+
).join(""),
|
|
34
|
+
content: /* @__PURE__ */ l(X, { children: t.map(
|
|
35
|
+
(n, i) => typeof n == "string" ? n : /* @__PURE__ */ l(
|
|
36
|
+
"a",
|
|
37
|
+
{
|
|
38
|
+
href: e[n.href],
|
|
39
|
+
target: "_blank",
|
|
40
|
+
rel: "noreferrer",
|
|
41
|
+
children: n.label
|
|
42
|
+
},
|
|
43
|
+
`${n.href}-${i}`
|
|
44
|
+
)
|
|
45
|
+
) })
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const me = {
|
|
27
49
|
definitionId: "lead-tcpa",
|
|
28
50
|
definitionVersion: "1",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
),
|
|
59
|
-
"."
|
|
60
|
-
] })
|
|
61
|
-
}
|
|
62
|
-
]
|
|
63
|
-
}, $ = {
|
|
51
|
+
type: "checkbox",
|
|
52
|
+
name: "tcpa_form_consent_granted",
|
|
53
|
+
grantDateField: "tcpa_form_opt_in_date",
|
|
54
|
+
requiredLegalUrls: [],
|
|
55
|
+
languageKey: "tcpa_consent_language",
|
|
56
|
+
copy: "By checking, you are allowing to receive transactional/informational SMS communications regarding account notifications, customer care, etc, from U.S. Gold Bureau. Messages frequency may vary. Data rates may apply, reply STOP to opt-out"
|
|
57
|
+
}, fe = {
|
|
58
|
+
definitionId: "lead-sms",
|
|
59
|
+
definitionVersion: "1",
|
|
60
|
+
type: "checkbox",
|
|
61
|
+
name: "sms_form_consent_granted",
|
|
62
|
+
requiredLegalUrls: [],
|
|
63
|
+
languageKey: "sms_consent_language",
|
|
64
|
+
copy: "By checking, you are allowing to receive promotional/marketing SMS communications from U.S. Gold Bureau. Frequency may vary. Data rates may apply. Reply HELP for help or STOP to opt-out."
|
|
65
|
+
}, ge = {
|
|
66
|
+
definitionId: "lead-tospp",
|
|
67
|
+
definitionVersion: "1",
|
|
68
|
+
type: "checkbox",
|
|
69
|
+
name: "tospp_form_consent_granted",
|
|
70
|
+
requiredLegalUrls: ["userAgreement", "privacyPolicy"],
|
|
71
|
+
languageKey: "tospp_consent_language",
|
|
72
|
+
copy: H([
|
|
73
|
+
"By checking, I accept ",
|
|
74
|
+
{ href: "userAgreement", label: "Terms of Conditions" },
|
|
75
|
+
" & ",
|
|
76
|
+
{ href: "privacyPolicy", label: "Privacy Policy" },
|
|
77
|
+
"."
|
|
78
|
+
])
|
|
79
|
+
}, pe = {
|
|
64
80
|
definitionId: "lead-clickwrap",
|
|
65
81
|
definitionVersion: "1",
|
|
82
|
+
type: "notice",
|
|
66
83
|
requiredLegalUrls: [
|
|
67
84
|
"privacyPolicy",
|
|
68
85
|
"userAgreement",
|
|
@@ -70,99 +87,108 @@ const D = {
|
|
|
70
87
|
"electronicDisclaimer",
|
|
71
88
|
"termsOfSale"
|
|
72
89
|
],
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
),
|
|
88
|
-
",",
|
|
89
|
-
" ",
|
|
90
|
-
/* @__PURE__ */ s(
|
|
91
|
-
"a",
|
|
92
|
-
{
|
|
93
|
-
href: t.userAgreement,
|
|
94
|
-
target: "_blank",
|
|
95
|
-
rel: "noreferrer",
|
|
96
|
-
children: "User Agreement"
|
|
97
|
-
}
|
|
98
|
-
),
|
|
99
|
-
",",
|
|
100
|
-
" ",
|
|
101
|
-
/* @__PURE__ */ s(
|
|
102
|
-
"a",
|
|
103
|
-
{
|
|
104
|
-
href: t.marketLossPolicy,
|
|
105
|
-
target: "_blank",
|
|
106
|
-
rel: "noreferrer",
|
|
107
|
-
children: "Market Loss Policy"
|
|
108
|
-
}
|
|
109
|
-
),
|
|
110
|
-
",",
|
|
111
|
-
" ",
|
|
112
|
-
/* @__PURE__ */ s(
|
|
113
|
-
"a",
|
|
114
|
-
{
|
|
115
|
-
href: t.electronicDisclaimer,
|
|
116
|
-
target: "_blank",
|
|
117
|
-
rel: "noreferrer",
|
|
118
|
-
children: "Electronic Disclaimer"
|
|
119
|
-
}
|
|
120
|
-
),
|
|
121
|
-
" ",
|
|
122
|
-
"and",
|
|
123
|
-
" ",
|
|
124
|
-
/* @__PURE__ */ s("a", { href: t.termsOfSale, target: "_blank", rel: "noreferrer", children: "Terms & Conditions of Sale" }),
|
|
125
|
-
"."
|
|
126
|
-
] })
|
|
127
|
-
}
|
|
128
|
-
]
|
|
129
|
-
}, ge = {
|
|
130
|
-
[`${D.definitionId}@${D.definitionVersion}`]: D,
|
|
131
|
-
[`${$.definitionId}@${$.definitionVersion}`]: $
|
|
90
|
+
languageKey: "clickwrap_consent_language",
|
|
91
|
+
copy: H([
|
|
92
|
+
"By clicking the button, I agree to be bound by your ",
|
|
93
|
+
{ href: "privacyPolicy", label: "Privacy Policy" },
|
|
94
|
+
", ",
|
|
95
|
+
{ href: "userAgreement", label: "User Agreement" },
|
|
96
|
+
", ",
|
|
97
|
+
{ href: "marketLossPolicy", label: "Market Loss Policy" },
|
|
98
|
+
", ",
|
|
99
|
+
{ href: "electronicDisclaimer", label: "Electronic Disclaimer" },
|
|
100
|
+
" and ",
|
|
101
|
+
{ href: "termsOfSale", label: "Terms & Conditions of Sale" },
|
|
102
|
+
"."
|
|
103
|
+
])
|
|
132
104
|
};
|
|
133
|
-
function
|
|
134
|
-
return
|
|
105
|
+
function he(...t) {
|
|
106
|
+
return Object.fromEntries(
|
|
107
|
+
t.map((e) => [
|
|
108
|
+
G(e.definitionId, e.definitionVersion),
|
|
109
|
+
e
|
|
110
|
+
])
|
|
111
|
+
);
|
|
135
112
|
}
|
|
136
|
-
|
|
113
|
+
const be = he(
|
|
114
|
+
me,
|
|
115
|
+
fe,
|
|
116
|
+
ge,
|
|
117
|
+
pe
|
|
118
|
+
);
|
|
119
|
+
function ye(t, e) {
|
|
120
|
+
return be[G(t, e)];
|
|
121
|
+
}
|
|
122
|
+
function W(t) {
|
|
123
|
+
if (!(t != null && t.length))
|
|
124
|
+
return [];
|
|
125
|
+
const e = [];
|
|
126
|
+
for (const n of t) {
|
|
127
|
+
const i = ye(
|
|
128
|
+
n.definitionId,
|
|
129
|
+
n.definitionVersion
|
|
130
|
+
);
|
|
131
|
+
if (!i)
|
|
132
|
+
return null;
|
|
133
|
+
e.push(
|
|
134
|
+
i.type === "checkbox" ? { ...i, required: !!n.required } : i
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
return e;
|
|
138
|
+
}
|
|
139
|
+
function _e(t, e, n, i) {
|
|
140
|
+
if (!t.length)
|
|
141
|
+
return;
|
|
142
|
+
const a = {};
|
|
143
|
+
for (const s of t) {
|
|
144
|
+
const { language: r } = j(s.copy, n);
|
|
145
|
+
if (a[s.languageKey] = r, s.type === "checkbox") {
|
|
146
|
+
const o = !!e[s.name];
|
|
147
|
+
a[s.name] = o, o && s.grantDateField && (a[s.grantDateField] = i);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return a;
|
|
151
|
+
}
|
|
152
|
+
function ke(t) {
|
|
153
|
+
const e = /* @__PURE__ */ new Set();
|
|
154
|
+
for (const n of t)
|
|
155
|
+
for (const i of n.requiredLegalUrls)
|
|
156
|
+
e.add(i);
|
|
157
|
+
return [...e];
|
|
158
|
+
}
|
|
159
|
+
function we(t) {
|
|
160
|
+
return t.type === "checkbox";
|
|
161
|
+
}
|
|
162
|
+
function O(t) {
|
|
137
163
|
return (e, n) => n ? e.trim().length > 0 || `${t} is required` : !0;
|
|
138
164
|
}
|
|
139
|
-
const
|
|
140
|
-
function
|
|
165
|
+
const ve = /^[2-9]\d{2}[2-9]\d{6}$/;
|
|
166
|
+
function z(t) {
|
|
141
167
|
let e = t.replace(/\D/g, "");
|
|
142
|
-
return e.length === 11 && e.startsWith("1") && (e = e.slice(1)), e.length !== 10 || !
|
|
168
|
+
return e.length === 11 && e.startsWith("1") && (e = e.slice(1)), e.length !== 10 || !ve.test(e) ? null : e;
|
|
143
169
|
}
|
|
144
|
-
function
|
|
170
|
+
function Se(t) {
|
|
145
171
|
const e = t.trim();
|
|
146
172
|
if (!e) return "";
|
|
147
|
-
const n =
|
|
173
|
+
const n = z(e);
|
|
148
174
|
if (!n) return e;
|
|
149
|
-
const
|
|
150
|
-
return
|
|
175
|
+
const i = e.replace(/\D/g, "");
|
|
176
|
+
return i.length === 11 && i.startsWith("1") ? `1${n}` : n;
|
|
151
177
|
}
|
|
152
|
-
const
|
|
178
|
+
const qe = {
|
|
153
179
|
firstname: {
|
|
154
180
|
name: "firstname",
|
|
155
181
|
control: "text",
|
|
156
182
|
label: "First name",
|
|
157
183
|
autoComplete: "given-name",
|
|
158
|
-
validate:
|
|
184
|
+
validate: O("First name")
|
|
159
185
|
},
|
|
160
186
|
lastname: {
|
|
161
187
|
name: "lastname",
|
|
162
188
|
control: "text",
|
|
163
189
|
label: "Last name",
|
|
164
190
|
autoComplete: "family-name",
|
|
165
|
-
validate:
|
|
191
|
+
validate: O("Last name")
|
|
166
192
|
},
|
|
167
193
|
email: {
|
|
168
194
|
name: "email",
|
|
@@ -171,7 +197,7 @@ const be = {
|
|
|
171
197
|
autoComplete: "email",
|
|
172
198
|
validate: (t, e) => {
|
|
173
199
|
const n = t.trim();
|
|
174
|
-
return n ?
|
|
200
|
+
return n ? ee(n) || "Enter a valid email" : e ? "Email is required" : !0;
|
|
175
201
|
}
|
|
176
202
|
},
|
|
177
203
|
phone: {
|
|
@@ -181,217 +207,202 @@ const be = {
|
|
|
181
207
|
autoComplete: "tel",
|
|
182
208
|
validate: (t, e) => {
|
|
183
209
|
const n = t.trim();
|
|
184
|
-
return n ?
|
|
210
|
+
return n ? z(n) ? !0 : "Enter a valid phone number" : e ? "Phone is required" : !0;
|
|
185
211
|
},
|
|
186
|
-
serialize:
|
|
212
|
+
serialize: Se
|
|
187
213
|
}
|
|
188
214
|
};
|
|
189
|
-
function
|
|
190
|
-
return
|
|
215
|
+
function B(t) {
|
|
216
|
+
return qe[t];
|
|
191
217
|
}
|
|
192
|
-
function
|
|
218
|
+
function V({
|
|
193
219
|
className: t,
|
|
194
220
|
appearance: e,
|
|
195
221
|
variantValue: n,
|
|
196
|
-
kind:
|
|
197
|
-
children:
|
|
222
|
+
kind: i,
|
|
223
|
+
children: a
|
|
198
224
|
}) {
|
|
199
|
-
return /* @__PURE__ */
|
|
225
|
+
return /* @__PURE__ */ l(
|
|
200
226
|
"div",
|
|
201
227
|
{
|
|
202
228
|
className: `usgb-form ${t ?? ""}`,
|
|
203
229
|
"data-appearance": e,
|
|
204
230
|
...n ? { "data-variant": n } : {},
|
|
205
|
-
"data-kind":
|
|
206
|
-
children:
|
|
231
|
+
"data-kind": i,
|
|
232
|
+
children: a
|
|
207
233
|
}
|
|
208
234
|
);
|
|
209
235
|
}
|
|
210
|
-
const
|
|
236
|
+
const Ce = [
|
|
211
237
|
"hubspot_utk",
|
|
212
238
|
"ga_client_id",
|
|
213
239
|
"ga_session_id",
|
|
214
240
|
"snowplow_id",
|
|
215
241
|
"vwo_uuid"
|
|
216
242
|
];
|
|
217
|
-
function
|
|
243
|
+
function C(t, e) {
|
|
218
244
|
return t === "collected" && e != null && e !== "" ? { status: "collected", value: e } : { status: t };
|
|
219
245
|
}
|
|
220
|
-
function
|
|
221
|
-
const { trackingFields: e, trackingRegistry: n, adapter:
|
|
222
|
-
for (const
|
|
223
|
-
const
|
|
224
|
-
if (!
|
|
225
|
-
const c = new Set(
|
|
226
|
-
if (
|
|
227
|
-
|
|
246
|
+
function Le(t) {
|
|
247
|
+
const { trackingFields: e, trackingRegistry: n, adapter: i } = t, a = i.getTrackingHints(), s = {};
|
|
248
|
+
for (const r of e) {
|
|
249
|
+
const o = n[r];
|
|
250
|
+
if (!o) continue;
|
|
251
|
+
const c = new Set(o.states);
|
|
252
|
+
if (o.collection === "server") {
|
|
253
|
+
s[r] = C("unavailable");
|
|
228
254
|
continue;
|
|
229
255
|
}
|
|
230
|
-
if (
|
|
231
|
-
if (
|
|
256
|
+
if (o.collection === "browser") {
|
|
257
|
+
if (r === "referrer" && typeof document < "u") {
|
|
232
258
|
const f = document.referrer;
|
|
233
|
-
|
|
259
|
+
s[r] = f ? C("collected", f) : C("unavailable");
|
|
234
260
|
} else
|
|
235
|
-
|
|
261
|
+
s[r] = C("unavailable");
|
|
236
262
|
continue;
|
|
237
263
|
}
|
|
238
|
-
const
|
|
239
|
-
if (
|
|
240
|
-
|
|
264
|
+
const u = a[r];
|
|
265
|
+
if (u != null && u !== "") {
|
|
266
|
+
s[r] = C("collected", u);
|
|
241
267
|
continue;
|
|
242
268
|
}
|
|
243
|
-
if (
|
|
244
|
-
|
|
269
|
+
if (Ce.includes(r) && c.has("consent-withheld")) {
|
|
270
|
+
s[r] = C("unavailable");
|
|
245
271
|
continue;
|
|
246
272
|
}
|
|
247
|
-
|
|
273
|
+
s[r] = C("unavailable");
|
|
248
274
|
}
|
|
249
|
-
return
|
|
275
|
+
return s;
|
|
250
276
|
}
|
|
251
|
-
function
|
|
277
|
+
function Ne() {
|
|
252
278
|
return typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `usgb-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
|
|
253
279
|
}
|
|
254
|
-
function
|
|
280
|
+
function Ee(t, e) {
|
|
255
281
|
const n = {};
|
|
256
|
-
for (const
|
|
257
|
-
n[
|
|
258
|
-
for (const
|
|
259
|
-
n[
|
|
282
|
+
for (const i of t)
|
|
283
|
+
n[i.name] = "";
|
|
284
|
+
for (const i of e)
|
|
285
|
+
n[i] = !1;
|
|
260
286
|
return n;
|
|
261
287
|
}
|
|
262
|
-
function
|
|
288
|
+
function R(t) {
|
|
263
289
|
const e = t == null ? void 0 : t.trim();
|
|
264
290
|
return e || void 0;
|
|
265
291
|
}
|
|
266
|
-
function
|
|
292
|
+
function De({
|
|
267
293
|
formId: t,
|
|
268
294
|
definition: e,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
successUrl:
|
|
273
|
-
adapter:
|
|
274
|
-
analytics:
|
|
295
|
+
source: n,
|
|
296
|
+
campaign: i,
|
|
297
|
+
legalUrls: a,
|
|
298
|
+
successUrl: s,
|
|
299
|
+
adapter: r,
|
|
300
|
+
analytics: o,
|
|
275
301
|
onAccepted: c,
|
|
276
|
-
onFailed:
|
|
302
|
+
onFailed: u
|
|
277
303
|
}) {
|
|
278
|
-
const f =
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
)
|
|
282
|
-
() => (
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
() => g.map((_) => _.name),
|
|
288
|
-
[g]
|
|
289
|
-
), m = P(
|
|
290
|
-
() => ye(e.fields, w),
|
|
291
|
-
[e.fields, w]
|
|
304
|
+
const f = te(), b = D(
|
|
305
|
+
() => W(e.consents) ?? [],
|
|
306
|
+
[e.consents]
|
|
307
|
+
), y = D(
|
|
308
|
+
() => b.filter(we).map((w) => w.name),
|
|
309
|
+
[b]
|
|
310
|
+
), p = D(
|
|
311
|
+
() => Ee(e.fields, y),
|
|
312
|
+
[e.fields, y]
|
|
292
313
|
), {
|
|
293
|
-
register:
|
|
294
|
-
handleSubmit:
|
|
295
|
-
formState: { errors:
|
|
296
|
-
} =
|
|
297
|
-
defaultValues:
|
|
298
|
-
}), [q,
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
}, [
|
|
302
|
-
const
|
|
303
|
-
const
|
|
304
|
-
for (const
|
|
305
|
-
|
|
306
|
-
for (const
|
|
307
|
-
|
|
308
|
-
return
|
|
309
|
-
}, [f, e.fields,
|
|
310
|
-
const
|
|
311
|
-
if (
|
|
312
|
-
|
|
314
|
+
register: _,
|
|
315
|
+
handleSubmit: m,
|
|
316
|
+
formState: { errors: d }
|
|
317
|
+
} = re({
|
|
318
|
+
defaultValues: p
|
|
319
|
+
}), [q, h] = ne({ kind: "idle" });
|
|
320
|
+
ie(() => {
|
|
321
|
+
o == null || o({ type: "view", formId: t });
|
|
322
|
+
}, [o, t]);
|
|
323
|
+
const L = D(() => {
|
|
324
|
+
const w = {};
|
|
325
|
+
for (const v of e.fields)
|
|
326
|
+
w[v.name] = `${f}-${v.name}`;
|
|
327
|
+
for (const v of y)
|
|
328
|
+
w[v] = `${f}-${v}`;
|
|
329
|
+
return w;
|
|
330
|
+
}, [f, e.fields, y]), x = m(async (w) => {
|
|
331
|
+
const v = Object.keys(d);
|
|
332
|
+
if (v.length) {
|
|
333
|
+
o == null || o({
|
|
313
334
|
type: "validation_failure",
|
|
314
335
|
formId: t,
|
|
315
|
-
fields:
|
|
336
|
+
fields: v
|
|
316
337
|
});
|
|
317
338
|
return;
|
|
318
339
|
}
|
|
319
|
-
|
|
320
|
-
const
|
|
340
|
+
o == null || o({ type: "submit_attempt", formId: t }), h({ kind: "submitting" });
|
|
341
|
+
const F = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), J = Le({
|
|
321
342
|
trackingFields: e.trackingFields,
|
|
322
|
-
trackingRegistry:
|
|
323
|
-
adapter:
|
|
324
|
-
}),
|
|
325
|
-
for (const
|
|
326
|
-
const
|
|
327
|
-
if (typeof
|
|
328
|
-
|
|
343
|
+
trackingRegistry: I.trackingRegistry,
|
|
344
|
+
adapter: r
|
|
345
|
+
}), A = {};
|
|
346
|
+
for (const k of e.fields) {
|
|
347
|
+
const S = w[k.name];
|
|
348
|
+
if (typeof S != "string") {
|
|
349
|
+
A[k.name] = !!S;
|
|
329
350
|
continue;
|
|
330
351
|
}
|
|
331
|
-
const
|
|
332
|
-
|
|
333
|
-
}
|
|
334
|
-
let H;
|
|
335
|
-
if (h && k) {
|
|
336
|
-
const y = {};
|
|
337
|
-
for (const v of g)
|
|
338
|
-
y[v.name] = !!_[v.name], E[v.name] = !!_[v.name];
|
|
339
|
-
h.submitFields.includes("tcpa_form_opt_in_date") && (y.tcpa_form_opt_in_date = G, E.tcpa_form_opt_in_date = G), H = {
|
|
340
|
-
definitionId: h.definitionId,
|
|
341
|
-
definitionVersion: h.definitionVersion,
|
|
342
|
-
values: y,
|
|
343
|
-
timestamp: W.toISOString(),
|
|
344
|
-
source: o,
|
|
345
|
-
placement: n || e.kind
|
|
346
|
-
};
|
|
352
|
+
const U = B(k.name);
|
|
353
|
+
A[k.name] = U != null && U.serialize ? U.serialize(S) : S.trim();
|
|
347
354
|
}
|
|
348
|
-
const
|
|
355
|
+
const Q = _e(
|
|
356
|
+
b,
|
|
357
|
+
w,
|
|
358
|
+
a ?? {},
|
|
359
|
+
F
|
|
360
|
+
), T = {
|
|
349
361
|
formId: t,
|
|
350
362
|
definitionVersion: e.definitionVersion,
|
|
351
|
-
submissionContractVersion:
|
|
352
|
-
idempotencyKey:
|
|
353
|
-
data:
|
|
354
|
-
|
|
363
|
+
submissionContractVersion: I.submissionContract.version,
|
|
364
|
+
idempotencyKey: Ne(),
|
|
365
|
+
data: A,
|
|
366
|
+
consents: Q,
|
|
355
367
|
context: {
|
|
356
|
-
host:
|
|
357
|
-
source:
|
|
358
|
-
campaign:
|
|
368
|
+
host: r.host,
|
|
369
|
+
source: n,
|
|
370
|
+
campaign: i,
|
|
359
371
|
page: typeof window < "u" ? window.location.href : void 0,
|
|
360
|
-
tracking:
|
|
372
|
+
tracking: J
|
|
361
373
|
}
|
|
362
374
|
};
|
|
363
375
|
try {
|
|
364
|
-
const
|
|
365
|
-
if (
|
|
366
|
-
|
|
367
|
-
const
|
|
368
|
-
|
|
376
|
+
const k = await r.submit(T);
|
|
377
|
+
if (k.status === "accepted") {
|
|
378
|
+
o == null || o({ type: "success", formId: t, status: "accepted" }), c == null || c(T), h({ kind: "accepted" });
|
|
379
|
+
const S = R(s);
|
|
380
|
+
S && typeof window < "u" && window.location.assign(S);
|
|
369
381
|
} else
|
|
370
|
-
|
|
382
|
+
h({
|
|
371
383
|
kind: "failed",
|
|
372
|
-
message:
|
|
373
|
-
}),
|
|
384
|
+
message: k.message ?? "Submission failed"
|
|
385
|
+
}), o == null || o({
|
|
374
386
|
type: "failure",
|
|
375
387
|
formId: t,
|
|
376
|
-
message:
|
|
377
|
-
}),
|
|
378
|
-
} catch (
|
|
379
|
-
const
|
|
380
|
-
|
|
388
|
+
message: k.message
|
|
389
|
+
}), u == null || u(T, k.message);
|
|
390
|
+
} catch (k) {
|
|
391
|
+
const S = k instanceof Error ? k.message : "Submission failed";
|
|
392
|
+
h({ kind: "failed", message: S }), o == null || o({ type: "failure", formId: t, message: S }), u == null || u(T, S);
|
|
381
393
|
}
|
|
382
394
|
});
|
|
383
395
|
return {
|
|
384
|
-
register:
|
|
385
|
-
errors:
|
|
386
|
-
fieldIds:
|
|
387
|
-
|
|
388
|
-
consentCheckboxes: g,
|
|
396
|
+
register: _,
|
|
397
|
+
errors: d,
|
|
398
|
+
fieldIds: L,
|
|
399
|
+
consentDefs: b,
|
|
389
400
|
uiState: q,
|
|
390
|
-
onSubmit:
|
|
401
|
+
onSubmit: x
|
|
391
402
|
};
|
|
392
403
|
}
|
|
393
|
-
function
|
|
394
|
-
return /* @__PURE__ */
|
|
404
|
+
function Pe() {
|
|
405
|
+
return /* @__PURE__ */ g(
|
|
395
406
|
"svg",
|
|
396
407
|
{
|
|
397
408
|
className: "usgb-field-error-icon",
|
|
@@ -403,7 +414,7 @@ function Ce() {
|
|
|
403
414
|
"aria-hidden": "true",
|
|
404
415
|
focusable: "false",
|
|
405
416
|
children: [
|
|
406
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ l(
|
|
407
418
|
"path",
|
|
408
419
|
{
|
|
409
420
|
d: "M7 13C10.3137 13 13 10.3137 13 7C13 3.68629 10.3137 1 7 1C3.68629 1 1 3.68629 1 7C1 10.3137 3.68629 13 7 13Z",
|
|
@@ -412,7 +423,7 @@ function Ce() {
|
|
|
412
423
|
strokeWidth: "0.7"
|
|
413
424
|
}
|
|
414
425
|
),
|
|
415
|
-
/* @__PURE__ */
|
|
426
|
+
/* @__PURE__ */ l(
|
|
416
427
|
"path",
|
|
417
428
|
{
|
|
418
429
|
d: "M6.31724 3.75816L6.42662 8.16962H7.57506L7.68444 3.75816H6.31724ZM7.00084 10.4483C7.41555 10.4483 7.74367 10.1338 7.74367 9.73277C7.74367 9.33173 7.41555 9.01727 7.00084 9.01727C6.58613 9.01727 6.258 9.33173 6.258 9.73277C6.258 10.1338 6.58613 10.4483 7.00084 10.4483Z",
|
|
@@ -423,8 +434,8 @@ function Ce() {
|
|
|
423
434
|
}
|
|
424
435
|
);
|
|
425
436
|
}
|
|
426
|
-
function
|
|
427
|
-
return /* @__PURE__ */
|
|
437
|
+
function xe() {
|
|
438
|
+
return /* @__PURE__ */ l(
|
|
428
439
|
"svg",
|
|
429
440
|
{
|
|
430
441
|
className: "usgb-form-checkbox-mark",
|
|
@@ -435,7 +446,7 @@ function Se() {
|
|
|
435
446
|
xmlns: "http://www.w3.org/2000/svg",
|
|
436
447
|
"aria-hidden": "true",
|
|
437
448
|
focusable: "false",
|
|
438
|
-
children: /* @__PURE__ */
|
|
449
|
+
children: /* @__PURE__ */ l(
|
|
439
450
|
"path",
|
|
440
451
|
{
|
|
441
452
|
d: "M1 3.5L2.33333 4.75L3.66667 6L9 1",
|
|
@@ -453,184 +464,175 @@ function K({
|
|
|
453
464
|
message: e,
|
|
454
465
|
className: n
|
|
455
466
|
}) {
|
|
456
|
-
return e ? /* @__PURE__ */
|
|
467
|
+
return e ? /* @__PURE__ */ g(
|
|
457
468
|
"span",
|
|
458
469
|
{
|
|
459
470
|
id: t,
|
|
460
471
|
role: "alert",
|
|
461
|
-
className:
|
|
472
|
+
className: P("usgb-field-error", n),
|
|
462
473
|
children: [
|
|
463
|
-
/* @__PURE__ */
|
|
474
|
+
/* @__PURE__ */ l(Pe, {}),
|
|
464
475
|
e
|
|
465
476
|
]
|
|
466
477
|
}
|
|
467
478
|
) : null;
|
|
468
479
|
}
|
|
469
|
-
const
|
|
470
|
-
function({ id: e, label: n, errorMessage:
|
|
471
|
-
const c =
|
|
472
|
-
return /* @__PURE__ */
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
/* @__PURE__ */
|
|
475
|
-
/* @__PURE__ */
|
|
480
|
+
const Fe = $(
|
|
481
|
+
function({ id: e, label: n, errorMessage: i, required: a, className: s, ...r }, o) {
|
|
482
|
+
const c = i ? `${e}-error` : void 0;
|
|
483
|
+
return /* @__PURE__ */ g("div", { className: "usgb-form-group", children: [
|
|
484
|
+
/* @__PURE__ */ g("div", { className: "usgb-consent-row", children: [
|
|
485
|
+
/* @__PURE__ */ g("span", { className: "usgb-form-checkbox-wrap", children: [
|
|
486
|
+
/* @__PURE__ */ l(
|
|
476
487
|
"input",
|
|
477
488
|
{
|
|
478
|
-
ref:
|
|
489
|
+
ref: o,
|
|
479
490
|
id: e,
|
|
480
491
|
type: "checkbox",
|
|
481
|
-
className:
|
|
482
|
-
"aria-invalid":
|
|
492
|
+
className: P("usgb-form-checkbox", s),
|
|
493
|
+
"aria-invalid": i ? !0 : void 0,
|
|
483
494
|
"aria-describedby": c,
|
|
484
|
-
"aria-required":
|
|
485
|
-
...
|
|
495
|
+
"aria-required": a || void 0,
|
|
496
|
+
...r
|
|
486
497
|
}
|
|
487
498
|
),
|
|
488
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ l(xe, {})
|
|
489
500
|
] }),
|
|
490
|
-
/* @__PURE__ */
|
|
501
|
+
/* @__PURE__ */ l("label", { htmlFor: e, className: "usgb-consent-copy", children: n })
|
|
491
502
|
] }),
|
|
492
|
-
/* @__PURE__ */
|
|
503
|
+
/* @__PURE__ */ l(K, { id: c, message: i })
|
|
493
504
|
] });
|
|
494
505
|
}
|
|
495
|
-
),
|
|
506
|
+
), Y = $(
|
|
496
507
|
function({
|
|
497
508
|
className: e,
|
|
498
509
|
variant: n = "primary",
|
|
499
|
-
loading:
|
|
500
|
-
disabled:
|
|
501
|
-
children:
|
|
502
|
-
...
|
|
503
|
-
},
|
|
504
|
-
return /* @__PURE__ */
|
|
510
|
+
loading: i = !1,
|
|
511
|
+
disabled: a = !1,
|
|
512
|
+
children: s,
|
|
513
|
+
...r
|
|
514
|
+
}, o) {
|
|
515
|
+
return /* @__PURE__ */ l(
|
|
505
516
|
"button",
|
|
506
517
|
{
|
|
507
|
-
ref:
|
|
508
|
-
type:
|
|
509
|
-
className:
|
|
518
|
+
ref: o,
|
|
519
|
+
type: r.type ?? "button",
|
|
520
|
+
className: P(
|
|
510
521
|
"usgb-btn",
|
|
511
522
|
n === "primary" && "usgb-btn-primary",
|
|
512
523
|
e
|
|
513
524
|
),
|
|
514
|
-
disabled:
|
|
515
|
-
"aria-busy":
|
|
516
|
-
...
|
|
517
|
-
children:
|
|
525
|
+
disabled: a || i,
|
|
526
|
+
"aria-busy": i || void 0,
|
|
527
|
+
...r,
|
|
528
|
+
children: i ? "Submitting…" : s
|
|
518
529
|
}
|
|
519
530
|
);
|
|
520
531
|
}
|
|
521
|
-
)
|
|
522
|
-
|
|
523
|
-
privacyPolicy: "/content/privacy-policy"
|
|
524
|
-
};
|
|
525
|
-
function Ne(t, e = ["clientAgreement", "privacyPolicy"]) {
|
|
526
|
-
return e.every((n) => {
|
|
527
|
-
var o;
|
|
528
|
-
return !!((o = t == null ? void 0 : t[n]) != null && o.trim());
|
|
529
|
-
});
|
|
530
|
-
}
|
|
531
|
-
function Le(t) {
|
|
532
|
+
);
|
|
533
|
+
function Te(t) {
|
|
532
534
|
const e = [];
|
|
533
535
|
let n = 0;
|
|
534
536
|
for (; n < t.length; ) {
|
|
535
|
-
const
|
|
536
|
-
if (
|
|
537
|
-
const
|
|
538
|
-
for (; n < t.length && t[n].group ===
|
|
539
|
-
|
|
540
|
-
e.push({ type: "group", group:
|
|
537
|
+
const i = t[n];
|
|
538
|
+
if (i.group) {
|
|
539
|
+
const a = i.group, s = [];
|
|
540
|
+
for (; n < t.length && t[n].group === a; )
|
|
541
|
+
s.push(t[n]), n += 1;
|
|
542
|
+
e.push({ type: "group", group: a, fields: s });
|
|
541
543
|
continue;
|
|
542
544
|
}
|
|
543
|
-
e.push({ type: "field", field:
|
|
545
|
+
e.push({ type: "field", field: i }), n += 1;
|
|
544
546
|
}
|
|
545
547
|
return e;
|
|
546
548
|
}
|
|
547
|
-
function
|
|
549
|
+
function Ue({
|
|
548
550
|
htmlFor: t,
|
|
549
551
|
children: e,
|
|
550
552
|
className: n,
|
|
551
|
-
required:
|
|
553
|
+
required: i
|
|
552
554
|
}) {
|
|
553
|
-
return /* @__PURE__ */
|
|
555
|
+
return /* @__PURE__ */ g("label", { htmlFor: t, className: P("usgb-field-label", n), children: [
|
|
554
556
|
e,
|
|
555
|
-
|
|
557
|
+
i ? /* @__PURE__ */ l("span", { className: "usgb-field-label-asterisk", "aria-hidden": "true", children: "*" }) : null
|
|
556
558
|
] });
|
|
557
559
|
}
|
|
558
|
-
function
|
|
560
|
+
function Ie(t) {
|
|
559
561
|
return t.replace(/\b\w/g, (e) => e.toUpperCase());
|
|
560
562
|
}
|
|
561
|
-
const
|
|
563
|
+
const Ae = $(
|
|
562
564
|
function({
|
|
563
565
|
id: e,
|
|
564
566
|
label: n,
|
|
565
|
-
type:
|
|
566
|
-
errorMessage:
|
|
567
|
-
required:
|
|
568
|
-
hideLabel:
|
|
569
|
-
placeholderCase:
|
|
567
|
+
type: i = "text",
|
|
568
|
+
errorMessage: a,
|
|
569
|
+
required: s,
|
|
570
|
+
hideLabel: r = !1,
|
|
571
|
+
placeholderCase: o = "upper",
|
|
570
572
|
showError: c = !0,
|
|
571
|
-
className:
|
|
573
|
+
className: u,
|
|
572
574
|
placeholder: f,
|
|
573
|
-
...
|
|
574
|
-
},
|
|
575
|
-
const
|
|
576
|
-
return /* @__PURE__ */
|
|
577
|
-
/* @__PURE__ */
|
|
578
|
-
|
|
575
|
+
...b
|
|
576
|
+
}, y) {
|
|
577
|
+
const p = a ? `${e}-error` : void 0, _ = r ? `${n}${s ? "*" : ""}` : f, m = r && _ ? o === "title" ? Ie(_) : _.toUpperCase() : _;
|
|
578
|
+
return /* @__PURE__ */ g("div", { className: "usgb-form-group", children: [
|
|
579
|
+
/* @__PURE__ */ l(
|
|
580
|
+
Ue,
|
|
579
581
|
{
|
|
580
582
|
htmlFor: e,
|
|
581
|
-
required:
|
|
582
|
-
className:
|
|
583
|
+
required: s,
|
|
584
|
+
className: r ? "usgb-field-label--sr-only" : void 0,
|
|
583
585
|
children: n
|
|
584
586
|
}
|
|
585
587
|
),
|
|
586
|
-
/* @__PURE__ */
|
|
588
|
+
/* @__PURE__ */ l(
|
|
587
589
|
"input",
|
|
588
590
|
{
|
|
589
|
-
ref:
|
|
591
|
+
ref: y,
|
|
590
592
|
id: e,
|
|
591
|
-
type:
|
|
592
|
-
className:
|
|
593
|
+
type: i,
|
|
594
|
+
className: P(
|
|
593
595
|
"usgb-field-control",
|
|
594
|
-
|
|
595
|
-
|
|
596
|
+
a && "usgb-field-invalid",
|
|
597
|
+
u
|
|
596
598
|
),
|
|
597
599
|
placeholder: m,
|
|
598
|
-
"aria-invalid":
|
|
599
|
-
"aria-describedby":
|
|
600
|
-
"aria-required":
|
|
601
|
-
...
|
|
600
|
+
"aria-invalid": a ? !0 : void 0,
|
|
601
|
+
"aria-describedby": p,
|
|
602
|
+
"aria-required": s || void 0,
|
|
603
|
+
...b
|
|
602
604
|
}
|
|
603
605
|
),
|
|
604
|
-
c ? /* @__PURE__ */
|
|
606
|
+
c ? /* @__PURE__ */ l(K, { id: p, message: a }) : null
|
|
605
607
|
] });
|
|
606
608
|
}
|
|
607
609
|
);
|
|
608
|
-
function
|
|
610
|
+
function M({
|
|
609
611
|
fieldRef: t,
|
|
610
612
|
fieldIds: e,
|
|
611
613
|
register: n,
|
|
612
|
-
errors:
|
|
613
|
-
hideLabel:
|
|
614
|
-
placeholderCase:
|
|
615
|
-
showError:
|
|
614
|
+
errors: i,
|
|
615
|
+
hideLabel: a,
|
|
616
|
+
placeholderCase: s,
|
|
617
|
+
showError: r = !0
|
|
616
618
|
}) {
|
|
617
|
-
const
|
|
618
|
-
if (!
|
|
619
|
-
const c =
|
|
620
|
-
return /* @__PURE__ */
|
|
621
|
-
|
|
619
|
+
const o = B(t.name);
|
|
620
|
+
if (!o) return null;
|
|
621
|
+
const c = i[t.name], u = typeof (c == null ? void 0 : c.message) == "string" ? c.message : void 0;
|
|
622
|
+
return /* @__PURE__ */ l(
|
|
623
|
+
Ae,
|
|
622
624
|
{
|
|
623
625
|
id: e[t.name],
|
|
624
|
-
label:
|
|
625
|
-
type:
|
|
626
|
+
label: o.label,
|
|
627
|
+
type: o.control,
|
|
626
628
|
required: t.required,
|
|
627
|
-
hideLabel:
|
|
628
|
-
placeholderCase:
|
|
629
|
-
showError:
|
|
630
|
-
autoComplete:
|
|
631
|
-
errorMessage:
|
|
629
|
+
hideLabel: a,
|
|
630
|
+
placeholderCase: s,
|
|
631
|
+
showError: r,
|
|
632
|
+
autoComplete: o.autoComplete,
|
|
633
|
+
errorMessage: u,
|
|
632
634
|
...n(t.name, {
|
|
633
|
-
validate: (f) =>
|
|
635
|
+
validate: (f) => o.validate(
|
|
634
636
|
typeof f == "string" ? f : "",
|
|
635
637
|
t.required
|
|
636
638
|
)
|
|
@@ -638,400 +640,415 @@ function B({
|
|
|
638
640
|
}
|
|
639
641
|
);
|
|
640
642
|
}
|
|
641
|
-
function
|
|
643
|
+
function Ve({
|
|
642
644
|
definition: t,
|
|
643
645
|
variants: e,
|
|
644
646
|
ctaLabel: n,
|
|
645
|
-
legalUrls:
|
|
646
|
-
session:
|
|
647
|
+
legalUrls: i,
|
|
648
|
+
session: a
|
|
647
649
|
}) {
|
|
648
|
-
const { register:
|
|
649
|
-
() =>
|
|
650
|
+
const { register: s, errors: r, fieldIds: o, consentDefs: c, uiState: u, onSubmit: f } = a, b = D(
|
|
651
|
+
() => Te(t.fields),
|
|
650
652
|
[t.fields]
|
|
651
|
-
),
|
|
652
|
-
return /* @__PURE__ */
|
|
653
|
-
|
|
653
|
+
), y = e.includes("sidebar"), p = e.includes("dense") || y, _ = y ? "title" : "upper";
|
|
654
|
+
return /* @__PURE__ */ g("form", { onSubmit: f, noValidate: !0, children: [
|
|
655
|
+
b.map((m) => m.type === "group" ? /* @__PURE__ */ l(
|
|
654
656
|
"div",
|
|
655
657
|
{
|
|
656
658
|
className: "usgb-form-grid",
|
|
657
|
-
children: m.fields.map((
|
|
658
|
-
|
|
659
|
+
children: m.fields.map((d) => /* @__PURE__ */ l(
|
|
660
|
+
M,
|
|
659
661
|
{
|
|
660
|
-
fieldRef:
|
|
661
|
-
fieldIds:
|
|
662
|
-
register:
|
|
663
|
-
errors:
|
|
664
|
-
hideLabel:
|
|
665
|
-
placeholderCase:
|
|
662
|
+
fieldRef: d,
|
|
663
|
+
fieldIds: o,
|
|
664
|
+
register: s,
|
|
665
|
+
errors: r,
|
|
666
|
+
hideLabel: p,
|
|
667
|
+
placeholderCase: _
|
|
666
668
|
},
|
|
667
|
-
|
|
669
|
+
d.name
|
|
668
670
|
))
|
|
669
671
|
},
|
|
670
|
-
`group-${m.group}-${m.fields.map((
|
|
671
|
-
) : /* @__PURE__ */
|
|
672
|
-
|
|
672
|
+
`group-${m.group}-${m.fields.map((d) => d.name).join("-")}`
|
|
673
|
+
) : /* @__PURE__ */ l(
|
|
674
|
+
M,
|
|
673
675
|
{
|
|
674
676
|
fieldRef: m.field,
|
|
675
|
-
fieldIds:
|
|
676
|
-
register:
|
|
677
|
-
errors:
|
|
678
|
-
hideLabel:
|
|
679
|
-
placeholderCase:
|
|
677
|
+
fieldIds: o,
|
|
678
|
+
register: s,
|
|
679
|
+
errors: r,
|
|
680
|
+
hideLabel: p,
|
|
681
|
+
placeholderCase: _
|
|
680
682
|
},
|
|
681
683
|
m.field.name
|
|
682
684
|
)),
|
|
683
|
-
c
|
|
684
|
-
const
|
|
685
|
-
m.
|
|
686
|
-
|
|
685
|
+
c.map((m) => {
|
|
686
|
+
const { content: d } = j(
|
|
687
|
+
m.copy,
|
|
688
|
+
i ?? {}
|
|
687
689
|
);
|
|
688
690
|
if (m.type === "notice")
|
|
689
|
-
return /* @__PURE__ */
|
|
691
|
+
return /* @__PURE__ */ l(
|
|
690
692
|
"p",
|
|
691
693
|
{
|
|
692
694
|
className: "usgb-consent-copy usgb-consent-notice",
|
|
693
|
-
children:
|
|
695
|
+
children: d
|
|
694
696
|
},
|
|
695
|
-
|
|
697
|
+
m.definitionId
|
|
696
698
|
);
|
|
697
|
-
const
|
|
698
|
-
return /* @__PURE__ */
|
|
699
|
-
|
|
699
|
+
const q = r[m.name], h = typeof (q == null ? void 0 : q.message) == "string" ? q.message : void 0;
|
|
700
|
+
return /* @__PURE__ */ l(
|
|
701
|
+
Fe,
|
|
700
702
|
{
|
|
701
|
-
id:
|
|
702
|
-
label:
|
|
703
|
+
id: o[m.name],
|
|
704
|
+
label: d,
|
|
703
705
|
required: m.required,
|
|
704
|
-
errorMessage:
|
|
705
|
-
...
|
|
706
|
+
errorMessage: h,
|
|
707
|
+
...s(m.name, {
|
|
706
708
|
required: m.required ? "This field is required" : !1
|
|
707
709
|
})
|
|
708
710
|
},
|
|
709
711
|
m.name
|
|
710
712
|
);
|
|
711
|
-
})
|
|
712
|
-
/* @__PURE__ */
|
|
713
|
-
|
|
713
|
+
}),
|
|
714
|
+
/* @__PURE__ */ l(Y, { type: "submit", loading: u.kind === "submitting", children: n }),
|
|
715
|
+
u.kind === "failed" ? /* @__PURE__ */ l(
|
|
714
716
|
"p",
|
|
715
717
|
{
|
|
716
718
|
className: "usgb-form-status usgb-form-status-error",
|
|
717
719
|
role: "alert",
|
|
718
|
-
children:
|
|
720
|
+
children: u.message ?? "Something went wrong. Please try again."
|
|
719
721
|
}
|
|
720
722
|
) : null
|
|
721
723
|
] });
|
|
722
724
|
}
|
|
723
|
-
function
|
|
725
|
+
function Re({
|
|
724
726
|
definition: t,
|
|
725
727
|
ctaLabel: e,
|
|
726
728
|
session: n
|
|
727
729
|
}) {
|
|
728
730
|
var f;
|
|
729
|
-
const { register:
|
|
730
|
-
return c ? /* @__PURE__ */
|
|
731
|
-
/* @__PURE__ */
|
|
732
|
-
/* @__PURE__ */
|
|
733
|
-
|
|
731
|
+
const { register: i, errors: a, fieldIds: s, uiState: r, onSubmit: o } = n, c = t.fields.find((b) => b.name === "email"), u = typeof ((f = a.email) == null ? void 0 : f.message) == "string" ? a.email.message : void 0;
|
|
732
|
+
return c ? /* @__PURE__ */ g("form", { onSubmit: o, noValidate: !0, children: [
|
|
733
|
+
/* @__PURE__ */ g("div", { className: "usgb-form-inline", children: [
|
|
734
|
+
/* @__PURE__ */ l(
|
|
735
|
+
M,
|
|
734
736
|
{
|
|
735
737
|
fieldRef: c,
|
|
736
|
-
fieldIds:
|
|
737
|
-
register:
|
|
738
|
-
errors:
|
|
738
|
+
fieldIds: s,
|
|
739
|
+
register: i,
|
|
740
|
+
errors: a,
|
|
739
741
|
hideLabel: !0,
|
|
740
742
|
placeholderCase: "upper",
|
|
741
743
|
showError: !1
|
|
742
744
|
}
|
|
743
745
|
),
|
|
744
|
-
/* @__PURE__ */
|
|
746
|
+
/* @__PURE__ */ l(Y, { type: "submit", loading: r.kind === "submitting", children: e })
|
|
745
747
|
] }),
|
|
746
|
-
/* @__PURE__ */
|
|
748
|
+
/* @__PURE__ */ l(
|
|
747
749
|
K,
|
|
748
750
|
{
|
|
749
|
-
id:
|
|
750
|
-
message:
|
|
751
|
+
id: u ? `${s.email}-error` : void 0,
|
|
752
|
+
message: u
|
|
751
753
|
}
|
|
752
754
|
),
|
|
753
|
-
|
|
755
|
+
r.kind === "failed" ? /* @__PURE__ */ l(
|
|
754
756
|
"p",
|
|
755
757
|
{
|
|
756
758
|
className: "usgb-form-status usgb-form-status-error",
|
|
757
759
|
role: "alert",
|
|
758
|
-
children:
|
|
760
|
+
children: r.message ?? "Something went wrong. Please try again."
|
|
759
761
|
}
|
|
760
762
|
) : null
|
|
761
|
-
] }) : /* @__PURE__ */
|
|
763
|
+
] }) : /* @__PURE__ */ l("p", { className: "usgb-form-status usgb-form-status-error", role: "alert", children: "Newsletter kind requires an email field" });
|
|
762
764
|
}
|
|
763
|
-
const
|
|
764
|
-
lead:
|
|
765
|
-
newsletter:
|
|
766
|
-
},
|
|
767
|
-
function
|
|
765
|
+
const Z = {
|
|
766
|
+
lead: Ve,
|
|
767
|
+
newsletter: Re
|
|
768
|
+
}, Me = "Thank you. Your request has been accepted and is being processed.";
|
|
769
|
+
function E({
|
|
768
770
|
className: t,
|
|
769
771
|
appearance: e,
|
|
770
772
|
variantValue: n,
|
|
771
|
-
kind:
|
|
772
|
-
children:
|
|
773
|
+
kind: i,
|
|
774
|
+
children: a
|
|
773
775
|
}) {
|
|
774
|
-
return /* @__PURE__ */
|
|
775
|
-
|
|
776
|
+
return /* @__PURE__ */ l(
|
|
777
|
+
V,
|
|
776
778
|
{
|
|
777
779
|
className: t,
|
|
778
780
|
appearance: e,
|
|
779
781
|
variantValue: n,
|
|
780
|
-
kind:
|
|
781
|
-
children: /* @__PURE__ */
|
|
782
|
+
kind: i,
|
|
783
|
+
children: /* @__PURE__ */ l("p", { className: "usgb-form-status usgb-form-status-error", role: "alert", children: a })
|
|
782
784
|
}
|
|
783
785
|
);
|
|
784
786
|
}
|
|
785
|
-
function
|
|
787
|
+
function $e({
|
|
786
788
|
formId: t,
|
|
787
789
|
definition: e,
|
|
788
790
|
appearance: n,
|
|
789
|
-
variants:
|
|
790
|
-
variantValue:
|
|
791
|
-
heading:
|
|
792
|
-
subheading:
|
|
793
|
-
ctaLabel:
|
|
791
|
+
variants: i,
|
|
792
|
+
variantValue: a,
|
|
793
|
+
heading: s,
|
|
794
|
+
subheading: r,
|
|
795
|
+
ctaLabel: o,
|
|
794
796
|
source: c,
|
|
795
|
-
campaign:
|
|
797
|
+
campaign: u,
|
|
796
798
|
legalUrls: f,
|
|
797
|
-
successMessage:
|
|
798
|
-
successUrl:
|
|
799
|
-
adapter:
|
|
800
|
-
analytics:
|
|
799
|
+
successMessage: b,
|
|
800
|
+
successUrl: y,
|
|
801
|
+
adapter: p,
|
|
802
|
+
analytics: _,
|
|
801
803
|
className: m,
|
|
802
|
-
onAccepted:
|
|
803
|
-
onFailed:
|
|
804
|
+
onAccepted: d,
|
|
805
|
+
onFailed: q
|
|
804
806
|
}) {
|
|
805
|
-
const
|
|
807
|
+
const h = De({
|
|
806
808
|
formId: t,
|
|
807
809
|
definition: e,
|
|
808
|
-
variantValue:
|
|
810
|
+
variantValue: a,
|
|
809
811
|
source: c,
|
|
810
|
-
campaign:
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
812
|
+
campaign: u,
|
|
813
|
+
legalUrls: f,
|
|
814
|
+
successUrl: y,
|
|
815
|
+
adapter: p,
|
|
816
|
+
analytics: _,
|
|
817
|
+
onAccepted: d,
|
|
818
|
+
onFailed: q
|
|
816
819
|
});
|
|
817
|
-
if (
|
|
818
|
-
const
|
|
819
|
-
return /* @__PURE__ */
|
|
820
|
-
|
|
820
|
+
if (h.uiState.kind === "accepted") {
|
|
821
|
+
const x = !!R(y);
|
|
822
|
+
return /* @__PURE__ */ g(
|
|
823
|
+
V,
|
|
821
824
|
{
|
|
822
825
|
className: m,
|
|
823
826
|
appearance: n,
|
|
824
|
-
variantValue:
|
|
827
|
+
variantValue: a,
|
|
825
828
|
kind: e.kind,
|
|
826
829
|
children: [
|
|
827
|
-
|
|
828
|
-
|
|
830
|
+
s ? /* @__PURE__ */ l("h2", { className: "usgb-form-heading", children: s }) : null,
|
|
831
|
+
x ? null : /* @__PURE__ */ l(
|
|
829
832
|
"p",
|
|
830
833
|
{
|
|
831
834
|
className: "usgb-form-status usgb-form-status-success",
|
|
832
835
|
role: "status",
|
|
833
|
-
children:
|
|
836
|
+
children: R(b) ?? Me
|
|
834
837
|
}
|
|
835
838
|
)
|
|
836
839
|
]
|
|
837
840
|
}
|
|
838
841
|
);
|
|
839
842
|
}
|
|
840
|
-
const
|
|
841
|
-
return /* @__PURE__ */
|
|
842
|
-
|
|
843
|
+
const L = Z[e.kind];
|
|
844
|
+
return /* @__PURE__ */ g(
|
|
845
|
+
V,
|
|
843
846
|
{
|
|
844
847
|
className: m,
|
|
845
848
|
appearance: n,
|
|
846
|
-
variantValue:
|
|
849
|
+
variantValue: a,
|
|
847
850
|
kind: e.kind,
|
|
848
851
|
children: [
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
/* @__PURE__ */
|
|
852
|
-
|
|
852
|
+
s ? /* @__PURE__ */ l("h2", { className: "usgb-form-heading", children: s }) : null,
|
|
853
|
+
r ? /* @__PURE__ */ l("p", { className: "usgb-form-subheading", children: r }) : null,
|
|
854
|
+
/* @__PURE__ */ l(
|
|
855
|
+
L,
|
|
853
856
|
{
|
|
854
857
|
definition: e,
|
|
855
|
-
variants:
|
|
856
|
-
ctaLabel:
|
|
858
|
+
variants: i,
|
|
859
|
+
ctaLabel: o,
|
|
857
860
|
legalUrls: f,
|
|
858
|
-
session:
|
|
861
|
+
session: h
|
|
859
862
|
}
|
|
860
863
|
)
|
|
861
864
|
]
|
|
862
865
|
}
|
|
863
866
|
);
|
|
864
867
|
}
|
|
865
|
-
function
|
|
868
|
+
function We({
|
|
866
869
|
formId: t,
|
|
867
870
|
appearance: e = "on-light",
|
|
868
871
|
variants: n = ["dense"],
|
|
869
|
-
heading:
|
|
870
|
-
subheading:
|
|
871
|
-
ctaLabel:
|
|
872
|
-
source:
|
|
873
|
-
campaign:
|
|
872
|
+
heading: i,
|
|
873
|
+
subheading: a,
|
|
874
|
+
ctaLabel: s,
|
|
875
|
+
source: r,
|
|
876
|
+
campaign: o,
|
|
874
877
|
legalUrls: c,
|
|
875
|
-
successMessage:
|
|
878
|
+
successMessage: u,
|
|
876
879
|
successUrl: f,
|
|
877
|
-
adapter:
|
|
878
|
-
analytics:
|
|
879
|
-
className:
|
|
880
|
-
onAccepted:
|
|
880
|
+
adapter: b,
|
|
881
|
+
analytics: y,
|
|
882
|
+
className: p,
|
|
883
|
+
onAccepted: _,
|
|
881
884
|
onFailed: m
|
|
882
885
|
}) {
|
|
883
|
-
const
|
|
884
|
-
if (!
|
|
885
|
-
return /* @__PURE__ */
|
|
886
|
-
|
|
886
|
+
const d = ue(t), h = (d == null ? void 0 : d.kind) === "newsletter" ? "" : n.join(" ");
|
|
887
|
+
if (!d)
|
|
888
|
+
return /* @__PURE__ */ g(
|
|
889
|
+
E,
|
|
887
890
|
{
|
|
888
|
-
className:
|
|
891
|
+
className: p,
|
|
889
892
|
appearance: e,
|
|
890
|
-
variantValue:
|
|
893
|
+
variantValue: h,
|
|
891
894
|
children: [
|
|
892
895
|
"Unknown form definition: ",
|
|
893
896
|
t
|
|
894
897
|
]
|
|
895
898
|
}
|
|
896
899
|
);
|
|
897
|
-
const
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
if (q && !C)
|
|
902
|
-
return /* @__PURE__ */ p(
|
|
903
|
-
F,
|
|
900
|
+
const L = W(d.consents);
|
|
901
|
+
if (L === null)
|
|
902
|
+
return /* @__PURE__ */ g(
|
|
903
|
+
E,
|
|
904
904
|
{
|
|
905
|
-
className:
|
|
905
|
+
className: p,
|
|
906
906
|
appearance: e,
|
|
907
|
-
variantValue:
|
|
908
|
-
kind:
|
|
907
|
+
variantValue: h,
|
|
908
|
+
kind: d.kind,
|
|
909
909
|
children: [
|
|
910
910
|
"Missing consent definition for ",
|
|
911
911
|
t
|
|
912
912
|
]
|
|
913
913
|
}
|
|
914
914
|
);
|
|
915
|
-
const
|
|
916
|
-
(
|
|
917
|
-
var
|
|
918
|
-
return !((
|
|
915
|
+
const w = ke(L).filter(
|
|
916
|
+
(N) => {
|
|
917
|
+
var F;
|
|
918
|
+
return !((F = c == null ? void 0 : c[N]) != null && F.trim());
|
|
919
919
|
}
|
|
920
|
-
)
|
|
921
|
-
if (
|
|
922
|
-
return /* @__PURE__ */
|
|
923
|
-
|
|
920
|
+
);
|
|
921
|
+
if (w.length)
|
|
922
|
+
return /* @__PURE__ */ g(
|
|
923
|
+
E,
|
|
924
924
|
{
|
|
925
|
-
className:
|
|
925
|
+
className: p,
|
|
926
926
|
appearance: e,
|
|
927
|
-
variantValue:
|
|
928
|
-
kind:
|
|
927
|
+
variantValue: h,
|
|
928
|
+
kind: d.kind,
|
|
929
929
|
children: [
|
|
930
930
|
"Missing legal URL(s) for ",
|
|
931
931
|
t,
|
|
932
932
|
": ",
|
|
933
|
-
|
|
933
|
+
w.join(", ")
|
|
934
934
|
]
|
|
935
935
|
}
|
|
936
936
|
);
|
|
937
|
-
const
|
|
938
|
-
(
|
|
937
|
+
const v = d.fields.filter(
|
|
938
|
+
(N) => !B(N.name)
|
|
939
939
|
);
|
|
940
|
-
return
|
|
941
|
-
|
|
940
|
+
return v.length ? /* @__PURE__ */ g(
|
|
941
|
+
E,
|
|
942
942
|
{
|
|
943
|
-
className:
|
|
943
|
+
className: p,
|
|
944
944
|
appearance: e,
|
|
945
|
-
variantValue:
|
|
946
|
-
kind:
|
|
945
|
+
variantValue: h,
|
|
946
|
+
kind: d.kind,
|
|
947
947
|
children: [
|
|
948
948
|
"Unknown field(s) in ",
|
|
949
949
|
t,
|
|
950
950
|
":",
|
|
951
951
|
" ",
|
|
952
|
-
|
|
952
|
+
v.map((N) => N.name).join(", ")
|
|
953
953
|
]
|
|
954
954
|
}
|
|
955
|
-
) :
|
|
956
|
-
|
|
955
|
+
) : d.kind in Z ? /* @__PURE__ */ l(
|
|
956
|
+
$e,
|
|
957
957
|
{
|
|
958
958
|
formId: t,
|
|
959
|
-
definition:
|
|
959
|
+
definition: d,
|
|
960
960
|
appearance: e,
|
|
961
961
|
variants: n,
|
|
962
|
-
variantValue:
|
|
963
|
-
heading:
|
|
964
|
-
subheading:
|
|
965
|
-
ctaLabel:
|
|
966
|
-
source:
|
|
967
|
-
campaign:
|
|
962
|
+
variantValue: h,
|
|
963
|
+
heading: i,
|
|
964
|
+
subheading: a,
|
|
965
|
+
ctaLabel: s ?? d.ctaLabel,
|
|
966
|
+
source: r,
|
|
967
|
+
campaign: o,
|
|
968
968
|
legalUrls: c,
|
|
969
|
-
successMessage:
|
|
969
|
+
successMessage: u,
|
|
970
970
|
successUrl: f,
|
|
971
|
-
adapter:
|
|
972
|
-
analytics:
|
|
973
|
-
className:
|
|
974
|
-
onAccepted:
|
|
971
|
+
adapter: b,
|
|
972
|
+
analytics: y,
|
|
973
|
+
className: p,
|
|
974
|
+
onAccepted: _,
|
|
975
975
|
onFailed: m
|
|
976
976
|
}
|
|
977
|
-
) : /* @__PURE__ */
|
|
978
|
-
|
|
977
|
+
) : /* @__PURE__ */ g(
|
|
978
|
+
E,
|
|
979
979
|
{
|
|
980
|
-
className:
|
|
980
|
+
className: p,
|
|
981
981
|
appearance: e,
|
|
982
|
-
variantValue:
|
|
983
|
-
kind:
|
|
982
|
+
variantValue: h,
|
|
983
|
+
kind: d.kind,
|
|
984
984
|
children: [
|
|
985
985
|
"Missing renderer for kind: ",
|
|
986
|
-
|
|
986
|
+
d.kind
|
|
987
987
|
]
|
|
988
988
|
}
|
|
989
989
|
);
|
|
990
990
|
}
|
|
991
|
-
function
|
|
992
|
-
const e = typeof t == "string" ? { host: t } : t, n = e.host ?? "pwa",
|
|
991
|
+
function ze(t = {}) {
|
|
992
|
+
const e = typeof t == "string" ? { host: t } : t, n = e.host ?? "pwa", i = e.delayMs ?? 400, a = e.result ?? { status: "accepted" };
|
|
993
993
|
return {
|
|
994
994
|
host: n,
|
|
995
995
|
getTrackingHints() {
|
|
996
996
|
if (typeof window > "u") return {};
|
|
997
|
-
const
|
|
997
|
+
const s = new URLSearchParams(window.location.search), r = (o) => s.get(o) ?? void 0;
|
|
998
998
|
return {
|
|
999
|
-
utm_source:
|
|
1000
|
-
utm_medium:
|
|
1001
|
-
utm_campaign:
|
|
1002
|
-
utm_term:
|
|
1003
|
-
utm_content:
|
|
1004
|
-
gclid:
|
|
1005
|
-
msclkid:
|
|
1006
|
-
gbraid:
|
|
1007
|
-
wbraid:
|
|
999
|
+
utm_source: r("utm_source"),
|
|
1000
|
+
utm_medium: r("utm_medium"),
|
|
1001
|
+
utm_campaign: r("utm_campaign"),
|
|
1002
|
+
utm_term: r("utm_term"),
|
|
1003
|
+
utm_content: r("utm_content"),
|
|
1004
|
+
gclid: r("gclid"),
|
|
1005
|
+
msclkid: r("msclkid"),
|
|
1006
|
+
gbraid: r("gbraid"),
|
|
1007
|
+
wbraid: r("wbraid")
|
|
1008
1008
|
};
|
|
1009
1009
|
},
|
|
1010
|
-
async submit(
|
|
1011
|
-
var
|
|
1012
|
-
return (
|
|
1010
|
+
async submit(s) {
|
|
1011
|
+
var r;
|
|
1012
|
+
return (r = e.onSubmit) == null || r.call(e, s), await new Promise((o) => setTimeout(o, i)), a;
|
|
1013
1013
|
}
|
|
1014
1014
|
};
|
|
1015
1015
|
}
|
|
1016
|
+
const Ye = {
|
|
1017
|
+
clientAgreement: "/content/client-agreement",
|
|
1018
|
+
privacyPolicy: "/content/privacy-policy",
|
|
1019
|
+
userAgreement: "/content/user-agreement",
|
|
1020
|
+
marketLossPolicy: "/content/market-loss-policy",
|
|
1021
|
+
electronicDisclaimer: "/content/electronic-disclaimer",
|
|
1022
|
+
termsOfSale: "/content/terms-of-sale"
|
|
1023
|
+
};
|
|
1024
|
+
function Ze(t, e) {
|
|
1025
|
+
return e.every((n) => {
|
|
1026
|
+
var i;
|
|
1027
|
+
return !!((i = t == null ? void 0 : t[n]) != null && i.trim());
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1016
1030
|
export {
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1031
|
+
Y as Button,
|
|
1032
|
+
Fe as ConsentField,
|
|
1033
|
+
qe as FIELD_REGISTRY,
|
|
1020
1034
|
K as FieldError,
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1035
|
+
Ue as FieldLabel,
|
|
1036
|
+
pe as LEAD_CLICKWRAP,
|
|
1037
|
+
fe as LEAD_SMS,
|
|
1038
|
+
me as LEAD_TCPA,
|
|
1039
|
+
ge as LEAD_TOSPP,
|
|
1040
|
+
Ye as PWA_LEGAL_URLS,
|
|
1041
|
+
Ae as TextField,
|
|
1042
|
+
We as UsgbForm,
|
|
1043
|
+
Le as collectTrackingContext,
|
|
1044
|
+
Ne as createIdempotencyKey,
|
|
1045
|
+
ze as createStubAdapter,
|
|
1046
|
+
I as formsManifest,
|
|
1047
|
+
ye as getConsentDefinition,
|
|
1048
|
+
B as getFieldDefinition,
|
|
1049
|
+
ue as getFormDefinition,
|
|
1050
|
+
Ze as isCompleteLegalUrls,
|
|
1051
|
+
He as listFormDefinitions,
|
|
1052
|
+
j as resolveConsentCopy,
|
|
1053
|
+
W as resolveFormConsents
|
|
1037
1054
|
};
|