@soyio/soyio-widget 2.15.0 → 2.15.1

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
@@ -432,7 +432,7 @@ class Hn {
432
432
  this.element.style.opacity = "0", setTimeout(() => this.element.remove(), 300);
433
433
  }
434
434
  }
435
- const He = "2.15.0";
435
+ const He = "2.15.1";
436
436
  function _n(c) {
437
437
  var E;
438
438
  const d = [
@@ -507,14 +507,14 @@ class ir extends We {
507
507
  }
508
508
  const ar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
509
509
  __proto__: null
510
- }, Symbol.toStringTag, { value: "Module" })), $n = "WIDGET_EVENT";
511
- function Bn(c) {
510
+ }, Symbol.toStringTag, { value: "Module" })), Bn = "WIDGET_EVENT";
511
+ function $n(c) {
512
512
  let d = "widget/";
513
513
  return "disclosureRequestId" in c.configProps ? d += ["disclosures", c.configProps.disclosureRequestId].join("/") : d += c.request, d;
514
514
  }
515
515
  function Gn(c) {
516
516
  var y;
517
- const d = (y = c.isSandbox) != null ? y : !1, h = c.developmentUrl || (d ? Lt : zt), f = Object.entries(c.configProps).filter(([E, S]) => S || E === "disclosureRequestId").map(([E, S]) => `${E}=${encodeURIComponent(S)}`).join("&"), v = Bn(c);
517
+ const d = (y = c.isSandbox) != null ? y : !1, h = c.developmentUrl || (d ? Lt : zt), f = Object.entries(c.configProps).filter(([E, S]) => S || E === "disclosureRequestId").map(([E, S]) => `${E}=${encodeURIComponent(S)}`).join("&"), v = $n(c);
518
518
  return `${h}/${v}?sdk=web&sdkVersion=${He}&${f}`;
519
519
  }
520
520
  let Y = null, Le = null;
