sales-frontend-utils 0.0.46 → 0.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -41,6 +41,9 @@ function debounce(func, delay) {
41
41
 
42
42
  // src/utils/cookie-utils.ts
43
43
  var getCookie = (name) => {
44
+ if (!isClient()) {
45
+ return "";
46
+ }
44
47
  if (typeof document === "undefined") {
45
48
  return "";
46
49
  }
@@ -48,6 +51,9 @@ var getCookie = (name) => {
48
51
  return match ? decodeURIComponent(match[2] || "") : "";
49
52
  };
50
53
  var setCookie = (name, value, options = {}) => {
54
+ if (!isClient()) {
55
+ return;
56
+ }
51
57
  if (typeof document === "undefined") {
52
58
  return;
53
59
  }
@@ -72,6 +78,9 @@ var setCookie = (name, value, options = {}) => {
72
78
  document.cookie = cookieString;
73
79
  };
74
80
  var deleteCookie = (name, options = {}) => {
81
+ if (!isClient()) {
82
+ return;
83
+ }
75
84
  setCookie(name, "", { ...options, expires: -1 });
76
85
  };
77
86
 
@@ -542,7 +551,13 @@ var isIosDevice = () => {
542
551
  if (isClient() === false) {
543
552
  return false;
544
553
  }
545
- return /iPhone|iPad|iPod/i.test(navigator.userAgent);
554
+ const ua = navigator.userAgent;
555
+ if (/Android/i.test(ua)) {
556
+ return false;
557
+ }
558
+ const isDirectIOS = /iPhone|iPad|iPod/i.test(ua);
559
+ const isIPadOS = navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
560
+ return isDirectIOS || isIPadOS;
546
561
  };
547
562
  var isAndroidWebView = () => {
548
563
  return getDspExecutionEnvironment() === "android-webview";