@heycater/qualification-funnel 1.10.0 → 1.11.0

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/index.esm.js CHANGED
@@ -10085,7 +10085,7 @@ function trackAnswerSelected(context, answer) {
10085
10085
  if (context.city) {
10086
10086
  properties.city = context.city;
10087
10087
  }
10088
- captureEvent("qf_v9_answer_selected", properties);
10088
+ captureEvent("qf_v10_answer_selected", properties);
10089
10089
  }
10090
10090
  function trackFormSubmitted(context, metadata) {
10091
10091
  if (!context.session_id) {
@@ -10103,7 +10103,7 @@ function trackFormSubmitted(context, metadata) {
10103
10103
  if (context.city) {
10104
10104
  properties.city = context.city;
10105
10105
  }
10106
- captureEvent("qf_v9_form_submitted", properties);
10106
+ captureEvent("qf_v10_form_submitted", properties);
10107
10107
  }
10108
10108
  function trackCompleted(context) {
10109
10109
  if (!context.session_id) {
@@ -10120,7 +10120,7 @@ function trackCompleted(context) {
10120
10120
  if (context.city) {
10121
10121
  properties.city = context.city;
10122
10122
  }
10123
- captureEvent("qf_v9_completed", properties);
10123
+ captureEvent("qf_v10_completed", properties);
10124
10124
  }
10125
10125
  function trackAbandoned(context, lastStep) {
10126
10126
  if (!context.session_id) {
@@ -10139,7 +10139,7 @@ function trackAbandoned(context, lastStep) {
10139
10139
  if (context.city) {
10140
10140
  properties.city = context.city;
10141
10141
  }
10142
- captureEvent("qf_v9_abandoned", properties);
10142
+ captureEvent("qf_v10_abandoned", properties);
10143
10143
  }
10144
10144
  function trackStarted(context, initialStepId) {
10145
10145
  const properties = {
@@ -10147,7 +10147,21 @@ function trackStarted(context, initialStepId) {
10147
10147
  session_id: context.session_id,
10148
10148
  initial_step: initialStepId
10149
10149
  };
10150
- captureEvent("qf_v9_started", properties);
10150
+ captureEvent("qf_v10_started", properties);
10151
+ }
10152
+ function serializeAnswerValue(value) {
10153
+ if (value === void 0) return null;
10154
+ if (value === null) return null;
10155
+ if (value instanceof Date) {
10156
+ return format(value, "yyyy-MM-dd");
10157
+ }
10158
+ if (typeof value === "object" && !Array.isArray(value) && Object.keys(value).length === 0) {
10159
+ return null;
10160
+ }
10161
+ if (Array.isArray(value)) {
10162
+ return value;
10163
+ }
10164
+ return value;
10151
10165
  }
10152
10166
  const TrackingContext = createContext(null);
10153
10167
  function TrackingProvider({
@@ -10165,7 +10179,7 @@ function TrackingProvider({
10165
10179
  const stepIndex = qual.stepIndex;
10166
10180
  const schemaStep = SCHEMA_STEPS[step2.id];
10167
10181
  const questions2 = (schemaStep == null ? void 0 : schemaStep.questions) || [];
10168
- const sessionKey = `qf_v9_started_${funnelContextRef.current.session_id}`;
10182
+ const sessionKey = `qf_v10_started_${funnelContextRef.current.session_id}`;
10169
10183
  if (typeof sessionStorage !== "undefined") {
10170
10184
  const hasStarted = sessionStorage.getItem(sessionKey);
10171
10185
  if (!hasStarted) {
@@ -10189,7 +10203,7 @@ function TrackingProvider({
10189
10203
  step_id: step2.id,
10190
10204
  step_index: stepIndex,
10191
10205
  question_id: question.id,
10192
- answer_value: currentValue ?? null,
10206
+ answer_value: serializeAnswerValue(currentValue),
10193
10207
  is_last_question: isLastQuestion
10194
10208
  });
10195
10209
  });
@@ -12917,14 +12931,7 @@ function requireFunctionBind() {
12917
12931
  functionBind = Function.prototype.bind || implementation2;
12918
12932
  return functionBind;
12919
12933
  }
12920
- var functionCall;
12921
- var hasRequiredFunctionCall;
12922
- function requireFunctionCall() {
12923
- if (hasRequiredFunctionCall) return functionCall;
12924
- hasRequiredFunctionCall = 1;
12925
- functionCall = Function.prototype.call;
12926
- return functionCall;
12927
- }
12934
+ var functionCall = Function.prototype.call;
12928
12935
  var functionApply;
12929
12936
  var hasRequiredFunctionApply;
12930
12937
  function requireFunctionApply() {
@@ -12936,12 +12943,12 @@ function requireFunctionApply() {
12936
12943
  var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
12937
12944
  var bind$2 = requireFunctionBind();
12938
12945
  var $apply$1 = requireFunctionApply();
12939
- var $call$2 = requireFunctionCall();
12946
+ var $call$2 = functionCall;
12940
12947
  var $reflectApply = reflectApply;
12941
12948
  var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
12942
12949
  var bind$1 = requireFunctionBind();
12943
12950
  var $TypeError$4 = type;
12944
- var $call$1 = requireFunctionCall();
12951
+ var $call$1 = functionCall;
12945
12952
  var $actualApply = actualApply;
12946
12953
  var callBindApplyHelpers = function callBindBasic(args) {
12947
12954
  if (args.length < 1 || typeof args[0] !== "function") {
@@ -13056,7 +13063,7 @@ var getProto = requireGetProto();
13056
13063
  var $ObjectGPO = requireObject_getPrototypeOf();
13057
13064
  var $ReflectGPO = requireReflect_getPrototypeOf();
13058
13065
  var $apply = requireFunctionApply();
13059
- var $call = requireFunctionCall();
13066
+ var $call = functionCall;
13060
13067
  var needsEval = {};
13061
13068
  var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
13062
13069
  var INTRINSICS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycater/qualification-funnel",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
4
4
  "type": "module",
5
5
  "description": "Heycater embedded qualification funnel widget",
6
6
  "main": "dist/index.cjs.js",