@wix/bex-utils 2.131.0 → 2.133.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.
Files changed (34) hide show
  1. package/@wix/bex-bundled-mini-essentials/dist/cjs/bex-bundled-mini-essentials.js +1305 -276
  2. package/@wix/bex-bundled-mini-essentials/dist/cjs/bex-bundled-mini-essentials.js.map +1 -1
  3. package/@wix/bex-bundled-mini-essentials/dist/cjs/exports/http-client/testkit/client.js +218 -116
  4. package/@wix/bex-bundled-mini-essentials/dist/cjs/exports/http-client/testkit/client.js.map +1 -1
  5. package/@wix/bex-bundled-mini-essentials/dist/cjs/exports/testkit/index.d.ts +7 -8
  6. package/@wix/bex-bundled-mini-essentials/dist/cjs/exports/testkit/index.js +1255 -263
  7. package/@wix/bex-bundled-mini-essentials/dist/cjs/exports/testkit/index.js.map +1 -1
  8. package/@wix/bex-bundled-mini-essentials/dist/esm/bex-bundled-mini-essentials.mjs +1298 -325
  9. package/@wix/bex-bundled-mini-essentials/dist/esm/bex-bundled-mini-essentials.mjs.map +1 -1
  10. package/@wix/bex-bundled-mini-essentials/dist/esm/common-errors_hi-P2YUYYLM.mjs +34 -0
  11. package/@wix/bex-bundled-mini-essentials/dist/esm/common-errors_hi-P2YUYYLM.mjs.map +1 -0
  12. package/@wix/bex-bundled-mini-essentials/dist/esm/{exports/testkit/common-errors_ja-73RRUZ7T.mjs → common-errors_ja-MS5PSRSC.mjs} +2 -2
  13. package/@wix/bex-bundled-mini-essentials/dist/esm/{common-errors_ja-OOUHZN3G.mjs.map → common-errors_ja-MS5PSRSC.mjs.map} +1 -1
  14. package/@wix/bex-bundled-mini-essentials/dist/esm/{common-errors_uk-TGSY773Q.mjs → common-errors_uk-G7XUMV2H.mjs} +2 -2
  15. package/@wix/bex-bundled-mini-essentials/dist/esm/{common-errors_uk-TGSY773Q.mjs.map → common-errors_uk-G7XUMV2H.mjs.map} +1 -1
  16. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/http-client/testkit/client.mjs +37 -8
  17. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/http-client/testkit/client.mjs.map +1 -1
  18. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/testkit/common-errors_hi-EY6JYIPV.mjs +34 -0
  19. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/testkit/common-errors_hi-EY6JYIPV.mjs.map +1 -0
  20. package/@wix/bex-bundled-mini-essentials/dist/esm/{common-errors_ja-OOUHZN3G.mjs → exports/testkit/common-errors_ja-J6VU7MQY.mjs} +2 -2
  21. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/testkit/{common-errors_ja-73RRUZ7T.mjs.map → common-errors_ja-J6VU7MQY.mjs.map} +1 -1
  22. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/testkit/{common-errors_uk-5VEGIENP.mjs → common-errors_uk-T2LUNSSB.mjs} +2 -2
  23. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/testkit/{common-errors_uk-5VEGIENP.mjs.map → common-errors_uk-T2LUNSSB.mjs.map} +1 -1
  24. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/testkit/index.d.mts +7 -8
  25. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/testkit/index.mjs +1161 -230
  26. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/testkit/index.mjs.map +1 -1
  27. package/@wix/bex-bundled-mini-essentials/dist/tsconfig.tsbuildinfo +1 -1
  28. package/@wix/bex-bundled-mini-essentials/package.json +12 -3
  29. package/package.json +3 -3
  30. package/@wix/bex-bundled-mini-essentials/CHANGELOG.md +0 -359
  31. package/@wix/bex-bundled-mini-essentials/dist/esm/common-errors_hi-UKK4LODD.mjs +0 -34
  32. package/@wix/bex-bundled-mini-essentials/dist/esm/common-errors_hi-UKK4LODD.mjs.map +0 -1
  33. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/testkit/common-errors_hi-X2D2EJ6Z.mjs +0 -34
  34. package/@wix/bex-bundled-mini-essentials/dist/esm/exports/testkit/common-errors_hi-X2D2EJ6Z.mjs.map +0 -1
@@ -119,9 +119,9 @@ var require_base64 = __commonJS({
119
119
  }
120
120
  });
121
121
 
