inertia-bootstrap-forms 2.1.21 → 3.0.0

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 (59) hide show
  1. package/README.fa.md +468 -0
  2. package/README.md +322 -714
  3. package/dist/inertia-bootstrap-forms.cjs.js +1 -0
  4. package/dist/inertia-bootstrap-forms.es.js +3524 -30
  5. package/index.d.ts +143 -507
  6. package/package.json +89 -70
  7. package/src/AmountInput.vue +81 -76
  8. package/src/CaptchaInput.vue +87 -88
  9. package/src/CheckboxButtonInput.vue +56 -69
  10. package/src/CheckboxInput.vue +60 -79
  11. package/src/CheckboxToggle.vue +53 -136
  12. package/src/ChipsInput.vue +157 -0
  13. package/src/ComboboxInput.vue +556 -0
  14. package/src/DropzoneInput.vue +125 -103
  15. package/src/EditorInput.vue +47 -106
  16. package/src/EmailInput.vue +16 -15
  17. package/src/FileInput.vue +189 -179
  18. package/src/FormAdornInput.vue +75 -0
  19. package/src/FormContainer.vue +288 -251
  20. package/src/FormField.vue +59 -0
  21. package/src/FormLabel.vue +27 -27
  22. package/src/GroupControl.vue +55 -53
  23. package/src/LocationInput.vue +79 -72
  24. package/src/MobileInput.vue +21 -13
  25. package/src/MultiQuantityInput.vue +109 -181
  26. package/src/OTPInput.vue +144 -76
  27. package/src/PasswordInput.vue +151 -17
  28. package/src/PersianDatePickerInput.vue +63 -166
  29. package/src/QuantityInput.vue +100 -119
  30. package/src/RangeInput.vue +96 -0
  31. package/src/SimpleUploader.vue +8 -143
  32. package/src/StarRatingInput.vue +114 -138
  33. package/src/SubmitButton.vue +39 -24
  34. package/src/SwitchInput.vue +58 -83
  35. package/src/TelInput.vue +86 -120
  36. package/src/TextAreaInput.vue +29 -33
  37. package/src/TextInput.vue +42 -51
  38. package/src/UppyInput.vue +237 -324
  39. package/src/composables/useBsInstance.js +66 -0
  40. package/src/composables/useChoice.js +34 -0
  41. package/src/composables/useDisposables.js +59 -0
  42. package/src/composables/useField.js +121 -0
  43. package/src/composables/useFormApi.js +12 -0
  44. package/src/i18n.js +120 -0
  45. package/src/index.js +123 -42
  46. package/src/utils/bootstrap.js +48 -0
  47. package/src/utils/digits.js +21 -0
  48. package/src/utils/http.js +15 -0
  49. package/dist/choices-KiM-I_0P.js +0 -2955
  50. package/dist/dropdown-yh2aQrbw-XuCU1v1F.js +0 -1543
  51. package/dist/index-BRtKc2RA.js +0 -604
  52. package/dist/index-_x4UqcXz.js +0 -4938
  53. package/dist/inertia-bootstrap-forms.umd.js +0 -19
  54. package/dist/range-slider-pips-DTDOg3Q9.js +0 -3506
  55. package/dist/style.css +0 -1
  56. package/src/css/from-select.scss +0 -384
  57. package/src/css/loader.gif +0 -0
  58. package/src/css/location.scss +0 -44
  59. package/src/css/simple-upload.scss +0 -54
