flowlink-auth 2.6.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/SignUp.js ADDED
@@ -0,0 +1,1246 @@
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/SignUp.jsx
1013
+ var import_react2 = __toESM(require_react(), 1);
1014
+
1015
+ // src/provider.js
1016
+ var import_react = __toESM(require_react(), 1);
1017
+ var AuthContext = (0, import_react.createContext)(null);
1018
+ var useAuth = () => {
1019
+ const ctx = (0, import_react.useContext)(AuthContext);
1020
+ if (!ctx) throw new Error("useAuth must be used within flowlinkAuthProvider");
1021
+ return ctx;
1022
+ };
1023
+
1024
+ // src/SignUp.jsx
1025
+ function SignUp() {
1026
+ const {
1027
+ publishableKey,
1028
+ baseUrl,
1029
+ redirect,
1030
+ redirectTo,
1031
+ user,
1032
+ loadingUser,
1033
+ fetchMe,
1034
+ setUser
1035
+ } = useAuth();
1036
+ const [name, setName] = (0, import_react2.useState)("");
1037
+ const [email, setEmail] = (0, import_react2.useState)("");
1038
+ const [password, setPassword] = (0, import_react2.useState)("");
1039
+ const [loading, setLoading] = (0, import_react2.useState)(false);
1040
+ const [error, setError] = (0, import_react2.useState)(null);
1041
+ const [message, setMessage] = (0, import_react2.useState)(null);
1042
+ if (loadingUser) return null;
1043
+ if (user && redirect) {
1044
+ if (typeof redirectTo === "function") redirectTo(redirect);
1045
+ else if (typeof window !== "undefined") window.location.assign(redirect);
1046
+ return null;
1047
+ }
1048
+ async function submit(e) {
1049
+ e.preventDefault();
1050
+ setError(null);
1051
+ setMessage(null);
1052
+ setLoading(true);
1053
+ const url = `${(baseUrl || "").replace(/\/+$/, "")}/api/sdk/signup`;
1054
+ try {
1055
+ const res = await fetch(url, {
1056
+ method: "POST",
1057
+ credentials: "include",
1058
+ headers: {
1059
+ "Content-Type": "application/json",
1060
+ "x-publishable-key": publishableKey || ""
1061
+ },
1062
+ body: JSON.stringify({ name, email, password })
1063
+ });
1064
+ const data = await res.json().catch(() => ({}));
1065
+ if (!res.ok) throw new Error(data.error || "Signup failed");
1066
+ if (data.user && typeof setUser === "function") setUser(data.user);
1067
+ if (typeof fetchMe === "function") await fetchMe();
1068
+ setMessage("Account created. Redirecting\u2026");
1069
+ if (redirect) {
1070
+ setTimeout(() => {
1071
+ if (typeof redirectTo === "function") redirectTo(redirect);
1072
+ else if (typeof window !== "undefined") window.location.assign(redirect);
1073
+ }, 300);
1074
+ }
1075
+ } catch (err) {
1076
+ setError(err?.message ?? "Network error");
1077
+ console.error("Signup error:", err);
1078
+ } finally {
1079
+ setLoading(false);
1080
+ }
1081
+ }
1082
+ async function startOAuthFlow(provider) {
1083
+ setError(null);
1084
+ setLoading(true);
1085
+ try {
1086
+ const rid = typeof crypto !== "undefined" && typeof crypto.randomUUID === "function" ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
1087
+ const callbackUrl = encodeURIComponent(`${window.location.origin}/signup`);
1088
+ const sdkBase = typeof process !== "undefined" && process.env && process.env.NEXT_PUBLIC_SDK_BASE_URL || baseUrl || window.location.origin.replace(/\/+$/, "");
1089
+ const startUrl = `${sdkBase}/sdk/auth/start?rid=${rid}&source=${encodeURIComponent(provider)}&callbackUrl=${callbackUrl}`;
1090
+ if (!publishableKey) {
1091
+ throw new Error("Missing publishable key (client side). Set NEXT_PUBLIC_SDK_PUBLISHABLE_KEY or provide publishableKey in provider.");
1092
+ }
1093
+ const res = await fetch(startUrl, {
1094
+ method: "GET",
1095
+ headers: {
1096
+ "x-publishable-key": publishableKey
1097
+ }
1098
+ });
1099
+ const data = await res.json().catch(() => null);
1100
+ if (!res.ok) {
1101
+ throw new Error(data?.error || `OAuth start failed (${res.status})`);
1102
+ }
1103
+ if (!data?.oauthUrl) {
1104
+ throw new Error("SDK start did not return oauthUrl");
1105
+ }
1106
+ window.location.href = data.oauthUrl;
1107
+ } catch (err) {
1108
+ console.error("OAuth start error:", err);
1109
+ setError(err?.message || "OAuth start failed");
1110
+ setLoading(false);
1111
+ }
1112
+ }
1113
+ const handleGoogle = (e) => {
1114
+ if (e && typeof e.preventDefault === "function") e.preventDefault();
1115
+ startOAuthFlow("google");
1116
+ };
1117
+ const handleGithub = (e) => {
1118
+ if (e && typeof e.preventDefault === "function") e.preventDefault();
1119
+ startOAuthFlow("github");
1120
+ };
1121
+ return /* @__PURE__ */ import_react2.default.createElement("div", { style: overlay }, /* @__PURE__ */ import_react2.default.createElement("div", { style: modal }, /* @__PURE__ */ import_react2.default.createElement("h2", { style: title }, "Create account"), /* @__PURE__ */ import_react2.default.createElement("form", { onSubmit: submit }, /* @__PURE__ */ import_react2.default.createElement("label", { style: label }, "Full name"), /* @__PURE__ */ import_react2.default.createElement(
1122
+ "input",
1123
+ {
1124
+ name: "name",
1125
+ style: input,
1126
+ value: name,
1127
+ onChange: (e) => setName(e.target.value),
1128
+ autoComplete: "name"
1129
+ }
1130
+ ), /* @__PURE__ */ import_react2.default.createElement("label", { style: label }, "Email"), /* @__PURE__ */ import_react2.default.createElement(
1131
+ "input",
1132
+ {
1133
+ name: "email",
1134
+ type: "email",
1135
+ style: input,
1136
+ value: email,
1137
+ onChange: (e) => setEmail(e.target.value),
1138
+ required: true,
1139
+ autoComplete: "email"
1140
+ }
1141
+ ), /* @__PURE__ */ import_react2.default.createElement("label", { style: label }, "Password"), /* @__PURE__ */ import_react2.default.createElement(
1142
+ "input",
1143
+ {
1144
+ name: "password",
1145
+ type: "password",
1146
+ style: input,
1147
+ value: password,
1148
+ onChange: (e) => setPassword(e.target.value),
1149
+ required: true,
1150
+ autoComplete: "new-password"
1151
+ }
1152
+ ), /* @__PURE__ */ import_react2.default.createElement("div", { style: { marginTop: 12 } }, /* @__PURE__ */ import_react2.default.createElement("button", { style: button, type: "submit", disabled: loading }, loading ? "Creating..." : "Create account")), /* @__PURE__ */ import_react2.default.createElement("div", { style: { display: "flex", gap: 8, marginTop: 16 } }, /* @__PURE__ */ import_react2.default.createElement(
1153
+ "button",
1154
+ {
1155
+ type: "button",
1156
+ onClick: handleGoogle,
1157
+ style: oauthButtonGoogle
1158
+ },
1159
+ "Continue with Google"
1160
+ ), /* @__PURE__ */ import_react2.default.createElement(
1161
+ "button",
1162
+ {
1163
+ type: "button",
1164
+ onClick: handleGithub,
1165
+ style: oauthButtonGithub
1166
+ },
1167
+ "Continue with GitHub"
1168
+ )), error && /* @__PURE__ */ import_react2.default.createElement("div", { style: errorBox }, error), message && /* @__PURE__ */ import_react2.default.createElement("div", { style: successBox }, message))));
1169
+ }
1170
+ var overlay = {
1171
+ position: "fixed",
1172
+ inset: 0,
1173
+ background: "rgba(0,0,0,0.5)",
1174
+ display: "flex",
1175
+ justifyContent: "center",
1176
+ alignItems: "center",
1177
+ padding: 20,
1178
+ zIndex: 9999
1179
+ };
1180
+ var modal = {
1181
+ width: "100%",
1182
+ maxWidth: 420,
1183
+ background: "#0f1724",
1184
+ borderRadius: 12,
1185
+ padding: 24,
1186
+ color: "#fff"
1187
+ };
1188
+ var title = { margin: 0, fontSize: 20, fontWeight: 600 };
1189
+ var label = { marginTop: 10, display: "block", fontSize: 13 };
1190
+ var input = {
1191
+ width: "100%",
1192
+ padding: "10px 12px",
1193
+ borderRadius: 8,
1194
+ background: "#0b1220",
1195
+ color: "#fff",
1196
+ border: "1px solid #1e293b",
1197
+ marginTop: 6
1198
+ };
1199
+ var button = {
1200
+ marginTop: 15,
1201
+ width: "100%",
1202
+ padding: "10px 12px",
1203
+ borderRadius: 8,
1204
+ background: "#2563eb",
1205
+ border: "none",
1206
+ color: "#fff",
1207
+ fontWeight: 600,
1208
+ cursor: "pointer"
1209
+ };
1210
+ var oauthButtonGoogle = {
1211
+ flex: 1,
1212
+ padding: "10px 12px",
1213
+ borderRadius: 8,
1214
+ background: "#db4437",
1215
+ color: "#fff",
1216
+ border: "none",
1217
+ cursor: "pointer"
1218
+ };
1219
+ var oauthButtonGithub = {
1220
+ flex: 1,
1221
+ padding: "10px 12px",
1222
+ borderRadius: 8,
1223
+ background: "#24292f",
1224
+ color: "#fff",
1225
+ border: "none",
1226
+ cursor: "pointer"
1227
+ };
1228
+ var errorBox = { marginTop: 10, color: "#ffb4b4", fontSize: 13 };
1229
+ var successBox = { marginTop: 10, color: "#bef264", fontSize: 13 };
1230
+ export {
1231
+ SignUp as default
1232
+ };
1233
+ /*! Bundled license information:
1234
+
1235
+ react/cjs/react.development.js:
1236
+ (**
1237
+ * @license React
1238
+ * react.development.js
1239
+ *
1240
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
1241
+ *
1242
+ * This source code is licensed under the MIT license found in the
1243
+ * LICENSE file in the root directory of this source tree.
1244
+ *)
1245
+ */
1246
+