@sesamy/sesamy-js 1.0.2 → 1.0.4
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 +26 -4
- package/dist/sesamy-js.es.js +1475 -1122
- package/dist/sesamy-js.umd.js +12 -6
- package/package.json +3 -2
package/dist/sesamy-js.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var pr = Object.defineProperty;
|
|
2
|
+
var mr = (t, e, n) => e in t ? pr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var G = (t, e, n) => (mr(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
4
|
(function() {
|
|
5
5
|
const e = document.createElement("link").relList;
|
|
6
6
|
if (e && e.supports && e.supports("modulepreload"))
|
|
@@ -25,16 +25,15 @@ var Y = (t, e, n) => (nr(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
|
25
25
|
fetch(i.href, o);
|
|
26
26
|
}
|
|
27
27
|
})();
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
detail: {},
|
|
28
|
+
function Ot(t, e) {
|
|
29
|
+
const n = new CustomEvent(t, {
|
|
30
|
+
detail: e,
|
|
32
31
|
bubbles: !0,
|
|
33
32
|
composed: !0
|
|
34
33
|
});
|
|
35
|
-
dispatchEvent(
|
|
34
|
+
dispatchEvent(n);
|
|
36
35
|
}
|
|
37
|
-
function
|
|
36
|
+
function Q(t, e) {
|
|
38
37
|
var n = {};
|
|
39
38
|
for (var r in t)
|
|
40
39
|
Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
|
|
@@ -45,14 +44,14 @@ function q(t, e) {
|
|
|
45
44
|
}
|
|
46
45
|
return n;
|
|
47
46
|
}
|
|
48
|
-
var
|
|
49
|
-
function
|
|
47
|
+
var se = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
48
|
+
function Pt(t) {
|
|
50
49
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
51
50
|
}
|
|
52
|
-
function
|
|
51
|
+
function Tt(t, e) {
|
|
53
52
|
return t(e = { exports: {} }, e.exports), e.exports;
|
|
54
53
|
}
|
|
55
|
-
var oe =
|
|
54
|
+
var oe = Tt(function(t, e) {
|
|
56
55
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
57
56
|
var n = function() {
|
|
58
57
|
function r() {
|
|
@@ -83,95 +82,95 @@ var oe = kt(function(t, e) {
|
|
|
83
82
|
return n.getInstance();
|
|
84
83
|
};
|
|
85
84
|
});
|
|
86
|
-
|
|
87
|
-
var
|
|
88
|
-
var n =
|
|
89
|
-
return new (
|
|
90
|
-
function y
|
|
85
|
+
Pt(oe);
|
|
86
|
+
var gr = Pt(Tt(function(t, e) {
|
|
87
|
+
var n = se && se.__awaiter || function(u, c, f, d) {
|
|
88
|
+
return new (f || (f = Promise))(function(v, k) {
|
|
89
|
+
function w(y) {
|
|
91
90
|
try {
|
|
92
|
-
_(
|
|
93
|
-
} catch (
|
|
94
|
-
|
|
91
|
+
_(d.next(y));
|
|
92
|
+
} catch (l) {
|
|
93
|
+
k(l);
|
|
95
94
|
}
|
|
96
95
|
}
|
|
97
|
-
function
|
|
96
|
+
function I(y) {
|
|
98
97
|
try {
|
|
99
|
-
_(
|
|
100
|
-
} catch (
|
|
101
|
-
|
|
98
|
+
_(d.throw(y));
|
|
99
|
+
} catch (l) {
|
|
100
|
+
k(l);
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
|
-
function _(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}).then(
|
|
103
|
+
function _(y) {
|
|
104
|
+
y.done ? v(y.value) : new f(function(l) {
|
|
105
|
+
l(y.value);
|
|
106
|
+
}).then(w, I);
|
|
108
107
|
}
|
|
109
|
-
_((
|
|
108
|
+
_((d = d.apply(u, c || [])).next());
|
|
110
109
|
});
|
|
111
|
-
}, r =
|
|
112
|
-
var
|
|
110
|
+
}, r = se && se.__generator || function(u, c) {
|
|
111
|
+
var f, d, v, k, w = { label: 0, sent: function() {
|
|
113
112
|
if (1 & v[0])
|
|
114
113
|
throw v[1];
|
|
115
114
|
return v[1];
|
|
116
115
|
}, trys: [], ops: [] };
|
|
117
|
-
return
|
|
116
|
+
return k = { next: I(0), throw: I(1), return: I(2) }, typeof Symbol == "function" && (k[Symbol.iterator] = function() {
|
|
118
117
|
return this;
|
|
119
|
-
}),
|
|
120
|
-
function
|
|
121
|
-
return function(
|
|
122
|
-
return function(
|
|
123
|
-
if (
|
|
118
|
+
}), k;
|
|
119
|
+
function I(_) {
|
|
120
|
+
return function(y) {
|
|
121
|
+
return function(l) {
|
|
122
|
+
if (f)
|
|
124
123
|
throw new TypeError("Generator is already executing.");
|
|
125
|
-
for (;
|
|
124
|
+
for (; w; )
|
|
126
125
|
try {
|
|
127
|
-
if (
|
|
126
|
+
if (f = 1, d && (v = 2 & l[0] ? d.return : l[0] ? d.throw || ((v = d.return) && v.call(d), 0) : d.next) && !(v = v.call(d, l[1])).done)
|
|
128
127
|
return v;
|
|
129
|
-
switch (
|
|
128
|
+
switch (d = 0, v && (l = [2 & l[0], v.value]), l[0]) {
|
|
130
129
|
case 0:
|
|
131
130
|
case 1:
|
|
132
|
-
v =
|
|
131
|
+
v = l;
|
|
133
132
|
break;
|
|
134
133
|
case 4:
|
|
135
|
-
return
|
|
134
|
+
return w.label++, { value: l[1], done: !1 };
|
|
136
135
|
case 5:
|
|
137
|
-
|
|
136
|
+
w.label++, d = l[1], l = [0];
|
|
138
137
|
continue;
|
|
139
138
|
case 7:
|
|
140
|
-
|
|
139
|
+
l = w.ops.pop(), w.trys.pop();
|
|
141
140
|
continue;
|
|
142
141
|
default:
|
|
143
|
-
if (v =
|
|
144
|
-
|
|
142
|
+
if (v = w.trys, !((v = v.length > 0 && v[v.length - 1]) || l[0] !== 6 && l[0] !== 2)) {
|
|
143
|
+
w = 0;
|
|
145
144
|
continue;
|
|
146
145
|
}
|
|
147
|
-
if (
|
|
148
|
-
|
|
146
|
+
if (l[0] === 3 && (!v || l[1] > v[0] && l[1] < v[3])) {
|
|
147
|
+
w.label = l[1];
|
|
149
148
|
break;
|
|
150
149
|
}
|
|
151
|
-
if (
|
|
152
|
-
|
|
150
|
+
if (l[0] === 6 && w.label < v[1]) {
|
|
151
|
+
w.label = v[1], v = l;
|
|
153
152
|
break;
|
|
154
153
|
}
|
|
155
|
-
if (v &&
|
|
156
|
-
|
|
154
|
+
if (v && w.label < v[2]) {
|
|
155
|
+
w.label = v[2], w.ops.push(l);
|
|
157
156
|
break;
|
|
158
157
|
}
|
|
159
|
-
v[2] &&
|
|
158
|
+
v[2] && w.ops.pop(), w.trys.pop();
|
|
160
159
|
continue;
|
|
161
160
|
}
|
|
162
|
-
|
|
161
|
+
l = c.call(u, w);
|
|
163
162
|
} catch (b) {
|
|
164
|
-
|
|
163
|
+
l = [6, b], d = 0;
|
|
165
164
|
} finally {
|
|
166
|
-
|
|
165
|
+
f = v = 0;
|
|
167
166
|
}
|
|
168
|
-
if (5 &
|
|
169
|
-
throw
|
|
170
|
-
return { value:
|
|
171
|
-
}([_,
|
|
167
|
+
if (5 & l[0])
|
|
168
|
+
throw l[1];
|
|
169
|
+
return { value: l[0] ? l[1] : void 0, done: !0 };
|
|
170
|
+
}([_, y]);
|
|
172
171
|
};
|
|
173
172
|
}
|
|
174
|
-
}, i =
|
|
173
|
+
}, i = se;
|
|
175
174
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
176
175
|
var o = "browser-tabs-lock-key", a = { key: function(u) {
|
|
177
176
|
return n(i, void 0, void 0, function() {
|
|
@@ -199,7 +198,7 @@ var ir = bt(kt(function(t, e) {
|
|
|
199
198
|
});
|
|
200
199
|
}, setItem: function(u, c) {
|
|
201
200
|
return n(i, void 0, void 0, function() {
|
|
202
|
-
return r(this, function(
|
|
201
|
+
return r(this, function(f) {
|
|
203
202
|
throw new Error("Unsupported");
|
|
204
203
|
});
|
|
205
204
|
});
|
|
@@ -219,54 +218,54 @@ var ir = bt(kt(function(t, e) {
|
|
|
219
218
|
return setTimeout(c, u);
|
|
220
219
|
});
|
|
221
220
|
}
|
|
222
|
-
function
|
|
223
|
-
for (var c = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",
|
|
224
|
-
|
|
225
|
-
return
|
|
221
|
+
function p(u) {
|
|
222
|
+
for (var c = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz", f = "", d = 0; d < u; d++)
|
|
223
|
+
f += c[Math.floor(Math.random() * c.length)];
|
|
224
|
+
return f;
|
|
226
225
|
}
|
|
227
226
|
var m = function() {
|
|
228
227
|
function u(c) {
|
|
229
|
-
this.acquiredIatSet = /* @__PURE__ */ new Set(), this.storageHandler = void 0, this.id = Date.now().toString() +
|
|
228
|
+
this.acquiredIatSet = /* @__PURE__ */ new Set(), this.storageHandler = void 0, this.id = Date.now().toString() + p(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 = []);
|
|
230
229
|
}
|
|
231
|
-
return u.prototype.acquireLock = function(c,
|
|
232
|
-
return
|
|
233
|
-
var
|
|
234
|
-
return r(this, function(
|
|
235
|
-
switch (
|
|
230
|
+
return u.prototype.acquireLock = function(c, f) {
|
|
231
|
+
return f === void 0 && (f = 5e3), n(this, void 0, void 0, function() {
|
|
232
|
+
var d, v, k, w, I, _, y;
|
|
233
|
+
return r(this, function(l) {
|
|
234
|
+
switch (l.label) {
|
|
236
235
|
case 0:
|
|
237
|
-
|
|
236
|
+
d = Date.now() + p(4), v = Date.now() + f, k = o + "-" + c, w = this.storageHandler === void 0 ? a : this.storageHandler, l.label = 1;
|
|
238
237
|
case 1:
|
|
239
238
|
return Date.now() < v ? [4, s(30)] : [3, 8];
|
|
240
239
|
case 2:
|
|
241
|
-
return
|
|
240
|
+
return l.sent(), w.getItemSync(k) !== null ? [3, 5] : (I = this.id + "-" + c + "-" + d, [4, s(Math.floor(25 * Math.random()))]);
|
|
242
241
|
case 3:
|
|
243
|
-
return
|
|
242
|
+
return l.sent(), w.setItemSync(k, JSON.stringify({ id: this.id, iat: d, timeoutKey: I, timeAcquired: Date.now(), timeRefreshed: Date.now() })), [4, s(30)];
|
|
244
243
|
case 4:
|
|
245
|
-
return
|
|
244
|
+
return l.sent(), (_ = w.getItemSync(k)) !== null && (y = JSON.parse(_)).id === this.id && y.iat === d ? (this.acquiredIatSet.add(d), this.refreshLockWhileAcquired(k, d), [2, !0]) : [3, 7];
|
|
246
245
|
case 5:
|
|
247
246
|
return u.lockCorrector(this.storageHandler === void 0 ? a : this.storageHandler), [4, this.waitForSomethingToChange(v)];
|
|
248
247
|
case 6:
|
|
249
|
-
|
|
248
|
+
l.sent(), l.label = 7;
|
|
250
249
|
case 7:
|
|
251
|
-
return
|
|
250
|
+
return d = Date.now() + p(4), [3, 1];
|
|
252
251
|
case 8:
|
|
253
252
|
return [2, !1];
|
|
254
253
|
}
|
|
255
254
|
});
|
|
256
255
|
});
|
|
257
|
-
}, u.prototype.refreshLockWhileAcquired = function(c,
|
|
256
|
+
}, u.prototype.refreshLockWhileAcquired = function(c, f) {
|
|
258
257
|
return n(this, void 0, void 0, function() {
|
|
259
|
-
var
|
|
258
|
+
var d = this;
|
|
260
259
|
return r(this, function(v) {
|
|
261
260
|
return setTimeout(function() {
|
|
262
|
-
return n(
|
|
263
|
-
var
|
|
261
|
+
return n(d, void 0, void 0, function() {
|
|
262
|
+
var k, w, I;
|
|
264
263
|
return r(this, function(_) {
|
|
265
264
|
switch (_.label) {
|
|
266
265
|
case 0:
|
|
267
|
-
return [4, oe.default().lock(
|
|
266
|
+
return [4, oe.default().lock(f)];
|
|
268
267
|
case 1:
|
|
269
|
-
return _.sent(), this.acquiredIatSet.has(
|
|
268
|
+
return _.sent(), this.acquiredIatSet.has(f) ? (k = this.storageHandler === void 0 ? a : this.storageHandler, (w = k.getItemSync(c)) === null ? (oe.default().unlock(f), [2]) : ((I = JSON.parse(w)).timeRefreshed = Date.now(), k.setItemSync(c, JSON.stringify(I)), oe.default().unlock(f), this.refreshLockWhileAcquired(c, f), [2])) : (oe.default().unlock(f), [2]);
|
|
270
269
|
}
|
|
271
270
|
});
|
|
272
271
|
});
|
|
@@ -275,31 +274,31 @@ var ir = bt(kt(function(t, e) {
|
|
|
275
274
|
});
|
|
276
275
|
}, u.prototype.waitForSomethingToChange = function(c) {
|
|
277
276
|
return n(this, void 0, void 0, function() {
|
|
278
|
-
return r(this, function(
|
|
279
|
-
switch (
|
|
277
|
+
return r(this, function(f) {
|
|
278
|
+
switch (f.label) {
|
|
280
279
|
case 0:
|
|
281
|
-
return [4, new Promise(function(
|
|
282
|
-
var v = !1,
|
|
283
|
-
function
|
|
284
|
-
if (
|
|
280
|
+
return [4, new Promise(function(d) {
|
|
281
|
+
var v = !1, k = Date.now(), w = !1;
|
|
282
|
+
function I() {
|
|
283
|
+
if (w || (window.removeEventListener("storage", I), u.removeFromWaiting(I), clearTimeout(_), w = !0), !v) {
|
|
285
284
|
v = !0;
|
|
286
|
-
var
|
|
287
|
-
|
|
285
|
+
var y = 50 - (Date.now() - k);
|
|
286
|
+
y > 0 ? setTimeout(d, y) : d(null);
|
|
288
287
|
}
|
|
289
288
|
}
|
|
290
|
-
window.addEventListener("storage",
|
|
291
|
-
var _ = setTimeout(
|
|
289
|
+
window.addEventListener("storage", I), u.addToWaiting(I);
|
|
290
|
+
var _ = setTimeout(I, Math.max(0, c - Date.now()));
|
|
292
291
|
})];
|
|
293
292
|
case 1:
|
|
294
|
-
return
|
|
293
|
+
return f.sent(), [2];
|
|
295
294
|
}
|
|
296
295
|
});
|
|
297
296
|
});
|
|
298
297
|
}, u.addToWaiting = function(c) {
|
|
299
298
|
this.removeFromWaiting(c), u.waiters !== void 0 && u.waiters.push(c);
|
|
300
299
|
}, u.removeFromWaiting = function(c) {
|
|
301
|
-
u.waiters !== void 0 && (u.waiters = u.waiters.filter(function(
|
|
302
|
-
return
|
|
300
|
+
u.waiters !== void 0 && (u.waiters = u.waiters.filter(function(f) {
|
|
301
|
+
return f !== c;
|
|
303
302
|
}));
|
|
304
303
|
}, u.notifyWaiters = function() {
|
|
305
304
|
u.waiters !== void 0 && u.waiters.slice().forEach(function(c) {
|
|
@@ -307,143 +306,143 @@ var ir = bt(kt(function(t, e) {
|
|
|
307
306
|
});
|
|
308
307
|
}, u.prototype.releaseLock = function(c) {
|
|
309
308
|
return n(this, void 0, void 0, function() {
|
|
310
|
-
return r(this, function(
|
|
311
|
-
switch (
|
|
309
|
+
return r(this, function(f) {
|
|
310
|
+
switch (f.label) {
|
|
312
311
|
case 0:
|
|
313
312
|
return [4, this.releaseLock__private__(c)];
|
|
314
313
|
case 1:
|
|
315
|
-
return [2,
|
|
314
|
+
return [2, f.sent()];
|
|
316
315
|
}
|
|
317
316
|
});
|
|
318
317
|
});
|
|
319
318
|
}, u.prototype.releaseLock__private__ = function(c) {
|
|
320
319
|
return n(this, void 0, void 0, function() {
|
|
321
|
-
var
|
|
322
|
-
return r(this, function(
|
|
323
|
-
switch (
|
|
320
|
+
var f, d, v, k;
|
|
321
|
+
return r(this, function(w) {
|
|
322
|
+
switch (w.label) {
|
|
324
323
|
case 0:
|
|
325
|
-
return
|
|
324
|
+
return f = this.storageHandler === void 0 ? a : this.storageHandler, d = o + "-" + c, (v = f.getItemSync(d)) === null ? [2] : (k = JSON.parse(v)).id !== this.id ? [3, 2] : [4, oe.default().lock(k.iat)];
|
|
326
325
|
case 1:
|
|
327
|
-
|
|
326
|
+
w.sent(), this.acquiredIatSet.delete(k.iat), f.removeItemSync(d), oe.default().unlock(k.iat), u.notifyWaiters(), w.label = 2;
|
|
328
327
|
case 2:
|
|
329
328
|
return [2];
|
|
330
329
|
}
|
|
331
330
|
});
|
|
332
331
|
});
|
|
333
332
|
}, u.lockCorrector = function(c) {
|
|
334
|
-
for (var
|
|
335
|
-
var
|
|
336
|
-
if (
|
|
333
|
+
for (var f = Date.now() - 5e3, d = c, v = [], k = 0; ; ) {
|
|
334
|
+
var w = d.keySync(k);
|
|
335
|
+
if (w === null)
|
|
337
336
|
break;
|
|
338
|
-
v.push(
|
|
337
|
+
v.push(w), k++;
|
|
339
338
|
}
|
|
340
|
-
for (var
|
|
341
|
-
var
|
|
342
|
-
if (
|
|
343
|
-
var
|
|
344
|
-
if (
|
|
345
|
-
var b = JSON.parse(
|
|
346
|
-
(b.timeRefreshed === void 0 && b.timeAcquired <
|
|
339
|
+
for (var I = !1, _ = 0; _ < v.length; _++) {
|
|
340
|
+
var y = v[_];
|
|
341
|
+
if (y.includes(o)) {
|
|
342
|
+
var l = d.getItemSync(y);
|
|
343
|
+
if (l !== null) {
|
|
344
|
+
var b = JSON.parse(l);
|
|
345
|
+
(b.timeRefreshed === void 0 && b.timeAcquired < f || b.timeRefreshed !== void 0 && b.timeRefreshed < f) && (d.removeItemSync(y), I = !0);
|
|
347
346
|
}
|
|
348
347
|
}
|
|
349
348
|
}
|
|
350
|
-
|
|
349
|
+
I && u.notifyWaiters();
|
|
351
350
|
}, u.waiters = void 0, u;
|
|
352
351
|
}();
|
|
353
352
|
e.default = m;
|
|
354
353
|
}));
|
|
355
|
-
const
|
|
356
|
-
let
|
|
354
|
+
const yr = { timeoutInSeconds: 60 }, In = { name: "auth0-spa-js", version: "2.1.3" }, _n = () => Date.now();
|
|
355
|
+
let V = class wt extends Error {
|
|
357
356
|
constructor(e, n) {
|
|
358
|
-
super(n), this.error = e, this.error_description = n, Object.setPrototypeOf(this,
|
|
357
|
+
super(n), this.error = e, this.error_description = n, Object.setPrototypeOf(this, wt.prototype);
|
|
359
358
|
}
|
|
360
359
|
static fromPayload({ error: e, error_description: n }) {
|
|
361
|
-
return new
|
|
360
|
+
return new wt(e, n);
|
|
362
361
|
}
|
|
363
|
-
},
|
|
362
|
+
}, vr = class Sn extends V {
|
|
364
363
|
constructor(e, n, r, i = null) {
|
|
365
|
-
super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this,
|
|
364
|
+
super(e, n), this.state = r, this.appState = i, Object.setPrototypeOf(this, Sn.prototype);
|
|
366
365
|
}
|
|
367
|
-
},
|
|
366
|
+
}, bt = class En extends V {
|
|
368
367
|
constructor() {
|
|
369
|
-
super("timeout", "Timeout"), Object.setPrototypeOf(this,
|
|
368
|
+
super("timeout", "Timeout"), Object.setPrototypeOf(this, En.prototype);
|
|
370
369
|
}
|
|
371
|
-
},
|
|
370
|
+
}, wr = class On extends bt {
|
|
372
371
|
constructor(e) {
|
|
373
|
-
super(), this.popup = e, Object.setPrototypeOf(this,
|
|
372
|
+
super(), this.popup = e, Object.setPrototypeOf(this, On.prototype);
|
|
374
373
|
}
|
|
375
|
-
},
|
|
374
|
+
}, br = class Pn extends V {
|
|
376
375
|
constructor(e) {
|
|
377
|
-
super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this,
|
|
376
|
+
super("cancelled", "Popup closed"), this.popup = e, Object.setPrototypeOf(this, Pn.prototype);
|
|
378
377
|
}
|
|
379
|
-
},
|
|
378
|
+
}, kr = class Tn extends V {
|
|
380
379
|
constructor(e, n, r) {
|
|
381
|
-
super(e, n), this.mfa_token = r, Object.setPrototypeOf(this,
|
|
380
|
+
super(e, n), this.mfa_token = r, Object.setPrototypeOf(this, Tn.prototype);
|
|
382
381
|
}
|
|
383
|
-
},
|
|
382
|
+
}, jn = class xn extends V {
|
|
384
383
|
constructor(e, n) {
|
|
385
|
-
super("missing_refresh_token", `Missing Refresh Token (audience: '${
|
|
384
|
+
super("missing_refresh_token", `Missing Refresh Token (audience: '${Dt(e, ["default"])}', scope: '${Dt(n)}')`), this.audience = e, this.scope = n, Object.setPrototypeOf(this, xn.prototype);
|
|
386
385
|
}
|
|
387
386
|
};
|
|
388
|
-
function
|
|
387
|
+
function Dt(t, e = []) {
|
|
389
388
|
return t && !e.includes(t) ? t : "";
|
|
390
389
|
}
|
|
391
|
-
const
|
|
390
|
+
const Be = () => window.crypto, ut = () => {
|
|
392
391
|
const t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";
|
|
393
392
|
let e = "";
|
|
394
|
-
return Array.from(
|
|
395
|
-
},
|
|
396
|
-
var { clientId: e } = t, n =
|
|
393
|
+
return Array.from(Be().getRandomValues(new Uint8Array(43))).forEach((n) => e += t[n % t.length]), e;
|
|
394
|
+
}, Ut = (t) => btoa(t), kt = (t) => {
|
|
395
|
+
var { clientId: e } = t, n = Q(t, ["clientId"]);
|
|
397
396
|
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();
|
|
398
|
-
},
|
|
397
|
+
}, Rt = (t) => ((e) => decodeURIComponent(atob(e).split("").map((n) => "%" + ("00" + n.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g, "/").replace(/-/g, "+")), Ir = async (t, e) => {
|
|
399
398
|
const n = await fetch(t, e);
|
|
400
399
|
return { ok: n.ok, json: await n.json() };
|
|
401
|
-
},
|
|
400
|
+
}, _r = async (t, e, n) => {
|
|
402
401
|
const r = new AbortController();
|
|
403
402
|
let i;
|
|
404
|
-
return e.signal = r.signal, Promise.race([
|
|
403
|
+
return e.signal = r.signal, Promise.race([Ir(t, e), new Promise((o, a) => {
|
|
405
404
|
i = setTimeout(() => {
|
|
406
405
|
r.abort(), a(new Error("Timeout when executing 'fetch'"));
|
|
407
406
|
}, n);
|
|
408
407
|
})]).finally(() => {
|
|
409
408
|
clearTimeout(i);
|
|
410
409
|
});
|
|
411
|
-
},
|
|
412
|
-
return s = { auth: { audience: e, scope: n }, timeout: i, fetchUrl: t, fetchOptions: r, useFormData: a },
|
|
410
|
+
}, Sr = async (t, e, n, r, i, o, a) => {
|
|
411
|
+
return s = { auth: { audience: e, scope: n }, timeout: i, fetchUrl: t, fetchOptions: r, useFormData: a }, p = o, new Promise(function(m, u) {
|
|
413
412
|
const c = new MessageChannel();
|
|
414
|
-
c.port1.onmessage = function(
|
|
415
|
-
|
|
416
|
-
},
|
|
413
|
+
c.port1.onmessage = function(f) {
|
|
414
|
+
f.data.error ? u(new Error(f.data.error)) : m(f.data), c.port1.close();
|
|
415
|
+
}, p.postMessage(s, [c.port2]);
|
|
417
416
|
});
|
|
418
|
-
var s,
|
|
419
|
-
},
|
|
420
|
-
async function
|
|
421
|
-
var { baseUrl: n, timeout: r, audience: i, scope: o, auth0Client: a, useFormData: s } = t,
|
|
422
|
-
const m = s ?
|
|
423
|
-
return await async function(u, c,
|
|
424
|
-
let
|
|
425
|
-
for (let
|
|
417
|
+
var s, p;
|
|
418
|
+
}, Er = async (t, e, n, r, i, o, a = 1e4) => i ? Sr(t, e, n, r, a, i, o) : _r(t, r, a);
|
|
419
|
+
async function Or(t, e) {
|
|
420
|
+
var { baseUrl: n, timeout: r, audience: i, scope: o, auth0Client: a, useFormData: s } = t, p = Q(t, ["baseUrl", "timeout", "audience", "scope", "auth0Client", "useFormData"]);
|
|
421
|
+
const m = s ? kt(p) : JSON.stringify(p);
|
|
422
|
+
return await async function(u, c, f, d, v, k, w) {
|
|
423
|
+
let I, _ = null;
|
|
424
|
+
for (let j = 0; j < 3; j++)
|
|
426
425
|
try {
|
|
427
|
-
|
|
426
|
+
I = await Er(u, f, d, v, k, w, c), _ = null;
|
|
428
427
|
break;
|
|
429
|
-
} catch (
|
|
430
|
-
_ =
|
|
428
|
+
} catch (D) {
|
|
429
|
+
_ = D;
|
|
431
430
|
}
|
|
432
431
|
if (_)
|
|
433
432
|
throw _;
|
|
434
|
-
const
|
|
435
|
-
if (!
|
|
436
|
-
const
|
|
437
|
-
throw
|
|
433
|
+
const y = I.json, { error: l, error_description: b } = y, T = Q(y, ["error", "error_description"]), { ok: x } = I;
|
|
434
|
+
if (!x) {
|
|
435
|
+
const j = b || `HTTP error. Unable to fetch ${u}`;
|
|
436
|
+
throw l === "mfa_required" ? new kr(l, j, T.mfa_token) : l === "missing_refresh_token" ? new jn(f, d) : new V(l || "request_error", j);
|
|
438
437
|
}
|
|
439
|
-
return
|
|
440
|
-
}(`${n}/oauth/token`, r, i || "default", o, { method: "POST", body: m, headers: { "Content-Type": s ? "application/x-www-form-urlencoded" : "application/json", "Auth0-Client": btoa(JSON.stringify(a ||
|
|
438
|
+
return T;
|
|
439
|
+
}(`${n}/oauth/token`, r, i || "default", o, { method: "POST", body: m, headers: { "Content-Type": s ? "application/x-www-form-urlencoded" : "application/json", "Auth0-Client": btoa(JSON.stringify(a || In)) } }, e, s);
|
|
441
440
|
}
|
|
442
|
-
const
|
|
441
|
+
const Me = (...t) => {
|
|
443
442
|
return (e = t.filter(Boolean).join(" ").trim().split(/\s+/), Array.from(new Set(e))).join(" ");
|
|
444
443
|
var e;
|
|
445
444
|
};
|
|
446
|
-
let
|
|
445
|
+
let ue = class It {
|
|
447
446
|
constructor(e, n = "@@auth0spajs@@", r) {
|
|
448
447
|
this.prefix = n, this.suffix = r, this.clientId = e.clientId, this.scope = e.scope, this.audience = e.audience;
|
|
449
448
|
}
|
|
@@ -452,13 +451,13 @@ let ce = class gt {
|
|
|
452
451
|
}
|
|
453
452
|
static fromKey(e) {
|
|
454
453
|
const [n, r, i, o] = e.split("::");
|
|
455
|
-
return new
|
|
454
|
+
return new It({ clientId: r, scope: o, audience: i }, n);
|
|
456
455
|
}
|
|
457
456
|
static fromCacheEntry(e) {
|
|
458
457
|
const { scope: n, audience: r, client_id: i } = e;
|
|
459
|
-
return new
|
|
458
|
+
return new It({ scope: n, audience: r, clientId: i });
|
|
460
459
|
}
|
|
461
|
-
},
|
|
460
|
+
}, Pr = class {
|
|
462
461
|
set(e, n) {
|
|
463
462
|
localStorage.setItem(e, JSON.stringify(n));
|
|
464
463
|
}
|
|
@@ -477,7 +476,7 @@ let ce = class gt {
|
|
|
477
476
|
allKeys() {
|
|
478
477
|
return Object.keys(window.localStorage).filter((e) => e.startsWith("@@auth0spajs@@"));
|
|
479
478
|
}
|
|
480
|
-
},
|
|
479
|
+
}, Cn = class {
|
|
481
480
|
constructor() {
|
|
482
481
|
this.enclosedCache = /* @__PURE__ */ function() {
|
|
483
482
|
let e = {};
|
|
@@ -492,9 +491,9 @@ let ce = class gt {
|
|
|
492
491
|
}, allKeys: () => Object.keys(e) };
|
|
493
492
|
}();
|
|
494
493
|
}
|
|
495
|
-
},
|
|
494
|
+
}, Tr = class {
|
|
496
495
|
constructor(e, n, r) {
|
|
497
|
-
this.cache = e, this.keyManifest = n, this.nowProvider = r ||
|
|
496
|
+
this.cache = e, this.keyManifest = n, this.nowProvider = r || _n;
|
|
498
497
|
}
|
|
499
498
|
async setIdToken(e, n, r) {
|
|
500
499
|
var i;
|
|
@@ -517,8 +516,8 @@ let ce = class gt {
|
|
|
517
516
|
const s = await this.getCacheKeys();
|
|
518
517
|
if (!s)
|
|
519
518
|
return;
|
|
520
|
-
const
|
|
521
|
-
|
|
519
|
+
const p = this.matchExistingCacheKey(e, s);
|
|
520
|
+
p && (i = await this.cache.get(p));
|
|
522
521
|
}
|
|
523
522
|
if (!i)
|
|
524
523
|
return;
|
|
@@ -527,7 +526,7 @@ let ce = class gt {
|
|
|
527
526
|
}
|
|
528
527
|
async set(e) {
|
|
529
528
|
var n;
|
|
530
|
-
const r = new
|
|
529
|
+
const r = new ue({ clientId: e.client_id, scope: e.scope, audience: e.audience }), i = await this.wrapCacheEntry(e);
|
|
531
530
|
await this.cache.set(r.toKey(), i), await ((n = this.keyManifest) === null || n === void 0 ? void 0 : n.add(r.toKey()));
|
|
532
531
|
}
|
|
533
532
|
async clear(e) {
|
|
@@ -546,16 +545,16 @@ let ce = class gt {
|
|
|
546
545
|
return this.keyManifest ? (e = await this.keyManifest.get()) === null || e === void 0 ? void 0 : e.keys : this.cache.allKeys ? this.cache.allKeys() : void 0;
|
|
547
546
|
}
|
|
548
547
|
getIdTokenCacheKey(e) {
|
|
549
|
-
return new
|
|
548
|
+
return new ue({ clientId: e }, "@@auth0spajs@@", "@@user@@").toKey();
|
|
550
549
|
}
|
|
551
550
|
matchExistingCacheKey(e, n) {
|
|
552
551
|
return n.filter((r) => {
|
|
553
552
|
var i;
|
|
554
|
-
const o =
|
|
555
|
-
return o.prefix === "@@auth0spajs@@" && o.clientId === e.clientId && o.audience === e.audience &&
|
|
553
|
+
const o = ue.fromKey(r), a = new Set(o.scope && o.scope.split(" ")), s = ((i = e.scope) === null || i === void 0 ? void 0 : i.split(" ")) || [], p = o.scope && s.reduce((m, u) => m && a.has(u), !0);
|
|
554
|
+
return o.prefix === "@@auth0spajs@@" && o.clientId === e.clientId && o.audience === e.audience && p;
|
|
556
555
|
})[0];
|
|
557
556
|
}
|
|
558
|
-
},
|
|
557
|
+
}, jr = class {
|
|
559
558
|
constructor(e, n, r) {
|
|
560
559
|
this.storage = e, this.clientId = n, this.cookieDomain = r, this.storageKey = `a0.spajs.txs.${this.clientId}`;
|
|
561
560
|
}
|
|
@@ -569,17 +568,17 @@ let ce = class gt {
|
|
|
569
568
|
this.storage.remove(this.storageKey, { cookieDomain: this.cookieDomain });
|
|
570
569
|
}
|
|
571
570
|
};
|
|
572
|
-
const
|
|
571
|
+
const ze = (t) => typeof t == "number", xr = ["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"], Cr = (t) => {
|
|
573
572
|
if (!t.id_token)
|
|
574
573
|
throw new Error("ID token is required but missing");
|
|
575
574
|
const e = ((o) => {
|
|
576
|
-
const a = o.split("."), [s,
|
|
577
|
-
if (a.length !== 3 || !s || !
|
|
575
|
+
const a = o.split("."), [s, p, m] = a;
|
|
576
|
+
if (a.length !== 3 || !s || !p || !m)
|
|
578
577
|
throw new Error("ID token could not be decoded");
|
|
579
|
-
const u = JSON.parse(
|
|
580
|
-
return Object.keys(u).forEach((
|
|
581
|
-
c[
|
|
582
|
-
}), { encoded: { header: s, payload:
|
|
578
|
+
const u = JSON.parse(Rt(p)), c = { __raw: o }, f = {};
|
|
579
|
+
return Object.keys(u).forEach((d) => {
|
|
580
|
+
c[d] = u[d], xr.includes(d) || (f[d] = u[d]);
|
|
581
|
+
}), { encoded: { header: s, payload: p, signature: m }, header: JSON.parse(Rt(s)), claims: c, user: f };
|
|
583
582
|
})(t.id_token);
|
|
584
583
|
if (!e.claims.iss)
|
|
585
584
|
throw new Error("Issuer (iss) claim must be a string present in the ID token");
|
|
@@ -608,21 +607,21 @@ const Ee = (t) => typeof t == "number", yr = ["iss", "aud", "exp", "nbf", "iat",
|
|
|
608
607
|
if (e.claims.nonce !== t.nonce)
|
|
609
608
|
throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${t.nonce}", found "${e.claims.nonce}"`);
|
|
610
609
|
}
|
|
611
|
-
if (t.max_age && !
|
|
610
|
+
if (t.max_age && !ze(e.claims.auth_time))
|
|
612
611
|
throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");
|
|
613
|
-
if (e.claims.exp == null || !
|
|
612
|
+
if (e.claims.exp == null || !ze(e.claims.exp))
|
|
614
613
|
throw new Error("Expiration Time (exp) claim must be a number present in the ID token");
|
|
615
|
-
if (!
|
|
614
|
+
if (!ze(e.claims.iat))
|
|
616
615
|
throw new Error("Issued At (iat) claim must be a number present in the ID token");
|
|
617
616
|
const n = t.leeway || 60, r = new Date(t.now || Date.now()), i = /* @__PURE__ */ new Date(0);
|
|
618
617
|
if (i.setUTCSeconds(e.claims.exp + n), r > i)
|
|
619
618
|
throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${r}) is after expiration time (${i})`);
|
|
620
|
-
if (e.claims.nbf != null &&
|
|
619
|
+
if (e.claims.nbf != null && ze(e.claims.nbf)) {
|
|
621
620
|
const o = /* @__PURE__ */ new Date(0);
|
|
622
621
|
if (o.setUTCSeconds(e.claims.nbf - n), r < o)
|
|
623
622
|
throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${r}) is before ${o}`);
|
|
624
623
|
}
|
|
625
|
-
if (e.claims.auth_time != null &&
|
|
624
|
+
if (e.claims.auth_time != null && ze(e.claims.auth_time)) {
|
|
626
625
|
const o = /* @__PURE__ */ new Date(0);
|
|
627
626
|
if (o.setUTCSeconds(parseInt(e.claims.auth_time) + t.max_age + n), r > o)
|
|
628
627
|
throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${r}) is after last auth at ${o}`);
|
|
@@ -645,36 +644,36 @@ const Ee = (t) => typeof t == "number", yr = ["iss", "aud", "exp", "nbf", "iat",
|
|
|
645
644
|
}
|
|
646
645
|
return e;
|
|
647
646
|
};
|
|
648
|
-
var
|
|
649
|
-
var n =
|
|
650
|
-
return n = Object.assign || function(
|
|
647
|
+
var le = Tt(function(t, e) {
|
|
648
|
+
var n = se && se.__assign || function() {
|
|
649
|
+
return n = Object.assign || function(p) {
|
|
651
650
|
for (var m, u = 1, c = arguments.length; u < c; u++)
|
|
652
|
-
for (var
|
|
653
|
-
Object.prototype.hasOwnProperty.call(m,
|
|
654
|
-
return
|
|
651
|
+
for (var f in m = arguments[u])
|
|
652
|
+
Object.prototype.hasOwnProperty.call(m, f) && (p[f] = m[f]);
|
|
653
|
+
return p;
|
|
655
654
|
}, n.apply(this, arguments);
|
|
656
655
|
};
|
|
657
|
-
function r(
|
|
656
|
+
function r(p, m) {
|
|
658
657
|
if (!m)
|
|
659
658
|
return "";
|
|
660
|
-
var u = "; " +
|
|
659
|
+
var u = "; " + p;
|
|
661
660
|
return m === !0 ? u : u + "=" + m;
|
|
662
661
|
}
|
|
663
|
-
function i(
|
|
664
|
-
return encodeURIComponent(
|
|
662
|
+
function i(p, m, u) {
|
|
663
|
+
return encodeURIComponent(p).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/\(/g, "%28").replace(/\)/g, "%29") + "=" + encodeURIComponent(m).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent) + function(c) {
|
|
665
664
|
if (typeof c.expires == "number") {
|
|
666
|
-
var
|
|
667
|
-
|
|
665
|
+
var f = /* @__PURE__ */ new Date();
|
|
666
|
+
f.setMilliseconds(f.getMilliseconds() + 864e5 * c.expires), c.expires = f;
|
|
668
667
|
}
|
|
669
668
|
return r("Expires", c.expires ? c.expires.toUTCString() : "") + r("Domain", c.domain) + r("Path", c.path) + r("Secure", c.secure) + r("SameSite", c.sameSite);
|
|
670
669
|
}(u);
|
|
671
670
|
}
|
|
672
|
-
function o(
|
|
673
|
-
for (var m = {}, u =
|
|
674
|
-
var
|
|
671
|
+
function o(p) {
|
|
672
|
+
for (var m = {}, u = p ? p.split("; ") : [], c = /(%[\dA-F]{2})+/gi, f = 0; f < u.length; f++) {
|
|
673
|
+
var d = u[f].split("="), v = d.slice(1).join("=");
|
|
675
674
|
v.charAt(0) === '"' && (v = v.slice(1, -1));
|
|
676
675
|
try {
|
|
677
|
-
m[
|
|
676
|
+
m[d[0].replace(c, decodeURIComponent)] = v.replace(c, decodeURIComponent);
|
|
678
677
|
} catch {
|
|
679
678
|
}
|
|
680
679
|
}
|
|
@@ -683,36 +682,36 @@ var ue = kt(function(t, e) {
|
|
|
683
682
|
function a() {
|
|
684
683
|
return o(document.cookie);
|
|
685
684
|
}
|
|
686
|
-
function s(
|
|
687
|
-
document.cookie = i(
|
|
685
|
+
function s(p, m, u) {
|
|
686
|
+
document.cookie = i(p, m, n({ path: "/" }, u));
|
|
688
687
|
}
|
|
689
|
-
e.__esModule = !0, e.encode = i, e.parse = o, e.getAll = a, e.get = function(
|
|
690
|
-
return a()[
|
|
691
|
-
}, e.set = s, e.remove = function(
|
|
692
|
-
s(
|
|
688
|
+
e.__esModule = !0, e.encode = i, e.parse = o, e.getAll = a, e.get = function(p) {
|
|
689
|
+
return a()[p];
|
|
690
|
+
}, e.set = s, e.remove = function(p, m) {
|
|
691
|
+
s(p, "", n(n({}, m), { expires: -1 }));
|
|
693
692
|
};
|
|
694
693
|
});
|
|
695
|
-
|
|
696
|
-
var
|
|
697
|
-
const
|
|
698
|
-
const e =
|
|
694
|
+
Pt(le), le.encode, le.parse, le.getAll;
|
|
695
|
+
var $r = le.get, $n = le.set, zn = le.remove;
|
|
696
|
+
const we = { get(t) {
|
|
697
|
+
const e = $r(t);
|
|
699
698
|
if (e !== void 0)
|
|
700
699
|
return JSON.parse(e);
|
|
701
700
|
}, save(t, e, n) {
|
|
702
701
|
let r = {};
|
|
703
|
-
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),
|
|
702
|
+
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), $n(t, JSON.stringify(e), r);
|
|
704
703
|
}, remove(t, e) {
|
|
705
704
|
let n = {};
|
|
706
|
-
e != null && e.cookieDomain && (n.domain = e.cookieDomain),
|
|
707
|
-
} },
|
|
708
|
-
return
|
|
705
|
+
e != null && e.cookieDomain && (n.domain = e.cookieDomain), zn(t, n);
|
|
706
|
+
} }, zr = { get(t) {
|
|
707
|
+
return we.get(t) || we.get(`_legacy_${t}`);
|
|
709
708
|
}, save(t, e, n) {
|
|
710
709
|
let r = {};
|
|
711
|
-
window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain),
|
|
710
|
+
window.location.protocol === "https:" && (r = { secure: !0 }), n != null && n.daysUntilExpire && (r.expires = n.daysUntilExpire), n != null && n.cookieDomain && (r.domain = n.cookieDomain), $n(`_legacy_${t}`, JSON.stringify(e), r), we.save(t, e, n);
|
|
712
711
|
}, remove(t, e) {
|
|
713
712
|
let n = {};
|
|
714
|
-
e != null && e.cookieDomain && (n.domain = e.cookieDomain),
|
|
715
|
-
} },
|
|
713
|
+
e != null && e.cookieDomain && (n.domain = e.cookieDomain), zn(t, n), we.remove(t, e), we.remove(`_legacy_${t}`, e);
|
|
714
|
+
} }, Ar = { get(t) {
|
|
716
715
|
if (typeof sessionStorage > "u")
|
|
717
716
|
return;
|
|
718
717
|
const e = sessionStorage.getItem(t);
|
|
@@ -722,12 +721,12 @@ const pe = { get(t) {
|
|
|
722
721
|
}, remove(t) {
|
|
723
722
|
sessionStorage.removeItem(t);
|
|
724
723
|
} };
|
|
725
|
-
function
|
|
726
|
-
var r = e === void 0 ? null : e, i = function(
|
|
727
|
-
var u = atob(
|
|
724
|
+
function Nr(t, e, n) {
|
|
725
|
+
var r = e === void 0 ? null : e, i = function(p, m) {
|
|
726
|
+
var u = atob(p);
|
|
728
727
|
if (m) {
|
|
729
|
-
for (var c = new Uint8Array(u.length),
|
|
730
|
-
c[
|
|
728
|
+
for (var c = new Uint8Array(u.length), f = 0, d = u.length; f < d; ++f)
|
|
729
|
+
c[f] = u.charCodeAt(f);
|
|
731
730
|
return String.fromCharCode.apply(null, new Uint16Array(c.buffer));
|
|
732
731
|
}
|
|
733
732
|
return u;
|
|
@@ -735,11 +734,11 @@ function Sr(t, e, n) {
|
|
|
735
734
|
`, 10) + 1, a = i.substring(o) + (r ? "//# sourceMappingURL=" + r : ""), s = new Blob([a], { type: "application/javascript" });
|
|
736
735
|
return URL.createObjectURL(s);
|
|
737
736
|
}
|
|
738
|
-
var
|
|
739
|
-
return
|
|
737
|
+
var Zt, Wt, Kt, lt, Lr = (Zt = "Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=", Wt = null, Kt = !1, function(t) {
|
|
738
|
+
return lt = lt || Nr(Zt, Wt, Kt), new Worker(lt, t);
|
|
740
739
|
});
|
|
741
|
-
const
|
|
742
|
-
let
|
|
740
|
+
const dt = {};
|
|
741
|
+
let Dr = class {
|
|
743
742
|
constructor(e, n) {
|
|
744
743
|
this.cache = e, this.clientId = n, this.manifestKey = this.createManifestKeyFrom(this.clientId);
|
|
745
744
|
}
|
|
@@ -765,85 +764,85 @@ let Or = class {
|
|
|
765
764
|
return `@@auth0spajs@@::${e}`;
|
|
766
765
|
}
|
|
767
766
|
};
|
|
768
|
-
const
|
|
769
|
-
const { openUrl: e, onRedirect: n } = t, r =
|
|
767
|
+
const Ur = { memory: () => new Cn().enclosedCache, localstorage: () => new Pr() }, Mt = (t) => Ur[t], Xt = (t) => {
|
|
768
|
+
const { openUrl: e, onRedirect: n } = t, r = Q(t, ["openUrl", "onRedirect"]);
|
|
770
769
|
return Object.assign(Object.assign({}, r), { openUrl: e === !1 || e ? e : n });
|
|
771
|
-
},
|
|
772
|
-
let
|
|
770
|
+
}, ht = new gr();
|
|
771
|
+
let Rr = class {
|
|
773
772
|
constructor(e) {
|
|
774
773
|
let n, r;
|
|
775
|
-
if (this.userCache = new
|
|
776
|
-
await
|
|
774
|
+
if (this.userCache = new Cn().enclosedCache, this.defaultOptions = { authorizationParams: { scope: "openid profile email" }, useRefreshTokensFallback: !1, useFormData: !0 }, this._releaseLockOnPageHide = async () => {
|
|
775
|
+
await ht.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
|
|
777
776
|
}, this.options = Object.assign(Object.assign(Object.assign({}, this.defaultOptions), e), { authorizationParams: Object.assign(Object.assign({}, this.defaultOptions.authorizationParams), e.authorizationParams) }), typeof window < "u" && (() => {
|
|
778
|
-
if (!
|
|
777
|
+
if (!Be())
|
|
779
778
|
throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");
|
|
780
|
-
if (
|
|
779
|
+
if (Be().subtle === void 0)
|
|
781
780
|
throw new Error(`
|
|
782
781
|
auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
|
|
783
782
|
`);
|
|
784
783
|
})(), 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)
|
|
785
784
|
r = e.cache;
|
|
786
785
|
else {
|
|
787
|
-
if (n = e.cacheLocation || "memory", !
|
|
786
|
+
if (n = e.cacheLocation || "memory", !Mt(n))
|
|
788
787
|
throw new Error(`Invalid cache location "${n}"`);
|
|
789
|
-
r =
|
|
788
|
+
r = Mt(n)();
|
|
790
789
|
}
|
|
791
|
-
this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ?
|
|
792
|
-
const i = e.useCookiesForTransactions ? this.cookieStorage :
|
|
790
|
+
this.httpTimeoutMs = e.httpTimeoutInSeconds ? 1e3 * e.httpTimeoutInSeconds : 1e4, this.cookieStorage = e.legacySameSiteCookie === !1 ? we : zr, this.orgHintCookieName = `auth0.${this.options.clientId}.organization_hint`, this.isAuthenticatedCookieName = ((a) => `auth0.${a}.is.authenticated`)(this.options.clientId), this.sessionCheckExpiryDays = e.sessionCheckExpiryDays || 1;
|
|
791
|
+
const i = e.useCookiesForTransactions ? this.cookieStorage : Ar;
|
|
793
792
|
var o;
|
|
794
|
-
this.scope =
|
|
793
|
+
this.scope = Me("openid", this.options.authorizationParams.scope, this.options.useRefreshTokens ? "offline_access" : ""), this.transactionManager = new jr(i, this.options.clientId, this.options.cookieDomain), this.nowProvider = this.options.nowProvider || _n, this.cacheManager = new Tr(r, r.allKeys ? void 0 : new Dr(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 Lr());
|
|
795
794
|
}
|
|
796
795
|
_url(e) {
|
|
797
|
-
const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client ||
|
|
796
|
+
const n = encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client || In)));
|
|
798
797
|
return `${this.domainUrl}${e}&auth0Client=${n}`;
|
|
799
798
|
}
|
|
800
799
|
_authorizeUrl(e) {
|
|
801
|
-
return this._url(`/authorize?${
|
|
800
|
+
return this._url(`/authorize?${kt(e)}`);
|
|
802
801
|
}
|
|
803
802
|
async _verifyIdToken(e, n, r) {
|
|
804
803
|
const i = await this.nowProvider();
|
|
805
|
-
return
|
|
804
|
+
return Cr({ 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 });
|
|
806
805
|
var o;
|
|
807
806
|
}
|
|
808
807
|
_processOrgHint(e) {
|
|
809
808
|
e ? this.cookieStorage.save(this.orgHintCookieName, e, { daysUntilExpire: this.sessionCheckExpiryDays, cookieDomain: this.options.cookieDomain }) : this.cookieStorage.remove(this.orgHintCookieName, { cookieDomain: this.options.cookieDomain });
|
|
810
809
|
}
|
|
811
810
|
async _prepareAuthorizeUrl(e, n, r) {
|
|
812
|
-
const i =
|
|
811
|
+
const i = Ut(ut()), o = Ut(ut()), a = ut(), s = ((u) => {
|
|
813
812
|
const c = new Uint8Array(u);
|
|
814
|
-
return ((
|
|
815
|
-
const
|
|
816
|
-
return
|
|
813
|
+
return ((f) => {
|
|
814
|
+
const d = { "+": "-", "/": "_", "=": "" };
|
|
815
|
+
return f.replace(/[+/=]/g, (v) => d[v]);
|
|
817
816
|
})(window.btoa(String.fromCharCode(...Array.from(c))));
|
|
818
|
-
})(await (async (u) => await
|
|
819
|
-
return { nonce: o, code_verifier: a, scope:
|
|
817
|
+
})(await (async (u) => await Be().subtle.digest({ name: "SHA-256" }, new TextEncoder().encode(u)))(a)), p = ((u, c, f, d, v, k, w, I) => Object.assign(Object.assign(Object.assign({ client_id: u.clientId }, u.authorizationParams), f), { scope: Me(c, f.scope), response_type: "code", response_mode: I || "query", state: d, nonce: v, redirect_uri: w || 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), m = this._authorizeUrl(p);
|
|
818
|
+
return { nonce: o, code_verifier: a, scope: p.scope, audience: p.audience || "default", redirect_uri: p.redirect_uri, state: i, url: m };
|
|
820
819
|
}
|
|
821
820
|
async loginWithPopup(e, n) {
|
|
822
821
|
var r;
|
|
823
822
|
if (e = e || {}, !(n = n || {}).popup && (n.popup = ((s) => {
|
|
824
|
-
const
|
|
825
|
-
return window.open(s, "auth0:authorize:popup", `left=${
|
|
823
|
+
const p = window.screenX + (window.innerWidth - 400) / 2, m = window.screenY + (window.innerHeight - 600) / 2;
|
|
824
|
+
return window.open(s, "auth0:authorize:popup", `left=${p},top=${m},width=400,height=600,resizable,scrollbars=yes,status=1`);
|
|
826
825
|
})(""), !n.popup))
|
|
827
826
|
throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");
|
|
828
827
|
const i = await this._prepareAuthorizeUrl(e.authorizationParams || {}, { response_mode: "web_message" }, window.location.origin);
|
|
829
828
|
n.popup.location.href = i.url;
|
|
830
|
-
const o = await ((s) => new Promise((
|
|
829
|
+
const o = await ((s) => new Promise((p, m) => {
|
|
831
830
|
let u;
|
|
832
831
|
const c = setInterval(() => {
|
|
833
|
-
s.popup && s.popup.closed && (clearInterval(c), clearTimeout(
|
|
834
|
-
}, 1e3),
|
|
835
|
-
clearInterval(c), m(new
|
|
832
|
+
s.popup && s.popup.closed && (clearInterval(c), clearTimeout(f), window.removeEventListener("message", u, !1), m(new br(s.popup)));
|
|
833
|
+
}, 1e3), f = setTimeout(() => {
|
|
834
|
+
clearInterval(c), m(new wr(s.popup)), window.removeEventListener("message", u, !1);
|
|
836
835
|
}, 1e3 * (s.timeoutInSeconds || 60));
|
|
837
|
-
u = function(
|
|
838
|
-
if (
|
|
839
|
-
if (clearTimeout(
|
|
840
|
-
return m(
|
|
841
|
-
|
|
836
|
+
u = function(d) {
|
|
837
|
+
if (d.data && d.data.type === "authorization_response") {
|
|
838
|
+
if (clearTimeout(f), clearInterval(c), window.removeEventListener("message", u, !1), s.popup.close(), d.data.response.error)
|
|
839
|
+
return m(V.fromPayload(d.data.response));
|
|
840
|
+
p(d.data.response);
|
|
842
841
|
}
|
|
843
842
|
}, window.addEventListener("message", u);
|
|
844
843
|
}))(Object.assign(Object.assign({}, n), { timeoutInSeconds: n.timeoutInSeconds || this.options.authorizeTimeoutInSeconds || 60 }));
|
|
845
844
|
if (i.state !== o.state)
|
|
846
|
-
throw new
|
|
845
|
+
throw new V("state_mismatch", "Invalid state");
|
|
847
846
|
const a = ((r = e.authorizationParams) === null || r === void 0 ? void 0 : r.organization) || this.options.authorizationParams.organization;
|
|
848
847
|
await this._requestToken({ audience: i.audience, scope: i.scope, code_verifier: i.code_verifier, grant_type: "authorization_code", code: o.code, redirect_uri: i.redirect_uri }, { nonceIn: i.nonce, organization: a });
|
|
849
848
|
}
|
|
@@ -859,10 +858,10 @@ let Er = class {
|
|
|
859
858
|
}
|
|
860
859
|
async loginWithRedirect(e = {}) {
|
|
861
860
|
var n;
|
|
862
|
-
const r =
|
|
863
|
-
this.transactionManager.create(Object.assign(Object.assign(Object.assign({}, c), { appState: a }),
|
|
864
|
-
const
|
|
865
|
-
i ? await i(
|
|
861
|
+
const r = Xt(e), { openUrl: i, fragment: o, appState: a } = r, s = Q(r, ["openUrl", "fragment", "appState"]), p = ((n = s.authorizationParams) === null || n === void 0 ? void 0 : n.organization) || this.options.authorizationParams.organization, m = await this._prepareAuthorizeUrl(s.authorizationParams || {}), { url: u } = m, c = Q(m, ["url"]);
|
|
862
|
+
this.transactionManager.create(Object.assign(Object.assign(Object.assign({}, c), { appState: a }), p && { organization: p }));
|
|
863
|
+
const f = o ? `${u}#${o}` : u;
|
|
864
|
+
i ? await i(f) : window.location.assign(f);
|
|
866
865
|
}
|
|
867
866
|
async handleRedirectCallback(e = window.location.href) {
|
|
868
867
|
const n = e.split("?").slice(1);
|
|
@@ -870,17 +869,17 @@ let Er = class {
|
|
|
870
869
|
throw new Error("There are no query params available for parsing.");
|
|
871
870
|
const { state: r, code: i, error: o, error_description: a } = ((c) => {
|
|
872
871
|
c.indexOf("#") > -1 && (c = c.substring(0, c.indexOf("#")));
|
|
873
|
-
const
|
|
874
|
-
return { state:
|
|
872
|
+
const f = new URLSearchParams(c);
|
|
873
|
+
return { state: f.get("state"), code: f.get("code") || void 0, error: f.get("error") || void 0, error_description: f.get("error_description") || void 0 };
|
|
875
874
|
})(n.join("")), s = this.transactionManager.get();
|
|
876
875
|
if (!s)
|
|
877
|
-
throw new
|
|
876
|
+
throw new V("missing_transaction", "Invalid state");
|
|
878
877
|
if (this.transactionManager.remove(), o)
|
|
879
|
-
throw new
|
|
878
|
+
throw new vr(o, a || o, r, s.appState);
|
|
880
879
|
if (!s.code_verifier || s.state && s.state !== r)
|
|
881
|
-
throw new
|
|
882
|
-
const
|
|
883
|
-
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: m, organization:
|
|
880
|
+
throw new V("state_mismatch", "Invalid state");
|
|
881
|
+
const p = s.organization, m = s.nonce, u = s.redirect_uri;
|
|
882
|
+
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: m, organization: p }), { appState: s.appState };
|
|
884
883
|
}
|
|
885
884
|
async checkSession(e) {
|
|
886
885
|
if (!this.cookieStorage.get(this.isAuthenticatedCookieName)) {
|
|
@@ -895,16 +894,16 @@ let Er = class {
|
|
|
895
894
|
}
|
|
896
895
|
async getTokenSilently(e = {}) {
|
|
897
896
|
var n;
|
|
898
|
-
const r = Object.assign(Object.assign({ cacheMode: "on" }, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope:
|
|
899
|
-
let s =
|
|
897
|
+
const r = Object.assign(Object.assign({ cacheMode: "on" }, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: Me(this.scope, (n = e.authorizationParams) === null || n === void 0 ? void 0 : n.scope) }) }), i = await ((o, a) => {
|
|
898
|
+
let s = dt[a];
|
|
900
899
|
return s || (s = o().finally(() => {
|
|
901
|
-
delete
|
|
902
|
-
}),
|
|
900
|
+
delete dt[a], s = null;
|
|
901
|
+
}), dt[a] = s), s;
|
|
903
902
|
})(() => this._getTokenSilently(r), `${this.options.clientId}::${r.authorizationParams.audience}::${r.authorizationParams.scope}`);
|
|
904
903
|
return e.detailedResponse ? i : i == null ? void 0 : i.access_token;
|
|
905
904
|
}
|
|
906
905
|
async _getTokenSilently(e) {
|
|
907
|
-
const { cacheMode: n } = e, r =
|
|
906
|
+
const { cacheMode: n } = e, r = Q(e, ["cacheMode"]);
|
|
908
907
|
if (n !== "off") {
|
|
909
908
|
const i = await this._getEntryFromCache({ scope: r.authorizationParams.scope, audience: r.authorizationParams.audience || "default", clientId: this.options.clientId });
|
|
910
909
|
if (i)
|
|
@@ -916,36 +915,36 @@ let Er = class {
|
|
|
916
915
|
if (await i())
|
|
917
916
|
return !0;
|
|
918
917
|
return !1;
|
|
919
|
-
})(() =>
|
|
920
|
-
throw new
|
|
918
|
+
})(() => ht.acquireLock("auth0.lock.getTokenSilently", 5e3), 10))
|
|
919
|
+
throw new bt();
|
|
921
920
|
try {
|
|
922
921
|
if (window.addEventListener("pagehide", this._releaseLockOnPageHide), n !== "off") {
|
|
923
922
|
const m = await this._getEntryFromCache({ scope: r.authorizationParams.scope, audience: r.authorizationParams.audience || "default", clientId: this.options.clientId });
|
|
924
923
|
if (m)
|
|
925
924
|
return m;
|
|
926
925
|
}
|
|
927
|
-
const i = this.options.useRefreshTokens ? await this._getTokenUsingRefreshToken(r) : await this._getTokenFromIFrame(r), { id_token: o, access_token: a, oauthTokenScope: s, expires_in:
|
|
928
|
-
return Object.assign(Object.assign({ id_token: o, access_token: a }, s ? { scope: s } : null), { expires_in:
|
|
926
|
+
const i = this.options.useRefreshTokens ? await this._getTokenUsingRefreshToken(r) : await this._getTokenFromIFrame(r), { id_token: o, access_token: a, oauthTokenScope: s, expires_in: p } = i;
|
|
927
|
+
return Object.assign(Object.assign({ id_token: o, access_token: a }, s ? { scope: s } : null), { expires_in: p });
|
|
929
928
|
} finally {
|
|
930
|
-
await
|
|
929
|
+
await ht.releaseLock("auth0.lock.getTokenSilently"), window.removeEventListener("pagehide", this._releaseLockOnPageHide);
|
|
931
930
|
}
|
|
932
931
|
}
|
|
933
932
|
}
|
|
934
933
|
async getTokenWithPopup(e = {}, n = {}) {
|
|
935
934
|
var r;
|
|
936
|
-
const i = Object.assign(Object.assign({}, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope:
|
|
937
|
-
return n = Object.assign(Object.assign({},
|
|
935
|
+
const i = Object.assign(Object.assign({}, e), { authorizationParams: Object.assign(Object.assign(Object.assign({}, this.options.authorizationParams), e.authorizationParams), { scope: Me(this.scope, (r = e.authorizationParams) === null || r === void 0 ? void 0 : r.scope) }) });
|
|
936
|
+
return n = Object.assign(Object.assign({}, yr), n), await this.loginWithPopup(i, n), (await this.cacheManager.get(new ue({ scope: i.authorizationParams.scope, audience: i.authorizationParams.audience || "default", clientId: this.options.clientId }))).access_token;
|
|
938
937
|
}
|
|
939
938
|
async isAuthenticated() {
|
|
940
939
|
return !!await this.getUser();
|
|
941
940
|
}
|
|
942
941
|
_buildLogoutUrl(e) {
|
|
943
942
|
e.clientId !== null ? e.clientId = e.clientId || this.options.clientId : delete e.clientId;
|
|
944
|
-
const n = e.logoutParams || {}, { federated: r } = n, i =
|
|
945
|
-
return this._url(`/v2/logout?${
|
|
943
|
+
const n = e.logoutParams || {}, { federated: r } = n, i = Q(n, ["federated"]), o = r ? "&federated" : "";
|
|
944
|
+
return this._url(`/v2/logout?${kt(Object.assign({ clientId: e.clientId }, i))}`) + o;
|
|
946
945
|
}
|
|
947
946
|
async logout(e = {}) {
|
|
948
|
-
const n =
|
|
947
|
+
const n = Xt(e), { openUrl: r } = n, i = Q(n, ["openUrl"]);
|
|
949
948
|
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@@");
|
|
950
949
|
const o = this._buildLogoutUrl(i);
|
|
951
950
|
r ? await r(o) : r !== !1 && window.location.assign(o);
|
|
@@ -953,41 +952,41 @@ let Er = class {
|
|
|
953
952
|
async _getTokenFromIFrame(e) {
|
|
954
953
|
const n = Object.assign(Object.assign({}, e.authorizationParams), { prompt: "none" }), r = this.cookieStorage.get(this.orgHintCookieName);
|
|
955
954
|
r && !n.organization && (n.organization = r);
|
|
956
|
-
const { url: i, state: o, nonce: a, code_verifier: s, redirect_uri:
|
|
955
|
+
const { url: i, state: o, nonce: a, code_verifier: s, redirect_uri: p, scope: m, audience: u } = await this._prepareAuthorizeUrl(n, { response_mode: "web_message" }, window.location.origin);
|
|
957
956
|
try {
|
|
958
957
|
if (window.crossOriginIsolated)
|
|
959
|
-
throw new
|
|
960
|
-
const c = e.timeoutInSeconds || this.options.authorizeTimeoutInSeconds,
|
|
961
|
-
const
|
|
962
|
-
|
|
963
|
-
const
|
|
964
|
-
window.document.body.contains(
|
|
958
|
+
throw new V("login_required", "The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");
|
|
959
|
+
const c = e.timeoutInSeconds || this.options.authorizeTimeoutInSeconds, f = await ((v, k, w = 60) => new Promise((I, _) => {
|
|
960
|
+
const y = window.document.createElement("iframe");
|
|
961
|
+
y.setAttribute("width", "0"), y.setAttribute("height", "0"), y.style.display = "none";
|
|
962
|
+
const l = () => {
|
|
963
|
+
window.document.body.contains(y) && (window.document.body.removeChild(y), window.removeEventListener("message", b, !1));
|
|
965
964
|
};
|
|
966
965
|
let b;
|
|
967
|
-
const
|
|
968
|
-
_(new
|
|
969
|
-
}, 1e3 *
|
|
970
|
-
b = function(
|
|
971
|
-
if (
|
|
966
|
+
const T = setTimeout(() => {
|
|
967
|
+
_(new bt()), l();
|
|
968
|
+
}, 1e3 * w);
|
|
969
|
+
b = function(x) {
|
|
970
|
+
if (x.origin != k || !x.data || x.data.type !== "authorization_response")
|
|
972
971
|
return;
|
|
973
|
-
const
|
|
974
|
-
|
|
975
|
-
}, window.addEventListener("message", b, !1), window.document.body.appendChild(
|
|
972
|
+
const j = x.source;
|
|
973
|
+
j && j.close(), x.data.response.error ? _(V.fromPayload(x.data.response)) : I(x.data.response), clearTimeout(T), window.removeEventListener("message", b, !1), setTimeout(l, 2e3);
|
|
974
|
+
}, window.addEventListener("message", b, !1), window.document.body.appendChild(y), y.setAttribute("src", v);
|
|
976
975
|
}))(i, this.domainUrl, c);
|
|
977
|
-
if (o !==
|
|
978
|
-
throw new
|
|
979
|
-
const
|
|
980
|
-
return Object.assign(Object.assign({},
|
|
976
|
+
if (o !== f.state)
|
|
977
|
+
throw new V("state_mismatch", "Invalid state");
|
|
978
|
+
const d = await this._requestToken(Object.assign(Object.assign({}, e.authorizationParams), { code_verifier: s, code: f.code, grant_type: "authorization_code", redirect_uri: p, timeout: e.authorizationParams.timeout || this.httpTimeoutMs }), { nonceIn: a, organization: n.organization });
|
|
979
|
+
return Object.assign(Object.assign({}, d), { scope: m, oauthTokenScope: d.scope, audience: u });
|
|
981
980
|
} catch (c) {
|
|
982
981
|
throw c.error === "login_required" && this.logout({ openUrl: !1 }), c;
|
|
983
982
|
}
|
|
984
983
|
}
|
|
985
984
|
async _getTokenUsingRefreshToken(e) {
|
|
986
|
-
const n = await this.cacheManager.get(new
|
|
985
|
+
const n = await this.cacheManager.get(new ue({ scope: e.authorizationParams.scope, audience: e.authorizationParams.audience || "default", clientId: this.options.clientId }));
|
|
987
986
|
if (!(n && n.refresh_token || this.worker)) {
|
|
988
987
|
if (this.options.useRefreshTokensFallback)
|
|
989
988
|
return await this._getTokenFromIFrame(e);
|
|
990
|
-
throw new
|
|
989
|
+
throw new jn(e.authorizationParams.audience || "default", e.authorizationParams.scope);
|
|
991
990
|
}
|
|
992
991
|
const r = e.authorizationParams.redirect_uri || this.options.authorizationParams.redirect_uri || window.location.origin, i = typeof e.timeoutInSeconds == "number" ? 1e3 * e.timeoutInSeconds : null;
|
|
993
992
|
try {
|
|
@@ -1000,196 +999,522 @@ let Er = class {
|
|
|
1000
999
|
}
|
|
1001
1000
|
}
|
|
1002
1001
|
async _saveEntryInCache(e) {
|
|
1003
|
-
const { id_token: n, decodedToken: r } = e, i =
|
|
1002
|
+
const { id_token: n, decodedToken: r } = e, i = Q(e, ["id_token", "decodedToken"]);
|
|
1004
1003
|
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);
|
|
1005
1004
|
}
|
|
1006
1005
|
async _getIdTokenFromCache() {
|
|
1007
|
-
const e = this.options.authorizationParams.audience || "default", n = await this.cacheManager.getIdToken(new
|
|
1006
|
+
const e = this.options.authorizationParams.audience || "default", n = await this.cacheManager.getIdToken(new ue({ clientId: this.options.clientId, audience: e, scope: this.scope })), r = this.userCache.get("@@user@@");
|
|
1008
1007
|
return n && n.id_token === (r == null ? void 0 : r.id_token) ? r : (this.userCache.set("@@user@@", n), n);
|
|
1009
1008
|
}
|
|
1010
1009
|
async _getEntryFromCache({ scope: e, audience: n, clientId: r }) {
|
|
1011
|
-
const i = await this.cacheManager.get(new
|
|
1010
|
+
const i = await this.cacheManager.get(new ue({ scope: e, audience: n, clientId: r }), 60);
|
|
1012
1011
|
if (i && i.access_token) {
|
|
1013
|
-
const { access_token: o, oauthTokenScope: a, expires_in: s } = i,
|
|
1014
|
-
return
|
|
1012
|
+
const { access_token: o, oauthTokenScope: a, expires_in: s } = i, p = await this._getIdTokenFromCache();
|
|
1013
|
+
return p && Object.assign(Object.assign({ id_token: p.id_token, access_token: o }, a ? { scope: a } : null), { expires_in: s });
|
|
1015
1014
|
}
|
|
1016
1015
|
}
|
|
1017
1016
|
async _requestToken(e, n) {
|
|
1018
|
-
const { nonceIn: r, organization: i } = n || {}, o = await
|
|
1017
|
+
const { nonceIn: r, organization: i } = n || {}, o = await Or(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);
|
|
1019
1018
|
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 });
|
|
1020
1019
|
}
|
|
1021
1020
|
};
|
|
1022
|
-
async function
|
|
1023
|
-
const e = new
|
|
1021
|
+
async function Zr(t) {
|
|
1022
|
+
const e = new Rr(t);
|
|
1024
1023
|
return await e.checkSession(), e;
|
|
1025
1024
|
}
|
|
1026
|
-
const
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1025
|
+
const An = "sesamy.com", Wr = "https://logs.sesamy.com/events";
|
|
1026
|
+
var fe = /* @__PURE__ */ ((t) => (t.READY = "sesamyReady", t.AUTHENTICATED = "sesamyAuthenticated", t.LOGOUT = "sesamyLogout", t))(fe || {});
|
|
1027
|
+
let X;
|
|
1028
|
+
async function Kr({ clientId: t }) {
|
|
1029
|
+
if (X = await Zr({
|
|
1030
|
+
domain: `token.${An}`,
|
|
1031
1031
|
clientId: t,
|
|
1032
1032
|
cacheLocation: "localstorage"
|
|
1033
1033
|
}), window.location.search.includes("code="))
|
|
1034
1034
|
try {
|
|
1035
|
-
await
|
|
1035
|
+
await X.handleRedirectCallback();
|
|
1036
|
+
const e = await X.getUser();
|
|
1037
|
+
Ot(fe.AUTHENTICATED, e), window.history.replaceState({}, document.title, "/");
|
|
1038
|
+
const n = await X.getTokenSilently();
|
|
1039
|
+
localStorage.setItem("accessToken", n);
|
|
1036
1040
|
} catch {
|
|
1037
1041
|
}
|
|
1038
1042
|
}
|
|
1039
|
-
async function
|
|
1040
|
-
if (!
|
|
1043
|
+
async function Mr() {
|
|
1044
|
+
if (!X)
|
|
1041
1045
|
throw new Error("Auth0 client not initialized");
|
|
1042
|
-
return
|
|
1046
|
+
return X.isAuthenticated();
|
|
1043
1047
|
}
|
|
1044
|
-
async function
|
|
1045
|
-
if (!
|
|
1048
|
+
async function Xr() {
|
|
1049
|
+
if (!X)
|
|
1046
1050
|
throw new Error("Auth0 client not initialized");
|
|
1047
|
-
return
|
|
1051
|
+
return X.getUser();
|
|
1048
1052
|
}
|
|
1049
|
-
function
|
|
1050
|
-
if (!
|
|
1053
|
+
function Fr() {
|
|
1054
|
+
if (!X)
|
|
1051
1055
|
throw new Error("Auth0 client not initialized");
|
|
1052
|
-
return
|
|
1056
|
+
return X.loginWithRedirect({
|
|
1053
1057
|
authorizationParams: {
|
|
1054
1058
|
redirect_uri: window.location.href
|
|
1055
1059
|
}
|
|
1056
1060
|
});
|
|
1057
1061
|
}
|
|
1058
|
-
function
|
|
1059
|
-
if (!
|
|
1062
|
+
async function Jr() {
|
|
1063
|
+
if (!X)
|
|
1064
|
+
throw new Error("Auth0 client not initialized");
|
|
1065
|
+
return X.getTokenSilently();
|
|
1066
|
+
}
|
|
1067
|
+
async function Hr() {
|
|
1068
|
+
if (!X)
|
|
1060
1069
|
throw new Error("Auth0 client not initialized");
|
|
1061
|
-
return
|
|
1070
|
+
return Ot(fe.LOGOUT, {}), X.logout({
|
|
1062
1071
|
logoutParams: {
|
|
1063
1072
|
returnTo: window.location.href
|
|
1064
1073
|
}
|
|
1065
1074
|
});
|
|
1066
1075
|
}
|
|
1067
|
-
|
|
1076
|
+
const Vr = (t, e) => e.skipDedupe || e.method !== "GET", Yr = (t, e) => e.method + "@" + t, Gr = (t) => t.clone(), Br = ({ skip: t = Vr, key: e = Yr, resolver: n = Gr } = {}) => {
|
|
1077
|
+
const r = /* @__PURE__ */ new Map();
|
|
1078
|
+
return (i) => (o, a) => {
|
|
1079
|
+
if (t(o, a))
|
|
1080
|
+
return i(o, a);
|
|
1081
|
+
const s = e(o, a);
|
|
1082
|
+
if (!r.has(s))
|
|
1083
|
+
r.set(s, []);
|
|
1084
|
+
else
|
|
1085
|
+
return new Promise((p, m) => {
|
|
1086
|
+
r.get(s).push([p, m]);
|
|
1087
|
+
});
|
|
1088
|
+
try {
|
|
1089
|
+
return i(o, a).then((p) => (r.get(s).forEach(([m]) => m(n(p))), r.delete(s), p)).catch((p) => {
|
|
1090
|
+
throw r.get(s).forEach(([m, u]) => u(p)), r.delete(s), p;
|
|
1091
|
+
});
|
|
1092
|
+
} catch (p) {
|
|
1093
|
+
return r.delete(s), Promise.reject(p);
|
|
1094
|
+
}
|
|
1095
|
+
};
|
|
1096
|
+
}, qr = (t, e) => t * e, Qr = (t) => t && t.ok, ei = ({ delayTimer: t = 500, delayRamp: e = qr, maxAttempts: n = 10, until: r = Qr, onRetry: i = null, retryOnNetworkError: o = !1, resolveWithLatestResponse: a = !1, skip: s } = {}) => (p) => (m, u) => {
|
|
1097
|
+
let c = 0;
|
|
1098
|
+
if (s && s(m, u))
|
|
1099
|
+
return p(m, u);
|
|
1100
|
+
const f = (d, v) => Promise.resolve(r(d, v)).then((k) => k ? d && a ? d : v ? Promise.reject(v) : d : (c++, !n || c <= n ? new Promise((w) => {
|
|
1101
|
+
const I = e(t, c);
|
|
1102
|
+
setTimeout(() => {
|
|
1103
|
+
typeof i == "function" ? Promise.resolve(i({
|
|
1104
|
+
response: d,
|
|
1105
|
+
error: v,
|
|
1106
|
+
url: m,
|
|
1107
|
+
options: u
|
|
1108
|
+
})).then((_ = {}) => {
|
|
1109
|
+
var y, l;
|
|
1110
|
+
w(p((y = _ && _.url) !== null && y !== void 0 ? y : m, (l = _ && _.options) !== null && l !== void 0 ? l : u));
|
|
1111
|
+
}) : w(p(m, u));
|
|
1112
|
+
}, I);
|
|
1113
|
+
}).then(f).catch((w) => {
|
|
1114
|
+
if (!o)
|
|
1115
|
+
throw w;
|
|
1116
|
+
return f(null, w);
|
|
1117
|
+
}) : d && a ? d : Promise.reject(v || new Error("Number of attempts exceeded."))));
|
|
1118
|
+
return p(m, u).then(f).catch((d) => {
|
|
1119
|
+
if (!o)
|
|
1120
|
+
throw d;
|
|
1121
|
+
return f(null, d);
|
|
1122
|
+
});
|
|
1123
|
+
}, ti = "application/json", Nn = "Content-Type", ve = Symbol(), Ln = Symbol();
|
|
1124
|
+
function Ft(t = {}) {
|
|
1125
|
+
var e;
|
|
1126
|
+
return (e = Object.entries(t).find(([n]) => n.toLowerCase() === Nn.toLowerCase())) === null || e === void 0 ? void 0 : e[1];
|
|
1127
|
+
}
|
|
1128
|
+
function Jt(t) {
|
|
1129
|
+
return /^application\/.*json.*/.test(t);
|
|
1130
|
+
}
|
|
1131
|
+
const de = function(t, e, n = !1) {
|
|
1132
|
+
return Object.entries(e).reduce((r, [i, o]) => {
|
|
1133
|
+
const a = t[i];
|
|
1134
|
+
return Array.isArray(a) && Array.isArray(o) ? r[i] = n ? [...a, ...o] : o : typeof a == "object" && typeof o == "object" ? r[i] = de(a, o, n) : r[i] = o, r;
|
|
1135
|
+
}, { ...t });
|
|
1136
|
+
}, Ee = {
|
|
1137
|
+
// Default options
|
|
1138
|
+
options: {},
|
|
1139
|
+
// Error type
|
|
1140
|
+
errorType: "text",
|
|
1141
|
+
// Polyfills
|
|
1142
|
+
polyfills: {
|
|
1143
|
+
// fetch: null,
|
|
1144
|
+
// FormData: null,
|
|
1145
|
+
// URLSearchParams: null,
|
|
1146
|
+
// performance: null,
|
|
1147
|
+
// PerformanceObserver: null,
|
|
1148
|
+
// AbortController: null
|
|
1149
|
+
},
|
|
1150
|
+
polyfill(t, e = !0, n = !1, ...r) {
|
|
1151
|
+
const i = this.polyfills[t] || (typeof self < "u" ? self[t] : null) || (typeof global < "u" ? global[t] : null);
|
|
1152
|
+
if (e && !i)
|
|
1153
|
+
throw new Error(t + " is not defined");
|
|
1154
|
+
return n && i ? new i(...r) : i;
|
|
1155
|
+
}
|
|
1156
|
+
};
|
|
1157
|
+
function ni(t, e = !1) {
|
|
1158
|
+
Ee.options = e ? t : de(Ee.options, t);
|
|
1159
|
+
}
|
|
1160
|
+
function ri(t, e = !1) {
|
|
1161
|
+
Ee.polyfills = e ? t : de(Ee.polyfills, t);
|
|
1162
|
+
}
|
|
1163
|
+
function ii(t) {
|
|
1164
|
+
Ee.errorType = t;
|
|
1165
|
+
}
|
|
1166
|
+
const oi = (t) => (e) => t.reduceRight((n, r) => r(n), e) || e;
|
|
1167
|
+
class Dn extends Error {
|
|
1168
|
+
}
|
|
1169
|
+
const ai = (t) => {
|
|
1170
|
+
const e = /* @__PURE__ */ Object.create(null);
|
|
1171
|
+
t = t._addons.reduce((y, l) => l.beforeRequest && l.beforeRequest(y, t._options, e) || y, t);
|
|
1172
|
+
const { _url: n, _options: r, _config: i, _catchers: o, _resolvers: a, _middlewares: s, _addons: p } = t, m = new Map(o), u = de(i.options, r);
|
|
1173
|
+
let c = n;
|
|
1174
|
+
const f = oi(s)((y, l) => (c = y, i.polyfill("fetch")(y, l)))(n, u), d = new Error(), v = f.catch((y) => {
|
|
1175
|
+
throw { [ve]: y };
|
|
1176
|
+
}).then((y) => {
|
|
1177
|
+
if (!y.ok) {
|
|
1178
|
+
const l = new Dn();
|
|
1179
|
+
if (l.cause = d, l.stack = l.stack + `
|
|
1180
|
+
CAUSE: ` + d.stack, l.response = y, l.url = c, y.type === "opaque")
|
|
1181
|
+
throw l;
|
|
1182
|
+
return y.text().then((b) => {
|
|
1183
|
+
var T;
|
|
1184
|
+
if (l.message = b, i.errorType === "json" || ((T = y.headers.get("Content-Type")) === null || T === void 0 ? void 0 : T.split(";")[0]) === "application/json")
|
|
1185
|
+
try {
|
|
1186
|
+
l.json = JSON.parse(b);
|
|
1187
|
+
} catch {
|
|
1188
|
+
}
|
|
1189
|
+
throw l.text = b, l.status = y.status, l;
|
|
1190
|
+
});
|
|
1191
|
+
}
|
|
1192
|
+
return y;
|
|
1193
|
+
}), k = (y) => y.catch((l) => {
|
|
1194
|
+
const b = l.hasOwnProperty(ve), T = b ? l[ve] : l, x = (T == null ? void 0 : T.status) && m.get(T.status) || m.get(T == null ? void 0 : T.name) || b && m.has(ve) && m.get(ve);
|
|
1195
|
+
if (x)
|
|
1196
|
+
return x(T, t);
|
|
1197
|
+
const j = m.get(Ln);
|
|
1198
|
+
if (j)
|
|
1199
|
+
return j(T, t);
|
|
1200
|
+
throw T;
|
|
1201
|
+
}), w = (y) => (l) => /* If a callback is provided, then callback with the body result otherwise return the parsed body itself. */ k(y ? v.then((b) => b && b[y]()).then((b) => l ? l(b) : b) : v.then((b) => l ? l(b) : b)), I = {
|
|
1202
|
+
_wretchReq: t,
|
|
1203
|
+
_fetchReq: f,
|
|
1204
|
+
_sharedState: e,
|
|
1205
|
+
res: w(null),
|
|
1206
|
+
json: w("json"),
|
|
1207
|
+
blob: w("blob"),
|
|
1208
|
+
formData: w("formData"),
|
|
1209
|
+
arrayBuffer: w("arrayBuffer"),
|
|
1210
|
+
text: w("text"),
|
|
1211
|
+
error(y, l) {
|
|
1212
|
+
return m.set(y, l), this;
|
|
1213
|
+
},
|
|
1214
|
+
badRequest(y) {
|
|
1215
|
+
return this.error(400, y);
|
|
1216
|
+
},
|
|
1217
|
+
unauthorized(y) {
|
|
1218
|
+
return this.error(401, y);
|
|
1219
|
+
},
|
|
1220
|
+
forbidden(y) {
|
|
1221
|
+
return this.error(403, y);
|
|
1222
|
+
},
|
|
1223
|
+
notFound(y) {
|
|
1224
|
+
return this.error(404, y);
|
|
1225
|
+
},
|
|
1226
|
+
timeout(y) {
|
|
1227
|
+
return this.error(408, y);
|
|
1228
|
+
},
|
|
1229
|
+
internalError(y) {
|
|
1230
|
+
return this.error(500, y);
|
|
1231
|
+
},
|
|
1232
|
+
fetchError(y) {
|
|
1233
|
+
return this.error(ve, y);
|
|
1234
|
+
}
|
|
1235
|
+
}, _ = p.reduce((y, l) => ({
|
|
1236
|
+
...y,
|
|
1237
|
+
...typeof l.resolver == "function" ? l.resolver(y) : l.resolver
|
|
1238
|
+
}), I);
|
|
1239
|
+
return a.reduce((y, l) => l(y, t), _);
|
|
1240
|
+
}, si = {
|
|
1241
|
+
_url: "",
|
|
1242
|
+
_options: {},
|
|
1243
|
+
_config: Ee,
|
|
1244
|
+
_catchers: /* @__PURE__ */ new Map(),
|
|
1245
|
+
_resolvers: [],
|
|
1246
|
+
_deferred: [],
|
|
1247
|
+
_middlewares: [],
|
|
1248
|
+
_addons: [],
|
|
1249
|
+
addon(t) {
|
|
1250
|
+
return { ...this, _addons: [...this._addons, t], ...t.wretch };
|
|
1251
|
+
},
|
|
1252
|
+
errorType(t) {
|
|
1253
|
+
return {
|
|
1254
|
+
...this,
|
|
1255
|
+
_config: {
|
|
1256
|
+
...this._config,
|
|
1257
|
+
errorType: t
|
|
1258
|
+
}
|
|
1259
|
+
};
|
|
1260
|
+
},
|
|
1261
|
+
polyfills(t, e = !1) {
|
|
1262
|
+
return {
|
|
1263
|
+
...this,
|
|
1264
|
+
_config: {
|
|
1265
|
+
...this._config,
|
|
1266
|
+
polyfills: e ? t : de(this._config.polyfills, t)
|
|
1267
|
+
}
|
|
1268
|
+
};
|
|
1269
|
+
},
|
|
1270
|
+
url(t, e = !1) {
|
|
1271
|
+
if (e)
|
|
1272
|
+
return { ...this, _url: t };
|
|
1273
|
+
const n = this._url.split("?");
|
|
1274
|
+
return {
|
|
1275
|
+
...this,
|
|
1276
|
+
_url: n.length > 1 ? n[0] + t + "?" + n[1] : this._url + t
|
|
1277
|
+
};
|
|
1278
|
+
},
|
|
1279
|
+
options(t, e = !1) {
|
|
1280
|
+
return { ...this, _options: e ? t : de(this._options, t) };
|
|
1281
|
+
},
|
|
1282
|
+
headers(t) {
|
|
1283
|
+
const e = t ? Array.isArray(t) ? Object.fromEntries(t) : "entries" in t ? Object.fromEntries(t.entries()) : t : {};
|
|
1284
|
+
return { ...this, _options: de(this._options, { headers: e }) };
|
|
1285
|
+
},
|
|
1286
|
+
accept(t) {
|
|
1287
|
+
return this.headers({ Accept: t });
|
|
1288
|
+
},
|
|
1289
|
+
content(t) {
|
|
1290
|
+
return this.headers({ [Nn]: t });
|
|
1291
|
+
},
|
|
1292
|
+
auth(t) {
|
|
1293
|
+
return this.headers({ Authorization: t });
|
|
1294
|
+
},
|
|
1295
|
+
catcher(t, e) {
|
|
1296
|
+
const n = new Map(this._catchers);
|
|
1297
|
+
return n.set(t, e), { ...this, _catchers: n };
|
|
1298
|
+
},
|
|
1299
|
+
catcherFallback(t) {
|
|
1300
|
+
return this.catcher(Ln, t);
|
|
1301
|
+
},
|
|
1302
|
+
resolve(t, e = !1) {
|
|
1303
|
+
return { ...this, _resolvers: e ? [t] : [...this._resolvers, t] };
|
|
1304
|
+
},
|
|
1305
|
+
defer(t, e = !1) {
|
|
1306
|
+
return {
|
|
1307
|
+
...this,
|
|
1308
|
+
_deferred: e ? [t] : [...this._deferred, t]
|
|
1309
|
+
};
|
|
1310
|
+
},
|
|
1311
|
+
middlewares(t, e = !1) {
|
|
1312
|
+
return {
|
|
1313
|
+
...this,
|
|
1314
|
+
_middlewares: e ? t : [...this._middlewares, ...t]
|
|
1315
|
+
};
|
|
1316
|
+
},
|
|
1317
|
+
fetch(t = this._options.method, e = "", n = null) {
|
|
1318
|
+
let r = this.url(e).options({ method: t });
|
|
1319
|
+
const i = Ft(r._options.headers), o = typeof n == "object" && (!r._options.headers || !i || Jt(i));
|
|
1320
|
+
return r = n ? o ? r.json(n, i) : r.body(n) : r, ai(r._deferred.reduce((a, s) => s(a, a._url, a._options), r));
|
|
1321
|
+
},
|
|
1322
|
+
get(t = "") {
|
|
1323
|
+
return this.fetch("GET", t);
|
|
1324
|
+
},
|
|
1325
|
+
delete(t = "") {
|
|
1326
|
+
return this.fetch("DELETE", t);
|
|
1327
|
+
},
|
|
1328
|
+
put(t, e = "") {
|
|
1329
|
+
return this.fetch("PUT", e, t);
|
|
1330
|
+
},
|
|
1331
|
+
post(t, e = "") {
|
|
1332
|
+
return this.fetch("POST", e, t);
|
|
1333
|
+
},
|
|
1334
|
+
patch(t, e = "") {
|
|
1335
|
+
return this.fetch("PATCH", e, t);
|
|
1336
|
+
},
|
|
1337
|
+
head(t = "") {
|
|
1338
|
+
return this.fetch("HEAD", t);
|
|
1339
|
+
},
|
|
1340
|
+
opts(t = "") {
|
|
1341
|
+
return this.fetch("OPTIONS", t);
|
|
1342
|
+
},
|
|
1343
|
+
body(t) {
|
|
1344
|
+
return { ...this, _options: { ...this._options, body: t } };
|
|
1345
|
+
},
|
|
1346
|
+
json(t, e) {
|
|
1347
|
+
const n = Ft(this._options.headers);
|
|
1348
|
+
return this.content(e || Jt(n) && n || ti).body(JSON.stringify(t));
|
|
1349
|
+
}
|
|
1350
|
+
};
|
|
1351
|
+
function pe(t = "", e = {}) {
|
|
1352
|
+
return { ...si, _url: t, _options: e };
|
|
1353
|
+
}
|
|
1354
|
+
pe.default = pe;
|
|
1355
|
+
pe.options = ni;
|
|
1356
|
+
pe.errorType = ii;
|
|
1357
|
+
pe.polyfills = ri;
|
|
1358
|
+
pe.WretchError = Dn;
|
|
1359
|
+
const ci = (t) => (e, n) => new Promise(async (r, i) => {
|
|
1360
|
+
try {
|
|
1361
|
+
const o = await Jr(), a = {
|
|
1362
|
+
...n,
|
|
1363
|
+
headers: {
|
|
1364
|
+
...n.headers,
|
|
1365
|
+
Authorization: `Bearer ${o}`
|
|
1366
|
+
}
|
|
1367
|
+
};
|
|
1368
|
+
r(t(e, a));
|
|
1369
|
+
} catch (o) {
|
|
1370
|
+
console.error("Error fetching access token:", o), i(o);
|
|
1371
|
+
}
|
|
1372
|
+
}), Un = pe(`https://api2.${An}`).headers({ "Content-Type": "application/json" }).middlewares([
|
|
1373
|
+
ci,
|
|
1374
|
+
Br(),
|
|
1375
|
+
ei({
|
|
1376
|
+
delayTimer: 1e3,
|
|
1377
|
+
delayRamp: (t, e) => t * e,
|
|
1378
|
+
maxAttempts: 3,
|
|
1379
|
+
until: (t) => (t == null ? void 0 : t.ok) || !1,
|
|
1380
|
+
retryOnNetworkError: !1
|
|
1381
|
+
})
|
|
1382
|
+
]);
|
|
1383
|
+
async function ui() {
|
|
1384
|
+
return Un.get("/entitlements").json();
|
|
1385
|
+
}
|
|
1386
|
+
async function li(t) {
|
|
1387
|
+
const e = await Un.get("/entitlements").json();
|
|
1388
|
+
return e == null ? void 0 : e.find((n) => n.id === t);
|
|
1389
|
+
}
|
|
1390
|
+
function di(t = "sesamy") {
|
|
1068
1391
|
window[t] = {
|
|
1069
|
-
getUser:
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1392
|
+
getUser: Xr,
|
|
1393
|
+
getEntitlement: li,
|
|
1394
|
+
getEntitlements: ui,
|
|
1395
|
+
isAuthenticated: Mr,
|
|
1396
|
+
loginWithRedirect: Fr,
|
|
1397
|
+
logout: Hr
|
|
1073
1398
|
};
|
|
1074
1399
|
}
|
|
1075
|
-
function
|
|
1400
|
+
function Ht(t, e, n, r, i) {
|
|
1076
1401
|
for (e = e.split ? e.split(".") : e, r = 0; r < e.length; r++)
|
|
1077
1402
|
t = t ? t[e[r]] : i;
|
|
1078
1403
|
return t === i ? n : t;
|
|
1079
1404
|
}
|
|
1080
|
-
var
|
|
1081
|
-
},
|
|
1082
|
-
|
|
1083
|
-
var
|
|
1084
|
-
|
|
1405
|
+
var Xe = "undefined", Vt = "object", hi = function() {
|
|
1406
|
+
}, Rn = "any", Zn = "*", me = "__", Qe = typeof process < "u" ? process : {};
|
|
1407
|
+
Qe.env && Qe.env.NODE_ENV;
|
|
1408
|
+
var Y = typeof document < "u";
|
|
1409
|
+
Qe.versions != null && Qe.versions.node != null;
|
|
1085
1410
|
typeof Deno < "u" && Deno.core;
|
|
1086
|
-
|
|
1087
|
-
function
|
|
1411
|
+
Y && window.name === "nodejs" || typeof navigator < "u" && navigator.userAgent !== void 0 && (navigator.userAgent.includes("Node.js") || navigator.userAgent.includes("jsdom"));
|
|
1412
|
+
function Wn(t, e) {
|
|
1088
1413
|
return e.charAt(0)[t]() + e.slice(1);
|
|
1089
1414
|
}
|
|
1090
|
-
var
|
|
1091
|
-
function
|
|
1092
|
-
return
|
|
1415
|
+
var fi = Wn.bind(null, "toUpperCase"), pi = Wn.bind(null, "toLowerCase");
|
|
1416
|
+
function mi(t) {
|
|
1417
|
+
return Kn(t) ? fi("null") : typeof t == "object" ? wi(t) : Object.prototype.toString.call(t).slice(8, -1);
|
|
1093
1418
|
}
|
|
1094
|
-
function
|
|
1419
|
+
function et(t, e) {
|
|
1095
1420
|
e === void 0 && (e = !0);
|
|
1096
|
-
var n =
|
|
1097
|
-
return e ?
|
|
1421
|
+
var n = mi(t);
|
|
1422
|
+
return e ? pi(n) : n;
|
|
1098
1423
|
}
|
|
1099
|
-
function
|
|
1424
|
+
function We(t, e) {
|
|
1100
1425
|
return typeof e === t;
|
|
1101
1426
|
}
|
|
1102
|
-
var
|
|
1103
|
-
|
|
1104
|
-
function
|
|
1427
|
+
var B = We.bind(null, "function"), re = We.bind(null, "string"), be = We.bind(null, "undefined"), gi = We.bind(null, "boolean");
|
|
1428
|
+
We.bind(null, "symbol");
|
|
1429
|
+
function Kn(t) {
|
|
1105
1430
|
return t === null;
|
|
1106
1431
|
}
|
|
1107
|
-
function
|
|
1108
|
-
return
|
|
1432
|
+
function yi(t) {
|
|
1433
|
+
return et(t) === "number" && !isNaN(t);
|
|
1109
1434
|
}
|
|
1110
|
-
function
|
|
1111
|
-
return
|
|
1435
|
+
function Mn(t) {
|
|
1436
|
+
return et(t) === "array";
|
|
1112
1437
|
}
|
|
1113
|
-
function
|
|
1114
|
-
if (!
|
|
1438
|
+
function H(t) {
|
|
1439
|
+
if (!vi(t))
|
|
1115
1440
|
return !1;
|
|
1116
1441
|
for (var e = t; Object.getPrototypeOf(e) !== null; )
|
|
1117
1442
|
e = Object.getPrototypeOf(e);
|
|
1118
1443
|
return Object.getPrototypeOf(t) === e;
|
|
1119
1444
|
}
|
|
1120
|
-
function
|
|
1445
|
+
function vi(t) {
|
|
1121
1446
|
return t && (typeof t == "object" || t !== null);
|
|
1122
1447
|
}
|
|
1123
|
-
function
|
|
1124
|
-
return
|
|
1448
|
+
function wi(t) {
|
|
1449
|
+
return B(t.constructor) ? t.constructor.name : null;
|
|
1125
1450
|
}
|
|
1126
|
-
function
|
|
1127
|
-
return t instanceof Error || re(t.message) && t.constructor &&
|
|
1451
|
+
function bi(t) {
|
|
1452
|
+
return t instanceof Error || re(t.message) && t.constructor && yi(t.constructor.stackTraceLimit);
|
|
1128
1453
|
}
|
|
1129
|
-
function
|
|
1130
|
-
if (typeof e != "object" ||
|
|
1454
|
+
function Xn(t, e) {
|
|
1455
|
+
if (typeof e != "object" || Kn(e))
|
|
1131
1456
|
return !1;
|
|
1132
1457
|
if (e instanceof t)
|
|
1133
1458
|
return !0;
|
|
1134
|
-
var n =
|
|
1135
|
-
if (
|
|
1459
|
+
var n = et(new t(""));
|
|
1460
|
+
if (bi(e))
|
|
1136
1461
|
for (; e; ) {
|
|
1137
|
-
if (
|
|
1462
|
+
if (et(e) === n)
|
|
1138
1463
|
return !0;
|
|
1139
1464
|
e = Object.getPrototypeOf(e);
|
|
1140
1465
|
}
|
|
1141
1466
|
return !1;
|
|
1142
1467
|
}
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
function
|
|
1468
|
+
Xn.bind(null, TypeError);
|
|
1469
|
+
Xn.bind(null, SyntaxError);
|
|
1470
|
+
function rt(t, e) {
|
|
1146
1471
|
var n = t instanceof Element || t instanceof HTMLDocument;
|
|
1147
|
-
return n && e ?
|
|
1472
|
+
return n && e ? ki(t, e) : n;
|
|
1148
1473
|
}
|
|
1149
|
-
function
|
|
1474
|
+
function ki(t, e) {
|
|
1150
1475
|
return e === void 0 && (e = ""), t && t.nodeName === e.toUpperCase();
|
|
1151
1476
|
}
|
|
1152
|
-
function
|
|
1477
|
+
function it(t) {
|
|
1153
1478
|
var e = [].slice.call(arguments, 1);
|
|
1154
1479
|
return function() {
|
|
1155
1480
|
return t.apply(void 0, [].slice.call(arguments).concat(e));
|
|
1156
1481
|
};
|
|
1157
1482
|
}
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
function
|
|
1163
|
-
return t ?
|
|
1483
|
+
it(rt, "form");
|
|
1484
|
+
it(rt, "button");
|
|
1485
|
+
it(rt, "input");
|
|
1486
|
+
it(rt, "select");
|
|
1487
|
+
function Ii(t) {
|
|
1488
|
+
return t ? Mn(t) ? t : [t] : [];
|
|
1164
1489
|
}
|
|
1165
|
-
function
|
|
1490
|
+
function Yt(t) {
|
|
1166
1491
|
try {
|
|
1167
1492
|
return decodeURIComponent(t.replace(/\+/g, " "));
|
|
1168
1493
|
} catch {
|
|
1169
1494
|
return null;
|
|
1170
1495
|
}
|
|
1171
1496
|
}
|
|
1172
|
-
function
|
|
1173
|
-
if (
|
|
1497
|
+
function _i() {
|
|
1498
|
+
if (Y) {
|
|
1174
1499
|
var t = navigator, e = t.languages;
|
|
1175
1500
|
return t.userLanguage || (e && e.length ? e[0] : t.language);
|
|
1176
1501
|
}
|
|
1177
1502
|
}
|
|
1178
|
-
function
|
|
1503
|
+
function Si() {
|
|
1179
1504
|
try {
|
|
1180
1505
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
1181
1506
|
} catch {
|
|
1182
1507
|
}
|
|
1183
1508
|
}
|
|
1184
|
-
function
|
|
1509
|
+
function Ei(t) {
|
|
1185
1510
|
return function(e) {
|
|
1186
1511
|
for (var n, r = /* @__PURE__ */ Object.create(null), i = /([^&=]+)=?([^&]*)/g; n = i.exec(e); ) {
|
|
1187
|
-
var o =
|
|
1512
|
+
var o = Yt(n[1]), a = Yt(n[2]);
|
|
1188
1513
|
o.substring(o.length - 2) === "[]" ? (r[o = o.substring(0, o.length - 2)] || (r[o] = [])).push(a) : r[o] = a === "" || a;
|
|
1189
1514
|
}
|
|
1190
1515
|
for (var s in r) {
|
|
1191
|
-
var
|
|
1192
|
-
|
|
1516
|
+
var p = s.split("[");
|
|
1517
|
+
p.length > 1 && (Oi(r, p.map(function(m) {
|
|
1193
1518
|
return m.replace(/[?[\]\\ ]/g, "");
|
|
1194
1519
|
}), r[s]), delete r[s]);
|
|
1195
1520
|
}
|
|
@@ -1199,10 +1524,10 @@ function Gr(t) {
|
|
|
1199
1524
|
var n = e.match(/\?(.*)/);
|
|
1200
1525
|
return n && n[1] ? n[1].split("#")[0] : "";
|
|
1201
1526
|
}
|
|
1202
|
-
return
|
|
1527
|
+
return Y && window.location.search.substring(1);
|
|
1203
1528
|
}(t));
|
|
1204
1529
|
}
|
|
1205
|
-
function
|
|
1530
|
+
function Oi(t, e, n) {
|
|
1206
1531
|
for (var r = e.length - 1, i = 0; i < r; ++i) {
|
|
1207
1532
|
var o = e[i];
|
|
1208
1533
|
if (o === "__proto__" || o === "constructor")
|
|
@@ -1211,27 +1536,27 @@ function Br(t, e, n) {
|
|
|
1211
1536
|
}
|
|
1212
1537
|
t[e[r]] = n;
|
|
1213
1538
|
}
|
|
1214
|
-
function
|
|
1539
|
+
function ot() {
|
|
1215
1540
|
for (var t = "", e = 0, n = 4294967295 * Math.random() | 0; e++ < 36; ) {
|
|
1216
1541
|
var r = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[e - 1], i = 15 & n;
|
|
1217
1542
|
t += r == "-" || r == "4" ? r : (r == "x" ? i : 3 & i | 8).toString(16), n = e % 8 == 0 ? 4294967295 * Math.random() | 0 : n >> 4;
|
|
1218
1543
|
}
|
|
1219
1544
|
return t;
|
|
1220
1545
|
}
|
|
1221
|
-
var
|
|
1222
|
-
function
|
|
1223
|
-
return
|
|
1546
|
+
var Le = "global", Oe = me + "global" + me, Pe = typeof self === Vt && self.self === self && self || typeof global === Vt && global.global === global && global || void 0;
|
|
1547
|
+
function ge(t) {
|
|
1548
|
+
return Pe[Oe][t];
|
|
1224
1549
|
}
|
|
1225
|
-
function
|
|
1226
|
-
return
|
|
1550
|
+
function ye(t, e) {
|
|
1551
|
+
return Pe[Oe][t] = e;
|
|
1227
1552
|
}
|
|
1228
|
-
function
|
|
1229
|
-
delete
|
|
1553
|
+
function je(t) {
|
|
1554
|
+
delete Pe[Oe][t];
|
|
1230
1555
|
}
|
|
1231
|
-
function
|
|
1556
|
+
function xe(t, e, n) {
|
|
1232
1557
|
var r;
|
|
1233
1558
|
try {
|
|
1234
|
-
if (
|
|
1559
|
+
if (jt(t)) {
|
|
1235
1560
|
var i = window[t];
|
|
1236
1561
|
r = i[e].bind(i);
|
|
1237
1562
|
}
|
|
@@ -1239,99 +1564,99 @@ function _e(t, e, n) {
|
|
|
1239
1564
|
}
|
|
1240
1565
|
return r || n;
|
|
1241
1566
|
}
|
|
1242
|
-
|
|
1243
|
-
var
|
|
1244
|
-
function
|
|
1245
|
-
if (typeof
|
|
1246
|
-
return
|
|
1567
|
+
Pe[Oe] || (Pe[Oe] = {});
|
|
1568
|
+
var Fe = {};
|
|
1569
|
+
function jt(t) {
|
|
1570
|
+
if (typeof Fe[t] !== Xe)
|
|
1571
|
+
return Fe[t];
|
|
1247
1572
|
try {
|
|
1248
1573
|
var e = window[t];
|
|
1249
|
-
e.setItem(
|
|
1574
|
+
e.setItem(Xe, Xe), e.removeItem(Xe);
|
|
1250
1575
|
} catch {
|
|
1251
|
-
return
|
|
1576
|
+
return Fe[t] = !1;
|
|
1252
1577
|
}
|
|
1253
|
-
return
|
|
1578
|
+
return Fe[t] = !0;
|
|
1254
1579
|
}
|
|
1255
|
-
function
|
|
1256
|
-
return
|
|
1580
|
+
function O() {
|
|
1581
|
+
return O = Object.assign || function(t) {
|
|
1257
1582
|
for (var e = 1; e < arguments.length; e++) {
|
|
1258
1583
|
var n = arguments[e];
|
|
1259
1584
|
for (var r in n)
|
|
1260
1585
|
Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
|
|
1261
1586
|
}
|
|
1262
1587
|
return t;
|
|
1263
|
-
},
|
|
1588
|
+
}, O.apply(this, arguments);
|
|
1264
1589
|
}
|
|
1265
|
-
var ne = "function", ee = "undefined",
|
|
1590
|
+
var ne = "function", ee = "undefined", Pi = "@@redux/" + Math.random().toString(36), Gt = /* @__PURE__ */ function() {
|
|
1266
1591
|
return typeof Symbol === ne && Symbol.observable || "@@observable";
|
|
1267
|
-
}(),
|
|
1268
|
-
function
|
|
1592
|
+
}(), Je = " != " + ne;
|
|
1593
|
+
function Fn(t, e, n) {
|
|
1269
1594
|
var r;
|
|
1270
1595
|
if (typeof e === ne && typeof n === ee && (n = e, e = void 0), typeof n !== ee) {
|
|
1271
1596
|
if (typeof n !== ne)
|
|
1272
|
-
throw new Error("enhancer" +
|
|
1273
|
-
return n(
|
|
1597
|
+
throw new Error("enhancer" + Je);
|
|
1598
|
+
return n(Fn)(t, e);
|
|
1274
1599
|
}
|
|
1275
1600
|
if (typeof t !== ne)
|
|
1276
|
-
throw new Error("reducer" +
|
|
1277
|
-
var i = t, o = e, a = [], s = a,
|
|
1601
|
+
throw new Error("reducer" + Je);
|
|
1602
|
+
var i = t, o = e, a = [], s = a, p = !1;
|
|
1278
1603
|
function m() {
|
|
1279
1604
|
s === a && (s = a.slice());
|
|
1280
1605
|
}
|
|
1281
1606
|
function u() {
|
|
1282
1607
|
return o;
|
|
1283
1608
|
}
|
|
1284
|
-
function c(
|
|
1285
|
-
if (typeof
|
|
1286
|
-
throw new Error("Listener" +
|
|
1609
|
+
function c(d) {
|
|
1610
|
+
if (typeof d !== ne)
|
|
1611
|
+
throw new Error("Listener" + Je);
|
|
1287
1612
|
var v = !0;
|
|
1288
|
-
return m(), s.push(
|
|
1613
|
+
return m(), s.push(d), function() {
|
|
1289
1614
|
if (v) {
|
|
1290
1615
|
v = !1, m();
|
|
1291
|
-
var
|
|
1292
|
-
s.splice(
|
|
1616
|
+
var k = s.indexOf(d);
|
|
1617
|
+
s.splice(k, 1);
|
|
1293
1618
|
}
|
|
1294
1619
|
};
|
|
1295
1620
|
}
|
|
1296
|
-
function d
|
|
1297
|
-
if (!
|
|
1621
|
+
function f(d) {
|
|
1622
|
+
if (!H(d))
|
|
1298
1623
|
throw new Error("Act != obj");
|
|
1299
|
-
if (typeof
|
|
1624
|
+
if (typeof d.type === ee)
|
|
1300
1625
|
throw new Error("ActType " + ee);
|
|
1301
|
-
if (
|
|
1626
|
+
if (p)
|
|
1302
1627
|
throw new Error("Dispatch in reducer");
|
|
1303
1628
|
try {
|
|
1304
|
-
|
|
1629
|
+
p = !0, o = i(o, d);
|
|
1305
1630
|
} finally {
|
|
1306
|
-
|
|
1631
|
+
p = !1;
|
|
1307
1632
|
}
|
|
1308
|
-
for (var v = a = s,
|
|
1309
|
-
(0, v[
|
|
1310
|
-
return
|
|
1311
|
-
}
|
|
1312
|
-
return
|
|
1313
|
-
if (typeof
|
|
1314
|
-
throw new Error("next reducer" +
|
|
1315
|
-
i =
|
|
1316
|
-
} })[
|
|
1317
|
-
var
|
|
1318
|
-
return (
|
|
1319
|
-
if (typeof
|
|
1633
|
+
for (var v = a = s, k = 0; k < v.length; k++)
|
|
1634
|
+
(0, v[k])();
|
|
1635
|
+
return d;
|
|
1636
|
+
}
|
|
1637
|
+
return f({ type: "@@redux/INIT" }), (r = { dispatch: f, subscribe: c, getState: u, replaceReducer: function(d) {
|
|
1638
|
+
if (typeof d !== ne)
|
|
1639
|
+
throw new Error("next reducer" + Je);
|
|
1640
|
+
i = d, f({ type: "@@redux/INIT" });
|
|
1641
|
+
} })[Gt] = function() {
|
|
1642
|
+
var d, v = c;
|
|
1643
|
+
return (d = { subscribe: function(k) {
|
|
1644
|
+
if (typeof k != "object")
|
|
1320
1645
|
throw new TypeError("Observer != obj");
|
|
1321
|
-
function
|
|
1322
|
-
|
|
1646
|
+
function w() {
|
|
1647
|
+
k.next && k.next(u());
|
|
1323
1648
|
}
|
|
1324
|
-
return
|
|
1325
|
-
} })[
|
|
1649
|
+
return w(), { unsubscribe: v(w) };
|
|
1650
|
+
} })[Gt] = function() {
|
|
1326
1651
|
return this;
|
|
1327
|
-
},
|
|
1652
|
+
}, d;
|
|
1328
1653
|
}, r;
|
|
1329
1654
|
}
|
|
1330
|
-
function
|
|
1655
|
+
function Ti(t, e) {
|
|
1331
1656
|
var n = e && e.type;
|
|
1332
1657
|
return "action " + (n && n.toString() || "?") + "reducer " + t + " returns " + ee;
|
|
1333
1658
|
}
|
|
1334
|
-
function
|
|
1659
|
+
function Te() {
|
|
1335
1660
|
var t = [].slice.call(arguments);
|
|
1336
1661
|
return t.length === 0 ? function(e) {
|
|
1337
1662
|
return e;
|
|
@@ -1341,48 +1666,48 @@ function Ie() {
|
|
|
1341
1666
|
};
|
|
1342
1667
|
});
|
|
1343
1668
|
}
|
|
1344
|
-
function
|
|
1669
|
+
function ji() {
|
|
1345
1670
|
var t = arguments;
|
|
1346
1671
|
return function(e) {
|
|
1347
1672
|
return function(n, r, i) {
|
|
1348
|
-
var o, a = e(n, r, i), s = a.dispatch,
|
|
1673
|
+
var o, a = e(n, r, i), s = a.dispatch, p = { getState: a.getState, dispatch: function(m) {
|
|
1349
1674
|
return s(m);
|
|
1350
1675
|
} };
|
|
1351
1676
|
return o = [].slice.call(t).map(function(m) {
|
|
1352
|
-
return m(
|
|
1353
|
-
}),
|
|
1677
|
+
return m(p);
|
|
1678
|
+
}), O({}, a, { dispatch: s = Te.apply(void 0, o)(a.dispatch) });
|
|
1354
1679
|
};
|
|
1355
1680
|
};
|
|
1356
1681
|
}
|
|
1357
|
-
var ie =
|
|
1682
|
+
var ie = me + "anon_id", he = me + "user_id", Ie = me + "user_traits", te = "userId", ke = "anonymousId", qe = ["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"], _t = ["name", "EVENTS", "config", "loaded"], E = qe.reduce(function(t, e) {
|
|
1358
1683
|
return t[e] = e, t;
|
|
1359
1684
|
}, { registerPluginType: function(t) {
|
|
1360
1685
|
return "registerPlugin:" + t;
|
|
1361
1686
|
}, pluginReadyType: function(t) {
|
|
1362
1687
|
return "ready:" + t;
|
|
1363
|
-
} }),
|
|
1364
|
-
function
|
|
1688
|
+
} }), Bt = /^utm_/, qt = /^an_prop_/, Qt = /^an_trait_/;
|
|
1689
|
+
function xi(t) {
|
|
1365
1690
|
var e = t.storage.setItem;
|
|
1366
1691
|
return function(n) {
|
|
1367
1692
|
return function(r) {
|
|
1368
1693
|
return function(i) {
|
|
1369
|
-
if (i.type ===
|
|
1370
|
-
var o = i.params, a = i.user, s = i.persistedUser,
|
|
1371
|
-
s.anonymousId !== a.anonymousId && e(ie, a.anonymousId), m || e(
|
|
1694
|
+
if (i.type === E.bootstrap) {
|
|
1695
|
+
var o = i.params, a = i.user, s = i.persistedUser, p = i.initialUser, m = s.userId === a.userId;
|
|
1696
|
+
s.anonymousId !== a.anonymousId && e(ie, a.anonymousId), m || e(he, a.userId), p.traits && e(Ie, O({}, m && s.traits ? s.traits : {}, p.traits));
|
|
1372
1697
|
var u = Object.keys(i.params);
|
|
1373
1698
|
if (u.length) {
|
|
1374
|
-
var c = o.an_uid,
|
|
1375
|
-
if (
|
|
1376
|
-
var
|
|
1377
|
-
v.campaign[
|
|
1699
|
+
var c = o.an_uid, f = o.an_event, d = u.reduce(function(v, k) {
|
|
1700
|
+
if (k.match(Bt) || k.match(/^(d|g)clid/)) {
|
|
1701
|
+
var w = k.replace(Bt, "");
|
|
1702
|
+
v.campaign[w === "campaign" ? "name" : w] = o[k];
|
|
1378
1703
|
}
|
|
1379
|
-
return
|
|
1704
|
+
return k.match(qt) && (v.props[k.replace(qt, "")] = o[k]), k.match(Qt) && (v.traits[k.replace(Qt, "")] = o[k]), v;
|
|
1380
1705
|
}, { campaign: {}, props: {}, traits: {} });
|
|
1381
|
-
n.dispatch(
|
|
1382
|
-
return t.identify(c,
|
|
1383
|
-
}, 0),
|
|
1384
|
-
return t.track(
|
|
1385
|
-
}, 0), Object.keys(
|
|
1706
|
+
n.dispatch(O({ type: E.params, raw: o }, d, c ? { userId: c } : {})), c && setTimeout(function() {
|
|
1707
|
+
return t.identify(c, d.traits);
|
|
1708
|
+
}, 0), f && setTimeout(function() {
|
|
1709
|
+
return t.track(f, d.props);
|
|
1710
|
+
}, 0), Object.keys(d.campaign).length && n.dispatch({ type: E.campaign, campaign: d.campaign });
|
|
1386
1711
|
}
|
|
1387
1712
|
}
|
|
1388
1713
|
return r(i);
|
|
@@ -1390,19 +1715,19 @@ function ti(t) {
|
|
|
1390
1715
|
};
|
|
1391
1716
|
};
|
|
1392
1717
|
}
|
|
1393
|
-
function
|
|
1718
|
+
function Ci(t) {
|
|
1394
1719
|
return function(e, n) {
|
|
1395
|
-
if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type ===
|
|
1720
|
+
if (e === void 0 && (e = {}), n === void 0 && (n = {}), n.type === E.setItemEnd) {
|
|
1396
1721
|
if (n.key === ie)
|
|
1397
|
-
return
|
|
1398
|
-
if (n.key ===
|
|
1399
|
-
return
|
|
1722
|
+
return O({}, e, { anonymousId: n.value });
|
|
1723
|
+
if (n.key === he)
|
|
1724
|
+
return O({}, e, { userId: n.value });
|
|
1400
1725
|
}
|
|
1401
1726
|
switch (n.type) {
|
|
1402
|
-
case
|
|
1403
|
-
return Object.assign({}, e, { userId: n.userId, traits:
|
|
1404
|
-
case
|
|
1405
|
-
return [
|
|
1727
|
+
case E.identify:
|
|
1728
|
+
return Object.assign({}, e, { userId: n.userId, traits: O({}, e.traits, n.traits) });
|
|
1729
|
+
case E.reset:
|
|
1730
|
+
return [he, ie, Ie].forEach(function(r) {
|
|
1406
1731
|
t.removeItem(r);
|
|
1407
1732
|
}), Object.assign({}, e, { userId: null, anonymousId: null, traits: {} });
|
|
1408
1733
|
default:
|
|
@@ -1410,357 +1735,357 @@ function ni(t) {
|
|
|
1410
1735
|
}
|
|
1411
1736
|
};
|
|
1412
1737
|
}
|
|
1413
|
-
function
|
|
1414
|
-
return { userId: t.getItem(
|
|
1738
|
+
function en(t) {
|
|
1739
|
+
return { userId: t.getItem(he), anonymousId: t.getItem(ie), traits: t.getItem(Ie) };
|
|
1415
1740
|
}
|
|
1416
|
-
var
|
|
1417
|
-
return
|
|
1741
|
+
var St = function(t) {
|
|
1742
|
+
return me + "TEMP" + me + t;
|
|
1418
1743
|
};
|
|
1419
|
-
function
|
|
1744
|
+
function $i(t) {
|
|
1420
1745
|
var e = t.storage, n = e.setItem, r = e.removeItem, i = e.getItem;
|
|
1421
1746
|
return function(o) {
|
|
1422
1747
|
return function(a) {
|
|
1423
1748
|
return function(s) {
|
|
1424
|
-
var
|
|
1425
|
-
if (s.type ===
|
|
1426
|
-
r(
|
|
1427
|
-
}), [te,
|
|
1428
|
-
|
|
1429
|
-
})), s.type ===
|
|
1430
|
-
i(ie) || n(ie,
|
|
1431
|
-
var c = i(
|
|
1432
|
-
c && c !==
|
|
1749
|
+
var p = s.userId, m = s.traits, u = s.options;
|
|
1750
|
+
if (s.type === E.reset && ([he, Ie, ie].forEach(function(d) {
|
|
1751
|
+
r(d);
|
|
1752
|
+
}), [te, ke, "traits"].forEach(function(d) {
|
|
1753
|
+
je(St(d));
|
|
1754
|
+
})), s.type === E.identify) {
|
|
1755
|
+
i(ie) || n(ie, ot());
|
|
1756
|
+
var c = i(he), f = i(Ie) || {};
|
|
1757
|
+
c && c !== p && o.dispatch({ type: E.userIdChanged, old: { userId: c, traits: f }, new: { userId: p, traits: m }, options: u }), p && n(he, p), m && n(Ie, O({}, f, m));
|
|
1433
1758
|
}
|
|
1434
1759
|
return a(s);
|
|
1435
1760
|
};
|
|
1436
1761
|
};
|
|
1437
1762
|
};
|
|
1438
1763
|
}
|
|
1439
|
-
var
|
|
1440
|
-
function
|
|
1441
|
-
|
|
1764
|
+
var Ne = {};
|
|
1765
|
+
function tn(t, e) {
|
|
1766
|
+
Ne[t] && B(Ne[t]) && (Ne[t](e), delete Ne[t]);
|
|
1442
1767
|
}
|
|
1443
|
-
function
|
|
1768
|
+
function Jn(t, e, n) {
|
|
1444
1769
|
return new Promise(function(r, i) {
|
|
1445
|
-
return e() ? r(t) : n < 1 ? i(
|
|
1770
|
+
return e() ? r(t) : n < 1 ? i(O({}, t, { queue: !0 })) : new Promise(function(o) {
|
|
1446
1771
|
return setTimeout(o, 10);
|
|
1447
1772
|
}).then(function(o) {
|
|
1448
|
-
return
|
|
1773
|
+
return Jn(t, e, n - 10).then(r, i);
|
|
1449
1774
|
});
|
|
1450
1775
|
});
|
|
1451
1776
|
}
|
|
1452
|
-
function
|
|
1777
|
+
function Hn(t, e, n) {
|
|
1453
1778
|
var r = e(), i = t.getState(), o = i.plugins, a = i.queue, s = i.user;
|
|
1454
1779
|
if (!i.context.offline && a && a.actions && a.actions.length) {
|
|
1455
|
-
var
|
|
1456
|
-
return o[c.plugin].loaded ? (u.process.push(c), u.processIndex.push(
|
|
1780
|
+
var p = a.actions.reduce(function(u, c, f) {
|
|
1781
|
+
return o[c.plugin].loaded ? (u.process.push(c), u.processIndex.push(f)) : (u.requeue.push(c), u.requeueIndex.push(f)), u;
|
|
1457
1782
|
}, { processIndex: [], process: [], requeue: [], requeueIndex: [] });
|
|
1458
|
-
if (
|
|
1459
|
-
|
|
1460
|
-
var c = a.actions[u],
|
|
1461
|
-
if (v &&
|
|
1462
|
-
var
|
|
1463
|
-
return
|
|
1464
|
-
return
|
|
1465
|
-
},
|
|
1783
|
+
if (p.processIndex && p.processIndex.length) {
|
|
1784
|
+
p.processIndex.forEach(function(u) {
|
|
1785
|
+
var c = a.actions[u], f = c.plugin, d = c.payload.type, v = r[f][d];
|
|
1786
|
+
if (v && B(v)) {
|
|
1787
|
+
var k = function(I, _) {
|
|
1788
|
+
return I === void 0 && (I = {}), _ === void 0 && (_ = {}), [te, ke].reduce(function(y, l) {
|
|
1789
|
+
return I.hasOwnProperty(l) && _[l] && _[l] !== I[l] && (y[l] = _[l]), y;
|
|
1790
|
+
}, I);
|
|
1466
1791
|
}(c.payload, s);
|
|
1467
|
-
v({ payload:
|
|
1468
|
-
var
|
|
1469
|
-
t.dispatch(
|
|
1792
|
+
v({ payload: k, config: o[f].config, instance: n });
|
|
1793
|
+
var w = d + ":" + f;
|
|
1794
|
+
t.dispatch(O({}, k, { type: w, _: { called: w, from: "queueDrain" } }));
|
|
1470
1795
|
}
|
|
1471
1796
|
});
|
|
1472
1797
|
var m = a.actions.filter(function(u, c) {
|
|
1473
|
-
return !~
|
|
1798
|
+
return !~p.processIndex.indexOf(c);
|
|
1474
1799
|
});
|
|
1475
1800
|
a.actions = m;
|
|
1476
1801
|
}
|
|
1477
1802
|
}
|
|
1478
1803
|
}
|
|
1479
|
-
var
|
|
1480
|
-
var e = t.data, n = t.action, r = t.instance, i = t.state, o = t.allPlugins, a = t.allMatches, s = t.store,
|
|
1804
|
+
var ft = function(t) {
|
|
1805
|
+
var e = t.data, n = t.action, r = t.instance, i = t.state, o = t.allPlugins, a = t.allMatches, s = t.store, p = t.EVENTS;
|
|
1481
1806
|
try {
|
|
1482
|
-
var m = i.plugins, u = i.context, c = n.type,
|
|
1483
|
-
return
|
|
1807
|
+
var m = i.plugins, u = i.context, c = n.type, f = c.match(_e), d = e.exact.map(function(w) {
|
|
1808
|
+
return w.pluginName;
|
|
1484
1809
|
});
|
|
1485
|
-
|
|
1486
|
-
return
|
|
1810
|
+
f && (d = a.during.map(function(w) {
|
|
1811
|
+
return w.pluginName;
|
|
1487
1812
|
}));
|
|
1488
|
-
var v = /* @__PURE__ */ function(
|
|
1489
|
-
return function(_,
|
|
1490
|
-
var b =
|
|
1491
|
-
|
|
1492
|
-
var
|
|
1493
|
-
return function(
|
|
1494
|
-
var K = U ? U.name :
|
|
1495
|
-
if (U && (!(M =
|
|
1496
|
-
throw new Error("Method " + L + " can only abort " +
|
|
1497
|
-
return
|
|
1813
|
+
var v = /* @__PURE__ */ function(w, I) {
|
|
1814
|
+
return function(_, y, l) {
|
|
1815
|
+
var b = y.config, T = y.name, x = T + "." + _.type;
|
|
1816
|
+
l && (x = l.event);
|
|
1817
|
+
var j = _.type.match(_e) ? /* @__PURE__ */ function(D, L, F, U, J) {
|
|
1818
|
+
return function(Z, P) {
|
|
1819
|
+
var K = U ? U.name : D, M = P && Ze(P) ? P : F;
|
|
1820
|
+
if (U && (!(M = P && Ze(P) ? P : [D]).includes(D) || M.length !== 1))
|
|
1821
|
+
throw new Error("Method " + L + " can only abort " + D + " plugin. " + JSON.stringify(M) + " input valid");
|
|
1822
|
+
return O({}, J, { abort: { reason: Z, plugins: M, caller: L, _: K } });
|
|
1498
1823
|
};
|
|
1499
|
-
}(
|
|
1824
|
+
}(T, x, I, l, _) : /* @__PURE__ */ function(D, L) {
|
|
1500
1825
|
return function() {
|
|
1501
|
-
throw new Error(
|
|
1826
|
+
throw new Error(D.type + " action not cancellable. Remove abort in " + L);
|
|
1502
1827
|
};
|
|
1503
|
-
}(_,
|
|
1504
|
-
return { payload:
|
|
1828
|
+
}(_, x);
|
|
1829
|
+
return { payload: zi(_), instance: w, config: b || {}, abort: j };
|
|
1505
1830
|
};
|
|
1506
|
-
}(r,
|
|
1507
|
-
var _ =
|
|
1508
|
-
return
|
|
1831
|
+
}(r, d), k = e.exact.reduce(function(w, I) {
|
|
1832
|
+
var _ = I.pluginName, y = I.methodName, l = !1;
|
|
1833
|
+
return y.match(/^initialize/) || y.match(/^reset/) || (l = !m[_].loaded), u.offline && y.match(/^(page|track|identify)/) && (l = !0), w["" + _] = l, w;
|
|
1509
1834
|
}, {});
|
|
1510
|
-
return Promise.resolve(e.exact.reduce(function(
|
|
1835
|
+
return Promise.resolve(e.exact.reduce(function(w, I, _) {
|
|
1511
1836
|
try {
|
|
1512
|
-
var
|
|
1513
|
-
return Promise.resolve(
|
|
1837
|
+
var y = I.pluginName;
|
|
1838
|
+
return Promise.resolve(w).then(function(l) {
|
|
1514
1839
|
function b() {
|
|
1515
|
-
return Promise.resolve(
|
|
1840
|
+
return Promise.resolve(l);
|
|
1516
1841
|
}
|
|
1517
|
-
var
|
|
1518
|
-
if (e.namespaced && e.namespaced[
|
|
1519
|
-
return Promise.resolve(e.namespaced[
|
|
1842
|
+
var T = function() {
|
|
1843
|
+
if (e.namespaced && e.namespaced[y])
|
|
1844
|
+
return Promise.resolve(e.namespaced[y].reduce(function(x, j, D) {
|
|
1520
1845
|
try {
|
|
1521
|
-
return Promise.resolve(
|
|
1522
|
-
return
|
|
1523
|
-
var K =
|
|
1524
|
-
if (K && K.name ===
|
|
1525
|
-
var M =
|
|
1526
|
-
throw new Error([
|
|
1846
|
+
return Promise.resolve(x).then(function(L) {
|
|
1847
|
+
return j.method && B(j.method) ? (function(Z, P) {
|
|
1848
|
+
var K = un(Z);
|
|
1849
|
+
if (K && K.name === P) {
|
|
1850
|
+
var M = un(K.method);
|
|
1851
|
+
throw new Error([P + " plugin is calling method " + Z, "Plugins cant call self", "Use " + K.method + " " + (M ? "or " + M.method : "") + " in " + P + " plugin insteadof " + Z].join(`
|
|
1527
1852
|
`));
|
|
1528
1853
|
}
|
|
1529
|
-
}(
|
|
1530
|
-
return
|
|
1531
|
-
}), config:
|
|
1532
|
-
var
|
|
1533
|
-
return Promise.resolve(
|
|
1854
|
+
}(j.methodName, j.pluginName), Promise.resolve(j.method({ payload: L, instance: r, abort: (F = L, U = y, J = j.pluginName, function(Z, P) {
|
|
1855
|
+
return O({}, F, { abort: { reason: Z, plugins: P || [U], caller: c, from: J || U } });
|
|
1856
|
+
}), config: on(j.pluginName, m, o), plugins: m })).then(function(Z) {
|
|
1857
|
+
var P = H(Z) ? Z : {};
|
|
1858
|
+
return Promise.resolve(O({}, L, P));
|
|
1534
1859
|
})) : L;
|
|
1535
|
-
var
|
|
1860
|
+
var F, U, J;
|
|
1536
1861
|
});
|
|
1537
1862
|
} catch (L) {
|
|
1538
1863
|
return Promise.reject(L);
|
|
1539
1864
|
}
|
|
1540
|
-
}, Promise.resolve(n))).then(function(
|
|
1541
|
-
|
|
1865
|
+
}, Promise.resolve(n))).then(function(x) {
|
|
1866
|
+
l[y] = x;
|
|
1542
1867
|
});
|
|
1543
|
-
|
|
1868
|
+
l[y] = n;
|
|
1544
1869
|
}();
|
|
1545
|
-
return
|
|
1870
|
+
return T && T.then ? T.then(b) : b();
|
|
1546
1871
|
});
|
|
1547
|
-
} catch (
|
|
1548
|
-
return Promise.reject(
|
|
1872
|
+
} catch (l) {
|
|
1873
|
+
return Promise.reject(l);
|
|
1549
1874
|
}
|
|
1550
|
-
}, Promise.resolve({}))).then(function(
|
|
1551
|
-
return Promise.resolve(e.exact.reduce(function(
|
|
1875
|
+
}, Promise.resolve({}))).then(function(w) {
|
|
1876
|
+
return Promise.resolve(e.exact.reduce(function(I, _, y) {
|
|
1552
1877
|
try {
|
|
1553
|
-
var
|
|
1554
|
-
return Promise.resolve(
|
|
1555
|
-
var
|
|
1556
|
-
if (
|
|
1557
|
-
return
|
|
1558
|
-
if (
|
|
1559
|
-
return
|
|
1560
|
-
if (
|
|
1561
|
-
return s.dispatch({ type: "queue", plugin: b, payload:
|
|
1562
|
-
var
|
|
1563
|
-
return Promise.resolve(
|
|
1564
|
-
var
|
|
1565
|
-
if (
|
|
1566
|
-
|
|
1878
|
+
var l = e.exact.length === y + 1, b = _.pluginName, T = o[b];
|
|
1879
|
+
return Promise.resolve(I).then(function(x) {
|
|
1880
|
+
var j = w[b] ? w[b] : {};
|
|
1881
|
+
if (f && (j = x), mt(j, b))
|
|
1882
|
+
return pt({ data: j, method: c, instance: r, pluginName: b, store: s }), Promise.resolve(x);
|
|
1883
|
+
if (mt(x, b))
|
|
1884
|
+
return l && pt({ data: x, method: c, instance: r, store: s }), Promise.resolve(x);
|
|
1885
|
+
if (k.hasOwnProperty(b) && k[b] === !0)
|
|
1886
|
+
return s.dispatch({ type: "queue", plugin: b, payload: j, _: { called: "queue", from: "queueMechanism" } }), Promise.resolve(x);
|
|
1887
|
+
var D = v(w[b], o[b]);
|
|
1888
|
+
return Promise.resolve(T[c]({ abort: D.abort, payload: j, instance: r, config: on(b, m, o), plugins: m })).then(function(L) {
|
|
1889
|
+
var F = H(L) ? L : {}, U = O({}, x, F), J = w[b];
|
|
1890
|
+
if (mt(J, b))
|
|
1891
|
+
pt({ data: J, method: c, instance: r, pluginName: b, store: s });
|
|
1567
1892
|
else {
|
|
1568
|
-
var
|
|
1569
|
-
(
|
|
1893
|
+
var Z = c + ":" + b;
|
|
1894
|
+
(Z.match(/:/g) || []).length < 2 && !c.match(nn) && !c.match(rn) && r.dispatch(O({}, f ? U : j, { type: Z, _: { called: Z, from: "submethod" } }));
|
|
1570
1895
|
}
|
|
1571
1896
|
return Promise.resolve(U);
|
|
1572
1897
|
});
|
|
1573
1898
|
});
|
|
1574
|
-
} catch (
|
|
1575
|
-
return Promise.reject(
|
|
1899
|
+
} catch (x) {
|
|
1900
|
+
return Promise.reject(x);
|
|
1576
1901
|
}
|
|
1577
|
-
}, Promise.resolve(n))).then(function(
|
|
1578
|
-
if (!(c.match(
|
|
1579
|
-
if (
|
|
1580
|
-
return
|
|
1581
|
-
var _ =
|
|
1582
|
-
|
|
1902
|
+
}, Promise.resolve(n))).then(function(I) {
|
|
1903
|
+
if (!(c.match(_e) || c.match(/^registerPlugin/) || c.match(rn) || c.match(nn) || c.match(/^params/) || c.match(/^userIdChanged/))) {
|
|
1904
|
+
if (p.plugins.includes(c), I._ && I._.originalAction === c)
|
|
1905
|
+
return I;
|
|
1906
|
+
var _ = O({}, I, { _: { originalAction: I.type, called: I.type, from: "engineEnd" } });
|
|
1907
|
+
Vn(I, e.exact.length) && !c.match(/End$/) && (_ = O({}, _, { type: I.type + "Aborted" })), s.dispatch(_);
|
|
1583
1908
|
}
|
|
1584
|
-
return
|
|
1909
|
+
return I;
|
|
1585
1910
|
});
|
|
1586
1911
|
});
|
|
1587
|
-
} catch (
|
|
1588
|
-
return Promise.reject(
|
|
1912
|
+
} catch (w) {
|
|
1913
|
+
return Promise.reject(w);
|
|
1589
1914
|
}
|
|
1590
|
-
},
|
|
1591
|
-
function
|
|
1915
|
+
}, _e = /Start$/, nn = /^bootstrap/, rn = /^ready/;
|
|
1916
|
+
function pt(t) {
|
|
1592
1917
|
var e = t.pluginName, n = t.method + "Aborted" + (e ? ":" + e : "");
|
|
1593
|
-
t.store.dispatch(
|
|
1918
|
+
t.store.dispatch(O({}, t.data, { type: n, _: { called: n, from: "abort" } }));
|
|
1594
1919
|
}
|
|
1595
|
-
function
|
|
1920
|
+
function on(t, e, n) {
|
|
1596
1921
|
var r = e[t] || n[t];
|
|
1597
1922
|
return r && r.config ? r.config : {};
|
|
1598
1923
|
}
|
|
1599
|
-
function
|
|
1924
|
+
function an(t, e) {
|
|
1600
1925
|
return e.reduce(function(n, r) {
|
|
1601
1926
|
return r[t] ? n.concat({ methodName: t, pluginName: r.name, method: r[t] }) : n;
|
|
1602
1927
|
}, []);
|
|
1603
1928
|
}
|
|
1604
|
-
function
|
|
1605
|
-
var n = t.replace(
|
|
1929
|
+
function sn(t, e) {
|
|
1930
|
+
var n = t.replace(_e, ""), r = e ? ":" + e : "";
|
|
1606
1931
|
return ["" + t + r, "" + n + r, n + "End" + r];
|
|
1607
1932
|
}
|
|
1608
|
-
function
|
|
1933
|
+
function mt(t, e) {
|
|
1609
1934
|
var n = t.abort;
|
|
1610
|
-
return !!n && (n === !0 ||
|
|
1935
|
+
return !!n && (n === !0 || cn(n, e) || n && cn(n.plugins, e));
|
|
1611
1936
|
}
|
|
1612
|
-
function
|
|
1937
|
+
function Vn(t, e) {
|
|
1613
1938
|
var n = t.abort;
|
|
1614
1939
|
if (!n)
|
|
1615
1940
|
return !1;
|
|
1616
1941
|
if (n === !0 || re(n))
|
|
1617
1942
|
return !0;
|
|
1618
1943
|
var r = n.plugins;
|
|
1619
|
-
return
|
|
1944
|
+
return Ze(n) && n.length === e || Ze(r) && r.length === e;
|
|
1620
1945
|
}
|
|
1621
|
-
function
|
|
1946
|
+
function Ze(t) {
|
|
1622
1947
|
return Array.isArray(t);
|
|
1623
1948
|
}
|
|
1624
|
-
function
|
|
1625
|
-
return !(!t || !
|
|
1949
|
+
function cn(t, e) {
|
|
1950
|
+
return !(!t || !Ze(t)) && t.includes(e);
|
|
1626
1951
|
}
|
|
1627
|
-
function
|
|
1952
|
+
function un(t) {
|
|
1628
1953
|
var e = t.match(/(.*):(.*)/);
|
|
1629
1954
|
return !!e && { method: e[1], name: e[2] };
|
|
1630
1955
|
}
|
|
1631
|
-
function
|
|
1956
|
+
function zi(t) {
|
|
1632
1957
|
return Object.keys(t).reduce(function(e, n) {
|
|
1633
|
-
return n === "type" || (e[n] =
|
|
1958
|
+
return n === "type" || (e[n] = H(t[n]) ? Object.assign({}, t[n]) : t[n]), e;
|
|
1634
1959
|
}, {});
|
|
1635
1960
|
}
|
|
1636
|
-
function
|
|
1961
|
+
function Ai(t, e, n) {
|
|
1637
1962
|
var r = {};
|
|
1638
1963
|
return function(i) {
|
|
1639
1964
|
return function(o) {
|
|
1640
1965
|
return function(a) {
|
|
1641
1966
|
try {
|
|
1642
|
-
var s,
|
|
1643
|
-
return s ?
|
|
1967
|
+
var s, p = function(l) {
|
|
1968
|
+
return s ? l : o(c);
|
|
1644
1969
|
}, m = a.type, u = a.plugins, c = a;
|
|
1645
1970
|
if (a.abort)
|
|
1646
1971
|
return Promise.resolve(o(a));
|
|
1647
|
-
if (m ===
|
|
1648
|
-
return
|
|
1649
|
-
}, 0), m ===
|
|
1650
|
-
var
|
|
1651
|
-
return u.includes(
|
|
1652
|
-
}).map(function(
|
|
1653
|
-
return
|
|
1654
|
-
}),
|
|
1655
|
-
var b =
|
|
1656
|
-
return
|
|
1657
|
-
return b({ config:
|
|
1658
|
-
}, 1e4).then(function(
|
|
1659
|
-
return r[
|
|
1660
|
-
return !
|
|
1661
|
-
}) }), r[
|
|
1662
|
-
}).catch(function(
|
|
1663
|
-
if (
|
|
1664
|
-
throw new Error(
|
|
1665
|
-
return
|
|
1972
|
+
if (m === E.enablePlugin && i.dispatch({ type: E.initializeStart, plugins: u, disabled: [], fromEnable: !0, meta: a.meta }), m === E.disablePlugin && setTimeout(function() {
|
|
1973
|
+
return tn(a.meta.rid, { payload: a });
|
|
1974
|
+
}, 0), m === E.initializeEnd) {
|
|
1975
|
+
var f = e(), d = Object.keys(f), v = d.filter(function(l) {
|
|
1976
|
+
return u.includes(l);
|
|
1977
|
+
}).map(function(l) {
|
|
1978
|
+
return f[l];
|
|
1979
|
+
}), k = [], w = [], I = a.disabled, _ = v.map(function(l) {
|
|
1980
|
+
var b = l.loaded, T = l.name, x = l.config;
|
|
1981
|
+
return Jn(l, function() {
|
|
1982
|
+
return b({ config: x });
|
|
1983
|
+
}, 1e4).then(function(j) {
|
|
1984
|
+
return r[T] || (i.dispatch({ type: E.pluginReadyType(T), name: T, events: Object.keys(l).filter(function(D) {
|
|
1985
|
+
return !_t.includes(D);
|
|
1986
|
+
}) }), r[T] = !0), k = k.concat(T), l;
|
|
1987
|
+
}).catch(function(j) {
|
|
1988
|
+
if (j instanceof Error)
|
|
1989
|
+
throw new Error(j);
|
|
1990
|
+
return w = w.concat(j.name), j;
|
|
1666
1991
|
});
|
|
1667
1992
|
});
|
|
1668
|
-
Promise.all(_).then(function(
|
|
1669
|
-
var b = { plugins:
|
|
1993
|
+
Promise.all(_).then(function(l) {
|
|
1994
|
+
var b = { plugins: k, failed: w, disabled: I };
|
|
1670
1995
|
setTimeout(function() {
|
|
1671
|
-
|
|
1996
|
+
d.length === _.length + I.length && i.dispatch(O({}, { type: E.ready }, b));
|
|
1672
1997
|
}, 0);
|
|
1673
1998
|
});
|
|
1674
1999
|
}
|
|
1675
|
-
var
|
|
1676
|
-
if (m !==
|
|
2000
|
+
var y = function() {
|
|
2001
|
+
if (m !== E.bootstrap)
|
|
1677
2002
|
return /^ready:([^:]*)$/.test(m) && setTimeout(function() {
|
|
1678
|
-
return
|
|
1679
|
-
}, 0), Promise.resolve(function(
|
|
2003
|
+
return Hn(i, e, t);
|
|
2004
|
+
}, 0), Promise.resolve(function(l, b, T, x, j) {
|
|
1680
2005
|
try {
|
|
1681
|
-
var
|
|
1682
|
-
if (
|
|
1683
|
-
return Promise.resolve(
|
|
1684
|
-
var U =
|
|
1685
|
-
var
|
|
1686
|
-
return
|
|
1687
|
-
}).map(function(
|
|
1688
|
-
return K[
|
|
2006
|
+
var D = B(b) ? b() : b, L = l.type, F = L.replace(_e, "");
|
|
2007
|
+
if (l._ && l._.called)
|
|
2008
|
+
return Promise.resolve(l);
|
|
2009
|
+
var U = T.getState(), J = (K = D, (M = U.plugins) === void 0 && (M = {}), (Ce = l.options) === void 0 && (Ce = {}), Object.keys(K).filter(function(h) {
|
|
2010
|
+
var g = Ce.plugins || {};
|
|
2011
|
+
return gi(g[h]) ? g[h] : g.all !== !1 && (!M[h] || M[h].enabled !== !1);
|
|
2012
|
+
}).map(function(h) {
|
|
2013
|
+
return K[h];
|
|
1689
2014
|
}));
|
|
1690
|
-
L ===
|
|
1691
|
-
var
|
|
1692
|
-
return
|
|
1693
|
-
}).map(function(
|
|
1694
|
-
return
|
|
2015
|
+
L === E.initializeStart && l.fromEnable && (J = Object.keys(U.plugins).filter(function(h) {
|
|
2016
|
+
var g = U.plugins[h];
|
|
2017
|
+
return l.plugins.includes(h) && !g.initialized;
|
|
2018
|
+
}).map(function(h) {
|
|
2019
|
+
return D[h];
|
|
1695
2020
|
}));
|
|
1696
|
-
var
|
|
1697
|
-
return
|
|
1698
|
-
}),
|
|
1699
|
-
var
|
|
1700
|
-
return
|
|
2021
|
+
var Z = J.map(function(h) {
|
|
2022
|
+
return h.name;
|
|
2023
|
+
}), P = function(h, g, S) {
|
|
2024
|
+
var C = sn(h).map(function($) {
|
|
2025
|
+
return an($, g);
|
|
1701
2026
|
});
|
|
1702
|
-
return
|
|
1703
|
-
var W =
|
|
1704
|
-
return
|
|
1705
|
-
}),
|
|
1706
|
-
return
|
|
1707
|
-
}, { before:
|
|
1708
|
-
}(L,
|
|
1709
|
-
return Promise.resolve(
|
|
1710
|
-
function
|
|
1711
|
-
var
|
|
1712
|
-
if (L.match(
|
|
1713
|
-
return Promise.resolve(
|
|
1714
|
-
|
|
2027
|
+
return g.reduce(function($, z) {
|
|
2028
|
+
var W = z.name, N = sn(h, W).map(function($e) {
|
|
2029
|
+
return an($e, g);
|
|
2030
|
+
}), R = N[0], A = N[1], q = N[2];
|
|
2031
|
+
return R.length && ($.beforeNS[W] = R), A.length && ($.duringNS[W] = A), q.length && ($.afterNS[W] = q), $;
|
|
2032
|
+
}, { before: C[0], beforeNS: {}, during: C[1], duringNS: {}, after: C[2], afterNS: {} });
|
|
2033
|
+
}(L, J);
|
|
2034
|
+
return Promise.resolve(ft({ action: l, data: { exact: P.before, namespaced: P.beforeNS }, state: U, allPlugins: D, allMatches: P, instance: T, store: x, EVENTS: j })).then(function(h) {
|
|
2035
|
+
function g() {
|
|
2036
|
+
var $ = function() {
|
|
2037
|
+
if (L.match(_e))
|
|
2038
|
+
return Promise.resolve(ft({ action: O({}, S, { type: F + "End" }), data: { exact: P.after, namespaced: P.afterNS }, state: U, allPlugins: D, allMatches: P, instance: T, store: x, EVENTS: j })).then(function(z) {
|
|
2039
|
+
z.meta && z.meta.hasCallback && tn(z.meta.rid, { payload: z });
|
|
1715
2040
|
});
|
|
1716
2041
|
}();
|
|
1717
|
-
return
|
|
1718
|
-
return
|
|
1719
|
-
}) :
|
|
2042
|
+
return $ && $.then ? $.then(function() {
|
|
2043
|
+
return h;
|
|
2044
|
+
}) : h;
|
|
1720
2045
|
}
|
|
1721
|
-
if (
|
|
1722
|
-
return
|
|
1723
|
-
var S,
|
|
1724
|
-
if (L !==
|
|
1725
|
-
return Promise.resolve(
|
|
1726
|
-
S =
|
|
2046
|
+
if (Vn(h, Z.length))
|
|
2047
|
+
return h;
|
|
2048
|
+
var S, C = function() {
|
|
2049
|
+
if (L !== F)
|
|
2050
|
+
return Promise.resolve(ft({ action: O({}, h, { type: F }), data: { exact: P.during, namespaced: P.duringNS }, state: U, allPlugins: D, allMatches: P, instance: T, store: x, EVENTS: j })).then(function($) {
|
|
2051
|
+
S = $;
|
|
1727
2052
|
});
|
|
1728
|
-
S =
|
|
2053
|
+
S = h;
|
|
1729
2054
|
}();
|
|
1730
|
-
return
|
|
2055
|
+
return C && C.then ? C.then(g) : g();
|
|
1731
2056
|
});
|
|
1732
|
-
} catch (
|
|
1733
|
-
return Promise.reject(
|
|
2057
|
+
} catch (h) {
|
|
2058
|
+
return Promise.reject(h);
|
|
1734
2059
|
}
|
|
1735
|
-
var K, M,
|
|
1736
|
-
}(a, e, t, i, n)).then(function(
|
|
1737
|
-
return s = 1, o(
|
|
2060
|
+
var K, M, Ce;
|
|
2061
|
+
}(a, e, t, i, n)).then(function(l) {
|
|
2062
|
+
return s = 1, o(l);
|
|
1738
2063
|
});
|
|
1739
2064
|
}();
|
|
1740
|
-
return Promise.resolve(
|
|
1741
|
-
} catch (
|
|
1742
|
-
return Promise.reject(
|
|
2065
|
+
return Promise.resolve(y && y.then ? y.then(p) : p(y));
|
|
2066
|
+
} catch (l) {
|
|
2067
|
+
return Promise.reject(l);
|
|
1743
2068
|
}
|
|
1744
2069
|
};
|
|
1745
2070
|
};
|
|
1746
2071
|
};
|
|
1747
2072
|
}
|
|
1748
|
-
function
|
|
2073
|
+
function Ni(t) {
|
|
1749
2074
|
return function(e) {
|
|
1750
2075
|
return function(n) {
|
|
1751
2076
|
return function(r) {
|
|
1752
2077
|
var i = r.type, o = r.key, a = r.value, s = r.options;
|
|
1753
|
-
if (i ===
|
|
2078
|
+
if (i === E.setItem || i === E.removeItem) {
|
|
1754
2079
|
if (r.abort)
|
|
1755
2080
|
return n(r);
|
|
1756
|
-
i ===
|
|
2081
|
+
i === E.setItem ? t.setItem(o, a, s) : t.removeItem(o, s);
|
|
1757
2082
|
}
|
|
1758
2083
|
return n(r);
|
|
1759
2084
|
};
|
|
1760
2085
|
};
|
|
1761
2086
|
};
|
|
1762
2087
|
}
|
|
1763
|
-
var
|
|
2088
|
+
var Li = function() {
|
|
1764
2089
|
var t = this;
|
|
1765
2090
|
this.before = [], this.after = [], this.addMiddleware = function(e, n) {
|
|
1766
2091
|
t[n] = t[n].concat(e);
|
|
@@ -1778,441 +2103,441 @@ var si = function() {
|
|
|
1778
2103
|
} }, a = t[e].map(function(s) {
|
|
1779
2104
|
return s(o);
|
|
1780
2105
|
});
|
|
1781
|
-
return
|
|
2106
|
+
return Te.apply(void 0, a)(r)(i);
|
|
1782
2107
|
};
|
|
1783
2108
|
};
|
|
1784
2109
|
};
|
|
1785
2110
|
};
|
|
1786
2111
|
};
|
|
1787
|
-
function
|
|
2112
|
+
function Di(t) {
|
|
1788
2113
|
return function(e, n) {
|
|
1789
2114
|
e === void 0 && (e = {});
|
|
1790
2115
|
var r = {};
|
|
1791
2116
|
if (n.type === "initialize:aborted")
|
|
1792
2117
|
return e;
|
|
1793
2118
|
if (/^registerPlugin:([^:]*)$/.test(n.type)) {
|
|
1794
|
-
var i =
|
|
2119
|
+
var i = ln(n.type, "registerPlugin"), o = t()[i];
|
|
1795
2120
|
if (!o || !i)
|
|
1796
2121
|
return e;
|
|
1797
2122
|
var a = n.enabled, s = o.config;
|
|
1798
|
-
return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s },
|
|
2123
|
+
return r[i] = { enabled: a, initialized: !!a && !o.initialize, loaded: !!a && !!o.loaded({ config: s }), config: s }, O({}, e, r);
|
|
1799
2124
|
}
|
|
1800
2125
|
if (/^initialize:([^:]*)$/.test(n.type)) {
|
|
1801
|
-
var
|
|
1802
|
-
return m &&
|
|
2126
|
+
var p = ln(n.type, E.initialize), m = t()[p];
|
|
2127
|
+
return m && p ? (r[p] = O({}, e[p], { initialized: !0, loaded: !!m.loaded({ config: m.config }) }), O({}, e, r)) : e;
|
|
1803
2128
|
}
|
|
1804
2129
|
if (/^ready:([^:]*)$/.test(n.type))
|
|
1805
|
-
return r[n.name] =
|
|
2130
|
+
return r[n.name] = O({}, e[n.name], { loaded: !0 }), O({}, e, r);
|
|
1806
2131
|
switch (n.type) {
|
|
1807
|
-
case
|
|
1808
|
-
return
|
|
1809
|
-
case
|
|
1810
|
-
return
|
|
2132
|
+
case E.disablePlugin:
|
|
2133
|
+
return O({}, e, dn(n.plugins, !1, e));
|
|
2134
|
+
case E.enablePlugin:
|
|
2135
|
+
return O({}, e, dn(n.plugins, !0, e));
|
|
1811
2136
|
default:
|
|
1812
2137
|
return e;
|
|
1813
2138
|
}
|
|
1814
2139
|
};
|
|
1815
2140
|
}
|
|
1816
|
-
function
|
|
2141
|
+
function ln(t, e) {
|
|
1817
2142
|
return t.substring(e.length + 1, t.length);
|
|
1818
2143
|
}
|
|
1819
|
-
function
|
|
2144
|
+
function dn(t, e, n) {
|
|
1820
2145
|
return t.reduce(function(r, i) {
|
|
1821
|
-
return r[i] =
|
|
2146
|
+
return r[i] = O({}, n[i], { enabled: e }), r;
|
|
1822
2147
|
}, n);
|
|
1823
2148
|
}
|
|
1824
|
-
function
|
|
2149
|
+
function Yn(t) {
|
|
1825
2150
|
try {
|
|
1826
2151
|
return JSON.parse(JSON.stringify(t));
|
|
1827
2152
|
} catch {
|
|
1828
2153
|
}
|
|
1829
2154
|
return t;
|
|
1830
2155
|
}
|
|
1831
|
-
var
|
|
1832
|
-
function
|
|
1833
|
-
t === void 0 && (t =
|
|
2156
|
+
var Ui = { last: {}, history: [] };
|
|
2157
|
+
function Ri(t, e) {
|
|
2158
|
+
t === void 0 && (t = Ui);
|
|
1834
2159
|
var n = e.options, r = e.meta;
|
|
1835
|
-
if (e.type ===
|
|
1836
|
-
var i =
|
|
1837
|
-
return
|
|
2160
|
+
if (e.type === E.track) {
|
|
2161
|
+
var i = Yn(O({ event: e.event, properties: e.properties }, Object.keys(n).length && { options: n }, { meta: r }));
|
|
2162
|
+
return O({}, t, { last: i, history: t.history.concat(i) });
|
|
1838
2163
|
}
|
|
1839
2164
|
return t;
|
|
1840
2165
|
}
|
|
1841
|
-
var
|
|
1842
|
-
function
|
|
1843
|
-
t === void 0 && (t =
|
|
2166
|
+
var Zi = { actions: [] };
|
|
2167
|
+
function Wi(t, e) {
|
|
2168
|
+
t === void 0 && (t = Zi);
|
|
1844
2169
|
var n = e.payload;
|
|
1845
2170
|
switch (e.type) {
|
|
1846
2171
|
case "queue":
|
|
1847
2172
|
var r;
|
|
1848
|
-
return r = n && n.type && n.type ===
|
|
2173
|
+
return r = n && n.type && n.type === E.identify ? [e].concat(t.actions) : t.actions.concat(e), O({}, t, { actions: r });
|
|
1849
2174
|
case "dequeue":
|
|
1850
2175
|
return [];
|
|
1851
2176
|
default:
|
|
1852
2177
|
return t;
|
|
1853
2178
|
}
|
|
1854
2179
|
}
|
|
1855
|
-
var
|
|
1856
|
-
function
|
|
2180
|
+
var Gn = /#.*$/;
|
|
2181
|
+
function Ki(t) {
|
|
1857
2182
|
var e = /(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);
|
|
1858
|
-
return "/" + (e && e[3] ? e[3].split("?")[0].replace(
|
|
2183
|
+
return "/" + (e && e[3] ? e[3].split("?")[0].replace(Gn, "") : "");
|
|
1859
2184
|
}
|
|
1860
|
-
var
|
|
1861
|
-
if (t === void 0 && (t = {}), !
|
|
2185
|
+
var Bn, qn, Qn, er, Mi = function(t) {
|
|
2186
|
+
if (t === void 0 && (t = {}), !Y)
|
|
1862
2187
|
return t;
|
|
1863
|
-
var e = document, n = e.title, r = e.referrer, i = window, o = i.location, a = i.innerWidth, s = i.innerHeight,
|
|
1864
|
-
var
|
|
1865
|
-
if (
|
|
1866
|
-
for (var v,
|
|
2188
|
+
var e = document, n = e.title, r = e.referrer, i = window, o = i.location, a = i.innerWidth, s = i.innerHeight, p = o.hash, m = o.search, u = function(f) {
|
|
2189
|
+
var d = function() {
|
|
2190
|
+
if (Y) {
|
|
2191
|
+
for (var v, k = document.getElementsByTagName("link"), w = 0; v = k[w]; w++)
|
|
1867
2192
|
if (v.getAttribute("rel") === "canonical")
|
|
1868
2193
|
return v.getAttribute("href");
|
|
1869
2194
|
}
|
|
1870
2195
|
}();
|
|
1871
|
-
return
|
|
1872
|
-
}(m), c = { title: n, url: u, path:
|
|
1873
|
-
return r && r !== "" && (c.referrer = r),
|
|
1874
|
-
},
|
|
1875
|
-
function
|
|
1876
|
-
t === void 0 && (t =
|
|
2196
|
+
return d ? d.match(/\?/) ? d : d + f : window.location.href.replace(Gn, "");
|
|
2197
|
+
}(m), c = { title: n, url: u, path: Ki(u), hash: p, search: m, width: a, height: s };
|
|
2198
|
+
return r && r !== "" && (c.referrer = r), O({}, c, t);
|
|
2199
|
+
}, Xi = { last: {}, history: [] };
|
|
2200
|
+
function Fi(t, e) {
|
|
2201
|
+
t === void 0 && (t = Xi);
|
|
1877
2202
|
var n = e.options;
|
|
1878
|
-
if (e.type ===
|
|
1879
|
-
var r =
|
|
1880
|
-
return
|
|
2203
|
+
if (e.type === E.page) {
|
|
2204
|
+
var r = Yn(O({ properties: e.properties, meta: e.meta }, Object.keys(n).length && { options: n }));
|
|
2205
|
+
return O({}, t, { last: r, history: t.history.concat(r) });
|
|
1881
2206
|
}
|
|
1882
2207
|
return t;
|
|
1883
2208
|
}
|
|
1884
|
-
|
|
1885
|
-
if (!
|
|
2209
|
+
Bn = function() {
|
|
2210
|
+
if (!Y)
|
|
1886
2211
|
return !1;
|
|
1887
2212
|
var t = navigator.appVersion;
|
|
1888
2213
|
return ~t.indexOf("Win") ? "Windows" : ~t.indexOf("Mac") ? "MacOS" : ~t.indexOf("X11") ? "UNIX" : ~t.indexOf("Linux") ? "Linux" : "Unknown OS";
|
|
1889
|
-
}(),
|
|
1890
|
-
var
|
|
1891
|
-
function
|
|
1892
|
-
t === void 0 && (t =
|
|
2214
|
+
}(), qn = Y ? document.referrer : null, Qn = _i(), er = Si();
|
|
2215
|
+
var hn = { initialized: !1, sessionId: ot(), app: null, version: null, debug: !1, offline: !!Y && !navigator.onLine, os: { name: Bn }, userAgent: Y ? navigator.userAgent : "node", library: { name: "analytics", version: "0.12.5" }, timezone: er, locale: Qn, campaign: {}, referrer: qn };
|
|
2216
|
+
function Ji(t, e) {
|
|
2217
|
+
t === void 0 && (t = hn);
|
|
1893
2218
|
var n = t.initialized, r = e.campaign;
|
|
1894
2219
|
switch (e.type) {
|
|
1895
|
-
case
|
|
1896
|
-
return
|
|
1897
|
-
case
|
|
1898
|
-
return
|
|
1899
|
-
case
|
|
1900
|
-
return
|
|
2220
|
+
case E.campaign:
|
|
2221
|
+
return O({}, t, { campaign: r });
|
|
2222
|
+
case E.offline:
|
|
2223
|
+
return O({}, t, { offline: !0 });
|
|
2224
|
+
case E.online:
|
|
2225
|
+
return O({}, t, { offline: !1 });
|
|
1901
2226
|
default:
|
|
1902
|
-
return n ? t :
|
|
2227
|
+
return n ? t : O({}, hn, t, { initialized: !0 });
|
|
1903
2228
|
}
|
|
1904
2229
|
}
|
|
1905
|
-
var
|
|
1906
|
-
function
|
|
1907
|
-
if (
|
|
2230
|
+
var Hi = ["plugins", "reducers", "storage"];
|
|
2231
|
+
function Vi(t, e, n) {
|
|
2232
|
+
if (Y) {
|
|
1908
2233
|
var r = window[(n ? "add" : "remove") + "EventListener"];
|
|
1909
2234
|
t.split(" ").forEach(function(i) {
|
|
1910
2235
|
r(i, e);
|
|
1911
2236
|
});
|
|
1912
2237
|
}
|
|
1913
2238
|
}
|
|
1914
|
-
function
|
|
1915
|
-
var e =
|
|
2239
|
+
function Yi(t) {
|
|
2240
|
+
var e = Vi.bind(null, "online offline", function(n) {
|
|
1916
2241
|
return Promise.resolve(!navigator.onLine).then(t);
|
|
1917
2242
|
});
|
|
1918
2243
|
return e(!0), function(n) {
|
|
1919
2244
|
return e(!1);
|
|
1920
2245
|
};
|
|
1921
2246
|
}
|
|
1922
|
-
function
|
|
1923
|
-
return
|
|
2247
|
+
function tr() {
|
|
2248
|
+
return ye("analytics", []), function(t) {
|
|
1924
2249
|
return function(e, n, r) {
|
|
1925
2250
|
var i = t(e, n, r), o = i.dispatch;
|
|
1926
2251
|
return Object.assign(i, { dispatch: function(a) {
|
|
1927
|
-
return
|
|
2252
|
+
return Pe[Oe].analytics.push(a.action || a), o(a);
|
|
1928
2253
|
} });
|
|
1929
2254
|
};
|
|
1930
2255
|
};
|
|
1931
2256
|
}
|
|
1932
|
-
function
|
|
2257
|
+
function fn(t) {
|
|
1933
2258
|
return function() {
|
|
1934
|
-
return
|
|
2259
|
+
return Te(Te.apply(null, arguments), tr());
|
|
1935
2260
|
};
|
|
1936
2261
|
}
|
|
1937
|
-
function
|
|
1938
|
-
return t ?
|
|
2262
|
+
function gt(t) {
|
|
2263
|
+
return t ? Mn(t) ? t : [t] : [];
|
|
1939
2264
|
}
|
|
1940
|
-
function
|
|
2265
|
+
function pn(t, e, n) {
|
|
1941
2266
|
t === void 0 && (t = {});
|
|
1942
|
-
var r, i, o =
|
|
1943
|
-
return e && (
|
|
1944
|
-
for (var s,
|
|
1945
|
-
if (
|
|
1946
|
-
s =
|
|
2267
|
+
var r, i, o = ot();
|
|
2268
|
+
return e && (Ne[o] = (r = e, i = function(a) {
|
|
2269
|
+
for (var s, p = a || Array.prototype.slice.call(arguments), m = 0; m < p.length; m++)
|
|
2270
|
+
if (B(p[m])) {
|
|
2271
|
+
s = p[m];
|
|
1947
2272
|
break;
|
|
1948
2273
|
}
|
|
1949
2274
|
return s;
|
|
1950
2275
|
}(n), function(a) {
|
|
1951
2276
|
i && i(a), r(a);
|
|
1952
|
-
})),
|
|
2277
|
+
})), O({}, t, { rid: o, ts: (/* @__PURE__ */ new Date()).getTime() }, e ? { hasCallback: !0 } : {});
|
|
1953
2278
|
}
|
|
1954
|
-
function
|
|
2279
|
+
function Gi(t) {
|
|
1955
2280
|
t === void 0 && (t = {});
|
|
1956
|
-
var e = t.reducers || {}, n = t.initialUser || {}, r = (t.plugins || []).reduce(function(
|
|
1957
|
-
if (
|
|
1958
|
-
return
|
|
1959
|
-
if (
|
|
2281
|
+
var e = t.reducers || {}, n = t.initialUser || {}, r = (t.plugins || []).reduce(function(h, g) {
|
|
2282
|
+
if (B(g))
|
|
2283
|
+
return h.middlewares = h.middlewares.concat(g), h;
|
|
2284
|
+
if (g.NAMESPACE && (g.name = g.NAMESPACE), !g.name)
|
|
1960
2285
|
throw new Error("https://lytics.dev/errors/1");
|
|
1961
|
-
|
|
1962
|
-
var S =
|
|
1963
|
-
return
|
|
2286
|
+
g.config || (g.config = {});
|
|
2287
|
+
var S = g.EVENTS ? Object.keys(g.EVENTS).map(function(z) {
|
|
2288
|
+
return g.EVENTS[z];
|
|
1964
2289
|
}) : [];
|
|
1965
|
-
|
|
2290
|
+
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(z, W) {
|
|
1966
2291
|
var N;
|
|
1967
|
-
return
|
|
1968
|
-
for (var
|
|
1969
|
-
|
|
1970
|
-
return
|
|
1971
|
-
}),
|
|
1972
|
-
}, {}), delete
|
|
1973
|
-
var
|
|
1974
|
-
if (
|
|
1975
|
-
throw new Error(
|
|
1976
|
-
return
|
|
2292
|
+
return z[W] = (N = g.methods[W], function() {
|
|
2293
|
+
for (var R = Array.prototype.slice.call(arguments), A = new Array(N.length), q = 0; q < R.length; q++)
|
|
2294
|
+
A[q] = R[q];
|
|
2295
|
+
return A[A.length] = b, N.apply({ instance: b }, A);
|
|
2296
|
+
}), z;
|
|
2297
|
+
}, {}), delete g.methods);
|
|
2298
|
+
var C = Object.keys(g).concat(S), $ = new Set(h.events.concat(C));
|
|
2299
|
+
if (h.events = Array.from($), h.pluginsArray = h.pluginsArray.concat(g), h.plugins[g.name])
|
|
2300
|
+
throw new Error(g.name + "AlreadyLoaded");
|
|
2301
|
+
return h.plugins[g.name] = g, h.plugins[g.name].loaded || (h.plugins[g.name].loaded = function() {
|
|
1977
2302
|
return !0;
|
|
1978
|
-
}),
|
|
1979
|
-
}, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem:
|
|
1980
|
-
return function(
|
|
1981
|
-
return S.getState("user")[
|
|
2303
|
+
}), h;
|
|
2304
|
+
}, { plugins: {}, pluginEnabled: {}, methods: {}, pluginsArray: [], middlewares: [], events: [] }), i = t.storage ? t.storage : { getItem: ge, setItem: ye, removeItem: je }, o = /* @__PURE__ */ function(h) {
|
|
2305
|
+
return function(g, S, C) {
|
|
2306
|
+
return S.getState("user")[g] || (C && H(C) && C[g] ? C[g] : en(h)[g] || ge(St(g)) || null);
|
|
1982
2307
|
};
|
|
1983
|
-
}(i), a = r.plugins, s = r.events.filter(function(
|
|
1984
|
-
return !
|
|
1985
|
-
}).sort(),
|
|
1986
|
-
return !
|
|
1987
|
-
})), m = Array.from(
|
|
2308
|
+
}(i), a = r.plugins, s = r.events.filter(function(h) {
|
|
2309
|
+
return !_t.includes(h);
|
|
2310
|
+
}).sort(), p = new Set(s.concat(qe).filter(function(h) {
|
|
2311
|
+
return !_t.includes(h);
|
|
2312
|
+
})), m = Array.from(p).sort(), u = function() {
|
|
1988
2313
|
return a;
|
|
1989
|
-
}, c = new
|
|
2314
|
+
}, c = new Li(), f = c.addMiddleware, d = c.removeMiddleware, v = c.dynamicMiddlewares, k = function() {
|
|
1990
2315
|
throw new Error("Abort disabled inListener");
|
|
1991
|
-
},
|
|
1992
|
-
_.anonymousId || (_.anonymousId =
|
|
1993
|
-
var
|
|
2316
|
+
}, w = Ei(), I = en(i), _ = O({}, I, n, w.an_uid ? { userId: w.an_uid } : {}, w.an_aid ? { anonymousId: w.an_aid } : {});
|
|
2317
|
+
_.anonymousId || (_.anonymousId = ot());
|
|
2318
|
+
var y = O({ enable: function(h, g) {
|
|
1994
2319
|
return new Promise(function(S) {
|
|
1995
|
-
|
|
2320
|
+
P.dispatch({ type: E.enablePlugin, plugins: gt(h), _: { originalAction: E.enablePlugin } }, S, [g]);
|
|
1996
2321
|
});
|
|
1997
|
-
}, disable: function(
|
|
2322
|
+
}, disable: function(h, g) {
|
|
1998
2323
|
return new Promise(function(S) {
|
|
1999
|
-
|
|
2324
|
+
P.dispatch({ type: E.disablePlugin, plugins: gt(h), _: { originalAction: E.disablePlugin } }, S, [g]);
|
|
2000
2325
|
});
|
|
2001
|
-
} }, r.methods),
|
|
2326
|
+
} }, r.methods), l = !1, b = { identify: function(h, g, S, C) {
|
|
2002
2327
|
try {
|
|
2003
|
-
var
|
|
2004
|
-
|
|
2005
|
-
var
|
|
2006
|
-
return Promise.resolve(new Promise(function(
|
|
2007
|
-
|
|
2328
|
+
var $ = re(h) ? h : null, z = H(h) ? h : g, W = S || {}, N = b.user();
|
|
2329
|
+
ye(St(te), $);
|
|
2330
|
+
var R = $ || z.userId || o(te, b, z);
|
|
2331
|
+
return Promise.resolve(new Promise(function(A) {
|
|
2332
|
+
P.dispatch(O({ type: E.identifyStart, userId: R, traits: z || {}, options: W, anonymousId: N.anonymousId }, N.id && N.id !== $ && { previousId: N.id }), A, [g, S, C]);
|
|
2008
2333
|
}));
|
|
2009
|
-
} catch (
|
|
2010
|
-
return Promise.reject(
|
|
2334
|
+
} catch (A) {
|
|
2335
|
+
return Promise.reject(A);
|
|
2011
2336
|
}
|
|
2012
|
-
}, track: function(
|
|
2337
|
+
}, track: function(h, g, S, C) {
|
|
2013
2338
|
try {
|
|
2014
|
-
var
|
|
2015
|
-
if (
|
|
2339
|
+
var $ = H(h) ? h.event : h;
|
|
2340
|
+
if (!$ || !re($))
|
|
2016
2341
|
throw new Error("EventMissing");
|
|
2017
|
-
var
|
|
2342
|
+
var z = H(h) ? h : g || {}, W = H(S) ? S : {};
|
|
2018
2343
|
return Promise.resolve(new Promise(function(N) {
|
|
2019
|
-
|
|
2344
|
+
P.dispatch({ type: E.trackStart, event: $, properties: z, options: W, userId: o(te, b, g), anonymousId: o(ke, b, g) }, N, [g, S, C]);
|
|
2020
2345
|
}));
|
|
2021
2346
|
} catch (N) {
|
|
2022
2347
|
return Promise.reject(N);
|
|
2023
2348
|
}
|
|
2024
|
-
}, page: function(
|
|
2349
|
+
}, page: function(h, g, S) {
|
|
2025
2350
|
try {
|
|
2026
|
-
var
|
|
2027
|
-
return Promise.resolve(new Promise(function(
|
|
2028
|
-
|
|
2351
|
+
var C = H(h) ? h : {}, $ = H(g) ? g : {};
|
|
2352
|
+
return Promise.resolve(new Promise(function(z) {
|
|
2353
|
+
P.dispatch({ type: E.pageStart, properties: Mi(C), options: $, userId: o(te, b, C), anonymousId: o(ke, b, C) }, z, [h, g, S]);
|
|
2029
2354
|
}));
|
|
2030
|
-
} catch (
|
|
2031
|
-
return Promise.reject(
|
|
2355
|
+
} catch (z) {
|
|
2356
|
+
return Promise.reject(z);
|
|
2032
2357
|
}
|
|
2033
|
-
}, user: function(
|
|
2034
|
-
if (
|
|
2358
|
+
}, user: function(h) {
|
|
2359
|
+
if (h === te || h === "id")
|
|
2035
2360
|
return o(te, b);
|
|
2036
|
-
if (
|
|
2037
|
-
return o(
|
|
2038
|
-
var
|
|
2039
|
-
return
|
|
2040
|
-
}, reset: function(
|
|
2041
|
-
return new Promise(function(
|
|
2042
|
-
|
|
2361
|
+
if (h === ke || h === "anonId")
|
|
2362
|
+
return o(ke, b);
|
|
2363
|
+
var g = b.getState("user");
|
|
2364
|
+
return h ? Ht(g, h) : g;
|
|
2365
|
+
}, reset: function(h) {
|
|
2366
|
+
return new Promise(function(g) {
|
|
2367
|
+
P.dispatch({ type: E.resetStart }, g, h);
|
|
2043
2368
|
});
|
|
2044
|
-
}, ready: function(
|
|
2045
|
-
return
|
|
2046
|
-
|
|
2369
|
+
}, ready: function(h) {
|
|
2370
|
+
return l && h({ plugins: y, instance: b }), b.on(E.ready, function(g) {
|
|
2371
|
+
h(g), l = !0;
|
|
2047
2372
|
});
|
|
2048
|
-
}, on: function(
|
|
2049
|
-
if (!
|
|
2373
|
+
}, on: function(h, g) {
|
|
2374
|
+
if (!h || !B(g))
|
|
2050
2375
|
return !1;
|
|
2051
|
-
if (
|
|
2052
|
-
throw new Error(".on disabled for " +
|
|
2376
|
+
if (h === E.bootstrap)
|
|
2377
|
+
throw new Error(".on disabled for " + h);
|
|
2053
2378
|
var S = /Start$|Start:/;
|
|
2054
|
-
if (
|
|
2055
|
-
var
|
|
2056
|
-
return function(
|
|
2057
|
-
return function(
|
|
2058
|
-
return
|
|
2379
|
+
if (h === "*") {
|
|
2380
|
+
var C = function(N) {
|
|
2381
|
+
return function(R) {
|
|
2382
|
+
return function(A) {
|
|
2383
|
+
return A.type.match(S) && g({ payload: A, instance: b, plugins: a }), R(A);
|
|
2059
2384
|
};
|
|
2060
2385
|
};
|
|
2061
|
-
},
|
|
2062
|
-
return function(
|
|
2063
|
-
return function(
|
|
2064
|
-
return
|
|
2386
|
+
}, $ = function(N) {
|
|
2387
|
+
return function(R) {
|
|
2388
|
+
return function(A) {
|
|
2389
|
+
return A.type.match(S) || g({ payload: A, instance: b, plugins: a }), R(A);
|
|
2065
2390
|
};
|
|
2066
2391
|
};
|
|
2067
2392
|
};
|
|
2068
|
-
return
|
|
2069
|
-
|
|
2393
|
+
return f(C, He), f($, Ve), function() {
|
|
2394
|
+
d(C, He), d($, Ve);
|
|
2070
2395
|
};
|
|
2071
2396
|
}
|
|
2072
|
-
var
|
|
2073
|
-
return function(
|
|
2074
|
-
return function(
|
|
2075
|
-
return
|
|
2397
|
+
var z = h.match(S) ? He : Ve, W = function(N) {
|
|
2398
|
+
return function(R) {
|
|
2399
|
+
return function(A) {
|
|
2400
|
+
return A.type === h && g({ payload: A, instance: b, plugins: a, abort: k }), R(A);
|
|
2076
2401
|
};
|
|
2077
2402
|
};
|
|
2078
2403
|
};
|
|
2079
|
-
return
|
|
2080
|
-
return
|
|
2404
|
+
return f(W, z), function() {
|
|
2405
|
+
return d(W, z);
|
|
2081
2406
|
};
|
|
2082
|
-
}, once: function(
|
|
2083
|
-
if (!
|
|
2407
|
+
}, once: function(h, g) {
|
|
2408
|
+
if (!h || !B(g))
|
|
2084
2409
|
return !1;
|
|
2085
|
-
if (
|
|
2086
|
-
throw new Error(".once disabled for " +
|
|
2087
|
-
var S = b.on(
|
|
2088
|
-
|
|
2410
|
+
if (h === E.bootstrap)
|
|
2411
|
+
throw new Error(".once disabled for " + h);
|
|
2412
|
+
var S = b.on(h, function(C) {
|
|
2413
|
+
g({ payload: C.payload, instance: b, plugins: a, abort: k }), S();
|
|
2089
2414
|
});
|
|
2090
2415
|
return S;
|
|
2091
|
-
}, getState: function(
|
|
2092
|
-
var
|
|
2093
|
-
return
|
|
2094
|
-
}, dispatch: function(
|
|
2095
|
-
var
|
|
2096
|
-
if (
|
|
2097
|
-
throw new Error("reserved action " +
|
|
2098
|
-
var S =
|
|
2099
|
-
|
|
2100
|
-
}, enablePlugin:
|
|
2101
|
-
|
|
2102
|
-
}, removeItem: function(
|
|
2103
|
-
|
|
2104
|
-
} }, setAnonymousId: function(
|
|
2105
|
-
b.storage.setItem(ie,
|
|
2106
|
-
}, events: { core:
|
|
2107
|
-
return function(
|
|
2416
|
+
}, getState: function(h) {
|
|
2417
|
+
var g = P.getState();
|
|
2418
|
+
return h ? Ht(g, h) : Object.assign({}, g);
|
|
2419
|
+
}, dispatch: function(h) {
|
|
2420
|
+
var g = re(h) ? { type: h } : h;
|
|
2421
|
+
if (qe.includes(g.type))
|
|
2422
|
+
throw new Error("reserved action " + g.type);
|
|
2423
|
+
var S = O({}, g, { _: O({ originalAction: g.type }, h._ || {}) });
|
|
2424
|
+
P.dispatch(S);
|
|
2425
|
+
}, enablePlugin: y.enable, disablePlugin: y.disable, plugins: y, storage: { getItem: i.getItem, setItem: function(h, g, S) {
|
|
2426
|
+
P.dispatch({ type: E.setItemStart, key: h, value: g, options: S });
|
|
2427
|
+
}, removeItem: function(h, g) {
|
|
2428
|
+
P.dispatch({ type: E.removeItemStart, key: h, options: g });
|
|
2429
|
+
} }, setAnonymousId: function(h, g) {
|
|
2430
|
+
b.storage.setItem(ie, h, g);
|
|
2431
|
+
}, events: { core: qe, plugins: s } }, T = r.middlewares.concat([function(h) {
|
|
2432
|
+
return function(g) {
|
|
2108
2433
|
return function(S) {
|
|
2109
|
-
return S.meta || (S.meta =
|
|
2434
|
+
return S.meta || (S.meta = pn()), g(S);
|
|
2110
2435
|
};
|
|
2111
2436
|
};
|
|
2112
|
-
}, v(
|
|
2113
|
-
if (
|
|
2437
|
+
}, v(He), Ai(b, u, { all: m, plugins: s }), Ni(i), xi(b), $i(b), v(Ve)]), x = { context: Ji, user: Ci(i), page: Fi, track: Ri, plugins: Di(u), queue: Wi }, j = Te, D = Te;
|
|
2438
|
+
if (Y && t.debug) {
|
|
2114
2439
|
var L = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;
|
|
2115
|
-
L && (
|
|
2116
|
-
return arguments.length === 0 ?
|
|
2440
|
+
L && (j = L({ trace: !0, traceLimit: 25 })), D = function() {
|
|
2441
|
+
return arguments.length === 0 ? tr() : H(typeof arguments[0]) ? fn() : fn().apply(null, arguments);
|
|
2117
2442
|
};
|
|
2118
2443
|
}
|
|
2119
|
-
var
|
|
2120
|
-
return Object.keys(
|
|
2121
|
-
return
|
|
2444
|
+
var F, U = function(h) {
|
|
2445
|
+
return Object.keys(h).reduce(function(g, S) {
|
|
2446
|
+
return Hi.includes(S) || (g[S] = h[S]), g;
|
|
2122
2447
|
}, {});
|
|
2123
|
-
}(t),
|
|
2124
|
-
var S =
|
|
2125
|
-
return
|
|
2126
|
-
}, {}),
|
|
2127
|
-
for (var
|
|
2128
|
-
var
|
|
2129
|
-
typeof
|
|
2448
|
+
}(t), J = r.pluginsArray.reduce(function(h, g) {
|
|
2449
|
+
var S = g.name, C = g.config, $ = g.loaded, z = r.pluginEnabled[S];
|
|
2450
|
+
return h[S] = { enabled: z, initialized: !!z && !g.initialize, loaded: !!$({ config: C }), config: C }, h;
|
|
2451
|
+
}, {}), Z = { context: U, user: _, plugins: J }, P = Fn(function(h) {
|
|
2452
|
+
for (var g = Object.keys(h), S = {}, C = 0; C < g.length; C++) {
|
|
2453
|
+
var $ = g[C];
|
|
2454
|
+
typeof h[$] === ne && (S[$] = h[$]);
|
|
2130
2455
|
}
|
|
2131
|
-
var
|
|
2456
|
+
var z, W = Object.keys(S);
|
|
2132
2457
|
try {
|
|
2133
2458
|
(function(N) {
|
|
2134
|
-
Object.keys(N).forEach(function(
|
|
2135
|
-
var
|
|
2136
|
-
if (typeof
|
|
2137
|
-
throw new Error("reducer " +
|
|
2459
|
+
Object.keys(N).forEach(function(R) {
|
|
2460
|
+
var A = N[R];
|
|
2461
|
+
if (typeof A(void 0, { type: "@@redux/INIT" }) === ee || typeof A(void 0, { type: Pi }) === ee)
|
|
2462
|
+
throw new Error("reducer " + R + " " + ee);
|
|
2138
2463
|
});
|
|
2139
2464
|
})(S);
|
|
2140
2465
|
} catch (N) {
|
|
2141
|
-
|
|
2466
|
+
z = N;
|
|
2142
2467
|
}
|
|
2143
|
-
return function(N,
|
|
2144
|
-
if (N === void 0 && (N = {}),
|
|
2145
|
-
throw
|
|
2146
|
-
for (var
|
|
2147
|
-
var
|
|
2148
|
-
if (typeof
|
|
2149
|
-
var
|
|
2150
|
-
throw new Error(
|
|
2468
|
+
return function(N, R) {
|
|
2469
|
+
if (N === void 0 && (N = {}), z)
|
|
2470
|
+
throw z;
|
|
2471
|
+
for (var A = !1, q = {}, $e = 0; $e < W.length; $e++) {
|
|
2472
|
+
var Ke = W[$e], Lt = N[Ke], ct = (0, S[Ke])(Lt, R);
|
|
2473
|
+
if (typeof ct === ee) {
|
|
2474
|
+
var fr = Ti(Ke, R);
|
|
2475
|
+
throw new Error(fr);
|
|
2151
2476
|
}
|
|
2152
|
-
|
|
2477
|
+
q[Ke] = ct, A = A || ct !== Lt;
|
|
2153
2478
|
}
|
|
2154
|
-
return
|
|
2479
|
+
return A ? q : N;
|
|
2155
2480
|
};
|
|
2156
|
-
}(
|
|
2157
|
-
|
|
2158
|
-
var
|
|
2159
|
-
return
|
|
2481
|
+
}(O({}, x, e)), Z, D(j(ji.apply(void 0, T))));
|
|
2482
|
+
P.dispatch = (F = P.dispatch, function(h, g, S) {
|
|
2483
|
+
var C = O({}, h, { meta: pn(h.meta, g, gt(S)) });
|
|
2484
|
+
return F.apply(null, [C]);
|
|
2160
2485
|
});
|
|
2161
2486
|
var K = Object.keys(a);
|
|
2162
|
-
|
|
2163
|
-
var M = K.filter(function(
|
|
2164
|
-
return r.pluginEnabled[
|
|
2165
|
-
}),
|
|
2166
|
-
return !r.pluginEnabled[
|
|
2487
|
+
P.dispatch({ type: E.bootstrap, plugins: K, config: U, params: w, user: _, initialUser: n, persistedUser: I });
|
|
2488
|
+
var M = K.filter(function(h) {
|
|
2489
|
+
return r.pluginEnabled[h];
|
|
2490
|
+
}), Ce = K.filter(function(h) {
|
|
2491
|
+
return !r.pluginEnabled[h];
|
|
2167
2492
|
});
|
|
2168
|
-
return
|
|
2169
|
-
var S =
|
|
2170
|
-
S &&
|
|
2171
|
-
}),
|
|
2172
|
-
|
|
2173
|
-
}), function(
|
|
2493
|
+
return P.dispatch({ type: E.registerPlugins, plugins: K, enabled: r.pluginEnabled }), r.pluginsArray.map(function(h, g) {
|
|
2494
|
+
var S = h.bootstrap, C = h.config, $ = h.name;
|
|
2495
|
+
S && B(S) && S({ instance: b, config: C, payload: h }), P.dispatch({ type: E.registerPluginType($), name: $, enabled: r.pluginEnabled[$], plugin: h }), r.pluginsArray.length === g + 1 && P.dispatch({ type: E.initializeStart, plugins: M, disabled: Ce });
|
|
2496
|
+
}), Yi(function(h) {
|
|
2497
|
+
P.dispatch({ type: h ? E.offline : E.online });
|
|
2498
|
+
}), function(h, g, S) {
|
|
2174
2499
|
setInterval(function() {
|
|
2175
|
-
return
|
|
2500
|
+
return Hn(h, g, S);
|
|
2176
2501
|
}, 3e3);
|
|
2177
|
-
}(
|
|
2502
|
+
}(P, u, b), b;
|
|
2178
2503
|
}
|
|
2179
|
-
var
|
|
2180
|
-
function
|
|
2181
|
-
return
|
|
2504
|
+
var He = "before", Ve = "after", De = "cookie", ce = ir(), nr = at, Bi = at;
|
|
2505
|
+
function rr(t) {
|
|
2506
|
+
return ce ? at(t, "", -1) : je(t);
|
|
2182
2507
|
}
|
|
2183
|
-
function
|
|
2184
|
-
if (
|
|
2185
|
-
return
|
|
2508
|
+
function ir() {
|
|
2509
|
+
if (ce !== void 0)
|
|
2510
|
+
return ce;
|
|
2186
2511
|
var t = "cookiecookie";
|
|
2187
2512
|
try {
|
|
2188
|
-
|
|
2513
|
+
at(t, t), ce = document.cookie.indexOf(t) !== -1, rr(t);
|
|
2189
2514
|
} catch {
|
|
2190
|
-
|
|
2515
|
+
ce = !1;
|
|
2191
2516
|
}
|
|
2192
|
-
return
|
|
2517
|
+
return ce;
|
|
2193
2518
|
}
|
|
2194
|
-
function
|
|
2519
|
+
function at(t, e, n, r, i, o) {
|
|
2195
2520
|
if (typeof window < "u") {
|
|
2196
2521
|
var a = arguments.length > 1;
|
|
2197
|
-
return
|
|
2198
|
-
}
|
|
2199
|
-
}
|
|
2200
|
-
var
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
var
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
function
|
|
2522
|
+
return ce === !1 && (a ? ye(t, e) : ge(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]);
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
var Ue = "localStorage", qi = jt.bind(null, "localStorage");
|
|
2526
|
+
xe("localStorage", "getItem", ge);
|
|
2527
|
+
xe("localStorage", "setItem", ye);
|
|
2528
|
+
xe("localStorage", "removeItem", je);
|
|
2529
|
+
var Re = "sessionStorage", Qi = jt.bind(null, "sessionStorage");
|
|
2530
|
+
xe("sessionStorage", "getItem", ge);
|
|
2531
|
+
xe("sessionStorage", "setItem", ye);
|
|
2532
|
+
xe("sessionStorage", "removeItem", je);
|
|
2533
|
+
function Se(t) {
|
|
2209
2534
|
var e = t;
|
|
2210
2535
|
try {
|
|
2211
2536
|
if ((e = JSON.parse(t)) === "true")
|
|
2212
2537
|
return !0;
|
|
2213
2538
|
if (e === "false")
|
|
2214
2539
|
return !1;
|
|
2215
|
-
if (
|
|
2540
|
+
if (H(e))
|
|
2216
2541
|
return e;
|
|
2217
2542
|
parseFloat(e) === e && (e = parseFloat(e));
|
|
2218
2543
|
} catch {
|
|
@@ -2220,57 +2545,57 @@ function we(t) {
|
|
|
2220
2545
|
if (e !== null && e !== "")
|
|
2221
2546
|
return e;
|
|
2222
2547
|
}
|
|
2223
|
-
var
|
|
2224
|
-
function
|
|
2548
|
+
var eo = qi(), to = Qi(), no = ir();
|
|
2549
|
+
function or(t, e) {
|
|
2225
2550
|
if (t) {
|
|
2226
|
-
var n =
|
|
2227
|
-
if (r && !
|
|
2551
|
+
var n = xt(e), r = !At(n), i = Ct(n) ? Se(localStorage.getItem(t)) : void 0;
|
|
2552
|
+
if (r && !be(i))
|
|
2228
2553
|
return i;
|
|
2229
|
-
var o =
|
|
2554
|
+
var o = $t(n) ? Se(nr(t)) : void 0;
|
|
2230
2555
|
if (r && o)
|
|
2231
2556
|
return o;
|
|
2232
|
-
var a =
|
|
2557
|
+
var a = zt(n) ? Se(sessionStorage.getItem(t)) : void 0;
|
|
2233
2558
|
if (r && a)
|
|
2234
2559
|
return a;
|
|
2235
|
-
var s =
|
|
2560
|
+
var s = ge(t);
|
|
2236
2561
|
return r ? s : { localStorage: i, sessionStorage: a, cookie: o, global: s };
|
|
2237
2562
|
}
|
|
2238
2563
|
}
|
|
2239
|
-
function
|
|
2240
|
-
if (t && !
|
|
2241
|
-
var r = {}, i =
|
|
2242
|
-
return
|
|
2564
|
+
function ro(t, e, n) {
|
|
2565
|
+
if (t && !be(e)) {
|
|
2566
|
+
var r = {}, i = xt(n), o = JSON.stringify(e), a = !At(i);
|
|
2567
|
+
return Ct(i) && (r[Ue] = Ye(Ue, e, Se(localStorage.getItem(t))), localStorage.setItem(t, o), a) ? r[Ue] : $t(i) && (r[De] = Ye(De, e, Se(nr(t))), Bi(t, o), a) ? r[De] : zt(i) && (r[Re] = Ye(Re, e, Se(sessionStorage.getItem(t))), sessionStorage.setItem(t, o), a) ? r[Re] : (r[Le] = Ye(Le, e, ge(t)), ye(t, e), a ? r[Le] : r);
|
|
2243
2568
|
}
|
|
2244
2569
|
}
|
|
2245
|
-
function
|
|
2570
|
+
function io(t, e) {
|
|
2246
2571
|
if (t) {
|
|
2247
|
-
var n =
|
|
2248
|
-
return !
|
|
2572
|
+
var n = xt(e), r = or(t, Zn), i = {};
|
|
2573
|
+
return !be(r.localStorage) && Ct(n) && (localStorage.removeItem(t), i[Ue] = r.localStorage), !be(r.cookie) && $t(n) && (rr(t), i[De] = r.cookie), !be(r.sessionStorage) && zt(n) && (sessionStorage.removeItem(t), i[Re] = r.sessionStorage), !be(r.global) && st(n, Le) && (je(t), i[Le] = r.global), i;
|
|
2249
2574
|
}
|
|
2250
2575
|
}
|
|
2251
|
-
function
|
|
2252
|
-
return t ? re(t) ? t : t.storage :
|
|
2576
|
+
function xt(t) {
|
|
2577
|
+
return t ? re(t) ? t : t.storage : Rn;
|
|
2253
2578
|
}
|
|
2254
|
-
function
|
|
2255
|
-
return
|
|
2579
|
+
function Ct(t) {
|
|
2580
|
+
return eo && st(t, Ue);
|
|
2256
2581
|
}
|
|
2257
|
-
function
|
|
2258
|
-
return
|
|
2582
|
+
function $t(t) {
|
|
2583
|
+
return no && st(t, De);
|
|
2259
2584
|
}
|
|
2260
|
-
function
|
|
2261
|
-
return
|
|
2585
|
+
function zt(t) {
|
|
2586
|
+
return to && st(t, Re);
|
|
2262
2587
|
}
|
|
2263
|
-
function
|
|
2264
|
-
return t ===
|
|
2588
|
+
function At(t) {
|
|
2589
|
+
return t === Zn || t === "all";
|
|
2265
2590
|
}
|
|
2266
|
-
function
|
|
2267
|
-
return t ===
|
|
2591
|
+
function st(t, e) {
|
|
2592
|
+
return t === Rn || t === e || At(t);
|
|
2268
2593
|
}
|
|
2269
|
-
function
|
|
2594
|
+
function Ye(t, e, n) {
|
|
2270
2595
|
return { location: t, current: e, previous: n };
|
|
2271
2596
|
}
|
|
2272
|
-
var
|
|
2273
|
-
function
|
|
2597
|
+
var oo = { setItem: ro, getItem: or, removeItem: io };
|
|
2598
|
+
function ao(t, e, n) {
|
|
2274
2599
|
return e in t ? Object.defineProperty(t, e, {
|
|
2275
2600
|
value: n,
|
|
2276
2601
|
enumerable: !0,
|
|
@@ -2278,7 +2603,7 @@ function Ci(t, e, n) {
|
|
|
2278
2603
|
writable: !0
|
|
2279
2604
|
}) : t[e] = n, t;
|
|
2280
2605
|
}
|
|
2281
|
-
function
|
|
2606
|
+
function mn(t, e) {
|
|
2282
2607
|
var n = Object.keys(t);
|
|
2283
2608
|
if (Object.getOwnPropertySymbols) {
|
|
2284
2609
|
var r = Object.getOwnPropertySymbols(t);
|
|
@@ -2288,24 +2613,24 @@ function on(t, e) {
|
|
|
2288
2613
|
}
|
|
2289
2614
|
return n;
|
|
2290
2615
|
}
|
|
2291
|
-
function
|
|
2616
|
+
function gn(t) {
|
|
2292
2617
|
for (var e = 1; e < arguments.length; e++) {
|
|
2293
2618
|
var n = arguments[e] != null ? arguments[e] : {};
|
|
2294
|
-
e % 2 ?
|
|
2295
|
-
|
|
2296
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) :
|
|
2619
|
+
e % 2 ? mn(Object(n), !0).forEach(function(r) {
|
|
2620
|
+
ao(t, r, n[r]);
|
|
2621
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : mn(Object(n)).forEach(function(r) {
|
|
2297
2622
|
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
|
|
2298
2623
|
});
|
|
2299
2624
|
}
|
|
2300
2625
|
return t;
|
|
2301
2626
|
}
|
|
2302
|
-
function
|
|
2627
|
+
function so() {
|
|
2303
2628
|
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = {
|
|
2304
|
-
storage:
|
|
2629
|
+
storage: oo
|
|
2305
2630
|
};
|
|
2306
|
-
return
|
|
2631
|
+
return Gi(gn(gn({}, e), t));
|
|
2307
2632
|
}
|
|
2308
|
-
function
|
|
2633
|
+
function co(t, e) {
|
|
2309
2634
|
e = e || {};
|
|
2310
2635
|
var n, r, i = [], o = e.max || 1 / 0;
|
|
2311
2636
|
function a() {
|
|
@@ -2316,75 +2641,75 @@ function zi(t, e) {
|
|
|
2316
2641
|
}
|
|
2317
2642
|
return s(), {
|
|
2318
2643
|
flush: a,
|
|
2319
|
-
push: function(
|
|
2320
|
-
return r = i.push(
|
|
2644
|
+
push: function(p) {
|
|
2645
|
+
return r = i.push(p), r >= o && a(), r;
|
|
2321
2646
|
},
|
|
2322
2647
|
size: function() {
|
|
2323
2648
|
return i.length;
|
|
2324
2649
|
},
|
|
2325
|
-
end: function(
|
|
2326
|
-
|
|
2650
|
+
end: function(p) {
|
|
2651
|
+
p && a(), clearInterval(n);
|
|
2327
2652
|
}
|
|
2328
2653
|
};
|
|
2329
2654
|
}
|
|
2330
|
-
const
|
|
2331
|
-
function
|
|
2655
|
+
const ar = "@sesamy/sesamy-js", sr = "1.0.3";
|
|
2656
|
+
function uo(t) {
|
|
2332
2657
|
if (!(typeof window > "u")) {
|
|
2333
2658
|
var e = window, n = e.addEventListener, r = e.history, i = e.location, o = i.pathname;
|
|
2334
2659
|
n("popstate", function() {
|
|
2335
2660
|
return t(i.pathname);
|
|
2336
2661
|
}), ["push", "replace"].map(function(a) {
|
|
2337
|
-
var s = "".concat(a, "State"),
|
|
2662
|
+
var s = "".concat(a, "State"), p = r[s];
|
|
2338
2663
|
r[s] = function() {
|
|
2339
|
-
var m = arguments, u =
|
|
2664
|
+
var m = arguments, u = ho(arguments[2]);
|
|
2340
2665
|
return o !== u && (o = u, setTimeout(function() {
|
|
2341
2666
|
return t(m[2]);
|
|
2342
|
-
}, 0)),
|
|
2667
|
+
}, 0)), p.apply(r, arguments);
|
|
2343
2668
|
};
|
|
2344
2669
|
});
|
|
2345
2670
|
}
|
|
2346
2671
|
}
|
|
2347
|
-
function
|
|
2672
|
+
function lo(t, e) {
|
|
2348
2673
|
var n = t.indexOf(e);
|
|
2349
2674
|
return n > -1 ? t.slice(0, n) : t;
|
|
2350
2675
|
}
|
|
2351
|
-
function
|
|
2676
|
+
function ho(t) {
|
|
2352
2677
|
return ["#", "?"].forEach(function(e) {
|
|
2353
|
-
return t =
|
|
2678
|
+
return t = lo(t, e);
|
|
2354
2679
|
}), t;
|
|
2355
2680
|
}
|
|
2356
|
-
function
|
|
2357
|
-
|
|
2358
|
-
|
|
2681
|
+
function fo() {
|
|
2682
|
+
uo(() => {
|
|
2683
|
+
ae.page();
|
|
2359
2684
|
});
|
|
2360
2685
|
}
|
|
2361
|
-
var
|
|
2362
|
-
function
|
|
2686
|
+
var yn = "EventListener";
|
|
2687
|
+
function po(t) {
|
|
2363
2688
|
return function(e, n, r, i) {
|
|
2364
|
-
var o = r ||
|
|
2365
|
-
if (!
|
|
2689
|
+
var o = r || hi, a = i || !1;
|
|
2690
|
+
if (!Y)
|
|
2366
2691
|
return o;
|
|
2367
|
-
var s =
|
|
2368
|
-
if (!
|
|
2692
|
+
var s = tt(n), p = tt(e, !0);
|
|
2693
|
+
if (!p.length)
|
|
2369
2694
|
throw new Error("noElements");
|
|
2370
2695
|
if (!s.length)
|
|
2371
2696
|
throw new Error("noEvent");
|
|
2372
2697
|
var m = [];
|
|
2373
2698
|
return function u(c) {
|
|
2374
2699
|
c && (m = []);
|
|
2375
|
-
for (var
|
|
2376
|
-
var v =
|
|
2377
|
-
m[
|
|
2378
|
-
for (var
|
|
2379
|
-
v[
|
|
2700
|
+
for (var f = c ? "add" + yn : "remove" + yn, d = 0; d < p.length; d++) {
|
|
2701
|
+
var v = p[d];
|
|
2702
|
+
m[d] = c ? a && a.once ? mo(o) : o : m[d] || o;
|
|
2703
|
+
for (var k = 0; k < s.length; k++)
|
|
2704
|
+
v[f] ? v["on" + s[k]] = c ? m[d] : null : v[f](s[k], m[d], a);
|
|
2380
2705
|
}
|
|
2381
2706
|
return u.bind(null, !c);
|
|
2382
2707
|
}(t);
|
|
2383
2708
|
};
|
|
2384
2709
|
}
|
|
2385
|
-
function
|
|
2710
|
+
function tt(t, e) {
|
|
2386
2711
|
if (re(t))
|
|
2387
|
-
return e ?
|
|
2712
|
+
return e ? tt(document.querySelectorAll(t)) : (n = t).split(n.indexOf(",") > -1 ? "," : " ").map(function(a) {
|
|
2388
2713
|
return a.trim();
|
|
2389
2714
|
});
|
|
2390
2715
|
var n;
|
|
@@ -2393,31 +2718,31 @@ function Ge(t, e) {
|
|
|
2393
2718
|
r[i] = t[i];
|
|
2394
2719
|
return r;
|
|
2395
2720
|
}
|
|
2396
|
-
var o =
|
|
2721
|
+
var o = Ii(t);
|
|
2397
2722
|
return e ? o.map(function(a) {
|
|
2398
|
-
return re(a) ?
|
|
2723
|
+
return re(a) ? tt(a, !0) : a;
|
|
2399
2724
|
}).flat() : o;
|
|
2400
2725
|
}
|
|
2401
|
-
function
|
|
2726
|
+
function mo(t, e) {
|
|
2402
2727
|
var n;
|
|
2403
2728
|
return function() {
|
|
2404
2729
|
return t && (n = t.apply(e || this, arguments), t = null), n;
|
|
2405
2730
|
};
|
|
2406
2731
|
}
|
|
2407
|
-
var
|
|
2408
|
-
function
|
|
2409
|
-
return
|
|
2732
|
+
var yt = po("Event");
|
|
2733
|
+
function cr(t, e) {
|
|
2734
|
+
return Y && B(window[t]) ? (n = window[t], r = e, (i = window) === void 0 && (i = null), B(n) ? function() {
|
|
2410
2735
|
n.apply(i, arguments), r.apply(i, arguments);
|
|
2411
2736
|
} : r) : window[t] = e;
|
|
2412
2737
|
var n, r, i;
|
|
2413
2738
|
}
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
var
|
|
2417
|
-
function
|
|
2418
|
-
if (
|
|
2739
|
+
cr.bind(null, "onerror");
|
|
2740
|
+
cr.bind(null, "onload");
|
|
2741
|
+
var ur = typeof window > "u", vn = "hidden";
|
|
2742
|
+
function go(t) {
|
|
2743
|
+
if (ur)
|
|
2419
2744
|
return !1;
|
|
2420
|
-
var e =
|
|
2745
|
+
var e = yo(), n = "".concat(e.replace(/[H|h]idden/, ""), "visibilitychange"), r = function() {
|
|
2421
2746
|
return t(!!document[e]);
|
|
2422
2747
|
}, i = function() {
|
|
2423
2748
|
return document.addEventListener(n, r);
|
|
@@ -2426,31 +2751,31 @@ function Ri(t) {
|
|
|
2426
2751
|
return document.removeEventListener(n, r), i;
|
|
2427
2752
|
};
|
|
2428
2753
|
}
|
|
2429
|
-
function
|
|
2754
|
+
function yo() {
|
|
2430
2755
|
var t = ["webkit", "moz", "ms", "o"];
|
|
2431
|
-
return
|
|
2756
|
+
return ur || vn in document ? vn : t.reduce(function(e, n) {
|
|
2432
2757
|
var r = n + "Hidden";
|
|
2433
2758
|
return !e && r in document ? r : e;
|
|
2434
2759
|
}, null);
|
|
2435
2760
|
}
|
|
2436
|
-
var
|
|
2437
|
-
function
|
|
2761
|
+
var vo = ["mousemove", "mousedown", "touchmove", "touchstart", "touchend", "keydown"];
|
|
2762
|
+
function wo(t, e) {
|
|
2438
2763
|
e === void 0 && (e = {});
|
|
2439
2764
|
var n = /* @__PURE__ */ function(a, s) {
|
|
2440
|
-
var
|
|
2765
|
+
var p = this, m = !1;
|
|
2441
2766
|
return function(u) {
|
|
2442
|
-
m || (a.call(
|
|
2767
|
+
m || (a.call(p, u), m = !0, setTimeout(function() {
|
|
2443
2768
|
return m = !1;
|
|
2444
2769
|
}, s));
|
|
2445
2770
|
};
|
|
2446
2771
|
}(t, e.throttle || 1e4), r = [];
|
|
2447
2772
|
function i() {
|
|
2448
|
-
var a =
|
|
2773
|
+
var a = go(function(s) {
|
|
2449
2774
|
s || n({ type: "tabVisible" });
|
|
2450
2775
|
});
|
|
2451
|
-
return r = [a].concat(
|
|
2452
|
-
return
|
|
2453
|
-
})).concat(
|
|
2776
|
+
return r = [a].concat(vo.map(function(s) {
|
|
2777
|
+
return yt(document, s, n);
|
|
2778
|
+
})).concat(yt(window, "load", n)).concat(yt(window, "scroll", n, { capture: !0, passive: !0 })), o;
|
|
2454
2779
|
}
|
|
2455
2780
|
function o() {
|
|
2456
2781
|
r.map(function(a) {
|
|
@@ -2461,42 +2786,42 @@ function Mi(t, e) {
|
|
|
2461
2786
|
return o(), i;
|
|
2462
2787
|
};
|
|
2463
2788
|
}
|
|
2464
|
-
function
|
|
2465
|
-
var e, n, r = t.onIdle, i = t.onWakeUp, o = t.onHeartbeat, a = t.timeout, s = a === void 0 ? 1e4 : a,
|
|
2789
|
+
function bo(t) {
|
|
2790
|
+
var e, n, r = t.onIdle, i = t.onWakeUp, o = t.onHeartbeat, a = t.timeout, s = a === void 0 ? 1e4 : a, p = t.throttle, m = p === void 0 ? 2e3 : p, u = !1, c = !1, f = /* @__PURE__ */ new Date(), d = function() {
|
|
2466
2791
|
return clearTimeout(e);
|
|
2467
2792
|
};
|
|
2468
|
-
function v(
|
|
2469
|
-
|
|
2470
|
-
u = !0, r && (n = /* @__PURE__ */ new Date(), r(
|
|
2793
|
+
function v(w) {
|
|
2794
|
+
d(), o && !u && o(Ae(f), w), i && u && (u = !1, i(Ae(n), w), f = /* @__PURE__ */ new Date()), e = setTimeout(function() {
|
|
2795
|
+
u = !0, r && (n = /* @__PURE__ */ new Date(), r(Ae(f), w));
|
|
2471
2796
|
}, s);
|
|
2472
2797
|
}
|
|
2473
|
-
var
|
|
2798
|
+
var k = wo(v, { throttle: m });
|
|
2474
2799
|
return { disable: function() {
|
|
2475
|
-
c = !0, u = !1,
|
|
2476
|
-
var
|
|
2800
|
+
c = !0, u = !1, d();
|
|
2801
|
+
var w = k();
|
|
2477
2802
|
return function() {
|
|
2478
|
-
return c = !1,
|
|
2803
|
+
return c = !1, f = /* @__PURE__ */ new Date(), v({ type: "load" }), w();
|
|
2479
2804
|
};
|
|
2480
2805
|
}, getStatus: function() {
|
|
2481
|
-
return { isIdle: u, isDisabled: c, active: u ? 0 :
|
|
2806
|
+
return { isIdle: u, isDisabled: c, active: u ? 0 : Ae(f, c), idle: u ? Ae(n, c) : 0 };
|
|
2482
2807
|
} };
|
|
2483
2808
|
}
|
|
2484
|
-
function
|
|
2809
|
+
function Ae(t, e) {
|
|
2485
2810
|
return e ? 0 : Math.round((/* @__PURE__ */ new Date() - t) / 1e3);
|
|
2486
2811
|
}
|
|
2487
|
-
const
|
|
2488
|
-
class
|
|
2812
|
+
const wn = 5e3;
|
|
2813
|
+
class ko {
|
|
2489
2814
|
constructor(e) {
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2815
|
+
G(this, "element");
|
|
2816
|
+
G(this, "isInViewport", !1);
|
|
2817
|
+
G(this, "isAwake", !1);
|
|
2818
|
+
G(this, "isFlushing");
|
|
2819
|
+
G(this, "observer");
|
|
2820
|
+
G(this, "lastEventAt", Date.now());
|
|
2821
|
+
G(this, "registeredView", !1);
|
|
2822
|
+
G(this, "viewCallback");
|
|
2823
|
+
G(this, "activeDurationCallback");
|
|
2824
|
+
G(this, "idleDurationCallback");
|
|
2500
2825
|
this.element = e.element, this.viewCallback = e.viewCallback, this.activeDurationCallback = e.activeDurationCallback, this.idleDurationCallback = e.idleDurationCallback, this.observer = new IntersectionObserver(
|
|
2501
2826
|
(n) => {
|
|
2502
2827
|
n.forEach((r) => {
|
|
@@ -2506,10 +2831,10 @@ class Vi {
|
|
|
2506
2831
|
{
|
|
2507
2832
|
threshold: 0
|
|
2508
2833
|
}
|
|
2509
|
-
), this.observer.observe(this.element),
|
|
2834
|
+
), this.observer.observe(this.element), bo({
|
|
2510
2835
|
onIdle: (n) => this.handleAwake(!1, n),
|
|
2511
2836
|
onWakeUp: (n) => this.handleAwake(!0, n),
|
|
2512
|
-
timeout:
|
|
2837
|
+
timeout: wn
|
|
2513
2838
|
});
|
|
2514
2839
|
}
|
|
2515
2840
|
/**
|
|
@@ -2528,7 +2853,7 @@ class Vi {
|
|
|
2528
2853
|
), this.isInViewport = e;
|
|
2529
2854
|
}
|
|
2530
2855
|
handleAwake(e, n) {
|
|
2531
|
-
this.isAwake = e, this.lastEventAt = e ? Date.now() - n *
|
|
2856
|
+
this.isAwake = e, this.lastEventAt = e ? Date.now() - n * wn : Date.now(), this.isInViewport && this.trackAwake(e, n);
|
|
2532
2857
|
}
|
|
2533
2858
|
trackAwake(e, n) {
|
|
2534
2859
|
!e && this.activeDurationCallback && this.activeDurationCallback(n, this.isFlushing), e && this.idleDurationCallback && this.idleDurationCallback(n, this.isFlushing);
|
|
@@ -2537,45 +2862,57 @@ class Vi {
|
|
|
2537
2862
|
this.registeredView || (this.registeredView = !0, this.viewCallback && this.viewCallback());
|
|
2538
2863
|
}
|
|
2539
2864
|
}
|
|
2540
|
-
|
|
2541
|
-
function
|
|
2865
|
+
const bn = "sesamy_session_id";
|
|
2866
|
+
function Io() {
|
|
2867
|
+
let t = sessionStorage.getItem(bn);
|
|
2868
|
+
return t || (t = Math.random().toString(36).slice(2, 9), sessionStorage.setItem(bn, t)), t;
|
|
2869
|
+
}
|
|
2870
|
+
let lr = !1, Et, kn, nt;
|
|
2871
|
+
function _o({
|
|
2542
2872
|
clientId: t,
|
|
2543
2873
|
enabled: e = !0,
|
|
2544
|
-
endpoint: n =
|
|
2874
|
+
endpoint: n = Wr
|
|
2545
2875
|
}) {
|
|
2546
|
-
if (
|
|
2876
|
+
if (Et = t, kn = e, nt = n, !kn)
|
|
2547
2877
|
return;
|
|
2548
|
-
|
|
2549
|
-
const r = new
|
|
2878
|
+
fo();
|
|
2879
|
+
const r = new ko({
|
|
2550
2880
|
element: document.body,
|
|
2551
2881
|
viewCallback: () => {
|
|
2552
|
-
|
|
2882
|
+
ae.page();
|
|
2553
2883
|
},
|
|
2554
2884
|
activeDurationCallback: (i, o) => {
|
|
2555
|
-
|
|
2885
|
+
ae.track("activeDuration", {
|
|
2556
2886
|
duration: i,
|
|
2557
2887
|
flushing: o
|
|
2558
2888
|
});
|
|
2559
2889
|
},
|
|
2560
2890
|
idleDurationCallback: (i, o) => {
|
|
2561
|
-
|
|
2891
|
+
ae.track("idleDuration", {
|
|
2562
2892
|
duration: i,
|
|
2563
2893
|
flushing: o
|
|
2564
2894
|
});
|
|
2565
2895
|
}
|
|
2566
2896
|
});
|
|
2567
|
-
|
|
2897
|
+
Eo(document.body, () => {
|
|
2568
2898
|
r.flush();
|
|
2899
|
+
}), window.addEventListener(fe.AUTHENTICATED, async (i) => {
|
|
2900
|
+
const o = i;
|
|
2901
|
+
await ae.identify(o.detail.sub);
|
|
2902
|
+
}), window.addEventListener(fe.LOGOUT, async () => {
|
|
2903
|
+
await ae.track("logout", {}), Nt.flush(), await ae.reset();
|
|
2569
2904
|
});
|
|
2570
2905
|
}
|
|
2571
|
-
function
|
|
2906
|
+
function dr(t) {
|
|
2572
2907
|
return JSON.stringify(
|
|
2573
2908
|
t.map((e) => ({
|
|
2574
2909
|
...e,
|
|
2910
|
+
clientId: Et,
|
|
2911
|
+
requestId: Math.random().toString(36).slice(2, 9),
|
|
2912
|
+
sessionId: Io(),
|
|
2575
2913
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
event: e.event || "page",
|
|
2914
|
+
version: sr,
|
|
2915
|
+
event: e.event,
|
|
2579
2916
|
context: {
|
|
2580
2917
|
page: {
|
|
2581
2918
|
url: window.location.hostname,
|
|
@@ -2585,18 +2922,18 @@ function Bn(t) {
|
|
|
2585
2922
|
referrer: document.referrer
|
|
2586
2923
|
},
|
|
2587
2924
|
locale: navigator.language,
|
|
2588
|
-
library:
|
|
2925
|
+
library: ar,
|
|
2589
2926
|
userAgent: navigator.userAgent,
|
|
2590
|
-
clientId:
|
|
2927
|
+
clientId: Et
|
|
2591
2928
|
}
|
|
2592
2929
|
}))
|
|
2593
2930
|
);
|
|
2594
2931
|
}
|
|
2595
|
-
const
|
|
2932
|
+
const Nt = co(
|
|
2596
2933
|
async (t) => {
|
|
2597
2934
|
if (t.length > 0) {
|
|
2598
|
-
const e =
|
|
2599
|
-
|
|
2935
|
+
const e = dr(t);
|
|
2936
|
+
lr ? navigator.sendBeacon(nt, e) : (await fetch(nt, {
|
|
2600
2937
|
method: "POST",
|
|
2601
2938
|
body: e,
|
|
2602
2939
|
headers: {
|
|
@@ -2612,22 +2949,24 @@ const qn = zi(
|
|
|
2612
2949
|
// 3s
|
|
2613
2950
|
}
|
|
2614
2951
|
);
|
|
2615
|
-
function
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
}
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2952
|
+
function vt(t) {
|
|
2953
|
+
var e;
|
|
2954
|
+
if (t.anonymousId)
|
|
2955
|
+
if ((e = t.properties) != null && e.flushing) {
|
|
2956
|
+
const n = { ...t };
|
|
2957
|
+
delete n.properties.flushing, navigator.sendBeacon(nt, dr([n]));
|
|
2958
|
+
} else
|
|
2959
|
+
Nt.push(t);
|
|
2960
|
+
}
|
|
2961
|
+
const ae = so({
|
|
2962
|
+
app: ar,
|
|
2963
|
+
version: sr,
|
|
2625
2964
|
plugins: [
|
|
2626
2965
|
{
|
|
2627
2966
|
name: "custom-analytics-plugin",
|
|
2628
2967
|
page: ({ payload: t }) => {
|
|
2629
2968
|
const { properties: e, anonymousId: n, userId: r, event: i } = t;
|
|
2630
|
-
|
|
2969
|
+
vt({
|
|
2631
2970
|
anonymousId: n,
|
|
2632
2971
|
userId: r,
|
|
2633
2972
|
properties: e,
|
|
@@ -2637,56 +2976,65 @@ const Je = $i({
|
|
|
2637
2976
|
},
|
|
2638
2977
|
track: ({ payload: t }) => {
|
|
2639
2978
|
const { properties: e, anonymousId: n, userId: r, event: i } = t;
|
|
2640
|
-
|
|
2979
|
+
vt({
|
|
2641
2980
|
anonymousId: n,
|
|
2642
2981
|
userId: r,
|
|
2643
2982
|
properties: e,
|
|
2644
2983
|
event: i,
|
|
2645
2984
|
type: "track"
|
|
2646
2985
|
});
|
|
2986
|
+
},
|
|
2987
|
+
identify: ({ payload: t }) => {
|
|
2988
|
+
const { properties: e, anonymousId: n, userId: r } = t;
|
|
2989
|
+
vt({
|
|
2990
|
+
anonymousId: n,
|
|
2991
|
+
userId: r,
|
|
2992
|
+
properties: e,
|
|
2993
|
+
type: "identify"
|
|
2994
|
+
});
|
|
2647
2995
|
}
|
|
2648
2996
|
}
|
|
2649
2997
|
]
|
|
2650
2998
|
});
|
|
2651
|
-
function
|
|
2652
|
-
return
|
|
2999
|
+
function So() {
|
|
3000
|
+
return lr = !0, Nt.flush();
|
|
2653
3001
|
}
|
|
2654
|
-
const
|
|
2655
|
-
function
|
|
2656
|
-
|
|
3002
|
+
const hr = /* @__PURE__ */ new Map();
|
|
3003
|
+
function Eo(t, e) {
|
|
3004
|
+
hr.set(t, e);
|
|
2657
3005
|
}
|
|
2658
3006
|
window.addEventListener("beforeunload", () => {
|
|
2659
|
-
|
|
3007
|
+
hr.forEach((t, e) => {
|
|
2660
3008
|
t.bind(e)();
|
|
2661
|
-
}),
|
|
3009
|
+
}), So();
|
|
2662
3010
|
});
|
|
2663
|
-
async function
|
|
2664
|
-
|
|
3011
|
+
async function Oo(t) {
|
|
3012
|
+
_o({
|
|
2665
3013
|
clientId: t.clientId,
|
|
2666
3014
|
// The default client id can be overridden by the config
|
|
2667
3015
|
...t.analytics
|
|
2668
|
-
}),
|
|
3016
|
+
}), await Kr(t), di(t.namespace), Ot(fe.READY, {});
|
|
2669
3017
|
}
|
|
2670
|
-
const
|
|
2671
|
-
if (
|
|
3018
|
+
const Ge = document.getElementById("sesamy-js");
|
|
3019
|
+
if (Ge != null && Ge.textContent)
|
|
2672
3020
|
try {
|
|
2673
|
-
const t = JSON.parse(
|
|
2674
|
-
|
|
3021
|
+
const t = JSON.parse(Ge.textContent);
|
|
3022
|
+
Oo(t);
|
|
2675
3023
|
} catch (t) {
|
|
2676
3024
|
console.error("Failed to parse config", t);
|
|
2677
3025
|
}
|
|
2678
|
-
const
|
|
2679
|
-
class
|
|
3026
|
+
const Po = "/sesamy.png";
|
|
3027
|
+
class To extends HTMLElement {
|
|
2680
3028
|
constructor() {
|
|
2681
3029
|
super();
|
|
2682
|
-
|
|
3030
|
+
G(this, "user");
|
|
2683
3031
|
}
|
|
2684
3032
|
async _handleProfile() {
|
|
2685
3033
|
this.user = await window.sesamy.getUser(), this.render();
|
|
2686
3034
|
}
|
|
2687
3035
|
async connectedCallback() {
|
|
2688
3036
|
if (this.setupEventListeners(), !window.sesamy) {
|
|
2689
|
-
window.addEventListener(
|
|
3037
|
+
window.addEventListener(fe.READY, () => this._handleProfile());
|
|
2690
3038
|
return;
|
|
2691
3039
|
}
|
|
2692
3040
|
this._handleProfile();
|
|
@@ -2695,7 +3043,7 @@ class Bi extends HTMLElement {
|
|
|
2695
3043
|
this.innerHTML = `
|
|
2696
3044
|
<div>
|
|
2697
3045
|
<a href="https://docs.sesamy.com" target="_blank">
|
|
2698
|
-
<img src="${
|
|
3046
|
+
<img src="${Po}" class="logo" alt="Vite logo" />
|
|
2699
3047
|
</a>
|
|
2700
3048
|
<h1>Sesamy JS</h1>
|
|
2701
3049
|
<p class="read-the-docs">
|
|
@@ -2724,6 +3072,11 @@ class Bi extends HTMLElement {
|
|
|
2724
3072
|
<div class="logout-wrap">
|
|
2725
3073
|
<a href="#" class="logout-btn" id="logout-btn"> Logout </a>
|
|
2726
3074
|
</div>
|
|
3075
|
+
<div>
|
|
3076
|
+
<a href="/entitlements.html">
|
|
3077
|
+
View Entitlements
|
|
3078
|
+
</a>
|
|
3079
|
+
</div>
|
|
2727
3080
|
</div>`;
|
|
2728
3081
|
}
|
|
2729
3082
|
setupEventListeners() {
|
|
@@ -2733,4 +3086,4 @@ class Bi extends HTMLElement {
|
|
|
2733
3086
|
});
|
|
2734
3087
|
}
|
|
2735
3088
|
}
|
|
2736
|
-
customElements.define("sesamy-app",
|
|
3089
|
+
customElements.define("sesamy-app", To);
|