@tern-secure/nextjs 3.3.5 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/dist/cjs/app-router/client/TernSecureProvider.js +33 -0
  2. package/dist/cjs/app-router/client/TernSecureProvider.js.map +1 -0
  3. package/dist/cjs/app-router/client/actions.js +180 -0
  4. package/dist/cjs/app-router/client/actions.js.map +1 -0
  5. package/dist/cjs/app-router/route-handler/internal-route.js +45 -0
  6. package/dist/cjs/app-router/route-handler/internal-route.js.map +1 -0
  7. package/dist/cjs/app-router/server/auth.js +71 -0
  8. package/dist/cjs/app-router/server/auth.js.map +1 -0
  9. package/dist/cjs/app-router/server/index.js +42 -0
  10. package/dist/cjs/app-router/server/index.js.map +1 -0
  11. package/dist/cjs/app-router/server/sessionTernSecure.js +159 -0
  12. package/dist/cjs/app-router/server/sessionTernSecure.js.map +1 -0
  13. package/dist/cjs/app-router/server/ternSecureMiddleware.js +50 -0
  14. package/dist/cjs/app-router/server/ternSecureMiddleware.js.map +1 -0
  15. package/dist/cjs/boundary/TernSecureClientProvider.js +107 -0
  16. package/dist/cjs/boundary/TernSecureClientProvider.js.map +1 -0
  17. package/dist/cjs/boundary/TernSecureCtx.js +49 -0
  18. package/dist/cjs/boundary/TernSecureCtx.js.map +1 -0
  19. package/dist/cjs/boundary/hooks/useAuth.js +51 -0
  20. package/dist/cjs/boundary/hooks/useAuth.js.map +1 -0
  21. package/dist/cjs/boundary/hooks/useSignUp.js +40 -0
  22. package/dist/cjs/boundary/hooks/useSignUp.js.map +1 -0
  23. package/dist/cjs/boundary/hooks/useUser.js +44 -0
  24. package/dist/cjs/boundary/hooks/useUser.js.map +1 -0
  25. package/dist/cjs/components/background.js +65 -0
  26. package/dist/cjs/components/background.js.map +1 -0
  27. package/dist/cjs/components/sign-in.js +242 -0
  28. package/dist/cjs/components/sign-in.js.map +1 -0
  29. package/dist/cjs/components/sign-out.js +69 -0
  30. package/dist/cjs/components/sign-out.js.map +1 -0
  31. package/dist/cjs/components/sign-up.js +328 -0
  32. package/dist/cjs/components/sign-up.js.map +1 -0
  33. package/dist/cjs/components/ui/alert.js +88 -0
  34. package/dist/cjs/components/ui/alert.js.map +1 -0
  35. package/dist/cjs/components/ui/button.js +84 -0
  36. package/dist/cjs/components/ui/button.js.map +1 -0
  37. package/dist/cjs/components/ui/card.js +101 -0
  38. package/dist/cjs/components/ui/card.js.map +1 -0
  39. package/dist/cjs/components/ui/input.js +58 -0
  40. package/dist/cjs/components/ui/input.js.map +1 -0
  41. package/dist/cjs/components/ui/label.js +55 -0
  42. package/dist/cjs/components/ui/label.js.map +1 -0
  43. package/dist/cjs/components/ui/separator.js +59 -0
  44. package/dist/cjs/components/ui/separator.js.map +1 -0
  45. package/dist/cjs/components/verify.js +195 -0
  46. package/dist/cjs/components/verify.js.map +1 -0
  47. package/dist/cjs/errors.js +41 -0
  48. package/dist/cjs/errors.js.map +1 -0
  49. package/dist/cjs/index.js +59 -0
  50. package/dist/cjs/index.js.map +1 -0
  51. package/dist/cjs/lib/utils.d.js +17 -0
  52. package/dist/cjs/lib/utils.d.js.map +1 -0
  53. package/dist/cjs/lib/utils.js +33 -0
  54. package/dist/cjs/lib/utils.js.map +1 -0
  55. package/dist/cjs/types.js +17 -0
  56. package/dist/cjs/types.js.map +1 -0
  57. package/dist/cjs/utils/admin-init.js +57 -0
  58. package/dist/cjs/utils/admin-init.js.map +1 -0
  59. package/dist/cjs/utils/client-init.js +49 -0
  60. package/dist/cjs/utils/client-init.js.map +1 -0
  61. package/dist/cjs/utils/config.js +113 -0
  62. package/dist/cjs/utils/config.js.map +1 -0
  63. package/dist/cjs/utils/construct.js +63 -0
  64. package/dist/cjs/utils/construct.js.map +1 -0
  65. package/dist/cjs/utils/create-styles.js +149 -0
  66. package/dist/cjs/utils/create-styles.js.map +1 -0
  67. package/dist/esm/app-router/client/TernSecureProvider.js +9 -0
  68. package/dist/esm/app-router/client/TernSecureProvider.js.map +1 -0
  69. package/dist/esm/app-router/client/actions.js +151 -0
  70. package/dist/esm/app-router/client/actions.js.map +1 -0
  71. package/dist/esm/app-router/route-handler/internal-route.js +20 -0
  72. package/dist/esm/app-router/route-handler/internal-route.js.map +1 -0
  73. package/dist/esm/app-router/server/auth.js +47 -0
  74. package/dist/esm/app-router/server/auth.js.map +1 -0
  75. package/dist/esm/app-router/server/index.js +13 -0
  76. package/dist/esm/app-router/server/index.js.map +1 -0
  77. package/dist/esm/app-router/server/sessionTernSecure.js +129 -0
  78. package/dist/esm/app-router/server/sessionTernSecure.js.map +1 -0
  79. package/dist/esm/app-router/server/ternSecureMiddleware.js +26 -0
  80. package/dist/esm/app-router/server/ternSecureMiddleware.js.map +1 -0
  81. package/dist/esm/boundary/TernSecureClientProvider.js +83 -0
  82. package/dist/esm/boundary/TernSecureClientProvider.js.map +1 -0
  83. package/dist/esm/boundary/TernSecureCtx.js +23 -0
  84. package/dist/esm/boundary/TernSecureCtx.js.map +1 -0
  85. package/dist/esm/boundary/hooks/useAuth.js +27 -0
  86. package/dist/esm/boundary/hooks/useAuth.js.map +1 -0
  87. package/dist/esm/boundary/hooks/useSignUp.js +16 -0
  88. package/dist/esm/boundary/hooks/useSignUp.js.map +1 -0
  89. package/dist/esm/boundary/hooks/useUser.js +20 -0
  90. package/dist/esm/boundary/hooks/useUser.js.map +1 -0
  91. package/dist/esm/components/background.js +41 -0
  92. package/dist/esm/components/background.js.map +1 -0
  93. package/dist/esm/components/sign-in.js +218 -0
  94. package/dist/esm/components/sign-in.js.map +1 -0
  95. package/dist/esm/components/sign-out.js +45 -0
  96. package/dist/esm/components/sign-out.js.map +1 -0
  97. package/dist/esm/components/sign-up.js +294 -0
  98. package/dist/esm/components/sign-up.js.map +1 -0
  99. package/dist/esm/components/ui/alert.js +52 -0
  100. package/dist/esm/components/ui/alert.js.map +1 -0
  101. package/dist/esm/components/ui/button.js +49 -0
  102. package/dist/esm/components/ui/button.js.map +1 -0
  103. package/dist/esm/components/ui/card.js +62 -0
  104. package/dist/esm/components/ui/card.js.map +1 -0
  105. package/dist/esm/components/ui/input.js +24 -0
  106. package/dist/esm/components/ui/input.js.map +1 -0
  107. package/dist/esm/components/ui/label.js +21 -0
  108. package/dist/esm/components/ui/label.js.map +1 -0
  109. package/dist/esm/components/ui/separator.js +25 -0
  110. package/dist/esm/components/ui/separator.js.map +1 -0
  111. package/dist/esm/components/verify.js +161 -0
  112. package/dist/esm/components/verify.js.map +1 -0
  113. package/dist/esm/errors.js +16 -0
  114. package/dist/esm/errors.js.map +1 -0
  115. package/dist/esm/index.js +24 -0
  116. package/dist/esm/index.js.map +1 -0
  117. package/dist/esm/lib/utils.d.js +1 -0
  118. package/dist/esm/lib/utils.d.js.map +1 -0
  119. package/dist/esm/lib/utils.js +9 -0
  120. package/dist/esm/lib/utils.js.map +1 -0
  121. package/dist/esm/types.js +1 -0
  122. package/dist/esm/types.js.map +1 -0
  123. package/dist/esm/utils/admin-init.js +22 -0
  124. package/dist/esm/utils/admin-init.js.map +1 -0
  125. package/dist/esm/utils/client-init.js +22 -0
  126. package/dist/esm/utils/client-init.js.map +1 -0
  127. package/dist/esm/utils/config.js +84 -0
  128. package/dist/esm/utils/config.js.map +1 -0
  129. package/dist/esm/utils/construct.js +37 -0
  130. package/dist/esm/utils/construct.js.map +1 -0
  131. package/dist/esm/utils/create-styles.js +123 -0
  132. package/dist/esm/utils/create-styles.js.map +1 -0
  133. package/dist/types/app-router/client/TernSecureProvider.d.ts +26 -0
  134. package/dist/types/app-router/client/TernSecureProvider.d.ts.map +1 -0
  135. package/dist/types/app-router/client/actions.d.ts +49 -0
  136. package/dist/types/app-router/client/actions.d.ts.map +1 -0
  137. package/dist/types/app-router/route-handler/internal-route.d.ts +9 -0
  138. package/dist/types/app-router/route-handler/internal-route.d.ts.map +1 -0
  139. package/dist/types/app-router/server/auth.d.ts +7 -0
  140. package/dist/types/app-router/server/auth.d.ts.map +1 -0
  141. package/dist/types/app-router/server/index.d.ts +5 -0
  142. package/dist/types/app-router/server/index.d.ts.map +1 -0
  143. package/dist/types/app-router/server/sessionTernSecure.d.ts +37 -0
  144. package/dist/types/app-router/server/sessionTernSecure.d.ts.map +1 -0
  145. package/dist/types/app-router/server/ternSecureMiddleware.d.ts +7 -0
  146. package/dist/types/app-router/server/ternSecureMiddleware.d.ts.map +1 -0
  147. package/dist/types/boundary/TernSecureClientProvider.d.ts +11 -0
  148. package/dist/types/boundary/TernSecureClientProvider.d.ts.map +1 -0
  149. package/dist/types/boundary/TernSecureCtx.d.ts +17 -0
  150. package/dist/types/boundary/TernSecureCtx.d.ts.map +1 -0
  151. package/dist/types/boundary/hooks/useAuth.d.ts +11 -0
  152. package/dist/types/boundary/hooks/useAuth.d.ts.map +1 -0
  153. package/dist/types/boundary/hooks/useSignUp.d.ts +5 -0
  154. package/dist/types/boundary/hooks/useSignUp.d.ts.map +1 -0
  155. package/dist/types/boundary/hooks/useUser.d.ts +7 -0
  156. package/dist/types/boundary/hooks/useUser.d.ts.map +1 -0
  157. package/dist/types/components/background.d.ts +2 -0
  158. package/dist/types/components/background.d.ts.map +1 -0
  159. package/dist/types/components/sign-in.d.ts +18 -0
  160. package/dist/types/components/sign-in.d.ts.map +1 -0
  161. package/dist/types/components/sign-out.d.ts +10 -0
  162. package/dist/types/components/sign-out.d.ts.map +1 -0
  163. package/dist/types/components/sign-up.d.ts +7 -0
  164. package/dist/types/components/sign-up.d.ts.map +1 -0
  165. package/dist/types/components/ui/alert.d.ts +9 -0
  166. package/dist/types/components/ui/alert.d.ts.map +1 -0
  167. package/dist/types/components/ui/button.d.ts +12 -0
  168. package/dist/types/components/ui/button.d.ts.map +1 -0
  169. package/dist/types/components/ui/card.d.ts +9 -0
  170. package/dist/types/components/ui/card.d.ts.map +1 -0
  171. package/dist/types/components/ui/input.d.ts +4 -0
  172. package/dist/types/components/ui/input.d.ts.map +1 -0
  173. package/dist/types/components/ui/label.d.ts +6 -0
  174. package/dist/types/components/ui/label.d.ts.map +1 -0
  175. package/dist/types/components/ui/separator.d.ts +5 -0
  176. package/dist/types/components/ui/separator.d.ts.map +1 -0
  177. package/dist/types/components/verify.d.ts +2 -0
  178. package/dist/types/components/verify.d.ts.map +1 -0
  179. package/dist/types/errors.d.ts +9 -0
  180. package/dist/types/errors.d.ts.map +1 -0
  181. package/dist/types/index.d.ts +1 -0
  182. package/dist/types/index.d.ts.map +1 -0
  183. package/dist/types/lib/utils.d.ts +3 -0
  184. package/dist/types/lib/utils.d.ts.map +1 -0
  185. package/dist/types/types.d.ts +63 -0
  186. package/dist/types/types.d.ts.map +1 -0
  187. package/dist/types/utils/admin-init.d.ts +4 -0
  188. package/dist/types/utils/admin-init.d.ts.map +1 -0
  189. package/dist/types/utils/client-init.d.ts +5 -0
  190. package/dist/types/utils/client-init.d.ts.map +1 -0
  191. package/dist/types/utils/config.d.ts +35 -0
  192. package/dist/types/utils/config.d.ts.map +1 -0
  193. package/dist/types/utils/construct.d.ts +22 -0
  194. package/dist/types/utils/construct.d.ts.map +1 -0
  195. package/dist/types/utils/create-styles.d.ts +99 -0
  196. package/dist/types/utils/create-styles.d.ts.map +1 -0
  197. package/package.json +1 -1
