@codebards/ik-embeddable-form 0.0.2721229331-qa → 0.0.2726025383-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 +49 -2
- package/dist/embed.js.map +1 -1
- package/package.json +1 -1
package/dist/embed.js
CHANGED
|
@@ -1348,6 +1348,46 @@ 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
|
+
const site = String(openConfig.site ?? "").trim().toLowerCase();
|
|
1369
|
+
if (site === "in" || site === "india") return true;
|
|
1370
|
+
return String(openConfig.variant ?? "").trim().toLowerCase().startsWith("india");
|
|
1371
|
+
}
|
|
1372
|
+
function geoBusinessCountry(countryName, countryCode) {
|
|
1373
|
+
if ((countryName == null ? void 0 : countryName.trim()) === "India") return "IN";
|
|
1374
|
+
if ((countryCode == null ? void 0 : countryCode.trim().toUpperCase()) === "IN") return "IN";
|
|
1375
|
+
return "US";
|
|
1376
|
+
}
|
|
1377
|
+
function resolveBusinessCountryMode(openConfig) {
|
|
1378
|
+
const override = openConfig.businessCountry ? normalizeBusinessCountry(String(openConfig.businessCountry)) : null;
|
|
1379
|
+
if (override) return override;
|
|
1380
|
+
if (isIndiaEmbedConfig(openConfig)) {
|
|
1381
|
+
return openConfig.isLandingPage ? "IN" : "geo";
|
|
1382
|
+
}
|
|
1383
|
+
if (resolveSiteBucket(openConfig.site) === "learn") return "US";
|
|
1384
|
+
return "geo";
|
|
1385
|
+
}
|
|
1386
|
+
function resolveBusinessCountry(openConfig, geo = {}) {
|
|
1387
|
+
const mode = resolveBusinessCountryMode(openConfig);
|
|
1388
|
+
if (mode !== "geo") return mode;
|
|
1389
|
+
return geoBusinessCountry(geo.countryName ?? "", geo.countryCode ?? "");
|
|
1390
|
+
}
|
|
1351
1391
|
function getDeviceType() {
|
|
1352
1392
|
const ua = navigator.userAgent;
|
|
1353
1393
|
if (/tablet|ipad|playbook|silk/i.test(ua)) return "Tablet";
|
|
@@ -1451,6 +1491,10 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
1451
1491
|
openConfig,
|
|
1452
1492
|
vCountry,
|
|
1453
1493
|
vCountryCode,
|
|
1494
|
+
businessCountry: resolveBusinessCountry(openConfig, {
|
|
1495
|
+
countryName: vCountry,
|
|
1496
|
+
countryCode: vCountryCode
|
|
1497
|
+
}),
|
|
1454
1498
|
userTimezone: geo.timezone || browserTz,
|
|
1455
1499
|
city: geo.city ?? "",
|
|
1456
1500
|
region: geo.region ?? "",
|
|
@@ -1620,7 +1664,8 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
1620
1664
|
return normalizeSlotApiCountry(slotApiConfig.country);
|
|
1621
1665
|
}
|
|
1622
1666
|
const ctx = getWebinarContextOrNull();
|
|
1623
|
-
if (ctx) return
|
|
1667
|
+
if (ctx) return businessCountryToAlpha3(ctx.businessCountry);
|
|
1668
|
+
if (openConfig) return businessCountryToAlpha3(resolveBusinessCountry(openConfig));
|
|
1624
1669
|
return "USA";
|
|
1625
1670
|
}
|
|
1626
1671
|
function resolveSlotApiTimezone() {
|
|
@@ -2878,6 +2923,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
2878
2923
|
page_url: context.pageUrl,
|
|
2879
2924
|
site_url: context.siteUrl,
|
|
2880
2925
|
v_country: context.vCountry,
|
|
2926
|
+
business_country: context.businessCountry,
|
|
2881
2927
|
salesforce_uuid: context.salesforceUuid,
|
|
2882
2928
|
phone_number_full: str(formData.phoneNumberFull ?? formData.phone),
|
|
2883
2929
|
phone_code: str(formData.phoneCode ?? "+1"),
|
|
@@ -2941,6 +2987,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
2941
2987
|
user_id: context.visitorId,
|
|
2942
2988
|
user_timezone: context.userTimezone,
|
|
2943
2989
|
v_country: context.vCountry,
|
|
2990
|
+
business_country: context.businessCountry,
|
|
2944
2991
|
phone_number_full: str(formData.phoneNumberFull ?? formData.phone),
|
|
2945
2992
|
phone_code: str(formData.phoneCode ?? ""),
|
|
2946
2993
|
"Event Start Time": str(formData.eventStartTime),
|
|
@@ -21046,7 +21093,7 @@ ${intlTelStyles}`;
|
|
|
21046
21093
|
destroy();
|
|
21047
21094
|
},
|
|
21048
21095
|
getVersion() {
|
|
21049
|
-
return "1.0.
|
|
21096
|
+
return "1.0.33";
|
|
21050
21097
|
},
|
|
21051
21098
|
/**
|
|
21052
21099
|
* Allowlisted snapshot of everything the user has submitted so far.
|