@usgb/forms 1.0.3 → 1.0.5
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 +43 -33
- package/dist/{forms-manifest.1.0.3.json → forms-manifest.1.0.5.json} +371 -28
- package/dist/forms-manifest.json +371 -28
- package/dist/index.js +336 -318
- package/dist/src/contract/types.d.ts +7 -1
- package/dist/src/contract/types.d.ts.map +1 -1
- package/dist/src/definitions/consents.d.ts +5 -0
- package/dist/src/definitions/consents.d.ts.map +1 -1
- package/dist/src/definitions/index.d.ts +1 -1
- package/dist/src/definitions/index.d.ts.map +1 -1
- 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.5.js +44 -0
- package/dist/usgb-forms.css +46 -33
- package/dist/usgb-forms.js +11 -11
- package/forms-manifest.json +371 -28
- package/package.json +1 -1
- package/dist/usgb-forms.1.0.3.js +0 -44
package/dist/index.js
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
1
|
import { jsx as s, Fragment as ee, jsxs as h } from "react/jsx-runtime";
|
|
2
|
-
import { useId as
|
|
2
|
+
import { useId as $, useMemo as T, useState as te, useRef as K, useEffect as H, forwardRef as M } from "react";
|
|
3
3
|
import { validate as ne } from "email-validator";
|
|
4
4
|
import { useForm as re } from "react-hook-form";
|
|
5
|
-
import
|
|
6
|
-
const ie = "1.1.0", oe = { version: "1.0.0", transport: "server-proxy" }, 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"] } }, 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: "2", required: !1 }], editor: { label: "Magento FIK Blog Rail", 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"] } }, "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:
|
|
5
|
+
import D from "classnames";
|
|
6
|
+
const ae = "1.1.0", ie = { 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-10dlc": { 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 10DLC", 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-401k": { 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 401k", 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": { 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", 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"] } }, "magento-footer": { definitionVersion: "1", kind: "newsletter", flow: { type: "single" }, fields: [{ name: "email", required: !0 }], ctaLabel: "SUBSCRIBE", editor: { label: "Magento Footer", description: "Email only. No consent.", whenToUse: "TBD", whenNotToUse: "TBD", options: ["appearance", "heading", "subheading", "ctaLabel", "successMessage", "successUrl"], supportedAppearances: ["on-light", "on-dark"], supportedVariants: [], requiredLegalUrls: [] } }, "wp-full-lead": { 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: "Submit", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "Full Lead Form (WP GF 1)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2); no consent checkboxes. GF form 1 → HubSpot 1ebf148f.", 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"] } }, "wp-request-call-back": { 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: "Submit", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "Request Call Back (WP GF 11)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2). Host sets `requested_callback=true` as context. GF form 11 → HubSpot 25c0c6ca.", 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"] } }, "wp-investor-kit-lead-nurturing": { 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: "Submit", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "Investor Kit Lead Nurturing (WP GF 13)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2). GF form 13 → HubSpot 1ebf148f.", 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"] } }, "wp-product-launch": { 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: "Reserve Yours Today", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "Product Launch (WP GF 15)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2). Product IPO/pre-IPO pages. GF form 15 → HubSpot 950c50a1.", 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"] } }, "wp-ira-full-lead": { 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: "Submit", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "IRA Full Lead Form (WP GF 20)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2). Host sets `ira_lead=true` as context. GF form 20 → HubSpot b42770ef.", 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"] } }, "wp-affiliate-ira-full-lead": { 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: "Submit", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "Affiliate — IRA Full Lead Form (WP GF 21)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2). Host supplies affiliate_id/affiliate_offer_id/affiliate_transaction_id as context (not schema fields). GF form 21 → HubSpot 1d4e44b3.", 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"] } }, "wp-full-lead-captcha": { 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: "Submit", consents: [{ definitionId: "lead-clickwrap", definitionVersion: "2" }], editor: { label: "Full Lead Form — captcha (WP GF 22)", description: "First name, last name, email, and phone required. Clickwrap notice only (lead-clickwrap v2). reCAPTCHA is a host bot-control concern, not a schema field. GF form 22 → HubSpot 034c00e5.", 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"] } } }, ce = { hosts: ["pwa", "wordpress"], mayProvide: ["legal document URLs", "host/store identity"], mustNotDefine: ["consent definitions", "form fields", "submission endpoints"] }, de = {
|
|
7
|
+
schemaVersion: ae,
|
|
8
8
|
package: { name: "@usgb/forms", compatiblePackageVersions: "^1.0.2" },
|
|
9
|
-
submissionContract:
|
|
10
|
-
trackingRegistry:
|
|
9
|
+
submissionContract: ie,
|
|
10
|
+
trackingRegistry: oe,
|
|
11
11
|
editorOptions: se,
|
|
12
12
|
forms: le,
|
|
13
13
|
hostAdapterContract: ce
|
|
14
|
-
},
|
|
15
|
-
function
|
|
16
|
-
return
|
|
14
|
+
}, E = de;
|
|
15
|
+
function W(t) {
|
|
16
|
+
return E.forms[t];
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return Object.entries(
|
|
18
|
+
function We() {
|
|
19
|
+
return Object.entries(E.forms).map(([t, e]) => ({
|
|
20
20
|
formId: t,
|
|
21
21
|
definition: e
|
|
22
22
|
}));
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
const e =
|
|
24
|
+
function je(t) {
|
|
25
|
+
const e = W(t);
|
|
26
26
|
if (!e)
|
|
27
27
|
return [];
|
|
28
28
|
const n = [];
|
|
29
|
-
for (const
|
|
30
|
-
const
|
|
31
|
-
if (!
|
|
29
|
+
for (const a of e.editor.options) {
|
|
30
|
+
const i = E.editorOptions[a];
|
|
31
|
+
if (!i)
|
|
32
32
|
continue;
|
|
33
|
-
const r =
|
|
33
|
+
const r = i.valuesFrom ? [...e.editor[i.valuesFrom]] : void 0;
|
|
34
34
|
r && !r.length || n.push({
|
|
35
|
-
...
|
|
36
|
-
key:
|
|
35
|
+
...i,
|
|
36
|
+
key: a,
|
|
37
37
|
values: r,
|
|
38
|
-
defaultValue:
|
|
38
|
+
defaultValue: i.defaultFrom ? e[i.defaultFrom] : i.default
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
return n;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function j(t, e) {
|
|
44
44
|
return typeof t == "string" ? { content: t, language: t } : t(e);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function z(t, e) {
|
|
47
47
|
return `${t}@${e}`;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function A(t) {
|
|
50
50
|
return (e) => ({
|
|
51
51
|
language: t.map(
|
|
52
52
|
(n) => typeof n == "string" ? n : `${n.label} (${e[n.href] ?? ""})`
|
|
53
53
|
).join(""),
|
|
54
54
|
content: /* @__PURE__ */ s(ee, { children: t.map(
|
|
55
|
-
(n,
|
|
55
|
+
(n, a) => typeof n == "string" ? n : /* @__PURE__ */ h(
|
|
56
56
|
"a",
|
|
57
57
|
{
|
|
58
58
|
href: e[n.href],
|
|
@@ -66,7 +66,7 @@ function x(t) {
|
|
|
66
66
|
] })
|
|
67
67
|
]
|
|
68
68
|
},
|
|
69
|
-
`${n.href}-${
|
|
69
|
+
`${n.href}-${a}`
|
|
70
70
|
)
|
|
71
71
|
) })
|
|
72
72
|
});
|
|
@@ -88,7 +88,7 @@ const ue = {
|
|
|
88
88
|
grantDateField: "tcpa_form_opt_in_date",
|
|
89
89
|
requiredLegalUrls: ["userAgreement", "privacyPolicy"],
|
|
90
90
|
languageKey: "tcpa_consent_language",
|
|
91
|
-
copy:
|
|
91
|
+
copy: A([
|
|
92
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
93
|
{ href: "userAgreement", label: "terms and conditions" },
|
|
94
94
|
" and ",
|
|
@@ -96,6 +96,21 @@ const ue = {
|
|
|
96
96
|
". Calls are recorded and may be monitored."
|
|
97
97
|
])
|
|
98
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: A([
|
|
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
|
+
])
|
|
113
|
+
}, ge = {
|
|
99
114
|
definitionId: "lead-sms",
|
|
100
115
|
definitionVersion: "1",
|
|
101
116
|
type: "checkbox",
|
|
@@ -110,14 +125,14 @@ const ue = {
|
|
|
110
125
|
name: "tospp_form_consent_granted",
|
|
111
126
|
requiredLegalUrls: ["userAgreement", "privacyPolicy"],
|
|
112
127
|
languageKey: "tospp_consent_language",
|
|
113
|
-
copy:
|
|
128
|
+
copy: A([
|
|
114
129
|
"By checking, I accept ",
|
|
115
130
|
{ href: "userAgreement", label: "Terms of Conditions" },
|
|
116
131
|
" & ",
|
|
117
132
|
{ href: "privacyPolicy", label: "Privacy Policy" },
|
|
118
133
|
"."
|
|
119
134
|
])
|
|
120
|
-
},
|
|
135
|
+
}, he = {
|
|
121
136
|
definitionId: "lead-clickwrap",
|
|
122
137
|
definitionVersion: "1",
|
|
123
138
|
type: "notice",
|
|
@@ -129,7 +144,7 @@ const ue = {
|
|
|
129
144
|
"termsOfSale"
|
|
130
145
|
],
|
|
131
146
|
languageKey: "clickwrap_consent_language",
|
|
132
|
-
copy:
|
|
147
|
+
copy: A([
|
|
133
148
|
"By clicking the button, I agree to be bound by your ",
|
|
134
149
|
{ href: "privacyPolicy", label: "Privacy Policy" },
|
|
135
150
|
", ",
|
|
@@ -142,13 +157,13 @@ const ue = {
|
|
|
142
157
|
{ href: "termsOfSale", label: "Terms & Conditions of Sale" },
|
|
143
158
|
"."
|
|
144
159
|
])
|
|
145
|
-
},
|
|
160
|
+
}, be = {
|
|
146
161
|
definitionId: "lead-clickwrap",
|
|
147
162
|
definitionVersion: "2",
|
|
148
163
|
type: "notice",
|
|
149
164
|
requiredLegalUrls: ["privacyPolicy", "userAgreement"],
|
|
150
165
|
languageKey: "clickwrap_consent_language",
|
|
151
|
-
copy:
|
|
166
|
+
copy: A([
|
|
152
167
|
"By submitting, you agree to United States Gold Bureau’s ",
|
|
153
168
|
{ href: "privacyPolicy", label: "Privacy Policy" },
|
|
154
169
|
" and ",
|
|
@@ -156,66 +171,67 @@ const ue = {
|
|
|
156
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."
|
|
157
172
|
])
|
|
158
173
|
};
|
|
159
|
-
function
|
|
174
|
+
function ye(...t) {
|
|
160
175
|
return Object.fromEntries(
|
|
161
176
|
t.map((e) => [
|
|
162
|
-
|
|
177
|
+
z(e.definitionId, e.definitionVersion),
|
|
163
178
|
e
|
|
164
179
|
])
|
|
165
180
|
);
|
|
166
181
|
}
|
|
167
|
-
const
|
|
182
|
+
const ve = ye(
|
|
168
183
|
ue,
|
|
169
184
|
me,
|
|
170
185
|
pe,
|
|
171
|
-
fe,
|
|
172
186
|
ge,
|
|
173
|
-
|
|
187
|
+
fe,
|
|
188
|
+
he,
|
|
189
|
+
be
|
|
174
190
|
);
|
|
175
|
-
function
|
|
176
|
-
return
|
|
191
|
+
function we(t, e) {
|
|
192
|
+
return ve[z(t, e)];
|
|
177
193
|
}
|
|
178
|
-
function
|
|
194
|
+
function Y(t) {
|
|
179
195
|
if (!(t != null && t.length))
|
|
180
196
|
return [];
|
|
181
197
|
const e = [];
|
|
182
198
|
for (const n of t) {
|
|
183
|
-
const
|
|
199
|
+
const a = we(
|
|
184
200
|
n.definitionId,
|
|
185
201
|
n.definitionVersion
|
|
186
202
|
);
|
|
187
|
-
if (!
|
|
203
|
+
if (!a)
|
|
188
204
|
return null;
|
|
189
205
|
e.push(
|
|
190
|
-
|
|
206
|
+
a.type === "checkbox" ? { ...a, required: !!n.required } : a
|
|
191
207
|
);
|
|
192
208
|
}
|
|
193
209
|
return e;
|
|
194
210
|
}
|
|
195
|
-
function ke(t, e, n,
|
|
211
|
+
function ke(t, e, n, a) {
|
|
196
212
|
if (!t.length)
|
|
197
213
|
return;
|
|
198
|
-
const
|
|
214
|
+
const i = {};
|
|
199
215
|
for (const r of t) {
|
|
200
|
-
const { language: l } =
|
|
201
|
-
if (
|
|
202
|
-
const
|
|
203
|
-
|
|
216
|
+
const { language: l } = j(r.copy, n);
|
|
217
|
+
if (i[r.languageKey] = l, r.type === "checkbox") {
|
|
218
|
+
const o = !!e[r.name];
|
|
219
|
+
i[r.name] = o, o && r.grantDateField && (i[r.grantDateField] = a);
|
|
204
220
|
}
|
|
205
221
|
}
|
|
206
|
-
return
|
|
222
|
+
return i;
|
|
207
223
|
}
|
|
208
|
-
function
|
|
224
|
+
function qe(t) {
|
|
209
225
|
const e = /* @__PURE__ */ new Set();
|
|
210
226
|
for (const n of t)
|
|
211
|
-
for (const
|
|
212
|
-
e.add(
|
|
227
|
+
for (const a of n.requiredLegalUrls)
|
|
228
|
+
e.add(a);
|
|
213
229
|
return [...e];
|
|
214
230
|
}
|
|
215
|
-
function
|
|
231
|
+
function Le(t) {
|
|
216
232
|
return t.type === "checkbox";
|
|
217
233
|
}
|
|
218
|
-
function
|
|
234
|
+
function O(t) {
|
|
219
235
|
return (e, n) => n ? e.trim().length > 0 || `${t} is required` : !0;
|
|
220
236
|
}
|
|
221
237
|
const _e = /^[2-9]\d{2}[2-9]\d{6}$/;
|
|
@@ -223,13 +239,13 @@ function Z(t) {
|
|
|
223
239
|
let e = t.replace(/\D/g, "");
|
|
224
240
|
return e.length === 11 && e.startsWith("1") && (e = e.slice(1)), e.length !== 10 || !_e.test(e) ? null : e;
|
|
225
241
|
}
|
|
226
|
-
function
|
|
242
|
+
function Ue(t) {
|
|
227
243
|
const e = t.trim();
|
|
228
244
|
if (!e) return "";
|
|
229
245
|
const n = Z(e);
|
|
230
246
|
if (!n) return e;
|
|
231
|
-
const
|
|
232
|
-
return
|
|
247
|
+
const a = e.replace(/\D/g, "");
|
|
248
|
+
return a.length === 11 && a.startsWith("1") ? `1${n}` : n;
|
|
233
249
|
}
|
|
234
250
|
const Se = {
|
|
235
251
|
firstname: {
|
|
@@ -237,46 +253,46 @@ const Se = {
|
|
|
237
253
|
control: "text",
|
|
238
254
|
label: "First name",
|
|
239
255
|
autoComplete: "given-name",
|
|
240
|
-
validate:
|
|
256
|
+
validate: O("First name")
|
|
241
257
|
},
|
|
242
258
|
lastname: {
|
|
243
259
|
name: "lastname",
|
|
244
260
|
control: "text",
|
|
245
261
|
label: "Last name",
|
|
246
262
|
autoComplete: "family-name",
|
|
247
|
-
validate:
|
|
263
|
+
validate: O("Last name")
|
|
248
264
|
},
|
|
249
265
|
email: {
|
|
250
266
|
name: "email",
|
|
251
267
|
control: "email",
|
|
252
|
-
label: "Email",
|
|
268
|
+
label: "Email address",
|
|
253
269
|
autoComplete: "email",
|
|
254
270
|
validate: (t, e) => {
|
|
255
271
|
const n = t.trim();
|
|
256
|
-
return n ? ne(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;
|
|
257
273
|
}
|
|
258
274
|
},
|
|
259
275
|
phone: {
|
|
260
276
|
name: "phone",
|
|
261
277
|
control: "tel",
|
|
262
|
-
label: "Phone",
|
|
278
|
+
label: "Phone number",
|
|
263
279
|
autoComplete: "tel",
|
|
264
280
|
validate: (t, e) => {
|
|
265
281
|
const n = t.trim();
|
|
266
|
-
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;
|
|
267
283
|
},
|
|
268
|
-
serialize:
|
|
284
|
+
serialize: Ue
|
|
269
285
|
}
|
|
270
286
|
};
|
|
271
|
-
function
|
|
287
|
+
function R(t) {
|
|
272
288
|
return Se[t];
|
|
273
289
|
}
|
|
274
290
|
function J({
|
|
275
291
|
className: t,
|
|
276
292
|
appearance: e,
|
|
277
293
|
variantValue: n,
|
|
278
|
-
twoColumn:
|
|
279
|
-
kind:
|
|
294
|
+
twoColumn: a,
|
|
295
|
+
kind: i,
|
|
280
296
|
children: r
|
|
281
297
|
}) {
|
|
282
298
|
return /* @__PURE__ */ s(
|
|
@@ -285,8 +301,8 @@ function J({
|
|
|
285
301
|
className: `usgb-form ${t ?? ""}`,
|
|
286
302
|
"data-appearance": e,
|
|
287
303
|
...n ? { "data-variant": n } : {},
|
|
288
|
-
...
|
|
289
|
-
"data-kind":
|
|
304
|
+
...a ? { "data-layout": "two-column" } : {},
|
|
305
|
+
"data-kind": i,
|
|
290
306
|
children: r
|
|
291
307
|
}
|
|
292
308
|
);
|
|
@@ -294,106 +310,107 @@ function J({
|
|
|
294
310
|
function Ce() {
|
|
295
311
|
return typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `usgb-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
|
|
296
312
|
}
|
|
297
|
-
function
|
|
313
|
+
function Pe(t, e) {
|
|
298
314
|
const n = {};
|
|
299
|
-
for (const
|
|
300
|
-
n[
|
|
301
|
-
for (const
|
|
302
|
-
n[
|
|
315
|
+
for (const a of t)
|
|
316
|
+
n[a.name] = "";
|
|
317
|
+
for (const a of e)
|
|
318
|
+
n[a] = !1;
|
|
303
319
|
return n;
|
|
304
320
|
}
|
|
305
|
-
function
|
|
321
|
+
function x(t) {
|
|
306
322
|
const e = t == null ? void 0 : t.trim();
|
|
307
323
|
return e || void 0;
|
|
308
324
|
}
|
|
309
|
-
function
|
|
325
|
+
function Te({
|
|
310
326
|
formId: t,
|
|
311
327
|
definition: e,
|
|
312
328
|
legalUrls: n,
|
|
313
|
-
successUrl:
|
|
314
|
-
adapter:
|
|
329
|
+
successUrl: a,
|
|
330
|
+
adapter: i,
|
|
315
331
|
analytics: r,
|
|
316
332
|
onAccepted: l,
|
|
317
|
-
onFailed:
|
|
333
|
+
onFailed: o
|
|
318
334
|
}) {
|
|
319
|
-
const d =
|
|
320
|
-
() =>
|
|
335
|
+
const d = $(), u = T(
|
|
336
|
+
() => Y(e.consents) ?? [],
|
|
321
337
|
[e.consents]
|
|
322
|
-
),
|
|
323
|
-
() => u.filter(
|
|
338
|
+
), g = T(
|
|
339
|
+
() => u.filter(Le).map((p) => p.name),
|
|
324
340
|
[u]
|
|
325
|
-
), b =
|
|
326
|
-
() =>
|
|
327
|
-
[e.fields,
|
|
341
|
+
), b = T(
|
|
342
|
+
() => Pe(e.fields, g),
|
|
343
|
+
[e.fields, g]
|
|
328
344
|
), {
|
|
329
|
-
register:
|
|
330
|
-
handleSubmit:
|
|
331
|
-
formState: { errors:
|
|
345
|
+
register: f,
|
|
346
|
+
handleSubmit: S,
|
|
347
|
+
formState: { errors: k }
|
|
332
348
|
} = re({
|
|
333
349
|
defaultValues: b
|
|
334
|
-
}), [m,
|
|
335
|
-
|
|
350
|
+
}), [m, L] = te({ kind: "idle" }), y = K(!1);
|
|
351
|
+
H(() => {
|
|
336
352
|
r == null || r({ type: "view", formId: t });
|
|
337
353
|
}, [r, t]);
|
|
338
|
-
const c =
|
|
354
|
+
const c = T(() => {
|
|
339
355
|
const p = {};
|
|
340
|
-
for (const
|
|
341
|
-
p[
|
|
342
|
-
for (const
|
|
343
|
-
p[
|
|
356
|
+
for (const w of e.fields)
|
|
357
|
+
p[w.name] = `${d}-${w.name}`;
|
|
358
|
+
for (const w of g)
|
|
359
|
+
p[w] = `${d}-${w}`;
|
|
344
360
|
return p;
|
|
345
|
-
}, [d, e.fields,
|
|
361
|
+
}, [d, e.fields, g]), v = T(() => {
|
|
346
362
|
const p = {};
|
|
347
|
-
for (const
|
|
348
|
-
|
|
363
|
+
for (const w of u)
|
|
364
|
+
w.type === "notice" && (p[w.definitionId] = `${d}-notice-${w.definitionId}`);
|
|
349
365
|
return p;
|
|
350
|
-
}, [d, u]),
|
|
366
|
+
}, [d, u]), C = S(
|
|
351
367
|
async (p) => {
|
|
352
368
|
if (y.current)
|
|
353
369
|
return;
|
|
354
|
-
y.current = !0,
|
|
355
|
-
const q = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), P =
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
370
|
+
y.current = !0, L({ kind: "submitting" }), r == null || r({ type: "submit_attempt", formId: t });
|
|
371
|
+
const q = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), P = e.fields.map(
|
|
372
|
+
(_) => {
|
|
373
|
+
const U = p[_.name];
|
|
374
|
+
if (typeof U != "string")
|
|
375
|
+
return { name: _.name, value: !!U };
|
|
376
|
+
const N = R(_.name);
|
|
377
|
+
return {
|
|
378
|
+
name: _.name,
|
|
379
|
+
value: N != null && N.serialize ? N.serialize(U) : U.trim()
|
|
380
|
+
};
|
|
361
381
|
}
|
|
362
|
-
|
|
363
|
-
P[L.name] = F != null && F.serialize ? F.serialize(S) : S.trim();
|
|
364
|
-
}
|
|
365
|
-
const E = ke(
|
|
382
|
+
), I = ke(
|
|
366
383
|
u,
|
|
367
384
|
p,
|
|
368
385
|
n ?? {},
|
|
369
386
|
q
|
|
370
|
-
),
|
|
387
|
+
), V = {
|
|
371
388
|
formId: t,
|
|
372
389
|
definitionVersion: e.definitionVersion,
|
|
373
|
-
submissionContractVersion:
|
|
390
|
+
submissionContractVersion: E.submissionContract.version,
|
|
374
391
|
idempotencyKey: Ce(),
|
|
375
392
|
data: P,
|
|
376
|
-
consents:
|
|
393
|
+
consents: I
|
|
377
394
|
};
|
|
378
395
|
try {
|
|
379
|
-
const
|
|
380
|
-
if (
|
|
381
|
-
r == null || r({ type: "success", formId: t, status: "accepted" }), l == null || l(
|
|
382
|
-
const
|
|
383
|
-
|
|
396
|
+
const _ = await i.submit(V);
|
|
397
|
+
if (_.status === "accepted") {
|
|
398
|
+
r == null || r({ type: "success", formId: t, status: "accepted" }), l == null || l(V), L({ kind: "accepted" });
|
|
399
|
+
const U = x(a);
|
|
400
|
+
U && typeof window < "u" && window.location.assign(U);
|
|
384
401
|
} else
|
|
385
|
-
y.current = !1,
|
|
402
|
+
y.current = !1, L({
|
|
386
403
|
kind: "failed",
|
|
387
|
-
message:
|
|
404
|
+
message: _.message ?? "Submission failed"
|
|
388
405
|
}), r == null || r({
|
|
389
406
|
type: "failure",
|
|
390
407
|
formId: t,
|
|
391
|
-
message:
|
|
392
|
-
}),
|
|
393
|
-
} catch (
|
|
408
|
+
message: _.message
|
|
409
|
+
}), o == null || o(V, _.message);
|
|
410
|
+
} catch (_) {
|
|
394
411
|
y.current = !1;
|
|
395
|
-
const
|
|
396
|
-
|
|
412
|
+
const U = _ instanceof Error ? _.message : "Submission failed";
|
|
413
|
+
L({ kind: "failed", message: U }), r == null || r({ type: "failure", formId: t, message: U }), o == null || o(V, U);
|
|
397
414
|
}
|
|
398
415
|
},
|
|
399
416
|
(p) => {
|
|
@@ -405,16 +422,16 @@ function Pe({
|
|
|
405
422
|
}
|
|
406
423
|
);
|
|
407
424
|
return {
|
|
408
|
-
register:
|
|
409
|
-
errors:
|
|
425
|
+
register: f,
|
|
426
|
+
errors: k,
|
|
410
427
|
fieldIds: c,
|
|
411
428
|
noticeIds: v,
|
|
412
429
|
consentDefs: u,
|
|
413
430
|
uiState: m,
|
|
414
|
-
onSubmit:
|
|
431
|
+
onSubmit: C
|
|
415
432
|
};
|
|
416
433
|
}
|
|
417
|
-
function
|
|
434
|
+
function Fe() {
|
|
418
435
|
return /* @__PURE__ */ h(
|
|
419
436
|
"svg",
|
|
420
437
|
{
|
|
@@ -447,7 +464,7 @@ function De() {
|
|
|
447
464
|
}
|
|
448
465
|
);
|
|
449
466
|
}
|
|
450
|
-
function
|
|
467
|
+
function De() {
|
|
451
468
|
return /* @__PURE__ */ s(
|
|
452
469
|
"svg",
|
|
453
470
|
{
|
|
@@ -472,7 +489,7 @@ function Te() {
|
|
|
472
489
|
}
|
|
473
490
|
);
|
|
474
491
|
}
|
|
475
|
-
function
|
|
492
|
+
function G({
|
|
476
493
|
id: t,
|
|
477
494
|
message: e,
|
|
478
495
|
className: n
|
|
@@ -482,38 +499,38 @@ function O({
|
|
|
482
499
|
{
|
|
483
500
|
id: t,
|
|
484
501
|
role: "alert",
|
|
485
|
-
className:
|
|
502
|
+
className: D("usgb-field-error", n),
|
|
486
503
|
children: [
|
|
487
|
-
/* @__PURE__ */ s(
|
|
504
|
+
/* @__PURE__ */ s(Fe, {}),
|
|
488
505
|
e
|
|
489
506
|
]
|
|
490
507
|
}
|
|
491
508
|
) : null;
|
|
492
509
|
}
|
|
493
|
-
const Ae =
|
|
494
|
-
function({ id: e, label: n, errorMessage:
|
|
495
|
-
const d =
|
|
496
|
-
return /* @__PURE__ */ h("div", { className: "usgb-form-group", children: [
|
|
510
|
+
const Ae = M(
|
|
511
|
+
function({ id: e, label: n, errorMessage: a, required: i, className: r, ...l }, o) {
|
|
512
|
+
const d = a ? `${e}-error` : void 0;
|
|
513
|
+
return /* @__PURE__ */ h("div", { className: "usgb-form-group usgb-consent", children: [
|
|
497
514
|
/* @__PURE__ */ h("div", { className: "usgb-consent-row", children: [
|
|
498
515
|
/* @__PURE__ */ h("span", { className: "usgb-form-checkbox-wrap", children: [
|
|
499
516
|
/* @__PURE__ */ s(
|
|
500
517
|
"input",
|
|
501
518
|
{
|
|
502
519
|
...l,
|
|
503
|
-
ref:
|
|
520
|
+
ref: o,
|
|
504
521
|
id: e,
|
|
505
522
|
type: "checkbox",
|
|
506
|
-
className:
|
|
507
|
-
"aria-invalid":
|
|
523
|
+
className: D("usgb-form-checkbox", r),
|
|
524
|
+
"aria-invalid": a ? !0 : void 0,
|
|
508
525
|
"aria-describedby": d,
|
|
509
|
-
"aria-required":
|
|
526
|
+
"aria-required": i || void 0
|
|
510
527
|
}
|
|
511
528
|
),
|
|
512
|
-
/* @__PURE__ */ s(
|
|
529
|
+
/* @__PURE__ */ s(De, {})
|
|
513
530
|
] }),
|
|
514
531
|
/* @__PURE__ */ h("label", { htmlFor: e, className: "usgb-consent-copy", children: [
|
|
515
532
|
n,
|
|
516
|
-
|
|
533
|
+
i ? /* @__PURE__ */ s(
|
|
517
534
|
"span",
|
|
518
535
|
{
|
|
519
536
|
className: "usgb-field-label-asterisk",
|
|
@@ -523,95 +540,95 @@ const Ae = R(
|
|
|
523
540
|
) : null
|
|
524
541
|
] })
|
|
525
542
|
] }),
|
|
526
|
-
/* @__PURE__ */ s(
|
|
543
|
+
/* @__PURE__ */ s(G, { id: d, message: a })
|
|
527
544
|
] });
|
|
528
545
|
}
|
|
529
|
-
), Q =
|
|
546
|
+
), Q = M(
|
|
530
547
|
function({
|
|
531
548
|
className: e,
|
|
532
549
|
variant: n = "primary",
|
|
533
|
-
loading:
|
|
534
|
-
disabled:
|
|
550
|
+
loading: a = !1,
|
|
551
|
+
disabled: i = !1,
|
|
535
552
|
children: r,
|
|
536
553
|
onClick: l,
|
|
537
|
-
type:
|
|
554
|
+
type: o = "button",
|
|
538
555
|
...d
|
|
539
556
|
}, u) {
|
|
540
|
-
const
|
|
557
|
+
const g = i || a, b = i && !a ? !0 : void 0;
|
|
541
558
|
return /* @__PURE__ */ s(
|
|
542
559
|
"button",
|
|
543
560
|
{
|
|
544
561
|
ref: u,
|
|
545
|
-
type:
|
|
546
|
-
className:
|
|
562
|
+
type: o,
|
|
563
|
+
className: D(
|
|
547
564
|
"usgb-btn",
|
|
548
565
|
n === "primary" && "usgb-btn-primary",
|
|
549
566
|
e
|
|
550
567
|
),
|
|
551
568
|
...d,
|
|
552
569
|
disabled: b,
|
|
553
|
-
"aria-disabled":
|
|
554
|
-
"aria-busy":
|
|
555
|
-
onClick: (
|
|
556
|
-
if (
|
|
557
|
-
|
|
570
|
+
"aria-disabled": g || void 0,
|
|
571
|
+
"aria-busy": a || void 0,
|
|
572
|
+
onClick: (f) => {
|
|
573
|
+
if (g) {
|
|
574
|
+
f.preventDefault();
|
|
558
575
|
return;
|
|
559
576
|
}
|
|
560
|
-
l == null || l(
|
|
577
|
+
l == null || l(f);
|
|
561
578
|
},
|
|
562
|
-
children:
|
|
579
|
+
children: a ? "Submitting…" : r
|
|
563
580
|
}
|
|
564
581
|
);
|
|
565
582
|
}
|
|
566
583
|
);
|
|
567
|
-
function
|
|
584
|
+
function Ie(t) {
|
|
568
585
|
const e = [];
|
|
569
586
|
let n = 0;
|
|
570
587
|
for (; n < t.length; ) {
|
|
571
|
-
const
|
|
572
|
-
if (
|
|
573
|
-
const
|
|
574
|
-
for (; n < t.length && t[n].group ===
|
|
588
|
+
const a = t[n];
|
|
589
|
+
if (a.group) {
|
|
590
|
+
const i = a.group, r = [];
|
|
591
|
+
for (; n < t.length && t[n].group === i; )
|
|
575
592
|
r.push(t[n]), n += 1;
|
|
576
|
-
e.push({ type: "group", group:
|
|
593
|
+
e.push({ type: "group", group: i, fields: r });
|
|
577
594
|
continue;
|
|
578
595
|
}
|
|
579
|
-
e.push({ type: "field", field:
|
|
596
|
+
e.push({ type: "field", field: a }), n += 1;
|
|
580
597
|
}
|
|
581
598
|
return e;
|
|
582
599
|
}
|
|
583
|
-
function
|
|
600
|
+
function Ve({
|
|
584
601
|
htmlFor: t,
|
|
585
602
|
children: e,
|
|
586
603
|
className: n,
|
|
587
|
-
required:
|
|
604
|
+
required: a
|
|
588
605
|
}) {
|
|
589
|
-
return /* @__PURE__ */ h("label", { htmlFor: t, className:
|
|
606
|
+
return /* @__PURE__ */ h("label", { htmlFor: t, className: D("usgb-field-label", n), children: [
|
|
590
607
|
e,
|
|
591
|
-
|
|
608
|
+
a ? /* @__PURE__ */ s("span", { className: "usgb-field-label-asterisk", "aria-hidden": "true", children: "*" }) : null
|
|
592
609
|
] });
|
|
593
610
|
}
|
|
594
|
-
function
|
|
611
|
+
function Ne(t) {
|
|
595
612
|
return t.replace(/\b\w/g, (e) => e.toUpperCase());
|
|
596
613
|
}
|
|
597
|
-
const
|
|
614
|
+
const Ee = M(
|
|
598
615
|
function({
|
|
599
616
|
id: e,
|
|
600
617
|
label: n,
|
|
601
|
-
type:
|
|
602
|
-
errorMessage:
|
|
618
|
+
type: a = "text",
|
|
619
|
+
errorMessage: i,
|
|
603
620
|
required: r,
|
|
604
621
|
hideLabel: l = !1,
|
|
605
|
-
placeholderCase:
|
|
622
|
+
placeholderCase: o = "upper",
|
|
606
623
|
showError: d = !0,
|
|
607
624
|
className: u,
|
|
608
|
-
placeholder:
|
|
625
|
+
placeholder: g,
|
|
609
626
|
...b
|
|
610
|
-
},
|
|
611
|
-
const
|
|
627
|
+
}, f) {
|
|
628
|
+
const S = i ? `${e}-error` : void 0, k = l ? `${n}${r ? "*" : ""}` : g, m = l && k ? o === "title" ? Ne(k) : k.toUpperCase() : k;
|
|
612
629
|
return /* @__PURE__ */ h("div", { className: "usgb-form-group", children: [
|
|
613
630
|
/* @__PURE__ */ s(
|
|
614
|
-
|
|
631
|
+
Ve,
|
|
615
632
|
{
|
|
616
633
|
htmlFor: e,
|
|
617
634
|
required: r,
|
|
@@ -622,52 +639,52 @@ const Ne = R(
|
|
|
622
639
|
/* @__PURE__ */ s(
|
|
623
640
|
"input",
|
|
624
641
|
{
|
|
625
|
-
ref:
|
|
642
|
+
ref: f,
|
|
626
643
|
id: e,
|
|
627
|
-
type:
|
|
628
|
-
className:
|
|
644
|
+
type: a,
|
|
645
|
+
className: D(
|
|
629
646
|
"usgb-field-control",
|
|
630
|
-
|
|
647
|
+
i && "usgb-field-invalid",
|
|
631
648
|
u
|
|
632
649
|
),
|
|
633
650
|
placeholder: m,
|
|
634
|
-
"aria-invalid":
|
|
635
|
-
"aria-describedby":
|
|
651
|
+
"aria-invalid": i ? !0 : void 0,
|
|
652
|
+
"aria-describedby": S,
|
|
636
653
|
"aria-required": r || void 0,
|
|
637
654
|
...b
|
|
638
655
|
}
|
|
639
656
|
),
|
|
640
|
-
d ? /* @__PURE__ */ s(
|
|
657
|
+
d ? /* @__PURE__ */ s(G, { id: S, message: i }) : null
|
|
641
658
|
] });
|
|
642
659
|
}
|
|
643
660
|
);
|
|
644
|
-
function
|
|
661
|
+
function B({
|
|
645
662
|
fieldRef: t,
|
|
646
663
|
fieldIds: e,
|
|
647
664
|
register: n,
|
|
648
|
-
errors:
|
|
649
|
-
hideLabel:
|
|
665
|
+
errors: a,
|
|
666
|
+
hideLabel: i,
|
|
650
667
|
placeholderCase: r,
|
|
651
668
|
showError: l = !0
|
|
652
669
|
}) {
|
|
653
|
-
const
|
|
654
|
-
if (!
|
|
655
|
-
const d =
|
|
670
|
+
const o = R(t.name);
|
|
671
|
+
if (!o) return null;
|
|
672
|
+
const d = a[t.name], u = typeof (d == null ? void 0 : d.message) == "string" ? d.message : void 0;
|
|
656
673
|
return /* @__PURE__ */ s(
|
|
657
|
-
|
|
674
|
+
Ee,
|
|
658
675
|
{
|
|
659
676
|
id: e[t.name],
|
|
660
|
-
label:
|
|
661
|
-
type:
|
|
677
|
+
label: o.label,
|
|
678
|
+
type: o.control,
|
|
662
679
|
required: t.required,
|
|
663
|
-
hideLabel:
|
|
680
|
+
hideLabel: i,
|
|
664
681
|
placeholderCase: r,
|
|
665
682
|
showError: l,
|
|
666
|
-
autoComplete:
|
|
683
|
+
autoComplete: o.autoComplete,
|
|
667
684
|
errorMessage: u,
|
|
668
685
|
...n(t.name, {
|
|
669
|
-
validate: (
|
|
670
|
-
typeof
|
|
686
|
+
validate: (g) => o.validate(
|
|
687
|
+
typeof g == "string" ? g : "",
|
|
671
688
|
t.required
|
|
672
689
|
)
|
|
673
690
|
})
|
|
@@ -678,75 +695,75 @@ function xe({
|
|
|
678
695
|
definition: t,
|
|
679
696
|
variant: e,
|
|
680
697
|
ctaLabel: n,
|
|
681
|
-
legalUrls:
|
|
682
|
-
session:
|
|
698
|
+
legalUrls: a,
|
|
699
|
+
session: i,
|
|
683
700
|
headingId: r
|
|
684
701
|
}) {
|
|
685
702
|
const {
|
|
686
703
|
register: l,
|
|
687
|
-
errors:
|
|
704
|
+
errors: o,
|
|
688
705
|
fieldIds: d,
|
|
689
706
|
noticeIds: u,
|
|
690
|
-
consentDefs:
|
|
707
|
+
consentDefs: g,
|
|
691
708
|
uiState: b,
|
|
692
|
-
onSubmit:
|
|
693
|
-
} =
|
|
694
|
-
() =>
|
|
709
|
+
onSubmit: f
|
|
710
|
+
} = i, S = T(
|
|
711
|
+
() => Ie(t.fields),
|
|
695
712
|
[t.fields]
|
|
696
|
-
),
|
|
713
|
+
), k = e === "sidebar", m = e === "dense" || k, L = k ? "title" : "upper", y = Object.values(u).join(" ");
|
|
697
714
|
return /* @__PURE__ */ h(
|
|
698
715
|
"form",
|
|
699
716
|
{
|
|
700
|
-
onSubmit:
|
|
717
|
+
onSubmit: f,
|
|
701
718
|
noValidate: !0,
|
|
702
719
|
...r ? { "aria-labelledby": r } : {},
|
|
703
720
|
children: [
|
|
704
|
-
|
|
721
|
+
S.map((c) => c.type === "group" ? /* @__PURE__ */ s(
|
|
705
722
|
"div",
|
|
706
723
|
{
|
|
707
724
|
className: "usgb-form-grid",
|
|
708
725
|
children: c.fields.map((v) => /* @__PURE__ */ s(
|
|
709
|
-
|
|
726
|
+
B,
|
|
710
727
|
{
|
|
711
728
|
fieldRef: v,
|
|
712
729
|
fieldIds: d,
|
|
713
730
|
register: l,
|
|
714
|
-
errors:
|
|
731
|
+
errors: o,
|
|
715
732
|
hideLabel: m,
|
|
716
|
-
placeholderCase:
|
|
733
|
+
placeholderCase: L
|
|
717
734
|
},
|
|
718
735
|
v.name
|
|
719
736
|
))
|
|
720
737
|
},
|
|
721
738
|
`group-${c.group}-${c.fields.map((v) => v.name).join("-")}`
|
|
722
739
|
) : /* @__PURE__ */ s(
|
|
723
|
-
|
|
740
|
+
B,
|
|
724
741
|
{
|
|
725
742
|
fieldRef: c.field,
|
|
726
743
|
fieldIds: d,
|
|
727
744
|
register: l,
|
|
728
|
-
errors:
|
|
745
|
+
errors: o,
|
|
729
746
|
hideLabel: m,
|
|
730
|
-
placeholderCase:
|
|
747
|
+
placeholderCase: L
|
|
731
748
|
},
|
|
732
749
|
c.field.name
|
|
733
750
|
)),
|
|
734
|
-
|
|
735
|
-
const { content: v } =
|
|
751
|
+
g.map((c) => {
|
|
752
|
+
const { content: v } = j(
|
|
736
753
|
c.copy,
|
|
737
|
-
|
|
754
|
+
a ?? {}
|
|
738
755
|
);
|
|
739
756
|
if (c.type === "notice")
|
|
740
757
|
return /* @__PURE__ */ s(
|
|
741
758
|
"p",
|
|
742
759
|
{
|
|
743
760
|
id: u[c.definitionId],
|
|
744
|
-
className: "usgb-consent-copy usgb-consent-notice",
|
|
761
|
+
className: "usgb-consent usgb-consent-copy usgb-consent-notice",
|
|
745
762
|
children: v
|
|
746
763
|
},
|
|
747
764
|
c.definitionId
|
|
748
765
|
);
|
|
749
|
-
const
|
|
766
|
+
const C = o[c.name], p = typeof (C == null ? void 0 : C.message) == "string" ? C.message : void 0;
|
|
750
767
|
return /* @__PURE__ */ s(
|
|
751
768
|
Ae,
|
|
752
769
|
{
|
|
@@ -782,49 +799,49 @@ function xe({
|
|
|
782
799
|
}
|
|
783
800
|
);
|
|
784
801
|
}
|
|
785
|
-
function
|
|
802
|
+
function Be({
|
|
786
803
|
definition: t,
|
|
787
804
|
ctaLabel: e,
|
|
788
805
|
session: n,
|
|
789
|
-
headingId:
|
|
806
|
+
headingId: a
|
|
790
807
|
}) {
|
|
791
808
|
var b;
|
|
792
|
-
const { register:
|
|
809
|
+
const { register: i, errors: r, fieldIds: l, uiState: o, onSubmit: d } = n, u = t.fields.find((f) => f.name === "email"), g = typeof ((b = r.email) == null ? void 0 : b.message) == "string" ? r.email.message : void 0;
|
|
793
810
|
return u ? /* @__PURE__ */ h(
|
|
794
811
|
"form",
|
|
795
812
|
{
|
|
796
813
|
onSubmit: d,
|
|
797
814
|
noValidate: !0,
|
|
798
|
-
...
|
|
815
|
+
...a ? { "aria-labelledby": a } : {},
|
|
799
816
|
children: [
|
|
800
817
|
/* @__PURE__ */ h("div", { className: "usgb-form-inline", children: [
|
|
801
818
|
/* @__PURE__ */ s(
|
|
802
|
-
|
|
819
|
+
B,
|
|
803
820
|
{
|
|
804
821
|
fieldRef: u,
|
|
805
822
|
fieldIds: l,
|
|
806
|
-
register:
|
|
823
|
+
register: i,
|
|
807
824
|
errors: r,
|
|
808
825
|
hideLabel: !0,
|
|
809
826
|
placeholderCase: "upper",
|
|
810
827
|
showError: !1
|
|
811
828
|
}
|
|
812
829
|
),
|
|
813
|
-
/* @__PURE__ */ s(Q, { type: "submit", loading:
|
|
830
|
+
/* @__PURE__ */ s(Q, { type: "submit", loading: o.kind === "submitting", children: e })
|
|
814
831
|
] }),
|
|
815
832
|
/* @__PURE__ */ s(
|
|
816
|
-
|
|
833
|
+
G,
|
|
817
834
|
{
|
|
818
|
-
id:
|
|
819
|
-
message:
|
|
835
|
+
id: g ? `${l.email}-error` : void 0,
|
|
836
|
+
message: g
|
|
820
837
|
}
|
|
821
838
|
),
|
|
822
|
-
|
|
839
|
+
o.kind === "failed" ? /* @__PURE__ */ s(
|
|
823
840
|
"p",
|
|
824
841
|
{
|
|
825
842
|
className: "usgb-form-status usgb-form-status-error",
|
|
826
843
|
role: "alert",
|
|
827
|
-
children:
|
|
844
|
+
children: o.message ?? "Something went wrong. Please try again."
|
|
828
845
|
}
|
|
829
846
|
) : null
|
|
830
847
|
]
|
|
@@ -833,14 +850,14 @@ function Me({
|
|
|
833
850
|
}
|
|
834
851
|
const X = {
|
|
835
852
|
lead: xe,
|
|
836
|
-
newsletter:
|
|
837
|
-
},
|
|
838
|
-
function
|
|
853
|
+
newsletter: Be
|
|
854
|
+
}, Me = "Thank you. Your request has been accepted and is being processed.";
|
|
855
|
+
function F({
|
|
839
856
|
className: t,
|
|
840
857
|
appearance: e,
|
|
841
858
|
variantValue: n,
|
|
842
|
-
twoColumn:
|
|
843
|
-
kind:
|
|
859
|
+
twoColumn: a,
|
|
860
|
+
kind: i,
|
|
844
861
|
children: r
|
|
845
862
|
}) {
|
|
846
863
|
return /* @__PURE__ */ s(
|
|
@@ -849,8 +866,8 @@ function T({
|
|
|
849
866
|
className: t,
|
|
850
867
|
appearance: e,
|
|
851
868
|
variantValue: n,
|
|
852
|
-
twoColumn:
|
|
853
|
-
kind:
|
|
869
|
+
twoColumn: a,
|
|
870
|
+
kind: i,
|
|
854
871
|
children: /* @__PURE__ */ s("p", { className: "usgb-form-status usgb-form-status-error", role: "alert", children: r })
|
|
855
872
|
}
|
|
856
873
|
);
|
|
@@ -859,55 +876,55 @@ function Re({
|
|
|
859
876
|
formId: t,
|
|
860
877
|
definition: e,
|
|
861
878
|
appearance: n,
|
|
862
|
-
variant:
|
|
863
|
-
variantValue:
|
|
879
|
+
variant: a,
|
|
880
|
+
variantValue: i,
|
|
864
881
|
twoColumn: r,
|
|
865
882
|
heading: l,
|
|
866
|
-
subheading:
|
|
883
|
+
subheading: o,
|
|
867
884
|
ctaLabel: d,
|
|
868
885
|
legalUrls: u,
|
|
869
|
-
successMessage:
|
|
886
|
+
successMessage: g,
|
|
870
887
|
successUrl: b,
|
|
871
|
-
adapter:
|
|
872
|
-
analytics:
|
|
873
|
-
className:
|
|
888
|
+
adapter: f,
|
|
889
|
+
analytics: S,
|
|
890
|
+
className: k,
|
|
874
891
|
onAccepted: m,
|
|
875
|
-
onFailed:
|
|
892
|
+
onFailed: L
|
|
876
893
|
}) {
|
|
877
|
-
const y =
|
|
894
|
+
const y = $(), c = l ? `${y}-heading` : void 0, v = K(null), C = Te({
|
|
878
895
|
formId: t,
|
|
879
896
|
definition: e,
|
|
880
897
|
legalUrls: u,
|
|
881
898
|
successUrl: b,
|
|
882
|
-
adapter:
|
|
883
|
-
analytics:
|
|
899
|
+
adapter: f,
|
|
900
|
+
analytics: S,
|
|
884
901
|
onAccepted: m,
|
|
885
|
-
onFailed:
|
|
886
|
-
}), p =
|
|
887
|
-
|
|
888
|
-
var
|
|
889
|
-
q && ((
|
|
902
|
+
onFailed: L
|
|
903
|
+
}), p = C.uiState.kind === "accepted", w = p && !!x(b), q = p && !w ? x(g) ?? Me : "";
|
|
904
|
+
H(() => {
|
|
905
|
+
var I;
|
|
906
|
+
q && ((I = v.current) == null || I.focus());
|
|
890
907
|
}, [q]);
|
|
891
908
|
const P = X[e.kind];
|
|
892
909
|
return /* @__PURE__ */ h(
|
|
893
910
|
J,
|
|
894
911
|
{
|
|
895
|
-
className:
|
|
912
|
+
className: k,
|
|
896
913
|
appearance: n,
|
|
897
|
-
variantValue:
|
|
914
|
+
variantValue: i,
|
|
898
915
|
twoColumn: r,
|
|
899
916
|
kind: e.kind,
|
|
900
917
|
children: [
|
|
901
918
|
l ? /* @__PURE__ */ s("h2", { id: c, className: "usgb-form-heading", children: l }) : null,
|
|
902
|
-
!p &&
|
|
919
|
+
!p && o ? /* @__PURE__ */ s("p", { className: "usgb-form-subheading", children: o }) : null,
|
|
903
920
|
p ? null : /* @__PURE__ */ s(
|
|
904
921
|
P,
|
|
905
922
|
{
|
|
906
923
|
definition: e,
|
|
907
|
-
variant:
|
|
924
|
+
variant: a,
|
|
908
925
|
ctaLabel: d,
|
|
909
926
|
legalUrls: u,
|
|
910
|
-
session:
|
|
927
|
+
session: C,
|
|
911
928
|
headingId: c
|
|
912
929
|
}
|
|
913
930
|
),
|
|
@@ -926,29 +943,29 @@ function Re({
|
|
|
926
943
|
}
|
|
927
944
|
);
|
|
928
945
|
}
|
|
929
|
-
function
|
|
946
|
+
function ze({
|
|
930
947
|
formId: t,
|
|
931
948
|
appearance: e = "on-light",
|
|
932
949
|
variant: n = "dense",
|
|
933
|
-
twoColumn:
|
|
934
|
-
heading:
|
|
950
|
+
twoColumn: a = !1,
|
|
951
|
+
heading: i,
|
|
935
952
|
subheading: r,
|
|
936
953
|
ctaLabel: l,
|
|
937
|
-
legalUrls:
|
|
954
|
+
legalUrls: o,
|
|
938
955
|
successMessage: d,
|
|
939
956
|
successUrl: u,
|
|
940
|
-
adapter:
|
|
957
|
+
adapter: g,
|
|
941
958
|
analytics: b,
|
|
942
|
-
className:
|
|
943
|
-
onAccepted:
|
|
944
|
-
onFailed:
|
|
959
|
+
className: f,
|
|
960
|
+
onAccepted: S,
|
|
961
|
+
onFailed: k
|
|
945
962
|
}) {
|
|
946
|
-
const m =
|
|
963
|
+
const m = W(t), L = (m == null ? void 0 : m.kind) === "newsletter", y = L ? "" : n, c = !L && a;
|
|
947
964
|
if (!m)
|
|
948
965
|
return /* @__PURE__ */ h(
|
|
949
|
-
|
|
966
|
+
F,
|
|
950
967
|
{
|
|
951
|
-
className:
|
|
968
|
+
className: f,
|
|
952
969
|
appearance: e,
|
|
953
970
|
variantValue: y,
|
|
954
971
|
twoColumn: c,
|
|
@@ -958,12 +975,12 @@ function We({
|
|
|
958
975
|
]
|
|
959
976
|
}
|
|
960
977
|
);
|
|
961
|
-
const v =
|
|
978
|
+
const v = Y(m.consents);
|
|
962
979
|
if (v === null)
|
|
963
980
|
return /* @__PURE__ */ h(
|
|
964
|
-
|
|
981
|
+
F,
|
|
965
982
|
{
|
|
966
|
-
className:
|
|
983
|
+
className: f,
|
|
967
984
|
appearance: e,
|
|
968
985
|
variantValue: y,
|
|
969
986
|
twoColumn: c,
|
|
@@ -974,17 +991,17 @@ function We({
|
|
|
974
991
|
]
|
|
975
992
|
}
|
|
976
993
|
);
|
|
977
|
-
const p =
|
|
994
|
+
const p = qe(v).filter(
|
|
978
995
|
(q) => {
|
|
979
996
|
var P;
|
|
980
|
-
return !((P =
|
|
997
|
+
return !((P = o == null ? void 0 : o[q]) != null && P.trim());
|
|
981
998
|
}
|
|
982
999
|
);
|
|
983
1000
|
if (p.length)
|
|
984
1001
|
return /* @__PURE__ */ h(
|
|
985
|
-
|
|
1002
|
+
F,
|
|
986
1003
|
{
|
|
987
|
-
className:
|
|
1004
|
+
className: f,
|
|
988
1005
|
appearance: e,
|
|
989
1006
|
variantValue: y,
|
|
990
1007
|
twoColumn: c,
|
|
@@ -997,13 +1014,13 @@ function We({
|
|
|
997
1014
|
]
|
|
998
1015
|
}
|
|
999
1016
|
);
|
|
1000
|
-
const
|
|
1001
|
-
(q) => !
|
|
1017
|
+
const w = m.fields.filter(
|
|
1018
|
+
(q) => !R(q.name)
|
|
1002
1019
|
);
|
|
1003
|
-
return
|
|
1004
|
-
|
|
1020
|
+
return w.length ? /* @__PURE__ */ h(
|
|
1021
|
+
F,
|
|
1005
1022
|
{
|
|
1006
|
-
className:
|
|
1023
|
+
className: f,
|
|
1007
1024
|
appearance: e,
|
|
1008
1025
|
variantValue: y,
|
|
1009
1026
|
twoColumn: c,
|
|
@@ -1013,7 +1030,7 @@ function We({
|
|
|
1013
1030
|
t,
|
|
1014
1031
|
":",
|
|
1015
1032
|
" ",
|
|
1016
|
-
|
|
1033
|
+
w.map((q) => q.name).join(", ")
|
|
1017
1034
|
]
|
|
1018
1035
|
}
|
|
1019
1036
|
) : m.kind in X ? /* @__PURE__ */ s(
|
|
@@ -1025,22 +1042,22 @@ function We({
|
|
|
1025
1042
|
variant: n,
|
|
1026
1043
|
variantValue: y,
|
|
1027
1044
|
twoColumn: c,
|
|
1028
|
-
heading:
|
|
1045
|
+
heading: i,
|
|
1029
1046
|
subheading: r,
|
|
1030
1047
|
ctaLabel: l ?? m.ctaLabel,
|
|
1031
|
-
legalUrls:
|
|
1048
|
+
legalUrls: o,
|
|
1032
1049
|
successMessage: d,
|
|
1033
1050
|
successUrl: u,
|
|
1034
|
-
adapter:
|
|
1051
|
+
adapter: g,
|
|
1035
1052
|
analytics: b,
|
|
1036
|
-
className:
|
|
1037
|
-
onAccepted:
|
|
1038
|
-
onFailed:
|
|
1053
|
+
className: f,
|
|
1054
|
+
onAccepted: S,
|
|
1055
|
+
onFailed: k
|
|
1039
1056
|
}
|
|
1040
1057
|
) : /* @__PURE__ */ h(
|
|
1041
|
-
|
|
1058
|
+
F,
|
|
1042
1059
|
{
|
|
1043
|
-
className:
|
|
1060
|
+
className: f,
|
|
1044
1061
|
appearance: e,
|
|
1045
1062
|
variantValue: y,
|
|
1046
1063
|
twoColumn: c,
|
|
@@ -1053,23 +1070,23 @@ function We({
|
|
|
1053
1070
|
);
|
|
1054
1071
|
}
|
|
1055
1072
|
function Ye(t = {}) {
|
|
1056
|
-
const e = typeof t == "string" ? { host: t } : t, n = e.host ?? "pwa",
|
|
1073
|
+
const e = typeof t == "string" ? { host: t } : t, n = e.host ?? "pwa", a = e.delayMs ?? 400, i = e.result ?? { status: "accepted" };
|
|
1057
1074
|
return {
|
|
1058
1075
|
host: n,
|
|
1059
1076
|
async submit(r) {
|
|
1060
1077
|
var l;
|
|
1061
|
-
return (l = e.onSubmit) == null || l.call(e, r), await new Promise((
|
|
1078
|
+
return (l = e.onSubmit) == null || l.call(e, r), await new Promise((o) => setTimeout(o, a)), i;
|
|
1062
1079
|
}
|
|
1063
1080
|
};
|
|
1064
1081
|
}
|
|
1065
|
-
const
|
|
1082
|
+
const Ze = {
|
|
1066
1083
|
clientAgreement: "client-agreement-url",
|
|
1067
1084
|
privacyPolicy: "privacy-policy-url",
|
|
1068
1085
|
userAgreement: "user-agreement-url",
|
|
1069
1086
|
marketLossPolicy: "market-loss-policy-url",
|
|
1070
1087
|
electronicDisclaimer: "electronic-disclaimer-url",
|
|
1071
1088
|
termsOfSale: "terms-of-sale-url"
|
|
1072
|
-
},
|
|
1089
|
+
}, Je = {
|
|
1073
1090
|
clientAgreement: "/content/client-agreement",
|
|
1074
1091
|
privacyPolicy: "/content/privacy-policy",
|
|
1075
1092
|
userAgreement: "/content/user-agreement",
|
|
@@ -1077,38 +1094,39 @@ const He = {
|
|
|
1077
1094
|
electronicDisclaimer: "/content/electronic-disclaimer",
|
|
1078
1095
|
termsOfSale: "/content/terms-of-sale"
|
|
1079
1096
|
};
|
|
1080
|
-
function
|
|
1097
|
+
function Qe(t, e) {
|
|
1081
1098
|
return e.every((n) => {
|
|
1082
|
-
var
|
|
1083
|
-
return !!((
|
|
1099
|
+
var a;
|
|
1100
|
+
return !!((a = t == null ? void 0 : t[n]) != null && a.trim());
|
|
1084
1101
|
});
|
|
1085
1102
|
}
|
|
1086
1103
|
export {
|
|
1087
1104
|
Q as Button,
|
|
1088
1105
|
Ae as ConsentField,
|
|
1089
1106
|
Se as FIELD_REGISTRY,
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1107
|
+
G as FieldError,
|
|
1108
|
+
Ve as FieldLabel,
|
|
1109
|
+
he as LEAD_CLICKWRAP,
|
|
1110
|
+
be as LEAD_CLICKWRAP_V2,
|
|
1111
|
+
ge as LEAD_SMS,
|
|
1095
1112
|
ue as LEAD_TCPA,
|
|
1096
1113
|
me as LEAD_TCPA_V2,
|
|
1114
|
+
pe as LEAD_TCPA_V3,
|
|
1097
1115
|
fe as LEAD_TOSPP,
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1116
|
+
Ze as LEGAL_URL_ATTRS,
|
|
1117
|
+
Je as PWA_LEGAL_URLS,
|
|
1118
|
+
Ee as TextField,
|
|
1119
|
+
ze as UsgbForm,
|
|
1120
|
+
qe as collectRequiredLegalUrls,
|
|
1103
1121
|
Ce as createIdempotencyKey,
|
|
1104
1122
|
Ye as createStubAdapter,
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1123
|
+
E as formsManifest,
|
|
1124
|
+
we as getConsentDefinition,
|
|
1125
|
+
R as getFieldDefinition,
|
|
1126
|
+
W as getFormDefinition,
|
|
1127
|
+
Qe as isCompleteLegalUrls,
|
|
1128
|
+
je as listEditorOptions,
|
|
1129
|
+
We as listFormDefinitions,
|
|
1130
|
+
j as resolveConsentCopy,
|
|
1131
|
+
Y as resolveFormConsents
|
|
1114
1132
|
};
|