docthub-core-components 3.3.11 → 3.3.12
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.
|
@@ -1,205 +1,205 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { c as
|
|
4
|
-
import { ChevronsUpDown as
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
7
|
-
import { isPossiblePhoneNumber as
|
|
8
|
-
import
|
|
9
|
-
import { CommandInput as
|
|
10
|
-
import { Input as
|
|
11
|
-
import { Label as
|
|
12
|
-
import { PopoverTrigger as
|
|
13
|
-
import { cn as
|
|
14
|
-
import { DoctTypography as
|
|
15
|
-
const
|
|
2
|
+
import { jsx as a, jsxs as B, Fragment as De } from "react/jsx-runtime";
|
|
3
|
+
import { c as ge } from "react-compiler-runtime";
|
|
4
|
+
import { ChevronsUpDown as Te, CheckIcon as Ae } from "lucide-react";
|
|
5
|
+
import * as P from "react";
|
|
6
|
+
import * as ke from "react-phone-number-input";
|
|
7
|
+
import { isPossiblePhoneNumber as pt, isValidPhoneNumber as yt } from "react-phone-number-input";
|
|
8
|
+
import Be from "react-phone-number-input/flags";
|
|
9
|
+
import { CommandInput as Le, CommandEmpty as Ve, CommandList as ze, CommandGroup as Ge, Command as Ue, CommandItem as qe } from "../../../ui/command.js";
|
|
10
|
+
import { Input as Me } from "../../../ui/input.js";
|
|
11
|
+
import { Label as Xe } from "../../../ui/label.js";
|
|
12
|
+
import { PopoverTrigger as He, PopoverContent as Je, Popover as Ke } from "../../../ui/popover.js";
|
|
13
|
+
import { cn as ee } from "../../../../lib/utils.js";
|
|
14
|
+
import { DoctTypography as _e } from "../../../ui/typography.js";
|
|
15
|
+
const Qe = /\D/g, te = (r) => r.replace(Qe, ""), Fe = (r) => {
|
|
16
16
|
const e = r.match(/^\+\s*(\d+)\s*-\s*(\d*)\s*$/);
|
|
17
17
|
return e ? {
|
|
18
18
|
callingCode: e[1],
|
|
19
19
|
national: e[2]
|
|
20
20
|
} : null;
|
|
21
|
-
},
|
|
21
|
+
}, je = (r) => {
|
|
22
22
|
if (r == null) return "";
|
|
23
|
-
const e = String(r).trim(), t =
|
|
24
|
-
return t ? t.national :
|
|
25
|
-
},
|
|
23
|
+
const e = String(r).trim(), t = Fe(e);
|
|
24
|
+
return t ? t.national : te(e);
|
|
25
|
+
}, q = (r) => {
|
|
26
26
|
if (!r) return "91";
|
|
27
27
|
if (typeof r == "object" && "countryCode" in r)
|
|
28
|
-
return
|
|
28
|
+
return te(r.countryCode) || "91";
|
|
29
29
|
try {
|
|
30
|
-
return
|
|
30
|
+
return ke.getCountryCallingCode(r);
|
|
31
31
|
} catch {
|
|
32
32
|
return "91";
|
|
33
33
|
}
|
|
34
|
-
},
|
|
34
|
+
}, Oe = (r, e) => {
|
|
35
35
|
if (r == null)
|
|
36
36
|
return e && e.length > 0 ? e[0] : "IN";
|
|
37
37
|
if (typeof r == "number" && (e != null && e.length)) {
|
|
38
38
|
const t = e[0];
|
|
39
39
|
if (t && typeof t == "object" && "countryId" in t) {
|
|
40
|
-
const o = e.find((
|
|
40
|
+
const o = e.find((n) => n.countryId === r);
|
|
41
41
|
if (o) return o;
|
|
42
42
|
}
|
|
43
43
|
return e[r];
|
|
44
44
|
}
|
|
45
45
|
return r;
|
|
46
|
-
},
|
|
47
|
-
if (!e) return r ? `+${
|
|
48
|
-
const t =
|
|
46
|
+
}, Re = (r, e) => {
|
|
47
|
+
if (!e) return r ? `+${te(r)}` : "";
|
|
48
|
+
const t = q(e);
|
|
49
49
|
return r ? `+${t}-${r}` : `+${t}`;
|
|
50
|
-
},
|
|
51
|
-
const o =
|
|
52
|
-
if (
|
|
53
|
-
return t &&
|
|
54
|
-
},
|
|
55
|
-
const e =
|
|
50
|
+
}, $e = (r, e) => e ? typeof r == "object" && "countryId" in r && typeof e == "object" && "countryId" in e ? r.countryId === e.countryId : r === e : !1, Se = (r, e, t) => {
|
|
51
|
+
const o = te(e), n = r.map((l) => l.value).filter((l) => !!l).filter((l) => q(l) === o);
|
|
52
|
+
if (n.length !== 0)
|
|
53
|
+
return t && n.some((l) => $e(l, t)) ? t : n[0];
|
|
54
|
+
}, Ee = (r) => {
|
|
55
|
+
const e = ge(5), {
|
|
56
56
|
country: t,
|
|
57
57
|
countryName: o
|
|
58
|
-
} = r,
|
|
59
|
-
let
|
|
60
|
-
e[0] !==
|
|
61
|
-
let
|
|
62
|
-
return e[3] !==
|
|
63
|
-
},
|
|
64
|
-
const e =
|
|
58
|
+
} = r, n = Be[t];
|
|
59
|
+
let l;
|
|
60
|
+
e[0] !== n || e[1] !== o ? (l = n && /* @__PURE__ */ a(n, { title: o }), e[0] = n, e[1] = o, e[2] = l) : l = e[2];
|
|
61
|
+
let s;
|
|
62
|
+
return e[3] !== l ? (s = /* @__PURE__ */ a("span", { className: "flex h-4 w-6 overflow-hidden rounded-sm bg-foreground/20 [&_svg:not([class*='size-'])]:size-full", children: l }), e[3] = l, e[4] = s) : s = e[4], s;
|
|
63
|
+
}, We = (r) => {
|
|
64
|
+
const e = ge(48), {
|
|
65
65
|
disabled: t,
|
|
66
66
|
value: o,
|
|
67
|
-
options:
|
|
68
|
-
onChange:
|
|
69
|
-
showFlagVariant:
|
|
70
|
-
hasError:
|
|
71
|
-
popoverAnchorRef:
|
|
72
|
-
} = r,
|
|
73
|
-
let
|
|
74
|
-
e[0] !== o ? (
|
|
75
|
-
const
|
|
76
|
-
let
|
|
77
|
-
e[2] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
78
|
-
|
|
79
|
-
}, e[2] =
|
|
80
|
-
const
|
|
81
|
-
let
|
|
82
|
-
e[3] !==
|
|
83
|
-
let
|
|
84
|
-
e[6] !== o || e[7] !==
|
|
67
|
+
options: n,
|
|
68
|
+
onChange: l,
|
|
69
|
+
showFlagVariant: s,
|
|
70
|
+
hasError: b,
|
|
71
|
+
popoverAnchorRef: m
|
|
72
|
+
} = r, v = P.useRef(null), [$, N] = P.useState(""), [g, x] = P.useState(!1);
|
|
73
|
+
let c;
|
|
74
|
+
e[0] !== o ? (c = o ? `+${q(o)}` : "+91", e[0] = o, e[1] = c) : c = e[1];
|
|
75
|
+
const y = c;
|
|
76
|
+
let i;
|
|
77
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (i = (S) => {
|
|
78
|
+
x(S), S && N("");
|
|
79
|
+
}, e[2] = i) : i = e[2];
|
|
80
|
+
const d = b ? "border-destructive" : "border-gray-300", C = g && "bg-gray-100";
|
|
81
|
+
let I;
|
|
82
|
+
e[3] !== d || e[4] !== C ? (I = ee("flex h-[40px] items-center gap-1.5 rounded-l-md rounded-r-none border-l-[1px] border-t-[1px] border-b-[1px] bg-white px-3 py-[1px] text-sm font-medium text-gray-900 transition-colors", d, "hover:bg-gray-100 focus:z-10 focus:outline-none", "disabled:cursor-not-allowed disabled:opacity-50", C), e[3] = d, e[4] = C, e[5] = I) : I = e[5];
|
|
83
|
+
let _;
|
|
84
|
+
e[6] !== o || e[7] !== s ? (_ = s && o && typeof o == "string" && /* @__PURE__ */ a("span", { className: "mr-1 flex items-center", children: /* @__PURE__ */ a(Ee, { country: o, countryName: o }) }), e[6] = o, e[7] = s, e[8] = _) : _ = e[8];
|
|
85
85
|
let D;
|
|
86
|
-
e[9] !==
|
|
87
|
-
const
|
|
88
|
-
let
|
|
89
|
-
e[11] !==
|
|
90
|
-
let
|
|
91
|
-
e[13] !==
|
|
92
|
-
let
|
|
93
|
-
e[15] !== t || e[16] !==
|
|
94
|
-
|
|
86
|
+
e[9] !== y ? (D = /* @__PURE__ */ a(_e, { variant: "body2", weight: "regular", className: "text-gray-900", children: y }), e[9] = y, e[10] = D) : D = e[10];
|
|
87
|
+
const L = t && "hidden";
|
|
88
|
+
let u;
|
|
89
|
+
e[11] !== L ? (u = ee("h-4 w-4 text-gray-500 shrink-0", L), e[11] = L, e[12] = u) : u = e[12];
|
|
90
|
+
let z;
|
|
91
|
+
e[13] !== u ? (z = /* @__PURE__ */ a(Te, { className: u }), e[13] = u, e[14] = z) : z = e[14];
|
|
92
|
+
let G;
|
|
93
|
+
e[15] !== t || e[16] !== z || e[17] !== I || e[18] !== _ || e[19] !== D ? (G = /* @__PURE__ */ a(He, { asChild: !0, children: /* @__PURE__ */ B("button", { type: "button", disabled: t, className: I, children: [
|
|
94
|
+
_,
|
|
95
95
|
D,
|
|
96
|
-
|
|
97
|
-
] }) }), e[15] = t, e[16] =
|
|
98
|
-
let
|
|
99
|
-
e[21] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
96
|
+
z
|
|
97
|
+
] }) }), e[15] = t, e[16] = z, e[17] = I, e[18] = _, e[19] = D, e[20] = G) : G = e[20];
|
|
98
|
+
let O;
|
|
99
|
+
e[21] === Symbol.for("react.memo_cache_sentinel") ? (O = {
|
|
100
100
|
side: "flip",
|
|
101
101
|
align: "shift",
|
|
102
102
|
fallbackAxisSide: "none"
|
|
103
|
-
}, e[21] =
|
|
103
|
+
}, e[21] = O) : O = e[21];
|
|
104
104
|
let M;
|
|
105
|
-
e[22] === Symbol.for("react.memo_cache_sentinel") ? (M = (
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
|
|
105
|
+
e[22] === Symbol.for("react.memo_cache_sentinel") ? (M = (S) => {
|
|
106
|
+
N(S), window.setTimeout(() => {
|
|
107
|
+
const U = v.current;
|
|
108
|
+
U && (U.scrollTop = 0);
|
|
109
109
|
}, 0);
|
|
110
110
|
}, e[22] = M) : M = e[22];
|
|
111
|
-
let
|
|
112
|
-
e[23] !==
|
|
113
|
-
let
|
|
114
|
-
e[25] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
111
|
+
let F;
|
|
112
|
+
e[23] !== $ ? (F = /* @__PURE__ */ a("div", { className: "mb-3 h-[32px] rounded-full border border-gray-300 bg-white overflow-hidden [&_[cmdk-input-wrapper]]:h-full [&_[cmdk-input-wrapper]]:px-3 [&_[cmdk-input-wrapper]_svg]:text-gray-500", children: /* @__PURE__ */ a(Le, { value: $, onValueChange: M, placeholder: "Search country..." }) }), e[23] = $, e[24] = F) : F = e[24];
|
|
113
|
+
let R, V;
|
|
114
|
+
e[25] === Symbol.for("react.memo_cache_sentinel") ? (R = {
|
|
115
115
|
msOverflowStyle: "none"
|
|
116
|
-
},
|
|
117
|
-
let
|
|
118
|
-
if (e[27] !==
|
|
119
|
-
let
|
|
120
|
-
e[32] !==
|
|
116
|
+
}, V = /* @__PURE__ */ a(Ve, { children: "No country found." }), e[25] = R, e[26] = V) : (R = e[25], V = e[26]);
|
|
117
|
+
let T;
|
|
118
|
+
if (e[27] !== n || e[28] !== l || e[29] !== o || e[30] !== s) {
|
|
119
|
+
let S;
|
|
120
|
+
e[32] !== l || e[33] !== o || e[34] !== s ? (S = (U) => {
|
|
121
121
|
const {
|
|
122
|
-
value:
|
|
123
|
-
label:
|
|
124
|
-
countryCode:
|
|
125
|
-
} =
|
|
126
|
-
return
|
|
127
|
-
}, e[32] =
|
|
122
|
+
value: E,
|
|
123
|
+
label: f,
|
|
124
|
+
countryCode: X
|
|
125
|
+
} = U;
|
|
126
|
+
return E ? /* @__PURE__ */ a(Ye, { country: E, countryName: f, countryCode: X, selectedCountry: o, onChange: l, onSelectComplete: () => x(!1), showFlagVariant: s }, typeof E == "object" && "countryId" in E ? E.countryId : E) : null;
|
|
127
|
+
}, e[32] = l, e[33] = o, e[34] = s, e[35] = S) : S = e[35], T = n.map(S), e[27] = n, e[28] = l, e[29] = o, e[30] = s, e[31] = T;
|
|
128
128
|
} else
|
|
129
|
-
|
|
130
|
-
let
|
|
131
|
-
e[36] !==
|
|
132
|
-
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
] }) }), e[36] =
|
|
135
|
-
let
|
|
136
|
-
e[38] !==
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
] }), e[38] =
|
|
140
|
-
let
|
|
141
|
-
e[41] !==
|
|
142
|
-
let
|
|
143
|
-
return e[44] !==
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
] }), e[44] =
|
|
147
|
-
},
|
|
148
|
-
const e =
|
|
129
|
+
T = e[31];
|
|
130
|
+
let j;
|
|
131
|
+
e[36] !== T ? (j = /* @__PURE__ */ a(ze, { children: /* @__PURE__ */ B("div", { ref: v, className: "max-h-[min(288px,calc(100vh-12rem))] overflow-y-auto -mx-1 px-1 [&::-webkit-scrollbar]:hidden [scrollbar-width:none]", style: R, children: [
|
|
132
|
+
V,
|
|
133
|
+
/* @__PURE__ */ a(Ge, { children: T })
|
|
134
|
+
] }) }), e[36] = T, e[37] = j) : j = e[37];
|
|
135
|
+
let A;
|
|
136
|
+
e[38] !== F || e[39] !== j ? (A = /* @__PURE__ */ B(Ue, { children: [
|
|
137
|
+
F,
|
|
138
|
+
j
|
|
139
|
+
] }), e[38] = F, e[39] = j, e[40] = A) : A = e[40];
|
|
140
|
+
let k;
|
|
141
|
+
e[41] !== m || e[42] !== A ? (k = /* @__PURE__ */ a(Je, { anchor: m, side: "bottom", sideOffset: 6, collisionAvoidance: O, className: "w-[min(var(--anchor-width),calc(100vw-1rem))] max-w-[var(--available-width)] min-w-0 p-1 shadow-md border border-gray-300 rounded-md", align: "start", children: A }), e[41] = m, e[42] = A, e[43] = k) : k = e[43];
|
|
142
|
+
let h;
|
|
143
|
+
return e[44] !== g || e[45] !== G || e[46] !== k ? (h = /* @__PURE__ */ B(Ke, { open: g, modal: !0, onOpenChange: i, children: [
|
|
144
|
+
G,
|
|
145
|
+
k
|
|
146
|
+
] }), e[44] = g, e[45] = G, e[46] = k, e[47] = h) : h = e[47], h;
|
|
147
|
+
}, Ye = (r) => {
|
|
148
|
+
const e = ge(21), {
|
|
149
149
|
country: t,
|
|
150
150
|
countryName: o,
|
|
151
|
-
countryCode:
|
|
152
|
-
selectedCountry:
|
|
153
|
-
onChange:
|
|
154
|
-
onSelectComplete:
|
|
155
|
-
showFlagVariant:
|
|
151
|
+
countryCode: n,
|
|
152
|
+
selectedCountry: l,
|
|
153
|
+
onChange: s,
|
|
154
|
+
onSelectComplete: b,
|
|
155
|
+
showFlagVariant: m
|
|
156
156
|
} = r;
|
|
157
|
-
let
|
|
158
|
-
e[0] !== t || e[1] !==
|
|
159
|
-
|
|
160
|
-
}, e[0] = t, e[1] =
|
|
161
|
-
const
|
|
162
|
-
let
|
|
157
|
+
let v;
|
|
158
|
+
e[0] !== t || e[1] !== s || e[2] !== b ? (v = () => {
|
|
159
|
+
s(t), b();
|
|
160
|
+
}, e[0] = t, e[1] = s, e[2] = b, e[3] = v) : v = e[3];
|
|
161
|
+
const $ = v;
|
|
162
|
+
let N;
|
|
163
163
|
e: {
|
|
164
|
-
if (!
|
|
165
|
-
|
|
164
|
+
if (!l) {
|
|
165
|
+
N = !1;
|
|
166
166
|
break e;
|
|
167
167
|
}
|
|
168
|
-
if (typeof t == "object" && "countryId" in t && typeof
|
|
169
|
-
|
|
168
|
+
if (typeof t == "object" && "countryId" in t && typeof l == "object" && "countryId" in l) {
|
|
169
|
+
N = t.countryId === l.countryId;
|
|
170
170
|
break e;
|
|
171
171
|
}
|
|
172
|
-
|
|
172
|
+
N = t === l;
|
|
173
173
|
}
|
|
174
|
-
const
|
|
175
|
-
let
|
|
176
|
-
e[4] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
177
|
-
let
|
|
178
|
-
e[5] !== t || e[6] !== o || e[7] !==
|
|
179
|
-
let
|
|
180
|
-
e[9] !==
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
] }) : /* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
] }), e[9] =
|
|
187
|
-
let
|
|
188
|
-
e[13] !==
|
|
189
|
-
let
|
|
190
|
-
return e[15] !==
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
] }), e[15] =
|
|
195
|
-
},
|
|
174
|
+
const g = N, x = typeof t == "object" && "countryId" in t ? `${t.countryName} ${t.countryCode}` : `${o} ${n}`;
|
|
175
|
+
let c;
|
|
176
|
+
e[4] === Symbol.for("react.memo_cache_sentinel") ? (c = ee("flex items-center gap-3 px-3 py-2.5 text-sm cursor-pointer transition-colors", "data-[selected=true]:bg-[#F5F5F5] data-[selected=true]:text-gray-900", "hover:bg-[#F5F5F5]"), e[4] = c) : c = e[4];
|
|
177
|
+
let y;
|
|
178
|
+
e[5] !== t || e[6] !== o || e[7] !== m ? (y = m && typeof t == "string" && /* @__PURE__ */ a("span", { className: "flex items-center", children: /* @__PURE__ */ a(Ee, { country: t, countryName: o }) }), e[5] = t, e[6] = o, e[7] = m, e[8] = y) : y = e[8];
|
|
179
|
+
let i;
|
|
180
|
+
e[9] !== n || e[10] !== o || e[11] !== m ? (i = m ? /* @__PURE__ */ B(De, { children: [
|
|
181
|
+
/* @__PURE__ */ a("span", { className: "flex-1 text-sm font-normal text-gray-700", children: o }),
|
|
182
|
+
/* @__PURE__ */ a(_e, { variant: "body2", weight: "regular", className: "text-gray-900 min-w-[50px] text-right", children: n })
|
|
183
|
+
] }) : /* @__PURE__ */ B(De, { children: [
|
|
184
|
+
/* @__PURE__ */ a(_e, { variant: "body2", weight: "regular", className: "text-gray-900 min-w-[50px]", children: n }),
|
|
185
|
+
/* @__PURE__ */ a("span", { className: "flex-1 text-sm font-normal text-gray-700", children: o })
|
|
186
|
+
] }), e[9] = n, e[10] = o, e[11] = m, e[12] = i) : i = e[12];
|
|
187
|
+
let d;
|
|
188
|
+
e[13] !== g ? (d = g && /* @__PURE__ */ a(Ae, { className: "ml-auto h-4 w-4 text-gray-900 shrink-0" }), e[13] = g, e[14] = d) : d = e[14];
|
|
189
|
+
let C;
|
|
190
|
+
return e[15] !== $ || e[16] !== x || e[17] !== y || e[18] !== i || e[19] !== d ? (C = /* @__PURE__ */ B(qe, { value: x, className: c, onSelect: $, children: [
|
|
191
|
+
y,
|
|
192
|
+
i,
|
|
193
|
+
d
|
|
194
|
+
] }), e[15] = $, e[16] = x, e[17] = y, e[18] = i, e[19] = d, e[20] = C) : C = e[20], C;
|
|
195
|
+
}, Ze = ke.getCountries(), et = (r) => {
|
|
196
196
|
if (!r || r.length === 0)
|
|
197
|
-
return
|
|
197
|
+
return Ze.map((t) => ({
|
|
198
198
|
value: t,
|
|
199
199
|
label: new Intl.DisplayNames(["en"], {
|
|
200
200
|
type: "region"
|
|
201
201
|
}).of(t) ?? t,
|
|
202
|
-
countryCode: `+${
|
|
202
|
+
countryCode: `+${q(t)}`
|
|
203
203
|
}));
|
|
204
204
|
const e = r[0];
|
|
205
205
|
return e && typeof e == "object" && "countryId" in e ? r.map((t) => ({
|
|
@@ -211,88 +211,140 @@ const ve = /\D/g, J = (r) => r.replace(ve, ""), Y = (r) => {
|
|
|
211
211
|
label: new Intl.DisplayNames(["en"], {
|
|
212
212
|
type: "region"
|
|
213
213
|
}).of(t) ?? t,
|
|
214
|
-
countryCode: `+${
|
|
214
|
+
countryCode: `+${q(t)}`
|
|
215
215
|
}));
|
|
216
216
|
};
|
|
217
|
-
function
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
217
|
+
function ft(r) {
|
|
218
|
+
const e = ge(110);
|
|
219
|
+
let t, o, n, l, s, b, m, v, $, N, g, x, c, y, i, d, C, I, _, D, L;
|
|
220
|
+
e[0] !== r ? ({
|
|
221
|
+
label: g,
|
|
222
|
+
helperText: v,
|
|
223
|
+
error: m,
|
|
224
|
+
required: I,
|
|
225
|
+
className: o,
|
|
226
|
+
"aria-describedby": t,
|
|
227
|
+
id: $,
|
|
228
|
+
value: D,
|
|
229
|
+
onPhoneChange: y,
|
|
230
|
+
countryCode: l,
|
|
231
|
+
onCountryCodeChange: c,
|
|
232
|
+
onValuesChange: d,
|
|
233
|
+
onCountryChange: x,
|
|
234
|
+
onValueChange: i,
|
|
235
|
+
countries: n,
|
|
236
|
+
defaultCountry: s,
|
|
237
|
+
variant: L,
|
|
238
|
+
disabled: b,
|
|
239
|
+
placeholder: C,
|
|
240
|
+
inputRef: N,
|
|
241
|
+
..._
|
|
242
|
+
} = r, e[0] = r, e[1] = t, e[2] = o, e[3] = n, e[4] = l, e[5] = s, e[6] = b, e[7] = m, e[8] = v, e[9] = $, e[10] = N, e[11] = g, e[12] = x, e[13] = c, e[14] = y, e[15] = i, e[16] = d, e[17] = C, e[18] = I, e[19] = _, e[20] = D, e[21] = L) : (t = e[1], o = e[2], n = e[3], l = e[4], s = e[5], b = e[6], m = e[7], v = e[8], $ = e[9], N = e[10], g = e[11], x = e[12], c = e[13], y = e[14], i = e[15], d = e[16], C = e[17], I = e[18], _ = e[19], D = e[20], L = e[21]);
|
|
243
|
+
const u = D === void 0 ? "" : D, z = L === void 0 ? "default" : L, G = P.useId(), O = P.useId(), M = P.useRef(null), F = $ ?? G, R = !!(v || m);
|
|
244
|
+
let V;
|
|
245
|
+
e[22] !== t || e[23] !== R || e[24] !== O ? (V = [t, R ? O : void 0].filter(Boolean).join(" ") || void 0, e[22] = t, e[23] = R, e[24] = O, e[25] = V) : V = e[25];
|
|
246
|
+
const T = V, j = !!m, A = z === "flag";
|
|
247
|
+
let k;
|
|
248
|
+
e[26] !== n ? (k = et(n), e[26] = n, e[27] = k) : k = e[27];
|
|
249
|
+
const h = k;
|
|
250
|
+
let S;
|
|
251
|
+
e[28] !== n || e[29] !== h || e[30] !== s || e[31] !== u ? (S = () => {
|
|
252
|
+
const p = Fe(String(u ?? "").trim());
|
|
253
|
+
if (p) {
|
|
254
|
+
const w = Se(h, p.callingCode, void 0);
|
|
255
|
+
if (w)
|
|
256
|
+
return w;
|
|
244
257
|
}
|
|
245
|
-
return
|
|
246
|
-
}, [
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
258
|
+
return Oe(s, n);
|
|
259
|
+
}, e[28] = n, e[29] = h, e[30] = s, e[31] = u, e[32] = S) : S = e[32];
|
|
260
|
+
const U = S;
|
|
261
|
+
let E;
|
|
262
|
+
e[33] !== U ? (E = () => U(), e[33] = U, e[34] = E) : E = e[34];
|
|
263
|
+
const [f, X] = P.useState(E);
|
|
264
|
+
let re, oe;
|
|
265
|
+
e[35] !== n || e[36] !== s ? (re = () => {
|
|
266
|
+
if (s != null) {
|
|
267
|
+
const p = Oe(s, n);
|
|
268
|
+
p && X(p);
|
|
253
269
|
}
|
|
254
|
-
}, [
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
]
|
|
270
|
+
}, oe = [s, n], e[35] = n, e[36] = s, e[37] = re, e[38] = oe) : (re = e[37], oe = e[38]), P.useEffect(re, oe);
|
|
271
|
+
const le = l !== void 0;
|
|
272
|
+
let ne, se;
|
|
273
|
+
e[39] !== c || e[40] !== f ? (se = () => {
|
|
274
|
+
if (!f)
|
|
275
|
+
return;
|
|
276
|
+
const p = q(f);
|
|
277
|
+
c == null || c(p);
|
|
278
|
+
}, ne = [f, c], e[39] = c, e[40] = f, e[41] = ne, e[42] = se) : (ne = e[41], se = e[42]), P.useEffect(se, ne);
|
|
279
|
+
let ie, ae;
|
|
280
|
+
e[43] !== l || e[44] !== h || e[45] !== le || e[46] !== f ? (ie = () => {
|
|
281
|
+
if (!le)
|
|
282
|
+
return;
|
|
283
|
+
const p = te(String(l ?? ""));
|
|
284
|
+
if (p === "")
|
|
285
|
+
return;
|
|
286
|
+
const w = Se(h, p, f);
|
|
287
|
+
w && !$e(w, f) && X(w);
|
|
288
|
+
}, ae = [l, h, le, f], e[43] = l, e[44] = h, e[45] = le, e[46] = f, e[47] = ie, e[48] = ae) : (ie = e[47], ae = e[48]), P.useEffect(ie, ae);
|
|
289
|
+
let ce, de;
|
|
290
|
+
e[49] !== h || e[50] !== f || e[51] !== u ? (ce = () => {
|
|
291
|
+
const p = Fe(String(u ?? "").trim());
|
|
292
|
+
if (!p)
|
|
293
|
+
return;
|
|
294
|
+
const w = Se(h, p.callingCode, f);
|
|
295
|
+
w && !$e(w, f) && X(w);
|
|
296
|
+
}, de = [u, h, f], e[49] = h, e[50] = f, e[51] = u, e[52] = ce, e[53] = de) : (ce = e[52], de = e[53]), P.useEffect(ce, de);
|
|
297
|
+
let fe;
|
|
298
|
+
e[54] !== u ? (fe = je(u), e[54] = u, e[55] = fe) : fe = e[55];
|
|
299
|
+
const me = fe;
|
|
300
|
+
let ue;
|
|
301
|
+
e[56] !== me || e[57] !== x || e[58] !== c || e[59] !== i || e[60] !== d ? (ue = (p) => {
|
|
302
|
+
X(p);
|
|
303
|
+
const w = q(p);
|
|
304
|
+
c == null || c(w), x == null || x(p), d == null || d([w, me]), i == null || i(Re(me, p));
|
|
305
|
+
}, e[56] = me, e[57] = x, e[58] = c, e[59] = i, e[60] = d, e[61] = ue) : ue = e[61];
|
|
306
|
+
const be = ue;
|
|
307
|
+
let pe;
|
|
308
|
+
e[62] !== l || e[63] !== y || e[64] !== i || e[65] !== d || e[66] !== f ? (pe = (p) => {
|
|
309
|
+
const w = p.target.value, Ie = te(w);
|
|
310
|
+
y == null || y(Ie);
|
|
311
|
+
const Pe = l ?? q(f);
|
|
312
|
+
d == null || d([Pe, Ie]), i == null || i(Re(Ie, f));
|
|
313
|
+
}, e[62] = l, e[63] = y, e[64] = i, e[65] = d, e[66] = f, e[67] = pe) : pe = e[67];
|
|
314
|
+
const ve = pe;
|
|
315
|
+
let ye;
|
|
316
|
+
e[68] !== u ? (ye = je(u), e[68] = u, e[69] = ye) : ye = e[69];
|
|
317
|
+
const xe = ye;
|
|
318
|
+
let H;
|
|
319
|
+
e[70] !== o ? (H = ee("space-y-1", o), e[70] = o, e[71] = H) : H = e[71];
|
|
320
|
+
let J;
|
|
321
|
+
e[72] !== g || e[73] !== I || e[74] !== F ? (J = g && /* @__PURE__ */ B(Xe, { htmlFor: F, className: "text-sm font-medium text-foreground", children: [
|
|
322
|
+
g,
|
|
323
|
+
I && /* @__PURE__ */ a("span", { className: "ml-1 text-destructive", "aria-hidden": "true", children: "*" })
|
|
324
|
+
] }), e[72] = g, e[73] = I, e[74] = F, e[75] = J) : J = e[75];
|
|
325
|
+
let K;
|
|
326
|
+
e[76] !== h || e[77] !== b || e[78] !== be || e[79] !== j || e[80] !== f || e[81] !== A ? (K = /* @__PURE__ */ a(We, { disabled: b, value: f, options: h, onChange: be, showFlagVariant: A, hasError: j, popoverAnchorRef: M }), e[76] = h, e[77] = b, e[78] = be, e[79] = j, e[80] = f, e[81] = A, e[82] = K) : K = e[82];
|
|
327
|
+
const Ce = I || void 0, we = j || void 0, Ne = j ? "border-destructive" : "border-gray-300";
|
|
328
|
+
let Q;
|
|
329
|
+
e[83] !== Ne ? (Q = ee("h-[40px] rounded-r-md rounded-l-none border-t-[1px] border-b-[1px] border-l-[1px] bg-white px-3 py-[1px] text-sm", Ne), e[83] = Ne, e[84] = Q) : Q = e[84];
|
|
330
|
+
let W;
|
|
331
|
+
e[85] !== T || e[86] !== b || e[87] !== ve || e[88] !== N || e[89] !== xe || e[90] !== C || e[91] !== F || e[92] !== _ || e[93] !== Ce || e[94] !== we || e[95] !== Q ? (W = /* @__PURE__ */ a(Me, { ..._, ref: N, id: F, type: "text", inputMode: "numeric", value: xe, onChange: ve, disabled: b, placeholder: C, "aria-required": Ce, "aria-invalid": we, "aria-describedby": T, className: Q }), e[85] = T, e[86] = b, e[87] = ve, e[88] = N, e[89] = xe, e[90] = C, e[91] = F, e[92] = _, e[93] = Ce, e[94] = we, e[95] = Q, e[96] = W) : W = e[96];
|
|
332
|
+
let Y;
|
|
333
|
+
e[97] !== K || e[98] !== W ? (Y = /* @__PURE__ */ B("div", { ref: M, className: "flex w-full min-w-0 items-center", children: [
|
|
334
|
+
K,
|
|
335
|
+
W
|
|
336
|
+
] }), e[97] = K, e[98] = W, e[99] = Y) : Y = e[99];
|
|
337
|
+
let Z;
|
|
338
|
+
e[100] !== m || e[101] !== R || e[102] !== O || e[103] !== v ? (Z = R && /* @__PURE__ */ a("p", { id: O, className: ee("text-xs", m ? "text-destructive" : "text-muted-foreground"), role: m ? "alert" : void 0, children: m || v }), e[100] = m, e[101] = R, e[102] = O, e[103] = v, e[104] = Z) : Z = e[104];
|
|
339
|
+
let he;
|
|
340
|
+
return e[105] !== H || e[106] !== J || e[107] !== Y || e[108] !== Z ? (he = /* @__PURE__ */ B("div", { className: H, children: [
|
|
341
|
+
J,
|
|
342
|
+
Y,
|
|
343
|
+
Z
|
|
344
|
+
] }), e[105] = H, e[106] = J, e[107] = Y, e[108] = Z, e[109] = he) : he = e[109], he;
|
|
293
345
|
}
|
|
294
346
|
export {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
347
|
+
ft as DoctPhoneInput,
|
|
348
|
+
pt as isPossiblePhoneNumber,
|
|
349
|
+
yt as isValidPhoneNumber
|
|
298
350
|
};
|