@@ -0,0 +1,84 @@
1
+ "use strict";
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 __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var button_exports = {};
30
+ __export(button_exports, {
31
+ Button: () => Button,
32
+ buttonVariants: () => buttonVariants
33
+ });
34
+ module.exports = __toCommonJS(button_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var React = __toESM(require("react"));
37
+ var import_react_slot = require("@radix-ui/react-slot");
38
+ var import_class_variance_authority = require("class-variance-authority");
39
+ var import_utils = require("../../lib/utils");
40
+ const buttonVariants = (0, import_class_variance_authority.cva)(
41
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
42
+ {
43
+ variants: {
44
+ variant: {
45
+ default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
46
+ destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
47
+ outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
48
+ secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
49
+ ghost: "hover:bg-accent hover:text-accent-foreground",
50
+ link: "text-primary underline-offset-4 hover:underline"
51
+ },
52
+ size: {
53
+ default: "h-9 px-4 py-2",
54
+ sm: "h-8 rounded-md px-3 text-xs",
55
+ lg: "h-10 rounded-md px-8",
56
+ icon: "h-9 w-9"
57
+ }
58
+ },
59
+ defaultVariants: {
60
+ variant: "default",
61
+ size: "default"
62
+ }
63
+ }
64
+ );
65
+ const Button = React.forwardRef(
66
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
67
+ const Comp = asChild ? import_react_slot.Slot : "button";
68
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
69
+ Comp,
70
+ {
71
+ className: (0, import_utils.cn)(buttonVariants({ variant, size, className })),
72
+ ref,
73
+ ...props
74
+ }
75
+ );
76
+ }
77
+ );
78
+ Button.displayName = "Button";
79
+ // Annotate the CommonJS export names for ESM import in node:
80
+ 0 && (module.exports = {
81
+ Button,
82
+ buttonVariants
83
+ });
84
+ //# sourceMappingURL=button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/ui/button.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground shadow hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n lg: \"h-10 rounded-md px-8\",\n icon: \"h-9 w-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\"\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8CM;AA9CN,YAAuB;AACvB,wBAAqB;AACrB,sCAAuC;AAEvC,mBAAmB;AAEnB,MAAM,qBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAQA,MAAM,SAAS,MAAM;AAAA,EACnB,CAAC,EAAE,WAAW,SAAS,MAAM,UAAU,OAAO,GAAG,MAAM,GAAG,QAAQ;AAChE,UAAM,OAAO,UAAU,yBAAO;AAC9B,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAW,iBAAG,eAAe,EAAE,SAAS,MAAM,UAAU,CAAC,CAAC;AAAA,QAC1D;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,OAAO,cAAc;","names":[]}
@@ -0,0 +1,101 @@
1
+ "use strict";
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 __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var card_exports = {};
30
+ __export(card_exports, {
31
+ Card: () => Card,
32
+ CardContent: () => CardContent,
33
+ CardDescription: () => CardDescription,
34
+ CardFooter: () => CardFooter,
35
+ CardHeader: () => CardHeader,
36
+ CardTitle: () => CardTitle
37
+ });
38
+ module.exports = __toCommonJS(card_exports);
39
+ var import_jsx_runtime = require("react/jsx-runtime");
40
+ var React = __toESM(require("react"));
41
+ var import_utils = require("../../lib/utils");
42
+ const Card = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
43
+ "div",
44
+ {
45
+ ref,
46
+ className: (0, import_utils.cn)(
47
+ "rounded-xl border bg-card text-card-foreground shadow",
48
+ className
49
+ ),
50
+ ...props
51
+ }
52
+ ));
53
+ Card.displayName = "Card";
54
+ const CardHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
55
+ "div",
56
+ {
57
+ ref,
58
+ className: (0, import_utils.cn)("flex flex-col space-y-1.5 p-6", className),
59
+ ...props
60
+ }
61
+ ));
62
+ CardHeader.displayName = "CardHeader";
63
+ const CardTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
64
+ "div",
65
+ {
66
+ ref,
67
+ className: (0, import_utils.cn)("font-semibold leading-none tracking-tight", className),
68
+ ...props
69
+ }
70
+ ));
71
+ CardTitle.displayName = "CardTitle";
72
+ const CardDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
73
+ "div",
74
+ {
75
+ ref,
76
+ className: (0, import_utils.cn)("text-sm text-muted-foreground", className),
77
+ ...props
78
+ }
79
+ ));
80
+ CardDescription.displayName = "CardDescription";
81
+ const CardContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, className: (0, import_utils.cn)("p-6 pt-0", className), ...props }));
82
+ CardContent.displayName = "CardContent";
83
+ const CardFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
84
+ "div",
85
+ {
86
+ ref,
87
+ className: (0, import_utils.cn)("flex items-center p-6 pt-0", className),
88
+ ...props
89
+ }
90
+ ));
91
+ CardFooter.displayName = "CardFooter";
92
+ // Annotate the CommonJS export names for ESM import in node:
93
+ 0 && (module.exports = {
94
+ Card,
95
+ CardContent,
96
+ CardDescription,
97
+ CardFooter,
98
+ CardHeader,
99
+ CardTitle
100
+ });
101
+ //# sourceMappingURL=card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/ui/card.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst Card = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"rounded-xl border bg-card text-card-foreground shadow\",\n className\n )}\n {...props}\n />\n))\nCard.displayName = \"Card\"\n\nconst CardHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex flex-col space-y-1.5 p-6\", className)}\n {...props}\n />\n))\nCardHeader.displayName = \"CardHeader\"\n\nconst CardTitle = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n))\nCardTitle.displayName = \"CardTitle\"\n\nconst CardDescription = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n))\nCardDescription.displayName = \"CardDescription\"\n\nconst CardContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-6 pt-0\", className)} {...props} />\n))\nCardContent.displayName = \"CardContent\"\n\nconst CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex items-center p-6 pt-0\", className)}\n {...props}\n />\n))\nCardFooter.displayName = \"CardFooter\"\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQE;AARF,YAAuB;AAEvB,mBAAmB;AAEnB,MAAM,OAAO,MAAM,WAGjB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,eAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,KAAK,cAAc;AAEnB,MAAM,aAAa,MAAM,WAGvB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,eAAW,iBAAG,iCAAiC,SAAS;AAAA,IACvD,GAAG;AAAA;AACN,CACD;AACD,WAAW,cAAc;AAEzB,MAAM,YAAY,MAAM,WAGtB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,eAAW,iBAAG,6CAA6C,SAAS;AAAA,IACnE,GAAG;AAAA;AACN,CACD;AACD,UAAU,cAAc;AAExB,MAAM,kBAAkB,MAAM,WAG5B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,eAAW,iBAAG,iCAAiC,SAAS;AAAA,IACvD,GAAG;AAAA;AACN,CACD;AACD,gBAAgB,cAAc;AAE9B,MAAM,cAAc,MAAM,WAGxB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B,4CAAC,SAAI,KAAU,eAAW,iBAAG,YAAY,SAAS,GAAI,GAAG,OAAO,CACjE;AACD,YAAY,cAAc;AAE1B,MAAM,aAAa,MAAM,WAGvB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,eAAW,iBAAG,8BAA8B,SAAS;AAAA,IACpD,GAAG;AAAA;AACN,CACD;AACD,WAAW,cAAc;","names":[]}
@@ -0,0 +1,58 @@
1
+ "use strict";
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 __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var input_exports = {};
30
+ __export(input_exports, {
31
+ Input: () => Input
32
+ });
33
+ module.exports = __toCommonJS(input_exports);
34
+ var import_jsx_runtime = require("react/jsx-runtime");
35
+ var React = __toESM(require("react"));
36
+ var import_utils = require("../../lib/utils");
37
+ const Input = React.forwardRef(
38
+ ({ className, type, ...props }, ref) => {
39
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
40
+ "input",
41
+ {
42
+ type,
43
+ className: (0, import_utils.cn)(
44
+ "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
45
+ className
46
+ ),
47
+ ref,
48
+ ...props
49
+ }
50
+ );
51
+ }
52
+ );
53
+ Input.displayName = "Input";
54
+ // Annotate the CommonJS export names for ESM import in node:
55
+ 0 && (module.exports = {
56
+ Input
57
+ });
58
+ //# sourceMappingURL=input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/ui/input.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst Input = React.forwardRef<HTMLInputElement, React.ComponentProps<\"input\">>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n )}\n ref={ref}\n {...props}\n />\n )\n }\n)\nInput.displayName = \"Input\"\n\nexport { Input }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOM;AAPN,YAAuB;AAEvB,mBAAmB;AAEnB,MAAM,QAAQ,MAAM;AAAA,EAClB,CAAC,EAAE,WAAW,MAAM,GAAG,MAAM,GAAG,QAAQ;AACtC,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF;AAAA,QACA;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;","names":[]}
@@ -0,0 +1,55 @@
1
+ "use strict";
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 __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var label_exports = {};
30
+ __export(label_exports, {
31
+ Label: () => Label
32
+ });
33
+ module.exports = __toCommonJS(label_exports);
34
+ var import_jsx_runtime = require("react/jsx-runtime");
35
+ var React = __toESM(require("react"));
36
+ var LabelPrimitive = __toESM(require("@radix-ui/react-label"));
37
+ var import_class_variance_authority = require("class-variance-authority");
38
+ var import_utils = require("../../lib/utils");
39
+ const labelVariants = (0, import_class_variance_authority.cva)(
40
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
41
+ );
42
+ const Label = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
43
+ LabelPrimitive.Root,
44
+ {
45
+ ref,
46
+ className: (0, import_utils.cn)(labelVariants(), className),
47
+ ...props
48
+ }
49
+ ));
50
+ Label.displayName = LabelPrimitive.Root.displayName;
51
+ // Annotate the CommonJS export names for ESM import in node:
52
+ 0 && (module.exports = {
53
+ Label
54
+ });
55
+ //# sourceMappingURL=label.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/ui/label.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants(), className)}\n {...props}\n />\n))\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport { Label }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeE;AAfF,YAAuB;AACvB,qBAAgC;AAChC,sCAAuC;AAEvC,mBAAmB;AAEnB,MAAM,oBAAgB;AAAA,EACpB;AACF;AAEA,MAAM,QAAQ,MAAM,WAIlB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC,eAAe;AAAA,EAAf;AAAA,IACC;AAAA,IACA,eAAW,iBAAG,cAAc,GAAG,SAAS;AAAA,IACvC,GAAG;AAAA;AACN,CACD;AACD,MAAM,cAAc,eAAe,KAAK;","names":[]}
@@ -0,0 +1,59 @@
1
+ "use strict";
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 __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var separator_exports = {};
30
+ __export(separator_exports, {
31
+ Separator: () => Separator
32
+ });
33
+ module.exports = __toCommonJS(separator_exports);
34
+ var import_jsx_runtime = require("react/jsx-runtime");
35
+ var React = __toESM(require("react"));
36
+ var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"));
37
+ var import_utils = require("../../lib/utils");
38
+ const Separator = React.forwardRef(
39
+ ({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
40
+ SeparatorPrimitive.Root,
41
+ {
42
+ ref,
43
+ decorative,
44
+ orientation,
45
+ className: (0, import_utils.cn)(
46
+ "shrink-0 bg-border",
47
+ orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
48
+ className
49
+ ),
50
+ ...props
51
+ }
52
+ )
53
+ );
54
+ Separator.displayName = SeparatorPrimitive.Root.displayName;
55
+ // Annotate the CommonJS export names for ESM import in node:
56
+ 0 && (module.exports = {
57
+ Separator
58
+ });
59
+ //# sourceMappingURL=separator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/ui/separator.tsx"],"sourcesContent":["import * as React from \"react\"\nimport * as SeparatorPrimitive from \"@radix-ui/react-separator\"\n\nimport { cn } from \"../../lib/utils\"\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(\n (\n { className, orientation = \"horizontal\", decorative = true, ...props },\n ref\n ) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n className\n )}\n {...props}\n />\n )\n)\nSeparator.displayName = SeparatorPrimitive.Root.displayName\n\nexport { Separator }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAaI;AAbJ,YAAuB;AACvB,yBAAoC;AAEpC,mBAAmB;AAEnB,MAAM,YAAY,MAAM;AAAA,EAItB,CACE,EAAE,WAAW,cAAc,cAAc,aAAa,MAAM,GAAG,MAAM,GACrE,QAEA;AAAA,IAAC,mBAAmB;AAAA,IAAnB;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA,eAAW;AAAA,QACT;AAAA,QACA,gBAAgB,eAAe,mBAAmB;AAAA,QAClD;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,UAAU,cAAc,mBAAmB,KAAK;","names":[]}
@@ -0,0 +1,195 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var verify_exports = {};
31
+ __export(verify_exports, {
32
+ Verify: () => Verify
33
+ });
34
+ module.exports = __toCommonJS(verify_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_react = require("react");
37
+ var import_navigation = require("next/navigation");
38
+ var import_link = __toESM(require("next/link"));
39
+ var import_lucide_react = require("lucide-react");
40
+ var import_button = require("./ui/button");
41
+ var import_card = require("./ui/card");
42
+ var import_alert = require("./ui/alert");
43
+ var import_separator = require("./ui/separator");
44
+ var import_background = require("./background");
45
+ var import_utils = require("../lib/utils");
46
+ var import_useSignUp = require("../boundary/hooks/useSignUp");
47
+ var import_actions = require("../app-router/client/actions");
48
+ const RESEND_COOLDOWN = 59;
49
+ const MAX_RESEND_ATTEMPTS = 3;
50
+ function Verify() {
51
+ const router = (0, import_navigation.useRouter)();
52
+ const { email } = (0, import_useSignUp.useSignUp)();
53
+ const [error, setError] = (0, import_react.useState)("");
54
+ const [success, setSuccess] = (0, import_react.useState)("");
55
+ const [resendCooldown, setResendCooldown] = (0, import_react.useState)(0);
56
+ const [isResending, setIsResending] = (0, import_react.useState)(false);
57
+ const [resendAttempts, setResendAttempts] = (0, import_react.useState)(0);
58
+ (0, import_react.useEffect)(() => {
59
+ if (!email) {
60
+ router.push("/sign-in");
61
+ }
62
+ }, [email, router]);
63
+ (0, import_react.useEffect)(() => {
64
+ let timer;
65
+ if (resendCooldown > 0) {
66
+ timer = setInterval(() => {
67
+ setResendCooldown((prev) => prev - 1);
68
+ }, 1e3);
69
+ }
70
+ return () => clearInterval(timer);
71
+ }, [resendCooldown]);
72
+ const handleResendVerification = async () => {
73
+ if (!email || isResending || resendCooldown > 0 || resendAttempts >= MAX_RESEND_ATTEMPTS) return;
74
+ try {
75
+ setIsResending(true);
76
+ setError("");
77
+ setSuccess("");
78
+ const result = await (0, import_actions.resendEmailVerification)();
79
+ if (result.success) {
80
+ if (result.isVerified) {
81
+ setSuccess(result.message);
82
+ setTimeout(() => {
83
+ router.push("/sign-in");
84
+ }, 2e3);
85
+ } else {
86
+ setSuccess(result.message);
87
+ setResendAttempts((prev) => prev + 1);
88
+ setResendCooldown(RESEND_COOLDOWN);
89
+ }
90
+ }
91
+ } catch (error2) {
92
+ setError("Failed to resend verification email. Please try again.");
93
+ } finally {
94
+ setIsResending(false);
95
+ }
96
+ };
97
+ const handleRedirectToSignIn = () => {
98
+ router.push("/sign-in");
99
+ };
100
+ if (!email) {
101
+ return null;
102
+ }
103
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative min-h-screen flex flex-col items-center justify-center py-12 px-4 sm:px-6 lg:px-8", children: [
104
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_background.AuthBackground, {}),
105
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
106
+ import_link.default,
107
+ {
108
+ href: "/sign-in",
109
+ className: (0, import_utils.cn)(
110
+ "absolute top-8 left-8 flex items-center text-sm font-medium text-muted-foreground",
111
+ "transition-colors hover:text-primary"
112
+ ),
113
+ children: [
114
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronLeft, { className: "mr-2 h-4 w-4" }),
115
+ "Back to sign in"
116
+ ]
117
+ }
118
+ ),
119
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_card.Card, { className: "w-full max-w-md mx-auto", children: [
120
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_card.CardHeader, { className: "space-y-1", children: [
121
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex justify-center mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative", children: [
122
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "absolute -inset-1 rounded-full bg-primary/20 blur-lg" }),
123
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "relative rounded-full bg-primary/10 p-3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.MailCheck, { className: "h-8 w-8 text-primary" }) })
124
+ ] }) }),
125
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_card.CardTitle, { className: "text-2xl font-bold tracking-tight text-center", children: "Check your email" }),
126
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_card.CardDescription, { className: "text-center", children: [
127
+ "We've sent a verification link to",
128
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("br", {}),
129
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-medium", children: email })
130
+ ] })
131
+ ] }),
132
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_card.CardContent, { className: "p-6 space-y-6", children: [
133
+ error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_alert.Alert, { variant: "destructive", className: "animate-in fade-in-50", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_alert.AlertDescription, { children: error }) }),
134
+ success && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
135
+ import_alert.Alert,
136
+ {
137
+ variant: "default",
138
+ className: (0, import_utils.cn)(
139
+ "animate-in fade-in-50",
140
+ success.includes("already verified") ? "bg-green-50" : "bg-blue-50"
141
+ ),
142
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
143
+ import_alert.AlertDescription,
144
+ {
145
+ className: success.includes("already verified") ? "text-green-800" : "text-blue-800",
146
+ children: success
147
+ }
148
+ )
149
+ }
150
+ ),
151
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-4", children: [
152
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "p-4 rounded-lg bg-muted/50", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-start space-x-4", children: [
153
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-1", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.MailCheck, { className: "h-5 w-5 text-muted-foreground" }) }),
154
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex-1 space-y-1", children: [
155
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-medium", children: "Already verified?" }),
156
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm text-muted-foreground", children: "If you've already clicked the verification link in your email, you can proceed to sign in." })
157
+ ] })
158
+ ] }) }),
159
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_button.Button, { onClick: handleRedirectToSignIn, className: "w-full", variant: "outline", children: [
160
+ "Continue to sign in",
161
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowRight, { className: "ml-2 h-4 w-4" })
162
+ ] }),
163
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_separator.Separator, {}),
164
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
165
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "text-sm text-center text-muted-foreground", children: [
166
+ "Didn't receive the email? Check your spam folder or request a new link",
167
+ resendCooldown > 0 && ` in ${resendCooldown}s`
168
+ ] }),
169
+ resendAttempts >= MAX_RESEND_ATTEMPTS ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_alert.Alert, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_alert.AlertDescription, { children: "Maximum resend attempts reached. Please try signing up again or contact support." }) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
170
+ import_button.Button,
171
+ {
172
+ onClick: handleResendVerification,
173
+ className: "w-full",
174
+ disabled: isResending || resendCooldown > 0 || resendAttempts >= MAX_RESEND_ATTEMPTS,
175
+ children: isResending ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
176
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }),
177
+ "Sending..."
178
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
179
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.RefreshCw, { className: "mr-2 h-4 w-4" }),
180
+ "Resend verification email",
181
+ resendAttempts > 0 && ` (${MAX_RESEND_ATTEMPTS - resendAttempts} left)`
182
+ ] })
183
+ }
184
+ )
185
+ ] }) })
186
+ ] })
187
+ ] })
188
+ ] })
189
+ ] });
190
+ }
191
+ // Annotate the CommonJS export names for ESM import in node:
192
+ 0 && (module.exports = {
193
+ Verify
194
+ });
195
+ //# sourceMappingURL=verify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/verify.tsx"],"sourcesContent":["\"use client\"\n\nimport { useState, useEffect } from \"react\"\nimport { useRouter } from \"next/navigation\"\nimport Link from \"next/link\"\nimport { Loader2, MailCheck, ChevronLeft, RefreshCw, ArrowRight } from 'lucide-react'\nimport { Button } from \"./ui/button\"\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"./ui/card\"\nimport { Alert, AlertDescription } from \"./ui/alert\"\nimport { Separator } from \"./ui/separator\"\nimport { AuthBackground } from \"./background\"\nimport { cn } from \"../lib/utils\"\nimport { useSignUp } from '../boundary/hooks/useSignUp'\nimport { resendEmailVerification } from '../app-router/client/actions'\n\nconst RESEND_COOLDOWN = 59 // 59 seconds cooldown for resend\nconst MAX_RESEND_ATTEMPTS = 3\n\n\nexport function Verify() {\n const router = useRouter()\n const { email } = useSignUp()\n \n const [error, setError] = useState(\"\")\n const [success, setSuccess] = useState(\"\")\n const [resendCooldown, setResendCooldown] = useState(0)\n const [isResending, setIsResending] = useState(false)\n const [resendAttempts, setResendAttempts] = useState(0)\n \n // Redirect if no email in context\n useEffect(() => {\n if (!email) {\n router.push(\"/sign-in\")\n }\n }, [email, router])\n \n useEffect(() => {\n let timer: NodeJS.Timeout\n if (resendCooldown > 0) {\n timer = setInterval(() => {\n setResendCooldown((prev) => prev - 1)\n }, 1000)\n }\n return () => clearInterval(timer)\n }, [resendCooldown])\n \n const handleResendVerification = async () => {\n if (!email || isResending || resendCooldown > 0 || resendAttempts >= MAX_RESEND_ATTEMPTS) return\n \n try {\n setIsResending(true)\n setError(\"\")\n setSuccess(\"\")\n\n const result = await resendEmailVerification()\n\n if (result.success) {\n if (result.isVerified) {\n // If already verified, show success message and redirect after delay\n setSuccess(result.message)\n setTimeout(() => {\n router.push('/sign-in')\n }, 2000)\n } else {\n // If not verified, increment attempts and start cooldown\n setSuccess(result.message)\n setResendAttempts((prev) => prev + 1)\n setResendCooldown(RESEND_COOLDOWN)\n }\n }\n\n } catch (error) {\n setError(\"Failed to resend verification email. Please try again.\")\n } finally {\n setIsResending(false)\n }\n }\n \n const handleRedirectToSignIn = () => {\n router.push(\"/sign-in\")\n }\n \n if (!email) {\n return null // Will redirect in useEffect\n }\n \n return (\n <div className=\"relative min-h-screen flex flex-col items-center justify-center py-12 px-4 sm:px-6 lg:px-8\">\n <AuthBackground />\n \n <Link\n href=\"/sign-in\"\n className={cn(\n \"absolute top-8 left-8 flex items-center text-sm font-medium text-muted-foreground\",\n \"transition-colors hover:text-primary\",\n )}\n >\n <ChevronLeft className=\"mr-2 h-4 w-4\" />\n Back to sign in\n </Link>\n \n <Card className=\"w-full max-w-md mx-auto\">\n <CardHeader className=\"space-y-1\">\n <div className=\"flex justify-center mb-4\">\n <div className=\"relative\">\n <div className=\"absolute -inset-1 rounded-full bg-primary/20 blur-lg\" />\n <div className=\"relative rounded-full bg-primary/10 p-3\">\n <MailCheck className=\"h-8 w-8 text-primary\" />\n </div>\n </div>\n </div>\n <CardTitle className=\"text-2xl font-bold tracking-tight text-center\">Check your email</CardTitle>\n <CardDescription className=\"text-center\">\n We&apos;ve sent a verification link to\n <br />\n <span className=\"font-medium\">{email}</span>\n </CardDescription>\n </CardHeader>\n \n <CardContent className=\"p-6 space-y-6\">\n {error && (\n <Alert variant=\"destructive\" className=\"animate-in fade-in-50\">\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n )}\n\n{success && (\n <Alert \n variant=\"default\" \n className={cn(\n \"animate-in fade-in-50\",\n success.includes(\"already verified\") ? \"bg-green-50\" : \"bg-blue-50\"\n )}\n >\n <AlertDescription \n className={success.includes(\"already verified\") ? \"text-green-800\" : \"text-blue-800\"}\n >\n {success}\n </AlertDescription>\n </Alert>\n)}\n \n <div className=\"space-y-4\">\n <div className=\"p-4 rounded-lg bg-muted/50\">\n <div className=\"flex items-start space-x-4\">\n <div className=\"mt-1\">\n <MailCheck className=\"h-5 w-5 text-muted-foreground\" />\n </div>\n <div className=\"flex-1 space-y-1\">\n <p className=\"text-sm font-medium\">Already verified?</p>\n <p className=\"text-sm text-muted-foreground\">\n If you&apos;ve already clicked the verification link in your email, you can proceed to sign in.\n </p>\n </div>\n </div>\n </div>\n \n <Button onClick={handleRedirectToSignIn} className=\"w-full\" variant=\"outline\">\n Continue to sign in\n <ArrowRight className=\"ml-2 h-4 w-4\" />\n </Button>\n \n <Separator />\n \n <div className=\"space-y-2\">\n <div className=\"space-y-2\">\n <p className=\"text-sm text-center text-muted-foreground\">\n Didn&apos;t receive the email? Check your spam folder or request a new link\n {resendCooldown > 0 && ` in ${resendCooldown}s`}\n </p>\n {resendAttempts >= MAX_RESEND_ATTEMPTS ? (\n <Alert>\n <AlertDescription>\n Maximum resend attempts reached. Please try signing up again or contact support.\n </AlertDescription>\n </Alert>\n ) : (\n <Button\n onClick={handleResendVerification}\n className=\"w-full\"\n disabled={isResending || resendCooldown > 0 || resendAttempts >= MAX_RESEND_ATTEMPTS}\n >\n {isResending ? (\n <>\n <Loader2 className=\"mr-2 h-4 w-4 animate-spin\" />\n Sending...\n </>\n ) : (\n <>\n <RefreshCw className=\"mr-2 h-4 w-4\" />\n Resend verification email\n {resendAttempts > 0 && ` (${MAX_RESEND_ATTEMPTS - resendAttempts} left)`}\n </>\n )}\n </Button>\n )}\n </div>\n </div>\n </div>\n </CardContent>\n </Card>\n </div>\n )\n }"],"mappings":"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","names":["error","Link"]}