@naturalcycles/internal-web-lib 1.6.0 → 1.7.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 (51) hide show
  1. package/bundle/analyticsClient.js +50 -63
  2. package/bundle/analyticsClient.js.map +1 -1
  3. package/bundle/conversionClient.js +22 -45
  4. package/bundle/conversionClient.js.map +1 -1
  5. package/bundle/cookieMonster.js +105 -101
  6. package/bundle/cookieMonster.js.map +1 -1
  7. package/dist/analytics/analyticsClient.d.ts +12 -0
  8. package/dist/analytics/analyticsClient.js +36 -12
  9. package/dist/conversion/conversion.util.js +1 -2
  10. package/dist/conversion/conversionClient.js +1 -2
  11. package/dist/cookie-monster/components/setting-dropdown/setting-dropdown.component.js +2 -3
  12. package/dist/cookie-monster/components/setting-dropdown/setting-dropdown2.component.js +1 -2
  13. package/dist/cookie-monster/components/themed-button/themed-button.component.js +2 -3
  14. package/dist/cookie-monster/components/themed-button/themed-button2.component.js +1 -2
  15. package/dist/cookie-monster/consent/consent.service.js +3 -4
  16. package/dist/cookie-monster/consent/consentLogStorage.service.js +1 -2
  17. package/dist/cookie-monster/const/cookieMonster.const.js +0 -1
  18. package/dist/cookie-monster/cookie-monster-element.d.ts +2 -2
  19. package/dist/cookie-monster/cookie-monster-element.js +11 -8
  20. package/dist/cookie-monster/cookieMonsterService.d.ts +3 -0
  21. package/dist/cookie-monster/cookieMonsterService.js +16 -9
  22. package/dist/cookie-monster/css/fonts.js +1 -2
  23. package/dist/cookie-monster/css/general.js +1 -2
  24. package/dist/cookie-monster/css/shared-sheets.js +2 -3
  25. package/dist/cookie-monster/css/variants.js +3 -0
  26. package/dist/cookie-monster/icons/chevron.js +1 -2
  27. package/dist/cookie-monster/index.js +2 -2
  28. package/dist/cookie-monster/lang/da-DK.js +1 -2
  29. package/dist/cookie-monster/lang/de-DE.js +1 -2
  30. package/dist/cookie-monster/lang/en-GB.js +1 -2
  31. package/dist/cookie-monster/lang/en-US.js +1 -2
  32. package/dist/cookie-monster/lang/es-US.js +1 -2
  33. package/dist/cookie-monster/lang/fi-FI.js +1 -2
  34. package/dist/cookie-monster/lang/fr-FR.js +1 -2
  35. package/dist/cookie-monster/lang/it-IT.js +1 -2
  36. package/dist/cookie-monster/lang/no-NO.js +1 -2
  37. package/dist/cookie-monster/lang/pt-BR.js +1 -2
  38. package/dist/cookie-monster/lang/sv-SE.js +1 -2
  39. package/dist/cookie-monster/types/CookieMonster.types.d.ts +5 -0
  40. package/dist/cookie-monster/types/CookieMonster.types.js +7 -3
  41. package/dist/cookie-monster/utils/createButton.js +1 -2
  42. package/dist/cookie-monster/utils/getCookieMonsterEvent.js +1 -2
  43. package/dist/cookie-monster/utils/handleRootClick.js +1 -2
  44. package/dist/cookie-monster/utils/linkify.js +1 -2
  45. package/dist/cookie-monster/utils/translationsService.js +1 -2
  46. package/dist/cookie-monster/views/main.view.js +3 -4
  47. package/dist/cookie-monster/views/settings.view.js +3 -5
  48. package/dist/cookie-monster/views/views.js +2 -3
  49. package/dist/{node_modules/.pnpm/@naturalcycles_ncuikit@1.17.0_react@19.3.1_undici@8.12.1/node_modules/@naturalcycles/ncuikit → ncuikit}/dist/styles/_palette.js +1 -2
  50. package/package.json +3 -2
  51. package/dist/cookie-monster/icons/back.js +0 -4
