flowlink-auth 2.7.7 → 2.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/provider.js CHANGED
@@ -1,1058 +1,19 @@
1
1
  "use client";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function __require() {
9
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
-
28
- // node_modules/react/cjs/react.development.js
29
- var require_react_development = __commonJS({
30
- "node_modules/react/cjs/react.development.js"(exports, module) {
31
- "use strict";
32
- (function() {
33
- function defineDeprecationWarning(methodName, info) {
34
- Object.defineProperty(Component.prototype, methodName, {
35
- get: function() {
36
- console.warn(
37
- "%s(...) is deprecated in plain JavaScript React classes. %s",
38
- info[0],
39
- info[1]
40
- );
41
- }
42
- });
43
- }
44
- function getIteratorFn(maybeIterable) {
45
- if (null === maybeIterable || "object" !== typeof maybeIterable)
46
- return null;
47
- maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
48
- return "function" === typeof maybeIterable ? maybeIterable : null;
49
- }
50
- function warnNoop(publicInstance, callerName) {
51
- publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
52
- var warningKey = publicInstance + "." + callerName;
53
- didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error(
54
- "Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",
55
- callerName,
56
- publicInstance
57
- ), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
58
- }
59
- function Component(props, context, updater) {
60
- this.props = props;
61
- this.context = context;
62
- this.refs = emptyObject;
63
- this.updater = updater || ReactNoopUpdateQueue;
64
- }
65
- function ComponentDummy() {
66
- }
67
- function PureComponent(props, context, updater) {
68
- this.props = props;
69
- this.context = context;
70
- this.refs = emptyObject;
71
- this.updater = updater || ReactNoopUpdateQueue;
72
- }
73
- function noop() {
74
- }
75
- function testStringCoercion(value) {
76
- return "" + value;
77
- }
78
- function checkKeyStringCoercion(value) {
79
- try {
80
- testStringCoercion(value);
81
- var JSCompiler_inline_result = false;
82
- } catch (e) {
83
- JSCompiler_inline_result = true;
84
- }
85
- if (JSCompiler_inline_result) {
86
- JSCompiler_inline_result = console;
87
- var JSCompiler_temp_const = JSCompiler_inline_result.error;
88
- var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
89
- JSCompiler_temp_const.call(
90
- JSCompiler_inline_result,
91
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
92
- JSCompiler_inline_result$jscomp$0
93
- );
94
- return testStringCoercion(value);
95
- }
96
- }
97
- function getComponentNameFromType(type) {
98
- if (null == type) return null;
99
- if ("function" === typeof type)
100
- return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
101
- if ("string" === typeof type) return type;
102
- switch (type) {
103
- case REACT_FRAGMENT_TYPE:
104
- return "Fragment";
105
- case REACT_PROFILER_TYPE:
106
- return "Profiler";
107
- case REACT_STRICT_MODE_TYPE:
108
- return "StrictMode";
109
- case REACT_SUSPENSE_TYPE:
110
- return "Suspense";
111
- case REACT_SUSPENSE_LIST_TYPE:
112
- return "SuspenseList";
113
- case REACT_ACTIVITY_TYPE:
114
- return "Activity";
115
- }
116
- if ("object" === typeof type)
117
- switch ("number" === typeof type.tag && console.error(
118
- "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
119
- ), type.$$typeof) {
120
- case REACT_PORTAL_TYPE:
121
- return "Portal";
122
- case REACT_CONTEXT_TYPE:
123
- return type.displayName || "Context";
124
- case REACT_CONSUMER_TYPE:
125
- return (type._context.displayName || "Context") + ".Consumer";
126
- case REACT_FORWARD_REF_TYPE:
127
- var innerType = type.render;
128
- type = type.displayName;
129
- type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
130
- return type;
131
- case REACT_MEMO_TYPE:
132
- return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
133
- case REACT_LAZY_TYPE:
134
- innerType = type._payload;
135
- type = type._init;
136
- try {
137
- return getComponentNameFromType(type(innerType));
138
- } catch (x) {
139
- }
140
- }
141
- return null;
142
- }
143
- function getTaskName(type) {
144
- if (type === REACT_FRAGMENT_TYPE) return "<>";
145
- if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
146
- return "<...>";
147
- try {
148
- var name = getComponentNameFromType(type);
149
- return name ? "<" + name + ">" : "<...>";
150
- } catch (x) {
151
- return "<...>";
152
- }
153
- }
154
- function getOwner() {
155
- var dispatcher = ReactSharedInternals.A;
156
- return null === dispatcher ? null : dispatcher.getOwner();
157
- }
158
- function UnknownOwner() {
159
- return Error("react-stack-top-frame");
160
- }
161
- function hasValidKey(config) {
162
- if (hasOwnProperty.call(config, "key")) {
163
- var getter = Object.getOwnPropertyDescriptor(config, "key").get;
164
- if (getter && getter.isReactWarning) return false;
165
- }
166
- return void 0 !== config.key;
167
- }
168
- function defineKeyPropWarningGetter(props, displayName) {
169
- function warnAboutAccessingKey() {
170
- specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
171
- "%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://react.dev/link/special-props)",
172
- displayName
173
- ));
174
- }
175
- warnAboutAccessingKey.isReactWarning = true;
176
- Object.defineProperty(props, "key", {
177
- get: warnAboutAccessingKey,
178
- configurable: true
179
- });
180
- }
181
- function elementRefGetterWithDeprecationWarning() {
182
- var componentName = getComponentNameFromType(this.type);
183
- didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
184
- "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
185
- ));
186
- componentName = this.props.ref;
187
- return void 0 !== componentName ? componentName : null;
188
- }
189
- function ReactElement(type, key, props, owner, debugStack, debugTask) {
190
- var refProp = props.ref;
191
- type = {
192
- $$typeof: REACT_ELEMENT_TYPE,
193
- type,
194
- key,
195
- props,
196
- _owner: owner
197
- };
198
- null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
199
- enumerable: false,
200
- get: elementRefGetterWithDeprecationWarning
201
- }) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
202
- type._store = {};
203
- Object.defineProperty(type._store, "validated", {
204
- configurable: false,
205
- enumerable: false,
206
- writable: true,
207
- value: 0
208
- });
209
- Object.defineProperty(type, "_debugInfo", {
210
- configurable: false,
211
- enumerable: false,
212
- writable: true,
213
- value: null
214
- });
215
- Object.defineProperty(type, "_debugStack", {
216
- configurable: false,
217
- enumerable: false,
218
- writable: true,
219
- value: debugStack
220
- });
221
- Object.defineProperty(type, "_debugTask", {
222
- configurable: false,
223
- enumerable: false,
224
- writable: true,
225
- value: debugTask
226
- });
227
- Object.freeze && (Object.freeze(type.props), Object.freeze(type));
228
- return type;
229
- }
230
- function cloneAndReplaceKey(oldElement, newKey) {
231
- newKey = ReactElement(
232
- oldElement.type,
233
- newKey,
234
- oldElement.props,
235
- oldElement._owner,
236
- oldElement._debugStack,
237
- oldElement._debugTask
238
- );
239
- oldElement._store && (newKey._store.validated = oldElement._store.validated);
240
- return newKey;
241
- }
242
- function validateChildKeys(node) {
243
- isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
244
- }
245
- function isValidElement(object) {
246
- return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
247
- }
248
- function escape(key) {
249
- var escaperLookup = { "=": "=0", ":": "=2" };
250
- return "$" + key.replace(/[=:]/g, function(match) {
251
- return escaperLookup[match];
252
- });
253
- }
254
- function getElementKey(element, index) {
255
- return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
256
- }
257
- function resolveThenable(thenable) {
258
- switch (thenable.status) {
259
- case "fulfilled":
260
- return thenable.value;
261
- case "rejected":
262
- throw thenable.reason;
263
- default:
264
- switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
265
- function(fulfilledValue) {
266
- "pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
267
- },
268
- function(error) {
269
- "pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
270
- }
271
- )), thenable.status) {
272
- case "fulfilled":
273
- return thenable.value;
274
- case "rejected":
275
- throw thenable.reason;
276
- }
277
- }
278
- throw thenable;
279
- }
280
- function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
281
- var type = typeof children;
282
- if ("undefined" === type || "boolean" === type) children = null;
283
- var invokeCallback = false;
284
- if (null === children) invokeCallback = true;
285
- else
286
- switch (type) {
287
- case "bigint":
288
- case "string":
289
- case "number":
290
- invokeCallback = true;
291
- break;
292
- case "object":
293
- switch (children.$$typeof) {
294
- case REACT_ELEMENT_TYPE:
295
- case REACT_PORTAL_TYPE:
296
- invokeCallback = true;
297
- break;
298
- case REACT_LAZY_TYPE:
299
- return invokeCallback = children._init, mapIntoArray(
300
- invokeCallback(children._payload),
301
- array,
302
- escapedPrefix,
303
- nameSoFar,
304
- callback
305
- );
306
- }
307
- }
308
- if (invokeCallback) {
309
- invokeCallback = children;
310
- callback = callback(invokeCallback);
311
- var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
312
- isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
313
- return c;
314
- })) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(
315
- callback,
316
- escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(
317
- userProvidedKeyEscapeRegex,
318
- "$&/"
319
- ) + "/") + childKey
320
- ), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
321
- return 1;
322
- }
323
- invokeCallback = 0;
324
- childKey = "" === nameSoFar ? "." : nameSoFar + ":";
325
- if (isArrayImpl(children))
326
- for (var i = 0; i < children.length; i++)
327
- nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
328
- nameSoFar,
329
- array,
330
- escapedPrefix,
331
- type,
332
- callback
333
- );
334
- else if (i = getIteratorFn(children), "function" === typeof i)
335
- for (i === children.entries && (didWarnAboutMaps || console.warn(
336
- "Using Maps as children is not supported. Use an array of keyed ReactElements instead."
337
- ), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
338
- nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
339
- nameSoFar,
340
- array,
341
- escapedPrefix,
342
- type,
343
- callback
344
- );
345
- else if ("object" === type) {
346
- if ("function" === typeof children.then)
347
- return mapIntoArray(
348
- resolveThenable(children),
349
- array,
350
- escapedPrefix,
351
- nameSoFar,
352
- callback
353
- );
354
- array = String(children);
355
- throw Error(
356
- "Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
357
- );
358
- }
359
- return invokeCallback;
360
- }
361
- function mapChildren(children, func, context) {
362
- if (null == children) return children;
363
- var result = [], count = 0;
364
- mapIntoArray(children, result, "", "", function(child) {
365
- return func.call(context, child, count++);
366
- });
367
- return result;
368
- }
369
- function lazyInitializer(payload) {
370
- if (-1 === payload._status) {
371
- var ioInfo = payload._ioInfo;
372
- null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());
373
- ioInfo = payload._result;
374
- var thenable = ioInfo();
375
- thenable.then(
376
- function(moduleObject) {
377
- if (0 === payload._status || -1 === payload._status) {
378
- payload._status = 1;
379
- payload._result = moduleObject;
380
- var _ioInfo = payload._ioInfo;
381
- null != _ioInfo && (_ioInfo.end = performance.now());
382
- void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
383
- }
384
- },
385
- function(error) {
386
- if (0 === payload._status || -1 === payload._status) {
387
- payload._status = 2;
388
- payload._result = error;
389
- var _ioInfo2 = payload._ioInfo;
390
- null != _ioInfo2 && (_ioInfo2.end = performance.now());
391
- void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
392
- }
393
- }
394
- );
395
- ioInfo = payload._ioInfo;
396
- if (null != ioInfo) {
397
- ioInfo.value = thenable;
398
- var displayName = thenable.displayName;
399
- "string" === typeof displayName && (ioInfo.name = displayName);
400
- }
401
- -1 === payload._status && (payload._status = 0, payload._result = thenable);
402
- }
403
- if (1 === payload._status)
404
- return ioInfo = payload._result, void 0 === ioInfo && console.error(
405
- "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",
406
- ioInfo
407
- ), "default" in ioInfo || console.error(
408
- "lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
409
- ioInfo
410
- ), ioInfo.default;
411
- throw payload._result;
412
- }
413
- function resolveDispatcher() {
414
- var dispatcher = ReactSharedInternals.H;
415
- null === dispatcher && console.error(
416
- "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
417
- );
418
- return dispatcher;
419
- }
420
- function releaseAsyncTransition() {
421
- ReactSharedInternals.asyncTransitions--;
422
- }
423
- function enqueueTask(task) {
424
- if (null === enqueueTaskImpl)
425
- try {
426
- var requireString = ("require" + Math.random()).slice(0, 7);
427
- enqueueTaskImpl = (module && module[requireString]).call(
428
- module,
429
- "timers"
430
- ).setImmediate;
431
- } catch (_err) {
432
- enqueueTaskImpl = function(callback) {
433
- false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error(
434
- "This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."
435
- ));
436
- var channel = new MessageChannel();
437
- channel.port1.onmessage = callback;
438
- channel.port2.postMessage(void 0);
439
- };
440
- }
441
- return enqueueTaskImpl(task);
442
- }
443
- function aggregateErrors(errors) {
444
- return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
445
- }
446
- function popActScope(prevActQueue, prevActScopeDepth) {
447
- prevActScopeDepth !== actScopeDepth - 1 && console.error(
448
- "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
449
- );
450
- actScopeDepth = prevActScopeDepth;
451
- }
452
- function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
453
- var queue = ReactSharedInternals.actQueue;
454
- if (null !== queue)
455
- if (0 !== queue.length)
456
- try {
457
- flushActQueue(queue);
458
- enqueueTask(function() {
459
- return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
460
- });
461
- return;
462
- } catch (error) {
463
- ReactSharedInternals.thrownErrors.push(error);
464
- }
465
- else ReactSharedInternals.actQueue = null;
466
- 0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
467
- }
468
- function flushActQueue(queue) {
469
- if (!isFlushing) {
470
- isFlushing = true;
471
- var i = 0;
472
- try {
473
- for (; i < queue.length; i++) {
474
- var callback = queue[i];
475
- do {
476
- ReactSharedInternals.didUsePromise = false;
477
- var continuation = callback(false);
478
- if (null !== continuation) {
479
- if (ReactSharedInternals.didUsePromise) {
480
- queue[i] = callback;
481
- queue.splice(0, i);
482
- return;
483
- }
484
- callback = continuation;
485
- } else break;
486
- } while (1);
487
- }
488
- queue.length = 0;
489
- } catch (error) {
490
- queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
491
- } finally {
492
- isFlushing = false;
493
- }
494
- }
495
- }
496
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
497
- var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
498
- isMounted: function() {
499
- return false;
500
- },
501
- enqueueForceUpdate: function(publicInstance) {
502
- warnNoop(publicInstance, "forceUpdate");
503
- },
504
- enqueueReplaceState: function(publicInstance) {
505
- warnNoop(publicInstance, "replaceState");
506
- },
507
- enqueueSetState: function(publicInstance) {
508
- warnNoop(publicInstance, "setState");
509
- }
510
- }, assign = Object.assign, emptyObject = {};
511
- Object.freeze(emptyObject);
512
- Component.prototype.isReactComponent = {};
513
- Component.prototype.setState = function(partialState, callback) {
514
- if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
515
- throw Error(
516
- "takes an object of state variables to update or a function which returns an object of state variables."
517
- );
518
- this.updater.enqueueSetState(this, partialState, callback, "setState");
519
- };
520
- Component.prototype.forceUpdate = function(callback) {
521
- this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
522
- };
523
- var deprecatedAPIs = {
524
- isMounted: [
525
- "isMounted",
526
- "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
527
- ],
528
- replaceState: [
529
- "replaceState",
530
- "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
531
- ]
532
- };
533
- for (fnName in deprecatedAPIs)
534
- deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
535
- ComponentDummy.prototype = Component.prototype;
536
- deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
537
- deprecatedAPIs.constructor = PureComponent;
538
- assign(deprecatedAPIs, Component.prototype);
539
- deprecatedAPIs.isPureReactComponent = true;
540
- var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = {
541
- H: null,
542
- A: null,
543
- T: null,
544
- S: null,
545
- actQueue: null,
546
- asyncTransitions: 0,
547
- isBatchingLegacy: false,
548
- didScheduleLegacyUpdate: false,
549
- didUsePromise: false,
550
- thrownErrors: [],
551
- getCurrentStack: null,
552
- recentlyCreatedOwnerStacks: 0
553
- }, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
554
- return null;
555
- };
556
- deprecatedAPIs = {
557
- react_stack_bottom_frame: function(callStackForError) {
558
- return callStackForError();
559
- }
560
- };
561
- var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
562
- var didWarnAboutElementRef = {};
563
- var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(
564
- deprecatedAPIs,
565
- UnknownOwner
566
- )();
567
- var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
568
- var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
569
- if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
570
- var event = new window.ErrorEvent("error", {
571
- bubbles: true,
572
- cancelable: true,
573
- message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
574
- error
575
- });
576
- if (!window.dispatchEvent(event)) return;
577
- } else if ("object" === typeof process && "function" === typeof process.emit) {
578
- process.emit("uncaughtException", error);
579
- return;
580
- }
581
- console.error(error);
582
- }, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
583
- queueMicrotask(function() {
584
- return queueMicrotask(callback);
585
- });
586
- } : enqueueTask;
587
- deprecatedAPIs = Object.freeze({
588
- __proto__: null,
589
- c: function(size) {
590
- return resolveDispatcher().useMemoCache(size);
591
- }
592
- });
593
- var fnName = {
594
- map: mapChildren,
595
- forEach: function(children, forEachFunc, forEachContext) {
596
- mapChildren(
597
- children,
598
- function() {
599
- forEachFunc.apply(this, arguments);
600
- },
601
- forEachContext
602
- );
603
- },
604
- count: function(children) {
605
- var n = 0;
606
- mapChildren(children, function() {
607
- n++;
608
- });
609
- return n;
610
- },
611
- toArray: function(children) {
612
- return mapChildren(children, function(child) {
613
- return child;
614
- }) || [];
615
- },
616
- only: function(children) {
617
- if (!isValidElement(children))
618
- throw Error(
619
- "React.Children.only expected to receive a single React element child."
620
- );
621
- return children;
622
- }
623
- };
624
- exports.Activity = REACT_ACTIVITY_TYPE;
625
- exports.Children = fnName;
626
- exports.Component = Component;
627
- exports.Fragment = REACT_FRAGMENT_TYPE;
628
- exports.Profiler = REACT_PROFILER_TYPE;
629
- exports.PureComponent = PureComponent;
630
- exports.StrictMode = REACT_STRICT_MODE_TYPE;
631
- exports.Suspense = REACT_SUSPENSE_TYPE;
632
- exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
633
- exports.__COMPILER_RUNTIME = deprecatedAPIs;
634
- exports.act = function(callback) {
635
- var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
636
- actScopeDepth++;
637
- var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
638
- try {
639
- var result = callback();
640
- } catch (error) {
641
- ReactSharedInternals.thrownErrors.push(error);
642
- }
643
- if (0 < ReactSharedInternals.thrownErrors.length)
644
- throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
645
- if (null !== result && "object" === typeof result && "function" === typeof result.then) {
646
- var thenable = result;
647
- queueSeveralMicrotasks(function() {
648
- didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
649
- "You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"
650
- ));
651
- });
652
- return {
653
- then: function(resolve, reject) {
654
- didAwaitActCall = true;
655
- thenable.then(
656
- function(returnValue) {
657
- popActScope(prevActQueue, prevActScopeDepth);
658
- if (0 === prevActScopeDepth) {
659
- try {
660
- flushActQueue(queue), enqueueTask(function() {
661
- return recursivelyFlushAsyncActWork(
662
- returnValue,
663
- resolve,
664
- reject
665
- );
666
- });
667
- } catch (error$0) {
668
- ReactSharedInternals.thrownErrors.push(error$0);
669
- }
670
- if (0 < ReactSharedInternals.thrownErrors.length) {
671
- var _thrownError = aggregateErrors(
672
- ReactSharedInternals.thrownErrors
673
- );
674
- ReactSharedInternals.thrownErrors.length = 0;
675
- reject(_thrownError);
676
- }
677
- } else resolve(returnValue);
678
- },
679
- function(error) {
680
- popActScope(prevActQueue, prevActScopeDepth);
681
- 0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
682
- ReactSharedInternals.thrownErrors
683
- ), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
684
- }
685
- );
686
- }
687
- };
688
- }
689
- var returnValue$jscomp$0 = result;
690
- popActScope(prevActQueue, prevActScopeDepth);
691
- 0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
692
- didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
693
- "A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
694
- ));
695
- }), ReactSharedInternals.actQueue = null);
696
- if (0 < ReactSharedInternals.thrownErrors.length)
697
- throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
698
- return {
699
- then: function(resolve, reject) {
700
- didAwaitActCall = true;
701
- 0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
702
- return recursivelyFlushAsyncActWork(
703
- returnValue$jscomp$0,
704
- resolve,
705
- reject
706
- );
707
- })) : resolve(returnValue$jscomp$0);
708
- }
709
- };
710
- };
711
- exports.cache = function(fn) {
712
- return function() {
713
- return fn.apply(null, arguments);
714
- };
715
- };
716
- exports.cacheSignal = function() {
717
- return null;
718
- };
719
- exports.captureOwnerStack = function() {
720
- var getCurrentStack = ReactSharedInternals.getCurrentStack;
721
- return null === getCurrentStack ? null : getCurrentStack();
722
- };
723
- exports.cloneElement = function(element, config, children) {
724
- if (null === element || void 0 === element)
725
- throw Error(
726
- "The argument must be a React element, but you passed " + element + "."
727
- );
728
- var props = assign({}, element.props), key = element.key, owner = element._owner;
729
- if (null != config) {
730
- var JSCompiler_inline_result;
731
- a: {
732
- if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
733
- config,
734
- "ref"
735
- ).get) && JSCompiler_inline_result.isReactWarning) {
736
- JSCompiler_inline_result = false;
737
- break a;
738
- }
739
- JSCompiler_inline_result = void 0 !== config.ref;
740
- }
741
- JSCompiler_inline_result && (owner = getOwner());
742
- hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
743
- for (propName in config)
744
- !hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
745
- }
746
- var propName = arguments.length - 2;
747
- if (1 === propName) props.children = children;
748
- else if (1 < propName) {
749
- JSCompiler_inline_result = Array(propName);
750
- for (var i = 0; i < propName; i++)
751
- JSCompiler_inline_result[i] = arguments[i + 2];
752
- props.children = JSCompiler_inline_result;
753
- }
754
- props = ReactElement(
755
- element.type,
756
- key,
757
- props,
758
- owner,
759
- element._debugStack,
760
- element._debugTask
761
- );
762
- for (key = 2; key < arguments.length; key++)
763
- validateChildKeys(arguments[key]);
764
- return props;
765
- };
766
- exports.createContext = function(defaultValue) {
767
- defaultValue = {
768
- $$typeof: REACT_CONTEXT_TYPE,
769
- _currentValue: defaultValue,
770
- _currentValue2: defaultValue,
771
- _threadCount: 0,
772
- Provider: null,
773
- Consumer: null
774
- };
775
- defaultValue.Provider = defaultValue;
776
- defaultValue.Consumer = {
777
- $$typeof: REACT_CONSUMER_TYPE,
778
- _context: defaultValue
779
- };
780
- defaultValue._currentRenderer = null;
781
- defaultValue._currentRenderer2 = null;
782
- return defaultValue;
783
- };
784
- exports.createElement = function(type, config, children) {
785
- for (var i = 2; i < arguments.length; i++)
786
- validateChildKeys(arguments[i]);
787
- i = {};
788
- var key = null;
789
- if (null != config)
790
- for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn(
791
- "Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
792
- )), hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key), config)
793
- hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
794
- var childrenLength = arguments.length - 2;
795
- if (1 === childrenLength) i.children = children;
796
- else if (1 < childrenLength) {
797
- for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
798
- childArray[_i] = arguments[_i + 2];
799
- Object.freeze && Object.freeze(childArray);
800
- i.children = childArray;
801
- }
802
- if (type && type.defaultProps)
803
- for (propName in childrenLength = type.defaultProps, childrenLength)
804
- void 0 === i[propName] && (i[propName] = childrenLength[propName]);
805
- key && defineKeyPropWarningGetter(
806
- i,
807
- "function" === typeof type ? type.displayName || type.name || "Unknown" : type
808
- );
809
- var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
810
- return ReactElement(
811
- type,
812
- key,
813
- i,
814
- getOwner(),
815
- propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
816
- propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
817
- );
818
- };
819
- exports.createRef = function() {
820
- var refObject = { current: null };
821
- Object.seal(refObject);
822
- return refObject;
823
- };
824
- exports.forwardRef = function(render) {
825
- null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
826
- "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
827
- ) : "function" !== typeof render ? console.error(
828
- "forwardRef requires a render function but was given %s.",
829
- null === render ? "null" : typeof render
830
- ) : 0 !== render.length && 2 !== render.length && console.error(
831
- "forwardRef render functions accept exactly two parameters: props and ref. %s",
832
- 1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
833
- );
834
- null != render && null != render.defaultProps && console.error(
835
- "forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
836
- );
837
- var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
838
- Object.defineProperty(elementType, "displayName", {
839
- enumerable: false,
840
- configurable: true,
841
- get: function() {
842
- return ownName;
843
- },
844
- set: function(name) {
845
- ownName = name;
846
- render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
847
- }
848
- });
849
- return elementType;
850
- };
851
- exports.isValidElement = isValidElement;
852
- exports.lazy = function(ctor) {
853
- ctor = { _status: -1, _result: ctor };
854
- var lazyType = {
855
- $$typeof: REACT_LAZY_TYPE,
856
- _payload: ctor,
857
- _init: lazyInitializer
858
- }, ioInfo = {
859
- name: "lazy",
860
- start: -1,
861
- end: -1,
862
- value: null,
863
- owner: null,
864
- debugStack: Error("react-stack-top-frame"),
865
- debugTask: console.createTask ? console.createTask("lazy()") : null
866
- };
867
- ctor._ioInfo = ioInfo;
868
- lazyType._debugInfo = [{ awaited: ioInfo }];
869
- return lazyType;
870
- };
871
- exports.memo = function(type, compare) {
872
- null == type && console.error(
873
- "memo: The first argument must be a component. Instead received: %s",
874
- null === type ? "null" : typeof type
875
- );
876
- compare = {
877
- $$typeof: REACT_MEMO_TYPE,
878
- type,
879
- compare: void 0 === compare ? null : compare
880
- };
881
- var ownName;
882
- Object.defineProperty(compare, "displayName", {
883
- enumerable: false,
884
- configurable: true,
885
- get: function() {
886
- return ownName;
887
- },
888
- set: function(name) {
889
- ownName = name;
890
- type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
891
- }
892
- });
893
- return compare;
894
- };
895
- exports.startTransition = function(scope) {
896
- var prevTransition = ReactSharedInternals.T, currentTransition = {};
897
- currentTransition._updatedFibers = /* @__PURE__ */ new Set();
898
- ReactSharedInternals.T = currentTransition;
899
- try {
900
- var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
901
- null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
902
- "object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop, reportGlobalError));
903
- } catch (error) {
904
- reportGlobalError(error);
905
- } finally {
906
- null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
907
- "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
908
- )), null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error(
909
- "We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
910
- ), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
911
- }
912
- };
913
- exports.unstable_useCacheRefresh = function() {
914
- return resolveDispatcher().useCacheRefresh();
915
- };
916
- exports.use = function(usable) {
917
- return resolveDispatcher().use(usable);
918
- };
919
- exports.useActionState = function(action, initialState, permalink) {
920
- return resolveDispatcher().useActionState(
921
- action,
922
- initialState,
923
- permalink
924
- );
925
- };
926
- exports.useCallback = function(callback, deps) {
927
- return resolveDispatcher().useCallback(callback, deps);
928
- };
929
- exports.useContext = function(Context) {
930
- var dispatcher = resolveDispatcher();
931
- Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
932
- "Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
933
- );
934
- return dispatcher.useContext(Context);
935
- };
936
- exports.useDebugValue = function(value, formatterFn) {
937
- return resolveDispatcher().useDebugValue(value, formatterFn);
938
- };
939
- exports.useDeferredValue = function(value, initialValue) {
940
- return resolveDispatcher().useDeferredValue(value, initialValue);
941
- };
942
- exports.useEffect = function(create, deps) {
943
- null == create && console.warn(
944
- "React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
945
- );
946
- return resolveDispatcher().useEffect(create, deps);
947
- };
948
- exports.useEffectEvent = function(callback) {
949
- return resolveDispatcher().useEffectEvent(callback);
950
- };
951
- exports.useId = function() {
952
- return resolveDispatcher().useId();
953
- };
954
- exports.useImperativeHandle = function(ref, create, deps) {
955
- return resolveDispatcher().useImperativeHandle(ref, create, deps);
956
- };
957
- exports.useInsertionEffect = function(create, deps) {
958
- null == create && console.warn(
959
- "React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
960
- );
961
- return resolveDispatcher().useInsertionEffect(create, deps);
962
- };
963
- exports.useLayoutEffect = function(create, deps) {
964
- null == create && console.warn(
965
- "React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
966
- );
967
- return resolveDispatcher().useLayoutEffect(create, deps);
968
- };
969
- exports.useMemo = function(create, deps) {
970
- return resolveDispatcher().useMemo(create, deps);
971
- };
972
- exports.useOptimistic = function(passthrough, reducer) {
973
- return resolveDispatcher().useOptimistic(passthrough, reducer);
974
- };
975
- exports.useReducer = function(reducer, initialArg, init) {
976
- return resolveDispatcher().useReducer(reducer, initialArg, init);
977
- };
978
- exports.useRef = function(initialValue) {
979
- return resolveDispatcher().useRef(initialValue);
980
- };
981
- exports.useState = function(initialState) {
982
- return resolveDispatcher().useState(initialState);
983
- };
984
- exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
985
- return resolveDispatcher().useSyncExternalStore(
986
- subscribe,
987
- getSnapshot,
988
- getServerSnapshot
989
- );
990
- };
991
- exports.useTransition = function() {
992
- return resolveDispatcher().useTransition();
993
- };
994
- exports.version = "19.2.0";
995
- "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
996
- })();
997
- }
998
- });
999
-
1000
- // node_modules/react/index.js
1001
- var require_react = __commonJS({
1002
- "node_modules/react/index.js"(exports, module) {
1003
- "use strict";
1004
- if (false) {
1005
- module.exports = null;
1006
- } else {
1007
- module.exports = require_react_development();
1008
- }
1009
- }
1010
- });
1011
-
1012
- // src/provider.js
1013
- var import_react = __toESM(require_react(), 1);
1014
-
1015
- // src/securityUtils.js
1016
- function isSecureContext() {
1017
- if (typeof window === "undefined") return true;
1018
- const isLocalhost = window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname === "[::1]";
1019
- const isHttps = window.location.protocol === "https:";
1020
- return isHttps || isLocalhost;
1021
- }
1022
- function checkSecureContext() {
1023
- if (!isSecureContext()) {
1024
- console.warn(
1025
- "flowlink-auth: HTTPS is required for production. Your connection is not secure. Authentication may fail."
1026
- );
1027
- }
1028
- }
1029
- function getSafeErrorMessage(error) {
1030
- if (typeof error === "string") {
1031
- if (error.includes("password") || error.includes("token") || error.includes("secret")) {
1032
- return "An error occurred. Please try again.";
1033
- }
1034
- return error;
1035
- }
1036
- if (error?.message) {
1037
- return getSafeErrorMessage(error.message);
1038
- }
1039
- return "An error occurred. Please try again.";
1040
- }
1041
-
1042
- // src/provider.js
1043
- var AuthContext = (0, import_react.createContext)(null);
1044
- var FlowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) => {
1045
- const [ready, setReady] = (0, import_react.useState)(false);
1046
- const [error, setError] = (0, import_react.useState)(null);
1047
- const [user, setUser] = (0, import_react.useState)(null);
1048
- const [loadingUser, setLoadingUser] = (0, import_react.useState)(true);
1049
- const [sessionTimeout, setSessionTimeout] = (0, import_react.useState)(null);
1050
- const redirectedRef = (0, import_react.useRef)(false);
1051
- const sessionTimerRef = (0, import_react.useRef)(null);
1052
- (0, import_react.useEffect)(() => {
2
+ import React, { createContext, useContext, useEffect, useState, useCallback, useRef } from "react";
3
+ import { checkSecureContext, validateEmail, getSafeErrorMessage } from "./securityUtils.js";
4
+ const AuthContext = createContext(null);
5
+ const FlowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) => {
6
+ const [ready, setReady] = useState(false);
7
+ const [error, setError] = useState(null);
8
+ const [user, setUser] = useState(null);
9
+ const [loadingUser, setLoadingUser] = useState(true);
10
+ const [sessionTimeout, setSessionTimeout] = useState(null);
11
+ const redirectedRef = useRef(false);
12
+ const sessionTimerRef = useRef(null);
13
+ useEffect(() => {
1053
14
  checkSecureContext();
1054
15
  }, []);
1055
- (0, import_react.useEffect)(() => {
16
+ useEffect(() => {
1056
17
  if (!publishableKey || !publishableKey.trim()) {
1057
18
  setError("Missing publishable key");
1058
19
  setReady(false);
@@ -1069,7 +30,7 @@ var FlowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) =>
1069
30
  setError(null);
1070
31
  setReady(true);
1071
32
  }, [publishableKey, baseUrl]);
1072
- const normalizedBase = (0, import_react.useCallback)(() => {
33
+ const normalizedBase = useCallback(() => {
1073
34
  return baseUrl?.replace(/\/+$/, "") || "";
1074
35
  }, [baseUrl]);
1075
36
  const redirectTo = (url, { replace = true } = {}) => {
@@ -1086,7 +47,7 @@ var FlowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) =>
1086
47
  window.location.href = url;
1087
48
  }
1088
49
  };
1089
- const resetSessionTimeout = (0, import_react.useCallback)(() => {
50
+ const resetSessionTimeout = useCallback(() => {
1090
51
  if (sessionTimerRef.current) {
1091
52
  clearTimeout(sessionTimerRef.current);
1092
53
  }
@@ -1095,7 +56,7 @@ var FlowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) =>
1095
56
  logout();
1096
57
  }, 24 * 60 * 60 * 1e3);
1097
58
  }, []);
1098
- const fetchMe = (0, import_react.useCallback)(async () => {
59
+ const fetchMe = useCallback(async () => {
1099
60
  setLoadingUser(true);
1100
61
  try {
1101
62
  const base = normalizedBase();
@@ -1131,7 +92,7 @@ var FlowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) =>
1131
92
  return null;
1132
93
  }
1133
94
  }, [normalizedBase, resetSessionTimeout]);
1134
- (0, import_react.useEffect)(() => {
95
+ useEffect(() => {
1135
96
  if (!ready) return;
1136
97
  fetchMe();
1137
98
  const onStorage = (e) => {
@@ -1149,7 +110,7 @@ var FlowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) =>
1149
110
  }
1150
111
  };
1151
112
  }, [ready, fetchMe]);
1152
- (0, import_react.useEffect)(() => {
113
+ useEffect(() => {
1153
114
  if (!ready) return;
1154
115
  if (loadingUser) return;
1155
116
  if (!user) {
@@ -1161,7 +122,7 @@ var FlowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) =>
1161
122
  redirectTo(redirect, { replace: true });
1162
123
  }
1163
124
  }, [ready, loadingUser, user, redirect]);
1164
- const completeLogin = (0, import_react.useCallback)(async (opts = {}) => {
125
+ const completeLogin = useCallback(async (opts = {}) => {
1165
126
  const { redirectTo: redirectUrl, replace = true } = opts;
1166
127
  const u = await fetchMe();
1167
128
  try {
@@ -1174,7 +135,7 @@ var FlowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) =>
1174
135
  }
1175
136
  return u;
1176
137
  }, [fetchMe, redirect]);
1177
- const logout = (0, import_react.useCallback)(async (opts = {}) => {
138
+ const logout = useCallback(async (opts = {}) => {
1178
139
  const { callServer = true, redirectTo: redirectUrl, replace = true } = opts;
1179
140
  const base = normalizedBase();
1180
141
  if (callServer && base) {
@@ -1206,10 +167,10 @@ var FlowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) =>
1206
167
  logout,
1207
168
  completeLogin
1208
169
  };
1209
- return /* @__PURE__ */ import_react.default.createElement(AuthContext.Provider, { value }, error ? /* @__PURE__ */ import_react.default.createElement("div", { style: { padding: "20px", background: "#220000", color: "white" } }, /* @__PURE__ */ import_react.default.createElement("h2", null, "flowlink Auth Error"), /* @__PURE__ */ import_react.default.createElement("p", null, error)) : !ready ? null : children);
170
+ return /* @__PURE__ */ React.createElement(AuthContext.Provider, { value }, error ? /* @__PURE__ */ React.createElement("div", { style: { padding: "20px", background: "#220000", color: "white" } }, /* @__PURE__ */ React.createElement("h2", null, "flowlink Auth Error"), /* @__PURE__ */ React.createElement("p", null, error)) : !ready ? null : children);
1210
171
  };
1211
- var useAuth = () => {
1212
- const ctx = (0, import_react.useContext)(AuthContext);
172
+ const useAuth = () => {
173
+ const ctx = useContext(AuthContext);
1213
174
  if (!ctx) throw new Error("useAuth must be used within FlowlinkAuthProvider");
1214
175
  return ctx;
1215
176
  };
@@ -1218,16 +179,3 @@ export {
1218
179
  provider_default as default,
1219
180
  useAuth
1220
181
  };
1221
- /*! Bundled license information:
1222
-
1223
- react/cjs/react.development.js:
1224
- (**
1225
- * @license React
1226
- * react.development.js
1227
- *
1228
- * Copyright (c) Meta Platforms, Inc. and affiliates.
1229
- *
1230
- * This source code is licensed under the MIT license found in the
1231
- * LICENSE file in the root directory of this source tree.
1232
- *)
1233
- */