@codebards/ik-embeddable-form 0.0.2721229331-qa → 0.0.2726880419-qa
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/dist/embed.js +64 -10
- package/dist/embed.js.map +1 -1
- package/package.json +1 -1
package/dist/embed.js
CHANGED
|
@@ -1348,6 +1348,44 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
1348
1348
|
if (!isClarityLoaded()) return;
|
|
1349
1349
|
window.clarity("set", key, value);
|
|
1350
1350
|
}
|
|
1351
|
+
const ALPHA3 = {
|
|
1352
|
+
IN: "IND",
|
|
1353
|
+
US: "USA"
|
|
1354
|
+
};
|
|
1355
|
+
function businessCountryToAlpha3(country) {
|
|
1356
|
+
return ALPHA3[country];
|
|
1357
|
+
}
|
|
1358
|
+
function normalizeBusinessCountry(value) {
|
|
1359
|
+
const trimmed = value.trim();
|
|
1360
|
+
if (!trimmed) return null;
|
|
1361
|
+
const upper = trimmed.toUpperCase();
|
|
1362
|
+
if (upper === "GEO" || upper === "AUTO") return "geo";
|
|
1363
|
+
if (upper === "IN" || upper === "IND" || upper === "INDIA") return "IN";
|
|
1364
|
+
if (upper === "US" || upper === "USA" || upper === "UNITED STATES") return "US";
|
|
1365
|
+
return null;
|
|
1366
|
+
}
|
|
1367
|
+
function isIndiaEmbedConfig(openConfig) {
|
|
1368
|
+
return String(openConfig.site ?? "").trim().toLowerCase() === "india";
|
|
1369
|
+
}
|
|
1370
|
+
function geoBusinessCountry(countryName, countryCode) {
|
|
1371
|
+
if ((countryName == null ? void 0 : countryName.trim()) === "India") return "IN";
|
|
1372
|
+
if ((countryCode == null ? void 0 : countryCode.trim().toUpperCase()) === "IN") return "IN";
|
|
1373
|
+
return "US";
|
|
1374
|
+
}
|
|
1375
|
+
function resolveBusinessCountryMode(openConfig) {
|
|
1376
|
+
const override = openConfig.businessCountry ? normalizeBusinessCountry(String(openConfig.businessCountry)) : null;
|
|
1377
|
+
if (override) return override;
|
|
1378
|
+
if (isIndiaEmbedConfig(openConfig)) {
|
|
1379
|
+
return openConfig.isLandingPage ? "IN" : "geo";
|
|
1380
|
+
}
|
|
1381
|
+
if (resolveSiteBucket(openConfig.site) === "learn") return "US";
|
|
1382
|
+
return "geo";
|
|
1383
|
+
}
|
|
1384
|
+
function resolveBusinessCountry(openConfig, geo = {}) {
|
|
1385
|
+
const mode = resolveBusinessCountryMode(openConfig);
|
|
1386
|
+
if (mode !== "geo") return mode;
|
|
1387
|
+
return geoBusinessCountry(geo.countryName ?? "", geo.countryCode ?? "");
|
|
1388
|
+
}
|
|
1351
1389
|
function getDeviceType() {
|
|
1352
1390
|
const ua = navigator.userAgent;
|
|
1353
1391
|
if (/tablet|ipad|playbook|silk/i.test(ua)) return "Tablet";
|
|
@@ -1451,6 +1489,10 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
1451
1489
|
openConfig,
|
|
1452
1490
|
vCountry,
|
|
1453
1491
|
vCountryCode,
|
|
1492
|
+
businessCountry: resolveBusinessCountry(openConfig, {
|
|
1493
|
+
countryName: vCountry,
|
|
1494
|
+
countryCode: vCountryCode
|
|
1495
|
+
}),
|
|
1454
1496
|
userTimezone: geo.timezone || browserTz,
|
|
1455
1497
|
city: geo.city ?? "",
|
|
1456
1498
|
region: geo.region ?? "",
|
|
@@ -1620,7 +1662,8 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
1620
1662
|
return normalizeSlotApiCountry(slotApiConfig.country);
|
|
1621
1663
|
}
|
|
1622
1664
|
const ctx = getWebinarContextOrNull();
|
|
1623
|
-
if (ctx) return
|
|
1665
|
+
if (ctx) return businessCountryToAlpha3(ctx.businessCountry);
|
|
1666
|
+
if (openConfig) return businessCountryToAlpha3(resolveBusinessCountry(openConfig));
|
|
1624
1667
|
return "USA";
|
|
1625
1668
|
}
|
|
1626
1669
|
function resolveSlotApiTimezone() {
|
|
@@ -2878,6 +2921,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
2878
2921
|
page_url: context.pageUrl,
|
|
2879
2922
|
site_url: context.siteUrl,
|
|
2880
2923
|
v_country: context.vCountry,
|
|
2924
|
+
business_country: context.businessCountry,
|
|
2881
2925
|
salesforce_uuid: context.salesforceUuid,
|
|
2882
2926
|
phone_number_full: str(formData.phoneNumberFull ?? formData.phone),
|
|
2883
2927
|
phone_code: str(formData.phoneCode ?? "+1"),
|
|
@@ -2941,6 +2985,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
2941
2985
|
user_id: context.visitorId,
|
|
2942
2986
|
user_timezone: context.userTimezone,
|
|
2943
2987
|
v_country: context.vCountry,
|
|
2988
|
+
business_country: context.businessCountry,
|
|
2944
2989
|
phone_number_full: str(formData.phoneNumberFull ?? formData.phone),
|
|
2945
2990
|
phone_code: str(formData.phoneCode ?? ""),
|
|
2946
2991
|
"Event Start Time": str(formData.eventStartTime),
|
|
@@ -15577,6 +15622,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
15577
15622
|
{
|
|
15578
15623
|
groups: progressGroups,
|
|
15579
15624
|
activeGroupIndex,
|
|
15625
|
+
currentStepId,
|
|
15580
15626
|
panelId
|
|
15581
15627
|
}
|
|
15582
15628
|
)
|
|
@@ -15716,6 +15762,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
15716
15762
|
function VerticalProgressTracker({
|
|
15717
15763
|
groups,
|
|
15718
15764
|
activeGroupIndex,
|
|
15765
|
+
currentStepId,
|
|
15719
15766
|
panelId
|
|
15720
15767
|
}) {
|
|
15721
15768
|
return /* @__PURE__ */ u$1(
|
|
@@ -15725,11 +15772,15 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
15725
15772
|
"data-testid": leftPanelTestId(panelId, "progress-tracker"),
|
|
15726
15773
|
"aria-label": "Registration progress groups",
|
|
15727
15774
|
children: groups.map((group, idx) => {
|
|
15775
|
+
var _a;
|
|
15728
15776
|
const isActive = idx === activeGroupIndex;
|
|
15729
|
-
const
|
|
15730
|
-
const
|
|
15777
|
+
const isPassed = idx < activeGroupIndex;
|
|
15778
|
+
const isPending = isPassed && !!((_a = group.pendingOnStepIds) == null ? void 0 : _a.includes(currentStepId));
|
|
15779
|
+
const isComplete = isPassed && !isPending;
|
|
15780
|
+
const isUpcoming = !isActive && !isComplete && !isPending;
|
|
15731
15781
|
const isLast = idx === groups.length - 1;
|
|
15732
|
-
const isHighlighted = isActive || isComplete;
|
|
15782
|
+
const isHighlighted = isActive || isComplete || isPending;
|
|
15783
|
+
const isInProgress = isActive || isPending;
|
|
15733
15784
|
return /* @__PURE__ */ u$1(
|
|
15734
15785
|
"li",
|
|
15735
15786
|
{
|
|
@@ -15755,9 +15806,9 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
15755
15806
|
class: [
|
|
15756
15807
|
"relative flex shrink-0 items-center justify-center overflow-hidden rounded-[30px]",
|
|
15757
15808
|
isHighlighted ? "size-10" : "size-8",
|
|
15758
|
-
|
|
15809
|
+
isInProgress ? "shadow-[0px_4px_12px_0px_rgba(3,131,248,0.37)]" : ""
|
|
15759
15810
|
].join(" "),
|
|
15760
|
-
style: isComplete ? { backgroundImage: COMPLETED_STEP_GRADIENT } :
|
|
15811
|
+
style: isComplete ? { backgroundImage: COMPLETED_STEP_GRADIENT } : isInProgress ? { backgroundImage: ACTIVE_STEP_GRADIENT } : void 0,
|
|
15761
15812
|
role: "presentation",
|
|
15762
15813
|
children: [
|
|
15763
15814
|
isUpcoming && /* @__PURE__ */ u$1(
|
|
@@ -15782,7 +15833,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
15782
15833
|
"data-testid": leftPanelTestId(panelId, `progress-group-${group.number}-number`),
|
|
15783
15834
|
class: [
|
|
15784
15835
|
"relative text-center font-semibold leading-[1.48]",
|
|
15785
|
-
|
|
15836
|
+
isInProgress ? "text-[16px] text-white" : "text-[14px] text-[#667085]"
|
|
15786
15837
|
].join(" "),
|
|
15787
15838
|
children: group.number
|
|
15788
15839
|
}
|
|
@@ -15814,7 +15865,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
15814
15865
|
"data-testid": leftPanelTestId(panelId, `progress-group-${group.number}-title`),
|
|
15815
15866
|
class: [
|
|
15816
15867
|
"font-semibold leading-[1.48]",
|
|
15817
|
-
isComplete ? "text-[14px] text-[#027a48]" :
|
|
15868
|
+
isComplete ? "text-[14px] text-[#027a48]" : isInProgress ? "text-[14px] text-[#0a3483]" : "text-[12px] text-[#98a2b3]"
|
|
15818
15869
|
].join(" "),
|
|
15819
15870
|
children: group.title
|
|
15820
15871
|
}
|
|
@@ -20767,7 +20818,10 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
20767
20818
|
{
|
|
20768
20819
|
number: 1,
|
|
20769
20820
|
title: "Webinar Registration",
|
|
20770
|
-
stepIds: ["contact-details", "slot-selection"]
|
|
20821
|
+
stepIds: ["contact-details", "slot-selection"],
|
|
20822
|
+
// India skips goals-details, so this group stays blue through
|
|
20823
|
+
// profile-details and only completes on the expert-insights step.
|
|
20824
|
+
pendingOnStepIds: ["profile-details"]
|
|
20771
20825
|
},
|
|
20772
20826
|
{
|
|
20773
20827
|
number: 2,
|
|
@@ -21046,7 +21100,7 @@ ${intlTelStyles}`;
|
|
|
21046
21100
|
destroy();
|
|
21047
21101
|
},
|
|
21048
21102
|
getVersion() {
|
|
21049
|
-
return "1.0.
|
|
21103
|
+
return "1.0.33";
|
|
21050
21104
|
},
|
|
21051
21105
|
/**
|
|
21052
21106
|
* Allowlisted snapshot of everything the user has submitted so far.
|