@usgb/forms 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +131 -142
  2. package/dist/forms-manifest.1.0.4.json +439 -0
  3. package/dist/forms-manifest.json +218 -84
  4. package/dist/index.js +636 -559
  5. package/dist/src/contract/createIdempotencyKey.d.ts +2 -0
  6. package/dist/src/contract/createIdempotencyKey.d.ts.map +1 -0
  7. package/dist/src/contract/createStubAdapter.d.ts.map +1 -1
  8. package/dist/src/contract/types.d.ts +15 -15
  9. package/dist/src/contract/types.d.ts.map +1 -1
  10. package/dist/src/definitions/consents.d.ts +15 -0
  11. package/dist/src/definitions/consents.d.ts.map +1 -1
  12. package/dist/src/definitions/index.d.ts +4 -3
  13. package/dist/src/definitions/index.d.ts.map +1 -1
  14. package/dist/src/definitions/manifest.d.ts +14 -1
  15. package/dist/src/definitions/manifest.d.ts.map +1 -1
  16. package/dist/src/definitions/types.d.ts +35 -5
  17. package/dist/src/definitions/types.d.ts.map +1 -1
  18. package/dist/src/form/FormShell.d.ts +2 -1
  19. package/dist/src/form/FormShell.d.ts.map +1 -1
  20. package/dist/src/form/UsgbForm.d.ts +5 -4
  21. package/dist/src/form/UsgbForm.d.ts.map +1 -1
  22. package/dist/src/form/chunkFields.d.ts +1 -1
  23. package/dist/src/form/kinds/LeadKindForm.d.ts +1 -1
  24. package/dist/src/form/kinds/LeadKindForm.d.ts.map +1 -1
  25. package/dist/src/form/kinds/NewsletterKindForm.d.ts +1 -1
  26. package/dist/src/form/kinds/NewsletterKindForm.d.ts.map +1 -1
  27. package/dist/src/form/kinds/types.d.ts +3 -1
  28. package/dist/src/form/kinds/types.d.ts.map +1 -1
  29. package/dist/src/form/useUsgbFormSession.d.ts +3 -4
  30. package/dist/src/form/useUsgbFormSession.d.ts.map +1 -1
  31. package/dist/src/index.d.ts +5 -5
  32. package/dist/src/index.d.ts.map +1 -1
  33. package/dist/src/ui/Button.d.ts.map +1 -1
  34. package/dist/src/ui/ConsentField.d.ts.map +1 -1
  35. package/dist/usgb-forms.1.0.4.js +44 -0
  36. package/dist/usgb-forms.css +141 -45
  37. package/dist/usgb-forms.js +11 -11
  38. package/forms-manifest.json +218 -84
  39. package/package.json +1 -1
  40. package/dist/forms-manifest.1.0.2.json +0 -305
  41. package/dist/src/contract/collectContext.d.ts +0 -9
  42. package/dist/src/contract/collectContext.d.ts.map +0 -1
  43. package/dist/usgb-forms.1.0.2.js +0 -44
package/dist/index.js CHANGED
@@ -1,51 +1,77 @@
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";
1
+ import { jsx as s, Fragment as ee, jsxs as h } from "react/jsx-runtime";
2
+ import { useId as K, useMemo as D, useState as te, useRef as G, useEffect as j, forwardRef as R } from "react";
3
+ import { validate as ne } from "email-validator";
4
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,
5
+ import T from "classnames";
6
+ const ie = "1.1.0", ae = { version: "1.0.0", transport: "server-proxy" }, oe = { 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"] } }, se = { appearance: { label: "Appearance", control: "select", reactProp: "appearance", attribute: "appearance", required: !1, default: "on-light", valuesFrom: "supportedAppearances", description: "Recolors the form for a light or dark host surface. It never paints a background, padding, or radius — the host container owns those." }, variant: { label: "Size variant", control: "select", reactProp: "variant", attribute: "variant", required: !1, default: "dense", valuesFrom: "supportedVariants", description: "Select exactly one size treatment: `dense`, `large`, or `sidebar`." }, twoColumn: { label: "Two-column name row", control: "checkbox", reactProp: "twoColumn", attribute: "two-column", required: !1, default: !1, description: "Places grouped name fields in two columns when the form container is wide enough." }, heading: { label: "Heading", control: "text", reactProp: "heading", attribute: "heading", required: !1, description: "Placement copy above the fields. Omit to render no heading." }, subheading: { label: "Subheading", control: "text", reactProp: "subheading", attribute: "subheading", required: !1, description: "Supporting copy under the heading. Omit to render none." }, ctaLabel: { label: "Button label", control: "text", reactProp: "ctaLabel", attribute: "cta", required: !1, defaultFrom: "ctaLabel", description: "Overrides the catalog submit label for this placement." }, legalUrls: { label: "Legal document URLs", control: "url-group", reactProp: "legalUrls", attributes: { clientAgreement: "client-agreement-url", privacyPolicy: "privacy-policy-url", userAgreement: "user-agreement-url", marketLossPolicy: "market-loss-policy-url", electronicDisclaimer: "electronic-disclaimer-url", termsOfSale: "terms-of-sale-url" }, required: !0, valuesFrom: "requiredLegalUrls", description: "Host CMS hrefs for the documents named in this form's consent copy. Every key in `requiredLegalUrls` must be a non-empty URL or the form does not render." }, successMessage: { label: "Thank-you message", control: "text", reactProp: "successMessage", attribute: "success-message", required: !1, description: "Inline copy shown after accept. Ignored when a thank-you URL is set; omitted values fall back to a package default line." }, successUrl: { label: "Thank-you URL", control: "url", reactProp: "successUrl", attribute: "success-url", required: !1, description: "Redirect after accept. A full navigation can cut off analytics beacons — prefer measuring the conversion on the thank-you page." } }, le = { "magento-fik": { definitionVersion: "1", kind: "lead", flow: { type: "single" }, fields: [{ name: "firstname", required: !0, group: "name" }, { name: "lastname", required: !0, group: "name" }, { name: "email", required: !0 }, { name: "phone", required: !1 }], 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: "Magento FIK", description: "First name, last name, and email required; phone optional. Optional checkboxes: transactional SMS (lead-tcpa v1), marketing SMS (lead-sms v1), and terms and privacy (lead-tospp v1).", whenToUse: "TBD", whenNotToUse: "TBD", options: ["appearance", "variant", "twoColumn", "heading", "subheading", "ctaLabel", "legalUrls", "successMessage", "successUrl"], supportedAppearances: ["on-light", "on-dark"], supportedVariants: ["dense", "large", "sidebar"], requiredLegalUrls: ["userAgreement", "privacyPolicy"] } }, "magento-ira-kick-article": { definitionVersion: "1", kind: "lead", flow: { type: "single" }, fields: [{ name: "firstname", required: !0, group: "name" }, { name: "lastname", required: !0, group: "name" }, { name: "email", required: !0 }, { name: "phone", required: !0 }], ctaLabel: "GET MY FREE GUIDE", consents: [{ definitionId: "lead-tcpa", definitionVersion: "2", required: !1 }], editor: { label: "Magento IRA Kick Article", description: "First name, last name, email, and phone required. Optional telephone and SMS consent checkbox with linked terms and privacy (lead-tcpa v2).", whenToUse: "TBD", whenNotToUse: "TBD", options: ["appearance", "variant", "twoColumn", "heading", "subheading", "ctaLabel", "legalUrls", "successMessage", "successUrl"], supportedAppearances: ["on-light", "on-dark"], supportedVariants: ["dense", "large", "sidebar"], requiredLegalUrls: ["userAgreement", "privacyPolicy"] } }, "magento-fik-blog-rail": { definitionVersion: "1", kind: "lead", flow: { type: "single" }, fields: [{ name: "firstname", required: !0, group: "name" }, { name: "lastname", required: !0, group: "name" }, { name: "email", required: !0 }, { name: "phone", required: !0 }], ctaLabel: "GET MY FREE GUIDE", consents: [{ definitionId: "lead-tcpa", definitionVersion: "3", required: !0 }], editor: { label: "Magento FIK Blog Rail", description: "First name, last name, email, and phone required. Required automated text-message consent checkbox with linked terms of service and privacy policy (lead-tcpa v3).", whenToUse: "TBD", whenNotToUse: "TBD", options: ["appearance", "variant", "twoColumn", "heading", "subheading", "ctaLabel", "legalUrls", "successMessage", "successUrl"], supportedAppearances: ["on-light", "on-dark"], supportedVariants: ["dense", "large", "sidebar"], requiredLegalUrls: ["userAgreement", "privacyPolicy"] } }, "main-investors-kit-notice": { definitionVersion: "1", kind: "lead", flow: { type: "single" }, fields: [{ name: "firstname", required: !0, group: "name" }, { name: "lastname", required: !0, group: "name" }, { name: "email", required: !0 }, { name: "phone", required: !1 }], ctaLabel: "CLAIM YOUR OFFER", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "Main Investors Kit (clickwrap)", description: "First name, last name, and email required; phone optional. Clickwrap notice only (lead-clickwrap v2); no consent checkboxes.", whenToUse: "TBD", whenNotToUse: "TBD", options: ["appearance", "variant", "twoColumn", "heading", "subheading", "ctaLabel", "legalUrls", "successMessage", "successUrl"], supportedAppearances: ["on-light", "on-dark"], supportedVariants: ["dense", "large", "sidebar"], requiredLegalUrls: ["privacyPolicy", "userAgreement"] } }, newsletter: { definitionVersion: "1", kind: "newsletter", flow: { type: "single" }, fields: [{ name: "email", required: !0 }], ctaLabel: "SUBSCRIBE", editor: { label: "Newsletter", description: "Email only. No consent.", whenToUse: "TBD", whenNotToUse: "TBD", options: ["appearance", "heading", "subheading", "ctaLabel", "successMessage", "successUrl"], supportedAppearances: ["on-light", "on-dark"], supportedVariants: [], requiredLegalUrls: [] } } }, ce = { hosts: ["pwa", "wordpress"], mayProvide: ["legal document URLs", "host/store identity"], mustNotDefine: ["consent definitions", "form fields", "submission endpoints"] }, de = {
7
+ schemaVersion: ie,
8
8
  package: { name: "@usgb/forms", compatiblePackageVersions: "^1.0.2" },
9
- submissionContract: se,
10
- trackingRegistry: ae,
9
+ submissionContract: ae,
10
+ trackingRegistry: oe,
11
+ editorOptions: se,
11
12
  forms: le,
12
13
  hostAdapterContract: ce
13
- }, I = de;
14
- function ue(t) {
15
- return I.forms[t];
14
+ }, x = de;
15
+ function z(t) {
16
+ return x.forms[t];
16
17
  }
