@levo-so/studio 0.1.101 → 0.1.103

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 (62) hide show
  1. package/{AuthProvider-56TywIOB.js → AuthProvider-C6bvedwF.js} +16 -16
  2. package/Beams-DboMUgCv.js +102 -0
  3. package/{BillingStep-Brc1Mzo3.js → BillingStep-BA3H9BVu.js} +1 -1
  4. package/{Button-XTKnNIl9.js → Button-CZycqusY.js} +249 -138
  5. package/Button-lUfKisu8.js +116 -0
  6. package/CollectionField-xa-jed3_.js +232 -0
  7. package/CollectionInput-CpNGIXJx.js +147 -0
  8. package/DateTimeWidget-DP_nMhqe.js +256 -0
  9. package/Dialog-IrII0ugb.js +130 -0
  10. package/Dots-a8xSboDv.js +100 -0
  11. package/{EntryCard-DTcx6wfA.js → EntryCard-CQpKNX7G.js} +4 -4
  12. package/Grid-BJQvxnks.js +99 -0
  13. package/{LoginCard-CnHmCKUF.js → LoginCard-Cyvm-y_q.js} +3 -3
  14. package/{LoginForm-Ck-xFaDg.js → LoginForm-_44FtvWg.js} +207 -206
  15. package/{LoginModal-BdYM8INu.js → LoginModal-Cyw_XKvz.js} +4 -4
  16. package/{MessageCard-ChDBqLVG.js → MessageCard-C2lNTxFx.js} +2 -2
  17. package/{MessageFooter-AzAtJWMo.js → MessageFooter-59Pziq3i.js} +2 -2
  18. package/{ModalManager-SggxCIno.js → ModalManager-DHkd0Zdb.js} +1 -1
  19. package/{PendingApprovalCard-C6ORDqrY.js → PendingApprovalCard-C8iZjo06.js} +3 -3
  20. package/PhoneWidget-CxxxDXkz.js +100 -0
  21. package/{Popover-BdKCElnb.js → Popover-DOvRAGzc.js} +19 -20
  22. package/PopupRenderer-C7OHYphU-Ct5T6tWM.js +2668 -0
  23. package/RichTextWidget-BqlcssWt.js +113 -0
  24. package/RteThemeProvider-Cfepkyer.js +20 -0
  25. package/{StripePaymentModal-BHIBBvRj.js → StripePaymentModal-DrLMN18M.js} +17 -17
  26. package/Toolbar-BwxoYWO_.js +738 -0
  27. package/Tooltip-NEMQqPyr.js +67 -0
  28. package/VerifyButton-TNkt-SDu.js +177 -0
  29. package/authentication-hnV1BI8s.js +36 -0
  30. package/bookingCard-BDyuBC6X.js +636 -0
  31. package/collection.d.ts +83 -0
  32. package/collection.js +9 -8
  33. package/{dialog-Dw6n_36P.js → dialog-C8-iHixJ.js} +32 -32
  34. package/dist-CG-pwDW0.js +3188 -0
  35. package/generateRadiusScale-BpcgkGtN.js +71 -0
  36. package/getFieldValidations-CSkSV2hW.js +90 -0
  37. package/index.d.ts +96 -9
  38. package/index.js +6021 -7731
  39. package/inlineRteTheme-Ajq9PNpQ.js +9 -0
  40. package/{nodeAlignment-BZbdafVA.js → nodeAlignment-DKCIjzlR.js} +41 -62
  41. package/package.json +38 -40
  42. package/studio.css +1 -1
  43. package/useLogin-B2qE8710.js +127 -0
  44. package/{utils-kDaDLLGt.js → utils-CZLafTgN.js} +1 -1
  45. package/{widgets-CWDiqXm9.js → widgets-eu5zXTf-.js} +58 -125
  46. package/Beams-B0O3uyYF.js +0 -118
  47. package/CollectionInput-cmJ0RXzG.js +0 -132
  48. package/DateTimeWidget-B5lBr0_R.js +0 -255
  49. package/Dots-DjezbpLp.js +0 -137
  50. package/Grid-C9aUfXM-.js +0 -145
  51. package/Input-Btdc1Dee.js +0 -293
  52. package/PhoneWidget-BRIAve47.js +0 -100
  53. package/RichTextWidget-CjEoGecM.js +0 -1136
  54. package/Tooltip-BOq5vSOW.js +0 -68
  55. package/VerifyButton-Bl2QqMpB.js +0 -273
  56. package/bookingCard-D3ZSjq-P.js +0 -577
  57. package/dist-DuTd566a.js +0 -3112
  58. package/getFieldValidations-DZnDgNI0.js +0 -159
  59. /package/{Gradient-B1K9Yi04.js → Gradient-NacpoDCM.js} +0 -0
  60. /package/{Waves-BkaAfGqA.js → Waves-DUuT_IFr.js} +0 -0
  61. /package/{card-BQr9258p.js → card-E2LKF9nT.js} +0 -0
  62. /package/{theme.cssm-2YTdd8Yh.js → theme.cssm-BXDp-ojp.js} +0 -0
@@ -1,9 +1,10 @@
1
1
  "use client";