@@ -551,7 +551,7 @@ function Zn() {
551
551
  function Kn(c) {
552
552
  return _(this, null, function* () {
553
553
  const { onEvent: d } = c, h = yield Promise.resolve().then(() => qe);
554
- me && Zn(), me = h.on($n, (v) => _(null, [v], function* ({ data: f }) {
554
+ me && Zn(), me = h.on(Bn, (v) => _(null, [v], function* ({ data: f }) {
555
555
  return d(f), Dn.includes(f.eventName) ? Yn() : f.eventName === Mn && _e(), Promise.resolve();
556
556
  }));
557
557
  });
@@ -629,7 +629,7 @@ function tr() {
629
629
  }), v.d(f, "TYPES", function() {
630
630
  return cn;
631
631
  }), v.d(f, "ProxyWindow", function() {
632
- return B;
632
+ return $;
633
633
  }), v.d(f, "setup", function() {
634
634
  return Et;
635
635
  }), v.d(f, "destroy", function() {
@@ -748,7 +748,7 @@ function tr() {
748
748
  if (!X(e)) throw new Error("Expected window to be same domain");
749
749
  return e;
750
750
  }
751
- function $e(e, n) {
751
+ function Be(e, n) {
752
752
  if (!e || !n) return !1;
753
753
  var t = k(n);
754
754
  return t ? t === e : function(r) {
@@ -761,7 +761,7 @@ function tr() {
761
761
  return o;
762
762
  }(n).indexOf(e) !== -1;
763
763
  }
764
- function Be(e) {
764
+ function $e(e) {
765
765
  var n = [], t;
766
766
  try {
767
767
  t = e.frames;
@@ -1290,7 +1290,7 @@ function tr() {
1290
1290
  throw new Error("Arguments not serializable -- can not be used to memoize");
1291
1291
  }
1292
1292
  }
1293
- function $t() {
1293
+ function Bt() {
1294
1294
  return {};
1295
1295
  }
1296
1296
  var ue = 0, Qe = 0;
@@ -1302,7 +1302,7 @@ function tr() {
1302
1302
  for (var s = arguments.length, w = new Array(s), m = 0; m < s; m++) w[m] = arguments[m];
1303
1303
  l < Qe && (i = null, a = null, l = ue, ue += 1);
1304
1304
  var p;
1305
- p = r ? (a = a || new Te()).getOrSet(this, $t) : i = i || {};
1305
+ p = r ? (a = a || new Te()).getOrSet(this, Bt) : i = i || {};
1306
1306
  var g;
1307
1307
  try {
1308
1308
  g = Xe(w);
@@ -1324,7 +1324,7 @@ function tr() {
1324
1324
  ce.clear = function() {
1325
1325
  Qe = ue;
1326
1326
  };
1327
- function Bt(e) {
1327
+ function $t(e) {
1328
1328
  var n = {};
1329
1329
  function t() {
1330
1330
  for (var r = arguments, o = this, i = arguments.length, a = new Array(i), l = 0; l < i; l++) a[l] = arguments[l];
@@ -1588,33 +1588,33 @@ function tr() {
1588
1588
  return e;
1589
1589
  }, q[void 0] = function(e) {
1590
1590
  return te("undefined", e);
1591
- }, q), Zt = {}, $, Kt = (($ = {}).function = function() {
1591
+ }, q), Zt = {}, B, Kt = ((B = {}).function = function() {
1592
1592
  throw new Error("Function serialization is not implemented; nothing to deserialize");
1593
- }, $.error = function(e) {
1593
+ }, B.error = function(e) {
1594
1594
  var n = e.stack, t = e.code, r = e.data, o = new Error(e.message);
1595
1595
  return o.code = t, r && (o.data = r), o.stack = n + `
1596
1596
 
1597
1597
  ` + o.stack, o;
1598
- }, $.promise = function() {
1598
+ }, B.promise = function() {
1599
1599
  throw new Error("Promise serialization is not implemented; nothing to deserialize");
1600
- }, $.regex = function(e) {
1600
+ }, B.regex = function(e) {
1601
1601
  return new RegExp(e);
1602
- }, $.date = function(e) {
1602
+ }, B.date = function(e) {
1603
1603
  return new Date(e);
1604
- }, $.array = function(e) {
1604
+ }, B.array = function(e) {
1605
1605
  return e;
1606
- }, $.object = function(e) {
1606
+ }, B.object = function(e) {
1607
1607
  return e;
1608
- }, $.string = function(e) {
1608
+ }, B.string = function(e) {
1609
1609
  return e;
1610
- }, $.number = function(e) {
1610
+ }, B.number = function(e) {
1611
1611
  return e;
1612
- }, $.boolean = function(e) {
1612
+ }, B.boolean = function(e) {
1613
1613
  return e;
1614
- }, $.null = function(e) {
1614
+ }, B.null = function(e) {
1615
1615
  return e;
1616
- }, $[void 0] = function() {
1617
- }, $), Xt = {};
1616
+ }, B[void 0] = function() {
1617
+ }, B), Xt = {};
1618
1618
  new P(function(e) {
1619
1619
  if (window.document && window.document.body) return e(window.document.body);
1620
1620
  var n = setInterval(function() {
@@ -1646,7 +1646,7 @@ function tr() {
1646
1646
  getType: function() {
1647
1647
  return a;
1648
1648
  },
1649
- getInstanceID: Bt(function() {
1649
+ getInstanceID: $t(function() {
1650
1650
  return e.then(function(u) {
1651
1651
  return st(u, {
1652
1652
  send: t
@@ -1708,7 +1708,7 @@ function tr() {
1708
1708
  }
1709
1709
  };
1710
1710
  }
1711
- var B = function() {
1711
+ var $ = function() {
1712
1712
  function e(t) {
1713
1713
  var r = t.send, o = t.win, i = t.serializedWindow;
1714
1714
  this.id = void 0, this.isProxyWindow = !0, this.serializedWindow = void 0, this.actualWindow = void 0, this.actualWindowPromise = void 0, this.send = void 0, this.name = void 0, this.actualWindowPromise = new P(), this.serializedWindow = i || dt(this.actualWindowPromise, {
@@ -1816,7 +1816,7 @@ function tr() {
1816
1816
  }();
1817
1817
  function De(e, n, t, r, o) {
1818
1818
  var i = H("methodStore"), a = z("proxyWindowMethods");
1819
- B.isProxyWindow(r) ? a.set(e, {
1819
+ $.isProxyWindow(r) ? a.set(e, {
1820
1820
  val: n,
1821
1821
  name: t,
1822
1822
  domain: o,
@@ -1849,7 +1849,7 @@ function tr() {
1849
1849
  var C = b.source, j = b.domain, R = b.val;
1850
1850
  return P.try(function() {
1851
1851
  if (!re(j, p)) throw new Error("Method '" + g.name + "' domain " + JSON.stringify(Re(b.domain) ? b.domain.source : b.domain) + " does not match origin " + p + " in " + F(window));
1852
- if (B.isProxyWindow(C)) return C.matchWindow(m, {
1852
+ if ($.isProxyWindow(C)) return C.matchWindow(m, {
1853
1853
  send: l
1854
1854
  }).then(function(T) {
1855
1855
  if (!T) throw new Error("Method call '" + g.name + "' failed - proxy window does not match source in " + F(window));
@@ -1882,9 +1882,9 @@ function tr() {
1882
1882
  });
1883
1883
  });
1884
1884
  var i, a, l, u = t.__id__ || J();
1885
- e = B.unwrap(e);
1885
+ e = $.unwrap(e);
1886
1886
  var s = t.__name__ || t.name || r;
1887
- return typeof s == "string" && typeof s.indexOf == "function" && s.indexOf("anonymous::") === 0 && (s = s.replace("anonymous::", r + "::")), B.isProxyWindow(e) ? (De(u, t, s, e, n), e.awaitWindow().then(function(w) {
1887
+ return typeof s == "string" && typeof s.indexOf == "function" && s.indexOf("anonymous::") === 0 && (s = s.replace("anonymous::", r + "::")), $.isProxyWindow(e) ? (De(u, t, s, e, n), e.awaitWindow().then(function(w) {
1888
1888
  De(u, t, s, w, n);
1889
1889
  })) : De(u, t, s, e, n), te("cross_domain_function", {
1890
1890
  id: u,
@@ -1924,7 +1924,7 @@ function tr() {
1924
1924
  send: a
1925
1925
  });
1926
1926
  }, o.object = function(l) {
1927
- return we(l) || B.isProxyWindow(l) ? te("cross_domain_window", B.serialize(l, {
1927
+ return we(l) || $.isProxyWindow(l) ? te("cross_domain_window", $.serialize(l, {
1928
1928
  send: a
1929
1929
  })) : l;
1930
1930
  }, o));
@@ -1949,7 +1949,7 @@ function tr() {
1949
1949
  b === void 0 && (b = {});
1950
1950
  function C() {
1951
1951
  var j = arguments;
1952
- return B.toProxyWindow(l, {
1952
+ return $.toProxyWindow(l, {
1953
1953
  send: g
1954
1954
  }).awaitWindow().then(function(R) {
1955
1955
  var T = ft(R, m);
@@ -1988,7 +1988,7 @@ function tr() {
1988
1988
  send: i
1989
1989
  });
1990
1990
  }, o.cross_domain_window = function(a) {
1991
- return B.deserialize(a, {
1991
+ return $.deserialize(a, {
1992
1992
  send: i
1993
1993
  });
1994
1994
  }, o));
@@ -2201,7 +2201,7 @@ function tr() {
2201
2201
  var r = function o(i, a) {
2202
2202
  var l = i.name, u = i.win, s = i.domain, w = H("requestListeners");
2203
2203
  if (!l || typeof l != "string") throw new Error("Name required to add request listener");
2204
- if (u && u !== "*" && B.isProxyWindow(u)) {
2204
+ if (u && u !== "*" && $.isProxyWindow(u)) {
2205
2205
  var m = u.awaitWindow().then(function(M) {
2206
2206
  return o({
2207
2207
  name: l,
@@ -2292,7 +2292,7 @@ function tr() {
2292
2292
  }
2293
2293
  var K = function e(n, t, r, o) {
2294
2294
  var i = (o = o || {}).domain || "*", a = o.timeout || -1, l = o.timeout || 5e3, u = o.fireAndForget || !1;
2295
- return B.toProxyWindow(n, {
2295
+ return $.toProxyWindow(n, {
2296
2296
  send: e
2297
2297
  }).awaitWindow().then(function(s) {
2298
2298
  return P.try(function() {
@@ -2311,15 +2311,15 @@ function tr() {
2311
2311
  }
2312
2312
  if (k(x) === x) return x;
2313
2313
  try {
2314
- if ($e(window, x) && window.top) return window.top;
2314
+ if (Be(window, x) && window.top) return window.top;
2315
2315
  } catch (R) {
2316
2316
  }
2317
2317
  try {
2318
- if ($e(x, window) && window.top) return window.top;
2318
+ if (Be(x, window) && window.top) return window.top;
2319
2319
  } catch (R) {
2320
2320
  }
2321
2321
  for (var b = 0, C = function R(T) {
2322
- for (var L = [], W = 0, O = Be(T); W < O.length; W++) {
2322
+ for (var L = [], W = 0, O = $e(T); W < O.length; W++) {
2323
2323
  var V = O[W];
2324
2324
  L.push(V);
2325
2325
  for (var M = 0, he = R(V); M < he.length; M++) L.push(he[M]);
@@ -2334,7 +2334,7 @@ function tr() {
2334
2334
  if (k(j) === j) return j;
2335
2335
  }
2336
2336
  }(m) === m) return !1;
2337
- for (var g = 0, I = Be(w); g < I.length; g++) if (I[g] === m) return !0;
2337
+ for (var g = 0, I = $e(w); g < I.length; g++) if (I[g] === m) return !0;
2338
2338
  return !1;
2339
2339
  }(window, s)) return function(w, m, p) {
2340
2340
  m === void 0 && (m = 5e3), p === void 0 && (p = "Window");
@@ -2438,13 +2438,13 @@ function tr() {
2438
2438
  });
2439
2439
  }
2440
2440
  function an(e) {
2441
- return new B({
2441
+ return new $({
2442
2442
  send: K,
2443
2443
  win: e
2444
2444
  });
2445
2445
  }
2446
2446
  function sn(e) {
2447
- return B.toProxyWindow(e, {
2447
+ return $.toProxyWindow(e, {
2448
2448
  send: K
2449
2449
  });
2450
2450
  }
@@ -121,7 +121,7 @@
121
121
  0% { background-position: 200% 0; }
122
122
  100% { background-position: -200% 0; }
123
123
  }
124
- `,document.head.appendChild(te)}d.appendChild(v),d.appendChild(y),d.appendChild(E),U.appendChild(H),U.appendChild(he),W.appendChild(q),W.appendChild(U),g.appendChild(d),g.appendChild(W),this.element.appendChild(g)}cleanupExistingSkeleton(){const f=document.getElementById(this.identifier);f&&f.remove()}mount(f){this.cleanupExistingSkeleton(),f.appendChild(this.element)}hide(){this.element.style.opacity="0",setTimeout(()=>this.element.remove(),300)}}const je="2.15.0";function mn(l){var E;const f=["actionToken","entityId","context","optionalReconsentBehavior","mandatoryReconsentBehavior"],g=(E=l.isSandbox)!=null?E:!1,d=l.developmentUrl||(g?at:it),v=new URLSearchParams;v.set("sdkVersion",je),f.forEach(W=>{l[W]&&v.set(W,l[W])});const y=v.toString();return`${d}/embed/consents/${l.consentTemplateId}${y?`?${y}`:""}`}class ze extends be{constructor(g){super(g);M(this,"defaultIframePrefix","consent-box");M(this,"defaultIframeCSSConfig",fn);M(this,"state",{isSelected:!1,actionToken:null});this.Skeleton=hn}get uniqueIdentifier(){return this.options.consentTemplateId}iframeUrl(){return mn(this.options)}handleStateChange(g){const{isSelected:d,actionToken:v}=g;this.state={isSelected:d,actionToken:v},this.options.onEvent({eventName:"CONSENT_CHECKBOX_CHANGE",isSelected:d,actionToken:v})}setupListeners(){return G(this,null,function*(){yield Vt(ze.prototype,this,"setupListeners").call(this),ot(this.uniqueIdentifier,{onStateChange:this.handleStateChange.bind(this)})})}getState(){return this.state}}function pn(l){var y,E,W;const f=(y=l.isSandbox)!=null?y:!1,g=l.developmentUrl||(f?rn:nn),d=new URLSearchParams;d.set("sdkVersion",je),l.sessionToken?d.set("sessionToken",l.sessionToken):l.companyId&&d.set("companyId",l.companyId),(E=l.enabledFeatures)!=null&&E.length&&d.set("enabledFeatures",l.enabledFeatures.join(",")),(W=l.dataSubjects)!=null&&W.length&&d.set("dataSubjects",l.dataSubjects.join(",")),l.requestReference&&d.set("requestReference",l.requestReference);const v=d.toString();return`${g}${v?`?${v}`:""}`}class vn extends be{constructor(){super(...arguments);M(this,"defaultIframePrefix","privacy-center");M(this,"_uniqueIdentifier","privacy-center");M(this,"defaultIframeCSSConfig",ln)}get uniqueIdentifier(){return this._uniqueIdentifier}iframeUrl(){return pn(this.options)}}const wn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),gn="WIDGET_EVENT";function yn(l){let f="widget/";return"disclosureRequestId"in l.configProps?f+=["disclosures",l.configProps.disclosureRequestId].join("/"):f+=l.request,f}function En(l){var y;const f=(y=l.isSandbox)!=null?y:!1,g=l.developmentUrl||(f?at:it),d=Object.entries(l.configProps).filter(([E,W])=>W||E==="disclosureRequestId").map(([E,W])=>`${E}=${encodeURIComponent(W)}`).join("&"),v=yn(l);return`${g}/${v}?sdk=web&sdkVersion=${je}&${d}`}let ee=null,Le=null;function ke(l=null){ee&&!ee.closed&&ee.focus(),l==null||l.preventDefault()}function Ue(){document.body.style.filter="",document.body.removeEventListener("click",ke)}function Sn(){Le=setInterval(()=>{(!ee||ee.closed)&&(Le&&clearInterval(Le),Ue())},cn)}function xn(l){const f=En(l),g=sn,d=un,v=window.screenLeft!==void 0?window.screenLeft:window.screenX,y=window.screenTop!==void 0?window.screenTop:window.screenY,E=window.innerWidth||document.documentElement.clientWidth||window.screen.width,W=window.innerHeight||document.documentElement.clientHeight||window.screen.height,q=E/window.screen.availWidth,U=(E-g)/2/q+v,H=(W-d)/2/q+y;document.body.style.filter="blur(5px)",document.body.addEventListener("click",ke),ee=window.open(f,"Soyio",`scrollbars=yes,
124
+ `,document.head.appendChild(te)}d.appendChild(v),d.appendChild(y),d.appendChild(E),U.appendChild(H),U.appendChild(he),W.appendChild(q),W.appendChild(U),g.appendChild(d),g.appendChild(W),this.element.appendChild(g)}cleanupExistingSkeleton(){const f=document.getElementById(this.identifier);f&&f.remove()}mount(f){this.cleanupExistingSkeleton(),f.appendChild(this.element)}hide(){this.element.style.opacity="0",setTimeout(()=>this.element.remove(),300)}}const je="2.15.1";function mn(l){var E;const f=["actionToken","entityId","context","optionalReconsentBehavior","mandatoryReconsentBehavior"],g=(E=l.isSandbox)!=null?E:!1,d=l.developmentUrl||(g?at:it),v=new URLSearchParams;v.set("sdkVersion",je),f.forEach(W=>{l[W]&&v.set(W,l[W])});const y=v.toString();return`${d}/embed/consents/${l.consentTemplateId}${y?`?${y}`:""}`}class ze extends be{constructor(g){super(g);M(this,"defaultIframePrefix","consent-box");M(this,"defaultIframeCSSConfig",fn);M(this,"state",{isSelected:!1,actionToken:null});this.Skeleton=hn}get uniqueIdentifier(){return this.options.consentTemplateId}iframeUrl(){return mn(this.options)}handleStateChange(g){const{isSelected:d,actionToken:v}=g;this.state={isSelected:d,actionToken:v},this.options.onEvent({eventName:"CONSENT_CHECKBOX_CHANGE",isSelected:d,actionToken:v})}setupListeners(){return G(this,null,function*(){yield Vt(ze.prototype,this,"setupListeners").call(this),ot(this.uniqueIdentifier,{onStateChange:this.handleStateChange.bind(this)})})}getState(){return this.state}}function pn(l){var y,E,W;const f=(y=l.isSandbox)!=null?y:!1,g=l.developmentUrl||(f?rn:nn),d=new URLSearchParams;d.set("sdkVersion",je),l.sessionToken?d.set("sessionToken",l.sessionToken):l.companyId&&d.set("companyId",l.companyId),(E=l.enabledFeatures)!=null&&E.length&&d.set("enabledFeatures",l.enabledFeatures.join(",")),(W=l.dataSubjects)!=null&&W.length&&d.set("dataSubjects",l.dataSubjects.join(",")),l.requestReference&&d.set("requestReference",l.requestReference);const v=d.toString();return`${g}${v?`?${v}`:""}`}class vn extends be{constructor(){super(...arguments);M(this,"defaultIframePrefix","privacy-center");M(this,"_uniqueIdentifier","privacy-center");M(this,"defaultIframeCSSConfig",ln)}get uniqueIdentifier(){return this._uniqueIdentifier}iframeUrl(){return pn(this.options)}}const wn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),gn="WIDGET_EVENT";function yn(l){let f="widget/";return"disclosureRequestId"in l.configProps?f+=["disclosures",l.configProps.disclosureRequestId].join("/"):f+=l.request,f}function En(l){var y;const f=(y=l.isSandbox)!=null?y:!1,g=l.developmentUrl||(f?at:it),d=Object.entries(l.configProps).filter(([E,W])=>W||E==="disclosureRequestId").map(([E,W])=>`${E}=${encodeURIComponent(W)}`).join("&"),v=yn(l);return`${g}/${v}?sdk=web&sdkVersion=${je}&${d}`}let ee=null,Le=null;function ke(l=null){ee&&!ee.closed&&ee.focus(),l==null||l.preventDefault()}function Ue(){document.body.style.filter="",document.body.removeEventListener("click",ke)}function Sn(){Le=setInterval(()=>{(!ee||ee.closed)&&(Le&&clearInterval(Le),Ue())},cn)}function xn(l){const f=En(l),g=sn,d=un,v=window.screenLeft!==void 0?window.screenLeft:window.screenX,y=window.screenTop!==void 0?window.screenTop:window.screenY,E=window.innerWidth||document.documentElement.clientWidth||window.screen.width,W=window.innerHeight||document.documentElement.clientHeight||window.screen.height,q=E/window.screen.availWidth,U=(E-g)/2/q+v,H=(W-d)/2/q+y;document.body.style.filter="blur(5px)",document.body.addEventListener("click",ke),ee=window.open(f,"Soyio",`scrollbars=yes,
125
125
  width=${g},
126
126
  height=${d},
127
127
  top=${H},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soyio/soyio-widget",
3
- "version": "2.15.0",
3
+ "version": "2.15.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",
@@ -40,10 +40,11 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "post-robot": "^10.0.46",
43
- "vite": "^7.0.1",
43
+ "vite": "7.2.6",
44
44
  "vite-plugin-dts": "^4.5.4"
45
45
  },
46
46
  "resolutions": {
47
- "brace-expansion": "^1.1.12"
47
+ "brace-expansion": "^1.1.12",
48
+ "vite": "7.2.6"
48
49
  }
49
50
  }