@net-advantage/nabs-ui-shell 0.77.0 → 0.80.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- import { forwardRef as e, useMemo as t } from "react";
2
- import { Layout as n } from "@net-advantage/nabs-ui-layout";
3
- import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
1
+ import { forwardRef as e, useEffect as t, useId as n, useMemo as r, useRef as i, useState as a } from "react";
2
+ import { Layout as o } from "@net-advantage/nabs-ui-layout";
3
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
4
4
  export * from "@net-advantage/nabs-ui-layout";
5
5
  export * from "@net-advantage/nabs-ui-accordion";
6
6
  export * from "@net-advantage/nabs-ui-avatar";
@@ -29,74 +29,74 @@ export * from "@net-advantage/nabs-ui-textarea";
29
29
  export * from "@net-advantage/nabs-ui-textbox";
30
30
  export * from "@net-advantage/nabs-ui-toolbar";
31
31
  //#region src/Shell.tsx
32
- var o = e(({ header: e, navigation: t, footer: r, children: a, className: o = "", headerClassName: s = "", navigationClassName: c = "", contentClassName: l = "", footerClassName: u = "", ...d }, f) => {
33
- let p = ["nabs-ui-shell", o].filter(Boolean).join(" "), m = ["nabs-ui-shell__header", s].filter(Boolean).join(" "), h = ["nabs-ui-shell__navigation", c].filter(Boolean).join(" "), g = ["nabs-ui-shell__content", l].filter(Boolean).join(" "), _ = ["nabs-ui-shell__footer", u].filter(Boolean).join(" ");
34
- return /* @__PURE__ */ i("div", {
32
+ var u = e(({ header: e, navigation: t, footer: n, children: r, className: i = "", headerClassName: a = "", navigationClassName: s = "", contentClassName: l = "", footerClassName: u = "", ...d }, f) => {
33
+ let p = ["nabs-ui-shell", i].filter(Boolean).join(" "), m = ["nabs-ui-shell__header", a].filter(Boolean).join(" "), h = ["nabs-ui-shell__navigation", s].filter(Boolean).join(" "), g = ["nabs-ui-shell__content", l].filter(Boolean).join(" "), _ = ["nabs-ui-shell__footer", u].filter(Boolean).join(" ");
34
+ return /* @__PURE__ */ c("div", {
35
35
  ref: f,
36
36
  className: p,
37
37
  ...d,
38
- children: /* @__PURE__ */ i(n, {
38
+ children: /* @__PURE__ */ c(o, {
39
39
  className: "nabs-ui-shell__layout",
40
40
  header: e,
41
- footer: r,
41
+ footer: n,
42
42
  leftSidePanel: t,
43
43
  headerClassName: m,
44
44
  footerClassName: _,
45
45
  leftSidePanelClassName: h,
46
46
  contentClassName: g,
47
- children: a
47
+ children: r
48
48
  })
49
49
  });
50
50
  });
51
- o.displayName = "Shell";
51
+ u.displayName = "Shell";
52
52
  //#endregion
53
53
  //#region src/Branding.tsx
54
- var s = e(function({ logo: e, title: t, byline: n, className: r = "", ...o }, s) {
55
- return /* @__PURE__ */ a("div", {
56
- ref: s,
54
+ var d = e(function({ logo: e, title: t, byline: n, className: r = "", ...i }, a) {
55
+ return /* @__PURE__ */ l("div", {
56
+ ref: a,
57
57
  className: ["nabs-ui-branding", r].filter(Boolean).join(" "),
58
- ...o,
59
- children: [/* @__PURE__ */ i("div", {
58
+ ...i,
59
+ children: [/* @__PURE__ */ c("div", {
60
60
  className: "nabs-ui-branding__logo",
61
61
  "aria-hidden": "true",
62
62
  children: e
63
- }), /* @__PURE__ */ a("div", {
63
+ }), /* @__PURE__ */ l("div", {
64
64
  className: "nabs-ui-branding__text",
65
- children: [/* @__PURE__ */ i("strong", {
65
+ children: [/* @__PURE__ */ c("strong", {
66
66
  className: "nabs-ui-branding__title",
67
67
  children: t
68
- }), /* @__PURE__ */ i("span", {
68
+ }), /* @__PURE__ */ c("span", {
69
69
  className: "nabs-ui-branding__byline",
70
70
  children: n
71
71
  })]
72
72
  })]
73
73
  });
74
74
  });
75
- s.displayName = "Branding";
75
+ d.displayName = "Branding";
76
76
  //#endregion
77
77
  //#region ../nabs-ui-breadcrumb/dist/nabs-ui-breadcrumb.js
78
- function c(e) {
78
+ function f(e) {
79
79
  return e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey;
80
80
  }
81
- function l() {
81
+ function p() {
82
82
  return "Home";
83
83
  }
84
- function u(e) {
84
+ function m(e) {
85
85
  return {
86
86
  id: "__home__",
87
- label: e?.label ?? l(),
87
+ label: e?.label ?? p(),
88
88
  href: e?.href,
89
89
  path: e?.path,
90
90
  disabled: e?.disabled
91
91
  };
92
92
  }
93
- function d(e, t, n) {
94
- return t ? [u(n), ...e] : e;
93
+ function h(e, t, n) {
94
+ return t ? [m(n), ...e] : e;
95
95
  }
96
- function f(e) {
96
+ function g(e) {
97
97
  return ["nabs-ui-breadcrumb", e ?? ""].filter(Boolean).join(" ");
98
98
  }
99
- function p({ isCurrent: e, disabled: t, itemClassName: n }) {
99
+ function _({ isCurrent: e, disabled: t, itemClassName: n }) {
100
100
  return [
101
101
  "nabs-ui-breadcrumb__item",
102
102
  e ? "nabs-ui-breadcrumb__item--current" : "",
@@ -104,24 +104,24 @@ function p({ isCurrent: e, disabled: t, itemClassName: n }) {
104
104
  n ?? ""
105
105
  ].filter(Boolean).join(" ");
106
106
  }
107
- function m(e) {
107
+ function v(e) {
108
108
  let t = typeof e.path == "string" && e.path.trim().length > 0, n = typeof e.href == "string" && e.href.trim().length > 0;
109
109
  return t ? e.path : n ? e.href : void 0;
110
110
  }
111
- function h() {
112
- return /* @__PURE__ */ a("svg", {
111
+ function y() {
112
+ return /* @__PURE__ */ l("svg", {
113
113
  className: "nabs-ui-breadcrumb__homeIcon",
114
114
  viewBox: "0 0 24 24",
115
115
  fill: "none",
116
116
  "aria-hidden": "true",
117
117
  focusable: "false",
118
- children: [/* @__PURE__ */ i("path", {
118
+ children: [/* @__PURE__ */ c("path", {
119
119
  d: "M3 11.5L12 4L21 11.5",
120
120
  stroke: "currentColor",
121
121
  strokeWidth: "1.8",
122
122
  strokeLinecap: "round",
123
123
  strokeLinejoin: "round"
124
- }), /* @__PURE__ */ i("path", {
124
+ }), /* @__PURE__ */ c("path", {
125
125
  d: "M6.5 10V20H17.5V10",
126
126
  stroke: "currentColor",
127
127
  strokeWidth: "1.8",
@@ -130,61 +130,61 @@ function h() {
130
130
  })]
131
131
  });
132
132
  }
133
- var g = e(function({ items: e = [], showHome: t = !0, home: n, separator: o = "/", lastItemClickable: s = !1, className: l = "", itemClassName: u = "", onItemSelect: g, ..._ }, v) {
134
- let y = d(e, t, n);
135
- return /* @__PURE__ */ i("nav", {
136
- ref: v,
137
- className: f(l),
133
+ var b = e(function({ items: e = [], showHome: t = !0, home: n, separator: r = "/", lastItemClickable: i = !1, className: a = "", itemClassName: o = "", onItemSelect: u, ...d }, p) {
134
+ let m = h(e, t, n);
135
+ return /* @__PURE__ */ c("nav", {
136
+ ref: p,
137
+ className: g(a),
138
138
  "aria-label": "Breadcrumb",
139
- ..._,
140
- children: /* @__PURE__ */ i("ol", {
139
+ ...d,
140
+ children: /* @__PURE__ */ c("ol", {
141
141
  className: "nabs-ui-breadcrumb__list",
142
- children: y.map((e, l) => {
143
- let d = l === y.length - 1, f = d && !s, _ = typeof e.path == "string" && e.path.trim().length > 0, v = m(e), b = p({
144
- isCurrent: f,
142
+ children: m.map((e, a) => {
143
+ let d = a === m.length - 1, p = d && !i, h = typeof e.path == "string" && e.path.trim().length > 0, g = v(e), b = _({
144
+ isCurrent: p,
145
145
  disabled: e.disabled,
146
- itemClassName: u
146
+ itemClassName: o
147
147
  }), x = (t) => {
148
- if (e.disabled || f) {
148
+ if (e.disabled || p) {
149
149
  t.preventDefault();
150
150
  return;
151
151
  }
152
- g?.({
152
+ u?.({
153
153
  itemId: e.id,
154
154
  item: e,
155
155
  event: t
156
- }), !t.defaultPrevented && (!_ || typeof window > "u" || !c(t) || (t.preventDefault(), window.history.pushState({}, "", e.path), window.dispatchEvent(new PopStateEvent("popstate", { state: window.history.state }))));
157
- }, S = /* @__PURE__ */ a(r, { children: [l === 0 && t ? n?.icon ?? /* @__PURE__ */ i(h, {}) : null, /* @__PURE__ */ i("span", {
156
+ }), !t.defaultPrevented && (!h || typeof window > "u" || !f(t) || (t.preventDefault(), window.history.pushState({}, "", e.path), window.dispatchEvent(new PopStateEvent("popstate", { state: window.history.state }))));
157
+ }, S = /* @__PURE__ */ l(s, { children: [a === 0 && t ? n?.icon ?? /* @__PURE__ */ c(y, {}) : null, /* @__PURE__ */ c("span", {
158
158
  className: "nabs-ui-breadcrumb__itemLabel",
159
159
  children: e.label
160
160
  })] });
161
- return /* @__PURE__ */ a("li", {
161
+ return /* @__PURE__ */ l("li", {
162
162
  className: "nabs-ui-breadcrumb__entry",
163
- children: [v && !f ? /* @__PURE__ */ i("a", {
163
+ children: [g && !p ? /* @__PURE__ */ c("a", {
164
164
  className: b,
165
- href: v,
165
+ href: g,
166
166
  onClick: x,
167
167
  children: S
168
- }) : /* @__PURE__ */ i("button", {
168
+ }) : /* @__PURE__ */ c("button", {
169
169
  type: "button",
170
170
  className: b,
171
- disabled: e.disabled || f,
172
- "aria-current": f ? "page" : void 0,
171
+ disabled: e.disabled || p,
172
+ "aria-current": p ? "page" : void 0,
173
173
  onClick: x,
174
174
  children: S
175
- }), d ? null : /* @__PURE__ */ i("span", {
175
+ }), d ? null : /* @__PURE__ */ c("span", {
176
176
  className: "nabs-ui-breadcrumb__separator",
177
- children: o
177
+ children: r
178
178
  })]
179
179
  }, e.id);
180
180
  })
181
181
  })
182
182
  });
183
183
  });
184
- g.displayName = "Breadcrumb";
184
+ b.displayName = "Breadcrumb";
185
185
  //#endregion
186
186
  //#region ../nabs-ui-charts/dist/nabs-ui-charts.js
187
- var _ = {
187
+ var x = {
188
188
  leftPadding: 44,
189
189
  rightPadding: 18,
190
190
  plotTop: 14,
@@ -202,14 +202,14 @@ var _ = {
202
202
  legendMarkerRadius: 2,
203
203
  legendApproxCharWidth: 5.8,
204
204
  svgBottomPadding: 8
205
- }, v = {
205
+ }, S = {
206
206
  line: "nabs-ui-charts--line",
207
207
  bar: "nabs-ui-charts--bar"
208
208
  };
209
- function y(e) {
209
+ function C(e) {
210
210
  return Number.isFinite(e) ? Math.max(0, Math.floor(e)) : 8;
211
211
  }
212
- function b(e) {
212
+ function w(e) {
213
213
  if (typeof e == "number" && Number.isFinite(e)) return e;
214
214
  if (typeof e == "string") {
215
215
  let t = Number(e);
@@ -217,19 +217,19 @@ function b(e) {
217
217
  }
218
218
  return 0;
219
219
  }
220
- function x(e, t) {
221
- return b(e[t]);
220
+ function T(e, t) {
221
+ return w(e[t]);
222
222
  }
223
- function S(e) {
223
+ function ee(e) {
224
224
  return !Number.isFinite(e) || e <= 0 ? 5 : Math.abs(e);
225
225
  }
226
- function C(e, t, n) {
226
+ function te(e, t, n) {
227
227
  return Math.min(n, Math.max(t, e));
228
228
  }
229
- function w(e) {
229
+ function E(e) {
230
230
  return Number(e.toFixed(6));
231
231
  }
232
- function T(e, t, n) {
232
+ function D(e, t, n) {
233
233
  let r = [];
234
234
  if (n?.length) for (let e of n) {
235
235
  let t = String(e ?? "").trim();
@@ -240,13 +240,13 @@ function T(e, t, n) {
240
240
  let t = e[0];
241
241
  for (let e of Object.keys(t)) {
242
242
  if (e === "yAxis") continue;
243
- let n = t[e], i = b(n);
243
+ let n = t[e], i = w(n);
244
244
  if (Number.isFinite(i) && r.push(e), r.length >= 10) break;
245
245
  }
246
246
  }
247
247
  return r.slice(0, 10);
248
248
  }
249
- function E(e, t, n, r) {
249
+ function O(e, t, n, r) {
250
250
  let i = e + t, a = Number.isFinite(n) ? n : 0, o = Number.isFinite(r) ? r : i;
251
251
  return o <= a ? {
252
252
  axisMin: a,
@@ -256,20 +256,20 @@ function E(e, t, n, r) {
256
256
  axisMax: o
257
257
  };
258
258
  }
259
- function D(e, t, n) {
259
+ function k(e, t, n) {
260
260
  let r = [e], i = n / 1e3, a = 0;
261
261
  for (let o = e + n; o <= t + i && !(a > 5e3); o += n) {
262
- let e = w(o);
262
+ let e = E(o);
263
263
  if (e >= t) break;
264
264
  r.push(e), a += 1;
265
265
  }
266
266
  return r[r.length - 1] !== t && r.push(t), r;
267
267
  }
268
- function O(e, t, n) {
269
- let r = e.map((e) => _.legendSampleWidth + _.legendTextGap + e.length * _.legendApproxCharWidth), i = t - (r.reduce((e, t) => e + t, 0) + Math.max(0, e.length - 1) * _.legendItemGap) / 2;
268
+ function A(e, t, n) {
269
+ let r = e.map((e) => x.legendSampleWidth + x.legendTextGap + e.length * x.legendApproxCharWidth), i = t - (r.reduce((e, t) => e + t, 0) + Math.max(0, e.length - 1) * x.legendItemGap) / 2;
270
270
  return e.map((e, t) => {
271
- let n = r[t], a = i, o = a + _.legendSampleWidth, s = a + _.legendSampleWidth / 2, c = o + _.legendTextGap;
272
- return i += n + _.legendItemGap, {
271
+ let n = r[t], a = i, o = a + x.legendSampleWidth, s = a + x.legendSampleWidth / 2, c = o + x.legendTextGap;
272
+ return i += n + x.legendItemGap, {
273
273
  id: `legend-${e}`,
274
274
  label: e,
275
275
  colorIndex: t,
@@ -280,7 +280,7 @@ function O(e, t, n) {
280
280
  };
281
281
  });
282
282
  }
283
- function k(e, t) {
283
+ function j(e, t) {
284
284
  let n = [];
285
285
  for (let r of e) r !== e[0] && n.push({
286
286
  id: `guide-${r}`,
@@ -289,24 +289,24 @@ function k(e, t) {
289
289
  });
290
290
  return n;
291
291
  }
292
- function A(e, t) {
292
+ function M(e, t) {
293
293
  return e.map((e) => ({
294
294
  id: `tick-${e}`,
295
295
  value: e,
296
296
  y: t(e)
297
297
  }));
298
298
  }
299
- function j(e, t, n, r, i, a, o, s) {
300
- let c = T(e, t, n), l = c.flatMap((t) => e.map((e) => x(e, t))), { axisMin: u, axisMax: d } = E(Math.max(0, ...l), i, a, o), f = Math.max(1, d - u), p = S(s), m = Math.max(1, e.length) * _.itemStep, h = _.leftPadding, g = h + m, v = _.plotTop, y = v + _.plotHeight, b = h + m + _.rightPadding, w = y, j = y + _.xLabelOffset, M = y + _.axisLabelOffset, N = M + _.legendOffset, P = r && c.length > 1, F = P ? N + _.svgBottomPadding : M + _.svgBottomPadding, I = (e) => v + (d - e) / f * _.plotHeight, L = D(u, d, p), R = k(L, I), z = A(L, I), B = e.map((e, t) => {
301
- let n = h + t * _.itemStep + _.itemStep / 2;
299
+ function N(e, t, n, r, i, a, o, s) {
300
+ let c = D(e, t, n), l = c.flatMap((t) => e.map((e) => T(e, t))), { axisMin: u, axisMax: d } = O(Math.max(0, ...l), i, a, o), f = Math.max(1, d - u), p = ee(s), m = Math.max(1, e.length) * x.itemStep, h = x.leftPadding, g = h + m, _ = x.plotTop, v = _ + x.plotHeight, y = h + m + x.rightPadding, b = v, S = v + x.xLabelOffset, C = v + x.axisLabelOffset, w = C + x.legendOffset, E = r && c.length > 1, N = E ? w + x.svgBottomPadding : C + x.svgBottomPadding, P = (e) => _ + (d - e) / f * x.plotHeight, F = k(u, d, p), I = j(F, P), L = M(F, P), R = e.map((e, t) => {
301
+ let n = h + t * x.itemStep + x.itemStep / 2;
302
302
  return {
303
303
  id: `category-${e.yAxis}-${t}`,
304
304
  label: e.yAxis,
305
305
  x: n
306
306
  };
307
- }), V = c.map((t, n) => {
308
- let r = B.map((n, r) => {
309
- let i = e[r], a = x(i, t), o = I(C(a, u, d));
307
+ }), z = c.map((t, n) => {
308
+ let r = R.map((n, r) => {
309
+ let i = e[r], a = T(i, t), o = P(te(a, u, d));
310
310
  return {
311
311
  id: `${t}-${n.id}`,
312
312
  label: n.label,
@@ -321,163 +321,163 @@ function j(e, t, n, r, i, a, o, s) {
321
321
  colorIndex: n,
322
322
  points: r
323
323
  };
324
- }), H = B.map((e) => ({
324
+ }), B = R.map((e) => ({
325
325
  id: `v-guide-${e.id}`,
326
326
  x: e.x
327
- })), U = P ? O(c, b / 2, N) : [], W = Math.max(1, V.length), G = _.itemStep * _.barGroupScale, K = _.barGap;
327
+ })), ne = E ? A(c, y / 2, w) : [], V = Math.max(1, z.length), re = x.itemStep * x.barGroupScale, H = x.barGap;
328
328
  return {
329
329
  valueKeys: c,
330
- categoryTicks: B,
331
- seriesModels: V,
332
- guides: R,
333
- verticalGuides: H,
334
- yTicks: z,
335
- legendItems: U,
336
- svgHeight: F,
337
- svgWidth: b,
338
- barWidth: Math.max(2, Math.min(_.barWidthMax, (G - Math.max(0, W - 1) * K) / W)),
339
- barGap: K,
330
+ categoryTicks: R,
331
+ seriesModels: z,
332
+ guides: I,
333
+ verticalGuides: B,
334
+ yTicks: L,
335
+ legendItems: ne,
336
+ svgHeight: N,
337
+ svgWidth: y,
338
+ barWidth: Math.max(2, Math.min(x.barWidthMax, (re - Math.max(0, V - 1) * H) / V)),
339
+ barGap: H,
340
340
  plotLeft: h,
341
341
  plotRight: g,
342
- plotTop: v,
343
- plotBottom: y,
344
- xAxisY: w,
345
- xAxisLabelY: j,
346
- axisNameY: M,
347
- legendY: N
342
+ plotTop: _,
343
+ plotBottom: v,
344
+ xAxisY: b,
345
+ xAxisLabelY: S,
346
+ axisNameY: C,
347
+ legendY: w
348
348
  };
349
349
  }
350
- function M(e) {
350
+ function P(e) {
351
351
  return e.map((e) => `${e.x},${e.y}`).join(" ");
352
352
  }
353
- function N(...e) {
353
+ function F(...e) {
354
354
  return e.filter(Boolean).join(" ");
355
355
  }
356
- var P = e(function({ className: e = "", series: n, valueName: r, valueNames: o, palette: s, chartType: c = "line", topSpace: l = 8, yAxisMin: u, yAxisMax: d, yAxisInterval: f, xAxisName: p = "", showXAxisName: m = !0, showLegend: h = !0, minPointHeight: g = 2, style: b, ...x }, S) {
357
- let C = y(l), w = t(() => j(n, r, o, h, C, u, d, f), [
358
- C,
359
- n,
356
+ var I = e(function({ className: e = "", series: t, valueName: n, valueNames: i, palette: a, chartType: o = "line", topSpace: s = 8, yAxisMin: u, yAxisMax: d, yAxisInterval: f, xAxisName: p = "", showXAxisName: m = !0, showLegend: h = !0, minPointHeight: g = 2, style: _, ...v }, y) {
357
+ let b = C(s), w = r(() => N(t, n, i, h, b, u, d, f), [
358
+ b,
359
+ t,
360
360
  h,
361
- r,
362
- o,
361
+ n,
362
+ i,
363
363
  f,
364
364
  d,
365
365
  u
366
- ]), T = t(() => {
367
- if (!s || s.length === 0) return;
366
+ ]), T = r(() => {
367
+ if (!a || a.length === 0) return;
368
368
  let e = {};
369
- for (let t = 0; t < Math.min(10, s.length); t += 1) {
370
- let n = String(s[t] ?? "").trim();
369
+ for (let t = 0; t < Math.min(10, a.length); t += 1) {
370
+ let n = String(a[t] ?? "").trim();
371
371
  n && (e[`--nabs-ui-charts-series-inline-${t + 1}`] = n);
372
372
  }
373
373
  return Object.keys(e).length > 0 ? e : void 0;
374
- }, [s]), E = T ? {
374
+ }, [a]), ee = T ? {
375
375
  ...T,
376
- ...b
377
- } : b, D = N("nabs-ui-charts", v[c], e), O = m && p.trim().length > 0, k = w.valueKeys.length > 0 ? w.valueKeys.join(", ") : String(r ?? "value");
378
- return /* @__PURE__ */ i("div", {
379
- ref: S,
380
- className: D,
381
- style: E,
382
- ...x,
383
- children: /* @__PURE__ */ a("svg", {
376
+ ..._
377
+ } : _, te = F("nabs-ui-charts", S[o], e), E = m && p.trim().length > 0, D = w.valueKeys.length > 0 ? w.valueKeys.join(", ") : String(n ?? "value");
378
+ return /* @__PURE__ */ c("div", {
379
+ ref: y,
380
+ className: te,
381
+ style: ee,
382
+ ...v,
383
+ children: /* @__PURE__ */ l("svg", {
384
384
  className: "nabs-ui-charts__svg",
385
385
  viewBox: `0 0 ${w.svgWidth} ${w.svgHeight}`,
386
386
  role: "img",
387
- "aria-label": `2D ${c} chart for ${k}`,
387
+ "aria-label": `2D ${o} chart for ${D}`,
388
388
  preserveAspectRatio: "xMidYMid meet",
389
389
  children: [
390
- /* @__PURE__ */ i("rect", {
390
+ /* @__PURE__ */ c("rect", {
391
391
  className: "nabs-ui-charts__plotBoundary",
392
392
  x: w.plotLeft,
393
393
  y: w.plotTop,
394
394
  width: w.plotRight - w.plotLeft,
395
395
  height: w.plotBottom - w.plotTop
396
396
  }),
397
- w.verticalGuides.map((e) => /* @__PURE__ */ i("line", {
397
+ w.verticalGuides.map((e) => /* @__PURE__ */ c("line", {
398
398
  className: "nabs-ui-charts__guide",
399
399
  x1: e.x,
400
400
  y1: w.plotTop,
401
401
  x2: e.x,
402
402
  y2: w.plotBottom
403
403
  }, e.id)),
404
- w.guides.map((e) => /* @__PURE__ */ i("line", {
404
+ w.guides.map((e) => /* @__PURE__ */ c("line", {
405
405
  className: "nabs-ui-charts__guide",
406
406
  x1: w.plotLeft,
407
407
  y1: e.y,
408
408
  x2: w.plotRight,
409
409
  y2: e.y
410
410
  }, e.id)),
411
- w.yTicks.map((e) => /* @__PURE__ */ i("text", {
411
+ w.yTicks.map((e) => /* @__PURE__ */ c("text", {
412
412
  className: "nabs-ui-charts__yTickLabel",
413
413
  x: w.plotLeft - 6,
414
414
  y: e.y,
415
415
  children: e.value
416
416
  }, e.id)),
417
- /* @__PURE__ */ i("line", {
417
+ /* @__PURE__ */ c("line", {
418
418
  className: "nabs-ui-charts__axis",
419
419
  x1: w.plotLeft,
420
420
  y1: w.xAxisY,
421
421
  x2: w.plotRight,
422
422
  y2: w.xAxisY
423
423
  }),
424
- c === "line" ? w.seriesModels.map((e) => {
425
- let t = N("nabs-ui-charts__line", `nabs-ui-charts__series-color-${e.colorIndex}`), n = N("nabs-ui-charts__point", `nabs-ui-charts__series-color-${e.colorIndex}`);
426
- return /* @__PURE__ */ a("g", { children: [e.points.length > 1 ? /* @__PURE__ */ i("polyline", {
424
+ o === "line" ? w.seriesModels.map((e) => {
425
+ let t = F("nabs-ui-charts__line", `nabs-ui-charts__series-color-${e.colorIndex}`), n = F("nabs-ui-charts__point", `nabs-ui-charts__series-color-${e.colorIndex}`);
426
+ return /* @__PURE__ */ l("g", { children: [e.points.length > 1 ? /* @__PURE__ */ c("polyline", {
427
427
  className: t,
428
- points: M(e.points)
429
- }) : null, e.points.map((t) => /* @__PURE__ */ i("circle", {
428
+ points: P(e.points)
429
+ }) : null, e.points.map((t) => /* @__PURE__ */ c("circle", {
430
430
  className: n,
431
431
  cx: t.x,
432
432
  cy: t.y,
433
433
  r: 1.5,
434
- children: /* @__PURE__ */ i("title", { children: `${t.label} • ${e.key}: ${t.value}` })
434
+ children: /* @__PURE__ */ c("title", { children: `${t.label} • ${e.key}: ${t.value}` })
435
435
  }, t.id))] }, e.id);
436
436
  }) : w.categoryTicks.map((e, t) => {
437
- let n = Math.max(1, w.seriesModels.length), r = n * w.barWidth + Math.max(0, n - 1) * w.barGap, a = e.x - r / 2;
438
- return /* @__PURE__ */ i("g", { children: w.seriesModels.map((n, r) => {
439
- let o = n.points[t], s = Math.max(w.xAxisY - o.y, g), c = w.xAxisY - s, l = a + r * (w.barWidth + w.barGap);
440
- return /* @__PURE__ */ i("rect", {
441
- className: N("nabs-ui-charts__bar", `nabs-ui-charts__series-color-${n.colorIndex}`),
437
+ let n = Math.max(1, w.seriesModels.length), r = n * w.barWidth + Math.max(0, n - 1) * w.barGap, i = e.x - r / 2;
438
+ return /* @__PURE__ */ c("g", { children: w.seriesModels.map((n, r) => {
439
+ let a = n.points[t], o = Math.max(w.xAxisY - a.y, g), s = w.xAxisY - o, l = i + r * (w.barWidth + w.barGap);
440
+ return /* @__PURE__ */ c("rect", {
441
+ className: F("nabs-ui-charts__bar", `nabs-ui-charts__series-color-${n.colorIndex}`),
442
442
  x: l,
443
- y: c,
443
+ y: s,
444
444
  width: w.barWidth,
445
- height: s,
445
+ height: o,
446
446
  rx: 1.5,
447
447
  ry: 1.5,
448
- children: /* @__PURE__ */ i("title", { children: `${e.label} • ${n.key}: ${o.value}` })
449
- }, `${n.id}-${o.id}`);
448
+ children: /* @__PURE__ */ c("title", { children: `${e.label} • ${n.key}: ${a.value}` })
449
+ }, `${n.id}-${a.id}`);
450
450
  }) }, `bars-${e.id}`);
451
451
  }),
452
- w.categoryTicks.map((e) => /* @__PURE__ */ i("text", {
452
+ w.categoryTicks.map((e) => /* @__PURE__ */ c("text", {
453
453
  className: "nabs-ui-charts__tickLabel",
454
454
  x: e.x,
455
455
  y: w.xAxisLabelY,
456
456
  children: e.label
457
457
  }, `${e.id}-label`)),
458
- O ? /* @__PURE__ */ i("text", {
458
+ E ? /* @__PURE__ */ c("text", {
459
459
  className: "nabs-ui-charts__axisName",
460
460
  x: w.svgWidth / 2,
461
461
  y: w.axisNameY,
462
462
  children: p
463
463
  }) : null,
464
464
  w.legendItems.map((e) => {
465
- let t = N("nabs-ui-charts__legendSample", `nabs-ui-charts__series-color-${e.colorIndex}`);
466
- return /* @__PURE__ */ a("g", { children: [
467
- /* @__PURE__ */ i("line", {
465
+ let t = F("nabs-ui-charts__legendSample", `nabs-ui-charts__series-color-${e.colorIndex}`);
466
+ return /* @__PURE__ */ l("g", { children: [
467
+ /* @__PURE__ */ c("line", {
468
468
  className: t,
469
469
  x1: e.sampleX1,
470
470
  y1: w.legendY,
471
471
  x2: e.sampleX2,
472
472
  y2: w.legendY
473
473
  }),
474
- /* @__PURE__ */ i("circle", {
474
+ /* @__PURE__ */ c("circle", {
475
475
  className: t,
476
476
  cx: e.markerX,
477
477
  cy: w.legendY,
478
- r: _.legendMarkerRadius
478
+ r: x.legendMarkerRadius
479
479
  }),
480
- /* @__PURE__ */ i("text", {
480
+ /* @__PURE__ */ c("text", {
481
481
  className: "nabs-ui-charts__legendLabel",
482
482
  x: e.textX,
483
483
  y: w.legendY,
@@ -489,8 +489,8 @@ var P = e(function({ className: e = "", series: n, valueName: r, valueNames: o,
489
489
  })
490
490
  });
491
491
  });
492
- P.displayName = "2DChart";
493
- var F = {
492
+ I.displayName = "2DChart";
493
+ var L = {
494
494
  svgWidth: 400,
495
495
  svgHeight: 180,
496
496
  centerX: 88,
@@ -503,13 +503,13 @@ var F = {
503
503
  legendSwatchSize: 7,
504
504
  legendTextGap: 6
505
505
  };
506
- function I(e) {
507
- let t = b(e);
506
+ function R(e) {
507
+ let t = w(e);
508
508
  return t > 0 ? t : 0;
509
509
  }
510
- function L(e, t) {
510
+ function z(e, t) {
511
511
  let n = e.map((e, n) => {
512
- let r = String(e.yAxis ?? `Slice ${n + 1}`).trim() || `Slice ${n + 1}`, i = I(e[t]);
512
+ let r = String(e.yAxis ?? `Slice ${n + 1}`).trim() || `Slice ${n + 1}`, i = R(e[t]);
513
513
  return {
514
514
  id: `slice-${r}-${n}`,
515
515
  label: r,
@@ -529,13 +529,13 @@ function L(e, t) {
529
529
  };
530
530
  });
531
531
  }
532
- function R(e, t, n, r) {
532
+ function B(e, t, n, r) {
533
533
  return {
534
534
  x: e + n * Math.cos(r),
535
535
  y: t + n * Math.sin(r)
536
536
  };
537
537
  }
538
- function z(e, t, n) {
538
+ function ne(e, t, n) {
539
539
  let r = e, i = t - n, a = e, o = t + n;
540
540
  return [
541
541
  `M ${e} ${t}`,
@@ -545,7 +545,7 @@ function z(e, t, n) {
545
545
  "Z"
546
546
  ].join(" ");
547
547
  }
548
- function B(e, t, n, r) {
548
+ function V(e, t, n, r) {
549
549
  let i = e, a = t - n, o = e, s = t + n, c = e, l = t - r, u = e, d = t + r;
550
550
  return [
551
551
  `M ${i} ${a}`,
@@ -557,16 +557,16 @@ function B(e, t, n, r) {
557
557
  "Z"
558
558
  ].join(" ");
559
559
  }
560
- function V(e, t, n, r, i, a) {
561
- if (e.ratio >= .999999) return t === "donut" ? B(n, r, i, a) : z(n, r, i);
562
- let o = +(e.endAngle - e.startAngle > Math.PI), s = R(n, r, i, e.startAngle), c = R(n, r, i, e.endAngle);
560
+ function re(e, t, n, r, i, a) {
561
+ if (e.ratio >= .999999) return t === "donut" ? V(n, r, i, a) : ne(n, r, i);
562
+ let o = +(e.endAngle - e.startAngle > Math.PI), s = B(n, r, i, e.startAngle), c = B(n, r, i, e.endAngle);
563
563
  if (t === "pie") return [
564
564
  `M ${n} ${r}`,
565
565
  `L ${s.x} ${s.y}`,
566
566
  `A ${i} ${i} 0 ${o} 1 ${c.x} ${c.y}`,
567
567
  "Z"
568
568
  ].join(" ");
569
- let l = R(n, r, a, e.startAngle), u = R(n, r, a, e.endAngle);
569
+ let l = B(n, r, a, e.startAngle), u = B(n, r, a, e.endAngle);
570
570
  return [
571
571
  `M ${s.x} ${s.y}`,
572
572
  `A ${i} ${i} 0 ${o} 1 ${c.x} ${c.y}`,
@@ -575,60 +575,60 @@ function V(e, t, n, r, i, a) {
575
575
  "Z"
576
576
  ].join(" ");
577
577
  }
578
- var H = e(function({ className: e = "", series: n, valueName: r, palette: o, chartType: s = "pie", showLegend: c = !0, style: l, ...u }, d) {
579
- let f = t(() => L(n, r), [n, r]), p = t(() => {
580
- if (!o || o.length === 0) return;
578
+ var H = e(function({ className: e = "", series: t, valueName: n, palette: i, chartType: a = "pie", showLegend: o = !0, style: s, ...u }, d) {
579
+ let f = r(() => z(t, n), [t, n]), p = r(() => {
580
+ if (!i || i.length === 0) return;
581
581
  let e = {};
582
- for (let t = 0; t < Math.min(10, o.length); t += 1) {
583
- let n = String(o[t] ?? "").trim();
582
+ for (let t = 0; t < Math.min(10, i.length); t += 1) {
583
+ let n = String(i[t] ?? "").trim();
584
584
  n && (e[`--nabs-ui-charts-series-inline-${t + 1}`] = n);
585
585
  }
586
586
  return Object.keys(e).length > 0 ? e : void 0;
587
- }, [o]);
588
- return /* @__PURE__ */ i("div", {
587
+ }, [i]);
588
+ return /* @__PURE__ */ c("div", {
589
589
  ref: d,
590
- className: N("nabs-ui-charts", "nabs-ui-charts--pie", `nabs-ui-charts--${s}`, e),
590
+ className: F("nabs-ui-charts", "nabs-ui-charts--pie", `nabs-ui-charts--${a}`, e),
591
591
  style: p ? {
592
592
  ...p,
593
- ...l
594
- } : l,
593
+ ...s
594
+ } : s,
595
595
  ...u,
596
- children: /* @__PURE__ */ a("svg", {
596
+ children: /* @__PURE__ */ l("svg", {
597
597
  className: "nabs-ui-charts__svg",
598
- viewBox: `0 0 ${F.svgWidth} ${F.svgHeight}`,
598
+ viewBox: `0 0 ${L.svgWidth} ${L.svgHeight}`,
599
599
  role: "img",
600
- "aria-label": `${s} chart for ${r}`,
600
+ "aria-label": `${a} chart for ${n}`,
601
601
  preserveAspectRatio: "xMidYMid meet",
602
602
  children: [
603
603
  f.length > 0 ? f.map((e) => {
604
- let t = V(e, s, F.centerX, F.centerY, F.radius, F.donutInnerRadius);
605
- return /* @__PURE__ */ i("path", {
606
- className: N("nabs-ui-charts__pieSlice", `nabs-ui-charts__series-color-${e.colorIndex}`),
604
+ let t = re(e, a, L.centerX, L.centerY, L.radius, L.donutInnerRadius);
605
+ return /* @__PURE__ */ c("path", {
606
+ className: F("nabs-ui-charts__pieSlice", `nabs-ui-charts__series-color-${e.colorIndex}`),
607
607
  d: t,
608
- children: /* @__PURE__ */ i("title", { children: `${e.label}: ${e.value}` })
608
+ children: /* @__PURE__ */ c("title", { children: `${e.label}: ${e.value}` })
609
609
  }, e.id);
610
610
  }) : null,
611
- c ? f.map((e, t) => {
612
- let n = F.legendStartY + t * F.legendItemHeight, r = N("nabs-ui-charts__legendSwatch", `nabs-ui-charts__series-color-${e.colorIndex}`), o = n - F.legendSwatchSize / 2, s = F.legendStartX + F.legendSwatchSize + F.legendTextGap;
613
- return /* @__PURE__ */ a("g", { children: [/* @__PURE__ */ i("rect", {
611
+ o ? f.map((e, t) => {
612
+ let n = L.legendStartY + t * L.legendItemHeight, r = F("nabs-ui-charts__legendSwatch", `nabs-ui-charts__series-color-${e.colorIndex}`), i = n - L.legendSwatchSize / 2, a = L.legendStartX + L.legendSwatchSize + L.legendTextGap;
613
+ return /* @__PURE__ */ l("g", { children: [/* @__PURE__ */ c("rect", {
614
614
  className: r,
615
- x: F.legendStartX,
616
- y: o,
617
- width: F.legendSwatchSize,
618
- height: F.legendSwatchSize,
615
+ x: L.legendStartX,
616
+ y: i,
617
+ width: L.legendSwatchSize,
618
+ height: L.legendSwatchSize,
619
619
  rx: 1,
620
620
  ry: 1
621
- }), /* @__PURE__ */ i("text", {
621
+ }), /* @__PURE__ */ c("text", {
622
622
  className: "nabs-ui-charts__legendLabel",
623
- x: s,
623
+ x: a,
624
624
  y: n,
625
625
  children: `${e.label} (${Math.round(e.ratio * 100)}%)`
626
626
  })] }, `legend-${e.id}`);
627
627
  }) : null,
628
- f.length === 0 ? /* @__PURE__ */ i("text", {
628
+ f.length === 0 ? /* @__PURE__ */ c("text", {
629
629
  className: "nabs-ui-charts__legendLabel",
630
- x: F.centerX,
631
- y: F.centerY,
630
+ x: L.centerX,
631
+ y: L.centerY,
632
632
  textAnchor: "middle",
633
633
  children: "No data"
634
634
  }) : null
@@ -638,4 +638,856 @@ var H = e(function({ className: e = "", series: n, valueName: r, palette: o, cha
638
638
  });
639
639
  H.displayName = "PieChart";
640
640
  //#endregion
641
- export { s as Branding, g as Breadcrumb, H as PieChart, o as Shell, P as TwoDChart };
641
+ //#region ../nabs-ui-event-calendar/dist/nabs-ui-event-calendar.js
642
+ var U = [
643
+ "none",
644
+ "top",
645
+ "left"
646
+ ], W = {
647
+ none: "nabs-ui-datepicker--label-none",
648
+ top: "nabs-ui-datepicker--label-top",
649
+ left: "nabs-ui-datepicker--label-left"
650
+ };
651
+ function ie(e) {
652
+ return typeof e == "string" && U.includes(e);
653
+ }
654
+ function ae(e) {
655
+ return ie(e) ? e : "top";
656
+ }
657
+ function oe(e, t) {
658
+ return e || `nabs-ui-datepicker-${t.replace(/:/g, "")}`;
659
+ }
660
+ function se({ label: e, labelPosition: t, className: n }) {
661
+ let r = ae(t);
662
+ return [
663
+ "nabs-ui-datepicker",
664
+ e ? W[r] ?? W.top : "",
665
+ n ?? ""
666
+ ].filter(Boolean).join(" ");
667
+ }
668
+ function ce(e) {
669
+ return ["nabs-ui-datepicker__input", e ?? ""].filter(Boolean).join(" ");
670
+ }
671
+ function le(e) {
672
+ return ["nabs-ui-datepicker__label", e ?? ""].filter(Boolean).join(" ");
673
+ }
674
+ function ue(e) {
675
+ if (e !== void 0) return e ?? "";
676
+ }
677
+ function de(e, t) {
678
+ return t && e === "" ? null : e;
679
+ }
680
+ function fe({ defaultPrevented: e, disabled: t, readOnly: n }) {
681
+ return !e && !t && !n;
682
+ }
683
+ var pe = e(({ label: e, labelPosition: t = "top", className: r = "", inputClassName: i = "", labelClassName: a = "", allowNull: o = !1, id: s, value: u, onChange: d, onClick: f, onValueChange: p, ...m }, h) => {
684
+ let g = oe(s, n()), _ = se({
685
+ label: e,
686
+ labelPosition: t,
687
+ className: r
688
+ }), v = ce(i), y = le(a), b = ue(u);
689
+ return /* @__PURE__ */ l("div", {
690
+ className: _,
691
+ children: [e ? /* @__PURE__ */ c("label", {
692
+ className: y,
693
+ htmlFor: g,
694
+ children: e
695
+ }) : null, /* @__PURE__ */ c("input", {
696
+ ref: h,
697
+ id: g,
698
+ className: v,
699
+ type: "date",
700
+ value: b,
701
+ onClick: (e) => {
702
+ f?.(e);
703
+ let t = e.currentTarget;
704
+ fe({
705
+ defaultPrevented: e.defaultPrevented,
706
+ disabled: t.disabled,
707
+ readOnly: t.readOnly
708
+ }) && t.showPicker?.();
709
+ },
710
+ onChange: (e) => {
711
+ d?.(e), p?.(de(e.target.value, o), e);
712
+ },
713
+ ...m
714
+ })]
715
+ });
716
+ });
717
+ pe.displayName = "DatePicker";
718
+ function me(e) {
719
+ return e.label ?? e.children ?? e.value;
720
+ }
721
+ function he(e, t) {
722
+ return e.value || `item-${t}`;
723
+ }
724
+ function ge(e, t, n) {
725
+ return e || t === null || n === null;
726
+ }
727
+ function _e(e, t) {
728
+ return e || `nabs-ui-dropdownlist-${t.replace(/:/g, "")}`;
729
+ }
730
+ function ve({ disabled: e = !1, className: t }) {
731
+ return [
732
+ "nabs-ui-dropdownlist",
733
+ e ? "nabs-ui-dropdownlist--disabled" : "",
734
+ t ?? ""
735
+ ].filter(Boolean).join(" ");
736
+ }
737
+ function ye(e, t, n) {
738
+ return ge(e, t, n);
739
+ }
740
+ function be(e) {
741
+ return e === "" ? null : e;
742
+ }
743
+ var xe = e(function({ items: e = [], value: t, defaultValue: r, allowNull: i = !1, nullLabel: a = "None", className: o = "", onChange: s, onValueChange: u, id: d, disabled: f, ...p }, m) {
744
+ let h = _e(d, n()), g = ve({
745
+ disabled: f,
746
+ className: o
747
+ }), _ = ye(i, t, r);
748
+ return /* @__PURE__ */ l("select", {
749
+ ref: m,
750
+ id: h,
751
+ className: g,
752
+ disabled: f,
753
+ value: t ?? void 0,
754
+ defaultValue: r ?? void 0,
755
+ onChange: (e) => {
756
+ let t = be(e.target.value);
757
+ u?.(t, e), s?.(e);
758
+ },
759
+ ...p,
760
+ children: [_ ? /* @__PURE__ */ c("option", {
761
+ value: "",
762
+ disabled: !i,
763
+ children: a
764
+ }) : null, e.map((e, t) => /* @__PURE__ */ c("option", {
765
+ value: e.value,
766
+ disabled: e.disabled,
767
+ children: me(e)
768
+ }, he(e, t)))]
769
+ });
770
+ });
771
+ xe.displayName = "DropdownList";
772
+ var Se = {
773
+ left: "nabs-ui-toolbar__content--label-left",
774
+ right: "nabs-ui-toolbar__content--label-right",
775
+ top: "nabs-ui-toolbar__content--label-top",
776
+ bottom: "nabs-ui-toolbar__content--label-bottom"
777
+ };
778
+ function Ce(e) {
779
+ return e || "right";
780
+ }
781
+ function we(e) {
782
+ return ["nabs-ui-toolbar", e ?? ""].filter(Boolean).join(" ");
783
+ }
784
+ function Te(e) {
785
+ return ["nabs-ui-toolbar__content", e].filter(Boolean).join(" ");
786
+ }
787
+ function Ee({ isActive: e, hasLabel: t, buttonClassName: n }) {
788
+ return [
789
+ "nabs-ui-toolbar__button",
790
+ e ? "nabs-ui-toolbar__button--active" : "",
791
+ t ? "" : "nabs-ui-toolbar__button--icon-only",
792
+ n ?? ""
793
+ ].filter(Boolean).join(" ");
794
+ }
795
+ function De(e) {
796
+ return ["nabs-ui-toolbar__icon", e ?? ""].filter(Boolean).join(" ");
797
+ }
798
+ function Oe(e) {
799
+ return ["nabs-ui-toolbar__label", e ?? ""].filter(Boolean).join(" ");
800
+ }
801
+ function ke(e, t) {
802
+ return typeof e == "string" ? e : t;
803
+ }
804
+ var Ae = e(function({ items: e, activeItemId: t, className: n = "", buttonClassName: r = "", iconClassName: i = "", labelClassName: a = "", onItemSelect: o, ...s }, u) {
805
+ return /* @__PURE__ */ c("div", {
806
+ ref: u,
807
+ className: we(n),
808
+ role: "toolbar",
809
+ ...s,
810
+ children: e.map((e) => {
811
+ let n = e.icon, s = !!e.label, u = e.id === t || e.pressed === !0, d = Te(Se[Ce(e.labelPosition)]), f = Ee({
812
+ isActive: u,
813
+ hasLabel: s,
814
+ buttonClassName: r
815
+ }), p = De(i), m = Oe(a), h = ke(e.label, e.title);
816
+ return /* @__PURE__ */ c("button", {
817
+ type: "button",
818
+ className: f,
819
+ disabled: e.disabled,
820
+ title: e.title,
821
+ "aria-label": h,
822
+ "aria-pressed": typeof e.pressed == "boolean" ? e.pressed : void 0,
823
+ onClick: (t) => {
824
+ o?.({
825
+ itemId: e.id,
826
+ item: e,
827
+ event: t
828
+ });
829
+ },
830
+ children: /* @__PURE__ */ l("span", {
831
+ className: d,
832
+ children: [n ? /* @__PURE__ */ c(n, {
833
+ className: p,
834
+ "aria-hidden": "true",
835
+ focusable: "false"
836
+ }) : null, e.label ? /* @__PURE__ */ c("span", {
837
+ className: m,
838
+ children: e.label
839
+ }) : null]
840
+ })
841
+ }, e.id);
842
+ })
843
+ });
844
+ });
845
+ Ae.displayName = "Toolbar";
846
+ var je = [
847
+ "day",
848
+ "week",
849
+ "work-week",
850
+ "month",
851
+ "quarter",
852
+ "half-year",
853
+ "year"
854
+ ], Me = {
855
+ day: "Day",
856
+ week: "Week",
857
+ "work-week": "Work week",
858
+ month: "Month",
859
+ quarter: "Quarter",
860
+ "half-year": "Half year",
861
+ year: "Year"
862
+ };
863
+ function G(e) {
864
+ return e && je.includes(e) ? e : "week";
865
+ }
866
+ function K(e, t) {
867
+ return typeof e != "number" || Number.isNaN(e) ? t : (Math.trunc(e) % 7 + 7) % 7;
868
+ }
869
+ function Ne(e, t) {
870
+ return typeof e != "number" || Number.isNaN(e) ? t : Math.min(23, Math.max(0, Math.trunc(e)));
871
+ }
872
+ function Pe(e) {
873
+ if (typeof e != "number" || Number.isNaN(e)) return 60;
874
+ let t = Math.trunc(e);
875
+ return t <= 0 ? 60 : Math.min(240, t);
876
+ }
877
+ function q(e) {
878
+ if (e instanceof Date) return Number.isNaN(e.getTime()) ? /* @__PURE__ */ new Date() : new Date(e.getTime());
879
+ if (typeof e == "number" || typeof e == "string") {
880
+ let t = new Date(e);
881
+ if (!Number.isNaN(t.getTime())) return t;
882
+ }
883
+ return /* @__PURE__ */ new Date();
884
+ }
885
+ function J(e) {
886
+ return new Date(e.getFullYear(), e.getMonth(), e.getDate(), 0, 0, 0, 0);
887
+ }
888
+ function Y(e, t) {
889
+ return new Date(e.getFullYear(), e.getMonth(), e.getDate() + t, e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
890
+ }
891
+ function X(e, t) {
892
+ return new Date(e.getFullYear(), e.getMonth() + t, e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
893
+ }
894
+ function Z(e) {
895
+ return new Date(e.getFullYear(), e.getMonth(), e.getDate(), 23, 59, 59, 999);
896
+ }
897
+ function Q(e, t) {
898
+ let n = J(e);
899
+ return Y(n, -((n.getDay() - t + 7) % 7));
900
+ }
901
+ function Fe(e, t) {
902
+ return Z(Y(Q(e, t), 6));
903
+ }
904
+ function Ie(e) {
905
+ return new Date(e.getFullYear(), e.getMonth(), 1, 0, 0, 0, 0);
906
+ }
907
+ function $(e) {
908
+ return new Date(e.getFullYear(), e.getMonth() + 1, 0, 23, 59, 59, 999);
909
+ }
910
+ function Le(e) {
911
+ return e.getHours() * 60 + e.getMinutes();
912
+ }
913
+ function Re(e) {
914
+ return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
915
+ }
916
+ function ze(e) {
917
+ let t = q(e.start), n = q(e.end);
918
+ return n.getTime() <= t.getTime() ? {
919
+ start: t,
920
+ end: new Date(t.getTime() + 1800 * 1e3)
921
+ } : {
922
+ start: t,
923
+ end: n
924
+ };
925
+ }
926
+ var Be = new Intl.DateTimeFormat(void 0, { weekday: "short" }), Ve = new Intl.DateTimeFormat(void 0, {
927
+ weekday: "short",
928
+ day: "numeric"
929
+ }), He = new Intl.DateTimeFormat(void 0, {
930
+ month: "long",
931
+ year: "numeric"
932
+ });
933
+ function Ue(e) {
934
+ return ["nabs-ui-event-calendar", e ?? ""].filter(Boolean).join(" ");
935
+ }
936
+ function We(e, t, n) {
937
+ let r = J(t);
938
+ if (e === "day") return {
939
+ start: r,
940
+ end: Z(r)
941
+ };
942
+ if (e === "week") {
943
+ let e = Q(r, 0);
944
+ return {
945
+ start: e,
946
+ end: Z(Y(e, 6))
947
+ };
948
+ }
949
+ if (e === "work-week") {
950
+ let e = Q(r, K(n, 1));
951
+ return {
952
+ start: e,
953
+ end: Z(Y(e, 4))
954
+ };
955
+ }
956
+ if (e === "month") return {
957
+ start: Ie(r),
958
+ end: $(r)
959
+ };
960
+ if (e === "quarter") {
961
+ let e = Math.floor(r.getMonth() / 3) * 3, t = new Date(r.getFullYear(), e, 1);
962
+ return {
963
+ start: t,
964
+ end: $(X(t, 2))
965
+ };
966
+ }
967
+ if (e === "half-year") {
968
+ let e = Math.floor(r.getMonth() / 6) * 6, t = new Date(r.getFullYear(), e, 1);
969
+ return {
970
+ start: t,
971
+ end: $(X(t, 5))
972
+ };
973
+ }
974
+ return {
975
+ start: new Date(r.getFullYear(), 0, 1),
976
+ end: new Date(r.getFullYear(), 11, 31, 23, 59, 59, 999)
977
+ };
978
+ }
979
+ function Ge(e) {
980
+ let t = e.start.getFullYear() === e.end.getFullYear();
981
+ return `${new Intl.DateTimeFormat(void 0, {
982
+ month: "short",
983
+ day: "numeric",
984
+ year: t ? void 0 : "numeric"
985
+ }).format(e.start)} - ${new Intl.DateTimeFormat(void 0, {
986
+ month: "short",
987
+ day: "numeric",
988
+ year: "numeric"
989
+ }).format(e.end)}`;
990
+ }
991
+ function Ke(e, t, n) {
992
+ return n === 0 ? /* @__PURE__ */ new Date() : t === "day" ? Y(e, n) : t === "week" || t === "work-week" ? Y(e, n * 7) : t === "month" ? X(e, n) : t === "quarter" ? X(e, n * 3) : t === "half-year" ? X(e, n * 6) : X(e, n * 12);
993
+ }
994
+ function qe(e, t, n) {
995
+ let r = J(t), i = (e) => ({
996
+ date: e,
997
+ id: `${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`,
998
+ label: Ve.format(e),
999
+ shortLabel: Be.format(e)
1000
+ });
1001
+ if (e === "day") return [i(r)];
1002
+ if (e === "week") {
1003
+ let e = Q(r, 0);
1004
+ return Array.from({ length: 7 }, (t, n) => i(Y(e, n)));
1005
+ }
1006
+ let a = Q(r, K(n, 1));
1007
+ return Array.from({ length: 5 }, (e, t) => i(Y(a, t)));
1008
+ }
1009
+ function Je(e, t, n, r) {
1010
+ let i = Math.max(n, Le(e)), a = Math.min(r, Le(t));
1011
+ return a <= i ? null : {
1012
+ startMinutes: i,
1013
+ endMinutes: a
1014
+ };
1015
+ }
1016
+ function Ye(e) {
1017
+ let t = [...e].sort((e, t) => e.startMinutes === t.startMinutes ? t.endMinutes - e.endMinutes : e.startMinutes - t.startMinutes), n = [], r = t.map((e) => {
1018
+ let t = n.findIndex((t) => e.startMinutes >= t);
1019
+ return t === -1 ? (t = n.length, n.push(e.endMinutes)) : n[t] = e.endMinutes, {
1020
+ ...e,
1021
+ laneIndex: t,
1022
+ laneCount: 0
1023
+ };
1024
+ }), i = n.length || 1;
1025
+ return r.map((e) => ({
1026
+ ...e,
1027
+ laneCount: i
1028
+ }));
1029
+ }
1030
+ function Xe(e, t) {
1031
+ let n = ze(e);
1032
+ return n.start.getTime() < t.end.getTime() && n.end.getTime() > t.start.getTime();
1033
+ }
1034
+ function Ze(e, t, n, r) {
1035
+ let i = n * 60, a = r * 60, o = Math.max(60, a - i), s = [];
1036
+ for (let n of t) {
1037
+ let t = {
1038
+ start: n.date,
1039
+ end: Y(n.date, 1)
1040
+ }, r = Ye(e.filter((e) => !e.allDay).map((e) => ({
1041
+ event: e,
1042
+ range: ze(e)
1043
+ })).filter((e) => Xe(e.event, t)).filter((e) => J(e.range.start).getTime() === J(e.range.end).getTime()).map((e) => {
1044
+ let t = Je(e.range.start, e.range.end, i, a);
1045
+ return t ? {
1046
+ event: e.event,
1047
+ start: e.range.start,
1048
+ end: e.range.end,
1049
+ startMinutes: t.startMinutes,
1050
+ endMinutes: t.endMinutes
1051
+ } : null;
1052
+ }).filter((e) => !!e));
1053
+ for (let e of r) s.push({
1054
+ event: e.event,
1055
+ columnId: n.id,
1056
+ laneIndex: e.laneIndex,
1057
+ laneCount: e.laneCount,
1058
+ topPct: (e.startMinutes - i) / o * 100,
1059
+ heightPct: Math.max(5, (e.endMinutes - e.startMinutes) / o * 100),
1060
+ start: e.start,
1061
+ end: e.end
1062
+ });
1063
+ }
1064
+ return s;
1065
+ }
1066
+ function Qe(e) {
1067
+ let t = [...e].sort((e, t) => e.startIndex === t.startIndex ? t.endIndex - t.startIndex - (e.endIndex - e.startIndex) : e.startIndex - t.startIndex), n = [], r = t.map((e) => {
1068
+ let t = n.findIndex((t) => e.startIndex > t);
1069
+ return t === -1 ? (t = n.length, n.push(e.endIndex)) : n[t] = e.endIndex, {
1070
+ ...e,
1071
+ laneIndex: t,
1072
+ laneCount: 0
1073
+ };
1074
+ }), i = n.length || 1;
1075
+ return r.map((e) => ({
1076
+ ...e,
1077
+ laneCount: i
1078
+ }));
1079
+ }
1080
+ function $e(e, t) {
1081
+ if (t.length === 0) return [];
1082
+ let n = t[0].date, r = Y(t[t.length - 1].date, 1);
1083
+ return Qe(e.map((e) => ({
1084
+ event: e,
1085
+ range: ze(e)
1086
+ })).filter((e) => e.range.start < r && e.range.end > n).filter((e) => e.event.allDay || J(e.range.start).getTime() !== J(e.range.end).getTime()).map((e) => {
1087
+ let i = new Date(Math.max(e.range.start.getTime(), n.getTime())), a = new Date(Math.min(e.range.end.getTime(), r.getTime())), o = Math.max(0, Math.floor((J(i).getTime() - n.getTime()) / (1440 * 60 * 1e3))), s = Y(J(a), a.getHours() === 0 && a.getMinutes() === 0 ? -1 : 0), c = Math.min(t.length - 1, Math.max(o, Math.floor((s.getTime() - n.getTime()) / (1440 * 60 * 1e3))));
1088
+ return {
1089
+ event: e.event,
1090
+ segmentStart: i,
1091
+ segmentEnd: a,
1092
+ startIndex: o,
1093
+ endIndex: c,
1094
+ isClippedStart: e.range.start.getTime() < n.getTime(),
1095
+ isClippedEnd: e.range.end.getTime() > r.getTime()
1096
+ };
1097
+ })).map((e) => ({
1098
+ event: e.event,
1099
+ startIndex: e.startIndex,
1100
+ endIndex: e.endIndex,
1101
+ laneIndex: e.laneIndex,
1102
+ laneCount: e.laneCount,
1103
+ segmentStart: e.segmentStart,
1104
+ segmentEnd: e.segmentEnd,
1105
+ isClippedStart: e.isClippedStart,
1106
+ isClippedEnd: e.isClippedEnd
1107
+ }));
1108
+ }
1109
+ function et(e, t, n, r) {
1110
+ let i = e === "month" ? 1 : e === "quarter" ? 3 : e === "half-year" ? 6 : 12, a = e === "month" ? Ie(t) : e === "quarter" ? new Date(t.getFullYear(), Math.floor(t.getMonth() / 3) * 3, 1) : e === "half-year" ? new Date(t.getFullYear(), Math.floor(t.getMonth() / 6) * 6, 1) : new Date(t.getFullYear(), 0, 1), o = K(r, 0), s = [];
1111
+ for (let e = 0; e < i; e += 1) {
1112
+ let t = Ie(X(a, e)), r = $(t), i = Q(t, o), c = Fe(r, o), l = [], u = i, d = 0;
1113
+ for (; u.getTime() <= c.getTime();) {
1114
+ let e = u, r = Array.from({ length: 7 }, (t, n) => Y(e, n)), i = r.map((e) => ({
1115
+ date: e,
1116
+ id: `${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`,
1117
+ label: Ve.format(e),
1118
+ shortLabel: Be.format(e)
1119
+ }));
1120
+ l.push({
1121
+ id: `${t.getFullYear()}-${t.getMonth()}-${d}`,
1122
+ weekStart: e,
1123
+ days: r,
1124
+ segments: $e(n, i)
1125
+ }), u = Y(e, 7), d += 1;
1126
+ }
1127
+ s.push({
1128
+ id: `${t.getFullYear()}-${t.getMonth()}`,
1129
+ title: He.format(t),
1130
+ weeks: l
1131
+ });
1132
+ }
1133
+ return s;
1134
+ }
1135
+ function tt(e) {
1136
+ return e === "day" || e === "week" || e === "work-week";
1137
+ }
1138
+ function nt(e, t) {
1139
+ let n = new Intl.DateTimeFormat(void 0, {
1140
+ hour: "numeric",
1141
+ minute: "2-digit"
1142
+ });
1143
+ return `${n.format(e)} - ${n.format(t)}`;
1144
+ }
1145
+ function rt(e) {
1146
+ return q(e);
1147
+ }
1148
+ function it(e, t, n) {
1149
+ return n ? n(e) : /* @__PURE__ */ l("div", {
1150
+ className: t,
1151
+ children: [/* @__PURE__ */ c("strong", {
1152
+ className: "nabs-ui-event-calendar__eventTitle",
1153
+ children: e.event.title
1154
+ }), e.event.content ? /* @__PURE__ */ c("div", {
1155
+ className: "nabs-ui-event-calendar__eventBody",
1156
+ children: e.event.content
1157
+ }) : null]
1158
+ });
1159
+ }
1160
+ var at = e(function({ events: e, view: n, defaultView: o = "week", anchorDate: s, defaultAnchorDate: u, weekStartsOn: d = 0, workWeekStartsOn: f = 1, dayStartsAt: p = 7, dayEndsAt: m = 22, slotMinutes: h = 60, showControls: g = !0, eventTemplate: _, onViewChange: v, onAnchorDateChange: y, onRangeChange: b, onEventClick: x, onEventDoubleClick: S, className: C = "", ...w }, T) {
1161
+ let [ee, te] = a(G(o)), [E, D] = a(() => rt(u)), O = i(b);
1162
+ t(() => {
1163
+ O.current = b;
1164
+ }, [b]);
1165
+ let k = G(n ?? ee), A = r(() => rt(s ?? E), [s, E]), j = K(d, 0), M = K(f, 1), N = Ne(p, 7), P = Math.max(N + 1, Ne(m, 22)), F = Pe(h), I = r(() => We(k, A, M), [
1166
+ A,
1167
+ k,
1168
+ M
1169
+ ]);
1170
+ t(() => {
1171
+ O.current?.({
1172
+ view: k,
1173
+ range: I
1174
+ });
1175
+ }, [I, k]);
1176
+ let L = Ue(C), R = Ge(I), z = r(() => qe(k, A, M), [
1177
+ A,
1178
+ k,
1179
+ M
1180
+ ]), B = r(() => Ze(e, z, N, P), [
1181
+ z,
1182
+ e,
1183
+ P,
1184
+ N
1185
+ ]), ne = r(() => $e(e, z), [z, e]), V = r(() => {
1186
+ let e = Math.max(60, (P - N) * 60);
1187
+ return Math.max(1, Math.floor(e / F));
1188
+ }, [
1189
+ P,
1190
+ N,
1191
+ F
1192
+ ]), re = r(() => et(k, A, e, j), [
1193
+ e,
1194
+ A,
1195
+ k,
1196
+ j
1197
+ ]), H = r(() => je.map((e) => ({
1198
+ label: Me[e],
1199
+ value: e
1200
+ })), []), U = (e) => {
1201
+ let t = Ke(A, k, e);
1202
+ D(t), y?.(t);
1203
+ }, W = (e) => {
1204
+ let t = G(e);
1205
+ te(t), v?.(t);
1206
+ };
1207
+ return /* @__PURE__ */ l("section", {
1208
+ ref: T,
1209
+ className: L,
1210
+ ...w,
1211
+ children: [g ? /* @__PURE__ */ l("div", {
1212
+ className: "nabs-ui-event-calendar__controls",
1213
+ "aria-label": "Calendar controls",
1214
+ children: [
1215
+ /* @__PURE__ */ c(Ae, {
1216
+ "aria-label": "Calendar navigation",
1217
+ items: [
1218
+ {
1219
+ id: "previous",
1220
+ label: "Previous"
1221
+ },
1222
+ {
1223
+ id: "today",
1224
+ label: "Today"
1225
+ },
1226
+ {
1227
+ id: "next",
1228
+ label: "Next"
1229
+ }
1230
+ ],
1231
+ onItemSelect: ({ itemId: e }) => {
1232
+ if (e === "previous") {
1233
+ U(-1);
1234
+ return;
1235
+ }
1236
+ if (e === "today") {
1237
+ U(0);
1238
+ return;
1239
+ }
1240
+ U(1);
1241
+ }
1242
+ }),
1243
+ /* @__PURE__ */ c(xe, {
1244
+ "aria-label": "Calendar view",
1245
+ items: H,
1246
+ value: k,
1247
+ onValueChange: (e) => {
1248
+ e && W(e);
1249
+ }
1250
+ }),
1251
+ /* @__PURE__ */ c(pe, {
1252
+ "aria-label": "Anchor date",
1253
+ label: "Date",
1254
+ labelPosition: "left",
1255
+ value: Re(A),
1256
+ onValueChange: (e) => {
1257
+ if (!e) return;
1258
+ let t = rt(e);
1259
+ D(t), y?.(t);
1260
+ }
1261
+ }),
1262
+ /* @__PURE__ */ c("span", {
1263
+ className: "nabs-ui-event-calendar__rangeLabel",
1264
+ children: R
1265
+ })
1266
+ ]
1267
+ }) : null, tt(k) ? /* @__PURE__ */ l("div", {
1268
+ className: "nabs-ui-event-calendar__timeView",
1269
+ children: [
1270
+ /* @__PURE__ */ c("div", {
1271
+ className: "nabs-ui-event-calendar__dayHeaderRow",
1272
+ children: /* @__PURE__ */ c("div", {
1273
+ className: "nabs-ui-event-calendar__dayHeaderGrid",
1274
+ style: { gridTemplateColumns: `repeat(${z.length}, minmax(0, 1fr))` },
1275
+ children: z.map((e) => /* @__PURE__ */ l("div", {
1276
+ className: "nabs-ui-event-calendar__dayHeaderCell",
1277
+ "aria-label": e.label,
1278
+ children: [/* @__PURE__ */ c("span", { children: e.shortLabel }), /* @__PURE__ */ c("strong", { children: e.date.getDate() })]
1279
+ }, e.id))
1280
+ })
1281
+ }),
1282
+ /* @__PURE__ */ c("div", {
1283
+ className: "nabs-ui-event-calendar__allDayRow",
1284
+ children: /* @__PURE__ */ l("div", {
1285
+ className: "nabs-ui-event-calendar__spanTrack",
1286
+ style: { gridTemplateColumns: `repeat(${z.length}, minmax(0, 1fr))` },
1287
+ children: [z.map((e) => /* @__PURE__ */ c("div", { className: "nabs-ui-event-calendar__spanCell" }, `${e.id}-all-day`)), ne.map((e) => {
1288
+ let t = e.startIndex / z.length * 100, n = (e.endIndex - e.startIndex + 1) / z.length * 100, r = e.laneIndex * 1.9, i = {
1289
+ event: e.event,
1290
+ view: k,
1291
+ segmentStart: e.segmentStart,
1292
+ segmentEnd: e.segmentEnd,
1293
+ isClippedStart: e.isClippedStart,
1294
+ isClippedEnd: e.isClippedEnd
1295
+ };
1296
+ return /* @__PURE__ */ l("button", {
1297
+ type: "button",
1298
+ className: [
1299
+ "nabs-ui-event-calendar__event",
1300
+ "nabs-ui-event-calendar__event--span",
1301
+ e.event.className ?? ""
1302
+ ].filter(Boolean).join(" "),
1303
+ style: {
1304
+ left: `${t}%`,
1305
+ width: `${n}%`,
1306
+ top: `${r}rem`
1307
+ },
1308
+ onClick: (t) => {
1309
+ x?.({
1310
+ event: e.event,
1311
+ nativeEvent: t
1312
+ });
1313
+ },
1314
+ onDoubleClick: (t) => {
1315
+ S?.({
1316
+ event: e.event,
1317
+ nativeEvent: t
1318
+ });
1319
+ },
1320
+ children: [
1321
+ e.isClippedStart ? /* @__PURE__ */ c("span", {
1322
+ className: "nabs-ui-event-calendar__clipMark",
1323
+ children: "‹"
1324
+ }) : null,
1325
+ it(i, "nabs-ui-event-calendar__eventContent", _),
1326
+ e.isClippedEnd ? /* @__PURE__ */ c("span", {
1327
+ className: "nabs-ui-event-calendar__clipMark",
1328
+ children: "›"
1329
+ }) : null
1330
+ ]
1331
+ }, `${e.event.id}-${e.startIndex}-${e.endIndex}-${e.laneIndex}`);
1332
+ })]
1333
+ })
1334
+ }),
1335
+ /* @__PURE__ */ c("div", {
1336
+ className: "nabs-ui-event-calendar__timeGridArea",
1337
+ children: /* @__PURE__ */ l("div", {
1338
+ className: "nabs-ui-event-calendar__dayColumns",
1339
+ style: { gridTemplateColumns: `repeat(${z.length}, minmax(0, 1fr))` },
1340
+ children: [z.map((e) => /* @__PURE__ */ c("div", {
1341
+ className: "nabs-ui-event-calendar__dayColumn",
1342
+ children: Array.from({ length: V }, (t, n) => /* @__PURE__ */ c("div", { className: "nabs-ui-event-calendar__timeGridLine" }, `${e.id}-${n}`))
1343
+ }, `${e.id}-lane`)), B.map((e) => {
1344
+ let t = 100 / e.laneCount, n = e.laneIndex / e.laneCount * 100, r = Math.max(10, t - 2), i = z.findIndex((t) => t.id === e.columnId);
1345
+ if (i < 0) return null;
1346
+ let a = {
1347
+ event: e.event,
1348
+ view: k,
1349
+ segmentStart: e.start,
1350
+ segmentEnd: e.end,
1351
+ isClippedStart: !1,
1352
+ isClippedEnd: !1
1353
+ };
1354
+ return /* @__PURE__ */ c("div", {
1355
+ className: "nabs-ui-event-calendar__timedContainer",
1356
+ style: {
1357
+ gridColumn: `${i + 1}`,
1358
+ top: `${e.topPct}%`,
1359
+ height: `${e.heightPct}%`
1360
+ },
1361
+ children: /* @__PURE__ */ l("button", {
1362
+ type: "button",
1363
+ className: [
1364
+ "nabs-ui-event-calendar__event",
1365
+ "nabs-ui-event-calendar__event--timed",
1366
+ e.event.className ?? ""
1367
+ ].filter(Boolean).join(" "),
1368
+ style: {
1369
+ left: `${n}%`,
1370
+ width: `${r}%`
1371
+ },
1372
+ onClick: (t) => {
1373
+ x?.({
1374
+ event: e.event,
1375
+ nativeEvent: t
1376
+ });
1377
+ },
1378
+ onDoubleClick: (t) => {
1379
+ S?.({
1380
+ event: e.event,
1381
+ nativeEvent: t
1382
+ });
1383
+ },
1384
+ children: [/* @__PURE__ */ c("div", {
1385
+ className: "nabs-ui-event-calendar__eventMeta",
1386
+ children: nt(e.start, e.end)
1387
+ }), it(a, "nabs-ui-event-calendar__eventContent", _)]
1388
+ })
1389
+ }, `${e.event.id}-${e.columnId}-${e.laneIndex}-${e.topPct}`);
1390
+ })]
1391
+ })
1392
+ })
1393
+ ]
1394
+ }) : /* @__PURE__ */ c("div", {
1395
+ className: "nabs-ui-event-calendar__monthLayouts",
1396
+ children: re.map((e) => {
1397
+ let t = Number(e.id.split("-")[1] ?? "0");
1398
+ return /* @__PURE__ */ l("article", {
1399
+ className: "nabs-ui-event-calendar__monthCard",
1400
+ children: [
1401
+ /* @__PURE__ */ c("header", {
1402
+ className: "nabs-ui-event-calendar__monthHeader",
1403
+ children: /* @__PURE__ */ c("h3", { children: e.title })
1404
+ }),
1405
+ /* @__PURE__ */ c("div", {
1406
+ className: "nabs-ui-event-calendar__weekdayHeader",
1407
+ style: { gridTemplateColumns: "repeat(7, minmax(0, 1fr))" },
1408
+ children: Array.from({ length: 7 }, (t, n) => {
1409
+ let r = new Date(2026, 0, 4 + n);
1410
+ return /* @__PURE__ */ c("div", {
1411
+ className: "nabs-ui-event-calendar__weekdayCell",
1412
+ children: new Intl.DateTimeFormat(void 0, { weekday: "short" }).format(r)
1413
+ }, `${e.id}-weekday-${n}`);
1414
+ })
1415
+ }),
1416
+ /* @__PURE__ */ c("div", {
1417
+ className: "nabs-ui-event-calendar__monthWeeks",
1418
+ children: e.weeks.map((e) => /* @__PURE__ */ l("div", {
1419
+ className: "nabs-ui-event-calendar__monthWeek",
1420
+ children: [/* @__PURE__ */ c("div", {
1421
+ className: "nabs-ui-event-calendar__monthWeekDays",
1422
+ style: { gridTemplateColumns: "repeat(7, minmax(0, 1fr))" },
1423
+ children: e.days.map((n) => /* @__PURE__ */ c("div", {
1424
+ className: ["nabs-ui-event-calendar__monthDayCell", n.getMonth() === t ? "" : "nabs-ui-event-calendar__monthDayCell--outside"].filter(Boolean).join(" "),
1425
+ children: /* @__PURE__ */ c("span", {
1426
+ className: "nabs-ui-event-calendar__monthDayNumber",
1427
+ children: n.getDate()
1428
+ })
1429
+ }, `${e.id}-${n.toISOString()}`))
1430
+ }), /* @__PURE__ */ c("div", {
1431
+ className: "nabs-ui-event-calendar__monthWeekSpans",
1432
+ children: e.segments.map((t) => {
1433
+ let n = t.startIndex / 7 * 100, r = (t.endIndex - t.startIndex + 1) / 7 * 100, i = t.laneIndex * 1.85, a = {
1434
+ event: t.event,
1435
+ view: k,
1436
+ segmentStart: t.segmentStart,
1437
+ segmentEnd: t.segmentEnd,
1438
+ isClippedStart: t.isClippedStart,
1439
+ isClippedEnd: t.isClippedEnd
1440
+ };
1441
+ return /* @__PURE__ */ l("button", {
1442
+ type: "button",
1443
+ className: [
1444
+ "nabs-ui-event-calendar__event",
1445
+ "nabs-ui-event-calendar__event--month",
1446
+ t.event.className ?? ""
1447
+ ].filter(Boolean).join(" "),
1448
+ style: {
1449
+ left: `${n}%`,
1450
+ width: `${r}%`,
1451
+ top: `${i}rem`
1452
+ },
1453
+ onClick: (e) => {
1454
+ x?.({
1455
+ event: t.event,
1456
+ nativeEvent: e
1457
+ });
1458
+ },
1459
+ onDoubleClick: (e) => {
1460
+ S?.({
1461
+ event: t.event,
1462
+ nativeEvent: e
1463
+ });
1464
+ },
1465
+ children: [
1466
+ t.isClippedStart ? /* @__PURE__ */ c("span", {
1467
+ className: "nabs-ui-event-calendar__clipMark",
1468
+ children: "‹"
1469
+ }) : null,
1470
+ /* @__PURE__ */ c("div", {
1471
+ className: "nabs-ui-event-calendar__eventMeta",
1472
+ children: nt(t.segmentStart, t.segmentEnd)
1473
+ }),
1474
+ it(a, "nabs-ui-event-calendar__eventContent", _),
1475
+ t.isClippedEnd ? /* @__PURE__ */ c("span", {
1476
+ className: "nabs-ui-event-calendar__clipMark",
1477
+ children: "›"
1478
+ }) : null
1479
+ ]
1480
+ }, `${e.id}-${t.event.id}-${t.startIndex}-${t.endIndex}-${t.laneIndex}`);
1481
+ })
1482
+ })]
1483
+ }, e.id))
1484
+ })
1485
+ ]
1486
+ }, e.id);
1487
+ })
1488
+ })]
1489
+ });
1490
+ });
1491
+ at.displayName = "EventCalendar";
1492
+ //#endregion
1493
+ export { d as Branding, b as Breadcrumb, at as EventCalendar, H as PieChart, u as Shell, I as TwoDChart };