@sikka/hawa 0.46.4-next → 0.48.0-next

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 (55) hide show
  1. package/dist/{Radio-Dyvlywnk.d.mts → Radio-BPHTeDMz.d.mts} +8 -7
  2. package/dist/{Radio-DlPwVCG4.d.ts → Radio-cRcIH8_L.d.ts} +8 -7
  3. package/dist/blocks/auth/index.d.mts +34 -17
  4. package/dist/blocks/auth/index.d.ts +34 -17
  5. package/dist/blocks/auth/index.js +1008 -430
  6. package/dist/blocks/auth/index.mjs +427 -297
  7. package/dist/blocks/feedback/index.d.mts +1 -1
  8. package/dist/blocks/feedback/index.d.ts +1 -1
  9. package/dist/blocks/feedback/index.js +68 -79
  10. package/dist/blocks/feedback/index.mjs +1 -1
  11. package/dist/blocks/index.d.mts +28 -11
  12. package/dist/blocks/index.d.ts +28 -11
  13. package/dist/blocks/index.js +2340 -2233
  14. package/dist/blocks/index.mjs +407 -269
  15. package/dist/blocks/misc/index.d.mts +1 -1
  16. package/dist/blocks/misc/index.d.ts +1 -1
  17. package/dist/blocks/misc/index.js +68 -79
  18. package/dist/blocks/misc/index.mjs +50 -367
  19. package/dist/blocks/pricing/index.d.mts +1 -1
  20. package/dist/blocks/pricing/index.d.ts +1 -1
  21. package/dist/blocks/pricing/index.mjs +1 -1
  22. package/dist/{chunk-6TG2PHZK.mjs → chunk-AWJSHOYU.mjs} +68 -79
  23. package/dist/{chunk-5CTMGPEF.mjs → chunk-GBLWUEYN.mjs} +650 -674
  24. package/dist/chunk-JFWD2ICY.mjs +511 -0
  25. package/dist/elements/index.d.mts +2 -2
  26. package/dist/elements/index.d.ts +2 -2
  27. package/dist/elements/index.js +81 -105
  28. package/dist/elements/index.mjs +1 -1
  29. package/dist/index.css +7 -0
  30. package/dist/index.d.mts +36 -17
  31. package/dist/index.d.ts +36 -17
  32. package/dist/index.js +482 -373
  33. package/dist/index.mjs +487 -373
  34. package/dist/phoneInput/index.d.mts +7 -7
  35. package/dist/phoneInput/index.d.ts +7 -7
  36. package/dist/phoneInput/index.js +78 -85
  37. package/dist/phoneInput/index.js.map +1 -1
  38. package/dist/phoneInput/index.mjs +78 -85
  39. package/dist/phoneInput/index.mjs.map +1 -1
  40. package/dist/pinInput/index.js +3 -20
  41. package/dist/pinInput/index.js.map +1 -1
  42. package/dist/pinInput/index.mjs +3 -20
  43. package/dist/pinInput/index.mjs.map +1 -1
  44. package/dist/select/index.d.mts +1 -0
  45. package/dist/select/index.d.ts +1 -0
  46. package/dist/select/index.js +68 -79
  47. package/dist/select/index.js.map +1 -1
  48. package/dist/select/index.mjs +68 -79
  49. package/dist/select/index.mjs.map +1 -1
  50. package/dist/{textTypes-DXLtO2fL.d.mts → textTypes-CYQYIsFt.d.mts} +1 -0
  51. package/dist/{textTypes-DXLtO2fL.d.ts → textTypes-CYQYIsFt.d.ts} +1 -0
  52. package/dist/types/index.d.mts +1 -0
  53. package/dist/types/index.d.ts +1 -0
  54. package/package.json +1 -1
  55. package/dist/chunk-EOH6A3GR.mjs +0 -183