2
- import { ALTERNATE_METHOD_VALUES as e, isPendingApprovalError as t, useLogin as n } from "./index.js";
3
- import { useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
4
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
5
- import { getLevoError as u } from "@levo-so/core";
6
- import { LevoOAuth as d, errorHandler as f, successToast as p, useLevo as m } from "@levo-so/react";
2
+ import { t as e } from "./useLogin-B2qE8710.js";
3
+ import { c as t, t as n } from "./authentication-hnV1BI8s.js";
4
+ import { LevoOAuth as r, errorHandler as i, successToast as a, useLevo as o } from "@levo-so/react";
5
+ import { useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
6
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
7
+ import { getLevoError as m } from "@levo-so/core";
7
8
  import { ChevronDown as h } from "lucide-react";
8
9
  import { Popover as g } from "radix-ui";
9
10
  import * as _ from "yup";
@@ -34,10 +35,10 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
34
35
  iconEnter: "_iconEnter_1je4h_103",
35
36
  iconScale: "_iconScale_1je4h_1",
36
37
  text: "_text_1je4h_119"
37
- }, P = ({ className: e, children: t, isLoading: n = !1, isError: i = !1, loadingText: a = "Loading...", successText: s = "Success!", errorText: u = "Error!", variant: d = "default", size: f = "default", disabled: p, ...m }) => {
38
- let [h, g] = o(!1), [_, v] = o(!1), [y, b] = o(n);
39
- r(() => {
40
- if (y && !n) if (i) {
38
+ }, P = ({ className: e, children: t, isLoading: n = !1, isError: r = !1, loadingText: i = "Loading...", successText: a = "Success!", errorText: o = "Error!", variant: c = "default", size: l = "default", disabled: d, ...m }) => {
39
+ let [h, g] = u(!1), [_, v] = u(!1), [y, b] = u(n);
40
+ s(() => {
41
+ if (y && !n) if (r) {
41
42
  v(!0);
42
43
  let e = setTimeout(() => {
43
44
  v(!1);
@@ -54,14 +55,14 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
54
55
  }, [
55
56
  n,
56
57
  y,
57
- i
58
+ r
58
59
  ]);
59
- let x = () => n ? a : h ? s : _ ? u : t, S = () => _ ? "destructive" : h ? "success" : d, C = () => n ? /* @__PURE__ */ c("div", {
60
+ let x = () => n ? i : h ? a : _ ? o : t, S = () => _ ? "destructive" : h ? "success" : c, C = () => n ? /* @__PURE__ */ f("div", {
60
61
  className: `${N.icon} ${N.iconEnter}`,
61
- children: /* @__PURE__ */ c("svg", {
62
+ children: /* @__PURE__ */ f("svg", {
62
63
  className: N.spinner,
63
64
  viewBox: "0 0 24 24",
64
- children: /* @__PURE__ */ c("circle", {
65
+ children: /* @__PURE__ */ f("circle", {
65
66
  cx: "12",
66
67
  cy: "12",
67
68
  r: "10",
@@ -72,16 +73,16 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
72
73
  strokeDashoffset: "32"
73
74
  })
74
75
  })
75
- }) : h && !n ? /* @__PURE__ */ c("div", {
76
+ }) : h && !n ? /* @__PURE__ */ f("div", {
76
77
  className: `${N.icon} ${N.iconEnter}`,
77
- children: /* @__PURE__ */ l("svg", {
78
+ children: /* @__PURE__ */ p("svg", {
78
79
  viewBox: "0 0 24 24",
79
- children: [/* @__PURE__ */ c("circle", {
80
+ children: [/* @__PURE__ */ f("circle", {
80
81
  cx: "12",
81
82
  cy: "12",
82
83
  r: "10",
83
84
  fill: "currentColor"
84
- }), /* @__PURE__ */ c("path", {
85
+ }), /* @__PURE__ */ f("path", {
85
86
  d: "m9 12 2 2 4-4",
86
87
  stroke: "white",
87
88
  strokeWidth: "2",
@@ -90,9 +91,9 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
90
91
  strokeLinejoin: "round"
91
92
  })]
92
93
  })
93
- }) : _ && !n ? /* @__PURE__ */ c("div", {
94
+ }) : _ && !n ? /* @__PURE__ */ f("div", {
94
95
  className: `${N.icon} ${N.iconEnter}`,
95
- children: /* @__PURE__ */ l("svg", {
96
+ children: /* @__PURE__ */ p("svg", {
96
97
  xmlns: "http://www.w3.org/2000/svg",
97
98
  width: "24",
98
99
  height: "24",
@@ -103,25 +104,25 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
103
104
  strokeLinecap: "round",
104
105
  strokeLinejoin: "round",
105
106
  children: [
106
- /* @__PURE__ */ c("circle", {
107
+ /* @__PURE__ */ f("circle", {
107
108
  cx: "12",
108
109
  cy: "12",
109
110
  r: "10"
110
111
  }),
111
- /* @__PURE__ */ c("path", { d: "m15 9-6 6" }),
112
- /* @__PURE__ */ c("path", { d: "m9 9 6 6" })
112
+ /* @__PURE__ */ f("path", { d: "m15 9-6 6" }),
113
+ /* @__PURE__ */ f("path", { d: "m9 9 6 6" })
113
114
  ]
114
115
  })
115
116
  }) : null;
116
- return /* @__PURE__ */ c("button", {
117
+ return /* @__PURE__ */ f("button", {
117
118
  className: `${N.button} ${e || ""}`,
118
119
  "data-variant": S(),
119
- "data-size": f,
120
- disabled: p || n,
120
+ "data-size": l,
121
+ disabled: d || n,
121
122
  ...m,
122
- children: /* @__PURE__ */ l("div", {
123
+ children: /* @__PURE__ */ p("div", {
123
124
  className: N.content,
124
- children: [C(), /* @__PURE__ */ c("span", {
125
+ children: [C(), /* @__PURE__ */ f("span", {
125
126
  className: N.text,
126
127
  children: x()
127
128
  })]
@@ -133,15 +134,15 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
133
134
  inputWrapper: "_inputWrapper_wx5fd_13",
134
135
  input: "_input_wx5fd_13",
135
136
  editButton: "_editButton_wx5fd_38"
136
- }, I = ({ email: e, setEmail: t, otpSent: n, handleReset: r }) => /* @__PURE__ */ l("div", {
137
+ }, I = ({ email: e, setEmail: t, otpSent: n, handleReset: r }) => /* @__PURE__ */ p("div", {
137
138
  className: F.container,
138
- children: [/* @__PURE__ */ c("label", {
139
+ children: [/* @__PURE__ */ f("label", {
139
140
  htmlFor: "email",
140
141
  className: F.label,
141
142
  children: "Email"
142
- }), /* @__PURE__ */ l("div", {
143
+ }), /* @__PURE__ */ p("div", {
143
144
  className: F.inputWrapper,
144
- children: [/* @__PURE__ */ c("input", {
145
+ children: [/* @__PURE__ */ f("input", {
145
146
  id: "email",
146
147
  type: "email",
147
148
  value: e,
@@ -149,7 +150,7 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
149
150
  className: F.input,
150
151
  placeholder: "Enter your email",
151
152
  disabled: n
152
- }), n && /* @__PURE__ */ c(P, {
153
+ }), n && /* @__PURE__ */ f(P, {
153
154
  type: "button",
154
155
  variant: "outline",
155
156
  onClick: () => r(),
@@ -167,17 +168,17 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
167
168
  submessage: "_submessage_x1dec_49",
168
169
  actions: "_actions_x1dec_55",
169
170
  resetButton: "_resetButton_x1dec_59"
170
- }, R = ({ email: e, onReset: t }) => /* @__PURE__ */ l("div", {
171
+ }, R = ({ email: e, onReset: t }) => /* @__PURE__ */ p("div", {
171
172
  className: L.container,
172
173
  children: [
173
- /* @__PURE__ */ c("div", {
174
+ /* @__PURE__ */ f("div", {
174
175
  className: L.iconWrapper,
175
- children: /* @__PURE__ */ c("svg", {
176
+ children: /* @__PURE__ */ f("svg", {
176
177
  className: L.icon,
177
178
  fill: "none",
178
179
  viewBox: "0 0 24 24",
179
180
  stroke: "currentColor",
180
- children: /* @__PURE__ */ c("path", {
181
+ children: /* @__PURE__ */ f("path", {
181
182
  strokeLinecap: "round",
182
183
  strokeLinejoin: "round",
183
184
  strokeWidth: 2,
@@ -185,26 +186,26 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
185
186
  })
186
187
  })
187
188
  }),
188
- /* @__PURE__ */ l("div", {
189
+ /* @__PURE__ */ p("div", {
189
190
  className: L.content,
190
191
  children: [
191
- /* @__PURE__ */ c("h3", {
192
+ /* @__PURE__ */ f("h3", {
192
193
  className: L.title,
193
194
  children: "Check your email"
194
195
  }),
195
- /* @__PURE__ */ l("p", {
196
+ /* @__PURE__ */ p("p", {
196
197
  className: L.message,
197
- children: ["We've sent a magic link to ", /* @__PURE__ */ c("strong", { children: e })]
198
+ children: ["We've sent a magic link to ", /* @__PURE__ */ f("strong", { children: e })]
198
199
  }),
199
- /* @__PURE__ */ c("p", {
200
+ /* @__PURE__ */ f("p", {
200
201
  className: L.submessage,
201
202
  children: "Click the link in your email to sign in. The link will expire in 15 minutes."
202
203
  })
203
204
  ]
204
205
  }),
205
- /* @__PURE__ */ c("div", {
206
+ /* @__PURE__ */ f("div", {
206
207
  className: L.actions,
207
- children: /* @__PURE__ */ c(P, {
208
+ children: /* @__PURE__ */ f(P, {
208
209
  variant: "outline",
209
210
  onClick: t,
210
211
  className: L.resetButton,
@@ -230,88 +231,88 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
230
231
  errorTitle: "_errorTitle_1mfd3_112",
231
232
  errorMessage: "_errorMessage_1mfd3_119",
232
233
  errorDismiss: "_errorDismiss_1mfd3_125"
233
- }, B = ({ error: e, onDismiss: t }) => /* @__PURE__ */ c("div", {
234
+ }, B = ({ error: e, onDismiss: t }) => /* @__PURE__ */ f("div", {
234
235
  className: z.errorContainer,
235
- children: /* @__PURE__ */ l("div", {
236
+ children: /* @__PURE__ */ p("div", {
236
237
  className: z.errorContent,
237
- children: [/* @__PURE__ */ l("div", {
238
+ children: [/* @__PURE__ */ p("div", {
238
239
  className: z.errorText,
239
- children: [e.title && /* @__PURE__ */ c("div", {
240
+ children: [e.title && /* @__PURE__ */ f("div", {
240
241
  className: z.errorTitle,
241
242
  children: e.title
242
- }), /* @__PURE__ */ c("div", {
243
+ }), /* @__PURE__ */ f("div", {
243
244
  className: z.errorMessage,
244
245
  children: e.message || "An unexpected error occurred"
245
246
  })]
246
- }), t && /* @__PURE__ */ c("button", {
247
+ }), t && /* @__PURE__ */ f("button", {
247
248
  onClick: t,
248
249
  className: z.errorDismiss,
249
250
  "aria-label": "Dismiss error",
250
251
  children: "×"
251
252
  })]
252
253
  })
253
- }), V = ({ onMagicLinkSent: e, onPendingApproval: i }) => {
254
- let { sendMagicLink: a } = n(), [s, d] = o(!1), [f, p] = o(null);
255
- r(() => {
256
- e?.(s);
257
- }, [s, e]);
258
- let m = v({
254
+ }), V = ({ onMagicLinkSent: n, onPendingApproval: r }) => {
255
+ let { sendMagicLink: i } = e(), [a, o] = u(!1), [c, l] = u(null);
256
+ s(() => {
257
+ n?.(a);
258
+ }, [a, n]);
259
+ let d = v({
259
260
  initialValues: { email: "" },
260
261
  validationSchema: M,
261
262
  validateOnChange: !1,
262
263
  validateOnBlur: !1,
263
- onSubmit: async (e, { setSubmitting: n, setFieldError: r }) => {
264
+ onSubmit: async (e, { setSubmitting: n, setFieldError: a }) => {
264
265
  try {
265
- p(null), await a(e.email), d(!0);
266
+ l(null), await i(e.email), o(!0);
266
267
  } catch (e) {
267
- let n = u(e);
268
+ let n = m(e);
268
269
  if (t(n.code)) {
269
- i?.();
270
+ r?.();
270
271
  return;
271
272
  }
272
273
  n.hasFieldErrors ? n.fieldErrors.forEach((e) => {
273
- r(e.param, e.message);
274
- }) : p(n);
274
+ a(e.param, e.message);
275
+ }) : l(n);
275
276
  } finally {
276
277
  n(!1);
277
278
  }
278
279
  }
279
280
  }), h = () => {
280
- d(!1), m.resetForm(), p(null);
281
+ o(!1), d.resetForm(), l(null);
281
282
  };
282
- return s ? /* @__PURE__ */ c(R, {
283
- email: m.values.email,
283
+ return a ? /* @__PURE__ */ f(R, {
284
+ email: d.values.email,
284
285
  onReset: h
285
- }) : /* @__PURE__ */ l("form", {
286
- onSubmit: m.handleSubmit,
286
+ }) : /* @__PURE__ */ p("form", {
287
+ onSubmit: d.handleSubmit,
287
288
  style: {
288
289
  display: "flex",
289
290
  flexDirection: "column",
290
291
  gap: "1rem"
291
292
  },
292
293
  children: [
293
- /* @__PURE__ */ c(I, {
294
- email: m.values.email,
295
- setEmail: (e) => m.setFieldValue("email", e),
294
+ /* @__PURE__ */ f(I, {
295
+ email: d.values.email,
296
+ setEmail: (e) => d.setFieldValue("email", e),
296
297
  otpSent: !1,
297
298
  handleReset: h
298
299
  }),
299
- /* @__PURE__ */ c("div", {
300
+ /* @__PURE__ */ f("div", {
300
301
  className: z.buttonWrapper,
301
- children: /* @__PURE__ */ c(P, {
302
+ children: /* @__PURE__ */ f(P, {
302
303
  type: "submit",
303
- isLoading: m.isSubmitting,
304
- isError: !!f,
305
- disabled: m.isSubmitting,
304
+ isLoading: d.isSubmitting,
305
+ isError: !!c,
306
+ disabled: d.isSubmitting,
306
307
  className: z.fullWidthButton,
307
308
  loadingText: "Sending Magic Link...",
308
309
  errorText: "Failed to Send",
309
310
  children: "Send Magic Link"
310
311
  })
311
312
  }),
312
- f && /* @__PURE__ */ c(B, {
313
- error: f,
314
- onDismiss: () => p(null)
313
+ c && /* @__PURE__ */ f(B, {
314
+ error: c,
315
+ onDismiss: () => l(null)
315
316
  })
316
317
  ]
317
318
  });
@@ -322,36 +323,36 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
322
323
  input: "_input_1c9qn_13",
323
324
  resendButton: "_resendButton_1c9qn_36"
324
325
  }, U = ({ otpSent: e, isResendingOtp: t, otp: n, resendOTP: r, setOtp: i }) => {
325
- let [a, s] = o(0);
326
- return e ? /* @__PURE__ */ l("div", {
326
+ let [a, o] = u(0);
327
+ return e ? /* @__PURE__ */ p("div", {
327
328
  className: H.container,
328
329
  children: [
329
- /* @__PURE__ */ c("label", {
330
+ /* @__PURE__ */ f("label", {
330
331
  className: H.label,
331
332
  children: "Verification Code"
332
333
  }),
333
- /* @__PURE__ */ c("div", {
334
+ /* @__PURE__ */ f("div", {
334
335
  className: H.inputGroup,
335
- children: /* @__PURE__ */ c(b, {
336
+ children: /* @__PURE__ */ f(b, {
336
337
  value: n,
337
338
  onChange: i,
338
339
  numInputs: 4,
339
340
  inputStyle: { marginRight: "12px" },
340
341
  inputType: "tel",
341
342
  skipDefaultStyles: !0,
342
- renderInput: ({ className: e, ...t }) => /* @__PURE__ */ c("input", {
343
+ renderInput: ({ className: e, ...t }) => /* @__PURE__ */ f("input", {
343
344
  className: `${H.input} ${e}`,
344
345
  ...t
345
346
  })
346
347
  })
347
348
  }),
348
- /* @__PURE__ */ c("button", {
349
+ /* @__PURE__ */ f("button", {
349
350
  type: "button",
350
351
  onClick: () => {
351
352
  r(() => {
352
- s(30);
353
+ o(30);
353
354
  let e = setInterval(() => {
354
- s((t) => t <= 1 ? (clearInterval(e), 0) : t - 1);
355
+ o((t) => t <= 1 ? (clearInterval(e), 0) : t - 1);
355
356
  }, 1e3);
356
357
  });
357
358
  },
@@ -361,33 +362,33 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
361
362
  })
362
363
  ]
363
364
  }) : null;
364
- }, W = ({ onPendingApproval: e }) => {
365
- let { sendOTP: r, verifyOTP: i, resendOTP: a } = n(), [s, d] = o(!1), [f, p] = o(null), [m, h] = o(!1), g = v({
365
+ }, W = ({ onPendingApproval: n }) => {
366
+ let { sendOTP: r, verifyOTP: i, resendOTP: a } = e(), [o, s] = u(!1), [c, l] = u(null), [d, h] = u(!1), g = v({
366
367
  initialValues: {
367
368
  email: "",
368
369
  otp: ""
369
370
  },
370
- validationSchema: s ? k : O,
371
+ validationSchema: o ? k : O,
371
372
  validateOnChange: !1,
372
373
  validateOnBlur: !1,
373
- onSubmit: async (n, { setSubmitting: a, setFieldError: o }) => {
374
+ onSubmit: async (e, { setSubmitting: a, setFieldError: c }) => {
374
375
  try {
375
- p(null), s ? await i(n.email, n.otp) : (await r({ email: n.email }), d(!0));
376
- } catch (n) {
377
- let r = u(n);
376
+ l(null), o ? await i(e.email, e.otp) : (await r({ email: e.email }), s(!0));
377
+ } catch (e) {
378
+ let r = m(e);
378
379
  if (t(r.code)) {
379
- e?.();
380
+ n?.();
380
381
  return;
381
382
  }
382
383
  r.hasFieldErrors ? r.fieldErrors.forEach((e) => {
383
- o(e.param, e.message);
384
- }) : p(r);
384
+ c(e.param, e.message);
385
+ }) : l(r);
385
386
  } finally {
386
387
  a(!1);
387
388
  }
388
389
  }
389
390
  });
390
- return /* @__PURE__ */ l("form", {
391
+ return /* @__PURE__ */ p("form", {
391
392
  onSubmit: g.handleSubmit,
392
393
  style: {
393
394
  display: "flex",
@@ -395,44 +396,44 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
395
396
  gap: "1rem"
396
397
  },
397
398
  children: [
398
- /* @__PURE__ */ c(I, {
399
+ /* @__PURE__ */ f(I, {
399
400
  email: g.values.email,
400
401
  setEmail: (e) => g.setFieldValue("email", e),
401
- otpSent: s,
402
+ otpSent: o,
402
403
  handleReset: () => {
403
- d(!1), g.resetForm(), p(null);
404
+ s(!1), g.resetForm(), l(null);
404
405
  }
405
406
  }),
406
- /* @__PURE__ */ c(U, {
407
- otpSent: s,
407
+ /* @__PURE__ */ f(U, {
408
+ otpSent: o,
408
409
  otp: g.values.otp,
409
410
  setOtp: (e) => g.setFieldValue("otp", e),
410
- isResendingOtp: m,
411
+ isResendingOtp: d,
411
412
  resendOTP: async () => {
412
413
  try {
413
- h(!0), p(null), await a({ email: g.values.email });
414
+ h(!0), l(null), await a({ email: g.values.email });
414
415
  } catch (e) {
415
- p(u(e));
416
+ l(m(e));
416
417
  } finally {
417
418
  h(!1);
418
419
  }
419
420
  }
420
421
  }),
421
- /* @__PURE__ */ c("div", {
422
+ /* @__PURE__ */ f("div", {
422
423
  className: z.buttonWrapper,
423
- children: s ? /* @__PURE__ */ c(P, {
424
+ children: o ? /* @__PURE__ */ f(P, {
424
425
  type: "submit",
425
426
  isLoading: g.isSubmitting,
426
- isError: !!f,
427
+ isError: !!c,
427
428
  disabled: g.isSubmitting || !g.values.otp,
428
429
  className: z.fullWidthButton,
429
430
  loadingText: "Verifying...",
430
431
  errorText: "Verification Failed",
431
432
  children: "Verify & Sign In"
432
- }) : /* @__PURE__ */ c(P, {
433
+ }) : /* @__PURE__ */ f(P, {
433
434
  type: "submit",
434
435
  isLoading: g.isSubmitting,
435
- isError: !!f,
436
+ isError: !!c,
436
437
  disabled: g.isSubmitting,
437
438
  className: z.fullWidthButton,
438
439
  loadingText: "Sending Code...",
@@ -440,9 +441,9 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
440
441
  children: "Send Code"
441
442
  })
442
443
  }),
443
- f && /* @__PURE__ */ c(B, {
444
- error: f,
445
- onDismiss: () => p(null)
444
+ c && /* @__PURE__ */ f(B, {
445
+ error: c,
446
+ onDismiss: () => l(null)
446
447
  })
447
448
  ]
448
449
  });
@@ -459,7 +460,7 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
459
460
  countryName: "_countryName_1fvbo_118",
460
461
  dialCode: "_dialCode_1fvbo_125"
461
462
  }, K = ({ phone: e, setPhone: t, otpSent: n, handleReset: r }) => {
462
- let [i, s] = o(!1), [u, d] = o(""), f = a(null), p = a(null), { inputValue: m, handlePhoneValueChange: _, inputRef: v, country: y, setCountry: b } = w({
463
+ let [i, a] = u(!1), [o, s] = u(""), c = l(null), d = l(null), { inputValue: m, handlePhoneValueChange: _, inputRef: v, country: y, setCountry: b } = w({
463
464
  defaultCountry: "in",
464
465
  value: e,
465
466
  countries: S,
@@ -470,32 +471,32 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
470
471
  forceDialCode: !0
471
472
  }), T = S.filter((e) => {
472
473
  let t = C(e);
473
- return t.name.toLowerCase().includes(u.toLowerCase()) || t.dialCode.includes(u);
474
+ return t.name.toLowerCase().includes(o.toLowerCase()) || t.dialCode.includes(o);
474
475
  });
475
- return /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("label", {
476
+ return /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
476
477
  className: G.label,
477
478
  children: "Phone Number"
478
- }), /* @__PURE__ */ l("div", {
479
+ }), /* @__PURE__ */ p("div", {
479
480
  className: G.inputWrapper,
480
- children: [/* @__PURE__ */ l("div", {
481
+ children: [/* @__PURE__ */ p("div", {
481
482
  className: G.phoneInputWrapper,
482
- children: [/* @__PURE__ */ l(g.Root, {
483
+ children: [/* @__PURE__ */ p(g.Root, {
483
484
  open: i,
484
- onOpenChange: s,
485
- children: [/* @__PURE__ */ c(g.Trigger, {
485
+ onOpenChange: a,
486
+ children: [/* @__PURE__ */ f(g.Trigger, {
486
487
  asChild: !0,
487
488
  disabled: n,
488
- children: /* @__PURE__ */ l("button", {
489
+ children: /* @__PURE__ */ p("button", {
489
490
  type: "button",
490
491
  className: G.selector,
491
492
  disabled: n,
492
- children: [/* @__PURE__ */ c(x, {
493
+ children: [/* @__PURE__ */ f(x, {
493
494
  iso2: y.iso2,
494
495
  style: {
495
496
  width: "24px",
496
497
  height: "16px"
497
498
  }
498
- }), /* @__PURE__ */ c(h, {
499
+ }), /* @__PURE__ */ f(h, {
499
500
  size: 16,
500
501
  style: {
501
502
  marginLeft: "4px",
@@ -503,24 +504,24 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
503
504
  }
504
505
  })]
505
506
  })
506
- }), /* @__PURE__ */ c(g.Portal, { children: /* @__PURE__ */ l(g.Content, {
507
+ }), /* @__PURE__ */ f(g.Portal, { children: /* @__PURE__ */ p(g.Content, {
507
508
  className: G.dropdownContent,
508
509
  align: "start",
509
510
  side: "bottom",
510
511
  sideOffset: 4,
511
512
  onOpenAutoFocus: (e) => {
512
- e.preventDefault(), p.current?.focus();
513
+ e.preventDefault(), d.current?.focus();
513
514
  },
514
- children: [/* @__PURE__ */ c("div", {
515
+ children: [/* @__PURE__ */ f("div", {
515
516
  style: { padding: "0.5rem" },
516
- children: /* @__PURE__ */ c("input", {
517
- ref: p,
517
+ children: /* @__PURE__ */ f("input", {
518
+ ref: d,
518
519
  type: "text",
519
520
  placeholder: "Search country...",
520
- value: u,
521
- onChange: (e) => d(e.target.value),
521
+ value: o,
522
+ onChange: (e) => s(e.target.value),
522
523
  onKeyDown: (e) => {
523
- e.key === "ArrowDown" && (e.preventDefault(), (f.current?.firstElementChild)?.focus());
524
+ e.key === "ArrowDown" && (e.preventDefault(), (c.current?.firstElementChild)?.focus());
524
525
  },
525
526
  className: G.input,
526
527
  style: {
@@ -528,45 +529,45 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
528
529
  borderLeft: "1px solid #d1d5db"
529
530
  }
530
531
  })
531
- }), /* @__PURE__ */ l("div", {
532
- ref: f,
532
+ }), /* @__PURE__ */ p("div", {
533
+ ref: c,
533
534
  style: {
534
535
  overflowY: "auto",
535
536
  flex: 1
536
537
  },
537
538
  children: [T.map((e) => {
538
539
  let t = C(e), n = t.iso2 === y.iso2;
539
- return /* @__PURE__ */ l("button", {
540
+ return /* @__PURE__ */ p("button", {
540
541
  type: "button",
541
542
  className: G.countryItem,
542
543
  "data-selected": n,
543
544
  onClick: () => {
544
- b(t.iso2), s(!1), d("");
545
+ b(t.iso2), a(!1), s("");
545
546
  },
546
547
  onKeyDown: (e) => {
547
548
  if (e.key === "ArrowDown") e.preventDefault(), e.currentTarget.nextElementSibling?.focus();
548
549
  else if (e.key === "ArrowUp") {
549
550
  e.preventDefault();
550
551
  let t = e.currentTarget.previousElementSibling;
551
- t ? t.focus() : p.current?.focus();
552
+ t ? t.focus() : d.current?.focus();
552
553
  }
553
554
  },
554
555
  children: [
555
- /* @__PURE__ */ c(x, {
556
+ /* @__PURE__ */ f(x, {
556
557
  iso2: t.iso2,
557
558
  className: G.flag
558
559
  }),
559
- /* @__PURE__ */ c("span", {
560
+ /* @__PURE__ */ f("span", {
560
561
  className: G.countryName,
561
562
  children: t.name
562
563
  }),
563
- /* @__PURE__ */ l("span", {
564
+ /* @__PURE__ */ p("span", {
564
565
  className: G.dialCode,
565
566
  children: ["+", t.dialCode]
566
567
  })
567
568
  ]
568
569
  }, t.iso2);
569
- }), T.length === 0 && /* @__PURE__ */ c("div", {
570
+ }), T.length === 0 && /* @__PURE__ */ f("div", {
570
571
  style: {
571
572
  padding: "1rem",
572
573
  textAlign: "center",
@@ -577,7 +578,7 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
577
578
  })]
578
579
  })]
579
580
  }) })]
580
- }), /* @__PURE__ */ c("input", {
581
+ }), /* @__PURE__ */ f("input", {
581
582
  ref: v,
582
583
  type: "tel",
583
584
  value: m,
@@ -585,43 +586,43 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
585
586
  className: G.input,
586
587
  disabled: n
587
588
  })]
588
- }), n && /* @__PURE__ */ c(P, {
589
+ }), n && /* @__PURE__ */ f(P, {
589
590
  variant: "outline",
590
591
  onClick: () => r(),
591
592
  className: G.editButton,
592
593
  children: "Edit"
593
594
  })]
594
595
  })] });
595
- }, q = ({ onPendingApproval: e }) => {
596
- let { sendOTP: r, verifyOTP: i, resendOTP: a } = n(), [s, d] = o(!1), [f, p] = o(null), [m, h] = o(!1), g = v({
596
+ }, q = ({ onPendingApproval: n }) => {
597
+ let { sendOTP: r, verifyOTP: i, resendOTP: a } = e(), [o, s] = u(!1), [c, l] = u(null), [d, h] = u(!1), g = v({
597
598
  initialValues: {
598
599
  phone: "",
599
600
  otp: ""
600
601
  },
601
- validationSchema: s ? j : A,
602
+ validationSchema: o ? j : A,
602
603
  validateOnChange: !1,
603
604
  validateOnBlur: !1,
604
- onSubmit: async (n, { setSubmitting: a, setFieldError: o }) => {
605
+ onSubmit: async (e, { setSubmitting: a, setFieldError: c }) => {
605
606
  try {
606
- p(null), s ? await i(n.phone, n.otp) : (await r({
607
- phone: n.phone,
607
+ l(null), o ? await i(e.phone, e.otp) : (await r({
608
+ phone: e.phone,
608
609
  medium: "whatsapp"
609
- }), d(!0));
610
- } catch (n) {
611
- let r = u(n);
610
+ }), s(!0));
611
+ } catch (e) {
612
+ let r = m(e);
612
613
  if (t(r.code)) {
613
- e?.();
614
+ n?.();
614
615
  return;
615
616
  }
616
617
  r.hasFieldErrors ? r.fieldErrors.forEach((e) => {
617
- o(e.param, e.message);
618
- }) : p(r);
618
+ c(e.param, e.message);
619
+ }) : l(r);
619
620
  } finally {
620
621
  a(!1);
621
622
  }
622
623
  }
623
624
  });
624
- return /* @__PURE__ */ l("form", {
625
+ return /* @__PURE__ */ p("form", {
625
626
  onSubmit: g.handleSubmit,
626
627
  style: {
627
628
  display: "flex",
@@ -629,47 +630,47 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
629
630
  gap: "1rem"
630
631
  },
631
632
  children: [
632
- /* @__PURE__ */ c(K, {
633
+ /* @__PURE__ */ f(K, {
633
634
  phone: g.values.phone,
634
635
  setPhone: (e) => g.setFieldValue("phone", e),
635
- otpSent: s,
636
+ otpSent: o,
636
637
  handleReset: () => {
637
- d(!1), g.resetForm(), p(null);
638
+ s(!1), g.resetForm(), l(null);
638
639
  }
639
640
  }),
640
- /* @__PURE__ */ c(U, {
641
- otpSent: s,
641
+ /* @__PURE__ */ f(U, {
642
+ otpSent: o,
642
643
  otp: g.values.otp,
643
644
  setOtp: (e) => g.setFieldValue("otp", e),
644
- isResendingOtp: m,
645
+ isResendingOtp: d,
645
646
  resendOTP: async () => {
646
647
  try {
647
- h(!0), p(null), await a({
648
+ h(!0), l(null), await a({
648
649
  phone: g.values.phone,
649
650
  medium: "whatsapp"
650
651
  });
651
652
  } catch (e) {
652
- p(u(e));
653
+ l(m(e));
653
654
  } finally {
654
655
  h(!1);
655
656
  }
656
657
  }
657
658
  }),
658
- /* @__PURE__ */ c("div", {
659
+ /* @__PURE__ */ f("div", {
659
660
  className: z.buttonWrapper,
660
- children: s ? /* @__PURE__ */ c(P, {
661
+ children: o ? /* @__PURE__ */ f(P, {
661
662
  type: "submit",
662
663
  isLoading: g.isSubmitting,
663
- isError: !!f,
664
+ isError: !!c,
664
665
  disabled: g.isSubmitting,
665
666
  className: z.fullWidthButton,
666
667
  loadingText: "Verifying...",
667
668
  errorText: "Verification Failed",
668
669
  children: "Verify & Sign In"
669
- }) : /* @__PURE__ */ c(P, {
670
+ }) : /* @__PURE__ */ f(P, {
670
671
  type: "submit",
671
672
  isLoading: g.isSubmitting,
672
- isError: !!f,
673
+ isError: !!c,
673
674
  disabled: g.isSubmitting,
674
675
  className: z.fullWidthButton,
675
676
  loadingText: "Sending Code...",
@@ -677,14 +678,14 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
677
678
  children: "Send Code"
678
679
  })
679
680
  }),
680
- f && /* @__PURE__ */ c(B, { error: f })
681
+ c && /* @__PURE__ */ f(B, { error: c })
681
682
  ]
682
683
  });
683
684
  }, J = ({ method: e, onMagicLinkSent: t, onPendingApproval: n }) => {
684
685
  switch (e) {
685
- case "otp": return /* @__PURE__ */ c(W, { onPendingApproval: n });
686
- case "whatsapp": return /* @__PURE__ */ c(q, { onPendingApproval: n });
687
- case "magiclink": return /* @__PURE__ */ c(V, {
686
+ case "otp": return /* @__PURE__ */ f(W, { onPendingApproval: n });
687
+ case "whatsapp": return /* @__PURE__ */ f(q, { onPendingApproval: n });
688
+ case "magiclink": return /* @__PURE__ */ f(V, {
688
689
  onMagicLinkSent: t,
689
690
  onPendingApproval: n
690
691
  });
@@ -692,78 +693,78 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
692
693
  }
693
694
  }, Y = ({ method: e }) => {
694
695
  switch (e) {
695
- case "google": return /* @__PURE__ */ c(d.Button, {
696
+ case "google": return /* @__PURE__ */ f(r.Button, {
696
697
  provider: "google",
697
- children: /* @__PURE__ */ l("button", {
698
+ children: /* @__PURE__ */ p("button", {
698
699
  type: "button",
699
700
  className: z.googleButton,
700
- children: [/* @__PURE__ */ c("img", {
701
+ children: [/* @__PURE__ */ f("img", {
701
702
  className: z.googleIcon,
702
703
  src: "https://static.levocdn.com/png/google.png"
703
704
  }), "Continue with Google"]
704
705
  })
705
706
  });
706
- case "microsoft": return /* @__PURE__ */ c(d.Button, {
707
+ case "microsoft": return /* @__PURE__ */ f(r.Button, {
707
708
  provider: "microsoft",
708
- children: /* @__PURE__ */ l("button", {
709
+ children: /* @__PURE__ */ p("button", {
709
710
  type: "button",
710
711
  className: z.googleButton,
711
- children: [/* @__PURE__ */ c("img", {
712
+ children: [/* @__PURE__ */ f("img", {
712
713
  className: z.googleIcon,
713
714
  src: "https://static.levocdn.com/png/microsoft.png"
714
715
  }), "Continue with Microsoft"]
715
716
  })
716
717
  });
717
- case "linkedin": return /* @__PURE__ */ c(d.Button, {
718
+ case "linkedin": return /* @__PURE__ */ f(r.Button, {
718
719
  provider: "linkedin",
719
- children: /* @__PURE__ */ l("button", {
720
+ children: /* @__PURE__ */ p("button", {
720
721
  type: "button",
721
722
  className: z.googleButton,
722
- children: [/* @__PURE__ */ c("img", {
723
+ children: [/* @__PURE__ */ f("img", {
723
724
  className: z.googleIcon,
724
725
  src: "https://static.levocdn.com/png/linkedin.png"
725
726
  }), "Continue with LinkedIn"]
726
727
  })
727
728
  });
728
- default: return /* @__PURE__ */ c(s, {});
729
+ default: return /* @__PURE__ */ f(d, {});
729
730
  }
730
- }, X = ({ otpSent: e, oAuthTitle: t, onOAuthSuccess: n, onOAuthError: r, oAuthMethods: i }) => {
731
- let { logger: a } = m();
732
- return /* @__PURE__ */ c("div", {
731
+ }, X = ({ otpSent: e, oAuthTitle: t, onOAuthSuccess: n, onOAuthError: i, oAuthMethods: s }) => {
732
+ let { logger: c } = o();
733
+ return /* @__PURE__ */ f("div", {
733
734
  className: z.oauthContainer,
734
- children: !e && /* @__PURE__ */ c(d.Container, {
735
+ children: !e && /* @__PURE__ */ f(r.Container, {
735
736
  title: t,
736
737
  onSuccess: () => {
737
- p("You are logged in successfully", "Login Successful", { position: "top-right" }), n && n();
738
+ a("You are logged in successfully", "Login Successful", { position: "top-right" }), n && n();
738
739
  },
739
740
  onError: (e) => {
740
- let t = u(e);
741
- a?.error("OAuth login failed", t.message), r && r(t);
741
+ let t = m(e);
742
+ c?.error("OAuth login failed", { exception: t }), i && i(t);
742
743
  },
743
- children: i?.map((e) => /* @__PURE__ */ c(Y, { method: e }, e))
744
+ children: s?.map((e) => /* @__PURE__ */ f(Y, { method: e }, e))
744
745
  })
745
746
  });
746
- }, Z = ({ oAuthMethods: e, oAuthTitle: t = "Studio", showDivider: n, dividerText: r, onOAuthSuccess: i, onOAuthError: a }) => /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(X, {
747
+ }, Z = ({ oAuthMethods: e, oAuthTitle: t = "Studio", showDivider: n, dividerText: r, onOAuthSuccess: i, onOAuthError: a }) => /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(X, {
747
748
  otpSent: !n,
748
749
  oAuthTitle: t,
749
750
  onOAuthSuccess: i,
750
751
  onOAuthError: a,
751
752
  oAuthMethods: e
752
- }), n && /* @__PURE__ */ l("div", {
753
+ }), n && /* @__PURE__ */ p("div", {
753
754
  className: z.divider,
754
755
  children: [
755
- /* @__PURE__ */ c("div", { className: z.dividerLine }),
756
- /* @__PURE__ */ c("div", {
756
+ /* @__PURE__ */ f("div", { className: z.dividerLine }),
757
+ /* @__PURE__ */ f("div", {
757
758
  className: z.dividerText,
758
759
  children: r
759
760
  }),
760
- /* @__PURE__ */ c("div", { className: z.dividerLine })
761
+ /* @__PURE__ */ f("div", { className: z.dividerLine })
761
762
  ]
762
- })] }), Q = ({ className: r, oAuthTitle: a = "Studio", page: o, magicLinkSent: s, setMagicLinkSent: u, oAuthMethods: d, onPendingApproval: p }) => {
763
- let { refetchLoginStatus: m } = n(), h = i(() => o?.access?.[0]?.kind === "authentication" && o?.access?.[0]?.options?.primary_method || "otp", [o?.access]), g = i(() => d || o?.access?.[0]?.kind === "authentication" && o?.access?.[0]?.options?.methods?.filter((t) => e.includes(t)) || [], [o?.access, d]);
764
- return /* @__PURE__ */ l("div", {
763
+ })] }), Q = ({ className: r, oAuthTitle: a = "Studio", page: o, magicLinkSent: s, setMagicLinkSent: l, oAuthMethods: u, onPendingApproval: d }) => {
764
+ let { refetchLoginStatus: m } = e(), h = c(() => o?.access?.[0]?.kind === "authentication" && o?.access?.[0]?.options?.primary_method || "otp", [o?.access]), g = c(() => u || o?.access?.[0]?.kind === "authentication" && o?.access?.[0]?.options?.methods?.filter((e) => n.includes(e)) || [], [o?.access, u]);
765
+ return /* @__PURE__ */ p("div", {
765
766
  className: `${z.container} ${r || ""}`,
766
- children: [g.length > 0 && !s && /* @__PURE__ */ c(Z, {
767
+ children: [g.length > 0 && !s && /* @__PURE__ */ f(Z, {
767
768
  oAuthMethods: g,
768
769
  oAuthTitle: a,
769
770
  showDivider: !0,
@@ -778,17 +779,17 @@ var T = _.string().required("Email is required").email("Please enter a valid ema
778
779
  },
779
780
  onOAuthError: (e) => {
780
781
  if (t(e?.code)) {
781
- p?.();
782
+ d?.();
782
783
  return;
783
784
  }
784
- f(e);
785
+ i(e);
785
786
  }
786
- }), /* @__PURE__ */ c("div", {
787
+ }), /* @__PURE__ */ f("div", {
787
788
  className: z.formSection,
788
- children: /* @__PURE__ */ c(J, {
789
+ children: /* @__PURE__ */ f(J, {
789
790
  method: h,
790
- onMagicLinkSent: u,
791
- onPendingApproval: p
791
+ onMagicLinkSent: l,
792
+ onPendingApproval: d
792
793
  })
793
794
  })]
794
795
  });