@trimble-oss/trimble-id-react 0.1.0 → 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- var wt = Object.defineProperty;
2
- var bt = (a, t, n) => t in a ? wt(a, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[t] = n;
3
- var p = (a, t, n) => (bt(a, typeof t != "symbol" ? t + "" : t, n), n);
4
- import { OpenIdEndpointProvider as Ct, AuthorizationCodeGrantTokenProvider as Le, AnalyticsHttpClient as Pt, BearerTokenHttpClientProvider as Ot } from "@trimble-oss/trimble-id";
5
- import * as ue from "es-cookie";
6
- import It from "jwt-decode";
7
- import Be, { createContext as xt, useContext as ze, useState as At, useReducer as Kt, useRef as Ut, useMemo as Fe, useEffect as He, useCallback as W } from "react";
1
+ var Rt = Object.defineProperty;
2
+ var wt = (i, t, a) => t in i ? Rt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : i[t] = a;
3
+ var P = (i, t, a) => (wt(i, typeof t != "symbol" ? t + "" : t, a), a);
4
+ import { OpenIdEndpointProvider as bt, AuthorizationCodeGrantTokenProvider as Fe, AnalyticsHttpClient as Ct, BearerTokenHttpClientProvider as St } from "@trimble-oss/trimble-id";
5
+ import * as le from "es-cookie";
6
+ import Pt from "jwt-decode";
7
+ import Ge, { createContext as Ot, useContext as Be, useState as xt, useReducer as It, useRef as At, useMemo as Le, useEffect as qe, useCallback as $ } from "react";
8
8
  class Dt {
9
9
  constructor() {
10
10
  /**
@@ -14,7 +14,7 @@ class Dt {
14
14
  * @see {https://medium.com/javascript-scene/encapsulation-in-javascript-26be60e325b4} Encapsulation
15
15
  * @return {CacheStorage} Key for the token
16
16
  */
17
- p(this, "generateCache", function() {
17
+ P(this, "generateCache", function() {
18
18
  const t = {
19
19
  token: void 0,
20
20
  user: void 0
@@ -39,16 +39,16 @@ class Dt {
39
39
  * @param {TIDAuthToken} token - Token that you want to store in cache
40
40
  * @return {Promise<void>} Empty promise
41
41
  */
42
- async storeToken(n) {
43
- t.token = n;
42
+ async storeToken(a) {
43
+ t.token = a;
44
44
  },
45
45
  /**
46
46
  * Store user in cache
47
47
  * @param {TIDUser} user - User that you want to store in cache
48
48
  * @return {Promise<void>} Empty promise
49
49
  */
50
- async storeUser(n) {
51
- t.user = n;
50
+ async storeUser(a) {
51
+ t.user = a;
52
52
  },
53
53
  /**
54
54
  * The clear the cache from the storage
@@ -62,228 +62,13 @@ class Dt {
62
62
  }
63
63
  }
64
64
  class Mt {
65
- /**
66
- * Initialized configuration to store information into local storage
67
- * @param {LocalStorageCacheOptions} options - Configuration for caching in localstorage
68
- */
69
- constructor(t) {
70
- /**
71
- * Local storage from the browser
72
- * @type {Storage}
73
- */
74
- p(this, "localStorage");
75
- /**
76
- * The cache key represents the keys for storing and retrieving user and token from auth
77
- * @type {CacheKey}
78
- */
79
- p(this, "cacheKey");
80
- this.localStorage = window.localStorage, this.cacheKey = t.cacheKey;
81
- }
82
- /**
83
- * Get token store in localstorage
84
- * @return {Promise<TIDAuthToken | undefined>} - Token store in localstorage
85
- */
86
- async getToken() {
87
- const t = this.getAuthKey(), n = localStorage.getItem(t);
88
- return n ? JSON.parse(n) : void 0;
89
- }
90
- /**
91
- * Get user store in localstorage
92
- * @return {Promise<TIDUser | undefined>} - User store in localstorage
93
- */
94
- async getUser() {
95
- const t = this.getUserKey(), n = localStorage.getItem(t);
96
- return n ? JSON.parse(n) : void 0;
97
- }
98
- /**
99
- * Store token in localstorage
100
- * @param {TIDAuthToken} token - Token that you want to store in localstorage
101
- * @return {Promise<void>} Empty promise
102
- */
103
- async storeToken(t) {
104
- const n = this.getAuthKey(), o = JSON.stringify(t);
105
- localStorage.setItem(n, o);
106
- }
107
- /**
108
- * Store user in cache
109
- * @param {TIDUser} user - User that you want to store in localstorage
110
- * @return {Promise<void>} Empty promise
111
- */
112
- async storeUser(t) {
113
- const n = this.getUserKey(), o = JSON.stringify(t);
114
- localStorage.setItem(n, o);
115
- }
116
- /**
117
- * Get the full key from the cachekey for the user
118
- * @return {string} - Full key to get the token from the localstorage
119
- */
120
- getUserKey() {
121
- return this.cacheKey.getUserKey();
122
- }
123
- /**
124
- * Get the full key from the cachekey for the token
125
- * @return {string} - Full key to get the token from the localstorage
126
- */
127
- getAuthKey() {
128
- return this.cacheKey.getAuthKey();
129
- }
130
- /**
131
- * The clear the cache from the localstorage
132
- * @return {Promise<void>} Empty promise
133
- */
134
- clear() {
135
- return this.localStorage.removeItem(this.getAuthKey()), this.localStorage.removeItem(this.getUserKey()), Promise.resolve(void 0);
136
- }
137
- }
138
- const ge = "@TID", jt = `${ge}_AUTH_KEY`, Lt = `${ge}_USER_KEY`;
139
- class Ft {
140
- /**
141
- * Initialized the cache key
142
- * @param {CacheKeyOptions} cacheKeyOptions - Cache key options to edit the default values
143
- */
144
- constructor(t) {
145
- /**
146
- * Client id of the application created in trimble developer console
147
- * @type {string}
148
- */
149
- p(this, "clientId");
150
- /**
151
- * Prefix value of the key, by default the prefix is based on the constant PREFIX_KEY
152
- * @type {string}
153
- */
154
- p(this, "prefix", ge);
155
- /**
156
- * Suffix value use it to generate the key to store and retrieve the token, by default the prefix is based on the constant AUTH_KEY
157
- * @type {string}
158
- */
159
- p(this, "authSuffix", jt);
160
- /**
161
- * Suffix value use it to generate the key to store and retrieve the user, by default the prefix is based on the constant USER_KEY
162
- * @type {string}
163
- */
164
- p(this, "userSuffix", Lt);
165
- this.clientId = t.client_id;
166
- }
167
- /**
168
- * Get key to store/retrieve user
169
- * @return {string} Key for the user
170
- */
171
- getUserKey() {
172
- return `${this.prefix}_${this.userSuffix}_${this.clientId}`;
173
- }
174
- /**
175
- * Get key to store/retrieve token
176
- * @return {string} Key for the token
177
- */
178
- getAuthKey() {
179
- return `${this.prefix}_${this.authSuffix}_${this.clientId}`;
180
- }
181
- }
182
- class Nt {
183
- /**
184
- * Initialized configuration to store information into session storage
185
- * @param {SessionStorageCacheOptions} options - Configuration for caching in session storage
186
- */
187
- constructor(t) {
188
- /**
189
- * Session storage from the browser
190
- * @type {Storage}
191
- */
192
- p(this, "sessionStorage");
193
- /**
194
- * The cache key represents the keys for storing and retrieving user and token from auth
195
- * @type {CacheKey}
196
- */
197
- p(this, "cacheKey");
198
- this.sessionStorage = window.sessionStorage, this.cacheKey = t.cacheKey;
199
- }
200
- /**
201
- * Get token store in session storage
202
- * @return {Promise<TIDAuthToken | undefined>} - Token store in session storage
203
- */
204
- async getToken() {
205
- const t = this.getAuthKey(), n = sessionStorage.getItem(t);
206
- return n ? JSON.parse(n) : void 0;
207
- }
208
- /**
209
- * Get user store in session storage
210
- * @return {Promise<TIDUser | undefined>} - User store in session storage
211
- */
212
- async getUser() {
213
- const t = this.getUserKey(), n = sessionStorage.getItem(t);
214
- return n ? JSON.parse(n) : void 0;
215
- }
216
- /**
217
- * Store token in session storage
218
- * @param {TIDAuthToken} authToken - Token that you want to store in session storage
219
- * @return {Promise<void>} Empty promise
220
- */
221
- async storeToken(t) {
222
- const n = this.getAuthKey(), o = JSON.stringify(t);
223
- sessionStorage.setItem(n, o);
224
- }
225
- /**
226
- * Store user in cache
227
- * @param {TIDUser} user - User that you want to store in session storage
228
- * @return {Promise<void>} Empty promise
229
- */
230
- async storeUser(t) {
231
- const n = this.getUserKey(), o = JSON.stringify(t);
232
- sessionStorage.setItem(n, o);
233
- }
234
- /**
235
- * Get the full key from the cachekey for the user
236
- * @return {string} - Full key to get the token from the session storage
237
- */
238
- getUserKey() {
239
- return this.cacheKey.getUserKey();
240
- }
241
- /**
242
- * Get the full key from the cachekey for the token
243
- * @return {string} - Full key to get the token from the session storage
244
- */
245
- getAuthKey() {
246
- return this.cacheKey.getAuthKey();
247
- }
248
- /**
249
- * The clear the cache from the session storage
250
- * @return {Promise<void>} Empty promise
251
- */
252
- clear() {
253
- return this.sessionStorage.removeItem(this.getAuthKey()), this.sessionStorage.removeItem(this.getUserKey()), Promise.resolve(void 0);
254
- }
255
- }
256
- class Wt {
257
- /**
258
- * Create a cache manager to extract or save the user, and token
259
- * @param {CacheManagerOptions} options - Configuration for the managing the caching
260
- */
261
- constructor(t) {
262
- /**
263
- * Type persistent you want the user and token to be store
264
- * in-memory - This one will only persist will the user stays in the page
265
- * localStorage - This persistent doesn't have expiration date
266
- * sessionStorage - This one is cleared when the page session ends
267
- * @type {PersistentStore}
268
- */
269
- p(this, "persistentStore");
65
+ constructor() {
270
66
  /**
271
67
  * Cache option selected
272
68
  * @type {CacheStorage}
273
69
  */
274
- p(this, "cacheStorage");
275
- /**
276
- * The cache key represents the keys for storing and retrieving user and token from auth
277
- * @type {CacheKey}
278
- */
279
- p(this, "cacheKey");
280
- this.persistentStore = t.persistentStore, this.cacheKey = new Ft({
281
- client_id: t.clientId
282
- }), this.persistentStore === "localStorage" ? this.cacheStorage = new Mt({
283
- cacheKey: this.cacheKey
284
- }) : this.persistentStore === "sessionStorage" ? this.cacheStorage = new Nt({
285
- cacheKey: this.cacheKey
286
- }) : this.cacheStorage = new Dt().generateCache;
70
+ P(this, "cacheStorage");
71
+ this.cacheStorage = new Dt().generateCache;
287
72
  }
288
73
  /**
289
74
  * Store token in cache
@@ -323,45 +108,44 @@ class Wt {
323
108
  await this.cacheStorage.clear();
324
109
  }
325
110
  }
326
- const Ne = 5 * 6e4, $t = ["code", "state"], We = (a) => a.split("?")[0], Vt = (a) => a.split("?")[1], qe = (a) => {
327
- let t = a;
328
- if (!a.startsWith("?"))
111
+ const We = 5 * 6e4, Ut = ["code", "state"], Ne = (i) => i.split("?")[0], jt = (i) => i.split("?")[1], Je = (i) => {
112
+ let t = i;
113
+ if (!i.startsWith("?"))
329
114
  try {
330
- t = new URL(a).search;
115
+ t = new URL(i).search;
331
116
  } catch {
332
117
  }
333
118
  return new URLSearchParams(t);
334
- }, Yt = (a = window.location.href, t) => {
119
+ }, Ft = (i = window.location.href, t) => {
335
120
  if (t != null) {
336
- const o = We(t), c = We(a ?? "");
337
- if (o !== c)
121
+ const o = Ne(t), u = Ne(i ?? "");
122
+ if (o !== u)
338
123
  return !1;
339
124
  }
340
- const n = qe(a);
341
- for (const o of $t)
342
- if (!n.has(o))
125
+ const a = Je(i);
126
+ for (const o of Ut)
127
+ if (!a.has(o))
343
128
  return !1;
344
129
  return !0;
345
- }, Gt = (a) => ({
346
- id: a.sub,
347
- name: `${a.given_name} ${a.family_name}`,
348
- given_name: a.given_name,
349
- family_name: a.family_name,
350
- picture: a.picture,
351
- email: a.email,
352
- email_verified: a.email_verified,
353
- phone_number_verified: !1
354
- }), Jt = "@TID_COOKIE";
355
- class Bt {
130
+ }, Lt = (i) => ({
131
+ id: i.sub,
132
+ name: `${i.given_name} ${i.family_name}`,
133
+ given_name: i.given_name,
134
+ family_name: i.family_name,
135
+ picture: i.picture,
136
+ email: i.email,
137
+ email_verified: i.email_verified
138
+ }), Wt = "@TID_COOKIE";
139
+ class Nt {
356
140
  /**
357
141
  * Retrieve a cookie from the browser
358
142
  * @param {string} key - Key to retrieve the cookies
359
143
  */
360
144
  get(t) {
361
- const n = ue.get(t);
362
- if (n == null)
145
+ const a = le.get(t);
146
+ if (a == null)
363
147
  throw new Error("Cookie not found");
364
- return JSON.parse(n);
148
+ return JSON.parse(a);
365
149
  }
366
150
  /**
367
151
  * Store cookies in the browser
@@ -373,12 +157,12 @@ class Bt {
373
157
  * @example Save cookies with a custom domain
374
158
  * cookiesStorage.set('key',{data:{...}},{domain:'https://example.com/subpath'})
375
159
  */
376
- set(t, n, o) {
377
- let c = {};
378
- window.location.protocol === "https:" && (c = {
160
+ set(t, a, o) {
161
+ let u = {};
162
+ window.location.protocol === "https:" && (u = {
379
163
  secure: !0,
380
164
  sameSite: "none"
381
- }), o != null && o.expires && (c.expires = o.expires), o != null && o.domain && (c.domain = o.domain), ue.set(t, JSON.stringify(n), c);
165
+ }), o != null && o.expires && (u.expires = o.expires), o != null && o.domain && (u.domain = o.domain), le.set(t, JSON.stringify(a), u);
382
166
  }
383
167
  /**
384
168
  * Remove a cookie from the browser
@@ -389,12 +173,12 @@ class Bt {
389
173
  * @example Remove cookies with custom domain
390
174
  * cookiesStorage.remove('key',{domain:'https://example.com/subpath'})
391
175
  */
392
- remove(t, n) {
176
+ remove(t, a) {
393
177
  const o = {};
394
- n != null && n.domain && (o.domain = n.domain), ue.remove(t, o);
178
+ a != null && a.domain && (o.domain = a.domain), le.remove(t, o);
395
179
  }
396
180
  }
397
- class zt {
181
+ class $t {
398
182
  /**
399
183
  * Create a cookies manager to extract or save cookies in the browser
400
184
  * @param {CookiesManagerOptions} options - Configuration for the managing the cookies
@@ -404,13 +188,13 @@ class zt {
404
188
  * Cookie full key to store and retrieve the information from cookies
405
189
  * @type {string}
406
190
  */
407
- p(this, "cookieKey");
191
+ P(this, "cookieKey");
408
192
  /**
409
193
  * Cookie storage. This object contain all functions necessary to retrieve and store tokens using cookies
410
194
  * @type {CookiesStorage}
411
195
  */
412
- p(this, "cookiesStorage");
413
- this.cookieKey = `${Jt}.${t.clientId}`, this.cookiesStorage = new Bt();
196
+ P(this, "cookiesStorage");
197
+ this.cookieKey = `${Wt}.${t.clientId}`, this.cookiesStorage = new Nt();
414
198
  }
415
199
  /**
416
200
  * Store cookies in the browser
@@ -443,18 +227,16 @@ class $e extends Error {
443
227
  }
444
228
  class Ve extends Error {
445
229
  }
446
- class Ht extends Error {
230
+ class Vt extends Error {
447
231
  }
448
- const O = "@trimble-oss/trimble-id-react", I = "0.1.0", qt = {
232
+ const O = "@trimble-oss/trimble-id-react", x = "1.0.0-rc.1", Kt = {
449
233
  configurationEndpoint: "",
450
234
  clientId: "",
451
235
  redirectUrl: "",
452
236
  logoutRedirectUrl: "",
453
237
  scopes: []
454
- }, Xt = {
455
- persistentStore: "in-memory"
456
238
  };
457
- class Qt {
239
+ class Yt {
458
240
  /**
459
241
  * Create a TID client to handle manage all user authentication functions and information
460
242
  * @param {CacheManagerOptions} props - TID client configuration
@@ -464,50 +246,47 @@ class Qt {
464
246
  * Token provider SDK. This object handles all necessary communication with TID
465
247
  * @type {AuthorizationCodeGrantTokenProvider}
466
248
  */
467
- p(this, "tokenProvider");
249
+ P(this, "tokenProvider");
468
250
  /**
469
251
  * This object manage all caching, and all configurations necessary
470
252
  * @type {CacheManager}
471
253
  */
472
- p(this, "cacheManager");
254
+ P(this, "cacheManager");
473
255
  /**
474
256
  * This object manage all cookies administration, and all configurations necessary
475
257
  * @type {CookiesManager}
476
258
  */
477
- p(this, "cookiesManager");
259
+ P(this, "cookiesManager");
478
260
  /**
479
261
  * Client id of the application created in trimble developer console
480
262
  * @type {string}
481
263
  */
482
- p(this, "clientId");
264
+ P(this, "clientId");
483
265
  /**
484
266
  * Callback url to redirect the user after the authentication is successful
485
267
  * @type {string}
486
268
  */
487
- p(this, "redirectUrl");
269
+ P(this, "redirectUrl");
488
270
  /**
489
271
  * AnalyticsHttpClient for sending events
490
272
  * @type {AnalyticsHttpClient}
491
273
  */
492
- p(this, "analyticshttpclient");
493
- const { config: n = qt, persistentOptions: o = Xt } = t;
494
- if (this.redirectUrl = n.redirectUrl, n.configurationEndpoint == null || n.configurationEndpoint == "")
274
+ P(this, "analyticshttpclient");
275
+ const { config: a = Kt } = t;
276
+ if (this.redirectUrl = a.redirectUrl, a.configurationEndpoint == null || a.configurationEndpoint == "")
495
277
  throw new Error("Configuration endpoint not defined");
496
- if (n.clientId == null || n.clientId == "")
278
+ if (a.clientId == null || a.clientId == "")
497
279
  throw new Error("Consumer key is not defined");
498
- this.cookiesManager = new zt({
499
- clientId: n.clientId
280
+ this.cookiesManager = new $t({
281
+ clientId: a.clientId
500
282
  });
501
- const c = this.cookiesManager.get(), S = new Ct(n.configurationEndpoint);
502
- let _ = new Le(
503
- S,
504
- n.clientId,
505
- n.redirectUrl
506
- ).WithScopes(n.scopes);
507
- n.logoutRedirectUrl && (_ = _.WithLogoutRedirect(n.logoutRedirectUrl)), (c == null ? void 0 : c.code_verifier) != null && (_ = _.WithProofKeyForCodeExchange(c.code_verifier)), this.tokenProvider = _, this.cacheManager = new Wt({
508
- clientId: n.clientId,
509
- persistentStore: o.persistentStore
510
- }), this.clientId = n.clientId, this.analyticshttpclient = Pt, this.analyticshttpclient.sendInitEvent("TIDClient", this.clientId, O, I);
283
+ const o = this.cookiesManager.get(), u = new bt(a.configurationEndpoint);
284
+ let E = new Fe(
285
+ u,
286
+ a.clientId,
287
+ a.redirectUrl
288
+ ).WithScopes(a.scopes);
289
+ a.logoutRedirectUrl && (E = E.WithLogoutRedirect(a.logoutRedirectUrl)), (o == null ? void 0 : o.code_verifier) != null && (E = E.WithProofKeyForCodeExchange(o.code_verifier)), this.tokenProvider = E, this.cacheManager = new Mt(), this.clientId = a.clientId, this.analyticshttpclient = Ct, this.analyticshttpclient.sendInitEvent("TIDClient", this.clientId, O, x);
511
290
  }
512
291
  /**
513
292
  * Redirect the user to TID using the browser
@@ -522,11 +301,11 @@ class Qt {
522
301
  * // So it can be handled by the developer
523
302
  */
524
303
  async loginWithRedirect(t) {
525
- this.analyticshttpclient.sendMethodEvent(this.loginWithRedirect.name, this.clientId, O, I);
526
- const { onRedirect: n } = t || {}, o = Le.GenerateCodeVerifier();
304
+ this.analyticshttpclient.sendMethodEvent(this.loginWithRedirect.name, this.clientId, O, x);
305
+ const { onRedirect: a } = t || {}, o = Fe.GenerateCodeVerifier();
527
306
  this.cookiesManager.save({ code_verifier: o }), this.tokenProvider = this.tokenProvider.WithProofKeyForCodeExchange(o);
528
- const c = await this.tokenProvider.GetOAuthRedirect("state");
529
- n != null ? n(c) : window.location.assign(c);
307
+ const u = await this.tokenProvider.GetOAuthRedirect("state");
308
+ a != null ? a(u) : window.location.assign(u);
530
309
  }
531
310
  /**
532
311
  * Authenticated the user using the url callback params
@@ -541,12 +320,12 @@ class Qt {
541
320
  * // Will try to log in the user with the url assign by the developer
542
321
  */
543
322
  async handleCallback(t = window.location.href) {
544
- const n = this.cookiesManager.get();
545
- if (n == null || (n == null ? void 0 : n.code_verifier) == null)
546
- throw new Ht("Code verifier not available");
547
- const o = Vt(t), c = qe(t), S = c.get("identity_provider") ?? "", _ = c.get("state") ?? "";
548
- return await this.tokenProvider.ValidateQuery(o), await this.generateToken(S), {
549
- authState: _
323
+ const a = this.cookiesManager.get();
324
+ if (a == null || (a == null ? void 0 : a.code_verifier) == null)
325
+ throw new Vt("Code verifier not available");
326
+ const o = jt(t), u = Je(t), E = u.get("identity_provider") ?? "", C = u.get("state") ?? "";
327
+ return await this.tokenProvider.ValidateQuery(o), await this.generateToken(E), {
328
+ authState: C
550
329
  };
551
330
  }
552
331
  /**
@@ -555,21 +334,21 @@ class Qt {
555
334
  * @return {Promise<void>} Empty promise
556
335
  */
557
336
  async generateToken(t) {
558
- var R, f;
559
- const n = await this.tokenProvider.RetrieveToken(), o = await this.tokenProvider.RetrieveRefreshToken(), c = await this.tokenProvider.RetrieveIdToken(), S = await this.tokenProvider.RetrieveTokenExpiry(), w = new Date(S).getTime(), v = (f = (R = this.tokenProvider) == null ? void 0 : R._scopes) == null ? void 0 : f.join(" ");
337
+ var f, R;
338
+ const a = await this.tokenProvider.RetrieveToken(), o = await this.tokenProvider.RetrieveRefreshToken(), u = await this.tokenProvider.RetrieveIdToken(), E = await this.tokenProvider.RetrieveTokenExpiry(), T = new Date(E).getTime(), p = (R = (f = this.tokenProvider) == null ? void 0 : f._scopes) == null ? void 0 : R.join(" ");
560
339
  await this.cacheManager.setToken({
561
- scope: v,
340
+ scope: p,
562
341
  state: "",
563
342
  session_state: "",
564
343
  identity_provider: t,
565
344
  token_type: "bearer",
566
- access_token: n,
345
+ access_token: a,
567
346
  refresh_token: o,
568
- id_token: c,
569
- expires_at: w
347
+ id_token: u,
348
+ expires_at: T
570
349
  });
571
- const P = It(c), T = Gt(P);
572
- await this.cacheManager.setUser(T), await this.reloadCodeVerifier();
350
+ const I = Pt(u), _ = Lt(I);
351
+ await this.cacheManager.setUser(_), await this.reloadCodeVerifier();
573
352
  }
574
353
  async reloadCodeVerifier() {
575
354
  const t = await this.tokenProvider.RetrieveCodeVerifier();
@@ -580,7 +359,7 @@ class Qt {
580
359
  * @return {Promise<TIDUser | undefined>} User in cache
581
360
  */
582
361
  async getUser() {
583
- return this.analyticshttpclient.sendMethodEvent(this.getUser.name, this.clientId, O, I), await this.cacheManager.getUser();
362
+ return this.analyticshttpclient.sendMethodEvent(this.getUser.name, this.clientId, O, x), await this.cacheManager.getUser();
584
363
  }
585
364
  /**
586
365
  * Gets the access token from cache. If the token already expired,
@@ -590,16 +369,16 @@ class Qt {
590
369
  * @throws {TokenExpiredException} Will throw an exception if the user token expired
591
370
  */
592
371
  async getAccessTokenSilently() {
593
- this.analyticshttpclient.sendMethodEvent(this.getAccessTokenSilently.name, this.clientId, O, I);
372
+ this.analyticshttpclient.sendMethodEvent(this.getAccessTokenSilently.name, this.clientId, O, x);
594
373
  let t = await this.cacheManager.getToken();
595
374
  if (t == null)
596
- throw this.analyticshttpclient.sendExceptionEvent(this.getAccessTokenSilently.name, "No token available", this.clientId, O, I), new Ve("No token available");
597
- const n = new Date((/* @__PURE__ */ new Date()).getTime() + Ne);
598
- if ((t == null ? void 0 : t.expires_at) == null || (t == null ? void 0 : t.expires_at) < n.getTime()) {
375
+ throw this.analyticshttpclient.sendExceptionEvent(this.getAccessTokenSilently.name, "No token available", this.clientId, O, x), new Ve("No token available");
376
+ const a = new Date((/* @__PURE__ */ new Date()).getTime() + We);
377
+ if ((t == null ? void 0 : t.expires_at) == null || (t == null ? void 0 : t.expires_at) < a.getTime()) {
599
378
  try {
600
379
  await this.tokenProvider.RetrieveToken();
601
380
  } catch (o) {
602
- throw this.analyticshttpclient.sendExceptionEvent(this.getAccessTokenSilently.name, o.message, this.clientId, O, I), new $e(o.message);
381
+ throw this.analyticshttpclient.sendExceptionEvent(this.getAccessTokenSilently.name, o.message, this.clientId, O, x), new $e(o.message);
603
382
  }
604
383
  await this.generateToken((t == null ? void 0 : t.identity_provider) ?? ""), t = await this.cacheManager.getToken();
605
384
  }
@@ -613,16 +392,16 @@ class Qt {
613
392
  * @throws {TokenExpiredException} Will throw an exception if the user token expired
614
393
  */
615
394
  async getTokens() {
616
- this.analyticshttpclient.sendMethodEvent(this.getTokens.name, this.clientId, O, I);
395
+ this.analyticshttpclient.sendMethodEvent(this.getTokens.name, this.clientId, O, x);
617
396
  let t = await this.cacheManager.getToken();
618
397
  if (t == null)
619
- throw this.analyticshttpclient.sendExceptionEvent(this.getTokens.name, "No token available", this.clientId, O, I), new Ve("No token available");
620
- const n = new Date((/* @__PURE__ */ new Date()).getTime() + Ne);
621
- if ((t == null ? void 0 : t.expires_at) == null || (t == null ? void 0 : t.expires_at) < n.getTime()) {
398
+ throw this.analyticshttpclient.sendExceptionEvent(this.getTokens.name, "No token available", this.clientId, O, x), new Ve("No token available");
399
+ const a = new Date((/* @__PURE__ */ new Date()).getTime() + We);
400
+ if ((t == null ? void 0 : t.expires_at) == null || (t == null ? void 0 : t.expires_at) < a.getTime()) {
622
401
  try {
623
402
  await this.tokenProvider.RetrieveToken();
624
403
  } catch (o) {
625
- throw this.analyticshttpclient.sendExceptionEvent(this.getTokens.name, o.message, this.clientId, O, I), new $e(o.message);
404
+ throw this.analyticshttpclient.sendExceptionEvent(this.getTokens.name, o.message, this.clientId, O, x), new $e(o.message);
626
405
  }
627
406
  await this.generateToken((t == null ? void 0 : t.identity_provider) ?? ""), t = await this.cacheManager.getToken();
628
407
  }
@@ -645,13 +424,13 @@ class Qt {
645
424
  * // So it can be handled by the developer
646
425
  */
647
426
  async logout(t) {
648
- this.analyticshttpclient.sendMethodEvent(this.logout.name, this.clientId, O, I);
649
- const { onRedirect: n, disabledAutoRedirect: o } = t || {};
427
+ this.analyticshttpclient.sendMethodEvent(this.logout.name, this.clientId, O, x);
428
+ const { onRedirect: a, disabledAutoRedirect: o } = t || {};
650
429
  this.cacheManager && await this.cacheManager.clear(), this.cookiesManager && this.cookiesManager.clear();
651
- const c = await this.tokenProvider.GetOAuthLogoutRedirect("state");
652
- if (n != null)
653
- return n(c);
654
- o || window.location.assign(c);
430
+ const u = await this.tokenProvider.GetOAuthLogoutRedirect("state");
431
+ if (a != null)
432
+ return a(u);
433
+ o || window.location.assign(u);
655
434
  }
656
435
  /**
657
436
  * Check if the user still has a valid session
@@ -680,15 +459,15 @@ class Qt {
680
459
  const t = await this.cacheManager.getToken();
681
460
  if (t == null)
682
461
  return;
683
- const n = t.access_token, o = t.refresh_token || "", c = t.id_token, S = t.expires_at;
684
- this.tokenProvider = this.tokenProvider.WithAccessToken(n, S).WithRefreshToken(o).WithIdToken(c);
462
+ const a = t.access_token, o = t.refresh_token || "", u = t.id_token, E = t.expires_at;
463
+ this.tokenProvider = this.tokenProvider.WithAccessToken(a, E).WithRefreshToken(o).WithIdToken(u);
685
464
  }
686
465
  /**
687
466
  * Get a http bearer token client to use it for another SDK (Ex: Processing framework)
688
467
  * @return {any} - BearerTokenHttpClientProvider
689
468
  */
690
469
  getBearerTokenHttpClient(t) {
691
- return new Ot(this.tokenProvider, t);
470
+ return new St(this.tokenProvider, t);
692
471
  }
693
472
  /**
694
473
  * Get the redirect url to TID
@@ -698,8 +477,8 @@ class Qt {
698
477
  return this.redirectUrl;
699
478
  }
700
479
  }
701
- const fe = xt(null), Xe = () => ze(fe) ?? {};
702
- var de = { exports: {} }, $ = {};
480
+ const ue = Ot(null), He = () => Be(ue) ?? {};
481
+ var fe = { exports: {} }, V = {};
703
482
  /**
704
483
  * @license React
705
484
  * react-jsx-runtime.production.min.js
@@ -709,25 +488,25 @@ var de = { exports: {} }, $ = {};
709
488
  * This source code is licensed under the MIT license found in the
710
489
  * LICENSE file in the root directory of this source tree.
711
490
  */
712
- var Ye;
713
- function Zt() {
714
- if (Ye)
715
- return $;
716
- Ye = 1;
717
- var a = Be, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, c = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, S = { key: !0, ref: !0, __self: !0, __source: !0 };
718
- function _(w, v, P) {
719
- var T, R = {}, f = null, D = null;
720
- P !== void 0 && (f = "" + P), v.key !== void 0 && (f = "" + v.key), v.ref !== void 0 && (D = v.ref);
721
- for (T in v)
722
- o.call(v, T) && !S.hasOwnProperty(T) && (R[T] = v[T]);
723
- if (w && w.defaultProps)
724
- for (T in v = w.defaultProps, v)
725
- R[T] === void 0 && (R[T] = v[T]);
726
- return { $$typeof: t, type: w, key: f, ref: D, props: R, _owner: c.current };
491
+ var Ke;
492
+ function Gt() {
493
+ if (Ke)
494
+ return V;
495
+ Ke = 1;
496
+ var i = Ge, t = Symbol.for("react.element"), a = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, u = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, E = { key: !0, ref: !0, __self: !0, __source: !0 };
497
+ function C(T, p, I) {
498
+ var _, f = {}, R = null, S = null;
499
+ I !== void 0 && (R = "" + I), p.key !== void 0 && (R = "" + p.key), p.ref !== void 0 && (S = p.ref);
500
+ for (_ in p)
501
+ o.call(p, _) && !E.hasOwnProperty(_) && (f[_] = p[_]);
502
+ if (T && T.defaultProps)
503
+ for (_ in p = T.defaultProps, p)
504
+ f[_] === void 0 && (f[_] = p[_]);
505
+ return { $$typeof: t, type: T, key: R, ref: S, props: f, _owner: u.current };
727
506
  }
728
- return $.Fragment = n, $.jsx = _, $.jsxs = _, $;
507
+ return V.Fragment = a, V.jsx = C, V.jsxs = C, V;
729
508
  }
730
- var V = {};
509
+ var K = {};
731
510
  /**
732
511
  * @license React
733
512
  * react-jsx-runtime.development.js
@@ -737,91 +516,91 @@ var V = {};
737
516
  * This source code is licensed under the MIT license found in the
738
517
  * LICENSE file in the root directory of this source tree.
739
518
  */
740
- var Ge;
741
- function er() {
742
- return Ge || (Ge = 1, process.env.NODE_ENV !== "production" && function() {
743
- var a = Be, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), _ = Symbol.for("react.provider"), w = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), D = Symbol.for("react.offscreen"), x = Symbol.iterator, Y = "@@iterator";
744
- function ee(e) {
519
+ var Ye;
520
+ function Bt() {
521
+ return Ye || (Ye = 1, process.env.NODE_ENV !== "production" && function() {
522
+ var i = Ge, t = Symbol.for("react.element"), a = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), E = Symbol.for("react.profiler"), C = Symbol.for("react.provider"), T = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), L = Symbol.iterator, Q = "@@iterator";
523
+ function Y(e) {
745
524
  if (e === null || typeof e != "object")
746
525
  return null;
747
- var r = x && e[x] || e[Y];
526
+ var r = L && e[L] || e[Q];
748
527
  return typeof r == "function" ? r : null;
749
528
  }
750
- var A = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
751
- function E(e) {
529
+ var A = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
530
+ function m(e) {
752
531
  {
753
- for (var r = arguments.length, i = new Array(r > 1 ? r - 1 : 0), s = 1; s < r; s++)
754
- i[s - 1] = arguments[s];
755
- G("error", e, i);
532
+ for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), s = 1; s < r; s++)
533
+ n[s - 1] = arguments[s];
534
+ G("error", e, n);
756
535
  }
757
536
  }
758
- function G(e, r, i) {
537
+ function G(e, r, n) {
759
538
  {
760
539
  var s = A.ReactDebugCurrentFrame, d = s.getStackAddendum();
761
- d !== "" && (r += "%s", i = i.concat([d]));
762
- var h = i.map(function(u) {
763
- return String(u);
540
+ d !== "" && (r += "%s", n = n.concat([d]));
541
+ var h = n.map(function(l) {
542
+ return String(l);
764
543
  });
765
544
  h.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, h);
766
545
  }
767
546
  }
768
- var J = !1, B = !1, te = !1, g = !1, b = !1, z;
769
- z = Symbol.for("react.module.reference");
770
- function Qe(e) {
771
- return !!(typeof e == "string" || typeof e == "function" || e === o || e === S || b || e === c || e === P || e === T || g || e === D || J || B || te || typeof e == "object" && e !== null && (e.$$typeof === f || e.$$typeof === R || e.$$typeof === _ || e.$$typeof === w || e.$$typeof === v || // This needs to include all possible module reference object
547
+ var B = !1, Z = !1, v = !1, w = !1, ee = !1, he;
548
+ he = Symbol.for("react.module.reference");
549
+ function ze(e) {
550
+ return !!(typeof e == "string" || typeof e == "function" || e === o || e === E || ee || e === u || e === I || e === _ || w || e === S || B || Z || v || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === f || e.$$typeof === C || e.$$typeof === T || e.$$typeof === p || // This needs to include all possible module reference object
772
551
  // types supported by any Flight configuration anywhere since
773
552
  // we don't know which Flight build this will end up being used
774
553
  // with.
775
- e.$$typeof === z || e.getModuleId !== void 0));
554
+ e.$$typeof === he || e.getModuleId !== void 0));
776
555
  }
777
- function Ze(e, r, i) {
556
+ function Xe(e, r, n) {
778
557
  var s = e.displayName;
779
558
  if (s)
780
559
  return s;
781
560
  var d = r.displayName || r.name || "";
782
- return d !== "" ? i + "(" + d + ")" : i;
561
+ return d !== "" ? n + "(" + d + ")" : n;
783
562
  }
784
563
  function ve(e) {
785
564
  return e.displayName || "Context";
786
565
  }
787
- function K(e) {
566
+ function D(e) {
788
567
  if (e == null)
789
568
  return null;
790
- if (typeof e.tag == "number" && E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
569
+ if (typeof e.tag == "number" && m("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
791
570
  return e.displayName || e.name || null;
792
571
  if (typeof e == "string")
793
572
  return e;
794
573
  switch (e) {
795
574
  case o:
796
575
  return "Fragment";
797
- case n:
576
+ case a:
798
577
  return "Portal";
799
- case S:
578
+ case E:
800
579
  return "Profiler";
801
- case c:
580
+ case u:
802
581
  return "StrictMode";
803
- case P:
582
+ case I:
804
583
  return "Suspense";
805
- case T:
584
+ case _:
806
585
  return "SuspenseList";
807
586
  }
808
587
  if (typeof e == "object")
809
588
  switch (e.$$typeof) {
810
- case w:
589
+ case T:
811
590
  var r = e;
812
591
  return ve(r) + ".Consumer";
813
- case _:
814
- var i = e;
815
- return ve(i._context) + ".Provider";
816
- case v:
817
- return Ze(e, e.render, "ForwardRef");
818
- case R:
592
+ case C:
593
+ var n = e;
594
+ return ve(n._context) + ".Provider";
595
+ case p:
596
+ return Xe(e, e.render, "ForwardRef");
597
+ case f:
819
598
  var s = e.displayName || null;
820
- return s !== null ? s : K(e.type) || "Memo";
821
- case f: {
822
- var d = e, h = d._payload, u = d._init;
599
+ return s !== null ? s : D(e.type) || "Memo";
600
+ case R: {
601
+ var d = e, h = d._payload, l = d._init;
823
602
  try {
824
- return K(u(h));
603
+ return D(l(h));
825
604
  } catch {
826
605
  return null;
827
606
  }
@@ -829,18 +608,18 @@ function er() {
829
608
  }
830
609
  return null;
831
610
  }
832
- var M = Object.assign, F = 0, ye, pe, me, Ee, _e, Te, Se;
833
- function ke() {
611
+ var U = Object.assign, W = 0, ge, pe, ye, Ee, me, _e, ke;
612
+ function Te() {
834
613
  }
835
- ke.__reactDisabledLog = !0;
836
- function et() {
614
+ Te.__reactDisabledLog = !0;
615
+ function Qe() {
837
616
  {
838
- if (F === 0) {
839
- ye = console.log, pe = console.info, me = console.warn, Ee = console.error, _e = console.group, Te = console.groupCollapsed, Se = console.groupEnd;
617
+ if (W === 0) {
618
+ ge = console.log, pe = console.info, ye = console.warn, Ee = console.error, me = console.group, _e = console.groupCollapsed, ke = console.groupEnd;
840
619
  var e = {
841
620
  configurable: !0,
842
621
  enumerable: !0,
843
- value: ke,
622
+ value: Te,
844
623
  writable: !0
845
624
  };
846
625
  Object.defineProperties(console, {
@@ -853,208 +632,208 @@ function er() {
853
632
  groupEnd: e
854
633
  });
855
634
  }
856
- F++;
635
+ W++;
857
636
  }
858
637
  }
859
- function tt() {
638
+ function Ze() {
860
639
  {
861
- if (F--, F === 0) {
640
+ if (W--, W === 0) {
862
641
  var e = {
863
642
  configurable: !0,
864
643
  enumerable: !0,
865
644
  writable: !0
866
645
  };
867
646
  Object.defineProperties(console, {
868
- log: M({}, e, {
869
- value: ye
647
+ log: U({}, e, {
648
+ value: ge
870
649
  }),
871
- info: M({}, e, {
650
+ info: U({}, e, {
872
651
  value: pe
873
652
  }),
874
- warn: M({}, e, {
875
- value: me
653
+ warn: U({}, e, {
654
+ value: ye
876
655
  }),
877
- error: M({}, e, {
656
+ error: U({}, e, {
878
657
  value: Ee
879
658
  }),
880
- group: M({}, e, {
881
- value: _e
659
+ group: U({}, e, {
660
+ value: me
882
661
  }),
883
- groupCollapsed: M({}, e, {
884
- value: Te
662
+ groupCollapsed: U({}, e, {
663
+ value: _e
885
664
  }),
886
- groupEnd: M({}, e, {
887
- value: Se
665
+ groupEnd: U({}, e, {
666
+ value: ke
888
667
  })
889
668
  });
890
669
  }
891
- F < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
670
+ W < 0 && m("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
892
671
  }
893
672
  }
894
- var re = A.ReactCurrentDispatcher, ne;
895
- function H(e, r, i) {
673
+ var te = A.ReactCurrentDispatcher, re;
674
+ function q(e, r, n) {
896
675
  {
897
- if (ne === void 0)
676
+ if (re === void 0)
898
677
  try {
899
678
  throw Error();
900
679
  } catch (d) {
901
680
  var s = d.stack.trim().match(/\n( *(at )?)/);
902
- ne = s && s[1] || "";
681
+ re = s && s[1] || "";
903
682
  }
904
683
  return `
905
- ` + ne + e;
684
+ ` + re + e;
906
685
  }
907
686
  }
908
- var ie = !1, q;
687
+ var ne = !1, J;
909
688
  {
910
- var rt = typeof WeakMap == "function" ? WeakMap : Map;
911
- q = new rt();
689
+ var et = typeof WeakMap == "function" ? WeakMap : Map;
690
+ J = new et();
912
691
  }
913
692
  function Re(e, r) {
914
- if (!e || ie)
693
+ if (!e || ne)
915
694
  return "";
916
695
  {
917
- var i = q.get(e);
918
- if (i !== void 0)
919
- return i;
696
+ var n = J.get(e);
697
+ if (n !== void 0)
698
+ return n;
920
699
  }
921
700
  var s;
922
- ie = !0;
701
+ ne = !0;
923
702
  var d = Error.prepareStackTrace;
924
703
  Error.prepareStackTrace = void 0;
925
704
  var h;
926
- h = re.current, re.current = null, et();
705
+ h = te.current, te.current = null, Qe();
927
706
  try {
928
707
  if (r) {
929
- var u = function() {
708
+ var l = function() {
930
709
  throw Error();
931
710
  };
932
- if (Object.defineProperty(u.prototype, "props", {
711
+ if (Object.defineProperty(l.prototype, "props", {
933
712
  set: function() {
934
713
  throw Error();
935
714
  }
936
715
  }), typeof Reflect == "object" && Reflect.construct) {
937
716
  try {
938
- Reflect.construct(u, []);
939
- } catch (U) {
940
- s = U;
717
+ Reflect.construct(l, []);
718
+ } catch (M) {
719
+ s = M;
941
720
  }
942
- Reflect.construct(e, [], u);
721
+ Reflect.construct(e, [], l);
943
722
  } else {
944
723
  try {
945
- u.call();
946
- } catch (U) {
947
- s = U;
724
+ l.call();
725
+ } catch (M) {
726
+ s = M;
948
727
  }
949
- e.call(u.prototype);
728
+ e.call(l.prototype);
950
729
  }
951
730
  } else {
952
731
  try {
953
732
  throw Error();
954
- } catch (U) {
955
- s = U;
733
+ } catch (M) {
734
+ s = M;
956
735
  }
957
736
  e();
958
737
  }
959
- } catch (U) {
960
- if (U && s && typeof U.stack == "string") {
961
- for (var l = U.stack.split(`
738
+ } catch (M) {
739
+ if (M && s && typeof M.stack == "string") {
740
+ for (var c = M.stack.split(`
962
741
  `), k = s.stack.split(`
963
- `), y = l.length - 1, m = k.length - 1; y >= 1 && m >= 0 && l[y] !== k[m]; )
964
- m--;
965
- for (; y >= 1 && m >= 0; y--, m--)
966
- if (l[y] !== k[m]) {
967
- if (y !== 1 || m !== 1)
742
+ `), g = c.length - 1, y = k.length - 1; g >= 1 && y >= 0 && c[g] !== k[y]; )
743
+ y--;
744
+ for (; g >= 1 && y >= 0; g--, y--)
745
+ if (c[g] !== k[y]) {
746
+ if (g !== 1 || y !== 1)
968
747
  do
969
- if (y--, m--, m < 0 || l[y] !== k[m]) {
970
- var C = `
971
- ` + l[y].replace(" at new ", " at ");
972
- return e.displayName && C.includes("<anonymous>") && (C = C.replace("<anonymous>", e.displayName)), typeof e == "function" && q.set(e, C), C;
748
+ if (g--, y--, y < 0 || c[g] !== k[y]) {
749
+ var b = `
750
+ ` + c[g].replace(" at new ", " at ");
751
+ return e.displayName && b.includes("<anonymous>") && (b = b.replace("<anonymous>", e.displayName)), typeof e == "function" && J.set(e, b), b;
973
752
  }
974
- while (y >= 1 && m >= 0);
753
+ while (g >= 1 && y >= 0);
975
754
  break;
976
755
  }
977
756
  }
978
757
  } finally {
979
- ie = !1, re.current = h, tt(), Error.prepareStackTrace = d;
758
+ ne = !1, te.current = h, Ze(), Error.prepareStackTrace = d;
980
759
  }
981
- var L = e ? e.displayName || e.name : "", je = L ? H(L) : "";
982
- return typeof e == "function" && q.set(e, je), je;
760
+ var F = e ? e.displayName || e.name : "", je = F ? q(F) : "";
761
+ return typeof e == "function" && J.set(e, je), je;
983
762
  }
984
- function nt(e, r, i) {
763
+ function tt(e, r, n) {
985
764
  return Re(e, !1);
986
765
  }
987
- function it(e) {
766
+ function rt(e) {
988
767
  var r = e.prototype;
989
768
  return !!(r && r.isReactComponent);
990
769
  }
991
- function X(e, r, i) {
770
+ function H(e, r, n) {
992
771
  if (e == null)
993
772
  return "";
994
773
  if (typeof e == "function")
995
- return Re(e, it(e));
774
+ return Re(e, rt(e));
996
775
  if (typeof e == "string")
997
- return H(e);
776
+ return q(e);
998
777
  switch (e) {
999
- case P:
1000
- return H("Suspense");
1001
- case T:
1002
- return H("SuspenseList");
778
+ case I:
779
+ return q("Suspense");
780
+ case _:
781
+ return q("SuspenseList");
1003
782
  }
1004
783
  if (typeof e == "object")
1005
784
  switch (e.$$typeof) {
1006
- case v:
1007
- return nt(e.render);
1008
- case R:
1009
- return X(e.type, r, i);
1010
- case f: {
785
+ case p:
786
+ return tt(e.render);
787
+ case f:
788
+ return H(e.type, r, n);
789
+ case R: {
1011
790
  var s = e, d = s._payload, h = s._init;
1012
791
  try {
1013
- return X(h(d), r, i);
792
+ return H(h(d), r, n);
1014
793
  } catch {
1015
794
  }
1016
795
  }
1017
796
  }
1018
797
  return "";
1019
798
  }
1020
- var Q = Object.prototype.hasOwnProperty, we = {}, be = A.ReactDebugCurrentFrame;
1021
- function Z(e) {
799
+ var z = Object.prototype.hasOwnProperty, we = {}, be = A.ReactDebugCurrentFrame;
800
+ function X(e) {
1022
801
  if (e) {
1023
- var r = e._owner, i = X(e.type, e._source, r ? r.type : null);
1024
- be.setExtraStackFrame(i);
802
+ var r = e._owner, n = H(e.type, e._source, r ? r.type : null);
803
+ be.setExtraStackFrame(n);
1025
804
  } else
1026
805
  be.setExtraStackFrame(null);
1027
806
  }
1028
- function at(e, r, i, s, d) {
807
+ function nt(e, r, n, s, d) {
1029
808
  {
1030
- var h = Function.call.bind(Q);
1031
- for (var u in e)
1032
- if (h(e, u)) {
1033
- var l = void 0;
809
+ var h = Function.call.bind(z);
810
+ for (var l in e)
811
+ if (h(e, l)) {
812
+ var c = void 0;
1034
813
  try {
1035
- if (typeof e[u] != "function") {
1036
- var k = Error((s || "React class") + ": " + i + " type `" + u + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[u] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
814
+ if (typeof e[l] != "function") {
815
+ var k = Error((s || "React class") + ": " + n + " type `" + l + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[l] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
1037
816
  throw k.name = "Invariant Violation", k;
1038
817
  }
1039
- l = e[u](r, u, s, i, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
1040
- } catch (y) {
1041
- l = y;
818
+ c = e[l](r, l, s, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
819
+ } catch (g) {
820
+ c = g;
1042
821
  }
1043
- l && !(l instanceof Error) && (Z(d), E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", s || "React class", i, u, typeof l), Z(null)), l instanceof Error && !(l.message in we) && (we[l.message] = !0, Z(d), E("Failed %s type: %s", i, l.message), Z(null));
822
+ c && !(c instanceof Error) && (X(d), m("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", s || "React class", n, l, typeof c), X(null)), c instanceof Error && !(c.message in we) && (we[c.message] = !0, X(d), m("Failed %s type: %s", n, c.message), X(null));
1044
823
  }
1045
824
  }
1046
825
  }
1047
- var ot = Array.isArray;
826
+ var at = Array.isArray;
1048
827
  function ae(e) {
1049
- return ot(e);
828
+ return at(e);
1050
829
  }
1051
- function st(e) {
830
+ function it(e) {
1052
831
  {
1053
- var r = typeof Symbol == "function" && Symbol.toStringTag, i = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
1054
- return i;
832
+ var r = typeof Symbol == "function" && Symbol.toStringTag, n = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
833
+ return n;
1055
834
  }
1056
835
  }
1057
- function ct(e) {
836
+ function ot(e) {
1058
837
  try {
1059
838
  return Ce(e), !1;
1060
839
  } catch {
@@ -1064,125 +843,125 @@ function er() {
1064
843
  function Ce(e) {
1065
844
  return "" + e;
1066
845
  }
1067
- function Pe(e) {
1068
- if (ct(e))
1069
- return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", st(e)), Ce(e);
846
+ function Se(e) {
847
+ if (ot(e))
848
+ return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", it(e)), Ce(e);
1070
849
  }
1071
- var N = A.ReactCurrentOwner, lt = {
850
+ var N = A.ReactCurrentOwner, st = {
1072
851
  key: !0,
1073
852
  ref: !0,
1074
853
  __self: !0,
1075
854
  __source: !0
1076
- }, Oe, Ie, oe;
1077
- oe = {};
1078
- function ut(e) {
1079
- if (Q.call(e, "ref")) {
855
+ }, Pe, Oe, ie;
856
+ ie = {};
857
+ function ct(e) {
858
+ if (z.call(e, "ref")) {
1080
859
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
1081
860
  if (r && r.isReactWarning)
1082
861
  return !1;
1083
862
  }
1084
863
  return e.ref !== void 0;
1085
864
  }
1086
- function ft(e) {
1087
- if (Q.call(e, "key")) {
865
+ function lt(e) {
866
+ if (z.call(e, "key")) {
1088
867
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
1089
868
  if (r && r.isReactWarning)
1090
869
  return !1;
1091
870
  }
1092
871
  return e.key !== void 0;
1093
872
  }
1094
- function dt(e, r) {
873
+ function ut(e, r) {
1095
874
  if (typeof e.ref == "string" && N.current && r && N.current.stateNode !== r) {
1096
- var i = K(N.current.type);
1097
- oe[i] || (E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', K(N.current.type), e.ref), oe[i] = !0);
875
+ var n = D(N.current.type);
876
+ ie[n] || (m('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', D(N.current.type), e.ref), ie[n] = !0);
1098
877
  }
1099
878
  }
1100
- function ht(e, r) {
879
+ function ft(e, r) {
1101
880
  {
1102
- var i = function() {
1103
- Oe || (Oe = !0, E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
881
+ var n = function() {
882
+ Pe || (Pe = !0, m("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
1104
883
  };
1105
- i.isReactWarning = !0, Object.defineProperty(e, "key", {
1106
- get: i,
884
+ n.isReactWarning = !0, Object.defineProperty(e, "key", {
885
+ get: n,
1107
886
  configurable: !0
1108
887
  });
1109
888
  }
1110
889
  }
1111
- function gt(e, r) {
890
+ function dt(e, r) {
1112
891
  {
1113
- var i = function() {
1114
- Ie || (Ie = !0, E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
892
+ var n = function() {
893
+ Oe || (Oe = !0, m("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
1115
894
  };
1116
- i.isReactWarning = !0, Object.defineProperty(e, "ref", {
1117
- get: i,
895
+ n.isReactWarning = !0, Object.defineProperty(e, "ref", {
896
+ get: n,
1118
897
  configurable: !0
1119
898
  });
1120
899
  }
1121
900
  }
1122
- var vt = function(e, r, i, s, d, h, u) {
1123
- var l = {
901
+ var ht = function(e, r, n, s, d, h, l) {
902
+ var c = {
1124
903
  // This tag allows us to uniquely identify this as a React Element
1125
904
  $$typeof: t,
1126
905
  // Built-in properties that belong on the element
1127
906
  type: e,
1128
907
  key: r,
1129
- ref: i,
1130
- props: u,
908
+ ref: n,
909
+ props: l,
1131
910
  // Record the component responsible for creating this element.
1132
911
  _owner: h
1133
912
  };
1134
- return l._store = {}, Object.defineProperty(l._store, "validated", {
913
+ return c._store = {}, Object.defineProperty(c._store, "validated", {
1135
914
  configurable: !1,
1136
915
  enumerable: !1,
1137
916
  writable: !0,
1138
917
  value: !1
1139
- }), Object.defineProperty(l, "_self", {
918
+ }), Object.defineProperty(c, "_self", {
1140
919
  configurable: !1,
1141
920
  enumerable: !1,
1142
921
  writable: !1,
1143
922
  value: s
1144
- }), Object.defineProperty(l, "_source", {
923
+ }), Object.defineProperty(c, "_source", {
1145
924
  configurable: !1,
1146
925
  enumerable: !1,
1147
926
  writable: !1,
1148
927
  value: d
1149
- }), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
928
+ }), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
1150
929
  };
1151
- function yt(e, r, i, s, d) {
930
+ function vt(e, r, n, s, d) {
1152
931
  {
1153
- var h, u = {}, l = null, k = null;
1154
- i !== void 0 && (Pe(i), l = "" + i), ft(r) && (Pe(r.key), l = "" + r.key), ut(r) && (k = r.ref, dt(r, d));
932
+ var h, l = {}, c = null, k = null;
933
+ n !== void 0 && (Se(n), c = "" + n), lt(r) && (Se(r.key), c = "" + r.key), ct(r) && (k = r.ref, ut(r, d));
1155
934
  for (h in r)
1156
- Q.call(r, h) && !lt.hasOwnProperty(h) && (u[h] = r[h]);
935
+ z.call(r, h) && !st.hasOwnProperty(h) && (l[h] = r[h]);
1157
936
  if (e && e.defaultProps) {
1158
- var y = e.defaultProps;
1159
- for (h in y)
1160
- u[h] === void 0 && (u[h] = y[h]);
937
+ var g = e.defaultProps;
938
+ for (h in g)
939
+ l[h] === void 0 && (l[h] = g[h]);
1161
940
  }
1162
- if (l || k) {
1163
- var m = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
1164
- l && ht(u, m), k && gt(u, m);
941
+ if (c || k) {
942
+ var y = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
943
+ c && ft(l, y), k && dt(l, y);
1165
944
  }
1166
- return vt(e, l, k, d, s, N.current, u);
945
+ return ht(e, c, k, d, s, N.current, l);
1167
946
  }
1168
947
  }
1169
- var se = A.ReactCurrentOwner, xe = A.ReactDebugCurrentFrame;
948
+ var oe = A.ReactCurrentOwner, xe = A.ReactDebugCurrentFrame;
1170
949
  function j(e) {
1171
950
  if (e) {
1172
- var r = e._owner, i = X(e.type, e._source, r ? r.type : null);
1173
- xe.setExtraStackFrame(i);
951
+ var r = e._owner, n = H(e.type, e._source, r ? r.type : null);
952
+ xe.setExtraStackFrame(n);
1174
953
  } else
1175
954
  xe.setExtraStackFrame(null);
1176
955
  }
1177
- var ce;
1178
- ce = !1;
1179
- function le(e) {
956
+ var se;
957
+ se = !1;
958
+ function ce(e) {
1180
959
  return typeof e == "object" && e !== null && e.$$typeof === t;
1181
960
  }
1182
- function Ae() {
961
+ function Ie() {
1183
962
  {
1184
- if (se.current) {
1185
- var e = K(se.current.type);
963
+ if (oe.current) {
964
+ var e = D(oe.current.type);
1186
965
  if (e)
1187
966
  return `
1188
967
 
@@ -1191,146 +970,146 @@ Check the render method of \`` + e + "`.";
1191
970
  return "";
1192
971
  }
1193
972
  }
1194
- function pt(e) {
973
+ function gt(e) {
1195
974
  {
1196
975
  if (e !== void 0) {
1197
- var r = e.fileName.replace(/^.*[\\\/]/, ""), i = e.lineNumber;
976
+ var r = e.fileName.replace(/^.*[\\\/]/, ""), n = e.lineNumber;
1198
977
  return `
1199
978
 
1200
- Check your code at ` + r + ":" + i + ".";
979
+ Check your code at ` + r + ":" + n + ".";
1201
980
  }
1202
981
  return "";
1203
982
  }
1204
983
  }
1205
- var Ke = {};
1206
- function mt(e) {
984
+ var Ae = {};
985
+ function pt(e) {
1207
986
  {
1208
- var r = Ae();
987
+ var r = Ie();
1209
988
  if (!r) {
1210
- var i = typeof e == "string" ? e : e.displayName || e.name;
1211
- i && (r = `
989
+ var n = typeof e == "string" ? e : e.displayName || e.name;
990
+ n && (r = `
1212
991
 
1213
- Check the top-level render call using <` + i + ">.");
992
+ Check the top-level render call using <` + n + ">.");
1214
993
  }
1215
994
  return r;
1216
995
  }
1217
996
  }
1218
- function Ue(e, r) {
997
+ function De(e, r) {
1219
998
  {
1220
999
  if (!e._store || e._store.validated || e.key != null)
1221
1000
  return;
1222
1001
  e._store.validated = !0;
1223
- var i = mt(r);
1224
- if (Ke[i])
1002
+ var n = pt(r);
1003
+ if (Ae[n])
1225
1004
  return;
1226
- Ke[i] = !0;
1005
+ Ae[n] = !0;
1227
1006
  var s = "";
1228
- e && e._owner && e._owner !== se.current && (s = " It was passed a child from " + K(e._owner.type) + "."), j(e), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', i, s), j(null);
1007
+ e && e._owner && e._owner !== oe.current && (s = " It was passed a child from " + D(e._owner.type) + "."), j(e), m('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, s), j(null);
1229
1008
  }
1230
1009
  }
1231
- function De(e, r) {
1010
+ function Me(e, r) {
1232
1011
  {
1233
1012
  if (typeof e != "object")
1234
1013
  return;
1235
1014
  if (ae(e))
1236
- for (var i = 0; i < e.length; i++) {
1237
- var s = e[i];
1238
- le(s) && Ue(s, r);
1015
+ for (var n = 0; n < e.length; n++) {
1016
+ var s = e[n];
1017
+ ce(s) && De(s, r);
1239
1018
  }
1240
- else if (le(e))
1019
+ else if (ce(e))
1241
1020
  e._store && (e._store.validated = !0);
1242
1021
  else if (e) {
1243
- var d = ee(e);
1022
+ var d = Y(e);
1244
1023
  if (typeof d == "function" && d !== e.entries)
1245
- for (var h = d.call(e), u; !(u = h.next()).done; )
1246
- le(u.value) && Ue(u.value, r);
1024
+ for (var h = d.call(e), l; !(l = h.next()).done; )
1025
+ ce(l.value) && De(l.value, r);
1247
1026
  }
1248
1027
  }
1249
1028
  }
1250
- function Et(e) {
1029
+ function yt(e) {
1251
1030
  {
1252
1031
  var r = e.type;
1253
1032
  if (r == null || typeof r == "string")
1254
1033
  return;
1255
- var i;
1034
+ var n;
1256
1035
  if (typeof r == "function")
1257
- i = r.propTypes;
1258
- else if (typeof r == "object" && (r.$$typeof === v || // Note: Memo only checks outer props here.
1036
+ n = r.propTypes;
1037
+ else if (typeof r == "object" && (r.$$typeof === p || // Note: Memo only checks outer props here.
1259
1038
  // Inner props are checked in the reconciler.
1260
- r.$$typeof === R))
1261
- i = r.propTypes;
1039
+ r.$$typeof === f))
1040
+ n = r.propTypes;
1262
1041
  else
1263
1042
  return;
1264
- if (i) {
1265
- var s = K(r);
1266
- at(i, e.props, "prop", s, e);
1267
- } else if (r.PropTypes !== void 0 && !ce) {
1268
- ce = !0;
1269
- var d = K(r);
1270
- E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", d || "Unknown");
1043
+ if (n) {
1044
+ var s = D(r);
1045
+ nt(n, e.props, "prop", s, e);
1046
+ } else if (r.PropTypes !== void 0 && !se) {
1047
+ se = !0;
1048
+ var d = D(r);
1049
+ m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", d || "Unknown");
1271
1050
  }
1272
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1051
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1273
1052
  }
1274
1053
  }
1275
- function _t(e) {
1054
+ function Et(e) {
1276
1055
  {
1277
- for (var r = Object.keys(e.props), i = 0; i < r.length; i++) {
1278
- var s = r[i];
1056
+ for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
1057
+ var s = r[n];
1279
1058
  if (s !== "children" && s !== "key") {
1280
- j(e), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", s), j(null);
1059
+ j(e), m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", s), j(null);
1281
1060
  break;
1282
1061
  }
1283
1062
  }
1284
- e.ref !== null && (j(e), E("Invalid attribute `ref` supplied to `React.Fragment`."), j(null));
1063
+ e.ref !== null && (j(e), m("Invalid attribute `ref` supplied to `React.Fragment`."), j(null));
1285
1064
  }
1286
1065
  }
1287
- function Me(e, r, i, s, d, h) {
1066
+ function Ue(e, r, n, s, d, h) {
1288
1067
  {
1289
- var u = Qe(e);
1290
- if (!u) {
1291
- var l = "";
1292
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (l += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1293
- var k = pt(d);
1294
- k ? l += k : l += Ae();
1295
- var y;
1296
- e === null ? y = "null" : ae(e) ? y = "array" : e !== void 0 && e.$$typeof === t ? (y = "<" + (K(e.type) || "Unknown") + " />", l = " Did you accidentally export a JSX literal instead of a component?") : y = typeof e, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", y, l);
1068
+ var l = ze(e);
1069
+ if (!l) {
1070
+ var c = "";
1071
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (c += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1072
+ var k = gt(d);
1073
+ k ? c += k : c += Ie();
1074
+ var g;
1075
+ e === null ? g = "null" : ae(e) ? g = "array" : e !== void 0 && e.$$typeof === t ? (g = "<" + (D(e.type) || "Unknown") + " />", c = " Did you accidentally export a JSX literal instead of a component?") : g = typeof e, m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", g, c);
1297
1076
  }
1298
- var m = yt(e, r, i, d, h);
1299
- if (m == null)
1300
- return m;
1301
- if (u) {
1302
- var C = r.children;
1303
- if (C !== void 0)
1077
+ var y = vt(e, r, n, d, h);
1078
+ if (y == null)
1079
+ return y;
1080
+ if (l) {
1081
+ var b = r.children;
1082
+ if (b !== void 0)
1304
1083
  if (s)
1305
- if (ae(C)) {
1306
- for (var L = 0; L < C.length; L++)
1307
- De(C[L], e);
1308
- Object.freeze && Object.freeze(C);
1084
+ if (ae(b)) {
1085
+ for (var F = 0; F < b.length; F++)
1086
+ Me(b[F], e);
1087
+ Object.freeze && Object.freeze(b);
1309
1088
  } else
1310
- E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
1089
+ m("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
1311
1090
  else
1312
- De(C, e);
1091
+ Me(b, e);
1313
1092
  }
1314
- return e === o ? _t(m) : Et(m), m;
1093
+ return e === o ? Et(y) : yt(y), y;
1315
1094
  }
1316
1095
  }
1317
- function Tt(e, r, i) {
1318
- return Me(e, r, i, !0);
1096
+ function mt(e, r, n) {
1097
+ return Ue(e, r, n, !0);
1319
1098
  }
1320
- function St(e, r, i) {
1321
- return Me(e, r, i, !1);
1099
+ function _t(e, r, n) {
1100
+ return Ue(e, r, n, !1);
1322
1101
  }
1323
- var kt = St, Rt = Tt;
1324
- V.Fragment = o, V.jsx = kt, V.jsxs = Rt;
1325
- }()), V;
1102
+ var kt = _t, Tt = mt;
1103
+ K.Fragment = o, K.jsx = kt, K.jsxs = Tt;
1104
+ }()), K;
1326
1105
  }
1327
- process.env.NODE_ENV === "production" ? de.exports = Zt() : de.exports = er();
1328
- var he = de.exports;
1329
- const tr = (a, t) => {
1106
+ process.env.NODE_ENV === "production" ? fe.exports = Gt() : fe.exports = Bt();
1107
+ var de = fe.exports;
1108
+ const qt = (i, t) => {
1330
1109
  switch (t.type) {
1331
1110
  case "INIT":
1332
1111
  return {
1333
- ...a,
1112
+ ...i,
1334
1113
  isLoading: !1,
1335
1114
  isAuthenticated: t.user != null,
1336
1115
  user: t.user,
@@ -1340,7 +1119,7 @@ const tr = (a, t) => {
1340
1119
  case "HANDLE_CALLBACK_COMPLETE":
1341
1120
  case "GET_ACCESS_TOKEN_COMPLETE":
1342
1121
  return {
1343
- ...a,
1122
+ ...i,
1344
1123
  isLoading: !1,
1345
1124
  isAuthenticated: t.user != null,
1346
1125
  user: t.user,
@@ -1348,146 +1127,136 @@ const tr = (a, t) => {
1348
1127
  };
1349
1128
  case "LOGOUT":
1350
1129
  return {
1351
- ...a,
1130
+ ...i,
1352
1131
  isAuthenticated: !1,
1353
1132
  user: void 0
1354
1133
  };
1355
1134
  case "ERROR":
1356
1135
  return {
1357
- ...a,
1136
+ ...i,
1358
1137
  isLoading: !1,
1359
1138
  error: t.error
1360
1139
  };
1361
1140
  }
1362
- }, rr = {
1141
+ }, Jt = {
1363
1142
  isLoading: !0,
1364
1143
  isAuthenticated: !1
1365
- }, Je = (a) => {
1366
- if (a == null || Object.keys(a).length <= 0)
1144
+ }, Ht = (i) => {
1145
+ if (i == null || Object.keys(i).length <= 0)
1367
1146
  return !0;
1368
- const t = Object.keys(a);
1369
- for (const n of t)
1370
- if (a[n] != null && a[n] !== "")
1147
+ const t = Object.keys(i);
1148
+ for (const a of t)
1149
+ if (i[a] != null && i[a] !== "")
1371
1150
  return !1;
1372
1151
  return !0;
1373
- }, nr = (a) => {
1374
- const t = Je(a.config), n = Je(a.persistentOptions);
1375
- return !t || !n;
1376
- }, ir = (a) => {
1152
+ }, zt = (i) => !Ht(i.config), Xt = (i) => {
1377
1153
  const {
1378
1154
  children: t,
1379
- configurationEndpoint: n,
1155
+ configurationEndpoint: a,
1380
1156
  clientId: o,
1381
- redirectUrl: c,
1382
- logoutRedirectUrl: S,
1383
- scopes: _,
1384
- persistentStore: w,
1385
- onRedirectCallback: v,
1386
- checkRedirectUrlMatch: P
1387
- } = a;
1388
- if (ze(fe) != null)
1157
+ redirectUrl: u,
1158
+ logoutRedirectUrl: E,
1159
+ scopes: C,
1160
+ onRedirectCallback: T,
1161
+ checkRedirectUrlMatch: p
1162
+ } = i;
1163
+ if (Be(ue) != null)
1389
1164
  throw new Error("TID Provider already defined");
1390
- const R = {
1165
+ const _ = {
1391
1166
  config: {
1392
- configurationEndpoint: n ?? "",
1167
+ configurationEndpoint: a ?? "",
1393
1168
  clientId: o ?? "",
1394
- redirectUrl: c ?? "",
1395
- logoutRedirectUrl: S ?? "",
1396
- scopes: _ ?? [""]
1397
- },
1398
- persistentOptions: {
1399
- persistentStore: w ?? "in-memory"
1169
+ redirectUrl: u ?? "",
1170
+ logoutRedirectUrl: E ?? "",
1171
+ scopes: C ?? [""]
1400
1172
  }
1401
- }, [f] = At(a.tidClient ?? new Qt(R)), [D, x] = Kt(tr, rr), Y = Ut(!1), ee = Fe(
1402
- () => P ? f.getRedirectUrl() : void 0,
1403
- [P, f]
1173
+ }, [f] = xt(i.tidClient ?? new Yt(_)), [R, S] = It(qt, Jt), L = At(!1), Q = Le(
1174
+ () => p ? f.getRedirectUrl() : void 0,
1175
+ [p, f]
1404
1176
  );
1405
- He(() => {
1406
- Y.current || (a.tidClient != null && nr({
1177
+ qe(() => {
1178
+ L.current || (i.tidClient != null && zt({
1407
1179
  config: {
1408
- configurationEndpoint: n,
1180
+ configurationEndpoint: a,
1409
1181
  clientId: o,
1410
- redirectUrl: c,
1411
- logoutRedirectUrl: S,
1412
- scopes: _
1413
- },
1414
- persistentOptions: {
1415
- persistentStore: w
1182
+ redirectUrl: u,
1183
+ logoutRedirectUrl: E,
1184
+ scopes: C
1416
1185
  }
1417
1186
  }) && console.warn(
1418
1187
  "When TID client is pass as prop, any client configuration property sent directly to the TID Provider component will be ignored"
1419
- ), Y.current = !0, (async () => {
1188
+ ), L.current = !0, (async () => {
1420
1189
  try {
1421
- let g;
1422
- if (Yt(void 0, ee)) {
1423
- const { authState: b } = await f.handleCallback();
1424
- g = await f.getUser(), v != null && v(b);
1190
+ let v;
1191
+ if (Ft(void 0, Q)) {
1192
+ const { authState: w } = await f.handleCallback();
1193
+ v = await f.getUser(), T != null && T(w);
1425
1194
  } else
1426
- await f.loadUserSession(), g = await f.getUser();
1427
- x({ type: "INIT", user: g });
1428
- } catch (g) {
1429
- let b = g;
1430
- typeof g == "string" && (b = new Error(g)), x({ type: "ERROR", error: b });
1195
+ await f.loadUserSession(), v = await f.getUser();
1196
+ S({ type: "INIT", user: v });
1197
+ } catch (v) {
1198
+ let w = v;
1199
+ typeof v == "string" && (w = new Error(v)), S({ type: "ERROR", error: w });
1431
1200
  }
1432
1201
  })());
1433
- }, [f, v]);
1434
- const A = W(async () => {
1435
- const g = await f.getAccessTokenSilently(), b = await f.getUser();
1436
- return x({
1202
+ }, [f, T]);
1203
+ const Y = $(async () => {
1204
+ const v = await f.getAccessTokenSilently(), w = await f.getUser();
1205
+ return S({
1437
1206
  type: "GET_ACCESS_TOKEN_COMPLETE",
1438
- user: b
1439
- }), g;
1440
- }, [f]), E = W(async () => {
1441
- const g = await f.getTokens(), b = await f.getUser();
1442
- return x({
1207
+ user: w
1208
+ }), v;
1209
+ }, [f]), A = $(async () => {
1210
+ const v = await f.getTokens(), w = await f.getUser();
1211
+ return S({
1443
1212
  type: "GET_TOKENS_COMPLETE",
1444
- user: b
1445
- }), g;
1446
- }, [f]), G = W(
1447
- async (g) => {
1448
- await f.loginWithRedirect(g);
1213
+ user: w
1214
+ }), v;
1215
+ }, [f]), m = $(
1216
+ async (v) => {
1217
+ await f.loginWithRedirect(v);
1449
1218
  },
1450
1219
  [f]
1451
- ), J = W(
1452
- async (g) => {
1453
- await f.logout(g), (g == null ? void 0 : g.disabledAutoRedirect) != null && g.disabledAutoRedirect && x({
1220
+ ), G = $(
1221
+ async (v) => {
1222
+ await f.logout(v), (v == null ? void 0 : v.disabledAutoRedirect) != null && v.disabledAutoRedirect && S({
1454
1223
  type: "LOGOUT"
1455
1224
  });
1456
1225
  },
1457
1226
  [f]
1458
- ), B = W(
1459
- async (g) => {
1460
- const { authState: b } = await f.handleCallback(g), z = await f.getUser();
1461
- return x({
1227
+ ), B = $(
1228
+ async (v) => {
1229
+ const { authState: w } = await f.handleCallback(v), ee = await f.getUser();
1230
+ return S({
1462
1231
  type: "HANDLE_CALLBACK_COMPLETE",
1463
- user: z
1232
+ user: ee
1464
1233
  }), {
1465
- authState: b
1234
+ authState: w
1466
1235
  };
1467
1236
  },
1468
1237
  [f]
1469
- ), te = Fe(
1238
+ ), Z = Le(
1470
1239
  () => ({
1471
- ...D,
1472
- getAccessTokenSilently: A,
1473
- getTokens: E,
1474
- loginWithRedirect: G,
1240
+ ...R,
1241
+ getAccessTokenSilently: Y,
1242
+ getTokens: A,
1243
+ loginWithRedirect: m,
1475
1244
  handleCallback: B,
1476
- logout: J
1245
+ logout: G
1477
1246
  }),
1478
- [D, A, E, G, B, J]
1247
+ [R, Y, A, m, B, G]
1479
1248
  );
1480
- return /* @__PURE__ */ he.jsx(fe.Provider, { value: te, children: t });
1481
- }, lr = Xe, ur = ir, fr = ({ renderComponent: a, loader: t }) => {
1482
- const { isAuthenticated: n, isLoading: o, loginWithRedirect: c } = Xe();
1483
- return He(() => {
1484
- !o && !n && (async () => await c())();
1485
- }, [o, n, c]), n ? a : t || /* @__PURE__ */ he.jsx(he.Fragment, {});
1249
+ return /* @__PURE__ */ de.jsx(ue.Provider, { value: Z, children: t });
1250
+ }, rr = He, nr = Xt, ar = ({ renderComponent: i, loader: t }) => {
1251
+ const { isAuthenticated: a, isLoading: o, loginWithRedirect: u } = He();
1252
+ return qe(() => {
1253
+ !o && !a && (async () => await u())();
1254
+ }, [o, a, u]), a ? i : t || /* @__PURE__ */ de.jsx(de.Fragment, {});
1486
1255
  };
1487
1256
  export {
1488
- fr as AuthenticationGuard,
1489
- Qt as TIDClient,
1490
- fe as TIDContext,
1491
- ur as TIDProvider,
1492
- lr as useAuth
1257
+ ar as AuthenticationGuard,
1258
+ Yt as TIDClient,
1259
+ ue as TIDContext,
1260
+ nr as TIDProvider,
1261
+ rr as useAuth
1493
1262
  };