@konstructio/ui 0.1.2-alpha.3 → 0.1.2-alpha.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DatePicker.css +1 -1
- package/dist/Modal-5xSxFoaD.js +99 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/chevron-down-DgT-uSF9.js +5 -0
- package/dist/chevron-right-DYvXLeql.js +7 -0
- package/dist/chevron-up-DrQr2Fwd.js +5 -0
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +30 -33
- package/dist/components/Badge/Badge.variants.js +8 -6
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/components/Item/Item.js +24 -23
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.variants.js +1 -1
- package/dist/components/Card/Card.variants.js +5 -9
- package/dist/components/Checkbox/Checkbox.js +6 -6
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/components/Command.js +1 -1
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +1 -1
- package/dist/components/Command/components/CommandInput.js +2 -2
- package/dist/components/Command/components/CommandItem.js +1 -1
- package/dist/components/Command/components/CommandList.js +1 -1
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +2 -2
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Datepicker/DatePicker.js +1209 -1147
- package/dist/components/Divider/Divider.variants.js +1 -1
- package/dist/components/Dropdown/Dropdown.js +46 -28
- package/dist/components/Dropdown/Dropdown.variants.js +32 -9
- package/dist/components/Dropdown/components/List/List.js +133 -54
- package/dist/components/Dropdown/components/List/List.variants.js +9 -7
- package/dist/components/Dropdown/components/ListItem/ListItem.js +74 -24
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +9 -7
- package/dist/components/Dropdown/components/Wrapper.js +144 -109
- package/dist/components/Dropdown/constants/index.js +4 -0
- package/dist/components/Dropdown/constants/pagination.js +4 -0
- package/dist/components/Dropdown/contexts/dropdown.context.js +26 -8
- package/dist/components/Dropdown/contexts/dropdown.provider.js +48 -19
- package/dist/components/Dropdown/hooks/useDropdown.js +83 -39
- package/dist/components/Dropdown/hooks/useNavigationList.js +28 -36
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.variants.js +2 -2
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/Input.variants.js +1 -1
- package/dist/components/Loading/Loading.js +1 -7
- package/dist/components/Modal/Modal.js +2 -2
- package/dist/components/Modal/components/Body/Body.js +1 -1
- package/dist/components/Modal/components/Footer/Footer.js +1 -1
- package/dist/components/Modal/components/Header/Header.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -3
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/NumberInput/NumberInput.js +2 -2
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +8 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +45 -0
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +27 -0
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +629 -0
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +36 -0
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +45 -0
- package/dist/components/PhoneNumberInput/components/Wrapper.js +625 -0
- package/dist/components/PhoneNumberInput/components/index.js +6 -0
- package/dist/components/PhoneNumberInput/contexts/index.js +8 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.context.js +28 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +13 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +6137 -0
- package/dist/components/PhoneNumberInput/utils/index.js +11 -0
- package/dist/components/PieChart/PieChart.js +647 -664
- package/dist/components/RadioCard/RadioCard.variants.js +1 -6
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Sidebar/Sidebar.variants.js +2 -2
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +29 -28
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +8 -8
- package/dist/components/Switch/Switch.variants.js +4 -4
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.variants.js +45 -24
- package/dist/components/Tabs/components/Content.js +1 -1
- package/dist/components/Tabs/components/List.js +1 -1
- package/dist/components/Tabs/components/Trigger.js +9 -8
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +98 -49
- package/dist/components/TimePicker/TimePicker.variants.js +2 -2
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +2 -2
- package/dist/components/Toast/Toast.js +206 -181
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Typography/Typography.variants.js +18 -23
- package/dist/components/VirtualizedTable/VirtualizedTable.js +119 -0
- package/dist/components/VirtualizedTable/VirtualizedTable.variants.js +5 -0
- package/dist/components/VirtualizedTable/assets/chevron-down.js +25 -0
- package/dist/components/VirtualizedTable/assets/chevron-up.js +25 -0
- package/dist/components/VirtualizedTable/assets/index.js +6 -0
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +72 -0
- package/dist/components/VirtualizedTable/components/Body/Body.js +51 -0
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +165 -0
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +34 -0
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +88 -0
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +48 -0
- package/dist/components/VirtualizedTable/components/Header/Header.js +84 -0
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +53 -0
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +67 -0
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +34 -0
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +27 -0
- package/dist/components/VirtualizedTable/components/index.js +16 -0
- package/dist/components/VirtualizedTable/constants/index.js +5 -0
- package/dist/components/VirtualizedTable/constants/pagination.js +5 -0
- package/dist/components/VirtualizedTable/contexts/index.js +8 -0
- package/dist/components/VirtualizedTable/contexts/table.context.js +32 -0
- package/dist/components/VirtualizedTable/contexts/table.hook.js +11 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +85 -0
- package/dist/components/index.js +79 -73
- package/dist/contexts/theme.provider.js +0 -1
- package/dist/{createLucideIcon-DbC6TvM5.js → createLucideIcon-D4r5Phnh.js} +0 -24
- package/dist/debounce-BFejQm9P.js +200 -0
- package/dist/ellipsis-vertical-BVPtjl5f.js +9 -0
- package/dist/{index-h-Ul0anl.js → index--V_ZsiQe.js} +1 -22
- package/dist/index-2hB40Iuc.js +1873 -0
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/{index-bwWKd82e.js → index-BbQkJE5L.js} +1 -1
- package/dist/index-BtQfgaSF.js +60 -0
- package/dist/index-C3tHPg8y.js +662 -0
- package/dist/index-CIAmiWcw.js +200 -0
- package/dist/index-CSFe9uC5.js +14 -0
- package/dist/index-CSWGJT-v.js +1722 -0
- package/dist/index-CigKKiZS.js +91 -0
- package/dist/index-DDByhzds.js +137 -0
- package/dist/{index-BAraV3ai.js → index-DH2Fnov1.js} +11 -12
- package/dist/index-DLcqcWxM.js +29 -0
- package/dist/index-Dbt2vBmS.js +136 -0
- package/dist/{index-DB2XhXHn.js → index-DpW9ExsS.js} +7 -7
- package/dist/index-DrWQH0QF.js +55 -0
- package/dist/{index-D3xzCzcO.js → index-X4k_cU8k.js} +4 -4
- package/dist/index-kyuBfLcN.js +479 -0
- package/dist/{index-C1g_chDT.js → index-mPY_8Y5v.js} +2 -2
- package/dist/index-ohdbKsws.js +27 -0
- package/dist/index.d.ts +184 -18
- package/dist/index.js +106 -98
- package/dist/libphonenumber-_7ZyKWA7.js +11549 -0
- package/dist/package.json +46 -32
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +191 -167
- package/dist/{useBreadcrumb-B8DnuqkR.js → useBreadcrumb-BAHbGQ_O.js} +0 -10
- package/dist/utils/index.js +534 -501
- package/dist/{x-BPcqkRZd.js → x-DPU9OdYH.js} +1 -1
- package/package.json +46 -32
- package/dist/Modal-V67Uz78z.js +0 -98
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/chevron-down-BLZPftpV.js +0 -11
- package/dist/chevron-up-RLP4nX7V.js +0 -54
- package/dist/index-BXuxPoz7.js +0 -435
- package/dist/index-BfXxHr_2.js +0 -125
- package/dist/index-C9T9HQaa.js +0 -423
- package/dist/index-CZnD2QxM.js +0 -32
- package/dist/index-CrBonFvu.js +0 -144
- package/dist/index-Cvx4lqTq.js +0 -47
- package/dist/index-DQH6odE9.js +0 -82
- package/dist/index-Oq5GlCHP.js +0 -131
- package/dist/index-iXyXtdgP.js +0 -31
|
@@ -0,0 +1,625 @@
|
|
|
1
|
+
import "./FlagSelectorList/FlagSelectorList.js";
|
|
2
|
+
import { jsxs as Z, jsx as V } from "react/jsx-runtime";
|
|
3
|
+
import { i as Te } from "../../../index-C3tHPg8y.js";
|
|
4
|
+
import { useRef as ee, useMemo as Ie, forwardRef as Ae, useId as Ne, useImperativeHandle as Be, useCallback as Re, useEffect as ce } from "react";
|
|
5
|
+
import { cn as Ge } from "../../../utils/index.js";
|
|
6
|
+
import { labelVariants as Le, phoneNumberInputVariants as Ve } from "../PhoneNumberInput.variants.js";
|
|
7
|
+
import { usePhoneNumberContext as xe } from "../contexts/phone-number.hook.js";
|
|
8
|
+
import { getPhoneMask as Ke } from "../utils/index.js";
|
|
9
|
+
import { FlagContent as De } from "./FlagContent/FlagContent.js";
|
|
10
|
+
import { FlagSelectorWrapper as Fe } from "./FlagSelectorWrapper/FlagSelectorWrapper.js";
|
|
11
|
+
function se(e, t) {
|
|
12
|
+
(t == null || t > e.length) && (t = e.length);
|
|
13
|
+
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
14
|
+
return r;
|
|
15
|
+
}
|
|
16
|
+
function Ue(e, t, n) {
|
|
17
|
+
return t = Y(t), function(r, o) {
|
|
18
|
+
if (o && (typeof o == "object" || typeof o == "function")) return o;
|
|
19
|
+
if (o !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
20
|
+
return function(a) {
|
|
21
|
+
if (a === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
22
|
+
return a;
|
|
23
|
+
}(r);
|
|
24
|
+
}(e, Oe() ? Reflect.construct(t, n || [], Y(e).constructor) : t.apply(e, n));
|
|
25
|
+
}
|
|
26
|
+
function $e(e, t) {
|
|
27
|
+
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
28
|
+
}
|
|
29
|
+
function ze(e, t, n) {
|
|
30
|
+
return Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
31
|
+
}
|
|
32
|
+
function ge(e, t) {
|
|
33
|
+
var n = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
34
|
+
if (!n) {
|
|
35
|
+
if (Array.isArray(e) || (n = function(i, c) {
|
|
36
|
+
if (i) {
|
|
37
|
+
if (typeof i == "string") return se(i, c);
|
|
38
|
+
var p = {}.toString.call(i).slice(8, -1);
|
|
39
|
+
return p === "Object" && i.constructor && (p = i.constructor.name), p === "Map" || p === "Set" ? Array.from(i) : p === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(p) ? se(i, c) : void 0;
|
|
40
|
+
}
|
|
41
|
+
}(e)) || t) {
|
|
42
|
+
n && (e = n);
|
|
43
|
+
var r = 0, o = function() {
|
|
44
|
+
};
|
|
45
|
+
return { s: o, n: function() {
|
|
46
|
+
return r >= e.length ? { done: !0 } : { done: !1, value: e[r++] };
|
|
47
|
+
}, e: function(i) {
|
|
48
|
+
throw i;
|
|
49
|
+
}, f: o };
|
|
50
|
+
}
|
|
51
|
+
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
52
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
53
|
+
}
|
|
54
|
+
var a, l = !0, u = !1;
|
|
55
|
+
return { s: function() {
|
|
56
|
+
n = n.call(e);
|
|
57
|
+
}, n: function() {
|
|
58
|
+
var i = n.next();
|
|
59
|
+
return l = i.done, i;
|
|
60
|
+
}, e: function(i) {
|
|
61
|
+
u = !0, a = i;
|
|
62
|
+
}, f: function() {
|
|
63
|
+
try {
|
|
64
|
+
l || n.return == null || n.return();
|
|
65
|
+
} finally {
|
|
66
|
+
if (u) throw a;
|
|
67
|
+
}
|
|
68
|
+
} };
|
|
69
|
+
}
|
|
70
|
+
function be(e, t, n) {
|
|
71
|
+
return (t = function(r) {
|
|
72
|
+
var o = function(a, l) {
|
|
73
|
+
if (typeof a != "object" || !a) return a;
|
|
74
|
+
var u = a[Symbol.toPrimitive];
|
|
75
|
+
if (u !== void 0) {
|
|
76
|
+
var i = u.call(a, l);
|
|
77
|
+
if (typeof i != "object") return i;
|
|
78
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
79
|
+
}
|
|
80
|
+
return (l === "string" ? String : Number)(a);
|
|
81
|
+
}(r, "string");
|
|
82
|
+
return typeof o == "symbol" ? o : o + "";
|
|
83
|
+
}(t)) in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
|
|
84
|
+
}
|
|
85
|
+
function Y(e) {
|
|
86
|
+
return Y = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
87
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
88
|
+
}, Y(e);
|
|
89
|
+
}
|
|
90
|
+
function He(e, t) {
|
|
91
|
+
if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function");
|
|
92
|
+
e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && te(e, t);
|
|
93
|
+
}
|
|
94
|
+
function Oe() {
|
|
95
|
+
try {
|
|
96
|
+
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
97
|
+
}));
|
|
98
|
+
} catch {
|
|
99
|
+
}
|
|
100
|
+
return (Oe = function() {
|
|
101
|
+
return !!e;
|
|
102
|
+
})();
|
|
103
|
+
}
|
|
104
|
+
function pe(e, t) {
|
|
105
|
+
var n = Object.keys(e);
|
|
106
|
+
if (Object.getOwnPropertySymbols) {
|
|
107
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
108
|
+
t && (r = r.filter(function(o) {
|
|
109
|
+
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
110
|
+
})), n.push.apply(n, r);
|
|
111
|
+
}
|
|
112
|
+
return n;
|
|
113
|
+
}
|
|
114
|
+
function J(e) {
|
|
115
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
116
|
+
var n = arguments[t] != null ? arguments[t] : {};
|
|
117
|
+
t % 2 ? pe(Object(n), !0).forEach(function(r) {
|
|
118
|
+
be(e, r, n[r]);
|
|
119
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : pe(Object(n)).forEach(function(r) {
|
|
120
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return e;
|
|
124
|
+
}
|
|
125
|
+
function _e(e, t) {
|
|
126
|
+
if (e == null) return {};
|
|
127
|
+
var n, r, o = function(l, u) {
|
|
128
|
+
if (l == null) return {};
|
|
129
|
+
var i = {};
|
|
130
|
+
for (var c in l) if ({}.hasOwnProperty.call(l, c)) {
|
|
131
|
+
if (u.includes(c)) continue;
|
|
132
|
+
i[c] = l[c];
|
|
133
|
+
}
|
|
134
|
+
return i;
|
|
135
|
+
}(e, t);
|
|
136
|
+
if (Object.getOwnPropertySymbols) {
|
|
137
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
138
|
+
for (r = 0; r < a.length; r++) n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
|
|
139
|
+
}
|
|
140
|
+
return o;
|
|
141
|
+
}
|
|
142
|
+
function te(e, t) {
|
|
143
|
+
return te = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
|
|
144
|
+
return n.__proto__ = r, n;
|
|
145
|
+
}, te(e, t);
|
|
146
|
+
}
|
|
147
|
+
function U(e, t) {
|
|
148
|
+
var n, r = t.replacementChars, o = t.replacement, a = t.separate, l = r, u = "", i = ge(e);
|
|
149
|
+
try {
|
|
150
|
+
for (i.s(); !(n = i.n()).done; ) {
|
|
151
|
+
var c, p = n.value, f = !Object.prototype.hasOwnProperty.call(o, p) && ((c = o[l[0]]) === null || c === void 0 ? void 0 : c.test(p));
|
|
152
|
+
(a && p === l[0] || f) && (l = l.slice(1), u += p);
|
|
153
|
+
}
|
|
154
|
+
} catch (b) {
|
|
155
|
+
i.e(b);
|
|
156
|
+
} finally {
|
|
157
|
+
i.f();
|
|
158
|
+
}
|
|
159
|
+
return u;
|
|
160
|
+
}
|
|
161
|
+
function Se(e, t) {
|
|
162
|
+
var n, r = t.mask, o = t.replacement, a = t.separate, l = t.showMask, u = 0, i = "", c = ge(r);
|
|
163
|
+
try {
|
|
164
|
+
for (c.s(); !(n = c.n()).done; ) {
|
|
165
|
+
var p = n.value;
|
|
166
|
+
if (!l && e[u] === void 0) break;
|
|
167
|
+
Object.prototype.hasOwnProperty.call(o, p) && e[u] !== void 0 ? i += e[u++] : i += p;
|
|
168
|
+
}
|
|
169
|
+
} catch (b) {
|
|
170
|
+
c.e(b);
|
|
171
|
+
} finally {
|
|
172
|
+
c.f();
|
|
173
|
+
}
|
|
174
|
+
if (a && !l) {
|
|
175
|
+
for (var f = r.length - 1; f >= 0 && i[f] === r[f]; f--) ;
|
|
176
|
+
i = i.slice(0, f + 1);
|
|
177
|
+
}
|
|
178
|
+
return i;
|
|
179
|
+
}
|
|
180
|
+
function we(e, t) {
|
|
181
|
+
for (var n = t.mask, r = t.replacement, o = [], a = 0; a < n.length; a++) {
|
|
182
|
+
var l, u = (l = e[a]) !== null && l !== void 0 ? l : n[a], i = Object.prototype.hasOwnProperty.call(r, u) ? "replacement" : e[a] !== void 0 && e[a] !== n[a] ? "input" : "mask";
|
|
183
|
+
o.push({ type: i, value: u, index: a });
|
|
184
|
+
}
|
|
185
|
+
return o;
|
|
186
|
+
}
|
|
187
|
+
function K(e) {
|
|
188
|
+
return e.length > 0 ? be({}, e, /./) : {};
|
|
189
|
+
}
|
|
190
|
+
function ne(e, t) {
|
|
191
|
+
for (var n = t.start, r = n === void 0 ? 0 : n, o = t.end, a = t.mask, l = t.replacement, u = t.separate, i = e.slice(r, o), c = a.slice(r, o), p = "", f = 0; f < c.length; f++) {
|
|
192
|
+
var b = Object.prototype.hasOwnProperty.call(l, c[f]);
|
|
193
|
+
b && i[f] !== void 0 && i[f] !== c[f] ? p += i[f] : b && u && (p += c[f]);
|
|
194
|
+
}
|
|
195
|
+
return p;
|
|
196
|
+
}
|
|
197
|
+
function ke(e, t) {
|
|
198
|
+
var n = t.mask, r = t.replacement, o = typeof r == "string" ? K(r) : r, a = RegExp("[^".concat(Object.keys(o).join(""), "]"), "g");
|
|
199
|
+
return Se(U(e, { replacementChars: n.replace(a, ""), replacement: o, separate: !1 }), { mask: n, replacement: o, separate: !1, showMask: !1 });
|
|
200
|
+
}
|
|
201
|
+
function We(e, t) {
|
|
202
|
+
var n = t.mask, r = t.replacement, o = typeof r == "string" ? K(r) : r, a = ne(e, { mask: n, replacement: o, separate: !1 }), l = RegExp("[^".concat(Object.keys(o).join(""), "]"), "g");
|
|
203
|
+
return U(a, { replacementChars: n.replace(l, ""), replacement: o, separate: !1 });
|
|
204
|
+
}
|
|
205
|
+
function Ze(e, t) {
|
|
206
|
+
var n = t.mask, r = t.replacement, o = typeof r == "string" ? K(r) : r;
|
|
207
|
+
return we(ke(e, { mask: n, replacement: o }), { mask: n, replacement: o });
|
|
208
|
+
}
|
|
209
|
+
var Je = ["[", "]", "\\", "/", "^", "$", ".", "|", "?", "*", "+", "(", ")", "{", "}"];
|
|
210
|
+
function fe(e) {
|
|
211
|
+
return Je.includes(e) ? "\\".concat(e) : e;
|
|
212
|
+
}
|
|
213
|
+
function Ye(e, t) {
|
|
214
|
+
for (var n = t.mask, r = t.replacement, o = typeof r == "string" ? K(r) : r, a = e === "partial" || e === "partial-inexact", l = e === "full" || e === "partial", u = "", i = 0; i < n.length; i++) {
|
|
215
|
+
var c = n[i];
|
|
216
|
+
i === 0 && (u = "^"), a && (u += "("), u += Object.prototype.hasOwnProperty.call(o, c) ? "".concat(l ? "(?!".concat(fe(c), ")") : "", "(").concat(o[c].source, ")") : fe(c), i === n.length - 1 && (a && (u += ")?".repeat(n.length)), u += "$");
|
|
217
|
+
}
|
|
218
|
+
return u;
|
|
219
|
+
}
|
|
220
|
+
function Qe(e, t) {
|
|
221
|
+
return new Proxy(e, { set: function(n, r, o) {
|
|
222
|
+
return r === "current" && (o !== e.current && (e.current !== null && t.unregister(e.current), o !== null && t.register(o)), n[r] = o, !0);
|
|
223
|
+
} });
|
|
224
|
+
}
|
|
225
|
+
function qe(e, t, n) {
|
|
226
|
+
return t = z(t), function(r, o) {
|
|
227
|
+
if (o && (typeof o == "object" || typeof o == "function")) return o;
|
|
228
|
+
if (o !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
229
|
+
return function(a) {
|
|
230
|
+
if (a === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
231
|
+
return a;
|
|
232
|
+
}(r);
|
|
233
|
+
}(e, ae() ? Reflect.construct(t, n || [], z(e).constructor) : t.apply(e, n));
|
|
234
|
+
}
|
|
235
|
+
function Pe(e, t) {
|
|
236
|
+
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
237
|
+
}
|
|
238
|
+
function Me(e, t, n) {
|
|
239
|
+
return Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
240
|
+
}
|
|
241
|
+
function Xe(e, t, n) {
|
|
242
|
+
return (t = function(r) {
|
|
243
|
+
var o = function(a, l) {
|
|
244
|
+
if (typeof a != "object" || !a) return a;
|
|
245
|
+
var u = a[Symbol.toPrimitive];
|
|
246
|
+
if (u !== void 0) {
|
|
247
|
+
var i = u.call(a, l);
|
|
248
|
+
if (typeof i != "object") return i;
|
|
249
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
250
|
+
}
|
|
251
|
+
return (l === "string" ? String : Number)(a);
|
|
252
|
+
}(r, "string");
|
|
253
|
+
return typeof o == "symbol" ? o : o + "";
|
|
254
|
+
}(t)) in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
|
|
255
|
+
}
|
|
256
|
+
function z(e) {
|
|
257
|
+
return z = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
258
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
259
|
+
}, z(e);
|
|
260
|
+
}
|
|
261
|
+
function et(e, t) {
|
|
262
|
+
if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function");
|
|
263
|
+
e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && H(e, t);
|
|
264
|
+
}
|
|
265
|
+
function ae() {
|
|
266
|
+
try {
|
|
267
|
+
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
268
|
+
}));
|
|
269
|
+
} catch {
|
|
270
|
+
}
|
|
271
|
+
return (ae = function() {
|
|
272
|
+
return !!e;
|
|
273
|
+
})();
|
|
274
|
+
}
|
|
275
|
+
function de(e, t) {
|
|
276
|
+
var n = Object.keys(e);
|
|
277
|
+
if (Object.getOwnPropertySymbols) {
|
|
278
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
279
|
+
t && (r = r.filter(function(o) {
|
|
280
|
+
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
281
|
+
})), n.push.apply(n, r);
|
|
282
|
+
}
|
|
283
|
+
return n;
|
|
284
|
+
}
|
|
285
|
+
function ve(e) {
|
|
286
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
287
|
+
var n = arguments[t] != null ? arguments[t] : {};
|
|
288
|
+
t % 2 ? de(Object(n), !0).forEach(function(r) {
|
|
289
|
+
Xe(e, r, n[r]);
|
|
290
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : de(Object(n)).forEach(function(r) {
|
|
291
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
return e;
|
|
295
|
+
}
|
|
296
|
+
function tt(e, t) {
|
|
297
|
+
if (e == null) return {};
|
|
298
|
+
var n, r, o = function(l, u) {
|
|
299
|
+
if (l == null) return {};
|
|
300
|
+
var i = {};
|
|
301
|
+
for (var c in l) if ({}.hasOwnProperty.call(l, c)) {
|
|
302
|
+
if (u.includes(c)) continue;
|
|
303
|
+
i[c] = l[c];
|
|
304
|
+
}
|
|
305
|
+
return i;
|
|
306
|
+
}(e, t);
|
|
307
|
+
if (Object.getOwnPropertySymbols) {
|
|
308
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
309
|
+
for (r = 0; r < a.length; r++) n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
|
|
310
|
+
}
|
|
311
|
+
return o;
|
|
312
|
+
}
|
|
313
|
+
function H(e, t) {
|
|
314
|
+
return H = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
|
|
315
|
+
return n.__proto__ = r, n;
|
|
316
|
+
}, H(e, t);
|
|
317
|
+
}
|
|
318
|
+
function re(e) {
|
|
319
|
+
var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
320
|
+
return re = function(n) {
|
|
321
|
+
if (n === null || !function(o) {
|
|
322
|
+
try {
|
|
323
|
+
return Function.toString.call(o).indexOf("[native code]") !== -1;
|
|
324
|
+
} catch {
|
|
325
|
+
return typeof o == "function";
|
|
326
|
+
}
|
|
327
|
+
}(n)) return n;
|
|
328
|
+
if (typeof n != "function") throw new TypeError("Super expression must either be null or a function");
|
|
329
|
+
if (t !== void 0) {
|
|
330
|
+
if (t.has(n)) return t.get(n);
|
|
331
|
+
t.set(n, r);
|
|
332
|
+
}
|
|
333
|
+
function r() {
|
|
334
|
+
return function(o, a, l) {
|
|
335
|
+
if (ae()) return Reflect.construct.apply(null, arguments);
|
|
336
|
+
var u = [null];
|
|
337
|
+
u.push.apply(u, a);
|
|
338
|
+
var i = new (o.bind.apply(o, u))();
|
|
339
|
+
return l && H(i, l.prototype), i;
|
|
340
|
+
}(n, arguments, z(this).constructor);
|
|
341
|
+
}
|
|
342
|
+
return r.prototype = Object.create(n.prototype, { constructor: { value: r, enumerable: !1, writable: !0, configurable: !0 } }), H(r, n);
|
|
343
|
+
}, re(e);
|
|
344
|
+
}
|
|
345
|
+
var $ = function(e) {
|
|
346
|
+
function t(n) {
|
|
347
|
+
var r;
|
|
348
|
+
return Pe(this, t), (r = qe(this, t, [n])).name = "SyntheticChangeError", r;
|
|
349
|
+
}
|
|
350
|
+
return et(t, e), Me(t);
|
|
351
|
+
}(re(Error)), me, nt = ["options"], he = ["text", "email", "tel", "search", "url"], Ee = Me(function e(t) {
|
|
352
|
+
var n = t.init, r = t.tracking;
|
|
353
|
+
Pe(this, e);
|
|
354
|
+
var o = /* @__PURE__ */ new WeakMap();
|
|
355
|
+
this.register = function(a) {
|
|
356
|
+
var l;
|
|
357
|
+
if (he.includes(a.type)) {
|
|
358
|
+
var u = (l = a._wrapperState) !== null && l !== void 0 ? l : {}, i = u.initialValue, c = i === void 0 ? "" : i, p = u.controlled, f = p !== void 0 && p, b = n({ initialValue: a.value || c, controlled: f }), M = b.value, j = b.options, h = { value: M, options: j, fallbackOptions: j }, v = { id: -1, cachedId: -1 }, s = { value: "", selectionStart: 0, selectionEnd: 0 }, O = Object.getOwnPropertyDescriptor("_valueTracker" in a ? a : HTMLInputElement.prototype, "value");
|
|
359
|
+
Object.defineProperty(a, "value", ve(ve({}, O), {}, { set: function(y) {
|
|
360
|
+
var m;
|
|
361
|
+
s.value = y, O == null || (m = O.set) === null || m === void 0 || m.call(a, y);
|
|
362
|
+
} })), a.value = M;
|
|
363
|
+
var S = function() {
|
|
364
|
+
var y = function() {
|
|
365
|
+
var m, k;
|
|
366
|
+
s.selectionStart = (m = a.selectionStart) !== null && m !== void 0 ? m : 0, s.selectionEnd = (k = a.selectionEnd) !== null && k !== void 0 ? k : 0, v.id = window.setTimeout(y);
|
|
367
|
+
};
|
|
368
|
+
v.id = window.setTimeout(y);
|
|
369
|
+
}, w = function() {
|
|
370
|
+
window.clearTimeout(v.id), v.id = -1, v.cachedId = -1;
|
|
371
|
+
}, d = function(y) {
|
|
372
|
+
try {
|
|
373
|
+
var m, k;
|
|
374
|
+
if (v.cachedId === v.id) throw new $("The input selection has not been updated.");
|
|
375
|
+
v.cachedId = v.id;
|
|
376
|
+
var P = a.value, g = a.selectionStart, T = a.selectionEnd;
|
|
377
|
+
if (g === null || T === null) throw new $("The selection attributes have not been initialized.");
|
|
378
|
+
var C, E = s.value;
|
|
379
|
+
if (y.inputType === void 0 && (s.selectionStart = 0, s.selectionEnd = E.length), g > s.selectionStart ? C = "insert" : g <= s.selectionStart && g < s.selectionEnd ? C = "deleteBackward" : g === s.selectionEnd && P.length < E.length && (C = "deleteForward"), C === void 0 || (C === "deleteBackward" || C === "deleteForward") && P.length > E.length) throw new $("Input type detection error.");
|
|
380
|
+
var I = "", N = s.selectionStart, B = s.selectionEnd;
|
|
381
|
+
if (C === "insert") I = P.slice(s.selectionStart, g);
|
|
382
|
+
else {
|
|
383
|
+
var D = E.length - P.length;
|
|
384
|
+
N = g, B = g + D;
|
|
385
|
+
}
|
|
386
|
+
h.value !== E ? h.options = h.fallbackOptions : h.fallbackOptions = h.options;
|
|
387
|
+
var F = h.options, R = r({ inputType: C, previousValue: E, previousOptions: F, value: P, addedValue: I, changeStart: N, changeEnd: B, selectionStart: g, selectionEnd: T }), _ = R.options, A = tt(R, nt);
|
|
388
|
+
a.value = A.value, a.setSelectionRange(A.selectionStart, A.selectionEnd), h.value = A.value, h.options = _, s.selectionStart = A.selectionStart, s.selectionEnd = A.selectionEnd, (m = a._valueTracker) === null || m === void 0 || (k = m.setValue) === null || k === void 0 || k.call(m, E);
|
|
389
|
+
} catch (W) {
|
|
390
|
+
if (a.value = s.value, a.setSelectionRange(s.selectionStart, s.selectionEnd), y.preventDefault(), y.stopPropagation(), W.name !== "SyntheticChangeError") throw W;
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
document.activeElement === a && S(), a.addEventListener("focus", S), a.addEventListener("blur", w), a.addEventListener("input", d), o.set(a, { onFocus: S, onBlur: w, onInput: d });
|
|
394
|
+
} else process.env.NODE_ENV !== "production" && console.warn("Warn: The input element type does not match one of the types: ".concat(he.join(", "), "."));
|
|
395
|
+
}, this.unregister = function(a) {
|
|
396
|
+
var l = o.get(a);
|
|
397
|
+
l !== void 0 && (a.removeEventListener("focus", l.onFocus), a.removeEventListener("blur", l.onBlur), a.removeEventListener("input", l.onInput), o.delete(a));
|
|
398
|
+
};
|
|
399
|
+
});
|
|
400
|
+
me = Ee, Object.defineProperty(me.prototype, Symbol.toStringTag, { writable: !1, enumerable: !1, configurable: !0, value: "Input" });
|
|
401
|
+
var X = function(e) {
|
|
402
|
+
return function() {
|
|
403
|
+
for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r];
|
|
404
|
+
return new e("".concat(n.join(`
|
|
405
|
+
|
|
406
|
+
`), `
|
|
407
|
+
`));
|
|
408
|
+
};
|
|
409
|
+
}, ye, rt = ["track", "modify"];
|
|
410
|
+
function x(e) {
|
|
411
|
+
var t, n, r, o;
|
|
412
|
+
return { mask: (t = e.mask) !== null && t !== void 0 ? t : "", replacement: typeof e.replacement == "string" ? K(e.replacement) : (n = e.replacement) !== null && n !== void 0 ? n : {}, showMask: (r = e.showMask) !== null && r !== void 0 && r, separate: (o = e.separate) !== null && o !== void 0 && o, track: e.track, modify: e.modify };
|
|
413
|
+
}
|
|
414
|
+
var Ce = function(e) {
|
|
415
|
+
function t() {
|
|
416
|
+
var n, r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
417
|
+
return $e(this, t), (n = Ue(this, t, [{ init: function(o) {
|
|
418
|
+
var a = o.initialValue, l = o.controlled, u = x(r), i = u.mask, c = u.replacement, p = u.separate, f = u.showMask;
|
|
419
|
+
return a = l || a ? a : f ? i : "", process.env.NODE_ENV !== "production" && function(b) {
|
|
420
|
+
var M = b.initialValue, j = b.mask, h = b.replacement;
|
|
421
|
+
M.length > j.length && console.error(X(Error)("The initialized value of the `value` or `defaultValue` property is longer than the value specified in the `mask` property. Check the correctness of the initialized value in the specified property.", 'Invalid value: "'.concat(M, '".'), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
|
|
422
|
+
var v = Object.keys(h).filter(function(d) {
|
|
423
|
+
return d.length > 1;
|
|
424
|
+
});
|
|
425
|
+
v.length > 0 && console.error(X(Error)("Object keys in the `replacement` property are longer than one character. Replacement keys must be one character long. Check the correctness of the value in the specified property.", "Invalid keys: ".concat(v.join(", "), "."), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
|
|
426
|
+
for (var s = j.slice(0, M.length), O = -1, S = 0; S < s.length; S++) {
|
|
427
|
+
var w = Object.prototype.hasOwnProperty.call(h, s[S]);
|
|
428
|
+
if (!(s[S] === M[S] || w && h[s[S]].test(M[S]))) {
|
|
429
|
+
O = S;
|
|
430
|
+
break;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
O !== -1 && console.error(X(Error)("An invalid character was found in the initialized property value `value` or `defaultValue` (index: ".concat(O, "). Check the correctness of the initialized value in the specified property."), 'Invalid value: "'.concat(M, '".'), "To initialize an unmasked value, use the `format` utility. More details https://github.com/GoncharukOrg/react-input/tree/main/packages/mask#initializing-the-value."));
|
|
434
|
+
}({ initialValue: a, mask: i, replacement: c }), { value: a, options: { mask: i, replacement: c, separate: p } };
|
|
435
|
+
}, tracking: function(o) {
|
|
436
|
+
var a = o.inputType, l = o.previousValue, u = o.previousOptions, i = o.addedValue, c = o.changeStart, p = o.changeEnd, f = x(r), b = f.track, M = f.modify, j = _e(f, rt), h = j.mask, v = j.replacement, s = j.showMask, O = j.separate, S = J(J({}, a === "insert" ? { inputType: a, data: i } : { inputType: a, data: null }), {}, { value: l, selectionStart: c, selectionEnd: p }), w = b?.(S);
|
|
437
|
+
if (w === !1) throw new $("Custom tracking stop.");
|
|
438
|
+
w === null ? i = "" : w !== !0 && w !== void 0 && (i = w);
|
|
439
|
+
var d = M?.(S);
|
|
440
|
+
d?.mask !== void 0 && (h = d.mask), d?.replacement !== void 0 && (v = typeof d?.replacement == "string" ? K(d?.replacement) : d.replacement), d?.showMask !== void 0 && (s = d.showMask), d?.separate !== void 0 && (O = d.separate);
|
|
441
|
+
var y = ne(l, J({ end: c }, u)), m = ne(l, J({ start: p }, u)), k = RegExp("[^".concat(Object.keys(v).join(""), "]"), "g"), P = h.replace(k, "");
|
|
442
|
+
if (y && (y = U(y, { replacementChars: P, replacement: v, separate: O }), P = P.slice(y.length)), i && (i = U(i, { replacementChars: P, replacement: v, separate: !1 }), P = P.slice(i.length)), a === "insert" && i === "") throw new $("The character does not match the key value of the `replacement` object.");
|
|
443
|
+
if (O) {
|
|
444
|
+
var g = h.slice(c, p).replace(k, ""), T = g.length - i.length;
|
|
445
|
+
T < 0 ? m = m.slice(-T) : T > 0 && (m = g.slice(-T) + m);
|
|
446
|
+
}
|
|
447
|
+
m && (m = U(m, { replacementChars: P, replacement: v, separate: O }));
|
|
448
|
+
var C = Se(y + i + m, { mask: h, replacement: v, separate: O, showMask: s }), E = function(I) {
|
|
449
|
+
var N, B, D, F = I.inputType, R = I.value, _ = I.addedValue, A = I.beforeChangeValue, W = I.mask, oe = I.replacement, je = I.separate, Q = we(R, { mask: W, replacement: oe }).filter(function(q) {
|
|
450
|
+
var ue = q.type;
|
|
451
|
+
return ue === "input" || je && ue === "replacement";
|
|
452
|
+
}), ie = (N = Q[A.length + _.length - 1]) === null || N === void 0 ? void 0 : N.index, G = (B = Q[A.length - 1]) === null || B === void 0 ? void 0 : B.index, L = (D = Q[A.length + _.length]) === null || D === void 0 ? void 0 : D.index;
|
|
453
|
+
if (F === "insert") {
|
|
454
|
+
if (ie !== void 0) return ie + 1;
|
|
455
|
+
if (L !== void 0) return L;
|
|
456
|
+
if (G !== void 0) return G + 1;
|
|
457
|
+
}
|
|
458
|
+
if (F === "deleteForward") {
|
|
459
|
+
if (L !== void 0) return L;
|
|
460
|
+
if (G !== void 0) return G + 1;
|
|
461
|
+
}
|
|
462
|
+
if (F === "deleteBackward") {
|
|
463
|
+
if (G !== void 0) return G + 1;
|
|
464
|
+
if (L !== void 0) return L;
|
|
465
|
+
}
|
|
466
|
+
var le = R.split("").findIndex(function(q) {
|
|
467
|
+
return Object.prototype.hasOwnProperty.call(oe, q);
|
|
468
|
+
});
|
|
469
|
+
return le !== -1 ? le : R.length;
|
|
470
|
+
}({ inputType: a, value: C, addedValue: i, beforeChangeValue: y, mask: h, replacement: v, separate: O });
|
|
471
|
+
return { value: C, selectionStart: E, selectionEnd: E, options: { mask: h, replacement: v, separate: O } };
|
|
472
|
+
} }])).format = function(o) {
|
|
473
|
+
return ke(o, x(r));
|
|
474
|
+
}, n.formatToParts = function(o) {
|
|
475
|
+
return Ze(o, x(r));
|
|
476
|
+
}, n.unformat = function(o) {
|
|
477
|
+
return We(o, x(r));
|
|
478
|
+
}, n.generatePattern = function(o) {
|
|
479
|
+
return Ye(o, x(r));
|
|
480
|
+
}, n;
|
|
481
|
+
}
|
|
482
|
+
return He(t, Ee), ze(t);
|
|
483
|
+
}();
|
|
484
|
+
ye = Ce, Object.defineProperty(ye.prototype, Symbol.toStringTag, { writable: !1, enumerable: !1, configurable: !0, value: "Mask" });
|
|
485
|
+
function at() {
|
|
486
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.mask, n = e.replacement, r = e.showMask, o = e.separate, a = e.track, l = e.modify, u = ee(null), i = ee({ mask: t, replacement: n, showMask: r, separate: o, track: a, modify: l });
|
|
487
|
+
return i.current.mask = t, i.current.replacement = n, i.current.showMask = r, i.current.separate = o, i.current.track = a, i.current.modify = l, Ie(function() {
|
|
488
|
+
return Qe(u, new Ce(i.current));
|
|
489
|
+
}, []);
|
|
490
|
+
}
|
|
491
|
+
const ot = "en", it = { AF: "Afghanistan", AL: "Albania", DZ: "Algeria", AS: "American Samoa", AD: "Andorra", AO: "Angola", AI: "Anguilla", AQ: "Antarctica", AG: "Antigua and Barbuda", AR: "Argentina", AM: "Armenia", AW: "Aruba", AU: "Australia", AT: "Austria", AZ: "Azerbaijan", BS: "Bahamas", BH: "Bahrain", BD: "Bangladesh", BB: "Barbados", BY: "Belarus", BE: "Belgium", BZ: "Belize", BJ: "Benin", BM: "Bermuda", BT: "Bhutan", BO: "Bolivia", BA: "Bosnia and Herzegovina", BW: "Botswana", BV: "Bouvet Island", BR: "Brazil", IO: "British Indian Ocean Territory", BN: "Brunei Darussalam", BG: "Bulgaria", BF: "Burkina Faso", BI: "Burundi", KH: "Cambodia", CM: "Cameroon", CA: "Canada", CV: "Cape Verde", KY: "Cayman Islands", CF: "Central African Republic", TD: "Chad", CL: "Chile", CN: ["People's Republic of China", "China"], CX: "Christmas Island", CC: "Cocos (Keeling) Islands", CO: "Colombia", KM: "Comoros", CG: ["Republic of the Congo", "Congo"], CD: ["Democratic Republic of the Congo", "Congo"], CK: "Cook Islands", CR: "Costa Rica", CI: ["Cote d'Ivoire", "Côte d'Ivoire", "Ivory Coast"], HR: "Croatia", CU: "Cuba", CY: "Cyprus", CZ: ["Czech Republic", "Czechia"], DK: "Denmark", DJ: "Djibouti", DM: "Dominica", DO: "Dominican Republic", EC: "Ecuador", EG: "Egypt", SV: "El Salvador", GQ: "Equatorial Guinea", ER: "Eritrea", EE: "Estonia", ET: "Ethiopia", FK: "Falkland Islands (Malvinas)", FO: "Faroe Islands", FJ: "Fiji", FI: "Finland", FR: "France", GF: "French Guiana", PF: "French Polynesia", TF: "French Southern Territories", GA: "Gabon", GM: ["Republic of The Gambia", "The Gambia", "Gambia"], GE: "Georgia", DE: "Germany", GH: "Ghana", GI: "Gibraltar", GR: "Greece", GL: "Greenland", GD: "Grenada", GP: "Guadeloupe", GU: "Guam", GT: "Guatemala", GN: "Guinea", GW: "Guinea-Bissau", GY: "Guyana", HT: "Haiti", HM: "Heard Island and McDonald Islands", VA: "Holy See (Vatican City State)", HN: "Honduras", HK: "Hong Kong", HU: "Hungary", IS: "Iceland", IN: "India", ID: "Indonesia", IR: ["Islamic Republic of Iran", "Iran"], IQ: "Iraq", IE: "Ireland", IL: "Israel", IT: "Italy", JM: "Jamaica", JP: "Japan", JO: "Jordan", KZ: "Kazakhstan", KE: "Kenya", KI: "Kiribati", KP: "North Korea", KR: ["South Korea", "Korea, Republic of", "Republic of Korea"], KW: "Kuwait", KG: "Kyrgyzstan", LA: "Lao People's Democratic Republic", LV: "Latvia", LB: "Lebanon", LS: "Lesotho", LR: "Liberia", LY: "Libya", LI: "Liechtenstein", LT: "Lithuania", LU: "Luxembourg", MO: "Macao", MG: "Madagascar", MW: "Malawi", MY: "Malaysia", MV: "Maldives", ML: "Mali", MT: "Malta", MH: "Marshall Islands", MQ: "Martinique", MR: "Mauritania", MU: "Mauritius", YT: "Mayotte", MX: "Mexico", FM: "Micronesia, Federated States of", MD: "Moldova, Republic of", MC: "Monaco", MN: "Mongolia", MS: "Montserrat", MA: "Morocco", MZ: "Mozambique", MM: "Myanmar", NA: "Namibia", NR: "Nauru", NP: "Nepal", NL: ["Netherlands", "The Netherlands", "Netherlands (Kingdom of the)"], NC: "New Caledonia", NZ: "New Zealand", NI: "Nicaragua", NE: "Niger", NG: "Nigeria", NU: "Niue", NF: "Norfolk Island", MK: ["The Republic of North Macedonia", "North Macedonia"], MP: "Northern Mariana Islands", NO: "Norway", OM: "Oman", PK: "Pakistan", PW: "Palau", PS: ["State of Palestine", "Palestine"], PA: "Panama", PG: "Papua New Guinea", PY: "Paraguay", PE: "Peru", PH: "Philippines", PN: ["Pitcairn", "Pitcairn Islands"], PL: "Poland", PT: "Portugal", PR: "Puerto Rico", QA: "Qatar", RE: "Reunion", RO: "Romania", RU: ["Russian Federation", "Russia"], RW: "Rwanda", SH: "Saint Helena", KN: "Saint Kitts and Nevis", LC: "Saint Lucia", PM: "Saint Pierre and Miquelon", VC: "Saint Vincent and the Grenadines", WS: "Samoa", SM: "San Marino", ST: "Sao Tome and Principe", SA: "Saudi Arabia", SN: "Senegal", SC: "Seychelles", SL: "Sierra Leone", SG: "Singapore", SK: "Slovakia", SI: "Slovenia", SB: "Solomon Islands", SO: "Somalia", ZA: "South Africa", GS: "South Georgia and the South Sandwich Islands", ES: "Spain", LK: "Sri Lanka", SD: "Sudan", SR: "Suriname", SJ: "Svalbard and Jan Mayen", SZ: "Eswatini", SE: "Sweden", CH: "Switzerland", SY: "Syrian Arab Republic", TW: ["Taiwan, Province of China", "Taiwan"], TJ: "Tajikistan", TZ: ["United Republic of Tanzania", "Tanzania"], TH: "Thailand", TL: "Timor-Leste", TG: "Togo", TK: "Tokelau", TO: "Tonga", TT: "Trinidad and Tobago", TN: "Tunisia", TR: ["Türkiye", "Turkey"], TM: "Turkmenistan", TC: "Turks and Caicos Islands", TV: "Tuvalu", UG: "Uganda", UA: "Ukraine", AE: ["United Arab Emirates", "UAE"], GB: ["United Kingdom", "UK", "Great Britain"], US: ["United States of America", "United States", "USA", "U.S.A.", "US", "U.S."], UM: "United States Minor Outlying Islands", UY: "Uruguay", UZ: "Uzbekistan", VU: "Vanuatu", VE: "Venezuela", VN: "Vietnam", VG: "Virgin Islands, British", VI: "Virgin Islands, U.S.", WF: "Wallis and Futuna", EH: "Western Sahara", YE: "Yemen", ZM: "Zambia", ZW: "Zimbabwe", AX: ["Åland Islands", "Aland Islands"], BQ: "Bonaire, Sint Eustatius and Saba", CW: "Curaçao", GG: "Guernsey", IM: "Isle of Man", JE: "Jersey", ME: "Montenegro", BL: "Saint Barthélemy", MF: "Saint Martin (French part)", RS: "Serbia", SX: "Sint Maarten (Dutch part)", SS: "South Sudan", XK: "Kosovo" }, lt = {
|
|
492
|
+
locale: ot,
|
|
493
|
+
countries: it
|
|
494
|
+
};
|
|
495
|
+
Te.registerLocale(lt);
|
|
496
|
+
const gt = Ae(
|
|
497
|
+
({
|
|
498
|
+
disabled: e = !1,
|
|
499
|
+
error: t,
|
|
500
|
+
helperText: n,
|
|
501
|
+
helperTextClassName: r,
|
|
502
|
+
isRequired: o,
|
|
503
|
+
label: a,
|
|
504
|
+
labelClassName: l,
|
|
505
|
+
name: u,
|
|
506
|
+
placeholder: i,
|
|
507
|
+
showFlagOnSearch: c = !0,
|
|
508
|
+
showInputFilter: p = !0,
|
|
509
|
+
showNameOnSearch: f = !0,
|
|
510
|
+
wrapperClassName: b,
|
|
511
|
+
showPlaceHolder: M,
|
|
512
|
+
...j
|
|
513
|
+
}, h) => {
|
|
514
|
+
const v = u ?? Ne(), s = ee(null), {
|
|
515
|
+
isOpenSelector: O,
|
|
516
|
+
value: S,
|
|
517
|
+
selectedCountry: w,
|
|
518
|
+
onChangeValue: d,
|
|
519
|
+
handleOpenSelector: y
|
|
520
|
+
} = xe(), m = typeof t == "string" && t.length >= 0, k = at({
|
|
521
|
+
mask: Ke(w),
|
|
522
|
+
replacement: { _: /\d/ }
|
|
523
|
+
});
|
|
524
|
+
Be(h, () => k.current, [k]);
|
|
525
|
+
const P = Re(
|
|
526
|
+
(g) => {
|
|
527
|
+
g.target.value.startsWith(w.prefix) ? d(g.target.value) : d(`${w.prefix} `);
|
|
528
|
+
},
|
|
529
|
+
[w.prefix, d]
|
|
530
|
+
);
|
|
531
|
+
return ce(() => {
|
|
532
|
+
const g = new AbortController(), T = (E) => {
|
|
533
|
+
E.key === "Escape" && y(!1);
|
|
534
|
+
}, C = (E) => {
|
|
535
|
+
s.current?.contains(E.target) || y(!1);
|
|
536
|
+
};
|
|
537
|
+
return document.addEventListener("keydown", T, {
|
|
538
|
+
signal: g.signal
|
|
539
|
+
}), document.addEventListener("mousedown", C, {
|
|
540
|
+
signal: g.signal
|
|
541
|
+
}), document.addEventListener(
|
|
542
|
+
"visibilitychange",
|
|
543
|
+
() => {
|
|
544
|
+
document.hidden && y(!1);
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
signal: g.signal
|
|
548
|
+
}
|
|
549
|
+
), () => {
|
|
550
|
+
g.abort();
|
|
551
|
+
};
|
|
552
|
+
}, [y, s]), ce(() => {
|
|
553
|
+
k.current && (k.current.value = w.prefix + " ");
|
|
554
|
+
}, [w.code]), /* @__PURE__ */ Z("div", { className: "w-full flex flex-col gap-2", children: [
|
|
555
|
+
a ? /* @__PURE__ */ Z(
|
|
556
|
+
"label",
|
|
557
|
+
{
|
|
558
|
+
id: v,
|
|
559
|
+
className: Le({ className: l }),
|
|
560
|
+
onClick: () => !e && k.current?.focus(),
|
|
561
|
+
children: [
|
|
562
|
+
a,
|
|
563
|
+
o && /* @__PURE__ */ V("span", { className: "text-red-600 ml-1", children: "*" })
|
|
564
|
+
]
|
|
565
|
+
}
|
|
566
|
+
) : null,
|
|
567
|
+
/* @__PURE__ */ Z(
|
|
568
|
+
"div",
|
|
569
|
+
{
|
|
570
|
+
ref: s,
|
|
571
|
+
"data-state": O ? "open" : "closed",
|
|
572
|
+
className: Ve({
|
|
573
|
+
className: b,
|
|
574
|
+
variant: m ? "error" : "default"
|
|
575
|
+
}),
|
|
576
|
+
children: [
|
|
577
|
+
/* @__PURE__ */ Z("div", { className: "p-2 flex items-center gap-2.5", children: [
|
|
578
|
+
/* @__PURE__ */ V(De, {}),
|
|
579
|
+
/* @__PURE__ */ V(
|
|
580
|
+
"input",
|
|
581
|
+
{
|
|
582
|
+
id: a ? v : void 0,
|
|
583
|
+
ref: k,
|
|
584
|
+
name: u,
|
|
585
|
+
autoComplete: "off",
|
|
586
|
+
className: "outline-0 w-full caret-slate-800 text-slate-800 bg-transparent dark:caret-slate-50 dark:text-slate-50 disabled:cursor-not-allowed disabled:opacity-50",
|
|
587
|
+
type: "tel",
|
|
588
|
+
inputMode: "tel",
|
|
589
|
+
value: S,
|
|
590
|
+
onChange: P,
|
|
591
|
+
disabled: e,
|
|
592
|
+
...j
|
|
593
|
+
}
|
|
594
|
+
)
|
|
595
|
+
] }),
|
|
596
|
+
O && /* @__PURE__ */ V(
|
|
597
|
+
Fe,
|
|
598
|
+
{
|
|
599
|
+
placeholder: i,
|
|
600
|
+
showFlagOnSearch: c,
|
|
601
|
+
showInputFilter: p,
|
|
602
|
+
showNameOnSearch: f,
|
|
603
|
+
showPlaceHolder: M
|
|
604
|
+
}
|
|
605
|
+
)
|
|
606
|
+
]
|
|
607
|
+
}
|
|
608
|
+
),
|
|
609
|
+
t ? /* @__PURE__ */ V("span", { className: "text-xs text-red-700 dark:text-red-500", children: t }) : null,
|
|
610
|
+
!t && n ? /* @__PURE__ */ V(
|
|
611
|
+
"span",
|
|
612
|
+
{
|
|
613
|
+
className: Ge(
|
|
614
|
+
"text-xs text-slate-600 dark:text-slate-200 kubefirst-dark:text-slate-200",
|
|
615
|
+
r
|
|
616
|
+
),
|
|
617
|
+
children: n
|
|
618
|
+
}
|
|
619
|
+
) : null
|
|
620
|
+
] });
|
|
621
|
+
}
|
|
622
|
+
);
|
|
623
|
+
export {
|
|
624
|
+
gt as Wrapper
|
|
625
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PhoneNumberContext as r } from "./phone-number.context.js";
|
|
2
|
+
import { PhoneNumberProvider as m } from "./phone-number.provider.js";
|
|
3
|
+
import { usePhoneNumberContext as x } from "./phone-number.hook.js";
|
|
4
|
+
export {
|
|
5
|
+
r as PhoneNumberContext,
|
|
6
|
+
m as PhoneNumberProvider,
|
|
7
|
+
x as usePhoneNumberContext
|
|
8
|
+
};
|