@sesamy/sesamy-js 1.7.0 → 1.7.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.
@@ -339,13 +339,13 @@ let Y = class kt extends Error {
339
339
  constructor(e, n, r, i = null) {
340
340
  super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this, Dn.prototype);
341
341
  }
342
- }, It = class Un extends Y {
342
+ }, It = class Ln extends Y {
343
343
  constructor() {
344
- super("timeout", "Timeout"), Object.setPrototypeOf(this, Un.prototype);
344
+ super("timeout", "Timeout"), Object.setPrototypeOf(this, Ln.prototype);
345
345
  }
346
- }, xr = class Ln extends It {
346
+ }, xr = class Un extends It {
347
347
  constructor(e) {
348
- super(), this.popup = e, Object.setPrototypeOf(this, Ln.prototype);
348
+ super(), this.popup = e, Object.setPrototypeOf(this, Un.prototype);
349
349
  }
350
350
  }, Ar = class Rn extends Y {
351
351
  constructor(e) {
@@ -391,18 +391,18 @@ const Qe = () => window.crypto, dt = () => {
391
391
  }, h.postMessage(s, [c.port2]);
392
392
  });
393
393
  var s, h;
394
- }, Ur = async (t, e, n, r, i, o, a = 1e4) => i ? Dr(t, e, n, r, a, i, o) : Nr(t, r, a);
395
- async function Lr(t, e) {
394
+ }, Lr = async (t, e, n, r, i, o, a = 1e4) => i ? Dr(t, e, n, r, a, i, o) : Nr(t, r, a);
395
+ async function Ur(t, e) {
396
396
  var { baseUrl: n, timeout: r, audience: i, scope: o, auth0Client: a, useFormData: s } = t, h = Q(t, ["baseUrl", "timeout", "audience", "scope", "auth0Client", "useFormData"]);
397
397
  const p = s ? St(h) : JSON.stringify(h);
398
398
  return await async function(u, c, f, d, w, k, v) {
399
399
  let E, S = null;
400
400
  for (let $ = 0; $ < 3; $++)
401
401
  try {
402
- E = await Ur(u, f, d, w, k, v, c), S = null;
402
+ E = await Lr(u, f, d, w, k, v, c), S = null;
403
403
  break;
404
- } catch (L) {
405
- S = L;
404
+ } catch (U) {
405
+ S = U;
406
406
  }
407
407
  if (S)
408
408
  throw S;
@@ -990,7 +990,7 @@ let Br = class {
990
990
  }
991
991
  }
992
992
  async _requestToken(e, n) {
993
- const { nonceIn: r, organization: i } = n || {}, o = await Lr(Object.assign({ baseUrl: this.domainUrl, client_id: this.options.clientId, auth0Client: this.options.auth0Client, useFormData: this.options.useFormData, timeout: this.httpTimeoutMs }, e), this.worker), a = await this._verifyIdToken(o.id_token, r, i);
993
+ const { nonceIn: r, organization: i } = n || {}, o = await Ur(Object.assign({ baseUrl: this.domainUrl, client_id: this.options.clientId, auth0Client: this.options.auth0Client, useFormData: this.options.useFormData, timeout: this.httpTimeoutMs }, e), this.worker), a = await this._verifyIdToken(o.id_token, r, i);
994
994
  return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({}, o), { decodedToken: a, scope: e.scope, audience: e.audience || "default" }), o.scope ? { oauthTokenScope: o.scope } : null), { client_id: this.options.clientId })), this.cookieStorage.save(this.isAuthenticatedCookieName, !0, { daysUntilExpire: this.sessionCheckExpiryDays, cookieDomain: this.options.cookieDomain }), this._processOrgHint(i || a.claims.org_id), Object.assign(Object.assign({}, o), { decodedToken: a });
995
995
  }
996
996
  };
@@ -1496,7 +1496,7 @@ function wi(t) {
1496
1496
  async function $(_, I) {
1497
1497
  return await a.url(`/tallies/${_}/push`).post(I).json();
1498
1498
  }
1499
- async function L(_) {
1499
+ async function U(_) {
1500
1500
  return await o.url(`/products/${_}`).get().json();
1501
1501
  }
1502
1502
  async function R(_) {
@@ -1522,7 +1522,7 @@ function wi(t) {
1522
1522
  getTallies: P,
1523
1523
  deleteTally: j,
1524
1524
  pushTally: $,
1525
- getProduct: L,
1525
+ getProduct: U,
1526
1526
  autoOnboardProduct: R
1527
1527
  };
1528
1528
  }
@@ -1684,7 +1684,7 @@ function zi(t, e) {
1684
1684
  return n = this, r = arguments, p <= 0 ? (clearTimeout(o), o = null, a = h, i = t.apply(n, r)) : o || (o = setTimeout(s, p)), i;
1685
1685
  };
1686
1686
  }
1687
- var Ue = "global", Oe = ge + "global" + ge, Pe = typeof self === on && self.self === self && self || typeof global === on && global.global === global && global || void 0;
1687
+ var Le = "global", Oe = ge + "global" + ge, Pe = typeof self === on && self.self === self && self || typeof global === on && global.global === global && global || void 0;
1688
1688
  function ye(t) {
1689
1689
  return Pe[Oe][t];
1690
1690
  }
@@ -1697,7 +1697,7 @@ function Ce(t) {
1697
1697
  function xe(t, e, n) {
1698
1698
  var r;
1699
1699
  try {
1700
- if (Ut(t)) {
1700
+ if (Lt(t)) {
1701
1701
  var i = window[t];
1702
1702
  r = i[e].bind(i);
1703
1703
  }
@@ -1707,7 +1707,7 @@ function xe(t, e, n) {
1707
1707
  }
1708
1708
  Pe[Oe] || (Pe[Oe] = {});
1709
1709
  var Xe = {};
1710
- function Ut(t) {
1710
+ function Lt(t) {
1711
1711
  if (typeof Xe[t] !== Je)
1712
1712
  return Xe[t];
1713
1713
  try {
@@ -1807,7 +1807,7 @@ function je() {
1807
1807
  };
1808
1808
  });
1809
1809
  }
1810
- function Ui() {
1810
+ function Li() {
1811
1811
  var t = arguments;
1812
1812
  return function(e) {
1813
1813
  return function(n, r, i) {
@@ -1827,7 +1827,7 @@ var oe = ge + "anon_id", me = ge + "user_id", Se = ge + "user_traits", ne = "use
1827
1827
  }, pluginReadyType: function(t) {
1828
1828
  return "ready:" + t;
1829
1829
  } }), cn = /^utm_/, un = /^an_prop_/, ln = /^an_trait_/;
1830
- function Li(t) {
1830
+ function Ui(t) {
1831
1831
  var e = t.storage.setItem;
1832
1832
  return function(n) {
1833
1833
  return function(r) {
@@ -1961,16 +1961,16 @@ var mt = function(t) {
1961
1961
  return function(S, g, l) {
1962
1962
  var b = g.config, P = g.name, j = P + "." + S.type;
1963
1963
  l && (j = l.event);
1964
- var $ = S.type.match(_e) ? /* @__PURE__ */ function(L, R, _, I, C) {
1964
+ var $ = S.type.match(_e) ? /* @__PURE__ */ function(U, R, _, I, C) {
1965
1965
  return function(D, T) {
1966
- var W = I ? I.name : L, J = T && Ze(T) ? T : _;
1967
- if (I && (!(J = T && Ze(T) ? T : [L]).includes(L) || J.length !== 1))
1968
- throw new Error("Method " + R + " can only abort " + L + " plugin. " + JSON.stringify(J) + " input valid");
1966
+ var W = I ? I.name : U, J = T && Ze(T) ? T : _;
1967
+ if (I && (!(J = T && Ze(T) ? T : [U]).includes(U) || J.length !== 1))
1968
+ throw new Error("Method " + R + " can only abort " + U + " plugin. " + JSON.stringify(J) + " input valid");
1969
1969
  return A({}, C, { abort: { reason: D, plugins: J, caller: R, _: W } });
1970
1970
  };
1971
- }(P, j, E, l, S) : /* @__PURE__ */ function(L, R) {
1971
+ }(P, j, E, l, S) : /* @__PURE__ */ function(U, R) {
1972
1972
  return function() {
1973
- throw new Error(L.type + " action not cancellable. Remove abort in " + R);
1973
+ throw new Error(U.type + " action not cancellable. Remove abort in " + R);
1974
1974
  };
1975
1975
  }(S, j);
1976
1976
  return { payload: Wi(S), instance: v, config: b || {}, abort: $ };
@@ -1988,7 +1988,7 @@ var mt = function(t) {
1988
1988
  }
1989
1989
  var P = function() {
1990
1990
  if (e.namespaced && e.namespaced[g])
1991
- return Promise.resolve(e.namespaced[g].reduce(function(j, $, L) {
1991
+ return Promise.resolve(e.namespaced[g].reduce(function(j, $, U) {
1992
1992
  try {
1993
1993
  return Promise.resolve(j).then(function(R) {
1994
1994
  return $.method && V($.method) ? (function(D, T) {
@@ -2031,8 +2031,8 @@ var mt = function(t) {
2031
2031
  return l && gt({ data: j, method: c, instance: r, store: s }), Promise.resolve(j);
2032
2032
  if (k.hasOwnProperty(b) && k[b] === !0)
2033
2033
  return s.dispatch({ type: "queue", plugin: b, payload: $, _: { called: "queue", from: "queueMechanism" } }), Promise.resolve(j);
2034
- var L = w(v[b], o[b]);
2035
- return Promise.resolve(P[c]({ abort: L.abort, payload: $, instance: r, config: mn(b, p, o), plugins: p })).then(function(R) {
2034
+ var U = w(v[b], o[b]);
2035
+ return Promise.resolve(P[c]({ abort: U.abort, payload: $, instance: r, config: mn(b, p, o), plugins: p })).then(function(R) {
2036
2036
  var _ = X(R) ? R : {}, I = A({}, j, _), C = v[b];
2037
2037
  if (yt(C, b))
2038
2038
  gt({ data: C, method: c, instance: r, pluginName: b, store: s });
@@ -2128,8 +2128,8 @@ function Ki(t, e, n) {
2128
2128
  return or(l, function() {
2129
2129
  return b({ config: j });
2130
2130
  }, 1e4).then(function($) {
2131
- return r[P] || (i.dispatch({ type: x.pluginReadyType(P), name: P, events: Object.keys(l).filter(function(L) {
2132
- return !Ot.includes(L);
2131
+ return r[P] || (i.dispatch({ type: x.pluginReadyType(P), name: P, events: Object.keys(l).filter(function(U) {
2132
+ return !Ot.includes(U);
2133
2133
  }) }), r[P] = !0), k = k.concat(P), l;
2134
2134
  }).catch(function($) {
2135
2135
  if ($ instanceof Error)
@@ -2150,10 +2150,10 @@ function Ki(t, e, n) {
2150
2150
  return ar(i, e, t);
2151
2151
  }, 0), Promise.resolve(function(l, b, P, j, $) {
2152
2152
  try {
2153
- var L = V(b) ? b() : b, R = l.type, _ = R.replace(_e, "");
2153
+ var U = V(b) ? b() : b, R = l.type, _ = R.replace(_e, "");
2154
2154
  if (l._ && l._.called)
2155
2155
  return Promise.resolve(l);
2156
- var I = P.getState(), C = (W = L, (J = I.plugins) === void 0 && (J = {}), (Ae = l.options) === void 0 && (Ae = {}), Object.keys(W).filter(function(m) {
2156
+ var I = P.getState(), C = (W = U, (J = I.plugins) === void 0 && (J = {}), (Ae = l.options) === void 0 && (Ae = {}), Object.keys(W).filter(function(m) {
2157
2157
  var y = Ae.plugins || {};
2158
2158
  return Si(y[m]) ? y[m] : y.all !== !1 && (!J[m] || J[m].enabled !== !1);
2159
2159
  }).map(function(m) {
@@ -2163,7 +2163,7 @@ function Ki(t, e, n) {
2163
2163
  var y = I.plugins[m];
2164
2164
  return l.plugins.includes(m) && !y.initialized;
2165
2165
  }).map(function(m) {
2166
- return L[m];
2166
+ return U[m];
2167
2167
  }));
2168
2168
  var D = C.map(function(m) {
2169
2169
  return m.name;
@@ -2171,19 +2171,19 @@ function Ki(t, e, n) {
2171
2171
  var z = yn(m).map(function(N) {
2172
2172
  return gn(N, y);
2173
2173
  });
2174
- return y.reduce(function(N, U) {
2175
- var F = U.name, Z = yn(m, F).map(function($e) {
2174
+ return y.reduce(function(N, L) {
2175
+ var F = L.name, Z = yn(m, F).map(function($e) {
2176
2176
  return gn($e, y);
2177
2177
  }), K = Z[0], M = Z[1], q = Z[2];
2178
2178
  return K.length && (N.beforeNS[F] = K), M.length && (N.duringNS[F] = M), q.length && (N.afterNS[F] = q), N;
2179
2179
  }, { before: z[0], beforeNS: {}, during: z[1], duringNS: {}, after: z[2], afterNS: {} });
2180
2180
  }(R, C);
2181
- return Promise.resolve(mt({ action: l, data: { exact: T.before, namespaced: T.beforeNS }, state: I, allPlugins: L, allMatches: T, instance: P, store: j, EVENTS: $ })).then(function(m) {
2181
+ return Promise.resolve(mt({ action: l, data: { exact: T.before, namespaced: T.beforeNS }, state: I, allPlugins: U, allMatches: T, instance: P, store: j, EVENTS: $ })).then(function(m) {
2182
2182
  function y() {
2183
2183
  var N = function() {
2184
2184
  if (R.match(_e))
2185
- return Promise.resolve(mt({ action: A({}, O, { type: _ + "End" }), data: { exact: T.after, namespaced: T.afterNS }, state: I, allPlugins: L, allMatches: T, instance: P, store: j, EVENTS: $ })).then(function(U) {
2186
- U.meta && U.meta.hasCallback && hn(U.meta.rid, { payload: U });
2185
+ return Promise.resolve(mt({ action: A({}, O, { type: _ + "End" }), data: { exact: T.after, namespaced: T.afterNS }, state: I, allPlugins: U, allMatches: T, instance: P, store: j, EVENTS: $ })).then(function(L) {
2186
+ L.meta && L.meta.hasCallback && hn(L.meta.rid, { payload: L });
2187
2187
  });
2188
2188
  }();
2189
2189
  return N && N.then ? N.then(function() {
@@ -2194,7 +2194,7 @@ function Ki(t, e, n) {
2194
2194
  return m;
2195
2195
  var O, z = function() {
2196
2196
  if (R !== _)
2197
- return Promise.resolve(mt({ action: A({}, m, { type: _ }), data: { exact: T.during, namespaced: T.duringNS }, state: I, allPlugins: L, allMatches: T, instance: P, store: j, EVENTS: $ })).then(function(N) {
2197
+ return Promise.resolve(mt({ action: A({}, m, { type: _ }), data: { exact: T.during, namespaced: T.duringNS }, state: I, allPlugins: U, allMatches: T, instance: P, store: j, EVENTS: $ })).then(function(N) {
2198
2198
  O = N;
2199
2199
  });
2200
2200
  O = m;
@@ -2431,16 +2431,16 @@ function oo(t) {
2431
2431
  if (y.NAMESPACE && (y.name = y.NAMESPACE), !y.name)
2432
2432
  throw new Error("https://lytics.dev/errors/1");
2433
2433
  y.config || (y.config = {});
2434
- var O = y.EVENTS ? Object.keys(y.EVENTS).map(function(U) {
2435
- return y.EVENTS[U];
2434
+ var O = y.EVENTS ? Object.keys(y.EVENTS).map(function(L) {
2435
+ return y.EVENTS[L];
2436
2436
  }) : [];
2437
- m.pluginEnabled[y.name] = !(y.enabled === !1 || y.config.enabled === !1), delete y.enabled, y.methods && (m.methods[y.name] = Object.keys(y.methods).reduce(function(U, F) {
2437
+ m.pluginEnabled[y.name] = !(y.enabled === !1 || y.config.enabled === !1), delete y.enabled, y.methods && (m.methods[y.name] = Object.keys(y.methods).reduce(function(L, F) {
2438
2438
  var Z;
2439
- return U[F] = (Z = y.methods[F], function() {
2439
+ return L[F] = (Z = y.methods[F], function() {
2440
2440
  for (var K = Array.prototype.slice.call(arguments), M = new Array(Z.length), q = 0; q < K.length; q++)
2441
2441
  M[q] = K[q];
2442
2442
  return M[M.length] = b, Z.apply({ instance: b }, M);
2443
- }), U;
2443
+ }), L;
2444
2444
  }, {}), delete y.methods);
2445
2445
  var z = Object.keys(y).concat(O), N = new Set(m.events.concat(z));
2446
2446
  if (m.events = Array.from(N), m.pluginsArray = m.pluginsArray.concat(y), m.plugins[y.name])
@@ -2472,11 +2472,11 @@ function oo(t) {
2472
2472
  });
2473
2473
  } }, r.methods), l = !1, b = { identify: function(m, y, O, z) {
2474
2474
  try {
2475
- var N = ie(m) ? m : null, U = X(m) ? m : y, F = O || {}, Z = b.user();
2475
+ var N = ie(m) ? m : null, L = X(m) ? m : y, F = O || {}, Z = b.user();
2476
2476
  ve(Pt(ne), N);
2477
- var K = N || U.userId || o(ne, b, U);
2477
+ var K = N || L.userId || o(ne, b, L);
2478
2478
  return Promise.resolve(new Promise(function(M) {
2479
- T.dispatch(A({ type: x.identifyStart, userId: K, traits: U || {}, options: F, anonymousId: Z.anonymousId }, Z.id && Z.id !== N && { previousId: Z.id }), M, [y, O, z]);
2479
+ T.dispatch(A({ type: x.identifyStart, userId: K, traits: L || {}, options: F, anonymousId: Z.anonymousId }, Z.id && Z.id !== N && { previousId: Z.id }), M, [y, O, z]);
2480
2480
  }));
2481
2481
  } catch (M) {
2482
2482
  return Promise.reject(M);
@@ -2486,9 +2486,9 @@ function oo(t) {
2486
2486
  var N = X(m) ? m.event : m;
2487
2487
  if (!N || !ie(N))
2488
2488
  throw new Error("EventMissing");
2489
- var U = X(m) ? m : y || {}, F = X(O) ? O : {};
2489
+ var L = X(m) ? m : y || {}, F = X(O) ? O : {};
2490
2490
  return Promise.resolve(new Promise(function(Z) {
2491
- T.dispatch({ type: x.trackStart, event: N, properties: U, options: F, userId: o(ne, b, y), anonymousId: o(Ie, b, y) }, Z, [y, O, z]);
2491
+ T.dispatch({ type: x.trackStart, event: N, properties: L, options: F, userId: o(ne, b, y), anonymousId: o(Ie, b, y) }, Z, [y, O, z]);
2492
2492
  }));
2493
2493
  } catch (Z) {
2494
2494
  return Promise.reject(Z);
@@ -2496,11 +2496,11 @@ function oo(t) {
2496
2496
  }, page: function(m, y, O) {
2497
2497
  try {
2498
2498
  var z = X(m) ? m : {}, N = X(y) ? y : {};
2499
- return Promise.resolve(new Promise(function(U) {
2500
- T.dispatch({ type: x.pageStart, properties: qi(z), options: N, userId: o(ne, b, z), anonymousId: o(Ie, b, z) }, U, [m, y, O]);
2499
+ return Promise.resolve(new Promise(function(L) {
2500
+ T.dispatch({ type: x.pageStart, properties: qi(z), options: N, userId: o(ne, b, z), anonymousId: o(Ie, b, z) }, L, [m, y, O]);
2501
2501
  }));
2502
- } catch (U) {
2503
- return Promise.reject(U);
2502
+ } catch (L) {
2503
+ return Promise.reject(L);
2504
2504
  }
2505
2505
  }, user: function(m) {
2506
2506
  if (m === ne || m === "id")
@@ -2541,15 +2541,15 @@ function oo(t) {
2541
2541
  d(z, Ye), d(N, Ge);
2542
2542
  };
2543
2543
  }
2544
- var U = m.match(O) ? Ye : Ge, F = function(Z) {
2544
+ var L = m.match(O) ? Ye : Ge, F = function(Z) {
2545
2545
  return function(K) {
2546
2546
  return function(M) {
2547
2547
  return M.type === m && y({ payload: M, instance: b, plugins: a, abort: k }), K(M);
2548
2548
  };
2549
2549
  };
2550
2550
  };
2551
- return f(F, U), function() {
2552
- return d(F, U);
2551
+ return f(F, L), function() {
2552
+ return d(F, L);
2553
2553
  };
2554
2554
  }, once: function(m, y) {
2555
2555
  if (!m || !V(y))
@@ -2581,10 +2581,10 @@ function oo(t) {
2581
2581
  return O.meta || (O.meta = _n()), y(O);
2582
2582
  };
2583
2583
  };
2584
- }, w(Ye), Ki(b, u, { all: p, plugins: s }), Fi(i), Li(b), Mi(b), w(Ge)]), j = { context: to, user: Ri(i), page: eo, track: Vi, plugins: Ji(u), queue: Gi }, $ = je, L = je;
2584
+ }, w(Ye), Ki(b, u, { all: p, plugins: s }), Fi(i), Ui(b), Mi(b), w(Ge)]), j = { context: to, user: Ri(i), page: eo, track: Vi, plugins: Ji(u), queue: Gi }, $ = je, U = je;
2585
2585
  if (H && t.debug) {
2586
2586
  var R = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
2587
- R && ($ = R({ trace: !0, traceLimit: 25 })), L = function() {
2587
+ R && ($ = R({ trace: !0, traceLimit: 25 })), U = function() {
2588
2588
  return arguments.length === 0 ? pr() : X(typeof arguments[0]) ? Sn() : Sn().apply(null, arguments);
2589
2589
  };
2590
2590
  }
@@ -2593,14 +2593,14 @@ function oo(t) {
2593
2593
  return no.includes(O) || (y[O] = m[O]), y;
2594
2594
  }, {});
2595
2595
  }(t), C = r.pluginsArray.reduce(function(m, y) {
2596
- var O = y.name, z = y.config, N = y.loaded, U = r.pluginEnabled[O];
2597
- return m[O] = { enabled: U, initialized: !!U && !y.initialize, loaded: !!N({ config: z }), config: z }, m;
2596
+ var O = y.name, z = y.config, N = y.loaded, L = r.pluginEnabled[O];
2597
+ return m[O] = { enabled: L, initialized: !!L && !y.initialize, loaded: !!N({ config: z }), config: z }, m;
2598
2598
  }, {}), D = { context: I, user: S, plugins: C }, T = ir(function(m) {
2599
2599
  for (var y = Object.keys(m), O = {}, z = 0; z < y.length; z++) {
2600
2600
  var N = y[z];
2601
2601
  typeof m[N] === re && (O[N] = m[N]);
2602
2602
  }
2603
- var U, F = Object.keys(O);
2603
+ var L, F = Object.keys(O);
2604
2604
  try {
2605
2605
  (function(Z) {
2606
2606
  Object.keys(Z).forEach(function(K) {
@@ -2610,11 +2610,11 @@ function oo(t) {
2610
2610
  });
2611
2611
  })(O);
2612
2612
  } catch (Z) {
2613
- U = Z;
2613
+ L = Z;
2614
2614
  }
2615
2615
  return function(Z, K) {
2616
- if (Z === void 0 && (Z = {}), U)
2617
- throw U;
2616
+ if (Z === void 0 && (Z = {}), L)
2617
+ throw L;
2618
2618
  for (var M = !1, q = {}, $e = 0; $e < F.length; $e++) {
2619
2619
  var Fe = F[$e], Ft = Z[Fe], lt = (0, O[Fe])(Ft, K);
2620
2620
  if (typeof lt === te) {
@@ -2625,7 +2625,7 @@ function oo(t) {
2625
2625
  }
2626
2626
  return M ? q : Z;
2627
2627
  };
2628
- }(A({}, j, e)), D, L($(Ui.apply(void 0, P))));
2628
+ }(A({}, j, e)), D, U($(Li.apply(void 0, P))));
2629
2629
  T.dispatch = (_ = T.dispatch, function(m, y, O) {
2630
2630
  var z = A({}, m, { meta: _n(m.meta, y, vt(O)) });
2631
2631
  return _.apply(null, [z]);
@@ -2648,7 +2648,7 @@ function oo(t) {
2648
2648
  }, 3e3);
2649
2649
  }(T, u, b), b;
2650
2650
  }
2651
- var Ye = "before", Ge = "after", Le = "cookie", de = yr(), mr = ct, ao = ct;
2651
+ var Ye = "before", Ge = "after", Ue = "cookie", de = yr(), mr = ct, ao = ct;
2652
2652
  function gr(t) {
2653
2653
  return de ? ct(t, "", -1) : Ce(t);
2654
2654
  }
@@ -2669,11 +2669,11 @@ function ct(t, e, n, r, i, o) {
2669
2669
  return de === !1 && (a ? ve(t, e) : ye(t)), a ? document.cookie = t + "=" + encodeURIComponent(e) + (n ? "; expires=" + new Date(+/* @__PURE__ */ new Date() + 1e3 * n).toUTCString() + (r ? "; path=" + r : "") + (i ? "; domain=" + i : "") + (o ? "; secure" : "") : "") : decodeURIComponent((("; " + document.cookie).split("; " + t + "=")[1] || "").split(";")[0]);
2670
2670
  }
2671
2671
  }
2672
- var Re = "localStorage", so = Ut.bind(null, "localStorage");
2672
+ var Re = "localStorage", so = Lt.bind(null, "localStorage");
2673
2673
  xe("localStorage", "getItem", ye);
2674
2674
  xe("localStorage", "setItem", ve);
2675
2675
  xe("localStorage", "removeItem", Ce);
2676
- var Me = "sessionStorage", co = Ut.bind(null, "sessionStorage");
2676
+ var Me = "sessionStorage", co = Lt.bind(null, "sessionStorage");
2677
2677
  xe("sessionStorage", "getItem", ye);
2678
2678
  xe("sessionStorage", "setItem", ve);
2679
2679
  xe("sessionStorage", "removeItem", Ce);
@@ -2695,7 +2695,7 @@ function Ee(t) {
2695
2695
  var uo = so(), lo = co(), ho = yr();
2696
2696
  function vr(t, e) {
2697
2697
  if (t) {
2698
- var n = Lt(e), r = !Wt(n), i = Rt(n) ? Ee(localStorage.getItem(t)) : void 0;
2698
+ var n = Ut(e), r = !Wt(n), i = Rt(n) ? Ee(localStorage.getItem(t)) : void 0;
2699
2699
  if (r && !ke(i))
2700
2700
  return i;
2701
2701
  var o = Mt(n) ? Ee(mr(t)) : void 0;
@@ -2710,24 +2710,24 @@ function vr(t, e) {
2710
2710
  }
2711
2711
  function fo(t, e, n) {
2712
2712
  if (t && !ke(e)) {
2713
- var r = {}, i = Lt(n), o = JSON.stringify(e), a = !Wt(i);
2714
- return Rt(i) && (r[Re] = Be(Re, e, Ee(localStorage.getItem(t))), localStorage.setItem(t, o), a) ? r[Re] : Mt(i) && (r[Le] = Be(Le, e, Ee(mr(t))), ao(t, o), a) ? r[Le] : Zt(i) && (r[Me] = Be(Me, e, Ee(sessionStorage.getItem(t))), sessionStorage.setItem(t, o), a) ? r[Me] : (r[Ue] = Be(Ue, e, ye(t)), ve(t, e), a ? r[Ue] : r);
2713
+ var r = {}, i = Ut(n), o = JSON.stringify(e), a = !Wt(i);
2714
+ return Rt(i) && (r[Re] = Be(Re, e, Ee(localStorage.getItem(t))), localStorage.setItem(t, o), a) ? r[Re] : Mt(i) && (r[Ue] = Be(Ue, e, Ee(mr(t))), ao(t, o), a) ? r[Ue] : Zt(i) && (r[Me] = Be(Me, e, Ee(sessionStorage.getItem(t))), sessionStorage.setItem(t, o), a) ? r[Me] : (r[Le] = Be(Le, e, ye(t)), ve(t, e), a ? r[Le] : r);
2715
2715
  }
2716
2716
  }
2717
2717
  function po(t, e) {
2718
2718
  if (t) {
2719
- var n = Lt(e), r = vr(t, Qn), i = {};
2720
- return !ke(r.localStorage) && Rt(n) && (localStorage.removeItem(t), i[Re] = r.localStorage), !ke(r.cookie) && Mt(n) && (gr(t), i[Le] = r.cookie), !ke(r.sessionStorage) && Zt(n) && (sessionStorage.removeItem(t), i[Me] = r.sessionStorage), !ke(r.global) && ut(n, Ue) && (Ce(t), i[Ue] = r.global), i;
2719
+ var n = Ut(e), r = vr(t, Qn), i = {};
2720
+ return !ke(r.localStorage) && Rt(n) && (localStorage.removeItem(t), i[Re] = r.localStorage), !ke(r.cookie) && Mt(n) && (gr(t), i[Ue] = r.cookie), !ke(r.sessionStorage) && Zt(n) && (sessionStorage.removeItem(t), i[Me] = r.sessionStorage), !ke(r.global) && ut(n, Le) && (Ce(t), i[Le] = r.global), i;
2721
2721
  }
2722
2722
  }
2723
- function Lt(t) {
2723
+ function Ut(t) {
2724
2724
  return t ? ie(t) ? t : t.storage : qn;
2725
2725
  }
2726
2726
  function Rt(t) {
2727
2727
  return uo && ut(t, Re);
2728
2728
  }
2729
2729
  function Mt(t) {
2730
- return ho && ut(t, Le);
2730
+ return ho && ut(t, Ue);
2731
2731
  }
2732
2732
  function Zt(t) {
2733
2733
  return lo && ut(t, Me);
@@ -2847,16 +2847,16 @@ function So(t) {
2847
2847
  b ? P = "initial" : p <= S && (P = "down");
2848
2848
  var j = v, $ = d;
2849
2849
  (P === "up" || b) && (j = v.slice().reverse(), $ = d.slice().reverse());
2850
- var L = $.reduce(function(I, C, D) {
2850
+ var U = $.reduce(function(I, C, D) {
2851
2851
  var T = j[D];
2852
2852
  return h.includes(C) && S <= T && (h = h.filter(function(W) {
2853
2853
  return W !== C;
2854
2854
  }), I.singleFunction = C), P === "down" && !a.includes(C) && S >= T && C > o ? (s.push(C), I.callbacks = I.callbacks.concat(C), I) : P === "up" && !a.includes(C) && S <= T && C <= g ? (I.foundFunc = [C], I) : (b && S >= T && I.foundFunc.length === 0 && (I.foundFunc = [C]), !s.includes(C) && S >= T && (s.push(C), I.singleFunction ? h.push(C) : I.singleFunction = C), I);
2855
2855
  }, { foundFunc: [], singleFunction: null, callbacks: [], direction: P });
2856
- if (p = S, P === "down" && L.callbacks && L.callbacks.forEach(function(I) {
2856
+ if (p = S, P === "down" && U.callbacks && U.callbacks.forEach(function(I) {
2857
2857
  V(t[I]) && (t[I]({ trigger: I, direction: P, scrollMin: c, scrollMax: u, range: [c, u] }), a.push(I));
2858
- }), L.singleFunction) {
2859
- var R = L.singleFunction, _ = L.direction;
2858
+ }), U.singleFunction) {
2859
+ var R = U.singleFunction, _ = U.direction;
2860
2860
  V(t[R]) && t[R]({ trigger: R, direction: _, scrollMin: c, scrollMax: u, range: [c, u] }), a.push(R);
2861
2861
  }
2862
2862
  }
@@ -3106,9 +3106,9 @@ function zo({ clientId: t, enabled: e = !0, endpoint: n = Qr }) {
3106
3106
  });
3107
3107
  }
3108
3108
  });
3109
- Uo(document.body, () => {
3109
+ Lo(document.body, () => {
3110
3110
  r.flush();
3111
- }), Lo(document.body, () => {
3111
+ }), Uo(document.body, () => {
3112
3112
  r.handleVisibilityChange();
3113
3113
  }), window.addEventListener(ae.AUTHENTICATED, async (i) => {
3114
3114
  const o = i;
@@ -3217,7 +3217,7 @@ function Do() {
3217
3217
  return kr = !0, Kt.flush();
3218
3218
  }
3219
3219
  const Sr = /* @__PURE__ */ new Map();
3220
- function Uo(t, e) {
3220
+ function Lo(t, e) {
3221
3221
  Sr.set(t, e);
3222
3222
  }
3223
3223
  window.addEventListener("beforeunload", () => {
@@ -3226,7 +3226,7 @@ window.addEventListener("beforeunload", () => {
3226
3226
  }), Do();
3227
3227
  });
3228
3228
  const _r = /* @__PURE__ */ new Map();
3229
- function Lo(t, e) {
3229
+ function Uo(t, e) {
3230
3230
  _r.set(t, e);
3231
3231
  }
3232
3232
  window.addEventListener("visibilitychange", () => {
@@ -3234,7 +3234,12 @@ window.addEventListener("visibilitychange", () => {
3234
3234
  t.bind(e)();
3235
3235
  });
3236
3236
  });
3237
- function Ro(t) {
3237
+ const Ro = "sesamySignedURLs";
3238
+ function Mo() {
3239
+ const t = sessionStorage.getItem(Ro);
3240
+ return t ? JSON.parse(t) : [];
3241
+ }
3242
+ function Zo(t) {
3238
3243
  const {
3239
3244
  getEntitlement: e,
3240
3245
  getEntitlements: n,
@@ -3275,7 +3280,8 @@ function Ro(t) {
3275
3280
  entitlements: {
3276
3281
  get: e,
3277
3282
  list: n,
3278
- access: r
3283
+ access: r,
3284
+ signedLinks: Mo
3279
3285
  },
3280
3286
  contracts: {
3281
3287
  get: i,
@@ -3301,15 +3307,15 @@ function Ro(t) {
3301
3307
  get: g,
3302
3308
  autoOnboard: l
3303
3309
  },
3304
- getVersion: Mo,
3310
+ getVersion: Wo,
3305
3311
  clearCache: ue
3306
3312
  };
3307
3313
  return t.namespace && (window[t.namespace] = b), b;
3308
3314
  }
3309
- function Mo() {
3315
+ function Wo() {
3310
3316
  return Dt;
3311
3317
  }
3312
- function Zo() {
3318
+ function Ko() {
3313
3319
  const t = new URLSearchParams(window.location.hash.substring(1)), e = t.get("access_token"), n = t.get("expires_in");
3314
3320
  if (e && n) {
3315
3321
  Xn(e, parseInt(n, 10));
@@ -3317,7 +3323,7 @@ function Zo() {
3317
3323
  t.delete("access_token"), t.delete("expires_in"), r.hash = t.toString(), window.history.replaceState(null, "", r);
3318
3324
  }
3319
3325
  }
3320
- async function Wo(t) {
3326
+ async function Fo(t) {
3321
3327
  zo({
3322
3328
  clientId: t.clientId,
3323
3329
  // The default client id can be overridden by the config
@@ -3327,19 +3333,19 @@ async function Wo(t) {
3327
3333
  // The default client id can be overridden by the config
3328
3334
  ...t.auth
3329
3335
  });
3330
- const e = Ro(t.api || {});
3331
- return We(ae.READY, {}), Zo(), e;
3336
+ const e = Zo(t.api || {});
3337
+ return We(ae.READY, {}), Ko(), e;
3332
3338
  }
3333
3339
  if (typeof document < "u") {
3334
3340
  const t = document.getElementById("sesamy-js");
3335
3341
  if (t != null && t.textContent)
3336
3342
  try {
3337
3343
  const e = JSON.parse(t.textContent);
3338
- Wo(e);
3344
+ Fo(e);
3339
3345
  } catch (e) {
3340
3346
  console.error("Failed to parse config", e);
3341
3347
  }
3342
3348
  }
3343
3349
  export {
3344
- Wo as init
3350
+ Fo as init
3345
3351
  };
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "registry": "https://registry.npmjs.org/",
7
7
  "tag": "latest"
8
8
  },
9
- "version": "1.7.0",
9
+ "version": "1.7.1",
10
10
  "main": "dist/sesamy-js.cjs",
11
11
  "module": "dist/sesamy-js.mjs",
12
12
  "types": "dist/sesamy-js.d.ts",