@heycater/qualification-funnel 1.19.31 → 1.19.32

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
@@ -12709,7 +12709,7 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
12709
12709
  var ys = arrObjKeys(obj, inspect2);
12710
12710
  var isPlainObject2 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
12711
12711
  var protoTag = obj instanceof Object ? "" : "null prototype";
12712
- var stringTag2 = !isPlainObject2 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? "Object" : "";
12712
+ var stringTag2 = !isPlainObject2 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
12713
12713
  var constructorTag = isPlainObject2 || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
12714
12714
  var tag = constructorTag + (stringTag2 || protoTag ? "[" + $join.call($concat$1.call([], stringTag2 || [], protoTag || []), ": ") + "] " : "");
12715
12715
  if (ys.length === 0) {
@@ -12734,25 +12734,25 @@ function canTrustToString(obj) {
12734
12734
  return !toStringTag || !(typeof obj === "object" && (toStringTag in obj || typeof obj[toStringTag] !== "undefined"));
12735
12735
  }
12736
12736
  function isArray$3(obj) {
12737
- return toStr$1(obj) === "[object Array]" && canTrustToString(obj);
12737
+ return toStr(obj) === "[object Array]" && canTrustToString(obj);
12738
12738
  }
12739
12739
  function isDate(obj) {
12740
- return toStr$1(obj) === "[object Date]" && canTrustToString(obj);
12740
+ return toStr(obj) === "[object Date]" && canTrustToString(obj);
12741
12741
  }
12742
12742
  function isRegExp$1(obj) {
12743
- return toStr$1(obj) === "[object RegExp]" && canTrustToString(obj);
12743
+ return toStr(obj) === "[object RegExp]" && canTrustToString(obj);
12744
12744
  }
12745
12745
  function isError(obj) {
12746
- return toStr$1(obj) === "[object Error]" && canTrustToString(obj);
12746
+ return toStr(obj) === "[object Error]" && canTrustToString(obj);
12747
12747
  }
12748
12748
  function isString(obj) {
12749
- return toStr$1(obj) === "[object String]" && canTrustToString(obj);
12749
+ return toStr(obj) === "[object String]" && canTrustToString(obj);
12750
12750
  }
12751
12751
  function isNumber(obj) {
12752
- return toStr$1(obj) === "[object Number]" && canTrustToString(obj);
12752
+ return toStr(obj) === "[object Number]" && canTrustToString(obj);
12753
12753
  }
12754
12754
  function isBoolean(obj) {
12755
- return toStr$1(obj) === "[object Boolean]" && canTrustToString(obj);
12755
+ return toStr(obj) === "[object Boolean]" && canTrustToString(obj);
12756
12756
  }
12757
12757
  function isSymbol(obj) {
12758
12758
  if (hasShammedSymbols) {
@@ -12788,7 +12788,7 @@ var hasOwn$1 = Object.prototype.hasOwnProperty || function(key) {
12788
12788
  function has$4(obj, key) {
12789
12789
  return hasOwn$1.call(obj, key);
12790
12790
  }
12791
- function toStr$1(obj) {
12791
+ function toStr(obj) {
12792
12792
  return objectToString.call(obj);
12793
12793
  }
12794
12794
  function nameOf(f) {
@@ -13097,7 +13097,7 @@ var syntax = SyntaxError;
13097
13097
  var uri = URIError;
13098
13098
  var abs$1 = Math.abs;
13099
13099
  var floor$1 = Math.floor;
13100
- var max$2 = Math.max;
13100
+ var max$1 = Math.max;
13101
13101
  var min$1 = Math.min;
13102
13102
  var pow$1 = Math.pow;
13103
13103
  var round$2 = Math.round;
@@ -13226,78 +13226,99 @@ function requireObject_getPrototypeOf() {
13226
13226
  Object_getPrototypeOf = $Object2.getPrototypeOf || null;
13227
13227
  return Object_getPrototypeOf;
13228
13228
  }
13229
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
13230
- var toStr = Object.prototype.toString;
13231
- var max$1 = Math.max;
13232
- var funcType = "[object Function]";
13233
- var concatty = function concatty2(a3, b2) {
13234
- var arr = [];
13235
- for (var i2 = 0; i2 < a3.length; i2 += 1) {
13236
- arr[i2] = a3[i2];
13237
- }
13238
- for (var j = 0; j < b2.length; j += 1) {
13239
- arr[j + a3.length] = b2[j];
13240
- }
13241
- return arr;
13242
- };
13243
- var slicy = function slicy2(arrLike, offset2) {
13244
- var arr = [];
13245
- for (var i2 = offset2, j = 0; i2 < arrLike.length; i2 += 1, j += 1) {
13246
- arr[j] = arrLike[i2];
13247
- }
13248
- return arr;
13249
- };
13250
- var joiny = function(arr, joiner) {
13251
- var str = "";
13252
- for (var i2 = 0; i2 < arr.length; i2 += 1) {
13253
- str += arr[i2];
13254
- if (i2 + 1 < arr.length) {
13255
- str += joiner;
13229
+ var implementation;
13230
+ var hasRequiredImplementation;
13231
+ function requireImplementation() {
13232
+ if (hasRequiredImplementation) return implementation;
13233
+ hasRequiredImplementation = 1;
13234
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
13235
+ var toStr2 = Object.prototype.toString;
13236
+ var max2 = Math.max;
13237
+ var funcType = "[object Function]";
13238
+ var concatty = function concatty2(a3, b2) {
13239
+ var arr = [];
13240
+ for (var i2 = 0; i2 < a3.length; i2 += 1) {
13241
+ arr[i2] = a3[i2];
13256
13242
  }
13257
- }
13258
- return str;
13259
- };
13260
- var implementation$1 = function bind(that) {
13261
- var target = this;
13262
- if (typeof target !== "function" || toStr.apply(target) !== funcType) {
13263
- throw new TypeError(ERROR_MESSAGE + target);
13264
- }
13265
- var args = slicy(arguments, 1);
13266
- var bound;
13267
- var binder = function() {
13268
- if (this instanceof bound) {
13269
- var result = target.apply(
13270
- this,
13271
- concatty(args, arguments)
13272
- );
13273
- if (Object(result) === result) {
13274
- return result;
13243
+ for (var j = 0; j < b2.length; j += 1) {
13244
+ arr[j + a3.length] = b2[j];
13245
+ }
13246
+ return arr;
13247
+ };
13248
+ var slicy = function slicy2(arrLike, offset2) {
13249
+ var arr = [];
13250
+ for (var i2 = offset2, j = 0; i2 < arrLike.length; i2 += 1, j += 1) {
13251
+ arr[j] = arrLike[i2];
13252
+ }
13253
+ return arr;
13254
+ };
13255
+ var joiny = function(arr, joiner) {
13256
+ var str = "";
13257
+ for (var i2 = 0; i2 < arr.length; i2 += 1) {
13258
+ str += arr[i2];
13259
+ if (i2 + 1 < arr.length) {
13260
+ str += joiner;
13275
13261
  }
13276
- return this;
13277
13262
  }
13278
- return target.apply(
13279
- that,
13280
- concatty(args, arguments)
13281
- );
13263
+ return str;
13282
13264
  };
13283
- var boundLength = max$1(0, target.length - args.length);
13284
- var boundArgs = [];
13285
- for (var i2 = 0; i2 < boundLength; i2++) {
13286
- boundArgs[i2] = "$" + i2;
13287
- }
13288
- bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
13289
- if (target.prototype) {
13290
- var Empty = function Empty2() {
13265
+ implementation = function bind2(that) {
13266
+ var target = this;
13267
+ if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
13268
+ throw new TypeError(ERROR_MESSAGE + target);
13269
+ }
13270
+ var args = slicy(arguments, 1);
13271
+ var bound;
13272
+ var binder = function() {
13273
+ if (this instanceof bound) {
13274
+ var result = target.apply(
13275
+ this,
13276
+ concatty(args, arguments)
13277
+ );
13278
+ if (Object(result) === result) {
13279
+ return result;
13280
+ }
13281
+ return this;
13282
+ }
13283
+ return target.apply(
13284
+ that,
13285
+ concatty(args, arguments)
13286
+ );
13291
13287
  };
13292
- Empty.prototype = target.prototype;
13293
- bound.prototype = new Empty();
13294
- Empty.prototype = null;
13295
- }
13296
- return bound;
13297
- };
13298
- var implementation = implementation$1;
13299
- var functionBind = Function.prototype.bind || implementation;
13300
- var functionCall = Function.prototype.call;
13288
+ var boundLength = max2(0, target.length - args.length);
13289
+ var boundArgs = [];
13290
+ for (var i2 = 0; i2 < boundLength; i2++) {
13291
+ boundArgs[i2] = "$" + i2;
13292
+ }
13293
+ bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
13294
+ if (target.prototype) {
13295
+ var Empty = function Empty2() {
13296
+ };
13297
+ Empty.prototype = target.prototype;
13298
+ bound.prototype = new Empty();
13299
+ Empty.prototype = null;
13300
+ }
13301
+ return bound;
13302
+ };
13303
+ return implementation;
13304
+ }
13305
+ var functionBind;
13306
+ var hasRequiredFunctionBind;
13307
+ function requireFunctionBind() {
13308
+ if (hasRequiredFunctionBind) return functionBind;
13309
+ hasRequiredFunctionBind = 1;
13310
+ var implementation2 = requireImplementation();
13311
+ functionBind = Function.prototype.bind || implementation2;
13312
+ return functionBind;
13313
+ }
13314
+ var functionCall;
13315
+ var hasRequiredFunctionCall;
13316
+ function requireFunctionCall() {
13317
+ if (hasRequiredFunctionCall) return functionCall;
13318
+ hasRequiredFunctionCall = 1;
13319
+ functionCall = Function.prototype.call;
13320
+ return functionCall;
13321
+ }
13301
13322
  var functionApply;
13302
13323
  var hasRequiredFunctionApply;
13303
13324
  function requireFunctionApply() {
@@ -13307,14 +13328,14 @@ function requireFunctionApply() {
13307
13328
  return functionApply;
13308
13329
  }
13309
13330
  var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
13310
- var bind$2 = functionBind;
13331
+ var bind$2 = requireFunctionBind();
13311
13332
  var $apply$1 = requireFunctionApply();
13312
- var $call$2 = functionCall;
13333
+ var $call$2 = requireFunctionCall();
13313
13334
  var $reflectApply = reflectApply;
13314
13335
  var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
13315
- var bind$1 = functionBind;
13336
+ var bind$1 = requireFunctionBind();
13316
13337
  var $TypeError$4 = type;
13317
- var $call$1 = functionCall;
13338
+ var $call$1 = requireFunctionCall();
13318
13339
  var $actualApply = actualApply;
13319
13340
  var callBindApplyHelpers = function callBindBasic(args) {
13320
13341
  if (args.length < 1 || typeof args[0] !== "function") {
@@ -13380,8 +13401,8 @@ function requireHasown() {
13380
13401
  hasRequiredHasown = 1;
13381
13402
  var call = Function.prototype.call;
13382
13403
  var $hasOwn = Object.prototype.hasOwnProperty;
13383
- var bind3 = functionBind;
13384
- hasown = bind3.call(call, $hasOwn);
13404
+ var bind2 = requireFunctionBind();
13405
+ hasown = bind2.call(call, $hasOwn);
13385
13406
  return hasown;
13386
13407
  }
13387
13408
  var undefined$1;
@@ -13395,7 +13416,7 @@ var $TypeError$3 = type;
13395
13416
  var $URIError = uri;
13396
13417
  var abs = abs$1;
13397
13418
  var floor = floor$1;
13398
- var max = max$2;
13419
+ var max = max$1;
13399
13420
  var min = min$1;
13400
13421
  var pow = pow$1;
13401
13422
  var round$1 = round$2;
@@ -13429,7 +13450,7 @@ var getProto = requireGetProto();
13429
13450
  var $ObjectGPO = requireObject_getPrototypeOf();
13430
13451
  var $ReflectGPO = requireReflect_getPrototypeOf();
13431
13452
  var $apply = requireFunctionApply();
13432
- var $call = functionCall;
13453
+ var $call = requireFunctionCall();
13433
13454
  var needsEval = {};
13434
13455
  var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
13435
13456
  var INTRINSICS = {
@@ -13600,13 +13621,13 @@ var LEGACY_ALIASES = {
13600
13621
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
13601
13622
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
13602
13623
  };
13603
- var bind2 = functionBind;
13624
+ var bind = requireFunctionBind();
13604
13625
  var hasOwn = requireHasown();
13605
- var $concat = bind2.call($call, Array.prototype.concat);
13606
- var $spliceApply = bind2.call($apply, Array.prototype.splice);
13607
- var $replace = bind2.call($call, String.prototype.replace);
13608
- var $strSlice = bind2.call($call, String.prototype.slice);
13609
- var $exec = bind2.call($call, RegExp.prototype.exec);
13626
+ var $concat = bind.call($call, Array.prototype.concat);
13627
+ var $spliceApply = bind.call($apply, Array.prototype.splice);
13628
+ var $replace = bind.call($call, String.prototype.replace);
13629
+ var $strSlice = bind.call($call, String.prototype.slice);
13630
+ var $exec = bind.call($call, RegExp.prototype.exec);
13610
13631
  var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
13611
13632
  var reEscapeChar = /\\(\\)?/g;
13612
13633
  var stringToPath = function stringToPath2(string2) {
@@ -32513,6 +32534,8 @@ const RedesignedFunnel = ({
32513
32534
  }, []);
32514
32535
  const handleContactFormSubmit = useCallback(async (formData) => {
32515
32536
  setIsSubmitting(true);
32537
+ const city = answerOf("city");
32538
+ const defaultCountry = city === "london" ? "United Kingdom" : "Germany";
32516
32539
  try {
32517
32540
  const buildValues = {
32518
32541
  first_name: formData.vorname,
@@ -32524,11 +32547,17 @@ const RedesignedFunnel = ({
32524
32547
  deliveryAddressStreetNumber: formData.deliveryAddressStreetNumber,
32525
32548
  deliveryAddressPostalCode: formData.deliveryAddressPostalCode,
32526
32549
  deliveryAddressCity: formData.deliveryAddressCity,
32527
- deliveryAddressCountry: formData.deliveryAddressCountry || "Germany",
32550
+ deliveryAddressCountry: formData.deliveryAddressCountry || defaultCountry,
32528
32551
  comment: formData.kommentar
32529
32552
  };
32530
32553
  const response = await submitAsNewCustomer(buildValues);
32531
- const { signInToken, opportunity } = response || {};
32554
+ const { signInToken, opportunity, isUkLead } = response || {};
32555
+ if (isUkLead) {
32556
+ trackCompleted(funnelContextRef.current);
32557
+ setSubmittedData(formData);
32558
+ setPhase("done");
32559
+ return;
32560
+ }
32532
32561
  if (!opportunity || !opportunity.id) {
32533
32562
  console.error("[HeyCater Funnel] submitAsNewCustomer returned invalid opportunity:", response);
32534
32563
  setIsSubmitting(false);
@@ -32543,7 +32572,7 @@ const RedesignedFunnel = ({
32543
32572
  console.error("Failed to submit request:", error);
32544
32573
  setIsSubmitting(false);
32545
32574
  }
32546
- }, [submitAsNewCustomer, funnelContextRef, router.locale]);
32575
+ }, [submitAsNewCustomer, funnelContextRef, router.locale, answerOf]);
32547
32576
  const handleContactBack = useCallback(() => {
32548
32577
  setPhase("questions");
32549
32578
  setCurrentStepIndex(stepOrder.length - 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycater/qualification-funnel",
3
- "version": "1.19.31",
3
+ "version": "1.19.32",
4
4
  "type": "module",
5
5
  "description": "Heycater embedded qualification funnel widget",
6
6
  "main": "dist/index.cjs.js",