122
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/bind.js
122
+ // ../../node_modules/axios/lib/helpers/bind.js
123
123
  var require_bind = __commonJS({
124
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/bind.js"(exports, module) {
124
+ "../../node_modules/axios/lib/helpers/bind.js"(exports, module) {
125
125
  "use strict";
126
126
  init_define_process_env();
127
127
  module.exports = function bind(fn, thisArg) {
@@ -136,9 +136,9 @@ var require_bind = __commonJS({
136
136
  }
137
137
  });
138
138
 
139
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/utils.js
139
+ // ../../node_modules/axios/lib/utils.js
140
140
  var require_utils = __commonJS({
141
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/utils.js"(exports, module) {
141
+ "../../node_modules/axios/lib/utils.js"(exports, module) {
142
142
  "use strict";
143
143
  init_define_process_env();
144
144
  var bind = require_bind();
@@ -290,9 +290,9 @@ var require_utils = __commonJS({
290
290
  }
291
291
  });
292
292
 
293
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/buildURL.js
293
+ // ../../node_modules/axios/lib/helpers/buildURL.js
294
294
  var require_buildURL = __commonJS({
295
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/buildURL.js"(exports, module) {
295
+ "../../node_modules/axios/lib/helpers/buildURL.js"(exports, module) {
296
296
  "use strict";
297
297
  init_define_process_env();
298
298
  var utils = require_utils();
@@ -342,9 +342,9 @@ var require_buildURL = __commonJS({
342
342
  }
343
343
  });
344
344
 
345
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/core/InterceptorManager.js
345
+ // ../../node_modules/axios/lib/core/InterceptorManager.js
346
346
  var require_InterceptorManager = __commonJS({
347
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/core/InterceptorManager.js"(exports, module) {
347
+ "../../node_modules/axios/lib/core/InterceptorManager.js"(exports, module) {
348
348
  "use strict";
349
349
  init_define_process_env();
350
350
  var utils = require_utils();
@@ -376,9 +376,9 @@ var require_InterceptorManager = __commonJS({
376
376
  }
377
377
  });
378
378
 
379
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/normalizeHeaderName.js
379
+ // ../../node_modules/axios/lib/helpers/normalizeHeaderName.js
380
380
  var require_normalizeHeaderName = __commonJS({
381
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/normalizeHeaderName.js"(exports, module) {
381
+ "../../node_modules/axios/lib/helpers/normalizeHeaderName.js"(exports, module) {
382
382
  "use strict";
383
383
  init_define_process_env();
384
384
  var utils = require_utils();
@@ -393,9 +393,9 @@ var require_normalizeHeaderName = __commonJS({
393
393
  }
394
394
  });
395
395
 
396
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/core/enhanceError.js
396
+ // ../../node_modules/axios/lib/core/enhanceError.js
397
397
  var require_enhanceError = __commonJS({
398
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/core/enhanceError.js"(exports, module) {
398
+ "../../node_modules/axios/lib/core/enhanceError.js"(exports, module) {
399
399
  "use strict";
400
400
  init_define_process_env();
401
401
  module.exports = function enhanceError(error, config, code, request, response) {
@@ -429,9 +429,9 @@ var require_enhanceError = __commonJS({
429
429
  }
430
430
  });
431
431
 
432
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/core/createError.js
432
+ // ../../node_modules/axios/lib/core/createError.js
433
433
  var require_createError = __commonJS({
434
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/core/createError.js"(exports, module) {
434
+ "../../node_modules/axios/lib/core/createError.js"(exports, module) {
435
435
  "use strict";
436
436
  init_define_process_env();
437
437
  var enhanceError = require_enhanceError();
@@ -442,9 +442,9 @@ var require_createError = __commonJS({
442
442
  }
443
443
  });
444
444
 
445
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/core/settle.js
445
+ // ../../node_modules/axios/lib/core/settle.js
446
446
  var require_settle = __commonJS({
447
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/core/settle.js"(exports, module) {
447
+ "../../node_modules/axios/lib/core/settle.js"(exports, module) {
448
448
  "use strict";
449
449
  init_define_process_env();
450
450
  var createError = require_createError();
@@ -465,9 +465,9 @@ var require_settle = __commonJS({
465
465
  }
466
466
  });
467
467
 
468
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/cookies.js
468
+ // ../../node_modules/axios/lib/helpers/cookies.js
469
469
  var require_cookies = __commonJS({
470
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/cookies.js"(exports, module) {
470
+ "../../node_modules/axios/lib/helpers/cookies.js"(exports, module) {
471
471
  "use strict";
472
472
  init_define_process_env();
473
473
  var utils = require_utils();
@@ -518,9 +518,9 @@ var require_cookies = __commonJS({
518
518
  }
519
519
  });
520
520
 
521
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/isAbsoluteURL.js
521
+ // ../../node_modules/axios/lib/helpers/isAbsoluteURL.js
522
522
  var require_isAbsoluteURL = __commonJS({
523
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/isAbsoluteURL.js"(exports, module) {
523
+ "../../node_modules/axios/lib/helpers/isAbsoluteURL.js"(exports, module) {
524
524
  "use strict";
525
525
  init_define_process_env();
526
526
  module.exports = function isAbsoluteURL(url) {
@@ -529,9 +529,9 @@ var require_isAbsoluteURL = __commonJS({
529
529
  }
530
530
  });
531
531
 
532
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/combineURLs.js
532
+ // ../../node_modules/axios/lib/helpers/combineURLs.js
533
533
  var require_combineURLs = __commonJS({
534
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/combineURLs.js"(exports, module) {
534
+ "../../node_modules/axios/lib/helpers/combineURLs.js"(exports, module) {
535
535
  "use strict";
536
536
  init_define_process_env();
537
537
  module.exports = function combineURLs(baseURL, relativeURL) {
@@ -540,9 +540,9 @@ var require_combineURLs = __commonJS({
540
540
  }
541
541
  });
542
542
 
543
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/core/buildFullPath.js
543
+ // ../../node_modules/axios/lib/core/buildFullPath.js
544
544
  var require_buildFullPath = __commonJS({
545
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/core/buildFullPath.js"(exports, module) {
545
+ "../../node_modules/axios/lib/core/buildFullPath.js"(exports, module) {
546
546
  "use strict";
547
547
  init_define_process_env();
548
548
  var isAbsoluteURL = require_isAbsoluteURL();
@@ -556,9 +556,9 @@ var require_buildFullPath = __commonJS({
556
556
  }
557
557
  });
558
558
 
559
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/parseHeaders.js
559
+ // ../../node_modules/axios/lib/helpers/parseHeaders.js
560
560
  var require_parseHeaders = __commonJS({
561
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/parseHeaders.js"(exports, module) {
561
+ "../../node_modules/axios/lib/helpers/parseHeaders.js"(exports, module) {
562
562
  "use strict";
563
563
  init_define_process_env();
564
564
  var utils = require_utils();
@@ -609,9 +609,9 @@ var require_parseHeaders = __commonJS({
609
609
  }
610
610
  });
611
611
 
612
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/isURLSameOrigin.js
612
+ // ../../node_modules/axios/lib/helpers/isURLSameOrigin.js
613
613
  var require_isURLSameOrigin = __commonJS({
614
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/isURLSameOrigin.js"(exports, module) {
614
+ "../../node_modules/axios/lib/helpers/isURLSameOrigin.js"(exports, module) {
615
615
  "use strict";
616
616
  init_define_process_env();
617
617
  var utils = require_utils();
@@ -657,9 +657,9 @@ var require_isURLSameOrigin = __commonJS({
657
657
  }
658
658
  });
659
659
 
660
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/adapters/xhr.js
660
+ // ../../node_modules/axios/lib/adapters/xhr.js
661
661
  var require_xhr = __commonJS({
662
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/adapters/xhr.js"(exports, module) {
662
+ "../../node_modules/axios/lib/adapters/xhr.js"(exports, module) {
663
663
  "use strict";
664
664
  init_define_process_env();
665
665
  var utils = require_utils();
@@ -787,9 +787,9 @@ var require_xhr = __commonJS({
787
787
  }
788
788
  });
789
789
 
790
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/defaults.js
790
+ // ../../node_modules/axios/lib/defaults.js
791
791
  var require_defaults = __commonJS({
792
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/defaults.js"(exports, module) {
792
+ "../../node_modules/axios/lib/defaults.js"(exports, module) {
793
793
  "use strict";
794
794
  init_define_process_env();
795
795
  var utils = require_utils();
@@ -898,9 +898,9 @@ var require_defaults = __commonJS({
898
898
  }
899
899
  });
900
900
 
901
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/core/transformData.js
901
+ // ../../node_modules/axios/lib/core/transformData.js
902
902
  var require_transformData = __commonJS({
903
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/core/transformData.js"(exports, module) {
903
+ "../../node_modules/axios/lib/core/transformData.js"(exports, module) {
904
904
  "use strict";
905
905
  init_define_process_env();
906
906
  var utils = require_utils();
@@ -915,9 +915,9 @@ var require_transformData = __commonJS({
915
915
  }
916
916
  });
917
917
 
918
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/cancel/isCancel.js
918
+ // ../../node_modules/axios/lib/cancel/isCancel.js
919
919
  var require_isCancel = __commonJS({
920
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/cancel/isCancel.js"(exports, module) {
920
+ "../../node_modules/axios/lib/cancel/isCancel.js"(exports, module) {
921
921
  "use strict";
922
922
  init_define_process_env();
923
923
  module.exports = function isCancel(value) {
@@ -926,9 +926,9 @@ var require_isCancel = __commonJS({
926
926
  }
927
927
  });
928
928
 
929
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/core/dispatchRequest.js
929
+ // ../../node_modules/axios/lib/core/dispatchRequest.js
930
930
  var require_dispatchRequest = __commonJS({
931
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/core/dispatchRequest.js"(exports, module) {
931
+ "../../node_modules/axios/lib/core/dispatchRequest.js"(exports, module) {
932
932
  "use strict";
933
933
  init_define_process_env();
934
934
  var utils = require_utils();
@@ -988,9 +988,9 @@ var require_dispatchRequest = __commonJS({
988
988
  }
989
989
  });
990
990
 
991
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/core/mergeConfig.js
991
+ // ../../node_modules/axios/lib/core/mergeConfig.js
992
992
  var require_mergeConfig = __commonJS({
993
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/core/mergeConfig.js"(exports, module) {
993
+ "../../node_modules/axios/lib/core/mergeConfig.js"(exports, module) {
994
994
  "use strict";
995
995
  init_define_process_env();
996
996
  var utils = require_utils();
@@ -1072,9 +1072,9 @@ var require_mergeConfig = __commonJS({
1072
1072
  }
1073
1073
  });
1074
1074
 
1075
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/package.json
1075
+ // ../../node_modules/axios/package.json
1076
1076
  var require_package = __commonJS({
1077
- "../../node_modules/@wix/fe-essentials/node_modules/axios/package.json"(exports, module) {
1077
+ "../../node_modules/axios/package.json"(exports, module) {
1078
1078
  module.exports = {
1079
1079
  name: "axios",
1080
1080
  version: "0.21.4",
@@ -1162,9 +1162,9 @@ var require_package = __commonJS({
1162
1162
  }
1163
1163
  });
1164
1164
 
1165
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/validator.js
1165
+ // ../../node_modules/axios/lib/helpers/validator.js
1166
1166
  var require_validator = __commonJS({
1167
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/validator.js"(exports, module) {
1167
+ "../../node_modules/axios/lib/helpers/validator.js"(exports, module) {
1168
1168
  "use strict";
1169
1169
  init_define_process_env();
1170
1170
  var pkg = require_package();
@@ -1239,9 +1239,9 @@ var require_validator = __commonJS({
1239
1239
  }
1240
1240
  });
1241
1241
 
1242
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/core/Axios.js
1242
+ // ../../node_modules/axios/lib/core/Axios.js
1243
1243
  var require_Axios = __commonJS({
1244
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/core/Axios.js"(exports, module) {
1244
+ "../../node_modules/axios/lib/core/Axios.js"(exports, module) {
1245
1245
  "use strict";
1246
1246
  init_define_process_env();
1247
1247
  var utils = require_utils();
@@ -1352,9 +1352,9 @@ var require_Axios = __commonJS({
1352
1352
  }
1353
1353
  });
1354
1354
 
1355
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/cancel/Cancel.js
1355
+ // ../../node_modules/axios/lib/cancel/Cancel.js
1356
1356
  var require_Cancel = __commonJS({
1357
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/cancel/Cancel.js"(exports, module) {
1357
+ "../../node_modules/axios/lib/cancel/Cancel.js"(exports, module) {
1358
1358
  "use strict";
1359
1359
  init_define_process_env();
1360
1360
  function Cancel(message) {
@@ -1368,9 +1368,9 @@ var require_Cancel = __commonJS({
1368
1368
  }
1369
1369
  });
1370
1370
 
1371
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/cancel/CancelToken.js
1371
+ // ../../node_modules/axios/lib/cancel/CancelToken.js
1372
1372
  var require_CancelToken = __commonJS({
1373
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/cancel/CancelToken.js"(exports, module) {
1373
+ "../../node_modules/axios/lib/cancel/CancelToken.js"(exports, module) {
1374
1374
  "use strict";
1375
1375
  init_define_process_env();
1376
1376
  var Cancel = require_Cancel();
@@ -1410,9 +1410,9 @@ var require_CancelToken = __commonJS({
1410
1410
  }
1411
1411
  });
1412
1412
 
1413
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/spread.js
1413
+ // ../../node_modules/axios/lib/helpers/spread.js
1414
1414
  var require_spread = __commonJS({
1415
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/spread.js"(exports, module) {
1415
+ "../../node_modules/axios/lib/helpers/spread.js"(exports, module) {
1416
1416
  "use strict";
1417
1417
  init_define_process_env();
1418
1418
  module.exports = function spread(callback) {
@@ -1423,9 +1423,9 @@ var require_spread = __commonJS({
1423
1423
  }
1424
1424
  });
1425
1425
 
1426
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/isAxiosError.js
1426
+ // ../../node_modules/axios/lib/helpers/isAxiosError.js
1427
1427
  var require_isAxiosError = __commonJS({
1428
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/helpers/isAxiosError.js"(exports, module) {
1428
+ "../../node_modules/axios/lib/helpers/isAxiosError.js"(exports, module) {
1429
1429
  "use strict";
1430
1430
  init_define_process_env();
1431
1431
  module.exports = function isAxiosError2(payload) {
@@ -1434,9 +1434,9 @@ var require_isAxiosError = __commonJS({
1434
1434
  }
1435
1435
  });
1436
1436
 
1437
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/lib/axios.js
1437
+ // ../../node_modules/axios/lib/axios.js
1438
1438
  var require_axios = __commonJS({
1439
- "../../node_modules/@wix/fe-essentials/node_modules/axios/lib/axios.js"(exports, module) {
1439
+ "../../node_modules/axios/lib/axios.js"(exports, module) {
1440
1440
  "use strict";
1441
1441
  init_define_process_env();
1442
1442
  var utils = require_utils();
@@ -1469,9 +1469,9 @@ var require_axios = __commonJS({
1469
1469
  }
1470
1470
  });
1471
1471
 
1472
- // ../../node_modules/@wix/fe-essentials/node_modules/axios/index.js
1472
+ // ../../node_modules/axios/index.js
1473
1473
  var require_axios2 = __commonJS({
1474
- "../../node_modules/@wix/fe-essentials/node_modules/axios/index.js"(exports, module) {
1474
+ "../../node_modules/axios/index.js"(exports, module) {
1475
1475
  "use strict";
1476
1476
  init_define_process_env();
1477
1477
  module.exports = require_axios();
@@ -2762,6 +2762,7 @@ var require_browser = __commonJS({
2762
2762
  init_define_process_env();
2763
2763
  Object.defineProperty(exports, "__esModule", { value: true });
2764
2764
  exports.readCookie = exports.sendBeacon = exports.getWindowSize = exports.getDesktopSize = exports.now = void 0;
2765
+ var utils_1 = require_utils2();
2765
2766
  function now2() {
2766
2767
  return typeof performance !== "undefined" && performance && performance.now ? performance.now() : -1;
2767
2768
  }
@@ -2798,7 +2799,7 @@ var require_browser = __commonJS({
2798
2799
  }
2799
2800
  exports.sendBeacon = sendBeacon2;
2800
2801
  function readCookie2(cookieName) {
2801
- if (typeof document === "undefined") {
2802
+ if ((0, utils_1.isDataProtocol)() || typeof document === "undefined") {
2802
2803
  return null;
2803
2804
  }
2804
2805
  if (window.__ENABLE_COOKIE_READ_OPTIMIZATION__ && window.__BI_cookie_cache && window.__BI_cookie_cache[cookieName] !== void 0) {
@@ -2835,8 +2836,8 @@ var require_constants = __commonJS({
2835
2836
  "use strict";
2836
2837
  init_define_process_env();
2837
2838
  Object.defineProperty(exports, "__esModule", { value: true });
2838
- exports.DefaultCommonConfig = exports.BrandToHostMap = exports.HeadlessHost = exports.DefaultBrand = exports.EventContextMap = exports.BackofficeDomains = exports.LoggerVersion = void 0;
2839
- exports.LoggerVersion = "2.0.985|C";
2839
+ exports.DefaultCommonConfig = exports.BrandToDomainMap = exports.BrandToHostMap = exports.HeadlessHost = exports.DefaultScreenResolution = exports.DefaultBrand = exports.EventContextMap = exports.BackofficeDomains = exports.LoggerVersion = void 0;
2840
+ exports.LoggerVersion = "2.0.987|C";
2840
2841
  exports.BackofficeDomains = [".wix.com", ".editorx.com"];
2841
2842
  var EventContextMap;
2842
2843
  (function(EventContextMap2) {
@@ -2847,16 +2848,22 @@ var require_constants = __commonJS({
2847
2848
  EventContextMap2["siteMemberId"] = "_siteMemberId";
2848
2849
  EventContextMap2["brandId"] = "_brandId";
2849
2850
  EventContextMap2["siteBranchId"] = "_siteBranchId";
2851
+ EventContextMap2["screenResolution"] = "_sr";
2850
2852
  EventContextMap2["ms"] = "_ms";
2851
2853
  EventContextMap2["lv"] = "_lv";
2852
2854
  EventContextMap2["isHeadless"] = "_isHeadless";
2853
2855
  EventContextMap2["hostingPlatform"] = "_hostingPlatform";
2854
2856
  })(EventContextMap = exports.EventContextMap || (exports.EventContextMap = {}));
2855
2857
  exports.DefaultBrand = "wix";
2858
+ exports.DefaultScreenResolution = "0x0";
2856
2859
  exports.HeadlessHost = "VIEWER_HEADLESS";
2857
2860
  exports.BrandToHostMap = {
2858
2861
  wix: "wix",
2859
- editorx: "editorx"
2862
+ editorx: "editorx",
2863
+ base44: "base44"
2864
+ };
2865
+ exports.BrandToDomainMap = {
2866
+ base44: /\.base44\.com$/
2860
2867
  };
2861
2868
  exports.DefaultCommonConfig = {
2862
2869
  brand: exports.DefaultBrand
@@ -2870,7 +2877,7 @@ var require_env = __commonJS({
2870
2877
  "use strict";
2871
2878
  init_define_process_env();
2872
2879
  Object.defineProperty(exports, "__esModule", { value: true });
2873
- exports.getGlobal = exports.getWindowIfTop = exports.isBackoffice = exports.isWebWorker = exports.getHost = exports.setHost = void 0;
2880
+ exports.getGlobal = exports.getWindowIfTop = exports.isBackoffice = exports.isWebWorker = exports.getBrandByDomain = exports.getHost = exports.setHost = void 0;
2874
2881
  var constants_1 = require_constants();
2875
2882
  var host;
2876
2883
  var hostByDomain;
@@ -2891,7 +2898,7 @@ var require_env = __commonJS({
2891
2898
  if (!window2.location || !window2.location.hostname) {
2892
2899
  return null;
2893
2900
  }
2894
- var _a = window2.location.hostname.match(/\.(wix|editorx)\.com$/) || [], domain = _a[1];
2901
+ var _a = window2.location.hostname.match(/\.(wix|editorx|base44)\.com$/) || [], domain = _a[1];
2895
2902
  return domain || null;
2896
2903
  }, null);
2897
2904
  }
@@ -2899,6 +2906,17 @@ var require_env = __commonJS({
2899
2906
  return "frog.".concat(hostByDomainOrBrand, ".com");
2900
2907
  }
2901
2908
  exports.getHost = getHost;
2909
+ function getBrandByDomain() {
2910
+ return getGlobal2(function(global2) {
2911
+ if (!global2.location || !global2.location.hostname) {
2912
+ return null;
2913
+ }
2914
+ return Object.keys(constants_1.BrandToDomainMap).find(function(brand) {
2915
+ return constants_1.BrandToDomainMap[brand].test(global2.location.hostname);
2916
+ }) || null;
2917
+ }, null);
2918
+ }
2919
+ exports.getBrandByDomain = getBrandByDomain;
2902
2920
  function isWebWorker2() {
2903
2921
  return typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope;
2904
2922
  }
@@ -2919,77 +2937,1094 @@ var require_env = __commonJS({
2919
2937
  } catch (e) {
2920
2938
  return null;
2921
2939
  }
2922
- }
2923
- return null;
2924
- }
2925
- exports.getWindowIfTop = getWindowIfTop;
2926
- function getGlobal2(cb, defaultValue) {
2927
- if (defaultValue === void 0) {
2928
- defaultValue = null;
2929
- }
2930
- if (typeof self !== "undefined" && self) {
2931
- return cb(self) || defaultValue;
2932
- }
2933
- return defaultValue;
2934
- }
2935
- exports.getGlobal = getGlobal2;
2940
+ }
2941
+ return null;
2942
+ }
2943
+ exports.getWindowIfTop = getWindowIfTop;
2944
+ function getGlobal2(cb, defaultValue) {
2945
+ if (defaultValue === void 0) {
2946
+ defaultValue = null;
2947
+ }
2948
+ if (typeof self !== "undefined" && self) {
2949
+ return cb(self) || defaultValue;
2950
+ }
2951
+ return defaultValue;
2952
+ }
2953
+ exports.getGlobal = getGlobal2;
2954
+ }
2955
+ });
2956
+
2957
+ // ../../node_modules/@wix/web-bi-logger/dist/src/lib/utils.js
2958
+ var require_utils2 = __commonJS({
2959
+ "../../node_modules/@wix/web-bi-logger/dist/src/lib/utils.js"(exports) {
2960
+ "use strict";
2961
+ init_define_process_env();
2962
+ Object.defineProperty(exports, "__esModule", { value: true });
2963
+ exports.guid = exports.isDataProtocol = exports.buildBiUrl = exports.getCookies = void 0;
2964
+ var browser_1 = require_browser();
2965
+ var env_1 = require_env();
2966
+ var cacheKillerCounter = 0;
2967
+ function getCookies(params) {
2968
+ return Object.keys(params).reduce(function(res, param) {
2969
+ var _a = typeof params[param] === "string" ? { name: params[param] } : params[param], name = _a.name, _b = _a.transform, transform = _b === void 0 ? function(x) {
2970
+ return x;
2971
+ } : _b;
2972
+ var value = transform((0, browser_1.readCookie)(name));
2973
+ if (value) {
2974
+ res[param] = value;
2975
+ }
2976
+ return res;
2977
+ }, {});
2978
+ }
2979
+ exports.getCookies = getCookies;
2980
+ function buildBiUrl(_a, params, context) {
2981
+ var _b = _a.host, host = _b === void 0 ? "" : _b, _c = _a.endpoint, endpoint = _c === void 0 ? "" : _c;
2982
+ if (context === void 0) {
2983
+ context = {};
2984
+ }
2985
+ host = typeof host === "function" ? host() : host;
2986
+ host = host || (0, env_1.getHost)();
2987
+ endpoint = context.endpoint || endpoint;
2988
+ if (!context.useBatch) {
2989
+ params._ = "" + (/* @__PURE__ */ new Date()).getTime() + cacheKillerCounter++;
2990
+ }
2991
+ var pairs = context.useBatch ? [] : Object.keys(params).map(function(key) {
2992
+ return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(params[key]));
2993
+ }, []);
2994
+ var url = ["//".concat(host, "/").concat(endpoint)].concat(pairs.length ? pairs.join("&") : []).join("?");
2995
+ if (url.startsWith("//") && isDataProtocol()) {
2996
+ url = "https:" + url;
2997
+ }
2998
+ return url;
2999
+ }
3000
+ exports.buildBiUrl = buildBiUrl;
3001
+ function isDataProtocol() {
3002
+ return typeof window !== "undefined" && (window === null || window === void 0 ? void 0 : window.location.protocol) === "data:";
3003
+ }
3004
+ exports.isDataProtocol = isDataProtocol;
3005
+ function guid() {
3006
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
3007
+ var r = Math.random() * 16 | 0;
3008
+ var v = c === "x" ? r : r & 3 | 8;
3009
+ return v.toString(16);
3010
+ });
3011
+ }
3012
+ exports.guid = guid;
3013
+ }
3014
+ });
3015
+
3016
+ // ../../node_modules/@wix/web-bi-logger/dist/src/types.js
3017
+ var require_types = __commonJS({
3018
+ "../../node_modules/@wix/web-bi-logger/dist/src/types.js"(exports) {
3019
+ "use strict";
3020
+ init_define_process_env();
3021
+ Object.defineProperty(exports, "__esModule", { value: true });
3022
+ exports.Errors = exports.EventCategories = exports.PublishMethods = void 0;
3023
+ var PublishMethods;
3024
+ (function(PublishMethods2) {
3025
+ PublishMethods2["Auto"] = "auto";
3026
+ PublishMethods2["PostMessage"] = "postMessage";
3027
+ PublishMethods2["Fetch"] = "fetch";
3028
+ })(PublishMethods = exports.PublishMethods || (exports.PublishMethods = {}));
3029
+ var EventCategories;
3030
+ (function(EventCategories2) {
3031
+ EventCategories2["Essential"] = "essential";
3032
+ EventCategories2["Functional"] = "functional";
3033
+ EventCategories2["Analytics"] = "analytics";
3034
+ })(EventCategories = exports.EventCategories || (exports.EventCategories = {}));
3035
+ var Errors;
3036
+ (function(Errors2) {
3037
+ Errors2[Errors2["Unsupported"] = 0] = "Unsupported";
3038
+ })(Errors = exports.Errors || (exports.Errors = {}));
3039
+ }
3040
+ });
3041
+
3042
+ // ../../node_modules/@wix/web-bi-logger/dist/src/lib/transport.js
3043
+ var require_transport = __commonJS({
3044
+ "../../node_modules/@wix/web-bi-logger/dist/src/lib/transport.js"(exports) {
3045
+ "use strict";
3046
+ init_define_process_env();
3047
+ Object.defineProperty(exports, "__esModule", { value: true });
3048
+ exports.postMessageTransport = exports.xhrTransport = exports.fetchTransport = exports.pixelTransport = exports.beaconTransport = void 0;
3049
+ var browser_1 = require_browser();
3050
+ var errors_1 = require_errors();
3051
+ function beaconTransport(url, params, sendInBody) {
3052
+ if (sendInBody === void 0) {
3053
+ sendInBody = false;
3054
+ }
3055
+ return new Promise(function(resolve, reject) {
3056
+ return (0, browser_1.sendBeacon)(url, sendInBody ? JSON.stringify(params) : void 0) ? resolve() : reject(new Error("Transport Error: Cannot send bi using beacon"));
3057
+ });
3058
+ }
3059
+ exports.beaconTransport = beaconTransport;
3060
+ function pixelTransport(url, image) {
3061
+ return new Promise(function(resolve, reject) {
3062
+ var biImage = image || new window.Image(0, 0);
3063
+ biImage.onload = function() {
3064
+ return resolve();
3065
+ };
3066
+ biImage.onerror = function() {
3067
+ return reject(new Error("Transport Error: Cannot send bi using pixel"));
3068
+ };
3069
+ biImage.src = url;
3070
+ });
3071
+ }
3072
+ exports.pixelTransport = pixelTransport;
3073
+ function fetchTransport(url, params, method, fetchFunction) {
3074
+ if (method === void 0) {
3075
+ method = "GET";
3076
+ }
3077
+ if (typeof fetchFunction === "undefined") {
3078
+ if (typeof fetch === "undefined") {
3079
+ return Promise.reject(new errors_1.APINotSupportedError("fetch"));
3080
+ }
3081
+ fetchFunction = fetch;
3082
+ }
3083
+ var options = {
3084
+ method,
3085
+ credentials: "include"
3086
+ };
3087
+ if (method === "POST") {
3088
+ options.body = JSON.stringify(params);
3089
+ } else {
3090
+ options.keepalive = true;
3091
+ }
3092
+ return fetchFunction(url, options).then(function(response) {
3093
+ if (!response.ok) {
3094
+ throw Error("Transport Error: Cannot send bi using fetch. Status: ".concat(response.status));
3095
+ }
3096
+ });
3097
+ }
3098
+ exports.fetchTransport = fetchTransport;
3099
+ function xhrTransport(url, params, method) {
3100
+ if (method === void 0) {
3101
+ method = "GET";
3102
+ }
3103
+ return new Promise(function(resolve, reject) {
3104
+ var xhr = new XMLHttpRequest();
3105
+ xhr.open(method, "".concat(location.protocol).concat(url));
3106
+ xhr.onload = resolve;
3107
+ xhr.onerror = function() {
3108
+ reject(new Error("Transport Error: Cannot send bi using xhr."));
3109
+ };
3110
+ xhr.withCredentials = true;
3111
+ if (method === "POST") {
3112
+ xhr.send(JSON.stringify(params));
3113
+ } else {
3114
+ xhr.send();
3115
+ }
3116
+ });
3117
+ }
3118
+ exports.xhrTransport = xhrTransport;
3119
+ function postMessageTransport(message, postMessage) {
3120
+ if (postMessage === void 0) {
3121
+ postMessage = self.postMessage;
3122
+ }
3123
+ var messageArgs = [message];
3124
+ if (typeof WorkerGlobalScope === "undefined") {
3125
+ messageArgs.push("*");
3126
+ }
3127
+ return postMessage.apply(self, messageArgs);
3128
+ }
3129
+ exports.postMessageTransport = postMessageTransport;
3130
+ }
3131
+ });
3132
+
3133
+ // ../../node_modules/@wix/web-bi-logger/dist/src/lib/publishers.js
3134
+ var require_publishers = __commonJS({
3135
+ "../../node_modules/@wix/web-bi-logger/dist/src/lib/publishers.js"(exports) {
3136
+ "use strict";
3137
+ init_define_process_env();
3138
+ var __assign4 = exports && exports.__assign || function() {
3139
+ __assign4 = Object.assign || function(t) {
3140
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
3141
+ s = arguments[i];
3142
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
3143
+ t[p] = s[p];
3144
+ }
3145
+ return t;
3146
+ };
3147
+ return __assign4.apply(this, arguments);
3148
+ };
3149
+ var __rest = exports && exports.__rest || function(s, e) {
3150
+ var t = {};
3151
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
3152
+ t[p] = s[p];
3153
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
3154
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
3155
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
3156
+ t[p[i]] = s[p[i]];
3157
+ }
3158
+ return t;
3159
+ };
3160
+ Object.defineProperty(exports, "__esModule", { value: true });
3161
+ exports.getTransformers = exports.getPublisher = exports.postMessagePublisher = exports.xhrPublisher = exports.fetchPublisher = exports.beaconPublisher = exports.imagePublisher = exports.resolvePublisher = void 0;
3162
+ var utils_1 = require_utils2();
3163
+ var env_1 = require_env();
3164
+ var errors_1 = require_errors();
3165
+ var types_1 = require_types();
3166
+ var transport_1 = require_transport();
3167
+ var getHttpMethod = function(context) {
3168
+ return context.useBatch ? "POST" : "GET";
3169
+ };
3170
+ var resolvePublisher = function(options, publishFunctions) {
3171
+ var publisherFactory;
3172
+ var publishFunction;
3173
+ if (options.publishMethod === types_1.PublishMethods.PostMessage) {
3174
+ publisherFactory = postMessagePublisher;
3175
+ publishFunction = publishFunctions && publishFunctions[types_1.PublishMethods.PostMessage];
3176
+ } else if (options.publishMethod === types_1.PublishMethods.Fetch) {
3177
+ publisherFactory = fetchPublisher;
3178
+ publishFunction = publishFunctions && publishFunctions[types_1.PublishMethods.Fetch];
3179
+ } else if ((0, env_1.isWebWorker)()) {
3180
+ publisherFactory = fetchPublisher;
3181
+ } else {
3182
+ publisherFactory = beaconPublisher;
3183
+ }
3184
+ return publisherFactory(options, publishFunction);
3185
+ };
3186
+ exports.resolvePublisher = resolvePublisher;
3187
+ function imagePublisher(options) {
3188
+ if (options === void 0) {
3189
+ options = {};
3190
+ }
3191
+ return function image(params, context) {
3192
+ if (context === void 0) {
3193
+ context = {};
3194
+ }
3195
+ if (context.useBatch) {
3196
+ throw new errors_1.APINotSupportedError("Can't use image publisher to send batched events.");
3197
+ }
3198
+ var url = (0, utils_1.buildBiUrl)(options, params, context);
3199
+ return (0, transport_1.pixelTransport)(url, context.image);
3200
+ };
3201
+ }
3202
+ exports.imagePublisher = imagePublisher;
3203
+ function beaconPublisher(options) {
3204
+ if (options === void 0) {
3205
+ options = {};
3206
+ }
3207
+ return function beacon(params, context) {
3208
+ if (context === void 0) {
3209
+ context = {};
3210
+ }
3211
+ var url = (0, utils_1.buildBiUrl)(options, params, context);
3212
+ return (0, transport_1.beaconTransport)(url, params, !!context.useBatch).catch(function() {
3213
+ var method = getHttpMethod(context);
3214
+ return context.useBatch ? (0, transport_1.fetchTransport)(url, params, method).catch(function(error) {
3215
+ return error instanceof errors_1.APINotSupportedError ? (0, transport_1.xhrTransport)(url, params, method) : Promise.reject(error);
3216
+ }) : (0, transport_1.pixelTransport)(url, context.image);
3217
+ });
3218
+ };
3219
+ }
3220
+ exports.beaconPublisher = beaconPublisher;
3221
+ function fetchPublisher(options, fetchFunction) {
3222
+ if (options === void 0) {
3223
+ options = {};
3224
+ }
3225
+ return function fetch2(params, context) {
3226
+ if (context === void 0) {
3227
+ context = {};
3228
+ }
3229
+ var url = (0, utils_1.buildBiUrl)(options, params, context);
3230
+ var method = getHttpMethod(context);
3231
+ return (0, transport_1.fetchTransport)(url, params, method, fetchFunction).catch(function(error) {
3232
+ return error instanceof errors_1.APINotSupportedError ? (0, transport_1.xhrTransport)(url, params, method) : Promise.reject(error);
3233
+ });
3234
+ };
3235
+ }
3236
+ exports.fetchPublisher = fetchPublisher;
3237
+ function xhrPublisher(options) {
3238
+ if (options === void 0) {
3239
+ options = {};
3240
+ }
3241
+ return function xhr(params, context) {
3242
+ if (context === void 0) {
3243
+ context = {};
3244
+ }
3245
+ var url = (0, utils_1.buildBiUrl)(options, params, context);
3246
+ var method = getHttpMethod(context);
3247
+ return (0, transport_1.xhrTransport)(url, params, method);
3248
+ };
3249
+ }
3250
+ exports.xhrPublisher = xhrPublisher;
3251
+ function postMessagePublisher(options, publishFunction) {
3252
+ if (options === void 0) {
3253
+ options = {};
3254
+ }
3255
+ return function postMessage(params) {
3256
+ return (0, transport_1.postMessageTransport)(params, publishFunction);
3257
+ };
3258
+ }
3259
+ exports.postMessagePublisher = postMessagePublisher;
3260
+ function getPublisher(options, publishFunctions) {
3261
+ return (0, exports.resolvePublisher)(options, publishFunctions);
3262
+ }
3263
+ exports.getPublisher = getPublisher;
3264
+ var getTransformers = function(factoryOptions, transformer) {
3265
+ var _eventTransformer, _payloadTransformer;
3266
+ if (transformer) {
3267
+ if (typeof transformer !== "function" && transformer.postMessage && factoryOptions.publishMethod === types_1.PublishMethods.PostMessage) {
3268
+ _payloadTransformer = transformer.postMessage;
3269
+ } else if (typeof transformer === "function") {
3270
+ _eventTransformer = transformer;
3271
+ }
3272
+ }
3273
+ var eventTransformer = _eventTransformer;
3274
+ var payloadTransformer = function(params, publisherContext) {
3275
+ if (publisherContext.useBatch) {
3276
+ var getEndpoint_1 = function(context) {
3277
+ return (context === null || context === void 0 ? void 0 : context.endpoint) || publisherContext.endpoint || factoryOptions.endpoint;
3278
+ };
3279
+ params.e = params.e.map(function(e) {
3280
+ var context = e.context, event = __rest(e, ["context"]);
3281
+ var res = __assign4(__assign4({}, event), { f: __assign4(__assign4({}, event.f), { _rp: getEndpoint_1(context) }) });
3282
+ return res;
3283
+ });
3284
+ }
3285
+ return _payloadTransformer ? _payloadTransformer(params) : params;
3286
+ };
3287
+ return { eventTransformer, payloadTransformer };
3288
+ };
3289
+ exports.getTransformers = getTransformers;
3290
+ }
3291
+ });
3292
+
3293
+ // ../../node_modules/@wix/web-bi-logger/dist/src/lib/common-config.js
3294
+ var require_common_config = __commonJS({
3295
+ "../../node_modules/@wix/web-bi-logger/dist/src/lib/common-config.js"(exports) {
3296
+ "use strict";
3297
+ init_define_process_env();
3298
+ Object.defineProperty(exports, "__esModule", { value: true });
3299
+ exports.getWixHost = exports.getBranchId = exports.getBrand = exports.getCommonConfigValue = void 0;
3300
+ var env_1 = require_env();
3301
+ var constants_1 = require_constants();
3302
+ var resolveCommonConfig = function() {
3303
+ return (0, env_1.getGlobal)(function(g) {
3304
+ return g.Wix && g.Wix.Utils && g.Wix.Utils.commonConfig || g.commonConfig;
3305
+ });
3306
+ };
3307
+ var getCommonConfigValue = function(key, commonConfig2, defaultValue) {
3308
+ if (commonConfig2 === void 0) {
3309
+ commonConfig2 = resolveCommonConfig();
3310
+ }
3311
+ if (defaultValue === void 0) {
3312
+ defaultValue = constants_1.DefaultCommonConfig[key];
3313
+ }
3314
+ commonConfig2 = commonConfig2 && typeof commonConfig2.getAll === "function" ? commonConfig2.getAll() : commonConfig2;
3315
+ if (!commonConfig2 || typeof commonConfig2[key] === "undefined") {
3316
+ return defaultValue;
3317
+ }
3318
+ return commonConfig2[key];
3319
+ };
3320
+ exports.getCommonConfigValue = getCommonConfigValue;
3321
+ var getBrand = function(commonConfigGetter) {
3322
+ return (0, exports.getCommonConfigValue)("brand", commonConfigGetter(), (0, env_1.getBrandByDomain)() || constants_1.DefaultBrand);
3323
+ };
3324
+ exports.getBrand = getBrand;
3325
+ var getBranchId = function(commonConfigGetter) {
3326
+ return (0, exports.getCommonConfigValue)("branchId", commonConfigGetter());
3327
+ };
3328
+ exports.getBranchId = getBranchId;
3329
+ var getWixHost = function(commonConfigGetter) {
3330
+ return (0, exports.getCommonConfigValue)("host", commonConfigGetter());
3331
+ };
3332
+ exports.getWixHost = getWixHost;
3333
+ }
3334
+ });
3335
+
3336
+ // ../../node_modules/@wix/web-bi-logger/dist/src/lib/event-defaults.js
3337
+ var require_event_defaults = __commonJS({
3338
+ "../../node_modules/@wix/web-bi-logger/dist/src/lib/event-defaults.js"(exports) {
3339
+ "use strict";
3340
+ init_define_process_env();
3341
+ Object.defineProperty(exports, "__esModule", { value: true });
3342
+ exports.getCommonDefaults = exports.getUserDefaults = exports.transformDefaults = void 0;
3343
+ var constants_1 = require_constants();
3344
+ var browser_1 = require_browser();
3345
+ var common_config_1 = require_common_config();
3346
+ var env_1 = require_env();
3347
+ var utils_1 = require_utils2();
3348
+ var transformDefaults = function(context) {
3349
+ return Object.keys(context).reduce(function(res, key) {
3350
+ var mappedKey = constants_1.EventContextMap[key] || key;
3351
+ res[mappedKey] = context[key];
3352
+ return res;
3353
+ }, {});
3354
+ };
3355
+ exports.transformDefaults = transformDefaults;
3356
+ var getUserDefaults = function() {
3357
+ return (0, utils_1.getCookies)({
3358
+ clientId: "_wixCIDX",
3359
+ uuid: {
3360
+ name: "_wixUIDX",
3361
+ transform: function(value) {
3362
+ return typeof value === "string" && value.split("|")[1];
3363
+ }
3364
+ }
3365
+ });
3366
+ };
3367
+ exports.getUserDefaults = getUserDefaults;
3368
+ var getCommonDefaults = function(commonConfigGetter, consentPolicyGetter) {
3369
+ return (0, exports.transformDefaults)({
3370
+ brandId: function() {
3371
+ return (0, common_config_1.getBrand)(commonConfigGetter);
3372
+ },
3373
+ siteBranchId: function() {
3374
+ return (0, common_config_1.getBranchId)(commonConfigGetter);
3375
+ },
3376
+ screenResolution: function() {
3377
+ return resolveScreenResolution();
3378
+ },
3379
+ ms: function() {
3380
+ return Math.round((0, browser_1.now)());
3381
+ },
3382
+ isHeadless: function() {
3383
+ return resolveIsHeadless(commonConfigGetter);
3384
+ },
3385
+ hostingPlatform: function() {
3386
+ return (0, common_config_1.getWixHost)(commonConfigGetter);
3387
+ },
3388
+ lv: constants_1.LoggerVersion
3389
+ });
3390
+ };
3391
+ exports.getCommonDefaults = getCommonDefaults;
3392
+ var resolveIsHeadless = function(commonConfigGetter) {
3393
+ return (0, common_config_1.getWixHost)(commonConfigGetter) === constants_1.HeadlessHost || void 0;
3394
+ };
3395
+ var resolveScreenResolution = function() {
3396
+ return (0, env_1.getWindowIfTop)(function(window2) {
3397
+ return (0, browser_1.getDesktopSize)(window2);
3398
+ }) || constants_1.DefaultScreenResolution;
3399
+ };
3400
+ }
3401
+ });
3402
+
3403
+ // ../../node_modules/@wix/web-bi-logger/dist/src/logger.js
3404
+ var require_logger = __commonJS({
3405
+ "../../node_modules/@wix/web-bi-logger/dist/src/logger.js"(exports) {
3406
+ "use strict";
3407
+ init_define_process_env();
3408
+ var __assign4 = exports && exports.__assign || function() {
3409
+ __assign4 = Object.assign || function(t) {
3410
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
3411
+ s = arguments[i];
3412
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
3413
+ t[p] = s[p];
3414
+ }
3415
+ return t;
3416
+ };
3417
+ return __assign4.apply(this, arguments);
3418
+ };
3419
+ var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
3420
+ if (k2 === void 0) k2 = k;
3421
+ var desc = Object.getOwnPropertyDescriptor(m, k);
3422
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
3423
+ desc = { enumerable: true, get: function() {
3424
+ return m[k];
3425
+ } };
3426
+ }
3427
+ Object.defineProperty(o, k2, desc);
3428
+ } : function(o, m, k, k2) {
3429
+ if (k2 === void 0) k2 = k;
3430
+ o[k2] = m[k];
3431
+ });
3432
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
3433
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
3434
+ } : function(o, v) {
3435
+ o["default"] = v;
3436
+ });
3437
+ var __importStar = exports && exports.__importStar || function(mod) {
3438
+ if (mod && mod.__esModule) return mod;
3439
+ var result = {};
3440
+ if (mod != null) {
3441
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
3442
+ }
3443
+ __setModuleDefault(result, mod);
3444
+ return result;
3445
+ };
3446
+ Object.defineProperty(exports, "__esModule", { value: true });
3447
+ exports.BiLoggerClientFactory = exports.createBatchQueue = exports.manager = exports.factory = exports.Factory = exports.setHost = exports.EventCategories = exports.PublishMethods = void 0;
3448
+ var wix_bi_logger_client_1 = require_dist();
3449
+ var consent_policy_client_accessor_1 = (init_src(), __toCommonJS(src_exports));
3450
+ var assert = __importStar(require_assert2());
3451
+ var publishers_1 = require_publishers();
3452
+ var common_config_1 = require_common_config();
3453
+ var env_1 = require_env();
3454
+ var types_1 = require_types();
3455
+ var event_defaults_1 = require_event_defaults();
3456
+ var types_2 = require_types();
3457
+ Object.defineProperty(exports, "PublishMethods", { enumerable: true, get: function() {
3458
+ return types_2.PublishMethods;
3459
+ } });
3460
+ Object.defineProperty(exports, "EventCategories", { enumerable: true, get: function() {
3461
+ return types_2.EventCategories;
3462
+ } });
3463
+ var env_2 = require_env();
3464
+ Object.defineProperty(exports, "setHost", { enumerable: true, get: function() {
3465
+ return env_2.setHost;
3466
+ } });
3467
+ var Factory = (
3468
+ /** @class */
3469
+ function() {
3470
+ function Factory2(options) {
3471
+ if (options === void 0) {
3472
+ options = {};
3473
+ }
3474
+ this.options = options;
3475
+ this.commonConfigGetter = function() {
3476
+ return void 0;
3477
+ };
3478
+ this.initialized = false;
3479
+ assert.ok(!options.publishMethod || Object.keys(types_1.PublishMethods).map(function(key) {
3480
+ return types_1.PublishMethods[key];
3481
+ }).indexOf(options.publishMethod) !== -1, 'Unsupported publish method "'.concat(options.publishMethod, '"'));
3482
+ Factory2.consentPolicyAccessor = Factory2.consentPolicyAccessor || new consent_policy_client_accessor_1.ConsentPolicyAccessor();
3483
+ this.loggerClientFactory = (0, wix_bi_logger_client_1.factory)();
3484
+ }
3485
+ Factory2.prototype.initFactory = function() {
3486
+ var _this = this;
3487
+ if (this.initialized) {
3488
+ return this.loggerClientFactory;
3489
+ }
3490
+ this.initialized = true;
3491
+ this.updateDefaults((0, event_defaults_1.getCommonDefaults)(this.commonConfigGetter, Factory2.consentPolicyAccessor));
3492
+ this.withUserContext((0, event_defaults_1.getUserDefaults)());
3493
+ var options = __assign4(__assign4({}, this.options), { host: this.options.host || function() {
3494
+ return (0, env_1.getHost)((0, common_config_1.getBrand)(_this.commonConfigGetter));
3495
+ } });
3496
+ var publisher = (0, publishers_1.getPublisher)(options, this.publishFunctions);
3497
+ var _a = (0, publishers_1.getTransformers)(options, this.transformer), eventTransformer = _a.eventTransformer, payloadTransformer = _a.payloadTransformer;
3498
+ var baseFactory = this.loggerClientFactory.addPublisher(publisher).withConsentPolicyGetter(function() {
3499
+ return Factory2.consentPolicyAccessor.getCurrentConsentPolicy();
3500
+ });
3501
+ if (eventTransformer) {
3502
+ baseFactory.withEventTransformer(eventTransformer);
3503
+ }
3504
+ if (payloadTransformer) {
3505
+ baseFactory.withPayloadTransformer(payloadTransformer);
3506
+ }
3507
+ return baseFactory;
3508
+ };
3509
+ Factory2.prototype.withTransformer = function(transformer) {
3510
+ assert.defined(transformer, "Transformer must be provided");
3511
+ assert.ok(typeof transformer === "function" || transformer && typeof transformer[types_1.PublishMethods.PostMessage] === "function", "Valid transformer must be provided");
3512
+ this.transformer = transformer;
3513
+ return this;
3514
+ };
3515
+ Factory2.prototype.withPublishFunction = function(publishFunctions) {
3516
+ assert.defined(publishFunctions, "Publish functions object must be provided");
3517
+ assert.ok(this.options.publishMethod && this.options.publishMethod !== types_1.PublishMethods.Auto, "Publish function can be used only when using a custom publish method");
3518
+ assert.ok(publishFunctions && typeof publishFunctions[this.options.publishMethod] === "function", "Valid publish function must be provided");
3519
+ this.publishFunctions = publishFunctions;
3520
+ return this;
3521
+ };
3522
+ Factory2.prototype.withUserContext = function(context) {
3523
+ assert.defined(context, "User context object must be provided");
3524
+ this.updateDefaults((0, event_defaults_1.transformDefaults)(context));
3525
+ return this;
3526
+ };
3527
+ Factory2.prototype.withUoUContext = function(context) {
3528
+ assert.defined(context, "UoU context object must be provided");
3529
+ this.updateDefaults((0, event_defaults_1.transformDefaults)(context));
3530
+ return this;
3531
+ };
3532
+ Factory2.prototype.withNonEssentialContext = function(context) {
3533
+ assert.defined(context, "Non-essential context object must be provided");
3534
+ this.loggerClientFactory.updateNonEssentialDefaults((0, event_defaults_1.transformDefaults)(context));
3535
+ return this;
3536
+ };
3537
+ Factory2.prototype.withCommonConfigGetter = function(commonConfigGetter) {
3538
+ assert.defined(commonConfigGetter, "Common config getter must be provided");
3539
+ assert.ok(typeof commonConfigGetter === "function", "Common config getter must be a function");
3540
+ this.commonConfigGetter = commonConfigGetter;
3541
+ return this;
3542
+ };
3543
+ Factory2.prototype.updateDefaults = function(params) {
3544
+ this.loggerClientFactory.updateDefaults(params);
3545
+ return this;
3546
+ };
3547
+ Factory2.prototype.setMuted = function(isMuted) {
3548
+ this.loggerClientFactory.setMuted(isMuted);
3549
+ return this;
3550
+ };
3551
+ Factory2.prototype.setEvents = function(events) {
3552
+ this.loggerClientFactory.setEvents(events);
3553
+ return this;
3554
+ };
3555
+ Factory2.prototype.setGlobalBatchQueue = function(batchQueue) {
3556
+ this.loggerClientFactory.setGlobalBatchQueue(batchQueue);
3557
+ return this;
3558
+ };
3559
+ Factory2.prototype.onError = function(handler) {
3560
+ this.loggerClientFactory.setPublisherFailHandler(handler);
3561
+ return this;
3562
+ };
3563
+ Factory2.prototype.logger = function(options) {
3564
+ if (options === void 0) {
3565
+ options = {};
3566
+ }
3567
+ var _a = this.options, endpoint = _a.endpoint, useBatch = _a.useBatch;
3568
+ var logger = this.initFactory().logger(__assign4({ endpoint, useBatch }, options));
3569
+ return logger;
3570
+ };
3571
+ return Factory2;
3572
+ }()
3573
+ );
3574
+ exports.Factory = Factory;
3575
+ var factory2 = function(options) {
3576
+ if (options === void 0) {
3577
+ options = {};
3578
+ }
3579
+ return new Factory(options);
3580
+ };
3581
+ exports.factory = factory2;
3582
+ exports.manager = wix_bi_logger_client_1.manager;
3583
+ exports.createBatchQueue = wix_bi_logger_client_1.createBatchQueue;
3584
+ exports.BiLoggerClientFactory = wix_bi_logger_client_1.BiLoggerFactory;
3585
+ }
3586
+ });
3587
+
3588
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/browser.js
3589
+ var require_browser2 = __commonJS({
3590
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/browser.js"(exports) {
3591
+ "use strict";
3592
+ init_define_process_env();
3593
+ Object.defineProperty(exports, "__esModule", { value: true });
3594
+ exports.readCookie = exports.sendBeacon = exports.getWindowSize = exports.getDesktopSize = exports.now = void 0;
3595
+ var utils_1 = require_utils3();
3596
+ function now2() {
3597
+ return typeof performance !== "undefined" && performance && performance.now ? performance.now() : -1;
3598
+ }
3599
+ exports.now = now2;
3600
+ function getDesktopSize(window2) {
3601
+ var width = window2.screen && window2.screen.width || 0;
3602
+ var height = window2.screen && window2.screen.height || 0;
3603
+ return "".concat(width, "x").concat(height);
3604
+ }
3605
+ exports.getDesktopSize = getDesktopSize;
3606
+ function getWindowSize(window2) {
3607
+ var width = 0;
3608
+ var height = 0;
3609
+ if (window2.innerWidth) {
3610
+ width = window2.innerWidth;
3611
+ height = window2.innerHeight;
3612
+ } else if (window2.document) {
3613
+ if (window2.document.documentElement && window2.document.documentElement.clientWidth) {
3614
+ width = window2.document.documentElement.clientWidth;
3615
+ height = window2.document.documentElement.clientHeight;
3616
+ } else if (window2.document.body && window2.document.body.clientWidth) {
3617
+ width = window2.document.body.clientWidth;
3618
+ height = window2.document.body.clientHeight;
3619
+ }
3620
+ }
3621
+ return "".concat(width, "x").concat(height);
3622
+ }
3623
+ exports.getWindowSize = getWindowSize;
3624
+ function sendBeacon2(url, data) {
3625
+ if (typeof navigator === "undefined" || !navigator || !navigator.sendBeacon) {
3626
+ return false;
3627
+ }
3628
+ return navigator.sendBeacon(url, data);
3629
+ }
3630
+ exports.sendBeacon = sendBeacon2;
3631
+ function readCookie2(cookieName) {
3632
+ if ((0, utils_1.isDataProtocol)() || typeof document === "undefined") {
3633
+ return null;
3634
+ }
3635
+ if (window.__ENABLE_COOKIE_READ_OPTIMIZATION__ && window.__BI_cookie_cache && window.__BI_cookie_cache[cookieName] !== void 0) {
3636
+ return window.__BI_cookie_cache[cookieName];
3637
+ }
3638
+ var cookies = document.cookie.split(";");
3639
+ for (var _i = 0, cookies_1 = cookies; _i < cookies_1.length; _i++) {
3640
+ var cookie = cookies_1[_i];
3641
+ var pair = cookie.split("=");
3642
+ var name_1 = pair[0];
3643
+ var value = pair[1];
3644
+ while (name_1[0] === " ") {
3645
+ name_1 = name_1.substr(1);
3646
+ }
3647
+ if (name_1 === cookieName) {
3648
+ if (window.__ENABLE_COOKIE_READ_OPTIMIZATION__) {
3649
+ if (!window.__BI_cookie_cache) {
3650
+ window.__BI_cookie_cache = {};
3651
+ }
3652
+ window.__BI_cookie_cache[cookieName] = value;
3653
+ }
3654
+ return value;
3655
+ }
3656
+ }
3657
+ return "";
3658
+ }
3659
+ exports.readCookie = readCookie2;
3660
+ }
3661
+ });
3662
+
3663
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/constants.js
3664
+ var require_constants2 = __commonJS({
3665
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/constants.js"(exports) {
3666
+ "use strict";
3667
+ init_define_process_env();
3668
+ Object.defineProperty(exports, "__esModule", { value: true });
3669
+ exports.DefaultCommonConfig = exports.BrandToHostMap = exports.HeadlessHost = exports.DefaultBrand = exports.EventContextMap = exports.BackofficeDomains = exports.LoggerVersion = void 0;
3670
+ exports.LoggerVersion = "2.0.985|C";
3671
+ exports.BackofficeDomains = [".wix.com", ".editorx.com"];
3672
+ var EventContextMap;
3673
+ (function(EventContextMap2) {
3674
+ EventContextMap2["msid"] = "_msid";
3675
+ EventContextMap2["clientId"] = "_client_id";
3676
+ EventContextMap2["uuid"] = "_uuid";
3677
+ EventContextMap2["visitorId"] = "_visitorId";
3678
+ EventContextMap2["siteMemberId"] = "_siteMemberId";
3679
+ EventContextMap2["brandId"] = "_brandId";
3680
+ EventContextMap2["siteBranchId"] = "_siteBranchId";
3681
+ EventContextMap2["ms"] = "_ms";
3682
+ EventContextMap2["lv"] = "_lv";
3683
+ EventContextMap2["isHeadless"] = "_isHeadless";
3684
+ EventContextMap2["hostingPlatform"] = "_hostingPlatform";
3685
+ })(EventContextMap = exports.EventContextMap || (exports.EventContextMap = {}));
3686
+ exports.DefaultBrand = "wix";
3687
+ exports.HeadlessHost = "VIEWER_HEADLESS";
3688
+ exports.BrandToHostMap = {
3689
+ wix: "wix",
3690
+ editorx: "editorx"
3691
+ };
3692
+ exports.DefaultCommonConfig = {
3693
+ brand: exports.DefaultBrand
3694
+ };
3695
+ }
3696
+ });
3697
+
3698
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/env.js
3699
+ var require_env2 = __commonJS({
3700
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/env.js"(exports) {
3701
+ "use strict";
3702
+ init_define_process_env();
3703
+ Object.defineProperty(exports, "__esModule", { value: true });
3704
+ exports.getGlobal = exports.getWindowIfTop = exports.isBackoffice = exports.isWebWorker = exports.getHost = exports.setHost = void 0;
3705
+ var constants_1 = require_constants2();
3706
+ var host;
3707
+ var hostByDomain;
3708
+ function setHost(_host) {
3709
+ host = _host;
3710
+ }
3711
+ exports.setHost = setHost;
3712
+ function getHost(brand) {
3713
+ if (brand === void 0) {
3714
+ brand = constants_1.DefaultBrand;
3715
+ }
3716
+ if (host) {
3717
+ return host;
3718
+ }
3719
+ var hostByDomainOrBrand = "";
3720
+ if (typeof hostByDomain === "undefined") {
3721
+ hostByDomain = getGlobal2(function(window2) {
3722
+ if (!window2.location || !window2.location.hostname) {
3723
+ return null;
3724
+ }
3725
+ var _a = window2.location.hostname.match(/\.(wix|editorx)\.com$/) || [], domain = _a[1];
3726
+ return domain || null;
3727
+ }, null);
3728
+ }
3729
+ hostByDomainOrBrand = hostByDomain || constants_1.BrandToHostMap[brand] || constants_1.BrandToHostMap[constants_1.DefaultBrand];
3730
+ return "frog.".concat(hostByDomainOrBrand, ".com");
3731
+ }
3732
+ exports.getHost = getHost;
3733
+ function isWebWorker2() {
3734
+ return typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope;
3735
+ }
3736
+ exports.isWebWorker = isWebWorker2;
3737
+ function isBackoffice() {
3738
+ return getWindowIfTop(function(_a) {
3739
+ var document2 = _a.document;
3740
+ return constants_1.BackofficeDomains.some(function(domain) {
3741
+ return document2.location.host.indexOf(domain) !== -1;
3742
+ });
3743
+ });
3744
+ }
3745
+ exports.isBackoffice = isBackoffice;
3746
+ function getWindowIfTop(cb) {
3747
+ if (typeof window !== "undefined" && window) {
3748
+ try {
3749
+ return window.top === window.self ? cb ? cb(window) : window : null;
3750
+ } catch (e) {
3751
+ return null;
3752
+ }
3753
+ }
3754
+ return null;
3755
+ }
3756
+ exports.getWindowIfTop = getWindowIfTop;
3757
+ function getGlobal2(cb, defaultValue) {
3758
+ if (defaultValue === void 0) {
3759
+ defaultValue = null;
3760
+ }
3761
+ if (typeof self !== "undefined" && self) {
3762
+ return cb(self) || defaultValue;
3763
+ }
3764
+ return defaultValue;
3765
+ }
3766
+ exports.getGlobal = getGlobal2;
3767
+ }
3768
+ });
3769
+
3770
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/utils.js
3771
+ var require_utils3 = __commonJS({
3772
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/utils.js"(exports) {
3773
+ "use strict";
3774
+ init_define_process_env();
3775
+ Object.defineProperty(exports, "__esModule", { value: true });
3776
+ exports.guid = exports.isDataProtocol = exports.buildBiUrl = exports.getCookies = void 0;
3777
+ var browser_1 = require_browser2();
3778
+ var env_1 = require_env2();
3779
+ var cacheKillerCounter = 0;
3780
+ function getCookies(params) {
3781
+ return Object.keys(params).reduce(function(res, param) {
3782
+ var _a = typeof params[param] === "string" ? { name: params[param] } : params[param], name = _a.name, _b = _a.transform, transform = _b === void 0 ? function(x) {
3783
+ return x;
3784
+ } : _b;
3785
+ var value = transform((0, browser_1.readCookie)(name));
3786
+ if (value) {
3787
+ res[param] = value;
3788
+ }
3789
+ return res;
3790
+ }, {});
3791
+ }
3792
+ exports.getCookies = getCookies;
3793
+ function buildBiUrl(_a, params, context) {
3794
+ var _b = _a.host, host = _b === void 0 ? "" : _b, _c = _a.endpoint, endpoint = _c === void 0 ? "" : _c;
3795
+ if (context === void 0) {
3796
+ context = {};
3797
+ }
3798
+ host = typeof host === "function" ? host() : host;
3799
+ host = host || (0, env_1.getHost)();
3800
+ endpoint = context.endpoint || endpoint;
3801
+ if (!context.useBatch) {
3802
+ params._ = "" + (/* @__PURE__ */ new Date()).getTime() + cacheKillerCounter++;
3803
+ }
3804
+ var pairs = context.useBatch ? [] : Object.keys(params).map(function(key) {
3805
+ return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(params[key]));
3806
+ }, []);
3807
+ var url = ["//".concat(host, "/").concat(endpoint)].concat(pairs.length ? pairs.join("&") : []).join("?");
3808
+ if (url.startsWith("//") && isDataProtocol()) {
3809
+ url = "https:" + url;
3810
+ }
3811
+ return url;
3812
+ }
3813
+ exports.buildBiUrl = buildBiUrl;
3814
+ function isDataProtocol() {
3815
+ return typeof window !== "undefined" && (window === null || window === void 0 ? void 0 : window.location.protocol) === "data:";
3816
+ }
3817
+ exports.isDataProtocol = isDataProtocol;
3818
+ function guid() {
3819
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
3820
+ var r = Math.random() * 16 | 0;
3821
+ var v = c === "x" ? r : r & 3 | 8;
3822
+ return v.toString(16);
3823
+ });
3824
+ }
3825
+ exports.guid = guid;
3826
+ }
3827
+ });
3828
+
3829
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/navigator.js
3830
+ var require_navigator = __commonJS({
3831
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/navigator.js"(exports) {
3832
+ "use strict";
3833
+ init_define_process_env();
3834
+ Object.defineProperty(exports, "__esModule", { value: true });
3835
+ exports.listen = void 0;
3836
+ var env_1 = require_env2();
3837
+ function hook(obj, fnName, cbHook) {
3838
+ if (!obj || !obj[fnName]) {
3839
+ return;
3840
+ }
3841
+ var original = obj[fnName];
3842
+ obj[fnName] = function() {
3843
+ cbHook.apply(null, arguments);
3844
+ return original.apply(obj, arguments);
3845
+ };
3846
+ }
3847
+ function onLoad(cb) {
3848
+ setTimeout(function() {
3849
+ return (0, env_1.getWindowIfTop)(function(window2) {
3850
+ return cb(window2.location.href);
3851
+ });
3852
+ });
3853
+ }
3854
+ function onPushState(cb) {
3855
+ (0, env_1.getWindowIfTop)(function(_a) {
3856
+ var history = _a.history;
3857
+ return ["pushState", "replaceState"].forEach(function(fnName) {
3858
+ hook(history, fnName, function(_, __, url) {
3859
+ return cb(url);
3860
+ });
3861
+ });
3862
+ });
3863
+ }
3864
+ function onPopState(cb) {
3865
+ (0, env_1.getWindowIfTop)(function(window2) {
3866
+ return window2.addEventListener("popstate", function() {
3867
+ return cb(window2.location.href);
3868
+ });
3869
+ });
3870
+ }
3871
+ function listen(cb) {
3872
+ (0, env_1.getWindowIfTop)(function(window2) {
3873
+ var fromUrl = window2.document.referrer;
3874
+ [onLoad, onPushState, onPopState].forEach(function(event) {
3875
+ return event(function(toUrl) {
3876
+ cb(fromUrl, toUrl);
3877
+ fromUrl = toUrl;
3878
+ });
3879
+ });
3880
+ });
3881
+ }
3882
+ exports.listen = listen;
3883
+ }
3884
+ });
3885
+
3886
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/tracker.js
3887
+ var require_tracker = __commonJS({
3888
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/tracker.js"(exports) {
3889
+ "use strict";
3890
+ init_define_process_env();
3891
+ Object.defineProperty(exports, "__esModule", { value: true });
3892
+ exports.track = void 0;
3893
+ var utils_1 = require_utils3();
3894
+ var navigator_1 = require_navigator();
3895
+ var env_1 = require_env2();
3896
+ var browser_1 = require_browser2();
3897
+ var IS_TRACKING = "__isTrackingPageViews__";
3898
+ var ENDPOINT = "p";
3899
+ var SOURCE = 19;
3900
+ var EVID = 3;
3901
+ function shouldTrack(force) {
3902
+ return force || !(0, env_1.isWebWorker)() && (0, env_1.isBackoffice)() && (0, env_1.getWindowIfTop)(function(window2) {
3903
+ return !window2[IS_TRACKING];
3904
+ });
3905
+ }
3906
+ function setIsTracking() {
3907
+ return (0, env_1.getWindowIfTop)(function(window2) {
3908
+ return window2[IS_TRACKING] = true;
3909
+ });
3910
+ }
3911
+ function getLogger(loggerFactory) {
3912
+ return loggerFactory({ endpoint: ENDPOINT }).updateDefaults({ src: SOURCE, evid: EVID, vsi: (0, utils_1.guid)() }).logger();
3913
+ }
3914
+ function trackBrowsingSession(loggerFactory) {
3915
+ var logger = getLogger(loggerFactory);
3916
+ var firstInSession = 1;
3917
+ (0, navigator_1.listen)(function(fromUrl, toUrl) {
3918
+ var _a = (0, env_1.getWindowIfTop)(function(window2) {
3919
+ return {
3920
+ sr: (0, browser_1.getDesktopSize)(window2),
3921
+ wr: (0, browser_1.getWindowSize)(window2)
3922
+ };
3923
+ }), sr = _a.sr, wr = _a.wr;
3924
+ logger.log({ from: fromUrl, to: toUrl, fis: firstInSession, sr, wr });
3925
+ firstInSession = 0;
3926
+ });
3927
+ }
3928
+ function track(loggerFactory, options) {
3929
+ if (options === void 0) {
3930
+ options = { force: false };
3931
+ }
3932
+ if (shouldTrack(options.force)) {
3933
+ setIsTracking();
3934
+ trackBrowsingSession(loggerFactory);
3935
+ }
3936
+ }
3937
+ exports.track = track;
3938
+ }
3939
+ });
3940
+
3941
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/errors.js
3942
+ var require_errors2 = __commonJS({
3943
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/errors.js"(exports) {
3944
+ "use strict";
3945
+ init_define_process_env();
3946
+ var __extends2 = exports && exports.__extends || /* @__PURE__ */ function() {
3947
+ var extendStatics = function(d, b) {
3948
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
3949
+ d2.__proto__ = b2;
3950
+ } || function(d2, b2) {
3951
+ for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
3952
+ };
3953
+ return extendStatics(d, b);
3954
+ };
3955
+ return function(d, b) {
3956
+ if (typeof b !== "function" && b !== null)
3957
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
3958
+ extendStatics(d, b);
3959
+ function __() {
3960
+ this.constructor = d;
3961
+ }
3962
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3963
+ };
3964
+ }();
3965
+ Object.defineProperty(exports, "__esModule", { value: true });
3966
+ exports.APINotSupportedError = exports.AssertionError = void 0;
3967
+ var AssertionError = (
3968
+ /** @class */
3969
+ function(_super) {
3970
+ __extends2(AssertionError2, _super);
3971
+ function AssertionError2(message) {
3972
+ var _this = _super.call(this, message) || this;
3973
+ _this.name = _this.constructor.name;
3974
+ return _this;
3975
+ }
3976
+ return AssertionError2;
3977
+ }(Error)
3978
+ );
3979
+ exports.AssertionError = AssertionError;
3980
+ var APINotSupportedError = (
3981
+ /** @class */
3982
+ function(_super) {
3983
+ __extends2(APINotSupportedError2, _super);
3984
+ function APINotSupportedError2(message) {
3985
+ var _this = _super.call(this, message) || this;
3986
+ _this.name = _this.constructor.name;
3987
+ return _this;
3988
+ }
3989
+ return APINotSupportedError2;
3990
+ }(Error)
3991
+ );
3992
+ exports.APINotSupportedError = APINotSupportedError;
2936
3993
  }
2937
3994
  });
2938
3995
 
2939
- // ../../node_modules/@wix/web-bi-logger/dist/src/lib/utils.js
2940
- var require_utils2 = __commonJS({
2941
- "../../node_modules/@wix/web-bi-logger/dist/src/lib/utils.js"(exports) {
3996
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/assert.js
3997
+ var require_assert3 = __commonJS({
3998
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/assert.js"(exports) {
2942
3999
  "use strict";
2943
4000
  init_define_process_env();
2944
4001
  Object.defineProperty(exports, "__esModule", { value: true });
2945
- exports.guid = exports.buildBiUrl = exports.getCookies = void 0;
2946
- var browser_1 = require_browser();
2947
- var env_1 = require_env();
2948
- var cacheKillerCounter = 0;
2949
- function getCookies(params) {
2950
- return Object.keys(params).reduce(function(res, param) {
2951
- var _a = typeof params[param] === "string" ? { name: params[param] } : params[param], name = _a.name, _b = _a.transform, transform = _b === void 0 ? function(x) {
2952
- return x;
2953
- } : _b;
2954
- var value = transform((0, browser_1.readCookie)(name));
2955
- if (value) {
2956
- res[param] = value;
2957
- }
2958
- return res;
2959
- }, {});
2960
- }
2961
- exports.getCookies = getCookies;
2962
- function buildBiUrl(_a, params, context) {
2963
- var _b = _a.host, host = _b === void 0 ? "" : _b, _c = _a.endpoint, endpoint = _c === void 0 ? "" : _c;
2964
- if (context === void 0) {
2965
- context = {};
4002
+ exports.ok = exports.object = exports.defined = void 0;
4003
+ var errors_1 = require_errors2();
4004
+ var defined = function(target, message) {
4005
+ if (target === void 0) {
4006
+ throw new errors_1.AssertionError(message);
2966
4007
  }
2967
- host = typeof host === "function" ? host() : host;
2968
- host = host || (0, env_1.getHost)();
2969
- endpoint = context.endpoint || endpoint;
2970
- if (!context.useBatch) {
2971
- params._ = "" + (/* @__PURE__ */ new Date()).getTime() + cacheKillerCounter++;
4008
+ };
4009
+ exports.defined = defined;
4010
+ var object = function(target, message) {
4011
+ if (target !== void 0 && (typeof target !== "object" || Array.isArray(target) || target === null)) {
4012
+ throw new errors_1.AssertionError(message);
2972
4013
  }
2973
- var pairs = context.useBatch ? [] : Object.keys(params).map(function(key) {
2974
- return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(params[key]));
2975
- }, []);
2976
- return ["//".concat(host, "/").concat(endpoint)].concat(pairs.length ? pairs.join("&") : []).join("?");
2977
- }
2978
- exports.buildBiUrl = buildBiUrl;
2979
- function guid() {
2980
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
2981
- var r = Math.random() * 16 | 0;
2982
- var v = c === "x" ? r : r & 3 | 8;
2983
- return v.toString(16);
2984
- });
2985
- }
2986
- exports.guid = guid;
4014
+ };
4015
+ exports.object = object;
4016
+ var ok = function(target, message) {
4017
+ if (!target) {
4018
+ throw new errors_1.AssertionError(message);
4019
+ }
4020
+ };
4021
+ exports.ok = ok;
2987
4022
  }
2988
4023
  });
2989
4024
 
2990
- // ../../node_modules/@wix/web-bi-logger/dist/src/types.js
2991
- var require_types = __commonJS({
2992
- "../../node_modules/@wix/web-bi-logger/dist/src/types.js"(exports) {
4025
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/types.js
4026
+ var require_types2 = __commonJS({
4027
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/types.js"(exports) {
2993
4028
  "use strict";
2994
4029
  init_define_process_env();
2995
4030
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -3013,15 +4048,15 @@ var require_types = __commonJS({
3013
4048
  }
3014
4049
  });
3015
4050
 
3016
- // ../../node_modules/@wix/web-bi-logger/dist/src/lib/transport.js
3017
- var require_transport = __commonJS({
3018
- "../../node_modules/@wix/web-bi-logger/dist/src/lib/transport.js"(exports) {
4051
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/transport.js
4052
+ var require_transport2 = __commonJS({
4053
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/transport.js"(exports) {
3019
4054
  "use strict";
3020
4055
  init_define_process_env();
3021
4056
  Object.defineProperty(exports, "__esModule", { value: true });
3022
4057
  exports.postMessageTransport = exports.xhrTransport = exports.fetchTransport = exports.pixelTransport = exports.beaconTransport = void 0;
3023
- var browser_1 = require_browser();
3024
- var errors_1 = require_errors();
4058
+ var browser_1 = require_browser2();
4059
+ var errors_1 = require_errors2();
3025
4060
  function beaconTransport(url, params, sendInBody) {
3026
4061
  if (sendInBody === void 0) {
3027
4062
  sendInBody = false;
@@ -3104,13 +4139,13 @@ var require_transport = __commonJS({
3104
4139
  }
3105
4140
  });
3106
4141
 
3107
- // ../../node_modules/@wix/web-bi-logger/dist/src/lib/publishers.js
3108
- var require_publishers = __commonJS({
3109
- "../../node_modules/@wix/web-bi-logger/dist/src/lib/publishers.js"(exports) {
4142
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/publishers.js
4143
+ var require_publishers2 = __commonJS({
4144
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/publishers.js"(exports) {
3110
4145
  "use strict";
3111
4146
  init_define_process_env();
3112
- var __assign3 = exports && exports.__assign || function() {
3113
- __assign3 = Object.assign || function(t) {
4147
+ var __assign4 = exports && exports.__assign || function() {
4148
+ __assign4 = Object.assign || function(t) {
3114
4149
  for (var s, i = 1, n = arguments.length; i < n; i++) {
3115
4150
  s = arguments[i];
3116
4151
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -3118,7 +4153,7 @@ var require_publishers = __commonJS({
3118
4153
  }
3119
4154
  return t;
3120
4155
  };
3121
- return __assign3.apply(this, arguments);
4156
+ return __assign4.apply(this, arguments);
3122
4157
  };
3123
4158
  var __rest = exports && exports.__rest || function(s, e) {
3124
4159
  var t = {};
@@ -3133,11 +4168,11 @@ var require_publishers = __commonJS({
3133
4168
  };
3134
4169
  Object.defineProperty(exports, "__esModule", { value: true });
3135
4170
  exports.getTransformers = exports.getPublisher = exports.postMessagePublisher = exports.xhrPublisher = exports.fetchPublisher = exports.beaconPublisher = exports.imagePublisher = exports.resolvePublisher = void 0;
3136
- var utils_1 = require_utils2();
3137
- var env_1 = require_env();
3138
- var errors_1 = require_errors();
3139
- var types_1 = require_types();
3140
- var transport_1 = require_transport();
4171
+ var utils_1 = require_utils3();
4172
+ var env_1 = require_env2();
4173
+ var errors_1 = require_errors2();
4174
+ var types_1 = require_types2();
4175
+ var transport_1 = require_transport2();
3141
4176
  var getHttpMethod = function(context) {
3142
4177
  return context.useBatch ? "POST" : "GET";
3143
4178
  };
@@ -3252,7 +4287,7 @@ var require_publishers = __commonJS({
3252
4287
  };
3253
4288
  params.e = params.e.map(function(e) {
3254
4289
  var context = e.context, event = __rest(e, ["context"]);
3255
- var res = __assign3(__assign3({}, event), { f: __assign3(__assign3({}, event.f), { _rp: getEndpoint_1(context) }) });
4290
+ var res = __assign4(__assign4({}, event), { f: __assign4(__assign4({}, event.f), { _rp: getEndpoint_1(context) }) });
3256
4291
  return res;
3257
4292
  });
3258
4293
  }
@@ -3264,15 +4299,15 @@ var require_publishers = __commonJS({
3264
4299
  }
3265
4300
  });
3266
4301
 
3267
- // ../../node_modules/@wix/web-bi-logger/dist/src/lib/common-config.js
3268
- var require_common_config = __commonJS({
3269
- "../../node_modules/@wix/web-bi-logger/dist/src/lib/common-config.js"(exports) {
4302
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/common-config.js
4303
+ var require_common_config2 = __commonJS({
4304
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/common-config.js"(exports) {
3270
4305
  "use strict";
3271
4306
  init_define_process_env();
3272
4307
  Object.defineProperty(exports, "__esModule", { value: true });
3273
4308
  exports.getWixHost = exports.getBranchId = exports.getBrand = exports.getCommonConfigValue = void 0;
3274
- var env_1 = require_env();
3275
- var constants_1 = require_constants();
4309
+ var env_1 = require_env2();
4310
+ var constants_1 = require_constants2();
3276
4311
  var resolveCommonConfig = function() {
3277
4312
  return (0, env_1.getGlobal)(function(g) {
3278
4313
  return g.Wix && g.Wix.Utils && g.Wix.Utils.commonConfig || g.commonConfig;
@@ -3304,17 +4339,17 @@ var require_common_config = __commonJS({
3304
4339
  }
3305
4340
  });
3306
4341
 
3307
- // ../../node_modules/@wix/web-bi-logger/dist/src/lib/event-defaults.js
3308
- var require_event_defaults = __commonJS({
3309
- "../../node_modules/@wix/web-bi-logger/dist/src/lib/event-defaults.js"(exports) {
4342
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/event-defaults.js
4343
+ var require_event_defaults2 = __commonJS({
4344
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/lib/event-defaults.js"(exports) {
3310
4345
  "use strict";
3311
4346
  init_define_process_env();
3312
4347
  Object.defineProperty(exports, "__esModule", { value: true });
3313
4348
  exports.getCommonDefaults = exports.getUserDefaults = exports.transformDefaults = void 0;
3314
- var constants_1 = require_constants();
3315
- var browser_1 = require_browser();
3316
- var common_config_1 = require_common_config();
3317
- var utils_1 = require_utils2();
4349
+ var constants_1 = require_constants2();
4350
+ var browser_1 = require_browser2();
4351
+ var common_config_1 = require_common_config2();
4352
+ var utils_1 = require_utils3();
3318
4353
  var transformDefaults = function(context) {
3319
4354
  return Object.keys(context).reduce(function(res, key) {
3320
4355
  var mappedKey = constants_1.EventContextMap[key] || key;
@@ -3362,13 +4397,13 @@ var require_event_defaults = __commonJS({
3362
4397
  }
3363
4398
  });
3364
4399
 
3365
- // ../../node_modules/@wix/web-bi-logger/dist/src/logger.js
3366
- var require_logger = __commonJS({
3367
- "../../node_modules/@wix/web-bi-logger/dist/src/logger.js"(exports) {
4400
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/logger.js
4401
+ var require_logger2 = __commonJS({
4402
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/logger.js"(exports) {
3368
4403
  "use strict";
3369
4404
  init_define_process_env();
3370
- var __assign3 = exports && exports.__assign || function() {
3371
- __assign3 = Object.assign || function(t) {
4405
+ var __assign4 = exports && exports.__assign || function() {
4406
+ __assign4 = Object.assign || function(t) {
3372
4407
  for (var s, i = 1, n = arguments.length; i < n; i++) {
3373
4408
  s = arguments[i];
3374
4409
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
@@ -3376,7 +4411,7 @@ var require_logger = __commonJS({
3376
4411
  }
3377
4412
  return t;
3378
4413
  };
3379
- return __assign3.apply(this, arguments);
4414
+ return __assign4.apply(this, arguments);
3380
4415
  };
3381
4416
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
3382
4417
  if (k2 === void 0) k2 = k;
@@ -3409,20 +4444,20 @@ var require_logger = __commonJS({
3409
4444
  exports.BiLoggerClientFactory = exports.createBatchQueue = exports.manager = exports.factory = exports.Factory = exports.setHost = exports.EventCategories = exports.PublishMethods = void 0;
3410
4445
  var wix_bi_logger_client_1 = require_dist();
3411
4446
  var consent_policy_client_accessor_1 = (init_src(), __toCommonJS(src_exports));
3412
- var assert = __importStar(require_assert2());
3413
- var publishers_1 = require_publishers();
3414
- var common_config_1 = require_common_config();
3415
- var env_1 = require_env();
3416
- var types_1 = require_types();
3417
- var event_defaults_1 = require_event_defaults();
3418
- var types_2 = require_types();
4447
+ var assert = __importStar(require_assert3());
4448
+ var publishers_1 = require_publishers2();
4449
+ var common_config_1 = require_common_config2();
4450
+ var env_1 = require_env2();
4451
+ var types_1 = require_types2();
4452
+ var event_defaults_1 = require_event_defaults2();
4453
+ var types_2 = require_types2();
3419
4454
  Object.defineProperty(exports, "PublishMethods", { enumerable: true, get: function() {
3420
4455
  return types_2.PublishMethods;
3421
4456
  } });
3422
4457
  Object.defineProperty(exports, "EventCategories", { enumerable: true, get: function() {
3423
4458
  return types_2.EventCategories;
3424
4459
  } });
3425
- var env_2 = require_env();
4460
+ var env_2 = require_env2();
3426
4461
  Object.defineProperty(exports, "setHost", { enumerable: true, get: function() {
3427
4462
  return env_2.setHost;
3428
4463
  } });
@@ -3452,7 +4487,7 @@ var require_logger = __commonJS({
3452
4487
  this.initialized = true;
3453
4488
  this.updateDefaults((0, event_defaults_1.getCommonDefaults)(this.commonConfigGetter, Factory2.consentPolicyAccessor));
3454
4489
  this.withUserContext((0, event_defaults_1.getUserDefaults)());
3455
- var options = __assign3(__assign3({}, this.options), { host: this.options.host || function() {
4490
+ var options = __assign4(__assign4({}, this.options), { host: this.options.host || function() {
3456
4491
  return (0, env_1.getHost)((0, common_config_1.getBrand)(_this.commonConfigGetter));
3457
4492
  } });
3458
4493
  var publisher = (0, publishers_1.getPublisher)(options, this.publishFunctions);
@@ -3527,7 +4562,7 @@ var require_logger = __commonJS({
3527
4562
  options = {};
3528
4563
  }
3529
4564
  var _a = this.options, endpoint = _a.endpoint, useBatch = _a.useBatch;
3530
- var logger = this.initFactory().logger(__assign3({ endpoint, useBatch }, options));
4565
+ var logger = this.initFactory().logger(__assign4({ endpoint, useBatch }, options));
3531
4566
  return logger;
3532
4567
  };
3533
4568
  return Factory2;
@@ -3547,121 +4582,9 @@ var require_logger = __commonJS({
3547
4582
  }
3548
4583
  });
3549
4584
 
3550
- // ../../node_modules/@wix/web-bi-logger/dist/src/lib/navigator.js
3551
- var require_navigator = __commonJS({
3552
- "../../node_modules/@wix/web-bi-logger/dist/src/lib/navigator.js"(exports) {
3553
- "use strict";
3554
- init_define_process_env();
3555
- Object.defineProperty(exports, "__esModule", { value: true });
3556
- exports.listen = void 0;
3557
- var env_1 = require_env();
3558
- function hook(obj, fnName, cbHook) {
3559
- if (!obj || !obj[fnName]) {
3560
- return;
3561
- }
3562
- var original = obj[fnName];
3563
- obj[fnName] = function() {
3564
- cbHook.apply(null, arguments);
3565
- return original.apply(obj, arguments);
3566
- };
3567
- }
3568
- function onLoad(cb) {
3569
- setTimeout(function() {
3570
- return (0, env_1.getWindowIfTop)(function(window2) {
3571
- return cb(window2.location.href);
3572
- });
3573
- });
3574
- }
3575
- function onPushState(cb) {
3576
- (0, env_1.getWindowIfTop)(function(_a) {
3577
- var history = _a.history;
3578
- return ["pushState", "replaceState"].forEach(function(fnName) {
3579
- hook(history, fnName, function(_, __, url) {
3580
- return cb(url);
3581
- });
3582
- });
3583
- });
3584
- }
3585
- function onPopState(cb) {
3586
- (0, env_1.getWindowIfTop)(function(window2) {
3587
- return window2.addEventListener("popstate", function() {
3588
- return cb(window2.location.href);
3589
- });
3590
- });
3591
- }
3592
- function listen(cb) {
3593
- (0, env_1.getWindowIfTop)(function(window2) {
3594
- var fromUrl = window2.document.referrer;
3595
- [onLoad, onPushState, onPopState].forEach(function(event) {
3596
- return event(function(toUrl) {
3597
- cb(fromUrl, toUrl);
3598
- fromUrl = toUrl;
3599
- });
3600
- });
3601
- });
3602
- }
3603
- exports.listen = listen;
3604
- }
3605
- });
3606
-
3607
- // ../../node_modules/@wix/web-bi-logger/dist/src/lib/tracker.js
3608
- var require_tracker = __commonJS({
3609
- "../../node_modules/@wix/web-bi-logger/dist/src/lib/tracker.js"(exports) {
3610
- "use strict";
3611
- init_define_process_env();
3612
- Object.defineProperty(exports, "__esModule", { value: true });
3613
- exports.track = void 0;
3614
- var utils_1 = require_utils2();
3615
- var navigator_1 = require_navigator();
3616
- var env_1 = require_env();
3617
- var browser_1 = require_browser();
3618
- var IS_TRACKING = "__isTrackingPageViews__";
3619
- var ENDPOINT = "p";
3620
- var SOURCE = 19;
3621
- var EVID = 3;
3622
- function shouldTrack(force) {
3623
- return force || !(0, env_1.isWebWorker)() && (0, env_1.isBackoffice)() && (0, env_1.getWindowIfTop)(function(window2) {
3624
- return !window2[IS_TRACKING];
3625
- });
3626
- }
3627
- function setIsTracking() {
3628
- return (0, env_1.getWindowIfTop)(function(window2) {
3629
- return window2[IS_TRACKING] = true;
3630
- });
3631
- }
3632
- function getLogger(loggerFactory) {
3633
- return loggerFactory({ endpoint: ENDPOINT }).updateDefaults({ src: SOURCE, evid: EVID, vsi: (0, utils_1.guid)() }).logger();
3634
- }
3635
- function trackBrowsingSession(loggerFactory) {
3636
- var logger = getLogger(loggerFactory);
3637
- var firstInSession = 1;
3638
- (0, navigator_1.listen)(function(fromUrl, toUrl) {
3639
- var _a = (0, env_1.getWindowIfTop)(function(window2) {
3640
- return {
3641
- sr: (0, browser_1.getDesktopSize)(window2),
3642
- wr: (0, browser_1.getWindowSize)(window2)
3643
- };
3644
- }), sr = _a.sr, wr = _a.wr;
3645
- logger.log({ from: fromUrl, to: toUrl, fis: firstInSession, sr, wr });
3646
- firstInSession = 0;
3647
- });
3648
- }
3649
- function track(loggerFactory, options) {
3650
- if (options === void 0) {
3651
- options = { force: false };
3652
- }
3653
- if (shouldTrack(options.force)) {
3654
- setIsTracking();
3655
- trackBrowsingSession(loggerFactory);
3656
- }
3657
- }
3658
- exports.track = track;
3659
- }
3660
- });
3661
-
3662
- // ../../node_modules/@wix/web-bi-logger/dist/src/tracking-logger.js
4585
+ // ../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/tracking-logger.js
3663
4586
  var require_tracking_logger = __commonJS({
3664
- "../../node_modules/@wix/web-bi-logger/dist/src/tracking-logger.js"(exports) {
4587
+ "../../node_modules/@wix/fe-essentials/node_modules/@wix/web-bi-logger/dist/src/tracking-logger.js"(exports) {
3665
4588
  "use strict";
3666
4589
  init_define_process_env();
3667
4590
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
@@ -3695,7 +4618,7 @@ var require_tracking_logger = __commonJS({
3695
4618
  exports.BiLoggerClientFactory = exports.EventCategories = exports.createBatchQueue = exports.manager = exports.setHost = exports.factory = void 0;
3696
4619
  var wix_bi_logger_client_1 = require_dist();
3697
4620
  var tracker = __importStar(require_tracker());
3698
- var logger = __importStar(require_logger());
4621
+ var logger = __importStar(require_logger2());
3699
4622
  var factory2 = function(options) {
3700
4623
  if (options === void 0) {
3701
4624
  options = {};
@@ -4149,6 +5072,12 @@ function getInstanceIdFromSignedInstance(signedInstance) {
4149
5072
  }
4150
5073
  }
4151
5074
 
5075
+ // ../../node_modules/@wix/headers/dist/esm/headers/currency.js
5076
+ init_define_process_env();
5077
+ function currencyHeader(currency) {
5078
+ return { "x-wix-currency": currency };
5079
+ }
5080
+
4152
5081
  // ../../node_modules/@wix/headers/dist/esm/assert.js
4153
5082
  init_define_process_env();
4154
5083
 
@@ -4185,7 +5114,8 @@ function createHeaders(opts = {}) {
4185
5114
  linguistHeader({
4186
5115
  signedInstance: opts.signedInstance,
4187
5116
  ...opts.multilingualOptions
4188
- })
5117
+ }),
5118
+ currencyHeader(opts.currency)
4189
5119
  ];
4190
5120
  if (opts.csrf) {
4191
5121
  headers.push(csrf());
@@ -4485,6 +5415,9 @@ function getFallbackRequestOptions(fallbackRequests) {
4485
5415
 
4486
5416
  // ../../node_modules/@wix/fe-essentials/node_modules/@wix/http-client/dist/es/src/http-client.js
4487
5417
  var HttpClient = class {
5418
+ static isHttpError(payload) {
5419
+ return !!(payload === null || payload === void 0 ? void 0 : payload.isWixHttpError);
5420
+ }
4488
5421
  constructor(opts = {}) {
4489
5422
  this.opts = opts;
4490
5423
  this.opts = defaultClientOptions(this.opts);
@@ -4493,9 +5426,6 @@ var HttpClient = class {
4493
5426
  sanitizerPocEnabled: checkSanitizerPocEnabled()
4494
5427
  };
4495
5428
  }
4496
- static isHttpError(payload) {
4497
- return !!(payload === null || payload === void 0 ? void 0 : payload.isWixHttpError);
4498
- }
4499
5429
  setErrorHandler(errorHandler) {
4500
5430
  this.opts.errorHandler = errorHandler;
4501
5431
  }
@@ -4570,6 +5500,7 @@ var HttpClient = class {
4570
5500
  return import_axios.default.isCancel;
4571
5501
  }
4572
5502
  getHeaders(requestOptions, signedInstance, urlObject) {
5503
+ var _a, _b;
4573
5504
  if (typeof this.opts.createHeaders === "function") {
4574
5505
  return this.getCustomHeaders(requestOptions, signedInstance, urlObject);
4575
5506
  }
@@ -4577,7 +5508,8 @@ var HttpClient = class {
4577
5508
  signedInstance,
4578
5509
  artifactId: this.opts.artifactId,
4579
5510
  csrf: false,
4580
- multilingualOptions: this.opts.multilingualOptions
5511
+ multilingualOptions: this.opts.multilingualOptions,
5512
+ currency: (_b = (_a = this.opts).getCurrency) === null || _b === void 0 ? void 0 : _b.call(_a)
4581
5513
  };
4582
5514
  return buildAllHeaders(requestOptions, wixHeadersOpts, getGlobalConfig(), urlObject);
4583
5515
  }
@@ -5620,7 +6552,7 @@ var translationsImportsMap = {
5620
6552
  ))),
5621
6553
  hi: () => Promise.resolve().then(() => __toESM(__require(
5622
6554
  /* webpackChunkName: "common-errors_hi-json" */
5623
- "./common-errors_hi-UKK4LODD.mjs"
6555
+ "./common-errors_hi-P2YUYYLM.mjs"
5624
6556
  ))),
5625
6557
  hr: () => Promise.resolve().then(() => __toESM(__require(
5626
6558
  /* webpackChunkName: "common-errors_hr-json" */
@@ -5640,7 +6572,7 @@ var translationsImportsMap = {
5640
6572
  ))),
5641
6573
  ja: () => Promise.resolve().then(() => __toESM(__require(
5642
6574
  /* webpackChunkName: "common-errors_ja-json" */
5643
- "./common-errors_ja-OOUHZN3G.mjs"
6575
+ "./common-errors_ja-MS5PSRSC.mjs"
5644
6576
  ))),
5645
6577
  ko: () => Promise.resolve().then(() => __toESM(__require(
5646
6578
  /* webpackChunkName: "common-errors_ko-json" */
@@ -5708,7 +6640,7 @@ var translationsImportsMap = {
5708
6640
  ))),
5709
6641
  uk: () => Promise.resolve().then(() => __toESM(__require(
5710
6642
  /* webpackChunkName: "common-errors_uk-json" */
5711
- "./common-errors_uk-TGSY773Q.mjs"
6643
+ "./common-errors_uk-G7XUMV2H.mjs"
5712
6644
  ))),
5713
6645
  vi: () => Promise.resolve().then(() => __toESM(__require(
5714
6646
  /* webpackChunkName: "common-errors_vi-json" */
@@ -5808,10 +6740,9 @@ init_define_process_env();
5808
6740
  // ../../node_modules/@wix/error-handler/node_modules/uuid/dist/esm-browser/stringify.js
5809
6741
  init_define_process_env();
5810
6742
  var byteToHex = [];
5811
- for (i = 0; i < 256; ++i) {
6743
+ for (let i = 0; i < 256; ++i) {
5812
6744
  byteToHex.push((i + 256).toString(16).slice(1));
5813
6745
  }
5814
- var i;
5815
6746
  function unsafeStringify(arr2, offset = 0) {
5816
6747
  return (byteToHex[arr2[offset + 0]] + byteToHex[arr2[offset + 1]] + byteToHex[arr2[offset + 2]] + byteToHex[arr2[offset + 3]] + "-" + byteToHex[arr2[offset + 4]] + byteToHex[arr2[offset + 5]] + "-" + byteToHex[arr2[offset + 6]] + byteToHex[arr2[offset + 7]] + "-" + byteToHex[arr2[offset + 8]] + byteToHex[arr2[offset + 9]] + "-" + byteToHex[arr2[offset + 10]] + byteToHex[arr2[offset + 11]] + byteToHex[arr2[offset + 12]] + byteToHex[arr2[offset + 13]] + byteToHex[arr2[offset + 14]] + byteToHex[arr2[offset + 15]]).toLowerCase();
5817
6748
  }
@@ -5822,10 +6753,10 @@ var getRandomValues;
5822
6753
  var rnds8 = new Uint8Array(16);
5823
6754
  function rng() {
5824
6755
  if (!getRandomValues) {
5825
- getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
5826
- if (!getRandomValues) {
6756
+ if (typeof crypto === "undefined" || !crypto.getRandomValues) {
5827
6757
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
5828
6758
  }
6759
+ getRandomValues = crypto.getRandomValues.bind(crypto);
5829
6760
  }
5830
6761
  return getRandomValues(rnds8);
5831
6762
  }
@@ -5836,22 +6767,27 @@ init_define_process_env();
5836
6767
  // ../../node_modules/@wix/error-handler/node_modules/uuid/dist/esm-browser/native.js
5837
6768
  init_define_process_env();
5838
6769
  var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
5839
- var native_default = {
5840
- randomUUID
5841
- };
6770
+ var native_default = { randomUUID };
5842
6771
 
5843
6772
  // ../../node_modules/@wix/error-handler/node_modules/uuid/dist/esm-browser/v4.js
5844
6773
  function v4(options, buf, offset) {
6774
+ var _a, _b, _c;
5845
6775
  if (native_default.randomUUID && !buf && !options) {
5846
6776
  return native_default.randomUUID();
5847
6777
  }
5848
6778
  options = options || {};
5849
- var rnds = options.random || (options.rng || rng)();
6779
+ const rnds = (_c = (_b = options.random) != null ? _b : (_a = options.rng) == null ? void 0 : _a.call(options)) != null ? _c : rng();
6780
+ if (rnds.length < 16) {
6781
+ throw new Error("Random bytes length must be >= 16");
6782
+ }
5850
6783
  rnds[6] = rnds[6] & 15 | 64;
5851
6784
  rnds[8] = rnds[8] & 63 | 128;
5852
6785
  if (buf) {
5853
6786
  offset = offset || 0;
5854
- for (var i = 0; i < 16; ++i) {
6787
+ if (offset < 0 || offset + 16 > buf.length) {
6788
+ throw new RangeError("UUID byte range ".concat(offset, ":").concat(offset + 15, " is out of buffer bounds"));
6789
+ }
6790
+ for (let i = 0; i < 16; ++i) {
5855
6791
  buf[offset + i] = rnds[i];
5856
6792
  }
5857
6793
  return buf;
@@ -6336,12 +7272,12 @@ init_define_process_env();
6336
7272
 
6337
7273
  // ../../node_modules/@wix/wix-experiments/dist/es/src/experiments.js
6338
7274
  init_define_process_env();
6339
- import { __assign as __assign2, __extends } from "tslib";
7275
+ import { __assign as __assign3, __extends } from "tslib";
6340
7276
 
6341
7277
  // ../../node_modules/@wix/wix-experiments/dist/es/src/base-url.js
6342
7278
  init_define_process_env();
6343
7279
  function baseUrl(isNewApi, maybeBaseUrl) {
6344
- var maybeTestkitUrl = define_process_env_default.NODE_ENV === "test" && isNewApi && "http://localhost:5700";
7280
+ var maybeTestkitUrl = define_process_env_default.NODE_ENV === "test" && isNewApi && define_process_env_default.EXPERIMENTS_TESTKIT_URL;
6345
7281
  return maybeBaseUrl || maybeTestkitUrl || "";
6346
7282
  }
6347
7283
 
@@ -6410,19 +7346,19 @@ var isNonEmptyString = function(value) {
6410
7346
  };
6411
7347
  var buildForSiteOwnerQuery = function(forSiteOwner) {
6412
7348
  if (isNonEmptyString(forSiteOwner.loggedInUserId) && isNonEmptyString(forSiteOwner.siteOwnerId)) {
6413
- return "&" + ("requestContext.forSiteOwner.loggedInUserId=" + forSiteOwner.loggedInUserId + "&") + ("requestContext.forSiteOwner.siteOwnerId=" + forSiteOwner.siteOwnerId);
7349
+ return "&" + "requestContext.forSiteOwner.loggedInUserId=".concat(forSiteOwner.loggedInUserId, "&") + "requestContext.forSiteOwner.siteOwnerId=".concat(forSiteOwner.siteOwnerId);
6414
7350
  }
6415
7351
  return "";
6416
7352
  };
6417
7353
  var buildForSiteVisitorsQuery = function(forSiteVisitors) {
6418
7354
  if (isNonEmptyString(forSiteVisitors.visitorId) && isNonEmptyString(forSiteVisitors.siteOwnerId)) {
6419
- return "&" + ("requestContext.forSiteVisitors.visitorId=" + forSiteVisitors.visitorId + "&") + ("requestContext.forSiteVisitors.siteOwnerId=" + forSiteVisitors.siteOwnerId);
7355
+ return "&" + "requestContext.forSiteVisitors.visitorId=".concat(forSiteVisitors.visitorId, "&") + "requestContext.forSiteVisitors.siteOwnerId=".concat(forSiteVisitors.siteOwnerId);
6420
7356
  }
6421
7357
  return "";
6422
7358
  };
6423
7359
  var buildOverrideCriteriaQuery = function(overrideCriteria) {
6424
7360
  if (isNonEmptyString(overrideCriteria.entityId)) {
6425
- return "&requestContext.overrideCriteria.entityId=" + overrideCriteria.entityId;
7361
+ return "&requestContext.overrideCriteria.entityId=".concat(overrideCriteria.entityId);
6426
7362
  }
6427
7363
  return "";
6428
7364
  };
@@ -6485,7 +7421,7 @@ var getAllInScopePath = function(scope, useNewApi) {
6485
7421
  if (useNewApi === void 0) {
6486
7422
  useNewApi = false;
6487
7423
  }
6488
- var urlApi = useNewApi ? petriUrlMap.new.conductAllInScope + "?scope=" + encodeURIComponent(scope) : petriUrlMap.old.conductAllInScope + "?scope=" + encodeURIComponent(scope);
7424
+ var urlApi = useNewApi ? "".concat(petriUrlMap.new.conductAllInScope, "?scope=").concat(encodeURIComponent(scope)) : "".concat(petriUrlMap.old.conductAllInScope, "?scope=").concat(encodeURIComponent(scope));
6489
7425
  return urlApi;
6490
7426
  };
6491
7427
  function isValidScopeUrl(url, useNewApi) {
@@ -6501,11 +7437,11 @@ var getExperimentPath = function(key, fallback, useNewApi) {
6501
7437
  if (useNewApi === void 0) {
6502
7438
  useNewApi = false;
6503
7439
  }
6504
- var urlApi = useNewApi ? petriUrlMap.new.conductExperiment + "?key=" + encodeURIComponent(key) + "&fallbackValue=" + encodeURIComponent(fallback) : petriUrlMap.old.conductExperiment + "?key=" + encodeURIComponent(key) + "&fallback=" + encodeURIComponent(fallback);
7440
+ var urlApi = useNewApi ? "".concat(petriUrlMap.new.conductExperiment, "?key=").concat(encodeURIComponent(key), "&fallbackValue=").concat(encodeURIComponent(fallback)) : "".concat(petriUrlMap.old.conductExperiment, "?key=").concat(encodeURIComponent(key), "&fallback=").concat(encodeURIComponent(fallback));
6505
7441
  return urlApi;
6506
7442
  };
6507
7443
  function isUrlOfExperiment(url, specName, useNewApi) {
6508
- var pattern = "" + getExperimentPath(specName, "", useNewApi);
7444
+ var pattern = "".concat(getExperimentPath(specName, "", useNewApi));
6509
7445
  return url.includes(pattern);
6510
7446
  }
6511
7447
 
@@ -6606,21 +7542,28 @@ function getCacheInstance() {
6606
7542
 
6607
7543
  // ../../node_modules/@wix/wix-experiments/dist/es/src/http-request.js
6608
7544
  init_define_process_env();
6609
- function httpRequest(url) {
7545
+ import { __assign as __assign2 } from "tslib";
7546
+ function httpRequest(url, signedInstance) {
6610
7547
  return new Promise(function(resolve, reject) {
7548
+ var headers = createHeaders({ signedInstance: signedInstance || "" });
6611
7549
  var xhr = new XMLHttpRequest();
6612
7550
  xhr.open("GET", url, true);
7551
+ Object.keys(headers).forEach(function(key) {
7552
+ return xhr.setRequestHeader(key, headers[key]);
7553
+ });
6613
7554
  xhr.responseType = "text";
6614
7555
  xhr.withCredentials = true;
6615
7556
  xhr.onload = function() {
6616
7557
  if (xhr.status >= 200 && xhr.status < 400) {
6617
7558
  resolve(xhr.responseText);
6618
7559
  } else {
6619
- reject(new Error("Failed to load " + url + ", status " + xhr.status));
7560
+ reject(new Error("Failed to load ".concat(url, ", status ").concat(xhr.status)));
6620
7561
  }
6621
7562
  };
6622
7563
  xhr.onerror = function() {
6623
- return reject(new Error("Failed to load " + url));
7564
+ var _a;
7565
+ var loggableHeaders = "authorization" in headers ? __assign2(__assign2({}, headers), { authorization: "<redacted>" }) : headers;
7566
+ reject(new Error("Failed to make a network call. Origin url: '".concat((_a = self === null || self === void 0 ? void 0 : self.location) === null || _a === void 0 ? void 0 : _a.origin, "', path: '").concat(url, "', headers: '").concat(JSON.stringify(loggableHeaders), "'")));
6624
7567
  };
6625
7568
  xhr.send();
6626
7569
  });
@@ -6639,7 +7582,8 @@ var ReadOnlyExperiments = (
6639
7582
  return this.experiments[key];
6640
7583
  };
6641
7584
  ReadOnlyExperiments2.prototype.enabled = function(key) {
6642
- return this.get(key) === "true";
7585
+ var value = this.experiments[key];
7586
+ return value === "true" || value === true || value === "B";
6643
7587
  };
6644
7588
  ReadOnlyExperiments2.prototype.pending = function() {
6645
7589
  return false;
@@ -6672,6 +7616,7 @@ var Experiments = (
6672
7616
  _this.loaders = /* @__PURE__ */ new Map();
6673
7617
  _this.baseUrl = baseUrl(_this.useNewApi, obj.baseUrl);
6674
7618
  _this.requestContext = obj.requestContext || getGlobalRequestContext(globalDefaults);
7619
+ _this.signedInstance = obj.signedInstance;
6675
7620
  _this.onError = obj.onError || noop;
6676
7621
  if (obj.scope) {
6677
7622
  _this.load(obj.scope);
@@ -6682,7 +7627,7 @@ var Experiments = (
6682
7627
  return _this;
6683
7628
  }
6684
7629
  Experiments2.prototype.add = function(obj) {
6685
- this.experiments = __assign2(__assign2({}, this.experiments), obj);
7630
+ this.experiments = __assign3(__assign3({}, this.experiments), obj);
6686
7631
  };
6687
7632
  Experiments2.prototype._addLoader = function(url, promise) {
6688
7633
  var _this = this;
@@ -6706,18 +7651,18 @@ var Experiments = (
6706
7651
  if (existingRequest !== void 0) {
6707
7652
  return existingRequest;
6708
7653
  }
6709
- var requestPromise = httpRequest(url);
6710
- getCacheInstance().addUrlRequest(url, requestPromise);
6711
- return requestPromise.catch(function(error) {
7654
+ var requestPromise = httpRequest(url, this.signedInstance).catch(function(error) {
6712
7655
  _this.onError(error);
6713
7656
  return fallback;
6714
7657
  });
7658
+ getCacheInstance().addUrlRequest(url, requestPromise);
7659
+ return requestPromise;
6715
7660
  };
6716
7661
  Experiments2.prototype.load = function(scope) {
6717
7662
  var _this = this;
6718
7663
  var scopeConductionPath = getAllInScopePath(scope, this.useNewApi);
6719
7664
  var requestContextQuery = this.useNewApi ? getRequestContextQuery(this.requestContext) : "";
6720
- var url = "" + this.baseUrl + scopeConductionPath + requestContextQuery;
7665
+ var url = "".concat(this.baseUrl).concat(scopeConductionPath).concat(requestContextQuery);
6721
7666
  var result = this._getUrlWithFallback(url, "{}").then(function(response) {
6722
7667
  return tryParse(response);
6723
7668
  }).then(function(response) {
@@ -6736,7 +7681,7 @@ var Experiments = (
6736
7681
  }
6737
7682
  var experimentsPath = getExperimentPath(spec, fallbackValue, this.useNewApi);
6738
7683
  var requestContextQuery = this.useNewApi ? getRequestContextQuery(this.requestContext) : "";
6739
- var url = "" + this.baseUrl + experimentsPath + requestContextQuery;
7684
+ var url = "".concat(this.baseUrl).concat(experimentsPath).concat(requestContextQuery);
6740
7685
  var result = this._getUrlWithFallback(url, fallbackValue !== null && fallbackValue !== void 0 ? fallbackValue : "").then(function(response) {
6741
7686
  return _this._addConductResult(spec, response);
6742
7687
  });
@@ -9486,6 +10431,14 @@ var streetNameFirstCountries = [
9486
10431
  "BR"
9487
10432
  // Brazil
9488
10433
  ];
10434
+ var apartmentNumberFirstCountries = [
10435
+ "CA"
10436
+ // Canada
10437
+ ];
10438
+ var apartmentNumberAfterStreetNameCountries = [
10439
+ "US"
10440
+ // United States
10441
+ ];
9489
10442
  var convertStreetAddressToAddressLine = ({ name, number, apt }, countryCode) => {
9490
10443
  if (!name && !number) {
9491
10444
  return "";
@@ -9493,12 +10446,24 @@ var convertStreetAddressToAddressLine = ({ name, number, apt }, countryCode) =>
9493
10446
  if (!name || !number) {
9494
10447
  return name || number;
9495
10448
  }
9496
- const formattedNumber = apt ? "".concat(number, "-").concat(apt) : number;
10449
+ if (apt && apartmentNumberAfterStreetNameCountries.includes(countryCode)) {
10450
+ return "".concat(number, " ").concat(name, " ").concat(apt).trim();
10451
+ }
10452
+ const formattedNumber = formatStreetApartmentNumber({ number, apt }, countryCode);
9497
10453
  if (streetNameFirstCountries.includes(countryCode)) {
9498
10454
  return "".concat(name, " ").concat(formattedNumber).trim();
9499
10455
  }
9500
10456
  return "".concat(formattedNumber, " ").concat(name).trim();
9501
10457
  };
10458
+ var formatStreetApartmentNumber = ({ number, apt = "" }, countryCode) => {
10459
+ if (number && apt) {
10460
+ return apartmentNumberFirstCountries.includes(countryCode) ? "".concat(apt, "-").concat(number) : "".concat(number, "-").concat(apt);
10461
+ }
10462
+ if (number) {
10463
+ return number;
10464
+ }
10465
+ return apt;
10466
+ };
9502
10467
  var convertWixAdressToGoogleAddress = (address, addressContactDetails) => {
9503
10468
  var _a, _b;
9504
10469
  const addressLines = [];
@@ -9563,7 +10528,13 @@ var parseGoogleTemplate = (template) => {
9563
10528
  }
9564
10529
  return parts;
9565
10530
  };
9566
- var trimGoogleTemplate = (address, tokens) => {
10531
+ var trimGoogleTemplate = (address, tokens, { appendAdministrativeArea = true } = {}) => {
10532
+ const isFieldPresent = (field) => {
10533
+ if (field === "administrativeArea" && !appendAdministrativeArea) {
10534
+ return false;
10535
+ }
10536
+ return hasFieldToken(address, field);
10537
+ };
9567
10538
  const parts = [];
9568
10539
  let i = 0;
9569
10540
  while (i < tokens.length) {
@@ -9572,12 +10543,12 @@ var trimGoogleTemplate = (address, tokens) => {
9572
10543
  parts.push(token);
9573
10544
  } else if (isAddressFieldToken(token)) {
9574
10545
  const tokenName = getTokenName(token);
9575
- if (hasFieldToken(address, tokenName)) {
10546
+ if (isFieldPresent(tokenName)) {
9576
10547
  parts.push(token);
9577
10548
  }
9578
10549
  } else {
9579
10550
  const notFollowingRemovedField = i === 0 || !isAddressFieldToken(tokens[i - 1]) || parts.length > 0 && isAddressFieldToken(parts[parts.length - 1]);
9580
- const notPrecedingEmptyField = i === token.length - 1 || token[i + 1] === "%n" || hasFieldToken(address, getTokenName(tokens[i + 1]));
10551
+ const notPrecedingEmptyField = i === token.length - 1 || token[i + 1] === "%n" || isFieldPresent(getTokenName(tokens[i + 1]));
9581
10552
  if (notFollowingRemovedField && notPrecedingEmptyField) {
9582
10553
  parts.push(token);
9583
10554
  }
@@ -9629,11 +10600,13 @@ var applyTemplate = (address, tokens, options) => {
9629
10600
  };
9630
10601
 
9631
10602
  // ../../node_modules/@wix/l10n/dist/esm/address/formatter.js
9632
- var formatAddress = ({ address, addressContactDetails }, { appendCountry = true } = {}) => {
10603
+ var formatAddress = ({ address, addressContactDetails }, { appendCountry = true, appendAdministrativeArea = true } = {}) => {
9633
10604
  const googleAddressFormat = convertWixAdressToGoogleAddress(address, addressContactDetails);
9634
10605
  const template = getGoogleTemplate(address.country);
9635
10606
  const tokens = parseGoogleTemplate(template);
9636
- const trimmedTemplate = trimGoogleTemplate(googleAddressFormat, tokens);
10607
+ const trimmedTemplate = trimGoogleTemplate(googleAddressFormat, tokens, {
10608
+ appendAdministrativeArea
10609
+ });
9637
10610
  return applyTemplate(googleAddressFormat, trimmedTemplate, {
9638
10611
  appendCountry
9639
10612
  });