@@ -1,32 +1,3526 @@
1
- import { A as n, C as p, a as s, b as u, c as e, _ as o, d as I, E as i, F as r, g as l, m as c, G as m, L as b, M as C, i as S, O as h, h as x, P as d, Q as g, R as k, l as P, e as T, k as F, j as y, S as A, n as E, o as L, p as M, f as Q } from "./index-_x4UqcXz.js";
1
+ import * as he from "vue";
2
+ import { inject as Z, computed as S, ref as B, watch as q, reactive as $e, defineComponent as E, createElementBlock as b, openBlock as v, normalizeClass as F, renderSlot as j, createElementVNode as $, createCommentVNode as A, toDisplayString as N, onBeforeUnmount as Ze, withDirectives as ee, vModelText as Ye, normalizeStyle as le, onMounted as K, vModelDynamic as me, createTextVNode as ue, shallowRef as Qe, nextTick as X, Fragment as Y, renderList as oe, resolveComponent as U, createBlock as Q, defineAsyncComponent as x, mergeProps as ve, withModifiers as Ue, provide as ge, withCtx as pe, createVNode as te, h as fn, vModelCheckbox as mn } from "vue";
3
+ import { useForm as pn } from "@inertiajs/vue3";
4
+ let yn = 0;
5
+ const R = {
6
+ /** Key of the field inside the FormContainer's v-model object. */
7
+ name: { type: String, default: null },
8
+ /** Standalone v-model (only used when the field is NOT inside a FormContainer). */
9
+ modelValue: { type: null, default: void 0 },
10
+ id: { type: String, default: null },
11
+ disabled: { type: Boolean, default: !1 },
12
+ readonly: { type: Boolean, default: !1 },
13
+ required: { type: Boolean, default: !1 },
14
+ /** Force the invalid state. By default it follows the server-side errors of the form. */
15
+ invalid: { type: Boolean, default: null }
16
+ };
17
+ function P(e, n, o = {}) {
18
+ const l = Z("form", null), r = Z("group", null), d = Z("formField", null), t = Z("formApi", null), a = S(() => (l == null ? void 0 : l.value) ?? null), f = S(() => {
19
+ var k;
20
+ return (k = r == null ? void 0 : r.value) != null && k.name ? r.value : null;
21
+ }), m = S(() => !a.value), p = B(
22
+ e.modelValue === void 0 ? o.defaultValue ?? null : e.modelValue
23
+ );
24
+ q(
25
+ () => e.modelValue,
26
+ (k) => {
27
+ m.value && k !== void 0 && (p.value = k);
28
+ }
29
+ );
30
+ const h = S({
31
+ get() {
32
+ return m.value ? p.value : f.value ? f.value.getData(e.name) : a.value[e.name];
33
+ },
34
+ set(k) {
35
+ m.value ? p.value = k : f.value ? f.value.setData(e.name, k) : a.value[e.name] = k, n("update:modelValue", k);
36
+ }
37
+ }), g = S(() => {
38
+ const k = [];
39
+ return f.value && (k.push(`${f.value.name}.${f.value.index}.${e.name}`), k.push(`${f.value.name}.${e.name}`)), k.push(e.name), k;
40
+ }), I = S(() => {
41
+ var T;
42
+ const k = (T = a.value) == null ? void 0 : T.errors;
43
+ if (!k) return null;
44
+ for (const M of g.value)
45
+ if (M && k[M] !== void 0) return k[M];
46
+ return null;
47
+ }), s = S(() => e.invalid === !0 || e.invalid === null && I.value !== null), c = S(() => {
48
+ var k;
49
+ return e.disabled || !!((k = a.value) != null && k.processing);
50
+ }), i = he.useId ? he.useId() : `ibf-${++yn}`, u = S(() => {
51
+ var k;
52
+ return e.id ? e.id : d != null && d.id && !o.valued ? d.id : (k = a.value) != null && k.getID && e.name ? a.value.getID({
53
+ name: e.name,
54
+ value: o.valued ? o.valued() : void 0,
55
+ group: f.value
56
+ }) : e.name ? `${e.name}-${i}` : i;
57
+ });
58
+ return {
59
+ form: a,
60
+ group: f,
61
+ standalone: m,
62
+ model: h,
63
+ error: I,
64
+ isInvalid: s,
65
+ isDisabled: c,
66
+ inputId: u,
67
+ emitChange: (k, T) => n("change", k, T),
68
+ formApi: t,
69
+ fieldCtx: d
70
+ };
71
+ }
72
+ const ne = $e({
73
+ locale: "auto",
74
+ messages: {
75
+ en: {
76
+ "select.placeholder": "Select an option…",
77
+ "select.search": "Type to search…",
78
+ "select.noResults": "No results found",
79
+ "select.loading": "Searching…",
80
+ "select.selectedCount": "{count} selected",
81
+ "select.clear": "— Clear selection —",
82
+ "select.error": "Search failed",
83
+ "submit.default": "Submit",
84
+ "chips.placeholder": "Type and press Enter…",
85
+ "chips.remove": "Remove",
86
+ "email.placeholder": "Enter your email",
87
+ "password.placeholder": "Enter your password",
88
+ "password.show": "Show password",
89
+ "password.hide": "Hide password",
90
+ "mobile.placeholder": "Enter your mobile number",
91
+ "amount.placeholder": "Enter a number",
92
+ "amount.unit": "pcs",
93
+ "quantity.unit": "pcs",
94
+ "quantity.increase": "Increase",
95
+ "quantity.decrease": "Decrease",
96
+ "captcha.placeholder": "Enter the code shown",
97
+ "captcha.refresh": "Refresh code",
98
+ "captcha.alt": "captcha",
99
+ "file.retry": "Retry",
100
+ "file.remove": "Remove",
101
+ "upload.failed": "Upload failed",
102
+ "uppy.types": "Only {types} files",
103
+ "uppy.maxFiles": "up to {count} files",
104
+ "uppy.minFiles": "at least {count} files required",
105
+ "uppy.maxSize": "max {size} per file",
106
+ "uppy.minSize": "min {size} per file",
107
+ "uppy.maxTotal": "max {size} in total",
108
+ "uppy.suffix": "are allowed."
109
+ },
110
+ fa: {
111
+ "select.placeholder": "انتخاب کنید…",
112
+ "select.search": "برای جستجو تایپ کنید…",
113
+ "select.noResults": "نتیجه‌ای یافت نشد",
114
+ "select.loading": "در حال جستجو…",
115
+ "select.selectedCount": "{count} مورد انتخاب شده",
116
+ "select.clear": "— پاک کردن انتخاب —",
117
+ "select.error": "جستجو با خطا مواجه شد",
118
+ "submit.default": "تایید و ثبت اطلاعات",
119
+ "chips.placeholder": "تایپ کنید و Enter بزنید…",
120
+ "chips.remove": "حذف",
121
+ "email.placeholder": "ایمیل خود را وارد کنید",
122
+ "password.placeholder": "گذرواژه خود را وارد کنید",
123
+ "password.show": "نمایش گذرواژه",
124
+ "password.hide": "مخفی کردن گذرواژه",
125
+ "mobile.placeholder": "موبایل خود را وارد کنید",
126
+ "amount.placeholder": "عدد را وارد کنید",
127
+ "amount.unit": "عدد",
128
+ "quantity.unit": "عدد",
129
+ "quantity.increase": "افزایش",
130
+ "quantity.decrease": "کاهش",
131
+ "captcha.placeholder": "کد امنیتی روبرو را وارد کنید",
132
+ "captcha.refresh": "کد جدید",
133
+ "captcha.alt": "کد امنیتی",
134
+ "file.retry": "تلاش مجدد",
135
+ "file.remove": "حذف",
136
+ "upload.failed": "خطا در آپلود",
137
+ "uppy.types": "فقط فایل‌های {types}",
138
+ "uppy.maxFiles": "امکان انتخاب حداکثر {count} فایل",
139
+ "uppy.minFiles": "حداقل {count} فایل نیاز است",
140
+ "uppy.maxSize": "با حداکثر حجم {size} برای هر فایل",
141
+ "uppy.minSize": "با حداقل حجم {size} برای هر فایل",
142
+ "uppy.maxTotal": "و مجموع حجم کل حداکثر {size}",
143
+ "uppy.suffix": "مجاز است."
144
+ }
145
+ }
146
+ });
147
+ function hn({ locale: e, messages: n } = {}) {
148
+ e && (ne.locale = e), n && Object.keys(n).forEach((o) => {
149
+ ne.messages[o] = { ...ne.messages[o] || {}, ...n[o] };
150
+ });
151
+ }
152
+ function vn() {
153
+ var e;
154
+ if (typeof document < "u") {
155
+ const n = document.documentElement;
156
+ if ((n == null ? void 0 : n.dir) === "rtl" || (e = n == null ? void 0 : n.getAttribute("lang")) != null && e.startsWith("fa")) return "fa";
157
+ }
158
+ return "en";
159
+ }
160
+ function G(e = () => null) {
161
+ const n = S(() => {
162
+ const l = e() || ne.locale;
163
+ return l === "auto" ? vn() : l;
164
+ });
165
+ return { t: (l, r = {}) => {
166
+ let t = (ne.messages[n.value] || ne.messages.en)[l] ?? ne.messages.en[l] ?? l;
167
+ return Object.keys(r).forEach((a) => {
168
+ t = t.replace(new RegExp(`\\{${a}\\}`, "g"), r[a]);
169
+ }), t;
170
+ }, locale: n };
171
+ }
172
+ const gn = "۰۱۲۳۴۵۶۷۸۹", bn = "٠١٢٣٤٥٦٧٨٩";
173
+ function De(e) {
174
+ return String(e ?? "").replace(/[۰-۹٠-٩]/g, (n) => {
175
+ const o = gn.indexOf(n);
176
+ return String(o !== -1 ? o : bn.indexOf(n));
177
+ });
178
+ }
179
+ function be(e) {
180
+ if (e == null || e === "") return "";
181
+ const n = Number(e);
182
+ return Number.isNaN(n) ? "" : n.toLocaleString("en-US");
183
+ }
184
+ function xe(e) {
185
+ const n = De(e).replace(/\D/g, "");
186
+ return n === "" ? null : parseInt(n, 10);
187
+ }
188
+ const O = (e, n) => {
189
+ const o = e.__vccOpts || e;
190
+ for (const [l, r] of n)
191
+ o[l] = r;
192
+ return o;
193
+ }, $n = E({
194
+ name: "AmountInput",
195
+ emits: ["update:modelValue", "change", "input", "focus", "blur"],
196
+ props: {
197
+ ...R,
198
+ placeholder: { type: String, default: null },
199
+ unit: { type: String, default: null },
200
+ min: { type: Number, default: null },
201
+ max: { type: Number, default: null },
202
+ inputClass: { type: [String, Array, Object], default: null },
203
+ size: { type: String, default: null },
204
+ locale: { type: String, default: null }
205
+ },
206
+ setup(e, { emit: n }) {
207
+ const o = P(e, n), { t: l } = G(() => e.locale), r = S(() => be(o.model.value)), d = S(() => e.unit ?? l("amount.unit")), t = S(() => e.size ? `form-control-${e.size}` : null);
208
+ function a(m) {
209
+ const p = m.target, h = p.value.slice(0, p.selectionStart ?? 0), g = De(h).replace(/\D/g, "").length, I = xe(p.value);
210
+ o.model.value = I;
211
+ const s = be(I);
212
+ p.value = s;
213
+ let c = 0, i = 0;
214
+ for (; c < s.length && i < g; )
215
+ /\d/.test(s[c]) && i++, c++;
216
+ document.activeElement === p && p.setSelectionRange(c, c), n("input", I, m);
217
+ }
218
+ function f(m) {
219
+ let p = o.model.value;
220
+ p != null && (e.max !== null && p > e.max && (p = e.max), e.min !== null && p < e.min && (p = e.min), p !== o.model.value && (o.model.value = p)), o.emitChange(p, m);
221
+ }
222
+ return { ...o, displayValue: r, unitText: d, sizeClass: t, onInput: a, clamp: f, t: l };
223
+ }
224
+ }), Sn = ["name", "id", "value", "placeholder", "required", "readonly", "disabled", "aria-invalid"], In = {
225
+ key: 0,
226
+ class: "input-group-text fanum"
227
+ };
228
+ function Cn(e, n, o, l, r, d) {
229
+ return v(), b("div", {
230
+ class: F(["input-group", { "is-invalid": e.isInvalid }])
231
+ }, [
232
+ j(e.$slots, "prefix"),
233
+ $("input", {
234
+ name: e.name,
235
+ id: e.inputId,
236
+ value: e.displayValue,
237
+ placeholder: e.placeholder ?? e.t("amount.placeholder"),
238
+ required: e.required,
239
+ readonly: e.readonly,
240
+ disabled: e.isDisabled,
241
+ "aria-invalid": e.isInvalid || void 0,
242
+ type: "tel",
243
+ inputmode: "numeric",
244
+ autocomplete: "off",
245
+ class: F(["form-control fanum", [e.sizeClass, e.inputClass, { "is-invalid": e.isInvalid }]]),
246
+ onInput: n[0] || (n[0] = (...t) => e.onInput && e.onInput(...t)),
247
+ onChange: n[1] || (n[1] = (...t) => e.clamp && e.clamp(...t)),
248
+ onFocus: n[2] || (n[2] = (t) => e.$emit("focus", t)),
249
+ onBlur: n[3] || (n[3] = (t) => e.$emit("blur", t))
250
+ }, null, 42, Sn),
251
+ e.unitText ? (v(), b("span", In, N(e.unitText), 1)) : A("", !0),
252
+ j(e.$slots, "suffix")
253
+ ], 2);
254
+ }
255
+ const wn = /* @__PURE__ */ O($n, [["render", Cn]]);
256
+ function ye() {
257
+ const e = [];
258
+ let n = !1;
259
+ const o = (a) => {
260
+ if (n) {
261
+ try {
262
+ a();
263
+ } catch {
264
+ }
265
+ return () => {
266
+ };
267
+ }
268
+ return e.push(a), () => {
269
+ const f = e.indexOf(a);
270
+ f !== -1 && e.splice(f, 1);
271
+ };
272
+ }, l = (a, f, m, p) => a ? (a.addEventListener(f, m, p), o(() => a.removeEventListener(f, m, p))) : () => {
273
+ }, r = (a, f) => {
274
+ const m = setTimeout(a, f);
275
+ return o(() => clearTimeout(m)), m;
276
+ }, d = () => {
277
+ const a = new AbortController();
278
+ return o(() => a.abort()), a;
279
+ }, t = () => {
280
+ for (n = !0; e.length; )
281
+ try {
282
+ e.pop()();
283
+ } catch {
284
+ }
285
+ };
286
+ return Ze(t), {
287
+ add: o,
288
+ listen: l,
289
+ timeout: r,
290
+ abortable: d,
291
+ dispose: t,
292
+ isDisposed: () => n
293
+ };
294
+ }
295
+ const kn = E({
296
+ name: "CaptchaInput",
297
+ emits: ["update:modelValue", "change", "input", "refresh"],
298
+ props: {
299
+ ...R,
300
+ name: { type: String, default: "captcha" },
301
+ /** Endpoint that returns the captcha image. */
302
+ url: { type: String, default: "/captcha/default" },
303
+ placeholder: { type: String, default: null },
304
+ /** Reload the image (and clear the input) when a submit finishes. */
305
+ refreshOnSubmit: { type: Boolean, default: !0 },
306
+ imageWidth: { type: [Number, String], default: 82 },
307
+ imageHeight: { type: [Number, String], default: 38 },
308
+ locale: { type: String, default: null }
309
+ },
310
+ setup(e, { emit: n, expose: o }) {
311
+ const l = P(e, n), { t: r } = G(() => e.locale), d = ye(), t = B(null), a = B(!0);
312
+ function f() {
313
+ a.value = !0, t.value = `${e.url}${e.url.includes("?") ? "&" : "?"}t=${Date.now()}`, d.timeout(() => {
314
+ a.value = !1;
315
+ }, 500), n("refresh");
316
+ }
317
+ return K(f), q(
318
+ () => {
319
+ var m;
320
+ return (m = l.form.value) == null ? void 0 : m.processing;
321
+ },
322
+ (m, p) => {
323
+ e.refreshOnSubmit && p && !m && (l.model.value = null, f());
324
+ }
325
+ ), o({ refresh: f }), { ...l, t: r, src: t, loading: a, refresh: f };
326
+ }
327
+ }), Mn = ["name", "id", "placeholder", "required", "readonly", "disabled", "aria-invalid"], Bn = ["src", "alt", "width", "height"], Tn = {
328
+ key: 1,
329
+ class: "placeholder-wave w-100",
330
+ "aria-hidden": "true"
331
+ }, An = ["disabled", "aria-label"];
332
+ function Nn(e, n, o, l, r, d) {
333
+ return v(), b("div", {
334
+ class: F(["input-group captcha", { "is-invalid": e.isInvalid }])
335
+ }, [
336
+ ee($("input", {
337
+ "onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
338
+ name: e.name,
339
+ id: e.inputId,
340
+ type: "text",
341
+ inputmode: "numeric",
342
+ autocomplete: "off",
343
+ placeholder: e.placeholder ?? e.t("captcha.placeholder"),
344
+ required: e.required,
345
+ readonly: e.readonly,
346
+ disabled: e.isDisabled,
347
+ "aria-invalid": e.isInvalid || void 0,
348
+ class: F(["form-control text-start", { "is-invalid": e.isInvalid }]),
349
+ onInput: n[1] || (n[1] = (t) => e.$emit("input", e.model, t)),
350
+ onChange: n[2] || (n[2] = (t) => e.emitChange(e.model, t))
351
+ }, null, 42, Mn), [
352
+ [Ye, e.model]
353
+ ]),
354
+ $("span", {
355
+ class: "input-group-text p-0 overflow-hidden",
356
+ style: le({ width: e.imageWidth + "px", height: "auto" })
357
+ }, [
358
+ e.src && !e.loading ? (v(), b("img", {
359
+ key: 0,
360
+ src: e.src,
361
+ alt: e.t("captcha.alt"),
362
+ width: e.imageWidth,
363
+ height: e.imageHeight,
364
+ class: "captcha-holder",
365
+ style: { cursor: "pointer", objectFit: "contain" },
366
+ onClick: n[3] || (n[3] = (...t) => e.refresh && e.refresh(...t))
367
+ }, null, 8, Bn)) : (v(), b("span", Tn, [
368
+ $("span", {
369
+ class: "placeholder w-100",
370
+ style: le({ height: e.imageHeight + "px" })
371
+ }, null, 4)
372
+ ]))
373
+ ], 4),
374
+ $("button", {
375
+ type: "button",
376
+ class: "btn-outline theme-secondary btn-icon",
377
+ disabled: e.isDisabled || e.loading,
378
+ "aria-label": e.t("captcha.refresh"),
379
+ onClick: n[4] || (n[4] = (...t) => e.refresh && e.refresh(...t))
380
+ }, n[5] || (n[5] = [
381
+ $("svg", {
382
+ width: "16",
383
+ height: "16",
384
+ viewBox: "0 0 16 16",
385
+ fill: "none",
386
+ stroke: "currentColor",
387
+ "stroke-width": "1.5",
388
+ "stroke-linecap": "round",
389
+ "stroke-linejoin": "round",
390
+ "aria-hidden": "true"
391
+ }, [
392
+ $("path", { d: "M13.5 3v3.5H10M2.5 13V9.5H6" }),
393
+ $("path", { d: "M3.2 6.5A5.5 5.5 0 0 1 13 6.5M12.8 9.5A5.5 5.5 0 0 1 3 9.5" })
394
+ ], -1)
395
+ ]), 8, An)
396
+ ], 2);
397
+ }
398
+ const En = /* @__PURE__ */ O(kn, [["render", Nn]]);
399
+ function Se(e, n, o, { type: l = () => e.type } = {}) {
400
+ function r() {
401
+ if (!e.checked) return;
402
+ const t = n.model.value;
403
+ l() === "radio" ? (t == null || t === "") && (n.model.value = e.value) : Array.isArray(t) ? t.includes(e.value) || (n.model.value = [...t, e.value]) : t || (n.model.value = e.trueValue !== void 0 ? e.trueValue : !0);
404
+ }
405
+ function d() {
406
+ o.value && (o.value.indeterminate = !!e.indeterminate);
407
+ }
408
+ return K(() => {
409
+ r(), d();
410
+ }), q(() => e.indeterminate, d), { applyInitialChecked: r };
411
+ }
412
+ const On = E({
413
+ name: "CheckboxButtonInput",
414
+ emits: ["update:modelValue", "change", "focus", "blur"],
415
+ props: {
416
+ ...R,
417
+ type: { type: String, default: "radio", validator: (e) => ["checkbox", "radio"].includes(e) },
418
+ value: { type: [String, Number, Boolean, Object], default: "yes" },
419
+ trueValue: { type: null, default: !0 },
420
+ falseValue: { type: null, default: !1 },
421
+ checked: { type: Boolean, default: !1 },
422
+ /** solid | outline | subtle | text | styled */
423
+ variant: { type: String, default: "outline" },
424
+ theme: { type: String, default: "primary" }
425
+ },
426
+ setup(e, { emit: n }) {
427
+ const o = B(null), l = P(e, n, { valued: () => e.value });
428
+ return Se(e, l, o), { ...l, input: o, onChange: (r) => l.emitChange(l.model.value, r) };
429
+ },
430
+ expose: ["input"]
431
+ }), Vn = ["name", "type", "value", "true-value", "false-value", "required", "disabled", "aria-invalid"];
432
+ function Dn(e, n, o, l, r, d) {
433
+ return v(), b("label", {
434
+ class: F(["btn-check", [`btn-${e.variant}`, `theme-${e.theme}`, { "is-invalid": e.isInvalid, disabled: e.isDisabled }]])
435
+ }, [
436
+ ee($("input", {
437
+ ref: "input",
438
+ "onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
439
+ name: e.name,
440
+ type: e.type,
441
+ value: e.value,
442
+ "true-value": e.trueValue,
443
+ "false-value": e.falseValue,
444
+ required: e.required,
445
+ disabled: e.isDisabled,
446
+ "aria-invalid": e.isInvalid || void 0,
447
+ autocomplete: "off",
448
+ class: F({ "is-invalid": e.isInvalid }),
449
+ onChange: n[1] || (n[1] = (...t) => e.onChange && e.onChange(...t)),
450
+ onFocus: n[2] || (n[2] = (t) => e.$emit("focus", t)),
451
+ onBlur: n[3] || (n[3] = (t) => e.$emit("blur", t))
452
+ }, null, 42, Vn), [
453
+ [me, e.model]
454
+ ]),
455
+ j(e.$slots, "default")
456
+ ], 2);
457
+ }
458
+ const Fn = /* @__PURE__ */ O(On, [["render", Dn]]), Ln = E({
459
+ name: "CheckboxInput",
460
+ emits: ["update:modelValue", "change", "focus", "blur"],
461
+ props: {
462
+ ...R,
463
+ /** checkbox | radio */
464
+ type: { type: String, default: "checkbox", validator: (e) => ["checkbox", "radio"].includes(e) },
465
+ /** Value added to the model (arrays / radios) when this option is checked. */
466
+ value: { type: [String, Number, Boolean, Object], default: "yes" },
467
+ trueValue: { type: null, default: !0 },
468
+ falseValue: { type: null, default: !1 },
469
+ /** Initial checked state (applied only when the model is still empty). */
470
+ checked: { type: Boolean, default: !1 },
471
+ indeterminate: { type: Boolean, default: !1 },
472
+ label: { type: String, default: null }
473
+ },
474
+ setup(e, { emit: n }) {
475
+ const o = B(null), l = P(e, n, { valued: () => e.value });
476
+ Se(e, l, o);
477
+ function r(d) {
478
+ l.emitChange(l.model.value, d);
479
+ }
480
+ return { ...l, input: o, onChange: r };
481
+ },
482
+ expose: ["input"]
483
+ }), zn = { class: "form-field" }, qn = ["name", "id", "type", "value", "true-value", "false-value", "required", "disabled", "aria-invalid"], Rn = ["for"];
484
+ function Pn(e, n, o, l, r, d) {
485
+ return v(), b("div", zn, [
486
+ ee($("input", {
487
+ ref: "input",
488
+ "onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
489
+ name: e.name,
490
+ id: e.inputId,
491
+ type: e.type,
492
+ value: e.value,
493
+ "true-value": e.trueValue,
494
+ "false-value": e.falseValue,
495
+ required: e.required,
496
+ disabled: e.isDisabled,
497
+ "aria-invalid": e.isInvalid || void 0,
498
+ class: F([e.type === "radio" ? "radio" : "check", { "is-invalid": e.isInvalid }]),
499
+ onClick: n[1] || (n[1] = (t) => e.readonly && t.preventDefault()),
500
+ onChange: n[2] || (n[2] = (...t) => e.onChange && e.onChange(...t)),
501
+ onFocus: n[3] || (n[3] = (t) => e.$emit("focus", t)),
502
+ onBlur: n[4] || (n[4] = (t) => e.$emit("blur", t))
503
+ }, null, 42, qn), [
504
+ [me, e.model]
505
+ ]),
506
+ $("label", { for: e.inputId }, [
507
+ j(e.$slots, "default", {}, () => [
508
+ ue(N(e.label), 1)
509
+ ])
510
+ ], 8, Rn)
511
+ ]);
512
+ }
513
+ const jn = /* @__PURE__ */ O(Ln, [["render", Pn]]), Un = E({
514
+ name: "CheckboxToggle",
515
+ emits: ["update:modelValue", "change", "focus", "blur"],
516
+ props: {
517
+ ...R,
518
+ type: { type: String, default: "checkbox", validator: (e) => ["checkbox", "radio"].includes(e) },
519
+ value: { type: [String, Number, Boolean, Object], default: "yes" },
520
+ trueValue: { type: null, default: !0 },
521
+ falseValue: { type: null, default: !1 },
522
+ checked: { type: Boolean, default: !1 },
523
+ /** Visually hide the check mark (the card highlight is the only indicator). */
524
+ hideInput: { type: Boolean, default: !1 }
525
+ },
526
+ setup(e, { emit: n }) {
527
+ const o = B(null), l = P(e, n, { valued: () => e.value });
528
+ return Se(e, l, o), { ...l, input: o, onChange: (r) => l.emitChange(l.model.value, r) };
529
+ },
530
+ expose: ["input"]
531
+ }), Kn = ["name", "id", "type", "value", "true-value", "false-value", "required", "disabled", "aria-invalid"], Gn = ["for"];
532
+ function Hn(e, n, o, l, r, d) {
533
+ return v(), b("div", {
534
+ class: F(["form-field form-field-card", { "is-invalid": e.isInvalid, disabled: e.isDisabled || e.readonly }])
535
+ }, [
536
+ ee($("input", {
537
+ ref: "input",
538
+ "onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
539
+ name: e.name,
540
+ id: e.inputId,
541
+ type: e.type,
542
+ value: e.value,
543
+ "true-value": e.trueValue,
544
+ "false-value": e.falseValue,
545
+ required: e.required,
546
+ disabled: e.isDisabled,
547
+ "aria-invalid": e.isInvalid || void 0,
548
+ class: F([e.type === "radio" ? "radio" : "check", { "is-invalid": e.isInvalid, "visually-hidden": e.hideInput }]),
549
+ onClick: n[1] || (n[1] = (t) => e.readonly && t.preventDefault()),
550
+ onChange: n[2] || (n[2] = (...t) => e.onChange && e.onChange(...t)),
551
+ onFocus: n[3] || (n[3] = (t) => e.$emit("focus", t)),
552
+ onBlur: n[4] || (n[4] = (t) => e.$emit("blur", t))
553
+ }, null, 42, Kn), [
554
+ [me, e.model]
555
+ ]),
556
+ $("label", { for: e.inputId }, [
557
+ j(e.$slots, "default")
558
+ ], 8, Gn)
559
+ ], 2);
560
+ }
561
+ const Xn = /* @__PURE__ */ O(Un, [["render", Hn]]), Oe = {}, fe = /* @__PURE__ */ new Map(), Ke = {
562
+ Combobox: () => import("bootstrap/js/dist/combobox.js"),
563
+ Menu: () => import("bootstrap/js/dist/menu.js"),
564
+ Strength: () => import("bootstrap/js/dist/strength.js"),
565
+ Chips: () => import("bootstrap/js/dist/chips.js"),
566
+ OtpInput: () => import("bootstrap/js/dist/otp-input.js"),
567
+ Range: () => import("bootstrap/js/dist/range.js")
568
+ };
569
+ function Jn(e = {}) {
570
+ Object.assign(Oe, e), fe.clear();
571
+ }
572
+ function Wn(e) {
573
+ return Oe[e] ? Promise.resolve(Oe[e]) : Ke[e] ? (fe.has(e) || fe.set(
574
+ e,
575
+ Ke[e]().then((n) => n.default ?? n[e]).catch((n) => {
576
+ throw fe.delete(e), n;
577
+ })
578
+ ), fe.get(e)) : Promise.reject(new Error(`[inertia-bootstrap-forms] Unknown Bootstrap plugin "${e}"`));
579
+ }
580
+ function se(e, n, o, l = {}) {
581
+ const r = Qe(null);
582
+ let d = 0, t = !1, a = null;
583
+ function f() {
584
+ var h;
585
+ d++;
586
+ const p = r.value;
587
+ if (r.value = null, p) {
588
+ try {
589
+ (h = l.onDestroy) == null || h.call(l, p, a);
590
+ } catch {
591
+ }
592
+ try {
593
+ p.dispose();
594
+ } catch {
595
+ }
596
+ }
597
+ a = null;
598
+ }
599
+ async function m() {
600
+ var s, c, i;
601
+ f();
602
+ const p = d, h = await Wn(e);
603
+ if (t || p !== d) return null;
604
+ const g = n();
605
+ if (!g) return null;
606
+ (c = (s = h.getInstance) == null ? void 0 : s.call(h, g)) == null || c.dispose(), a = g;
607
+ const I = new h(g, o());
608
+ return r.value = I, (i = l.onCreate) == null || i.call(l, I, g), I;
609
+ }
610
+ return K(() => {
611
+ t = !1, m().catch((p) => {
612
+ console.error(`[inertia-bootstrap-forms] Could not start Bootstrap ${e}.`, p);
613
+ });
614
+ }), Ze(() => {
615
+ t = !0, f();
616
+ }), { instance: r, create: m, destroy: f };
617
+ }
618
+ const Ge = (e, n) => e.length === n.length && e.every((o, l) => o === n[l]), Zn = E({
619
+ name: "ChipsInput",
620
+ emits: ["update:modelValue", "change", "add", "remove", "select", "rejected", "focus", "blur"],
621
+ props: {
622
+ ...R,
623
+ placeholder: { type: String, default: null },
624
+ /** Character that splits typed / pasted text into chips. Use null to disable. */
625
+ separator: { type: String, default: "," },
626
+ allowDuplicates: { type: Boolean, default: !1 },
627
+ maxChips: { type: Number, default: null },
628
+ dismissible: { type: Boolean, default: !0 },
629
+ /** HTML / SVG of the remove icon (sanitised by Bootstrap). */
630
+ dismissIcon: { type: String, default: null },
631
+ /** Turn the pending text into a chip when the input loses focus. */
632
+ createOnBlur: { type: Boolean, default: !0 },
633
+ /** (value: string) => boolean — return false to reject a chip. */
634
+ validator: { type: Function, default: null },
635
+ locale: { type: String, default: null }
636
+ },
637
+ setup(e, { emit: n, expose: o }) {
638
+ const l = P(e, n), { t: r } = G(() => e.locale), d = B(null), t = B(null);
639
+ let a = !1, f = [];
640
+ const m = (s) => Array.isArray(s) ? s.map(String) : typeof s == "string" && s !== "" ? e.separator ? s.split(e.separator).map((c) => c.trim()).filter(Boolean) : [s] : [];
641
+ function p() {
642
+ const s = g.value;
643
+ if (!s) return;
644
+ const c = m(l.model.value);
645
+ if (Ge(s.getValues(), c)) return;
646
+ a = !0;
647
+ try {
648
+ s.clear(), c.forEach((u) => s.add(u));
649
+ } finally {
650
+ a = !1;
651
+ }
652
+ const i = s.getValues();
653
+ !Ge(i, c) && Array.isArray(l.model.value) && (l.model.value = i);
654
+ }
655
+ const h = () => e.readonly || l.isDisabled.value, { instance: g, create: I } = se(
656
+ "Chips",
657
+ () => d.value,
658
+ () => {
659
+ const s = {
660
+ separator: e.separator,
661
+ allowDuplicates: e.allowDuplicates,
662
+ maxChips: e.maxChips,
663
+ dismissible: e.dismissible && !h(),
664
+ createOnBlur: e.createOnBlur,
665
+ placeholder: e.placeholder ?? r("chips.placeholder")
666
+ };
667
+ return e.dismissIcon && (s.dismissIcon = e.dismissIcon), s;
668
+ },
669
+ {
670
+ onCreate(s, c) {
671
+ const i = (u, w) => {
672
+ c.addEventListener(u, w), f.push(() => c.removeEventListener(u, w));
673
+ };
674
+ i("add.bs.chips", (u) => {
675
+ if (!a) {
676
+ if (e.validator && !e.validator(u.value)) {
677
+ u.preventDefault(), n("rejected", u.value);
678
+ return;
679
+ }
680
+ n("add", u.value);
681
+ }
682
+ }), i("remove.bs.chips", (u) => !a && n("remove", u.value)), i("select.bs.chips", (u) => n("select", u.selected)), i("change.bs.chips", (u) => {
683
+ a || (l.model.value = u.values, l.emitChange(u.values, u));
684
+ }), p();
685
+ },
686
+ onDestroy() {
687
+ f.forEach((s) => s()), f = [];
688
+ }
689
+ }
690
+ );
691
+ return q(() => l.model.value, p, { deep: !0 }), q(
692
+ () => [e.separator, e.allowDuplicates, e.maxChips, e.dismissible, e.createOnBlur, e.dismissIcon, e.readonly, l.isDisabled.value],
693
+ async () => {
694
+ await X(), I();
695
+ }
696
+ ), o({
697
+ add: (s) => {
698
+ var c;
699
+ return (c = g.value) == null ? void 0 : c.add(s);
700
+ },
701
+ remove: (s) => {
702
+ var c;
703
+ return (c = g.value) == null ? void 0 : c.remove(s);
704
+ },
705
+ clear: () => {
706
+ var s;
707
+ return (s = g.value) == null ? void 0 : s.clear();
708
+ },
709
+ focus: () => {
710
+ var s;
711
+ return (s = t.value) == null ? void 0 : s.focus();
712
+ }
713
+ }), { ...l, t: r, el: d, ghost: t, locked: h };
714
+ }
715
+ }), Yn = ["aria-disabled"], Qn = ["id", "placeholder", "disabled", "readonly", "aria-invalid"];
716
+ function xn(e, n, o, l, r, d) {
717
+ return v(), b("div", {
718
+ ref: "el",
719
+ class: "chip-input",
720
+ "aria-disabled": e.isDisabled || void 0
721
+ }, [
722
+ $("input", {
723
+ ref: "ghost",
724
+ type: "text",
725
+ class: F(["form-ghost", { "is-invalid": e.isInvalid }]),
726
+ id: e.inputId,
727
+ placeholder: e.placeholder ?? e.t("chips.placeholder"),
728
+ disabled: e.isDisabled,
729
+ readonly: e.readonly,
730
+ "aria-invalid": e.isInvalid || void 0,
731
+ autocomplete: "off",
732
+ onFocus: n[0] || (n[0] = (t) => e.$emit("focus", t)),
733
+ onBlur: n[1] || (n[1] = (t) => e.$emit("blur", t))
734
+ }, null, 42, Qn)
735
+ ], 8, Yn);
736
+ }
737
+ const _n = /* @__PURE__ */ O(Zn, [["render", xn]]), ie = (e) => e !== null && typeof e == "object", He = (e) => e == null || e === "";
738
+ function et() {
739
+ if (typeof document > "u") return null;
740
+ const e = document.cookie.match(/(?:^|;\s*)XSRF-TOKEN=([^;]+)/);
741
+ return e ? decodeURIComponent(e[1]) : null;
742
+ }
743
+ const nt = E({
744
+ name: "ComboboxInput",
745
+ emits: [
746
+ "update:modelValue",
747
+ "change",
748
+ "selected",
749
+ "clear",
750
+ "search",
751
+ "search-success",
752
+ "search-error",
753
+ "show",
754
+ "shown",
755
+ "hide",
756
+ "hidden"
757
+ ],
758
+ props: {
759
+ ...R,
760
+ /** Strings, numbers or objects ({ id | value, name | label, description, disabled }). */
761
+ options: { type: Array, default: () => [] },
762
+ /** Property that holds the value of an option object (default: id → value → name → label). */
763
+ valueKey: { type: String, default: null },
764
+ /** Property that holds the label of an option object (default: name → label → title → value). */
765
+ labelKey: { type: String, default: null },
766
+ /** Legacy alias of `labelKey`. */
767
+ label: { type: String, default: null },
768
+ descriptionKey: { type: String, default: "description" },
769
+ multiple: { type: Boolean, default: !1 },
770
+ placeholder: { type: String, default: null },
771
+ /** Show a client-side search box. */
772
+ searchEnabled: { type: Boolean, default: !1 },
773
+ searchPlaceholder: { type: String, default: null },
774
+ /**
775
+ * Remote search: { url, method = 'POST', param = 'query', debounce = 400, minChars = 0, headers = {}, resultsKey }.
776
+ * The endpoint must answer with a JSON array (or { data: [] }).
777
+ */
778
+ search: { type: Object, default: () => ({ url: null }) },
779
+ /** Add an entry at the top of a single select that clears the value. */
780
+ clearable: { type: Boolean, default: !1 },
781
+ clearText: { type: String, default: null },
782
+ noResultsText: { type: String, default: null },
783
+ loadingText: { type: String, default: null },
784
+ /** Text of a multiple select when more than one item is chosen. `{count}` is replaced. */
785
+ selectedText: { type: String, default: null },
786
+ /**
787
+ * Multiple select only: show the chosen options themselves (true) instead of the
788
+ * "N selected" counter (false, default).
789
+ */
790
+ showSelected: { type: Boolean, default: !0 },
791
+ /** With `showSelected`: above this many chosen options the counter is shown instead. */
792
+ maxVisible: { type: Number, default: null },
793
+ /** Separator between the chosen labels (default: "، " for fa, ", " otherwise). */
794
+ selectedSeparator: { type: String, default: null },
795
+ searchNormalize: { type: Boolean, default: !1 },
796
+ /** Floating UI placement of the menu. */
797
+ placement: { type: String, default: "bottom-start" },
798
+ size: { type: String, default: null },
799
+ /** Hide the caret icon. */
800
+ hideDropdown: { type: Boolean, default: !1 },
801
+ locale: { type: String, default: null }
802
+ },
803
+ setup(e, { emit: n, expose: o, slots: l }) {
804
+ const r = P(e, n), { t: d, locale: t } = G(() => e.locale), a = ye(), f = B(null), m = B(null), p = B(null), h = B(null), g = B(null), I = B({}), s = $e({ results: null, loading: !1, error: !1 }), c = S(() => {
805
+ var y;
806
+ return ((y = e.search) == null ? void 0 : y.url) || null;
807
+ }), i = S(() => e.searchEnabled || !!c.value), u = (y) => ie(y) ? e.valueKey ? y[e.valueKey] : y.id ?? y.value ?? y.name ?? y.label : y, w = (y) => {
808
+ if (!ie(y)) return y;
809
+ const C = e.labelKey || e.label;
810
+ return (C ? y[C] : y.name ?? y.label ?? y.title ?? y.value) ?? u(y);
811
+ }, k = (y) => ie(y) ? y[e.descriptionKey] ?? null : null, T = (y) => String(u(y));
812
+ function M(y) {
813
+ const C = { ...I.value };
814
+ (y || []).forEach((V) => {
815
+ C[T(V)] = V;
816
+ }), I.value = C;
817
+ }
818
+ q(() => e.options, (y) => M(y), { immediate: !0, deep: !0 });
819
+ const L = S(() => {
820
+ const y = r.model.value;
821
+ return e.multiple ? Array.isArray(y) ? y : ie(y) ? Object.values(y) : He(y) ? [] : [y] : He(y) ? [] : [y];
822
+ }), z = S(() => L.value.map((y) => ie(y) ? T(y) : String(y))), H = (y) => {
823
+ const C = I.value[y];
824
+ return C !== void 0 ? String(w(C)) : y;
825
+ }, de = S(
826
+ () => z.value.map((y) => {
827
+ const C = I.value[y];
828
+ return {
829
+ key: y,
830
+ raw: C,
831
+ label: C !== void 0 ? String(w(C)) : y,
832
+ description: C !== void 0 ? k(C) : null
833
+ };
834
+ })
835
+ ), Ce = S(() => e.selectedSeparator ?? (t.value === "fa" ? "، " : ", ")), Le = S(
836
+ () => e.multiple && e.showSelected && z.value.length > 1 && (e.maxVisible === null || z.value.length <= e.maxVisible)
837
+ ), ze = S(
838
+ () => !!l.selection && z.value.length > 0 && (!e.multiple || z.value.length === 1 || Le.value)
839
+ ), qe = S(() => {
840
+ const y = z.value;
841
+ return y.length ? e.multiple && y.length > 1 ? Le.value ? de.value.map((C) => C.label).join(Ce.value) : (e.selectedText ?? d("select.selectedCount")).replace("{count}", y.length) : H(y[0]) : e.placeholder ?? d("select.placeholder");
842
+ }), we = S(() => ze.value ? "" : qe.value), Re = S(() => z.value.length === 0), ke = S(() => {
843
+ let y = s.results ?? e.options;
844
+ if (s.results && e.multiple) {
845
+ const C = new Set(y.map(T));
846
+ y = [...z.value.filter((D) => !C.has(D) && I.value[D] !== void 0).map((D) => I.value[D]), ...y];
847
+ }
848
+ return y.map((C) => ({
849
+ raw: C,
850
+ key: T(C),
851
+ label: w(C),
852
+ description: k(C),
853
+ disabled: ie(C) && !!C.disabled
854
+ }));
855
+ });
856
+ function an() {
857
+ if (!p.value) return;
858
+ const y = new Set(z.value);
859
+ p.value.querySelectorAll(".menu-item[data-bs-value]").forEach((C) => {
860
+ const V = y.has(C.dataset.bsValue) && C.dataset.bsValue !== "";
861
+ C.classList.toggle("selected", V), C.setAttribute("aria-selected", V ? "true" : "false");
862
+ });
863
+ }
864
+ function Pe() {
865
+ h.value && (h.value.textContent = we.value, h.value.classList.toggle("combobox-placeholder", Re.value));
866
+ }
867
+ function rn() {
868
+ var y;
869
+ (y = m.value) == null || y.classList.toggle("is-invalid", r.isInvalid.value);
870
+ }
871
+ function ce() {
872
+ an(), Pe(), rn();
873
+ }
874
+ q([() => r.model.value, ke, we, r.isInvalid], () => X(ce), { flush: "post" });
875
+ function je(y) {
876
+ const C = I.value[y];
877
+ return C !== void 0 ? u(C) : y;
878
+ }
879
+ function un(y) {
880
+ let C, V;
881
+ if (e.multiple) {
882
+ const D = y.value || [];
883
+ C = D.map(je), V = D.map((W) => I.value[W]);
884
+ } else y.value === "" || y.value === void 0 ? (C = null, V = null) : (C = je(y.value), V = I.value[y.value]);
885
+ r.model.value = C, C === null && n("clear"), n("selected", V), r.emitChange(C, y), X(ce), Pe();
886
+ }
887
+ let Me = null, J = null;
888
+ a.add(() => {
889
+ clearTimeout(Me), J == null || J.abort();
890
+ });
891
+ function Be() {
892
+ var y;
893
+ p.value && (p.value.querySelectorAll(".menu-item[data-bs-value]").forEach((C) => {
894
+ C.style.display = "";
895
+ }), (y = p.value.querySelector(".combobox-no-results")) == null || y.classList.toggle("d-none", ke.value.length > 0));
896
+ }
897
+ async function sn(y) {
898
+ const C = e.search || {};
899
+ if (C.url) {
900
+ J == null || J.abort(), J = new AbortController(), s.loading = !0, s.error = !1;
901
+ try {
902
+ const V = new URL(C.url, window.location.origin);
903
+ V.searchParams.set(C.param || "query", y);
904
+ const D = {
905
+ Accept: "application/json",
906
+ "X-Requested-With": "XMLHttpRequest",
907
+ ...C.headers || {}
908
+ }, W = et();
909
+ W && !D["X-XSRF-TOKEN"] && (D["X-XSRF-TOKEN"] = W);
910
+ const ae = await fetch(V, {
911
+ method: (C.method || "POST").toUpperCase(),
912
+ headers: D,
913
+ credentials: "same-origin",
914
+ signal: J.signal
915
+ });
916
+ if (!ae.ok) throw new Error(`HTTP ${ae.status}`);
917
+ const _ = await ae.json(), Ne = Array.isArray(_) ? _ : (_ == null ? void 0 : _[C.resultsKey || "data"]) ?? (_ == null ? void 0 : _.results) ?? [];
918
+ M(Ne), s.results = Ne, s.loading = !1, n("search-success", Ne), await X(), Be(), ce();
919
+ } catch (V) {
920
+ if ((V == null ? void 0 : V.name) === "AbortError") return;
921
+ s.loading = !1, s.error = !0, s.results = [], n("search-error", V), await X(), Be();
922
+ }
923
+ }
924
+ }
925
+ function dn(y) {
926
+ var D, W;
927
+ const C = y.target.value;
928
+ if (n("search", C), !c.value) return;
929
+ clearTimeout(Me);
930
+ const V = ((D = e.search) == null ? void 0 : D.minChars) ?? 0;
931
+ if (C.length < V) {
932
+ J == null || J.abort(), s.results = null, s.loading = !1;
933
+ return;
934
+ }
935
+ s.loading = !0, Me = setTimeout(() => sn(C), ((W = e.search) == null ? void 0 : W.debounce) ?? 400);
936
+ }
937
+ let Te = [];
938
+ const { instance: Ae, create: cn } = se(
939
+ "Combobox",
940
+ () => m.value,
941
+ () => ({
942
+ multiple: e.multiple,
943
+ placeholder: e.placeholder ?? d("select.placeholder"),
944
+ placement: e.placement,
945
+ search: i.value,
946
+ searchNormalize: e.searchNormalize
947
+ }),
948
+ {
949
+ onCreate(y, C) {
950
+ const V = (D, W, ae) => {
951
+ D.addEventListener(W, ae), Te.push(() => D.removeEventListener(W, ae));
952
+ };
953
+ V(C, "change.bs.combobox", un), V(C, "show.bs.combobox", (D) => n("show", D)), V(C, "shown.bs.combobox", (D) => n("shown", D)), V(C, "hide.bs.combobox", (D) => n("hide", D)), V(C, "hidden.bs.combobox", (D) => {
954
+ s.results !== null && (s.results = null, s.error = !1, X(() => {
955
+ Be(), ce();
956
+ })), n("hidden", D);
957
+ }), g.value && (V(g.value, "input", dn), V(g.value, "keydown", (D) => D.key === "Enter" && D.preventDefault())), ce();
958
+ },
959
+ onDestroy() {
960
+ Te.forEach((y) => y()), Te = [];
961
+ }
962
+ }
963
+ );
964
+ return q(
965
+ () => [e.multiple, i.value, e.placement, e.searchNormalize],
966
+ async () => {
967
+ await X(), cn();
968
+ }
969
+ ), o({
970
+ show: () => {
971
+ var y;
972
+ return (y = Ae.value) == null ? void 0 : y.show();
973
+ },
974
+ hide: () => {
975
+ var y;
976
+ return (y = Ae.value) == null ? void 0 : y.hide();
977
+ },
978
+ toggle: () => {
979
+ var y;
980
+ return (y = Ae.value) == null ? void 0 : y.toggle();
981
+ },
982
+ clear: () => {
983
+ r.model.value = e.multiple ? [] : null, n("clear"), r.emitChange(r.model.value);
984
+ },
985
+ focus: () => {
986
+ var y;
987
+ return (y = m.value) == null ? void 0 : y.focus();
988
+ }
989
+ }), {
990
+ ...r,
991
+ t: d,
992
+ root: f,
993
+ toggle: m,
994
+ menu: p,
995
+ valueEl: h,
996
+ searchInput: g,
997
+ remote: s,
998
+ hasSearch: i,
999
+ rendered: ke,
1000
+ displayText: qe,
1001
+ plainText: we,
1002
+ selectedItems: de,
1003
+ customSelection: ze,
1004
+ separator: Ce,
1005
+ selectedSet: S(() => new Set(z.value)),
1006
+ showingPlaceholder: Re,
1007
+ sizeClass: S(() => e.size ? `form-control-${e.size}` : null)
1008
+ };
1009
+ }
1010
+ }), tt = {
1011
+ ref: "root",
1012
+ class: "combobox"
1013
+ }, lt = ["id", "disabled", "aria-invalid", "aria-required"], ot = {
1014
+ key: 0,
1015
+ class: "combobox-selection d-flex align-items-center flex-wrap gap-2 text-start"
1016
+ }, at = ["textContent"], it = {
1017
+ key: 1,
1018
+ class: "combobox-caret",
1019
+ width: "16",
1020
+ height: "16",
1021
+ viewBox: "0 0 16 16",
1022
+ fill: "none",
1023
+ stroke: "currentColor",
1024
+ "stroke-width": "1.5",
1025
+ "stroke-linecap": "round",
1026
+ "stroke-linejoin": "round",
1027
+ "aria-hidden": "true"
1028
+ }, rt = ["aria-multiselectable"], ut = {
1029
+ key: 0,
1030
+ class: "combobox-search"
1031
+ }, st = ["placeholder"], dt = {
1032
+ key: 1,
1033
+ class: "menu-header",
1034
+ role: "status"
1035
+ }, ct = {
1036
+ key: 2,
1037
+ class: "menu-header",
1038
+ role: "alert"
1039
+ }, ft = {
1040
+ key: 3,
1041
+ type: "button",
1042
+ class: "menu-item",
1043
+ "data-bs-value": "",
1044
+ role: "option"
1045
+ }, mt = { class: "menu-item-content" }, pt = ["data-bs-value", "disabled"], yt = { class: "menu-item-content" }, ht = {
1046
+ key: 0,
1047
+ class: "menu-item-description"
1048
+ }, vt = { class: "combobox-no-results d-none" };
1049
+ function gt(e, n, o, l, r, d) {
1050
+ return v(), b("div", tt, [
1051
+ $("button", {
1052
+ ref: "toggle",
1053
+ type: "button",
1054
+ class: F(["combobox-toggle form-control", e.sizeClass]),
1055
+ "data-bs-toggle": "combobox",
1056
+ id: e.inputId,
1057
+ disabled: e.isDisabled || e.readonly,
1058
+ "aria-haspopup": "listbox",
1059
+ "aria-invalid": e.isInvalid || void 0,
1060
+ "aria-required": e.required || void 0
1061
+ }, [
1062
+ e.customSelection ? (v(), b("span", ot, [
1063
+ (v(!0), b(Y, null, oe(e.selectedItems, (t, a) => j(e.$slots, "selection", {
1064
+ key: t.key,
1065
+ option: t.raw,
1066
+ label: t.label,
1067
+ description: t.description,
1068
+ value: t.key,
1069
+ index: a,
1070
+ multiple: e.multiple
1071
+ }, () => [
1072
+ ue(N(t.label), 1)
1073
+ ])), 128))
1074
+ ])) : A("", !0),
1075
+ $("span", {
1076
+ ref: "valueEl",
1077
+ class: F(["combobox-value", { "combobox-placeholder": e.showingPlaceholder }]),
1078
+ textContent: N(e.plainText)
1079
+ }, null, 10, at),
1080
+ e.hideDropdown ? A("", !0) : (v(), b("svg", it, n[0] || (n[0] = [
1081
+ $("path", { d: "m3 6 5 5 5-5" }, null, -1)
1082
+ ])))
1083
+ ], 10, lt),
1084
+ $("div", {
1085
+ ref: "menu",
1086
+ class: "menu",
1087
+ role: "listbox",
1088
+ "aria-multiselectable": e.multiple || void 0
1089
+ }, [
1090
+ e.hasSearch ? (v(), b("div", ut, [
1091
+ $("input", {
1092
+ ref: "searchInput",
1093
+ type: "search",
1094
+ class: "form-control combobox-search-input",
1095
+ autocomplete: "off",
1096
+ placeholder: e.searchPlaceholder ?? e.t("select.search")
1097
+ }, null, 8, st)
1098
+ ])) : A("", !0),
1099
+ e.remote.loading ? (v(), b("div", dt, N(e.loadingText ?? e.t("select.loading")), 1)) : e.remote.error ? (v(), b("div", ct, N(e.t("select.error")), 1)) : A("", !0),
1100
+ e.clearable && !e.multiple ? (v(), b("button", ft, [
1101
+ $("span", mt, [
1102
+ $("span", null, N(e.clearText ?? e.t("select.clear")), 1)
1103
+ ])
1104
+ ])) : A("", !0),
1105
+ (v(!0), b(Y, null, oe(e.rendered, (t) => (v(), b("button", {
1106
+ key: t.key,
1107
+ type: "button",
1108
+ class: "menu-item",
1109
+ role: "option",
1110
+ "data-bs-value": t.key,
1111
+ disabled: t.disabled || void 0
1112
+ }, [
1113
+ $("span", yt, [
1114
+ j(e.$slots, "option", {
1115
+ option: t.raw,
1116
+ label: t.label,
1117
+ description: t.description,
1118
+ value: t.key,
1119
+ selected: e.selectedSet.has(t.key),
1120
+ disabled: t.disabled
1121
+ }, () => [
1122
+ $("span", null, N(t.label), 1),
1123
+ t.description ? (v(), b("span", ht, N(t.description), 1)) : A("", !0)
1124
+ ])
1125
+ ]),
1126
+ n[1] || (n[1] = $("svg", {
1127
+ class: "menu-item-check",
1128
+ width: "16",
1129
+ height: "16",
1130
+ viewBox: "0 0 16 16",
1131
+ fill: "none",
1132
+ stroke: "currentColor",
1133
+ "stroke-width": "2",
1134
+ "stroke-linecap": "round",
1135
+ "stroke-linejoin": "round",
1136
+ "aria-hidden": "true"
1137
+ }, [
1138
+ $("path", { d: "m3.5 8.5 3 3 6-7" })
1139
+ ], -1))
1140
+ ], 8, pt))), 128)),
1141
+ $("div", vt, N(e.noResultsText ?? e.t("select.noResults")), 1)
1142
+ ], 8, rt)
1143
+ ], 512);
1144
+ }
1145
+ const _e = /* @__PURE__ */ O(nt, [["render", gt]]);
1146
+ function re(e = {}) {
1147
+ const n = {
1148
+ Accept: "application/json",
1149
+ "X-Requested-With": "XMLHttpRequest",
1150
+ ...e
1151
+ };
1152
+ if (typeof document < "u") {
1153
+ const o = document.cookie.match(/(?:^|;\s*)XSRF-TOKEN=([^;]+)/);
1154
+ o && !n["X-XSRF-TOKEN"] && (n["X-XSRF-TOKEN"] = decodeURIComponent(o[1]));
1155
+ }
1156
+ return n;
1157
+ }
1158
+ const bt = E({
1159
+ name: "DropzoneInput",
1160
+ emits: ["update:modelValue", "change", "ready", "added", "success", "error", "removed", "complete"],
1161
+ props: {
1162
+ ...R,
1163
+ multiple: { type: Boolean, default: !1 },
1164
+ url: { type: String, default: "/upload" },
1165
+ /** Dropzone options (merged over the defaults). */
1166
+ options: { type: Object, default: () => ({}) },
1167
+ headers: { type: Object, default: () => ({}) },
1168
+ locale: { type: String, default: null }
1169
+ },
1170
+ setup(e, { emit: n, expose: o }) {
1171
+ const l = P(e, n), { t: r } = G(() => e.locale), d = ye(), t = B(null);
1172
+ let a = null, f = !1;
1173
+ const m = () => Array.isArray(l.model.value) ? l.model.value : [];
1174
+ return K(async () => {
1175
+ const { default: p } = await import("dropzone");
1176
+ d.isDisposed() || !t.value || (p.autoDiscover = !1, a = new p(t.value, {
1177
+ url: e.url,
1178
+ addRemoveLinks: !0,
1179
+ maxFiles: e.multiple ? null : 1,
1180
+ headers: re(e.headers),
1181
+ ...e.options
1182
+ }), a.on("addedfile", (h) => n("added", h)), a.on("complete", (h) => n("complete", h)), a.on("error", (h, g) => {
1183
+ var c, i;
1184
+ let I = r("upload.failed");
1185
+ typeof g == "string" && (I = g), g != null && g.message && (I = g.message), (c = h.previewElement) == null || c.classList.add("dz-error");
1186
+ const s = (i = h.previewElement) == null ? void 0 : i.querySelector("[data-dz-errormessage]");
1187
+ s && (s.textContent = I), n("error", h, I);
1188
+ }), a.on("success", (h, g) => {
1189
+ const I = (g == null ? void 0 : g.data) ?? g;
1190
+ l.model.value = e.multiple ? [...m(), I] : I, l.emitChange(l.model.value), n("success", h, I);
1191
+ }), a.on("removedfile", async (h) => {
1192
+ var I;
1193
+ if (n("removed", h), f) return;
1194
+ let g = (I = h.xhr) == null ? void 0 : I.response;
1195
+ if (g)
1196
+ try {
1197
+ g = JSON.parse(g);
1198
+ const s = g.data ?? g;
1199
+ l.model.value = e.multiple ? m().filter((c) => ((c == null ? void 0 : c.path) ?? c) !== s.path) : null, l.emitChange(l.model.value), await fetch(e.url, {
1200
+ method: "DELETE",
1201
+ headers: re({ "Content-Type": "application/json", ...e.headers }),
1202
+ credentials: "same-origin",
1203
+ body: s.path
1204
+ });
1205
+ } catch (s) {
1206
+ console.error("[inertia-bootstrap-forms] Could not delete the uploaded file on the server", s);
1207
+ }
1208
+ }), d.add(() => {
1209
+ f = !0;
1210
+ try {
1211
+ a == null || a.destroy();
1212
+ } catch {
1213
+ }
1214
+ a = null;
1215
+ }), n("ready", a));
1216
+ }), q(
1217
+ () => l.model.value,
1218
+ (p) => {
1219
+ var g;
1220
+ (p == null || p === "" || Array.isArray(p) && !p.length) && ((g = a == null ? void 0 : a.files) != null && g.length) && (f = !0, a.removeAllFiles(!0), f = !1);
1221
+ }
1222
+ ), o({ dropzone: () => a }), { ...l, el: t };
1223
+ }
1224
+ }), $t = ["id"];
1225
+ function St(e, n, o, l, r, d) {
1226
+ return v(), b("div", {
1227
+ ref: "el",
1228
+ class: F(["inertia-dropzone-input dropzone", { "is-invalid": e.isInvalid }]),
1229
+ id: e.inputId
1230
+ }, null, 10, $t);
1231
+ }
1232
+ const It = /* @__PURE__ */ O(bt, [["render", St]]), Ct = x(() => import("@tinymce/tinymce-vue")), wt = E({
1233
+ name: "EditorInput",
1234
+ components: { Editor: Ct },
1235
+ emits: ["update:modelValue", "change", "init", "focus", "blur"],
1236
+ props: {
1237
+ ...R,
1238
+ placeholder: { type: String, default: "" },
1239
+ /** TinyMCE `init` options. */
1240
+ options: { type: Object, default: () => ({}) },
1241
+ height: { type: [Number, String], default: null },
1242
+ /** Self-hosted TinyMCE script (`tinymceScriptSrc`) or Tiny Cloud api key. */
1243
+ tinymceScriptSrc: { type: String, default: null },
1244
+ apiKey: { type: String, default: null }
1245
+ },
1246
+ setup(e, { emit: n, expose: o }) {
1247
+ const l = P(e, n), r = B(null);
1248
+ function d(t, a) {
1249
+ var f;
1250
+ r.value = a, (f = a.mode) == null || f.set(l.isDisabled.value || e.readonly ? "readonly" : "design"), n("init", a);
1251
+ }
1252
+ return q(
1253
+ () => l.isDisabled.value || e.readonly,
1254
+ (t) => {
1255
+ var a, f;
1256
+ return (f = (a = r.value) == null ? void 0 : a.mode) == null ? void 0 : f.set(t ? "readonly" : "design");
1257
+ }
1258
+ ), o({ editor: () => r.value }), { ...l, onInit: d };
1259
+ }
1260
+ });
1261
+ function kt(e, n, o, l, r, d) {
1262
+ const t = U("Editor");
1263
+ return v(), Q(t, {
1264
+ modelValue: e.model,
1265
+ "onUpdate:modelValue": n[0] || (n[0] = (a) => e.model = a),
1266
+ id: e.inputId,
1267
+ disabled: e.isDisabled || e.readonly,
1268
+ "tinymce-script-src": e.tinymceScriptSrc || void 0,
1269
+ "api-key": e.apiKey || void 0,
1270
+ init: { placeholder: e.placeholder, ...e.height ? { height: e.height } : {}, ...e.options },
1271
+ class: "tiny-editor-input-el",
1272
+ onInit: e.onInit,
1273
+ onChange: n[1] || (n[1] = (a) => e.emitChange(e.model, a)),
1274
+ onFocus: n[2] || (n[2] = (a) => e.$emit("focus", a)),
1275
+ onBlur: n[3] || (n[3] = (a) => e.$emit("blur", a))
1276
+ }, null, 8, ["modelValue", "id", "disabled", "tinymce-script-src", "api-key", "init", "onInit"]);
1277
+ }
1278
+ const Mt = /* @__PURE__ */ O(wt, [["render", kt]]), Bt = E({
1279
+ name: "TextInput",
1280
+ emits: ["update:modelValue", "change", "input", "focus", "blur"],
1281
+ props: {
1282
+ ...R,
1283
+ type: { type: String, default: "text" },
1284
+ placeholder: { type: String, default: null },
1285
+ /** sm | lg */
1286
+ size: { type: String, default: null }
1287
+ },
1288
+ setup(e, { emit: n }) {
1289
+ const o = P(e, n), l = S(() => e.size ? `form-control-${e.size}` : null);
1290
+ return { ...o, sizeClass: l, emit: n };
1291
+ }
1292
+ }), Tt = ["name", "id", "type", "placeholder", "required", "readonly", "disabled", "aria-invalid"];
1293
+ function At(e, n, o, l, r, d) {
1294
+ return ee((v(), b("input", {
1295
+ "onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
1296
+ name: e.name,
1297
+ id: e.inputId,
1298
+ type: e.type,
1299
+ placeholder: e.placeholder,
1300
+ required: e.required,
1301
+ readonly: e.readonly,
1302
+ disabled: e.isDisabled,
1303
+ "aria-invalid": e.isInvalid || void 0,
1304
+ class: F(["form-control", [e.sizeClass, { "is-invalid": e.isInvalid }]]),
1305
+ onInput: n[1] || (n[1] = (t) => e.emit("input", e.model, t)),
1306
+ onChange: n[2] || (n[2] = (t) => e.emitChange(e.model, t)),
1307
+ onFocus: n[3] || (n[3] = (t) => e.$emit("focus", t)),
1308
+ onBlur: n[4] || (n[4] = (t) => e.$emit("blur", t))
1309
+ }, null, 42, Tt)), [
1310
+ [me, e.model]
1311
+ ]);
1312
+ }
1313
+ const Ie = /* @__PURE__ */ O(Bt, [["render", At]]), Nt = E({
1314
+ name: "EmailInput",
1315
+ components: { TextInput: Ie },
1316
+ props: {
1317
+ name: { type: String, default: "email" },
1318
+ placeholder: { type: String, default: null },
1319
+ locale: { type: String, default: null }
1320
+ },
1321
+ setup(e) {
1322
+ const { t: n } = G(() => e.locale);
1323
+ return { t: n };
1324
+ }
1325
+ });
1326
+ function Et(e, n, o, l, r, d) {
1327
+ const t = U("TextInput");
1328
+ return v(), Q(t, {
1329
+ type: "email",
1330
+ autocomplete: "email",
1331
+ name: e.name,
1332
+ placeholder: e.placeholder ?? e.t("email.placeholder")
1333
+ }, null, 8, ["name", "placeholder"]);
1334
+ }
1335
+ const Ot = /* @__PURE__ */ O(Nt, [["render", Et]]);
1336
+ let Vt = 0;
1337
+ const Dt = E({
1338
+ name: "FileInput",
1339
+ emits: ["update:modelValue", "change", "added", "progress", "uploaded", "error", "removed"],
1340
+ props: {
1341
+ ...R,
1342
+ multiple: { type: Boolean, default: !1 },
1343
+ endpoint: { type: String, default: "/upload" },
1344
+ accept: { type: String, default: null },
1345
+ headers: { type: Object, default: () => ({}) },
1346
+ /** Name of the multipart field. */
1347
+ fieldName: { type: String, default: "file" },
1348
+ locale: { type: String, default: null }
1349
+ },
1350
+ setup(e, { emit: n, expose: o }) {
1351
+ const l = P(e, n), { t: r } = G(() => e.locale), d = ye(), t = B(null), a = B([]), f = /* @__PURE__ */ new Map();
1352
+ d.add(() => {
1353
+ f.forEach((i) => i.abort()), f.clear(), l.form.value && (l.form.value.uploading = null);
1354
+ });
1355
+ const m = () => a.value.filter((i) => i.path).map((i) => i.path);
1356
+ function p(i) {
1357
+ const u = e.multiple ? m() : m()[0] ?? null;
1358
+ l.model.value = u, l.emitChange(u, i);
1359
+ }
1360
+ function h() {
1361
+ const i = l.form.value;
1362
+ if (!i) return;
1363
+ const u = a.value.filter((w) => w.uploading);
1364
+ i.uploading = u.length ? Math.min(99, Math.round(u.reduce((w, k) => w + k.percent, 0) / u.length)) : null;
1365
+ }
1366
+ function g(i) {
1367
+ i.error = "", i.percent = 0, i.uploading = !0, h();
1368
+ const u = new FormData();
1369
+ u.append(e.fieldName, i.file);
1370
+ const w = new XMLHttpRequest();
1371
+ f.set(i.id, w), w.open("POST", e.endpoint), Object.entries(re(e.headers)).forEach(([T, M]) => w.setRequestHeader(T, M)), w.upload.onprogress = (T) => {
1372
+ T.lengthComputable && (i.percent = Math.round(T.loaded / T.total * 100), n("progress", i, i.percent), h());
1373
+ };
1374
+ const k = (T) => {
1375
+ i.uploading = !1, i.error = T || r("upload.failed"), f.delete(i.id), h(), n("error", i, i.error);
1376
+ };
1377
+ w.onerror = () => k(), w.onload = () => {
1378
+ var L;
1379
+ let T = null;
1380
+ try {
1381
+ T = JSON.parse(w.responseText);
1382
+ } catch {
1383
+ }
1384
+ if (w.status < 200 || w.status >= 300) {
1385
+ const z = T != null && T.errors ? Object.values(T.errors)[0] : null;
1386
+ return k((T == null ? void 0 : T.message) || (Array.isArray(z) ? z[0] : z));
1387
+ }
1388
+ const M = ((L = T == null ? void 0 : T.data) == null ? void 0 : L.path) ?? (T == null ? void 0 : T.path);
1389
+ if (!M) return k();
1390
+ i.path = M, i.percent = 100, i.uploading = !1, f.delete(i.id), h(), p(), n("uploaded", i);
1391
+ }, w.send(u);
1392
+ }
1393
+ function I(i) {
1394
+ const u = $e({ id: `f${++Vt}`, file: i, percent: 0, error: "", path: null, uploading: !1 });
1395
+ a.value = e.multiple ? [...a.value, u] : [u], n("added", u), g(u);
1396
+ }
1397
+ function s(i) {
1398
+ Array.from(i.target.files).forEach(I), i.target.value = "";
1399
+ }
1400
+ async function c(i) {
1401
+ var u;
1402
+ if ((u = f.get(i.id)) == null || u.abort(), f.delete(i.id), a.value = a.value.filter((w) => w.id !== i.id), h(), i.path) {
1403
+ p();
1404
+ try {
1405
+ await fetch(e.endpoint, {
1406
+ method: "DELETE",
1407
+ headers: re(e.headers),
1408
+ credentials: "same-origin",
1409
+ body: i.path
1410
+ });
1411
+ } catch {
1412
+ }
1413
+ }
1414
+ n("removed", i);
1415
+ }
1416
+ return q(
1417
+ () => l.model.value,
1418
+ (i) => {
1419
+ (i == null || i === "" || Array.isArray(i) && !i.length) && a.value.some((w) => w.path) && (a.value = a.value.filter((w) => !w.path));
1420
+ }
1421
+ ), o({ clear: () => a.value.slice().forEach(c) }), { ...l, t: r, input: t, files: a, onSelect: s, remove: c, retry: g, size: (i) => `${Math.round(i / 1024)}KB` };
1422
+ }
1423
+ }), Ft = { class: "file-input-uploader" }, Lt = ["name", "id", "multiple", "accept", "required", "disabled", "aria-invalid"], zt = {
1424
+ key: 0,
1425
+ class: "list-group mt-2"
1426
+ }, qt = { class: "d-flex align-items-center justify-content-between gap-2" }, Rt = { class: "text-truncate" }, Pt = { class: "d-flex align-items-center gap-2" }, jt = {
1427
+ class: "fg-secondary fanum",
1428
+ dir: "ltr"
1429
+ }, Ut = ["aria-label", "onClick"], Kt = ["aria-label", "onClick"], Gt = ["aria-valuenow"], Ht = {
1430
+ key: 1,
1431
+ class: "fg-danger mt-1",
1432
+ role: "alert"
1433
+ };
1434
+ function Xt(e, n, o, l, r, d) {
1435
+ return v(), b("div", Ft, [
1436
+ $("input", {
1437
+ ref: "input",
1438
+ type: "file",
1439
+ class: F(["form-control", { "is-invalid": e.isInvalid }]),
1440
+ name: e.name,
1441
+ id: e.inputId,
1442
+ multiple: e.multiple,
1443
+ accept: e.accept || void 0,
1444
+ required: e.required && !e.files.length,
1445
+ disabled: e.isDisabled || e.readonly,
1446
+ "aria-invalid": e.isInvalid || void 0,
1447
+ onChange: n[0] || (n[0] = (...t) => e.onSelect && e.onSelect(...t))
1448
+ }, null, 42, Lt),
1449
+ e.files.length ? (v(), b("ul", zt, [
1450
+ (v(!0), b(Y, null, oe(e.files, (t) => (v(), b("li", {
1451
+ key: t.id,
1452
+ class: "list-group-item"
1453
+ }, [
1454
+ $("div", qt, [
1455
+ $("span", Rt, N(t.file.name), 1),
1456
+ $("span", Pt, [
1457
+ $("span", jt, N(e.size(t.file.size)), 1),
1458
+ t.error ? (v(), b("button", {
1459
+ key: 0,
1460
+ type: "button",
1461
+ class: "btn-text theme-secondary btn-icon",
1462
+ "aria-label": e.t("file.retry"),
1463
+ onClick: (a) => e.retry(t)
1464
+ }, n[1] || (n[1] = [
1465
+ $("svg", {
1466
+ width: "16",
1467
+ height: "16",
1468
+ viewBox: "0 0 16 16",
1469
+ fill: "none",
1470
+ stroke: "currentColor",
1471
+ "stroke-width": "1.5",
1472
+ "stroke-linecap": "round",
1473
+ "stroke-linejoin": "round",
1474
+ "aria-hidden": "true"
1475
+ }, [
1476
+ $("path", { d: "M13.5 3v3.5H10" }),
1477
+ $("path", { d: "M3.2 6.5A5.5 5.5 0 0 1 13 6.5M12.8 9.5A5.5 5.5 0 0 1 3 9.5M2.5 13V9.5H6" })
1478
+ ], -1)
1479
+ ]), 8, Ut)) : A("", !0),
1480
+ t.path || t.error ? (v(), b("button", {
1481
+ key: 1,
1482
+ type: "button",
1483
+ class: "btn-text theme-danger btn-icon",
1484
+ "aria-label": e.t("file.remove"),
1485
+ onClick: (a) => e.remove(t)
1486
+ }, n[2] || (n[2] = [
1487
+ $("svg", {
1488
+ width: "16",
1489
+ height: "16",
1490
+ viewBox: "0 0 16 16",
1491
+ fill: "none",
1492
+ stroke: "currentColor",
1493
+ "stroke-width": "1.5",
1494
+ "stroke-linecap": "round",
1495
+ "aria-hidden": "true"
1496
+ }, [
1497
+ $("path", { d: "m4 4 8 8M12 4l-8 8" })
1498
+ ], -1)
1499
+ ]), 8, Kt)) : A("", !0)
1500
+ ])
1501
+ ]),
1502
+ t.uploading ? (v(), b("div", {
1503
+ key: 0,
1504
+ class: "progress mt-2",
1505
+ role: "progressbar",
1506
+ "aria-valuenow": t.percent,
1507
+ "aria-valuemin": "0",
1508
+ "aria-valuemax": "100"
1509
+ }, [
1510
+ $("div", {
1511
+ class: "progress-bar",
1512
+ style: le({ width: t.percent + "%" })
1513
+ }, null, 4)
1514
+ ], 8, Gt)) : A("", !0),
1515
+ t.error ? (v(), b("div", Ht, N(t.error), 1)) : A("", !0)
1516
+ ]))), 128))
1517
+ ])) : A("", !0)
1518
+ ]);
1519
+ }
1520
+ const en = /* @__PURE__ */ O(Dt, [["render", Xt]]), Jt = E({
1521
+ name: "FormAdornInput",
1522
+ inheritAttrs: !1,
1523
+ emits: ["update:modelValue", "change", "input", "focus", "blur"],
1524
+ props: {
1525
+ ...R,
1526
+ type: { type: String, default: "text" },
1527
+ placeholder: { type: String, default: null },
1528
+ /** Text shown before the input. */
1529
+ startText: { type: String, default: null },
1530
+ /** Text shown after the input. */
1531
+ endText: { type: String, default: null },
1532
+ size: { type: String, default: null }
1533
+ },
1534
+ setup(e, { emit: n }) {
1535
+ const o = P(e, n), l = B(null), r = S(() => e.size ? `form-control-${e.size}` : null);
1536
+ function d(t) {
1537
+ var a, f, m;
1538
+ (t.target === t.currentTarget || (f = (a = t.target).closest) != null && f.call(a, ".form-adorn-icon, .form-adorn-text")) && ((m = l.value) == null || m.focus());
1539
+ }
1540
+ return { ...o, input: l, sizeClass: r, focusInput: d, emit: n, focus: () => {
1541
+ var t;
1542
+ return (t = l.value) == null ? void 0 : t.focus();
1543
+ } };
1544
+ },
1545
+ expose: ["focus"]
1546
+ }), Wt = {
1547
+ key: 0,
1548
+ class: "form-adorn-text"
1549
+ }, Zt = ["name", "id", "type", "placeholder", "required", "readonly", "disabled", "aria-invalid"], Yt = {
1550
+ key: 0,
1551
+ class: "form-adorn-text"
1552
+ };
1553
+ function Qt(e, n, o, l, r, d) {
1554
+ return v(), b("div", {
1555
+ class: F(["form-control form-adorn", [e.sizeClass, { "is-invalid": e.isInvalid }, e.$attrs.class]]),
1556
+ style: le(e.$attrs.style),
1557
+ onClick: n[5] || (n[5] = (...t) => e.focusInput && e.focusInput(...t))
1558
+ }, [
1559
+ j(e.$slots, "start", {}, () => [
1560
+ e.startText ? (v(), b("span", Wt, N(e.startText), 1)) : A("", !0)
1561
+ ]),
1562
+ ee($("input", ve({
1563
+ ref: "input",
1564
+ "onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t)
1565
+ }, { ...e.$attrs, class: void 0, style: void 0 }, {
1566
+ name: e.name,
1567
+ id: e.inputId,
1568
+ type: e.type,
1569
+ placeholder: e.placeholder,
1570
+ required: e.required,
1571
+ readonly: e.readonly,
1572
+ disabled: e.isDisabled,
1573
+ "aria-invalid": e.isInvalid || void 0,
1574
+ class: ["form-ghost", { "is-invalid": e.isInvalid }],
1575
+ onInput: n[1] || (n[1] = (t) => e.emit("input", e.model, t)),
1576
+ onChange: n[2] || (n[2] = (t) => e.emitChange(e.model, t)),
1577
+ onFocus: n[3] || (n[3] = (t) => e.$emit("focus", t)),
1578
+ onBlur: n[4] || (n[4] = (t) => e.$emit("blur", t))
1579
+ }), null, 16, Zt), [
1580
+ [me, e.model]
1581
+ ]),
1582
+ j(e.$slots, "end", {}, () => [
1583
+ e.endText ? (v(), b("span", Yt, N(e.endText), 1)) : A("", !0)
1584
+ ])
1585
+ ], 6);
1586
+ }
1587
+ const Fe = /* @__PURE__ */ O(Jt, [["render", Qt]]), xt = (e) => e !== null && typeof e == "object" && (Object.getPrototypeOf(e) === Object.prototype || Object.getPrototypeOf(e) === null);
1588
+ function Ve(e) {
1589
+ return typeof e == "string" ? De(e) : Array.isArray(e) ? e.map(Ve) : xt(e) ? Object.keys(e).reduce((n, o) => (n[o] = Ve(e[o]), n), {}) : e;
1590
+ }
1591
+ function Xe(e, n) {
1592
+ try {
1593
+ return JSON.stringify(e) === JSON.stringify(n);
1594
+ } catch {
1595
+ return !1;
1596
+ }
1597
+ }
1598
+ const _t = E({
1599
+ name: "FormContainer",
1600
+ emits: [
1601
+ "update:modelValue",
1602
+ "change",
1603
+ "submit",
1604
+ "reset",
1605
+ "before",
1606
+ "start",
1607
+ "progress",
1608
+ "success",
1609
+ "error",
1610
+ "cancel",
1611
+ "finish",
1612
+ // Legacy (v2) event names
1613
+ "onStart",
1614
+ "onFinish",
1615
+ "onSuccess",
1616
+ "onError"
1617
+ ],
1618
+ props: {
1619
+ /** The object that holds the value of every field (v-model). */
1620
+ modelValue: { type: Object, default: () => ({}) },
1621
+ url: { type: String, default: "" },
1622
+ method: { type: String, default: "post" },
1623
+ /** Only reload these props after a successful visit (Inertia `only`). */
1624
+ only: { type: Array, default: () => [] },
1625
+ /** Extra form fields that are not part of `modelValue`. */
1626
+ options: { type: Object, default: () => ({}) },
1627
+ /** Extra Inertia visit options (preserveScroll, preserveState, headers, …). */
1628
+ visitOptions: { type: Object, default: () => ({}) },
1629
+ autoTab: { type: Boolean, default: !0 },
1630
+ resetOnSuccess: { type: Boolean, default: !1 },
1631
+ /** Replace the default submit behaviour. Receives (event, form). */
1632
+ submitHandler: { type: Function, default: null },
1633
+ /** Convert Persian/Arabic digits to English digits before submitting. */
1634
+ normalizeDigits: { type: Boolean, default: !0 },
1635
+ /** Enable Bootstrap 6 client-side validation (`data-bs-validate`). */
1636
+ validate: { type: Boolean, default: !1 },
1637
+ /** Render server messages as HTML (only enable for trusted messages). */
1638
+ htmlMessages: { type: Boolean, default: !1 },
1639
+ /** Hide the built-in error / success alerts. */
1640
+ hideAlerts: { type: Boolean, default: !1 }
1641
+ },
1642
+ setup(e, { emit: n, expose: o }) {
1643
+ const l = B(null), r = $e({ hasMessage: !1, successMessage: null }), d = pn({
1644
+ ...e.options,
1645
+ ...e.modelValue
1646
+ });
1647
+ d.uploading = null, d.getID = function(s = {}) {
1648
+ var i;
1649
+ const c = [];
1650
+ return (i = l.value) != null && i.id && c.push(l.value.id), typeof s == "string" && c.push(s), s.group && (s.group.name && c.push(s.group.name), s.group.index !== void 0 && s.group.index !== null && c.push(s.group.index)), s.name && c.push(s.name), s.value !== void 0 && s.value !== null && s.value !== "" && c.push(s.value), c.join("-");
1651
+ };
1652
+ const t = new Set(Object.keys(d)), a = () => Object.keys(d).filter((s) => !t.has(s) && typeof d[s] != "function" && d[s] !== void 0), f = () => {
1653
+ const s = typeof d.data == "function" ? { ...d.data() } : Object.keys(d).reduce((c, i) => (t.has(i) && typeof d[i] != "function" && (c[i] = d[i]), c), {});
1654
+ return a().forEach((c) => {
1655
+ s[c] = d[c];
1656
+ }), s;
1657
+ }, m = () => {
1658
+ a().forEach((s) => delete d[s]), d.reset();
1659
+ };
1660
+ q(
1661
+ () => f(),
1662
+ (s) => {
1663
+ n("change", s), n("update:modelValue", s);
1664
+ },
1665
+ { deep: !0 }
1666
+ ), q(
1667
+ () => e.modelValue,
1668
+ (s) => {
1669
+ !s || Xe(s, f()) || Object.keys(s).forEach((c) => {
1670
+ Xe(d[c], s[c]) || (d[c] = s[c]);
1671
+ });
1672
+ },
1673
+ { deep: !0 }
1674
+ );
1675
+ function p(s) {
1676
+ const c = Array.from(l.value.querySelectorAll("input, select, textarea")).filter(
1677
+ (u) => !u.disabled && u.tabIndex !== -1 && u.type !== "hidden" && u.offsetParent !== null
1678
+ ), i = c[c.indexOf(s) + 1];
1679
+ i && (i.focus(), i.tagName !== "SELECT" && typeof i.select == "function" && i.select());
1680
+ }
1681
+ function h(s) {
1682
+ const c = s.target;
1683
+ if (!["INPUT", "TEXTAREA"].includes(c.tagName)) return;
1684
+ e.autoTab && c.maxLength > 0 && c.value.length >= c.maxLength && p(c);
1685
+ const i = parseInt(c.dataset.autoSubmitLength, 10);
1686
+ !isNaN(i) && c.value.length >= i && I();
1687
+ }
1688
+ function g() {
1689
+ m(), d.clearErrors(), r.hasMessage = !1, r.successMessage = null, n("reset");
1690
+ }
1691
+ async function I(s) {
1692
+ if (e.submitHandler)
1693
+ return e.submitHandler(s, d);
1694
+ n("submit", s), d.transform((c) => {
1695
+ const i = { ...e.modelValue, ...c, ...f() };
1696
+ return e.normalizeDigits ? Ve(i) : i;
1697
+ }).submit((e.method || "post").toString().toLowerCase(), e.url, {
1698
+ only: e.only,
1699
+ ...e.visitOptions,
1700
+ onBefore: (c) => {
1701
+ var i, u;
1702
+ return n("before", c), (u = (i = e.visitOptions).onBefore) == null ? void 0 : u.call(i, c);
1703
+ },
1704
+ onStart: (c) => {
1705
+ var i, u;
1706
+ r.hasMessage = !1, r.successMessage = null, d.clearErrors(), n("start", c), n("onStart", c), (u = (i = e.visitOptions).onStart) == null || u.call(i, c);
1707
+ },
1708
+ onProgress: (c) => {
1709
+ var i, u;
1710
+ n("progress", c), (u = (i = e.visitOptions).onProgress) == null || u.call(i, c);
1711
+ },
1712
+ onCancel: () => {
1713
+ var c, i;
1714
+ n("cancel"), (i = (c = e.visitOptions).onCancel) == null || i.call(c);
1715
+ },
1716
+ onFinish: (c) => {
1717
+ var i, u;
1718
+ n("finish", c), n("onFinish", c), (u = (i = e.visitOptions).onFinish) == null || u.call(i, c);
1719
+ },
1720
+ onError: (c) => {
1721
+ var i, u;
1722
+ n("error", c), n("onError", c), (u = (i = e.visitOptions).onError) == null || u.call(i, c);
1723
+ },
1724
+ onSuccess: (c) => {
1725
+ var i, u, w;
1726
+ e.resetOnSuccess && m(), (i = c == null ? void 0 : c.props) != null && i.message && (r.hasMessage = !0, r.successMessage = c.props.message), n("success", c), n("onSuccess", c), (w = (u = e.visitOptions).onSuccess) == null || w.call(u, c);
1727
+ }
1728
+ });
1729
+ }
1730
+ return ge("form", S(() => d)), ge("formApi", { submit: I, reset: g, el: l }), o({ submit: I, reset: g, form: d, el: l }), { form: d, formEl: l, ui: r, handleInput: h, reset: g, submit: I };
1731
+ }
1732
+ }), el = ["action", "method", "data-bs-validate", "novalidate"], nl = {
1733
+ key: 0,
1734
+ class: "alert theme-danger",
1735
+ role: "alert"
1736
+ }, tl = { class: "list-unstyled p-0 m-0 fanum" }, ll = ["innerHTML"], ol = {
1737
+ key: 0,
1738
+ class: "alert theme-success",
1739
+ role: "status"
1740
+ }, al = ["innerHTML"], il = { key: 1 };
1741
+ function rl(e, n, o, l, r, d) {
1742
+ return v(), b("form", {
1743
+ ref: "formEl",
1744
+ action: e.url || void 0,
1745
+ method: e.method,
1746
+ "data-bs-validate": e.validate ? "" : void 0,
1747
+ novalidate: !e.validate || e.form.hasErrors ? !0 : void 0,
1748
+ class: F({ "form-processing": e.form.processing }),
1749
+ onInput: n[0] || (n[0] = (...t) => e.handleInput && e.handleInput(...t)),
1750
+ onSubmit: n[1] || (n[1] = Ue((...t) => e.submit && e.submit(...t), ["prevent"])),
1751
+ onReset: n[2] || (n[2] = Ue((...t) => e.reset && e.reset(...t), ["prevent"]))
1752
+ }, [
1753
+ e.hideAlerts ? A("", !0) : (v(), b(Y, { key: 0 }, [
1754
+ j(e.$slots, "errors", {
1755
+ errors: e.form.errors,
1756
+ form: e.form
1757
+ }, () => [
1758
+ e.form.hasErrors ? (v(), b("div", nl, [
1759
+ $("ul", tl, [
1760
+ (v(!0), b(Y, null, oe(e.form.errors, (t, a) => (v(), b("li", { key: a }, [
1761
+ e.htmlMessages ? (v(), b("span", {
1762
+ key: 0,
1763
+ innerHTML: t
1764
+ }, null, 8, ll)) : (v(), b(Y, { key: 1 }, [
1765
+ ue(N(t), 1)
1766
+ ], 64))
1767
+ ]))), 128))
1768
+ ])
1769
+ ])) : A("", !0)
1770
+ ]),
1771
+ j(e.$slots, "message", {
1772
+ message: e.ui.successMessage
1773
+ }, () => [
1774
+ e.ui.hasMessage && e.ui.successMessage ? (v(), b("div", ol, [
1775
+ e.htmlMessages ? (v(), b("span", {
1776
+ key: 0,
1777
+ innerHTML: e.ui.successMessage
1778
+ }, null, 8, al)) : (v(), b("span", il, N(e.ui.successMessage), 1))
1779
+ ])) : A("", !0)
1780
+ ])
1781
+ ], 64)),
1782
+ j(e.$slots, "default", {
1783
+ form: e.form,
1784
+ submit: e.submit,
1785
+ reset: e.reset
1786
+ })
1787
+ ], 42, el);
1788
+ }
1789
+ const ul = /* @__PURE__ */ O(_t, [["render", rl]]), sl = E({
1790
+ name: "FormLabel",
1791
+ props: {
1792
+ /** id of the control. Detected automatically inside <FormField> or from the next element. */
1793
+ for: { type: String, default: null },
1794
+ required: { type: Boolean, default: !1 }
1795
+ },
1796
+ setup(e) {
1797
+ const n = Z("formField", null), o = B(null), l = B(null);
1798
+ K(() => {
1799
+ var t, a;
1800
+ if (e.for || n != null && n.id) return;
1801
+ const d = (t = o.value) == null ? void 0 : t.nextElementSibling;
1802
+ d && (l.value = d.id || ((a = d.querySelector("[id]")) == null ? void 0 : a.id) || null);
1803
+ });
1804
+ const r = S(() => e.for || (n == null ? void 0 : n.id) || l.value || void 0);
1805
+ return { el: o, target: r };
1806
+ }
1807
+ }), dl = ["for"], cl = {
1808
+ key: 0,
1809
+ class: "fg-danger",
1810
+ "aria-hidden": "true"
1811
+ };
1812
+ function fl(e, n, o, l, r, d) {
1813
+ return v(), b("label", {
1814
+ ref: "el",
1815
+ class: "form-label",
1816
+ for: e.target
1817
+ }, [
1818
+ j(e.$slots, "default"),
1819
+ e.required ? (v(), b("span", cl, " *")) : A("", !0)
1820
+ ], 8, dl);
1821
+ }
1822
+ const nn = /* @__PURE__ */ O(sl, [["render", fl]]);
1823
+ let ml = 0;
1824
+ const pl = E({
1825
+ name: "FormField",
1826
+ components: { FormLabel: nn },
1827
+ props: {
1828
+ /** Field key. Used to read the server-side error of the field. */
1829
+ name: { type: String, default: null },
1830
+ label: { type: String, default: null },
1831
+ help: { type: String, default: null },
1832
+ /** Override the error text (otherwise it is read from the form errors). */
1833
+ error: { type: String, default: null },
1834
+ required: { type: Boolean, default: !1 },
1835
+ id: { type: String, default: null }
1836
+ },
1837
+ setup(e) {
1838
+ const n = Z("form", null), o = he.useId ? he.useId() : `ff-${++ml}`, l = S(() => e.id || (e.name ? `${e.name}-${o}` : o));
1839
+ ge("formField", {
1840
+ get id() {
1841
+ return l.value;
1842
+ },
1843
+ get name() {
1844
+ return e.name;
1845
+ }
1846
+ });
1847
+ const r = S(() => {
1848
+ var d, t;
1849
+ return e.error ?? (e.name ? (t = (d = n == null ? void 0 : n.value) == null ? void 0 : d.errors) == null ? void 0 : t[e.name] : null) ?? null;
1850
+ });
1851
+ return { fieldId: l, errorText: r };
1852
+ }
1853
+ }), yl = { class: "form-field" }, hl = ["id"], vl = ["id"];
1854
+ function gl(e, n, o, l, r, d) {
1855
+ const t = U("FormLabel");
1856
+ return v(), b("div", yl, [
1857
+ j(e.$slots, "label", {}, () => [
1858
+ e.label ? (v(), Q(t, {
1859
+ key: 0,
1860
+ for: e.fieldId,
1861
+ required: e.required
1862
+ }, {
1863
+ default: pe(() => [
1864
+ ue(N(e.label), 1)
1865
+ ]),
1866
+ _: 1
1867
+ }, 8, ["for", "required"])) : A("", !0)
1868
+ ]),
1869
+ j(e.$slots, "default"),
1870
+ j(e.$slots, "help", {}, () => [
1871
+ e.help ? (v(), b("div", {
1872
+ key: 0,
1873
+ id: e.fieldId + "-help",
1874
+ class: "form-text"
1875
+ }, N(e.help), 9, hl)) : A("", !0)
1876
+ ]),
1877
+ j(e.$slots, "error", { error: e.errorText }, () => [
1878
+ e.errorText ? (v(), b("div", {
1879
+ key: 0,
1880
+ id: e.fieldId + "-error",
1881
+ class: "invalid-feedback d-block",
1882
+ role: "alert"
1883
+ }, N(e.errorText), 9, vl)) : A("", !0)
1884
+ ])
1885
+ ]);
1886
+ }
1887
+ const bl = /* @__PURE__ */ O(pl, [["render", gl]]), $l = E({
1888
+ name: "GroupControl",
1889
+ props: {
1890
+ /** Key of the object / array inside the form that holds the grouped values. */
1891
+ name: { type: String, required: !0 },
1892
+ /** Explicit item index (repeaters). When omitted it is detected from the DOM position. */
1893
+ index: { type: [Number, String], default: null }
1894
+ },
1895
+ setup(e) {
1896
+ const n = Z("form", null), o = B(null), l = B("0"), r = S(() => e.index !== null ? String(e.index) : l.value);
1897
+ K(() => {
1898
+ var a, f, m;
1899
+ if (e.index !== null) return;
1900
+ const t = (m = (f = (a = o.value) == null ? void 0 : a.parentNode) == null ? void 0 : f.parentNode) == null ? void 0 : m.querySelectorAll(".form-control-group");
1901
+ t == null || t.forEach((p, h) => {
1902
+ p === o.value && (l.value = String(h));
1903
+ });
1904
+ });
1905
+ const d = {
1906
+ get name() {
1907
+ return e.name;
1908
+ },
1909
+ get index() {
1910
+ return r.value;
1911
+ },
1912
+ getData(t) {
1913
+ var f, m;
1914
+ const a = (f = n == null ? void 0 : n.value) == null ? void 0 : f[e.name];
1915
+ return a == null ? null : Array.isArray(a) ? ((m = a[Number(r.value)]) == null ? void 0 : m[t]) ?? null : a[t] ?? null;
1916
+ },
1917
+ setData(t, a) {
1918
+ const f = n == null ? void 0 : n.value;
1919
+ if (f)
1920
+ if ((f[e.name] === null || f[e.name] === void 0) && (f[e.name] = e.index !== null ? [] : {}), Array.isArray(f[e.name])) {
1921
+ const m = Number(r.value);
1922
+ f[e.name][m] || (f[e.name][m] = {}), f[e.name][m][t] = a;
1923
+ } else
1924
+ f[e.name][t] = a;
1925
+ }
1926
+ };
1927
+ return ge("group", S(() => d)), { groupEl: o, index: r };
1928
+ }
1929
+ }), Sl = ["data-name", "data-group-id"];
1930
+ function Il(e, n, o, l, r, d) {
1931
+ return v(), b("div", {
1932
+ ref: "groupEl",
1933
+ class: "form-control-group",
1934
+ "data-name": e.name,
1935
+ "data-group-id": e.index
1936
+ }, [
1937
+ j(e.$slots, "default")
1938
+ ], 8, Sl);
1939
+ }
1940
+ const tn = /* @__PURE__ */ O($l, [["render", Il]]), Cl = x(() => import("@vue-leaflet/vue-leaflet").then((e) => e.LMap)), wl = x(() => import("@vue-leaflet/vue-leaflet").then((e) => e.LTileLayer)), kl = x(() => import("@vue-leaflet/vue-leaflet").then((e) => e.LMarker)), Ml = E({
1941
+ name: "LocationInput",
1942
+ components: { LMap: Cl, LTileLayer: wl, LMarker: kl },
1943
+ emits: ["update:modelValue", "change", "ready"],
1944
+ props: {
1945
+ ...R,
1946
+ name: { type: String, default: "location" },
1947
+ /** Initial map centre when there is no value yet. */
1948
+ center: { type: Object, default: () => ({ lat: 35.69293, lng: 51.36372 }) },
1949
+ zoom: { type: Number, default: 13 },
1950
+ height: { type: [Number, String], default: 300 },
1951
+ tileUrl: { type: String, default: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" },
1952
+ attribution: { type: String, default: "&copy; OpenStreetMap contributors" }
1953
+ },
1954
+ setup(e, { emit: n }) {
1955
+ const o = P(e, n), l = B(!1), r = B(e.zoom);
1956
+ K(() => {
1957
+ l.value = !0;
1958
+ });
1959
+ const d = S(() => {
1960
+ const m = o.model.value;
1961
+ return (m == null ? void 0 : m.lat) !== void 0 && (m == null ? void 0 : m.lat) !== null && (m == null ? void 0 : m.lng) !== void 0 && (m == null ? void 0 : m.lng) !== null ? { lat: Number(m.lat), lng: Number(m.lng) } : null;
1962
+ }), t = S(() => d.value ?? e.center), a = S(() => e.readonly || o.isDisabled.value);
1963
+ q(() => e.zoom, (m) => r.value = m);
1964
+ function f(m) {
1965
+ var g;
1966
+ if (a.value) return;
1967
+ const p = (m == null ? void 0 : m.latlng) ?? ((g = m == null ? void 0 : m.target) == null ? void 0 : g._latlng);
1968
+ if (!p) return;
1969
+ const h = { lat: p.lat, lng: p.lng };
1970
+ o.model.value = h, o.emitChange(h, m);
1971
+ }
1972
+ return {
1973
+ ...o,
1974
+ ready: l,
1975
+ zoomLevel: r,
1976
+ marker: d,
1977
+ mapCenter: t,
1978
+ locked: a,
1979
+ setMarker: f,
1980
+ heightCss: S(() => typeof e.height == "number" ? `${e.height}px` : e.height)
1981
+ };
1982
+ }
1983
+ }), Bl = ["id"];
1984
+ function Tl(e, n, o, l, r, d) {
1985
+ const t = U("l-tile-layer"), a = U("l-marker"), f = U("l-map");
1986
+ return v(), b("div", {
1987
+ class: F(["location-map-container position-relative overflow-hidden", { disabled: e.locked, "is-invalid": e.isInvalid }]),
1988
+ id: e.inputId,
1989
+ style: le({ width: "100%", height: e.heightCss })
1990
+ }, [
1991
+ e.ready ? (v(), Q(f, {
1992
+ key: 0,
1993
+ zoom: e.zoomLevel,
1994
+ "onUpdate:zoom": n[0] || (n[0] = (m) => e.zoomLevel = m),
1995
+ "use-global-leaflet": !1,
1996
+ center: e.mapCenter,
1997
+ onClick: e.setMarker,
1998
+ onReady: n[1] || (n[1] = (m) => e.$emit("ready", m))
1999
+ }, {
2000
+ default: pe(() => [
2001
+ te(t, {
2002
+ url: e.tileUrl,
2003
+ attribution: e.attribution,
2004
+ "layer-type": "base",
2005
+ name: "OpenStreetMap"
2006
+ }, null, 8, ["url", "attribution"]),
2007
+ e.marker ? (v(), Q(a, {
2008
+ key: 0,
2009
+ "lat-lng": e.marker,
2010
+ draggable: !e.locked,
2011
+ onDragend: e.setMarker
2012
+ }, null, 8, ["lat-lng", "draggable", "onDragend"])) : A("", !0)
2013
+ ]),
2014
+ _: 1
2015
+ }, 8, ["zoom", "center", "onClick"])) : A("", !0)
2016
+ ], 14, Bl);
2017
+ }
2018
+ const Al = /* @__PURE__ */ O(Ml, [["render", Tl]]), Nl = E({
2019
+ name: "MobileInput",
2020
+ components: { TextInput: Ie },
2021
+ props: {
2022
+ name: { type: String, default: "mobile" },
2023
+ placeholder: { type: String, default: null },
2024
+ locale: { type: String, default: null }
2025
+ },
2026
+ setup(e) {
2027
+ const { t: n } = G(() => e.locale);
2028
+ return { t: n };
2029
+ }
2030
+ });
2031
+ function El(e, n, o, l, r, d) {
2032
+ const t = U("TextInput");
2033
+ return v(), Q(t, {
2034
+ type: "tel",
2035
+ inputmode: "tel",
2036
+ autocomplete: "tel",
2037
+ class: "form-control-mobile fanum",
2038
+ name: e.name,
2039
+ placeholder: e.placeholder ?? e.t("mobile.placeholder")
2040
+ }, null, 8, ["name", "placeholder"]);
2041
+ }
2042
+ const Ol = /* @__PURE__ */ O(Nl, [["render", El]]), Vl = E({
2043
+ name: "QuantityInput",
2044
+ emits: ["update:modelValue", "change", "input", "increment", "decrement", "focus", "blur"],
2045
+ props: {
2046
+ ...R,
2047
+ min: { type: Number, default: 0 },
2048
+ max: { type: Number, default: null },
2049
+ step: { type: Number, default: 1 },
2050
+ unit: { type: String, default: null },
2051
+ size: { type: String, default: null },
2052
+ locale: { type: String, default: null }
2053
+ },
2054
+ setup(e, { emit: n }) {
2055
+ const o = P(e, n), { t: l } = G(() => e.locale), r = S(() => {
2056
+ const g = Number(o.model.value);
2057
+ return Number.isFinite(g) ? g : e.min;
2058
+ }), d = S(() => e.unit ?? l("quantity.unit")), t = S(() => be(r.value)), a = S(() => e.readonly || o.isDisabled.value), f = S(() => !a.value && (e.max === null || r.value + e.step <= e.max)), m = S(() => !a.value && r.value - e.step >= e.min);
2059
+ function p(g, I, s) {
2060
+ let c = g;
2061
+ e.max !== null && (c = Math.min(c, e.max)), c = Math.max(c, e.min), o.model.value = c, s && n(s, c), o.emitChange(c, I);
2062
+ }
2063
+ function h(g) {
2064
+ const I = xe(g.target.value);
2065
+ o.model.value = I === null ? e.min : I, g.target.value = be(o.model.value), n("input", o.model.value, g);
2066
+ }
2067
+ return K(() => {
2068
+ const g = o.model.value;
2069
+ (g == null || g === "") && (o.model.value = e.min);
2070
+ }), {
2071
+ ...o,
2072
+ t: l,
2073
+ unitText: d,
2074
+ display: t,
2075
+ canIncrement: f,
2076
+ canDecrement: m,
2077
+ lock: a,
2078
+ increment: (g) => f.value && p(r.value + e.step, g, "increment"),
2079
+ decrement: (g) => m.value && p(r.value - e.step, g, "decrement"),
2080
+ onInput: h,
2081
+ clampOnBlur: (g) => p(r.value, g)
2082
+ };
2083
+ }
2084
+ }), Dl = ["disabled", "aria-label"], Fl = ["name", "id", "value", "readonly", "disabled", "aria-invalid"], Ll = ["disabled", "aria-label"], zl = {
2085
+ key: 0,
2086
+ class: "input-group-text fanum"
2087
+ };
2088
+ function ql(e, n, o, l, r, d) {
2089
+ return v(), b("div", {
2090
+ class: F(["input-group input-group-quantity", { "is-invalid": e.isInvalid }])
2091
+ }, [
2092
+ $("button", {
2093
+ type: "button",
2094
+ class: "btn-outline theme-secondary btn-icon",
2095
+ disabled: !e.canIncrement,
2096
+ "aria-label": e.t("quantity.increase"),
2097
+ onClick: n[0] || (n[0] = (...t) => e.increment && e.increment(...t))
2098
+ }, n[6] || (n[6] = [
2099
+ $("svg", {
2100
+ width: "14",
2101
+ height: "14",
2102
+ viewBox: "0 0 16 16",
2103
+ fill: "none",
2104
+ stroke: "currentColor",
2105
+ "stroke-width": "2",
2106
+ "stroke-linecap": "round",
2107
+ "aria-hidden": "true"
2108
+ }, [
2109
+ $("path", { d: "M8 3v10M3 8h10" })
2110
+ ], -1)
2111
+ ]), 8, Dl),
2112
+ $("input", {
2113
+ name: e.name,
2114
+ id: e.inputId,
2115
+ value: e.display,
2116
+ readonly: e.readonly,
2117
+ disabled: e.isDisabled,
2118
+ "aria-invalid": e.isInvalid || void 0,
2119
+ type: "tel",
2120
+ inputmode: "numeric",
2121
+ autocomplete: "off",
2122
+ class: F(["form-control fanum text-center", { "is-invalid": e.isInvalid }]),
2123
+ onInput: n[1] || (n[1] = (...t) => e.onInput && e.onInput(...t)),
2124
+ onChange: n[2] || (n[2] = (...t) => e.clampOnBlur && e.clampOnBlur(...t)),
2125
+ onFocus: n[3] || (n[3] = (t) => e.$emit("focus", t)),
2126
+ onBlur: n[4] || (n[4] = (t) => e.$emit("blur", t))
2127
+ }, null, 42, Fl),
2128
+ $("button", {
2129
+ type: "button",
2130
+ class: "btn-outline theme-secondary btn-icon",
2131
+ disabled: !e.canDecrement,
2132
+ "aria-label": e.t("quantity.decrease"),
2133
+ onClick: n[5] || (n[5] = (...t) => e.decrement && e.decrement(...t))
2134
+ }, n[7] || (n[7] = [
2135
+ $("svg", {
2136
+ width: "14",
2137
+ height: "14",
2138
+ viewBox: "0 0 16 16",
2139
+ fill: "none",
2140
+ stroke: "currentColor",
2141
+ "stroke-width": "2",
2142
+ "stroke-linecap": "round",
2143
+ "aria-hidden": "true"
2144
+ }, [
2145
+ $("path", { d: "M3 8h10" })
2146
+ ], -1)
2147
+ ]), 8, Ll),
2148
+ e.unitText ? (v(), b("span", zl, N(e.unitText), 1)) : A("", !0),
2149
+ j(e.$slots, "suffix")
2150
+ ], 2);
2151
+ }
2152
+ const ln = /* @__PURE__ */ O(Vl, [["render", ql]]), Rl = E({
2153
+ name: "MultiQuantityInput",
2154
+ components: { GroupControl: tn, QuantityInput: ln },
2155
+ emits: ["update:modelValue", "change", "show", "shown", "hide", "hidden"],
2156
+ props: {
2157
+ ...R,
2158
+ /** Array of strings or { name, min, max, description, html }. */
2159
+ options: { type: Array, default: () => [] },
2160
+ min: { type: Number, default: 0 },
2161
+ max: { type: Number, default: null },
2162
+ totalMin: { type: Number, default: null },
2163
+ totalMax: { type: Number, default: null },
2164
+ unit: { type: String, default: null },
2165
+ placement: { type: String, default: "bottom-start" },
2166
+ locale: { type: String, default: null }
2167
+ },
2168
+ setup(e, { emit: n }) {
2169
+ const o = P(e, n), { t: l } = G(() => e.locale), r = B(null), d = S(() => {
2170
+ const m = o.model.value;
2171
+ return m && typeof m == "object" ? m : {};
2172
+ }), t = S(
2173
+ () => e.options.reduce((m, p, h) => m + (Number(d.value[h]) || 0), 0)
2174
+ ), a = S(() => e.unit ?? l("quantity.unit")), f = S(
2175
+ () => e.options.map((m, p) => {
2176
+ const h = typeof m == "object" && m !== null ? m : { name: m }, g = Number(d.value[p]) || 0, I = h.max ?? e.max, s = e.totalMax === null ? 1 / 0 : g + (e.totalMax - t.value);
2177
+ return {
2178
+ key: p,
2179
+ name: h.name ?? h.label ?? String(m),
2180
+ description: h.description ?? null,
2181
+ html: !!h.html,
2182
+ min: h.min ?? e.min,
2183
+ max: Math.min(I ?? 1 / 0, s) === 1 / 0 ? null : Math.min(I ?? 1 / 0, s)
2184
+ };
2185
+ })
2186
+ );
2187
+ return K(() => {
2188
+ (!o.model.value || typeof o.model.value != "object") && (o.model.value = e.options.reduce((m, p, h) => (m[h] = typeof p == "object" && (p == null ? void 0 : p.min) || e.min, m), {}));
2189
+ }), se(
2190
+ "Menu",
2191
+ () => r.value,
2192
+ () => ({ autoClose: "outside", placement: e.placement }),
2193
+ {
2194
+ onCreate(m, p) {
2195
+ ["show", "shown", "hide", "hidden"].forEach(
2196
+ (h) => p.addEventListener(`${h}.bs.menu`, (g) => n(h, g))
2197
+ );
2198
+ }
2199
+ }
2200
+ ), { ...o, t: l, toggle: r, total: t, unitText: a, normalized: f };
2201
+ }
2202
+ }), Pl = { class: "multi-quantity-input fanum" }, jl = ["disabled"], Ul = { class: "combobox-value" }, Kl = { class: "menu p-3" }, Gl = ["innerHTML"], Hl = { key: 1 }, Xl = {
2203
+ key: 2,
2204
+ class: "form-text mt-0"
2205
+ };
2206
+ function Jl(e, n, o, l, r, d) {
2207
+ const t = U("QuantityInput"), a = U("GroupControl");
2208
+ return v(), b("div", Pl, [
2209
+ $("button", {
2210
+ ref: "toggle",
2211
+ type: "button",
2212
+ class: F(["form-control combobox-toggle", { "is-invalid": e.isInvalid }]),
2213
+ "data-bs-toggle": "menu",
2214
+ "aria-haspopup": "true",
2215
+ disabled: e.isDisabled || e.readonly
2216
+ }, [
2217
+ $("span", Ul, N(e.total) + " " + N(e.unitText), 1)
2218
+ ], 10, jl),
2219
+ $("div", Kl, [
2220
+ te(a, { name: e.name }, {
2221
+ default: pe(() => [
2222
+ (v(!0), b(Y, null, oe(e.normalized, (f) => (v(), b("div", {
2223
+ key: f.key,
2224
+ class: "d-flex align-items-center justify-content-between gap-3 py-1"
2225
+ }, [
2226
+ $("div", null, [
2227
+ f.html ? (v(), b("span", {
2228
+ key: 0,
2229
+ innerHTML: f.name
2230
+ }, null, 8, Gl)) : (v(), b("span", Hl, N(f.name), 1)),
2231
+ f.description ? (v(), b("div", Xl, N(f.description), 1)) : A("", !0)
2232
+ ]),
2233
+ te(t, {
2234
+ name: String(f.key),
2235
+ min: f.min,
2236
+ max: f.max,
2237
+ readonly: e.readonly,
2238
+ unit: ""
2239
+ }, null, 8, ["name", "min", "max", "readonly"])
2240
+ ]))), 128))
2241
+ ]),
2242
+ _: 1
2243
+ }, 8, ["name"])
2244
+ ])
2245
+ ]);
2246
+ }
2247
+ const Wl = /* @__PURE__ */ O(Rl, [["render", Jl]]), Zl = E({
2248
+ name: "OTPInput",
2249
+ emits: ["update:modelValue", "change", "input", "complete", "focus", "blur"],
2250
+ props: {
2251
+ ...R,
2252
+ /** Number of characters. */
2253
+ length: { type: Number, default: null },
2254
+ /** Legacy alias of `length`. */
2255
+ maxLength: { type: Number, default: null },
2256
+ /** numeric | alphanumeric | alpha */
2257
+ type: { type: String, default: "numeric", validator: (e) => ["numeric", "alphanumeric", "alpha"].includes(e) },
2258
+ /** Show • instead of the typed character. */
2259
+ mask: { type: Boolean, default: !1 },
2260
+ /** Visual grouping, e.g. [3, 3] renders `123 · 456`. */
2261
+ groups: { type: Array, default: null },
2262
+ separator: { type: String, default: "·" },
2263
+ /** Submit the surrounding FormContainer as soon as the code is complete. */
2264
+ autoSubmit: { type: Boolean, default: !1 },
2265
+ autofocus: { type: Boolean, default: !1 }
2266
+ },
2267
+ setup(e, { emit: n, expose: o }) {
2268
+ const l = P(e, n), r = B(null), d = B(null);
2269
+ let t = !1, a = [];
2270
+ const f = () => e.length ?? e.maxLength ?? 6, m = (s) => s == null ? "" : String(s);
2271
+ function p() {
2272
+ var s;
2273
+ (s = d.value) == null || s.classList.toggle("is-invalid", l.isInvalid.value);
2274
+ }
2275
+ function h() {
2276
+ const s = g.value;
2277
+ if (!s) return;
2278
+ const c = m(l.model.value);
2279
+ if (s.getValue() !== c) {
2280
+ t = !0;
2281
+ try {
2282
+ s.setValue(c);
2283
+ } finally {
2284
+ t = !1;
2285
+ }
2286
+ }
2287
+ }
2288
+ const { instance: g, create: I } = se(
2289
+ "OtpInput",
2290
+ () => r.value,
2291
+ () => ({
2292
+ length: f(),
2293
+ type: e.type,
2294
+ mask: e.mask,
2295
+ groups: e.groups,
2296
+ separator: e.separator
2297
+ }),
2298
+ {
2299
+ onCreate(s, c) {
2300
+ const i = (u, w) => {
2301
+ c.addEventListener(u, w), a.push(() => c.removeEventListener(u, w));
2302
+ };
2303
+ i("input.bs.otpInput", (u) => {
2304
+ t || (l.model.value = u.value, n("input", u.value, u), l.emitChange(u.value, u));
2305
+ }), i("complete.bs.otpInput", (u) => {
2306
+ var w, k;
2307
+ t || (n("complete", u.value), e.autoSubmit && ((k = (w = l.formApi) == null ? void 0 : w.submit) == null || k.call(w)));
2308
+ }), h(), p(), e.autofocus && s.focus();
2309
+ },
2310
+ onDestroy() {
2311
+ a.forEach((s) => s()), a = [];
2312
+ }
2313
+ }
2314
+ );
2315
+ return K(() => {
2316
+ d.value && (d.value.value = m(l.model.value));
2317
+ }), q(() => l.model.value, h), q(l.isInvalid, p, { flush: "post" }), q(
2318
+ () => [f(), e.type, e.mask, e.groups, e.separator],
2319
+ async () => {
2320
+ await X(), I();
2321
+ },
2322
+ { deep: !0 }
2323
+ ), o({
2324
+ focus: () => {
2325
+ var s;
2326
+ return (s = g.value) == null ? void 0 : s.focus();
2327
+ },
2328
+ clear: () => {
2329
+ var s;
2330
+ (s = g.value) == null || s.clear(), l.model.value = "";
2331
+ }
2332
+ }), { ...l, el: r, input: d };
2333
+ }
2334
+ }), Yl = {
2335
+ ref: "el",
2336
+ class: "otp fanum"
2337
+ }, Ql = ["name", "id", "disabled", "readonly", "required", "aria-invalid"];
2338
+ function xl(e, n, o, l, r, d) {
2339
+ return v(), b("div", Yl, [
2340
+ $("input", {
2341
+ ref: "input",
2342
+ type: "text",
2343
+ name: e.name,
2344
+ id: e.inputId,
2345
+ disabled: e.isDisabled,
2346
+ readonly: e.readonly,
2347
+ required: e.required,
2348
+ "aria-invalid": e.isInvalid || void 0,
2349
+ onFocus: n[0] || (n[0] = (t) => e.$emit("focus", t)),
2350
+ onBlur: n[1] || (n[1] = (t) => e.$emit("blur", t))
2351
+ }, null, 40, Ql)
2352
+ ], 512);
2353
+ }
2354
+ const _l = /* @__PURE__ */ O(Zl, [["render", xl]]), Je = {
2355
+ en: { weak: "Weak", fair: "Fair", good: "Good", strong: "Strong" },
2356
+ fa: { weak: "ضعیف", fair: "متوسط", good: "خوب", strong: "قوی" }
2357
+ }, eo = E({
2358
+ name: "PasswordInput",
2359
+ components: { TextInput: Ie, FormAdornInput: Fe },
2360
+ inheritAttrs: !1,
2361
+ emits: ["toggle", "strength"],
2362
+ props: {
2363
+ ...R,
2364
+ name: { type: String, default: "password" },
2365
+ placeholder: { type: String, default: null },
2366
+ /** Show a "reveal password" button. */
2367
+ toggle: { type: Boolean, default: !1 },
2368
+ /** Show the password strength meter. */
2369
+ strength: { type: Boolean, default: !1 },
2370
+ /** Show the text feedback ("Weak", "Strong", …) under the meter. */
2371
+ strengthText: { type: Boolean, default: !0 },
2372
+ /** Override the labels: { weak, fair, good, strong }. */
2373
+ strengthMessages: { type: Object, default: null },
2374
+ /** Bootstrap Strength options: { minLength, thresholds: [2, 4, 6], weights, scorer(password) => number }. */
2375
+ strengthOptions: { type: Object, default: () => ({}) },
2376
+ size: { type: String, default: null },
2377
+ locale: { type: String, default: null }
2378
+ },
2379
+ setup(e, { emit: n, expose: o }) {
2380
+ const { t: l, locale: r } = G(() => e.locale), d = P(e, () => {
2381
+ }), t = B(null), a = B(null), f = B(!1), m = S(() => ({
2382
+ ...Je[r.value] || Je.en,
2383
+ ...e.strengthMessages || {}
2384
+ }));
2385
+ function p() {
2386
+ f.value = !f.value, n("toggle", f.value);
2387
+ }
2388
+ let h = [];
2389
+ const { instance: g, create: I } = se(
2390
+ "Strength",
2391
+ () => e.strength ? a.value : null,
2392
+ () => {
2393
+ var c;
2394
+ return {
2395
+ ...e.strengthOptions,
2396
+ input: (c = t.value) == null ? void 0 : c.querySelector("input"),
2397
+ messages: m.value
2398
+ };
2399
+ },
2400
+ {
2401
+ onCreate(c, i) {
2402
+ const u = (w) => n("strength", w.strength ?? null, w.score ?? 0);
2403
+ i.addEventListener("strengthChange.bs.strength", u), h.push(() => i.removeEventListener("strengthChange.bs.strength", u));
2404
+ },
2405
+ onDestroy() {
2406
+ h.forEach((c) => c()), h = [];
2407
+ }
2408
+ }
2409
+ );
2410
+ q(
2411
+ () => d.model.value,
2412
+ () => X(() => {
2413
+ var c;
2414
+ return (c = g.value) == null ? void 0 : c.evaluate();
2415
+ })
2416
+ ), q(
2417
+ () => [e.strength, e.toggle, e.strengthText, m.value, e.strengthOptions],
2418
+ async () => {
2419
+ await X(), e.strength && I();
2420
+ },
2421
+ { deep: !0 }
2422
+ ), o({ strength: () => {
2423
+ var c, i;
2424
+ return ((i = (c = g.value) == null ? void 0 : c.getStrength) == null ? void 0 : i.call(c)) ?? null;
2425
+ } });
2426
+ const s = S(() => ({
2427
+ name: e.name,
2428
+ modelValue: e.modelValue,
2429
+ id: e.id,
2430
+ disabled: e.disabled,
2431
+ readonly: e.readonly,
2432
+ required: e.required,
2433
+ invalid: e.invalid,
2434
+ size: e.size,
2435
+ placeholder: e.placeholder ?? l("password.placeholder")
2436
+ }));
2437
+ return { t: l, root: t, meter: a, visible: f, toggleVisible: p, forwarded: s };
2438
+ }
2439
+ }), no = {
2440
+ ref: "root",
2441
+ class: "password-input"
2442
+ }, to = ["aria-label", "aria-pressed"], lo = {
2443
+ key: 0,
2444
+ width: "16",
2445
+ height: "16",
2446
+ viewBox: "0 0 16 16",
2447
+ fill: "none",
2448
+ stroke: "currentColor",
2449
+ "stroke-width": "1.5",
2450
+ "stroke-linecap": "round",
2451
+ "stroke-linejoin": "round",
2452
+ "aria-hidden": "true"
2453
+ }, oo = {
2454
+ key: 1,
2455
+ width: "16",
2456
+ height: "16",
2457
+ viewBox: "0 0 16 16",
2458
+ fill: "none",
2459
+ stroke: "currentColor",
2460
+ "stroke-width": "1.5",
2461
+ "stroke-linecap": "round",
2462
+ "stroke-linejoin": "round",
2463
+ "aria-hidden": "true"
2464
+ }, ao = {
2465
+ ref: "meter",
2466
+ class: "strength",
2467
+ "aria-hidden": "true"
2468
+ }, io = {
2469
+ key: 0,
2470
+ class: "strength-text",
2471
+ "aria-live": "polite"
2472
+ };
2473
+ function ro(e, n, o, l, r, d) {
2474
+ const t = U("FormAdornInput"), a = U("TextInput");
2475
+ return v(), b("div", no, [
2476
+ e.toggle ? (v(), Q(t, ve({ key: 0 }, { ...e.$attrs, ...e.forwarded }, {
2477
+ type: e.visible ? "text" : "password",
2478
+ autocomplete: "current-password"
2479
+ }), {
2480
+ end: pe(() => [
2481
+ $("button", {
2482
+ type: "button",
2483
+ class: "btn-text theme-secondary btn-icon",
2484
+ "aria-label": e.visible ? e.t("password.hide") : e.t("password.show"),
2485
+ "aria-pressed": e.visible,
2486
+ onClick: n[0] || (n[0] = (...f) => e.toggleVisible && e.toggleVisible(...f))
2487
+ }, [
2488
+ e.visible ? (v(), b("svg", oo, n[2] || (n[2] = [
2489
+ $("path", { d: "M2 2l12 12M6.6 3.7A7 7 0 0 1 8 3.5C12.5 3.5 15 8 15 8a11 11 0 0 1-2.2 2.6M4 5.4A11 11 0 0 0 1 8s2.5 4.5 7 4.5c1 0 1.9-.2 2.7-.6" }, null, -1)
2490
+ ]))) : (v(), b("svg", lo, n[1] || (n[1] = [
2491
+ $("path", { d: "M1 8s2.5-4.5 7-4.5S15 8 15 8s-2.5 4.5-7 4.5S1 8 1 8Z" }, null, -1),
2492
+ $("circle", {
2493
+ cx: "8",
2494
+ cy: "8",
2495
+ r: "2"
2496
+ }, null, -1)
2497
+ ])))
2498
+ ], 8, to)
2499
+ ]),
2500
+ _: 1
2501
+ }, 16, ["type"])) : (v(), Q(a, ve({ key: 1 }, { ...e.$attrs, ...e.forwarded }, {
2502
+ type: "password",
2503
+ autocomplete: "current-password"
2504
+ }), null, 16)),
2505
+ e.strength ? (v(), b(Y, { key: 2 }, [
2506
+ $("div", ao, n[3] || (n[3] = [
2507
+ $("div", { class: "strength-segment" }, null, -1),
2508
+ $("div", { class: "strength-segment" }, null, -1),
2509
+ $("div", { class: "strength-segment" }, null, -1),
2510
+ $("div", { class: "strength-segment" }, null, -1)
2511
+ ]), 512),
2512
+ e.strengthText ? (v(), b("div", io)) : A("", !0)
2513
+ ], 64)) : A("", !0)
2514
+ ], 512);
2515
+ }
2516
+ const uo = /* @__PURE__ */ O(eo, [["render", ro]]), so = x(() => import("vue3-persian-datetime-picker")), co = E({
2517
+ name: "PersianDatePickerInput",
2518
+ components: { Vue3PersianDatetimePicker: so },
2519
+ emits: ["update:modelValue", "change", "open", "close"],
2520
+ props: {
2521
+ ...R,
2522
+ /** date | datetime | time | year-month | month */
2523
+ calendar: { type: String, default: "date" },
2524
+ view: { type: String, default: "date" },
2525
+ min: { type: String, default: null },
2526
+ max: { type: String, default: null },
2527
+ range: { type: Boolean, default: !1 },
2528
+ locale: { type: String, default: "fa" },
2529
+ /** Format of the stored value. */
2530
+ format: { type: String, default: "jYYYY/jMM/jDD" },
2531
+ /** Format shown in the input (defaults to `format`). */
2532
+ inputFormat: { type: String, default: null },
2533
+ placeholder: { type: String, default: null },
2534
+ inputClass: { type: String, default: "form-control fanum" },
2535
+ /** Extra props forwarded to vue3-persian-datetime-picker. */
2536
+ pickerOptions: { type: Object, default: () => ({}) }
2537
+ },
2538
+ setup(e, { emit: n, expose: o }) {
2539
+ const l = P(e, n), r = B(!1);
2540
+ return K(() => {
2541
+ r.value = !0;
2542
+ }), q(
2543
+ () => l.model.value,
2544
+ (d, t) => n("change", d, t)
2545
+ ), o({ clear: () => l.model.value = null }), { ...l, ready: r };
2546
+ }
2547
+ }), fo = ["placeholder"];
2548
+ function mo(e, n, o, l, r, d) {
2549
+ const t = U("Vue3PersianDatetimePicker");
2550
+ return e.ready ? (v(), Q(t, ve({
2551
+ key: 0,
2552
+ modelValue: e.model,
2553
+ "onUpdate:modelValue": n[0] || (n[0] = (a) => e.model = a),
2554
+ name: e.name,
2555
+ id: e.inputId,
2556
+ type: e.calendar,
2557
+ view: e.view,
2558
+ min: e.min,
2559
+ max: e.max,
2560
+ range: e.range,
2561
+ locale: e.locale,
2562
+ format: e.format,
2563
+ "input-format": e.inputFormat || e.format,
2564
+ placeholder: e.placeholder,
2565
+ disabled: e.isDisabled || e.readonly,
2566
+ "input-class": [e.inputClass, { "is-invalid": e.isInvalid }],
2567
+ editable: "",
2568
+ jumpminute: "15",
2569
+ roundminute: !0,
2570
+ "show-now-btn": !0,
2571
+ "auto-submit": !0
2572
+ }, e.pickerOptions, {
2573
+ onOpen: n[1] || (n[1] = (a) => e.$emit("open")),
2574
+ onClose: n[2] || (n[2] = (a) => e.$emit("close"))
2575
+ }), null, 16, ["modelValue", "name", "id", "type", "view", "min", "max", "range", "locale", "format", "input-format", "placeholder", "disabled", "input-class"])) : (v(), b("input", {
2576
+ key: 1,
2577
+ type: "text",
2578
+ class: F(["form-control", { "is-invalid": e.isInvalid }]),
2579
+ placeholder: e.placeholder,
2580
+ disabled: ""
2581
+ }, null, 10, fo));
2582
+ }
2583
+ const po = /* @__PURE__ */ O(co, [["render", mo]]), yo = E({
2584
+ name: "RangeInput",
2585
+ emits: ["update:modelValue", "change", "input", "focus", "blur"],
2586
+ props: {
2587
+ ...R,
2588
+ min: { type: Number, default: 0 },
2589
+ max: { type: Number, default: 100 },
2590
+ step: { type: Number, default: 1 },
2591
+ /** Show the current value above the thumb. */
2592
+ bubble: { type: Boolean, default: !1 },
2593
+ /** (value:number) => string — formats the bubble and the tick labels. */
2594
+ formatter: { type: Function, default: null },
2595
+ /** Tick marks: numbers or { value, label } objects. */
2596
+ ticks: { type: Array, default: () => [] }
2597
+ },
2598
+ setup(e, { emit: n }) {
2599
+ const o = P(e, n), l = B(null), r = B(null), d = S(() => {
2600
+ const h = Number(o.model.value);
2601
+ return o.model.value === null || o.model.value === void 0 || Number.isNaN(h) ? e.min : h;
2602
+ }), t = S(() => e.ticks.length ? `${o.inputId.value}-ticks` : void 0), a = S(
2603
+ () => e.ticks.map((h) => typeof h == "object" && h !== null ? h : { value: h, label: e.formatter ? e.formatter(h) : String(h) })
2604
+ );
2605
+ function f(h) {
2606
+ const g = Number(h.target.value);
2607
+ o.model.value = g, n("input", g, h);
2608
+ }
2609
+ const { instance: m, create: p } = se(
2610
+ "Range",
2611
+ () => l.value,
2612
+ () => ({ bubble: e.bubble, formatter: e.formatter })
2613
+ );
2614
+ return q(
2615
+ () => [o.model.value, e.min, e.max],
2616
+ () => X(() => {
2617
+ var h;
2618
+ return (h = m.value) == null ? void 0 : h.update();
2619
+ }),
2620
+ { flush: "post" }
2621
+ ), q(
2622
+ () => [e.bubble, e.formatter, e.ticks, e.min, e.max],
2623
+ async () => {
2624
+ await X(), p();
2625
+ },
2626
+ { deep: !0 }
2627
+ ), { ...o, el: l, input: r, current: d, listId: t, tickItems: a, onInput: f };
2628
+ }
2629
+ }), ho = {
2630
+ ref: "el",
2631
+ class: "form-range"
2632
+ }, vo = ["name", "id", "min", "max", "step", "list", "disabled", "aria-invalid", "value"], go = ["id"], bo = ["value", "label"];
2633
+ function $o(e, n, o, l, r, d) {
2634
+ return v(), b("div", ho, [
2635
+ $("input", {
2636
+ ref: "input",
2637
+ type: "range",
2638
+ class: F(["form-range-input", { "is-invalid": e.isInvalid }]),
2639
+ name: e.name,
2640
+ id: e.inputId,
2641
+ min: e.min,
2642
+ max: e.max,
2643
+ step: e.step,
2644
+ list: e.listId,
2645
+ disabled: e.isDisabled || e.readonly,
2646
+ "aria-invalid": e.isInvalid || void 0,
2647
+ value: e.current,
2648
+ onInput: n[0] || (n[0] = (...t) => e.onInput && e.onInput(...t)),
2649
+ onChange: n[1] || (n[1] = (t) => e.emitChange(Number(t.target.value), t)),
2650
+ onFocus: n[2] || (n[2] = (t) => e.$emit("focus", t)),
2651
+ onBlur: n[3] || (n[3] = (t) => e.$emit("blur", t))
2652
+ }, null, 42, vo),
2653
+ e.listId ? (v(), b("datalist", {
2654
+ key: 0,
2655
+ id: e.listId
2656
+ }, [
2657
+ (v(!0), b(Y, null, oe(e.tickItems, (t) => (v(), b("option", {
2658
+ key: t.value,
2659
+ value: t.value,
2660
+ label: t.label
2661
+ }, null, 8, bo))), 128))
2662
+ ], 8, go)) : A("", !0)
2663
+ ], 512);
2664
+ }
2665
+ const on = /* @__PURE__ */ O(yo, [["render", $o]]), So = E({
2666
+ name: "SimpleUploader",
2667
+ inheritAttrs: !0,
2668
+ setup(e, { attrs: n, slots: o }) {
2669
+ return () => fn(en, n, o);
2670
+ }
2671
+ }), Io = E({
2672
+ name: "StarRatingInput",
2673
+ emits: ["update:modelValue", "change", "hover"],
2674
+ props: {
2675
+ ...R,
2676
+ /** Initial rating used when the model is empty. */
2677
+ value: { type: Number, default: 0 },
2678
+ maxStars: { type: Number, default: 5 },
2679
+ /** Steps per star: 1 = whole stars, 2 = half stars, 4 = quarter stars… */
2680
+ precision: { type: Number, default: 2 },
2681
+ showValue: { type: Boolean, default: !0 },
2682
+ /** Allow clicking the current rating again to reset it to 0. */
2683
+ clearable: { type: Boolean, default: !1 }
2684
+ },
2685
+ setup(e, { emit: n }) {
2686
+ const o = P(e, n), l = B(null), r = B(null), d = B(!1);
2687
+ K(() => {
2688
+ l.value && (d.value = getComputedStyle(l.value).direction === "rtl");
2689
+ });
2690
+ const t = S(() => e.readonly || o.isDisabled.value), a = S(() => {
2691
+ const u = Number(o.model.value);
2692
+ return o.model.value === null || o.model.value === void 0 || Number.isNaN(u) ? e.value : u;
2693
+ }), f = S(() => r.value ?? a.value), m = S(() => 1 / e.precision), p = (u) => Math.max(0, Math.min(1, f.value - (u - 1))) * 100;
2694
+ function h(u) {
2695
+ const w = l.value.getBoundingClientRect(), k = d.value ? w.right - u.clientX : u.clientX - w.left, T = w.width / e.maxStars, M = Math.ceil(k / T * e.precision) / e.precision;
2696
+ return Math.min(e.maxStars, Math.max(m.value, M));
2697
+ }
2698
+ function g(u) {
2699
+ t.value || (r.value = h(u), n("hover", r.value));
2700
+ }
2701
+ function I() {
2702
+ r.value = null;
2703
+ }
2704
+ function s(u, w) {
2705
+ if (t.value) return;
2706
+ const k = e.clearable && u === a.value ? 0 : u;
2707
+ o.model.value = k, o.emitChange(k, w);
2708
+ }
2709
+ function c(u) {
2710
+ t.value || s(h(u), u);
2711
+ }
2712
+ function i(u) {
2713
+ if (t.value) return;
2714
+ const w = d.value ? "ArrowLeft" : "ArrowRight", k = d.value ? "ArrowRight" : "ArrowLeft";
2715
+ let T = null;
2716
+ u.key === w || u.key === "ArrowUp" ? T = a.value + m.value : u.key === k || u.key === "ArrowDown" ? T = a.value - m.value : u.key === "Home" ? T = 0 : u.key === "End" && (T = e.maxStars), T !== null && (u.preventDefault(), s(Math.min(e.maxStars, Math.max(0, Number(T.toFixed(4)))), u));
2717
+ }
2718
+ return {
2719
+ ...o,
2720
+ container: l,
2721
+ rating: f,
2722
+ stored: a,
2723
+ fillOf: p,
2724
+ onMove: g,
2725
+ leave: I,
2726
+ onClick: c,
2727
+ onKeydown: i,
2728
+ locked: t,
2729
+ display: S(() => f.value.toFixed(1))
2730
+ };
2731
+ }
2732
+ }), Co = ["tabindex", "aria-valuemax", "aria-valuenow", "aria-readonly", "aria-invalid"], wo = ["name", "value"], ko = {
2733
+ key: 1,
2734
+ class: "rating-value fanum"
2735
+ };
2736
+ function Mo(e, n, o, l, r, d) {
2737
+ return v(), b("div", {
2738
+ class: F(["star-rating d-flex align-items-center gap-2", { "is-invalid": e.isInvalid }])
2739
+ }, [
2740
+ $("div", {
2741
+ ref: "container",
2742
+ class: "star-rating-container d-flex position-relative",
2743
+ role: "slider",
2744
+ tabindex: e.locked ? -1 : 0,
2745
+ "aria-valuemin": 0,
2746
+ "aria-valuemax": e.maxStars,
2747
+ "aria-valuenow": e.stored,
2748
+ "aria-readonly": e.locked || void 0,
2749
+ "aria-invalid": e.isInvalid || void 0,
2750
+ style: le({ cursor: e.locked ? "default" : "pointer" }),
2751
+ onPointermove: n[0] || (n[0] = (...t) => e.onMove && e.onMove(...t)),
2752
+ onPointerleave: n[1] || (n[1] = (...t) => e.leave && e.leave(...t)),
2753
+ onClick: n[2] || (n[2] = (...t) => e.onClick && e.onClick(...t)),
2754
+ onKeydown: n[3] || (n[3] = (...t) => e.onKeydown && e.onKeydown(...t))
2755
+ }, [
2756
+ (v(!0), b(Y, null, oe(e.maxStars, (t) => (v(), b("span", {
2757
+ key: t,
2758
+ class: "star-wrapper position-relative d-inline-block fs-2xl lh-1"
2759
+ }, [
2760
+ n[4] || (n[4] = $("span", {
2761
+ class: "star-bg fg-secondary opacity-50",
2762
+ "aria-hidden": "true"
2763
+ }, "★", -1)),
2764
+ $("span", {
2765
+ class: "star-overlay fg-warning",
2766
+ "aria-hidden": "true",
2767
+ style: le({ position: "absolute", top: 0, insetInlineStart: 0, overflow: "hidden", whiteSpace: "nowrap", width: e.fillOf(t) + "%" })
2768
+ }, "★", 4)
2769
+ ]))), 128))
2770
+ ], 44, Co),
2771
+ e.name ? (v(), b("input", {
2772
+ key: 0,
2773
+ type: "hidden",
2774
+ name: e.name,
2775
+ value: e.stored
2776
+ }, null, 8, wo)) : A("", !0),
2777
+ e.showValue && e.rating > 0 ? (v(), b("span", ko, N(e.display), 1)) : A("", !0)
2778
+ ], 2);
2779
+ }
2780
+ const Bo = /* @__PURE__ */ O(Io, [["render", Mo]]), To = E({
2781
+ name: "SubmitButton",
2782
+ emits: ["click"],
2783
+ props: {
2784
+ disabled: { type: Boolean, default: !1 },
2785
+ /** Force the loading state (otherwise it follows form.processing / form.uploading). */
2786
+ loading: { type: Boolean, default: null },
2787
+ /** Bootstrap 6 button variant: solid | outline | subtle | text | styled | link. Use null to supply your own classes. */
2788
+ variant: { type: String, default: "solid" },
2789
+ /** Bootstrap 6 theme: primary | secondary | accent | success | danger | warning | info | inverse. */
2790
+ theme: { type: String, default: "primary" },
2791
+ locale: { type: String, default: null }
2792
+ },
2793
+ setup(e, { emit: n }) {
2794
+ const o = Z("form", null), l = S(() => (o == null ? void 0 : o.value) ?? null), { t: r } = G(() => e.locale), d = S(
2795
+ () => {
2796
+ var a, f;
2797
+ return e.loading !== null ? e.loading : !!((a = l.value) != null && a.processing || (f = l.value) != null && f.uploading);
2798
+ }
2799
+ ), t = S(() => [
2800
+ e.variant ? `btn-${e.variant}` : null,
2801
+ e.theme && e.variant ? `theme-${e.theme}` : null
2802
+ ]);
2803
+ return { form: l, busy: d, classes: t, t: r, onClick: (a) => n("click", a) };
2804
+ }
2805
+ }), Ao = ["disabled", "aria-busy"], No = {
2806
+ key: 0,
2807
+ class: "spinner-border spinner-sm me-2",
2808
+ role: "status",
2809
+ "aria-hidden": "true"
2810
+ }, Eo = {
2811
+ key: 0,
2812
+ class: "fanum"
2813
+ };
2814
+ function Oo(e, n, o, l, r, d) {
2815
+ var t;
2816
+ return v(), b("button", {
2817
+ type: "submit",
2818
+ class: F(e.classes),
2819
+ disabled: e.disabled || e.busy,
2820
+ "aria-busy": e.busy || void 0,
2821
+ onClick: n[0] || (n[0] = (...a) => e.onClick && e.onClick(...a))
2822
+ }, [
2823
+ e.busy ? (v(), b("span", No)) : A("", !0),
2824
+ j(e.$slots, "default", {
2825
+ form: e.form,
2826
+ loading: e.busy
2827
+ }, () => [
2828
+ ue(N(e.t("submit.default")), 1)
2829
+ ]),
2830
+ j(e.$slots, "progress", {
2831
+ progress: (t = e.form) == null ? void 0 : t.uploading
2832
+ }, () => {
2833
+ var a;
2834
+ return [
2835
+ (a = e.form) != null && a.uploading ? (v(), b("span", Eo, N(e.form.uploading) + "%", 1)) : A("", !0)
2836
+ ];
2837
+ })
2838
+ ], 10, Ao);
2839
+ }
2840
+ const Vo = /* @__PURE__ */ O(To, [["render", Oo]]), Do = E({
2841
+ name: "SwitchInput",
2842
+ emits: ["update:modelValue", "change", "focus", "blur"],
2843
+ props: {
2844
+ ...R,
2845
+ value: { type: [String, Number, Boolean, Object], default: null },
2846
+ trueValue: { type: null, default: !0 },
2847
+ falseValue: { type: null, default: !1 },
2848
+ checked: { type: Boolean, default: !1 },
2849
+ label: { type: String, default: null }
2850
+ },
2851
+ setup(e, { emit: n }) {
2852
+ const o = B(null), l = P(e, n, { valued: () => e.value });
2853
+ return Se(e, l, o, { type: () => "checkbox" }), {
2854
+ ...l,
2855
+ input: o,
2856
+ onChange: (r) => l.emitChange(l.model.value, r)
2857
+ };
2858
+ },
2859
+ expose: ["input"]
2860
+ }), Fo = { class: "form-field" }, Lo = { class: "switch" }, zo = ["name", "id", "value", "true-value", "false-value", "required", "disabled", "aria-invalid"], qo = ["for"];
2861
+ function Ro(e, n, o, l, r, d) {
2862
+ return v(), b("div", Fo, [
2863
+ $("div", Lo, [
2864
+ ee($("input", {
2865
+ ref: "input",
2866
+ "onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
2867
+ name: e.name,
2868
+ id: e.inputId,
2869
+ type: "checkbox",
2870
+ role: "switch",
2871
+ switch: "",
2872
+ value: e.value ?? void 0,
2873
+ "true-value": e.trueValue,
2874
+ "false-value": e.falseValue,
2875
+ required: e.required,
2876
+ disabled: e.isDisabled,
2877
+ "aria-invalid": e.isInvalid || void 0,
2878
+ class: F({ "is-invalid": e.isInvalid }),
2879
+ onChange: n[1] || (n[1] = (...t) => e.onChange && e.onChange(...t)),
2880
+ onFocus: n[2] || (n[2] = (t) => e.$emit("focus", t)),
2881
+ onBlur: n[3] || (n[3] = (t) => e.$emit("blur", t))
2882
+ }, null, 42, zo), [
2883
+ [mn, e.model]
2884
+ ])
2885
+ ]),
2886
+ $("label", { for: e.inputId }, [
2887
+ j(e.$slots, "default", {}, () => [
2888
+ ue(N(e.label), 1)
2889
+ ])
2890
+ ], 8, qo)
2891
+ ]);
2892
+ }
2893
+ const Po = /* @__PURE__ */ O(Do, [["render", Ro]]), jo = x(() => import("vue-tel-input").then((e) => e.VueTelInput)), Uo = E({
2894
+ name: "TelInput",
2895
+ components: { VueTelInput: jo },
2896
+ emits: ["update:modelValue", "change", "validate", "country-changed", "focus", "blur"],
2897
+ props: {
2898
+ ...R,
2899
+ placeholder: { type: String, default: "000 000 0000" },
2900
+ /** Legacy alias of `placeholder`. */
2901
+ placeHolder: { type: String, default: null },
2902
+ defaultCountry: { type: String, default: "ir" },
2903
+ preferredCountries: { type: Array, default: () => ["ir", "us", "tr", "ca"] },
2904
+ mode: { type: String, default: "national" },
2905
+ validCharactersOnly: { type: Boolean, default: !0 },
2906
+ /** Mark the field invalid as soon as the typed number is not valid. */
2907
+ validate: { type: Boolean, default: !0 },
2908
+ searchPlaceholder: { type: String, default: "Search…" },
2909
+ dropdownOptions: { type: Object, default: () => ({}) },
2910
+ inputOptions: { type: Object, default: () => ({}) }
2911
+ },
2912
+ setup(e, { emit: n }) {
2913
+ const o = P(e, n), l = B(o.model.value ?? ""), r = B(null);
2914
+ let d = o.model.value ?? "";
2915
+ q(
2916
+ () => o.model.value,
2917
+ (a) => {
2918
+ (a ?? "") !== d && (l.value = a ?? "");
2919
+ }
2920
+ );
2921
+ function t(a, f) {
2922
+ d = (f == null ? void 0 : f.number) ?? "", o.model.value = d, r.value = (f == null ? void 0 : f.valid) ?? null, n("validate", r.value, f), o.emitChange(d);
2923
+ }
2924
+ return {
2925
+ ...o,
2926
+ text: l,
2927
+ valid: r,
2928
+ onInput: t,
2929
+ dropdown: S(() => ({
2930
+ showDialCodeInList: !0,
2931
+ showDialCodeInSelection: !0,
2932
+ showSearchBox: !0,
2933
+ searchBoxPlaceholder: e.searchPlaceholder,
2934
+ showFlags: !1,
2935
+ ...e.dropdownOptions
2936
+ })),
2937
+ inputOpts: S(() => ({
2938
+ placeholder: e.placeHolder ?? e.placeholder,
2939
+ id: o.inputId.value,
2940
+ name: e.name,
2941
+ readonly: e.readonly,
2942
+ ...e.inputOptions
2943
+ })),
2944
+ invalidClass: S(() => o.isInvalid.value || e.validate && r.value === !1)
2945
+ };
2946
+ }
2947
+ }), Ko = {
2948
+ class: "telephone-input input-group fanum",
2949
+ dir: "ltr"
2950
+ };
2951
+ function Go(e, n, o, l, r, d) {
2952
+ const t = U("VueTelInput");
2953
+ return v(), b("div", Ko, [
2954
+ te(t, {
2955
+ modelValue: e.text,
2956
+ "onUpdate:modelValue": n[0] || (n[0] = (a) => e.text = a),
2957
+ mode: e.mode,
2958
+ "valid-characters-only": e.validCharactersOnly,
2959
+ "default-country": e.defaultCountry,
2960
+ "preferred-countries": e.preferredCountries,
2961
+ disabled: e.isDisabled,
2962
+ "dropdown-options": e.dropdown,
2963
+ "input-options": e.inputOpts,
2964
+ "style-classes": "form-control form-control-tel fanum" + (e.invalidClass ? " is-invalid" : ""),
2965
+ onOnInput: e.onInput,
2966
+ onCountryChanged: n[1] || (n[1] = (a) => e.$emit("country-changed", a)),
2967
+ onFocus: n[2] || (n[2] = (a) => e.$emit("focus", a)),
2968
+ onBlur: n[3] || (n[3] = (a) => e.$emit("blur", a))
2969
+ }, null, 8, ["modelValue", "mode", "valid-characters-only", "default-country", "preferred-countries", "disabled", "dropdown-options", "input-options", "style-classes", "onOnInput"])
2970
+ ]);
2971
+ }
2972
+ const Ho = /* @__PURE__ */ O(Uo, [["render", Go]]), Xo = E({
2973
+ name: "TextAreaInput",
2974
+ emits: ["update:modelValue", "change", "input", "focus", "blur"],
2975
+ props: {
2976
+ ...R,
2977
+ rows: { type: [Number, String], default: 3 },
2978
+ placeholder: { type: String, default: null },
2979
+ size: { type: String, default: null }
2980
+ },
2981
+ setup(e, { emit: n }) {
2982
+ const o = P(e, n), l = S(() => e.size ? `form-control-${e.size}` : null);
2983
+ return { ...o, sizeClass: l, emit: n };
2984
+ }
2985
+ }), Jo = ["name", "id", "rows", "placeholder", "required", "readonly", "disabled", "aria-invalid"];
2986
+ function Wo(e, n, o, l, r, d) {
2987
+ return ee((v(), b("textarea", {
2988
+ "onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
2989
+ name: e.name,
2990
+ id: e.inputId,
2991
+ rows: e.rows,
2992
+ placeholder: e.placeholder,
2993
+ required: e.required,
2994
+ readonly: e.readonly,
2995
+ disabled: e.isDisabled,
2996
+ "aria-invalid": e.isInvalid || void 0,
2997
+ class: F(["form-control", [e.sizeClass, { "is-invalid": e.isInvalid }]]),
2998
+ onInput: n[1] || (n[1] = (t) => e.emit("input", e.model, t)),
2999
+ onChange: n[2] || (n[2] = (t) => e.emitChange(e.model, t)),
3000
+ onFocus: n[3] || (n[3] = (t) => e.$emit("focus", t)),
3001
+ onBlur: n[4] || (n[4] = (t) => e.$emit("blur", t))
3002
+ }, null, 42, Jo)), [
3003
+ [Ye, e.model]
3004
+ ]);
3005
+ }
3006
+ const Zo = /* @__PURE__ */ O(Xo, [["render", Wo]]), Yo = x(() => import("@uppy/vue").then((e) => e.UppyContextProvider)), Qo = x(() => import("@uppy/vue").then((e) => e.FilesList)), xo = x(() => import("@uppy/vue").then((e) => e.Dropzone)), We = ["bytes", "KB", "MB", "GB", "TB"];
3007
+ function Ee(e) {
3008
+ let n = 0, o = parseInt(e, 10) || 0;
3009
+ for (; o >= 1024 && n < We.length - 1; )
3010
+ o /= 1024, n++;
3011
+ return `${o.toFixed(o < 10 && n > 0 ? 1 : 0)}${We[n]}`;
3012
+ }
3013
+ const _o = E({
3014
+ name: "UppyInput",
3015
+ components: { UppyContextProvider: Yo, FilesList: Qo, UppyDropzone: xo },
3016
+ emits: [
3017
+ "update:modelValue",
3018
+ "change",
3019
+ "ready",
3020
+ "file-added",
3021
+ "file-removed",
3022
+ "beforeUpload",
3023
+ "progress",
3024
+ "upload",
3025
+ "upload-progress",
3026
+ "upload-error",
3027
+ "upload-success",
3028
+ "upload-pause",
3029
+ "complete",
3030
+ "error",
3031
+ "upload-retry",
3032
+ "upload-stalled",
3033
+ "retry-all",
3034
+ "cancel-all",
3035
+ "restriction-failed"
3036
+ ],
3037
+ props: {
3038
+ ...R,
3039
+ multiple: { type: Boolean, default: !1 },
3040
+ useXHR: { type: Boolean, default: !0 },
3041
+ XHRConfig: { type: Object, default: () => ({}) },
3042
+ url: { type: String, default: "/upload" },
3043
+ /** Uppy core options. */
3044
+ config: { type: Object, default: () => ({}) },
3045
+ errorHandler: { type: Function, default: null },
3046
+ showRestrictionCaption: { type: Boolean, default: !0 },
3047
+ locale: { type: String, default: null }
3048
+ },
3049
+ setup(e, { emit: n, expose: o }) {
3050
+ const l = P(e, n), { t: r } = G(() => e.locale), d = ye(), t = Qe(null), a = B(null), f = B(null), m = B(null), p = B(0);
3051
+ let h = !1, g = !1;
3052
+ const I = (i) => {
3053
+ l.form.value && (l.form.value.uploading = i);
3054
+ };
3055
+ function s(i) {
3056
+ if (e.errorHandler) return e.errorHandler(i);
3057
+ i && (m.value = i, d.timeout(() => m.value = null, 3e3));
3058
+ }
3059
+ function c(i) {
3060
+ var w;
3061
+ if (!i) return "";
3062
+ const u = [];
3063
+ return (w = i.allowedFileTypes) != null && w.length && u.push(r("uppy.types", { types: i.allowedFileTypes.map((k) => k.replace(".", "")).join(", ") })), i.maxNumberOfFiles && i.maxNumberOfFiles > 1 && u.push(r("uppy.maxFiles", { count: i.maxNumberOfFiles })), i.minNumberOfFiles && u.push(r("uppy.minFiles", { count: i.minNumberOfFiles })), i.maxFileSize && u.push(r("uppy.maxSize", { size: Ee(i.maxFileSize) })), i.minFileSize && u.push(r("uppy.minSize", { size: Ee(i.minFileSize) })), i.maxTotalFileSize && u.push(r("uppy.maxTotal", { size: Ee(i.maxTotalFileSize) })), u.length ? `${u.join(", ")} ${r("uppy.suffix")}` : "";
3064
+ }
3065
+ return K(async () => {
3066
+ var w, k, T;
3067
+ const { default: i } = await import("@uppy/core");
3068
+ if (d.isDisposed()) return;
3069
+ const u = new i({
3070
+ id: e.name ?? "uppy",
3071
+ autoProceed: !0,
3072
+ ...e.config,
3073
+ restrictions: {
3074
+ maxNumberOfFiles: e.multiple ? null : 1,
3075
+ ...((w = e.config) == null ? void 0 : w.restrictions) || {}
3076
+ }
3077
+ });
3078
+ if (u.on("upload", () => {
3079
+ p.value = u.getFiles().filter((M) => !M.progress.uploadComplete).length, n("upload");
3080
+ }), u.on("before-upload", (M) => n("beforeUpload", M)), u.on("upload-success", (M, L) => {
3081
+ p.value = Math.max(0, p.value - 1);
3082
+ const z = L.body ?? L;
3083
+ if (e.multiple) {
3084
+ const H = Array.isArray(l.model.value) ? l.model.value : [];
3085
+ l.model.value = [...H, z];
3086
+ } else
3087
+ l.model.value = z;
3088
+ l.emitChange(l.model.value), n("upload-success", M, L);
3089
+ }), u.on("file-added", (M) => n("file-added", M)), u.on("file-removed", (M) => {
3090
+ var z;
3091
+ const L = ((z = M.response) == null ? void 0 : z.body) ?? M.response;
3092
+ e.multiple && Array.isArray(l.model.value) ? l.model.value = l.model.value.filter((H) => JSON.stringify(H) !== JSON.stringify(L)) : l.model.value = null, l.emitChange(l.model.value), L && !h && !g && fetch(e.url, {
3093
+ method: "DELETE",
3094
+ headers: re({ "Content-Type": "application/json" }),
3095
+ credentials: "same-origin",
3096
+ body: JSON.stringify(L)
3097
+ }).catch(() => {
3098
+ }), n("file-removed", M);
3099
+ }), u.on("progress", (M) => {
3100
+ M <= 0 ? I(null) : M >= 100 ? I(p.value > 0 ? 99 : null) : I(M), n("progress", M);
3101
+ }), u.on("upload-progress", (M, L) => n("upload-progress", M, L)), u.on("upload-pause", (M, L) => n("upload-pause", M, L)), u.on("cancel-all", () => n("cancel-all")), u.on("retry-all", () => n("retry-all")), u.on("upload-stalled", (M, L) => n("upload-stalled", M, L)), u.on("upload-retry", (M) => n("upload-retry", M)), u.on("complete", (M) => {
3102
+ p.value = 0, I(null), n("complete", M);
3103
+ }), u.on("error", (M) => n("error", M)), u.on("upload-error", (M, L, z) => {
3104
+ var de;
3105
+ p.value = Math.max(0, p.value - 1);
3106
+ let H = L;
3107
+ try {
3108
+ H = ((de = JSON.parse(z.response)) == null ? void 0 : de.message) ?? L;
3109
+ } catch {
3110
+ }
3111
+ s((H == null ? void 0 : H.message) ?? H), n("upload-error", M, L, z, H);
3112
+ }), u.on("restriction-failed", (M, L) => {
3113
+ s(L.message), n("restriction-failed", M, L);
3114
+ }), e.useXHR) {
3115
+ const { default: M } = await import("@uppy/xhr-upload");
3116
+ if (d.isDisposed()) {
3117
+ (k = u.destroy) == null || k.call(u);
3118
+ return;
3119
+ }
3120
+ u.use(M, {
3121
+ method: "POST",
3122
+ endpoint: e.url,
3123
+ headers: re(),
3124
+ ...e.XHRConfig
3125
+ });
3126
+ }
3127
+ d.add(() => {
3128
+ var M;
3129
+ g = !0, I(null);
3130
+ try {
3131
+ (M = u.destroy) == null || M.call(u);
3132
+ } catch {
3133
+ }
3134
+ t.value = null;
3135
+ }), t.value = u, e.showRestrictionCaption && (f.value = c((T = u.opts) == null ? void 0 : T.restrictions)), n("ready", u);
3136
+ }), q(
3137
+ () => {
3138
+ var i;
3139
+ return (i = l.form.value) == null ? void 0 : i.wasSuccessful;
3140
+ },
3141
+ (i, u) => {
3142
+ i === !0 && u === !1 && t.value && (h = !0, t.value.cancelAll(), h = !1, l.model.value = e.multiple ? [] : null);
3143
+ }
3144
+ ), o({ uppy: () => t.value }), { ...l, uppy: t, area: a, caption: f, errorMessage: m };
3145
+ }
3146
+ }), ea = ["id"], na = {
3147
+ key: 0,
3148
+ class: "alert theme-danger text-center py-1 mb-2",
3149
+ role: "alert"
3150
+ }, ta = {
3151
+ key: 1,
3152
+ class: "uppy-input-area--caption form-text text-center fst-italic"
3153
+ }, la = {
3154
+ key: 2,
3155
+ class: "invalid-feedback d-block"
3156
+ };
3157
+ function oa(e, n, o, l, r, d) {
3158
+ const t = U("FilesList"), a = U("UppyDropzone"), f = U("UppyContextProvider");
3159
+ return e.uppy ? (v(), b("div", {
3160
+ key: 0,
3161
+ ref: "area",
3162
+ class: "uppy-input-area",
3163
+ id: e.inputId
3164
+ }, [
3165
+ e.errorMessage ? (v(), b("div", na, N(e.errorMessage), 1)) : A("", !0),
3166
+ te(f, {
3167
+ name: "uu" + (e.name ?? "uppy"),
3168
+ uppy: e.uppy
3169
+ }, {
3170
+ default: pe(() => [
3171
+ j(e.$slots, "default", { uppy: e.uppy }, () => [
3172
+ te(t, { class: "uppy-file-lists" }),
3173
+ te(a, { class: "uppy-drop-zone" })
3174
+ ])
3175
+ ]),
3176
+ _: 3
3177
+ }, 8, ["name", "uppy"]),
3178
+ e.caption ? (v(), b("div", ta, N(e.caption), 1)) : A("", !0),
3179
+ e.isInvalid ? (v(), b("div", la, N(e.error), 1)) : A("", !0)
3180
+ ], 8, ea)) : A("", !0);
3181
+ }
3182
+ const aa = /* @__PURE__ */ O(_o, [["render", oa]]);
3183
+ function fa() {
3184
+ const e = Z("form", null), n = Z("formApi", null);
3185
+ return {
3186
+ form: e,
3187
+ submit: (...o) => {
3188
+ var l;
3189
+ return (l = n == null ? void 0 : n.submit) == null ? void 0 : l.call(n, ...o);
3190
+ },
3191
+ reset: () => {
3192
+ var o;
3193
+ return (o = n == null ? void 0 : n.reset) == null ? void 0 : o.call(n);
3194
+ }
3195
+ };
3196
+ }
3197
+ const ma = [
3198
+ { country: "Afghanistan", code: "93", iso: "AF" },
3199
+ { country: "Albania", code: "355", iso: "AL" },
3200
+ { country: "Algeria", code: "213", iso: "DZ" },
3201
+ { country: "American Samoa", code: "1-684", iso: "AS" },
3202
+ { country: "Andorra", code: "376", iso: "AD" },
3203
+ { country: "Angola", code: "244", iso: "AO" },
3204
+ { country: "Anguilla", code: "1-264", iso: "AI" },
3205
+ { country: "Antarctica", code: "672", iso: "AQ" },
3206
+ { country: "Antigua and Barbuda", code: "1-268", iso: "AG" },
3207
+ { country: "Argentina", code: "54", iso: "AR" },
3208
+ { country: "Armenia", code: "374", iso: "AM" },
3209
+ { country: "Aruba", code: "297", iso: "AW" },
3210
+ { country: "Australia", code: "61", iso: "AU" },
3211
+ { country: "Austria", code: "43", iso: "AT" },
3212
+ { country: "Azerbaijan", code: "994", iso: "AZ" },
3213
+ { country: "Bahamas", code: "1-242", iso: "BS" },
3214
+ { country: "Bahrain", code: "973", iso: "BH" },
3215
+ { country: "Bangladesh", code: "880", iso: "BD" },
3216
+ { country: "Barbados", code: "1-246", iso: "BB" },
3217
+ { country: "Belarus", code: "375", iso: "BY" },
3218
+ { country: "Belgium", code: "32", iso: "BE" },
3219
+ { country: "Belize", code: "501", iso: "BZ" },
3220
+ { country: "Benin", code: "229", iso: "BJ" },
3221
+ { country: "Bermuda", code: "1-441", iso: "BM" },
3222
+ { country: "Bhutan", code: "975", iso: "BT" },
3223
+ { country: "Bolivia", code: "591", iso: "BO" },
3224
+ { country: "Bosnia and Herzegovina", code: "387", iso: "BA" },
3225
+ { country: "Botswana", code: "267", iso: "BW" },
3226
+ { country: "Brazil", code: "55", iso: "BR" },
3227
+ { country: "British Indian Ocean Territory", code: "246", iso: "IO" },
3228
+ { country: "British Virgin Islands", code: "1-284", iso: "VG" },
3229
+ { country: "Brunei", code: "673", iso: "BN" },
3230
+ { country: "Bulgaria", code: "359", iso: "BG" },
3231
+ { country: "Burkina Faso", code: "226", iso: "BF" },
3232
+ { country: "Burundi", code: "257", iso: "BI" },
3233
+ { country: "Cambodia", code: "855", iso: "KH" },
3234
+ { country: "Cameroon", code: "237", iso: "CM" },
3235
+ { country: "Canada", code: "1", iso: "CA" },
3236
+ { country: "Cape Verde", code: "238", iso: "CV" },
3237
+ { country: "Cayman Islands", code: "1-345", iso: "KY" },
3238
+ { country: "Central African Republic", code: "236", iso: "CF" },
3239
+ { country: "Chad", code: "235", iso: "TD" },
3240
+ { country: "Chile", code: "56", iso: "CL" },
3241
+ { country: "China", code: "86", iso: "CN" },
3242
+ { country: "Christmas Island", code: "61", iso: "CX" },
3243
+ { country: "Cocos Islands", code: "61", iso: "CC" },
3244
+ { country: "Colombia", code: "57", iso: "CO" },
3245
+ { country: "Comoros", code: "269", iso: "KM" },
3246
+ { country: "Cook Islands", code: "682", iso: "CK" },
3247
+ { country: "Costa Rica", code: "506", iso: "CR" },
3248
+ { country: "Croatia", code: "385", iso: "HR" },
3249
+ { country: "Cuba", code: "53", iso: "CU" },
3250
+ { country: "Curacao", code: "599", iso: "CW" },
3251
+ { country: "Cyprus", code: "357", iso: "CY" },
3252
+ { country: "Czech Republic", code: "420", iso: "CZ" },
3253
+ { country: "Democratic Republic of the Congo", code: "243", iso: "CD" },
3254
+ { country: "Denmark", code: "45", iso: "DK" },
3255
+ { country: "Djibouti", code: "253", iso: "DJ" },
3256
+ { country: "Dominica", code: "1-767", iso: "DM" },
3257
+ { country: "Dominican Republic", code: "1-809, 1-829, 1-849", iso: "DO" },
3258
+ { country: "East Timor", code: "670", iso: "TL" },
3259
+ { country: "Ecuador", code: "593", iso: "EC" },
3260
+ { country: "Egypt", code: "20", iso: "EG" },
3261
+ { country: "El Salvador", code: "503", iso: "SV" },
3262
+ { country: "Equatorial Guinea", code: "240", iso: "GQ" },
3263
+ { country: "Eritrea", code: "291", iso: "ER" },
3264
+ { country: "Estonia", code: "372", iso: "EE" },
3265
+ { country: "Ethiopia", code: "251", iso: "ET" },
3266
+ { country: "Falkland Islands", code: "500", iso: "FK" },
3267
+ { country: "Faroe Islands", code: "298", iso: "FO" },
3268
+ { country: "Fiji", code: "679", iso: "FJ" },
3269
+ { country: "Finland", code: "358", iso: "FI" },
3270
+ { country: "France", code: "33", iso: "FR" },
3271
+ { country: "French Polynesia", code: "689", iso: "PF" },
3272
+ { country: "Gabon", code: "241", iso: "GA" },
3273
+ { country: "Gambia", code: "220", iso: "GM" },
3274
+ { country: "Georgia", code: "995", iso: "GE" },
3275
+ { country: "Germany", code: "49", iso: "DE" },
3276
+ { country: "Ghana", code: "233", iso: "GH" },
3277
+ { country: "Gibraltar", code: "350", iso: "GI" },
3278
+ { country: "Greece", code: "30", iso: "GR" },
3279
+ { country: "Greenland", code: "299", iso: "GL" },
3280
+ { country: "Grenada", code: "1-473", iso: "GD" },
3281
+ { country: "Guam", code: "1-671", iso: "GU" },
3282
+ { country: "Guatemala", code: "502", iso: "GT" },
3283
+ { country: "Guernsey", code: "44-1481", iso: "GG" },
3284
+ { country: "Guinea", code: "224", iso: "GN" },
3285
+ { country: "Guinea-Bissau", code: "245", iso: "GW" },
3286
+ { country: "Guyana", code: "592", iso: "GY" },
3287
+ { country: "Haiti", code: "509", iso: "HT" },
3288
+ { country: "Honduras", code: "504", iso: "HN" },
3289
+ { country: "Hong Kong", code: "852", iso: "HK" },
3290
+ { country: "Hungary", code: "36", iso: "HU" },
3291
+ { country: "Iceland", code: "354", iso: "IS" },
3292
+ { country: "India", code: "91", iso: "IN" },
3293
+ { country: "Indonesia", code: "62", iso: "ID" },
3294
+ { country: "ایران", code: "98", iso: "IR" },
3295
+ { country: "Iraq", code: "964", iso: "IQ" },
3296
+ { country: "Ireland", code: "353", iso: "IE" },
3297
+ { country: "Isle of Man", code: "44-1624", iso: "IM" },
3298
+ { country: "Israel", code: "972", iso: "IL" },
3299
+ { country: "Italy", code: "39", iso: "IT" },
3300
+ { country: "Ivory Coast", code: "225", iso: "CI" },
3301
+ { country: "Jamaica", code: "1-876", iso: "JM" },
3302
+ { country: "Japan", code: "81", iso: "JP" },
3303
+ { country: "Jersey", code: "44-1534", iso: "JE" },
3304
+ { country: "Jordan", code: "962", iso: "JO" },
3305
+ { country: "Kazakhstan", code: "7", iso: "KZ" },
3306
+ { country: "Kenya", code: "254", iso: "KE" },
3307
+ { country: "Kiribati", code: "686", iso: "KI" },
3308
+ { country: "Kosovo", code: "383", iso: "XK" },
3309
+ { country: "Kuwait", code: "965", iso: "KW" },
3310
+ { country: "Kyrgyzstan", code: "996", iso: "KG" },
3311
+ { country: "Laos", code: "856", iso: "LA" },
3312
+ { country: "Latvia", code: "371", iso: "LV" },
3313
+ { country: "Lebanon", code: "961", iso: "LB" },
3314
+ { country: "Lesotho", code: "266", iso: "LS" },
3315
+ { country: "Liberia", code: "231", iso: "LR" },
3316
+ { country: "Libya", code: "218", iso: "LY" },
3317
+ { country: "Liechtenstein", code: "423", iso: "LI" },
3318
+ { country: "Lithuania", code: "370", iso: "LT" },
3319
+ { country: "Luxembourg", code: "352", iso: "LU" },
3320
+ { country: "Macao", code: "853", iso: "MO" },
3321
+ { country: "Macedonia", code: "389", iso: "MK" },
3322
+ { country: "Madagascar", code: "261", iso: "MG" },
3323
+ { country: "Malawi", code: "265", iso: "MW" },
3324
+ { country: "Malaysia", code: "60", iso: "MY" },
3325
+ { country: "Maldives", code: "960", iso: "MV" },
3326
+ { country: "Mali", code: "223", iso: "ML" },
3327
+ { country: "Malta", code: "356", iso: "MT" },
3328
+ { country: "Marshall Islands", code: "692", iso: "MH" },
3329
+ { country: "Mauritania", code: "222", iso: "MR" },
3330
+ { country: "Mauritius", code: "230", iso: "MU" },
3331
+ { country: "Mayotte", code: "262", iso: "YT" },
3332
+ { country: "Mexico", code: "52", iso: "MX" },
3333
+ { country: "Micronesia", code: "691", iso: "FM" },
3334
+ { country: "Moldova", code: "373", iso: "MD" },
3335
+ { country: "Monaco", code: "377", iso: "MC" },
3336
+ { country: "Mongolia", code: "976", iso: "MN" },
3337
+ { country: "Montenegro", code: "382", iso: "ME" },
3338
+ { country: "Montserrat", code: "1-664", iso: "MS" },
3339
+ { country: "Morocco", code: "212", iso: "MA" },
3340
+ { country: "Mozambique", code: "258", iso: "MZ" },
3341
+ { country: "Myanmar", code: "95", iso: "MM" },
3342
+ { country: "Namibia", code: "264", iso: "NA" },
3343
+ { country: "Nauru", code: "674", iso: "NR" },
3344
+ { country: "Nepal", code: "977", iso: "NP" },
3345
+ { country: "Netherlands", code: "31", iso: "NL" },
3346
+ { country: "Netherlands Antilles", code: "599", iso: "AN" },
3347
+ { country: "New Caledonia", code: "687", iso: "NC" },
3348
+ { country: "New Zealand", code: "64", iso: "NZ" },
3349
+ { country: "Nicaragua", code: "505", iso: "NI" },
3350
+ { country: "Niger", code: "227", iso: "NE" },
3351
+ { country: "Nigeria", code: "234", iso: "NG" },
3352
+ { country: "Niue", code: "683", iso: "NU" },
3353
+ { country: "North Korea", code: "850", iso: "KP" },
3354
+ { country: "Northern Mariana Islands", code: "1-670", iso: "MP" },
3355
+ { country: "Norway", code: "47", iso: "NO" },
3356
+ { country: "Oman", code: "968", iso: "OM" },
3357
+ { country: "Pakistan", code: "92", iso: "PK" },
3358
+ { country: "Palau", code: "680", iso: "PW" },
3359
+ { country: "Palestine", code: "970", iso: "PS" },
3360
+ { country: "Panama", code: "507", iso: "PA" },
3361
+ { country: "Papua New Guinea", code: "675", iso: "PG" },
3362
+ { country: "Paraguay", code: "595", iso: "PY" },
3363
+ { country: "Peru", code: "51", iso: "PE" },
3364
+ { country: "Philippines", code: "63", iso: "PH" },
3365
+ { country: "Pitcairn", code: "64", iso: "PN" },
3366
+ { country: "Poland", code: "48", iso: "PL" },
3367
+ { country: "Portugal", code: "351", iso: "PT" },
3368
+ { country: "Puerto Rico", code: "1-787, 1-939", iso: "PR" },
3369
+ { country: "Qatar", code: "974", iso: "QA" },
3370
+ { country: "Republic of the Congo", code: "242", iso: "CG" },
3371
+ { country: "Reunion", code: "262", iso: "RE" },
3372
+ { country: "Romania", code: "40", iso: "RO" },
3373
+ { country: "Russia", code: "7", iso: "RU" },
3374
+ { country: "Rwanda", code: "250", iso: "RW" },
3375
+ { country: "Saint Barthelemy", code: "590", iso: "BL" },
3376
+ { country: "Saint Helena", code: "290", iso: "SH" },
3377
+ { country: "Saint Kitts and Nevis", code: "1-869", iso: "KN" },
3378
+ { country: "Saint Lucia", code: "1-758", iso: "LC" },
3379
+ { country: "Saint Martin", code: "590", iso: "MF" },
3380
+ { country: "Saint Pierre and Miquelon", code: "508", iso: "PM" },
3381
+ { country: "Saint Vincent and the Grenadines", code: "1-784", iso: "VC" },
3382
+ { country: "Samoa", code: "685", iso: "WS" },
3383
+ { country: "San Marino", code: "378", iso: "SM" },
3384
+ { country: "Sao Tome and Principe", code: "239", iso: "ST" },
3385
+ { country: "Saudi Arabia", code: "966", iso: "SA" },
3386
+ { country: "Senegal", code: "221", iso: "SN" },
3387
+ { country: "Serbia", code: "381", iso: "RS" },
3388
+ { country: "Seychelles", code: "248", iso: "SC" },
3389
+ { country: "Sierra Leone", code: "232", iso: "SL" },
3390
+ { country: "Singapore", code: "65", iso: "SG" },
3391
+ { country: "Sint Maarten", code: "1-721", iso: "SX" },
3392
+ { country: "Slovakia", code: "421", iso: "SK" },
3393
+ { country: "Slovenia", code: "386", iso: "SI" },
3394
+ { country: "Solomon Islands", code: "677", iso: "SB" },
3395
+ { country: "Somalia", code: "252", iso: "SO" },
3396
+ { country: "South Africa", code: "27", iso: "ZA" },
3397
+ { country: "South Korea", code: "82", iso: "KR" },
3398
+ { country: "South Sudan", code: "211", iso: "SS" },
3399
+ { country: "Spain", code: "34", iso: "ES" },
3400
+ { country: "Sri Lanka", code: "94", iso: "LK" },
3401
+ { country: "Sudan", code: "249", iso: "SD" },
3402
+ { country: "Suriname", code: "597", iso: "SR" },
3403
+ { country: "Svalbard and Jan Mayen", code: "47", iso: "SJ" },
3404
+ { country: "Swaziland", code: "268", iso: "SZ" },
3405
+ { country: "Sweden", code: "46", iso: "SE" },
3406
+ { country: "Switzerland", code: "41", iso: "CH" },
3407
+ { country: "Syria", code: "963", iso: "SY" },
3408
+ { country: "Taiwan", code: "886", iso: "TW" },
3409
+ { country: "Tajikistan", code: "992", iso: "TJ" },
3410
+ { country: "Tanzania", code: "255", iso: "TZ" },
3411
+ { country: "Thailand", code: "66", iso: "TH" },
3412
+ { country: "Togo", code: "228", iso: "TG" },
3413
+ { country: "Tokelau", code: "690", iso: "TK" },
3414
+ { country: "Tonga", code: "676", iso: "TO" },
3415
+ { country: "Trinidad and Tobago", code: "1-868", iso: "TT" },
3416
+ { country: "Tunisia", code: "216", iso: "TN" },
3417
+ { country: "Turkey", code: "90", iso: "TR" },
3418
+ { country: "Turkmenistan", code: "993", iso: "TM" },
3419
+ { country: "Turks and Caicos Islands", code: "1-649", iso: "TC" },
3420
+ { country: "Tuvalu", code: "688", iso: "TV" },
3421
+ { country: "U.S. Virgin Islands", code: "1-340", iso: "VI" },
3422
+ { country: "Uganda", code: "256", iso: "UG" },
3423
+ { country: "Ukraine", code: "380", iso: "UA" },
3424
+ { country: "United Arab Emirates", code: "971", iso: "AE" },
3425
+ { country: "United Kingdom", code: "44", iso: "GB" },
3426
+ { country: "United States", code: "1", iso: "US" },
3427
+ { country: "Uruguay", code: "598", iso: "UY" },
3428
+ { country: "Uzbekistan", code: "998", iso: "UZ" },
3429
+ { country: "Vanuatu", code: "678", iso: "VU" },
3430
+ { country: "Vatican", code: "379", iso: "VA" },
3431
+ { country: "Venezuela", code: "58", iso: "VE" },
3432
+ { country: "Vietnam", code: "84", iso: "VN" },
3433
+ { country: "Wallis and Futuna", code: "681", iso: "WF" },
3434
+ { country: "Western Sahara", code: "212", iso: "EH" },
3435
+ { country: "Yemen", code: "967", iso: "YE" },
3436
+ { country: "Zambia", code: "260", iso: "ZM" },
3437
+ { country: "Zimbabwe", code: "263", iso: "ZW" }
3438
+ ], ia = _e, ra = on, ua = Fe, sa = {
3439
+ AmountInput: wn,
3440
+ CaptchaInput: En,
3441
+ CheckboxButtonInput: Fn,
3442
+ CheckboxInput: jn,
3443
+ CheckboxToggle: Xn,
3444
+ ChipsInput: _n,
3445
+ ComboboxInput: _e,
3446
+ DropzoneInput: It,
3447
+ EditorInput: Mt,
3448
+ EmailInput: Ot,
3449
+ FileInput: en,
3450
+ FormAdornInput: Fe,
3451
+ FormContainer: ul,
3452
+ FormField: bl,
3453
+ FormLabel: nn,
3454
+ GroupControl: tn,
3455
+ LocationInput: Al,
3456
+ MobileInput: Ol,
3457
+ MultiQuantityInput: Wl,
3458
+ OTPInput: _l,
3459
+ PasswordInput: uo,
3460
+ PersianDatePickerInput: po,
3461
+ QuantityInput: ln,
3462
+ RangeInput: on,
3463
+ SimpleUploader: So,
3464
+ StarRatingInput: Bo,
3465
+ SubmitButton: Vo,
3466
+ SwitchInput: Po,
3467
+ TelInput: Ho,
3468
+ TextAreaInput: Zo,
3469
+ TextInput: Ie,
3470
+ UppyInput: aa,
3471
+ // aliases
3472
+ Select2Input: ia,
3473
+ RangeSliderInput: ra,
3474
+ FormAdorn: ua
3475
+ }, pa = {
3476
+ install(e, n = {}) {
3477
+ (n.locale || n.messages) && hn(n), n.bootstrap && Jn(n.bootstrap), Object.entries(sa).forEach(([o, l]) => e.component(o, l));
3478
+ }
3479
+ };
2
3480
  export {
3
- n as AmountInput,
4
- p as CaptchaInput,
5
- s as CheckboxButtonInput,
6
- u as CheckboxInput,
7
- e as CheckboxToggle,
8
- o as DropzoneInput,
9
- I as EditorInput,
10
- i as EmailInput,
11
- r as FileInput,
12
- l as FormContainer,
13
- c as FormLabel,
14
- m as GroupControl,
15
- b as LocationInput,
16
- C as MobileInput,
17
- S as MultiQuantityInput,
18
- h as OTPInput,
19
- x as PasswordInput,
20
- d as PersianDatePickerInput,
21
- g as QuantityInput,
22
- k as RangeSliderInput,
23
- P as Select2Input,
24
- T as SimpleUploader,
25
- F as StarRatingInput,
26
- y as SubmitButton,
27
- A as SwitchInput,
28
- E as TelInput,
29
- L as TextAreaInput,
30
- M as TextInput,
31
- Q as UppyInput
3481
+ wn as AmountInput,
3482
+ En as CaptchaInput,
3483
+ Fn as CheckboxButtonInput,
3484
+ jn as CheckboxInput,
3485
+ Xn as CheckboxToggle,
3486
+ _n as ChipsInput,
3487
+ _e as ComboboxInput,
3488
+ It as DropzoneInput,
3489
+ Mt as EditorInput,
3490
+ Ot as EmailInput,
3491
+ en as FileInput,
3492
+ ua as FormAdorn,
3493
+ Fe as FormAdornInput,
3494
+ ul as FormContainer,
3495
+ bl as FormField,
3496
+ nn as FormLabel,
3497
+ tn as GroupControl,
3498
+ Al as LocationInput,
3499
+ Ol as MobileInput,
3500
+ Wl as MultiQuantityInput,
3501
+ _l as OTPInput,
3502
+ uo as PasswordInput,
3503
+ po as PersianDatePickerInput,
3504
+ ln as QuantityInput,
3505
+ on as RangeInput,
3506
+ ra as RangeSliderInput,
3507
+ ia as Select2Input,
3508
+ So as SimpleUploader,
3509
+ Bo as StarRatingInput,
3510
+ Vo as SubmitButton,
3511
+ Po as SwitchInput,
3512
+ Ho as TelInput,
3513
+ Zo as TextAreaInput,
3514
+ Ie as TextInput,
3515
+ aa as UppyInput,
3516
+ Jn as configureBootstrap,
3517
+ hn as configureI18n,
3518
+ ma as countryCodes,
3519
+ pa as default,
3520
+ R as fieldProps,
3521
+ De as toEnglishDigits,
3522
+ se as useBsInstance,
3523
+ ye as useDisposables,
3524
+ P as useField,
3525
+ fa as useFormApi
32
3526
  };