@@ -3,13 +3,11 @@ function e(e = 21) {
3
3
  for (; e--;) t += "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[n[e] & 63];
4
4
  return t;
5
5
  }
6
- //#endregion
7
- //#region src/conversion/conversion.util.ts
6
+ // src/conversion/conversion.util.ts
8
7
  function t() {
9
8
  return e();
10
9
  }
11
- //#endregion
12
- //#region ../../node_modules/.pnpm/@naturalcycles+js-lib@15.93.1_undici@8.12.1/node_modules/@naturalcycles/js-lib/dist/is.util.js
10
+ // ../../node_modules/.pnpm/@naturalcycles+js-lib@15.98.0_undici@8.12.3/node_modules/@naturalcycles/js-lib/dist/is.util.js
13
11
  var n = (e) => !!e;
14
12
  function r(e) {
15
13
  return typeof e == "object" && !!e && !Array.isArray(e) || !1;
@@ -24,8 +22,7 @@ function i(e) {
24
22
  }
25
23
  return !1;
26
24
  }
27
- //#endregion
28
- //#region ../../node_modules/.pnpm/@naturalcycles+js-lib@15.93.1_undici@8.12.1/node_modules/@naturalcycles/js-lib/dist/abort.js
25
+ // ../../node_modules/.pnpm/@naturalcycles+js-lib@15.98.0_undici@8.12.3/node_modules/@naturalcycles/js-lib/dist/abort.js
29
26
  function a(e) {
30
27
  return e ? o(e) : void 0;
31
28
  }
@@ -54,8 +51,7 @@ function u(e) {
54
51
  });
55
52
  return t.signal;
56
53
  }
