@codebards/ik-embeddable-form 0.0.2708315494-qa → 0.0.2713998803-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 CHANGED
@@ -454,7 +454,8 @@ var IKEmbeddableFormBundle = function(exports) {
454
454
  countryName: geoData.country,
455
455
  timezone: geoData.timezone,
456
456
  region: geoData.region,
457
- city: geoData.city
457
+ city: geoData.city,
458
+ ip: geoData.ip ?? ""
458
459
  };
459
460
  }
460
461
  }
@@ -482,13 +483,15 @@ var IKEmbeddableFormBundle = function(exports) {
482
483
  countryName: COUNTRIES_BY_CODE[code] ?? code,
483
484
  timezone,
484
485
  region: data.region,
485
- city: data.city
486
+ city: data.city,
487
+ ip: data.ip ?? ""
486
488
  };
487
489
  } catch {
488
490
  return {
489
491
  countryCode: "US",
490
492
  countryName: "United States",
491
- timezone: resolveBrowserTimezone()
493
+ timezone: resolveBrowserTimezone(),
494
+ ip: ""
492
495
  };
493
496
  }
494
497
  }
@@ -1208,6 +1211,34 @@ var IKEmbeddableFormBundle = function(exports) {
1208
1211
  if (window.innerWidth < 1024) return "Tablet";
1209
1212
  return "Desktop";
1210
1213
  }
1214
+ const UNKNOWN = { browserName: "Unknown", browserVersion: "Unknown" };
1215
+ function getBrowserDetails() {
1216
+ var _a, _b, _c;
1217
+ try {
1218
+ const ua = navigator.userAgent;
1219
+ let browserName = "Unknown";
1220
+ let version = "Unknown";
1221
+ if (ua.indexOf("Firefox") > -1) {
1222
+ browserName = "Firefox";
1223
+ version = ua.split("Firefox/")[1] || "Unknown";
1224
+ } else if (ua.indexOf("Chrome") > -1 && ua.indexOf("Edg/") === -1) {
1225
+ browserName = "Chrome";
1226
+ version = ((_a = ua.split("Chrome/")[1]) == null ? void 0 : _a.split(" ")[0]) || "Unknown";
1227
+ } else if (ua.indexOf("Safari") > -1 && ua.indexOf("Chrome") === -1) {
1228
+ browserName = "Safari";
1229
+ version = ((_b = ua.split("Version/")[1]) == null ? void 0 : _b.split(" ")[0]) || "Unknown";
1230
+ } else if (ua.indexOf("Edg/") > -1) {
1231
+ browserName = "Edge";
1232
+ version = ua.split("Edg/")[1] || "Unknown";
1233
+ } else if (ua.indexOf("Trident/") > -1) {
1234
+ browserName = "Internet Explorer";
1235
+ version = ((_c = ua.split("rv:")[1]) == null ? void 0 : _c.split(")")[0]) || "Unknown";
1236
+ }
1237
+ return { browserName, browserVersion: version };
1238
+ } catch {
1239
+ return { ...UNKNOWN };
1240
+ }
1241
+ }
1211
1242
  const LOCALHOST_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]"]);
1212
1243
  function isLocalhostHost(hostname) {
1213
1244
  return LOCALHOST_HOSTS.has(hostname);
@@ -1271,6 +1302,7 @@ var IKEmbeddableFormBundle = function(exports) {
1271
1302
  ...openConfig.prefilledValues
1272
1303
  };
1273
1304
  const pageUrl = resolveWorkflowPageUrl(openConfig.pageUrl);
1305
+ const browser = getBrowserDetails();
1274
1306
  contextInstance = {
1275
1307
  ...attribution,
1276
1308
  landingPageUrl: normalizeLandingPageUrl(attribution.landingPageUrl, pageUrl),
@@ -1281,6 +1313,9 @@ var IKEmbeddableFormBundle = function(exports) {
1281
1313
  city: geo.city ?? "",
1282
1314
  region: geo.region ?? "",
1283
1315
  device: getDeviceType(),
1316
+ ipAddress: geo.ip,
1317
+ browserName: browser.browserName,
1318
+ browserVersion: browser.browserVersion,
1284
1319
  pageUrl,
1285
1320
  siteUrl: resolveStaticSiteUrl(openConfig.site),
1286
1321
  eventName: openConfig.eventName,
@@ -2618,6 +2653,9 @@ var IKEmbeddableFormBundle = function(exports) {
2618
2653
  fbcId: context.fbcId ?? "",
2619
2654
  fbpId: context.fbpId ?? "",
2620
2655
  user_agent: navigator.userAgent,
2656
+ ipAddress: context.ipAddress,
2657
+ browserName: context.browserName,
2658
+ browserVersion: context.browserVersion,
2621
2659
  user_id: context.visitorId,
2622
2660
  li_fat_id: context.liFatId,
2623
2661
  cta_page_url: context.ctaPageUrl,