@medha-analytics/medha-one-access-react 1.0.7 → 1.0.8

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.js CHANGED
@@ -14400,25 +14400,27 @@ function vb({ className: e, ...t }) {
14400
14400
  }
14401
14401
  //#endregion
14402
14402
  //#region src/components/shared/DataTable.tsx
14403
- function yb({ columns: e, data: t, totalCount: n, isLoading: r = !1, emptyMessage: i = "No results found", onSearchChange: a, onPaginationChange: s, pageSize: l = 20, searchPlaceholder: u = "Search...", toolbar: d, statusFilter: p, onStatusFilterChange: m }) {
14404
- let [h, v] = f({
14403
+ function yb({ columns: e, data: t, totalCount: n, isLoading: r = !1, emptyMessage: i = "No results found", onSearchChange: a, onPaginationChange: s, pageSize: l = 20, searchPlaceholder: u = "Search...", toolbar: p, statusFilter: m, onStatusFilterChange: h }) {
14404
+ let [v, y] = f({
14405
14405
  pageIndex: 0,
14406
14406
  pageSize: l
14407
- }), [y, b] = f(""), x = o((e) => {
14408
- b(e), a?.(e);
14407
+ }), [b, x] = f(""), S = d(void 0), C = o((e) => {
14408
+ x(e), S.current && clearTimeout(S.current), S.current = setTimeout(() => a?.(e), 400);
14409
14409
  }, [a]);
14410
- c(() => {
14411
- s?.(h);
14412
- }, [h, s]);
14413
- let S = Cn({
14410
+ c(() => () => {
14411
+ S.current && clearTimeout(S.current);
14412
+ }, []), c(() => {
14413
+ s?.(v);
14414
+ }, [v, s]);
14415
+ let w = Cn({
14414
14416
  data: t,
14415
14417
  columns: e,
14416
- pageCount: Math.ceil(n / h.pageSize),
14417
- state: { pagination: h },
14418
- onPaginationChange: v,
14418
+ pageCount: Math.ceil(n / v.pageSize),
14419
+ state: { pagination: v },
14420
+ onPaginationChange: y,
14419
14421
  getCoreRowModel: vn(),
14420
14422
  manualPagination: !0
14421
- }), C = Math.ceil(n / h.pageSize);
14423
+ }), T = Math.ceil(n / v.pageSize);
14422
14424
  return /* @__PURE__ */ _("div", {
14423
14425
  className: "space-y-4",
14424
14426
  children: [
@@ -14429,44 +14431,44 @@ function yb({ columns: e, data: t, totalCount: n, isLoading: r = !1, emptyMessag
14429
14431
  className: "relative flex-1 max-w-sm",
14430
14432
  children: [/* @__PURE__ */ g(xe, { className: "absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ g(ub, {
14431
14433
  placeholder: u,
14432
- value: y,
14433
- onChange: (e) => x(e.target.value),
14434
+ value: b,
14435
+ onChange: (e) => C(e.target.value),
14434
14436
  className: "pl-8"
14435
14437
  })]
14436
14438
  }),
14437
- m && /* @__PURE__ */ g("div", {
14439
+ h && /* @__PURE__ */ g("div", {
14438
14440
  className: "flex items-center rounded-md border",
14439
14441
  children: [
14440
14442
  "all",
14441
14443
  "active",
14442
14444
  "inactive"
14443
14445
  ].map((e) => /* @__PURE__ */ g("button", {
14444
- onClick: () => m(e),
14445
- className: H("cursor-pointer px-3 py-1.5 text-xs font-medium capitalize transition-colors first:rounded-l-md last:rounded-r-md", p === e ? "bg-primary text-primary-foreground" : "bg-background text-muted-foreground hover:bg-accent"),
14446
+ onClick: () => h(e),
14447
+ className: H("cursor-pointer px-3 py-1.5 text-xs font-medium capitalize transition-colors first:rounded-l-md last:rounded-r-md", m === e ? "bg-primary text-primary-foreground" : "bg-background text-muted-foreground hover:bg-accent"),
14446
14448
  children: e
14447
14449
  }, e))
14448
14450
  }),
14449
- d && /* @__PURE__ */ g("div", {
14451
+ p && /* @__PURE__ */ g("div", {
14450
14452
  className: "flex items-center gap-2",
14451
- children: d
14453
+ children: p
14452
14454
  })
14453
14455
  ]
14454
14456
  }),
14455
14457
  /* @__PURE__ */ g("div", {
14456
14458
  className: "rounded-md border",
14457
- children: /* @__PURE__ */ _(ib, { children: [/* @__PURE__ */ g(ab, { children: S.getHeaderGroups().map((e) => /* @__PURE__ */ g(sb, { children: e.headers.map((e) => /* @__PURE__ */ g(cb, { children: e.isPlaceholder ? null : yn(e.column.columnDef.header, e.getContext()) }, e.id)) }, e.id)) }), /* @__PURE__ */ g(ob, { children: r ? Array.from({ length: h.pageSize }).map((t, n) => /* @__PURE__ */ g(sb, { children: e.map((e, t) => /* @__PURE__ */ g(lb, { children: /* @__PURE__ */ g(vb, { className: "h-4 w-full animate-pulse" }) }, t)) }, n)) : S.getRowModel().rows.length === 0 ? /* @__PURE__ */ g(sb, { children: /* @__PURE__ */ g(lb, {
14459
+ children: /* @__PURE__ */ _(ib, { children: [/* @__PURE__ */ g(ab, { children: w.getHeaderGroups().map((e) => /* @__PURE__ */ g(sb, { children: e.headers.map((e) => /* @__PURE__ */ g(cb, { children: e.isPlaceholder ? null : yn(e.column.columnDef.header, e.getContext()) }, e.id)) }, e.id)) }), /* @__PURE__ */ g(ob, { children: r ? Array.from({ length: v.pageSize }).map((t, n) => /* @__PURE__ */ g(sb, { children: e.map((e, t) => /* @__PURE__ */ g(lb, { children: /* @__PURE__ */ g(vb, { className: "h-4 w-full animate-pulse" }) }, t)) }, n)) : w.getRowModel().rows.length === 0 ? /* @__PURE__ */ g(sb, { children: /* @__PURE__ */ g(lb, {
14458
14460
  colSpan: e.length,
14459
14461
  className: "h-24 text-center text-muted-foreground",
14460
14462
  children: i
14461
- }) }) : S.getRowModel().rows.map((e) => /* @__PURE__ */ g(sb, { children: e.getVisibleCells().map((e) => /* @__PURE__ */ g(lb, { children: yn(e.column.columnDef.cell, e.getContext()) }, e.id)) }, e.id)) })] })
14463
+ }) }) : w.getRowModel().rows.map((e) => /* @__PURE__ */ g(sb, { children: e.getVisibleCells().map((e) => /* @__PURE__ */ g(lb, { children: yn(e.column.columnDef.cell, e.getContext()) }, e.id)) }, e.id)) })] })
14462
14464
  }),
14463
14465
  n > 0 && /* @__PURE__ */ _("div", {
14464
14466
  className: "flex items-center justify-between",
14465
14467
  children: [/* @__PURE__ */ _("div", {
14466
14468
  className: "flex items-center gap-2 text-sm text-muted-foreground",
14467
14469
  children: [/* @__PURE__ */ g("span", { children: "Rows per page:" }), /* @__PURE__ */ _(db, {
14468
- value: String(h.pageSize),
14469
- onValueChange: (e) => v({
14470
+ value: String(v.pageSize),
14471
+ onValueChange: (e) => y({
14470
14472
  pageIndex: 0,
14471
14473
  pageSize: Number(e)
14472
14474
  }),
@@ -14488,9 +14490,9 @@ function yb({ columns: e, data: t, totalCount: n, isLoading: r = !1, emptyMessag
14488
14490
  /* @__PURE__ */ _("span", {
14489
14491
  className: "text-muted-foreground",
14490
14492
  children: [
14491
- h.pageIndex * h.pageSize + 1,
14493
+ v.pageIndex * v.pageSize + 1,
14492
14494
  "–",
14493
- Math.min((h.pageIndex + 1) * h.pageSize, n),
14495
+ Math.min((v.pageIndex + 1) * v.pageSize, n),
14494
14496
  " of ",
14495
14497
  n
14496
14498
  ]
@@ -14498,21 +14500,21 @@ function yb({ columns: e, data: t, totalCount: n, isLoading: r = !1, emptyMessag
14498
14500
  /* @__PURE__ */ g(qh, {
14499
14501
  variant: "ghost",
14500
14502
  size: "icon",
14501
- onClick: () => v((e) => ({
14503
+ onClick: () => y((e) => ({
14502
14504
  ...e,
14503
14505
  pageIndex: e.pageIndex - 1
14504
14506
  })),
14505
- disabled: h.pageIndex === 0,
14507
+ disabled: v.pageIndex === 0,
14506
14508
  children: /* @__PURE__ */ g(pe, { className: "h-4 w-4" })
14507
14509
  }),
14508
14510
  /* @__PURE__ */ g(qh, {
14509
14511
  variant: "ghost",
14510
14512
  size: "icon",
14511
- onClick: () => v((e) => ({
14513
+ onClick: () => y((e) => ({
14512
14514
  ...e,
14513
14515
  pageIndex: e.pageIndex + 1
14514
14516
  })),
14515
- disabled: h.pageIndex >= C - 1,
14517
+ disabled: v.pageIndex >= T - 1,
14516
14518
  children: /* @__PURE__ */ g(me, { className: "h-4 w-4" })
14517
14519
  })
14518
14520
  ]
@@ -18774,7 +18776,9 @@ function gw(e = {}) {
18774
18776
  queryKey: ["access-rules", e],
18775
18777
  queryFn: async () => {
18776
18778
  let e = {};
18777
- return n !== void 0 && (e.skip = n), r !== void 0 && (e.limit = r), i !== void 0 && (e.active = i), a && (e.application_name = a), o && o.trim() && (e.search = o.trim()), ((await t.get("/access-rules/", { params: e })).data ?? []).map(hw);
18779
+ n !== void 0 && (e.skip = n), r !== void 0 && (e.limit = r), i !== void 0 && (e.active = i), a && (e.application_name = a);
18780
+ let s = o && o.trim() ? "/access-rules/search" : "/access-rules/";
18781
+ return o && o.trim() && (e.search = o.trim()), ((await t.get(s, { params: e })).data ?? []).map(hw);
18778
18782
  }
18779
18783
  });
18780
18784
  }
@@ -19224,12 +19228,14 @@ function Nw({ open: e, onClose: t, user: n }) {
19224
19228
  //#endregion
19225
19229
  //#region src/core/hooks/useArtifacts.ts
19226
19230
  function Pw(e = {}) {
19227
- let t = G(), { skip: n, limit: r, activeOnly: i, appName: a, type: o } = e;
19231
+ let t = G(), { skip: n, limit: r, activeOnly: i, appName: a, type: o, search: s } = e;
19228
19232
  return C({
19229
19233
  queryKey: ["artifacts", e],
19230
19234
  queryFn: async () => {
19231
19235
  let e = {};
19232
- return n !== void 0 && (e.skip = n), r !== void 0 && (e.limit = r), i !== void 0 && (e.active = i), a && (e.application_name = a), o && (e.artifact_type = o), (await t.get("/artifacts/", { params: e })).data;
19236
+ n !== void 0 && (e.skip = n), r !== void 0 && (e.limit = r), i !== void 0 && (e.active = i), a && (e.application_name = a), o && (e.artifact_type = o);
19237
+ let c = s && s.trim() ? "/artifacts/search" : "/artifacts/";
19238
+ return s && s.trim() && (e.search = s.trim()), (await t.get(c, { params: e })).data;
19233
19239
  }
19234
19240
  });
19235
19241
  }
@@ -19353,7 +19359,11 @@ function Kw(e) {
19353
19359
  return `${t === 0 && e.operator === "+" ? "" : e.operator}${n}`;
19354
19360
  }).join("");
19355
19361
  }
19356
- function qw({ type: e, value: t, onChange: n, label: r, required: i }) {
19362
+ var qw = {
19363
+ user: "user",
19364
+ resource: "artifact"
19365
+ };
19366
+ function Jw({ type: e, value: t, onChange: n, label: r, required: i }) {
19357
19367
  let [a, s] = f(""), [c, l] = f(!1), u = d(null), p = aw({ activeOnly: !0 }), m = cw(), h = Pw({ type: "RESOURCE" }), v = Pw({ type: "RESOURCEGROUP" }), { data: y } = Ew(t, e), b = e === "user" ? p.isLoading || m.isLoading : h.isLoading || v.isLoading, x = a.startsWith("-") ? "-" : "+", S = a.replace(/^[+-]/, "").trim().toLowerCase(), C = (() => {
19358
19368
  if (e === "user") {
19359
19369
  let e = p.data ?? [], t = m.data ?? [], n = (S ? e.filter((e) => {
@@ -19383,17 +19393,33 @@ function qw({ type: e, value: t, onChange: n, label: r, required: i }) {
19383
19393
  kind: "resourcegroup"
19384
19394
  }));
19385
19395
  return [...r, ...i];
19386
- })(), w = Gw(t), T = o((e, t, r) => {
19387
- w.find((t) => t.entity === e) || (n(Kw([...w, {
19396
+ })(), w = (() => {
19397
+ let t = /* @__PURE__ */ new Map();
19398
+ if (e === "user") {
19399
+ for (let e of p.data ?? []) {
19400
+ let n = `${e.first_name ?? ""} ${e.last_name ?? ""}`.trim();
19401
+ t.set(e.id, n || e.email || e.id);
19402
+ }
19403
+ for (let e of m.data ?? []) t.set(e.id, e.name ?? e.id);
19404
+ } else {
19405
+ for (let e of h.data ?? []) t.set(e.id, e.name ?? e.id);
19406
+ for (let e of v.data ?? []) t.set(e.id, e.name ?? e.id);
19407
+ }
19408
+ return t;
19409
+ })(), T = Gw(t).map((e) => ({
19410
+ ...e,
19411
+ label: w.get(e.entity) ?? e.entity
19412
+ })), E = o((e, t, r) => {
19413
+ T.find((t) => t.entity === e) || (n(Kw([...T, {
19388
19414
  raw: `${r}${e}`,
19389
19415
  operator: r,
19390
19416
  entity: e,
19391
19417
  label: t
19392
19418
  }])), s(""), l(!1), u.current?.focus());
19393
- }, [w, n]), E = o((e) => {
19394
- n(Kw(w.filter((t, n) => n !== e)));
19395
- }, [w, n]), D = o((e) => {
19396
- n(Kw(w.map((t, n) => {
19419
+ }, [T, n]), D = o((e) => {
19420
+ n(Kw(T.filter((t, n) => n !== e)));
19421
+ }, [T, n]), O = o((e) => {
19422
+ n(Kw(T.map((t, n) => {
19397
19423
  if (n !== e) return t;
19398
19424
  let r = t.operator === "+" ? "-" : "+";
19399
19425
  return {
@@ -19402,12 +19428,12 @@ function qw({ type: e, value: t, onChange: n, label: r, required: i }) {
19402
19428
  raw: `${r}${t.entity}`
19403
19429
  };
19404
19430
  })));
19405
- }, [w, n]);
19406
- function O(e) {
19431
+ }, [T, n]);
19432
+ function k(e) {
19407
19433
  s(e.target.value), l(!0);
19408
19434
  }
19409
- function k(e) {
19410
- e.key === "Backspace" && !a && w.length > 0 && E(w.length - 1), e.key === "Escape" && (l(!1), s(""));
19435
+ function A(e) {
19436
+ e.key === "Backspace" && !a && T.length > 0 && D(T.length - 1), e.key === "Escape" && (l(!1), s(""));
19411
19437
  }
19412
19438
  return /* @__PURE__ */ _("div", {
19413
19439
  className: "space-y-2 relative",
@@ -19419,13 +19445,13 @@ function qw({ type: e, value: t, onChange: n, label: r, required: i }) {
19419
19445
  /* @__PURE__ */ _("div", {
19420
19446
  className: "min-h-9 rounded-md border border-input bg-background px-3 py-1.5 flex flex-wrap gap-1.5 items-center cursor-text focus-within:ring-1 focus-within:ring-ring",
19421
19447
  onClick: () => u.current?.focus(),
19422
- children: [w.map((e, t) => /* @__PURE__ */ _(Yh, {
19448
+ children: [T.map((e, t) => /* @__PURE__ */ _(Yh, {
19423
19449
  variant: e.operator === "+" ? "success" : "destructive",
19424
19450
  className: "flex items-center gap-1 pr-1",
19425
19451
  children: [
19426
19452
  /* @__PURE__ */ g("button", {
19427
19453
  type: "button",
19428
- onClick: () => D(t),
19454
+ onClick: () => O(t),
19429
19455
  className: "cursor-pointer hover:opacity-70",
19430
19456
  title: "Toggle include/exclude",
19431
19457
  children: e.operator === "+" ? /* @__PURE__ */ g(be, { className: "h-3 w-3" }) : /* @__PURE__ */ g(ve, { className: "h-3 w-3" })
@@ -19436,7 +19462,7 @@ function qw({ type: e, value: t, onChange: n, label: r, required: i }) {
19436
19462
  }),
19437
19463
  /* @__PURE__ */ g("button", {
19438
19464
  type: "button",
19439
- onClick: () => E(t),
19465
+ onClick: () => D(t),
19440
19466
  className: "cursor-pointer hover:opacity-70 ml-0.5",
19441
19467
  "aria-label": `Remove ${e.entity}`,
19442
19468
  children: /* @__PURE__ */ g(Ee, { className: "h-3 w-3" })
@@ -19446,11 +19472,11 @@ function qw({ type: e, value: t, onChange: n, label: r, required: i }) {
19446
19472
  ref: u,
19447
19473
  type: "text",
19448
19474
  value: a,
19449
- onChange: O,
19450
- onKeyDown: k,
19475
+ onChange: k,
19476
+ onKeyDown: A,
19451
19477
  onFocus: () => l(!0),
19452
19478
  onBlur: () => setTimeout(() => l(!1), 150),
19453
- placeholder: w.length === 0 ? `Type + or - then ${e} name…` : "",
19479
+ placeholder: T.length === 0 ? `Type + or - then ${qw[e]} name…` : "",
19454
19480
  className: "flex-1 min-w-28 bg-transparent text-sm outline-none placeholder:text-muted-foreground"
19455
19481
  })]
19456
19482
  }),
@@ -19463,7 +19489,7 @@ function qw({ type: e, value: t, onChange: n, label: r, required: i }) {
19463
19489
  className: "px-3 py-2 text-sm text-muted-foreground",
19464
19490
  children: [
19465
19491
  "No ",
19466
- e,
19492
+ qw[e],
19467
19493
  "s found"
19468
19494
  ]
19469
19495
  }) : /* @__PURE__ */ g("ul", {
@@ -19471,7 +19497,7 @@ function qw({ type: e, value: t, onChange: n, label: r, required: i }) {
19471
19497
  children: C.map((e) => /* @__PURE__ */ g("li", { children: /* @__PURE__ */ _("button", {
19472
19498
  type: "button",
19473
19499
  className: "w-full cursor-pointer text-left px-3 py-2 text-sm hover:bg-accent flex items-center gap-2",
19474
- onMouseDown: () => T(e.id, e.label, x),
19500
+ onMouseDown: () => E(e.id, e.label, x),
19475
19501
  children: [
19476
19502
  /* @__PURE__ */ g("span", {
19477
19503
  className: `font-mono text-xs font-bold ${x === "+" ? "text-green-600" : "text-red-500"}`,
@@ -19501,14 +19527,14 @@ function qw({ type: e, value: t, onChange: n, label: r, required: i }) {
19501
19527
  }
19502
19528
  //#endregion
19503
19529
  //#region src/core/hooks/useGroups.ts
19504
- function Jw(e) {
19530
+ function Yw(e) {
19505
19531
  let t = e.user_metadata ?? {}, n = e.id;
19506
19532
  return t.name ? n = t.name : e.first_name || e.last_name ? n = `${e.first_name ?? ""} ${e.last_name ?? ""}`.trim() : e.description && (n = e.description), {
19507
19533
  ...e,
19508
19534
  name: n
19509
19535
  };
19510
19536
  }
19511
- function Yw(e = {}) {
19537
+ function Xw(e = {}) {
19512
19538
  let t = G(), { skip: n, limit: r, activeOnly: i, search: a } = e;
19513
19539
  return C({
19514
19540
  queryKey: ["groups", e],
@@ -19516,13 +19542,13 @@ function Yw(e = {}) {
19516
19542
  let e = { user_type: "USERGROUP" };
19517
19543
  if (i !== void 0 && (e.active = i), a && a.trim()) {
19518
19544
  let n = await t.get("/users/", { params: e }), r = a.trim().toLowerCase();
19519
- return (n.data ?? []).map(Jw).filter((e) => (e.name ?? "").toLowerCase().includes(r) || (e.description ?? "").toLowerCase().includes(r) || e.id.toLowerCase().includes(r));
19545
+ return (n.data ?? []).map(Yw).filter((e) => (e.name ?? "").toLowerCase().includes(r) || (e.description ?? "").toLowerCase().includes(r) || e.id.toLowerCase().includes(r));
19520
19546
  }
19521
- return n !== void 0 && (e.skip = n), r !== void 0 && (e.limit = r), ((await t.get("/users/", { params: e })).data ?? []).map(Jw);
19547
+ return n !== void 0 && (e.skip = n), r !== void 0 && (e.limit = r), ((await t.get("/users/", { params: e })).data ?? []).map(Yw);
19522
19548
  }
19523
19549
  });
19524
19550
  }
19525
- function Xw(e = {}) {
19551
+ function Zw(e = {}) {
19526
19552
  let t = G(), { activeOnly: n } = e;
19527
19553
  return C({
19528
19554
  queryKey: [
@@ -19536,7 +19562,7 @@ function Xw(e = {}) {
19536
19562
  }
19537
19563
  });
19538
19564
  }
19539
- function Zw(e) {
19565
+ function Qw(e) {
19540
19566
  let t = G();
19541
19567
  return C({
19542
19568
  queryKey: ["groups", e],
@@ -19544,7 +19570,7 @@ function Zw(e) {
19544
19570
  enabled: !!e
19545
19571
  });
19546
19572
  }
19547
- function Qw(e) {
19573
+ function $w(e) {
19548
19574
  let t = G();
19549
19575
  return C({
19550
19576
  queryKey: [
@@ -19561,14 +19587,14 @@ function Qw(e) {
19561
19587
  enabled: !!e
19562
19588
  });
19563
19589
  }
19564
- function $w() {
19590
+ function eT() {
19565
19591
  let e = G(), t = w();
19566
19592
  return S({
19567
19593
  mutationFn: async (t) => (await e.post("/users/", t)).data,
19568
19594
  onSuccess: () => t.invalidateQueries({ queryKey: ["groups"] })
19569
19595
  });
19570
19596
  }
19571
- function eT() {
19597
+ function tT() {
19572
19598
  let e = G(), t = w();
19573
19599
  return S({
19574
19600
  mutationFn: async (t) => (await e.put(`/users/${t.id}`, t)).data,
@@ -19577,7 +19603,7 @@ function eT() {
19577
19603
  }
19578
19604
  });
19579
19605
  }
19580
- function tT() {
19606
+ function nT() {
19581
19607
  let e = G(), t = w();
19582
19608
  return S({
19583
19609
  mutationFn: async (t) => {
@@ -19586,7 +19612,7 @@ function tT() {
19586
19612
  onSuccess: () => t.invalidateQueries({ queryKey: ["groups"] })
19587
19613
  });
19588
19614
  }
19589
- function nT() {
19615
+ function rT() {
19590
19616
  let e = G(), t = w();
19591
19617
  return S({
19592
19618
  mutationFn: async ({ groupId: t, userId: n }) => {
@@ -19599,7 +19625,7 @@ function nT() {
19599
19625
  ] })
19600
19626
  });
19601
19627
  }
19602
- function rT() {
19628
+ function iT() {
19603
19629
  let e = G(), t = w();
19604
19630
  return S({
19605
19631
  mutationFn: async ({ groupId: t, userId: n }) => {
@@ -19614,14 +19640,14 @@ function rT() {
19614
19640
  }
19615
19641
  //#endregion
19616
19642
  //#region src/components/dialogs/GroupDialog.tsx
19617
- var iT = JC({
19643
+ var aT = JC({
19618
19644
  name: KC().min(1, "Name is required"),
19619
19645
  description: KC().optional(),
19620
19646
  expression: KC().min(1, "Expression is required")
19621
19647
  });
19622
- function aT({ open: e, onClose: t, group: n }) {
19623
- let r = !!n, i = $w(), a = eT(), { register: o, handleSubmit: s, watch: l, setValue: u, formState: { errors: d }, reset: f } = uS({
19624
- resolver: gS(iT),
19648
+ function oT({ open: e, onClose: t, group: n }) {
19649
+ let r = !!n, i = eT(), a = tT(), { register: o, handleSubmit: s, watch: l, setValue: u, formState: { errors: d }, reset: f } = uS({
19650
+ resolver: gS(aT),
19625
19651
  defaultValues: {
19626
19652
  name: "",
19627
19653
  description: "",
@@ -19652,7 +19678,7 @@ function aT({ open: e, onClose: t, group: n }) {
19652
19678
  function m() {
19653
19679
  f(), t();
19654
19680
  }
19655
- let { data: h = [], isLoading: v } = Qw(r ? n.id : ""), { data: y = [], isLoading: b } = Cw(r ? n.id : "");
19681
+ let { data: h = [], isLoading: v } = $w(r ? n.id : ""), { data: y = [], isLoading: b } = Cw(r ? n.id : "");
19656
19682
  return /* @__PURE__ */ g(XC, {
19657
19683
  open: e,
19658
19684
  onOpenChange: (e) => !e && m(),
@@ -19710,7 +19736,7 @@ function aT({ open: e, onClose: t, group: n }) {
19710
19736
  ...o("description")
19711
19737
  })]
19712
19738
  }),
19713
- /* @__PURE__ */ g(qw, {
19739
+ /* @__PURE__ */ g(Jw, {
19714
19740
  type: "user",
19715
19741
  value: l("expression"),
19716
19742
  onChange: (e) => u("expression", e),
@@ -19786,12 +19812,12 @@ function aT({ open: e, onClose: t, group: n }) {
19786
19812
  }
19787
19813
  //#endregion
19788
19814
  //#region src/components/views/GroupsView.tsx
19789
- function oT() {
19790
- let [e, t] = f(0), [n, r] = f(20), [i, a] = f(""), [o, s] = f(!1), [c, l] = f(), [u, d] = f(), { data: p = [], isLoading: m, isError: h, refetch: v } = Yw({
19815
+ function sT() {
19816
+ let [e, t] = f(0), [n, r] = f(20), [i, a] = f(""), [o, s] = f(!1), [c, l] = f(), [u, d] = f(), { data: p = [], isLoading: m, isError: h, refetch: v } = Xw({
19791
19817
  skip: e,
19792
19818
  limit: n,
19793
19819
  search: i
19794
- }), { data: y = 0 } = Xw(), b = tT();
19820
+ }), { data: y = 0 } = Zw(), b = nT();
19795
19821
  return /* @__PURE__ */ _("div", {
19796
19822
  className: "space-y-4",
19797
19823
  children: [
@@ -19868,7 +19894,7 @@ function oT() {
19868
19894
  t(e.pageIndex * e.pageSize), r(e.pageSize);
19869
19895
  }
19870
19896
  }),
19871
- /* @__PURE__ */ g(aT, {
19897
+ /* @__PURE__ */ g(oT, {
19872
19898
  open: o,
19873
19899
  onClose: () => {
19874
19900
  s(!1), l(void 0);
@@ -19890,7 +19916,7 @@ function oT() {
19890
19916
  }
19891
19917
  //#endregion
19892
19918
  //#region src/core/lib/expression.ts
19893
- function sT(e) {
19919
+ function cT(e) {
19894
19920
  if (!e) return [];
19895
19921
  let t = e.replace(/“/g, "\"").replace(/”/g, "\""), n = [], r = /([+-]?)\s*(".*?"|[^+-]+)/g, i, a = !0;
19896
19922
  for (; (i = r.exec(t)) !== null;) {
@@ -19905,13 +19931,13 @@ function sT(e) {
19905
19931
  }
19906
19932
  return n;
19907
19933
  }
19908
- function cT(e, t, n) {
19934
+ function lT(e, t, n) {
19909
19935
  if (!t) return !1;
19910
19936
  let r = /* @__PURE__ */ new Set();
19911
19937
  function i(t, a = 0) {
19912
19938
  if (a > 10) return !1;
19913
19939
  let o = !1;
19914
- for (let s of sT(t)) {
19940
+ for (let s of cT(t)) {
19915
19941
  let t = s.entity.trim();
19916
19942
  if (t === e) {
19917
19943
  o = s.type === "include";
@@ -19930,20 +19956,20 @@ function cT(e, t, n) {
19930
19956
  }
19931
19957
  //#endregion
19932
19958
  //#region src/core/hooks/useHierarchy.ts
19933
- function lT(e) {
19959
+ function uT(e) {
19934
19960
  return e.user_metadata?.name || e.name || e.id;
19935
19961
  }
19936
- function uT(e) {
19962
+ function dT(e) {
19937
19963
  return e.name || [e.first_name, e.last_name].filter(Boolean).join(" ") || e.id;
19938
19964
  }
19939
- function dT(e, t) {
19965
+ function fT(e, t) {
19940
19966
  let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
19941
19967
  for (let t of e) if (n.set(t.id, {
19942
19968
  id: t.id,
19943
- name: lT(t),
19969
+ name: uT(t),
19944
19970
  type: "USERGROUP",
19945
19971
  children: []
19946
- }), t.expression) for (let n of sT(t.expression)) {
19972
+ }), t.expression) for (let n of cT(t.expression)) {
19947
19973
  let i = n.entity.trim();
19948
19974
  n.type === "include" && e.some((e) => e.id === i) && (r.has(i) || r.set(i, []), r.get(i).push(t.id));
19949
19975
  }
@@ -19954,9 +19980,9 @@ function dT(e, t) {
19954
19980
  }
19955
19981
  let o = e.find((e) => e.id === i);
19956
19982
  if (!o?.expression) continue;
19957
- let s = t.filter((t) => cT(t.id, o.expression, e)).map((e) => ({
19983
+ let s = t.filter((t) => lT(t.id, o.expression, e)).map((e) => ({
19958
19984
  id: e.id,
19959
- name: uT(e),
19985
+ name: dT(e),
19960
19986
  type: "USER",
19961
19987
  children: [],
19962
19988
  email: e.email,
@@ -19969,9 +19995,9 @@ function dT(e, t) {
19969
19995
  name: "Groups",
19970
19996
  type: "USERGROUP",
19971
19997
  children: Array.from(n.values())
19972
- }], a = t.filter((t) => !e.some((n) => n.expression && cT(t.id, n.expression, e))).map((e) => ({
19998
+ }], a = t.filter((t) => !e.some((n) => n.expression && lT(t.id, n.expression, e))).map((e) => ({
19973
19999
  id: e.id,
19974
- name: uT(e),
20000
+ name: dT(e),
19975
20001
  type: "USER",
19976
20002
  children: [],
19977
20003
  email: e.email,
@@ -19984,24 +20010,24 @@ function dT(e, t) {
19984
20010
  children: a
19985
20011
  }), i;
19986
20012
  }
19987
- function fT() {
20013
+ function pT() {
19988
20014
  let e = G();
19989
20015
  return C({
19990
20016
  queryKey: ["hierarchy", "org"],
19991
20017
  queryFn: async () => (await e.get("/reporting/organization-chart")).data
19992
20018
  });
19993
20019
  }
19994
- function pT() {
20020
+ function mT() {
19995
20021
  let e = G();
19996
20022
  return C({
19997
20023
  queryKey: ["hierarchy", "combined"],
19998
20024
  queryFn: async () => {
19999
20025
  let [t, n] = await Promise.all([e.get("/users/", { params: { user_type: "USERGROUP" } }), e.get("/users/", { params: { user_type: "USER" } })]);
20000
- return dT(t.data ?? [], n.data ?? []);
20026
+ return fT(t.data ?? [], n.data ?? []);
20001
20027
  }
20002
20028
  });
20003
20029
  }
20004
- function mT(e, t) {
20030
+ function hT(e, t) {
20005
20031
  let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
20006
20032
  for (let t of e) if (n.set(t.id, {
20007
20033
  id: t.id,
@@ -20009,7 +20035,7 @@ function mT(e, t) {
20009
20035
  type: "RESOURCEGROUP",
20010
20036
  children: [],
20011
20037
  application: t.application
20012
- }), t.expression) for (let n of sT(t.expression)) {
20038
+ }), t.expression) for (let n of cT(t.expression)) {
20013
20039
  let i = n.entity.trim();
20014
20040
  n.type === "include" && e.some((e) => e.id === i) && (r.has(i) || r.set(i, []), r.get(i).push(t.id));
20015
20041
  }
@@ -20020,7 +20046,7 @@ function mT(e, t) {
20020
20046
  }
20021
20047
  let o = e.find((e) => e.id === i);
20022
20048
  if (!o?.expression) continue;
20023
- let s = t.filter((t) => cT(t.id, o.expression, e)).map((e) => ({
20049
+ let s = t.filter((t) => lT(t.id, o.expression, e)).map((e) => ({
20024
20050
  id: e.id,
20025
20051
  name: e.name || e.id,
20026
20052
  type: "RESOURCE",
@@ -20031,10 +20057,10 @@ function mT(e, t) {
20031
20057
  }
20032
20058
  let i = [{
20033
20059
  id: "groups_root",
20034
- name: "Resource Groups",
20060
+ name: "Artifact Groups",
20035
20061
  type: "RESOURCEGROUP",
20036
20062
  children: Array.from(n.values())
20037
- }], a = t.filter((t) => !e.some((n) => n.expression && cT(t.id, n.expression, e))).map((e) => ({
20063
+ }], a = t.filter((t) => !e.some((n) => n.expression && lT(t.id, n.expression, e))).map((e) => ({
20038
20064
  id: e.id,
20039
20065
  name: e.name || e.id,
20040
20066
  type: "RESOURCE",
@@ -20043,30 +20069,30 @@ function mT(e, t) {
20043
20069
  }));
20044
20070
  return a.length > 0 && i.push({
20045
20071
  id: "artifacts_root",
20046
- name: "Ungrouped Resources",
20072
+ name: "Ungrouped Artifacts",
20047
20073
  type: "RESOURCE",
20048
20074
  children: a
20049
20075
  }), i;
20050
20076
  }
20051
- function hT() {
20077
+ function gT() {
20052
20078
  let e = G();
20053
20079
  return C({
20054
20080
  queryKey: ["hierarchy", "artifacts-combined"],
20055
20081
  queryFn: async () => {
20056
20082
  let [t, n] = await Promise.all([e.get("/artifacts/", { params: { artifact_type: "RESOURCEGROUP" } }), e.get("/artifacts/", { params: { artifact_type: "RESOURCE" } })]);
20057
- return mT(t.data ?? [], n.data ?? []);
20083
+ return hT(t.data ?? [], n.data ?? []);
20058
20084
  }
20059
20085
  });
20060
20086
  }
20061
20087
  //#endregion
20062
20088
  //#region src/components/views/UsersView.tsx
20063
- function gT() {
20089
+ function _T() {
20064
20090
  let [e, t] = f(0), [n, r] = f(20), [i, a] = f(""), [o, s] = f("all"), [c, l] = f("users"), [u, d] = f(!1), [p, m] = f(), [h, v] = f(!1), [y, b] = f(), { data: x = [], isLoading: S, isError: C, refetch: w } = aw({
20065
20091
  skip: e,
20066
20092
  limit: n,
20067
20093
  search: i,
20068
20094
  activeOnly: o === "active" ? !0 : o === "inactive" ? !1 : void 0
20069
- }), { data: T = 0 } = ow({ search: i }), E = mw(), { data: D = [] } = pT();
20095
+ }), { data: T = 0 } = ow({ search: i }), E = mw(), { data: D = [] } = mT();
20070
20096
  return /* @__PURE__ */ _("div", {
20071
20097
  className: "space-y-4",
20072
20098
  children: [
@@ -20190,7 +20216,7 @@ function gT() {
20190
20216
  }),
20191
20217
  /* @__PURE__ */ g(Gh, {
20192
20218
  value: "groups",
20193
- children: /* @__PURE__ */ g(oT, {})
20219
+ children: /* @__PURE__ */ g(sT, {})
20194
20220
  }),
20195
20221
  /* @__PURE__ */ g(Gh, {
20196
20222
  value: "hierarchy",
@@ -20208,7 +20234,7 @@ function gT() {
20208
20234
  },
20209
20235
  user: p
20210
20236
  }),
20211
- /* @__PURE__ */ g(aT, {
20237
+ /* @__PURE__ */ g(oT, {
20212
20238
  open: h,
20213
20239
  onClose: () => v(!1)
20214
20240
  }),
@@ -20227,7 +20253,7 @@ function gT() {
20227
20253
  }
20228
20254
  //#endregion
20229
20255
  //#region src/components/dialogs/ArtifactDialog.tsx
20230
- var _T = JC({
20256
+ var vT = JC({
20231
20257
  name: KC().min(1, "Name is required"),
20232
20258
  description: KC().optional(),
20233
20259
  type: YC(["RESOURCE", "RESOURCEGROUP"]),
@@ -20235,9 +20261,9 @@ var _T = JC({
20235
20261
  expression: KC().optional(),
20236
20262
  status: YC(["Active", "Inactive"])
20237
20263
  });
20238
- function vT({ open: e, onClose: t, artifact: n, currentApplication: r, isAdmin: i }) {
20264
+ function yT({ open: e, onClose: t, artifact: n, currentApplication: r, isAdmin: i }) {
20239
20265
  let a = !!n, o = Hw(), s = Uw(), { register: l, handleSubmit: u, watch: d, setValue: p, formState: { errors: m }, reset: h } = uS({
20240
- resolver: gS(_T),
20266
+ resolver: gS(vT),
20241
20267
  defaultValues: {
20242
20268
  name: "",
20243
20269
  description: "",
@@ -20371,10 +20397,10 @@ function vT({ open: e, onClose: t, artifact: n, currentApplication: r, isAdmin:
20371
20397
  onValueChange: (e) => p("type", e),
20372
20398
  children: [/* @__PURE__ */ g(pb, { children: /* @__PURE__ */ g(fb, {}) }), /* @__PURE__ */ _(mb, { children: [/* @__PURE__ */ g(hb, {
20373
20399
  value: "RESOURCE",
20374
- children: "Resource"
20400
+ children: "Artifact"
20375
20401
  }), /* @__PURE__ */ g(hb, {
20376
20402
  value: "RESOURCEGROUP",
20377
- children: "Resource Group"
20403
+ children: "Artifact Group"
20378
20404
  })] })]
20379
20405
  })]
20380
20406
  }), /* @__PURE__ */ _("div", {
@@ -20496,11 +20522,11 @@ function vT({ open: e, onClose: t, artifact: n, currentApplication: r, isAdmin:
20496
20522
  })
20497
20523
  ]
20498
20524
  }),
20499
- v === "RESOURCEGROUP" && /* @__PURE__ */ g(qw, {
20525
+ v === "RESOURCEGROUP" && /* @__PURE__ */ g(Jw, {
20500
20526
  type: "resource",
20501
20527
  value: d("expression") ?? "",
20502
20528
  onChange: (e) => p("expression", e),
20503
- label: "Resources Expression",
20529
+ label: "Artifacts Expression",
20504
20530
  currentApplication: r,
20505
20531
  isAdmin: i
20506
20532
  }),
@@ -20550,7 +20576,7 @@ function vT({ open: e, onClose: t, artifact: n, currentApplication: r, isAdmin:
20550
20576
  children: "Loading members…"
20551
20577
  }) : (ie.data ?? []).length === 0 ? /* @__PURE__ */ g("p", {
20552
20578
  className: "py-6 text-center text-sm text-muted-foreground",
20553
- children: "No member resources"
20579
+ children: "No member artifacts"
20554
20580
  }) : /* @__PURE__ */ g("ul", {
20555
20581
  className: "space-y-1.5 py-2",
20556
20582
  children: ie.data.map((e) => /* @__PURE__ */ _("li", {
@@ -20568,7 +20594,7 @@ function vT({ open: e, onClose: t, artifact: n, currentApplication: r, isAdmin:
20568
20594
  children: "Loading parent groups…"
20569
20595
  }) : (ae.data ?? []).length === 0 ? /* @__PURE__ */ g("p", {
20570
20596
  className: "py-6 text-center text-sm text-muted-foreground",
20571
- children: "Not a member of any resource group"
20597
+ children: "Not a member of any artifact group"
20572
20598
  }) : /* @__PURE__ */ g("ul", {
20573
20599
  className: "space-y-1.5 py-2",
20574
20600
  children: ae.data.map((e) => /* @__PURE__ */ _("li", {
@@ -20590,18 +20616,19 @@ function vT({ open: e, onClose: t, artifact: n, currentApplication: r, isAdmin:
20590
20616
  }
20591
20617
  //#endregion
20592
20618
  //#region src/components/views/ArtifactsView.tsx
20593
- function yT() {
20619
+ function bT() {
20594
20620
  let { currentApplication: e, isAdmin: t } = Jy(), [n, r] = f(0), [i, a] = f(20), [o, s] = f(""), [c, l] = f("RESOURCE"), [u, d] = f("all"), [p, m] = f("all"), [h, v] = f(!1), [y, b] = f(), [x, S] = f(), { data: C = [] } = Vw(), w = t ? p === "all" ? void 0 : p : e, { data: T = [], isLoading: E, isError: D, refetch: O } = Pw({
20595
20621
  skip: n,
20596
20622
  limit: i,
20597
20623
  type: c,
20598
20624
  appName: w,
20599
- activeOnly: u === "active" ? !0 : u === "inactive" ? !1 : void 0
20625
+ activeOnly: u === "active" ? !0 : u === "inactive" ? !1 : void 0,
20626
+ search: o
20600
20627
  }), { data: k = 0 } = Fw({
20601
20628
  type: c,
20602
20629
  appName: w,
20603
20630
  search: o
20604
- }), A = Ww(), { data: j = [] } = hT(), M = [
20631
+ }), A = Ww(), { data: j = [] } = gT(), M = [
20605
20632
  {
20606
20633
  accessorKey: "name",
20607
20634
  header: "Name"
@@ -20671,11 +20698,11 @@ function yT() {
20671
20698
  children: [/* @__PURE__ */ _(Uh, { children: [
20672
20699
  /* @__PURE__ */ g(Wh, {
20673
20700
  value: "resources",
20674
- children: "Resources"
20701
+ children: "Artifacts"
20675
20702
  }),
20676
20703
  /* @__PURE__ */ g(Wh, {
20677
20704
  value: "groups",
20678
- children: "Resource Groups"
20705
+ children: "Artifact Groups"
20679
20706
  }),
20680
20707
  /* @__PURE__ */ g(Wh, {
20681
20708
  value: "hierarchy",
@@ -20688,7 +20715,7 @@ function yT() {
20688
20715
  children: [
20689
20716
  /* @__PURE__ */ g(ge, { className: "mr-2 h-4 w-4" }),
20690
20717
  " Add ",
20691
- c === "RESOURCE" ? "Resource" : "Group"
20718
+ c === "RESOURCE" ? "Artifact" : "Group"
20692
20719
  ]
20693
20720
  })]
20694
20721
  }),
@@ -20698,7 +20725,7 @@ function yT() {
20698
20725
  className: "rounded-md border border-destructive/50 p-4 flex items-center justify-between",
20699
20726
  children: [/* @__PURE__ */ g("span", {
20700
20727
  className: "text-sm text-destructive",
20701
- children: "Failed to load resources"
20728
+ children: "Failed to load artifacts"
20702
20729
  }), /* @__PURE__ */ g(qh, {
20703
20730
  variant: "outline",
20704
20731
  size: "sm",
@@ -20710,8 +20737,8 @@ function yT() {
20710
20737
  data: T,
20711
20738
  totalCount: k,
20712
20739
  isLoading: E,
20713
- emptyMessage: "No resources found",
20714
- searchPlaceholder: "Search resources...",
20740
+ emptyMessage: "No artifacts found",
20741
+ searchPlaceholder: "Search artifacts...",
20715
20742
  onSearchChange: (e) => {
20716
20743
  s(e), r(0);
20717
20744
  },
@@ -20732,7 +20759,7 @@ function yT() {
20732
20759
  data: T,
20733
20760
  totalCount: k,
20734
20761
  isLoading: E,
20735
- emptyMessage: "No resource groups found",
20762
+ emptyMessage: "No artifact groups found",
20736
20763
  onPaginationChange: (e) => {
20737
20764
  r(e.pageIndex * e.pageSize), a(e.pageSize);
20738
20765
  },
@@ -20752,7 +20779,7 @@ function yT() {
20752
20779
  })
20753
20780
  ]
20754
20781
  }),
20755
- /* @__PURE__ */ g(vT, {
20782
+ /* @__PURE__ */ g(yT, {
20756
20783
  open: h,
20757
20784
  onClose: () => {
20758
20785
  v(!1), b(void 0);
@@ -20776,16 +20803,16 @@ function yT() {
20776
20803
  }
20777
20804
  //#endregion
20778
20805
  //#region src/components/dialogs/AccessRuleDialog.tsx
20779
- var bT = [
20806
+ var xT = [
20780
20807
  "Read",
20781
20808
  "Write",
20782
20809
  "Execute",
20783
20810
  "Export"
20784
- ], xT = JC({
20811
+ ], ST = JC({
20785
20812
  name: KC().min(1, "Name is required"),
20786
20813
  description: KC().optional(),
20787
20814
  userExpression: KC().min(1, "User expression is required"),
20788
- resourceExpression: KC().min(1, "Resource expression is required"),
20815
+ resourceExpression: KC().min(1, "Artifact expression is required"),
20789
20816
  permissions: qC(KC()).min(1, "At least one permission is required"),
20790
20817
  application: KC().optional(),
20791
20818
  status: YC(["Active", "Inactive"]),
@@ -20794,9 +20821,9 @@ var bT = [
20794
20821
  startTime: KC().optional(),
20795
20822
  endTime: KC().optional()
20796
20823
  });
20797
- function ST({ open: e, onClose: t, rule: n, currentApplication: r, isAdmin: i }) {
20798
- let a = !!n, o = Ow(), s = kw(), [l, u] = f(bT), [d, p] = f(""), { register: m, handleSubmit: h, watch: v, setValue: y, formState: { errors: b }, reset: x } = uS({
20799
- resolver: gS(xT),
20824
+ function CT({ open: e, onClose: t, rule: n, currentApplication: r, isAdmin: i }) {
20825
+ let a = !!n, o = Ow(), s = kw(), [l, u] = f(xT), [d, p] = f(""), { register: m, handleSubmit: h, watch: v, setValue: y, formState: { errors: b }, reset: x } = uS({
20826
+ resolver: gS(ST),
20800
20827
  defaultValues: {
20801
20828
  name: "",
20802
20829
  description: "",
@@ -20813,8 +20840,8 @@ function ST({ open: e, onClose: t, rule: n, currentApplication: r, isAdmin: i })
20813
20840
  });
20814
20841
  c(() => {
20815
20842
  if (e) {
20816
- let e = (n?.permissions ?? []).filter((e) => !bT.includes(e));
20817
- u(e.length ? [...bT, ...e] : bT), p(""), x({
20843
+ let e = (n?.permissions ?? []).filter((e) => !xT.includes(e));
20844
+ u(e.length ? [...xT, ...e] : xT), p(""), x({
20818
20845
  name: n?.name ?? "",
20819
20846
  description: n?.description ?? "",
20820
20847
  userExpression: n?.userExpression ?? "",
@@ -20907,7 +20934,7 @@ function ST({ open: e, onClose: t, rule: n, currentApplication: r, isAdmin: i })
20907
20934
  ...m("description")
20908
20935
  })]
20909
20936
  }),
20910
- /* @__PURE__ */ g(qw, {
20937
+ /* @__PURE__ */ g(Jw, {
20911
20938
  type: "user",
20912
20939
  value: v("userExpression"),
20913
20940
  onChange: (e) => y("userExpression", e),
@@ -20920,11 +20947,11 @@ function ST({ open: e, onClose: t, rule: n, currentApplication: r, isAdmin: i })
20920
20947
  className: "text-xs text-destructive",
20921
20948
  children: b.userExpression.message
20922
20949
  }),
20923
- /* @__PURE__ */ g(qw, {
20950
+ /* @__PURE__ */ g(Jw, {
20924
20951
  type: "resource",
20925
20952
  value: v("resourceExpression"),
20926
20953
  onChange: (e) => y("resourceExpression", e),
20927
- label: "Resource Expression",
20954
+ label: "Artifact Expression",
20928
20955
  required: !0,
20929
20956
  currentApplication: r,
20930
20957
  isAdmin: i
@@ -21069,12 +21096,13 @@ function ST({ open: e, onClose: t, rule: n, currentApplication: r, isAdmin: i })
21069
21096
  }
21070
21097
  //#endregion
21071
21098
  //#region src/components/views/AccessRulesView.tsx
21072
- function CT() {
21099
+ function wT() {
21073
21100
  let { currentApplication: e, isAdmin: t } = Jy(), [n, r] = f(0), [i, a] = f(20), [o, s] = f(""), [c, l] = f("all"), [u, d] = f("all"), [p, m] = f(!1), [h, v] = f(), [y, b] = f(), { data: x = [] } = Vw(), S = t ? u === "all" ? void 0 : u : e, C = c === "active" ? !0 : c === "inactive" ? !1 : void 0, { data: w = [], isLoading: T, isError: E, refetch: D } = gw({
21074
21101
  skip: n,
21075
21102
  limit: i,
21076
21103
  appName: S,
21077
- activeOnly: C
21104
+ activeOnly: C,
21105
+ search: o
21078
21106
  }), { data: O = 0 } = _w({
21079
21107
  search: o,
21080
21108
  appName: S,
@@ -21098,7 +21126,7 @@ function CT() {
21098
21126
  },
21099
21127
  {
21100
21128
  accessorKey: "resourceExpression",
21101
- header: "Resource Expression",
21129
+ header: "Artifact Expression",
21102
21130
  cell: ({ row: e }) => /* @__PURE__ */ g("span", {
21103
21131
  className: "font-mono text-xs max-w-[140px] truncate block",
21104
21132
  children: e.original.resourceExpression
@@ -21205,7 +21233,7 @@ function CT() {
21205
21233
  },
21206
21234
  toolbar: j
21207
21235
  }),
21208
- /* @__PURE__ */ g(ST, {
21236
+ /* @__PURE__ */ g(CT, {
21209
21237
  open: p,
21210
21238
  onClose: () => {
21211
21239
  m(!1), v(void 0);
@@ -21229,7 +21257,7 @@ function CT() {
21229
21257
  }
21230
21258
  //#endregion
21231
21259
  //#region src/MedhaOneAccess.tsx
21232
- var wT = [
21260
+ var TT = [
21233
21261
  {
21234
21262
  id: "users",
21235
21263
  label: "Users",
@@ -21246,7 +21274,7 @@ var wT = [
21246
21274
  Icon: Se
21247
21275
  }
21248
21276
  ];
21249
- function TT() {
21277
+ function ET() {
21250
21278
  let [e, t] = f("users");
21251
21279
  return /* @__PURE__ */ _("div", {
21252
21280
  className: "flex h-full bg-background",
@@ -21259,7 +21287,7 @@ function TT() {
21259
21287
  className: "text-sm font-bold text-slate-600 uppercase tracking-wider",
21260
21288
  children: "Access Control"
21261
21289
  })
21262
- }), wT.map(({ id: n, label: r, Icon: i }) => /* @__PURE__ */ _("button", {
21290
+ }), TT.map(({ id: n, label: r, Icon: i }) => /* @__PURE__ */ _("button", {
21263
21291
  onClick: () => t(n),
21264
21292
  className: H("flex cursor-pointer items-center gap-2.5 rounded-md px-3 py-2 text-sm font-medium transition-colors text-left w-full", e === n ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:bg-background/60 hover:text-foreground"),
21265
21293
  children: [/* @__PURE__ */ g(i, { className: "h-4 w-4 shrink-0" }), r]
@@ -21270,9 +21298,9 @@ function TT() {
21270
21298
  children: /* @__PURE__ */ _("div", {
21271
21299
  className: "max-w-7xl mx-auto",
21272
21300
  children: [
21273
- e === "users" && /* @__PURE__ */ g(gT, {}),
21274
- e === "artifacts" && /* @__PURE__ */ g(yT, {}),
21275
- e === "access-rules" && /* @__PURE__ */ g(CT, {})
21301
+ e === "users" && /* @__PURE__ */ g(_T, {}),
21302
+ e === "artifacts" && /* @__PURE__ */ g(bT, {}),
21303
+ e === "access-rules" && /* @__PURE__ */ g(wT, {})
21276
21304
  ]
21277
21305
  })
21278
21306
  }),
@@ -21284,6 +21312,6 @@ function TT() {
21284
21312
  });
21285
21313
  }
21286
21314
  //#endregion
21287
- export { ST as AccessRuleDialog, CT as AccessRulesView, vT as ArtifactDialog, yT as ArtifactsView, Yh as Badge, qh as Button, Ab as ConfirmDialog, yb as DataTable, qw as ExpressionInput, aT as GroupDialog, oT as GroupsView, Rb as HierarchyTree, ub as Input, rw as Label, TT as MedhaOneAccess, Xy as MedhaOneAccessProvider, Nw as UserDialog, gT as UsersView, H as cn, Wy as generateToken, vw as useAccessRule, gw as useAccessRules, _w as useAccessRulesCount, nT as useAddGroupMember, Iw as useArtifact, ww as useArtifactAccess, hT as useArtifactCombinedHierarchy, Rw as useArtifactGroup, Tw as useArtifactGroupAccess, zw as useArtifactGroupContents, Lw as useArtifactGroups, Pw as useArtifacts, Fw as useArtifactsCount, yw as useCheckAccess, pT as useCombinedHierarchy, Ow as useCreateAccessRule, Hw as useCreateArtifact, $w as useCreateGroup, fw as useCreateUser, Aw as useDeleteAccessRule, Ww as useDeleteArtifact, tT as useDeleteGroup, mw as useDeleteUser, uw as useDepartments, Zw as useGroup, Qw as useGroupMembers, Yw as useGroups, Xw as useGroupsCount, Bw as useGroupsForArtifact, Jy as useMedhaConfig, G as useMedhaHttp, fT as useOrgChart, rT as useRemoveGroupMember, dw as useRoles, Vw as useUniqueApplications, kw as useUpdateAccessRule, Uw as useUpdateArtifact, eT as useUpdateGroup, pw as useUpdateUser, sw as useUser, Sw as useUserAccess, Cw as useUserGroupAccess, lw as useUserGroups, aw as useUsers, ow as useUsersCount, Ew as useValidateExpression };
21315
+ export { CT as AccessRuleDialog, wT as AccessRulesView, yT as ArtifactDialog, bT as ArtifactsView, Yh as Badge, qh as Button, Ab as ConfirmDialog, yb as DataTable, Jw as ExpressionInput, oT as GroupDialog, sT as GroupsView, Rb as HierarchyTree, ub as Input, rw as Label, ET as MedhaOneAccess, Xy as MedhaOneAccessProvider, Nw as UserDialog, _T as UsersView, H as cn, Wy as generateToken, vw as useAccessRule, gw as useAccessRules, _w as useAccessRulesCount, rT as useAddGroupMember, Iw as useArtifact, ww as useArtifactAccess, gT as useArtifactCombinedHierarchy, Rw as useArtifactGroup, Tw as useArtifactGroupAccess, zw as useArtifactGroupContents, Lw as useArtifactGroups, Pw as useArtifacts, Fw as useArtifactsCount, yw as useCheckAccess, mT as useCombinedHierarchy, Ow as useCreateAccessRule, Hw as useCreateArtifact, eT as useCreateGroup, fw as useCreateUser, Aw as useDeleteAccessRule, Ww as useDeleteArtifact, nT as useDeleteGroup, mw as useDeleteUser, uw as useDepartments, Qw as useGroup, $w as useGroupMembers, Xw as useGroups, Zw as useGroupsCount, Bw as useGroupsForArtifact, Jy as useMedhaConfig, G as useMedhaHttp, pT as useOrgChart, iT as useRemoveGroupMember, dw as useRoles, Vw as useUniqueApplications, kw as useUpdateAccessRule, Uw as useUpdateArtifact, tT as useUpdateGroup, pw as useUpdateUser, sw as useUser, Sw as useUserAccess, Cw as useUserGroupAccess, lw as useUserGroups, aw as useUsers, ow as useUsersCount, Ew as useValidateExpression };
21288
21316
 
21289
21317
  //# sourceMappingURL=index.js.map