57
- //#endregion
58
- //#region ../../node_modules/.pnpm/@naturalcycles+js-lib@15.93.1_undici@8.12.1/node_modules/@naturalcycles/js-lib/dist/log/commonLogger.js
54
+ // ../../node_modules/.pnpm/@naturalcycles+js-lib@15.98.0_undici@8.12.3/node_modules/@naturalcycles/js-lib/dist/log/commonLogger.js
59
55
  function d(e, t) {
60
56
  let n = (n, [r, i]) => e({
61
57
  ...t?.(),
@@ -115,8 +111,7 @@ var f = d(({ level: e, msg: t, err: n, ...r }) => {
115
111
  });
116
112
  }
117
113
  }(), m = p.runInBackground.bind(p), te = (...e) => void 0, h = Object.entries;
118
- //#endregion
119
- //#region ../../node_modules/.pnpm/@naturalcycles+js-lib@15.93.1_undici@8.12.1/node_modules/@naturalcycles/js-lib/dist/object/object.util.js
114
+ // ../../node_modules/.pnpm/@naturalcycles+js-lib@15.98.0_undici@8.12.3/node_modules/@naturalcycles/js-lib/dist/object/object.util.js
120
115
  function g(e, t, n = {}) {
121
116
  if (n.mutate) {
122
117
  for (let n of Object.keys(e)) t.includes(n) || delete e[n];
@@ -165,16 +160,14 @@ function S(e, ...t) {
165
160
  for (let n of t) if (r(n)) for (let t of Object.keys(n)) t !== "__proto__" && t !== "constructor" && t !== "prototype" && (r(n[t]) ? (e[t] ||= {}, S(e[t], n[t])) : e[t] = n[t]);
166
161
  return e;
167
162
  }
168
- //#endregion
169
- //#region ../../node_modules/.pnpm/@naturalcycles+js-lib@15.93.1_undici@8.12.1/node_modules/@naturalcycles/js-lib/dist/env.js
163
+ // ../../node_modules/.pnpm/@naturalcycles+js-lib@15.98.0_undici@8.12.3/node_modules/@naturalcycles/js-lib/dist/env.js
170
164
  function C() {
171
165
  return !ie();
172
166
  }
173
167
  function ie() {
174
168
  return typeof window < "u" && !!window?.document;
175
169
  }
176
- //#endregion
177
- //#region ../../node_modules/.pnpm/@naturalcycles+js-lib@15.93.1_undici@8.12.1/node_modules/@naturalcycles/js-lib/dist/string/json.util.js
170
+ // ../../node_modules/.pnpm/@naturalcycles+js-lib@15.98.0_undici@8.12.3/node_modules/@naturalcycles/js-lib/dist/string/json.util.js
178
171
  var ae = /^\s*[{["\-\d]/;
179
172
  function w(e, t) {
180
173
  if (typeof e == "string" && e && ae.test(e)) try {
@@ -189,8 +182,7 @@ function oe(e, t) {
189
182
  throw new le({ text: e });
190
183
  }
191
184
  }
192
- //#endregion
193
- //#region ../../node_modules/.pnpm/@naturalcycles+js-lib@15.93.1_undici@8.12.1/node_modules/@naturalcycles/js-lib/dist/string/string.util.js
185
+ // ../../node_modules/.pnpm/@naturalcycles+js-lib@15.98.0_undici@8.12.3/node_modules/@naturalcycles/js-lib/dist/string/string.util.js
194
186
  function T(e, t, n = "...") {
195
187
  if (!e || e.length <= t) return e;
196
188
  if (t <= n.length) return n;
@@ -201,8 +193,7 @@ function E(e, t) {
201
193
  let n = e.indexOf(t);
202
194
  return e.slice(0, n === -1 ? void 0 : n);
203
195
  }
204
- //#endregion
205
- //#region ../../node_modules/.pnpm/@naturalcycles+js-lib@15.93.1_undici@8.12.1/node_modules/@naturalcycles/js-lib/dist/error/error.util.js
196
+ // ../../node_modules/.pnpm/@naturalcycles+js-lib@15.98.0_undici@8.12.3/node_modules/@naturalcycles/js-lib/dist/error/error.util.js
206
197
  function D(e, t = Error, n) {
207
198
  let r;
208
199
  return r = e instanceof t ? e : se(O(e), t), n && (r.data ||= {}, Object.assign(r.data, n)), r;
@@ -341,8 +332,7 @@ var P = class e extends Error {
341
332
  super(e || "expected error was not thrown", {}, { name: "UnexpectedPassError" });
342
333
  }
343
334
  };
344
- //#endregion
345
- //#region ../../node_modules/.pnpm/@naturalcycles+js-lib@15.93.1_undici@8.12.1/node_modules/@naturalcycles/js-lib/dist/string/safeJsonStringify.js
335
+ // ../../node_modules/.pnpm/@naturalcycles+js-lib@15.98.0_undici@8.12.3/node_modules/@naturalcycles/js-lib/dist/string/safeJsonStringify.js
346
336
  function R(e, t, n, r) {
347
337
  try {
348
338
  return JSON.stringify(e, t, n);
@@ -360,8 +350,7 @@ function z(e, t) {
360
350
  return e == null ? a : e.call(this, i, a);
361
351
  };
362
352
  }
363
- //#endregion
364
- //#region ../../node_modules/.pnpm/@naturalcycles+js-lib@15.93.1_undici@8.12.1/node_modules/@naturalcycles/js-lib/dist/string/stringify.js
353
+ // ../../node_modules/.pnpm/@naturalcycles+js-lib@15.98.0_undici@8.12.3/node_modules/@naturalcycles/js-lib/dist/string/stringify.js
365
354
  var B = typeof globalThis.AggregateError == "function", V = R;
366
355
  function H(e, t = {}) {
367
356
  if (e === void 0) return "undefined";
@@ -398,16 +387,14 @@ function U(e, t) {
398
387
  ...e.errors.map((e, n) => `${n + 1}. ${H(e, t)}`)
399
388
  ].join("\n")), e.cause && n && (r = r + "\nCaused by: " + H(e.cause, t)), r;
400
389
  }
401
- //#endregion
402
- //#region ../../node_modules/.pnpm/@naturalcycles+js-lib@15.93.1_undici@8.12.1/node_modules/@naturalcycles/js-lib/dist/error/assert.js
390
+ // ../../node_modules/.pnpm/@naturalcycles+js-lib@15.98.0_undici@8.12.3/node_modules/@naturalcycles/js-lib/dist/error/assert.js
403
391
  function W(e, t = Error) {
404
392
  if (!(e instanceof t)) throw new ce(`Expected to be instanceof ${t.name}, actual typeof: ${typeof e}`);
405
393
  }
406
394
  function ue(e, t) {
407
395
  if (!(e instanceof t)) throw e;
408
396
  }
409
- //#endregion
410
- //#region ../../node_modules/.pnpm/@naturalcycles+js-lib@15.93.1_undici@8.12.1/node_modules/@naturalcycles/js-lib/dist/promise/pDelay.js
397
+ // ../../node_modules/.pnpm/@naturalcycles+js-lib@15.98.0_undici@8.12.3/node_modules/@naturalcycles/js-lib/dist/promise/pDelay.js
411
398
  async function de(e, t) {
412
399
  t?.aborted || await new Promise((n) => {
413
400
  let r = setTimeout(i, e);
@@ -417,8 +404,7 @@ async function de(e, t) {
417
404
  t?.addEventListener("abort", i);
418
405
  });
419
406
  }
420
- //#endregion
421
- //#region ../../node_modules/.pnpm/@naturalcycles+js-lib@15.93.1_undici@8.12.1/node_modules/@naturalcycles/js-lib/dist/datetime/time.util.js
407
+ // ../../node_modules/.pnpm/@naturalcycles+js-lib@15.98.0_undici@8.12.3/node_modules/@naturalcycles/js-lib/dist/datetime/time.util.js
422
408
  function G(e, t = Date.now()) {
423
409
  return K(t - e);
424
410
  }
@@ -428,13 +414,11 @@ function K(e) {
428
414
  let t = Math.floor(e / 1e3) % 60, n = Math.floor(e / 6e4) % 60, r = Math.floor(e / 36e5);
429
415
  return r === 0 ? n === 0 ? `${t} sec` : `${n}m${t}s` : r < 24 ? `${r}h${n}m` : r < 48 ? `${Math.round(r + n / 60)}h` : `${Math.floor(r / 24)} days`;
430
416
  }
431
- //#endregion
432
- //#region ../../node_modules/.pnpm/@naturalcycles+js-lib@15.93.1_undici@8.12.1/node_modules/@naturalcycles/js-lib/dist/number/number.util.js
417
+ // ../../node_modules/.pnpm/@naturalcycles+js-lib@15.98.0_undici@8.12.3/node_modules/@naturalcycles/js-lib/dist/number/number.util.js
433
418
  function fe(e, t, n) {
434
419
  return e <= t ? t : e >= n ? n : e;
435
420
  }
436
- //#endregion
437
- //#region ../../node_modules/.pnpm/@naturalcycles+js-lib@15.93.1_undici@8.12.1/node_modules/@naturalcycles/js-lib/dist/promise/pTimeout.js
421
+ // ../../node_modules/.pnpm/@naturalcycles+js-lib@15.98.0_undici@8.12.3/node_modules/@naturalcycles/js-lib/dist/promise/pTimeout.js
438
422
  async function pe(e, t) {
439
423
  let n = new AbortController(), { signal: r } = n;
440
424
  if (!t.timeout) return await e(r);
@@ -460,8 +444,7 @@ async function pe(e, t) {
460
444
  }
461
445
  });
462
446
  }
463
- //#endregion
464
- //#region ../../node_modules/.pnpm/@naturalcycles+js-lib@15.93.1_undici@8.12.1/node_modules/@naturalcycles/js-lib/dist/string/url.util.js
447
+ // ../../node_modules/.pnpm/@naturalcycles+js-lib@15.98.0_undici@8.12.3/node_modules/@naturalcycles/js-lib/dist/string/url.util.js
465
448
  function me(e, t) {
466
449
  if (typeof e != "string") return null;
467
450
  try {
@@ -470,8 +453,7 @@ function me(e, t) {
470
453
  return null;
471
454
  }
472
455
  }
473
- //#endregion
474
- //#region ../../node_modules/.pnpm/@naturalcycles+js-lib@15.93.1_undici@8.12.1/node_modules/@naturalcycles/js-lib/dist/http/http.model.js
456
+ // ../../node_modules/.pnpm/@naturalcycles+js-lib@15.98.0_undici@8.12.3/node_modules/@naturalcycles/js-lib/dist/http/http.model.js
475
457
  var he = [
476
458
  "GET",
477
459
  "POST",
@@ -782,9 +764,7 @@ var he = [
782
764
  return this.cfg.logWithSearchParams || (n = n.split("?")[0]), !this.cfg.logWithBaseUrl && t && n.startsWith(t) && (n = n.slice(t.length)), n;
783
765
  }
784
766
  normalizeCfg(t) {
785
- let { debug: n = !1, logger: r = f } = t;
786
- t.baseUrl?.endsWith("/") && (r.warn(`Fetcher: baseUrl should not end with slash: ${t.baseUrl}`), t.baseUrl = t.baseUrl.slice(0, t.baseUrl.length - 1));
787
- let i = S({
767
+ let { debug: n = !1, logger: r = f } = t, i = S({
788
768
  baseUrl: "",
789
769
  name: this.getFetcherName(t),
790
770
  inputUrl: "",
@@ -827,7 +807,7 @@ var he = [
827
807
  "name",
828
808
  "keepalive"
829
809
  ]));
830
- return i.init.headers = x(i.init.headers, (e) => e.toLowerCase()), i;
810
+ return i.init.headers = x(i.init.headers, (e) => e.toLowerCase()), i.baseUrl.endsWith("/") && (r.warn(`Fetcher: baseUrl should not end with slash: ${i.baseUrl}`), i.baseUrl = i.baseUrl.slice(0, -1)), i;
831
811
  }
832
812
  getFetcherName(e) {
833
813
  let { name: t } = e;
@@ -1022,8 +1002,7 @@ var Z = new class {
1022
1002
  document.cookie = `${e}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`;
1023
1003
  }
1024
1004
  }();
1025
- //#endregion
1026
- //#region ../shared/dist/util/metaClickId.util.js
1005
+ // ../shared/dist/util/metaClickId.util.js
1027
1006
  function $(e) {
1028
1007
  if (e) return e.startsWith("fb.") ? e : `fb.1.${Date.now()}.${e}`;
1029
1008
  }
@@ -1033,8 +1012,7 @@ function we(e) {
1033
1012
  let t = e.split("."), n = t.lastIndexOf("fb");
1034
1013
  return n > 0 && t.length - n >= 4 && (e = t.slice(n).join(".")), e;
1035
1014
  }
1036
- //#endregion
1037
- //#region src/conversion/conversionClient.ts
1015
+ // src/conversion/conversionClient.ts
1038
1016
  var Te = 30, Ee = 200, De = 20, Oe = class {
1039
1017
  constructor(e) {
1040
1018
  this.cfg = {
@@ -1129,7 +1107,6 @@ var Te = 30, Ee = 200, De = 20, Oe = class {
1129
1107
  if (!(!t || t.length < De) && !(this.pendingClickIds[Y.fbclid] || Q.getCookie(Y.fbclid))?.endsWith(`.${t}`)) return $(t);
1130
1108
  }
1131
1109
  };
1132
- //#endregion
1133
1110
  export { Oe as ConversionClient, t as generateConversionEventId };
1134
1111
 
1135
1112
  //# sourceMappingURL=conversionClient.js.map