17
- function He() {
18
- return Object.entries(I.forms).map(([t, e]) => ({
18
+ function ze() {
19
+ return Object.entries(x.forms).map(([t, e]) => ({
19
20
  formId: t,
20
21
  definition: e
21
22
  }));
22
23
  }
23
- function j(t, e) {
24
+ function We(t) {
25
+ const e = z(t);
26
+ if (!e)
27
+ return [];
28
+ const n = [];
29
+ for (const i of e.editor.options) {
30
+ const a = x.editorOptions[i];
31
+ if (!a)
32
+ continue;
33
+ const r = a.valuesFrom ? [...e.editor[a.valuesFrom]] : void 0;
34
+ r && !r.length || n.push({
35
+ ...a,
36
+ key: i,
37
+ values: r,
38
+ defaultValue: a.defaultFrom ? e[a.defaultFrom] : a.default
39
+ });
40
+ }
41
+ return n;
42
+ }
43
+ function W(t, e) {
24
44
  return typeof t == "string" ? { content: t, language: t } : t(e);
25
45
  }
26
- function G(t, e) {
46
+ function H(t, e) {
27
47
  return `${t}@${e}`;
28
48
  }
29
- function H(t) {
49
+ function E(t) {
30
50
  return (e) => ({
31
51
  language: t.map(
32
52
  (n) => typeof n == "string" ? n : `${n.label} (${e[n.href] ?? ""})`
33
53
  ).join(""),
34
- content: /* @__PURE__ */ l(X, { children: t.map(
35
- (n, i) => typeof n == "string" ? n : /* @__PURE__ */ l(
54
+ content: /* @__PURE__ */ s(ee, { children: t.map(
55
+ (n, i) => typeof n == "string" ? n : /* @__PURE__ */ h(
36
56
  "a",
37
57
  {
38
58
  href: e[n.href],
39
59
  target: "_blank",
40
60
  rel: "noreferrer",
41
- children: n.label
61
+ children: [
62
+ n.label,
63
+ /* @__PURE__ */ h("span", { className: "usgb-field-label--sr-only", children: [
64
+ " ",
65
+ "(opens in a new tab)"
66
+ ] })
67
+ ]
42
68
  },
43
69
  `${n.href}-${i}`
44
70
  )
45
71
  ) })
46
72
  });
47
73
  }
48
- const me = {
74
+ const ue = {
49
75
  definitionId: "lead-tcpa",
50
76
  definitionVersion: "1",
51
77
  type: "checkbox",
@@ -54,6 +80,36 @@ const me = {
54
80
  requiredLegalUrls: [],
55
81
  languageKey: "tcpa_consent_language",
56
82
  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"
83
+ }, me = {
84
+ definitionId: "lead-tcpa",
85
+ definitionVersion: "2",
86
+ type: "checkbox",
87
+ name: "tcpa_form_consent_granted",
88
+ grantDateField: "tcpa_form_opt_in_date",
89
+ requiredLegalUrls: ["userAgreement", "privacyPolicy"],
90
+ languageKey: "tcpa_consent_language",
91
+ copy: E([
92
+ "By checking the box you authorize United States Gold Bureau to provide you with telephone calls or SMS messages at the phone number provided, including the use of automatic telephone dialing systems, and you agree to our ",
93
+ { href: "userAgreement", label: "terms and conditions" },
94
+ " and ",
95
+ { href: "privacyPolicy", label: "privacy policy" },
96
+ ". Calls are recorded and may be monitored."
97
+ ])
98
+ }, pe = {
99
+ definitionId: "lead-tcpa",
100
+ definitionVersion: "3",
101
+ type: "checkbox",
102
+ name: "tcpa_form_consent_granted",
103
+ grantDateField: "tcpa_form_opt_in_date",
104
+ requiredLegalUrls: ["userAgreement", "privacyPolicy"],
105
+ languageKey: "tcpa_consent_language",
106
+ copy: E([
107
+ "I agree to receive automated text messages from the US Gold Bureau at the phone number provided. Msg & data rates may apply. Msg frequency varies. Reply HELP for help and STOP to cancel. View our ",
108
+ { href: "userAgreement", label: "Terms of Service" },
109
+ " and ",
110
+ { href: "privacyPolicy", label: "Privacy Policy" },
111
+ "."
112
+ ])
57
113
  }, fe = {
58
114
  definitionId: "lead-sms",
59
115
  definitionVersion: "1",
@@ -69,14 +125,14 @@ const me = {
69
125
  name: "tospp_form_consent_granted",
70
126
  requiredLegalUrls: ["userAgreement", "privacyPolicy"],
71
127
  languageKey: "tospp_consent_language",
72
- copy: H([
128
+ copy: E([
73
129
  "By checking, I accept ",
74
130
  { href: "userAgreement", label: "Terms of Conditions" },
75
131
  " & ",
76
132
  { href: "privacyPolicy", label: "Privacy Policy" },
77
133
  "."
78
134
  ])
79
- }, pe = {
135
+ }, he = {
80
136
  definitionId: "lead-clickwrap",
81
137
  definitionVersion: "1",
82
138
  type: "notice",
@@ -88,7 +144,7 @@ const me = {
88
144
  "termsOfSale"
89
145
  ],
90
146
  languageKey: "clickwrap_consent_language",
91
- copy: H([
147
+ copy: E([
92
148
  "By clicking the button, I agree to be bound by your ",
93
149
  { href: "privacyPolicy", label: "Privacy Policy" },
94
150
  ", ",
@@ -101,30 +157,46 @@ const me = {
101
157
  { href: "termsOfSale", label: "Terms & Conditions of Sale" },
102
158
  "."
103
159
  ])
160
+ }, be = {
161
+ definitionId: "lead-clickwrap",
162
+ definitionVersion: "2",
163
+ type: "notice",
164
+ requiredLegalUrls: ["privacyPolicy", "userAgreement"],
165
+ languageKey: "clickwrap_consent_language",
166
+ copy: E([
167
+ "By submitting, you agree to United States Gold Bureau’s ",
168
+ { href: "privacyPolicy", label: "Privacy Policy" },
169
+ " and ",
170
+ { href: "userAgreement", label: "Terms & Conditions" },
171
+ ", including dispute resolution, and consent to receive texts and calls for informational, marketing and sales purposes, even if your number is on a do not call list, using automated dialing, voice or AI tech. Consent not required for purchase. Msg & data rates may apply. Calls may be recorded and monitored. Opt out anytime."
172
+ ])
104
173
  };
105
- function he(...t) {
174
+ function ye(...t) {
106
175
  return Object.fromEntries(
107
176
  t.map((e) => [
108
- G(e.definitionId, e.definitionVersion),
177
+ H(e.definitionId, e.definitionVersion),
109
178
  e
110
179
  ])
111
180
  );
112
181
  }
113
- const be = he(
182
+ const ve = ye(
183
+ ue,
114
184
  me,
185
+ pe,
115
186
  fe,
116
187
  ge,
117
- pe
188
+ he,
189
+ be
118
190
  );
119
- function ye(t, e) {
120
- return be[G(t, e)];
191
+ function ke(t, e) {
192
+ return ve[H(t, e)];
121
193
  }
122
- function W(t) {
194
+ function Y(t) {
123
195
  if (!(t != null && t.length))
124
196
  return [];
125
197
  const e = [];
126
198
  for (const n of t) {
127
- const i = ye(
199
+ const i = ke(
128
200
  n.definitionId,
129
201
  n.definitionVersion
130
202
  );
@@ -136,148 +208,109 @@ function W(t) {
136
208
  }
137
209
  return e;
138
210
  }
139
- function _e(t, e, n, i) {
211
+ function we(t, e, n, i) {
140
212
  if (!t.length)
141
213
  return;
142
214
  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);
215
+ for (const r of t) {
216
+ const { language: l } = W(r.copy, n);
217
+ if (a[r.languageKey] = l, r.type === "checkbox") {
218
+ const o = !!e[r.name];
219
+ a[r.name] = o, o && r.grantDateField && (a[r.grantDateField] = i);
148
220
  }
149
221
  }
150
222
  return a;
151
223
  }
152
- function ke(t) {
224
+ function _e(t) {
153
225
  const e = /* @__PURE__ */ new Set();
154
226
  for (const n of t)
155
227
  for (const i of n.requiredLegalUrls)
156
228
  e.add(i);
157
229
  return [...e];
158
230
  }
159
- function we(t) {
231
+ function qe(t) {
160
232
  return t.type === "checkbox";
161
233
  }
162
- function O(t) {
234
+ function $(t) {
163
235
  return (e, n) => n ? e.trim().length > 0 || `${t} is required` : !0;
164
236
  }
165
- const ve = /^[2-9]\d{2}[2-9]\d{6}$/;
166
- function z(t) {
237
+ const Le = /^[2-9]\d{2}[2-9]\d{6}$/;
238
+ function Z(t) {
167
239
  let e = t.replace(/\D/g, "");
168
- return e.length === 11 && e.startsWith("1") && (e = e.slice(1)), e.length !== 10 || !ve.test(e) ? null : e;
240
+ return e.length === 11 && e.startsWith("1") && (e = e.slice(1)), e.length !== 10 || !Le.test(e) ? null : e;
169
241
  }
170
242
  function Se(t) {
171
243
  const e = t.trim();
172
244
  if (!e) return "";
173
- const n = z(e);
245
+ const n = Z(e);
174
246
  if (!n) return e;
175
247
  const i = e.replace(/\D/g, "");
176
248
  return i.length === 11 && i.startsWith("1") ? `1${n}` : n;
177
249
  }
178
- const qe = {
250
+ const Ce = {
179
251
  firstname: {
180
252
  name: "firstname",
181
253
  control: "text",
182
254
  label: "First name",
183
255
  autoComplete: "given-name",
184
- validate: O("First name")
256
+ validate: $("First name")
185
257
  },
186
258
  lastname: {
187
259
  name: "lastname",
188
260
  control: "text",
189
261
  label: "Last name",
190
262
  autoComplete: "family-name",
191
- validate: O("Last name")
263
+ validate: $("Last name")
192
264
  },
193
265
  email: {
194
266
  name: "email",
195
267
  control: "email",
196
- label: "Email",
268
+ label: "Email address",
197
269
  autoComplete: "email",
198
270
  validate: (t, e) => {
199
271
  const n = t.trim();
200
- return n ? ee(n) || "Enter a valid email" : e ? "Email is required" : !0;
272
+ return n ? ne(n) || "Enter a valid email address" : e ? "Email address is required" : !0;
201
273
  }
202
274
  },
203
275
  phone: {
204
276
  name: "phone",
205
277
  control: "tel",
206
- label: "Phone",
278
+ label: "Phone number",
207
279
  autoComplete: "tel",
208
280
  validate: (t, e) => {
209
281
  const n = t.trim();
210
- return n ? z(n) ? !0 : "Enter a valid phone number" : e ? "Phone is required" : !0;
282
+ return n ? Z(n) ? !0 : "Enter a valid phone number" : e ? "Phone number is required" : !0;
211
283
  },
212
284
  serialize: Se
213
285
  }
214
286
  };
215
287
  function B(t) {
216
- return qe[t];
288
+ return Ce[t];
217
289
  }
218
- function V({
290
+ function J({
219
291
  className: t,
220
292
  appearance: e,
221
293
  variantValue: n,
222
- kind: i,
223
- children: a
294
+ twoColumn: i,
295
+ kind: a,
296
+ children: r
224
297
  }) {
225
- return /* @__PURE__ */ l(
298
+ return /* @__PURE__ */ s(
226
299
  "div",
227
300
  {
228
301
  className: `usgb-form ${t ?? ""}`,
229
302
  "data-appearance": e,
230
303
  ...n ? { "data-variant": n } : {},
231
- "data-kind": i,
232
- children: a
304
+ ...i ? { "data-layout": "two-column" } : {},
305
+ "data-kind": a,
306
+ children: r
233
307
  }
234
308
  );
235
309
  }
236
- const Ce = [
237
- "hubspot_utk",
238
- "ga_client_id",
239
- "ga_session_id",
240
- "snowplow_id",
241
- "vwo_uuid"
242
- ];
243
- function C(t, e) {
244
- return t === "collected" && e != null && e !== "" ? { status: "collected", value: e } : { status: t };
245
- }
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");
254
- continue;
255
- }
256
- if (o.collection === "browser") {
257
- if (r === "referrer" && typeof document < "u") {
258
- const f = document.referrer;
259
- s[r] = f ? C("collected", f) : C("unavailable");
260
- } else
261
- s[r] = C("unavailable");
262
- continue;
263
- }
264
- const u = a[r];
265
- if (u != null && u !== "") {
266
- s[r] = C("collected", u);
267
- continue;
268
- }
269
- if (Ce.includes(r) && c.has("consent-withheld")) {
270
- s[r] = C("unavailable");
271
- continue;
272
- }
273
- s[r] = C("unavailable");
274
- }
275
- return s;
276
- }
277
- function Ne() {
310
+ function Ue() {
278
311
  return typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `usgb-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
279
312
  }
280
- function Ee(t, e) {
313
+ function Pe(t, e) {
281
314
  const n = {};
282
315
  for (const i of t)
283
316
  n[i.name] = "";
@@ -285,124 +318,120 @@ function Ee(t, e) {
285
318
  n[i] = !1;
286
319
  return n;
287
320
  }
288
- function R(t) {
321
+ function M(t) {
289
322
  const e = t == null ? void 0 : t.trim();
290
323
  return e || void 0;
291
324
  }
292
325
  function De({
293
326
  formId: t,
294
327
  definition: e,
295
- source: n,
296
- campaign: i,
297
- legalUrls: a,
298
- successUrl: s,
299
- adapter: r,
300
- analytics: o,
301
- onAccepted: c,
302
- onFailed: u
328
+ legalUrls: n,
329
+ successUrl: i,
330
+ adapter: a,
331
+ analytics: r,
332
+ onAccepted: l,
333
+ onFailed: o
303
334
  }) {
304
- const f = te(), b = D(
305
- () => W(e.consents) ?? [],
335
+ const d = K(), u = D(
336
+ () => Y(e.consents) ?? [],
306
337
  [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]
338
+ ), f = D(
339
+ () => u.filter(qe).map((p) => p.name),
340
+ [u]
341
+ ), b = D(
342
+ () => Pe(e.fields, f),
343
+ [e.fields, f]
313
344
  ), {
314
- register: _,
315
- handleSubmit: m,
316
- formState: { errors: d }
345
+ register: g,
346
+ handleSubmit: C,
347
+ formState: { errors: w }
317
348
  } = 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({
349
+ defaultValues: b
350
+ }), [m, q] = te({ kind: "idle" }), y = G(!1);
351
+ j(() => {
352
+ r == null || r({ type: "view", formId: t });
353
+ }, [r, t]);
354
+ const c = D(() => {
355
+ const p = {};
356
+ for (const k of e.fields)
357
+ p[k.name] = `${d}-${k.name}`;
358
+ for (const k of f)
359
+ p[k] = `${d}-${k}`;
360
+ return p;
361
+ }, [d, e.fields, f]), v = D(() => {
362
+ const p = {};
363
+ for (const k of u)
364
+ k.type === "notice" && (p[k.definitionId] = `${d}-notice-${k.definitionId}`);
365
+ return p;
366
+ }, [d, u]), U = C(
367
+ async (p) => {
368
+ if (y.current)
369
+ return;
370
+ y.current = !0, q({ kind: "submitting" }), r == null || r({ type: "submit_attempt", formId: t });
371
+ const _ = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), P = {};
372
+ for (const L of e.fields) {
373
+ const S = p[L.name];
374
+ if (typeof S != "string") {
375
+ P[L.name] = !!S;
376
+ continue;
377
+ }
378
+ const N = B(L.name);
379
+ P[L.name] = N != null && N.serialize ? N.serialize(S) : S.trim();
380
+ }
381
+ const I = we(
382
+ u,
383
+ p,
384
+ n ?? {},
385
+ _
386
+ ), F = {
387
+ formId: t,
388
+ definitionVersion: e.definitionVersion,
389
+ submissionContractVersion: x.submissionContract.version,
390
+ idempotencyKey: Ue(),
391
+ data: P,
392
+ consents: I
393
+ };
394
+ try {
395
+ const L = await a.submit(F);
396
+ if (L.status === "accepted") {
397
+ r == null || r({ type: "success", formId: t, status: "accepted" }), l == null || l(F), q({ kind: "accepted" });
398
+ const S = M(i);
399
+ S && typeof window < "u" && window.location.assign(S);
400
+ } else
401
+ y.current = !1, q({
402
+ kind: "failed",
403
+ message: L.message ?? "Submission failed"
404
+ }), r == null || r({
405
+ type: "failure",
406
+ formId: t,
407
+ message: L.message
408
+ }), o == null || o(F, L.message);
409
+ } catch (L) {
410
+ y.current = !1;
411
+ const S = L instanceof Error ? L.message : "Submission failed";
412
+ q({ kind: "failed", message: S }), r == null || r({ type: "failure", formId: t, message: S }), o == null || o(F, S);
413
+ }
414
+ },
415
+ (p) => {
416
+ r == null || r({
334
417
  type: "validation_failure",
335
418
  formId: t,
336
- fields: v
419
+ fields: Object.keys(p)
337
420
  });
338
- return;
339
- }
340
- o == null || o({ type: "submit_attempt", formId: t }), h({ kind: "submitting" });
341
- const F = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), J = Le({
342
- trackingFields: e.trackingFields,
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;
350
- continue;
351
- }
352
- const U = B(k.name);
353
- A[k.name] = U != null && U.serialize ? U.serialize(S) : S.trim();
354
- }
355
- const Q = _e(
356
- b,
357
- w,
358
- a ?? {},
359
- F
360
- ), T = {
361
- formId: t,
362
- definitionVersion: e.definitionVersion,
363
- submissionContractVersion: I.submissionContract.version,
364
- idempotencyKey: Ne(),
365
- data: A,
366
- consents: Q,
367
- context: {
368
- host: r.host,
369
- source: n,
370
- campaign: i,
371
- page: typeof window < "u" ? window.location.href : void 0,
372
- tracking: J
373
- }
374
- };
375
- try {
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);
381
- } else
382
- h({
383
- kind: "failed",
384
- message: k.message ?? "Submission failed"
385
- }), o == null || o({
386
- type: "failure",
387
- formId: t,
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);
393
421
  }
394
- });
422
+ );
395
423
  return {
396
- register: _,
397
- errors: d,
398
- fieldIds: L,
399
- consentDefs: b,
400
- uiState: q,
401
- onSubmit: x
424
+ register: g,
425
+ errors: w,
426
+ fieldIds: c,
427
+ noticeIds: v,
428
+ consentDefs: u,
429
+ uiState: m,
430
+ onSubmit: U
402
431
  };
403
432
  }
404
- function Pe() {
405
- return /* @__PURE__ */ g(
433
+ function Ae() {
434
+ return /* @__PURE__ */ h(
406
435
  "svg",
407
436
  {
408
437
  className: "usgb-field-error-icon",
@@ -414,7 +443,7 @@ function Pe() {
414
443
  "aria-hidden": "true",
415
444
  focusable: "false",
416
445
  children: [
417
- /* @__PURE__ */ l(
446
+ /* @__PURE__ */ s(
418
447
  "path",
419
448
  {
420
449
  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",
@@ -423,7 +452,7 @@ function Pe() {
423
452
  strokeWidth: "0.7"
424
453
  }
425
454
  ),
426
- /* @__PURE__ */ l(
455
+ /* @__PURE__ */ s(
427
456
  "path",
428
457
  {
429
458
  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",
@@ -434,8 +463,8 @@ function Pe() {
434
463
  }
435
464
  );
436
465
  }
437
- function xe() {
438
- return /* @__PURE__ */ l(
466
+ function Te() {
467
+ return /* @__PURE__ */ s(
439
468
  "svg",
440
469
  {
441
470
  className: "usgb-form-checkbox-mark",
@@ -446,7 +475,7 @@ function xe() {
446
475
  xmlns: "http://www.w3.org/2000/svg",
447
476
  "aria-hidden": "true",
448
477
  focusable: "false",
449
- children: /* @__PURE__ */ l(
478
+ children: /* @__PURE__ */ s(
450
479
  "path",
451
480
  {
452
481
  d: "M1 3.5L2.33333 4.75L3.66667 6L9 1",
@@ -459,176 +488,197 @@ function xe() {
459
488
  }
460
489
  );
461
490
  }
462
- function K({
491
+ function O({
463
492
  id: t,
464
493
  message: e,
465
494
  className: n
466
495
  }) {
467
- return e ? /* @__PURE__ */ g(
496
+ return e ? /* @__PURE__ */ h(
468
497
  "span",
469
498
  {
470
499
  id: t,
471
500
  role: "alert",
472
- className: P("usgb-field-error", n),
501
+ className: T("usgb-field-error", n),
473
502
  children: [
474
- /* @__PURE__ */ l(Pe, {}),
503
+ /* @__PURE__ */ s(Ae, {}),
475
504
  e
476
505
  ]
477
506
  }
478
507
  ) : null;
479
508
  }
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(
509
+ const Ee = R(
510
+ function({ id: e, label: n, errorMessage: i, required: a, className: r, ...l }, o) {
511
+ const d = i ? `${e}-error` : void 0;
512
+ return /* @__PURE__ */ h("div", { className: "usgb-form-group usgb-consent", children: [
513
+ /* @__PURE__ */ h("div", { className: "usgb-consent-row", children: [
514
+ /* @__PURE__ */ h("span", { className: "usgb-form-checkbox-wrap", children: [
515
+ /* @__PURE__ */ s(
487
516
  "input",
488
517
  {
518
+ ...l,
489
519
  ref: o,
490
520
  id: e,
491
521
  type: "checkbox",
492
- className: P("usgb-form-checkbox", s),
522
+ className: T("usgb-form-checkbox", r),
493
523
  "aria-invalid": i ? !0 : void 0,
494
- "aria-describedby": c,
495
- "aria-required": a || void 0,
496
- ...r
524
+ "aria-describedby": d,
525
+ "aria-required": a || void 0
497
526
  }
498
527
  ),
499
- /* @__PURE__ */ l(xe, {})
528
+ /* @__PURE__ */ s(Te, {})
500
529
  ] }),
501
- /* @__PURE__ */ l("label", { htmlFor: e, className: "usgb-consent-copy", children: n })
530
+ /* @__PURE__ */ h("label", { htmlFor: e, className: "usgb-consent-copy", children: [
531
+ n,
532
+ a ? /* @__PURE__ */ s(
533
+ "span",
534
+ {
535
+ className: "usgb-field-label-asterisk",
536
+ "aria-hidden": "true",
537
+ children: "*"
538
+ }
539
+ ) : null
540
+ ] })
502
541
  ] }),
503
- /* @__PURE__ */ l(K, { id: c, message: i })
542
+ /* @__PURE__ */ s(O, { id: d, message: i })
504
543
  ] });
505
544
  }
506
- ), Y = $(
545
+ ), Q = R(
507
546
  function({
508
547
  className: e,
509
548
  variant: n = "primary",
510
549
  loading: i = !1,
511
550
  disabled: a = !1,
512
- children: s,
513
- ...r
514
- }, o) {
515
- return /* @__PURE__ */ l(
551
+ children: r,
552
+ onClick: l,
553
+ type: o = "button",
554
+ ...d
555
+ }, u) {
556
+ const f = a || i, b = a && !i ? !0 : void 0;
557
+ return /* @__PURE__ */ s(
516
558
  "button",
517
559
  {
518
- ref: o,
519
- type: r.type ?? "button",
520
- className: P(
560
+ ref: u,
561
+ type: o,
562
+ className: T(
521
563
  "usgb-btn",
522
564
  n === "primary" && "usgb-btn-primary",
523
565
  e
524
566
  ),
525
- disabled: a || i,
567
+ ...d,
568
+ disabled: b,
569
+ "aria-disabled": f || void 0,
526
570
  "aria-busy": i || void 0,
527
- ...r,
528
- children: i ? "Submitting…" : s
571
+ onClick: (g) => {
572
+ if (f) {
573
+ g.preventDefault();
574
+ return;
575
+ }
576
+ l == null || l(g);
577
+ },
578
+ children: i ? "Submitting…" : r
529
579
  }
530
580
  );
531
581
  }
532
582
  );
533
- function Te(t) {
583
+ function Ie(t) {
534
584
  const e = [];
535
585
  let n = 0;
536
586
  for (; n < t.length; ) {
537
587
  const i = t[n];
538
588
  if (i.group) {
539
- const a = i.group, s = [];
589
+ const a = i.group, r = [];
540
590
  for (; n < t.length && t[n].group === a; )
541
- s.push(t[n]), n += 1;
542
- e.push({ type: "group", group: a, fields: s });
591
+ r.push(t[n]), n += 1;
592
+ e.push({ type: "group", group: a, fields: r });
543
593
  continue;
544
594
  }
545
595
  e.push({ type: "field", field: i }), n += 1;
546
596
  }
547
597
  return e;
548
598
  }
549
- function Ue({
599
+ function Fe({
550
600
  htmlFor: t,
551
601
  children: e,
552
602
  className: n,
553
603
  required: i
554
604
  }) {
555
- return /* @__PURE__ */ g("label", { htmlFor: t, className: P("usgb-field-label", n), children: [
605
+ return /* @__PURE__ */ h("label", { htmlFor: t, className: T("usgb-field-label", n), children: [
556
606
  e,
557
- i ? /* @__PURE__ */ l("span", { className: "usgb-field-label-asterisk", "aria-hidden": "true", children: "*" }) : null
607
+ i ? /* @__PURE__ */ s("span", { className: "usgb-field-label-asterisk", "aria-hidden": "true", children: "*" }) : null
558
608
  ] });
559
609
  }
560
- function Ie(t) {
610
+ function Ne(t) {
561
611
  return t.replace(/\b\w/g, (e) => e.toUpperCase());
562
612
  }
563
- const Ae = $(
613
+ const xe = R(
564
614
  function({
565
615
  id: e,
566
616
  label: n,
567
617
  type: i = "text",
568
618
  errorMessage: a,
569
- required: s,
570
- hideLabel: r = !1,
619
+ required: r,
620
+ hideLabel: l = !1,
571
621
  placeholderCase: o = "upper",
572
- showError: c = !0,
622
+ showError: d = !0,
573
623
  className: u,
574
624
  placeholder: f,
575
625
  ...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,
626
+ }, g) {
627
+ const C = a ? `${e}-error` : void 0, w = l ? `${n}${r ? "*" : ""}` : f, m = l && w ? o === "title" ? Ne(w) : w.toUpperCase() : w;
628
+ return /* @__PURE__ */ h("div", { className: "usgb-form-group", children: [
629
+ /* @__PURE__ */ s(
630
+ Fe,
581
631
  {
582
632
  htmlFor: e,
583
- required: s,
584
- className: r ? "usgb-field-label--sr-only" : void 0,
633
+ required: r,
634
+ className: l ? "usgb-field-label--sr-only" : void 0,
585
635
  children: n
586
636
  }
587
637
  ),
588
- /* @__PURE__ */ l(
638
+ /* @__PURE__ */ s(
589
639
  "input",
590
640
  {
591
- ref: y,
641
+ ref: g,
592
642
  id: e,
593
643
  type: i,
594
- className: P(
644
+ className: T(
595
645
  "usgb-field-control",
596
646
  a && "usgb-field-invalid",
597
647
  u
598
648
  ),
599
649
  placeholder: m,
600
650
  "aria-invalid": a ? !0 : void 0,
601
- "aria-describedby": p,
602
- "aria-required": s || void 0,
651
+ "aria-describedby": C,
652
+ "aria-required": r || void 0,
603
653
  ...b
604
654
  }
605
655
  ),
606
- c ? /* @__PURE__ */ l(K, { id: p, message: a }) : null
656
+ d ? /* @__PURE__ */ s(O, { id: C, message: a }) : null
607
657
  ] });
608
658
  }
609
659
  );
610
- function M({
660
+ function V({
611
661
  fieldRef: t,
612
662
  fieldIds: e,
613
663
  register: n,
614
664
  errors: i,
615
665
  hideLabel: a,
616
- placeholderCase: s,
617
- showError: r = !0
666
+ placeholderCase: r,
667
+ showError: l = !0
618
668
  }) {
619
669
  const o = B(t.name);
620
670
  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,
671
+ const d = i[t.name], u = typeof (d == null ? void 0 : d.message) == "string" ? d.message : void 0;
672
+ return /* @__PURE__ */ s(
673
+ xe,
624
674
  {
625
675
  id: e[t.name],
626
676
  label: o.label,
627
677
  type: o.control,
628
678
  required: t.required,
629
679
  hideLabel: a,
630
- placeholderCase: s,
631
- showError: r,
680
+ placeholderCase: r,
681
+ showError: l,
632
682
  autoComplete: o.autoComplete,
633
683
  errorMessage: u,
634
684
  ...n(t.name, {
@@ -640,380 +690,402 @@ function M({
640
690
  }
641
691
  );
642
692
  }
643
- function Ve({
693
+ function Me({
644
694
  definition: t,
645
- variants: e,
695
+ variant: e,
646
696
  ctaLabel: n,
647
697
  legalUrls: i,
648
- session: a
698
+ session: a,
699
+ headingId: r
649
700
  }) {
650
- const { register: s, errors: r, fieldIds: o, consentDefs: c, uiState: u, onSubmit: f } = a, b = D(
651
- () => Te(t.fields),
701
+ const {
702
+ register: l,
703
+ errors: o,
704
+ fieldIds: d,
705
+ noticeIds: u,
706
+ consentDefs: f,
707
+ uiState: b,
708
+ onSubmit: g
709
+ } = a, C = D(
710
+ () => Ie(t.fields),
652
711
  [t.fields]
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(
656
- "div",
657
- {
658
- className: "usgb-form-grid",
659
- children: m.fields.map((d) => /* @__PURE__ */ l(
660
- M,
712
+ ), w = e === "sidebar", m = e === "dense" || w, q = w ? "title" : "upper", y = Object.values(u).join(" ");
713
+ return /* @__PURE__ */ h(
714
+ "form",
715
+ {
716
+ onSubmit: g,
717
+ noValidate: !0,
718
+ ...r ? { "aria-labelledby": r } : {},
719
+ children: [
720
+ C.map((c) => c.type === "group" ? /* @__PURE__ */ s(
721
+ "div",
661
722
  {
662
- fieldRef: d,
663
- fieldIds: o,
664
- register: s,
665
- errors: r,
666
- hideLabel: p,
667
- placeholderCase: _
723
+ className: "usgb-form-grid",
724
+ children: c.fields.map((v) => /* @__PURE__ */ s(
725
+ V,
726
+ {
727
+ fieldRef: v,
728
+ fieldIds: d,
729
+ register: l,
730
+ errors: o,
731
+ hideLabel: m,
732
+ placeholderCase: q
733
+ },
734
+ v.name
735
+ ))
668
736
  },
669
- d.name
670
- ))
671
- },
672
- `group-${m.group}-${m.fields.map((d) => d.name).join("-")}`
673
- ) : /* @__PURE__ */ l(
674
- M,
675
- {
676
- fieldRef: m.field,
677
- fieldIds: o,
678
- register: s,
679
- errors: r,
680
- hideLabel: p,
681
- placeholderCase: _
682
- },
683
- m.field.name
684
- )),
685
- c.map((m) => {
686
- const { content: d } = j(
687
- m.copy,
688
- i ?? {}
689
- );
690
- if (m.type === "notice")
691
- return /* @__PURE__ */ l(
692
- "p",
737
+ `group-${c.group}-${c.fields.map((v) => v.name).join("-")}`
738
+ ) : /* @__PURE__ */ s(
739
+ V,
693
740
  {
694
- className: "usgb-consent-copy usgb-consent-notice",
695
- children: d
741
+ fieldRef: c.field,
742
+ fieldIds: d,
743
+ register: l,
744
+ errors: o,
745
+ hideLabel: m,
746
+ placeholderCase: q
696
747
  },
697
- m.definitionId
698
- );
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,
702
- {
703
- id: o[m.name],
704
- label: d,
705
- required: m.required,
706
- errorMessage: h,
707
- ...s(m.name, {
708
- required: m.required ? "This field is required" : !1
709
- })
710
- },
711
- m.name
712
- );
713
- }),
714
- /* @__PURE__ */ l(Y, { type: "submit", loading: u.kind === "submitting", children: n }),
715
- u.kind === "failed" ? /* @__PURE__ */ l(
716
- "p",
717
- {
718
- className: "usgb-form-status usgb-form-status-error",
719
- role: "alert",
720
- children: u.message ?? "Something went wrong. Please try again."
721
- }
722
- ) : null
723
- ] });
748
+ c.field.name
749
+ )),
750
+ f.map((c) => {
751
+ const { content: v } = W(
752
+ c.copy,
753
+ i ?? {}
754
+ );
755
+ if (c.type === "notice")
756
+ return /* @__PURE__ */ s(
757
+ "p",
758
+ {
759
+ id: u[c.definitionId],
760
+ className: "usgb-consent usgb-consent-copy usgb-consent-notice",
761
+ children: v
762
+ },
763
+ c.definitionId
764
+ );
765
+ const U = o[c.name], p = typeof (U == null ? void 0 : U.message) == "string" ? U.message : void 0;
766
+ return /* @__PURE__ */ s(
767
+ Ee,
768
+ {
769
+ id: d[c.name],
770
+ label: v,
771
+ required: c.required,
772
+ errorMessage: p,
773
+ ...l(c.name, {
774
+ required: c.required ? "This field is required" : !1
775
+ })
776
+ },
777
+ c.name
778
+ );
779
+ }),
780
+ /* @__PURE__ */ s(
781
+ Q,
782
+ {
783
+ type: "submit",
784
+ loading: b.kind === "submitting",
785
+ "aria-describedby": y || void 0,
786
+ children: n
787
+ }
788
+ ),
789
+ b.kind === "failed" ? /* @__PURE__ */ s(
790
+ "p",
791
+ {
792
+ className: "usgb-form-status usgb-form-status-error",
793
+ role: "alert",
794
+ children: b.message ?? "Something went wrong. Please try again."
795
+ }
796
+ ) : null
797
+ ]
798
+ }
799
+ );
724
800
  }
725
- function Re({
801
+ function Ve({
726
802
  definition: t,
727
803
  ctaLabel: e,
728
- session: n
804
+ session: n,
805
+ headingId: i
729
806
  }) {
730
- var f;
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,
736
- {
737
- fieldRef: c,
738
- fieldIds: s,
739
- register: i,
740
- errors: a,
741
- hideLabel: !0,
742
- placeholderCase: "upper",
743
- showError: !1
744
- }
745
- ),
746
- /* @__PURE__ */ l(Y, { type: "submit", loading: r.kind === "submitting", children: e })
747
- ] }),
748
- /* @__PURE__ */ l(
749
- K,
750
- {
751
- id: u ? `${s.email}-error` : void 0,
752
- message: u
753
- }
754
- ),
755
- r.kind === "failed" ? /* @__PURE__ */ l(
756
- "p",
757
- {
758
- className: "usgb-form-status usgb-form-status-error",
759
- role: "alert",
760
- children: r.message ?? "Something went wrong. Please try again."
761
- }
762
- ) : null
763
- ] }) : /* @__PURE__ */ l("p", { className: "usgb-form-status usgb-form-status-error", role: "alert", children: "Newsletter kind requires an email field" });
807
+ var b;
808
+ const { register: a, errors: r, fieldIds: l, uiState: o, onSubmit: d } = n, u = t.fields.find((g) => g.name === "email"), f = typeof ((b = r.email) == null ? void 0 : b.message) == "string" ? r.email.message : void 0;
809
+ return u ? /* @__PURE__ */ h(
810
+ "form",
811
+ {
812
+ onSubmit: d,
813
+ noValidate: !0,
814
+ ...i ? { "aria-labelledby": i } : {},
815
+ children: [
816
+ /* @__PURE__ */ h("div", { className: "usgb-form-inline", children: [
817
+ /* @__PURE__ */ s(
818
+ V,
819
+ {
820
+ fieldRef: u,
821
+ fieldIds: l,
822
+ register: a,
823
+ errors: r,
824
+ hideLabel: !0,
825
+ placeholderCase: "upper",
826
+ showError: !1
827
+ }
828
+ ),
829
+ /* @__PURE__ */ s(Q, { type: "submit", loading: o.kind === "submitting", children: e })
830
+ ] }),
831
+ /* @__PURE__ */ s(
832
+ O,
833
+ {
834
+ id: f ? `${l.email}-error` : void 0,
835
+ message: f
836
+ }
837
+ ),
838
+ o.kind === "failed" ? /* @__PURE__ */ s(
839
+ "p",
840
+ {
841
+ className: "usgb-form-status usgb-form-status-error",
842
+ role: "alert",
843
+ children: o.message ?? "Something went wrong. Please try again."
844
+ }
845
+ ) : null
846
+ ]
847
+ }
848
+ ) : /* @__PURE__ */ s("p", { className: "usgb-form-status usgb-form-status-error", role: "alert", children: "Newsletter kind requires an email field" });
764
849
  }
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({
850
+ const X = {
851
+ lead: Me,
852
+ newsletter: Ve
853
+ }, Re = "Thank you. Your request has been accepted and is being processed.";
854
+ function A({
770
855
  className: t,
771
856
  appearance: e,
772
857
  variantValue: n,
773
- kind: i,
774
- children: a
858
+ twoColumn: i,
859
+ kind: a,
860
+ children: r
775
861
  }) {
776
- return /* @__PURE__ */ l(
777
- V,
862
+ return /* @__PURE__ */ s(
863
+ J,
778
864
  {
779
865
  className: t,
780
866
  appearance: e,
781
867
  variantValue: n,
782
- kind: i,
783
- children: /* @__PURE__ */ l("p", { className: "usgb-form-status usgb-form-status-error", role: "alert", children: a })
868
+ twoColumn: i,
869
+ kind: a,
870
+ children: /* @__PURE__ */ s("p", { className: "usgb-form-status usgb-form-status-error", role: "alert", children: r })
784
871
  }
785
872
  );
786
873
  }
787
- function $e({
874
+ function Be({
788
875
  formId: t,
789
876
  definition: e,
790
877
  appearance: n,
791
- variants: i,
878
+ variant: i,
792
879
  variantValue: a,
793
- heading: s,
794
- subheading: r,
795
- ctaLabel: o,
796
- source: c,
797
- campaign: u,
798
- legalUrls: f,
799
- successMessage: b,
800
- successUrl: y,
801
- adapter: p,
802
- analytics: _,
803
- className: m,
804
- onAccepted: d,
880
+ twoColumn: r,
881
+ heading: l,
882
+ subheading: o,
883
+ ctaLabel: d,
884
+ legalUrls: u,
885
+ successMessage: f,
886
+ successUrl: b,
887
+ adapter: g,
888
+ analytics: C,
889
+ className: w,
890
+ onAccepted: m,
805
891
  onFailed: q
806
892
  }) {
807
- const h = De({
893
+ const y = K(), c = l ? `${y}-heading` : void 0, v = G(null), U = De({
808
894
  formId: t,
809
895
  definition: e,
810
- variantValue: a,
811
- source: c,
812
- campaign: u,
813
- legalUrls: f,
814
- successUrl: y,
815
- adapter: p,
816
- analytics: _,
817
- onAccepted: d,
896
+ legalUrls: u,
897
+ successUrl: b,
898
+ adapter: g,
899
+ analytics: C,
900
+ onAccepted: m,
818
901
  onFailed: q
819
- });
820
- if (h.uiState.kind === "accepted") {
821
- const x = !!R(y);
822
- return /* @__PURE__ */ g(
823
- V,
824
- {
825
- className: m,
826
- appearance: n,
827
- variantValue: a,
828
- kind: e.kind,
829
- children: [
830
- s ? /* @__PURE__ */ l("h2", { className: "usgb-form-heading", children: s }) : null,
831
- x ? null : /* @__PURE__ */ l(
832
- "p",
833
- {
834
- className: "usgb-form-status usgb-form-status-success",
835
- role: "status",
836
- children: R(b) ?? Me
837
- }
838
- )
839
- ]
840
- }
841
- );
842
- }
843
- const L = Z[e.kind];
844
- return /* @__PURE__ */ g(
845
- V,
902
+ }), p = U.uiState.kind === "accepted", k = p && !!M(b), _ = p && !k ? M(f) ?? Re : "";
903
+ j(() => {
904
+ var I;
905
+ _ && ((I = v.current) == null || I.focus());
906
+ }, [_]);
907
+ const P = X[e.kind];
908
+ return /* @__PURE__ */ h(
909
+ J,
846
910
  {
847
- className: m,
911
+ className: w,
848
912
  appearance: n,
849
913
  variantValue: a,
914
+ twoColumn: r,
850
915
  kind: e.kind,
851
916
  children: [
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,
917
+ l ? /* @__PURE__ */ s("h2", { id: c, className: "usgb-form-heading", children: l }) : null,
918
+ !p && o ? /* @__PURE__ */ s("p", { className: "usgb-form-subheading", children: o }) : null,
919
+ p ? null : /* @__PURE__ */ s(
920
+ P,
856
921
  {
857
922
  definition: e,
858
- variants: i,
859
- ctaLabel: o,
860
- legalUrls: f,
861
- session: h
923
+ variant: i,
924
+ ctaLabel: d,
925
+ legalUrls: u,
926
+ session: U,
927
+ headingId: c
928
+ }
929
+ ),
930
+ /* @__PURE__ */ s(
931
+ "p",
932
+ {
933
+ ref: v,
934
+ className: _ ? "usgb-form-status usgb-form-status-success" : "usgb-field-label--sr-only",
935
+ role: "status",
936
+ "aria-live": "polite",
937
+ tabIndex: _ ? -1 : void 0,
938
+ children: _
862
939
  }
863
940
  )
864
941
  ]
865
942
  }
866
943
  );
867
944
  }
868
- function We({
945
+ function He({
869
946
  formId: t,
870
947
  appearance: e = "on-light",
871
- variants: n = ["dense"],
872
- heading: i,
873
- subheading: a,
874
- ctaLabel: s,
875
- source: r,
876
- campaign: o,
877
- legalUrls: c,
878
- successMessage: u,
879
- successUrl: f,
880
- adapter: b,
881
- analytics: y,
882
- className: p,
883
- onAccepted: _,
884
- onFailed: m
948
+ variant: n = "dense",
949
+ twoColumn: i = !1,
950
+ heading: a,
951
+ subheading: r,
952
+ ctaLabel: l,
953
+ legalUrls: o,
954
+ successMessage: d,
955
+ successUrl: u,
956
+ adapter: f,
957
+ analytics: b,
958
+ className: g,
959
+ onAccepted: C,
960
+ onFailed: w
885
961
  }) {
886
- const d = ue(t), h = (d == null ? void 0 : d.kind) === "newsletter" ? "" : n.join(" ");
887
- if (!d)
888
- return /* @__PURE__ */ g(
889
- E,
962
+ const m = z(t), q = (m == null ? void 0 : m.kind) === "newsletter", y = q ? "" : n, c = !q && i;
963
+ if (!m)
964
+ return /* @__PURE__ */ h(
965
+ A,
890
966
  {
891
- className: p,
967
+ className: g,
892
968
  appearance: e,
893
- variantValue: h,
969
+ variantValue: y,
970
+ twoColumn: c,
894
971
  children: [
895
972
  "Unknown form definition: ",
896
973
  t
897
974
  ]
898
975
  }
899
976
  );
900
- const L = W(d.consents);
901
- if (L === null)
902
- return /* @__PURE__ */ g(
903
- E,
977
+ const v = Y(m.consents);
978
+ if (v === null)
979
+ return /* @__PURE__ */ h(
980
+ A,
904
981
  {
905
- className: p,
982
+ className: g,
906
983
  appearance: e,
907
- variantValue: h,
908
- kind: d.kind,
984
+ variantValue: y,
985
+ twoColumn: c,
986
+ kind: m.kind,
909
987
  children: [
910
988
  "Missing consent definition for ",
911
989
  t
912
990
  ]
913
991
  }
914
992
  );
915
- const w = ke(L).filter(
916
- (N) => {
917
- var F;
918
- return !((F = c == null ? void 0 : c[N]) != null && F.trim());
993
+ const p = _e(v).filter(
994
+ (_) => {
995
+ var P;
996
+ return !((P = o == null ? void 0 : o[_]) != null && P.trim());
919
997
  }
920
998
  );
921
- if (w.length)
922
- return /* @__PURE__ */ g(
923
- E,
999
+ if (p.length)
1000
+ return /* @__PURE__ */ h(
1001
+ A,
924
1002
  {
925
- className: p,
1003
+ className: g,
926
1004
  appearance: e,
927
- variantValue: h,
928
- kind: d.kind,
1005
+ variantValue: y,
1006
+ twoColumn: c,
1007
+ kind: m.kind,
929
1008
  children: [
930
1009
  "Missing legal URL(s) for ",
931
1010
  t,
932
1011
  ": ",
933
- w.join(", ")
1012
+ p.join(", ")
934
1013
  ]
935
1014
  }
936
1015
  );
937
- const v = d.fields.filter(
938
- (N) => !B(N.name)
1016
+ const k = m.fields.filter(
1017
+ (_) => !B(_.name)
939
1018
  );
940
- return v.length ? /* @__PURE__ */ g(
941
- E,
1019
+ return k.length ? /* @__PURE__ */ h(
1020
+ A,
942
1021
  {
943
- className: p,
1022
+ className: g,
944
1023
  appearance: e,
945
- variantValue: h,
946
- kind: d.kind,
1024
+ variantValue: y,
1025
+ twoColumn: c,
1026
+ kind: m.kind,
947
1027
  children: [
948
1028
  "Unknown field(s) in ",
949
1029
  t,
950
1030
  ":",
951
1031
  " ",
952
- v.map((N) => N.name).join(", ")
1032
+ k.map((_) => _.name).join(", ")
953
1033
  ]
954
1034
  }
955
- ) : d.kind in Z ? /* @__PURE__ */ l(
956
- $e,
1035
+ ) : m.kind in X ? /* @__PURE__ */ s(
1036
+ Be,
957
1037
  {
958
1038
  formId: t,
959
- definition: d,
1039
+ definition: m,
960
1040
  appearance: e,
961
- variants: n,
962
- variantValue: h,
963
- heading: i,
964
- subheading: a,
965
- ctaLabel: s ?? d.ctaLabel,
966
- source: r,
967
- campaign: o,
968
- legalUrls: c,
969
- successMessage: u,
970
- successUrl: f,
971
- adapter: b,
972
- analytics: y,
973
- className: p,
974
- onAccepted: _,
975
- onFailed: m
1041
+ variant: n,
1042
+ variantValue: y,
1043
+ twoColumn: c,
1044
+ heading: a,
1045
+ subheading: r,
1046
+ ctaLabel: l ?? m.ctaLabel,
1047
+ legalUrls: o,
1048
+ successMessage: d,
1049
+ successUrl: u,
1050
+ adapter: f,
1051
+ analytics: b,
1052
+ className: g,
1053
+ onAccepted: C,
1054
+ onFailed: w
976
1055
  }
977
- ) : /* @__PURE__ */ g(
978
- E,
1056
+ ) : /* @__PURE__ */ h(
1057
+ A,
979
1058
  {
980
- className: p,
1059
+ className: g,
981
1060
  appearance: e,
982
- variantValue: h,
983
- kind: d.kind,
1061
+ variantValue: y,
1062
+ twoColumn: c,
1063
+ kind: m.kind,
984
1064
  children: [
985
1065
  "Missing renderer for kind: ",
986
- d.kind
1066
+ m.kind
987
1067
  ]
988
1068
  }
989
1069
  );
990
1070
  }
991
- function ze(t = {}) {
1071
+ function Ye(t = {}) {
992
1072
  const e = typeof t == "string" ? { host: t } : t, n = e.host ?? "pwa", i = e.delayMs ?? 400, a = e.result ?? { status: "accepted" };
993
1073
  return {
994
1074
  host: n,
995
- getTrackingHints() {
996
- if (typeof window > "u") return {};
997
- const s = new URLSearchParams(window.location.search), r = (o) => s.get(o) ?? void 0;
998
- return {
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
- };
1009
- },
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;
1075
+ async submit(r) {
1076
+ var l;
1077
+ return (l = e.onSubmit) == null || l.call(e, r), await new Promise((o) => setTimeout(o, i)), a;
1013
1078
  }
1014
1079
  };
1015
1080
  }
1016
- const Ye = {
1081
+ const Ze = {
1082
+ clientAgreement: "client-agreement-url",
1083
+ privacyPolicy: "privacy-policy-url",
1084
+ userAgreement: "user-agreement-url",
1085
+ marketLossPolicy: "market-loss-policy-url",
1086
+ electronicDisclaimer: "electronic-disclaimer-url",
1087
+ termsOfSale: "terms-of-sale-url"
1088
+ }, Je = {
1017
1089
  clientAgreement: "/content/client-agreement",
1018
1090
  privacyPolicy: "/content/privacy-policy",
1019
1091
  userAgreement: "/content/user-agreement",
@@ -1021,34 +1093,39 @@ const Ye = {
1021
1093
  electronicDisclaimer: "/content/electronic-disclaimer",
1022
1094
  termsOfSale: "/content/terms-of-sale"
1023
1095
  };
1024
- function Ze(t, e) {
1096
+ function Qe(t, e) {
1025
1097
  return e.every((n) => {
1026
1098
  var i;
1027
1099
  return !!((i = t == null ? void 0 : t[n]) != null && i.trim());
1028
1100
  });
1029
1101
  }
1030
1102
  export {
1031
- Y as Button,
1032
- Fe as ConsentField,
1033
- qe as FIELD_REGISTRY,
1034
- K as FieldError,
1035
- Ue as FieldLabel,
1036
- pe as LEAD_CLICKWRAP,
1103
+ Q as Button,
1104
+ Ee as ConsentField,
1105
+ Ce as FIELD_REGISTRY,
1106
+ O as FieldError,
1107
+ Fe as FieldLabel,
1108
+ he as LEAD_CLICKWRAP,
1109
+ be as LEAD_CLICKWRAP_V2,
1037
1110
  fe as LEAD_SMS,
1038
- me as LEAD_TCPA,
1111
+ ue as LEAD_TCPA,
1112
+ me as LEAD_TCPA_V2,
1113
+ pe as LEAD_TCPA_V3,
1039
1114
  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,
1115
+ Ze as LEGAL_URL_ATTRS,
1116
+ Je as PWA_LEGAL_URLS,
1117
+ xe as TextField,
1118
+ He as UsgbForm,
1119
+ _e as collectRequiredLegalUrls,
1120
+ Ue as createIdempotencyKey,
1121
+ Ye as createStubAdapter,
1122
+ x as formsManifest,
1123
+ ke as getConsentDefinition,
1048
1124
  B as getFieldDefinition,
1049
- ue as getFormDefinition,
1050
- Ze as isCompleteLegalUrls,
1051
- He as listFormDefinitions,
1052
- j as resolveConsentCopy,
1053
- W as resolveFormConsents
1125
+ z as getFormDefinition,
1126
+ Qe as isCompleteLegalUrls,
1127
+ We as listEditorOptions,
1128
+ ze as listFormDefinitions,
1129
+ W as resolveConsentCopy,
1130
+ Y as resolveFormConsents
1054
1131
  };