@paolojulian.dev/design-system 4.5.1 → 4.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,640 +1,701 @@
1
- import { jsx as n, jsxs as _, Fragment as Bt } from "react/jsx-runtime";
2
- import { cn as m } from "./utils.es.js";
3
- import { forwardRef as Ne, useId as Qe, useRef as ne, useState as G, useMemo as Ee, useEffect as Me, Children as Kt } from "react";
4
- import { C as Rt, a as At, b as Lt } from "./chevron-right-icon-CDCRryr1.js";
5
- const Pa = ({
1
+ import { jsx as a, jsxs as _, Fragment as wt } from "react/jsx-runtime";
2
+ import { cn as h } from "./utils.es.js";
3
+ import { forwardRef as oe, useId as Oe, useRef as me, useState as re, useMemo as tt, useEffect as Ce, Children as Xt } from "react";
4
+ import { C as qt, a as Pt, b as Ft } from "./chevron-right-icon-CDCRryr1.js";
5
+ const en = ({
6
6
  children: e,
7
7
  gap: t = void 0,
8
- alignItems: a = void 0,
8
+ alignItems: n = void 0,
9
9
  justifyContent: r = void 0,
10
- className: o = ""
11
- }) => /* @__PURE__ */ n(
10
+ className: l = ""
11
+ }) => /* @__PURE__ */ a(
12
12
  "div",
13
13
  {
14
- className: m("flex flex-row", o),
14
+ className: h("p-row", l),
15
15
  style: {
16
16
  gap: t,
17
- alignItems: a,
17
+ alignItems: n,
18
18
  justifyContent: r
19
19
  },
20
20
  children: e
21
21
  }
22
- ), jt = ({
22
+ ), Zt = ({
23
23
  children: e,
24
24
  gap: t = void 0,
25
- alignItems: a = void 0,
25
+ alignItems: n = void 0,
26
26
  justifyContent: r = void 0,
27
- className: o = ""
28
- }) => /* @__PURE__ */ n(
27
+ className: l = ""
28
+ }) => /* @__PURE__ */ a(
29
29
  "div",
30
30
  {
31
- className: m("flex flex-col", o),
31
+ className: h("p-stack", l),
32
32
  style: {
33
33
  gap: t,
34
- alignItems: a,
34
+ alignItems: n,
35
35
  justifyContent: r
36
36
  },
37
37
  children: e
38
38
  }
39
- ), Ht = Ne(
39
+ ), Jt = oe(
40
40
  ({
41
41
  as: e = "span",
42
42
  variant: t = "neutral",
43
- size: a = "sm",
43
+ size: n = "sm",
44
44
  appearance: r = "subtle",
45
- leftIcon: o,
46
- rightIcon: c,
47
- children: d,
48
- className: g,
49
- ...v
45
+ isPinging: l = !1,
46
+ leftIcon: s,
47
+ rightIcon: d,
48
+ children: m,
49
+ className: y,
50
+ ...b
50
51
  }, u) => /* @__PURE__ */ _(
51
52
  e,
52
53
  {
53
- ...v,
54
+ ...b,
54
55
  ref: u,
55
- className: m(
56
+ className: h(
56
57
  "p-badge",
57
58
  `p-badge--${t}`,
58
- `p-badge--${a}`,
59
+ `p-badge--${n}`,
59
60
  `p-badge--${r}`,
60
- g
61
+ l && "p-badge--pinging",
62
+ y
61
63
  ),
62
64
  children: [
63
- o && /* @__PURE__ */ n("span", { className: "p-badge__icon", "aria-hidden": "true", children: o }),
64
- /* @__PURE__ */ n("span", { className: "p-badge__label", children: d }),
65
- c && /* @__PURE__ */ n("span", { className: "p-badge__icon", "aria-hidden": "true", children: c })
65
+ s && /* @__PURE__ */ a("span", { className: "p-badge__icon", "aria-hidden": "true", children: s }),
66
+ /* @__PURE__ */ a("span", { className: "p-badge__label", children: m }),
67
+ d && /* @__PURE__ */ a("span", { className: "p-badge__icon", "aria-hidden": "true", children: d })
66
68
  ]
67
69
  }
68
70
  )
69
71
  );
70
- Ht.displayName = "PBadge";
71
- const Ut = Ne(
72
+ Jt.displayName = "PBadge";
73
+ const Qt = oe(
72
74
  ({
73
75
  variant: e = "primary",
74
76
  size: t = "md",
75
- fullWidth: a = !1,
77
+ fullWidth: n = !1,
76
78
  isActive: r = !1,
77
- isLoading: o = !1,
78
- leftIcon: c,
79
- rightIcon: d,
80
- children: g,
81
- className: v,
79
+ isLoading: l = !1,
80
+ isPinging: s = !1,
81
+ leftIcon: d,
82
+ rightIcon: m,
83
+ children: y,
84
+ className: b,
82
85
  ...u
83
- }, h) => {
84
- const f = !!("disabled" in u && u.disabled || o), x = m(
86
+ }, v) => {
87
+ const N = !!("disabled" in u && u.disabled || l), F = h(
85
88
  "p-button",
86
89
  `p-button--${e}`,
87
90
  `p-button--${t}`,
88
- a && "p-button--full-width",
91
+ n && "p-button--full-width",
89
92
  r && "p-button--active",
90
- v
91
- ), R = /* @__PURE__ */ _(Bt, { children: [
92
- o ? /* @__PURE__ */ n("span", { className: "p-button__spinner", "aria-hidden": "true" }) : c && /* @__PURE__ */ n("span", { className: "p-button__icon", "aria-hidden": "true", children: c }),
93
- /* @__PURE__ */ n("span", { className: "p-button__label", children: g }),
94
- !o && d && /* @__PURE__ */ n("span", { className: "p-button__icon", "aria-hidden": "true", children: d })
93
+ s && "p-button--pinging",
94
+ b
95
+ ), k = /* @__PURE__ */ _(wt, { children: [
96
+ l ? /* @__PURE__ */ a("span", { className: "p-button__spinner", "aria-hidden": "true" }) : d && /* @__PURE__ */ a("span", { className: "p-button__icon", "aria-hidden": "true", children: d }),
97
+ /* @__PURE__ */ a("span", { className: "p-button__label", children: y }),
98
+ !l && m && /* @__PURE__ */ a("span", { className: "p-button__icon", "aria-hidden": "true", children: m })
95
99
  ] });
96
100
  if ("href" in u && typeof u.href == "string") {
97
- const { disabled: A, onClick: I, ...C } = u, P = (U) => {
98
- if (f) {
99
- U.preventDefault();
101
+ const { disabled: B, onClick: A, ...I } = u, T = (V) => {
102
+ if (N) {
103
+ V.preventDefault();
100
104
  return;
101
105
  }
102
- I == null || I(U);
106
+ A == null || A(V);
103
107
  };
104
- return /* @__PURE__ */ n(
108
+ return /* @__PURE__ */ a(
105
109
  "a",
106
110
  {
107
- ...C,
108
- ref: h,
109
- className: x,
110
- "aria-disabled": f || void 0,
111
- "aria-busy": o || void 0,
111
+ ...I,
112
+ ref: v,
113
+ className: F,
114
+ "aria-disabled": N || void 0,
115
+ "aria-busy": l || void 0,
112
116
  "data-active": r || void 0,
113
- "data-disabled": A || void 0,
114
- tabIndex: f ? -1 : C.tabIndex,
115
- onClick: P,
116
- children: R
117
+ "data-disabled": B || void 0,
118
+ tabIndex: N ? -1 : I.tabIndex,
119
+ onClick: T,
120
+ children: k
117
121
  }
118
122
  );
119
123
  }
120
- const { type: T = "button", disabled: k, ...w } = u;
121
- return /* @__PURE__ */ n(
124
+ const { type: g = "button", disabled: $, ...j } = u;
125
+ return /* @__PURE__ */ a(
122
126
  "button",
123
127
  {
124
- ...w,
125
- ref: h,
126
- type: T,
127
- disabled: !!(k || o),
128
- className: x,
129
- "aria-busy": o || void 0,
128
+ ...j,
129
+ ref: v,
130
+ type: g,
131
+ disabled: !!($ || l),
132
+ className: F,
133
+ "aria-busy": l || void 0,
130
134
  "data-active": r || void 0,
131
- children: R
135
+ children: k
132
136
  }
133
137
  );
134
138
  }
135
139
  );
136
- Ut.displayName = "PButton";
137
- function Vt(e) {
138
- var t, a, r = "";
140
+ Qt.displayName = "PButton";
141
+ function zt(e) {
142
+ var t, n, r = "";
139
143
  if (typeof e == "string" || typeof e == "number") r += e;
140
- else if (typeof e == "object") if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (a = Vt(e[t])) && (r && (r += " "), r += a);
144
+ else if (typeof e == "object") if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (n = zt(e[t])) && (r && (r += " "), r += n);
141
145
  else for (t in e) e[t] && (r && (r += " "), r += t);
142
146
  return r;
143
147
  }
144
- function Wt() {
145
- for (var e, t, a = 0, r = ""; a < arguments.length; ) (e = arguments[a++]) && (t = Vt(e)) && (r && (r += " "), r += t);
148
+ function Et() {
149
+ for (var e, t, n = 0, r = ""; n < arguments.length; ) (e = arguments[n++]) && (t = zt(e)) && (r && (r += " "), r += t);
146
150
  return r;
147
151
  }
148
- const Dt = (e) => typeof e == "boolean" ? "".concat(e) : e === 0 ? "0" : e, wt = Wt, qt = (e, t) => (a) => {
152
+ const Yt = (e) => typeof e == "boolean" ? "".concat(e) : e === 0 ? "0" : e, Ct = Et, ea = (e, t) => (n) => {
149
153
  var r;
150
- if ((t == null ? void 0 : t.variants) == null) return wt(e, a == null ? void 0 : a.class, a == null ? void 0 : a.className);
151
- const { variants: o, defaultVariants: c } = t, d = Object.keys(o).map((u) => {
152
- const h = a == null ? void 0 : a[u], f = c == null ? void 0 : c[u];
153
- if (h === null) return null;
154
- const x = Dt(h) || Dt(f);
155
- return o[u][x];
156
- }), g = a && Object.entries(a).reduce((u, h) => {
157
- let [f, x] = h;
158
- return x === void 0 || (u[f] = x), u;
159
- }, {}), v = t == null || (r = t.compoundVariants) === null || r === void 0 ? void 0 : r.reduce((u, h) => {
160
- let { class: f, className: x, ...R } = h;
161
- return Object.entries(R).every((T) => {
162
- let [k, w] = T;
163
- return Array.isArray(w) ? w.includes({
164
- ...c,
165
- ...g
166
- }[k]) : {
167
- ...c,
168
- ...g
169
- }[k] === w;
154
+ if ((t == null ? void 0 : t.variants) == null) return Ct(e, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
155
+ const { variants: l, defaultVariants: s } = t, d = Object.keys(l).map((b) => {
156
+ const u = n == null ? void 0 : n[b], v = s == null ? void 0 : s[b];
157
+ if (u === null) return null;
158
+ const N = Yt(u) || Yt(v);
159
+ return l[b][N];
160
+ }), m = n && Object.entries(n).reduce((b, u) => {
161
+ let [v, N] = u;
162
+ return N === void 0 || (b[v] = N), b;
163
+ }, {}), y = t == null || (r = t.compoundVariants) === null || r === void 0 ? void 0 : r.reduce((b, u) => {
164
+ let { class: v, className: N, ...F } = u;
165
+ return Object.entries(F).every((k) => {
166
+ let [g, $] = k;
167
+ return Array.isArray($) ? $.includes({
168
+ ...s,
169
+ ...m
170
+ }[g]) : {
171
+ ...s,
172
+ ...m
173
+ }[g] === $;
170
174
  }) ? [
171
- ...u,
172
- f,
173
- x
174
- ] : u;
175
+ ...b,
176
+ v,
177
+ N
178
+ ] : b;
175
179
  }, []);
176
- return wt(e, d, v, a == null ? void 0 : a.class, a == null ? void 0 : a.className);
177
- }, Ot = {
180
+ return Ct(e, d, y, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
181
+ }, ta = {
178
182
  serif: "p-typography--serif",
179
183
  body: "p-typography--body",
184
+ "body-medium": "p-typography--body-medium",
180
185
  "body-wide": "p-typography--body-wide",
181
186
  heading: "p-typography--heading",
182
187
  "heading-lg": "p-typography--heading-lg",
183
188
  "heading-xl": "p-typography--heading-xl"
184
- }, Gt = qt("p-typography", {
189
+ }, aa = ea("p-typography", {
185
190
  variants: {
186
- variant: Ot
191
+ variant: ta
187
192
  },
188
193
  defaultVariants: {
189
194
  variant: "body"
190
195
  }
191
196
  });
192
- function ot({
197
+ function Ke({
193
198
  as: e = "p",
194
199
  children: t,
195
- className: a = "",
200
+ className: n = "",
196
201
  variant: r,
197
- ...o
202
+ ...l
198
203
  }) {
199
- return /* @__PURE__ */ n(
204
+ return /* @__PURE__ */ a(
200
205
  e,
201
206
  {
202
- className: m(Gt({ variant: r, className: a })),
203
- ...o,
207
+ className: h(aa({ variant: r, className: n })),
208
+ ...l,
204
209
  children: t
205
210
  }
206
211
  );
207
212
  }
208
- function Ve(e) {
213
+ function Ge(e) {
209
214
  return e != null && e !== !1 && e !== "";
210
215
  }
211
- function Mt(e, t) {
212
- return Ve(e) ? typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ n(ot, { className: t, variant: "body-wide", children: e }) : /* @__PURE__ */ n("span", { className: m(t, "p-card__meta-custom"), children: e }) : null;
216
+ function St(e, t) {
217
+ return Ge(e) ? typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ a(Ke, { className: t, variant: "body-wide", children: e }) : /* @__PURE__ */ a("span", { className: h(t, "p-card__meta-custom"), children: e }) : null;
213
218
  }
214
- function et(e) {
219
+ function at(e) {
215
220
  return typeof e == "number" ? `${e}px` : e;
216
221
  }
217
- const Xt = Ne(
222
+ const na = oe(
218
223
  ({
219
224
  prefix: e,
220
225
  eyebrow: t,
221
- title: a,
226
+ title: n,
222
227
  description: r,
223
- media: o,
224
- actions: c,
228
+ media: l,
229
+ actions: s,
225
230
  density: d = "default",
226
- fullWidth: g = !1,
227
- width: v,
228
- minWidth: u,
229
- height: h,
230
- minHeight: f,
231
- className: x,
232
- style: R,
233
- children: T,
234
- ...k
235
- }, w) => {
236
- const A = "href" in k && typeof k.href == "string", I = m(
231
+ fullWidth: m = !1,
232
+ width: y,
233
+ minWidth: b,
234
+ height: u,
235
+ minHeight: v,
236
+ className: N,
237
+ style: F,
238
+ children: k,
239
+ ...g
240
+ }, $) => {
241
+ const j = "href" in g && typeof g.href == "string", B = h(
237
242
  "p-card",
238
243
  d !== "default" && `p-card--${d}`,
239
- g && "p-card--full-width",
240
- v !== void 0 && "p-card--custom-width",
241
- u !== void 0 && "p-card--custom-min-width",
242
- h !== void 0 && "p-card--custom-height",
243
- f !== void 0 && "p-card--custom-min-height",
244
- A && "p-card--interactive",
245
- x
246
- ), C = {
247
- ...R,
248
- ...v !== void 0 ? { "--p-card-width": et(v) } : {},
249
- ...u !== void 0 ? { "--p-card-min-width": et(u) } : {},
250
- ...h !== void 0 ? { "--p-card-height": et(h) } : {},
251
- ...f !== void 0 ? { "--p-card-min-height": et(f) } : {}
252
- }, P = /* @__PURE__ */ _(Bt, { children: [
253
- Ve(o) && /* @__PURE__ */ n("div", { className: "p-card__media", children: o }),
254
- (Ve(e) || Ve(t)) && /* @__PURE__ */ _("div", { className: "p-card__meta", children: [
255
- Mt(e, "p-card__prefix"),
256
- Mt(t, "p-card__eyebrow")
244
+ m && "p-card--full-width",
245
+ y !== void 0 && "p-card--custom-width",
246
+ b !== void 0 && "p-card--custom-min-width",
247
+ u !== void 0 && "p-card--custom-height",
248
+ v !== void 0 && "p-card--custom-min-height",
249
+ j && "p-card--interactive",
250
+ N
251
+ ), A = {
252
+ ...F,
253
+ ...y !== void 0 ? { "--p-card-width": at(y) } : {},
254
+ ...b !== void 0 ? { "--p-card-min-width": at(b) } : {},
255
+ ...u !== void 0 ? { "--p-card-height": at(u) } : {},
256
+ ...v !== void 0 ? { "--p-card-min-height": at(v) } : {}
257
+ }, I = /* @__PURE__ */ _(wt, { children: [
258
+ Ge(l) && /* @__PURE__ */ a("div", { className: "p-card__media", children: l }),
259
+ (Ge(e) || Ge(t)) && /* @__PURE__ */ _("div", { className: "p-card__meta", children: [
260
+ St(e, "p-card__prefix"),
261
+ St(t, "p-card__eyebrow")
257
262
  ] }),
258
263
  /* @__PURE__ */ _("div", { className: "p-card__body", children: [
259
- /* @__PURE__ */ n(ot, { as: "h3", className: "p-card__title", variant: "heading", children: A ? /* @__PURE__ */ n("a", { ...k, className: "p-card__link", children: a }) : a }),
260
- Ve(r) ? /* @__PURE__ */ n(ot, { className: "p-card__description", variant: "body", children: r }) : null
264
+ /* @__PURE__ */ a(Ke, { as: "h3", className: "p-card__title", variant: "heading", children: j ? /* @__PURE__ */ a("a", { ...g, className: "p-card__link", children: n }) : n }),
265
+ Ge(r) ? /* @__PURE__ */ a(Ke, { className: "p-card__description", variant: "body", children: r }) : null
261
266
  ] }),
262
- Ve(T) && /* @__PURE__ */ n("div", { className: "p-card__content", children: T }),
263
- Ve(c) && /* @__PURE__ */ n("div", { className: "p-card__actions", children: c })
267
+ Ge(k) && /* @__PURE__ */ a("div", { className: "p-card__content", children: k }),
268
+ Ge(s) && /* @__PURE__ */ a("div", { className: "p-card__actions", children: s })
264
269
  ] });
265
- return A ? /* @__PURE__ */ n("article", { ref: w, className: I, style: C, children: P }) : /* @__PURE__ */ n(
270
+ return j ? /* @__PURE__ */ a("article", { ref: $, className: B, style: A, children: I }) : /* @__PURE__ */ a(
266
271
  "article",
267
272
  {
268
- ...k,
269
- ref: w,
270
- className: I,
271
- style: C,
272
- children: P
273
+ ...g,
274
+ ref: $,
275
+ className: B,
276
+ style: A,
277
+ children: I
278
+ }
279
+ );
280
+ }
281
+ );
282
+ na.displayName = "PCard";
283
+ function ra(e) {
284
+ return typeof e == "number" ? `${e}px` : e;
285
+ }
286
+ function la(e) {
287
+ return e ? typeof e == "number" ? {
288
+ mobile: 1,
289
+ tablet: Math.min(e, 2),
290
+ desktop: e
291
+ } : {
292
+ mobile: e.mobile ?? 1,
293
+ tablet: e.tablet ?? e.mobile ?? 2,
294
+ desktop: e.desktop ?? e.tablet ?? e.mobile ?? 2
295
+ } : {
296
+ mobile: 1,
297
+ tablet: 2,
298
+ desktop: 2
299
+ };
300
+ }
301
+ const ia = oe(
302
+ ({
303
+ as: e = "div",
304
+ columns: t,
305
+ minCardWidth: n,
306
+ gap: r = "none",
307
+ align: l = "stretch",
308
+ className: s,
309
+ style: d,
310
+ children: m,
311
+ ...y
312
+ }, b) => {
313
+ const u = la(t), v = {
314
+ ...d,
315
+ "--p-card-grid-mobile-columns": u.mobile,
316
+ "--p-card-grid-tablet-columns": u.tablet,
317
+ "--p-card-grid-desktop-columns": u.desktop,
318
+ ...n !== void 0 ? { "--p-card-grid-min-card-width": ra(n) } : {}
319
+ };
320
+ return /* @__PURE__ */ a(
321
+ e,
322
+ {
323
+ ...y,
324
+ ref: b,
325
+ className: h(
326
+ "p-card-grid",
327
+ `p-card-grid--gap-${r}`,
328
+ l === "start" && "p-card-grid--align-start",
329
+ n !== void 0 && "p-card-grid--auto-fit",
330
+ s
331
+ ),
332
+ style: v,
333
+ children: m
273
334
  }
274
335
  );
275
336
  }
276
337
  );
277
- Xt.displayName = "PCard";
278
- function Zt() {
279
- return /* @__PURE__ */ n("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "m5 8 5 5 5-5" }) });
338
+ ia.displayName = "PCardGrid";
339
+ function sa() {
340
+ return /* @__PURE__ */ a("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "m5 8 5 5 5-5" }) });
280
341
  }
281
- function Jt() {
282
- return /* @__PURE__ */ n("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "m4 10 4 4 8-8" }) });
342
+ function oa() {
343
+ return /* @__PURE__ */ a("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "m4 10 4 4 8-8" }) });
283
344
  }
284
- function It() {
345
+ function Tt() {
285
346
  return /* @__PURE__ */ _("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: [
286
- /* @__PURE__ */ n("path", { d: "m5 5 10 10" }),
287
- /* @__PURE__ */ n("path", { d: "m15 5-10 10" })
347
+ /* @__PURE__ */ a("path", { d: "m5 5 10 10" }),
348
+ /* @__PURE__ */ a("path", { d: "m15 5-10 10" })
288
349
  ] });
289
350
  }
290
- function $t(e) {
351
+ function Bt(e) {
291
352
  return e.trim().toLocaleLowerCase();
292
353
  }
293
- function pt(e, t) {
294
- const a = $t(t);
295
- return a ? e.filter((r) => {
296
- const o = [
354
+ function ht(e, t) {
355
+ const n = Bt(t);
356
+ return n ? e.filter((r) => {
357
+ const l = [
297
358
  r.label,
298
359
  r.value,
299
360
  r.description,
300
361
  r.group,
301
362
  ...r.keywords ?? []
302
363
  ].filter(Boolean).join(" ");
303
- return $t(o).includes(a);
364
+ return Bt(l).includes(n);
304
365
  }) : e;
305
366
  }
306
- function zt(e) {
367
+ function Rt(e) {
307
368
  return e.findIndex((t) => !t.disabled);
308
369
  }
309
- function ht(e, t) {
310
- const a = e.findIndex((r) => r.value === t && !r.disabled);
311
- return a >= 0 ? a : zt(e);
370
+ function bt(e, t) {
371
+ const n = e.findIndex((r) => r.value === t && !r.disabled);
372
+ return n >= 0 ? n : Rt(e);
312
373
  }
313
- function Ct(e, t, a) {
314
- var o;
374
+ function At(e, t, n) {
375
+ var l;
315
376
  if (!e.length)
316
377
  return -1;
317
378
  let r = t;
318
- for (let c = 0; c < e.length; c += 1)
319
- if (r = (r + a + e.length) % e.length, !((o = e[r]) != null && o.disabled))
379
+ for (let s = 0; s < e.length; s += 1)
380
+ if (r = (r + n + e.length) % e.length, !((l = e[r]) != null && l.disabled))
320
381
  return r;
321
382
  return -1;
322
383
  }
323
- function Et(e, t) {
384
+ function ca(e, t) {
324
385
  if (typeof e == "function") {
325
386
  e(t);
326
387
  return;
327
388
  }
328
389
  e && (e.current = t);
329
390
  }
330
- const Qt = Ne(
391
+ const da = oe(
331
392
  ({
332
393
  label: e,
333
394
  options: t,
334
- value: a,
395
+ value: n,
335
396
  defaultValue: r,
336
- selectedOption: o,
337
- onValueChange: c,
397
+ selectedOption: l,
398
+ onValueChange: s,
338
399
  query: d,
339
- defaultQuery: g,
340
- onQueryChange: v,
341
- filterMode: u = "local",
342
- isLoading: h = !1,
343
- isLoadingMore: f = !1,
344
- hasMore: x = !1,
345
- onLoadMore: R,
346
- placeholder: T = "Select an option",
347
- searchPlaceholder: k = "Search options",
348
- emptyText: w = "No options found.",
349
- loadingText: A = "Loading options...",
350
- loadingMoreText: I = "Loading more options...",
351
- loadMoreText: C = "Load more options",
352
- helperText: P,
353
- isError: U = !1,
354
- errorMessage: he,
355
- name: Ie,
356
- disabled: me = !1,
357
- readOnly: $e = !1,
358
- required: oe = !1,
359
- clearable: le = !0,
360
- className: ee,
361
- inputClassName: se,
362
- id: Be,
363
- style: Re,
364
- ...ze
365
- }, We) => {
366
- const Z = Qe(), Y = Be ?? Z, ke = `${Y}-label`, N = `${Y}-input`, B = `${Y}-listbox`, j = `${Y}-helper`, L = `${Y}-error`, $ = ne(null), V = ne(null), S = ne(null), J = ne(null), ge = ne(null), te = ne(null), fe = a !== void 0, xe = d !== void 0, [Ce, qe] = G(r ?? ""), q = fe ? a : Ce, F = (o == null ? void 0 : o.value) === q ? o : t.find((i) => i.value === q) ?? null, [Oe, ie] = G(g ?? (F == null ? void 0 : F.label) ?? ""), E = xe ? d : Oe, [D, Q] = G(!1), [ce, Fe] = G(!1), z = Ee(
367
- () => u === "local" ? pt(t, E) : t,
368
- [u, t, E]
369
- ), [De, be] = G(() => ht(t, q)), _e = D ? z[De] : void 0, Ae = _e ? `${B}-option-${De}` : void 0, de = `${Y}-modal-title`, ye = U && he ? L : P ? j : void 0, Le = !!F, ue = le && Le && !me && !$e, Ye = D ? E : (F == null ? void 0 : F.label) ?? E, Ke = h && z.length === 0, Ge = f || h && z.length > 0, Xe = !!(x && R && !h && !f);
370
- Me(() => {
371
- !D && !xe && ie((F == null ? void 0 : F.label) ?? "");
372
- }, [D, xe, F]), Me(() => {
373
- D && be((i) => z[i] && !z[i].disabled ? i : ht(z, q));
374
- }, [z, D, q]), Me(() => {
375
- var i;
376
- D && ((i = ge.current) == null || i.scrollIntoView({ block: "nearest" }));
377
- }, [De, D]), Me(() => {
378
- var Te, Pe;
379
- const i = globalThis, p = (Te = i.matchMedia) == null ? void 0 : Te.call(i, "(max-width: 64rem)");
380
- if (!p)
400
+ defaultQuery: m,
401
+ onQueryChange: y,
402
+ filterMode: b = "local",
403
+ isLoading: u = !1,
404
+ isLoadingMore: v = !1,
405
+ hasMore: N = !1,
406
+ onLoadMore: F,
407
+ placeholder: k = "Select an option",
408
+ searchPlaceholder: g = "Search options",
409
+ emptyText: $ = "No options found.",
410
+ loadingText: j = "Loading options...",
411
+ loadingMoreText: B = "Loading more options...",
412
+ loadMoreText: A = "Load more options",
413
+ helperText: I,
414
+ isError: T = !1,
415
+ errorMessage: V,
416
+ name: S,
417
+ disabled: z = !1,
418
+ readOnly: ee = !1,
419
+ required: O = !1,
420
+ clearable: X = !0,
421
+ className: p,
422
+ inputClassName: M,
423
+ id: x,
424
+ style: W,
425
+ ...pe
426
+ }, w) => {
427
+ const D = Oe(), H = x ?? D, he = `${H}-label`, Y = `${H}-input`, R = `${H}-listbox`, te = `${H}-helper`, Z = `${H}-error`, G = me(null), J = me(null), q = me(null), ce = me(null), De = me(null), be = me(null), xe = n !== void 0, Fe = d !== void 0, [Se, Xe] = re(r ?? ""), le = xe ? n : Se, U = (l == null ? void 0 : l.value) === le ? l : t.find((c) => c.value === le) ?? null, [Ze, ge] = re(m ?? (U == null ? void 0 : U.label) ?? ""), de = Fe ? d : Ze, [L, ue] = re(!1), [ye, Te] = re(!1), Q = tt(
428
+ () => b === "local" ? ht(t, de) : t,
429
+ [b, t, de]
430
+ ), [Ie, Me] = re(() => bt(t, le)), $e = L ? Q[Ie] : void 0, je = $e ? `${R}-option-${Ie}` : void 0, ve = `${H}-modal-title`, we = T && V ? Z : I ? te : void 0, He = !!U, Ne = X && He && !z && !ee, Be = L ? de : (U == null ? void 0 : U.label) ?? de, We = u && Q.length === 0, Je = v || u && Q.length > 0, Qe = !!(N && F && !u && !v);
431
+ Ce(() => {
432
+ !L && !Fe && ge((U == null ? void 0 : U.label) ?? "");
433
+ }, [L, Fe, U]), Ce(() => {
434
+ L && Me((c) => Q[c] && !Q[c].disabled ? c : bt(Q, le));
435
+ }, [Q, L, le]), Ce(() => {
436
+ var c;
437
+ L && ((c = De.current) == null || c.scrollIntoView({ block: "nearest" }));
438
+ }, [Ie, L]), Ce(() => {
439
+ var Ve, Le;
440
+ const c = globalThis, f = (Ve = c.matchMedia) == null ? void 0 : Ve.call(c, "(max-width: 64rem)");
441
+ if (!f)
381
442
  return;
382
- const W = () => Fe(p.matches);
383
- return W(), (Pe = p.addEventListener) == null || Pe.call(p, "change", W), () => {
384
- var je;
385
- return (je = p.removeEventListener) == null ? void 0 : je.call(p, "change", W);
443
+ const ne = () => Te(f.matches);
444
+ return ne(), (Le = f.addEventListener) == null || Le.call(f, "change", ne), () => {
445
+ var Ue;
446
+ return (Ue = f.removeEventListener) == null ? void 0 : Ue.call(f, "change", ne);
386
447
  };
387
- }, []), Me(() => {
388
- var i;
389
- !D || !ce || (i = S.current) == null || i.focus();
390
- }, [ce, D]), Me(() => {
391
- J.current && J.current.setCustomValidity(oe && !q ? "Select an option." : "");
392
- }, [oe, q]);
393
- const s = (i) => {
394
- $.current = i, Et(We, i);
395
- }, y = (i, p) => {
396
- xe || ie(i), v == null || v(i, { source: p });
397
- }, H = () => {
398
- !x || !R || h || f || R({ query: E, optionCount: z.length });
448
+ }, []), Ce(() => {
449
+ var c;
450
+ !L || !ye || (c = q.current) == null || c.focus();
451
+ }, [ye, L]), Ce(() => {
452
+ ce.current && ce.current.setCustomValidity(O && !le ? "Select an option." : "");
453
+ }, [O, le]);
454
+ const o = (c) => {
455
+ G.current = c, ca(w, c);
456
+ }, C = (c, f) => {
457
+ Fe || ge(c), y == null || y(c, { source: f });
458
+ }, ae = () => {
459
+ !N || !F || u || v || F({ query: de, optionCount: Q.length });
399
460
  };
400
- Me(() => {
401
- if (!D || !te.current)
461
+ Ce(() => {
462
+ if (!L || !be.current)
402
463
  return;
403
- const { scrollHeight: i, clientHeight: p } = te.current;
404
- i <= p + 48 && H();
464
+ const { scrollHeight: c, clientHeight: f } = be.current;
465
+ c <= f + 48 && ae();
405
466
  });
406
- const l = (i) => {
407
- const p = (i == null ? void 0 : i.value) ?? "";
408
- fe || qe(p), y((i == null ? void 0 : i.label) ?? "", i ? "selection" : "clear"), c == null || c(p, i);
409
- }, b = (i = E) => {
410
- if (me || $e)
467
+ const i = (c) => {
468
+ const f = (c == null ? void 0 : c.value) ?? "";
469
+ xe || Xe(f), C((c == null ? void 0 : c.label) ?? "", c ? "selection" : "clear"), s == null || s(f, c);
470
+ }, P = (c = de) => {
471
+ if (z || ee)
411
472
  return;
412
- const p = u === "local" ? pt(t, i) : t;
413
- y(i, "open"), be(ht(p, q)), Q(!0);
414
- }, K = () => {
415
- Q(!1), y((F == null ? void 0 : F.label) ?? "", "reset");
416
- }, ve = (i) => {
417
- const p = i.currentTarget.value, W = u === "local" ? pt(t, p) : t;
418
- y(p, "input"), be(zt(W)), Q(!0);
419
- }, ae = (i) => {
420
- if (i.key === "ArrowDown") {
421
- if (i.preventDefault(), !D) {
422
- b("");
473
+ const f = b === "local" ? ht(t, c) : t;
474
+ C(c, "open"), Me(bt(f, le)), ue(!0);
475
+ }, E = () => {
476
+ ue(!1), C((U == null ? void 0 : U.label) ?? "", "reset");
477
+ }, Pe = (c) => {
478
+ const f = c.currentTarget.value, ne = b === "local" ? ht(t, f) : t;
479
+ C(f, "input"), Me(Rt(ne)), ue(!0);
480
+ }, _e = (c) => {
481
+ if (c.key === "ArrowDown") {
482
+ if (c.preventDefault(), !L) {
483
+ P("");
423
484
  return;
424
485
  }
425
- be((p) => Ct(z, p, 1));
486
+ Me((f) => At(Q, f, 1));
426
487
  return;
427
488
  }
428
- if (i.key === "ArrowUp") {
429
- if (i.preventDefault(), !D) {
430
- b("");
489
+ if (c.key === "ArrowUp") {
490
+ if (c.preventDefault(), !L) {
491
+ P("");
431
492
  return;
432
493
  }
433
- be((p) => Ct(z, p, -1));
494
+ Me((f) => At(Q, f, -1));
434
495
  return;
435
496
  }
436
- if (i.key === "Enter") {
437
- if (!D) {
438
- b(E);
497
+ if (c.key === "Enter") {
498
+ if (!L) {
499
+ P(de);
439
500
  return;
440
501
  }
441
- _e && !_e.disabled && (i.preventDefault(), l(_e), Q(!1));
502
+ $e && !$e.disabled && (c.preventDefault(), i($e), ue(!1));
442
503
  return;
443
504
  }
444
- if (i.key === "Escape" && D) {
445
- i.preventDefault(), K();
505
+ if (c.key === "Escape" && L) {
506
+ c.preventDefault(), E();
446
507
  return;
447
508
  }
448
- i.key === "Tab" && K();
449
- }, Se = (i, p) => {
450
- var W;
451
- i.preventDefault(), !p.disabled && (l(p), Q(!1), (W = V.current) == null || W.focus());
452
- }, ct = (i) => {
453
- var p;
454
- i.preventDefault(), i.stopPropagation(), l(null), Q(!1), (p = V.current) == null || p.focus();
455
- }, dt = (i) => {
456
- const p = i.currentTarget;
457
- p.scrollHeight - p.scrollTop - p.clientHeight <= 48 && H();
458
- }, ut = (i) => {
459
- if (!D)
509
+ c.key === "Tab" && E();
510
+ }, Ae = (c, f) => {
511
+ var ne;
512
+ c.preventDefault(), !f.disabled && (i(f), ue(!1), (ne = J.current) == null || ne.focus());
513
+ }, dt = (c) => {
514
+ var f;
515
+ c.preventDefault(), c.stopPropagation(), i(null), ue(!1), (f = J.current) == null || f.focus();
516
+ }, ut = (c) => {
517
+ const f = c.currentTarget;
518
+ f.scrollHeight - f.scrollTop - f.clientHeight <= 48 && ae();
519
+ }, pt = (c) => {
520
+ if (!L)
460
521
  return;
461
- i.currentTarget.contains(i.relatedTarget) || K();
462
- }, xt = z.reduce(
463
- (i, p) => {
464
- const W = p.group ?? null, Te = i.find((Pe) => Pe.group === W);
465
- return Te ? (Te.options.push(p), i) : (i.push({ group: W, options: [p] }), i);
522
+ c.currentTarget.contains(c.relatedTarget) || E();
523
+ }, It = Q.reduce(
524
+ (c, f) => {
525
+ const ne = f.group ?? null, Ve = c.find((Le) => Le.group === ne);
526
+ return Ve ? (Ve.options.push(f), c) : (c.push({ group: ne, options: [f] }), c);
466
527
  },
467
528
  []
468
529
  );
469
530
  return /* @__PURE__ */ _(
470
531
  "div",
471
532
  {
472
- ...ze,
473
- ref: s,
474
- id: Y,
475
- style: Re,
476
- onBlur: ut,
477
- className: m(
533
+ ...pe,
534
+ ref: o,
535
+ id: H,
536
+ style: W,
537
+ onBlur: pt,
538
+ className: h(
478
539
  "p-combobox",
479
- D && "p-combobox--open",
480
- U && "p-combobox--error",
481
- me && "p-combobox--disabled",
482
- $e && "p-combobox--readonly",
483
- ee
540
+ L && "p-combobox--open",
541
+ T && "p-combobox--error",
542
+ z && "p-combobox--disabled",
543
+ ee && "p-combobox--readonly",
544
+ p
484
545
  ),
485
546
  children: [
486
547
  /* @__PURE__ */ _("div", { className: "p-combobox__field", children: [
487
- /* @__PURE__ */ n(
548
+ /* @__PURE__ */ a(
488
549
  "input",
489
550
  {
490
- ref: V,
491
- id: N,
551
+ ref: J,
552
+ id: Y,
492
553
  role: "combobox",
493
554
  type: "text",
494
- value: Ye,
495
- placeholder: D ? k : " ",
496
- disabled: me,
497
- readOnly: $e,
555
+ value: Be,
556
+ placeholder: L ? g : " ",
557
+ disabled: z,
558
+ readOnly: ee,
498
559
  required: !1,
499
560
  "aria-autocomplete": "list",
500
- "aria-controls": B,
501
- "aria-describedby": ye,
502
- "aria-activedescendant": Ae,
503
- "aria-expanded": D,
561
+ "aria-controls": R,
562
+ "aria-describedby": we,
563
+ "aria-activedescendant": je,
564
+ "aria-expanded": L,
504
565
  "aria-haspopup": "listbox",
505
- "aria-invalid": U || void 0,
506
- "aria-labelledby": ke,
566
+ "aria-invalid": T || void 0,
567
+ "aria-labelledby": he,
507
568
  autoComplete: "off",
508
- className: m("p-combobox__input", (ue || Le) && "p-combobox__input--adorned", se),
509
- onChange: ve,
510
- onClick: () => b(""),
511
- onKeyDown: ae
569
+ className: h("p-combobox__input", (Ne || He) && "p-combobox__input--adorned", M),
570
+ onChange: Pe,
571
+ onClick: () => P(""),
572
+ onKeyDown: _e
512
573
  }
513
574
  ),
514
- /* @__PURE__ */ n(
575
+ /* @__PURE__ */ a(
515
576
  "label",
516
577
  {
517
- id: ke,
518
- htmlFor: N,
519
- className: m("p-combobox__label p-combobox__floating-label", U && "p-combobox__label--error"),
578
+ id: he,
579
+ htmlFor: Y,
580
+ className: h("p-combobox__label p-combobox__floating-label", T && "p-combobox__label--error"),
520
581
  children: e
521
582
  }
522
583
  ),
523
- /* @__PURE__ */ n("span", { "aria-hidden": "true", className: "p-combobox__label p-combobox__placeholder-label", children: T || e }),
524
- ue ? /* @__PURE__ */ n(
584
+ /* @__PURE__ */ a("span", { "aria-hidden": "true", className: "p-combobox__label p-combobox__placeholder-label", children: k || e }),
585
+ Ne ? /* @__PURE__ */ a(
525
586
  "button",
526
587
  {
527
588
  type: "button",
528
589
  className: "p-combobox__clear",
529
590
  "aria-label": `Clear ${e}`,
530
- onMouseDown: ct,
531
- children: /* @__PURE__ */ n(It, {})
591
+ onMouseDown: dt,
592
+ children: /* @__PURE__ */ a(Tt, {})
532
593
  }
533
594
  ) : null,
534
- /* @__PURE__ */ n("span", { className: "p-combobox__chevron", "aria-hidden": "true", children: /* @__PURE__ */ n(Zt, {}) }),
535
- D ? /* @__PURE__ */ _(
595
+ /* @__PURE__ */ a("span", { className: "p-combobox__chevron", "aria-hidden": "true", children: /* @__PURE__ */ a(sa, {}) }),
596
+ L ? /* @__PURE__ */ _(
536
597
  "div",
537
598
  {
538
599
  className: "p-combobox__panel",
539
- role: ce ? "dialog" : void 0,
540
- "aria-modal": ce || void 0,
541
- "aria-labelledby": ce ? de : void 0,
600
+ role: ye ? "dialog" : void 0,
601
+ "aria-modal": ye || void 0,
602
+ "aria-labelledby": ye ? ve : void 0,
542
603
  children: [
543
604
  /* @__PURE__ */ _("div", { className: "p-combobox__modal-header", children: [
544
- /* @__PURE__ */ n("div", { id: de, className: "p-combobox__modal-title", children: e }),
545
- /* @__PURE__ */ n("button", { type: "button", className: "p-combobox__modal-close", "aria-label": `Close ${e}`, onClick: K, children: /* @__PURE__ */ n(It, {}) })
605
+ /* @__PURE__ */ a("div", { id: ve, className: "p-combobox__modal-title", children: e }),
606
+ /* @__PURE__ */ a("button", { type: "button", className: "p-combobox__modal-close", "aria-label": `Close ${e}`, onClick: E, children: /* @__PURE__ */ a(Tt, {}) })
546
607
  ] }),
547
- /* @__PURE__ */ n("div", { className: "p-combobox__modal-search", children: /* @__PURE__ */ n(
608
+ /* @__PURE__ */ a("div", { className: "p-combobox__modal-search", children: /* @__PURE__ */ a(
548
609
  "input",
549
610
  {
550
- ref: S,
611
+ ref: q,
551
612
  role: "combobox",
552
613
  type: "search",
553
- value: E,
554
- placeholder: k,
555
- "aria-activedescendant": Ae,
614
+ value: de,
615
+ placeholder: g,
616
+ "aria-activedescendant": je,
556
617
  "aria-autocomplete": "list",
557
- "aria-controls": B,
558
- "aria-expanded": D,
618
+ "aria-controls": R,
619
+ "aria-expanded": L,
559
620
  "aria-haspopup": "listbox",
560
621
  "aria-label": `Search ${e}`,
561
622
  autoComplete: "off",
562
623
  className: "p-combobox__modal-input",
563
- onChange: ve,
564
- onKeyDown: ae
624
+ onChange: Pe,
625
+ onKeyDown: _e
565
626
  }
566
627
  ) }),
567
628
  /* @__PURE__ */ _(
568
629
  "div",
569
630
  {
570
- id: B,
571
- ref: (i) => {
572
- te.current = i;
631
+ id: R,
632
+ ref: (c) => {
633
+ be.current = c;
573
634
  },
574
635
  role: "listbox",
575
- "aria-busy": h || f || void 0,
576
- "aria-labelledby": ke,
636
+ "aria-busy": u || v || void 0,
637
+ "aria-labelledby": he,
577
638
  className: "p-combobox__list",
578
- onScroll: dt,
639
+ onScroll: ut,
579
640
  children: [
580
- Ke ? /* @__PURE__ */ _("div", { className: "p-combobox__status", role: "option", "aria-disabled": "true", "aria-selected": "false", children: [
581
- /* @__PURE__ */ n("span", { className: "p-combobox__spinner", "aria-hidden": "true" }),
582
- /* @__PURE__ */ n("span", { children: A })
641
+ We ? /* @__PURE__ */ _("div", { className: "p-combobox__status", role: "option", "aria-disabled": "true", "aria-selected": "false", children: [
642
+ /* @__PURE__ */ a("span", { className: "p-combobox__spinner", "aria-hidden": "true" }),
643
+ /* @__PURE__ */ a("span", { children: j })
583
644
  ] }) : null,
584
- xt.length ? xt.map((i) => /* @__PURE__ */ _("div", { className: "p-combobox__group", children: [
585
- i.group ? /* @__PURE__ */ n("div", { className: "p-combobox__group-label", children: i.group }) : null,
586
- i.options.map((p) => {
587
- const W = z.indexOf(p), Te = W === De, Pe = p.value === q;
645
+ It.length ? It.map((c) => /* @__PURE__ */ _("div", { className: "p-combobox__group", children: [
646
+ c.group ? /* @__PURE__ */ a("div", { className: "p-combobox__group-label", children: c.group }) : null,
647
+ c.options.map((f) => {
648
+ const ne = Q.indexOf(f), Ve = ne === Ie, Le = f.value === le;
588
649
  return /* @__PURE__ */ _(
589
650
  "div",
590
651
  {
591
- ref: Te ? (je) => {
592
- ge.current = je;
652
+ ref: Ve ? (Ue) => {
653
+ De.current = Ue;
593
654
  } : void 0,
594
- id: `${B}-option-${W}`,
655
+ id: `${R}-option-${ne}`,
595
656
  role: "option",
596
- "aria-disabled": p.disabled || void 0,
597
- "aria-selected": Pe,
598
- className: m(
657
+ "aria-disabled": f.disabled || void 0,
658
+ "aria-selected": Le,
659
+ className: h(
599
660
  "p-combobox__option",
600
- Te && "p-combobox__option--active",
601
- Pe && "p-combobox__option--selected",
602
- p.disabled && "p-combobox__option--disabled"
661
+ Ve && "p-combobox__option--active",
662
+ Le && "p-combobox__option--selected",
663
+ f.disabled && "p-combobox__option--disabled"
603
664
  ),
604
- onMouseDown: (je) => Se(je, p),
665
+ onMouseDown: (Ue) => Ae(Ue, f),
605
666
  children: [
606
- /* @__PURE__ */ n("span", { className: "p-combobox__option-check", children: Pe ? /* @__PURE__ */ n(Jt, {}) : null }),
667
+ /* @__PURE__ */ a("span", { className: "p-combobox__option-check", children: Le ? /* @__PURE__ */ a(oa, {}) : null }),
607
668
  /* @__PURE__ */ _("span", { className: "p-combobox__option-content", children: [
608
- /* @__PURE__ */ n("span", { className: "p-combobox__option-label", children: p.label }),
609
- p.description ? /* @__PURE__ */ n("span", { className: "p-combobox__option-description", children: p.description }) : null
669
+ /* @__PURE__ */ a("span", { className: "p-combobox__option-label", children: f.label }),
670
+ f.description ? /* @__PURE__ */ a("span", { className: "p-combobox__option-description", children: f.description }) : null
610
671
  ] }),
611
- p.meta ? /* @__PURE__ */ n("span", { className: "p-combobox__option-meta", children: p.meta }) : null
672
+ f.meta ? /* @__PURE__ */ a("span", { className: "p-combobox__option-meta", children: f.meta }) : null
612
673
  ]
613
674
  },
614
- p.value
675
+ f.value
615
676
  );
616
677
  })
617
- ] }, i.group ?? "ungrouped")) : Ke ? null : /* @__PURE__ */ n("div", { className: "p-combobox__empty", role: "option", "aria-disabled": "true", "aria-selected": "false", children: w }),
618
- Ge ? /* @__PURE__ */ _("div", { className: "p-combobox__status p-combobox__status--footer", role: "option", "aria-disabled": "true", "aria-selected": "false", children: [
619
- /* @__PURE__ */ n("span", { className: "p-combobox__spinner", "aria-hidden": "true" }),
620
- /* @__PURE__ */ n("span", { children: I })
678
+ ] }, c.group ?? "ungrouped")) : We ? null : /* @__PURE__ */ a("div", { className: "p-combobox__empty", role: "option", "aria-disabled": "true", "aria-selected": "false", children: $ }),
679
+ Je ? /* @__PURE__ */ _("div", { className: "p-combobox__status p-combobox__status--footer", role: "option", "aria-disabled": "true", "aria-selected": "false", children: [
680
+ /* @__PURE__ */ a("span", { className: "p-combobox__spinner", "aria-hidden": "true" }),
681
+ /* @__PURE__ */ a("span", { children: B })
621
682
  ] }) : null
622
683
  ]
623
684
  }
624
685
  ),
625
- Xe ? /* @__PURE__ */ n("div", { className: "p-combobox__footer", children: /* @__PURE__ */ n("button", { type: "button", className: "p-combobox__load-more", onMouseDown: (i) => i.preventDefault(), onClick: H, children: C }) }) : null
686
+ Qe ? /* @__PURE__ */ a("div", { className: "p-combobox__footer", children: /* @__PURE__ */ a("button", { type: "button", className: "p-combobox__load-more", onMouseDown: (c) => c.preventDefault(), onClick: ae, children: A }) }) : null
626
687
  ]
627
688
  }
628
689
  ) : null
629
690
  ] }),
630
- /* @__PURE__ */ n(
691
+ /* @__PURE__ */ a(
631
692
  "input",
632
693
  {
633
- ref: J,
694
+ ref: ce,
634
695
  type: "text",
635
- name: Ie,
636
- value: q ?? "",
637
- required: oe,
696
+ name: S,
697
+ value: le ?? "",
698
+ required: O,
638
699
  tabIndex: -1,
639
700
  "aria-hidden": "true",
640
701
  className: "p-combobox__hidden-input",
@@ -642,17 +703,17 @@ const Qt = Ne(
642
703
  }
643
704
  }
644
705
  ),
645
- D ? /* @__PURE__ */ n("div", { className: "p-combobox__backdrop", "aria-hidden": "true", onMouseDown: K }) : null,
646
- U && he ? /* @__PURE__ */ n("p", { id: L, role: "alert", className: "p-combobox__message p-combobox__message--error", children: he }) : null,
647
- !U && P ? /* @__PURE__ */ n("p", { id: j, className: "p-combobox__message", children: P }) : null
706
+ L ? /* @__PURE__ */ a("div", { className: "p-combobox__backdrop", "aria-hidden": "true", onMouseDown: E }) : null,
707
+ T && V ? /* @__PURE__ */ a("p", { id: Z, role: "alert", className: "p-combobox__message p-combobox__message--error", children: V }) : null,
708
+ !T && I ? /* @__PURE__ */ a("p", { id: te, className: "p-combobox__message", children: I }) : null
648
709
  ]
649
710
  }
650
711
  );
651
712
  }
652
713
  );
653
- Qt.displayName = "PCombobox";
654
- const ea = new Intl.DateTimeFormat(void 0, { weekday: "short" });
655
- function nt(e) {
714
+ da.displayName = "PCombobox";
715
+ const ua = new Intl.DateTimeFormat(void 0, { weekday: "short" });
716
+ function lt(e) {
656
717
  if (!e)
657
718
  return null;
658
719
  if (e instanceof Date)
@@ -660,63 +721,63 @@ function nt(e) {
660
721
  const t = e.split("-").map(Number);
661
722
  if (t.length !== 3 || t.some(Number.isNaN))
662
723
  return null;
663
- const [a, r, o] = t, c = new Date(a, r - 1, o);
664
- return c.getFullYear() !== a || c.getMonth() !== r - 1 || c.getDate() !== o ? null : c;
724
+ const [n, r, l] = t, s = new Date(n, r - 1, l);
725
+ return s.getFullYear() !== n || s.getMonth() !== r - 1 || s.getDate() !== l ? null : s;
665
726
  }
666
- function Je(e) {
727
+ function et(e) {
667
728
  if (!e)
668
729
  return "";
669
- const t = e.getFullYear(), a = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
670
- return `${t}-${a}-${r}`;
730
+ const t = e.getFullYear(), n = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
731
+ return `${t}-${n}-${r}`;
671
732
  }
672
- function re(e) {
733
+ function fe(e) {
673
734
  return new Date(e.getFullYear(), e.getMonth(), 1);
674
735
  }
675
- function it(e) {
736
+ function ct(e) {
676
737
  return new Date(e.getFullYear(), e.getMonth() + 1, 0);
677
738
  }
678
- function kt(e, t) {
739
+ function Mt(e, t) {
679
740
  return new Date(e.getFullYear(), e.getMonth() + t, 1);
680
741
  }
681
- function Ft(e, t) {
682
- const a = kt(e, t), r = it(a).getDate();
683
- return new Date(a.getFullYear(), a.getMonth(), Math.min(e.getDate(), r));
742
+ function Vt(e, t) {
743
+ const n = Mt(e, t), r = ct(n).getDate();
744
+ return new Date(n.getFullYear(), n.getMonth(), Math.min(e.getDate(), r));
684
745
  }
685
- function pe(e, t) {
746
+ function ke(e, t) {
686
747
  return new Date(e.getFullYear(), e.getMonth(), e.getDate() + t);
687
748
  }
688
- function Ze(e, t) {
689
- return !!(e && t && Je(e) === Je(t));
749
+ function Ee(e, t) {
750
+ return !!(e && t && et(e) === et(t));
690
751
  }
691
- function He() {
752
+ function ze() {
692
753
  const e = /* @__PURE__ */ new Date();
693
754
  return new Date(e.getFullYear(), e.getMonth(), e.getDate());
694
755
  }
695
- function ta(e, t) {
696
- const a = re(e), r = (a.getDay() - t + 7) % 7, o = pe(a, -r);
697
- return Array.from({ length: 42 }, (c, d) => pe(o, d));
756
+ function pa(e, t) {
757
+ const n = fe(e), r = (n.getDay() - t + 7) % 7, l = ke(n, -r);
758
+ return Array.from({ length: 42 }, (s, d) => ke(l, d));
698
759
  }
699
- function mt(e) {
760
+ function _t(e) {
700
761
  const t = typeof e.value == "function" ? e.value() : e.value;
701
- return nt(t);
762
+ return lt(t);
702
763
  }
703
- function aa(e, t) {
764
+ function ha(e, t) {
704
765
  return new Intl.DateTimeFormat(t, { month: "long", year: "numeric" }).format(e);
705
766
  }
706
- function na(e) {
707
- return Array.from({ length: 12 }, (t, a) => ({
708
- label: new Intl.DateTimeFormat(e, { month: "long" }).format(new Date(2024, a, 1)),
709
- value: a
767
+ function ba(e) {
768
+ return Array.from({ length: 12 }, (t, n) => ({
769
+ label: new Intl.DateTimeFormat(e, { month: "long" }).format(new Date(2024, n, 1)),
770
+ value: n
710
771
  }));
711
772
  }
712
- function ra(e, t) {
773
+ function _a(e, t) {
713
774
  return new Intl.DateTimeFormat(t, {
714
775
  month: "short",
715
776
  day: "numeric",
716
777
  year: "numeric"
717
778
  }).format(e);
718
779
  }
719
- function oa(e, t) {
780
+ function ma(e, t) {
720
781
  return new Intl.DateTimeFormat(t, {
721
782
  weekday: "long",
722
783
  month: "long",
@@ -724,181 +785,181 @@ function oa(e, t) {
724
785
  year: "numeric"
725
786
  }).format(e);
726
787
  }
727
- function la(e, t) {
728
- const a = new Date(2024, 0, 7);
729
- return Array.from({ length: 7 }, (r, o) => {
730
- const c = pe(a, e + o);
731
- return ea.formatToParts(c).length ? new Intl.DateTimeFormat(t, { weekday: "short" }).format(c) : "";
788
+ function fa(e, t) {
789
+ const n = new Date(2024, 0, 7);
790
+ return Array.from({ length: 7 }, (r, l) => {
791
+ const s = ke(n, e + l);
792
+ return ua.formatToParts(s).length ? new Intl.DateTimeFormat(t, { weekday: "short" }).format(s) : "";
732
793
  });
733
794
  }
734
- function gt(e, t) {
795
+ function mt(e, t) {
735
796
  return !!(t && e.getTime() < t.getTime());
736
797
  }
737
798
  function ft(e, t) {
738
799
  return !!(t && e.getTime() > t.getTime());
739
800
  }
740
- function Yt(e, t) {
801
+ function Lt(e, t) {
741
802
  return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth();
742
803
  }
743
- function bt(e, t, a) {
744
- const r = re(e), o = it(e);
745
- return !!(t && o < t || a && r > a);
804
+ function gt(e, t, n) {
805
+ const r = fe(e), l = ct(e);
806
+ return !!(t && l < t || n && r > n);
746
807
  }
747
- function sa(e, t, a) {
748
- return t && it(e) < t ? re(t) : a && re(e) > a ? re(a) : re(e);
808
+ function ga(e, t, n) {
809
+ return t && ct(e) < t ? fe(t) : n && fe(e) > n ? fe(n) : fe(e);
749
810
  }
750
- function ia(e, t, a, r) {
751
- const o = re(e), c = it(e);
811
+ function ya(e, t, n, r) {
812
+ const l = fe(e), s = ct(e);
752
813
  let d = new Date(
753
- o.getFullYear(),
754
- o.getMonth(),
755
- Math.min(t.getDate(), c.getDate())
814
+ l.getFullYear(),
815
+ l.getMonth(),
816
+ Math.min(t.getDate(), s.getDate())
756
817
  );
757
- return a && d < a && (d = Yt(a, o) ? a : o), r && d > r && (d = Yt(r, o) ? r : c), d;
818
+ return n && d < n && (d = Lt(n, l) ? n : l), r && d > r && (d = Lt(r, l) ? r : s), d;
758
819
  }
759
- function ca(e, t, a, r) {
760
- const o = e.getFullYear(), c = Math.min(o, r.getFullYear() - 100), d = Math.max(o, r.getFullYear() + 20), g = (t == null ? void 0 : t.getFullYear()) ?? c, v = (a == null ? void 0 : a.getFullYear()) ?? d, u = Math.min(g, v, o), h = Math.max(g, v, o);
761
- return Array.from({ length: h - u + 1 }, (f, x) => u + x);
820
+ function va(e, t, n, r) {
821
+ const l = e.getFullYear(), s = Math.min(l, r.getFullYear() - 100), d = Math.max(l, r.getFullYear() + 20), m = (t == null ? void 0 : t.getFullYear()) ?? s, y = (n == null ? void 0 : n.getFullYear()) ?? d, b = Math.min(m, y, l), u = Math.max(m, y, l);
822
+ return Array.from({ length: u - b + 1 }, (v, N) => b + N);
762
823
  }
763
- const da = Ne(
824
+ const Na = oe(
764
825
  ({
765
826
  label: e,
766
827
  value: t,
767
- defaultValue: a,
828
+ defaultValue: n,
768
829
  onValueChange: r,
769
- presets: o = [],
770
- customLabel: c = "Custom",
830
+ presets: l = [],
831
+ customLabel: s = "Custom",
771
832
  showCustom: d = !0,
772
- presetColumns: g = "auto",
773
- placeholder: v = "Select date",
774
- helperText: u,
775
- isError: h = !1,
776
- errorMessage: f,
777
- min: x,
778
- max: R,
779
- name: T,
780
- disabled: k = !1,
781
- readOnly: w = !1,
782
- required: A = !1,
783
- locale: I,
784
- weekStartsOn: C = 0,
785
- className: P,
786
- id: U,
787
- style: he,
788
- ...Ie
789
- }, me) => {
790
- const $e = Qe(), oe = U ?? $e, le = `${oe}-label`, ee = `${oe}-panel`, se = `${oe}-helper`, Be = `${oe}-error`, Re = t !== void 0, [ze, We] = G(a ?? ""), [Z, Y] = G(!1), ke = Re ? t : ze, N = nt(ke), B = Ee(He, []), j = nt(x), L = nt(R), [$, V] = G(() => re(N ?? B)), [S, J] = G(() => N ?? B), ge = ne(null), te = ne({}), fe = ne(!1), xe = ta($, C), Ce = la(C, I), qe = Ee(() => na(I), [I]), q = ca($, j, L, B), F = o.length > 0, Oe = F ? d : !0, ie = g === "auto" ? void 0 : {
791
- "--p-date-picker-preset-columns": String(g)
792
- }, E = h && f ? Be : u ? se : void 0, D = N ? ra(N, I) : v, Q = F ? o.some((s) => Ze(mt(s), N)) : !1, ce = Z || !!(N && !Q), Fe = kt($, -1), z = kt($, 1), De = bt(Fe, j, L), be = bt(z, j, L);
793
- Me(() => {
794
- var s;
795
- Z && fe.current && ((s = te.current[Je(S)]) == null || s.focus(), fe.current = !1);
796
- }, [S, Z, $]);
797
- const _e = (s, y) => {
798
- const H = Je(s);
799
- Re || We(H), s && V(re(s)), r == null || r(H, { date: s, source: y });
800
- }, Ae = (s) => {
801
- if (k || w)
833
+ presetColumns: m = "auto",
834
+ placeholder: y = "Select date",
835
+ helperText: b,
836
+ isError: u = !1,
837
+ errorMessage: v,
838
+ min: N,
839
+ max: F,
840
+ name: k,
841
+ disabled: g = !1,
842
+ readOnly: $ = !1,
843
+ required: j = !1,
844
+ locale: B,
845
+ weekStartsOn: A = 0,
846
+ className: I,
847
+ id: T,
848
+ style: V,
849
+ ...S
850
+ }, z) => {
851
+ const ee = Oe(), O = T ?? ee, X = `${O}-label`, p = `${O}-panel`, M = `${O}-helper`, x = `${O}-error`, W = t !== void 0, [pe, w] = re(n ?? ""), [D, H] = re(!1), he = W ? t : pe, Y = lt(he), R = tt(ze, []), te = lt(N), Z = lt(F), [G, J] = re(() => fe(Y ?? R)), [q, ce] = re(() => Y ?? R), De = me(null), be = me({}), xe = me(!1), Fe = pa(G, A), Se = fa(A, B), Xe = tt(() => ba(B), [B]), le = va(G, te, Z, R), U = l.length > 0, Ze = U ? d : !0, ge = m === "auto" ? void 0 : {
852
+ "--p-date-picker-preset-columns": String(m)
853
+ }, de = u && v ? x : b ? M : void 0, L = Y ? _a(Y, B) : y, ue = U ? l.some((o) => Ee(_t(o), Y)) : !1, ye = D || !!(Y && !ue), Te = Mt(G, -1), Q = Mt(G, 1), Ie = gt(Te, te, Z), Me = gt(Q, te, Z);
854
+ Ce(() => {
855
+ var o;
856
+ D && xe.current && ((o = be.current[et(q)]) == null || o.focus(), xe.current = !1);
857
+ }, [q, D, G]);
858
+ const $e = (o, C) => {
859
+ const ae = et(o);
860
+ W || w(ae), o && J(fe(o)), r == null || r(ae, { date: o, source: C });
861
+ }, je = (o) => {
862
+ if (g || $)
802
863
  return;
803
- const y = N ?? B;
804
- ge.current = s, fe.current = !0, J(y), V(re(y)), Y(!0);
805
- }, de = (s = !1) => {
806
- var y;
807
- Y(!1), s && ((y = ge.current) == null || y.focus());
808
- }, ye = (s) => {
809
- const y = sa(s, j, L);
810
- V(y), J(ia(y, S, j, L));
811
- }, Le = (s) => {
812
- const { value: y } = s.currentTarget;
813
- ye(new Date($.getFullYear(), Number(y), 1));
814
- }, ue = (s) => {
815
- const { value: y } = s.currentTarget;
816
- ye(new Date(Number(y), $.getMonth(), 1));
817
- }, Ye = (s) => {
818
- if (k || w)
864
+ const C = Y ?? R;
865
+ De.current = o, xe.current = !0, ce(C), J(fe(C)), H(!0);
866
+ }, ve = (o = !1) => {
867
+ var C;
868
+ H(!1), o && ((C = De.current) == null || C.focus());
869
+ }, we = (o) => {
870
+ const C = ga(o, te, Z);
871
+ J(C), ce(ya(C, q, te, Z));
872
+ }, He = (o) => {
873
+ const { value: C } = o.currentTarget;
874
+ we(new Date(G.getFullYear(), Number(C), 1));
875
+ }, Ne = (o) => {
876
+ const { value: C } = o.currentTarget;
877
+ we(new Date(Number(C), G.getMonth(), 1));
878
+ }, Be = (o) => {
879
+ if (g || $)
819
880
  return;
820
- const y = mt(s);
821
- _e(y, "preset"), de();
822
- }, Ke = (s) => {
823
- k || w || gt(s, j) || ft(s, L) || (J(s), _e(s, "calendar"), de(!0));
824
- }, Ge = (s) => {
825
- gt(s, j) || ft(s, L) || (fe.current = !0, J(s), V(re(s)));
826
- }, Xe = (s) => (y) => {
827
- if (y.key === "Escape") {
828
- y.preventDefault(), de(!0);
881
+ const C = _t(o);
882
+ $e(C, "preset"), ve();
883
+ }, We = (o) => {
884
+ g || $ || mt(o, te) || ft(o, Z) || (ce(o), $e(o, "calendar"), ve(!0));
885
+ }, Je = (o) => {
886
+ mt(o, te) || ft(o, Z) || (xe.current = !0, ce(o), J(fe(o)));
887
+ }, Qe = (o) => (C) => {
888
+ if (C.key === "Escape") {
889
+ C.preventDefault(), ve(!0);
829
890
  return;
830
891
  }
831
- const H = (s.getDay() - C + 7) % 7, b = {
832
- ArrowLeft: pe(s, -1),
833
- ArrowRight: pe(s, 1),
834
- ArrowUp: pe(s, -7),
835
- ArrowDown: pe(s, 7),
836
- Home: pe(s, -H),
837
- End: pe(s, 6 - H),
838
- PageUp: Ft(s, -1),
839
- PageDown: Ft(s, 1)
840
- }[y.key];
841
- b && (y.preventDefault(), Ge(b));
892
+ const ae = (o.getDay() - A + 7) % 7, P = {
893
+ ArrowLeft: ke(o, -1),
894
+ ArrowRight: ke(o, 1),
895
+ ArrowUp: ke(o, -7),
896
+ ArrowDown: ke(o, 7),
897
+ Home: ke(o, -ae),
898
+ End: ke(o, 6 - ae),
899
+ PageUp: Vt(o, -1),
900
+ PageDown: Vt(o, 1)
901
+ }[C.key];
902
+ P && (C.preventDefault(), Je(P));
842
903
  };
843
904
  return /* @__PURE__ */ _(
844
905
  "div",
845
906
  {
846
- ...Ie,
847
- ref: me,
848
- id: oe,
849
- style: ie ? { ...he, ...ie } : he,
850
- className: m(
907
+ ...S,
908
+ ref: z,
909
+ id: O,
910
+ style: ge ? { ...V, ...ge } : V,
911
+ className: h(
851
912
  "p-date-picker",
852
- F && "p-date-picker--with-presets",
853
- h && "p-date-picker--error",
854
- k && "p-date-picker--disabled",
855
- P
913
+ U && "p-date-picker--with-presets",
914
+ u && "p-date-picker--error",
915
+ g && "p-date-picker--disabled",
916
+ I
856
917
  ),
857
918
  children: [
858
- F ? /* @__PURE__ */ _("div", { id: le, className: "p-date-picker__label", children: [
859
- /* @__PURE__ */ n("span", { children: e }),
860
- /* @__PURE__ */ n("span", { className: m("p-date-picker__label-value", !N && "p-date-picker__label-value--empty"), children: D })
919
+ U ? /* @__PURE__ */ _("div", { id: X, className: "p-date-picker__label", children: [
920
+ /* @__PURE__ */ a("span", { children: e }),
921
+ /* @__PURE__ */ a("span", { className: h("p-date-picker__label-value", !Y && "p-date-picker__label-value--empty"), children: L })
861
922
  ] }) : null,
862
- F ? /* @__PURE__ */ _(
923
+ U ? /* @__PURE__ */ _(
863
924
  "div",
864
925
  {
865
- "aria-describedby": E,
866
- "aria-labelledby": le,
867
- className: m(
926
+ "aria-describedby": de,
927
+ "aria-labelledby": X,
928
+ className: h(
868
929
  "p-date-picker__presets",
869
- g !== "auto" && "p-date-picker__presets--fixed"
930
+ m !== "auto" && "p-date-picker__presets--fixed"
870
931
  ),
871
932
  role: "group",
872
933
  children: [
873
- o.map((s) => {
874
- const y = mt(s), H = Ze(y, N);
875
- return /* @__PURE__ */ n(
934
+ l.map((o) => {
935
+ const C = _t(o), ae = Ee(C, Y);
936
+ return /* @__PURE__ */ a(
876
937
  "button",
877
938
  {
878
939
  type: "button",
879
- className: m("p-date-picker__preset", H && "p-date-picker__preset--active"),
880
- disabled: k,
881
- "aria-pressed": H,
882
- onClick: () => Ye(s),
883
- children: s.label
940
+ className: h("p-date-picker__preset", ae && "p-date-picker__preset--active"),
941
+ disabled: g,
942
+ "aria-pressed": ae,
943
+ onClick: () => Be(o),
944
+ children: o.label
884
945
  },
885
- s.label
946
+ o.label
886
947
  );
887
948
  }),
888
- Oe ? /* @__PURE__ */ n(
949
+ Ze ? /* @__PURE__ */ a(
889
950
  "button",
890
951
  {
891
952
  type: "button",
892
- className: m(
953
+ className: h(
893
954
  "p-date-picker__preset",
894
- ce && "p-date-picker__preset--active"
955
+ ye && "p-date-picker__preset--active"
895
956
  ),
896
- disabled: k,
897
- "aria-controls": ee,
898
- "aria-expanded": Z,
899
- "aria-pressed": ce,
900
- onClick: (s) => Z ? de(!0) : Ae(s.currentTarget),
901
- children: c
957
+ disabled: g,
958
+ "aria-controls": p,
959
+ "aria-expanded": D,
960
+ "aria-pressed": ye,
961
+ onClick: (o) => D ? ve(!0) : je(o.currentTarget),
962
+ children: s
902
963
  }
903
964
  ) : null
904
965
  ]
@@ -907,169 +968,169 @@ const da = Ne(
907
968
  "button",
908
969
  {
909
970
  type: "button",
910
- className: m(
971
+ className: h(
911
972
  "p-date-picker__trigger",
912
- !N && "p-date-picker__trigger--empty",
913
- N && "p-date-picker__trigger--filled",
914
- Z && "p-date-picker__trigger--open"
973
+ !Y && "p-date-picker__trigger--empty",
974
+ Y && "p-date-picker__trigger--filled",
975
+ D && "p-date-picker__trigger--open"
915
976
  ),
916
- disabled: k,
917
- "aria-controls": ee,
918
- "aria-describedby": E,
919
- "aria-expanded": Z,
977
+ disabled: g,
978
+ "aria-controls": p,
979
+ "aria-describedby": de,
980
+ "aria-expanded": D,
920
981
  "aria-haspopup": "dialog",
921
- "aria-label": `${e}: ${D}`,
922
- onClick: (s) => Z ? de(!0) : Ae(s.currentTarget),
982
+ "aria-label": `${e}: ${L}`,
983
+ onClick: (o) => D ? ve(!0) : je(o.currentTarget),
923
984
  children: [
924
- /* @__PURE__ */ n(
985
+ /* @__PURE__ */ a(
925
986
  "span",
926
987
  {
927
- id: le,
928
- className: m(
988
+ id: X,
989
+ className: h(
929
990
  "p-date-picker__trigger-label p-date-picker__trigger-floating-label",
930
- h && "p-date-picker__trigger-label--error"
991
+ u && "p-date-picker__trigger-label--error"
931
992
  ),
932
993
  "aria-hidden": "true",
933
994
  children: e
934
995
  }
935
996
  ),
936
- /* @__PURE__ */ n(
997
+ /* @__PURE__ */ a(
937
998
  "span",
938
999
  {
939
- className: m(
1000
+ className: h(
940
1001
  "p-date-picker__trigger-label p-date-picker__trigger-placeholder-label",
941
- h && "p-date-picker__trigger-label--error"
1002
+ u && "p-date-picker__trigger-label--error"
942
1003
  ),
943
1004
  "aria-hidden": "true",
944
1005
  children: e
945
1006
  }
946
1007
  ),
947
- /* @__PURE__ */ n("span", { className: "p-date-picker__trigger-value", children: D }),
948
- /* @__PURE__ */ n("span", { className: "p-date-picker__trigger-icon", children: /* @__PURE__ */ n(Rt, {}) })
1008
+ /* @__PURE__ */ a("span", { className: "p-date-picker__trigger-value", children: L }),
1009
+ /* @__PURE__ */ a("span", { className: "p-date-picker__trigger-icon", children: /* @__PURE__ */ a(qt, {}) })
949
1010
  ]
950
1011
  }
951
1012
  ),
952
- /* @__PURE__ */ n("input", { type: "hidden", name: T, value: ke ?? "", required: A }),
953
- Z && /* @__PURE__ */ _(
1013
+ /* @__PURE__ */ a("input", { type: "hidden", name: k, value: he ?? "", required: j }),
1014
+ D && /* @__PURE__ */ _(
954
1015
  "div",
955
1016
  {
956
- id: ee,
1017
+ id: p,
957
1018
  className: "p-date-picker__panel",
958
1019
  role: "dialog",
959
- "aria-labelledby": `${ee}-title`,
960
- onKeyDown: (s) => {
961
- s.key === "Escape" && de();
1020
+ "aria-labelledby": `${p}-title`,
1021
+ onKeyDown: (o) => {
1022
+ o.key === "Escape" && ve();
962
1023
  },
963
1024
  children: [
964
1025
  /* @__PURE__ */ _("div", { className: "p-date-picker__calendar-header", children: [
965
- /* @__PURE__ */ n(
1026
+ /* @__PURE__ */ a(
966
1027
  "button",
967
1028
  {
968
1029
  type: "button",
969
1030
  className: "p-date-picker__nav",
970
1031
  "aria-label": "Previous month",
971
- disabled: De,
972
- onClick: () => ye(Fe),
973
- children: /* @__PURE__ */ n(At, {})
1032
+ disabled: Ie,
1033
+ onClick: () => we(Te),
1034
+ children: /* @__PURE__ */ a(Pt, {})
974
1035
  }
975
1036
  ),
976
1037
  /* @__PURE__ */ _("div", { className: "p-date-picker__month", children: [
977
- /* @__PURE__ */ n("span", { id: `${ee}-title`, className: "p-date-picker__month-label", children: aa($, I) }),
978
- /* @__PURE__ */ n(
1038
+ /* @__PURE__ */ a("span", { id: `${p}-title`, className: "p-date-picker__month-label", children: ha(G, B) }),
1039
+ /* @__PURE__ */ a(
979
1040
  "select",
980
1041
  {
981
1042
  className: "p-date-picker__month-select p-date-picker__calendar-select",
982
1043
  "aria-label": "Month",
983
- value: $.getMonth(),
984
- onChange: Le,
985
- children: qe.map((s) => /* @__PURE__ */ n(
1044
+ value: G.getMonth(),
1045
+ onChange: He,
1046
+ children: Xe.map((o) => /* @__PURE__ */ a(
986
1047
  "option",
987
1048
  {
988
- value: s.value,
989
- disabled: bt(new Date($.getFullYear(), s.value, 1), j, L),
990
- children: s.label
1049
+ value: o.value,
1050
+ disabled: gt(new Date(G.getFullYear(), o.value, 1), te, Z),
1051
+ children: o.label
991
1052
  },
992
- s.value
1053
+ o.value
993
1054
  ))
994
1055
  }
995
1056
  ),
996
- /* @__PURE__ */ n(
1057
+ /* @__PURE__ */ a(
997
1058
  "select",
998
1059
  {
999
1060
  className: "p-date-picker__year-select p-date-picker__calendar-select",
1000
1061
  "aria-label": "Year",
1001
- value: $.getFullYear(),
1002
- onChange: ue,
1003
- children: q.map((s) => /* @__PURE__ */ n("option", { value: s, children: s }, s))
1062
+ value: G.getFullYear(),
1063
+ onChange: Ne,
1064
+ children: le.map((o) => /* @__PURE__ */ a("option", { value: o, children: o }, o))
1004
1065
  }
1005
1066
  )
1006
1067
  ] }),
1007
- /* @__PURE__ */ n(
1068
+ /* @__PURE__ */ a(
1008
1069
  "button",
1009
1070
  {
1010
1071
  type: "button",
1011
1072
  className: "p-date-picker__nav",
1012
1073
  "aria-label": "Next month",
1013
- disabled: be,
1014
- onClick: () => ye(z),
1015
- children: /* @__PURE__ */ n(Lt, {})
1074
+ disabled: Me,
1075
+ onClick: () => we(Q),
1076
+ children: /* @__PURE__ */ a(Ft, {})
1016
1077
  }
1017
1078
  )
1018
1079
  ] }),
1019
- /* @__PURE__ */ n("div", { className: "p-date-picker__weekdays", "aria-hidden": "true", children: Ce.map((s) => /* @__PURE__ */ n("span", { children: s }, s)) }),
1020
- /* @__PURE__ */ n("div", { className: "p-date-picker__grid", role: "grid", "aria-labelledby": `${ee}-title`, children: xe.map((s) => {
1021
- const y = Je(s), H = s.getMonth() !== $.getMonth(), l = Ze(s, N), b = Ze(s, B), K = gt(s, j) || ft(s, L);
1022
- return /* @__PURE__ */ n(
1080
+ /* @__PURE__ */ a("div", { className: "p-date-picker__weekdays", "aria-hidden": "true", children: Se.map((o) => /* @__PURE__ */ a("span", { children: o }, o)) }),
1081
+ /* @__PURE__ */ a("div", { className: "p-date-picker__grid", role: "grid", "aria-labelledby": `${p}-title`, children: Fe.map((o) => {
1082
+ const C = et(o), ae = o.getMonth() !== G.getMonth(), i = Ee(o, Y), P = Ee(o, R), E = mt(o, te) || ft(o, Z);
1083
+ return /* @__PURE__ */ a(
1023
1084
  "button",
1024
1085
  {
1025
- ref: (ve) => {
1026
- te.current[y] = ve;
1086
+ ref: (Pe) => {
1087
+ be.current[C] = Pe;
1027
1088
  },
1028
1089
  type: "button",
1029
1090
  role: "gridcell",
1030
- "data-date": y,
1031
- className: m(
1091
+ "data-date": C,
1092
+ className: h(
1032
1093
  "p-date-picker__day",
1033
- H && "p-date-picker__day--outside",
1034
- b && "p-date-picker__day--today",
1035
- l && "p-date-picker__day--selected"
1094
+ ae && "p-date-picker__day--outside",
1095
+ P && "p-date-picker__day--today",
1096
+ i && "p-date-picker__day--selected"
1036
1097
  ),
1037
- disabled: K,
1038
- "aria-label": oa(s, I),
1039
- "aria-selected": l,
1040
- tabIndex: Ze(s, S) ? 0 : -1,
1041
- onClick: () => Ke(s),
1042
- onKeyDown: Xe(s),
1043
- children: s.getDate()
1098
+ disabled: E,
1099
+ "aria-label": ma(o, B),
1100
+ "aria-selected": i,
1101
+ tabIndex: Ee(o, q) ? 0 : -1,
1102
+ onClick: () => We(o),
1103
+ onKeyDown: Qe(o),
1104
+ children: o.getDate()
1044
1105
  },
1045
- y
1106
+ C
1046
1107
  );
1047
1108
  }) })
1048
1109
  ]
1049
1110
  }
1050
1111
  ),
1051
- h && f ? /* @__PURE__ */ n("p", { id: Be, role: "alert", className: "p-date-picker__message p-date-picker__message--error", children: f }) : null,
1052
- !h && u ? /* @__PURE__ */ n("p", { id: se, className: "p-date-picker__message", children: u }) : null
1112
+ u && v ? /* @__PURE__ */ a("p", { id: x, role: "alert", className: "p-date-picker__message p-date-picker__message--error", children: v }) : null,
1113
+ !u && b ? /* @__PURE__ */ a("p", { id: M, className: "p-date-picker__message", children: b }) : null
1053
1114
  ]
1054
1115
  }
1055
1116
  );
1056
1117
  }
1057
1118
  );
1058
- da.displayName = "PDatePicker";
1059
- const Ba = {
1060
- today: { label: "Today", value: () => He() },
1061
- yesterday: { label: "Yesterday", value: () => pe(He(), -1) },
1062
- tomorrow: { label: "Tomorrow", value: () => pe(He(), 1) },
1063
- startOfMonth: { label: "Start of month", value: () => re(He()) },
1119
+ Na.displayName = "PDatePicker";
1120
+ const tn = {
1121
+ today: { label: "Today", value: () => ze() },
1122
+ yesterday: { label: "Yesterday", value: () => ke(ze(), -1) },
1123
+ tomorrow: { label: "Tomorrow", value: () => ke(ze(), 1) },
1124
+ startOfMonth: { label: "Start of month", value: () => fe(ze()) },
1064
1125
  endOfMonth: {
1065
1126
  label: "End of month",
1066
1127
  value: () => {
1067
- const e = He();
1128
+ const e = ze();
1068
1129
  return new Date(e.getFullYear(), e.getMonth() + 1, 0);
1069
1130
  }
1070
1131
  }
1071
- }, ua = new Intl.DateTimeFormat(void 0, { weekday: "short" });
1072
- function lt(e) {
1132
+ }, ka = new Intl.DateTimeFormat(void 0, { weekday: "short" });
1133
+ function st(e) {
1073
1134
  if (!e)
1074
1135
  return null;
1075
1136
  if (e instanceof Date)
@@ -1077,56 +1138,56 @@ function lt(e) {
1077
1138
  const t = e.split("-").map(Number);
1078
1139
  if (t.length !== 3 || t.some(Number.isNaN))
1079
1140
  return null;
1080
- const [a, r, o] = t, c = new Date(a, r - 1, o);
1081
- return c.getFullYear() !== a || c.getMonth() !== r - 1 || c.getDate() !== o ? null : c;
1141
+ const [n, r, l] = t, s = new Date(n, r - 1, l);
1142
+ return s.getFullYear() !== n || s.getMonth() !== r - 1 || s.getDate() !== l ? null : s;
1082
1143
  }
1083
- function M(e) {
1144
+ function K(e) {
1084
1145
  if (!e)
1085
1146
  return "";
1086
- const t = e.getFullYear(), a = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
1087
- return `${t}-${a}-${r}`;
1147
+ const t = e.getFullYear(), n = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
1148
+ return `${t}-${n}-${r}`;
1088
1149
  }
1089
- function X(e) {
1150
+ function se(e) {
1090
1151
  return new Date(e.getFullYear(), e.getMonth(), 1);
1091
1152
  }
1092
- function Ue(e) {
1153
+ function Re(e) {
1093
1154
  return new Date(e.getFullYear(), e.getMonth() + 1, 0);
1094
1155
  }
1095
- function st(e, t) {
1156
+ function ot(e, t) {
1096
1157
  return new Date(e.getFullYear(), e.getMonth() + t, 1);
1097
1158
  }
1098
- function St(e, t) {
1099
- const a = st(e, t), r = Ue(a).getDate();
1100
- return new Date(a.getFullYear(), a.getMonth(), Math.min(e.getDate(), r));
1159
+ function Kt(e, t) {
1160
+ const n = ot(e, t), r = Re(n).getDate();
1161
+ return new Date(n.getFullYear(), n.getMonth(), Math.min(e.getDate(), r));
1101
1162
  }
1102
- function O(e, t) {
1163
+ function ie(e, t) {
1103
1164
  return new Date(e.getFullYear(), e.getMonth(), e.getDate() + t);
1104
1165
  }
1105
- function we() {
1166
+ function Ye() {
1106
1167
  const e = /* @__PURE__ */ new Date();
1107
1168
  return new Date(e.getFullYear(), e.getMonth(), e.getDate());
1108
1169
  }
1109
- function pa(e, t) {
1110
- const a = X(e), r = (a.getDay() - t + 7) % 7, o = O(a, -r);
1111
- return Array.from({ length: 42 }, (c, d) => O(o, d));
1170
+ function Da(e, t) {
1171
+ const n = se(e), r = (n.getDay() - t + 7) % 7, l = ie(n, -r);
1172
+ return Array.from({ length: 42 }, (s, d) => ie(l, d));
1112
1173
  }
1113
- function ha(e, t) {
1174
+ function xa(e, t) {
1114
1175
  return new Intl.DateTimeFormat(t, { month: "long", year: "numeric" }).format(e);
1115
1176
  }
1116
- function ma(e) {
1117
- return Array.from({ length: 12 }, (t, a) => ({
1118
- label: new Intl.DateTimeFormat(e, { month: "long" }).format(new Date(2024, a, 1)),
1119
- value: a
1177
+ function Ma(e) {
1178
+ return Array.from({ length: 12 }, (t, n) => ({
1179
+ label: new Intl.DateTimeFormat(e, { month: "long" }).format(new Date(2024, n, 1)),
1180
+ value: n
1120
1181
  }));
1121
1182
  }
1122
- function tt(e, t) {
1183
+ function nt(e, t) {
1123
1184
  return new Intl.DateTimeFormat(t, {
1124
1185
  month: "short",
1125
1186
  day: "numeric",
1126
1187
  year: "numeric"
1127
1188
  }).format(e);
1128
1189
  }
1129
- function ga(e, t) {
1190
+ function $a(e, t) {
1130
1191
  return new Intl.DateTimeFormat(t, {
1131
1192
  weekday: "long",
1132
1193
  month: "long",
@@ -1134,231 +1195,231 @@ function ga(e, t) {
1134
1195
  year: "numeric"
1135
1196
  }).format(e);
1136
1197
  }
1137
- function fa(e, t) {
1138
- const a = new Date(2024, 0, 7);
1139
- return Array.from({ length: 7 }, (r, o) => {
1140
- const c = O(a, e + o);
1141
- return ua.formatToParts(c).length ? new Intl.DateTimeFormat(t, { weekday: "short" }).format(c) : "";
1198
+ function wa(e, t) {
1199
+ const n = new Date(2024, 0, 7);
1200
+ return Array.from({ length: 7 }, (r, l) => {
1201
+ const s = ie(n, e + l);
1202
+ return ka.formatToParts(s).length ? new Intl.DateTimeFormat(t, { weekday: "short" }).format(s) : "";
1142
1203
  });
1143
1204
  }
1144
- function at(e, t) {
1145
- return !!(e && t && M(e) === M(t));
1205
+ function rt(e, t) {
1206
+ return !!(e && t && K(e) === K(t));
1146
1207
  }
1147
- function _t(e, t) {
1208
+ function yt(e, t) {
1148
1209
  return !!(t && e.getTime() < t.getTime());
1149
1210
  }
1150
- function yt(e, t) {
1211
+ function vt(e, t) {
1151
1212
  return !!(t && e.getTime() > t.getTime());
1152
1213
  }
1153
- function Tt(e, t) {
1214
+ function jt(e, t) {
1154
1215
  return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth();
1155
1216
  }
1156
- function vt(e, t, a) {
1157
- const r = X(e), o = Ue(e);
1158
- return !!(t && o < t || a && r > a);
1217
+ function Nt(e, t, n) {
1218
+ const r = se(e), l = Re(e);
1219
+ return !!(t && l < t || n && r > n);
1159
1220
  }
1160
- function ba(e, t, a) {
1161
- return t && Ue(e) < t ? X(t) : a && X(e) > a ? X(a) : X(e);
1221
+ function Pa(e, t, n) {
1222
+ return t && Re(e) < t ? se(t) : n && se(e) > n ? se(n) : se(e);
1162
1223
  }
1163
- function _a(e, t, a, r) {
1164
- const o = X(e), c = Ue(e);
1224
+ function Fa(e, t, n, r) {
1225
+ const l = se(e), s = Re(e);
1165
1226
  let d = new Date(
1166
- o.getFullYear(),
1167
- o.getMonth(),
1168
- Math.min(t.getDate(), c.getDate())
1227
+ l.getFullYear(),
1228
+ l.getMonth(),
1229
+ Math.min(t.getDate(), s.getDate())
1169
1230
  );
1170
- return a && d < a && (d = Tt(a, o) ? a : o), r && d > r && (d = Tt(r, o) ? r : c), d;
1231
+ return n && d < n && (d = jt(n, l) ? n : l), r && d > r && (d = jt(r, l) ? r : s), d;
1171
1232
  }
1172
- function ya(e, t, a, r) {
1173
- const o = e.getFullYear(), c = Math.min(o, r.getFullYear() - 100), d = Math.max(o, r.getFullYear() + 20), g = (t == null ? void 0 : t.getFullYear()) ?? c, v = (a == null ? void 0 : a.getFullYear()) ?? d, u = Math.min(g, v, o), h = Math.max(g, v, o);
1174
- return Array.from({ length: h - u + 1 }, (f, x) => u + x);
1233
+ function Ia(e, t, n, r) {
1234
+ const l = e.getFullYear(), s = Math.min(l, r.getFullYear() - 100), d = Math.max(l, r.getFullYear() + 20), m = (t == null ? void 0 : t.getFullYear()) ?? s, y = (n == null ? void 0 : n.getFullYear()) ?? d, b = Math.min(m, y, l), u = Math.max(m, y, l);
1235
+ return Array.from({ length: u - b + 1 }, (v, N) => b + N);
1175
1236
  }
1176
- function va(e, t, a) {
1177
- return !!(t && a && e > t && e < a);
1237
+ function Ya(e, t, n) {
1238
+ return !!(t && n && e > t && e < n);
1178
1239
  }
1179
- function Na(e, t) {
1240
+ function Ca(e, t) {
1180
1241
  return !e && !t ? {} : e && t && t < e ? {
1181
- start: M(t),
1182
- end: M(e)
1242
+ start: K(t),
1243
+ end: K(e)
1183
1244
  } : {
1184
- start: M(e),
1185
- end: M(t)
1245
+ start: K(e),
1246
+ end: K(t)
1186
1247
  };
1187
1248
  }
1188
- function Nt(e) {
1249
+ function kt(e) {
1189
1250
  return typeof e.value == "function" ? e.value() : e.value;
1190
1251
  }
1191
- function rt(e) {
1252
+ function it(e) {
1192
1253
  return {
1193
- startDate: lt(e == null ? void 0 : e.start),
1194
- endDate: lt(e == null ? void 0 : e.end)
1254
+ startDate: st(e == null ? void 0 : e.start),
1255
+ endDate: st(e == null ? void 0 : e.end)
1195
1256
  };
1196
1257
  }
1197
- function Pt(e, t) {
1258
+ function Ht(e, t) {
1198
1259
  return !!(e != null && e.start && (e != null && e.end) && e.start === (t == null ? void 0 : t.start) && e.end === (t == null ? void 0 : t.end));
1199
1260
  }
1200
- function ka(e, t, a) {
1201
- const { startDate: r, endDate: o } = rt(e);
1202
- return r && o ? `${tt(r, a)} - ${tt(o, a)}` : r ? `${tt(r, a)} -` : o ? `- ${tt(o, a)}` : t;
1261
+ function Sa(e, t, n) {
1262
+ const { startDate: r, endDate: l } = it(e);
1263
+ return r && l ? `${nt(r, n)} - ${nt(l, n)}` : r ? `${nt(r, n)} -` : l ? `- ${nt(l, n)}` : t;
1203
1264
  }
1204
- const xa = Ne(
1265
+ const Ta = oe(
1205
1266
  ({
1206
1267
  label: e,
1207
1268
  value: t,
1208
- defaultValue: a,
1269
+ defaultValue: n,
1209
1270
  onValueChange: r,
1210
- presets: o = [],
1211
- customLabel: c = "Custom",
1271
+ presets: l = [],
1272
+ customLabel: s = "Custom",
1212
1273
  showCustom: d = !0,
1213
- presetColumns: g = "auto",
1214
- placeholder: v = "Select range",
1215
- helperText: u,
1216
- isError: h = !1,
1217
- errorMessage: f,
1218
- min: x,
1219
- max: R,
1220
- nameStart: T,
1221
- nameEnd: k,
1222
- disabled: w = !1,
1223
- readOnly: A = !1,
1224
- required: I = !1,
1225
- locale: C,
1226
- weekStartsOn: P = 0,
1227
- className: U,
1228
- id: he,
1229
- style: Ie,
1230
- ...me
1231
- }, $e) => {
1232
- const oe = Qe(), le = he ?? oe, ee = `${le}-label`, se = `${le}-panel`, Be = `${le}-helper`, Re = `${le}-error`, ze = t !== void 0, [We, Z] = G(a ?? {}), [Y, ke] = G(!1), N = ze ? t : We, { startDate: B, endDate: j } = rt(N), L = Ee(we, []), $ = lt(x), V = lt(R), [S, J] = G(() => X(B ?? L)), [ge, te] = G(() => B ?? L), fe = ne(null), xe = ne({}), Ce = ne(!1), qe = pa(S, P), q = fa(P, C), F = Ee(() => ma(C), [C]), Oe = ya(S, $, V, L), ie = o.length > 0, E = ie ? d : !0, D = g === "auto" ? void 0 : {
1233
- "--p-date-range-picker-preset-columns": String(g)
1234
- }, Q = !!(N != null && N.start && (N != null && N.end)), ce = h && f ? Re : u ? Be : void 0, Fe = ka(N, v, C), z = ie ? o.some((l) => Pt(Nt(l), N)) : !1, De = Y || !!(Q && !z), be = st(S, -1), _e = st(S, 1), Ae = vt(be, $, V), de = vt(_e, $, V);
1235
- Me(() => {
1236
- var l;
1237
- Y && Ce.current && ((l = xe.current[M(ge)]) == null || l.focus(), Ce.current = !1);
1238
- }, [ge, Y, S]);
1239
- const ye = (l, b) => {
1240
- const { startDate: K, endDate: ve } = rt(l), ae = Na(K, ve);
1241
- ze || Z(ae);
1242
- const Se = rt(ae);
1243
- Se.startDate && J(X(Se.startDate)), r == null || r(ae, {
1244
- startDate: Se.startDate,
1245
- endDate: Se.endDate,
1246
- source: b
1274
+ presetColumns: m = "auto",
1275
+ placeholder: y = "Select range",
1276
+ helperText: b,
1277
+ isError: u = !1,
1278
+ errorMessage: v,
1279
+ min: N,
1280
+ max: F,
1281
+ nameStart: k,
1282
+ nameEnd: g,
1283
+ disabled: $ = !1,
1284
+ readOnly: j = !1,
1285
+ required: B = !1,
1286
+ locale: A,
1287
+ weekStartsOn: I = 0,
1288
+ className: T,
1289
+ id: V,
1290
+ style: S,
1291
+ ...z
1292
+ }, ee) => {
1293
+ const O = Oe(), X = V ?? O, p = `${X}-label`, M = `${X}-panel`, x = `${X}-helper`, W = `${X}-error`, pe = t !== void 0, [w, D] = re(n ?? {}), [H, he] = re(!1), Y = pe ? t : w, { startDate: R, endDate: te } = it(Y), Z = tt(Ye, []), G = st(N), J = st(F), [q, ce] = re(() => se(R ?? Z)), [De, be] = re(() => R ?? Z), xe = me(null), Fe = me({}), Se = me(!1), Xe = Da(q, I), le = wa(I, A), U = tt(() => Ma(A), [A]), Ze = Ia(q, G, J, Z), ge = l.length > 0, de = ge ? d : !0, L = m === "auto" ? void 0 : {
1294
+ "--p-date-range-picker-preset-columns": String(m)
1295
+ }, ue = !!(Y != null && Y.start && (Y != null && Y.end)), ye = u && v ? W : b ? x : void 0, Te = Sa(Y, y, A), Q = ge ? l.some((i) => Ht(kt(i), Y)) : !1, Ie = H || !!(ue && !Q), Me = ot(q, -1), $e = ot(q, 1), je = Nt(Me, G, J), ve = Nt($e, G, J);
1296
+ Ce(() => {
1297
+ var i;
1298
+ H && Se.current && ((i = Fe.current[K(De)]) == null || i.focus(), Se.current = !1);
1299
+ }, [De, H, q]);
1300
+ const we = (i, P) => {
1301
+ const { startDate: E, endDate: Pe } = it(i), _e = Ca(E, Pe);
1302
+ pe || D(_e);
1303
+ const Ae = it(_e);
1304
+ Ae.startDate && ce(se(Ae.startDate)), r == null || r(_e, {
1305
+ startDate: Ae.startDate,
1306
+ endDate: Ae.endDate,
1307
+ source: P
1247
1308
  });
1248
- }, Le = (l) => {
1249
- if (w || A)
1309
+ }, He = (i) => {
1310
+ if ($ || j)
1250
1311
  return;
1251
- const b = B ?? L;
1252
- fe.current = l, Ce.current = !0, te(b), J(X(b)), ke(!0);
1253
- }, ue = (l = !1) => {
1254
- var b;
1255
- ke(!1), l && ((b = fe.current) == null || b.focus());
1256
- }, Ye = (l) => {
1257
- const b = ba(l, $, V);
1258
- J(b), te(_a(b, ge, $, V));
1259
- }, Ke = (l) => {
1260
- const { value: b } = l.currentTarget;
1261
- Ye(new Date(S.getFullYear(), Number(b), 1));
1262
- }, Ge = (l) => {
1263
- const { value: b } = l.currentTarget;
1264
- Ye(new Date(Number(b), S.getMonth(), 1));
1265
- }, Xe = (l) => {
1266
- w || A || (ye(Nt(l), "preset"), ue());
1267
- }, s = (l) => {
1268
- if (!(w || A || _t(l, $) || yt(l, V))) {
1269
- if (!B || j) {
1270
- te(l), ye({ start: M(l), end: "" }, "calendar");
1312
+ const P = R ?? Z;
1313
+ xe.current = i, Se.current = !0, be(P), ce(se(P)), he(!0);
1314
+ }, Ne = (i = !1) => {
1315
+ var P;
1316
+ he(!1), i && ((P = xe.current) == null || P.focus());
1317
+ }, Be = (i) => {
1318
+ const P = Pa(i, G, J);
1319
+ ce(P), be(Fa(P, De, G, J));
1320
+ }, We = (i) => {
1321
+ const { value: P } = i.currentTarget;
1322
+ Be(new Date(q.getFullYear(), Number(P), 1));
1323
+ }, Je = (i) => {
1324
+ const { value: P } = i.currentTarget;
1325
+ Be(new Date(Number(P), q.getMonth(), 1));
1326
+ }, Qe = (i) => {
1327
+ $ || j || (we(kt(i), "preset"), Ne());
1328
+ }, o = (i) => {
1329
+ if (!($ || j || yt(i, G) || vt(i, J))) {
1330
+ if (!R || te) {
1331
+ be(i), we({ start: K(i), end: "" }, "calendar");
1271
1332
  return;
1272
1333
  }
1273
- te(l), ye({ start: M(B), end: M(l) }, "calendar"), ue(!0);
1334
+ be(i), we({ start: K(R), end: K(i) }, "calendar"), Ne(!0);
1274
1335
  }
1275
- }, y = (l) => {
1276
- _t(l, $) || yt(l, V) || (Ce.current = !0, te(l), J(X(l)));
1277
- }, H = (l) => (b) => {
1278
- if (b.key === "Escape") {
1279
- b.preventDefault(), ue(!0);
1336
+ }, C = (i) => {
1337
+ yt(i, G) || vt(i, J) || (Se.current = !0, be(i), ce(se(i)));
1338
+ }, ae = (i) => (P) => {
1339
+ if (P.key === "Escape") {
1340
+ P.preventDefault(), Ne(!0);
1280
1341
  return;
1281
1342
  }
1282
- const K = (l.getDay() - P + 7) % 7, ae = {
1283
- ArrowLeft: O(l, -1),
1284
- ArrowRight: O(l, 1),
1285
- ArrowUp: O(l, -7),
1286
- ArrowDown: O(l, 7),
1287
- Home: O(l, -K),
1288
- End: O(l, 6 - K),
1289
- PageUp: St(l, -1),
1290
- PageDown: St(l, 1)
1291
- }[b.key];
1292
- ae && (b.preventDefault(), y(ae));
1343
+ const E = (i.getDay() - I + 7) % 7, _e = {
1344
+ ArrowLeft: ie(i, -1),
1345
+ ArrowRight: ie(i, 1),
1346
+ ArrowUp: ie(i, -7),
1347
+ ArrowDown: ie(i, 7),
1348
+ Home: ie(i, -E),
1349
+ End: ie(i, 6 - E),
1350
+ PageUp: Kt(i, -1),
1351
+ PageDown: Kt(i, 1)
1352
+ }[P.key];
1353
+ _e && (P.preventDefault(), C(_e));
1293
1354
  };
1294
1355
  return /* @__PURE__ */ _(
1295
1356
  "div",
1296
1357
  {
1297
- ...me,
1298
- ref: $e,
1299
- id: le,
1300
- style: D ? { ...Ie, ...D } : Ie,
1301
- className: m(
1358
+ ...z,
1359
+ ref: ee,
1360
+ id: X,
1361
+ style: L ? { ...S, ...L } : S,
1362
+ className: h(
1302
1363
  "p-date-range-picker",
1303
- ie && "p-date-range-picker--with-presets",
1304
- h && "p-date-range-picker--error",
1305
- w && "p-date-range-picker--disabled",
1306
- U
1364
+ ge && "p-date-range-picker--with-presets",
1365
+ u && "p-date-range-picker--error",
1366
+ $ && "p-date-range-picker--disabled",
1367
+ T
1307
1368
  ),
1308
1369
  children: [
1309
- ie ? /* @__PURE__ */ _("div", { id: ee, className: "p-date-range-picker__label", children: [
1310
- /* @__PURE__ */ n("span", { children: e }),
1311
- /* @__PURE__ */ n(
1370
+ ge ? /* @__PURE__ */ _("div", { id: p, className: "p-date-range-picker__label", children: [
1371
+ /* @__PURE__ */ a("span", { children: e }),
1372
+ /* @__PURE__ */ a(
1312
1373
  "span",
1313
1374
  {
1314
- className: m(
1375
+ className: h(
1315
1376
  "p-date-range-picker__label-value",
1316
- !Q && "p-date-range-picker__label-value--empty"
1377
+ !ue && "p-date-range-picker__label-value--empty"
1317
1378
  ),
1318
- children: Fe
1379
+ children: Te
1319
1380
  }
1320
1381
  )
1321
1382
  ] }) : null,
1322
- ie ? /* @__PURE__ */ _(
1383
+ ge ? /* @__PURE__ */ _(
1323
1384
  "div",
1324
1385
  {
1325
- "aria-describedby": ce,
1326
- "aria-labelledby": ee,
1327
- className: m(
1386
+ "aria-describedby": ye,
1387
+ "aria-labelledby": p,
1388
+ className: h(
1328
1389
  "p-date-range-picker__presets",
1329
- g !== "auto" && "p-date-range-picker__presets--fixed"
1390
+ m !== "auto" && "p-date-range-picker__presets--fixed"
1330
1391
  ),
1331
1392
  role: "group",
1332
1393
  children: [
1333
- o.map((l) => {
1334
- const b = Nt(l), K = Pt(b, N);
1335
- return /* @__PURE__ */ n(
1394
+ l.map((i) => {
1395
+ const P = kt(i), E = Ht(P, Y);
1396
+ return /* @__PURE__ */ a(
1336
1397
  "button",
1337
1398
  {
1338
1399
  type: "button",
1339
- className: m("p-date-range-picker__preset", K && "p-date-range-picker__preset--active"),
1340
- disabled: w,
1341
- "aria-pressed": K,
1342
- onClick: () => Xe(l),
1343
- children: l.label
1400
+ className: h("p-date-range-picker__preset", E && "p-date-range-picker__preset--active"),
1401
+ disabled: $,
1402
+ "aria-pressed": E,
1403
+ onClick: () => Qe(i),
1404
+ children: i.label
1344
1405
  },
1345
- l.label
1406
+ i.label
1346
1407
  );
1347
1408
  }),
1348
- E ? /* @__PURE__ */ n(
1409
+ de ? /* @__PURE__ */ a(
1349
1410
  "button",
1350
1411
  {
1351
1412
  type: "button",
1352
- className: m(
1413
+ className: h(
1353
1414
  "p-date-range-picker__preset",
1354
- De && "p-date-range-picker__preset--active"
1415
+ Ie && "p-date-range-picker__preset--active"
1355
1416
  ),
1356
- disabled: w,
1357
- "aria-controls": se,
1358
- "aria-expanded": Y,
1359
- "aria-pressed": De,
1360
- onClick: (l) => Y ? ue(!0) : Le(l.currentTarget),
1361
- children: c
1417
+ disabled: $,
1418
+ "aria-controls": M,
1419
+ "aria-expanded": H,
1420
+ "aria-pressed": Ie,
1421
+ onClick: (i) => H ? Ne(!0) : He(i.currentTarget),
1422
+ children: s
1362
1423
  }
1363
1424
  ) : null
1364
1425
  ]
@@ -1367,316 +1428,853 @@ const xa = Ne(
1367
1428
  "button",
1368
1429
  {
1369
1430
  type: "button",
1370
- className: m(
1431
+ className: h(
1371
1432
  "p-date-range-picker__trigger",
1372
- !Q && "p-date-range-picker__trigger--empty",
1373
- Q && "p-date-range-picker__trigger--filled",
1374
- Y && "p-date-range-picker__trigger--open"
1433
+ !ue && "p-date-range-picker__trigger--empty",
1434
+ ue && "p-date-range-picker__trigger--filled",
1435
+ H && "p-date-range-picker__trigger--open"
1375
1436
  ),
1376
- disabled: w,
1377
- "aria-controls": se,
1378
- "aria-describedby": ce,
1379
- "aria-expanded": Y,
1437
+ disabled: $,
1438
+ "aria-controls": M,
1439
+ "aria-describedby": ye,
1440
+ "aria-expanded": H,
1380
1441
  "aria-haspopup": "dialog",
1381
- "aria-label": `${e}: ${Fe}`,
1382
- onClick: (l) => Y ? ue(!0) : Le(l.currentTarget),
1442
+ "aria-label": `${e}: ${Te}`,
1443
+ onClick: (i) => H ? Ne(!0) : He(i.currentTarget),
1383
1444
  children: [
1384
- /* @__PURE__ */ n(
1445
+ /* @__PURE__ */ a(
1385
1446
  "span",
1386
1447
  {
1387
- id: ee,
1388
- className: m(
1448
+ id: p,
1449
+ className: h(
1389
1450
  "p-date-range-picker__trigger-label p-date-range-picker__trigger-floating-label",
1390
- h && "p-date-range-picker__trigger-label--error"
1451
+ u && "p-date-range-picker__trigger-label--error"
1391
1452
  ),
1392
1453
  "aria-hidden": "true",
1393
1454
  children: e
1394
1455
  }
1395
1456
  ),
1396
- /* @__PURE__ */ n(
1457
+ /* @__PURE__ */ a(
1397
1458
  "span",
1398
1459
  {
1399
- className: m(
1460
+ className: h(
1400
1461
  "p-date-range-picker__trigger-label p-date-range-picker__trigger-placeholder-label",
1401
- h && "p-date-range-picker__trigger-label--error"
1462
+ u && "p-date-range-picker__trigger-label--error"
1402
1463
  ),
1403
1464
  "aria-hidden": "true",
1404
1465
  children: e
1405
1466
  }
1406
1467
  ),
1407
- /* @__PURE__ */ n("span", { className: "p-date-range-picker__trigger-value", children: Fe }),
1408
- /* @__PURE__ */ n("span", { className: "p-date-range-picker__trigger-icon", children: /* @__PURE__ */ n(Rt, {}) })
1468
+ /* @__PURE__ */ a("span", { className: "p-date-range-picker__trigger-value", children: Te }),
1469
+ /* @__PURE__ */ a("span", { className: "p-date-range-picker__trigger-icon", children: /* @__PURE__ */ a(qt, {}) })
1409
1470
  ]
1410
1471
  }
1411
1472
  ),
1412
- /* @__PURE__ */ n("input", { type: "hidden", name: T, value: (N == null ? void 0 : N.start) ?? "", required: I }),
1413
- /* @__PURE__ */ n("input", { type: "hidden", name: k, value: (N == null ? void 0 : N.end) ?? "", required: I }),
1414
- Y && /* @__PURE__ */ _(
1473
+ /* @__PURE__ */ a("input", { type: "hidden", name: k, value: (Y == null ? void 0 : Y.start) ?? "", required: B }),
1474
+ /* @__PURE__ */ a("input", { type: "hidden", name: g, value: (Y == null ? void 0 : Y.end) ?? "", required: B }),
1475
+ H && /* @__PURE__ */ _(
1415
1476
  "div",
1416
1477
  {
1417
- id: se,
1478
+ id: M,
1418
1479
  className: "p-date-range-picker__panel",
1419
1480
  role: "dialog",
1420
- "aria-labelledby": `${se}-title`,
1421
- onKeyDown: (l) => {
1422
- l.key === "Escape" && ue();
1481
+ "aria-labelledby": `${M}-title`,
1482
+ onKeyDown: (i) => {
1483
+ i.key === "Escape" && Ne();
1423
1484
  },
1424
1485
  children: [
1425
1486
  /* @__PURE__ */ _("div", { className: "p-date-range-picker__calendar-header", children: [
1426
- /* @__PURE__ */ n(
1487
+ /* @__PURE__ */ a(
1427
1488
  "button",
1428
1489
  {
1429
1490
  type: "button",
1430
1491
  className: "p-date-range-picker__nav",
1431
1492
  "aria-label": "Previous month",
1432
- disabled: Ae,
1433
- onClick: () => Ye(be),
1434
- children: /* @__PURE__ */ n(At, {})
1493
+ disabled: je,
1494
+ onClick: () => Be(Me),
1495
+ children: /* @__PURE__ */ a(Pt, {})
1435
1496
  }
1436
1497
  ),
1437
1498
  /* @__PURE__ */ _("div", { className: "p-date-range-picker__month", children: [
1438
- /* @__PURE__ */ n("span", { id: `${se}-title`, className: "p-date-range-picker__month-label", children: ha(S, C) }),
1439
- /* @__PURE__ */ n(
1499
+ /* @__PURE__ */ a("span", { id: `${M}-title`, className: "p-date-range-picker__month-label", children: xa(q, A) }),
1500
+ /* @__PURE__ */ a(
1440
1501
  "select",
1441
1502
  {
1442
1503
  className: "p-date-range-picker__month-select p-date-range-picker__calendar-select",
1443
1504
  "aria-label": "Month",
1444
- value: S.getMonth(),
1445
- onChange: Ke,
1446
- children: F.map((l) => /* @__PURE__ */ n(
1505
+ value: q.getMonth(),
1506
+ onChange: We,
1507
+ children: U.map((i) => /* @__PURE__ */ a(
1447
1508
  "option",
1448
1509
  {
1449
- value: l.value,
1450
- disabled: vt(new Date(S.getFullYear(), l.value, 1), $, V),
1451
- children: l.label
1510
+ value: i.value,
1511
+ disabled: Nt(new Date(q.getFullYear(), i.value, 1), G, J),
1512
+ children: i.label
1452
1513
  },
1453
- l.value
1514
+ i.value
1454
1515
  ))
1455
1516
  }
1456
1517
  ),
1457
- /* @__PURE__ */ n(
1518
+ /* @__PURE__ */ a(
1458
1519
  "select",
1459
1520
  {
1460
1521
  className: "p-date-range-picker__year-select p-date-range-picker__calendar-select",
1461
1522
  "aria-label": "Year",
1462
- value: S.getFullYear(),
1463
- onChange: Ge,
1464
- children: Oe.map((l) => /* @__PURE__ */ n("option", { value: l, children: l }, l))
1523
+ value: q.getFullYear(),
1524
+ onChange: Je,
1525
+ children: Ze.map((i) => /* @__PURE__ */ a("option", { value: i, children: i }, i))
1465
1526
  }
1466
1527
  )
1467
1528
  ] }),
1468
- /* @__PURE__ */ n(
1529
+ /* @__PURE__ */ a(
1469
1530
  "button",
1470
1531
  {
1471
1532
  type: "button",
1472
1533
  className: "p-date-range-picker__nav",
1473
1534
  "aria-label": "Next month",
1474
- disabled: de,
1475
- onClick: () => Ye(_e),
1476
- children: /* @__PURE__ */ n(Lt, {})
1535
+ disabled: ve,
1536
+ onClick: () => Be($e),
1537
+ children: /* @__PURE__ */ a(Ft, {})
1477
1538
  }
1478
1539
  )
1479
1540
  ] }),
1480
- /* @__PURE__ */ n("div", { className: "p-date-range-picker__weekdays", "aria-hidden": "true", children: q.map((l) => /* @__PURE__ */ n("span", { children: l }, l)) }),
1481
- /* @__PURE__ */ n("div", { className: "p-date-range-picker__grid", role: "grid", "aria-labelledby": `${se}-title`, children: qe.map((l) => {
1482
- const b = M(l), K = l.getMonth() !== S.getMonth(), ve = at(l, B), ae = at(l, j), Se = va(l, B, j), ct = at(l, L), dt = _t(l, $) || yt(l, V);
1483
- return /* @__PURE__ */ n(
1541
+ /* @__PURE__ */ a("div", { className: "p-date-range-picker__weekdays", "aria-hidden": "true", children: le.map((i) => /* @__PURE__ */ a("span", { children: i }, i)) }),
1542
+ /* @__PURE__ */ a("div", { className: "p-date-range-picker__grid", role: "grid", "aria-labelledby": `${M}-title`, children: Xe.map((i) => {
1543
+ const P = K(i), E = i.getMonth() !== q.getMonth(), Pe = rt(i, R), _e = rt(i, te), Ae = Ya(i, R, te), dt = rt(i, Z), ut = yt(i, G) || vt(i, J);
1544
+ return /* @__PURE__ */ a(
1484
1545
  "button",
1485
1546
  {
1486
- ref: (ut) => {
1487
- xe.current[b] = ut;
1547
+ ref: (pt) => {
1548
+ Fe.current[P] = pt;
1488
1549
  },
1489
1550
  type: "button",
1490
1551
  role: "gridcell",
1491
- "data-date": b,
1492
- className: m(
1552
+ "data-date": P,
1553
+ className: h(
1493
1554
  "p-date-range-picker__day",
1494
- K && "p-date-range-picker__day--outside",
1495
- ct && "p-date-range-picker__day--today",
1496
- Se && "p-date-range-picker__day--in-range",
1497
- (ve || ae) && "p-date-range-picker__day--selected"
1555
+ E && "p-date-range-picker__day--outside",
1556
+ dt && "p-date-range-picker__day--today",
1557
+ Ae && "p-date-range-picker__day--in-range",
1558
+ (Pe || _e) && "p-date-range-picker__day--selected"
1498
1559
  ),
1499
- disabled: dt,
1500
- "aria-label": ga(l, C),
1501
- "aria-selected": ve || ae,
1502
- tabIndex: at(l, ge) ? 0 : -1,
1503
- onClick: () => s(l),
1504
- onKeyDown: H(l),
1505
- children: l.getDate()
1560
+ disabled: ut,
1561
+ "aria-label": $a(i, A),
1562
+ "aria-selected": Pe || _e,
1563
+ tabIndex: rt(i, De) ? 0 : -1,
1564
+ onClick: () => o(i),
1565
+ onKeyDown: ae(i),
1566
+ children: i.getDate()
1506
1567
  },
1507
- b
1568
+ P
1508
1569
  );
1509
1570
  }) })
1510
1571
  ]
1511
1572
  }
1512
1573
  ),
1513
- h && f ? /* @__PURE__ */ n("p", { id: Re, role: "alert", className: "p-date-range-picker__message p-date-range-picker__message--error", children: f }) : null,
1514
- !h && u ? /* @__PURE__ */ n("p", { id: Be, className: "p-date-range-picker__message", children: u }) : null
1574
+ u && v ? /* @__PURE__ */ a("p", { id: W, role: "alert", className: "p-date-range-picker__message p-date-range-picker__message--error", children: v }) : null,
1575
+ !u && b ? /* @__PURE__ */ a("p", { id: x, className: "p-date-range-picker__message", children: b }) : null
1515
1576
  ]
1516
1577
  }
1517
1578
  );
1518
1579
  }
1519
1580
  );
1520
- xa.displayName = "PDateRangePicker";
1521
- const Ra = {
1581
+ Ta.displayName = "PDateRangePicker";
1582
+ const an = {
1522
1583
  thisWeek: {
1523
1584
  label: "This week",
1524
1585
  value: () => {
1525
- const e = we(), t = O(e, -e.getDay());
1586
+ const e = Ye(), t = ie(e, -e.getDay());
1526
1587
  return {
1527
- start: M(t),
1528
- end: M(O(t, 6))
1588
+ start: K(t),
1589
+ end: K(ie(t, 6))
1529
1590
  };
1530
1591
  }
1531
1592
  },
1532
1593
  last7Days: {
1533
1594
  label: "Last 7 days",
1534
1595
  value: () => {
1535
- const e = we();
1596
+ const e = Ye();
1536
1597
  return {
1537
- start: M(O(e, -6)),
1538
- end: M(e)
1598
+ start: K(ie(e, -6)),
1599
+ end: K(e)
1539
1600
  };
1540
1601
  }
1541
1602
  },
1542
1603
  last14Days: {
1543
1604
  label: "Last 14 days",
1544
1605
  value: () => {
1545
- const e = we();
1606
+ const e = Ye();
1546
1607
  return {
1547
- start: M(O(e, -13)),
1548
- end: M(e)
1608
+ start: K(ie(e, -13)),
1609
+ end: K(e)
1549
1610
  };
1550
1611
  }
1551
1612
  },
1552
1613
  last30Days: {
1553
1614
  label: "Last 30 days",
1554
1615
  value: () => {
1555
- const e = we();
1616
+ const e = Ye();
1556
1617
  return {
1557
- start: M(O(e, -29)),
1558
- end: M(e)
1618
+ start: K(ie(e, -29)),
1619
+ end: K(e)
1559
1620
  };
1560
1621
  }
1561
1622
  },
1562
1623
  thisMonth: {
1563
1624
  label: "This month",
1564
1625
  value: () => {
1565
- const e = we(), t = X(e), a = Ue(e);
1626
+ const e = Ye(), t = se(e), n = Re(e);
1566
1627
  return {
1567
- start: M(t),
1568
- end: M(a)
1628
+ start: K(t),
1629
+ end: K(n)
1569
1630
  };
1570
1631
  }
1571
1632
  },
1572
1633
  lastMonth: {
1573
1634
  label: "Last month",
1574
1635
  value: () => {
1575
- const e = we(), t = st(e, -1);
1636
+ const e = Ye(), t = ot(e, -1);
1576
1637
  return {
1577
- start: M(X(t)),
1578
- end: M(Ue(t))
1638
+ start: K(se(t)),
1639
+ end: K(Re(t))
1579
1640
  };
1580
1641
  }
1581
1642
  },
1582
1643
  monthToDate: {
1583
1644
  label: "Month to date",
1584
1645
  value: () => {
1585
- const e = we(), t = X(e);
1646
+ const e = Ye(), t = se(e);
1586
1647
  return {
1587
- start: M(t),
1588
- end: M(e)
1648
+ start: K(t),
1649
+ end: K(e)
1589
1650
  };
1590
1651
  }
1591
1652
  },
1592
1653
  yearToDate: {
1593
1654
  label: "Year to date",
1594
1655
  value: () => {
1595
- const e = we();
1656
+ const e = Ye();
1596
1657
  return {
1597
- start: M(new Date(e.getFullYear(), 0, 1)),
1598
- end: M(e)
1658
+ start: K(new Date(e.getFullYear(), 0, 1)),
1659
+ end: K(e)
1599
1660
  };
1600
1661
  }
1601
1662
  }
1602
- }, Da = Ne(
1663
+ }, Ba = oe(
1603
1664
  ({
1604
1665
  as: e = "span",
1605
1666
  variant: t = "primary",
1606
- appearance: a = "text",
1667
+ appearance: n = "text",
1607
1668
  color: r,
1608
- textColor: o,
1609
- children: c,
1669
+ textColor: l,
1670
+ children: s,
1610
1671
  className: d,
1611
- style: g,
1612
- ...v
1613
- }, u) => {
1614
- const h = {
1615
- ...g,
1672
+ style: m,
1673
+ ...y
1674
+ }, b) => {
1675
+ const u = {
1676
+ ...m,
1616
1677
  ...r ? { "--p-highlight-color": r, "--p-highlight-bg": r } : {},
1617
- ...o ? { "--p-highlight-text": o } : {}
1678
+ ...l ? { "--p-highlight-text": l } : {}
1618
1679
  };
1619
- return /* @__PURE__ */ n(
1680
+ return /* @__PURE__ */ a(
1620
1681
  e,
1621
1682
  {
1622
- ...v,
1623
- ref: u,
1624
- className: m(
1683
+ ...y,
1684
+ ref: b,
1685
+ className: h(
1625
1686
  "p-highlight",
1626
1687
  `p-highlight--${t}`,
1627
- a === "background" && "p-highlight--background",
1688
+ n === "background" && "p-highlight--background",
1628
1689
  d
1629
1690
  ),
1630
- style: h,
1631
- children: c
1691
+ style: u,
1692
+ children: s
1632
1693
  }
1633
1694
  );
1634
1695
  }
1635
1696
  );
1636
- Da.displayName = "PHighlight";
1637
- const wa = Ne(
1697
+ Ba.displayName = "PHighlight";
1698
+ const Aa = oe(
1638
1699
  ({
1639
1700
  children: e,
1640
1701
  ariaLabel: t = "Horizontal content",
1641
- gap: a,
1702
+ gap: n,
1642
1703
  snap: r = !0,
1643
- className: o,
1644
- scrollerClassName: c,
1704
+ className: l,
1705
+ scrollerClassName: s,
1645
1706
  listClassName: d,
1646
- itemClassName: g,
1647
- style: v,
1648
- ...u
1649
- }, h) => {
1650
- const f = {
1651
- ...v,
1652
- ...a ? { "--p-horizontal-slider-gap": a } : {}
1707
+ itemClassName: m,
1708
+ style: y,
1709
+ ...b
1710
+ }, u) => {
1711
+ const v = {
1712
+ ...y,
1713
+ ...n ? { "--p-horizontal-slider-gap": n } : {}
1653
1714
  };
1654
- return /* @__PURE__ */ n(
1715
+ return /* @__PURE__ */ a(
1655
1716
  "div",
1656
1717
  {
1657
- ...u,
1658
- ref: h,
1659
- className: m("p-horizontal-slider", !r && "p-horizontal-slider--no-snap", o),
1660
- style: f,
1661
- children: /* @__PURE__ */ n(
1718
+ ...b,
1719
+ ref: u,
1720
+ className: h("p-horizontal-slider", !r && "p-horizontal-slider--no-snap", l),
1721
+ style: v,
1722
+ children: /* @__PURE__ */ a(
1662
1723
  "div",
1663
1724
  {
1664
1725
  "aria-label": t,
1665
- className: m("p-horizontal-slider__scroller", c),
1726
+ className: h("p-horizontal-slider__scroller", s),
1666
1727
  role: "region",
1667
1728
  tabIndex: 0,
1668
- children: /* @__PURE__ */ n("ul", { className: m("p-horizontal-slider__list", d), children: Kt.map(e, (x) => /* @__PURE__ */ n("li", { className: m("p-horizontal-slider__item", g), children: x })) })
1729
+ children: /* @__PURE__ */ a("ul", { className: h("p-horizontal-slider__list", d), children: Xt.map(e, (N) => /* @__PURE__ */ a("li", { className: h("p-horizontal-slider__item", m), children: N })) })
1669
1730
  }
1670
1731
  )
1671
1732
  }
1672
1733
  );
1673
1734
  }
1674
1735
  );
1675
- wa.displayName = "PHorizontalSlider";
1676
- function Aa({ title: e }) {
1677
- return /* @__PURE__ */ n(jt, { className: "pt-2 border-t border-white text-white", children: /* @__PURE__ */ n(ot, { className: "uppercase", variant: "body-wide", children: e }) });
1736
+ Aa.displayName = "PHorizontalSlider";
1737
+ function Va() {
1738
+ return /* @__PURE__ */ a("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "m5 8 5 5 5-5" }) });
1739
+ }
1740
+ function Gt(e) {
1741
+ return Array.isArray(e) ? e[0] ?? "" : e ?? "";
1742
+ }
1743
+ const Ot = oe(
1744
+ ({
1745
+ className: e,
1746
+ selectClassName: t,
1747
+ label: n,
1748
+ options: r,
1749
+ placeholder: l = "Select an option",
1750
+ helperText: s,
1751
+ id: d,
1752
+ isError: m = !1,
1753
+ errorMessage: y,
1754
+ density: b = "standard",
1755
+ variant: u = "floating",
1756
+ hideLabel: v = !1,
1757
+ disabled: N,
1758
+ required: F,
1759
+ value: k,
1760
+ defaultValue: g,
1761
+ onChange: $,
1762
+ onValueChange: j,
1763
+ style: B,
1764
+ ...A
1765
+ }, I) => {
1766
+ const T = Oe(), V = d ?? T, S = `${V}-error`, z = `${V}-helper`, ee = k !== void 0, [O, X] = re(Gt(g)), M = Gt(ee ? k : O) !== "", x = [
1767
+ m && y ? S : null,
1768
+ !m && s ? z : null
1769
+ ].filter(Boolean).join(" ") || void 0, W = r.reduce(
1770
+ (w, D) => {
1771
+ const H = D.group ?? null, he = w.find((Y) => Y.group === H);
1772
+ return he ? (he.options.push(D), w) : (w.push({ group: H, options: [D] }), w);
1773
+ },
1774
+ []
1775
+ ), pe = (w) => {
1776
+ const { value: D } = w.currentTarget;
1777
+ ee || X(D), $ == null || $(w), j == null || j(
1778
+ D,
1779
+ r.find((H) => String(H.value) === D) ?? null
1780
+ );
1781
+ };
1782
+ return /* @__PURE__ */ _(
1783
+ "div",
1784
+ {
1785
+ className: h(
1786
+ "p-select",
1787
+ `p-select--${b}`,
1788
+ `p-select--${u}`,
1789
+ M && "p-select--filled",
1790
+ m && "p-select--error",
1791
+ N && "p-select--disabled",
1792
+ e
1793
+ ),
1794
+ style: B,
1795
+ children: [
1796
+ /* @__PURE__ */ _("div", { className: "p-select__field", children: [
1797
+ /* @__PURE__ */ _(
1798
+ "select",
1799
+ {
1800
+ ...A,
1801
+ id: V,
1802
+ ref: I,
1803
+ value: k,
1804
+ defaultValue: k === void 0 ? g ?? "" : void 0,
1805
+ disabled: N,
1806
+ required: F,
1807
+ "aria-invalid": m || void 0,
1808
+ "aria-describedby": x,
1809
+ "aria-required": F,
1810
+ "aria-disabled": N,
1811
+ className: h("p-select__control", m && "p-select__control--error", t),
1812
+ onChange: pe,
1813
+ children: [
1814
+ l ? /* @__PURE__ */ a("option", { value: "", disabled: F, "aria-label": l, children: "" }) : null,
1815
+ W.map(
1816
+ (w) => w.group ? /* @__PURE__ */ a("optgroup", { label: w.group, children: w.options.map((D) => /* @__PURE__ */ a("option", { value: D.value, disabled: D.disabled, children: D.label }, String(D.value))) }, w.group) : w.options.map((D) => /* @__PURE__ */ a("option", { value: D.value, disabled: D.disabled, children: D.label }, String(D.value)))
1817
+ )
1818
+ ]
1819
+ }
1820
+ ),
1821
+ u === "floating" ? /* @__PURE__ */ _(wt, { children: [
1822
+ /* @__PURE__ */ a(
1823
+ "span",
1824
+ {
1825
+ "aria-hidden": "true",
1826
+ className: h(
1827
+ "p-select__label p-select__floating-label",
1828
+ v && "p-select__label--hidden",
1829
+ m && "p-select__label--error"
1830
+ ),
1831
+ children: n
1832
+ }
1833
+ ),
1834
+ /* @__PURE__ */ a(
1835
+ "label",
1836
+ {
1837
+ htmlFor: V,
1838
+ className: h("p-select__label p-select__placeholder-label", v && "p-select__label--hidden"),
1839
+ children: l || n
1840
+ }
1841
+ )
1842
+ ] }) : /* @__PURE__ */ a(
1843
+ "label",
1844
+ {
1845
+ htmlFor: V,
1846
+ className: h("p-select__label p-select__inline-label", v && "p-select__label--hidden"),
1847
+ children: n
1848
+ }
1849
+ ),
1850
+ /* @__PURE__ */ a("span", { className: "p-select__chevron", "aria-hidden": "true", children: /* @__PURE__ */ a(Va, {}) })
1851
+ ] }),
1852
+ m && y ? /* @__PURE__ */ a("p", { id: S, role: "alert", className: "p-select__message p-select__message--error", children: y }) : null,
1853
+ !m && s ? /* @__PURE__ */ a("p", { id: z, className: "p-select__message", children: s }) : null
1854
+ ]
1855
+ }
1856
+ );
1857
+ }
1858
+ );
1859
+ Ot.displayName = "PSelect";
1860
+ function $t(e, t) {
1861
+ return Number.isFinite(e) ? t ? Math.min(Math.max(1, Math.trunc(e)), Math.max(1, t)) : Math.max(1, Math.trunc(e)) : 1;
1862
+ }
1863
+ function qe(e, t) {
1864
+ return Array.from({ length: t - e + 1 }, (n, r) => e + r);
1865
+ }
1866
+ function La(e, t, n, r) {
1867
+ const l = Math.max(1, t), s = $t(e, l), d = Math.max(0, Math.trunc(n)), m = Math.max(1, Math.trunc(r)), y = m * 2 + d * 2 + 3;
1868
+ if (l <= y)
1869
+ return qe(1, l);
1870
+ const b = y - m - 1, u = qe(1, m), v = qe(l - m + 1, l), N = b, F = l - b + 1;
1871
+ if (s <= N - d)
1872
+ return [...qe(1, N), "ellipsis", ...v];
1873
+ if (s >= F + d)
1874
+ return [...u, "ellipsis", ...qe(F, l)];
1875
+ const k = s - d, g = s + d;
1876
+ return [
1877
+ ...u,
1878
+ "ellipsis",
1879
+ ...qe(k, g),
1880
+ "ellipsis",
1881
+ ...v
1882
+ ];
1883
+ }
1884
+ function Ka(e, t, n, r, l) {
1885
+ if (n !== void 0 && r) {
1886
+ if (n <= 0)
1887
+ return `No ${l}`;
1888
+ const s = (e - 1) * r + 1, d = Math.min(n, e * r);
1889
+ return `Showing ${s}-${d} of ${n} ${l}`;
1890
+ }
1891
+ return t ? `Page ${e} of ${t}` : `Page ${e}`;
1892
+ }
1893
+ function Dt({
1894
+ className: e,
1895
+ children: t,
1896
+ ...n
1897
+ }) {
1898
+ return /* @__PURE__ */ a("button", { ...n, type: "button", className: h("p-pagination__button", e), children: t });
1899
+ }
1900
+ const ja = oe(
1901
+ ({
1902
+ page: e,
1903
+ pageCount: t,
1904
+ totalItems: n,
1905
+ pageSize: r,
1906
+ pageSizeOptions: l,
1907
+ itemLabel: s = "items",
1908
+ density: d = "standard",
1909
+ siblingCount: m = 1,
1910
+ boundaryCount: y = 1,
1911
+ disabled: b = !1,
1912
+ isLoading: u = !1,
1913
+ hasPreviousPage: v,
1914
+ hasNextPage: N,
1915
+ showRowsPerPage: F = !0,
1916
+ onPageChange: k,
1917
+ onPageSizeChange: g,
1918
+ className: $,
1919
+ summary: j,
1920
+ ...B
1921
+ }, A) => {
1922
+ const I = t ? Math.max(1, Math.trunc(t)) : void 0, T = $t(e, I), V = b || u, S = !V && !!k, z = S && (v ?? T > 1), ee = S && (N ?? (I ? T < I : !0)), O = I ? La(T, I, m, y) : [], X = !!(F && r && (l != null && l.length) && g), p = j ?? Ka(T, I, n, r, s), M = (x) => {
1923
+ if (V)
1924
+ return;
1925
+ const W = $t(x, I);
1926
+ W === T && I || k == null || k(W);
1927
+ };
1928
+ return /* @__PURE__ */ _(
1929
+ "nav",
1930
+ {
1931
+ ...B,
1932
+ ref: A,
1933
+ className: h(
1934
+ "p-pagination",
1935
+ `p-pagination--${d}`,
1936
+ u && "p-pagination--loading",
1937
+ $
1938
+ ),
1939
+ "aria-label": B["aria-label"] ?? "Pagination",
1940
+ "aria-busy": u || void 0,
1941
+ children: [
1942
+ /* @__PURE__ */ a("div", { className: "p-pagination__summary", "aria-live": "polite", children: p }),
1943
+ /* @__PURE__ */ _("div", { className: "p-pagination__controls", children: [
1944
+ /* @__PURE__ */ _(
1945
+ Dt,
1946
+ {
1947
+ className: "p-pagination__button--previous",
1948
+ disabled: !z,
1949
+ "aria-label": "Go to previous page",
1950
+ onClick: () => M(T - 1),
1951
+ children: [
1952
+ /* @__PURE__ */ a(Pt, {}),
1953
+ /* @__PURE__ */ a("span", { children: "Previous" })
1954
+ ]
1955
+ }
1956
+ ),
1957
+ I ? /* @__PURE__ */ a("div", { className: "p-pagination__pages", "aria-label": "Pages", children: O.map(
1958
+ (x, W) => x === "ellipsis" ? /* @__PURE__ */ a("span", { className: "p-pagination__ellipsis", "aria-hidden": "true", children: "..." }, `ellipsis-${W}`) : /* @__PURE__ */ a(
1959
+ Dt,
1960
+ {
1961
+ className: h("p-pagination__page", x === T && "p-pagination__page--current"),
1962
+ "aria-label": `Go to page ${x}`,
1963
+ "aria-current": x === T ? "page" : void 0,
1964
+ disabled: !S || x === T,
1965
+ onClick: () => M(x),
1966
+ children: x
1967
+ },
1968
+ x
1969
+ )
1970
+ ) }) : /* @__PURE__ */ _("div", { className: "p-pagination__cursor-page", "aria-live": "polite", children: [
1971
+ "Page ",
1972
+ T
1973
+ ] }),
1974
+ /* @__PURE__ */ _(
1975
+ Dt,
1976
+ {
1977
+ className: "p-pagination__button--next",
1978
+ disabled: !ee,
1979
+ "aria-label": "Go to next page",
1980
+ onClick: () => M(T + 1),
1981
+ children: [
1982
+ /* @__PURE__ */ a("span", { children: "Next" }),
1983
+ /* @__PURE__ */ a(Ft, {})
1984
+ ]
1985
+ }
1986
+ )
1987
+ ] }),
1988
+ X ? /* @__PURE__ */ a(
1989
+ Ot,
1990
+ {
1991
+ className: "p-pagination__page-size",
1992
+ label: "Rows per page",
1993
+ placeholder: "",
1994
+ density: "compact",
1995
+ variant: "inline",
1996
+ hideLabel: !0,
1997
+ value: r,
1998
+ disabled: V,
1999
+ options: (l == null ? void 0 : l.map((x) => ({ value: x, label: `${x} / page` }))) ?? [],
2000
+ onValueChange: (x) => g == null ? void 0 : g(Number(x))
2001
+ }
2002
+ ) : null
2003
+ ]
2004
+ }
2005
+ );
2006
+ }
2007
+ );
2008
+ ja.displayName = "PPagination";
2009
+ function Wt(e) {
2010
+ return e.label ? e.label : e.mobileLabel ? e.mobileLabel : typeof e.header == "string" ? e.header : e.id;
2011
+ }
2012
+ function xt(e, t, n) {
2013
+ return t.cell ? t.cell(e, n) : typeof t.accessor == "function" ? t.accessor(e) : t.accessor ? e[t.accessor] : null;
2014
+ }
2015
+ function Ha(e) {
2016
+ return e === "ascending" ? "descending" : "ascending";
2017
+ }
2018
+ function Ga(e) {
2019
+ return !!(e && typeof e == "object" && "closest" in e && typeof e.closest == "function");
2020
+ }
2021
+ function Wa(e) {
2022
+ return !!(e && typeof e == "object" && "contains" in e && typeof e.contains == "function");
2023
+ }
2024
+ function Ut(e, t) {
2025
+ if (!Wa(t) || !Ga(e))
2026
+ return !1;
2027
+ const n = e.closest(
2028
+ [
2029
+ "a",
2030
+ "button",
2031
+ "input",
2032
+ "select",
2033
+ "textarea",
2034
+ "summary",
2035
+ '[contenteditable="true"]',
2036
+ '[role="button"]',
2037
+ '[role="link"]',
2038
+ '[role="menuitem"]',
2039
+ "[data-p-table-ignore-row-click]"
2040
+ ].join(",")
2041
+ );
2042
+ return !!(n && n !== t && t.contains(n));
2043
+ }
2044
+ function Ua({
2045
+ columns: e,
2046
+ rows: t,
2047
+ caption: n,
2048
+ captionHidden: r = !1,
2049
+ summary: l,
2050
+ density: s = "standard",
2051
+ stickyHeader: d = !0,
2052
+ stickyFirstColumn: m = !0,
2053
+ isLoading: y = !1,
2054
+ loadingLabel: b = "Loading table data...",
2055
+ emptyState: u = {
2056
+ title: "No records found",
2057
+ description: "Try adjusting the filters or checking back later."
2058
+ },
2059
+ errorState: v,
2060
+ getRowId: N,
2061
+ getRowTone: F,
2062
+ onRowClick: k,
2063
+ renderRowActions: g,
2064
+ onSortChange: $,
2065
+ className: j,
2066
+ tableClassName: B,
2067
+ ...A
2068
+ }, I) {
2069
+ const T = t.length > 0, V = !!g, S = v ?? (!y && !T ? u : null), z = e.filter((p) => !p.hideOnMobile), ee = e.length + (V ? 1 : 0), O = (p, M, x) => {
2070
+ Ut(x.target, x.currentTarget) || k == null || k(p, M, x);
2071
+ }, X = (p, M, x) => {
2072
+ Ut(x.target, x.currentTarget) || x.key !== "Enter" && x.key !== " " || (x.preventDefault(), k == null || k(p, M, x));
2073
+ };
2074
+ return /* @__PURE__ */ _(
2075
+ "div",
2076
+ {
2077
+ ...A,
2078
+ ref: I,
2079
+ className: h(
2080
+ "p-table",
2081
+ `p-table--${s}`,
2082
+ d && "p-table--sticky-header",
2083
+ m && "p-table--sticky-first-column",
2084
+ k && "p-table--interactive",
2085
+ j
2086
+ ),
2087
+ children: [
2088
+ /* @__PURE__ */ a("div", { className: "p-table__header", children: /* @__PURE__ */ _("div", { className: "p-table__header-copy", children: [
2089
+ /* @__PURE__ */ a("h3", { className: h("p-table__caption", r && "p-table__caption--hidden"), children: n }),
2090
+ l ? /* @__PURE__ */ a("div", { className: "p-table__summary", children: l }) : null
2091
+ ] }) }),
2092
+ /* @__PURE__ */ a("div", { className: "p-table__viewport", children: /* @__PURE__ */ _("table", { className: h("p-table__table", B), children: [
2093
+ /* @__PURE__ */ a("caption", { className: "p-table__native-caption", children: n }),
2094
+ /* @__PURE__ */ _("colgroup", { children: [
2095
+ e.map((p) => /* @__PURE__ */ a(
2096
+ "col",
2097
+ {
2098
+ className: h(
2099
+ "p-table__col",
2100
+ p.priority && `p-table__col--priority-${p.priority}`,
2101
+ p.hideOnTablet && "p-table__col--hide-tablet",
2102
+ p.hideOnMobile && "p-table__col--hide-mobile"
2103
+ ),
2104
+ style: p.width ? { width: p.width } : void 0
2105
+ },
2106
+ p.id
2107
+ )),
2108
+ V ? /* @__PURE__ */ a("col", { className: "p-table__actions-col" }) : null
2109
+ ] }),
2110
+ /* @__PURE__ */ a("thead", { className: "p-table__head", children: /* @__PURE__ */ _("tr", { children: [
2111
+ e.map((p) => {
2112
+ const M = Ha(p.sortDirection), x = p.sortDirection ?? (p.sortable ? "none" : void 0);
2113
+ return /* @__PURE__ */ a(
2114
+ "th",
2115
+ {
2116
+ scope: "col",
2117
+ "aria-sort": x,
2118
+ className: h(
2119
+ "p-table__cell p-table__head-cell",
2120
+ p.align && `p-table__cell--${p.align}`,
2121
+ p.priority && `p-table__cell--priority-${p.priority}`,
2122
+ p.hideOnTablet && "p-table__cell--hide-tablet",
2123
+ p.hideOnMobile && "p-table__cell--hide-mobile"
2124
+ ),
2125
+ children: p.sortable ? /* @__PURE__ */ _(
2126
+ "button",
2127
+ {
2128
+ type: "button",
2129
+ className: "p-table__sort-button",
2130
+ "aria-label": `Sort by ${Wt(p)}`,
2131
+ onClick: () => $ == null ? void 0 : $(p.id, M),
2132
+ children: [
2133
+ /* @__PURE__ */ a("span", { children: p.header }),
2134
+ /* @__PURE__ */ a(
2135
+ "span",
2136
+ {
2137
+ className: h(
2138
+ "p-table__sort-mark",
2139
+ p.sortDirection && `p-table__sort-mark--${p.sortDirection}`
2140
+ ),
2141
+ "aria-hidden": "true"
2142
+ }
2143
+ )
2144
+ ]
2145
+ }
2146
+ ) : p.header
2147
+ },
2148
+ p.id
2149
+ );
2150
+ }),
2151
+ V ? /* @__PURE__ */ a("th", { scope: "col", className: "p-table__cell p-table__head-cell p-table__actions-head", children: /* @__PURE__ */ a("span", { className: "p-table__sr-only", children: "Actions" }) }) : null
2152
+ ] }) }),
2153
+ /* @__PURE__ */ a("tbody", { className: "p-table__body", children: y ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ _("td", { className: "p-table__state-cell", colSpan: ee, children: [
2154
+ /* @__PURE__ */ a("span", { className: "p-table__loading-mark", "aria-hidden": "true" }),
2155
+ /* @__PURE__ */ a("span", { children: b })
2156
+ ] }) }) : S ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { className: "p-table__state-cell", colSpan: ee, children: /* @__PURE__ */ _("div", { className: h("p-table__state", S.tone && `p-table__state--${S.tone}`), children: [
2157
+ /* @__PURE__ */ a("strong", { children: S.title }),
2158
+ S.description ? /* @__PURE__ */ a("span", { children: S.description }) : null,
2159
+ S.action ? /* @__PURE__ */ a("div", { className: "p-table__state-action", children: S.action }) : null
2160
+ ] }) }) }) : t.map((p, M) => {
2161
+ const x = (N == null ? void 0 : N(p, M)) ?? String(M), W = F == null ? void 0 : F(p, M), pe = e.map((w) => /* @__PURE__ */ a(
2162
+ "td",
2163
+ {
2164
+ className: h(
2165
+ "p-table__cell p-table__body-cell",
2166
+ w.align && `p-table__cell--${w.align}`,
2167
+ w.priority && `p-table__cell--priority-${w.priority}`,
2168
+ w.hideOnTablet && "p-table__cell--hide-tablet",
2169
+ w.hideOnMobile && "p-table__cell--hide-mobile"
2170
+ ),
2171
+ children: xt(p, w, M)
2172
+ },
2173
+ w.id
2174
+ ));
2175
+ return /* @__PURE__ */ _(
2176
+ "tr",
2177
+ {
2178
+ className: h("p-table__row", W && `p-table__row--${W}`),
2179
+ tabIndex: k ? 0 : void 0,
2180
+ onClick: k ? (w) => O(p, M, w) : void 0,
2181
+ onKeyDown: k ? (w) => X(p, M, w) : void 0,
2182
+ children: [
2183
+ pe,
2184
+ V ? /* @__PURE__ */ a("td", { className: "p-table__cell p-table__body-cell p-table__actions-cell", children: g == null ? void 0 : g(p, M) }) : null
2185
+ ]
2186
+ },
2187
+ x
2188
+ );
2189
+ }) })
2190
+ ] }) }),
2191
+ /* @__PURE__ */ a("ul", { className: "p-table__mobile-list", "aria-label": `${n} rows`, children: y ? /* @__PURE__ */ _("li", { className: "p-table__mobile-state", children: [
2192
+ /* @__PURE__ */ a("span", { className: "p-table__loading-mark", "aria-hidden": "true" }),
2193
+ /* @__PURE__ */ a("span", { children: b })
2194
+ ] }) : S ? /* @__PURE__ */ a("li", { className: "p-table__mobile-state", children: /* @__PURE__ */ _("div", { className: h("p-table__state", S.tone && `p-table__state--${S.tone}`), children: [
2195
+ /* @__PURE__ */ a("strong", { children: S.title }),
2196
+ S.description ? /* @__PURE__ */ a("span", { children: S.description }) : null,
2197
+ S.action ? /* @__PURE__ */ a("div", { className: "p-table__state-action", children: S.action }) : null
2198
+ ] }) }) : t.map((p, M) => {
2199
+ const x = (N == null ? void 0 : N(p, M)) ?? String(M), W = z.find((D) => D.priority === "primary") ?? z[0], pe = z.filter((D) => D.id !== (W == null ? void 0 : W.id)), w = F == null ? void 0 : F(p, M);
2200
+ return /* @__PURE__ */ _(
2201
+ "li",
2202
+ {
2203
+ className: h("p-table__mobile-row", w && `p-table__mobile-row--${w}`),
2204
+ role: k ? "button" : void 0,
2205
+ tabIndex: k ? 0 : void 0,
2206
+ onClick: k ? (D) => O(p, M, D) : void 0,
2207
+ onKeyDown: k ? (D) => X(p, M, D) : void 0,
2208
+ children: [
2209
+ W ? /* @__PURE__ */ a("div", { className: "p-table__mobile-title", children: xt(p, W, M) }) : null,
2210
+ /* @__PURE__ */ a("dl", { className: "p-table__mobile-fields", children: pe.map((D) => /* @__PURE__ */ _("div", { className: "p-table__mobile-field", children: [
2211
+ /* @__PURE__ */ a("dt", { children: Wt(D) }),
2212
+ /* @__PURE__ */ a("dd", { children: xt(p, D, M) })
2213
+ ] }, D.id)) }),
2214
+ V ? /* @__PURE__ */ a("div", { className: "p-table__mobile-actions", children: g == null ? void 0 : g(p, M) }) : null
2215
+ ]
2216
+ },
2217
+ x
2218
+ );
2219
+ }) })
2220
+ ]
2221
+ }
2222
+ );
2223
+ }
2224
+ const qa = oe(Ua);
2225
+ qa.displayName = "PTable";
2226
+ function nn({
2227
+ title: e,
2228
+ index: t = "01",
2229
+ variant: n = "default",
2230
+ className: r
2231
+ }) {
2232
+ return n === "indexed" ? /* @__PURE__ */ _(
2233
+ "div",
2234
+ {
2235
+ className: h("p-section-header p-section-header--indexed", r),
2236
+ children: [
2237
+ /* @__PURE__ */ a(
2238
+ Ke,
2239
+ {
2240
+ as: "span",
2241
+ className: "p-section-header__mark",
2242
+ variant: "body",
2243
+ "aria-hidden": "true",
2244
+ children: "—"
2245
+ }
2246
+ ),
2247
+ /* @__PURE__ */ a(
2248
+ Ke,
2249
+ {
2250
+ as: "span",
2251
+ className: "p-section-header__index",
2252
+ variant: "body",
2253
+ children: t
2254
+ }
2255
+ ),
2256
+ /* @__PURE__ */ a(
2257
+ Ke,
2258
+ {
2259
+ as: "span",
2260
+ className: "p-section-header__divider",
2261
+ variant: "body",
2262
+ "aria-hidden": "true",
2263
+ children: "\\"
2264
+ }
2265
+ ),
2266
+ /* @__PURE__ */ a(Ke, { as: "h2", className: "p-section-header__title", variant: "body", children: e })
2267
+ ]
2268
+ }
2269
+ ) : /* @__PURE__ */ a(
2270
+ Zt,
2271
+ {
2272
+ className: h("p-section-header p-section-header--default", r),
2273
+ children: /* @__PURE__ */ a(Ke, { className: "p-section-header__title", variant: "body-wide", children: e })
2274
+ }
2275
+ );
1678
2276
  }
1679
- function Ma() {
2277
+ function za() {
1680
2278
  return /* @__PURE__ */ _(
1681
2279
  "svg",
1682
2280
  {
@@ -1691,13 +2289,13 @@ function Ma() {
1691
2289
  focusable: "false",
1692
2290
  className: "p-text-input__icon",
1693
2291
  children: [
1694
- /* @__PURE__ */ n("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }),
1695
- /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "3" })
2292
+ /* @__PURE__ */ a("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }),
2293
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "3" })
1696
2294
  ]
1697
2295
  }
1698
2296
  );
1699
2297
  }
1700
- function Ia() {
2298
+ function Ra() {
1701
2299
  return /* @__PURE__ */ _(
1702
2300
  "svg",
1703
2301
  {
@@ -1712,190 +2310,190 @@ function Ia() {
1712
2310
  focusable: "false",
1713
2311
  className: "p-text-input__icon",
1714
2312
  children: [
1715
- /* @__PURE__ */ n("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }),
1716
- /* @__PURE__ */ n("path", { d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }),
1717
- /* @__PURE__ */ n("path", { d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }),
1718
- /* @__PURE__ */ n("line", { x1: "2", x2: "22", y1: "2", y2: "22" })
2313
+ /* @__PURE__ */ a("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }),
2314
+ /* @__PURE__ */ a("path", { d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }),
2315
+ /* @__PURE__ */ a("path", { d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }),
2316
+ /* @__PURE__ */ a("line", { x1: "2", x2: "22", y1: "2", y2: "22" })
1719
2317
  ]
1720
2318
  }
1721
2319
  );
1722
2320
  }
1723
- const $a = Ne(
2321
+ const Oa = oe(
1724
2322
  ({
1725
2323
  className: e,
1726
2324
  inputClassName: t,
1727
- type: a,
2325
+ type: n,
1728
2326
  label: r,
1729
- helperText: o,
1730
- id: c,
2327
+ helperText: l,
2328
+ id: s,
1731
2329
  isError: d = !1,
1732
- errorMessage: g,
1733
- rightAdornment: v,
1734
- disabled: u,
1735
- readOnly: h,
1736
- style: f,
1737
- ...x
1738
- }, R) => {
1739
- const T = Qe(), k = c ?? T, w = `${k}-error`, A = `${k}-helper`, I = a === "password", C = !!v && !I, [P, U] = G(!1), he = I ? P ? "text" : "password" : a ?? "text", Ie = [
1740
- d && g ? w : null,
1741
- !d && o ? A : null
2330
+ errorMessage: m,
2331
+ rightAdornment: y,
2332
+ disabled: b,
2333
+ readOnly: u,
2334
+ style: v,
2335
+ ...N
2336
+ }, F) => {
2337
+ const k = Oe(), g = s ?? k, $ = `${g}-error`, j = `${g}-helper`, B = n === "password", A = !!y && !B, [I, T] = re(!1), V = B ? I ? "text" : "password" : n ?? "text", S = [
2338
+ d && m ? $ : null,
2339
+ !d && l ? j : null
1742
2340
  ].filter(Boolean).join(" ") || void 0;
1743
- return /* @__PURE__ */ _("div", { className: m("p-text-input", e), style: f, children: [
2341
+ return /* @__PURE__ */ _("div", { className: h("p-text-input", e), style: v, children: [
1744
2342
  /* @__PURE__ */ _("div", { className: "p-text-input__field", children: [
1745
- /* @__PURE__ */ n(
2343
+ /* @__PURE__ */ a(
1746
2344
  "input",
1747
2345
  {
1748
- ...x,
1749
- id: k,
1750
- ref: R,
1751
- type: he,
1752
- disabled: u,
1753
- readOnly: h,
2346
+ ...N,
2347
+ id: g,
2348
+ ref: F,
2349
+ type: V,
2350
+ disabled: b,
2351
+ readOnly: u,
1754
2352
  placeholder: " ",
1755
2353
  "aria-invalid": d || void 0,
1756
- "aria-describedby": Ie,
1757
- "aria-required": x.required,
1758
- "aria-disabled": u,
1759
- "aria-readonly": h,
1760
- autoComplete: x.autoComplete ?? (I ? "current-password" : void 0),
1761
- className: m(
2354
+ "aria-describedby": S,
2355
+ "aria-required": N.required,
2356
+ "aria-disabled": b,
2357
+ "aria-readonly": u,
2358
+ autoComplete: N.autoComplete ?? (B ? "current-password" : void 0),
2359
+ className: h(
1762
2360
  "p-text-input__control",
1763
- (I || C) && "p-text-input__control--adorned",
2361
+ (B || A) && "p-text-input__control--adorned",
1764
2362
  d && "p-text-input__control--error",
1765
- C && a === "date" && "p-text-input__control--date-adorned",
2363
+ A && n === "date" && "p-text-input__control--date-adorned",
1766
2364
  t
1767
2365
  )
1768
2366
  }
1769
2367
  ),
1770
- /* @__PURE__ */ n(
2368
+ /* @__PURE__ */ a(
1771
2369
  "span",
1772
2370
  {
1773
2371
  "aria-hidden": "true",
1774
- className: m(
2372
+ className: h(
1775
2373
  "p-text-input__label p-text-input__floating-label",
1776
2374
  d && "p-text-input__label--error"
1777
2375
  ),
1778
2376
  children: r
1779
2377
  }
1780
2378
  ),
1781
- /* @__PURE__ */ n(
2379
+ /* @__PURE__ */ a(
1782
2380
  "label",
1783
2381
  {
1784
- htmlFor: k,
2382
+ htmlFor: g,
1785
2383
  className: "p-text-input__label p-text-input__placeholder-label",
1786
2384
  children: r
1787
2385
  }
1788
2386
  ),
1789
- I && /* @__PURE__ */ n(
2387
+ B && /* @__PURE__ */ a(
1790
2388
  "button",
1791
2389
  {
1792
2390
  type: "button",
1793
- onClick: () => U((me) => !me),
1794
- disabled: u,
2391
+ onClick: () => T((z) => !z),
2392
+ disabled: b,
1795
2393
  className: "p-text-input__action",
1796
- "aria-label": P ? "Hide password" : "Show password",
1797
- "aria-pressed": P,
1798
- "aria-controls": k,
1799
- children: P ? /* @__PURE__ */ n(Ma, {}) : /* @__PURE__ */ n(Ia, {})
2394
+ "aria-label": I ? "Hide password" : "Show password",
2395
+ "aria-pressed": I,
2396
+ "aria-controls": g,
2397
+ children: I ? /* @__PURE__ */ a(za, {}) : /* @__PURE__ */ a(Ra, {})
1800
2398
  }
1801
2399
  ),
1802
- C && /* @__PURE__ */ n("span", { "aria-hidden": "true", className: "p-text-input__adornment", children: v })
2400
+ A && /* @__PURE__ */ a("span", { "aria-hidden": "true", className: "p-text-input__adornment", children: y })
1803
2401
  ] }),
1804
- d && g && /* @__PURE__ */ n(
2402
+ d && m && /* @__PURE__ */ a(
1805
2403
  "p",
1806
2404
  {
1807
- id: w,
2405
+ id: $,
1808
2406
  role: "alert",
1809
2407
  className: "p-text-input__message p-text-input__message--error",
1810
- children: g
2408
+ children: m
1811
2409
  }
1812
2410
  ),
1813
- !d && o && /* @__PURE__ */ n(
2411
+ !d && l && /* @__PURE__ */ a(
1814
2412
  "p",
1815
2413
  {
1816
- id: A,
2414
+ id: j,
1817
2415
  className: "p-text-input__message p-text-input__message--helper",
1818
- children: o
2416
+ children: l
1819
2417
  }
1820
2418
  )
1821
2419
  ] });
1822
2420
  }
1823
2421
  );
1824
- $a.displayName = "PTextInput";
1825
- const Ca = Ne(
2422
+ Oa.displayName = "PTextInput";
2423
+ const Xa = oe(
1826
2424
  ({
1827
2425
  className: e,
1828
2426
  textareaClassName: t,
1829
- label: a,
2427
+ label: n,
1830
2428
  helperText: r,
1831
- id: o,
1832
- isError: c = !1,
2429
+ id: l,
2430
+ isError: s = !1,
1833
2431
  errorMessage: d,
1834
- disabled: g,
1835
- readOnly: v,
1836
- rows: u = 4,
1837
- style: h,
1838
- ...f
1839
- }, x) => {
1840
- const R = Qe(), T = o ?? R, k = `${T}-error`, w = `${T}-helper`, A = [
1841
- c && d ? k : null,
1842
- !c && r ? w : null
2432
+ disabled: m,
2433
+ readOnly: y,
2434
+ rows: b = 4,
2435
+ style: u,
2436
+ ...v
2437
+ }, N) => {
2438
+ const F = Oe(), k = l ?? F, g = `${k}-error`, $ = `${k}-helper`, j = [
2439
+ s && d ? g : null,
2440
+ !s && r ? $ : null
1843
2441
  ].filter(Boolean).join(" ") || void 0;
1844
- return /* @__PURE__ */ _("div", { className: m("p-text-area", e), style: h, children: [
1845
- /* @__PURE__ */ n(
2442
+ return /* @__PURE__ */ _("div", { className: h("p-text-area", e), style: u, children: [
2443
+ /* @__PURE__ */ a(
1846
2444
  "textarea",
1847
2445
  {
1848
- ...f,
1849
- id: T,
1850
- ref: x,
1851
- rows: u,
1852
- disabled: g,
1853
- readOnly: v,
2446
+ ...v,
2447
+ id: k,
2448
+ ref: N,
2449
+ rows: b,
2450
+ disabled: m,
2451
+ readOnly: y,
1854
2452
  placeholder: " ",
1855
- "aria-invalid": c || void 0,
1856
- "aria-describedby": A,
1857
- "aria-required": f.required,
1858
- "aria-disabled": g,
1859
- "aria-readonly": v,
1860
- className: m(
2453
+ "aria-invalid": s || void 0,
2454
+ "aria-describedby": j,
2455
+ "aria-required": v.required,
2456
+ "aria-disabled": m,
2457
+ "aria-readonly": y,
2458
+ className: h(
1861
2459
  "p-text-area__control",
1862
- c && "p-text-area__control--error",
2460
+ s && "p-text-area__control--error",
1863
2461
  t
1864
2462
  )
1865
2463
  }
1866
2464
  ),
1867
- /* @__PURE__ */ n(
2465
+ /* @__PURE__ */ a(
1868
2466
  "span",
1869
2467
  {
1870
2468
  "aria-hidden": "true",
1871
- className: m(
2469
+ className: h(
1872
2470
  "p-text-area__label p-text-area__floating-label",
1873
- c && "p-text-area__label--error"
2471
+ s && "p-text-area__label--error"
1874
2472
  ),
1875
- children: a
2473
+ children: n
1876
2474
  }
1877
2475
  ),
1878
- /* @__PURE__ */ n(
2476
+ /* @__PURE__ */ a(
1879
2477
  "label",
1880
2478
  {
1881
- htmlFor: T,
2479
+ htmlFor: k,
1882
2480
  className: "p-text-area__label p-text-area__placeholder-label",
1883
- children: a
2481
+ children: n
1884
2482
  }
1885
2483
  ),
1886
- c && d && /* @__PURE__ */ n(
2484
+ s && d && /* @__PURE__ */ a(
1887
2485
  "p",
1888
2486
  {
1889
- id: k,
2487
+ id: g,
1890
2488
  role: "alert",
1891
2489
  className: "p-text-area__message p-text-area__message--error",
1892
2490
  children: d
1893
2491
  }
1894
2492
  ),
1895
- !c && r && /* @__PURE__ */ n(
2493
+ !s && r && /* @__PURE__ */ a(
1896
2494
  "p",
1897
2495
  {
1898
- id: w,
2496
+ id: $,
1899
2497
  className: "p-text-area__message p-text-area__message--helper",
1900
2498
  children: r
1901
2499
  }
@@ -1903,23 +2501,27 @@ const Ca = Ne(
1903
2501
  ] });
1904
2502
  }
1905
2503
  );
1906
- Ca.displayName = "PTextArea";
2504
+ Xa.displayName = "PTextArea";
1907
2505
  export {
1908
- Ht as PBadge,
1909
- Ut as PButton,
1910
- Xt as PCard,
1911
- Qt as PCombobox,
1912
- da as PDatePicker,
1913
- Ba as PDatePickerPresets,
1914
- xa as PDateRangePicker,
1915
- Ra as PDateRangePickerPresets,
1916
- Da as PHighlight,
1917
- wa as PHorizontalSlider,
1918
- Aa as PSectionHeader,
1919
- Ca as PTextArea,
1920
- $a as PTextInput,
1921
- ot as PTypography,
1922
- Pa as Row,
1923
- jt as Stack
2506
+ Jt as PBadge,
2507
+ Qt as PButton,
2508
+ na as PCard,
2509
+ ia as PCardGrid,
2510
+ da as PCombobox,
2511
+ Na as PDatePicker,
2512
+ tn as PDatePickerPresets,
2513
+ Ta as PDateRangePicker,
2514
+ an as PDateRangePickerPresets,
2515
+ Ba as PHighlight,
2516
+ Aa as PHorizontalSlider,
2517
+ ja as PPagination,
2518
+ nn as PSectionHeader,
2519
+ Ot as PSelect,
2520
+ qa as PTable,
2521
+ Xa as PTextArea,
2522
+ Oa as PTextInput,
2523
+ Ke as PTypography,
2524
+ en as Row,
2525
+ Zt as Stack
1924
2526
  };
1925
2527
  //# sourceMappingURL=index.es.js.map