@@ -3295,6 +3295,7 @@ var import_clsx2 = __toESM(require("clsx"));
3295
3295
  var Select = ({
3296
3296
  labelProps,
3297
3297
  labelKey = "label",
3298
+ valueKey = "value",
3298
3299
  ...props
3299
3300
  }) => {
3300
3301
  const NoOption = () => {
@@ -3314,13 +3315,7 @@ var Select = ({
3314
3315
  children
3315
3316
  );
3316
3317
  };
3317
- const Option = ({
3318
- children,
3319
- innerProps,
3320
- innerRef,
3321
- isFocused,
3322
- isSelected
3323
- }) => {
3318
+ const Option = ({ children, innerProps, innerRef, isFocused, isSelected }) => {
3324
3319
  return /* @__PURE__ */ import_react9.default.createElement(
3325
3320
  "div",
3326
3321
  {
@@ -3335,14 +3330,7 @@ var Select = ({
3335
3330
  children
3336
3331
  );
3337
3332
  };
3338
- const Menu = ({
3339
- cx,
3340
- children,
3341
- getStyles,
3342
- innerProps,
3343
- innerRef,
3344
- ...menuProps
3345
- }) => {
3333
+ const Menu = ({ cx, children, getStyles, innerProps, innerRef, ...menuProps }) => {
3346
3334
  const menuOpen = menuProps.selectProps.menuIsOpen;
3347
3335
  return /* @__PURE__ */ import_react9.default.createElement(
3348
3336
  "div",
@@ -3371,71 +3359,72 @@ var Select = ({
3371
3359
  )
3372
3360
  },
3373
3361
  props.label && /* @__PURE__ */ import_react9.default.createElement(Label, { ...labelProps }, props.label),
3374
- props.isLoading ? /* @__PURE__ */ import_react9.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? (
3375
- // TODO: enable keyboard to go to the next item in the list
3376
- /* @__PURE__ */ import_react9.default.createElement(
3377
- import_react_select.default,
3378
- {
3379
- noOptionsMessage: NoOption,
3380
- classNames: {
3381
- control: () => cn(
3382
- props.phoneCode && "hawa-rounded-r-none",
3383
- props.controlClassNames
3384
- ),
3385
- container: () => cn(
3386
- selectContainerStyles,
3387
- props.phoneCode && phoneCodeStyles,
3388
- props.isMulti && "hawa-ps-0 "
3389
- ),
3390
- placeholder: () => cn(
3391
- selectPlaceholderStyles,
3392
- props.disabled && "hawa-text-muted-foreground"
3393
- ),
3394
- valueContainer: () => "hawa-text-foreground hawa-px-1 ",
3395
- singleValue: () => cn(
3396
- props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
3397
- ),
3398
- indicatorsContainer: () => cn(
3399
- selectIndicatorContainerStyles,
3400
- props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
3401
- props.disabled && "hawa-opacity-30"
3402
- )
3403
- },
3404
- unstyled: true,
3405
- autoFocus: false,
3406
- components: props.hideIndicator ? { Option, Menu, IndicatorsContainer: () => null } : {
3362
+ props.isLoading ? /* @__PURE__ */ import_react9.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" }) : !props.isCreatable ? /* @__PURE__ */ import_react9.default.createElement(
3363
+ import_react_select.default,
3364
+ {
3365
+ noOptionsMessage: NoOption,
3366
+ classNames: {
3367
+ control: () => cn(props.phoneCode && "hawa-rounded-r-none", props.controlClassNames),
3368
+ container: () => cn(
3369
+ selectContainerStyles,
3370
+ props.phoneCode && phoneCodeStyles,
3371
+ props.isMulti && "hawa-ps-0 "
3372
+ ),
3373
+ placeholder: () => cn(selectPlaceholderStyles, props.disabled && "hawa-text-muted-foreground"),
3374
+ valueContainer: () => "hawa-text-foreground hawa-px-1",
3375
+ singleValue: () => cn(
3376
+ props.disabled ? "hawa-text-muted-foreground hawa-opacity-30" : "hawa-text-foreground"
3377
+ ),
3378
+ indicatorsContainer: () => cn(
3379
+ selectIndicatorContainerStyles,
3380
+ props.hideIndicator ? "hawa-invisible" : "hawa-px-1",
3381
+ props.disabled && "hawa-opacity-30"
3382
+ )
3383
+ },
3384
+ unstyled: true,
3385
+ autoFocus: false,
3386
+ components: props.hideIndicator ? {
3387
+ Option: (optionProps) => /* @__PURE__ */ import_react9.default.createElement(
3407
3388
  Option,
3408
- Menu,
3409
- ValueContainer: (e) => /* @__PURE__ */ import_react9.default.createElement(
3410
- "div",
3411
- {
3412
- className: cn(
3413
- e.className,
3414
- "hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-1"
3415
- ),
3416
- ...e
3417
- }
3418
- ),
3419
- MultiValueContainer: (e) => /* @__PURE__ */ import_react9.default.createElement(
3420
- "div",
3421
- {
3422
- className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
3423
- ...e
3424
- }
3425
- )
3426
- },
3427
- onChange: (newValue, action) => props.onChange(newValue, action),
3428
- options: props.options,
3429
- getOptionLabel: props.getOptionLabel,
3430
- defaultValue: props.defaultValue,
3431
- value: props.value,
3432
- placeholder: props.placeholder,
3433
- isDisabled: props.disabled,
3434
- isClearable: props.isClearable,
3435
- isMulti: props.isMulti,
3436
- isSearchable: props.isSearchable
3437
- }
3438
- )
3389
+ {
3390
+ ...optionProps,
3391
+ isSelected: optionProps.data[valueKey] === props.value[valueKey]
3392
+ }
3393
+ ),
3394
+ Menu,
3395
+ IndicatorsContainer: () => null
3396
+ } : {
3397
+ Option,
3398
+ Menu,
3399
+ ValueContainer: (e) => /* @__PURE__ */ import_react9.default.createElement(
3400
+ "div",
3401
+ {
3402
+ className: cn(
3403
+ e.className,
3404
+ "hawa-gap-1 hawa-flex hawa-flex-row hawa-flex-wrap hawa-p-2 hawa-w-full hawa-cursor-pointer"
3405
+ ),
3406
+ ...e
3407
+ }
3408
+ ),
3409
+ MultiValueContainer: (e) => /* @__PURE__ */ import_react9.default.createElement(
3410
+ "div",
3411
+ {
3412
+ className: "hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-flex hawa-flex-row",
3413
+ ...e
3414
+ }
3415
+ )
3416
+ },
3417
+ onChange: (newValue, action) => props.onChange(newValue, action),
3418
+ options: props.options,
3419
+ getOptionLabel: props.getOptionLabel,
3420
+ defaultValue: props.defaultValue,
3421
+ value: props.value,
3422
+ placeholder: props.placeholder,
3423
+ isDisabled: props.disabled,
3424
+ isClearable: props.isClearable,
3425
+ isMulti: props.isMulti,
3426
+ isSearchable: props.isSearchable
3427
+ }
3439
3428
  ) : /* @__PURE__ */ import_react9.default.createElement(
3440
3429
  import_creatable.default,
3441
3430
  {
@@ -3477,11 +3466,13 @@ var PhoneInput = ({
3477
3466
  countryCodes,
3478
3467
  ...props
3479
3468
  }) => {
3469
+ var _a;
3480
3470
  const [phoneNumber, setPhoneNumber] = (0, import_react10.useState)("");
3481
- const [countryCode, setCountryCode] = (0, import_react10.useState)(props.preferredCountry);
3471
+ const [countryCode, setCountryCode] = (0, import_react10.useState)(
3472
+ props.preferredCountry || { label: "+966" }
3473
+ );
3482
3474
  const inputRef = (0, import_react10.useRef)(null);
3483
3475
  const handleInputChange = (e) => {
3484
- console.log("test e ", e.target.value);
3485
3476
  const validChars = /^[0-9-()]+$/;
3486
3477
  const input = e.target.value;
3487
3478
  if (input === "" || validChars.test(input)) {
@@ -3503,11 +3494,13 @@ var PhoneInput = ({
3503
3494
  isMulti: false,
3504
3495
  isSearchable: true,
3505
3496
  isClearable: false,
3506
- placeholder: "Code",
3497
+ placeholder: (_a = props.preferredCountry) == null ? void 0 : _a.label,
3507
3498
  options: countryCodes || countries_default,
3508
- onChange: setCountryCode,
3509
- value: countryCode == null ? void 0 : countryCode.label,
3510
- defaultValue: props.preferredCountry
3499
+ onChange: (e) => setCountryCode({ label: e.label, value: e.label }),
3500
+ valueKey: "label",
3501
+ labelKey: "label",
3502
+ value: { label: countryCode == null ? void 0 : countryCode.label, value: countryCode == null ? void 0 : countryCode.label },
3503
+ defaultValue: { label: countryCode == null ? void 0 : countryCode.label, value: countryCode == null ? void 0 : countryCode.label }
3511
3504
  }
3512
3505
  ), /* @__PURE__ */ import_react10.default.createElement("div", { className: "hawa-relative hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-justify-center hawa-gap-0" }, /* @__PURE__ */ import_react10.default.createElement(
3513
3506
  "input",
@@ -3860,14 +3853,7 @@ var LoginForm = ({
3860
3853
  (texts == null ? void 0 : texts.loginText) || "Login"
3861
3854
  ),
3862
3855
  props.additionalButtons && props.additionalButtons,
3863
- props.allowRegister && /* @__PURE__ */ import_react14.default.createElement("div", { className: "hawa-select-none hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, (texts == null ? void 0 : texts.newUserText) || "New user?", " ", /* @__PURE__ */ import_react14.default.createElement(
3864
- "span",
3865
- {
3866
- onClick: props.onRouteToRegister,
3867
- className: "clickable-link"
3868
- },
3869
- (texts == null ? void 0 : texts.createAccount) || "Create Account"
3870
- ))
3856
+ props.allowRegister && /* @__PURE__ */ import_react14.default.createElement("div", { className: "hawa-select-none hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, (texts == null ? void 0 : texts.newUserText) || "New user?", " ", /* @__PURE__ */ import_react14.default.createElement("span", { onClick: props.onRouteToRegister, className: "clickable-link" }, (texts == null ? void 0 : texts.createAccount) || "Create Account"))
3871
3857
  )),
3872
3858
  props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react14.default.createElement(
3873
3859
  CardFooter,
@@ -3897,9 +3883,10 @@ var LoginForm = ({
3897
3883
  };
3898
3884
 
3899
3885
  // blocks/auth/RegisterForm.tsx
3900
- var import_react17 = __toESM(require("react"));
3886
+ var import_react37 = __toESM(require("react"));
3901
3887
  var import_react_hook_form2 = require("react-hook-form");
3902
3888
  var import_zod2 = require("@hookform/resolvers/zod");
3889
+ var import_libphonenumber_js2 = require("libphonenumber-js");
3903
3890
  var z2 = __toESM(require("zod"));
3904
3891
 
3905
3892
  // elements/checkbox/Checkbox.tsx
@@ -4047,6 +4034,475 @@ var StopPropagationWrapper = (props) => {
4047
4034
  return /* @__PURE__ */ import_react16.default.createElement("div", { onClick: handleClick }, props.children);
4048
4035
  };
4049
4036
 
4037
+ // elements/tabs/Tabs.tsx
4038
+ var React30 = __toESM(require("react"));
4039
+
4040
+ // hooks/useIsomorphicEffect.ts
4041
+ var import_react17 = require("react");
4042
+
4043
+ // hooks/useDiscloser.ts
4044
+ var import_react18 = require("react");
4045
+
4046
+ // hooks/useHover.ts
4047
+ var import_react19 = require("react");
4048
+
4049
+ // hooks/useToast.ts
4050
+ var React22 = __toESM(require("react"));
4051
+
4052
+ // hooks/useCarousel.ts
4053
+ var import_react20 = require("react");
4054
+
4055
+ // hooks/useDialogCarousel.ts
4056
+ var import_react21 = require("react");
4057
+ var import_embla_carousel_auto_height = __toESM(require("embla-carousel-auto-height"));
4058
+ var import_embla_carousel_react = __toESM(require("embla-carousel-react"));
4059
+
4060
+ // hooks/useDialogSteps.ts
4061
+ var import_react22 = require("react");
4062
+
4063
+ // hooks/useClipboard.ts
4064
+ var import_react23 = require("react");
4065
+
4066
+ // hooks/useBreakpoint.ts
4067
+ var import_react24 = require("react");
4068
+
4069
+ // hooks/useWindowSize.ts
4070
+ var import_react25 = require("react");
4071
+
4072
+ // hooks/useFocusWithin.ts
4073
+ var import_react26 = require("react");
4074
+
4075
+ // hooks/useMediaQuery.ts
4076
+ var import_react27 = require("react");
4077
+
4078
+ // hooks/useScrollPosition.ts
4079
+ var import_react28 = require("react");
4080
+
4081
+ // hooks/useTable.ts
4082
+ var import_react29 = require("react");
4083
+
4084
+ // hooks/useTabs.ts
4085
+ var import_react30 = require("react");
4086
+
4087
+ // hooks/useMeasureDirty.ts
4088
+ var import_react31 = require("react");
4089
+
4090
+ // hooks/useClickOutside.ts
4091
+ var import_react32 = require("react");
4092
+
4093
+ // hooks/useShortcuts.ts
4094
+ var import_react33 = require("react");
4095
+
4096
+ // hooks/useWindowEvent.ts
4097
+ var import_react34 = require("react");
4098
+ function useWindowEvent(type, listener, options) {
4099
+ (0, import_react34.useEffect)(() => {
4100
+ window.addEventListener(type, listener, options);
4101
+ return () => window.removeEventListener(type, listener, options);
4102
+ }, [type, listener]);
4103
+ }
4104
+
4105
+ // hooks/useViewportSize.ts
4106
+ var import_react35 = require("react");
4107
+ var eventListerOptions = {
4108
+ passive: true
4109
+ };
4110
+ function useViewportSize() {
4111
+ const [windowSize, setWindowSize] = (0, import_react35.useState)({
4112
+ width: 0,
4113
+ height: 0
4114
+ });
4115
+ const setSize = (0, import_react35.useCallback)(() => {
4116
+ setWindowSize({
4117
+ width: window.innerWidth || 0,
4118
+ height: window.innerHeight || 0
4119
+ });
4120
+ }, []);
4121
+ useWindowEvent("resize", setSize, eventListerOptions);
4122
+ useWindowEvent("orientationchange", setSize, eventListerOptions);
4123
+ (0, import_react35.useEffect)(setSize, []);
4124
+ return windowSize;
4125
+ }
4126
+
4127
+ // elements/tabs/Tabs.tsx
4128
+ var Popover = __toESM(require("@radix-ui/react-popover"));
4129
+ var TabsPrimitive = __toESM(require("@radix-ui/react-tabs"));
4130
+ var import_tailwind_variants = require("tailwind-variants");
4131
+
4132
+ // elements/chip/Chip.tsx
4133
+ var import_react36 = __toESM(require("react"));
4134
+ var Chip = import_react36.default.forwardRef(
4135
+ ({
4136
+ label,
4137
+ size = "normal",
4138
+ icon,
4139
+ color,
4140
+ radius = "inherit",
4141
+ dot,
4142
+ dotStatus = "none",
4143
+ ...rest
4144
+ }, ref) => {
4145
+ let defaultStyles = "hawa-flex hawa-flex-row hawa-w-fit hawa-gap-1 hawa-items-center hawa-px-2.5 hawa-py-1 hawa-font-bold ";
4146
+ let radiusStyles = {
4147
+ inherit: " hawa-rounded",
4148
+ full: "hawa-rounded-full",
4149
+ none: "hawa-rounded-none"
4150
+ };
4151
+ let sizeStyles = {
4152
+ small: "hawa-h-[15px] hawa-leading-4 hawa-px-0 hawa-py-0 hawa-text-[9px] hawa-gap-0.5 ",
4153
+ normal: "hawa-h-fit hawa-text-xs",
4154
+ large: "hawa-text-base"
4155
+ };
4156
+ let dotStyles = {
4157
+ small: "hawa-flex hawa-h-1 hawa-w-1 hawa-rounded-full",
4158
+ normal: "hawa-flex hawa-h-2 hawa-w-2 hawa-rounded-full",
4159
+ large: "hawa-flex hawa-h-3 hawa-w-3 hawa-rounded-full"
4160
+ };
4161
+ let dotStatusStyles = {
4162
+ none: "hawa-bg-gray-500 dark:hawa-bg-gray-800",
4163
+ available: "hawa-bg-green-500",
4164
+ unavailable: "hawa-bg-red-500"
4165
+ };
4166
+ let colorStyles = {
4167
+ green: "hawa-bg-green-200 hawa-text-green-700 dark:hawa-bg-green-700 dark:hawa-text-green-200",
4168
+ blue: "hawa-bg-blue-200 hawa-text-blue-700 dark:hawa-bg-blue-700 dark:hawa-text-blue-100",
4169
+ red: "hawa-bg-red-200 hawa-text-red-700 dark:hawa-bg-red-700 dark:hawa-text-red-100",
4170
+ yellow: "hawa-bg-yellow-200 hawa-text-yellow-700 dark:hawa-bg-yellow-600 dark:hawa-text-black",
4171
+ orange: "hawa-bg-orange-200 hawa-text-orange-700 dark:hawa-bg-orange-700 dark:hawa-text-orange-100",
4172
+ purple: "hawa-bg-purple-200 hawa-text-purple-700 dark:hawa-bg-purple-700 dark:hawa-text-purple-100",
4173
+ cyan: "hawa-bg-cyan-200 hawa-text-cyan-700 dark:hawa-bg-cyan-700 dark:hawa-text-cyan-100",
4174
+ hyper: "hawa-text-white dark:hawa-text-black hawa-bg-gradient-to-tl hawa-from-pink-500 hawa-via-red-500 hawa-to-yellow-500 ",
4175
+ oceanic: "hawa-text-white dark:hawa-text-black hawa-bg-gradient-to-bl hawa-from-green-300 hawa-via-blue-500 hawa-to-purple-600"
4176
+ };
4177
+ if (label) {
4178
+ return /* @__PURE__ */ import_react36.default.createElement(
4179
+ "span",
4180
+ {
4181
+ ...rest,
4182
+ ref,
4183
+ className: cn(
4184
+ defaultStyles,
4185
+ sizeStyles[size],
4186
+ radiusStyles[radius],
4187
+ color ? colorStyles[color] : "hawa-border hawa-bg-none",
4188
+ rest.className
4189
+ )
4190
+ },
4191
+ dot && /* @__PURE__ */ import_react36.default.createElement(
4192
+ "span",
4193
+ {
4194
+ className: cn(dotStyles[size], dotStatusStyles[dotStatus])
4195
+ }
4196
+ ),
4197
+ icon && icon,
4198
+ label
4199
+ );
4200
+ } else {
4201
+ return /* @__PURE__ */ import_react36.default.createElement(
4202
+ "span",
4203
+ {
4204
+ ...rest,
4205
+ ref,
4206
+ className: cn(
4207
+ "hawa-h-2 hawa-w-2 hawa-rounded-full",
4208
+ color ? colorStyles[color] : "hawa-border hawa-bg-none"
4209
+ )
4210
+ }
4211
+ );
4212
+ }
4213
+ }
4214
+ );
4215
+
4216
+ // elements/scrollArea/ScrollArea.tsx
4217
+ var React29 = __toESM(require("react"));
4218
+ var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"));
4219
+ var ScrollArea = React29.forwardRef(({ className, children, orientation = "vertical", ...props }, ref) => {
4220
+ const scrollAreaRef = React29.useRef(null);
4221
+ const isDragging = React29.useRef(false);
4222
+ const startPos = React29.useRef({ x: 0, y: 0 });
4223
+ const scrollPos = React29.useRef({ top: 0, left: 0 });
4224
+ const [showLeftFade, setShowLeftFade] = React29.useState(false);
4225
+ const [showRightFade, setShowRightFade] = React29.useState(false);
4226
+ const checkOverflow = () => {
4227
+ if (scrollAreaRef.current) {
4228
+ const { scrollLeft, scrollWidth, clientWidth } = scrollAreaRef.current;
4229
+ setShowLeftFade(scrollLeft > 0);
4230
+ setShowRightFade(scrollLeft + clientWidth < scrollWidth);
4231
+ }
4232
+ };
4233
+ const onMouseDown = (e) => {
4234
+ isDragging.current = true;
4235
+ startPos.current = { x: e.clientX, y: e.clientY };
4236
+ if (scrollAreaRef.current) {
4237
+ scrollPos.current = {
4238
+ top: scrollAreaRef.current.scrollTop,
4239
+ left: scrollAreaRef.current.scrollLeft
4240
+ };
4241
+ }
4242
+ document.addEventListener("mousemove", onMouseMove);
4243
+ document.addEventListener("mouseup", onMouseUp);
4244
+ };
4245
+ const onMouseMove = (e) => {
4246
+ if (!isDragging.current || !scrollAreaRef.current) return;
4247
+ const dx = e.clientX - startPos.current.x;
4248
+ const dy = e.clientY - startPos.current.y;
4249
+ if (orientation === "vertical") {
4250
+ scrollAreaRef.current.scrollTop = scrollPos.current.top - dy;
4251
+ } else {
4252
+ scrollAreaRef.current.scrollLeft = scrollPos.current.left - dx;
4253
+ checkOverflow();
4254
+ }
4255
+ };
4256
+ const onMouseUp = () => {
4257
+ isDragging.current = false;
4258
+ document.removeEventListener("mousemove", onMouseMove);
4259
+ document.removeEventListener("mouseup", onMouseUp);
4260
+ };
4261
+ React29.useEffect(() => {
4262
+ checkOverflow();
4263
+ if (scrollAreaRef.current) {
4264
+ scrollAreaRef.current.addEventListener("scroll", checkOverflow);
4265
+ window.addEventListener("resize", checkOverflow);
4266
+ }
4267
+ return () => {
4268
+ if (scrollAreaRef.current) {
4269
+ scrollAreaRef.current.removeEventListener("scroll", checkOverflow);
4270
+ }
4271
+ window.removeEventListener("resize", checkOverflow);
4272
+ };
4273
+ }, []);
4274
+ return /* @__PURE__ */ React29.createElement(
4275
+ ScrollAreaPrimitive.Root,
4276
+ {
4277
+ ref,
4278
+ className: cn("hawa-relative hawa-overflow-hidden", className),
4279
+ ...props
4280
+ },
4281
+ /* @__PURE__ */ React29.createElement(
4282
+ "div",
4283
+ {
4284
+ className: cn(
4285
+ "hawa-pointer-events-none hawa-absolute hawa-bg-background hawa-h-full hawa-w-[50px] hawa-z-10 hawa-start-0 hawa-mask-fade-right",
4286
+ showLeftFade ? "hawa-block" : "hawa-hidden"
4287
+ )
4288
+ }
4289
+ ),
4290
+ /* @__PURE__ */ React29.createElement(
4291
+ "div",
4292
+ {
4293
+ className: cn(
4294
+ "hawa-pointer-events-none hawa-absolute hawa-bg-background hawa-mask-fade-left hawa-end-0 hawa-h-full hawa-w-[50px] hawa-z-10",
4295
+ showRightFade ? "hawa-block" : "hawa-hidden"
4296
+ )
4297
+ }
4298
+ ),
4299
+ /* @__PURE__ */ React29.createElement(
4300
+ ScrollAreaPrimitive.Viewport,
4301
+ {
4302
+ ref: scrollAreaRef,
4303
+ className: "hawa-h-full hawa-w-full hawa-rounded-[inherit]",
4304
+ onMouseDown
4305
+ },
4306
+ children
4307
+ ),
4308
+ /* @__PURE__ */ React29.createElement(ScrollBar, { orientation }),
4309
+ /* @__PURE__ */ React29.createElement(ScrollAreaPrimitive.Corner, null)
4310
+ );
4311
+ });
4312
+ ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
4313
+ var ScrollBar = React29.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ React29.createElement(
4314
+ ScrollAreaPrimitive.ScrollAreaScrollbar,
4315
+ {
4316
+ ref,
4317
+ orientation,
4318
+ className: cn(
4319
+ "hawa-flex hawa-touch-none hawa-select-none hawa-transition-colors",
4320
+ orientation === "vertical" && "hawa-h-full hawa-w-2.5 hawa-border-l hawa-border-l-transparent hawa-p-[1px]",
4321
+ orientation === "horizontal" && "hawa-h-2.5 hawa-border-t hawa-border-t-transparent hawa-p-[1px]",
4322
+ className
4323
+ ),
4324
+ ...props
4325
+ },
4326
+ /* @__PURE__ */ React29.createElement(
4327
+ ScrollAreaPrimitive.ScrollAreaThumb,
4328
+ {
4329
+ className: cn(
4330
+ "hawa-relative hawa-rounded-full hawa-bg-border",
4331
+ orientation === "vertical" && "hawa-flex-1"
4332
+ )
4333
+ }
4334
+ )
4335
+ ));
4336
+ ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
4337
+
4338
+ // elements/tabs/Tabs.tsx
4339
+ var tabsListVariant = (0, import_tailwind_variants.tv)({
4340
+ base: "",
4341
+ variants: {
4342
+ variant: {
4343
+ default: "hawa-flex hawa-w-fit hawa-items-center hawa-justify-start hawa-gap-1 hawa-rounded hawa-border hawa-bg-muted hawa-p-1 hawa-text-muted-foreground dark:hawa-border-primary/10",
4344
+ underlined: "hawa-flex hawa-w-fit hawa-items-center hawa-justify-start hawa-gap-1 hawa-rounded hawa-p-1 hawa-text-muted-foreground dark:hawa-border-primary/10",
4345
+ underlined_tabs: "hawa-flex hawa-w-fit hawa-items-center hawa-justify-start hawa-gap-1 hawa-text-muted-foreground"
4346
+ },
4347
+ orientation: { horizontal: "", vertical: "" }
4348
+ },
4349
+ compoundVariants: [
4350
+ {
4351
+ variant: "underlined_tabs",
4352
+ orientation: "vertical",
4353
+ class: "hawa-border-e-2 hawa-border-e-primary"
4354
+ },
4355
+ {
4356
+ variant: "underlined_tabs",
4357
+ orientation: "horizontal",
4358
+ class: "hawa-border-b-2 hawa-border-b-primary"
4359
+ }
4360
+ ],
4361
+ defaultVariants: { variant: "default", orientation: "horizontal" }
4362
+ });
4363
+ var tabsTriggerVariant = (0, import_tailwind_variants.tv)({
4364
+ base: "",
4365
+ variants: {
4366
+ variant: {
4367
+ default: "hawa-inline-flex hawa-w-full hawa-flex-1 hawa-select-none hawa-items-center hawa-justify-center hawa-gap-2 hawa-whitespace-nowrap hawa-rounded hawa-border hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-all focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50 data-[state=active]:hawa-bg-primary data-[state=active]:hawa-text-primary-foreground data-[state=active]:hawa-shadow-sm dark:hawa-border-primary/10",
4368
+ underlined: "hawa-inline-flex hawa-w-full hawa-flex-1 hawa-select-none hawa-items-center hawa-justify-center hawa-gap-2 hawa-whitespace-nowrap hawa-rounded hawa-rounded-none hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-all focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50",
4369
+ underlined_tabs: "hawa-inline-flex hawa-w-full hawa-flex-1 hawa-select-none hawa-items-center hawa-justify-center hawa-gap-2 hawa-whitespace-nowrap hawa-rounded hawa-px-3 hawa-py-1.5 hawa-text-sm hawa-font-medium hawa-ring-offset-background hawa-transition-all focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50 hawa-bg-primary/10 data-[state=active]:hawa-bg-primary data-[state=active]:hawa-text-primary-foreground dark:hawa-border-primary/10"
4370
+ },
4371
+ orientation: { horizontal: "", vertical: "" }
4372
+ },
4373
+ compoundVariants: [
4374
+ {
4375
+ variant: "underlined",
4376
+ orientation: "horizontal",
4377
+ class: "data-[state=active]:hawa-border-b-primary hawa-border-b hawa-border-b-2"
4378
+ },
4379
+ {
4380
+ variant: "underlined",
4381
+ orientation: "vertical",
4382
+ class: "data-[state=active]:hawa-border-e-primary hawa-border-e hawa-border-e-2"
4383
+ },
4384
+ {
4385
+ variant: "underlined_tabs",
4386
+ orientation: "horizontal",
4387
+ class: "hawa-rounded-b-none"
4388
+ },
4389
+ {
4390
+ variant: "underlined_tabs",
4391
+ orientation: "vertical",
4392
+ class: "hawa-rounded-e-none"
4393
+ }
4394
+ ],
4395
+ defaultVariants: { variant: "default", orientation: "horizontal" }
4396
+ });
4397
+ var TabsContext = React30.createContext({ orientation: "horizontal", variant: "default", scrollable: false });
4398
+ var Tabs = React30.forwardRef(
4399
+ ({ className, orientation, scrollable, variant = "default", ...props }, ref) => /* @__PURE__ */ React30.createElement(
4400
+ TabsPrimitive.Root,
4401
+ {
4402
+ ref,
4403
+ className: cn(
4404
+ "hawa-flex hawa-gap-2",
4405
+ orientation === "vertical" ? "hawa-flex-row" : "hawa-flex-col",
4406
+ className
4407
+ ),
4408
+ ...props
4409
+ },
4410
+ /* @__PURE__ */ React30.createElement(TabsContext.Provider, { value: { orientation, variant, scrollable } }, props.children)
4411
+ )
4412
+ );
4413
+ var TabsList = React30.forwardRef(({ className, classNames, ...props }, ref) => {
4414
+ const { orientation, variant, scrollable } = React30.useContext(TabsContext);
4415
+ const { width } = useViewportSize();
4416
+ if (scrollable && width < 768 && orientation === "horizontal") {
4417
+ return /* @__PURE__ */ React30.createElement(ScrollArea, { orientation: "horizontal", className: classNames == null ? void 0 : classNames.scrollArea }, /* @__PURE__ */ React30.createElement(
4418
+ TabsPrimitive.List,
4419
+ {
4420
+ ref,
4421
+ className: cn(
4422
+ tabsListVariant({ variant, orientation }),
4423
+ "hawa-flex-row hawa-flex-nowrap",
4424
+ className
4425
+ ),
4426
+ ...props
4427
+ }
4428
+ ));
4429
+ } else {
4430
+ return /* @__PURE__ */ React30.createElement(
4431
+ TabsPrimitive.List,
4432
+ {
4433
+ ref,
4434
+ className: cn(
4435
+ tabsListVariant({ variant, orientation }),
4436
+ orientation === "vertical" ? "hawa-flex-col" : "hawa-flex-row",
4437
+ "hawa-flex-wrap",
4438
+ className
4439
+ ),
4440
+ ...props
4441
+ }
4442
+ );
4443
+ }
4444
+ });
4445
+ var TabsTrigger = React30.forwardRef(
4446
+ ({ className, chipProps, withPopover = false, onPopoverClick, ...props }, ref) => {
4447
+ const { orientation, variant } = React30.useContext(TabsContext);
4448
+ if (withPopover) {
4449
+ return /* @__PURE__ */ React30.createElement(Popover.Root, { open: props.showPopover }, /* @__PURE__ */ React30.createElement(Popover.Anchor, { asChild: true }, /* @__PURE__ */ React30.createElement(
4450
+ TabsPrimitive.Trigger,
4451
+ {
4452
+ className: cn(
4453
+ tabsTriggerVariant({ variant, orientation }),
4454
+ "hawa-relative",
4455
+ className
4456
+ ),
4457
+ ...props
4458
+ },
4459
+ props.children,
4460
+ chipProps && /* @__PURE__ */ React30.createElement(Chip, { ...chipProps })
4461
+ )), /* @__PURE__ */ React30.createElement(
4462
+ Popover.Content,
4463
+ {
4464
+ onClick: onPopoverClick,
4465
+ asChild: true,
4466
+ className: cn(
4467
+ "dark:dark-shadow hawa-z-50 hawa-rounded hawa-border hawa-bg-popover hawa-text-popover-foreground hawa-shadow-md hawa-outline-none data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2",
4468
+ "hawa-arrow-default-top hawa-mt-2"
4469
+ )
4470
+ },
4471
+ /* @__PURE__ */ React30.createElement("div", { className: "hawa-p-2" }, " ", props.popoverContent)
4472
+ ));
4473
+ } else {
4474
+ return /* @__PURE__ */ React30.createElement(
4475
+ TabsPrimitive.Trigger,
4476
+ {
4477
+ className: cn(
4478
+ tabsTriggerVariant({ variant, orientation }),
4479
+ "hawa-relative",
4480
+ className
4481
+ ),
4482
+ ...props
4483
+ },
4484
+ props.children,
4485
+ chipProps && /* @__PURE__ */ React30.createElement(Chip, { ...chipProps })
4486
+ );
4487
+ }
4488
+ }
4489
+ );
4490
+ var TabsContent = React30.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React30.createElement(
4491
+ TabsPrimitive.Content,
4492
+ {
4493
+ ref,
4494
+ className: cn(
4495
+ "hawa-ring-offset-hawa-background hawa-w-full focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2",
4496
+ className
4497
+ ),
4498
+ ...props
4499
+ }
4500
+ ));
4501
+ Tabs.displayName = TabsPrimitive.Root.displayName;
4502
+ TabsList.displayName = TabsPrimitive.List.displayName;
4503
+ TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
4504
+ TabsContent.displayName = TabsPrimitive.Content.displayName;
4505
+
4050
4506
  // blocks/auth/RegisterForm.tsx
4051
4507
  var RegisterForm = ({
4052
4508
  texts,
@@ -4054,10 +4510,15 @@ var RegisterForm = ({
4054
4510
  minPasswordLength = 8,
4055
4511
  showTermsOption = false,
4056
4512
  showNewsletterOption = false,
4513
+ registerTypes,
4057
4514
  ...props
4058
4515
  }) => {
4059
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
4060
- const [passwordVisible, setPasswordVisible] = (0, import_react17.useState)(false);
4516
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
4517
+ const [passwordVisible, setPasswordVisible] = (0, import_react37.useState)(false);
4518
+ const [selectedRegisterType, setSelectedRegisterType] = (0, import_react37.useState)({
4519
+ value: ((_a = registerTypes == null ? void 0 : registerTypes[0]) == null ? void 0 : _a.value) || "password",
4520
+ label: ((_b = registerTypes == null ? void 0 : registerTypes[0]) == null ? void 0 : _b.label) || "Password"
4521
+ });
4061
4522
  const thirdPartyAuthTexts = {
4062
4523
  continueWithGoogle: texts == null ? void 0 : texts.continueWithGoogle,
4063
4524
  continueWithTwitter: texts == null ? void 0 : texts.continueWithTwitter,
@@ -4069,8 +4530,12 @@ var RegisterForm = ({
4069
4530
  };
4070
4531
  const methods = (0, import_react_hook_form2.useForm)();
4071
4532
  let fieldSchemas = {};
4533
+ const hasPhoneType = registerTypes == null ? void 0 : registerTypes.some((type) => type.value === "phone");
4534
+ if (hasPhoneType && selectedRegisterType.value === "phone") {
4535
+ registerFields = ["phone"];
4536
+ }
4072
4537
  registerFields.forEach((field) => {
4073
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
4538
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2;
4074
4539
  switch (field) {
4075
4540
  case "fullname":
4076
4541
  fieldSchemas["fullName"] = z2.string().optional();
@@ -4095,55 +4560,85 @@ var RegisterForm = ({
4095
4560
  { message: ((_g2 = texts == null ? void 0 : texts.username) == null ? void 0 : _g2.invalid) || "Invalid username" }
4096
4561
  );
4097
4562
  break;
4563
+ case "phone":
4564
+ fieldSchemas["phone"] = z2.string({
4565
+ required_error: ((_h2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _h2.required) || "Phone Number Required"
4566
+ }).refine(
4567
+ (value) => {
4568
+ let isPhoneValid = (0, import_libphonenumber_js2.isPossiblePhoneNumber)(value) && (0, import_libphonenumber_js2.isValidPhoneNumber)(value) && (0, import_libphonenumber_js2.validatePhoneNumberLength)(value) === void 0;
4569
+ return isPhoneValid;
4570
+ },
4571
+ { message: ((_i2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _i2.invalid) || "Phone Number Invalid" }
4572
+ );
4573
+ break;
4098
4574
  }
4099
4575
  });
4100
- const formSchema = z2.object({
4101
- ...fieldSchemas,
4102
- password: z2.string({
4103
- required_error: ((_a = texts == null ? void 0 : texts.password) == null ? void 0 : _a.required) || "Password is required"
4104
- }).min(minPasswordLength, {
4105
- message: ((_b = texts == null ? void 0 : texts.password) == null ? void 0 : _b.tooShort) || "Password is too short"
4106
- }).refine((value) => value !== "", {
4107
- message: ((_c = texts == null ? void 0 : texts.password) == null ? void 0 : _c.required) || "Password is required"
4108
- }),
4109
- confirm_password: z2.string({
4110
- required_error: ((_d = texts == null ? void 0 : texts.confirm) == null ? void 0 : _d.required) || "Confirm password required"
4111
- }).min(minPasswordLength, {
4112
- message: ((_e = texts == null ? void 0 : texts.password) == null ? void 0 : _e.tooShort) || "Password is too short"
4113
- }).refine((value) => value !== "", {
4114
- message: ((_f = texts == null ? void 0 : texts.password) == null ? void 0 : _f.required) || "Confirm password is required"
4115
- }),
4116
- refCode: z2.string().optional(),
4117
- reference: z2.string().optional(),
4118
- terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
4119
- message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
4120
- }),
4121
- newsletter_accepted: z2.boolean().optional()
4122
- }).refine((data) => data.password === data.confirm_password, {
4123
- message: ((_g = texts == null ? void 0 : texts.confirm) == null ? void 0 : _g.dontMatch) || "Passwords don't match",
4124
- path: ["confirm_password"]
4125
- });
4576
+ let formSchema;
4577
+ if (selectedRegisterType.value === "phone") {
4578
+ formSchema = z2.object({
4579
+ phone: z2.string({
4580
+ required_error: ((_c = texts == null ? void 0 : texts.phone) == null ? void 0 : _c.required) || "Phone Number Required"
4581
+ }).refine(
4582
+ (value) => {
4583
+ let isPhoneValid = (0, import_libphonenumber_js2.isPossiblePhoneNumber)(value) && (0, import_libphonenumber_js2.isValidPhoneNumber)(value) && (0, import_libphonenumber_js2.validatePhoneNumberLength)(value) === void 0;
4584
+ return isPhoneValid;
4585
+ },
4586
+ { message: ((_d = texts == null ? void 0 : texts.phone) == null ? void 0 : _d.invalid) || "Phone Number Invalid" }
4587
+ ),
4588
+ refCode: z2.string().optional(),
4589
+ reference: z2.string().optional(),
4590
+ terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
4591
+ message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
4592
+ }),
4593
+ newsletter_accepted: z2.boolean().optional()
4594
+ });
4595
+ } else {
4596
+ formSchema = z2.object({
4597
+ ...fieldSchemas,
4598
+ password: z2.string({
4599
+ required_error: ((_e = texts == null ? void 0 : texts.password) == null ? void 0 : _e.required) || "Password is required"
4600
+ }).min(minPasswordLength, {
4601
+ message: ((_f = texts == null ? void 0 : texts.password) == null ? void 0 : _f.tooShort) || "Password is too short"
4602
+ }).refine((value) => value !== "", {
4603
+ message: ((_g = texts == null ? void 0 : texts.password) == null ? void 0 : _g.required) || "Password is required"
4604
+ }),
4605
+ confirm_password: z2.string({
4606
+ required_error: ((_h = texts == null ? void 0 : texts.confirm) == null ? void 0 : _h.required) || "Confirm password required"
4607
+ }).min(minPasswordLength, {
4608
+ message: ((_i = texts == null ? void 0 : texts.password) == null ? void 0 : _i.tooShort) || "Password is too short"
4609
+ }).refine((value) => value !== "", {
4610
+ message: ((_j = texts == null ? void 0 : texts.password) == null ? void 0 : _j.required) || "Confirm password is required"
4611
+ }),
4612
+ refCode: z2.string().optional(),
4613
+ reference: z2.string().optional(),
4614
+ terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
4615
+ message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
4616
+ }),
4617
+ newsletter_accepted: z2.boolean().optional()
4618
+ }).refine((data) => data.password === data.confirm_password, {
4619
+ message: ((_k = texts == null ? void 0 : texts.confirm) == null ? void 0 : _k.dontMatch) || "Passwords don't match",
4620
+ path: ["confirm_password"]
4621
+ });
4622
+ }
4126
4623
  const { handleSubmit, control, formState } = (0, import_react_hook_form2.useForm)({
4127
4624
  resolver: (0, import_zod2.zodResolver)(formSchema)
4128
4625
  });
4129
- return /* @__PURE__ */ import_react17.default.createElement(
4130
- "div",
4626
+ return /* @__PURE__ */ import_react37.default.createElement("div", { className: cn("hawa-flex hawa-flex-col", (_l = props.classNames) == null ? void 0 : _l.root) }, /* @__PURE__ */ import_react37.default.createElement(
4627
+ Card,
4131
4628
  {
4629
+ dir: props.direction,
4132
4630
  className: cn(
4133
- "hawa-flex hawa-flex-col hawa-gap-4",
4134
- (_h = props.classNames) == null ? void 0 : _h.root
4631
+ (_m = props.classNames) == null ? void 0 : _m.card,
4632
+ props.cardless && "hawa-border-none hawa-bg-transparent !hawa-shadow-none !hawa-drop-shadow-none"
4135
4633
  )
4136
4634
  },
4137
- /* @__PURE__ */ import_react17.default.createElement(
4138
- Card,
4635
+ /* @__PURE__ */ import_react37.default.createElement(
4636
+ CardContent,
4139
4637
  {
4140
- dir: props.direction,
4141
- className: cn(
4142
- (_i = props.classNames) == null ? void 0 : _i.card,
4143
- props.cardless && "hawa-border-none hawa-bg-transparent !hawa-shadow-none !hawa-drop-shadow-none"
4144
- )
4638
+ headless: registerTypes ? registerTypes.length <= 1 : true,
4639
+ noPadding: props.cardless
4145
4640
  },
4146
- /* @__PURE__ */ import_react17.default.createElement(CardContent, { headless: true, noPadding: props.cardless }, /* @__PURE__ */ import_react17.default.createElement("div", null, props.showError && /* @__PURE__ */ import_react17.default.createElement(
4641
+ /* @__PURE__ */ import_react37.default.createElement("div", null, props.showError && /* @__PURE__ */ import_react37.default.createElement(
4147
4642
  Alert,
4148
4643
  {
4149
4644
  direction: props.direction,
@@ -4156,7 +4651,7 @@ var RegisterForm = ({
4156
4651
  }
4157
4652
  }
4158
4653
  }
4159
- ), /* @__PURE__ */ import_react17.default.createElement(import_react_hook_form2.FormProvider, { ...methods }, /* @__PURE__ */ import_react17.default.createElement(
4654
+ ), /* @__PURE__ */ import_react37.default.createElement(import_react_hook_form2.FormProvider, { ...methods }, /* @__PURE__ */ import_react37.default.createElement(
4160
4655
  "form",
4161
4656
  {
4162
4657
  noValidate: true,
@@ -4164,241 +4659,353 @@ var RegisterForm = ({
4164
4659
  if (props.onRegister) {
4165
4660
  return props.onRegister(e);
4166
4661
  } else {
4167
- console.log(
4168
- "Form is submitted but onRegister prop is missing"
4169
- );
4662
+ console.log("Form is submitted but onRegister prop is missing");
4170
4663
  }
4171
4664
  }),
4172
4665
  className: "hawa-flex hawa-flex-col hawa-gap-4"
4173
4666
  },
4174
- /* @__PURE__ */ import_react17.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
4175
- if (fld === "fullname") {
4176
- return /* @__PURE__ */ import_react17.default.createElement(
4667
+ /* @__PURE__ */ import_react37.default.createElement(
4668
+ Tabs,
4669
+ {
4670
+ dir: props.direction,
4671
+ value: selectedRegisterType.value,
4672
+ onValueChange: (e) => setSelectedRegisterType(
4673
+ (registerTypes == null ? void 0 : registerTypes.find((r) => r.value === e)) || registerTypes && registerTypes[0] || {
4674
+ label: "Password",
4675
+ value: "password"
4676
+ }
4677
+ )
4678
+ },
4679
+ registerTypes && registerTypes.length > 1 && /* @__PURE__ */ import_react37.default.createElement(CardHeader, { className: "hawa-w-full hawa-px-0 hawa-py-0 hawa-my-4 hawa-mt-6" }, /* @__PURE__ */ import_react37.default.createElement(TabsList, { className: "hawa-w-full" }, registerTypes.map((registerType) => /* @__PURE__ */ import_react37.default.createElement(TabsTrigger, { value: registerType.value }, registerType.label)))),
4680
+ /* @__PURE__ */ import_react37.default.createElement(
4681
+ TabsContent,
4682
+ {
4683
+ value: "password",
4684
+ className: cn(
4685
+ "hawa-flex hawa-flex-col hawa-gap-4",
4686
+ selectedRegisterType.value === "password" ? "hawa-block" : "hawa-hidden"
4687
+ ),
4688
+ dir: props.direction
4689
+ },
4690
+ /* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
4691
+ if (fld === "fullname") {
4692
+ return /* @__PURE__ */ import_react37.default.createElement(
4693
+ import_react_hook_form2.Controller,
4694
+ {
4695
+ key: i,
4696
+ control,
4697
+ name: "fullName",
4698
+ render: ({ field }) => {
4699
+ var _a2, _b2, _c2;
4700
+ return /* @__PURE__ */ import_react37.default.createElement(
4701
+ Input,
4702
+ {
4703
+ width: "full",
4704
+ label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
4705
+ placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
4706
+ helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
4707
+ ...field
4708
+ }
4709
+ );
4710
+ }
4711
+ }
4712
+ );
4713
+ }
4714
+ if (fld === "email") {
4715
+ return /* @__PURE__ */ import_react37.default.createElement(
4716
+ import_react_hook_form2.Controller,
4717
+ {
4718
+ key: i,
4719
+ control,
4720
+ name: "email",
4721
+ render: ({ field }) => {
4722
+ var _a2, _b2, _c2;
4723
+ return /* @__PURE__ */ import_react37.default.createElement(
4724
+ Input,
4725
+ {
4726
+ dir: "ltr",
4727
+ inputProps: {
4728
+ className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
4729
+ },
4730
+ width: "full",
4731
+ autoComplete: "email",
4732
+ label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
4733
+ helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
4734
+ placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
4735
+ ...field,
4736
+ onChange: (e) => {
4737
+ field.onChange(e.target.value.toLowerCase().trim());
4738
+ }
4739
+ }
4740
+ );
4741
+ }
4742
+ }
4743
+ );
4744
+ }
4745
+ if (fld === "username") {
4746
+ return /* @__PURE__ */ import_react37.default.createElement(
4747
+ import_react_hook_form2.Controller,
4748
+ {
4749
+ key: i,
4750
+ control,
4751
+ name: "username",
4752
+ render: ({ field }) => {
4753
+ var _a2, _b2, _c2, _d2;
4754
+ return /* @__PURE__ */ import_react37.default.createElement(
4755
+ Input,
4756
+ {
4757
+ width: "full",
4758
+ autoComplete: "username",
4759
+ label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
4760
+ labelProps: {
4761
+ ...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
4762
+ },
4763
+ helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
4764
+ placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
4765
+ ...field
4766
+ }
4767
+ );
4768
+ }
4769
+ }
4770
+ );
4771
+ }
4772
+ })),
4773
+ /* @__PURE__ */ import_react37.default.createElement(
4177
4774
  import_react_hook_form2.Controller,
4178
4775
  {
4179
- key: i,
4180
4776
  control,
4181
- name: "fullName",
4777
+ name: "password",
4182
4778
  render: ({ field }) => {
4183
4779
  var _a2, _b2, _c2;
4184
- return /* @__PURE__ */ import_react17.default.createElement(
4780
+ return /* @__PURE__ */ import_react37.default.createElement(
4185
4781
  Input,
4186
4782
  {
4187
4783
  width: "full",
4188
- label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
4189
- placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
4190
- helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
4784
+ type: passwordVisible ? "text" : "password",
4785
+ autoComplete: "new-password",
4786
+ label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
4787
+ placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
4788
+ helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
4789
+ endIcon: /* @__PURE__ */ import_react37.default.createElement(
4790
+ "div",
4791
+ {
4792
+ className: "hawa-cursor-pointer",
4793
+ onClick: () => setPasswordVisible(!passwordVisible)
4794
+ },
4795
+ passwordVisible ? /* @__PURE__ */ import_react37.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react37.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
4796
+ " "
4797
+ ),
4191
4798
  ...field
4192
4799
  }
4193
4800
  );
4194
4801
  }
4195
4802
  }
4196
- );
4197
- }
4198
- if (fld === "email") {
4199
- return /* @__PURE__ */ import_react17.default.createElement(
4803
+ ),
4804
+ /* @__PURE__ */ import_react37.default.createElement(
4200
4805
  import_react_hook_form2.Controller,
4201
4806
  {
4202
- key: i,
4203
4807
  control,
4204
- name: "email",
4808
+ name: "confirm_password",
4205
4809
  render: ({ field }) => {
4206
4810
  var _a2, _b2, _c2;
4207
- return /* @__PURE__ */ import_react17.default.createElement(
4811
+ return /* @__PURE__ */ import_react37.default.createElement(
4208
4812
  Input,
4209
4813
  {
4210
- dir: "ltr",
4211
- inputProps: {
4212
- className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
4213
- },
4214
4814
  width: "full",
4215
- autoComplete: "email",
4216
- label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
4217
- helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
4218
- placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
4219
- ...field,
4220
- onChange: (e) => {
4221
- field.onChange(
4222
- e.target.value.toLowerCase().trim()
4223
- );
4224
- }
4815
+ type: passwordVisible ? "text" : "password",
4816
+ autoComplete: "new-password",
4817
+ label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
4818
+ placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
4819
+ helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
4820
+ endIcon: /* @__PURE__ */ import_react37.default.createElement(
4821
+ "div",
4822
+ {
4823
+ className: "hawa-cursor-pointer",
4824
+ onClick: () => setPasswordVisible(!passwordVisible)
4825
+ },
4826
+ passwordVisible ? /* @__PURE__ */ import_react37.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react37.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
4827
+ " "
4828
+ ),
4829
+ ...field
4225
4830
  }
4226
4831
  );
4227
4832
  }
4228
4833
  }
4229
- );
4230
- }
4231
- if (fld === "username") {
4232
- return /* @__PURE__ */ import_react17.default.createElement(
4834
+ ),
4835
+ props.additionalInputs,
4836
+ props.showRefCode && /* @__PURE__ */ import_react37.default.createElement(
4233
4837
  import_react_hook_form2.Controller,
4234
4838
  {
4235
- key: i,
4236
4839
  control,
4237
- name: "username",
4840
+ name: "refCode",
4238
4841
  render: ({ field }) => {
4239
- var _a2, _b2, _c2, _d2;
4240
- return /* @__PURE__ */ import_react17.default.createElement(
4842
+ var _a2;
4843
+ return /* @__PURE__ */ import_react37.default.createElement(
4241
4844
  Input,
4242
4845
  {
4243
4846
  width: "full",
4244
- autoComplete: "username",
4245
- label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
4246
- labelProps: {
4247
- ...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
4248
- },
4249
- helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
4250
- placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
4847
+ label: texts == null ? void 0 : texts.refCode,
4848
+ placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
4849
+ helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
4251
4850
  ...field
4252
4851
  }
4253
4852
  );
4254
4853
  }
4255
4854
  }
4256
- );
4257
- }
4258
- })),
4259
- /* @__PURE__ */ import_react17.default.createElement(
4260
- import_react_hook_form2.Controller,
4261
- {
4262
- control,
4263
- name: "password",
4264
- render: ({ field }) => {
4265
- var _a2, _b2, _c2;
4266
- return /* @__PURE__ */ import_react17.default.createElement(
4267
- Input,
4268
- {
4269
- width: "full",
4270
- type: passwordVisible ? "text" : "password",
4271
- endIcon: /* @__PURE__ */ import_react17.default.createElement(
4272
- "div",
4855
+ ),
4856
+ props.showUserSource && /* @__PURE__ */ import_react37.default.createElement(
4857
+ import_react_hook_form2.Controller,
4858
+ {
4859
+ control,
4860
+ name: "reference",
4861
+ render: ({ field }) => {
4862
+ var _a2, _b2;
4863
+ return /* @__PURE__ */ import_react37.default.createElement(
4864
+ Select,
4273
4865
  {
4274
- className: "hawa-cursor-pointer",
4275
- onClick: () => setPasswordVisible(!passwordVisible)
4276
- },
4277
- passwordVisible ? /* @__PURE__ */ import_react17.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react17.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
4278
- " "
4279
- ),
4280
- autoComplete: "new-password",
4281
- label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
4282
- placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
4283
- helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
4284
- ...field
4866
+ label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
4867
+ placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
4868
+ isCreatable: false,
4869
+ isMulti: false,
4870
+ isSearchable: false,
4871
+ isClearable: false,
4872
+ options: props.userReferenceOptions || [],
4873
+ onChange: (e) => field.onChange(e)
4874
+ }
4875
+ );
4285
4876
  }
4286
- );
4287
- }
4288
- }
4289
- ),
4290
- /* @__PURE__ */ import_react17.default.createElement(
4291
- import_react_hook_form2.Controller,
4292
- {
4293
- control,
4294
- name: "confirm_password",
4295
- render: ({ field }) => {
4296
- var _a2, _b2, _c2;
4297
- return /* @__PURE__ */ import_react17.default.createElement(
4298
- Input,
4299
- {
4300
- width: "full",
4301
- type: "password",
4302
- autoComplete: "new-password",
4303
- label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
4304
- placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
4305
- helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
4306
- ...field
4877
+ }
4878
+ )
4879
+ ),
4880
+ /* @__PURE__ */ import_react37.default.createElement(
4881
+ TabsContent,
4882
+ {
4883
+ value: "phone",
4884
+ className: cn(
4885
+ "hawa-flex hawa-flex-col hawa-gap-4",
4886
+ selectedRegisterType.value === "phone" ? "hawa-block" : "hawa-hidden"
4887
+ ),
4888
+ dir: props.direction
4889
+ },
4890
+ /* @__PURE__ */ import_react37.default.createElement(
4891
+ import_react_hook_form2.Controller,
4892
+ {
4893
+ control,
4894
+ name: "phone",
4895
+ render: ({ field }) => {
4896
+ var _a2, _b2;
4897
+ return /* @__PURE__ */ import_react37.default.createElement(
4898
+ PhoneInput,
4899
+ {
4900
+ label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
4901
+ helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
4902
+ preferredCountry: { label: "+966" },
4903
+ ...props.phoneInputProps,
4904
+ handleChange: (e) => {
4905
+ if ((0, import_libphonenumber_js2.isValidPhoneNumber)(e) && (0, import_libphonenumber_js2.isPossiblePhoneNumber)(e) && (0, import_libphonenumber_js2.validatePhoneNumberLength)(e) === void 0) {
4906
+ let parsed = (0, import_libphonenumber_js2.parsePhoneNumber)(e);
4907
+ field.onChange(parsed.number);
4908
+ } else {
4909
+ field.onChange(e);
4910
+ }
4911
+ }
4912
+ }
4913
+ );
4307
4914
  }
4308
- );
4309
- }
4310
- }
4311
- ),
4312
- props.additionalInputs,
4313
- props.showRefCode && /* @__PURE__ */ import_react17.default.createElement(
4314
- import_react_hook_form2.Controller,
4315
- {
4316
- control,
4317
- name: "refCode",
4318
- render: ({ field }) => {
4319
- var _a2;
4320
- return /* @__PURE__ */ import_react17.default.createElement(
4321
- Input,
4322
- {
4323
- width: "full",
4324
- label: texts == null ? void 0 : texts.refCode,
4325
- placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
4326
- helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
4327
- ...field
4915
+ }
4916
+ ),
4917
+ props.additionalInputs,
4918
+ props.showRefCode && /* @__PURE__ */ import_react37.default.createElement(
4919
+ import_react_hook_form2.Controller,
4920
+ {
4921
+ control,
4922
+ name: "refCode",
4923
+ render: ({ field }) => {
4924
+ var _a2;
4925
+ return /* @__PURE__ */ import_react37.default.createElement(
4926
+ Input,
4927
+ {
4928
+ width: "full",
4929
+ label: texts == null ? void 0 : texts.refCode,
4930
+ placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
4931
+ helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
4932
+ ...field
4933
+ }
4934
+ );
4328
4935
  }
4329
- );
4330
- }
4331
- }
4332
- ),
4333
- props.showUserSource && /* @__PURE__ */ import_react17.default.createElement(
4334
- import_react_hook_form2.Controller,
4335
- {
4336
- control,
4337
- name: "reference",
4338
- render: ({ field }) => {
4339
- var _a2, _b2;
4340
- return /* @__PURE__ */ import_react17.default.createElement(
4341
- Select,
4342
- {
4343
- label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
4344
- placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
4345
- isCreatable: false,
4346
- isMulti: false,
4347
- isSearchable: false,
4348
- isClearable: false,
4349
- options: props.userReferenceOptions || [],
4350
- onChange: (e) => field.onChange(e)
4936
+ }
4937
+ ),
4938
+ props.showUserSource && /* @__PURE__ */ import_react37.default.createElement(
4939
+ import_react_hook_form2.Controller,
4940
+ {
4941
+ control,
4942
+ name: "reference",
4943
+ render: ({ field }) => {
4944
+ var _a2, _b2;
4945
+ return /* @__PURE__ */ import_react37.default.createElement(
4946
+ Select,
4947
+ {
4948
+ label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
4949
+ placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
4950
+ isCreatable: false,
4951
+ isMulti: false,
4952
+ isSearchable: false,
4953
+ isClearable: false,
4954
+ options: props.userReferenceOptions || [],
4955
+ onChange: (e) => field.onChange(e)
4956
+ }
4957
+ );
4351
4958
  }
4352
- );
4959
+ }
4960
+ )
4961
+ ),
4962
+ showTermsOption || showNewsletterOption ? /* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ import_react37.default.createElement(
4963
+ import_react_hook_form2.Controller,
4964
+ {
4965
+ control,
4966
+ name: "terms_accepted",
4967
+ render: ({ field }) => {
4968
+ var _a2, _b2;
4969
+ return /* @__PURE__ */ import_react37.default.createElement(
4970
+ Checkbox,
4971
+ {
4972
+ id: "terms_accepted",
4973
+ helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
4974
+ onCheckedChange: (e) => field.onChange(e),
4975
+ label: /* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-0.5 hawa-whitespace-nowrap hawa-flex-wrap" }, (texts == null ? void 0 : texts.iAcceptText) || "I accept the", " ", /* @__PURE__ */ import_react37.default.createElement(StopPropagationWrapper, null, /* @__PURE__ */ import_react37.default.createElement(
4976
+ "span",
4977
+ {
4978
+ onClick: (e) => {
4979
+ e.preventDefault();
4980
+ if (props.onRouteToTOS) {
4981
+ props.onRouteToTOS();
4982
+ }
4983
+ },
4984
+ className: "clickable-link"
4985
+ },
4986
+ (texts == null ? void 0 : texts.termsText) || "Terms of Service"
4987
+ )))
4988
+ }
4989
+ );
4990
+ }
4353
4991
  }
4354
- }
4355
- ),
4356
- showTermsOption || showNewsletterOption ? /* @__PURE__ */ import_react17.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ import_react17.default.createElement(
4357
- import_react_hook_form2.Controller,
4358
- {
4359
- control,
4360
- name: "terms_accepted",
4361
- render: ({ field }) => {
4362
- var _a2, _b2;
4363
- return /* @__PURE__ */ import_react17.default.createElement(
4992
+ ), showNewsletterOption && /* @__PURE__ */ import_react37.default.createElement(
4993
+ import_react_hook_form2.Controller,
4994
+ {
4995
+ control,
4996
+ name: "newsletter_accepted",
4997
+ render: ({ field }) => /* @__PURE__ */ import_react37.default.createElement(
4364
4998
  Checkbox,
4365
4999
  {
4366
- id: "terms_accepted",
4367
- helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
4368
- onCheckedChange: (e) => field.onChange(e),
4369
- label: /* @__PURE__ */ import_react17.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-0.5 hawa-whitespace-nowrap hawa-flex-wrap" }, (texts == null ? void 0 : texts.iAcceptText) || "I accept the", " ", /* @__PURE__ */ import_react17.default.createElement(StopPropagationWrapper, null, /* @__PURE__ */ import_react17.default.createElement(
4370
- "span",
4371
- {
4372
- onClick: (e) => {
4373
- e.preventDefault();
4374
- if (props.onRouteToTOS) {
4375
- props.onRouteToTOS();
4376
- }
4377
- },
4378
- className: "clickable-link"
4379
- },
4380
- (texts == null ? void 0 : texts.termsText) || "Terms of Service"
4381
- )))
5000
+ id: "newsletter_accepted",
5001
+ label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
5002
+ onCheckedChange: field.onChange
4382
5003
  }
4383
- );
5004
+ )
4384
5005
  }
4385
- }
4386
- ), showNewsletterOption && /* @__PURE__ */ import_react17.default.createElement(
4387
- import_react_hook_form2.Controller,
4388
- {
4389
- control,
4390
- name: "newsletter_accepted",
4391
- render: ({ field }) => /* @__PURE__ */ import_react17.default.createElement(
4392
- Checkbox,
4393
- {
4394
- id: "newsletter_accepted",
4395
- label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
4396
- onCheckedChange: field.onChange
4397
- }
4398
- )
4399
- }
4400
- )) : null,
4401
- /* @__PURE__ */ import_react17.default.createElement(
5006
+ )) : null
5007
+ ),
5008
+ /* @__PURE__ */ import_react37.default.createElement(
4402
5009
  Button,
4403
5010
  {
4404
5011
  className: "hawa-w-full",
@@ -4409,37 +5016,37 @@ var RegisterForm = ({
4409
5016
  (texts == null ? void 0 : texts.registerText) || "Register"
4410
5017
  ),
4411
5018
  props.additionalButtons
4412
- )), props.onRouteToLogin && /* @__PURE__ */ import_react17.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-1 hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-white" }, /* @__PURE__ */ import_react17.default.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ import_react17.default.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))),
4413
- props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react17.default.createElement(
4414
- CardFooter,
4415
- {
4416
- noPadding: props.cardless,
4417
- className: cn(
4418
- props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
4419
- )
4420
- },
4421
- /* @__PURE__ */ import_react17.default.createElement(
4422
- AuthButtons,
4423
- {
4424
- texts: thirdPartyAuthTexts,
4425
- viaGoogle: props.viaGoogle,
4426
- viaGithub: props.viaGithub,
4427
- viaTwitter: props.viaTwitter,
4428
- isGoogleLoading: props.isGoogleLoading,
4429
- isGithubLoading: props.isGithubLoading,
4430
- isTwitterLoading: props.isTwitterLoading,
4431
- handleGoogle: props.onGoogleRegister,
4432
- handleGithub: props.onGithubRegister,
4433
- handleTwitter: props.onTwitterRegister
4434
- }
5019
+ )), props.onRouteToLogin && /* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-1 hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-white" }, /* @__PURE__ */ import_react37.default.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ import_react37.default.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))
5020
+ ),
5021
+ props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react37.default.createElement(
5022
+ CardFooter,
5023
+ {
5024
+ noPadding: props.cardless,
5025
+ className: cn(
5026
+ props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
4435
5027
  )
4436
- ) : null
4437
- )
4438
- );
5028
+ },
5029
+ /* @__PURE__ */ import_react37.default.createElement(
5030
+ AuthButtons,
5031
+ {
5032
+ texts: thirdPartyAuthTexts,
5033
+ viaGoogle: props.viaGoogle,
5034
+ viaGithub: props.viaGithub,
5035
+ viaTwitter: props.viaTwitter,
5036
+ isGoogleLoading: props.isGoogleLoading,
5037
+ isGithubLoading: props.isGithubLoading,
5038
+ isTwitterLoading: props.isTwitterLoading,
5039
+ handleGoogle: props.onGoogleRegister,
5040
+ handleGithub: props.onGithubRegister,
5041
+ handleTwitter: props.onTwitterRegister
5042
+ }
5043
+ )
5044
+ ) : null
5045
+ ));
4439
5046
  };
4440
5047
 
4441
5048
  // blocks/auth/AppLanding.tsx
4442
- var import_react18 = __toESM(require("react"));
5049
+ var import_react38 = __toESM(require("react"));
4443
5050
  var AppLanding = ({ texts, ...props }) => {
4444
5051
  const thirdPartyAuthTexts = {
4445
5052
  continueWithGoogle: texts == null ? void 0 : texts.continueWithGoogle,
@@ -4450,7 +5057,7 @@ var AppLanding = ({ texts, ...props }) => {
4450
5057
  continueWithEmail: texts == null ? void 0 : texts.continueWithEmail,
4451
5058
  continueWithPhone: texts == null ? void 0 : texts.continueWithPhone
4452
5059
  };
4453
- return /* @__PURE__ */ import_react18.default.createElement("div", { dir: props.direction }, /* @__PURE__ */ import_react18.default.createElement(Card, null, /* @__PURE__ */ import_react18.default.createElement(CardContent, { headless: true, className: "hawa-flex hawa-flex-col hawa-gap-6" }, /* @__PURE__ */ import_react18.default.createElement(
5060
+ return /* @__PURE__ */ import_react38.default.createElement("div", { dir: props.direction }, /* @__PURE__ */ import_react38.default.createElement(Card, null, /* @__PURE__ */ import_react38.default.createElement(CardContent, { headless: true, className: "hawa-flex hawa-flex-col hawa-gap-6" }, /* @__PURE__ */ import_react38.default.createElement(
4454
5061
  AuthButtons,
4455
5062
  {
4456
5063
  texts: thirdPartyAuthTexts,
@@ -4469,7 +5076,7 @@ var AppLanding = ({ texts, ...props }) => {
4469
5076
  handleEmail: props.handleEmail,
4470
5077
  handlePhone: props.handlePhone
4471
5078
  }
4472
- ), props.allowRegister && /* @__PURE__ */ import_react18.default.createElement("div", { className: "hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, texts == null ? void 0 : texts.newUserText, " ", /* @__PURE__ */ import_react18.default.createElement(
5079
+ ), props.allowRegister && /* @__PURE__ */ import_react38.default.createElement("div", { className: "hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, texts == null ? void 0 : texts.newUserText, " ", /* @__PURE__ */ import_react38.default.createElement(
4473
5080
  "span",
4474
5081
  {
4475
5082
  onClick: props.handleRouteToRegister,
@@ -4480,9 +5087,9 @@ var AppLanding = ({ texts, ...props }) => {
4480
5087
  };
4481
5088
 
4482
5089
  // blocks/auth/CheckEmail.tsx
4483
- var import_react19 = __toESM(require("react"));
5090
+ var import_react39 = __toESM(require("react"));
4484
5091
  var CheckEmail = ({ texts, handleResend }) => {
4485
- return /* @__PURE__ */ import_react19.default.createElement(Card, null, /* @__PURE__ */ import_react19.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react19.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center hawa-text-center" }, /* @__PURE__ */ import_react19.default.createElement("div", { className: "hawa-flex hawa-h-16 hawa-w-16 hawa-flex-col hawa-items-center hawa-justify-center hawa-rounded-3xl hawa-bg-primary hawa-text-6xl hawa-font-bold hawa-text-primary-foreground" }, /* @__PURE__ */ import_react19.default.createElement(
5092
+ return /* @__PURE__ */ import_react39.default.createElement(Card, null, /* @__PURE__ */ import_react39.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react39.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center hawa-text-center" }, /* @__PURE__ */ import_react39.default.createElement("div", { className: "hawa-flex hawa-h-16 hawa-w-16 hawa-flex-col hawa-items-center hawa-justify-center hawa-rounded-3xl hawa-bg-primary hawa-text-6xl hawa-font-bold hawa-text-primary-foreground" }, /* @__PURE__ */ import_react39.default.createElement(
4486
5093
  "svg",
4487
5094
  {
4488
5095
  stroke: "currentColor",
@@ -4495,13 +5102,13 @@ var CheckEmail = ({ texts, handleResend }) => {
4495
5102
  width: "0.5em",
4496
5103
  xmlns: "http://www.w3.org/2000/svg"
4497
5104
  },
4498
- /* @__PURE__ */ import_react19.default.createElement("path", { d: "M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" }),
4499
- /* @__PURE__ */ import_react19.default.createElement("polyline", { points: "22,6 12,13 2,6" })
4500
- )), /* @__PURE__ */ import_react19.default.createElement("div", { className: "hawa-m-2 hawa-text-xl hawa-font-bold" }, (texts == null ? void 0 : texts.checkEmail) || "Check your Email"), /* @__PURE__ */ import_react19.default.createElement("div", { className: "hawa-text-sm" }, (texts == null ? void 0 : texts.pleaseVerify) || "Thank you for signing up! To complete your registration, we've sent a verification email to the address you provided. Please check your inbox and follow the instructions in the email to activate your account."))), /* @__PURE__ */ import_react19.default.createElement(CardFooter, { className: "hawa-flex hawa-flex-col hawa-justify-center" }, /* @__PURE__ */ import_react19.default.createElement("span", { className: "clickable-link hawa-text-sm", onClick: handleResend }, (texts == null ? void 0 : texts.resendEmail) || "Resend Email")));
5105
+ /* @__PURE__ */ import_react39.default.createElement("path", { d: "M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" }),
5106
+ /* @__PURE__ */ import_react39.default.createElement("polyline", { points: "22,6 12,13 2,6" })
5107
+ )), /* @__PURE__ */ import_react39.default.createElement("div", { className: "hawa-m-2 hawa-text-xl hawa-font-bold" }, (texts == null ? void 0 : texts.checkEmail) || "Check your Email"), /* @__PURE__ */ import_react39.default.createElement("div", { className: "hawa-text-sm" }, (texts == null ? void 0 : texts.pleaseVerify) || "Thank you for signing up! To complete your registration, we've sent a verification email to the address you provided. Please check your inbox and follow the instructions in the email to activate your account."))), /* @__PURE__ */ import_react39.default.createElement(CardFooter, { className: "hawa-flex hawa-flex-col hawa-justify-center" }, /* @__PURE__ */ import_react39.default.createElement("span", { className: "clickable-link hawa-text-sm", onClick: handleResend }, (texts == null ? void 0 : texts.resendEmail) || "Resend Email")));
4501
5108
  };
4502
5109
 
4503
5110
  // blocks/auth/NewPassword.tsx
4504
- var import_react20 = __toESM(require("react"));
5111
+ var import_react40 = __toESM(require("react"));
4505
5112
  var import_react_hook_form3 = require("react-hook-form");
4506
5113
  var import_zod3 = require("@hookform/resolvers/zod");
4507
5114
  var z3 = __toESM(require("zod"));
@@ -4523,7 +5130,7 @@ var NewPasswordForm = ({
4523
5130
  const { handleSubmit, control, formState } = (0, import_react_hook_form3.useForm)({
4524
5131
  resolver: (0, import_zod3.zodResolver)(formSchema)
4525
5132
  });
4526
- return /* @__PURE__ */ import_react20.default.createElement(Card, { dir: props.direction }, props.showSuccess ? /* @__PURE__ */ import_react20.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react20.default.createElement("div", { className: "hawa-text-center" }, texts == null ? void 0 : texts.passwordChanged)) : /* @__PURE__ */ import_react20.default.createElement(
5133
+ return /* @__PURE__ */ import_react40.default.createElement(Card, { dir: props.direction }, props.showSuccess ? /* @__PURE__ */ import_react40.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react40.default.createElement("div", { className: "hawa-text-center" }, texts == null ? void 0 : texts.passwordChanged)) : /* @__PURE__ */ import_react40.default.createElement(
4527
5134
  "form",
4528
5135
  {
4529
5136
  noValidate: true,
@@ -4537,7 +5144,7 @@ var NewPasswordForm = ({
4537
5144
  }
4538
5145
  })
4539
5146
  },
4540
- /* @__PURE__ */ import_react20.default.createElement(CardContent, { headless: true, className: "hawa-flex hawa-flex-col" }, props.showError && /* @__PURE__ */ import_react20.default.createElement(
5147
+ /* @__PURE__ */ import_react40.default.createElement(CardContent, { headless: true, className: "hawa-flex hawa-flex-col" }, props.showError && /* @__PURE__ */ import_react40.default.createElement(
4541
5148
  Alert,
4542
5149
  {
4543
5150
  direction: props.direction,
@@ -4545,14 +5152,14 @@ var NewPasswordForm = ({
4545
5152
  text: props.errorText,
4546
5153
  severity: "error"
4547
5154
  }
4548
- ), /* @__PURE__ */ import_react20.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4 hawa-mb-4" }, /* @__PURE__ */ import_react20.default.createElement(
5155
+ ), /* @__PURE__ */ import_react40.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4 hawa-mb-4" }, /* @__PURE__ */ import_react40.default.createElement(
4549
5156
  import_react_hook_form3.Controller,
4550
5157
  {
4551
5158
  control,
4552
5159
  name: "password",
4553
5160
  render: ({ field }) => {
4554
5161
  var _a2, _b2, _c2;
4555
- return /* @__PURE__ */ import_react20.default.createElement(
5162
+ return /* @__PURE__ */ import_react40.default.createElement(
4556
5163
  Input,
4557
5164
  {
4558
5165
  width: "full",
@@ -4566,14 +5173,14 @@ var NewPasswordForm = ({
4566
5173
  );
4567
5174
  }
4568
5175
  }
4569
- ), /* @__PURE__ */ import_react20.default.createElement(
5176
+ ), /* @__PURE__ */ import_react40.default.createElement(
4570
5177
  import_react_hook_form3.Controller,
4571
5178
  {
4572
5179
  control,
4573
5180
  name: "confirm_password",
4574
5181
  render: ({ field }) => {
4575
5182
  var _a2, _b2, _c2;
4576
- return /* @__PURE__ */ import_react20.default.createElement(
5183
+ return /* @__PURE__ */ import_react40.default.createElement(
4577
5184
  Input,
4578
5185
  {
4579
5186
  width: "full",
@@ -4587,7 +5194,7 @@ var NewPasswordForm = ({
4587
5194
  );
4588
5195
  }
4589
5196
  }
4590
- )), /* @__PURE__ */ import_react20.default.createElement(Button, { className: "hawa-w-full", type: "submit", isLoading }, texts == null ? void 0 : texts.updatePassword), props.allowRegister && /* @__PURE__ */ import_react20.default.createElement("div", { className: "hawa-mt-4 hawa-pb-0 hawa-text-center hawa-text-sm dark:hawa-text-gray-300" }, (_g = texts == null ? void 0 : texts.dontHaveAccount) != null ? _g : "Don't have an account? ", /* @__PURE__ */ import_react20.default.createElement(
5197
+ )), /* @__PURE__ */ import_react40.default.createElement(Button, { className: "hawa-w-full", type: "submit", isLoading }, texts == null ? void 0 : texts.updatePassword), props.allowRegister && /* @__PURE__ */ import_react40.default.createElement("div", { className: "hawa-mt-4 hawa-pb-0 hawa-text-center hawa-text-sm dark:hawa-text-gray-300" }, (_g = texts == null ? void 0 : texts.dontHaveAccount) != null ? _g : "Don't have an account? ", /* @__PURE__ */ import_react40.default.createElement(
4591
5198
  "span",
4592
5199
  {
4593
5200
  className: "clickable-link",
@@ -4599,7 +5206,7 @@ var NewPasswordForm = ({
4599
5206
  };
4600
5207
 
4601
5208
  // blocks/auth/ResetPassword.tsx
4602
- var import_react21 = __toESM(require("react"));
5209
+ var import_react41 = __toESM(require("react"));
4603
5210
  var import_react_hook_form4 = require("react-hook-form");
4604
5211
  var import_zod4 = require("@hookform/resolvers/zod");
4605
5212
  var z4 = __toESM(require("zod"));
@@ -4617,7 +5224,7 @@ var ResetPasswordForm = ({
4617
5224
  const { handleSubmit, control, formState } = (0, import_react_hook_form4.useForm)({
4618
5225
  resolver: (0, import_zod4.zodResolver)(formSchema)
4619
5226
  });
4620
- return /* @__PURE__ */ import_react21.default.createElement(Card, { dir: props.direction }, !props.sent ? /* @__PURE__ */ import_react21.default.createElement(import_react21.default.Fragment, null, !props.headless && /* @__PURE__ */ import_react21.default.createElement(CardHeader, null, /* @__PURE__ */ import_react21.default.createElement(CardTitle, null, ((_g = props.texts) == null ? void 0 : _g.headTitle) || "Reset Password"), /* @__PURE__ */ import_react21.default.createElement(CardDescription, null, ((_h = props.texts) == null ? void 0 : _h.headDescription) || "Enter your email to reset your account password")), /* @__PURE__ */ import_react21.default.createElement(
5227
+ return /* @__PURE__ */ import_react41.default.createElement(Card, { dir: props.direction }, !props.sent ? /* @__PURE__ */ import_react41.default.createElement(import_react41.default.Fragment, null, !props.headless && /* @__PURE__ */ import_react41.default.createElement(CardHeader, null, /* @__PURE__ */ import_react41.default.createElement(CardTitle, null, ((_g = props.texts) == null ? void 0 : _g.headTitle) || "Reset Password"), /* @__PURE__ */ import_react41.default.createElement(CardDescription, null, ((_h = props.texts) == null ? void 0 : _h.headDescription) || "Enter your email to reset your account password")), /* @__PURE__ */ import_react41.default.createElement(
4621
5228
  "form",
4622
5229
  {
4623
5230
  noValidate: true,
@@ -4629,7 +5236,7 @@ var ResetPasswordForm = ({
4629
5236
  }
4630
5237
  })
4631
5238
  },
4632
- /* @__PURE__ */ import_react21.default.createElement(CardContent, { headless: props.headless, className: "hawa-pb-4" }, props.showError && /* @__PURE__ */ import_react21.default.createElement(
5239
+ /* @__PURE__ */ import_react41.default.createElement(CardContent, { headless: props.headless, className: "hawa-pb-4" }, props.showError && /* @__PURE__ */ import_react41.default.createElement(
4633
5240
  Alert,
4634
5241
  {
4635
5242
  direction: props.direction,
@@ -4637,14 +5244,14 @@ var ResetPasswordForm = ({
4637
5244
  text: props.errorText,
4638
5245
  severity: "error"
4639
5246
  }
4640
- ), /* @__PURE__ */ import_react21.default.createElement(
5247
+ ), /* @__PURE__ */ import_react41.default.createElement(
4641
5248
  import_react_hook_form4.Controller,
4642
5249
  {
4643
5250
  control,
4644
5251
  name: "email",
4645
5252
  render: ({ field }) => {
4646
5253
  var _a2, _b2, _c2, _d2, _e2;
4647
- return /* @__PURE__ */ import_react21.default.createElement(
5254
+ return /* @__PURE__ */ import_react41.default.createElement(
4648
5255
  Input,
4649
5256
  {
4650
5257
  width: "full",
@@ -4660,7 +5267,7 @@ var ResetPasswordForm = ({
4660
5267
  }
4661
5268
  }
4662
5269
  )),
4663
- /* @__PURE__ */ import_react21.default.createElement(CardFooter, { className: "hawa-flex hawa-flex-col" }, /* @__PURE__ */ import_react21.default.createElement(
5270
+ /* @__PURE__ */ import_react41.default.createElement(CardFooter, { className: "hawa-flex hawa-flex-col" }, /* @__PURE__ */ import_react41.default.createElement(
4664
5271
  Button,
4665
5272
  {
4666
5273
  type: "submit",
@@ -4668,7 +5275,7 @@ var ResetPasswordForm = ({
4668
5275
  isLoading
4669
5276
  },
4670
5277
  ((_i = props.texts) == null ? void 0 : _i.resetPassword) || "Reset Password"
4671
- ), allowRegister && /* @__PURE__ */ import_react21.default.createElement("div", { className: "hawa-mt-4 hawa-pb-0 hawa-text-center hawa-text-sm dark:hawa-text-gray-300" }, (_k = (_j = props.texts) == null ? void 0 : _j.dontHaveAccount) != null ? _k : "Don't have an account? ", /* @__PURE__ */ import_react21.default.createElement(
5278
+ ), allowRegister && /* @__PURE__ */ import_react41.default.createElement("div", { className: "hawa-mt-4 hawa-pb-0 hawa-text-center hawa-text-sm dark:hawa-text-gray-300" }, (_k = (_j = props.texts) == null ? void 0 : _j.dontHaveAccount) != null ? _k : "Don't have an account? ", /* @__PURE__ */ import_react41.default.createElement(
4672
5279
  "span",
4673
5280
  {
4674
5281
  className: "clickable-link",
@@ -4676,21 +5283,21 @@ var ResetPasswordForm = ({
4676
5283
  },
4677
5284
  (_m = (_l = props.texts) == null ? void 0 : _l.registerText) != null ? _m : "Register"
4678
5285
  )))
4679
- )) : /* @__PURE__ */ import_react21.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react21.default.createElement("div", { className: "hawa-text-center" }, ((_n = props.texts) == null ? void 0 : _n.emailSentText) || "An email has been sent with a link to set a new password")));
5286
+ )) : /* @__PURE__ */ import_react41.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react41.default.createElement("div", { className: "hawa-text-center" }, ((_n = props.texts) == null ? void 0 : _n.emailSentText) || "An email has been sent with a link to set a new password")));
4680
5287
  };
4681
5288
 
4682
5289
  // blocks/auth/CodeConfirmation.tsx
4683
- var import_react24 = __toESM(require("react"));
5290
+ var import_react44 = __toESM(require("react"));
4684
5291
  var import_react_hook_form5 = require("react-hook-form");
4685
5292
  var import_zod5 = require("@hookform/resolvers/zod");
4686
5293
  var z5 = __toESM(require("zod"));
4687
5294
 
4688
5295
  // elements/pinInput/PinInput.tsx
4689
- var React25 = __toESM(require("react"));
5296
+ var React36 = __toESM(require("react"));
4690
5297
  var import_input_otp = require("input-otp");
4691
5298
 
4692
5299
  // ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
4693
- var import_react23 = require("react");
5300
+ var import_react43 = require("react");
4694
5301
 
4695
5302
  // ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
4696
5303
  var toKebabCase = (string6) => string6.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
@@ -4699,7 +5306,7 @@ var mergeClasses = (...classes) => classes.filter((className, index, array) => {
4699
5306
  }).join(" ");
4700
5307
 
4701
5308
  // ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
4702
- var import_react22 = require("react");
5309
+ var import_react42 = require("react");
4703
5310
 
4704
5311
  // ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
4705
5312
  var defaultAttributes = {
@@ -4715,7 +5322,7 @@ var defaultAttributes = {
4715
5322
  };
4716
5323
 
4717
5324
  // ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
4718
- var Icon = (0, import_react22.forwardRef)(
5325
+ var Icon = (0, import_react42.forwardRef)(
4719
5326
  ({
4720
5327
  color = "currentColor",
4721
5328
  size = 24,
@@ -4726,7 +5333,7 @@ var Icon = (0, import_react22.forwardRef)(
4726
5333
  iconNode,
4727
5334
  ...rest
4728
5335
  }, ref) => {
4729
- return (0, import_react22.createElement)(
5336
+ return (0, import_react42.createElement)(
4730
5337
  "svg",
4731
5338
  {
4732
5339
  ref,
@@ -4739,7 +5346,7 @@ var Icon = (0, import_react22.forwardRef)(
4739
5346
  ...rest
4740
5347
  },
4741
5348
  [
4742
- ...iconNode.map(([tag, attrs]) => (0, import_react22.createElement)(tag, attrs)),
5349
+ ...iconNode.map(([tag, attrs]) => (0, import_react42.createElement)(tag, attrs)),
4743
5350
  ...Array.isArray(children) ? children : [children]
4744
5351
  ]
4745
5352
  );
@@ -4748,8 +5355,8 @@ var Icon = (0, import_react22.forwardRef)(
4748
5355
 
4749
5356
  // ../../node_modules/.pnpm/lucide-react@0.427.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
4750
5357
  var createLucideIcon = (iconName, iconNode) => {
4751
- const Component = (0, import_react23.forwardRef)(
4752
- ({ className, ...props }, ref) => (0, import_react23.createElement)(Icon, {
5358
+ const Component = (0, import_react43.forwardRef)(
5359
+ ({ className, ...props }, ref) => (0, import_react43.createElement)(Icon, {
4753
5360
  ref,
4754
5361
  iconNode,
4755
5362
  className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
@@ -4766,7 +5373,7 @@ var Dot = createLucideIcon("Dot", [
4766
5373
  ]);
4767
5374
 
4768
5375
  // elements/pinInput/PinInput.tsx
4769
- var PinInputRoot = React25.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ React25.createElement(
5376
+ var PinInputRoot = React36.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ React36.createElement(
4770
5377
  import_input_otp.OTPInput,
4771
5378
  {
4772
5379
  ref,
@@ -4779,19 +5386,12 @@ var PinInputRoot = React25.forwardRef(({ className, containerClassName, ...props
4779
5386
  }
4780
5387
  ));
4781
5388
  PinInputRoot.displayName = "PinInputRoot";
4782
- var PinInputGroup = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React25.createElement(
4783
- "div",
4784
- {
4785
- ref,
4786
- className: cn("hawa-flex hawa-items-center", className),
4787
- ...props
4788
- }
4789
- ));
5389
+ var PinInputGroup = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React36.createElement("div", { ref, className: cn("hawa-flex hawa-items-center", className), ...props }));
4790
5390
  PinInputGroup.displayName = "PinInputGroup";
4791
- var PinInputSlot = React25.forwardRef(({ index, className, ...props }, ref) => {
4792
- const pinInputContext = React25.useContext(import_input_otp.OTPInputContext);
5391
+ var PinInputSlot = React36.forwardRef(({ index, className, ...props }, ref) => {
5392
+ const pinInputContext = React36.useContext(import_input_otp.OTPInputContext);
4793
5393
  const { char, hasFakeCaret, isActive } = pinInputContext.slots[index];
4794
- return /* @__PURE__ */ React25.createElement(
5394
+ return /* @__PURE__ */ React36.createElement(
4795
5395
  "div",
4796
5396
  {
4797
5397
  ref,
@@ -4803,42 +5403,29 @@ var PinInputSlot = React25.forwardRef(({ index, className, ...props }, ref) => {
4803
5403
  ...props
4804
5404
  },
4805
5405
  char,
4806
- hasFakeCaret && /* @__PURE__ */ React25.createElement("div", { className: "hawa-pointer-events-none hawa-absolute hawa-inset-0 hawa-flex hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React25.createElement("div", { className: "hawa-animate-caret-blink hawa-bg-foreground hawa-h-4 hawa-w-px hawa-duration-1000" }))
5406
+ hasFakeCaret && /* @__PURE__ */ React36.createElement("div", { className: "hawa-pointer-events-none hawa-absolute hawa-inset-0 hawa-flex hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React36.createElement("div", { className: "hawa-animate-caret-blink hawa-bg-foreground hawa-h-4 hawa-w-px hawa-duration-1000" }))
4807
5407
  );
4808
5408
  });
4809
5409
  PinInputSlot.displayName = "PinInputSlot";
4810
- var PinInputSeperator = React25.forwardRef(({ ...props }, ref) => /* @__PURE__ */ React25.createElement("div", { ref, role: "separator", ...props }, /* @__PURE__ */ React25.createElement(Dot, null)));
5410
+ var PinInputSeperator = React36.forwardRef(({ ...props }, ref) => /* @__PURE__ */ React36.createElement("div", { ref, role: "separator", ...props }, /* @__PURE__ */ React36.createElement(Dot, null)));
4811
5411
  PinInputSeperator.displayName = "PinInputSeperator";
4812
- var PinInput = ({
4813
- separatorPosition = 0,
4814
- ...props
4815
- }) => {
5412
+ var PinInput = ({ separatorPosition = 0, ...props }) => {
4816
5413
  const maxLength = props.maxLength || 6;
4817
5414
  const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);
4818
5415
  const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;
4819
5416
  const secondGroupLength = maxLength - firstGroupLength;
4820
- return /* @__PURE__ */ React25.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React25.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React25.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React25.createElement(
4821
- PinInputSlot,
4822
- {
4823
- key: index,
4824
- index,
4825
- className: "hawa-w-full hawa-border"
4826
- }
4827
- ))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React25.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React25.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React25.createElement(
5417
+ return /* @__PURE__ */ React36.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2", dir: "ltr" }, /* @__PURE__ */ React36.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React36.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React36.createElement(PinInputSlot, { key: index, index, className: "hawa-w-full hawa-border" }))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React36.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React36.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React36.createElement(
4828
5418
  PinInputSlot,
4829
5419
  {
4830
5420
  key: index + firstGroupLength,
4831
5421
  index: index + firstGroupLength,
4832
5422
  className: "hawa-w-full hawa-border"
4833
5423
  }
4834
- )))), /* @__PURE__ */ React25.createElement(HelperText, { helperText: props.helperText }));
5424
+ )))), /* @__PURE__ */ React36.createElement(HelperText, { helperText: props.helperText }));
4835
5425
  };
4836
5426
 
4837
5427
  // blocks/auth/CodeConfirmation.tsx
4838
- var CodeConfirmation = ({
4839
- codeLength = 6,
4840
- ...props
4841
- }) => {
5428
+ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
4842
5429
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
4843
5430
  const formSchema = z5.object({
4844
5431
  otp_code: z5.string({ required_error: (_a = props.texts) == null ? void 0 : _a.codeRequiredText }).min(codeLength, { message: (_b = props.texts) == null ? void 0 : _b.codeTooShort })
@@ -4846,9 +5433,9 @@ var CodeConfirmation = ({
4846
5433
  const { handleSubmit, control, formState, setValue } = (0, import_react_hook_form5.useForm)({
4847
5434
  resolver: (0, import_zod5.zodResolver)(formSchema)
4848
5435
  });
4849
- const [resendTimer, setResendTimer] = (0, import_react24.useState)(null);
4850
- const [remainingTime, setRemainingTime] = (0, import_react24.useState)(0);
4851
- const [showResendTimer, setShowResendTimer] = (0, import_react24.useState)(false);
5436
+ const [resendTimer, setResendTimer] = (0, import_react44.useState)(null);
5437
+ const [remainingTime, setRemainingTime] = (0, import_react44.useState)(0);
5438
+ const [showResendTimer, setShowResendTimer] = (0, import_react44.useState)(false);
4852
5439
  const startResendTimer = () => {
4853
5440
  if (resendTimer !== null) {
4854
5441
  clearInterval(resendTimer);
@@ -4870,21 +5457,14 @@ var CodeConfirmation = ({
4870
5457
  }, 1e3);
4871
5458
  setResendTimer(newTimer);
4872
5459
  };
4873
- (0, import_react24.useEffect)(() => {
5460
+ (0, import_react44.useEffect)(() => {
4874
5461
  return () => {
4875
5462
  if (resendTimer !== null) {
4876
5463
  clearInterval(resendTimer);
4877
5464
  }
4878
5465
  };
4879
5466
  }, []);
4880
- return /* @__PURE__ */ import_react24.default.createElement(Card, null, /* @__PURE__ */ import_react24.default.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ import_react24.default.createElement(
4881
- Alert,
4882
- {
4883
- title: props.errorTitle,
4884
- text: props.errorText,
4885
- severity: "error"
4886
- }
4887
- ), /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourPhone) || "Please check your phone"), /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-text-muted-foreground" }, /* @__PURE__ */ import_react24.default.createElement("span", null, ((_d = props.texts) == null ? void 0 : _d.weSentCode) || "We've sent a code to "), /* @__PURE__ */ import_react24.default.createElement("span", null, props.phoneNumber))), /* @__PURE__ */ import_react24.default.createElement(
5467
+ return /* @__PURE__ */ import_react44.default.createElement(Card, null, /* @__PURE__ */ import_react44.default.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ import_react44.default.createElement(Alert, { title: props.errorTitle, text: props.errorText, severity: "error" }), /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourIdentifier) || "Please check your phone"), /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-text-muted-foreground" }, /* @__PURE__ */ import_react44.default.createElement("span", null, ((_d = props.texts) == null ? void 0 : _d.weSentCode) || "We've sent a code to "), /* @__PURE__ */ import_react44.default.createElement("span", null, props.identifier))), /* @__PURE__ */ import_react44.default.createElement(
4888
5468
  "form",
4889
5469
  {
4890
5470
  noValidate: true,
@@ -4896,14 +5476,14 @@ var CodeConfirmation = ({
4896
5476
  }
4897
5477
  })
4898
5478
  },
4899
- /* @__PURE__ */ import_react24.default.createElement(
5479
+ /* @__PURE__ */ import_react44.default.createElement(
4900
5480
  import_react_hook_form5.Controller,
4901
5481
  {
4902
5482
  control,
4903
5483
  name: "otp_code",
4904
5484
  render: ({ field }) => {
4905
5485
  var _a2;
4906
- return /* @__PURE__ */ import_react24.default.createElement(
5486
+ return /* @__PURE__ */ import_react44.default.createElement(
4907
5487
  PinInput,
4908
5488
  {
4909
5489
  maxLength: codeLength,
@@ -4914,7 +5494,7 @@ var CodeConfirmation = ({
4914
5494
  }
4915
5495
  }
4916
5496
  ),
4917
- showResendTimer ? /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, (_e = props.texts) == null ? void 0 : _e.resendCodeTimer, " ", /* @__PURE__ */ import_react24.default.createElement("strong", null, remainingTime), " ", (_f = props.texts) == null ? void 0 : _f.seconds) : /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, /* @__PURE__ */ import_react24.default.createElement("span", null, (_h = (_g = props.texts) == null ? void 0 : _g.didntGetCode) != null ? _h : "Didn't get the code?"), " ", /* @__PURE__ */ import_react24.default.createElement(
5497
+ showResendTimer ? /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, (_e = props.texts) == null ? void 0 : _e.resendCodeTimer, " ", /* @__PURE__ */ import_react44.default.createElement("strong", null, remainingTime), " ", (_f = props.texts) == null ? void 0 : _f.seconds) : /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, /* @__PURE__ */ import_react44.default.createElement("span", null, (_h = (_g = props.texts) == null ? void 0 : _g.didntGetCode) != null ? _h : "Didn't get the code?"), " ", /* @__PURE__ */ import_react44.default.createElement(
4918
5498
  "span",
4919
5499
  {
4920
5500
  className: "clickable-link",
@@ -4925,7 +5505,7 @@ var CodeConfirmation = ({
4925
5505
  },
4926
5506
  ((_i = props.texts) == null ? void 0 : _i.resendCode) || "Click to resend"
4927
5507
  )),
4928
- /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-mt-4 hawa-grid hawa-grid-cols-2 hawa-gap-2" }, /* @__PURE__ */ import_react24.default.createElement(
5508
+ /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-mt-4 hawa-grid hawa-grid-cols-2 hawa-gap-2" }, /* @__PURE__ */ import_react44.default.createElement(
4929
5509
  Button,
4930
5510
  {
4931
5511
  type: "button",
@@ -4933,15 +5513,13 @@ var CodeConfirmation = ({
4933
5513
  if (props.onCancel) {
4934
5514
  return props.onCancel();
4935
5515
  } else {
4936
- console.log(
4937
- "Cancel button clicked but onCancel prop is missing"
4938
- );
5516
+ console.log("Cancel button clicked but onCancel prop is missing");
4939
5517
  }
4940
5518
  },
4941
5519
  variant: "outline"
4942
5520
  },
4943
5521
  ((_j = props.texts) == null ? void 0 : _j.cancel) || "Cancel"
4944
- ), /* @__PURE__ */ import_react24.default.createElement(Button, { isLoading: props.confirmLoading }, ((_k = props.texts) == null ? void 0 : _k.confirm) || "Confirm"))
5522
+ ), /* @__PURE__ */ import_react44.default.createElement(Button, { isLoading: props.confirmLoading }, ((_k = props.texts) == null ? void 0 : _k.confirm) || "Confirm"))
4945
5523
  )));
4946
5524
  };
4947
5525
  // Annotate the CommonJS export names for ESM import in node: