@sesamy/sesamy-js 1.10.0 → 1.10.2
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/README.md +1 -0
- package/dist/sesamy-js.cjs +5 -5
- package/dist/sesamy-js.d.ts +15 -2
- package/dist/sesamy-js.iife.js +5 -5
- package/dist/sesamy-js.mjs +1044 -1027
- package/package.json +1 -1
package/dist/sesamy-js.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var q = (t, e, n) => (
|
|
1
|
+
var Ur = Object.defineProperty;
|
|
2
|
+
var zr = (t, e, n) => e in t ? Ur(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var q = (t, e, n) => (zr(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
4
|
function ue(t, e) {
|
|
5
5
|
const n = new CustomEvent(t, {
|
|
6
6
|
detail: e,
|
|
@@ -9,7 +9,7 @@ function ue(t, e) {
|
|
|
9
9
|
});
|
|
10
10
|
dispatchEvent(n);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function ne(t, e) {
|
|
13
13
|
var n = {};
|
|
14
14
|
for (var r in t)
|
|
15
15
|
Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
|
|
@@ -21,13 +21,13 @@ function te(t, e) {
|
|
|
21
21
|
return n;
|
|
22
22
|
}
|
|
23
23
|
var he = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
24
|
-
function
|
|
24
|
+
function At(t) {
|
|
25
25
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function $t(t, e) {
|
|
28
28
|
return t(e = { exports: {} }, e.exports), e.exports;
|
|
29
29
|
}
|
|
30
|
-
var de =
|
|
30
|
+
var de = $t(function(t, e) {
|
|
31
31
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
32
32
|
var n = function() {
|
|
33
33
|
function r() {
|
|
@@ -58,48 +58,48 @@ var de = At(function(t, e) {
|
|
|
58
58
|
return n.getInstance();
|
|
59
59
|
};
|
|
60
60
|
});
|
|
61
|
-
|
|
62
|
-
var
|
|
63
|
-
var n = he && he.__awaiter || function(u, c,
|
|
64
|
-
return new (
|
|
65
|
-
function v(
|
|
61
|
+
At(de);
|
|
62
|
+
var Rr = At($t(function(t, e) {
|
|
63
|
+
var n = he && he.__awaiter || function(u, c, m, d) {
|
|
64
|
+
return new (m || (m = Promise))(function(w, k) {
|
|
65
|
+
function v(y) {
|
|
66
66
|
try {
|
|
67
|
-
|
|
67
|
+
S(d.next(y));
|
|
68
68
|
} catch (l) {
|
|
69
69
|
k(l);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function _(y) {
|
|
73
73
|
try {
|
|
74
|
-
|
|
74
|
+
S(d.throw(y));
|
|
75
75
|
} catch (l) {
|
|
76
76
|
k(l);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
|
|
81
|
-
l(
|
|
82
|
-
}).then(v,
|
|
79
|
+
function S(y) {
|
|
80
|
+
y.done ? w(y.value) : new m(function(l) {
|
|
81
|
+
l(y.value);
|
|
82
|
+
}).then(v, _);
|
|
83
83
|
}
|
|
84
|
-
|
|
84
|
+
S((d = d.apply(u, c || [])).next());
|
|
85
85
|
});
|
|
86
86
|
}, r = he && he.__generator || function(u, c) {
|
|
87
|
-
var
|
|
87
|
+
var m, d, w, k, v = { label: 0, sent: function() {
|
|
88
88
|
if (1 & w[0])
|
|
89
89
|
throw w[1];
|
|
90
90
|
return w[1];
|
|
91
91
|
}, trys: [], ops: [] };
|
|
92
|
-
return k = { next:
|
|
92
|
+
return k = { next: _(0), throw: _(1), return: _(2) }, typeof Symbol == "function" && (k[Symbol.iterator] = function() {
|
|
93
93
|
return this;
|
|
94
94
|
}), k;
|
|
95
|
-
function
|
|
96
|
-
return function(
|
|
95
|
+
function _(S) {
|
|
96
|
+
return function(y) {
|
|
97
97
|
return function(l) {
|
|
98
|
-
if (
|
|
98
|
+
if (m)
|
|
99
99
|
throw new TypeError("Generator is already executing.");
|
|
100
100
|
for (; v; )
|
|
101
101
|
try {
|
|
102
|
-
if (
|
|
102
|
+
if (m = 1, d && (w = 2 & l[0] ? d.return : l[0] ? d.throw || ((w = d.return) && w.call(d), 0) : d.next) && !(w = w.call(d, l[1])).done)
|
|
103
103
|
return w;
|
|
104
104
|
switch (d = 0, w && (l = [2 & l[0], w.value]), l[0]) {
|
|
105
105
|
case 0:
|
|
@@ -138,12 +138,12 @@ var Ur = xt(At(function(t, e) {
|
|
|
138
138
|
} catch (b) {
|
|
139
139
|
l = [6, b], d = 0;
|
|
140
140
|
} finally {
|
|
141
|
-
|
|
141
|
+
m = w = 0;
|
|
142
142
|
}
|
|
143
143
|
if (5 & l[0])
|
|
144
144
|
throw l[1];
|
|
145
145
|
return { value: l[0] ? l[1] : void 0, done: !0 };
|
|
146
|
-
}([
|
|
146
|
+
}([S, y]);
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
149
|
}, i = he;
|
|
@@ -174,7 +174,7 @@ var Ur = xt(At(function(t, e) {
|
|
|
174
174
|
});
|
|
175
175
|
}, setItem: function(u, c) {
|
|
176
176
|
return n(i, void 0, void 0, function() {
|
|
177
|
-
return r(this, function(
|
|
177
|
+
return r(this, function(m) {
|
|
178
178
|
throw new Error("Unsupported");
|
|
179
179
|
});
|
|
180
180
|
});
|
|
@@ -194,54 +194,54 @@ var Ur = xt(At(function(t, e) {
|
|
|
194
194
|
return setTimeout(c, u);
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
for (var c = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",
|
|
199
|
-
|
|
200
|
-
return
|
|
197
|
+
function f(u) {
|
|
198
|
+
for (var c = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz", m = "", d = 0; d < u; d++)
|
|
199
|
+
m += c[Math.floor(Math.random() * c.length)];
|
|
200
|
+
return m;
|
|
201
201
|
}
|
|
202
202
|
var p = function() {
|
|
203
203
|
function u(c) {
|
|
204
|
-
this.acquiredIatSet = /* @__PURE__ */ new Set(), this.storageHandler = void 0, this.id = Date.now().toString() +
|
|
204
|
+
this.acquiredIatSet = /* @__PURE__ */ new Set(), this.storageHandler = void 0, this.id = Date.now().toString() + f(15), this.acquireLock = this.acquireLock.bind(this), this.releaseLock = this.releaseLock.bind(this), this.releaseLock__private__ = this.releaseLock__private__.bind(this), this.waitForSomethingToChange = this.waitForSomethingToChange.bind(this), this.refreshLockWhileAcquired = this.refreshLockWhileAcquired.bind(this), this.storageHandler = c, u.waiters === void 0 && (u.waiters = []);
|
|
205
205
|
}
|
|
206
|
-
return u.prototype.acquireLock = function(c,
|
|
207
|
-
return
|
|
208
|
-
var d, w, k, v,
|
|
206
|
+
return u.prototype.acquireLock = function(c, m) {
|
|
207
|
+
return m === void 0 && (m = 5e3), n(this, void 0, void 0, function() {
|
|
208
|
+
var d, w, k, v, _, S, y;
|
|
209
209
|
return r(this, function(l) {
|
|
210
210
|
switch (l.label) {
|
|
211
211
|
case 0:
|
|
212
|
-
d = Date.now() +
|
|
212
|
+
d = Date.now() + f(4), w = Date.now() + m, k = o + "-" + c, v = this.storageHandler === void 0 ? a : this.storageHandler, l.label = 1;
|
|
213
213
|
case 1:
|
|
214
214
|
return Date.now() < w ? [4, s(30)] : [3, 8];
|
|
215
215
|
case 2:
|
|
216
|
-
return l.sent(), v.getItemSync(k) !== null ? [3, 5] : (
|
|
216
|
+
return l.sent(), v.getItemSync(k) !== null ? [3, 5] : (_ = this.id + "-" + c + "-" + d, [4, s(Math.floor(25 * Math.random()))]);
|
|
217
217
|
case 3:
|
|
218
|
-
return l.sent(), v.setItemSync(k, JSON.stringify({ id: this.id, iat: d, timeoutKey:
|
|
218
|
+
return l.sent(), v.setItemSync(k, JSON.stringify({ id: this.id, iat: d, timeoutKey: _, timeAcquired: Date.now(), timeRefreshed: Date.now() })), [4, s(30)];
|
|
219
219
|
case 4:
|
|
220
|
-
return l.sent(), (
|
|
220
|
+
return l.sent(), (S = v.getItemSync(k)) !== null && (y = JSON.parse(S)).id === this.id && y.iat === d ? (this.acquiredIatSet.add(d), this.refreshLockWhileAcquired(k, d), [2, !0]) : [3, 7];
|
|
221
221
|
case 5:
|
|
222
222
|
return u.lockCorrector(this.storageHandler === void 0 ? a : this.storageHandler), [4, this.waitForSomethingToChange(w)];
|
|
223
223
|
case 6:
|
|
224
224
|
l.sent(), l.label = 7;
|
|
225
225
|
case 7:
|
|
226
|
-
return d = Date.now() +
|
|
226
|
+
return d = Date.now() + f(4), [3, 1];
|
|
227
227
|
case 8:
|
|
228
228
|
return [2, !1];
|
|
229
229
|
}
|
|
230
230
|
});
|
|
231
231
|
});
|
|
232
|
-
}, u.prototype.refreshLockWhileAcquired = function(c,
|
|
232
|
+
}, u.prototype.refreshLockWhileAcquired = function(c, m) {
|
|
233
233
|
return n(this, void 0, void 0, function() {
|
|
234
234
|
var d = this;
|
|
235
235
|
return r(this, function(w) {
|
|
236
236
|
return setTimeout(function() {
|
|
237
237
|
return n(d, void 0, void 0, function() {
|
|
238
|
-
var k, v,
|
|
239
|
-
return r(this, function(
|
|
240
|
-
switch (
|
|
238
|
+
var k, v, _;
|
|
239
|
+
return r(this, function(S) {
|
|
240
|
+
switch (S.label) {
|
|
241
241
|
case 0:
|
|
242
|
-
return [4, de.default().lock(
|
|
242
|
+
return [4, de.default().lock(m)];
|
|
243
243
|
case 1:
|
|
244
|
-
return
|
|
244
|
+
return S.sent(), this.acquiredIatSet.has(m) ? (k = this.storageHandler === void 0 ? a : this.storageHandler, (v = k.getItemSync(c)) === null ? (de.default().unlock(m), [2]) : ((_ = JSON.parse(v)).timeRefreshed = Date.now(), k.setItemSync(c, JSON.stringify(_)), de.default().unlock(m), this.refreshLockWhileAcquired(c, m), [2])) : (de.default().unlock(m), [2]);
|
|
245
245
|
}
|
|
246
246
|
});
|
|
247
247
|
});
|
|
@@ -250,31 +250,31 @@ var Ur = xt(At(function(t, e) {
|
|
|
250
250
|
});
|
|
251
251
|
}, u.prototype.waitForSomethingToChange = function(c) {
|
|
252
252
|
return n(this, void 0, void 0, function() {
|
|
253
|
-
return r(this, function(
|
|
254
|
-
switch (
|
|
253
|
+
return r(this, function(m) {
|
|
254
|
+
switch (m.label) {
|
|
255
255
|
case 0:
|
|
256
256
|
return [4, new Promise(function(d) {
|
|
257
257
|
var w = !1, k = Date.now(), v = !1;
|
|
258
|
-
function
|
|
259
|
-
if (v || (window.removeEventListener("storage",
|
|
258
|
+
function _() {
|
|
259
|
+
if (v || (window.removeEventListener("storage", _), u.removeFromWaiting(_), clearTimeout(S), v = !0), !w) {
|
|
260
260
|
w = !0;
|
|
261
|
-
var
|
|
262
|
-
|
|
261
|
+
var y = 50 - (Date.now() - k);
|
|
262
|
+
y > 0 ? setTimeout(d, y) : d(null);
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
|
-
window.addEventListener("storage",
|
|
266
|
-
var
|
|
265
|
+
window.addEventListener("storage", _), u.addToWaiting(_);
|
|
266
|
+
var S = setTimeout(_, Math.max(0, c - Date.now()));
|
|
267
267
|
})];
|
|
268
268
|
case 1:
|
|
269
|
-
return
|
|
269
|
+
return m.sent(), [2];
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
272
|
});
|
|
273
273
|
}, u.addToWaiting = function(c) {
|
|
274
274
|
this.removeFromWaiting(c), u.waiters !== void 0 && u.waiters.push(c);
|
|
275
275
|
}, u.removeFromWaiting = function(c) {
|
|
276
|
-
u.waiters !== void 0 && (u.waiters = u.waiters.filter(function(
|
|
277
|
-
return
|
|
276
|
+
u.waiters !== void 0 && (u.waiters = u.waiters.filter(function(m) {
|
|
277
|
+
return m !== c;
|
|
278
278
|
}));
|
|
279
279
|
}, u.notifyWaiters = function() {
|
|
280
280
|
u.waiters !== void 0 && u.waiters.slice().forEach(function(c) {
|
|
@@ -282,52 +282,52 @@ var Ur = xt(At(function(t, e) {
|
|
|
282
282
|
});
|
|
283
283
|
}, u.prototype.releaseLock = function(c) {
|
|
284
284
|
return n(this, void 0, void 0, function() {
|
|
285
|
-
return r(this, function(
|
|
286
|
-
switch (
|
|
285
|
+
return r(this, function(m) {
|
|
286
|
+
switch (m.label) {
|
|
287
287
|
case 0:
|
|
288
288
|
return [4, this.releaseLock__private__(c)];
|
|
289
289
|
case 1:
|
|
290
|
-
return [2,
|
|
290
|
+
return [2, m.sent()];
|
|
291
291
|
}
|
|
292
292
|
});
|
|
293
293
|
});
|
|
294
294
|
}, u.prototype.releaseLock__private__ = function(c) {
|
|
295
295
|
return n(this, void 0, void 0, function() {
|
|
296
|
-
var
|
|
296
|
+
var m, d, w, k;
|
|
297
297
|
return r(this, function(v) {
|
|
298
298
|
switch (v.label) {
|
|
299
299
|
case 0:
|
|
300
|
-
return
|
|
300
|
+
return m = this.storageHandler === void 0 ? a : this.storageHandler, d = o + "-" + c, (w = m.getItemSync(d)) === null ? [2] : (k = JSON.parse(w)).id !== this.id ? [3, 2] : [4, de.default().lock(k.iat)];
|
|
301
301
|
case 1:
|
|
302
|
-
v.sent(), this.acquiredIatSet.delete(k.iat),
|
|
302
|
+
v.sent(), this.acquiredIatSet.delete(k.iat), m.removeItemSync(d), de.default().unlock(k.iat), u.notifyWaiters(), v.label = 2;
|
|
303
303
|
case 2:
|
|
304
304
|
return [2];
|
|
305
305
|
}
|
|
306
306
|
});
|
|
307
307
|
});
|
|
308
308
|
}, u.lockCorrector = function(c) {
|
|
309
|
-
for (var
|
|
309
|
+
for (var m = Date.now() - 5e3, d = c, w = [], k = 0; ; ) {
|
|
310
310
|
var v = d.keySync(k);
|
|
311
311
|
if (v === null)
|
|
312
312
|
break;
|
|
313
313
|
w.push(v), k++;
|
|
314
314
|
}
|
|
315
|
-
for (var
|
|
316
|
-
var
|
|
317
|
-
if (
|
|
318
|
-
var l = d.getItemSync(
|
|
315
|
+
for (var _ = !1, S = 0; S < w.length; S++) {
|
|
316
|
+
var y = w[S];
|
|
317
|
+
if (y.includes(o)) {
|
|
318
|
+
var l = d.getItemSync(y);
|
|
319
319
|
if (l !== null) {
|
|
320
320
|
var b = JSON.parse(l);
|
|
321
|
-
(b.timeRefreshed === void 0 && b.timeAcquired <
|
|
321
|
+
(b.timeRefreshed === void 0 && b.timeAcquired < m || b.timeRefreshed !== void 0 && b.timeRefreshed < m) && (d.removeItemSync(y), _ = !0);
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
|
|
325
|
+
_ && u.notifyWaiters();
|
|
326
326
|
}, u.waiters = void 0, u;
|
|
327
327
|
}();
|
|
328
328
|
e.default = p;
|
|
329
329
|
}));
|
|
330
|
-
const
|
|
330
|
+
const Dr = { timeoutInSeconds: 60 }, Mn = { name: "auth0-spa-js", version: "2.1.3" }, Zn = () => Date.now();
|
|
331
331
|
let G = class kt extends Error {
|
|
332
332
|
constructor(e, n) {
|
|
333
333
|
super(n), this.error = e, this.error_description = n, Object.setPrototypeOf(this, kt.prototype);
|
|
@@ -335,84 +335,84 @@ let G = class kt extends Error {
|
|
|
335
335
|
static fromPayload({ error: e, error_description: n }) {
|
|
336
336
|
return new kt(e, n);
|
|
337
337
|
}
|
|
338
|
-
},
|
|
338
|
+
}, Lr = class Kn extends G {
|
|
339
339
|
constructor(e, n, r, i = null) {
|
|
340
|
-
super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this,
|
|
340
|
+
super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this, Kn.prototype);
|
|
341
341
|
}
|
|
342
|
-
}, It = class
|
|
342
|
+
}, It = class Wn extends G {
|
|
343
343
|
constructor() {
|
|
344
|
-
super("timeout", "Timeout"), Object.setPrototypeOf(this,
|
|
344
|
+
super("timeout", "Timeout"), Object.setPrototypeOf(this, Wn.prototype);
|
|
345
345
|
}
|
|
346
|
-
},
|
|
346
|
+
}, Mr = class Hn extends It {
|
|
347
347
|
constructor(e) {
|
|
348
|
-
super(), this.popup = e, Object.setPrototypeOf(this,
|
|
348
|
+
super(), this.popup = e, Object.setPrototypeOf(this, Hn.prototype);
|
|
349
349
|
}
|
|
350
|
-
},
|
|
350
|
+
}, Zr = class Fn extends G {
|
|
351
351
|
constructor(e) {
|
|
352
|
-
super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this,
|
|
352
|
+
super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this, Fn.prototype);
|
|
353
353
|
}
|
|
354
|
-
},
|
|
354
|
+
}, Kr = class Jn extends G {
|
|
355
355
|
constructor(e, n, r) {
|
|
356
|
-
super(e, n), this.mfa_token = r, Object.setPrototypeOf(this,
|
|
356
|
+
super(e, n), this.mfa_token = r, Object.setPrototypeOf(this, Jn.prototype);
|
|
357
357
|
}
|
|
358
|
-
},
|
|
358
|
+
}, Xn = class Vn extends G {
|
|
359
359
|
constructor(e, n) {
|
|
360
|
-
super("missing_refresh_token", `Missing Refresh Token (audience: '${
|
|
360
|
+
super("missing_refresh_token", `Missing Refresh Token (audience: '${Jt(e, ["default"])}', scope: '${Jt(n)}')`), this.audience = e, this.scope = n, Object.setPrototypeOf(this, Vn.prototype);
|
|
361
361
|
}
|
|
362
362
|
};
|
|
363
|
-
function
|
|
363
|
+
function Jt(t, e = []) {
|
|
364
364
|
return t && !e.includes(t) ? t : "";
|
|
365
365
|
}
|
|
366
366
|
const Qe = () => window.crypto, dt = () => {
|
|
367
367
|
const t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";
|
|
368
368
|
let e = "";
|
|
369
369
|
return Array.from(Qe().getRandomValues(new Uint8Array(43))).forEach((n) => e += t[n % t.length]), e;
|
|
370
|
-
},
|
|
371
|
-
var { clientId: e } = t, n =
|
|
370
|
+
}, Xt = (t) => btoa(t), St = (t) => {
|
|
371
|
+
var { clientId: e } = t, n = ne(t, ["clientId"]);
|
|
372
372
|
return new URLSearchParams(((r) => Object.keys(r).filter((i) => r[i] !== void 0).reduce((i, o) => Object.assign(Object.assign({}, i), { [o]: r[o] }), {}))(Object.assign({ client_id: e }, n))).toString();
|
|
373
|
-
},
|
|
373
|
+
}, Vt = (t) => ((e) => decodeURIComponent(atob(e).split("").map((n) => "%" + ("00" + n.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g, "/").replace(/-/g, "+")), Wr = async (t, e) => {
|
|
374
374
|
const n = await fetch(t, e);
|
|
375
375
|
return { ok: n.ok, json: await n.json() };
|
|
376
|
-
},
|
|
376
|
+
}, Hr = async (t, e, n) => {
|
|
377
377
|
const r = new AbortController();
|
|
378
378
|
let i;
|
|
379
|
-
return e.signal = r.signal, Promise.race([
|
|
379
|
+
return e.signal = r.signal, Promise.race([Wr(t, e), new Promise((o, a) => {
|
|
380
380
|
i = setTimeout(() => {
|
|
381
381
|
r.abort(), a(new Error("Timeout when executing 'fetch'"));
|
|
382
382
|
}, n);
|
|
383
383
|
})]).finally(() => {
|
|
384
384
|
clearTimeout(i);
|
|
385
385
|
});
|
|
386
|
-
},
|
|
387
|
-
return s = { auth: { audience: e, scope: n }, timeout: i, fetchUrl: t, fetchOptions: r, useFormData: a },
|
|
386
|
+
}, Fr = async (t, e, n, r, i, o, a) => {
|
|
387
|
+
return s = { auth: { audience: e, scope: n }, timeout: i, fetchUrl: t, fetchOptions: r, useFormData: a }, f = o, new Promise(function(p, u) {
|
|
388
388
|
const c = new MessageChannel();
|
|
389
|
-
c.port1.onmessage = function(
|
|
390
|
-
|
|
391
|
-
},
|
|
389
|
+
c.port1.onmessage = function(m) {
|
|
390
|
+
m.data.error ? u(new Error(m.data.error)) : p(m.data), c.port1.close();
|
|
391
|
+
}, f.postMessage(s, [c.port2]);
|
|
392
392
|
});
|
|
393
|
-
var s,
|
|
394
|
-
},
|
|
395
|
-
async function
|
|
396
|
-
var { baseUrl: n, timeout: r, audience: i, scope: o, auth0Client: a, useFormData: s } = t,
|
|
397
|
-
const p = s ? St(
|
|
398
|
-
return await async function(u, c,
|
|
399
|
-
let
|
|
400
|
-
for (let
|
|
393
|
+
var s, f;
|
|
394
|
+
}, Jr = async (t, e, n, r, i, o, a = 1e4) => i ? Fr(t, e, n, r, a, i, o) : Hr(t, r, a);
|
|
395
|
+
async function Xr(t, e) {
|
|
396
|
+
var { baseUrl: n, timeout: r, audience: i, scope: o, auth0Client: a, useFormData: s } = t, f = ne(t, ["baseUrl", "timeout", "audience", "scope", "auth0Client", "useFormData"]);
|
|
397
|
+
const p = s ? St(f) : JSON.stringify(f);
|
|
398
|
+
return await async function(u, c, m, d, w, k, v) {
|
|
399
|
+
let _, S = null;
|
|
400
|
+
for (let C = 0; C < 3; C++)
|
|
401
401
|
try {
|
|
402
|
-
|
|
402
|
+
_ = await Jr(u, m, d, w, k, v, c), S = null;
|
|
403
403
|
break;
|
|
404
404
|
} catch (D) {
|
|
405
|
-
|
|
405
|
+
S = D;
|
|
406
406
|
}
|
|
407
|
-
if (
|
|
408
|
-
throw
|
|
409
|
-
const
|
|
407
|
+
if (S)
|
|
408
|
+
throw S;
|
|
409
|
+
const y = _.json, { error: l, error_description: b } = y, T = ne(y, ["error", "error_description"]), { ok: O } = _;
|
|
410
410
|
if (!O) {
|
|
411
|
-
const
|
|
412
|
-
throw l === "mfa_required" ? new
|
|
411
|
+
const C = b || `HTTP error. Unable to fetch ${u}`;
|
|
412
|
+
throw l === "mfa_required" ? new Kr(l, C, T.mfa_token) : l === "missing_refresh_token" ? new Xn(m, d) : new G(l || "request_error", C);
|
|
413
413
|
}
|
|
414
|
-
return
|
|
415
|
-
}(`${n}/oauth/token`, r, i || "default", o, { method: "POST", body: p, headers: { "Content-Type": s ? "application/x-www-form-urlencoded" : "application/json", "Auth0-Client": btoa(JSON.stringify(a ||
|
|
414
|
+
return T;
|
|
415
|
+
}(`${n}/oauth/token`, r, i || "default", o, { method: "POST", body: p, headers: { "Content-Type": s ? "application/x-www-form-urlencoded" : "application/json", "Auth0-Client": btoa(JSON.stringify(a || Mn)) } }, e, s);
|
|
416
416
|
}
|
|
417
417
|
const Fe = (...t) => {
|
|
418
418
|
return (e = t.filter(Boolean).join(" ").trim().split(/\s+/), Array.from(new Set(e))).join(" ");
|
|
@@ -433,7 +433,7 @@ let pe = class _t {
|
|
|
433
433
|
const { scope: n, audience: r, client_id: i } = e;
|
|
434
434
|
return new _t({ scope: n, audience: r, clientId: i });
|
|
435
435
|
}
|
|
436
|
-
},
|
|
436
|
+
}, Vr = class {
|
|
437
437
|
set(e, n) {
|
|
438
438
|
localStorage.setItem(e, JSON.stringify(n));
|
|
439
439
|
}
|
|
@@ -452,7 +452,7 @@ let pe = class _t {
|
|
|
452
452
|
allKeys() {
|
|
453
453
|
return Object.keys(window.localStorage).filter((e) => e.startsWith("@@auth0spajs@@"));
|
|
454
454
|
}
|
|
455
|
-
},
|
|
455
|
+
}, Yn = class {
|
|
456
456
|
constructor() {
|
|
457
457
|
this.enclosedCache = /* @__PURE__ */ function() {
|
|
458
458
|
let e = {};
|
|
@@ -467,9 +467,9 @@ let pe = class _t {
|
|
|
467
467
|
}, allKeys: () => Object.keys(e) };
|
|
468
468
|
}();
|
|
469
469
|
}
|
|
470
|
-
},
|
|
470
|
+
}, Yr = class {
|
|
471
471
|
constructor(e, n, r) {
|
|
472
|
-
this.cache = e, this.keyManifest = n, this.nowProvider = r ||
|
|
472
|
+
this.cache = e, this.keyManifest = n, this.nowProvider = r || Zn;
|
|
473
473
|
}
|
|
474
474
|
async setIdToken(e, n, r) {
|
|
475
475
|
var i;
|
|
@@ -492,8 +492,8 @@ let pe = class _t {
|
|
|
492
492
|
const s = await this.getCacheKeys();
|
|
493
493
|
if (!s)
|
|
494
494
|
return;
|
|
495
|
-
const
|
|
496
|
-
|
|
495
|
+
const f = this.matchExistingCacheKey(e, s);
|
|
496
|
+
f && (i = await this.cache.get(f));
|
|
497
497
|
}
|
|
498
498
|
if (!i)
|
|
499
499
|
return;
|
|
@@ -526,11 +526,11 @@ let pe = class _t {
|
|
|
526
526
|
matchExistingCacheKey(e, n) {
|
|
527
527
|
return n.filter((r) => {
|
|
528
528
|
var i;
|
|
529
|
-
const o = pe.fromKey(r), a = new Set(o.scope && o.scope.split(" ")), s = ((i = e.scope) === null || i === void 0 ? void 0 : i.split(" ")) || [],
|
|
530
|
-
return o.prefix === "@@auth0spajs@@" && o.clientId === e.clientId && o.audience === e.audience &&
|
|
529
|
+
const o = pe.fromKey(r), a = new Set(o.scope && o.scope.split(" ")), s = ((i = e.scope) === null || i === void 0 ? void 0 : i.split(" ")) || [], f = o.scope && s.reduce((p, u) => p && a.has(u), !0);
|
|
530
|
+
return o.prefix === "@@auth0spajs@@" && o.clientId === e.clientId && o.audience === e.audience && f;
|
|
531
531
|
})[0];
|
|
532
532
|
}
|
|
533
|
-
},
|
|
533
|
+
}, Gr = class {
|
|
534
534
|
constructor(e, n, r) {
|
|
535
535
|
this.storage = e, this.clientId = n, this.cookieDomain = r, this.storageKey = `a0.spajs.txs.${this.clientId}`;
|
|
536
536
|
}
|
|
@@ -544,17 +544,17 @@ let pe = class _t {
|
|
|
544
544
|
this.storage.remove(this.storageKey, { cookieDomain: this.cookieDomain });
|
|
545
545
|
}
|
|
546
546
|
};
|
|
547
|
-
const Ue = (t) => typeof t == "number",
|
|
547
|
+
const Ue = (t) => typeof t == "number", Br = ["iss", "aud", "exp", "nbf", "iat", "jti", "azp", "nonce", "auth_time", "at_hash", "c_hash", "acr", "amr", "sub_jwk", "cnf", "sip_from_tag", "sip_date", "sip_callid", "sip_cseq_num", "sip_via_branch", "orig", "dest", "mky", "events", "toe", "txn", "rph", "sid", "vot", "vtm"], qr = (t) => {
|
|
548
548
|
if (!t.id_token)
|
|
549
549
|
throw new Error("ID token is required but missing");
|
|
550
550
|
const e = ((o) => {
|
|
551
|
-
const a = o.split("."), [s,
|
|
552
|
-
if (a.length !== 3 || !s || !
|
|
551
|
+
const a = o.split("."), [s, f, p] = a;
|
|
552
|
+
if (a.length !== 3 || !s || !f || !p)
|
|
553
553
|
throw new Error("ID token could not be decoded");
|
|
554
|
-
const u = JSON.parse(
|
|
554
|
+
const u = JSON.parse(Vt(f)), c = { __raw: o }, m = {};
|
|
555
555
|
return Object.keys(u).forEach((d) => {
|
|
556
|
-
c[d] = u[d],
|
|
557
|
-
}), { encoded: { header: s, payload:
|
|
556
|
+
c[d] = u[d], Br.includes(d) || (m[d] = u[d]);
|
|
557
|
+
}), { encoded: { header: s, payload: f, signature: p }, header: JSON.parse(Vt(s)), claims: c, user: m };
|
|
558
558
|
})(t.id_token);
|
|
559
559
|
if (!e.claims.iss)
|
|
560
560
|
throw new Error("Issuer (iss) claim must be a string present in the ID token");
|
|
@@ -620,33 +620,33 @@ const Ue = (t) => typeof t == "number", Yr = ["iss", "aud", "exp", "nbf", "iat",
|
|
|
620
620
|
}
|
|
621
621
|
return e;
|
|
622
622
|
};
|
|
623
|
-
var me =
|
|
623
|
+
var me = $t(function(t, e) {
|
|
624
624
|
var n = he && he.__assign || function() {
|
|
625
|
-
return n = Object.assign || function(
|
|
625
|
+
return n = Object.assign || function(f) {
|
|
626
626
|
for (var p, u = 1, c = arguments.length; u < c; u++)
|
|
627
|
-
for (var
|
|
628
|
-
Object.prototype.hasOwnProperty.call(p,
|
|
629
|
-
return
|
|
627
|
+
for (var m in p = arguments[u])
|
|
628
|
+
Object.prototype.hasOwnProperty.call(p, m) && (f[m] = p[m]);
|
|
629
|
+
return f;
|
|
630
630
|
}, n.apply(this, arguments);
|
|
631
631
|
};
|
|
632
|
-
function r(
|
|
632
|
+
function r(f, p) {
|
|
633
633
|
if (!p)
|
|
634
634
|
return "";
|
|
635
|
-
var u = "; " +
|
|
635
|
+
var u = "; " + f;
|
|
636
636
|
return p === !0 ? u : u + "=" + p;
|
|
637
637
|
}
|
|
638
|
-
function i(
|
|
639
|
-
return encodeURIComponent(
|
|
638
|
+
function i(f, p, u) {
|
|
639
|
+
return encodeURIComponent(f).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/\(/g, "%28").replace(/\)/g, "%29") + "=" + encodeURIComponent(p).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent) + function(c) {
|
|
640
640
|
if (typeof c.expires == "number") {
|
|
641
|
-
var
|
|
642
|
-
|
|
641
|
+
var m = /* @__PURE__ */ new Date();
|
|
642
|
+
m.setMilliseconds(m.getMilliseconds() + 864e5 * c.expires), c.expires = m;
|
|
643
643
|
}
|
|
644
644
|
return r("Expires", c.expires ? c.expires.toUTCString() : "") + r("Domain", c.domain) + r("Path", c.path) + r("Secure", c.secure) + r("SameSite", c.sameSite);
|
|
645
645
|
}(u);
|
|
646
646
|
}
|
|
647
|
-
function o(
|
|
648
|
-
for (var p = {}, u =
|
|
649
|
-
var d = u[
|
|
647
|
+
function o(f) {
|
|
648
|
+
for (var p = {}, u = f ? f.split("; ") : [], c = /(%[\dA-F]{2})+/gi, m = 0; m < u.length; m++) {
|
|
649
|
+
var d = u[m].split("="), w = d.slice(1).join("=");
|
|
650
650
|
w.charAt(0) === '"' && (w = w.slice(1, -1));
|
|
651
651
|
try {
|
|
652
652
|
p[d[0].replace(c, decodeURIComponent)] = w.replace(c, decodeURIComponent);
|
|
@@ -658,36 +658,36 @@ var me = At(function(t, e) {
|
|
|
658
658
|
function a() {
|
|
659
659
|
return o(document.cookie);
|
|
660
660
|
}
|
|
661
|
-
function s(
|
|
662
|
-
document.cookie = i(
|
|
661
|
+
function s(f, p, u) {
|
|
662
|
+
document.cookie = i(f, p, n({ path: "/" }, u));
|
|
663
663
|
}
|
|
664
|
-
e.__esModule = !0, e.encode = i, e.parse = o, e.getAll = a, e.get = function(
|
|
665
|
-
return a()[
|
|
666
|
-
}, e.set = s, e.remove = function(
|
|
667
|
-
s(
|
|
664
|
+
e.__esModule = !0, e.encode = i, e.parse = o, e.getAll = a, e.get = function(f) {
|
|
665
|
+
return a()[f];
|
|
666
|
+
}, e.set = s, e.remove = function(f, p) {
|
|
667
|
+
s(f, "", n(n({}, p), { expires: -1 }));
|
|
668
668
|
};
|
|
669
669
|
});
|
|
670
|
-
|
|
671
|
-
var
|
|
670
|
+
At(me), me.encode, me.parse, me.getAll;
|
|
671
|
+
var Qr = me.get, Gn = me.set, Bn = me.remove;
|
|
672
672
|
const Ie = { get(t) {
|
|
673
|
-
const e =
|
|
673
|
+
const e = Qr(t);
|
|
674
674
|
if (e !== void 0)
|
|
675
675
|
return JSON.parse(e);
|
|
676
676
|
}, save(t, e, n) {
|
|
677
677
|
let r = {};
|
|
678
|
-
window.location.protocol === "https:" && (r = { secure: !0, sameSite: "none" }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain),
|
|
678
|
+
window.location.protocol === "https:" && (r = { secure: !0, sameSite: "none" }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), Gn(t, JSON.stringify(e), r);
|
|
679
679
|
}, remove(t, e) {
|
|
680
680
|
let n = {};
|
|
681
|
-
e != null && e.cookieDomain && (n.domain = e.cookieDomain),
|
|
682
|
-
} },
|
|
681
|
+
e != null && e.cookieDomain && (n.domain = e.cookieDomain), Bn(t, n);
|
|
682
|
+
} }, ei = { get(t) {
|
|
683
683
|
return Ie.get(t) || Ie.get(`_legacy_${t}`);
|
|
684
684
|
}, save(t, e, n) {
|
|
685
685
|
let r = {};
|
|
686
|
-
window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain),
|
|
686
|
+
window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), Gn(`_legacy_${t}`, JSON.stringify(e), r), Ie.save(t, e, n);
|
|
687
687
|
}, remove(t, e) {
|
|
688
688
|
let n = {};
|
|
689
|
-
e != null && e.cookieDomain && (n.domain = e.cookieDomain),
|
|
690
|
-
} },
|
|
689
|
+
e != null && e.cookieDomain && (n.domain = e.cookieDomain), Bn(t, n), Ie.remove(t, e), Ie.remove(`_legacy_${t}`, e);
|
|
690
|
+
} }, ti = { get(t) {
|
|
691
691
|
if (typeof sessionStorage > "u")
|
|
692
692
|
return;
|
|
693
693
|
const e = sessionStorage.getItem(t);
|
|
@@ -697,12 +697,12 @@ const Ie = { get(t) {
|
|
|
697
697
|
}, remove(t) {
|
|
698
698
|
sessionStorage.removeItem(t);
|
|
699
699
|
} };
|
|
700
|
-
function
|
|
701
|
-
var r = e === void 0 ? null : e, i = function(
|
|
702
|
-
var u = atob(
|
|
700
|
+
function ni(t, e, n) {
|
|
701
|
+
var r = e === void 0 ? null : e, i = function(f, p) {
|
|
702
|
+
var u = atob(f);
|
|
703
703
|
if (p) {
|
|
704
|
-
for (var c = new Uint8Array(u.length),
|
|
705
|
-
c[
|
|
704
|
+
for (var c = new Uint8Array(u.length), m = 0, d = u.length; m < d; ++m)
|
|
705
|
+
c[m] = u.charCodeAt(m);
|
|
706
706
|
return String.fromCharCode.apply(null, new Uint16Array(c.buffer));
|
|
707
707
|
}
|
|
708
708
|
return u;
|
|
@@ -710,11 +710,11 @@ function ei(t, e, n) {
|
|
|
710
710
|
`, 10) + 1, a = i.substring(o) + (r ? "//# sourceMappingURL=" + r : ""), s = new Blob([a], { type: "application/javascript" });
|
|
711
711
|
return URL.createObjectURL(s);
|
|
712
712
|
}
|
|
713
|
-
var
|
|
714
|
-
return ht = ht ||
|
|
713
|
+
var Yt, Gt, Bt, ht, ri = (Yt = "Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=", Gt = null, Bt = !1, function(t) {
|
|
714
|
+
return ht = ht || ni(Yt, Gt, Bt), new Worker(ht, t);
|
|
715
715
|
});
|
|
716
716
|
const ft = {};
|
|
717
|
-
let
|
|
717
|
+
let ii = class {
|
|
718
718
|
constructor(e, n) {
|
|
719
719
|
this.cache = e, this.clientId = n, this.manifestKey = this.createManifestKeyFrom(this.clientId);
|
|
720
720
|
}
|
|
@@ -740,14 +740,14 @@ let ni = class {
|
|
|
740
740
|
return `@@auth0spajs@@::${e}`;
|
|
741
741
|
}
|
|
742
742
|
};
|
|
743
|
-
const
|
|
744
|
-
const { openUrl: e, onRedirect: n } = t, r =
|
|
743
|
+
const oi = { memory: () => new Yn().enclosedCache, localstorage: () => new Vr() }, qt = (t) => oi[t], Qt = (t) => {
|
|
744
|
+
const { openUrl: e, onRedirect: n } = t, r = ne(t, ["openUrl", "onRedirect"]);
|
|
745
745
|
return Object.assign(Object.assign({}, r), { openUrl: e === !1 || e ? e : n });
|
|
746
|
-
}, pt = new
|
|
747
|
-
let
|
|
746
|
+
}, pt = new Rr();
|
|
747
|
+
let ai = class {
|
|
748
748
|
constructor(e) {
|
|
749
749
|
let n, r;
|
|
750
|
-
if (this.userCache = new
|
|
750
|
+
if (this.userCache = new Yn().enclosedCache, this.defaultOptions = { authorizationParams: { scope: "openid profile email" }, useRefreshTokensFallback: !1, useFormData: !0 }, this._releaseLockOnPageHide = async () => {
|
|
751
751
|
await pt.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
|
|
752
752
|
}, this.options = Object.assign(Object.assign(Object.assign({}, this.defaultOptions), e), { authorizationParams: Object.assign(Object.assign({}, this.defaultOptions.authorizationParams), e.authorizationParams) }), typeof window < "u" && (() => {
|
|
753
753
|
if (!Qe())
|
|
@@ -759,17 +759,17 @@ let ii = class {
|
|
|
759
759
|
})(), e.cache && e.cacheLocation && console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."), e.cache)
|
|
760
760
|
r = e.cache;
|
|
761
761
|
else {
|
|
762
|
-
if (n = e.cacheLocation || "memory", !
|
|
762
|
+
if (n = e.cacheLocation || "memory", !qt(n))
|
|
763
763
|
throw new Error(`Invalid cache location "${n}"`);
|
|
764
|
-
r =
|
|
764
|
+
r = qt(n)();
|
|
765
765
|
}
|
|
766
|
-
this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ? Ie :
|
|
767
|
-
const i = e.useCookiesForTransactions ? this.cookieStorage :
|
|
766
|
+
this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ? Ie : ei, this.orgHintCookieName = `auth0.${this.options.clientId}.organization_hint`, this.isAuthenticatedCookieName = ((a) => `auth0.${a}.is.authenticated`)(this.options.clientId), this.sessionCheckExpiryDays = e.sessionCheckExpiryDays || 1;
|
|
767
|
+
const i = e.useCookiesForTransactions ? this.cookieStorage : ti;
|
|
768
768
|
var o;
|
|
769
|
-
this.scope = Fe("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new
|
|
769
|
+
this.scope = Fe("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new Gr(i, this.options.clientId, this.options.cookieDomain), this.nowProvider = this.options.nowProvider || Zn, this.cacheManager = new Yr(r, r.allKeys ? void 0 : new ii(r, this.options.clientId), this.nowProvider), this.domainUrl = (o = this.options.domain, /^https?:\/\//.test(o) ? o : `https://${o}`), this.tokenIssuer = ((a, s) => a ? a.startsWith("https://") ? a : `https://${a}/` : `${s}/`)(this.options.issuer, this.domainUrl), typeof window < "u" && window.Worker && this.options.useRefreshTokens && n === "memory" && (this.options.workerUrl ? this.worker = new Worker(this.options.workerUrl) : this.worker = new ri());
|
|
770
770
|
}
|
|
771
771
|
_url(e) {
|
|
772
|
-
const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client ||
|
|
772
|
+
const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client || Mn)));
|
|
773
773
|
return `${this.domainUrl}${e}&auth0Client=${n}`;
|
|
774
774
|
}
|
|
775
775
|
_authorizeUrl(e) {
|
|
@@ -777,43 +777,43 @@ let ii = class {
|
|
|
777
777
|
}
|
|
778
778
|
async _verifyIdToken(e, n, r) {
|
|
779
779
|
const i = await this.nowProvider();
|
|
780
|
-
return
|
|
780
|
+
return qr({ iss: this.tokenIssuer, aud: this.options.clientId, id_token: e, nonce: n, organization: r, leeway: this.options.leeway, max_age: (o = this.options.authorizationParams.max_age, typeof o != "string" ? o : parseInt(o, 10) || void 0), now: i });
|
|
781
781
|
var o;
|
|
782
782
|
}
|
|
783
783
|
_processOrgHint(e) {
|
|
784
784
|
e ? this.cookieStorage.save(this.orgHintCookieName, e, { daysUntilExpire: this.sessionCheckExpiryDays, cookieDomain: this.options.cookieDomain }) : this.cookieStorage.remove(this.orgHintCookieName, { cookieDomain: this.options.cookieDomain });
|
|
785
785
|
}
|
|
786
786
|
async _prepareAuthorizeUrl(e, n, r) {
|
|
787
|
-
const i =
|
|
787
|
+
const i = Xt(dt()), o = Xt(dt()), a = dt(), s = ((u) => {
|
|
788
788
|
const c = new Uint8Array(u);
|
|
789
|
-
return ((
|
|
789
|
+
return ((m) => {
|
|
790
790
|
const d = { "+": "-", "/": "_", "=": "" };
|
|
791
|
-
return
|
|
791
|
+
return m.replace(/[+/=]/g, (w) => d[w]);
|
|
792
792
|
})(window.btoa(String.fromCharCode(...Array.from(c))));
|
|
793
|
-
})(await (async (u) => await Qe().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(u)))(a)),
|
|
794
|
-
return { nonce: o, code_verifier: a, scope:
|
|
793
|
+
})(await (async (u) => await Qe().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(u)))(a)), f = ((u, c, m, d, w, k, v, _) => Object.assign(Object.assign(Object.assign({ client_id: u.clientId }, u.authorizationParams), m), { scope: Fe(c, m.scope), response_type: "code", response_mode: _ || "query", state: d, nonce: w, redirect_uri: v || u.authorizationParams.redirect_uri, code_challenge: k, code_challenge_method: "S256" }))(this.options, this.scope, e, i, o, s, e.redirect_uri || this.options.authorizationParams.redirect_uri || r, n == null ? void 0 : n.response_mode), p = this._authorizeUrl(f);
|
|
794
|
+
return { nonce: o, code_verifier: a, scope: f.scope, audience: f.audience || "default", redirect_uri: f.redirect_uri, state: i, url: p };
|
|
795
795
|
}
|
|
796
796
|
async loginWithPopup(e, n) {
|
|
797
797
|
var r;
|
|
798
798
|
if (e = e || {}, !(n = n || {}).popup && (n.popup = ((s) => {
|
|
799
|
-
const
|
|
800
|
-
return window.open(s, "auth0:authorize:popup", `left=${
|
|
799
|
+
const f = window.screenX + (window.innerWidth - 400) / 2, p = window.screenY + (window.innerHeight - 600) / 2;
|
|
800
|
+
return window.open(s, "auth0:authorize:popup", `left=${f},top=${p},width=400,height=600,resizable,scrollbars=yes,status=1`);
|
|
801
801
|
})(""), !n.popup))
|
|
802
802
|
throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");
|
|
803
803
|
const i = await this._prepareAuthorizeUrl(e.authorizationParams || {}, { response_mode: "web_message" }, window.location.origin);
|
|
804
804
|
n.popup.location.href = i.url;
|
|
805
|
-
const o = await ((s) => new Promise((
|
|
805
|
+
const o = await ((s) => new Promise((f, p) => {
|
|
806
806
|
let u;
|
|
807
807
|
const c = setInterval(() => {
|
|
808
|
-
s.popup && s.popup.closed && (clearInterval(c), clearTimeout(
|
|
809
|
-
}, 1e3),
|
|
810
|
-
clearInterval(c), p(new
|
|
808
|
+
s.popup && s.popup.closed && (clearInterval(c), clearTimeout(m), window.removeEventListener("message", u, !1), p(new Zr(s.popup)));
|
|
809
|
+
}, 1e3), m = setTimeout(() => {
|
|
810
|
+
clearInterval(c), p(new Mr(s.popup)), window.removeEventListener("message", u, !1);
|
|
811
811
|
}, 1e3 * (s.timeoutInSeconds || 60));
|
|
812
812
|
u = function(d) {
|
|
813
813
|
if (d.data && d.data.type === "authorization_response") {
|
|
814
|
-
if (clearTimeout(
|
|
814
|
+
if (clearTimeout(m), clearInterval(c), window.removeEventListener("message", u, !1), s.popup.close(), d.data.response.error)
|
|
815
815
|
return p(G.fromPayload(d.data.response));
|
|
816
|
-
|
|
816
|
+
f(d.data.response);
|
|
817
817
|
}
|
|
818
818
|
}, window.addEventListener("message", u);
|
|
819
819
|
}))(Object.assign(Object.assign({}, n), { timeoutInSeconds: n.timeoutInSeconds || this.options.authorizeTimeoutInSeconds || 60 }));
|
|
@@ -834,10 +834,10 @@ let ii = class {
|
|
|
834
834
|
}
|
|
835
835
|
async loginWithRedirect(e = {}) {
|
|
836
836
|
var n;
|
|
837
|
-
const r =
|
|
838
|
-
this.transactionManager.create(Object.assign(Object.assign(Object.assign({}, c), { appState: a }),
|
|
839
|
-
const
|
|
840
|
-
i ? await i(
|
|
837
|
+
const r = Qt(e), { openUrl: i, fragment: o, appState: a } = r, s = ne(r, ["openUrl", "fragment", "appState"]), f = ((n = s.authorizationParams) === null || n === void 0 ? void 0 : n.organization) || this.options.authorizationParams.organization, p = await this._prepareAuthorizeUrl(s.authorizationParams || {}), { url: u } = p, c = ne(p, ["url"]);
|
|
838
|
+
this.transactionManager.create(Object.assign(Object.assign(Object.assign({}, c), { appState: a }), f && { organization: f }));
|
|
839
|
+
const m = o ? `${u}#${o}` : u;
|
|
840
|
+
i ? await i(m) : window.location.assign(m);
|
|
841
841
|
}
|
|
842
842
|
async handleRedirectCallback(e = window.location.href) {
|
|
843
843
|
const n = e.split("?").slice(1);
|
|
@@ -845,17 +845,17 @@ let ii = class {
|
|
|
845
845
|
throw new Error("There are no query params available for parsing.");
|
|
846
846
|
const { state: r, code: i, error: o, error_description: a } = ((c) => {
|
|
847
847
|
c.indexOf("#") > -1 && (c = c.substring(0, c.indexOf("#")));
|
|
848
|
-
const
|
|
849
|
-
return { state:
|
|
848
|
+
const m = new URLSearchParams(c);
|
|
849
|
+
return { state: m.get("state"), code: m.get("code") || void 0, error: m.get("error") || void 0, error_description: m.get("error_description") || void 0 };
|
|
850
850
|
})(n.join("")), s = this.transactionManager.get();
|
|
851
851
|
if (!s)
|
|
852
852
|
throw new G("missing_transaction", "Invalid state");
|
|
853
853
|
if (this.transactionManager.remove(), o)
|
|
854
|
-
throw new
|
|
854
|
+
throw new Lr(o, a || o, r, s.appState);
|
|
855
855
|
if (!s.code_verifier || s.state && s.state !== r)
|
|
856
856
|
throw new G("state_mismatch", "Invalid state");
|
|
857
|
-
const
|
|
858
|
-
return await this._requestToken(Object.assign({ audience: s.audience, scope: s.scope, code_verifier: s.code_verifier, grant_type: "authorization_code", code: i }, u ? { redirect_uri: u } : {}), { nonceIn: p, organization:
|
|
857
|
+
const f = s.organization, p = s.nonce, u = s.redirect_uri;
|
|
858
|
+
return await this._requestToken(Object.assign({ audience: s.audience, scope: s.scope, code_verifier: s.code_verifier, grant_type: "authorization_code", code: i }, u ? { redirect_uri: u } : {}), { nonceIn: p, organization: f }), { appState: s.appState };
|
|
859
859
|
}
|
|
860
860
|
async checkSession(e) {
|
|
861
861
|
if (!this.cookieStorage.get(this.isAuthenticatedCookieName)) {
|
|
@@ -879,7 +879,7 @@ let ii = class {
|
|
|
879
879
|
return e.detailedResponse ? i : i == null ? void 0 : i.access_token;
|
|
880
880
|
}
|
|
881
881
|
async _getTokenSilently(e) {
|
|
882
|
-
const { cacheMode: n } = e, r =
|
|
882
|
+
const { cacheMode: n } = e, r = ne(e, ["cacheMode"]);
|
|
883
883
|
if (n !== "off") {
|
|
884
884
|
const i = await this._getEntryFromCache({ scope: r.authorizationParams.scope, audience: r.authorizationParams.audience || "default", clientId: this.options.clientId });
|
|
885
885
|
if (i)
|
|
@@ -899,8 +899,8 @@ let ii = class {
|
|
|
899
899
|
if (p)
|
|
900
900
|
return p;
|
|
901
901
|
}
|
|
902
|
-
const i = this.options.useRefreshTokens ? await this._getTokenUsingRefreshToken(r) : await this._getTokenFromIFrame(r), { id_token: o, access_token: a, oauthTokenScope: s, expires_in:
|
|
903
|
-
return Object.assign(Object.assign({ id_token: o, access_token: a }, s ? { scope: s } : null), { expires_in:
|
|
902
|
+
const i = this.options.useRefreshTokens ? await this._getTokenUsingRefreshToken(r) : await this._getTokenFromIFrame(r), { id_token: o, access_token: a, oauthTokenScope: s, expires_in: f } = i;
|
|
903
|
+
return Object.assign(Object.assign({ id_token: o, access_token: a }, s ? { scope: s } : null), { expires_in: f });
|
|
904
904
|
} finally {
|
|
905
905
|
await pt.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
|
|
906
906
|
}
|
|
@@ -909,18 +909,18 @@ let ii = class {
|
|
|
909
909
|
async getTokenWithPopup(e = {}, n = {}) {
|
|
910
910
|
var r;
|
|
911
911
|
const i = Object.assign(Object.assign({}, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: Fe(this.scope, (r = e.authorizationParams) === null || r === void 0 ? void 0 : r.scope) }) });
|
|
912
|
-
return n = Object.assign(Object.assign({},
|
|
912
|
+
return n = Object.assign(Object.assign({}, Dr), n), await this.loginWithPopup(i, n), (await this.cacheManager.get(new pe({ scope: i.authorizationParams.scope, audience: i.authorizationParams.audience || "default", clientId: this.options.clientId }))).access_token;
|
|
913
913
|
}
|
|
914
914
|
async isAuthenticated() {
|
|
915
915
|
return !!await this.getUser();
|
|
916
916
|
}
|
|
917
917
|
_buildLogoutUrl(e) {
|
|
918
918
|
e.clientId !== null ? e.clientId = e.clientId || this.options.clientId : delete e.clientId;
|
|
919
|
-
const n = e.logoutParams || {}, { federated: r } = n, i =
|
|
919
|
+
const n = e.logoutParams || {}, { federated: r } = n, i = ne(n, ["federated"]), o = r ? "&federated" : "";
|
|
920
920
|
return this._url(`/v2/logout?${St(Object.assign({ clientId: e.clientId }, i))}`) + o;
|
|
921
921
|
}
|
|
922
922
|
async logout(e = {}) {
|
|
923
|
-
const n =
|
|
923
|
+
const n = Qt(e), { openUrl: r } = n, i = ne(n, ["openUrl"]);
|
|
924
924
|
e.clientId === null ? await this.cacheManager.clear() : await this.cacheManager.clear(e.clientId || this.options.clientId), this.cookieStorage.remove(this.orgHintCookieName, { cookieDomain: this.options.cookieDomain }), this.cookieStorage.remove(this.isAuthenticatedCookieName, { cookieDomain: this.options.cookieDomain }), this.userCache.remove("@@user@@");
|
|
925
925
|
const o = this._buildLogoutUrl(i);
|
|
926
926
|
r ? await r(o) : r !== !1 && window.location.assign(o);
|
|
@@ -928,30 +928,30 @@ let ii = class {
|
|
|
928
928
|
async _getTokenFromIFrame(e) {
|
|
929
929
|
const n = Object.assign(Object.assign({}, e.authorizationParams), { prompt: "none" }), r = this.cookieStorage.get(this.orgHintCookieName);
|
|
930
930
|
r && !n.organization && (n.organization = r);
|
|
931
|
-
const { url: i, state: o, nonce: a, code_verifier: s, redirect_uri:
|
|
931
|
+
const { url: i, state: o, nonce: a, code_verifier: s, redirect_uri: f, scope: p, audience: u } = await this._prepareAuthorizeUrl(n, { response_mode: "web_message" }, window.location.origin);
|
|
932
932
|
try {
|
|
933
933
|
if (window.crossOriginIsolated)
|
|
934
934
|
throw new G("login_required", "The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");
|
|
935
|
-
const c = e.timeoutInSeconds || this.options.authorizeTimeoutInSeconds,
|
|
936
|
-
const
|
|
937
|
-
|
|
935
|
+
const c = e.timeoutInSeconds || this.options.authorizeTimeoutInSeconds, m = await ((w, k, v = 60) => new Promise((_, S) => {
|
|
936
|
+
const y = window.document.createElement("iframe");
|
|
937
|
+
y.setAttribute("width", "0"), y.setAttribute("height", "0"), y.style.display = "none";
|
|
938
938
|
const l = () => {
|
|
939
|
-
window.document.body.contains(
|
|
939
|
+
window.document.body.contains(y) && (window.document.body.removeChild(y), window.removeEventListener("message", b, !1));
|
|
940
940
|
};
|
|
941
941
|
let b;
|
|
942
|
-
const
|
|
943
|
-
|
|
942
|
+
const T = setTimeout(() => {
|
|
943
|
+
S(new It()), l();
|
|
944
944
|
}, 1e3 * v);
|
|
945
945
|
b = function(O) {
|
|
946
946
|
if (O.origin != k || !O.data || O.data.type !== "authorization_response")
|
|
947
947
|
return;
|
|
948
|
-
const
|
|
949
|
-
|
|
950
|
-
}, window.addEventListener("message", b, !1), window.document.body.appendChild(
|
|
948
|
+
const C = O.source;
|
|
949
|
+
C && C.close(), O.data.response.error ? S(G.fromPayload(O.data.response)) : _(O.data.response), clearTimeout(T), window.removeEventListener("message", b, !1), setTimeout(l, 2e3);
|
|
950
|
+
}, window.addEventListener("message", b, !1), window.document.body.appendChild(y), y.setAttribute("src", w);
|
|
951
951
|
}))(i, this.domainUrl, c);
|
|
952
|
-
if (o !==
|
|
952
|
+
if (o !== m.state)
|
|
953
953
|
throw new G("state_mismatch", "Invalid state");
|
|
954
|
-
const d = await this._requestToken(Object.assign(Object.assign({}, e.authorizationParams), { code_verifier: s, code:
|
|
954
|
+
const d = await this._requestToken(Object.assign(Object.assign({}, e.authorizationParams), { code_verifier: s, code: m.code, grant_type: "authorization_code", redirect_uri: f, timeout: e.authorizationParams.timeout || this.httpTimeoutMs }), { nonceIn: a, organization: n.organization });
|
|
955
955
|
return Object.assign(Object.assign({}, d), { scope: p, oauthTokenScope: d.scope, audience: u });
|
|
956
956
|
} catch (c) {
|
|
957
957
|
throw c.error === "login_required" && this.logout({ openUrl: !1 }), c;
|
|
@@ -962,7 +962,7 @@ let ii = class {
|
|
|
962
962
|
if (!(n && n.refresh_token || this.worker)) {
|
|
963
963
|
if (this.options.useRefreshTokensFallback)
|
|
964
964
|
return await this._getTokenFromIFrame(e);
|
|
965
|
-
throw new
|
|
965
|
+
throw new Xn(e.authorizationParams.audience || "default", e.authorizationParams.scope);
|
|
966
966
|
}
|
|
967
967
|
const r = e.authorizationParams.redirect_uri || this.options.authorizationParams.redirect_uri || window.location.origin, i = typeof e.timeoutInSeconds == "number" ? 1e3 * e.timeoutInSeconds : null;
|
|
968
968
|
try {
|
|
@@ -975,7 +975,7 @@ let ii = class {
|
|
|
975
975
|
}
|
|
976
976
|
}
|
|
977
977
|
async _saveEntryInCache(e) {
|
|
978
|
-
const { id_token: n, decodedToken: r } = e, i =
|
|
978
|
+
const { id_token: n, decodedToken: r } = e, i = ne(e, ["id_token", "decodedToken"]);
|
|
979
979
|
this.userCache.set("@@user@@", { id_token: n, decodedToken: r }), await this.cacheManager.setIdToken(this.options.clientId, e.id_token, e.decodedToken), await this.cacheManager.set(i);
|
|
980
980
|
}
|
|
981
981
|
async _getIdTokenFromCache() {
|
|
@@ -985,31 +985,31 @@ let ii = class {
|
|
|
985
985
|
async _getEntryFromCache({ scope: e, audience: n, clientId: r }) {
|
|
986
986
|
const i = await this.cacheManager.get(new pe({ scope: e, audience: n, clientId: r }), 60);
|
|
987
987
|
if (i && i.access_token) {
|
|
988
|
-
const { access_token: o, oauthTokenScope: a, expires_in: s } = i,
|
|
989
|
-
return
|
|
988
|
+
const { access_token: o, oauthTokenScope: a, expires_in: s } = i, f = await this._getIdTokenFromCache();
|
|
989
|
+
return f && Object.assign(Object.assign({ id_token: f.id_token, access_token: o }, a ? { scope: a } : null), { expires_in: s });
|
|
990
990
|
}
|
|
991
991
|
}
|
|
992
992
|
async _requestToken(e, n) {
|
|
993
|
-
const { nonceIn: r, organization: i } = n || {}, o = await
|
|
993
|
+
const { nonceIn: r, organization: i } = n || {}, o = await Xr(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
|
};
|
|
997
|
-
async function
|
|
998
|
-
const e = new
|
|
997
|
+
async function si(t) {
|
|
998
|
+
const e = new ai(t);
|
|
999
999
|
return await e.checkSession(), e;
|
|
1000
1000
|
}
|
|
1001
|
-
const
|
|
1001
|
+
const Et = "sesamy.com", ci = "https://logs.sesamy.com/events", Pt = "sesamyCacheTimestamp";
|
|
1002
1002
|
var Q = /* @__PURE__ */ ((t) => (t.READY = "sesamyJsReady", t.AUTHENTICATED = "sesamyJsAuthenticated", t.LOGOUT = "sesamyJsLogout", t.CLEAR_CACHE = "sesamyJsClearCache", t.USER_ATTRIBUTE_CHANGED = "sesamyUserAttributeChanged", t.PURCHASE = "sesamyJsPurchase", t))(Q || {});
|
|
1003
1003
|
let B;
|
|
1004
|
-
const
|
|
1005
|
-
function
|
|
1006
|
-
const t = localStorage.getItem(
|
|
1004
|
+
const Nt = "sesamyAccessToken", Ut = "sesamyExpires";
|
|
1005
|
+
function zt() {
|
|
1006
|
+
const t = localStorage.getItem(Ut);
|
|
1007
1007
|
if (!(t && parseInt(t, 10) < (/* @__PURE__ */ new Date()).getTime()))
|
|
1008
|
-
return localStorage.getItem(
|
|
1008
|
+
return localStorage.getItem(Nt);
|
|
1009
1009
|
}
|
|
1010
|
-
async function
|
|
1011
|
-
if (t.enabled !== !1 && (B = await
|
|
1012
|
-
domain: t.endpoint || `token.${
|
|
1010
|
+
async function ui(t) {
|
|
1011
|
+
if (t.enabled !== !1 && (B = await si({
|
|
1012
|
+
domain: t.endpoint || `token.${Et}`,
|
|
1013
1013
|
clientId: t.clientId
|
|
1014
1014
|
}), window.location.search.includes("code=")))
|
|
1015
1015
|
try {
|
|
@@ -1021,15 +1021,15 @@ async function si(t) {
|
|
|
1021
1021
|
} catch {
|
|
1022
1022
|
}
|
|
1023
1023
|
}
|
|
1024
|
-
async function
|
|
1025
|
-
if (
|
|
1024
|
+
async function qn() {
|
|
1025
|
+
if (zt())
|
|
1026
1026
|
return !0;
|
|
1027
1027
|
if (!B)
|
|
1028
1028
|
throw new Error("Auth0 client not initialized");
|
|
1029
1029
|
return B.isAuthenticated();
|
|
1030
1030
|
}
|
|
1031
|
-
async function
|
|
1032
|
-
if (
|
|
1031
|
+
async function li() {
|
|
1032
|
+
if (zt())
|
|
1033
1033
|
return {
|
|
1034
1034
|
sub: "local",
|
|
1035
1035
|
name: "Local User"
|
|
@@ -1038,7 +1038,7 @@ async function ui() {
|
|
|
1038
1038
|
throw new Error("Auth0 client not initialized");
|
|
1039
1039
|
return B.getUser();
|
|
1040
1040
|
}
|
|
1041
|
-
function
|
|
1041
|
+
function Qn() {
|
|
1042
1042
|
if (!B)
|
|
1043
1043
|
throw new Error("Auth0 client not initialized");
|
|
1044
1044
|
return B.loginWithRedirect({
|
|
@@ -1047,8 +1047,8 @@ function Bn() {
|
|
|
1047
1047
|
}
|
|
1048
1048
|
});
|
|
1049
1049
|
}
|
|
1050
|
-
async function
|
|
1051
|
-
const e =
|
|
1050
|
+
async function en(t = !0) {
|
|
1051
|
+
const e = zt();
|
|
1052
1052
|
if (e)
|
|
1053
1053
|
return e;
|
|
1054
1054
|
try {
|
|
@@ -1062,7 +1062,7 @@ async function li(t = !0) {
|
|
|
1062
1062
|
}
|
|
1063
1063
|
}
|
|
1064
1064
|
async function di() {
|
|
1065
|
-
if (localStorage.removeItem(
|
|
1065
|
+
if (localStorage.removeItem(Nt), localStorage.removeItem(Ut), !B)
|
|
1066
1066
|
throw new Error("Auth0 client not initialized");
|
|
1067
1067
|
return ue(Q.LOGOUT, {}), B.logout({
|
|
1068
1068
|
logoutParams: {
|
|
@@ -1081,12 +1081,12 @@ function hi(t) {
|
|
|
1081
1081
|
);
|
|
1082
1082
|
return JSON.parse(i);
|
|
1083
1083
|
}
|
|
1084
|
-
async function
|
|
1085
|
-
localStorage.setItem(
|
|
1084
|
+
async function er(t, e) {
|
|
1085
|
+
localStorage.setItem(Nt, t), e && localStorage.setItem(Ut, JSON.stringify(e * 1e3 + (/* @__PURE__ */ new Date()).getTime()));
|
|
1086
1086
|
const n = hi(t);
|
|
1087
1087
|
ue(Q.AUTHENTICATED, n);
|
|
1088
1088
|
}
|
|
1089
|
-
const fi = (t, e) => e.skipDedupe || e.method !== "GET", pi = (t, e) => e.method + "@" + t, mi = (t) => t.clone(),
|
|
1089
|
+
const fi = (t, e) => e.skipDedupe || e.method !== "GET", pi = (t, e) => e.method + "@" + t, mi = (t) => t.clone(), tn = ({ skip: t = fi, key: e = pi, resolver: n = mi } = {}) => {
|
|
1090
1090
|
const r = /* @__PURE__ */ new Map();
|
|
1091
1091
|
return (i) => (o, a) => {
|
|
1092
1092
|
if (t(o, a))
|
|
@@ -1095,50 +1095,50 @@ const fi = (t, e) => e.skipDedupe || e.method !== "GET", pi = (t, e) => e.method
|
|
|
1095
1095
|
if (!r.has(s))
|
|
1096
1096
|
r.set(s, []);
|
|
1097
1097
|
else
|
|
1098
|
-
return new Promise((
|
|
1099
|
-
r.get(s).push([
|
|
1098
|
+
return new Promise((f, p) => {
|
|
1099
|
+
r.get(s).push([f, p]);
|
|
1100
1100
|
});
|
|
1101
1101
|
try {
|
|
1102
|
-
return i(o, a).then((
|
|
1103
|
-
throw r.get(s).forEach(([p, u]) => u(
|
|
1102
|
+
return i(o, a).then((f) => (r.get(s).forEach(([p]) => p(n(f))), r.delete(s), f)).catch((f) => {
|
|
1103
|
+
throw r.get(s).forEach(([p, u]) => u(f)), r.delete(s), f;
|
|
1104
1104
|
});
|
|
1105
|
-
} catch (
|
|
1106
|
-
return r.delete(s), Promise.reject(
|
|
1105
|
+
} catch (f) {
|
|
1106
|
+
return r.delete(s), Promise.reject(f);
|
|
1107
1107
|
}
|
|
1108
1108
|
};
|
|
1109
|
-
}, gi = (t, e) => t * e, yi = (t) => t && t.ok,
|
|
1109
|
+
}, gi = (t, e) => t * e, yi = (t) => t && t.ok, nn = ({ delayTimer: t = 500, delayRamp: e = gi, maxAttempts: n = 10, until: r = yi, onRetry: i = null, retryOnNetworkError: o = !1, resolveWithLatestResponse: a = !1, skip: s } = {}) => (f) => (p, u) => {
|
|
1110
1110
|
let c = 0;
|
|
1111
1111
|
if (s && s(p, u))
|
|
1112
|
-
return
|
|
1113
|
-
const
|
|
1114
|
-
const
|
|
1112
|
+
return f(p, u);
|
|
1113
|
+
const m = (d, w) => Promise.resolve(r(d, w)).then((k) => k ? d && a ? d : w ? Promise.reject(w) : d : (c++, !n || c <= n ? new Promise((v) => {
|
|
1114
|
+
const _ = e(t, c);
|
|
1115
1115
|
setTimeout(() => {
|
|
1116
1116
|
typeof i == "function" ? Promise.resolve(i({
|
|
1117
1117
|
response: d,
|
|
1118
1118
|
error: w,
|
|
1119
1119
|
url: p,
|
|
1120
1120
|
options: u
|
|
1121
|
-
})).then((
|
|
1122
|
-
var
|
|
1123
|
-
v(
|
|
1124
|
-
}) : v(
|
|
1125
|
-
},
|
|
1126
|
-
}).then(
|
|
1121
|
+
})).then((S = {}) => {
|
|
1122
|
+
var y, l;
|
|
1123
|
+
v(f((y = S && S.url) !== null && y !== void 0 ? y : p, (l = S && S.options) !== null && l !== void 0 ? l : u));
|
|
1124
|
+
}) : v(f(p, u));
|
|
1125
|
+
}, _);
|
|
1126
|
+
}).then(m).catch((v) => {
|
|
1127
1127
|
if (!o)
|
|
1128
1128
|
throw v;
|
|
1129
|
-
return
|
|
1129
|
+
return m(null, v);
|
|
1130
1130
|
}) : d && a ? d : Promise.reject(w || new Error("Number of attempts exceeded."))));
|
|
1131
|
-
return
|
|
1131
|
+
return f(p, u).then(m).catch((d) => {
|
|
1132
1132
|
if (!o)
|
|
1133
1133
|
throw d;
|
|
1134
|
-
return
|
|
1134
|
+
return m(null, d);
|
|
1135
1135
|
});
|
|
1136
|
-
}, vi = "application/json",
|
|
1137
|
-
function
|
|
1136
|
+
}, vi = "application/json", tr = "Content-Type", ke = Symbol(), nr = Symbol();
|
|
1137
|
+
function rn(t = {}) {
|
|
1138
1138
|
var e;
|
|
1139
|
-
return (e = Object.entries(t).find(([n]) => n.toLowerCase() ===
|
|
1139
|
+
return (e = Object.entries(t).find(([n]) => n.toLowerCase() === tr.toLowerCase())) === null || e === void 0 ? void 0 : e[1];
|
|
1140
1140
|
}
|
|
1141
|
-
function
|
|
1141
|
+
function on(t) {
|
|
1142
1142
|
return /^application\/.*json.*/.test(t);
|
|
1143
1143
|
}
|
|
1144
1144
|
const ge = function(t, e, n = !1) {
|
|
@@ -1177,43 +1177,43 @@ function ki(t) {
|
|
|
1177
1177
|
Oe.errorType = t;
|
|
1178
1178
|
}
|
|
1179
1179
|
const Ii = (t) => (e) => t.reduceRight((n, r) => r(n), e) || e;
|
|
1180
|
-
class
|
|
1180
|
+
class rr extends Error {
|
|
1181
1181
|
}
|
|
1182
1182
|
const Si = (t) => {
|
|
1183
1183
|
const e = /* @__PURE__ */ Object.create(null);
|
|
1184
|
-
t = t._addons.reduce((
|
|
1185
|
-
const { _url: n, _options: r, _config: i, _catchers: o, _resolvers: a, _middlewares: s, _addons:
|
|
1184
|
+
t = t._addons.reduce((y, l) => l.beforeRequest && l.beforeRequest(y, t._options, e) || y, t);
|
|
1185
|
+
const { _url: n, _options: r, _config: i, _catchers: o, _resolvers: a, _middlewares: s, _addons: f } = t, p = new Map(o), u = ge(i.options, r);
|
|
1186
1186
|
let c = n;
|
|
1187
|
-
const
|
|
1188
|
-
throw { [ke]:
|
|
1189
|
-
}).then((
|
|
1190
|
-
if (!
|
|
1191
|
-
const l = new
|
|
1187
|
+
const m = Ii(s)((y, l) => (c = y, i.polyfill("fetch")(y, l)))(n, u), d = new Error(), w = m.catch((y) => {
|
|
1188
|
+
throw { [ke]: y };
|
|
1189
|
+
}).then((y) => {
|
|
1190
|
+
if (!y.ok) {
|
|
1191
|
+
const l = new rr();
|
|
1192
1192
|
if (l.cause = d, l.stack = l.stack + `
|
|
1193
|
-
CAUSE: ` + d.stack, l.response =
|
|
1193
|
+
CAUSE: ` + d.stack, l.response = y, l.url = c, y.type === "opaque")
|
|
1194
1194
|
throw l;
|
|
1195
|
-
return
|
|
1196
|
-
var
|
|
1197
|
-
if (l.message = b, i.errorType === "json" || ((
|
|
1195
|
+
return y.text().then((b) => {
|
|
1196
|
+
var T;
|
|
1197
|
+
if (l.message = b, i.errorType === "json" || ((T = y.headers.get("Content-Type")) === null || T === void 0 ? void 0 : T.split(";")[0]) === "application/json")
|
|
1198
1198
|
try {
|
|
1199
1199
|
l.json = JSON.parse(b);
|
|
1200
1200
|
} catch {
|
|
1201
1201
|
}
|
|
1202
|
-
throw l.text = b, l.status =
|
|
1202
|
+
throw l.text = b, l.status = y.status, l;
|
|
1203
1203
|
});
|
|
1204
1204
|
}
|
|
1205
|
-
return
|
|
1206
|
-
}), k = (
|
|
1207
|
-
const b = l.hasOwnProperty(ke),
|
|
1205
|
+
return y;
|
|
1206
|
+
}), k = (y) => y.catch((l) => {
|
|
1207
|
+
const b = l.hasOwnProperty(ke), T = b ? l[ke] : l, O = (T == null ? void 0 : T.status) && p.get(T.status) || p.get(T == null ? void 0 : T.name) || b && p.has(ke) && p.get(ke);
|
|
1208
1208
|
if (O)
|
|
1209
|
-
return O(
|
|
1210
|
-
const
|
|
1211
|
-
if (
|
|
1212
|
-
return
|
|
1213
|
-
throw
|
|
1214
|
-
}), v = (
|
|
1209
|
+
return O(T, t);
|
|
1210
|
+
const C = p.get(nr);
|
|
1211
|
+
if (C)
|
|
1212
|
+
return C(T, t);
|
|
1213
|
+
throw T;
|
|
1214
|
+
}), v = (y) => (l) => /* If a callback is provided, then callback with the body result otherwise return the parsed body itself. */ k(y ? w.then((b) => b && b[y]()).then((b) => l ? l(b) : b) : w.then((b) => l ? l(b) : b)), _ = {
|
|
1215
1215
|
_wretchReq: t,
|
|
1216
|
-
_fetchReq:
|
|
1216
|
+
_fetchReq: m,
|
|
1217
1217
|
_sharedState: e,
|
|
1218
1218
|
res: v(null),
|
|
1219
1219
|
json: v("json"),
|
|
@@ -1221,35 +1221,35 @@ CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
|
1221
1221
|
formData: v("formData"),
|
|
1222
1222
|
arrayBuffer: v("arrayBuffer"),
|
|
1223
1223
|
text: v("text"),
|
|
1224
|
-
error(
|
|
1225
|
-
return p.set(
|
|
1224
|
+
error(y, l) {
|
|
1225
|
+
return p.set(y, l), this;
|
|
1226
1226
|
},
|
|
1227
|
-
badRequest(
|
|
1228
|
-
return this.error(400,
|
|
1227
|
+
badRequest(y) {
|
|
1228
|
+
return this.error(400, y);
|
|
1229
1229
|
},
|
|
1230
|
-
unauthorized(
|
|
1231
|
-
return this.error(401,
|
|
1230
|
+
unauthorized(y) {
|
|
1231
|
+
return this.error(401, y);
|
|
1232
1232
|
},
|
|
1233
|
-
forbidden(
|
|
1234
|
-
return this.error(403,
|
|
1233
|
+
forbidden(y) {
|
|
1234
|
+
return this.error(403, y);
|
|
1235
1235
|
},
|
|
1236
|
-
notFound(
|
|
1237
|
-
return this.error(404,
|
|
1236
|
+
notFound(y) {
|
|
1237
|
+
return this.error(404, y);
|
|
1238
1238
|
},
|
|
1239
|
-
timeout(
|
|
1240
|
-
return this.error(408,
|
|
1239
|
+
timeout(y) {
|
|
1240
|
+
return this.error(408, y);
|
|
1241
1241
|
},
|
|
1242
|
-
internalError(
|
|
1243
|
-
return this.error(500,
|
|
1242
|
+
internalError(y) {
|
|
1243
|
+
return this.error(500, y);
|
|
1244
1244
|
},
|
|
1245
|
-
fetchError(
|
|
1246
|
-
return this.error(ke,
|
|
1245
|
+
fetchError(y) {
|
|
1246
|
+
return this.error(ke, y);
|
|
1247
1247
|
}
|
|
1248
|
-
},
|
|
1249
|
-
...
|
|
1250
|
-
...typeof l.resolver == "function" ? l.resolver(
|
|
1251
|
-
}),
|
|
1252
|
-
return a.reduce((
|
|
1248
|
+
}, S = f.reduce((y, l) => ({
|
|
1249
|
+
...y,
|
|
1250
|
+
...typeof l.resolver == "function" ? l.resolver(y) : l.resolver
|
|
1251
|
+
}), _);
|
|
1252
|
+
return a.reduce((y, l) => l(y, t), S);
|
|
1253
1253
|
}, _i = {
|
|
1254
1254
|
_url: "",
|
|
1255
1255
|
_options: {},
|
|
@@ -1300,7 +1300,7 @@ CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
|
1300
1300
|
return this.headers({ Accept: t });
|
|
1301
1301
|
},
|
|
1302
1302
|
content(t) {
|
|
1303
|
-
return this.headers({ [
|
|
1303
|
+
return this.headers({ [tr]: t });
|
|
1304
1304
|
},
|
|
1305
1305
|
auth(t) {
|
|
1306
1306
|
return this.headers({ Authorization: t });
|
|
@@ -1310,7 +1310,7 @@ CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
|
1310
1310
|
return n.set(t, e), { ...this, _catchers: n };
|
|
1311
1311
|
},
|
|
1312
1312
|
catcherFallback(t) {
|
|
1313
|
-
return this.catcher(
|
|
1313
|
+
return this.catcher(nr, t);
|
|
1314
1314
|
},
|
|
1315
1315
|
resolve(t, e = !1) {
|
|
1316
1316
|
return { ...this, _resolvers: e ? [t] : [...this._resolvers, t] };
|
|
@@ -1329,7 +1329,7 @@ CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
|
1329
1329
|
},
|
|
1330
1330
|
fetch(t = this._options.method, e = "", n = null) {
|
|
1331
1331
|
let r = this.url(e).options({ method: t });
|
|
1332
|
-
const i =
|
|
1332
|
+
const i = rn(r._options.headers), o = typeof n == "object" && (!r._options.headers || !i || on(i));
|
|
1333
1333
|
return r = n ? o ? r.json(n, i) : r.body(n) : r, Si(r._deferred.reduce((a, s) => s(a, a._url, a._options), r));
|
|
1334
1334
|
},
|
|
1335
1335
|
get(t = "") {
|
|
@@ -1357,8 +1357,8 @@ CAUSE: ` + d.stack, l.response = g, l.url = c, g.type === "opaque")
|
|
|
1357
1357
|
return { ...this, _options: { ...this._options, body: t } };
|
|
1358
1358
|
},
|
|
1359
1359
|
json(t, e) {
|
|
1360
|
-
const n =
|
|
1361
|
-
return this.content(e ||
|
|
1360
|
+
const n = rn(this._options.headers);
|
|
1361
|
+
return this.content(e || on(n) && n || vi).body(JSON.stringify(t));
|
|
1362
1362
|
}
|
|
1363
1363
|
};
|
|
1364
1364
|
function le(t = "", e = {}) {
|
|
@@ -1368,195 +1368,205 @@ le.default = le;
|
|
|
1368
1368
|
le.options = wi;
|
|
1369
1369
|
le.errorType = ki;
|
|
1370
1370
|
le.polyfills = bi;
|
|
1371
|
-
le.WretchError =
|
|
1372
|
-
function
|
|
1373
|
-
sessionStorage.removeItem(
|
|
1371
|
+
le.WretchError = rr;
|
|
1372
|
+
function te() {
|
|
1373
|
+
sessionStorage.removeItem(Pt), ue(Q.CLEAR_CACHE, {});
|
|
1374
1374
|
}
|
|
1375
1375
|
function Ei(t) {
|
|
1376
|
-
const e = t.endpoint || `https://api2.${
|
|
1377
|
-
let
|
|
1378
|
-
|
|
1379
|
-
const
|
|
1380
|
-
...
|
|
1376
|
+
const e = t.endpoint || `https://api2.${Et}`, n = (I) => async (E, W) => {
|
|
1377
|
+
let h = sessionStorage.getItem(Pt);
|
|
1378
|
+
h || (h = Date.now().toString(), sessionStorage.setItem(Pt, h));
|
|
1379
|
+
const g = {
|
|
1380
|
+
...W,
|
|
1381
1381
|
headers: {
|
|
1382
|
-
...
|
|
1383
|
-
"Cache-Timestamp":
|
|
1382
|
+
...W.headers,
|
|
1383
|
+
"Cache-Timestamp": h
|
|
1384
1384
|
}
|
|
1385
1385
|
};
|
|
1386
|
-
return
|
|
1387
|
-
}, r = (
|
|
1388
|
-
let
|
|
1389
|
-
if (
|
|
1390
|
-
if (
|
|
1386
|
+
return I(E, g);
|
|
1387
|
+
}, r = (I = !0) => (E) => async (W, h) => {
|
|
1388
|
+
let g = null;
|
|
1389
|
+
if (g = await en(I), !g) {
|
|
1390
|
+
if (I)
|
|
1391
1391
|
throw new Error("No access token available");
|
|
1392
|
-
return
|
|
1392
|
+
return E(W, h);
|
|
1393
1393
|
}
|
|
1394
|
-
const
|
|
1395
|
-
...
|
|
1394
|
+
const P = {
|
|
1395
|
+
...h,
|
|
1396
1396
|
headers: {
|
|
1397
|
-
...
|
|
1398
|
-
...
|
|
1397
|
+
...h.headers,
|
|
1398
|
+
...g ? { Authorization: `Bearer ${g}` } : {}
|
|
1399
1399
|
}
|
|
1400
1400
|
};
|
|
1401
|
-
return
|
|
1402
|
-
}, i = (
|
|
1403
|
-
if (
|
|
1404
|
-
return
|
|
1405
|
-
const
|
|
1406
|
-
...
|
|
1401
|
+
return E(W, P);
|
|
1402
|
+
}, i = (I) => (E, W) => {
|
|
1403
|
+
if (W.headers.Authorization)
|
|
1404
|
+
return I(E, W);
|
|
1405
|
+
const h = localStorage.getItem("__anon_id"), g = btoa(`${h}:`), P = {
|
|
1406
|
+
...W,
|
|
1407
1407
|
headers: {
|
|
1408
|
-
...
|
|
1409
|
-
Authorization: `Basic ${
|
|
1408
|
+
...W.headers,
|
|
1409
|
+
Authorization: `Basic ${g}`
|
|
1410
1410
|
}
|
|
1411
1411
|
};
|
|
1412
|
-
return
|
|
1412
|
+
return I(E, P);
|
|
1413
1413
|
}, o = le(e).headers({ "Content-Type": "application/json" }).middlewares([
|
|
1414
1414
|
n,
|
|
1415
1415
|
r(),
|
|
1416
|
-
|
|
1417
|
-
|
|
1416
|
+
tn(),
|
|
1417
|
+
nn({
|
|
1418
1418
|
delayTimer: 1e3,
|
|
1419
|
-
delayRamp: (
|
|
1419
|
+
delayRamp: (I, E) => I * E,
|
|
1420
1420
|
maxAttempts: 3,
|
|
1421
|
-
until: (
|
|
1421
|
+
until: (I) => !!(I && (I.ok || I.status >= 400 && I.status < 500)),
|
|
1422
1422
|
retryOnNetworkError: !1
|
|
1423
1423
|
})
|
|
1424
1424
|
]), a = le(e).headers({ "Content-Type": "application/json" }).middlewares([
|
|
1425
1425
|
n,
|
|
1426
1426
|
r(!1),
|
|
1427
1427
|
i,
|
|
1428
|
-
|
|
1429
|
-
|
|
1428
|
+
tn(),
|
|
1429
|
+
nn({
|
|
1430
1430
|
delayTimer: 1e3,
|
|
1431
|
-
delayRamp: (
|
|
1431
|
+
delayRamp: (I, E) => I * E,
|
|
1432
1432
|
maxAttempts: 3,
|
|
1433
|
-
until: (
|
|
1433
|
+
until: (I) => !!(I && (I.ok || I.status >= 400 && I.status < 500)),
|
|
1434
1434
|
retryOnNetworkError: !1
|
|
1435
1435
|
})
|
|
1436
1436
|
]);
|
|
1437
1437
|
async function s() {
|
|
1438
1438
|
return o.get("/entitlements").json();
|
|
1439
1439
|
}
|
|
1440
|
-
async function
|
|
1441
|
-
const
|
|
1442
|
-
return
|
|
1440
|
+
async function f(I) {
|
|
1441
|
+
const E = await o.get("/entitlements").json();
|
|
1442
|
+
return E == null ? void 0 : E.find((W) => W.id === I);
|
|
1443
1443
|
}
|
|
1444
|
-
async function p(
|
|
1445
|
-
return o.get(`/entitlements/${
|
|
1444
|
+
async function p(I) {
|
|
1445
|
+
return o.get(`/entitlements/${I}/access`).json();
|
|
1446
1446
|
}
|
|
1447
1447
|
async function u() {
|
|
1448
1448
|
return o.get("/contracts").json();
|
|
1449
1449
|
}
|
|
1450
|
-
async function c(
|
|
1451
|
-
const
|
|
1452
|
-
return
|
|
1450
|
+
async function c(I) {
|
|
1451
|
+
const E = await o.get("/contracts").json();
|
|
1452
|
+
return E == null ? void 0 : E.find((W) => W.id === I);
|
|
1453
1453
|
}
|
|
1454
|
-
async function
|
|
1454
|
+
async function m() {
|
|
1455
1455
|
return o.get("/subscriptions").json();
|
|
1456
1456
|
}
|
|
1457
1457
|
async function d() {
|
|
1458
1458
|
return o.get("/bills").json();
|
|
1459
1459
|
}
|
|
1460
|
-
async function w(
|
|
1461
|
-
const
|
|
1462
|
-
return
|
|
1460
|
+
async function w(I) {
|
|
1461
|
+
const E = await o.get("/bills").json();
|
|
1462
|
+
return E == null ? void 0 : E.find((W) => W.id === I);
|
|
1463
1463
|
}
|
|
1464
|
-
async function k(
|
|
1465
|
-
const
|
|
1466
|
-
return ue(Q.USER_ATTRIBUTE_CHANGED, {}),
|
|
1464
|
+
async function k(I, E) {
|
|
1465
|
+
const W = await o.url(`/user-metadata/${I}`).put(E).json();
|
|
1466
|
+
return ue(Q.USER_ATTRIBUTE_CHANGED, {}), te(), W;
|
|
1467
1467
|
}
|
|
1468
|
-
async function v(
|
|
1469
|
-
const
|
|
1470
|
-
return
|
|
1468
|
+
async function v(I) {
|
|
1469
|
+
const E = await o.url(`/user-metadata/${I}`).delete().res();
|
|
1470
|
+
return te(), E.ok;
|
|
1471
1471
|
}
|
|
1472
|
-
async function
|
|
1473
|
-
return (await o.url(`/user-metadata/${
|
|
1472
|
+
async function _(I) {
|
|
1473
|
+
return (await o.url(`/user-metadata/${I}`).get().json())[I];
|
|
1474
1474
|
}
|
|
1475
|
-
async function
|
|
1475
|
+
async function S() {
|
|
1476
1476
|
return await o.url("/user-metadata").get().json();
|
|
1477
1477
|
}
|
|
1478
|
-
async function
|
|
1478
|
+
async function y() {
|
|
1479
1479
|
return await o.url("/tags").get().json();
|
|
1480
1480
|
}
|
|
1481
|
-
async function l(
|
|
1482
|
-
const
|
|
1483
|
-
return
|
|
1481
|
+
async function l(I) {
|
|
1482
|
+
const E = await o.url(`/tags/${I}`).delete().res();
|
|
1483
|
+
return te(), E.ok;
|
|
1484
1484
|
}
|
|
1485
|
-
async function b(
|
|
1486
|
-
const
|
|
1487
|
-
return ue(Q.USER_ATTRIBUTE_CHANGED, {}),
|
|
1485
|
+
async function b(I) {
|
|
1486
|
+
const E = await o.url("/tags").post(I).res();
|
|
1487
|
+
return ue(Q.USER_ATTRIBUTE_CHANGED, {}), te(), E.ok;
|
|
1488
1488
|
}
|
|
1489
|
-
async function
|
|
1490
|
-
return (await a.url("/tallies").get().json())[
|
|
1489
|
+
async function T(I) {
|
|
1490
|
+
return (await a.url("/tallies").get().json())[I];
|
|
1491
1491
|
}
|
|
1492
1492
|
async function O() {
|
|
1493
1493
|
return await a.url("/tallies").get().json();
|
|
1494
1494
|
}
|
|
1495
|
-
async function
|
|
1496
|
-
const
|
|
1497
|
-
return
|
|
1495
|
+
async function C(I) {
|
|
1496
|
+
const E = await a.url(`/tallies/${I}`).delete().res();
|
|
1497
|
+
return te(), E.ok;
|
|
1498
1498
|
}
|
|
1499
|
-
async function D(
|
|
1500
|
-
return await a.url(`/tallies/${
|
|
1499
|
+
async function D(I, E) {
|
|
1500
|
+
return await a.url(`/tallies/${I}/push`).post(E).json();
|
|
1501
1501
|
}
|
|
1502
|
-
async function
|
|
1503
|
-
return await o.url(`/products/${
|
|
1502
|
+
async function z(I) {
|
|
1503
|
+
return await o.url(`/products/${I}`).get().json();
|
|
1504
1504
|
}
|
|
1505
|
-
async function
|
|
1506
|
-
return await o.url("/profile").get().json();
|
|
1505
|
+
async function F() {
|
|
1506
|
+
return await qn() ? await o.url("/profile").get().json() : null;
|
|
1507
1507
|
}
|
|
1508
|
-
async function
|
|
1508
|
+
async function $(I) {
|
|
1509
|
+
const E = await o.url("/profile").patch(I).res();
|
|
1510
|
+
return te(), E.ok;
|
|
1511
|
+
}
|
|
1512
|
+
async function R() {
|
|
1509
1513
|
return await o.url("/payment-issues").get().json();
|
|
1510
1514
|
}
|
|
1511
|
-
async function
|
|
1512
|
-
const
|
|
1513
|
-
return
|
|
1515
|
+
async function K(I) {
|
|
1516
|
+
const E = await o.url(`/products/${I}/auto-onboard`).post().json();
|
|
1517
|
+
return E.length && te(), E;
|
|
1518
|
+
}
|
|
1519
|
+
async function j() {
|
|
1520
|
+
const I = await en(!1), E = new URL(`https://account.${Et}/subscriptions/${t.clientId}`);
|
|
1521
|
+
I && (E.hash = `#access_token=${I}`), window.location.href = E.toString();
|
|
1514
1522
|
}
|
|
1515
1523
|
return {
|
|
1516
1524
|
getEntitlements: s,
|
|
1517
|
-
getEntitlement:
|
|
1525
|
+
getEntitlement: f,
|
|
1518
1526
|
getEntitlementAccess: p,
|
|
1519
1527
|
getContracts: u,
|
|
1520
1528
|
getContract: c,
|
|
1521
|
-
getProfile:
|
|
1522
|
-
|
|
1529
|
+
getProfile: F,
|
|
1530
|
+
updateProfile: $,
|
|
1531
|
+
getSubscriptions: m,
|
|
1523
1532
|
getBills: d,
|
|
1524
1533
|
getBill: w,
|
|
1525
1534
|
setUserMetadata: k,
|
|
1526
1535
|
deleteUserMetadata: v,
|
|
1527
|
-
getUserMetadata:
|
|
1528
|
-
listUserMetadata:
|
|
1529
|
-
getTags:
|
|
1536
|
+
getUserMetadata: _,
|
|
1537
|
+
listUserMetadata: S,
|
|
1538
|
+
getTags: y,
|
|
1530
1539
|
deleteTag: l,
|
|
1531
1540
|
setTag: b,
|
|
1532
|
-
getTally:
|
|
1541
|
+
getTally: T,
|
|
1533
1542
|
getTallies: O,
|
|
1534
|
-
deleteTally:
|
|
1543
|
+
deleteTally: C,
|
|
1535
1544
|
pushTally: D,
|
|
1536
|
-
getProduct:
|
|
1537
|
-
getPaymentIssues:
|
|
1538
|
-
autoOnboardProduct:
|
|
1545
|
+
getProduct: z,
|
|
1546
|
+
getPaymentIssues: R,
|
|
1547
|
+
autoOnboardProduct: K,
|
|
1548
|
+
openHostedAccountPage: j
|
|
1539
1549
|
};
|
|
1540
1550
|
}
|
|
1541
|
-
const
|
|
1542
|
-
function
|
|
1551
|
+
const ir = "@sesamy/sesamy-js", Rt = "1.3.2";
|
|
1552
|
+
function an(t, e, n, r, i) {
|
|
1543
1553
|
for (e = e.split ? e.split(".") : e, r = 0; r < e.length; r++)
|
|
1544
1554
|
t = t ? t[e[r]] : i;
|
|
1545
1555
|
return t === i ? n : t;
|
|
1546
1556
|
}
|
|
1547
|
-
var Je = "undefined",
|
|
1548
|
-
},
|
|
1557
|
+
var Je = "undefined", sn = "object", Tt = function() {
|
|
1558
|
+
}, or = "any", ar = "*", ve = "__", tt = typeof process < "u" ? process : {};
|
|
1549
1559
|
tt.env && tt.env.NODE_ENV;
|
|
1550
|
-
var
|
|
1560
|
+
var X = typeof document < "u";
|
|
1551
1561
|
tt.versions != null && tt.versions.node != null;
|
|
1552
1562
|
typeof Deno < "u" && Deno.core;
|
|
1553
|
-
|
|
1554
|
-
function
|
|
1563
|
+
X && window.name === "nodejs" || typeof navigator < "u" && navigator.userAgent !== void 0 && (navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom"));
|
|
1564
|
+
function sr(t, e) {
|
|
1555
1565
|
return e.charAt(0)[t]() + e.slice(1);
|
|
1556
1566
|
}
|
|
1557
|
-
var Pi =
|
|
1567
|
+
var Pi = sr.bind(null, "toUpperCase"), Ti = sr.bind(null, "toLowerCase");
|
|
1558
1568
|
function Oi(t) {
|
|
1559
|
-
return
|
|
1569
|
+
return cr(t) ? Pi("null") : typeof t == "object" ? Ai(t) : Object.prototype.toString.call(t).slice(8, -1);
|
|
1560
1570
|
}
|
|
1561
1571
|
function nt(t, e) {
|
|
1562
1572
|
e === void 0 && (e = !0);
|
|
@@ -1568,13 +1578,13 @@ function We(t, e) {
|
|
|
1568
1578
|
}
|
|
1569
1579
|
var Y = We.bind(null, "function"), se = We.bind(null, "string"), Se = We.bind(null, "undefined"), ji = We.bind(null, "boolean");
|
|
1570
1580
|
We.bind(null, "symbol");
|
|
1571
|
-
function
|
|
1581
|
+
function cr(t) {
|
|
1572
1582
|
return t === null;
|
|
1573
1583
|
}
|
|
1574
1584
|
function Ci(t) {
|
|
1575
1585
|
return nt(t) === "number" && !isNaN(t);
|
|
1576
1586
|
}
|
|
1577
|
-
function
|
|
1587
|
+
function ur(t) {
|
|
1578
1588
|
return nt(t) === "array";
|
|
1579
1589
|
}
|
|
1580
1590
|
function V(t) {
|
|
@@ -1593,8 +1603,8 @@ function Ai(t) {
|
|
|
1593
1603
|
function $i(t) {
|
|
1594
1604
|
return t instanceof Error || se(t.message) && t.constructor && Ci(t.constructor.stackTraceLimit);
|
|
1595
1605
|
}
|
|
1596
|
-
function
|
|
1597
|
-
if (typeof e != "object" ||
|
|
1606
|
+
function lr(t, e) {
|
|
1607
|
+
if (typeof e != "object" || cr(e))
|
|
1598
1608
|
return !1;
|
|
1599
1609
|
if (e instanceof t)
|
|
1600
1610
|
return !0;
|
|
@@ -1607,8 +1617,8 @@ function cr(t, e) {
|
|
|
1607
1617
|
}
|
|
1608
1618
|
return !1;
|
|
1609
1619
|
}
|
|
1610
|
-
|
|
1611
|
-
|
|
1620
|
+
lr.bind(null, TypeError);
|
|
1621
|
+
lr.bind(null, SyntaxError);
|
|
1612
1622
|
function ot(t, e) {
|
|
1613
1623
|
var n = t instanceof Element || t instanceof HTMLDocument;
|
|
1614
1624
|
return n && e ? Ni(t, e) : n;
|
|
@@ -1627,9 +1637,9 @@ at(ot, "button");
|
|
|
1627
1637
|
at(ot, "input");
|
|
1628
1638
|
at(ot, "select");
|
|
1629
1639
|
function Ui(t) {
|
|
1630
|
-
return t ?
|
|
1640
|
+
return t ? ur(t) ? t : [t] : [];
|
|
1631
1641
|
}
|
|
1632
|
-
function
|
|
1642
|
+
function cn(t) {
|
|
1633
1643
|
try {
|
|
1634
1644
|
return decodeURIComponent(t.replace(/\+/g, " "));
|
|
1635
1645
|
} catch {
|
|
@@ -1637,7 +1647,7 @@ function an(t) {
|
|
|
1637
1647
|
}
|
|
1638
1648
|
}
|
|
1639
1649
|
function zi() {
|
|
1640
|
-
if (
|
|
1650
|
+
if (X) {
|
|
1641
1651
|
var t = navigator, e = t.languages;
|
|
1642
1652
|
return t.userLanguage || (e && e.length ? e[0] : t.language);
|
|
1643
1653
|
}
|
|
@@ -1651,12 +1661,12 @@ function Ri() {
|
|
|
1651
1661
|
function Di(t) {
|
|
1652
1662
|
return function(e) {
|
|
1653
1663
|
for (var n, r = /* @__PURE__ */ Object.create(null), i = /([^&=]+)=?([^&]*)/g; n = i.exec(e); ) {
|
|
1654
|
-
var o =
|
|
1664
|
+
var o = cn(n[1]), a = cn(n[2]);
|
|
1655
1665
|
o.substring(o.length - 2) === "[]" ? (r[o = o.substring(0, o.length - 2)] || (r[o] = [])).push(a) : r[o] = a === "" || a;
|
|
1656
1666
|
}
|
|
1657
1667
|
for (var s in r) {
|
|
1658
|
-
var
|
|
1659
|
-
|
|
1668
|
+
var f = s.split("[");
|
|
1669
|
+
f.length > 1 && (Li(r, f.map(function(p) {
|
|
1660
1670
|
return p.replace(/[?[\]\\ ]/g, "");
|
|
1661
1671
|
}), r[s]), delete r[s]);
|
|
1662
1672
|
}
|
|
@@ -1666,7 +1676,7 @@ function Di(t) {
|
|
|
1666
1676
|
var n = e.match(/\?(.*)/);
|
|
1667
1677
|
return n && n[1] ? n[1].split("#")[0] : "";
|
|
1668
1678
|
}
|
|
1669
|
-
return
|
|
1679
|
+
return X && window.location.search.substring(1);
|
|
1670
1680
|
}(t));
|
|
1671
1681
|
}
|
|
1672
1682
|
function Li(t, e, n) {
|
|
@@ -1690,13 +1700,13 @@ function Mi(t, e) {
|
|
|
1690
1700
|
a = /* @__PURE__ */ new Date(), o = null, i = t.apply(n, r);
|
|
1691
1701
|
};
|
|
1692
1702
|
return function() {
|
|
1693
|
-
var
|
|
1694
|
-
a || (a =
|
|
1695
|
-
var p = e - (
|
|
1696
|
-
return n = this, r = arguments, p <= 0 ? (clearTimeout(o), o = null, a =
|
|
1703
|
+
var f = /* @__PURE__ */ new Date();
|
|
1704
|
+
a || (a = f);
|
|
1705
|
+
var p = e - (f - a);
|
|
1706
|
+
return n = this, r = arguments, p <= 0 ? (clearTimeout(o), o = null, a = f, i = t.apply(n, r)) : o || (o = setTimeout(s, p)), i;
|
|
1697
1707
|
};
|
|
1698
1708
|
}
|
|
1699
|
-
var De = "global", je = ve + "global" + ve, Ce = typeof self ===
|
|
1709
|
+
var De = "global", je = ve + "global" + ve, Ce = typeof self === sn && self.self === self && self || typeof global === sn && global.global === global && global || void 0;
|
|
1700
1710
|
function we(t) {
|
|
1701
1711
|
return Ce[je][t];
|
|
1702
1712
|
}
|
|
@@ -1709,7 +1719,7 @@ function Ae(t) {
|
|
|
1709
1719
|
function $e(t, e, n) {
|
|
1710
1720
|
var r;
|
|
1711
1721
|
try {
|
|
1712
|
-
if (
|
|
1722
|
+
if (Dt(t)) {
|
|
1713
1723
|
var i = window[t];
|
|
1714
1724
|
r = i[e].bind(i);
|
|
1715
1725
|
}
|
|
@@ -1719,7 +1729,7 @@ function $e(t, e, n) {
|
|
|
1719
1729
|
}
|
|
1720
1730
|
Ce[je] || (Ce[je] = {});
|
|
1721
1731
|
var Xe = {};
|
|
1722
|
-
function
|
|
1732
|
+
function Dt(t) {
|
|
1723
1733
|
if (typeof Xe[t] !== Je)
|
|
1724
1734
|
return Xe[t];
|
|
1725
1735
|
try {
|
|
@@ -1730,29 +1740,29 @@ function Rt(t) {
|
|
|
1730
1740
|
}
|
|
1731
1741
|
return Xe[t] = !0;
|
|
1732
1742
|
}
|
|
1733
|
-
function
|
|
1734
|
-
return
|
|
1743
|
+
function A() {
|
|
1744
|
+
return A = Object.assign || function(t) {
|
|
1735
1745
|
for (var e = 1; e < arguments.length; e++) {
|
|
1736
1746
|
var n = arguments[e];
|
|
1737
1747
|
for (var r in n)
|
|
1738
1748
|
Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
|
|
1739
1749
|
}
|
|
1740
1750
|
return t;
|
|
1741
|
-
},
|
|
1751
|
+
}, A.apply(this, arguments);
|
|
1742
1752
|
}
|
|
1743
|
-
var ae = "function", ie = "undefined", Zi = "@@redux/" + Math.random().toString(36),
|
|
1753
|
+
var ae = "function", ie = "undefined", Zi = "@@redux/" + Math.random().toString(36), un = /* @__PURE__ */ function() {
|
|
1744
1754
|
return typeof Symbol === ae && Symbol.observable || "@@observable";
|
|
1745
1755
|
}(), Ve = " != " + ae;
|
|
1746
|
-
function
|
|
1756
|
+
function dr(t, e, n) {
|
|
1747
1757
|
var r;
|
|
1748
1758
|
if (typeof e === ae && typeof n === ie && (n = e, e = void 0), typeof n !== ie) {
|
|
1749
1759
|
if (typeof n !== ae)
|
|
1750
1760
|
throw new Error("enhancer" + Ve);
|
|
1751
|
-
return n(
|
|
1761
|
+
return n(dr)(t, e);
|
|
1752
1762
|
}
|
|
1753
1763
|
if (typeof t !== ae)
|
|
1754
1764
|
throw new Error("reducer" + Ve);
|
|
1755
|
-
var i = t, o = e, a = [], s = a,
|
|
1765
|
+
var i = t, o = e, a = [], s = a, f = !1;
|
|
1756
1766
|
function p() {
|
|
1757
1767
|
s === a && (s = a.slice());
|
|
1758
1768
|
}
|
|
@@ -1771,27 +1781,27 @@ function ur(t, e, n) {
|
|
|
1771
1781
|
}
|
|
1772
1782
|
};
|
|
1773
1783
|
}
|
|
1774
|
-
function
|
|
1784
|
+
function m(d) {
|
|
1775
1785
|
if (!V(d))
|
|
1776
1786
|
throw new Error("Act != obj");
|
|
1777
1787
|
if (typeof d.type === ie)
|
|
1778
1788
|
throw new Error("ActType " + ie);
|
|
1779
|
-
if (
|
|
1789
|
+
if (f)
|
|
1780
1790
|
throw new Error("Dispatch in reducer");
|
|
1781
1791
|
try {
|
|
1782
|
-
|
|
1792
|
+
f = !0, o = i(o, d);
|
|
1783
1793
|
} finally {
|
|
1784
|
-
|
|
1794
|
+
f = !1;
|
|
1785
1795
|
}
|
|
1786
1796
|
for (var w = a = s, k = 0; k < w.length; k++)
|
|
1787
1797
|
(0, w[k])();
|
|
1788
1798
|
return d;
|
|
1789
1799
|
}
|
|
1790
|
-
return
|
|
1800
|
+
return m({ type: "@@redux/INIT" }), (r = { dispatch: m, subscribe: c, getState: u, replaceReducer: function(d) {
|
|
1791
1801
|
if (typeof d !== ae)
|
|
1792
1802
|
throw new Error("next reducer" + Ve);
|
|
1793
|
-
i = d,
|
|
1794
|
-
} })[
|
|
1803
|
+
i = d, m({ type: "@@redux/INIT" });
|
|
1804
|
+
} })[un] = function() {
|
|
1795
1805
|
var d, w = c;
|
|
1796
1806
|
return (d = { subscribe: function(k) {
|
|
1797
1807
|
if (typeof k != "object")
|
|
@@ -1800,7 +1810,7 @@ function ur(t, e, n) {
|
|
|
1800
1810
|
k.next && k.next(u());
|
|
1801
1811
|
}
|
|
1802
1812
|
return v(), { unsubscribe: w(v) };
|
|
1803
|
-
} })[
|
|
1813
|
+
} })[un] = function() {
|
|
1804
1814
|
return this;
|
|
1805
1815
|
}, d;
|
|
1806
1816
|
}, r;
|
|
@@ -1823,44 +1833,44 @@ function Wi() {
|
|
|
1823
1833
|
var t = arguments;
|
|
1824
1834
|
return function(e) {
|
|
1825
1835
|
return function(n, r, i) {
|
|
1826
|
-
var o, a = e(n, r, i), s = a.dispatch,
|
|
1836
|
+
var o, a = e(n, r, i), s = a.dispatch, f = { getState: a.getState, dispatch: function(p) {
|
|
1827
1837
|
return s(p);
|
|
1828
1838
|
} };
|
|
1829
1839
|
return o = [].slice.call(t).map(function(p) {
|
|
1830
|
-
return p(
|
|
1831
|
-
}),
|
|
1840
|
+
return p(f);
|
|
1841
|
+
}), A({}, a, { dispatch: s = xe.apply(void 0, o)(a.dispatch) });
|
|
1832
1842
|
};
|
|
1833
1843
|
};
|
|
1834
1844
|
}
|
|
1835
|
-
var ce = ve + "anon_id", ye = ve + "user_id", Ee = ve + "user_traits", oe = "userId", _e = "anonymousId", et = ["bootstrap", "params", "campaign", "initializeStart", "initialize", "initializeEnd", "ready", "resetStart", "reset", "resetEnd", "pageStart", "page", "pageEnd", "pageAborted", "trackStart", "track", "trackEnd", "trackAborted", "identifyStart", "identify", "identifyEnd", "identifyAborted", "userIdChanged", "registerPlugins", "enablePlugin", "disablePlugin", "online", "offline", "setItemStart", "setItem", "setItemEnd", "setItemAborted", "removeItemStart", "removeItem", "removeItemEnd", "removeItemAborted"],
|
|
1845
|
+
var ce = ve + "anon_id", ye = ve + "user_id", Ee = ve + "user_traits", oe = "userId", _e = "anonymousId", et = ["bootstrap", "params", "campaign", "initializeStart", "initialize", "initializeEnd", "ready", "resetStart", "reset", "resetEnd", "pageStart", "page", "pageEnd", "pageAborted", "trackStart", "track", "trackEnd", "trackAborted", "identifyStart", "identify", "identifyEnd", "identifyAborted", "userIdChanged", "registerPlugins", "enablePlugin", "disablePlugin", "online", "offline", "setItemStart", "setItem", "setItemEnd", "setItemAborted", "removeItemStart", "removeItem", "removeItemEnd", "removeItemAborted"], Ot = ["name", "EVENTS", "config", "loaded"], x = et.reduce(function(t, e) {
|
|
1836
1846
|
return t[e] = e, t;
|
|
1837
1847
|
}, { registerPluginType: function(t) {
|
|
1838
1848
|
return "registerPlugin:" + t;
|
|
1839
1849
|
}, pluginReadyType: function(t) {
|
|
1840
1850
|
return "ready:" + t;
|
|
1841
|
-
} }),
|
|
1851
|
+
} }), ln = /^utm_/, dn = /^an_prop_/, hn = /^an_trait_/;
|
|
1842
1852
|
function Hi(t) {
|
|
1843
1853
|
var e = t.storage.setItem;
|
|
1844
1854
|
return function(n) {
|
|
1845
1855
|
return function(r) {
|
|
1846
1856
|
return function(i) {
|
|
1847
|
-
if (i.type ===
|
|
1848
|
-
var o = i.params, a = i.user, s = i.persistedUser,
|
|
1849
|
-
s.anonymousId !== a.anonymousId && e(ce, a.anonymousId), p || e(ye, a.userId),
|
|
1857
|
+
if (i.type === x.bootstrap) {
|
|
1858
|
+
var o = i.params, a = i.user, s = i.persistedUser, f = i.initialUser, p = s.userId === a.userId;
|
|
1859
|
+
s.anonymousId !== a.anonymousId && e(ce, a.anonymousId), p || e(ye, a.userId), f.traits && e(Ee, A({}, p && s.traits ? s.traits : {}, f.traits));
|
|
1850
1860
|
var u = Object.keys(i.params);
|
|
1851
1861
|
if (u.length) {
|
|
1852
|
-
var c = o.an_uid,
|
|
1853
|
-
if (k.match(
|
|
1854
|
-
var v = k.replace(
|
|
1862
|
+
var c = o.an_uid, m = o.an_event, d = u.reduce(function(w, k) {
|
|
1863
|
+
if (k.match(ln) || k.match(/^(d|g)clid/)) {
|
|
1864
|
+
var v = k.replace(ln, "");
|
|
1855
1865
|
w.campaign[v === "campaign" ? "name" : v] = o[k];
|
|
1856
1866
|
}
|
|
1857
|
-
return k.match(
|
|
1867
|
+
return k.match(dn) && (w.props[k.replace(dn, "")] = o[k]), k.match(hn) && (w.traits[k.replace(hn, "")] = o[k]), w;
|
|
1858
1868
|
}, { campaign: {}, props: {}, traits: {} });
|
|
1859
|
-
n.dispatch(
|
|
1869
|
+
n.dispatch(A({ type: x.params, raw: o }, d, c ? { userId: c } : {})), c && setTimeout(function() {
|
|
1860
1870
|
return t.identify(c, d.traits);
|
|
1861
|
-
}, 0),
|
|
1862
|
-
return t.track(
|
|
1863
|
-
}, 0), Object.keys(d.campaign).length && n.dispatch({ type:
|
|
1871
|
+
}, 0), m && setTimeout(function() {
|
|
1872
|
+
return t.track(m, d.props);
|
|
1873
|
+
}, 0), Object.keys(d.campaign).length && n.dispatch({ type: x.campaign, campaign: d.campaign });
|
|
1864
1874
|
}
|
|
1865
1875
|
}
|
|
1866
1876
|
return r(i);
|
|
@@ -1870,16 +1880,16 @@ function Hi(t) {
|
|
|
1870
1880
|
}
|
|
1871
1881
|
function Fi(t) {
|
|
1872
1882
|
return function(e, n) {
|
|
1873
|
-
if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type ===
|
|
1883
|
+
if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type === x.setItemEnd) {
|
|
1874
1884
|
if (n.key === ce)
|
|
1875
|
-
return
|
|
1885
|
+
return A({}, e, { anonymousId: n.value });
|
|
1876
1886
|
if (n.key === ye)
|
|
1877
|
-
return
|
|
1887
|
+
return A({}, e, { userId: n.value });
|
|
1878
1888
|
}
|
|
1879
1889
|
switch (n.type) {
|
|
1880
|
-
case
|
|
1881
|
-
return Object.assign({}, e, { userId: n.userId, traits:
|
|
1882
|
-
case
|
|
1890
|
+
case x.identify:
|
|
1891
|
+
return Object.assign({}, e, { userId: n.userId, traits: A({}, e.traits, n.traits) });
|
|
1892
|
+
case x.reset:
|
|
1883
1893
|
return [ye, ce, Ee].forEach(function(r) {
|
|
1884
1894
|
t.removeItem(r);
|
|
1885
1895
|
}), Object.assign({}, e, { userId: null, anonymousId: null, traits: {} });
|
|
@@ -1888,10 +1898,10 @@ function Fi(t) {
|
|
|
1888
1898
|
}
|
|
1889
1899
|
};
|
|
1890
1900
|
}
|
|
1891
|
-
function
|
|
1901
|
+
function fn(t) {
|
|
1892
1902
|
return { userId: t.getItem(ye), anonymousId: t.getItem(ce), traits: t.getItem(Ee) };
|
|
1893
1903
|
}
|
|
1894
|
-
var
|
|
1904
|
+
var jt = function(t) {
|
|
1895
1905
|
return ve + "TEMP" + ve + t;
|
|
1896
1906
|
};
|
|
1897
1907
|
function Ji(t) {
|
|
@@ -1899,15 +1909,15 @@ function Ji(t) {
|
|
|
1899
1909
|
return function(o) {
|
|
1900
1910
|
return function(a) {
|
|
1901
1911
|
return function(s) {
|
|
1902
|
-
var
|
|
1903
|
-
if (s.type ===
|
|
1912
|
+
var f = s.userId, p = s.traits, u = s.options;
|
|
1913
|
+
if (s.type === x.reset && ([ye, Ee, ce].forEach(function(d) {
|
|
1904
1914
|
r(d);
|
|
1905
1915
|
}), [oe, _e, "traits"].forEach(function(d) {
|
|
1906
|
-
Ae(
|
|
1907
|
-
})), s.type ===
|
|
1916
|
+
Ae(jt(d));
|
|
1917
|
+
})), s.type === x.identify) {
|
|
1908
1918
|
i(ce) || n(ce, st());
|
|
1909
|
-
var c = i(ye),
|
|
1910
|
-
c && c !==
|
|
1919
|
+
var c = i(ye), m = i(Ee) || {};
|
|
1920
|
+
c && c !== f && o.dispatch({ type: x.userIdChanged, old: { userId: c, traits: m }, new: { userId: f, traits: p }, options: u }), f && n(ye, f), p && n(Ee, A({}, m, p));
|
|
1911
1921
|
}
|
|
1912
1922
|
return a(s);
|
|
1913
1923
|
};
|
|
@@ -1915,185 +1925,185 @@ function Ji(t) {
|
|
|
1915
1925
|
};
|
|
1916
1926
|
}
|
|
1917
1927
|
var Re = {};
|
|
1918
|
-
function
|
|
1928
|
+
function pn(t, e) {
|
|
1919
1929
|
Re[t] && Y(Re[t]) && (Re[t](e), delete Re[t]);
|
|
1920
1930
|
}
|
|
1921
|
-
function
|
|
1931
|
+
function hr(t, e, n) {
|
|
1922
1932
|
return new Promise(function(r, i) {
|
|
1923
|
-
return e() ? r(t) : n < 1 ? i(
|
|
1933
|
+
return e() ? r(t) : n < 1 ? i(A({}, t, { queue: !0 })) : new Promise(function(o) {
|
|
1924
1934
|
return setTimeout(o, 10);
|
|
1925
1935
|
}).then(function(o) {
|
|
1926
|
-
return
|
|
1936
|
+
return hr(t, e, n - 10).then(r, i);
|
|
1927
1937
|
});
|
|
1928
1938
|
});
|
|
1929
1939
|
}
|
|
1930
1940
|
function Xi(t) {
|
|
1931
1941
|
return { abort: t };
|
|
1932
1942
|
}
|
|
1933
|
-
function
|
|
1934
|
-
var r = {}, i = e(), o = t.getState(), a = o.plugins, s = o.queue,
|
|
1943
|
+
function fr(t, e, n) {
|
|
1944
|
+
var r = {}, i = e(), o = t.getState(), a = o.plugins, s = o.queue, f = o.user;
|
|
1935
1945
|
if (!o.context.offline && s && s.actions && s.actions.length) {
|
|
1936
|
-
var p = s.actions.reduce(function(c,
|
|
1937
|
-
return a[
|
|
1946
|
+
var p = s.actions.reduce(function(c, m, d) {
|
|
1947
|
+
return a[m.plugin].loaded ? (c.process.push(m), c.processIndex.push(d)) : (c.requeue.push(m), c.requeueIndex.push(d)), c;
|
|
1938
1948
|
}, { processIndex: [], process: [], requeue: [], requeueIndex: [] });
|
|
1939
1949
|
if (p.processIndex && p.processIndex.length) {
|
|
1940
1950
|
p.processIndex.forEach(function(c) {
|
|
1941
|
-
var
|
|
1951
|
+
var m = s.actions[c], d = m.plugin, w = m.payload.type, k = i[d][w];
|
|
1942
1952
|
if (k && Y(k)) {
|
|
1943
|
-
var v,
|
|
1944
|
-
return l === void 0 && (l = {}), b === void 0 && (b = {}), [oe, _e].reduce(function(
|
|
1945
|
-
return l.hasOwnProperty(O) && b[O] && b[O] !== l[O] && (
|
|
1953
|
+
var v, _ = function(l, b) {
|
|
1954
|
+
return l === void 0 && (l = {}), b === void 0 && (b = {}), [oe, _e].reduce(function(T, O) {
|
|
1955
|
+
return l.hasOwnProperty(O) && b[O] && b[O] !== l[O] && (T[O] = b[O]), T;
|
|
1946
1956
|
}, l);
|
|
1947
|
-
}(
|
|
1948
|
-
if (!
|
|
1949
|
-
return void (r[
|
|
1950
|
-
if (!
|
|
1951
|
-
var
|
|
1952
|
-
t.dispatch(
|
|
1957
|
+
}(m.payload, f), S = r[_.meta.rid];
|
|
1958
|
+
if (!S && (v = k({ payload: _, config: a[d].config, instance: n, abort: Xi })) && V(v) && v.abort)
|
|
1959
|
+
return void (r[_.meta.rid] = !0);
|
|
1960
|
+
if (!S) {
|
|
1961
|
+
var y = w + ":" + d;
|
|
1962
|
+
t.dispatch(A({}, _, { type: y, _: { called: y, from: "queueDrain" } }));
|
|
1953
1963
|
}
|
|
1954
1964
|
}
|
|
1955
1965
|
});
|
|
1956
|
-
var u = s.actions.filter(function(c,
|
|
1957
|
-
return !~p.processIndex.indexOf(
|
|
1966
|
+
var u = s.actions.filter(function(c, m) {
|
|
1967
|
+
return !~p.processIndex.indexOf(m);
|
|
1958
1968
|
});
|
|
1959
1969
|
s.actions = u;
|
|
1960
1970
|
}
|
|
1961
1971
|
}
|
|
1962
1972
|
}
|
|
1963
1973
|
var mt = function(t) {
|
|
1964
|
-
var e = t.data, n = t.action, r = t.instance, i = t.state, o = t.allPlugins, a = t.allMatches, s = t.store,
|
|
1974
|
+
var e = t.data, n = t.action, r = t.instance, i = t.state, o = t.allPlugins, a = t.allMatches, s = t.store, f = t.EVENTS;
|
|
1965
1975
|
try {
|
|
1966
|
-
var p = i.plugins, u = i.context, c = n.type,
|
|
1976
|
+
var p = i.plugins, u = i.context, c = n.type, m = c.match(Pe), d = e.exact.map(function(v) {
|
|
1967
1977
|
return v.pluginName;
|
|
1968
1978
|
});
|
|
1969
|
-
|
|
1979
|
+
m && (d = a.during.map(function(v) {
|
|
1970
1980
|
return v.pluginName;
|
|
1971
1981
|
}));
|
|
1972
|
-
var w = /* @__PURE__ */ function(v,
|
|
1973
|
-
return function(
|
|
1974
|
-
var b =
|
|
1982
|
+
var w = /* @__PURE__ */ function(v, _) {
|
|
1983
|
+
return function(S, y, l) {
|
|
1984
|
+
var b = y.config, T = y.name, O = T + "." + S.type;
|
|
1975
1985
|
l && (O = l.event);
|
|
1976
|
-
var
|
|
1977
|
-
return function(
|
|
1978
|
-
var
|
|
1979
|
-
if (
|
|
1980
|
-
throw new Error("Method " +
|
|
1981
|
-
return
|
|
1986
|
+
var C = S.type.match(Pe) ? /* @__PURE__ */ function(D, z, F, $, R) {
|
|
1987
|
+
return function(K, j) {
|
|
1988
|
+
var I = $ ? $.name : D, E = j && Ke(j) ? j : F;
|
|
1989
|
+
if ($ && (!(E = j && Ke(j) ? j : [D]).includes(D) || E.length !== 1))
|
|
1990
|
+
throw new Error("Method " + z + " can only abort " + D + " plugin. " + JSON.stringify(E) + " input valid");
|
|
1991
|
+
return A({}, R, { abort: { reason: K, plugins: E, caller: z, _: I } });
|
|
1982
1992
|
};
|
|
1983
|
-
}(
|
|
1993
|
+
}(T, O, _, l, S) : /* @__PURE__ */ function(D, z) {
|
|
1984
1994
|
return function() {
|
|
1985
|
-
throw new Error(D.type + " action not cancellable. Remove abort in " +
|
|
1995
|
+
throw new Error(D.type + " action not cancellable. Remove abort in " + z);
|
|
1986
1996
|
};
|
|
1987
|
-
}(
|
|
1988
|
-
return { payload: Vi(
|
|
1997
|
+
}(S, O);
|
|
1998
|
+
return { payload: Vi(S), instance: v, config: b || {}, abort: C };
|
|
1989
1999
|
};
|
|
1990
|
-
}(r, d), k = e.exact.reduce(function(v,
|
|
1991
|
-
var
|
|
1992
|
-
return
|
|
2000
|
+
}(r, d), k = e.exact.reduce(function(v, _) {
|
|
2001
|
+
var S = _.pluginName, y = _.methodName, l = !1;
|
|
2002
|
+
return y.match(/^initialize/) || y.match(/^reset/) || (l = !p[S].loaded), u.offline && y.match(/^(page|track|identify)/) && (l = !0), v["" + S] = l, v;
|
|
1993
2003
|
}, {});
|
|
1994
|
-
return Promise.resolve(e.exact.reduce(function(v,
|
|
2004
|
+
return Promise.resolve(e.exact.reduce(function(v, _, S) {
|
|
1995
2005
|
try {
|
|
1996
|
-
var
|
|
2006
|
+
var y = _.pluginName;
|
|
1997
2007
|
return Promise.resolve(v).then(function(l) {
|
|
1998
2008
|
function b() {
|
|
1999
2009
|
return Promise.resolve(l);
|
|
2000
2010
|
}
|
|
2001
|
-
var
|
|
2002
|
-
if (e.namespaced && e.namespaced[
|
|
2003
|
-
return Promise.resolve(e.namespaced[
|
|
2011
|
+
var T = function() {
|
|
2012
|
+
if (e.namespaced && e.namespaced[y])
|
|
2013
|
+
return Promise.resolve(e.namespaced[y].reduce(function(O, C, D) {
|
|
2004
2014
|
try {
|
|
2005
|
-
return Promise.resolve(O).then(function(
|
|
2006
|
-
return
|
|
2007
|
-
var
|
|
2008
|
-
if (
|
|
2009
|
-
var
|
|
2010
|
-
throw new Error([
|
|
2015
|
+
return Promise.resolve(O).then(function(z) {
|
|
2016
|
+
return C.method && Y(C.method) ? (function(K, j) {
|
|
2017
|
+
var I = kn(K);
|
|
2018
|
+
if (I && I.name === j) {
|
|
2019
|
+
var E = kn(I.method);
|
|
2020
|
+
throw new Error([j + " plugin is calling method " + K, "Plugins cant call self", "Use " + I.method + " " + (E ? "or " + E.method : "") + " in " + j + " plugin insteadof " + K].join(`
|
|
2011
2021
|
`));
|
|
2012
2022
|
}
|
|
2013
|
-
}(
|
|
2014
|
-
return
|
|
2015
|
-
}), config:
|
|
2016
|
-
var
|
|
2017
|
-
return Promise.resolve(
|
|
2018
|
-
})) :
|
|
2019
|
-
var
|
|
2023
|
+
}(C.methodName, C.pluginName), Promise.resolve(C.method({ payload: z, instance: r, abort: (F = z, $ = y, R = C.pluginName, function(K, j) {
|
|
2024
|
+
return A({}, F, { abort: { reason: K, plugins: j || [$], caller: c, from: R || $ } });
|
|
2025
|
+
}), config: yn(C.pluginName, p, o), plugins: p })).then(function(K) {
|
|
2026
|
+
var j = V(K) ? K : {};
|
|
2027
|
+
return Promise.resolve(A({}, z, j));
|
|
2028
|
+
})) : z;
|
|
2029
|
+
var F, $, R;
|
|
2020
2030
|
});
|
|
2021
|
-
} catch (
|
|
2022
|
-
return Promise.reject(
|
|
2031
|
+
} catch (z) {
|
|
2032
|
+
return Promise.reject(z);
|
|
2023
2033
|
}
|
|
2024
2034
|
}, Promise.resolve(n))).then(function(O) {
|
|
2025
|
-
l[
|
|
2035
|
+
l[y] = O;
|
|
2026
2036
|
});
|
|
2027
|
-
l[
|
|
2037
|
+
l[y] = n;
|
|
2028
2038
|
}();
|
|
2029
|
-
return
|
|
2039
|
+
return T && T.then ? T.then(b) : b();
|
|
2030
2040
|
});
|
|
2031
2041
|
} catch (l) {
|
|
2032
2042
|
return Promise.reject(l);
|
|
2033
2043
|
}
|
|
2034
2044
|
}, Promise.resolve({}))).then(function(v) {
|
|
2035
|
-
return Promise.resolve(e.exact.reduce(function(
|
|
2045
|
+
return Promise.resolve(e.exact.reduce(function(_, S, y) {
|
|
2036
2046
|
try {
|
|
2037
|
-
var l = e.exact.length ===
|
|
2038
|
-
return Promise.resolve(
|
|
2039
|
-
var
|
|
2040
|
-
if (
|
|
2041
|
-
return gt({ data:
|
|
2047
|
+
var l = e.exact.length === y + 1, b = S.pluginName, T = o[b];
|
|
2048
|
+
return Promise.resolve(_).then(function(O) {
|
|
2049
|
+
var C = v[b] ? v[b] : {};
|
|
2050
|
+
if (m && (C = O), yt(C, b))
|
|
2051
|
+
return gt({ data: C, method: c, instance: r, pluginName: b, store: s }), Promise.resolve(O);
|
|
2042
2052
|
if (yt(O, b))
|
|
2043
2053
|
return l && gt({ data: O, method: c, instance: r, store: s }), Promise.resolve(O);
|
|
2044
2054
|
if (k.hasOwnProperty(b) && k[b] === !0)
|
|
2045
|
-
return s.dispatch({ type: "queue", plugin: b, payload:
|
|
2055
|
+
return s.dispatch({ type: "queue", plugin: b, payload: C, _: { called: "queue", from: "queueMechanism" } }), Promise.resolve(O);
|
|
2046
2056
|
var D = w(v[b], o[b]);
|
|
2047
|
-
return Promise.resolve(
|
|
2048
|
-
var
|
|
2049
|
-
if (yt(
|
|
2050
|
-
gt({ data:
|
|
2057
|
+
return Promise.resolve(T[c]({ abort: D.abort, payload: C, instance: r, config: yn(b, p, o), plugins: p })).then(function(z) {
|
|
2058
|
+
var F = V(z) ? z : {}, $ = A({}, O, F), R = v[b];
|
|
2059
|
+
if (yt(R, b))
|
|
2060
|
+
gt({ data: R, method: c, instance: r, pluginName: b, store: s });
|
|
2051
2061
|
else {
|
|
2052
|
-
var
|
|
2053
|
-
(
|
|
2062
|
+
var K = c + ":" + b;
|
|
2063
|
+
(K.match(/:/g) || []).length < 2 && !c.match(mn) && !c.match(gn) && r.dispatch(A({}, m ? $ : C, { type: K, _: { called: K, from: "submethod" } }));
|
|
2054
2064
|
}
|
|
2055
|
-
return Promise.resolve(
|
|
2065
|
+
return Promise.resolve($);
|
|
2056
2066
|
});
|
|
2057
2067
|
});
|
|
2058
2068
|
} catch (O) {
|
|
2059
2069
|
return Promise.reject(O);
|
|
2060
2070
|
}
|
|
2061
|
-
}, Promise.resolve(n))).then(function(
|
|
2062
|
-
if (!(c.match(Pe) || c.match(/^registerPlugin/) || c.match(
|
|
2063
|
-
if (
|
|
2064
|
-
return
|
|
2065
|
-
var
|
|
2066
|
-
|
|
2071
|
+
}, Promise.resolve(n))).then(function(_) {
|
|
2072
|
+
if (!(c.match(Pe) || c.match(/^registerPlugin/) || c.match(gn) || c.match(mn) || c.match(/^params/) || c.match(/^userIdChanged/))) {
|
|
2073
|
+
if (f.plugins.includes(c), _._ && _._.originalAction === c)
|
|
2074
|
+
return _;
|
|
2075
|
+
var S = A({}, _, { _: { originalAction: _.type, called: _.type, from: "engineEnd" } });
|
|
2076
|
+
pr(_, e.exact.length) && !c.match(/End$/) && (S = A({}, S, { type: _.type + "Aborted" })), s.dispatch(S);
|
|
2067
2077
|
}
|
|
2068
|
-
return
|
|
2078
|
+
return _;
|
|
2069
2079
|
});
|
|
2070
2080
|
});
|
|
2071
2081
|
} catch (v) {
|
|
2072
2082
|
return Promise.reject(v);
|
|
2073
2083
|
}
|
|
2074
|
-
}, Pe = /Start$/,
|
|
2084
|
+
}, Pe = /Start$/, mn = /^bootstrap/, gn = /^ready/;
|
|
2075
2085
|
function gt(t) {
|
|
2076
2086
|
var e = t.pluginName, n = t.method + "Aborted" + (e ? ":" + e : "");
|
|
2077
|
-
t.store.dispatch(
|
|
2087
|
+
t.store.dispatch(A({}, t.data, { type: n, _: { called: n, from: "abort" } }));
|
|
2078
2088
|
}
|
|
2079
|
-
function
|
|
2089
|
+
function yn(t, e, n) {
|
|
2080
2090
|
var r = e[t] || n[t];
|
|
2081
2091
|
return r && r.config ? r.config : {};
|
|
2082
2092
|
}
|
|
2083
|
-
function
|
|
2093
|
+
function vn(t, e) {
|
|
2084
2094
|
return e.reduce(function(n, r) {
|
|
2085
2095
|
return r[t] ? n.concat({ methodName: t, pluginName: r.name, method: r[t] }) : n;
|
|
2086
2096
|
}, []);
|
|
2087
2097
|
}
|
|
2088
|
-
function
|
|
2098
|
+
function wn(t, e) {
|
|
2089
2099
|
var n = t.replace(Pe, ""), r = e ? ":" + e : "";
|
|
2090
2100
|
return ["" + t + r, "" + n + r, n + "End" + r];
|
|
2091
2101
|
}
|
|
2092
2102
|
function yt(t, e) {
|
|
2093
2103
|
var n = t.abort;
|
|
2094
|
-
return !!n && (n === !0 ||
|
|
2104
|
+
return !!n && (n === !0 || bn(n, e) || n && bn(n.plugins, e));
|
|
2095
2105
|
}
|
|
2096
|
-
function
|
|
2106
|
+
function pr(t, e) {
|
|
2097
2107
|
var n = t.abort;
|
|
2098
2108
|
if (!n)
|
|
2099
2109
|
return !1;
|
|
@@ -2105,10 +2115,10 @@ function hr(t, e) {
|
|
|
2105
2115
|
function Ke(t) {
|
|
2106
2116
|
return Array.isArray(t);
|
|
2107
2117
|
}
|
|
2108
|
-
function
|
|
2118
|
+
function bn(t, e) {
|
|
2109
2119
|
return !(!t || !Ke(t)) && t.includes(e);
|
|
2110
2120
|
}
|
|
2111
|
-
function
|
|
2121
|
+
function kn(t) {
|
|
2112
2122
|
var e = t.match(/(.*):(.*)/);
|
|
2113
2123
|
return !!e && { method: e[1], name: e[2] };
|
|
2114
2124
|
}
|
|
@@ -2123,105 +2133,105 @@ function Yi(t, e, n) {
|
|
|
2123
2133
|
return function(o) {
|
|
2124
2134
|
return function(a) {
|
|
2125
2135
|
try {
|
|
2126
|
-
var s,
|
|
2136
|
+
var s, f = function(l) {
|
|
2127
2137
|
return s ? l : o(c);
|
|
2128
2138
|
}, p = a.type, u = a.plugins, c = a;
|
|
2129
2139
|
if (a.abort)
|
|
2130
2140
|
return Promise.resolve(o(a));
|
|
2131
|
-
if (p ===
|
|
2132
|
-
return
|
|
2133
|
-
}, 0), p ===
|
|
2134
|
-
var
|
|
2141
|
+
if (p === x.enablePlugin && i.dispatch({ type: x.initializeStart, plugins: u, disabled: [], fromEnable: !0, meta: a.meta }), p === x.disablePlugin && setTimeout(function() {
|
|
2142
|
+
return pn(a.meta.rid, { payload: a });
|
|
2143
|
+
}, 0), p === x.initializeEnd) {
|
|
2144
|
+
var m = e(), d = Object.keys(m), w = d.filter(function(l) {
|
|
2135
2145
|
return u.includes(l);
|
|
2136
2146
|
}).map(function(l) {
|
|
2137
|
-
return
|
|
2138
|
-
}), k = [], v = [],
|
|
2139
|
-
var b = l.loaded,
|
|
2140
|
-
return
|
|
2147
|
+
return m[l];
|
|
2148
|
+
}), k = [], v = [], _ = a.disabled, S = w.map(function(l) {
|
|
2149
|
+
var b = l.loaded, T = l.name, O = l.config;
|
|
2150
|
+
return hr(l, function() {
|
|
2141
2151
|
return b({ config: O });
|
|
2142
|
-
}, 1e4).then(function(
|
|
2143
|
-
return r[
|
|
2144
|
-
return !
|
|
2145
|
-
}) }), r[
|
|
2146
|
-
}).catch(function(
|
|
2147
|
-
if (
|
|
2148
|
-
throw new Error(
|
|
2149
|
-
return v = v.concat(
|
|
2152
|
+
}, 1e4).then(function(C) {
|
|
2153
|
+
return r[T] || (i.dispatch({ type: x.pluginReadyType(T), name: T, events: Object.keys(l).filter(function(D) {
|
|
2154
|
+
return !Ot.includes(D);
|
|
2155
|
+
}) }), r[T] = !0), k = k.concat(T), l;
|
|
2156
|
+
}).catch(function(C) {
|
|
2157
|
+
if (C instanceof Error)
|
|
2158
|
+
throw new Error(C);
|
|
2159
|
+
return v = v.concat(C.name), C;
|
|
2150
2160
|
});
|
|
2151
2161
|
});
|
|
2152
|
-
Promise.all(
|
|
2153
|
-
var b = { plugins: k, failed: v, disabled:
|
|
2162
|
+
Promise.all(S).then(function(l) {
|
|
2163
|
+
var b = { plugins: k, failed: v, disabled: _ };
|
|
2154
2164
|
setTimeout(function() {
|
|
2155
|
-
d.length ===
|
|
2165
|
+
d.length === S.length + _.length && i.dispatch(A({}, { type: x.ready }, b));
|
|
2156
2166
|
}, 0);
|
|
2157
2167
|
});
|
|
2158
2168
|
}
|
|
2159
|
-
var
|
|
2160
|
-
if (p !==
|
|
2169
|
+
var y = function() {
|
|
2170
|
+
if (p !== x.bootstrap)
|
|
2161
2171
|
return /^ready:([^:]*)$/.test(p) && setTimeout(function() {
|
|
2162
|
-
return
|
|
2163
|
-
}, 0), Promise.resolve(function(l, b,
|
|
2172
|
+
return fr(i, e, t);
|
|
2173
|
+
}, 0), Promise.resolve(function(l, b, T, O, C) {
|
|
2164
2174
|
try {
|
|
2165
|
-
var D = Y(b) ? b() : b,
|
|
2175
|
+
var D = Y(b) ? b() : b, z = l.type, F = z.replace(Pe, "");
|
|
2166
2176
|
if (l._ && l._.called)
|
|
2167
2177
|
return Promise.resolve(l);
|
|
2168
|
-
var
|
|
2169
|
-
var
|
|
2170
|
-
return ji(
|
|
2171
|
-
}).map(function(
|
|
2172
|
-
return
|
|
2178
|
+
var $ = T.getState(), R = (I = D, (E = $.plugins) === void 0 && (E = {}), (W = l.options) === void 0 && (W = {}), Object.keys(I).filter(function(h) {
|
|
2179
|
+
var g = W.plugins || {};
|
|
2180
|
+
return ji(g[h]) ? g[h] : g.all !== !1 && (!E[h] || E[h].enabled !== !1);
|
|
2181
|
+
}).map(function(h) {
|
|
2182
|
+
return I[h];
|
|
2173
2183
|
}));
|
|
2174
|
-
|
|
2175
|
-
var
|
|
2176
|
-
return l.plugins.includes(
|
|
2177
|
-
}).map(function(
|
|
2178
|
-
return D[
|
|
2184
|
+
z === x.initializeStart && l.fromEnable && (R = Object.keys($.plugins).filter(function(h) {
|
|
2185
|
+
var g = $.plugins[h];
|
|
2186
|
+
return l.plugins.includes(h) && !g.initialized;
|
|
2187
|
+
}).map(function(h) {
|
|
2188
|
+
return D[h];
|
|
2179
2189
|
}));
|
|
2180
|
-
var
|
|
2181
|
-
return
|
|
2182
|
-
}),
|
|
2183
|
-
var
|
|
2184
|
-
return
|
|
2190
|
+
var K = R.map(function(h) {
|
|
2191
|
+
return h.name;
|
|
2192
|
+
}), j = function(h, g, P) {
|
|
2193
|
+
var N = wn(h).map(function(U) {
|
|
2194
|
+
return vn(U, g);
|
|
2185
2195
|
});
|
|
2186
|
-
return
|
|
2187
|
-
var
|
|
2188
|
-
return
|
|
2189
|
-
}),
|
|
2190
|
-
return
|
|
2191
|
-
}, { before:
|
|
2192
|
-
}(
|
|
2193
|
-
return Promise.resolve(mt({ action: l, data: { exact:
|
|
2194
|
-
function
|
|
2196
|
+
return g.reduce(function(U, L) {
|
|
2197
|
+
var J = L.name, Z = wn(h, J).map(function(Ne) {
|
|
2198
|
+
return vn(Ne, g);
|
|
2199
|
+
}), H = Z[0], M = Z[1], ee = Z[2];
|
|
2200
|
+
return H.length && (U.beforeNS[J] = H), M.length && (U.duringNS[J] = M), ee.length && (U.afterNS[J] = ee), U;
|
|
2201
|
+
}, { before: N[0], beforeNS: {}, during: N[1], duringNS: {}, after: N[2], afterNS: {} });
|
|
2202
|
+
}(z, R);
|
|
2203
|
+
return Promise.resolve(mt({ action: l, data: { exact: j.before, namespaced: j.beforeNS }, state: $, allPlugins: D, allMatches: j, instance: T, store: O, EVENTS: C })).then(function(h) {
|
|
2204
|
+
function g() {
|
|
2195
2205
|
var U = function() {
|
|
2196
|
-
if (
|
|
2197
|
-
return Promise.resolve(mt({ action:
|
|
2198
|
-
|
|
2206
|
+
if (z.match(Pe))
|
|
2207
|
+
return Promise.resolve(mt({ action: A({}, P, { type: F + "End" }), data: { exact: j.after, namespaced: j.afterNS }, state: $, allPlugins: D, allMatches: j, instance: T, store: O, EVENTS: C })).then(function(L) {
|
|
2208
|
+
L.meta && L.meta.hasCallback && pn(L.meta.rid, { payload: L });
|
|
2199
2209
|
});
|
|
2200
2210
|
}();
|
|
2201
2211
|
return U && U.then ? U.then(function() {
|
|
2202
|
-
return
|
|
2203
|
-
}) :
|
|
2212
|
+
return h;
|
|
2213
|
+
}) : h;
|
|
2204
2214
|
}
|
|
2205
|
-
if (
|
|
2206
|
-
return
|
|
2207
|
-
var
|
|
2208
|
-
if (
|
|
2209
|
-
return Promise.resolve(mt({ action:
|
|
2210
|
-
|
|
2215
|
+
if (pr(h, K.length))
|
|
2216
|
+
return h;
|
|
2217
|
+
var P, N = function() {
|
|
2218
|
+
if (z !== F)
|
|
2219
|
+
return Promise.resolve(mt({ action: A({}, h, { type: F }), data: { exact: j.during, namespaced: j.duringNS }, state: $, allPlugins: D, allMatches: j, instance: T, store: O, EVENTS: C })).then(function(U) {
|
|
2220
|
+
P = U;
|
|
2211
2221
|
});
|
|
2212
|
-
|
|
2222
|
+
P = h;
|
|
2213
2223
|
}();
|
|
2214
|
-
return
|
|
2224
|
+
return N && N.then ? N.then(g) : g();
|
|
2215
2225
|
});
|
|
2216
|
-
} catch (
|
|
2217
|
-
return Promise.reject(
|
|
2226
|
+
} catch (h) {
|
|
2227
|
+
return Promise.reject(h);
|
|
2218
2228
|
}
|
|
2219
|
-
var
|
|
2229
|
+
var I, E, W;
|
|
2220
2230
|
}(a, e, t, i, n)).then(function(l) {
|
|
2221
2231
|
return s = 1, o(l);
|
|
2222
2232
|
});
|
|
2223
2233
|
}();
|
|
2224
|
-
return Promise.resolve(
|
|
2234
|
+
return Promise.resolve(y && y.then ? y.then(f) : f(y));
|
|
2225
2235
|
} catch (l) {
|
|
2226
2236
|
return Promise.reject(l);
|
|
2227
2237
|
}
|
|
@@ -2234,10 +2244,10 @@ function Gi(t) {
|
|
|
2234
2244
|
return function(n) {
|
|
2235
2245
|
return function(r) {
|
|
2236
2246
|
var i = r.type, o = r.key, a = r.value, s = r.options;
|
|
2237
|
-
if (i ===
|
|
2247
|
+
if (i === x.setItem || i === x.removeItem) {
|
|
2238
2248
|
if (r.abort)
|
|
2239
2249
|
return n(r);
|
|
2240
|
-
i ===
|
|
2250
|
+
i === x.setItem ? t.setItem(o, a, s) : t.removeItem(o, s);
|
|
2241
2251
|
}
|
|
2242
2252
|
return n(r);
|
|
2243
2253
|
};
|
|
@@ -2275,37 +2285,37 @@ function qi(t) {
|
|
|
2275
2285
|
if (n.type === "initialize:aborted")
|
|
2276
2286
|
return e;
|
|
2277
2287
|
if (/^registerPlugin:([^:]*)$/.test(n.type)) {
|
|
2278
|
-
var i =
|
|
2288
|
+
var i = In(n.type, "registerPlugin"), o = t()[i];
|
|
2279
2289
|
if (!o || !i)
|
|
2280
2290
|
return e;
|
|
2281
2291
|
var a = n.enabled, s = o.config;
|
|
2282
|
-
return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s },
|
|
2292
|
+
return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s }, A({}, e, r);
|
|
2283
2293
|
}
|
|
2284
2294
|
if (/^initialize:([^:]*)$/.test(n.type)) {
|
|
2285
|
-
var
|
|
2286
|
-
return p &&
|
|
2295
|
+
var f = In(n.type, x.initialize), p = t()[f];
|
|
2296
|
+
return p && f ? (r[f] = A({}, e[f], { initialized: !0, loaded: !!p.loaded({ config: p.config }) }), A({}, e, r)) : e;
|
|
2287
2297
|
}
|
|
2288
2298
|
if (/^ready:([^:]*)$/.test(n.type))
|
|
2289
|
-
return r[n.name] =
|
|
2299
|
+
return r[n.name] = A({}, e[n.name], { loaded: !0 }), A({}, e, r);
|
|
2290
2300
|
switch (n.type) {
|
|
2291
|
-
case
|
|
2292
|
-
return
|
|
2293
|
-
case
|
|
2294
|
-
return
|
|
2301
|
+
case x.disablePlugin:
|
|
2302
|
+
return A({}, e, Sn(n.plugins, !1, e));
|
|
2303
|
+
case x.enablePlugin:
|
|
2304
|
+
return A({}, e, Sn(n.plugins, !0, e));
|
|
2295
2305
|
default:
|
|
2296
2306
|
return e;
|
|
2297
2307
|
}
|
|
2298
2308
|
};
|
|
2299
2309
|
}
|
|
2300
|
-
function
|
|
2310
|
+
function In(t, e) {
|
|
2301
2311
|
return t.substring(e.length + 1, t.length);
|
|
2302
2312
|
}
|
|
2303
|
-
function
|
|
2313
|
+
function Sn(t, e, n) {
|
|
2304
2314
|
return t.reduce(function(r, i) {
|
|
2305
|
-
return r[i] =
|
|
2315
|
+
return r[i] = A({}, n[i], { enabled: e }), r;
|
|
2306
2316
|
}, n);
|
|
2307
2317
|
}
|
|
2308
|
-
function
|
|
2318
|
+
function mr(t) {
|
|
2309
2319
|
try {
|
|
2310
2320
|
return JSON.parse(JSON.stringify(t));
|
|
2311
2321
|
} catch {
|
|
@@ -2316,9 +2326,9 @@ var Qi = { last: {}, history: [] };
|
|
|
2316
2326
|
function eo(t, e) {
|
|
2317
2327
|
t === void 0 && (t = Qi);
|
|
2318
2328
|
var n = e.options, r = e.meta;
|
|
2319
|
-
if (e.type ===
|
|
2320
|
-
var i =
|
|
2321
|
-
return
|
|
2329
|
+
if (e.type === x.track) {
|
|
2330
|
+
var i = mr(A({ event: e.event, properties: e.properties }, Object.keys(n).length && { options: n }, { meta: r }));
|
|
2331
|
+
return A({}, t, { last: i, history: t.history.concat(i) });
|
|
2322
2332
|
}
|
|
2323
2333
|
return t;
|
|
2324
2334
|
}
|
|
@@ -2329,66 +2339,66 @@ function no(t, e) {
|
|
|
2329
2339
|
switch (e.type) {
|
|
2330
2340
|
case "queue":
|
|
2331
2341
|
var r;
|
|
2332
|
-
return r = n && n.type && n.type ===
|
|
2342
|
+
return r = n && n.type && n.type === x.identify ? [e].concat(t.actions) : t.actions.concat(e), A({}, t, { actions: r });
|
|
2333
2343
|
case "dequeue":
|
|
2334
2344
|
return [];
|
|
2335
2345
|
default:
|
|
2336
2346
|
return t;
|
|
2337
2347
|
}
|
|
2338
2348
|
}
|
|
2339
|
-
var
|
|
2349
|
+
var gr = /#.*$/;
|
|
2340
2350
|
function ro(t) {
|
|
2341
2351
|
var e = /(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);
|
|
2342
|
-
return "/" + (e && e[3] ? e[3].split("?")[0].replace(
|
|
2352
|
+
return "/" + (e && e[3] ? e[3].split("?")[0].replace(gr, "") : "");
|
|
2343
2353
|
}
|
|
2344
|
-
var
|
|
2345
|
-
if (t === void 0 && (t = {}), !
|
|
2354
|
+
var yr, vr, wr, br, io = function(t) {
|
|
2355
|
+
if (t === void 0 && (t = {}), !X)
|
|
2346
2356
|
return t;
|
|
2347
|
-
var e = document, n = e.title, r = e.referrer, i = window, o = i.location, a = i.innerWidth, s = i.innerHeight,
|
|
2357
|
+
var e = document, n = e.title, r = e.referrer, i = window, o = i.location, a = i.innerWidth, s = i.innerHeight, f = o.hash, p = o.search, u = function(m) {
|
|
2348
2358
|
var d = function() {
|
|
2349
|
-
if (
|
|
2359
|
+
if (X) {
|
|
2350
2360
|
for (var w, k = document.getElementsByTagName("link"), v = 0; w = k[v]; v++)
|
|
2351
2361
|
if (w.getAttribute("rel") === "canonical")
|
|
2352
2362
|
return w.getAttribute("href");
|
|
2353
2363
|
}
|
|
2354
2364
|
}();
|
|
2355
|
-
return d ? d.match(/\?/) ? d : d +
|
|
2356
|
-
}(p), c = { title: n, url: u, path: ro(u), hash:
|
|
2357
|
-
return r && r !== "" && (c.referrer = r),
|
|
2365
|
+
return d ? d.match(/\?/) ? d : d + m : window.location.href.replace(gr, "");
|
|
2366
|
+
}(p), c = { title: n, url: u, path: ro(u), hash: f, search: p, width: a, height: s };
|
|
2367
|
+
return r && r !== "" && (c.referrer = r), A({}, c, t);
|
|
2358
2368
|
}, oo = { last: {}, history: [] };
|
|
2359
2369
|
function ao(t, e) {
|
|
2360
2370
|
t === void 0 && (t = oo);
|
|
2361
2371
|
var n = e.options;
|
|
2362
|
-
if (e.type ===
|
|
2363
|
-
var r =
|
|
2364
|
-
return
|
|
2372
|
+
if (e.type === x.page) {
|
|
2373
|
+
var r = mr(A({ properties: e.properties, meta: e.meta }, Object.keys(n).length && { options: n }));
|
|
2374
|
+
return A({}, t, { last: r, history: t.history.concat(r) });
|
|
2365
2375
|
}
|
|
2366
2376
|
return t;
|
|
2367
2377
|
}
|
|
2368
|
-
|
|
2369
|
-
if (!
|
|
2378
|
+
yr = function() {
|
|
2379
|
+
if (!X)
|
|
2370
2380
|
return !1;
|
|
2371
2381
|
var t = navigator.appVersion;
|
|
2372
2382
|
return ~t.indexOf("Win") ? "Windows" : ~t.indexOf("Mac") ? "MacOS" : ~t.indexOf("X11") ? "UNIX" : ~t.indexOf("Linux") ? "Linux" : "Unknown OS";
|
|
2373
|
-
}(),
|
|
2374
|
-
var
|
|
2383
|
+
}(), vr = X ? document.referrer : null, wr = zi(), br = Ri();
|
|
2384
|
+
var _n = { initialized: !1, sessionId: st(), app: null, version: null, debug: !1, offline: !!X && !navigator.onLine, os: { name: yr }, userAgent: X ? navigator.userAgent : "node", library: { name: "analytics", version: "0.12.7" }, timezone: br, locale: wr, campaign: {}, referrer: vr };
|
|
2375
2385
|
function so(t, e) {
|
|
2376
|
-
t === void 0 && (t =
|
|
2386
|
+
t === void 0 && (t = _n);
|
|
2377
2387
|
var n = t.initialized, r = e.campaign;
|
|
2378
2388
|
switch (e.type) {
|
|
2379
|
-
case
|
|
2380
|
-
return
|
|
2381
|
-
case
|
|
2382
|
-
return
|
|
2383
|
-
case
|
|
2384
|
-
return
|
|
2389
|
+
case x.campaign:
|
|
2390
|
+
return A({}, t, { campaign: r });
|
|
2391
|
+
case x.offline:
|
|
2392
|
+
return A({}, t, { offline: !0 });
|
|
2393
|
+
case x.online:
|
|
2394
|
+
return A({}, t, { offline: !1 });
|
|
2385
2395
|
default:
|
|
2386
|
-
return n ? t :
|
|
2396
|
+
return n ? t : A({}, _n, t, { initialized: !0 });
|
|
2387
2397
|
}
|
|
2388
2398
|
}
|
|
2389
2399
|
var co = ["plugins", "reducers", "storage"];
|
|
2390
2400
|
function uo(t, e, n) {
|
|
2391
|
-
if (
|
|
2401
|
+
if (X) {
|
|
2392
2402
|
var r = window[(n ? "add" : "remove") + "EventListener"];
|
|
2393
2403
|
t.split(" ").forEach(function(i) {
|
|
2394
2404
|
r(i, e);
|
|
@@ -2403,7 +2413,7 @@ function lo(t) {
|
|
|
2403
2413
|
return e(!1);
|
|
2404
2414
|
};
|
|
2405
2415
|
}
|
|
2406
|
-
function
|
|
2416
|
+
function kr() {
|
|
2407
2417
|
return be("analytics", []), function(t) {
|
|
2408
2418
|
return function(e, n, r) {
|
|
2409
2419
|
var i = t(e, n, r), o = i.dispatch;
|
|
@@ -2413,263 +2423,263 @@ function wr() {
|
|
|
2413
2423
|
};
|
|
2414
2424
|
};
|
|
2415
2425
|
}
|
|
2416
|
-
function
|
|
2426
|
+
function En(t) {
|
|
2417
2427
|
return function() {
|
|
2418
|
-
return xe(xe.apply(null, arguments),
|
|
2428
|
+
return xe(xe.apply(null, arguments), kr());
|
|
2419
2429
|
};
|
|
2420
2430
|
}
|
|
2421
2431
|
function vt(t) {
|
|
2422
|
-
return t ?
|
|
2432
|
+
return t ? ur(t) ? t : [t] : [];
|
|
2423
2433
|
}
|
|
2424
|
-
function
|
|
2434
|
+
function Pn(t, e, n) {
|
|
2425
2435
|
t === void 0 && (t = {});
|
|
2426
2436
|
var r, i, o = st();
|
|
2427
2437
|
return e && (Re[o] = (r = e, i = function(a) {
|
|
2428
|
-
for (var s,
|
|
2429
|
-
if (Y(
|
|
2430
|
-
s =
|
|
2438
|
+
for (var s, f = a || Array.prototype.slice.call(arguments), p = 0; p < f.length; p++)
|
|
2439
|
+
if (Y(f[p])) {
|
|
2440
|
+
s = f[p];
|
|
2431
2441
|
break;
|
|
2432
2442
|
}
|
|
2433
2443
|
return s;
|
|
2434
2444
|
}(n), function(a) {
|
|
2435
2445
|
i && i(a), r(a);
|
|
2436
|
-
})),
|
|
2446
|
+
})), A({}, t, { rid: o, ts: (/* @__PURE__ */ new Date()).getTime() }, e ? { hasCallback: !0 } : {});
|
|
2437
2447
|
}
|
|
2438
2448
|
function ho(t) {
|
|
2439
2449
|
t === void 0 && (t = {});
|
|
2440
|
-
var e = t.reducers || {}, n = t.initialUser || {}, r = (t.plugins || []).reduce(function(
|
|
2441
|
-
if (Y(
|
|
2442
|
-
return
|
|
2443
|
-
if (
|
|
2450
|
+
var e = t.reducers || {}, n = t.initialUser || {}, r = (t.plugins || []).reduce(function(h, g) {
|
|
2451
|
+
if (Y(g))
|
|
2452
|
+
return h.middlewares = h.middlewares.concat(g), h;
|
|
2453
|
+
if (g.NAMESPACE && (g.name = g.NAMESPACE), !g.name)
|
|
2444
2454
|
throw new Error("https://lytics.dev/errors/1");
|
|
2445
|
-
|
|
2446
|
-
var
|
|
2447
|
-
return
|
|
2455
|
+
g.config || (g.config = {});
|
|
2456
|
+
var P = g.EVENTS ? Object.keys(g.EVENTS).map(function(L) {
|
|
2457
|
+
return g.EVENTS[L];
|
|
2448
2458
|
}) : [];
|
|
2449
|
-
|
|
2459
|
+
h.pluginEnabled[g.name] = !(g.enabled === !1 || g.config.enabled === !1), delete g.enabled, g.methods && (h.methods[g.name] = Object.keys(g.methods).reduce(function(L, J) {
|
|
2450
2460
|
var Z;
|
|
2451
|
-
return
|
|
2452
|
-
for (var
|
|
2453
|
-
M[ee] =
|
|
2461
|
+
return L[J] = (Z = g.methods[J], function() {
|
|
2462
|
+
for (var H = Array.prototype.slice.call(arguments), M = new Array(Z.length), ee = 0; ee < H.length; ee++)
|
|
2463
|
+
M[ee] = H[ee];
|
|
2454
2464
|
return M[M.length] = b, Z.apply({ instance: b }, M);
|
|
2455
|
-
}),
|
|
2456
|
-
}, {}), delete
|
|
2457
|
-
var
|
|
2458
|
-
if (
|
|
2459
|
-
throw new Error(
|
|
2460
|
-
return
|
|
2465
|
+
}), L;
|
|
2466
|
+
}, {}), delete g.methods);
|
|
2467
|
+
var N = Object.keys(g).concat(P), U = new Set(h.events.concat(N));
|
|
2468
|
+
if (h.events = Array.from(U), h.pluginsArray = h.pluginsArray.concat(g), h.plugins[g.name])
|
|
2469
|
+
throw new Error(g.name + "AlreadyLoaded");
|
|
2470
|
+
return h.plugins[g.name] = g, h.plugins[g.name].loaded || (h.plugins[g.name].loaded = function() {
|
|
2461
2471
|
return !0;
|
|
2462
|
-
}),
|
|
2463
|
-
}, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: we, setItem: be, removeItem: Ae }, o = /* @__PURE__ */ function(
|
|
2464
|
-
return function(
|
|
2465
|
-
return
|
|
2472
|
+
}), h;
|
|
2473
|
+
}, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: we, setItem: be, removeItem: Ae }, o = /* @__PURE__ */ function(h) {
|
|
2474
|
+
return function(g, P, N) {
|
|
2475
|
+
return P.getState("user")[g] || (N && V(N) && N[g] ? N[g] : fn(h)[g] || we(jt(g)) || null);
|
|
2466
2476
|
};
|
|
2467
|
-
}(i), a = r.plugins, s = r.events.filter(function(
|
|
2468
|
-
return !
|
|
2469
|
-
}).sort(),
|
|
2470
|
-
return !
|
|
2471
|
-
})), p = Array.from(
|
|
2477
|
+
}(i), a = r.plugins, s = r.events.filter(function(h) {
|
|
2478
|
+
return !Ot.includes(h);
|
|
2479
|
+
}).sort(), f = new Set(s.concat(et).filter(function(h) {
|
|
2480
|
+
return !Ot.includes(h);
|
|
2481
|
+
})), p = Array.from(f).sort(), u = function() {
|
|
2472
2482
|
return a;
|
|
2473
|
-
}, c = new Bi(),
|
|
2483
|
+
}, c = new Bi(), m = c.addMiddleware, d = c.removeMiddleware, w = c.dynamicMiddlewares, k = function() {
|
|
2474
2484
|
throw new Error("Abort disabled inListener");
|
|
2475
|
-
}, v = Di(),
|
|
2476
|
-
|
|
2477
|
-
var
|
|
2478
|
-
return new Promise(function(
|
|
2479
|
-
|
|
2485
|
+
}, v = Di(), _ = fn(i), S = A({}, _, n, v.an_uid ? { userId: v.an_uid } : {}, v.an_aid ? { anonymousId: v.an_aid } : {});
|
|
2486
|
+
S.anonymousId || (S.anonymousId = st());
|
|
2487
|
+
var y = A({ enable: function(h, g) {
|
|
2488
|
+
return new Promise(function(P) {
|
|
2489
|
+
j.dispatch({ type: x.enablePlugin, plugins: vt(h), _: { originalAction: x.enablePlugin } }, P, [g]);
|
|
2480
2490
|
});
|
|
2481
|
-
}, disable: function(
|
|
2482
|
-
return new Promise(function(
|
|
2483
|
-
|
|
2491
|
+
}, disable: function(h, g) {
|
|
2492
|
+
return new Promise(function(P) {
|
|
2493
|
+
j.dispatch({ type: x.disablePlugin, plugins: vt(h), _: { originalAction: x.disablePlugin } }, P, [g]);
|
|
2484
2494
|
});
|
|
2485
|
-
} }, r.methods), l = !1, b = { identify: function(
|
|
2495
|
+
} }, r.methods), l = !1, b = { identify: function(h, g, P, N) {
|
|
2486
2496
|
try {
|
|
2487
|
-
var U = se(
|
|
2488
|
-
be(
|
|
2489
|
-
var
|
|
2497
|
+
var U = se(h) ? h : null, L = V(h) ? h : g, J = P || {}, Z = b.user();
|
|
2498
|
+
be(jt(oe), U);
|
|
2499
|
+
var H = U || L.userId || o(oe, b, L);
|
|
2490
2500
|
return Promise.resolve(new Promise(function(M) {
|
|
2491
|
-
|
|
2501
|
+
j.dispatch(A({ type: x.identifyStart, userId: H, traits: L || {}, options: J, anonymousId: Z.anonymousId }, Z.id && Z.id !== U && { previousId: Z.id }), M, [g, P, N]);
|
|
2492
2502
|
}));
|
|
2493
2503
|
} catch (M) {
|
|
2494
2504
|
return Promise.reject(M);
|
|
2495
2505
|
}
|
|
2496
|
-
}, track: function(
|
|
2506
|
+
}, track: function(h, g, P, N) {
|
|
2497
2507
|
try {
|
|
2498
|
-
var U = V(
|
|
2508
|
+
var U = V(h) ? h.event : h;
|
|
2499
2509
|
if (!U || !se(U))
|
|
2500
2510
|
throw new Error("EventMissing");
|
|
2501
|
-
var
|
|
2511
|
+
var L = V(h) ? h : g || {}, J = V(P) ? P : {};
|
|
2502
2512
|
return Promise.resolve(new Promise(function(Z) {
|
|
2503
|
-
|
|
2513
|
+
j.dispatch({ type: x.trackStart, event: U, properties: L, options: J, userId: o(oe, b, g), anonymousId: o(_e, b, g) }, Z, [g, P, N]);
|
|
2504
2514
|
}));
|
|
2505
2515
|
} catch (Z) {
|
|
2506
2516
|
return Promise.reject(Z);
|
|
2507
2517
|
}
|
|
2508
|
-
}, page: function(
|
|
2518
|
+
}, page: function(h, g, P) {
|
|
2509
2519
|
try {
|
|
2510
|
-
var
|
|
2511
|
-
return Promise.resolve(new Promise(function(
|
|
2512
|
-
|
|
2520
|
+
var N = V(h) ? h : {}, U = V(g) ? g : {};
|
|
2521
|
+
return Promise.resolve(new Promise(function(L) {
|
|
2522
|
+
j.dispatch({ type: x.pageStart, properties: io(N), options: U, userId: o(oe, b, N), anonymousId: o(_e, b, N) }, L, [h, g, P]);
|
|
2513
2523
|
}));
|
|
2514
|
-
} catch (
|
|
2515
|
-
return Promise.reject(
|
|
2524
|
+
} catch (L) {
|
|
2525
|
+
return Promise.reject(L);
|
|
2516
2526
|
}
|
|
2517
|
-
}, user: function(
|
|
2518
|
-
if (
|
|
2527
|
+
}, user: function(h) {
|
|
2528
|
+
if (h === oe || h === "id")
|
|
2519
2529
|
return o(oe, b);
|
|
2520
|
-
if (
|
|
2530
|
+
if (h === _e || h === "anonId")
|
|
2521
2531
|
return o(_e, b);
|
|
2522
|
-
var
|
|
2523
|
-
return
|
|
2524
|
-
}, reset: function(
|
|
2525
|
-
return new Promise(function(
|
|
2526
|
-
|
|
2532
|
+
var g = b.getState("user");
|
|
2533
|
+
return h ? an(g, h) : g;
|
|
2534
|
+
}, reset: function(h) {
|
|
2535
|
+
return new Promise(function(g) {
|
|
2536
|
+
j.dispatch({ type: x.resetStart }, g, h);
|
|
2527
2537
|
});
|
|
2528
|
-
}, ready: function(
|
|
2529
|
-
return l &&
|
|
2530
|
-
|
|
2538
|
+
}, ready: function(h) {
|
|
2539
|
+
return l && h({ plugins: y, instance: b }), b.on(x.ready, function(g) {
|
|
2540
|
+
h(g), l = !0;
|
|
2531
2541
|
});
|
|
2532
|
-
}, on: function(
|
|
2533
|
-
if (!
|
|
2542
|
+
}, on: function(h, g) {
|
|
2543
|
+
if (!h || !Y(g))
|
|
2534
2544
|
return !1;
|
|
2535
|
-
if (
|
|
2536
|
-
throw new Error(".on disabled for " +
|
|
2537
|
-
var
|
|
2538
|
-
if (
|
|
2539
|
-
var
|
|
2540
|
-
return function(
|
|
2545
|
+
if (h === x.bootstrap)
|
|
2546
|
+
throw new Error(".on disabled for " + h);
|
|
2547
|
+
var P = /Start$|Start:/;
|
|
2548
|
+
if (h === "*") {
|
|
2549
|
+
var N = function(Z) {
|
|
2550
|
+
return function(H) {
|
|
2541
2551
|
return function(M) {
|
|
2542
|
-
return M.type.match(
|
|
2552
|
+
return M.type.match(P) && g({ payload: M, instance: b, plugins: a }), H(M);
|
|
2543
2553
|
};
|
|
2544
2554
|
};
|
|
2545
2555
|
}, U = function(Z) {
|
|
2546
|
-
return function(
|
|
2556
|
+
return function(H) {
|
|
2547
2557
|
return function(M) {
|
|
2548
|
-
return M.type.match(
|
|
2558
|
+
return M.type.match(P) || g({ payload: M, instance: b, plugins: a }), H(M);
|
|
2549
2559
|
};
|
|
2550
2560
|
};
|
|
2551
2561
|
};
|
|
2552
|
-
return
|
|
2553
|
-
d(
|
|
2562
|
+
return m(N, Ye), m(U, Ge), function() {
|
|
2563
|
+
d(N, Ye), d(U, Ge);
|
|
2554
2564
|
};
|
|
2555
2565
|
}
|
|
2556
|
-
var
|
|
2557
|
-
return function(
|
|
2566
|
+
var L = h.match(P) ? Ye : Ge, J = function(Z) {
|
|
2567
|
+
return function(H) {
|
|
2558
2568
|
return function(M) {
|
|
2559
|
-
return M.type ===
|
|
2569
|
+
return M.type === h && g({ payload: M, instance: b, plugins: a, abort: k }), H(M);
|
|
2560
2570
|
};
|
|
2561
2571
|
};
|
|
2562
2572
|
};
|
|
2563
|
-
return
|
|
2564
|
-
return d(
|
|
2573
|
+
return m(J, L), function() {
|
|
2574
|
+
return d(J, L);
|
|
2565
2575
|
};
|
|
2566
|
-
}, once: function(
|
|
2567
|
-
if (!
|
|
2576
|
+
}, once: function(h, g) {
|
|
2577
|
+
if (!h || !Y(g))
|
|
2568
2578
|
return !1;
|
|
2569
|
-
if (
|
|
2570
|
-
throw new Error(".once disabled for " +
|
|
2571
|
-
var
|
|
2572
|
-
|
|
2579
|
+
if (h === x.bootstrap)
|
|
2580
|
+
throw new Error(".once disabled for " + h);
|
|
2581
|
+
var P = b.on(h, function(N) {
|
|
2582
|
+
g({ payload: N.payload, instance: b, plugins: a, abort: k }), P();
|
|
2573
2583
|
});
|
|
2574
|
-
return
|
|
2575
|
-
}, getState: function(
|
|
2576
|
-
var
|
|
2577
|
-
return
|
|
2578
|
-
}, dispatch: function(
|
|
2579
|
-
var
|
|
2580
|
-
if (et.includes(
|
|
2581
|
-
throw new Error("reserved action " +
|
|
2582
|
-
var
|
|
2583
|
-
|
|
2584
|
-
}, enablePlugin:
|
|
2585
|
-
|
|
2586
|
-
}, removeItem: function(
|
|
2587
|
-
|
|
2588
|
-
} }, setAnonymousId: function(
|
|
2589
|
-
b.storage.setItem(ce,
|
|
2590
|
-
}, events: { core: et, plugins: s } },
|
|
2591
|
-
return function(
|
|
2592
|
-
return function(
|
|
2593
|
-
return
|
|
2584
|
+
return P;
|
|
2585
|
+
}, getState: function(h) {
|
|
2586
|
+
var g = j.getState();
|
|
2587
|
+
return h ? an(g, h) : Object.assign({}, g);
|
|
2588
|
+
}, dispatch: function(h) {
|
|
2589
|
+
var g = se(h) ? { type: h } : h;
|
|
2590
|
+
if (et.includes(g.type))
|
|
2591
|
+
throw new Error("reserved action " + g.type);
|
|
2592
|
+
var P = A({}, g, { _: A({ originalAction: g.type }, h._ || {}) });
|
|
2593
|
+
j.dispatch(P);
|
|
2594
|
+
}, enablePlugin: y.enable, disablePlugin: y.disable, plugins: y, storage: { getItem: i.getItem, setItem: function(h, g, P) {
|
|
2595
|
+
j.dispatch({ type: x.setItemStart, key: h, value: g, options: P });
|
|
2596
|
+
}, removeItem: function(h, g) {
|
|
2597
|
+
j.dispatch({ type: x.removeItemStart, key: h, options: g });
|
|
2598
|
+
} }, setAnonymousId: function(h, g) {
|
|
2599
|
+
b.storage.setItem(ce, h, g);
|
|
2600
|
+
}, events: { core: et, plugins: s } }, T = r.middlewares.concat([function(h) {
|
|
2601
|
+
return function(g) {
|
|
2602
|
+
return function(P) {
|
|
2603
|
+
return P.meta || (P.meta = Pn()), g(P);
|
|
2594
2604
|
};
|
|
2595
2605
|
};
|
|
2596
|
-
}, w(Ye), Yi(b, u, { all: p, plugins: s }), Gi(i), Hi(b), Ji(b), w(Ge)]), O = { context: so, user: Fi(i), page: ao, track: eo, plugins: qi(u), queue: no },
|
|
2597
|
-
if (
|
|
2598
|
-
var
|
|
2599
|
-
|
|
2600
|
-
return arguments.length === 0 ?
|
|
2606
|
+
}, w(Ye), Yi(b, u, { all: p, plugins: s }), Gi(i), Hi(b), Ji(b), w(Ge)]), O = { context: so, user: Fi(i), page: ao, track: eo, plugins: qi(u), queue: no }, C = xe, D = xe;
|
|
2607
|
+
if (X && t.debug) {
|
|
2608
|
+
var z = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
|
|
2609
|
+
z && (C = z({ trace: !0, traceLimit: 25 })), D = function() {
|
|
2610
|
+
return arguments.length === 0 ? kr() : V(typeof arguments[0]) ? En() : En().apply(null, arguments);
|
|
2601
2611
|
};
|
|
2602
2612
|
}
|
|
2603
|
-
var
|
|
2604
|
-
return Object.keys(
|
|
2605
|
-
return co.includes(
|
|
2613
|
+
var F, $ = function(h) {
|
|
2614
|
+
return Object.keys(h).reduce(function(g, P) {
|
|
2615
|
+
return co.includes(P) || (g[P] = h[P]), g;
|
|
2606
2616
|
}, {});
|
|
2607
|
-
}(t),
|
|
2608
|
-
var
|
|
2609
|
-
return
|
|
2610
|
-
}, {}),
|
|
2611
|
-
for (var
|
|
2612
|
-
var U =
|
|
2613
|
-
typeof
|
|
2617
|
+
}(t), R = r.pluginsArray.reduce(function(h, g) {
|
|
2618
|
+
var P = g.name, N = g.config, U = g.loaded, L = r.pluginEnabled[P];
|
|
2619
|
+
return h[P] = { enabled: L, initialized: !!L && !g.initialize, loaded: !!U({ config: N }), config: N }, h;
|
|
2620
|
+
}, {}), K = { context: $, user: S, plugins: R }, j = dr(function(h) {
|
|
2621
|
+
for (var g = Object.keys(h), P = {}, N = 0; N < g.length; N++) {
|
|
2622
|
+
var U = g[N];
|
|
2623
|
+
typeof h[U] === ae && (P[U] = h[U]);
|
|
2614
2624
|
}
|
|
2615
|
-
var
|
|
2625
|
+
var L, J = Object.keys(P);
|
|
2616
2626
|
try {
|
|
2617
2627
|
(function(Z) {
|
|
2618
|
-
Object.keys(Z).forEach(function(
|
|
2619
|
-
var M = Z[
|
|
2628
|
+
Object.keys(Z).forEach(function(H) {
|
|
2629
|
+
var M = Z[H];
|
|
2620
2630
|
if (typeof M(void 0, { type: "@@redux/INIT" }) === ie || typeof M(void 0, { type: Zi }) === ie)
|
|
2621
|
-
throw new Error("reducer " +
|
|
2631
|
+
throw new Error("reducer " + H + " " + ie);
|
|
2622
2632
|
});
|
|
2623
|
-
})(
|
|
2633
|
+
})(P);
|
|
2624
2634
|
} catch (Z) {
|
|
2625
|
-
|
|
2635
|
+
L = Z;
|
|
2626
2636
|
}
|
|
2627
|
-
return function(Z,
|
|
2628
|
-
if (Z === void 0 && (Z = {}),
|
|
2629
|
-
throw
|
|
2630
|
-
for (var M = !1, ee = {}, Ne = 0; Ne <
|
|
2631
|
-
var He =
|
|
2637
|
+
return function(Z, H) {
|
|
2638
|
+
if (Z === void 0 && (Z = {}), L)
|
|
2639
|
+
throw L;
|
|
2640
|
+
for (var M = !1, ee = {}, Ne = 0; Ne < J.length; Ne++) {
|
|
2641
|
+
var He = J[Ne], Ft = Z[He], lt = (0, P[He])(Ft, H);
|
|
2632
2642
|
if (typeof lt === ie) {
|
|
2633
|
-
var
|
|
2634
|
-
throw new Error(
|
|
2643
|
+
var Nr = Ki(He, H);
|
|
2644
|
+
throw new Error(Nr);
|
|
2635
2645
|
}
|
|
2636
|
-
ee[He] = lt, M = M || lt !==
|
|
2646
|
+
ee[He] = lt, M = M || lt !== Ft;
|
|
2637
2647
|
}
|
|
2638
2648
|
return M ? ee : Z;
|
|
2639
2649
|
};
|
|
2640
|
-
}(
|
|
2641
|
-
|
|
2642
|
-
var
|
|
2643
|
-
return
|
|
2650
|
+
}(A({}, O, e)), K, D(C(Wi.apply(void 0, T))));
|
|
2651
|
+
j.dispatch = (F = j.dispatch, function(h, g, P) {
|
|
2652
|
+
var N = A({}, h, { meta: Pn(h.meta, g, vt(P)) });
|
|
2653
|
+
return F.apply(null, [N]);
|
|
2644
2654
|
});
|
|
2645
|
-
var
|
|
2646
|
-
|
|
2647
|
-
var
|
|
2648
|
-
return r.pluginEnabled[
|
|
2649
|
-
}),
|
|
2650
|
-
return !r.pluginEnabled[
|
|
2655
|
+
var I = Object.keys(a);
|
|
2656
|
+
j.dispatch({ type: x.bootstrap, plugins: I, config: $, params: v, user: S, initialUser: n, persistedUser: _ });
|
|
2657
|
+
var E = I.filter(function(h) {
|
|
2658
|
+
return r.pluginEnabled[h];
|
|
2659
|
+
}), W = I.filter(function(h) {
|
|
2660
|
+
return !r.pluginEnabled[h];
|
|
2651
2661
|
});
|
|
2652
|
-
return
|
|
2653
|
-
var
|
|
2654
|
-
|
|
2655
|
-
}), lo(function(
|
|
2656
|
-
|
|
2657
|
-
}), function(
|
|
2662
|
+
return j.dispatch({ type: x.registerPlugins, plugins: I, enabled: r.pluginEnabled }), r.pluginsArray.map(function(h, g) {
|
|
2663
|
+
var P = h.bootstrap, N = h.config, U = h.name;
|
|
2664
|
+
P && Y(P) && P({ instance: b, config: N, payload: h }), j.dispatch({ type: x.registerPluginType(U), name: U, enabled: r.pluginEnabled[U], plugin: h }), r.pluginsArray.length === g + 1 && j.dispatch({ type: x.initializeStart, plugins: E, disabled: W });
|
|
2665
|
+
}), lo(function(h) {
|
|
2666
|
+
j.dispatch({ type: h ? x.offline : x.online });
|
|
2667
|
+
}), function(h, g, P) {
|
|
2658
2668
|
setInterval(function() {
|
|
2659
|
-
return
|
|
2669
|
+
return fr(h, g, P);
|
|
2660
2670
|
}, 3e3);
|
|
2661
|
-
}(
|
|
2671
|
+
}(j, u, b), b;
|
|
2662
2672
|
}
|
|
2663
|
-
var Ye = "before", Ge = "after", Le = "cookie", fe =
|
|
2664
|
-
function
|
|
2673
|
+
var Ye = "before", Ge = "after", Le = "cookie", fe = _r(), Ir = ct, fo = ct;
|
|
2674
|
+
function Sr(t) {
|
|
2665
2675
|
return fe ? ct(t, "", -1) : Ae(t);
|
|
2666
2676
|
}
|
|
2667
|
-
function
|
|
2677
|
+
function _r() {
|
|
2668
2678
|
if (fe !== void 0)
|
|
2669
2679
|
return fe;
|
|
2670
2680
|
var t = "cookiecookie";
|
|
2671
2681
|
try {
|
|
2672
|
-
ct(t, t), fe = document.cookie.indexOf(t) !== -1,
|
|
2682
|
+
ct(t, t), fe = document.cookie.indexOf(t) !== -1, Sr(t);
|
|
2673
2683
|
} catch {
|
|
2674
2684
|
fe = !1;
|
|
2675
2685
|
}
|
|
@@ -2681,11 +2691,11 @@ function ct(t, e, n, r, i, o) {
|
|
|
2681
2691
|
return fe === !1 && (a ? be(t, e) : we(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]);
|
|
2682
2692
|
}
|
|
2683
2693
|
}
|
|
2684
|
-
var Me = "localStorage", po =
|
|
2694
|
+
var Me = "localStorage", po = Dt.bind(null, "localStorage");
|
|
2685
2695
|
$e("localStorage", "getItem", we);
|
|
2686
2696
|
$e("localStorage", "setItem", be);
|
|
2687
2697
|
$e("localStorage", "removeItem", Ae);
|
|
2688
|
-
var Ze = "sessionStorage", mo =
|
|
2698
|
+
var Ze = "sessionStorage", mo = Dt.bind(null, "sessionStorage");
|
|
2689
2699
|
$e("sessionStorage", "getItem", we);
|
|
2690
2700
|
$e("sessionStorage", "setItem", be);
|
|
2691
2701
|
$e("sessionStorage", "removeItem", Ae);
|
|
@@ -2704,16 +2714,16 @@ function Te(t) {
|
|
|
2704
2714
|
if (e !== null && e !== "")
|
|
2705
2715
|
return e;
|
|
2706
2716
|
}
|
|
2707
|
-
var go = po(), yo = mo(), vo =
|
|
2708
|
-
function
|
|
2717
|
+
var go = po(), yo = mo(), vo = _r();
|
|
2718
|
+
function Er(t, e) {
|
|
2709
2719
|
if (t) {
|
|
2710
|
-
var n =
|
|
2720
|
+
var n = Lt(e), r = !Wt(n), i = Mt(n) ? Te(localStorage.getItem(t)) : void 0;
|
|
2711
2721
|
if (r && !Se(i))
|
|
2712
2722
|
return i;
|
|
2713
|
-
var o =
|
|
2723
|
+
var o = Zt(n) ? Te(Ir(t)) : void 0;
|
|
2714
2724
|
if (r && o)
|
|
2715
2725
|
return o;
|
|
2716
|
-
var a =
|
|
2726
|
+
var a = Kt(n) ? Te(sessionStorage.getItem(t)) : void 0;
|
|
2717
2727
|
if (r && a)
|
|
2718
2728
|
return a;
|
|
2719
2729
|
var s = we(t);
|
|
@@ -2722,38 +2732,38 @@ function Sr(t, e) {
|
|
|
2722
2732
|
}
|
|
2723
2733
|
function wo(t, e, n) {
|
|
2724
2734
|
if (t && !Se(e)) {
|
|
2725
|
-
var r = {}, i =
|
|
2726
|
-
return
|
|
2735
|
+
var r = {}, i = Lt(n), o = JSON.stringify(e), a = !Wt(i);
|
|
2736
|
+
return Mt(i) && (r[Me] = Be(Me, e, Te(localStorage.getItem(t))), localStorage.setItem(t, o), a) ? r[Me] : Zt(i) && (r[Le] = Be(Le, e, Te(Ir(t))), fo(t, o), a) ? r[Le] : Kt(i) && (r[Ze] = Be(Ze, e, Te(sessionStorage.getItem(t))), sessionStorage.setItem(t, o), a) ? r[Ze] : (r[De] = Be(De, e, we(t)), be(t, e), a ? r[De] : r);
|
|
2727
2737
|
}
|
|
2728
2738
|
}
|
|
2729
2739
|
function bo(t, e) {
|
|
2730
2740
|
if (t) {
|
|
2731
|
-
var n =
|
|
2732
|
-
return !Se(r.localStorage) &&
|
|
2741
|
+
var n = Lt(e), r = Er(t, ar), i = {};
|
|
2742
|
+
return !Se(r.localStorage) && Mt(n) && (localStorage.removeItem(t), i[Me] = r.localStorage), !Se(r.cookie) && Zt(n) && (Sr(t), i[Le] = r.cookie), !Se(r.sessionStorage) && Kt(n) && (sessionStorage.removeItem(t), i[Ze] = r.sessionStorage), !Se(r.global) && ut(n, De) && (Ae(t), i[De] = r.global), i;
|
|
2733
2743
|
}
|
|
2734
2744
|
}
|
|
2735
|
-
function Dt(t) {
|
|
2736
|
-
return t ? se(t) ? t : t.storage : rr;
|
|
2737
|
-
}
|
|
2738
2745
|
function Lt(t) {
|
|
2739
|
-
return
|
|
2746
|
+
return t ? se(t) ? t : t.storage : or;
|
|
2740
2747
|
}
|
|
2741
2748
|
function Mt(t) {
|
|
2742
|
-
return
|
|
2749
|
+
return go && ut(t, Me);
|
|
2743
2750
|
}
|
|
2744
2751
|
function Zt(t) {
|
|
2745
|
-
return
|
|
2752
|
+
return vo && ut(t, Le);
|
|
2746
2753
|
}
|
|
2747
2754
|
function Kt(t) {
|
|
2748
|
-
return
|
|
2755
|
+
return yo && ut(t, Ze);
|
|
2756
|
+
}
|
|
2757
|
+
function Wt(t) {
|
|
2758
|
+
return t === ar || t === "all";
|
|
2749
2759
|
}
|
|
2750
2760
|
function ut(t, e) {
|
|
2751
|
-
return t ===
|
|
2761
|
+
return t === or || t === e || Wt(t);
|
|
2752
2762
|
}
|
|
2753
2763
|
function Be(t, e, n) {
|
|
2754
2764
|
return { location: t, current: e, previous: n };
|
|
2755
2765
|
}
|
|
2756
|
-
var ko = { setItem: wo, getItem:
|
|
2766
|
+
var ko = { setItem: wo, getItem: Er, removeItem: bo };
|
|
2757
2767
|
function Io(t, e, n) {
|
|
2758
2768
|
return e in t ? Object.defineProperty(t, e, {
|
|
2759
2769
|
value: n,
|
|
@@ -2762,7 +2772,7 @@ function Io(t, e, n) {
|
|
|
2762
2772
|
writable: !0
|
|
2763
2773
|
}) : t[e] = n, t;
|
|
2764
2774
|
}
|
|
2765
|
-
function
|
|
2775
|
+
function Tn(t, e) {
|
|
2766
2776
|
var n = Object.keys(t);
|
|
2767
2777
|
if (Object.getOwnPropertySymbols) {
|
|
2768
2778
|
var r = Object.getOwnPropertySymbols(t);
|
|
@@ -2772,12 +2782,12 @@ function En(t, e) {
|
|
|
2772
2782
|
}
|
|
2773
2783
|
return n;
|
|
2774
2784
|
}
|
|
2775
|
-
function
|
|
2785
|
+
function On(t) {
|
|
2776
2786
|
for (var e = 1; e < arguments.length; e++) {
|
|
2777
2787
|
var n = arguments[e] != null ? arguments[e] : {};
|
|
2778
|
-
e % 2 ?
|
|
2788
|
+
e % 2 ? Tn(Object(n), !0).forEach(function(r) {
|
|
2779
2789
|
Io(t, r, n[r]);
|
|
2780
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) :
|
|
2790
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : Tn(Object(n)).forEach(function(r) {
|
|
2781
2791
|
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
|
|
2782
2792
|
});
|
|
2783
2793
|
}
|
|
@@ -2787,7 +2797,7 @@ function So() {
|
|
|
2787
2797
|
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = {
|
|
2788
2798
|
storage: ko
|
|
2789
2799
|
};
|
|
2790
|
-
return ho(
|
|
2800
|
+
return ho(On(On({}, e), t));
|
|
2791
2801
|
}
|
|
2792
2802
|
function _o(t, e) {
|
|
2793
2803
|
e = e || {};
|
|
@@ -2800,14 +2810,14 @@ function _o(t, e) {
|
|
|
2800
2810
|
}
|
|
2801
2811
|
return s(), {
|
|
2802
2812
|
flush: a,
|
|
2803
|
-
push: function(
|
|
2804
|
-
return r = i.push(
|
|
2813
|
+
push: function(f) {
|
|
2814
|
+
return r = i.push(f), r >= o && a(), r;
|
|
2805
2815
|
},
|
|
2806
2816
|
size: function() {
|
|
2807
2817
|
return i.length;
|
|
2808
2818
|
},
|
|
2809
|
-
end: function(
|
|
2810
|
-
|
|
2819
|
+
end: function(f) {
|
|
2820
|
+
f && a(), clearInterval(n);
|
|
2811
2821
|
}
|
|
2812
2822
|
};
|
|
2813
2823
|
}
|
|
@@ -2821,10 +2831,10 @@ function Eo(t) {
|
|
|
2821
2831
|
if (a !== "pushState" && a !== "replaceState")
|
|
2822
2832
|
return;
|
|
2823
2833
|
const s = n[a];
|
|
2824
|
-
n[a] = function(...
|
|
2834
|
+
n[a] = function(...f) {
|
|
2825
2835
|
var c;
|
|
2826
|
-
const p = ((c =
|
|
2827
|
-
return i !== u && (i = u, setTimeout(() => t(p), 0)), s.apply(n,
|
|
2836
|
+
const p = ((c = f[2]) == null ? void 0 : c.toString()) || "", u = To(p);
|
|
2837
|
+
return i !== u && (i = u, setTimeout(() => t(p), 0)), s.apply(n, f);
|
|
2828
2838
|
};
|
|
2829
2839
|
});
|
|
2830
2840
|
}
|
|
@@ -2837,39 +2847,39 @@ function To(t) {
|
|
|
2837
2847
|
}
|
|
2838
2848
|
function Oo() {
|
|
2839
2849
|
Eo(() => {
|
|
2840
|
-
|
|
2850
|
+
re.page();
|
|
2841
2851
|
});
|
|
2842
2852
|
}
|
|
2843
2853
|
function jo(t) {
|
|
2844
|
-
if (t === void 0 && (t = {}), !
|
|
2845
|
-
return
|
|
2846
|
-
var e =
|
|
2847
|
-
if (!
|
|
2848
|
-
return
|
|
2849
|
-
var d =
|
|
2854
|
+
if (t === void 0 && (t = {}), !X)
|
|
2855
|
+
return Tt;
|
|
2856
|
+
var e = Cn(), n = Ct(), r = jn(), i = qe(r, e), o = qe(n, e), a = [], s = [], f = [], p = r, u = i, c = o, m = Object.keys(t);
|
|
2857
|
+
if (!m.length)
|
|
2858
|
+
return Tt;
|
|
2859
|
+
var d = m.map(function(k) {
|
|
2850
2860
|
return Number(k);
|
|
2851
2861
|
}), w = Mi(function() {
|
|
2852
|
-
var k =
|
|
2853
|
-
return
|
|
2854
|
-
return
|
|
2862
|
+
var k = Cn(), v = function($, R) {
|
|
2863
|
+
return R.map(function(K) {
|
|
2864
|
+
return K === 100 ? $ - 5 : $ * (K / 100);
|
|
2855
2865
|
});
|
|
2856
|
-
}(k, d),
|
|
2857
|
-
if (u =
|
|
2858
|
-
var b = p ===
|
|
2859
|
-
b ?
|
|
2860
|
-
var O = v,
|
|
2861
|
-
(
|
|
2862
|
-
var D =
|
|
2863
|
-
var
|
|
2864
|
-
return
|
|
2865
|
-
return
|
|
2866
|
-
}),
|
|
2867
|
-
}, { foundFunc: [], singleFunction: null, callbacks: [], direction:
|
|
2868
|
-
if (p =
|
|
2869
|
-
Y(t[
|
|
2866
|
+
}(k, d), _ = Ct(), S = jn(), y = qe(S, k), l = qe(_, k);
|
|
2867
|
+
if (u = y > u ? y : u, c = l < c ? l : c, !(a.length >= d.length)) {
|
|
2868
|
+
var b = p === S, T = "up";
|
|
2869
|
+
b ? T = "initial" : p <= S && (T = "down");
|
|
2870
|
+
var O = v, C = d;
|
|
2871
|
+
(T === "up" || b) && (O = v.slice().reverse(), C = d.slice().reverse());
|
|
2872
|
+
var D = C.reduce(function($, R, K) {
|
|
2873
|
+
var j = O[K];
|
|
2874
|
+
return f.includes(R) && S <= j && (f = f.filter(function(I) {
|
|
2875
|
+
return I !== R;
|
|
2876
|
+
}), $.singleFunction = R), T === "down" && !a.includes(R) && S >= j && R > o ? (s.push(R), $.callbacks = $.callbacks.concat(R), $) : T === "up" && !a.includes(R) && S <= j && R <= y ? ($.foundFunc = [R], $) : (b && S >= j && $.foundFunc.length === 0 && ($.foundFunc = [R]), !s.includes(R) && S >= j && (s.push(R), $.singleFunction ? f.push(R) : $.singleFunction = R), $);
|
|
2877
|
+
}, { foundFunc: [], singleFunction: null, callbacks: [], direction: T });
|
|
2878
|
+
if (p = S, T === "down" && D.callbacks && D.callbacks.forEach(function($) {
|
|
2879
|
+
Y(t[$]) && (t[$]({ trigger: $, direction: T, scrollMin: c, scrollMax: u, range: [c, u] }), a.push($));
|
|
2870
2880
|
}), D.singleFunction) {
|
|
2871
|
-
var
|
|
2872
|
-
Y(t[
|
|
2881
|
+
var z = D.singleFunction, F = D.direction;
|
|
2882
|
+
Y(t[z]) && t[z]({ trigger: z, direction: F, scrollMin: c, scrollMax: u, range: [c, u] }), a.push(z);
|
|
2873
2883
|
}
|
|
2874
2884
|
}
|
|
2875
2885
|
}, 500);
|
|
@@ -2877,17 +2887,17 @@ function jo(t) {
|
|
|
2877
2887
|
return window.removeEventListener("scroll", w);
|
|
2878
2888
|
};
|
|
2879
2889
|
}
|
|
2880
|
-
function
|
|
2881
|
-
return
|
|
2890
|
+
function Ct() {
|
|
2891
|
+
return X ? document.body.scrollTop || document.documentElement.scrollTop : 0;
|
|
2882
2892
|
}
|
|
2883
2893
|
function Co() {
|
|
2884
|
-
return
|
|
2894
|
+
return X ? window.innerHeight || document.documentElement.clientHeight : 0;
|
|
2885
2895
|
}
|
|
2886
|
-
function
|
|
2887
|
-
return Math.round(
|
|
2896
|
+
function jn() {
|
|
2897
|
+
return Math.round(Ct() + Co());
|
|
2888
2898
|
}
|
|
2889
|
-
function
|
|
2890
|
-
if (!
|
|
2899
|
+
function Cn() {
|
|
2900
|
+
if (!X)
|
|
2891
2901
|
return 0;
|
|
2892
2902
|
var t = document.body, e = document.documentElement;
|
|
2893
2903
|
return Math.max(t.scrollHeight, t.offsetHeight, e.clientHeight, e.scrollHeight, e.offsetHeight);
|
|
@@ -2895,25 +2905,25 @@ function On() {
|
|
|
2895
2905
|
function qe(t, e) {
|
|
2896
2906
|
return Math.round(t / e * 100);
|
|
2897
2907
|
}
|
|
2898
|
-
var
|
|
2908
|
+
var xn = "EventListener";
|
|
2899
2909
|
function xo(t) {
|
|
2900
2910
|
return function(e, n, r, i) {
|
|
2901
|
-
var o = r ||
|
|
2902
|
-
if (!
|
|
2911
|
+
var o = r || Tt, a = i || !1;
|
|
2912
|
+
if (!X)
|
|
2903
2913
|
return o;
|
|
2904
|
-
var s = rt(n),
|
|
2905
|
-
if (!
|
|
2914
|
+
var s = rt(n), f = rt(e, !0);
|
|
2915
|
+
if (!f.length)
|
|
2906
2916
|
throw new Error("noElements");
|
|
2907
2917
|
if (!s.length)
|
|
2908
2918
|
throw new Error("noEvent");
|
|
2909
2919
|
var p = [];
|
|
2910
2920
|
return function u(c) {
|
|
2911
2921
|
c && (p = []);
|
|
2912
|
-
for (var
|
|
2913
|
-
var w =
|
|
2922
|
+
for (var m = c ? "add" + xn : "remove" + xn, d = 0; d < f.length; d++) {
|
|
2923
|
+
var w = f[d];
|
|
2914
2924
|
p[d] = c ? a && a.once ? Ao(o) : o : p[d] || o;
|
|
2915
2925
|
for (var k = 0; k < s.length; k++)
|
|
2916
|
-
w[
|
|
2926
|
+
w[m] ? w["on" + s[k]] = c ? p[d] : null : w[m](s[k], p[d], a);
|
|
2917
2927
|
}
|
|
2918
2928
|
return u.bind(null, !c);
|
|
2919
2929
|
}(t);
|
|
@@ -2942,17 +2952,17 @@ function Ao(t, e) {
|
|
|
2942
2952
|
};
|
|
2943
2953
|
}
|
|
2944
2954
|
var wt = xo("Event");
|
|
2945
|
-
function
|
|
2946
|
-
return
|
|
2955
|
+
function Pr(t, e) {
|
|
2956
|
+
return X && Y(window[t]) ? (n = window[t], r = e, (i = window) === void 0 && (i = null), Y(n) ? function() {
|
|
2947
2957
|
n.apply(i, arguments), r.apply(i, arguments);
|
|
2948
2958
|
} : r) : window[t] = e;
|
|
2949
2959
|
var n, r, i;
|
|
2950
2960
|
}
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
var
|
|
2961
|
+
Pr.bind(null, "onerror");
|
|
2962
|
+
Pr.bind(null, "onload");
|
|
2963
|
+
var Tr = typeof window > "u", An = "hidden";
|
|
2954
2964
|
function $o(t) {
|
|
2955
|
-
if (
|
|
2965
|
+
if (Tr)
|
|
2956
2966
|
return !1;
|
|
2957
2967
|
var e = No(), n = "".concat(e.replace(/[H|h]idden/, ""), "visibilitychange"), r = function() {
|
|
2958
2968
|
return t(!!document[e]);
|
|
@@ -2965,7 +2975,7 @@ function $o(t) {
|
|
|
2965
2975
|
}
|
|
2966
2976
|
function No() {
|
|
2967
2977
|
var t = ["webkit", "moz", "ms", "o"];
|
|
2968
|
-
return
|
|
2978
|
+
return Tr || An in document ? An : t.reduce(function(e, n) {
|
|
2969
2979
|
var r = n + "Hidden";
|
|
2970
2980
|
return !e && r in document ? r : e;
|
|
2971
2981
|
}, null);
|
|
@@ -2974,9 +2984,9 @@ var Uo = ["mousemove", "mousedown", "touchmove", "touchstart", "touchend", "keyd
|
|
|
2974
2984
|
function zo(t, e) {
|
|
2975
2985
|
e === void 0 && (e = {});
|
|
2976
2986
|
var n = /* @__PURE__ */ function(a, s) {
|
|
2977
|
-
var
|
|
2987
|
+
var f = this, p = !1;
|
|
2978
2988
|
return function(u) {
|
|
2979
|
-
p || (a.call(
|
|
2989
|
+
p || (a.call(f, u), p = !0, setTimeout(function() {
|
|
2980
2990
|
return p = !1;
|
|
2981
2991
|
}, s));
|
|
2982
2992
|
};
|
|
@@ -2999,12 +3009,12 @@ function zo(t, e) {
|
|
|
2999
3009
|
};
|
|
3000
3010
|
}
|
|
3001
3011
|
function Ro(t) {
|
|
3002
|
-
var e, n, r = t.onIdle, i = t.onWakeUp, o = t.onHeartbeat, a = t.timeout, s = a === void 0 ? 1e4 : a,
|
|
3012
|
+
var e, n, r = t.onIdle, i = t.onWakeUp, o = t.onHeartbeat, a = t.timeout, s = a === void 0 ? 1e4 : a, f = t.throttle, p = f === void 0 ? 2e3 : f, u = !1, c = !1, m = /* @__PURE__ */ new Date(), d = function() {
|
|
3003
3013
|
return clearTimeout(e);
|
|
3004
3014
|
};
|
|
3005
3015
|
function w(v) {
|
|
3006
|
-
d(), o && !u && o(ze(
|
|
3007
|
-
u = !0, r && (n = /* @__PURE__ */ new Date(), r(ze(
|
|
3016
|
+
d(), o && !u && o(ze(m), v), i && u && (u = !1, i(ze(n), v), m = /* @__PURE__ */ new Date()), e = setTimeout(function() {
|
|
3017
|
+
u = !0, r && (n = /* @__PURE__ */ new Date(), r(ze(m), v));
|
|
3008
3018
|
}, s);
|
|
3009
3019
|
}
|
|
3010
3020
|
var k = zo(w, { throttle: p });
|
|
@@ -3012,16 +3022,16 @@ function Ro(t) {
|
|
|
3012
3022
|
c = !0, u = !1, d();
|
|
3013
3023
|
var v = k();
|
|
3014
3024
|
return function() {
|
|
3015
|
-
return c = !1,
|
|
3025
|
+
return c = !1, m = /* @__PURE__ */ new Date(), w({ type: "load" }), v();
|
|
3016
3026
|
};
|
|
3017
3027
|
}, getStatus: function() {
|
|
3018
|
-
return { isIdle: u, isDisabled: c, active: u ? 0 : ze(
|
|
3028
|
+
return { isIdle: u, isDisabled: c, active: u ? 0 : ze(m, c), idle: u ? ze(n, c) : 0 };
|
|
3019
3029
|
} };
|
|
3020
3030
|
}
|
|
3021
3031
|
function ze(t, e) {
|
|
3022
3032
|
return e ? 0 : Math.round((/* @__PURE__ */ new Date() - t) / 1e3);
|
|
3023
3033
|
}
|
|
3024
|
-
const
|
|
3034
|
+
const $n = 5e3;
|
|
3025
3035
|
class Do {
|
|
3026
3036
|
constructor(e) {
|
|
3027
3037
|
q(this, "element");
|
|
@@ -3047,7 +3057,7 @@ class Do {
|
|
|
3047
3057
|
), this.observer.observe(this.element), Ro({
|
|
3048
3058
|
onIdle: (n) => this.handleAwake(!1, n),
|
|
3049
3059
|
onWakeUp: (n) => this.handleAwake(!0, n),
|
|
3050
|
-
timeout:
|
|
3060
|
+
timeout: $n
|
|
3051
3061
|
}), jo({
|
|
3052
3062
|
25: this.handleScroll.bind(this),
|
|
3053
3063
|
50: this.handleScroll.bind(this),
|
|
@@ -3066,7 +3076,7 @@ class Do {
|
|
|
3066
3076
|
e ? (this.isAwake = !0, this.trackInViewport()) : this.handleAwake(!1), this.isInViewport = e;
|
|
3067
3077
|
}
|
|
3068
3078
|
handleAwake(e, n = Math.round((Date.now() - this.lastEventAt) / 1e3)) {
|
|
3069
|
-
this.isAwake = e, this.lastEventAt = e ? Date.now() - n *
|
|
3079
|
+
this.isAwake = e, this.lastEventAt = e ? Date.now() - n * $n : Date.now(), this.isInViewport && this.trackAwake(e, n);
|
|
3070
3080
|
}
|
|
3071
3081
|
handleScroll(e) {
|
|
3072
3082
|
this.scrollCallback && this.scrollCallback(e);
|
|
@@ -3083,37 +3093,37 @@ class Do {
|
|
|
3083
3093
|
this.registeredView || (this.registeredView = !0, this.viewCallback && this.viewCallback());
|
|
3084
3094
|
}
|
|
3085
3095
|
}
|
|
3086
|
-
const
|
|
3096
|
+
const Nn = "sesamy_session_id";
|
|
3087
3097
|
function Lo() {
|
|
3088
|
-
let t = sessionStorage.getItem(
|
|
3089
|
-
return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(
|
|
3098
|
+
let t = sessionStorage.getItem(Nn);
|
|
3099
|
+
return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(Nn, t)), t;
|
|
3090
3100
|
}
|
|
3091
|
-
let
|
|
3092
|
-
function Mo({ clientId: t, enabled: e = !0, endpoint: n =
|
|
3093
|
-
if (
|
|
3101
|
+
let Or = !1, xt, Un, it;
|
|
3102
|
+
function Mo({ clientId: t, enabled: e = !0, endpoint: n = ci }) {
|
|
3103
|
+
if (xt = t, Un = e, it = n, !Un)
|
|
3094
3104
|
return;
|
|
3095
3105
|
Oo();
|
|
3096
3106
|
const r = new Do({
|
|
3097
3107
|
element: document.body,
|
|
3098
3108
|
viewCallback: () => {
|
|
3099
|
-
|
|
3109
|
+
re.page();
|
|
3100
3110
|
},
|
|
3101
3111
|
activeDurationCallback: (i, o, a) => {
|
|
3102
|
-
|
|
3112
|
+
re.track("activeDuration", {
|
|
3103
3113
|
duration: i,
|
|
3104
3114
|
durationStart: a,
|
|
3105
3115
|
flushing: o
|
|
3106
3116
|
});
|
|
3107
3117
|
},
|
|
3108
3118
|
idleDurationCallback: (i, o, a) => {
|
|
3109
|
-
|
|
3119
|
+
re.track("idleDuration", {
|
|
3110
3120
|
duration: i,
|
|
3111
3121
|
durationStart: a,
|
|
3112
3122
|
flushing: o
|
|
3113
3123
|
});
|
|
3114
3124
|
},
|
|
3115
3125
|
scrollCallback: (i) => {
|
|
3116
|
-
|
|
3126
|
+
re.track("scroll", {
|
|
3117
3127
|
scroll: i.scrollMax
|
|
3118
3128
|
});
|
|
3119
3129
|
}
|
|
@@ -3124,20 +3134,20 @@ function Mo({ clientId: t, enabled: e = !0, endpoint: n = ai }) {
|
|
|
3124
3134
|
r.handleVisibilityChange();
|
|
3125
3135
|
}), window.addEventListener(Q.AUTHENTICATED, async (i) => {
|
|
3126
3136
|
const o = i;
|
|
3127
|
-
await
|
|
3137
|
+
await re.identify(o.detail.sub);
|
|
3128
3138
|
}), window.addEventListener(Q.LOGOUT, async () => {
|
|
3129
|
-
await
|
|
3139
|
+
await re.track("logout", {}), Ht.flush(), await re.reset();
|
|
3130
3140
|
});
|
|
3131
3141
|
}
|
|
3132
|
-
function
|
|
3142
|
+
function jr(t) {
|
|
3133
3143
|
return JSON.stringify(
|
|
3134
3144
|
t.map((e) => ({
|
|
3135
3145
|
...e,
|
|
3136
|
-
clientId:
|
|
3146
|
+
clientId: xt,
|
|
3137
3147
|
requestId: Math.random().toString(36).slice(2, 9),
|
|
3138
3148
|
sessionId: Lo(),
|
|
3139
3149
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3140
|
-
version:
|
|
3150
|
+
version: Rt,
|
|
3141
3151
|
event: e.event,
|
|
3142
3152
|
context: {
|
|
3143
3153
|
page: {
|
|
@@ -3148,18 +3158,18 @@ function Tr(t) {
|
|
|
3148
3158
|
referrer: document.referrer
|
|
3149
3159
|
},
|
|
3150
3160
|
locale: navigator.language,
|
|
3151
|
-
library:
|
|
3161
|
+
library: ir,
|
|
3152
3162
|
userAgent: navigator.userAgent,
|
|
3153
|
-
clientId:
|
|
3163
|
+
clientId: xt
|
|
3154
3164
|
}
|
|
3155
3165
|
}))
|
|
3156
3166
|
);
|
|
3157
3167
|
}
|
|
3158
|
-
const
|
|
3168
|
+
const Ht = _o(
|
|
3159
3169
|
async (t) => {
|
|
3160
3170
|
if (t.length > 0) {
|
|
3161
|
-
const e =
|
|
3162
|
-
|
|
3171
|
+
const e = jr(t);
|
|
3172
|
+
Or ? navigator.sendBeacon(it, e) : (await fetch(it, {
|
|
3163
3173
|
method: "POST",
|
|
3164
3174
|
body: e,
|
|
3165
3175
|
headers: {
|
|
@@ -3180,13 +3190,13 @@ function bt(t) {
|
|
|
3180
3190
|
if (t.anonymousId)
|
|
3181
3191
|
if ((e = t.properties) != null && e.flushing) {
|
|
3182
3192
|
const n = { ...t };
|
|
3183
|
-
delete n.properties.flushing, navigator.sendBeacon(it,
|
|
3193
|
+
delete n.properties.flushing, navigator.sendBeacon(it, jr([n]));
|
|
3184
3194
|
} else
|
|
3185
|
-
|
|
3195
|
+
Ht.push(t);
|
|
3186
3196
|
}
|
|
3187
|
-
const
|
|
3188
|
-
app:
|
|
3189
|
-
version:
|
|
3197
|
+
const re = So({
|
|
3198
|
+
app: ir,
|
|
3199
|
+
version: Rt,
|
|
3190
3200
|
plugins: [
|
|
3191
3201
|
{
|
|
3192
3202
|
name: "custom-analytics-plugin",
|
|
@@ -3223,37 +3233,37 @@ const ne = So({
|
|
|
3223
3233
|
]
|
|
3224
3234
|
});
|
|
3225
3235
|
function Zo(t, e) {
|
|
3226
|
-
|
|
3236
|
+
re.track(t, e);
|
|
3227
3237
|
}
|
|
3228
3238
|
function Ko() {
|
|
3229
|
-
return
|
|
3239
|
+
return Or = !0, Ht.flush();
|
|
3230
3240
|
}
|
|
3231
|
-
const
|
|
3241
|
+
const Cr = /* @__PURE__ */ new Map();
|
|
3232
3242
|
function Wo(t, e) {
|
|
3233
|
-
|
|
3243
|
+
Cr.set(t, e);
|
|
3234
3244
|
}
|
|
3235
3245
|
window.addEventListener("beforeunload", () => {
|
|
3236
|
-
|
|
3246
|
+
Cr.forEach((t, e) => {
|
|
3237
3247
|
t.bind(e)();
|
|
3238
3248
|
}), Ko();
|
|
3239
3249
|
});
|
|
3240
|
-
const
|
|
3250
|
+
const xr = /* @__PURE__ */ new Map();
|
|
3241
3251
|
function Ho(t, e) {
|
|
3242
|
-
|
|
3252
|
+
xr.set(t, e);
|
|
3243
3253
|
}
|
|
3244
3254
|
window.addEventListener("visibilitychange", () => {
|
|
3245
|
-
document.visibilityState !== "visible" &&
|
|
3255
|
+
document.visibilityState !== "visible" && xr.forEach((t, e) => {
|
|
3246
3256
|
t.bind(e)();
|
|
3247
3257
|
});
|
|
3248
3258
|
});
|
|
3249
|
-
const
|
|
3250
|
-
function
|
|
3251
|
-
const t = sessionStorage.getItem(
|
|
3259
|
+
const Ar = "sesamySignedURLs";
|
|
3260
|
+
function $r() {
|
|
3261
|
+
const t = sessionStorage.getItem(Ar);
|
|
3252
3262
|
return t ? JSON.parse(t) : [];
|
|
3253
3263
|
}
|
|
3254
3264
|
function Fo(t) {
|
|
3255
|
-
const e =
|
|
3256
|
-
e.push(t), sessionStorage.setItem(
|
|
3265
|
+
const e = $r();
|
|
3266
|
+
e.push(t), sessionStorage.setItem(Ar, JSON.stringify(e));
|
|
3257
3267
|
}
|
|
3258
3268
|
function Jo(t) {
|
|
3259
3269
|
const {
|
|
@@ -3264,43 +3274,50 @@ function Jo(t) {
|
|
|
3264
3274
|
getContract: o,
|
|
3265
3275
|
getContracts: a,
|
|
3266
3276
|
getBill: s,
|
|
3267
|
-
getBills:
|
|
3277
|
+
getBills: f,
|
|
3268
3278
|
getProfile: p,
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3279
|
+
updateProfile: u,
|
|
3280
|
+
getTags: c,
|
|
3281
|
+
deleteTag: m,
|
|
3282
|
+
setTag: d,
|
|
3283
|
+
getUserMetadata: w,
|
|
3284
|
+
listUserMetadata: k,
|
|
3285
|
+
setUserMetadata: v,
|
|
3286
|
+
deleteUserMetadata: _,
|
|
3287
|
+
getTally: S,
|
|
3288
|
+
getTallies: y,
|
|
3289
|
+
pushTally: l,
|
|
3290
|
+
deleteTally: b,
|
|
3291
|
+
getProduct: T,
|
|
3292
|
+
getPaymentIssues: O,
|
|
3293
|
+
autoOnboardProduct: C,
|
|
3294
|
+
openHostedAccountPage: D
|
|
3295
|
+
} = Ei(t), z = {
|
|
3284
3296
|
auth: {
|
|
3285
3297
|
getUser: p,
|
|
3286
|
-
isAuthenticated:
|
|
3287
|
-
loginWithRedirect:
|
|
3298
|
+
isAuthenticated: qn,
|
|
3299
|
+
loginWithRedirect: Qn,
|
|
3288
3300
|
logout: di,
|
|
3289
|
-
setToken:
|
|
3301
|
+
setToken: er
|
|
3302
|
+
},
|
|
3303
|
+
profile: {
|
|
3304
|
+
get: p,
|
|
3305
|
+
update: u,
|
|
3306
|
+
openHostedAccountPage: D
|
|
3290
3307
|
},
|
|
3291
3308
|
analytics: {
|
|
3292
3309
|
track: Zo
|
|
3293
3310
|
},
|
|
3294
3311
|
tags: {
|
|
3295
|
-
list:
|
|
3296
|
-
set:
|
|
3297
|
-
delete:
|
|
3312
|
+
list: c,
|
|
3313
|
+
set: d,
|
|
3314
|
+
delete: m
|
|
3298
3315
|
},
|
|
3299
3316
|
entitlements: {
|
|
3300
3317
|
get: e,
|
|
3301
3318
|
list: n,
|
|
3302
3319
|
access: r,
|
|
3303
|
-
signedLinks:
|
|
3320
|
+
signedLinks: $r
|
|
3304
3321
|
},
|
|
3305
3322
|
contracts: {
|
|
3306
3323
|
get: o,
|
|
@@ -3308,50 +3325,50 @@ function Jo(t) {
|
|
|
3308
3325
|
},
|
|
3309
3326
|
bills: {
|
|
3310
3327
|
get: s,
|
|
3311
|
-
list:
|
|
3328
|
+
list: f
|
|
3312
3329
|
},
|
|
3313
3330
|
userMetadata: {
|
|
3314
|
-
get:
|
|
3315
|
-
list:
|
|
3316
|
-
set:
|
|
3317
|
-
delete:
|
|
3331
|
+
get: w,
|
|
3332
|
+
list: k,
|
|
3333
|
+
set: v,
|
|
3334
|
+
delete: _
|
|
3318
3335
|
},
|
|
3319
3336
|
tallies: {
|
|
3320
|
-
get:
|
|
3321
|
-
list:
|
|
3322
|
-
push:
|
|
3323
|
-
delete:
|
|
3337
|
+
get: S,
|
|
3338
|
+
list: y,
|
|
3339
|
+
push: l,
|
|
3340
|
+
delete: b
|
|
3324
3341
|
},
|
|
3325
3342
|
subscriptions: {
|
|
3326
3343
|
list: i
|
|
3327
3344
|
},
|
|
3328
3345
|
products: {
|
|
3329
|
-
get:
|
|
3330
|
-
autoOnboard:
|
|
3346
|
+
get: T,
|
|
3347
|
+
autoOnboard: C
|
|
3331
3348
|
},
|
|
3332
3349
|
getVersion: Xo,
|
|
3333
|
-
getPaymentIssues:
|
|
3334
|
-
clearCache:
|
|
3350
|
+
getPaymentIssues: O,
|
|
3351
|
+
clearCache: te
|
|
3335
3352
|
};
|
|
3336
|
-
return t.namespace && (window[t.namespace] =
|
|
3353
|
+
return t.namespace && (window[t.namespace] = z), z;
|
|
3337
3354
|
}
|
|
3338
3355
|
function Xo() {
|
|
3339
|
-
return
|
|
3356
|
+
return Rt;
|
|
3340
3357
|
}
|
|
3341
3358
|
function Vo() {
|
|
3342
3359
|
const t = new URLSearchParams(window.location.hash.substring(1)), e = t.get("access_token"), n = t.get("expires_in");
|
|
3343
3360
|
if (e) {
|
|
3344
|
-
|
|
3361
|
+
er(e, n ? parseInt(n, 10) : void 0);
|
|
3345
3362
|
const r = new URL(window.location.href);
|
|
3346
3363
|
t.delete("access_token"), t.delete("expires_in"), r.hash = t.toString(), window.history.replaceState(null, "", r);
|
|
3347
3364
|
}
|
|
3348
3365
|
}
|
|
3349
|
-
const
|
|
3366
|
+
const zn = "sesamy-refresh", Rn = "force-refetch-entitlements";
|
|
3350
3367
|
function Yo() {
|
|
3351
|
-
const t = new URLSearchParams(window.location.search), e = t.get(
|
|
3368
|
+
const t = new URLSearchParams(window.location.search), e = t.get(Rn), n = t.get(zn);
|
|
3352
3369
|
if (e !== null || n !== null) {
|
|
3353
3370
|
const r = new URL(window.location.href);
|
|
3354
|
-
t.delete(
|
|
3371
|
+
t.delete(Rn), t.delete(zn), r.search = t.toString(), te(), window.history.replaceState(null, "", r);
|
|
3355
3372
|
}
|
|
3356
3373
|
}
|
|
3357
3374
|
function Go() {
|
|
@@ -3370,22 +3387,22 @@ function Go() {
|
|
|
3370
3387
|
const i = new URL(window.location.href);
|
|
3371
3388
|
i.searchParams.delete("ss"), i.searchParams.delete("se"), i.searchParams.delete("sp"), i.searchParams.delete("so"), i.searchParams.delete("token"), window.history.replaceState(null, "", i);
|
|
3372
3389
|
}
|
|
3373
|
-
const
|
|
3390
|
+
const Dn = "sesamy-user";
|
|
3374
3391
|
async function Bo() {
|
|
3375
|
-
const e = new URLSearchParams(window.location.search).get(
|
|
3392
|
+
const e = new URLSearchParams(window.location.search).get(Dn);
|
|
3376
3393
|
if (!e)
|
|
3377
3394
|
return;
|
|
3378
|
-
const n = await
|
|
3379
|
-
(n == null ? void 0 : n.email) !== e &&
|
|
3395
|
+
const n = await li();
|
|
3396
|
+
(n == null ? void 0 : n.email) !== e && Qn();
|
|
3380
3397
|
const r = new URL(window.location.href);
|
|
3381
|
-
r.searchParams.delete(
|
|
3398
|
+
r.searchParams.delete(Dn), window.history.replaceState(null, "", r);
|
|
3382
3399
|
}
|
|
3383
|
-
const
|
|
3400
|
+
const Ln = "sesamy-purchase";
|
|
3384
3401
|
function qo() {
|
|
3385
|
-
const t = new URLSearchParams(window.location.search), e = t.get(
|
|
3402
|
+
const t = new URLSearchParams(window.location.search), e = t.get(Ln);
|
|
3386
3403
|
if (e !== null) {
|
|
3387
3404
|
const n = new URL(window.location.href);
|
|
3388
|
-
t.delete(
|
|
3405
|
+
t.delete(Ln), n.search = t.toString(), ue(Q.PURCHASE, { itemSrc: e }), te(), window.history.replaceState(null, "", n);
|
|
3389
3406
|
}
|
|
3390
3407
|
}
|
|
3391
3408
|
async function Qo(t) {
|
|
@@ -3393,12 +3410,12 @@ async function Qo(t) {
|
|
|
3393
3410
|
clientId: t.clientId,
|
|
3394
3411
|
// The default client id can be overridden by the config
|
|
3395
3412
|
...t.analytics
|
|
3396
|
-
}), await
|
|
3413
|
+
}), await ui({
|
|
3397
3414
|
clientId: t.clientId,
|
|
3398
3415
|
// The default client id can be overridden by the config
|
|
3399
3416
|
...t.auth
|
|
3400
3417
|
});
|
|
3401
|
-
const e = Jo(t.api
|
|
3418
|
+
const e = Jo({ clientId: t.clientId, ...t.api });
|
|
3402
3419
|
return ue(Q.READY, {}), Vo(), Yo(), Go(), await Bo(), qo(), e;
|
|
3403
3420
|
}
|
|
3404
3421
|
if (typeof document < "u") {
|