alex-evo-sh-ui-kit 1.1.84 → 1.1.85

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.
@@ -397,7 +397,7 @@ const We = ({ children: n, onHide: t, disableBackplate: r }) => {
397
397
  }), [i]), { screen: r };
398
398
  }, _t = {
399
399
  screen: ee.STANDART
400
- }, we = Pe(_t), Ns = ({ children: n, option: t }) => {
400
+ }, we = Pe(_t), ws = ({ children: n, option: t }) => {
401
401
  const r = Ct(t);
402
402
  return /* @__PURE__ */ e.jsx(we.Provider, { value: r, children: n });
403
403
  }, U = ({
@@ -1464,7 +1464,7 @@ const Nn = (n) => /* @__PURE__ */ e.jsx(R, { ...n, className: `${n.className} ic
1464
1464
  }
1465
1465
  )
1466
1466
  ] });
1467
- }, ws = Tn, It = (n) => {
1467
+ }, Ss = Tn, It = (n) => {
1468
1468
  const { primaryColor: t } = F(n);
1469
1469
  return /* @__PURE__ */ e.jsx(R, { ...n, children: /* @__PURE__ */ e.jsxs("g", { children: [
1470
1470
  /* @__PURE__ */ e.jsx(
@@ -2019,7 +2019,7 @@ const Kt = ({ valueDisplayDuration: n = 2e3 }) => {
2019
2019
  children: t
2020
2020
  }
2021
2021
  );
2022
- function Ss(n, t, r) {
2022
+ function Ms(n, t, r) {
2023
2023
  arguments.length === 1 && (t = n.s, r = n.l, n = n.h);
2024
2024
  var s = n, i, l;
2025
2025
  return r *= 2, t *= r <= 1 ? r : 2 - r, l = (r + t) / 2, i = 2 * t / (r + t), {
@@ -2028,7 +2028,7 @@ function Ss(n, t, r) {
2028
2028
  v: l
2029
2029
  };
2030
2030
  }
2031
- function Ms(n, t, r) {
2031
+ function Ls(n, t, r) {
2032
2032
  arguments.length === 1 && (t = n.s, r = n.v, n = n.h);
2033
2033
  var s = (2 - t) * r / 2;
2034
2034
  return s != 0 && (s == 1 ? t = 0 : s < 0.5 ? t = t * r / (s * 2) : t = t * r / (2 - s * 2)), { h: n, s: t, l: s };
@@ -2370,10 +2370,10 @@ const $e = () => {
2370
2370
  createTheme: $e,
2371
2371
  deleteTheme: $e,
2372
2372
  resetTheme: $e
2373
- }, sn = Pe(sr), Ls = ({ children: n }) => {
2373
+ }, sn = Pe(sr), $s = ({ children: n }) => {
2374
2374
  const t = rr();
2375
2375
  return /* @__PURE__ */ e.jsx(sn.Provider, { value: t, children: n });
2376
- }, dn = "var(--range-width)", $s = ({
2376
+ }, dn = "var(--range-width)", Rs = ({
2377
2377
  colorRange: n,
2378
2378
  colorBg: t = "var(--Surface-container-color)",
2379
2379
  onChange: r,
@@ -2477,7 +2477,7 @@ const $e = () => {
2477
2477
  ]
2478
2478
  }
2479
2479
  );
2480
- }, Rs = ({
2480
+ }, Es = ({
2481
2481
  min: n = 0,
2482
2482
  max: t = 100,
2483
2483
  value: r = 0,
@@ -2733,7 +2733,7 @@ const cr = 100, dr = (n) => {
2733
2733
  s !== 0 ? /* @__PURE__ */ e.jsx(se, {}) : null,
2734
2734
  /* @__PURE__ */ e.jsx(zn, { block: r, smallDisplay: !0, autoHide: n.autoHide, onHide: n.onHide })
2735
2735
  ] }, s)) }) });
2736
- }, Pn = (n) => n.screensize === ee.MOBILE ? /* @__PURE__ */ e.jsx(Ce, { container: n.container, children: /* @__PURE__ */ e.jsx(ur, { ...n }) }) : /* @__PURE__ */ e.jsx(Ce, { container: n.container, children: /* @__PURE__ */ e.jsx(dr, { ...n }) }), Es = ne.forwardRef(({ screensize: n, autoHide: t, blocks: r, container: s, onClick: i, ...l }, o) => {
2736
+ }, Pn = (n) => n.screensize === ee.MOBILE ? /* @__PURE__ */ e.jsx(Ce, { container: n.container, children: /* @__PURE__ */ e.jsx(ur, { ...n }) }) : /* @__PURE__ */ e.jsx(Ce, { container: n.container, children: /* @__PURE__ */ e.jsx(dr, { ...n }) }), Vs = ne.forwardRef(({ screensize: n, autoHide: t, blocks: r, container: s, onClick: i, ...l }, o) => {
2737
2737
  const [c, a] = g(!1), [d, u] = g(void 0), { screen: m } = _e(we), h = () => {
2738
2738
  a(!1), u(void 0);
2739
2739
  }, x = (j) => {
@@ -3190,7 +3190,7 @@ const Fe = ne.forwardRef(
3190
3190
  }
3191
3191
  );
3192
3192
  Fe.displayName = "TextField";
3193
- const Vs = ({
3193
+ const Fs = ({
3194
3194
  styleContainer: n,
3195
3195
  text: t,
3196
3196
  header: r,
@@ -3273,7 +3273,7 @@ const Vs = ({
3273
3273
  ]
3274
3274
  }
3275
3275
  );
3276
- }, Fs = ({
3276
+ }, Ts = ({
3277
3277
  style: n,
3278
3278
  className: t = "",
3279
3279
  header: r,
@@ -3430,7 +3430,7 @@ const Vs = ({
3430
3430
  }
3431
3431
  );
3432
3432
  xr.displayName = "Card";
3433
- const Ts = ({ children: n, className: t }) => /* @__PURE__ */ e.jsx("div", { className: `base-action-card ${t ?? ""}`, children: n }), Os = ({ children: n, className: t, id: r, height: s, width: i, pozMove: l, draggable: o = !0 }) => {
3433
+ const Os = ({ children: n, className: t }) => /* @__PURE__ */ e.jsx("div", { className: `base-action-card ${t ?? ""}`, children: n }), As = ({ children: n, className: t, id: r, height: s, width: i, pozMove: l, draggable: o = !0 }) => {
3434
3434
  const [c, a] = g(!1), [d, u] = g(null), [m, h] = g({ x: 0, y: 0 }), x = (f) => {
3435
3435
  f.button == 1 && (a(!1), u(null), document.body.style.cursor = "auto");
3436
3436
  }, C = (f) => {
@@ -3447,7 +3447,7 @@ const Ts = ({ children: n, className: t }) => /* @__PURE__ */ e.jsx("div", { cla
3447
3447
  return O(() => {
3448
3448
  l && h({ ...l });
3449
3449
  }, [l]), /* @__PURE__ */ e.jsx("div", { id: r, style: { height: s, width: i }, className: `big-container ${t}`, onMouseDown: C, onMouseUp: x, onMouseMove: j, children: /* @__PURE__ */ e.jsx("div", { className: "big-container-content", style: { left: m.x, top: m.y }, children: n }) });
3450
- }, As = ({
3450
+ }, Ds = ({
3451
3451
  onClick: n,
3452
3452
  onContextMenu: t,
3453
3453
  gap: r,
@@ -3495,7 +3495,7 @@ const Ts = ({ children: n, className: t }) => /* @__PURE__ */ e.jsx("div", { cla
3495
3495
  ))
3496
3496
  }
3497
3497
  );
3498
- }, fr = 10, jr = 2e-3, Ds = ({
3498
+ }, fr = 10, jr = 2e-3, Is = ({
3499
3499
  children: n,
3500
3500
  label: t,
3501
3501
  className: r = "",
@@ -3586,14 +3586,14 @@ const Ts = ({ children: n, className: t }) => /* @__PURE__ */ e.jsx("div", { cla
3586
3586
  ]
3587
3587
  }
3588
3588
  );
3589
- }, Is = ({ children: n, colSpan: t = 1 }) => /* @__PURE__ */ e.jsx(
3589
+ }, Hs = ({ children: n, colSpan: t = 1 }) => /* @__PURE__ */ e.jsx(
3590
3590
  "div",
3591
3591
  {
3592
3592
  className: "adaptiv-grid-item",
3593
3593
  style: { gridColumnEnd: `span ${t}` },
3594
3594
  children: /* @__PURE__ */ e.jsx("div", { className: "adaptiv-grid-item-container", children: n })
3595
3595
  }
3596
- ), Hs = ({
3596
+ ), zs = ({
3597
3597
  minWith: n,
3598
3598
  children: t,
3599
3599
  className: r = "",
@@ -3669,7 +3669,7 @@ const Ts = ({ children: n, className: t }) => /* @__PURE__ */ e.jsx("div", { cla
3669
3669
  children: n
3670
3670
  }
3671
3671
  );
3672
- }, zs = ({ className: n, children: t, height: r }) => /* @__PURE__ */ e.jsx("div", { className: `scroll-container ${n}`, style: { height: r }, children: t }), Ps = ({
3672
+ }, Ps = ({ className: n, children: t, height: r }) => /* @__PURE__ */ e.jsx("div", { className: `scroll-container ${n}`, style: { height: r }, children: t }), Bs = ({
3673
3673
  tabs: n,
3674
3674
  scrollAmount: t = 150,
3675
3675
  tabClassName: r = "",
@@ -3884,7 +3884,7 @@ const br = ({ data: n, column: t, color: r, backgroundColor: s, H: i }) => {
3884
3884
  )
3885
3885
  ] }) })
3886
3886
  ] });
3887
- }, Bs = ({
3887
+ }, Ws = ({
3888
3888
  data: n,
3889
3889
  columns: t,
3890
3890
  onDelete: r,
@@ -3948,7 +3948,7 @@ const br = ({ data: n, column: t, color: r, backgroundColor: s, H: i }) => {
3948
3948
  navigation-item-bar__icon_color_active-secondary-container
3949
3949
  `, children: t }),
3950
3950
  /* @__PURE__ */ e.jsx("div", { className: "navigation-item-bar__text navigation-item-bar__text_color_surface-variant", children: r })
3951
- ] }), Ws = ({ btns: n }) => /* @__PURE__ */ e.jsx("div", { className: "navigation-bar", children: /* @__PURE__ */ e.jsx("div", { className: "navigation-bar__content", children: n.map((t, r) => t.type === "button" ? /* @__PURE__ */ e.jsx(Nr, { icon: t.icon, onClick: t.onClick, title: t.text }, r) : t.type === "link" ? /* @__PURE__ */ e.jsx(yr, { icon: t.icon, to: t.to, title: t.text }, r) : null) }) }), Xn = ({ onClick: n, icon: t, title: r, to: s }) => /* @__PURE__ */ e.jsxs(Qe, { onClick: n, to: s, className: `
3951
+ ] }), Gs = ({ btns: n }) => /* @__PURE__ */ e.jsx("div", { className: "navigation-bar", children: /* @__PURE__ */ e.jsx("div", { className: "navigation-bar__content", children: n.map((t, r) => t.type === "button" ? /* @__PURE__ */ e.jsx(Nr, { icon: t.icon, onClick: t.onClick, title: t.text }, r) : t.type === "link" ? /* @__PURE__ */ e.jsx(yr, { icon: t.icon, to: t.to, title: t.text }, r) : null) }) }), Xn = ({ onClick: n, icon: t, title: r, to: s }) => /* @__PURE__ */ e.jsxs(Qe, { onClick: n, to: s, className: `
3952
3952
  navigation-item
3953
3953
  navigation-item-drawer
3954
3954
  navigation-item-drawer_hover-color_surface-container-highest
@@ -4010,7 +4010,7 @@ const br = ({ data: n, column: t, color: r, backgroundColor: s, H: i }) => {
4010
4010
  ) : null
4011
4011
  ) })
4012
4012
  ] });
4013
- }, Gs = ({ visible: n, firstBtn: t, mainBtn: r, onHide: s, otherBtn: i, backBtn: l, openAlways: o }) => {
4013
+ }, Zs = ({ visible: n, firstBtn: t, mainBtn: r, onHide: s, otherBtn: i, backBtn: l, openAlways: o }) => {
4014
4014
  const c = (a, d) => a.type === "button" ? /* @__PURE__ */ e.jsx(Re, { active: a.active, onClick: a.onClick, title: a.text, icon: a.icon }, d) : a.type === "link" ? /* @__PURE__ */ e.jsx(Xn, { onClick: () => s(), title: a.text, icon: a.icon, to: a.to }, d) : a.type === "submenu" ? /* @__PURE__ */ e.jsx(wr, { item: a, onHide: s }, d) : null;
4015
4015
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
4016
4016
  /* @__PURE__ */ e.jsxs("div", { className: `navigation-drawer ${n || o ? "navigation-drawer_show" : "navigation-drawer_hide"}`, children: [
@@ -4051,7 +4051,7 @@ const br = ({ data: n, column: t, color: r, backgroundColor: s, H: i }) => {
4051
4051
  navigation-item-rail__icon_color_active-secondary-container
4052
4052
  `, children: t }),
4053
4053
  /* @__PURE__ */ e.jsx("div", { className: "navigation-item-rail__text navigation-item-rail__text_color_surface-variant", children: r })
4054
- ] }), Zs = ({ onToggleMenu: n, firstBtn: t, mainBtn: r, backBtn: s }) => /* @__PURE__ */ e.jsx("div", { className: "navigation-rail", children: /* @__PURE__ */ e.jsx("div", { className: "navigation-rail__block", children: /* @__PURE__ */ e.jsxs("div", { className: "navigation-rail__block__content", children: [
4054
+ ] }), Ys = ({ onToggleMenu: n, firstBtn: t, mainBtn: r, backBtn: s }) => /* @__PURE__ */ e.jsx("div", { className: "navigation-rail", children: /* @__PURE__ */ e.jsx("div", { className: "navigation-rail__block", children: /* @__PURE__ */ e.jsxs("div", { className: "navigation-rail__block__content", children: [
4055
4055
  n ? /* @__PURE__ */ e.jsx(Oe, { icon: /* @__PURE__ */ e.jsx(Ln, { className: "navigation-rail__block__content__icon navigation-rail__block__content__icon_color_surface-variant" }), onClick: n }) : null,
4056
4056
  t ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
4057
4057
  /* @__PURE__ */ e.jsx(se, {}),
@@ -4401,7 +4401,7 @@ const Fr = [
4401
4401
  ]
4402
4402
  }
4403
4403
  );
4404
- }, Ys = ({
4404
+ }, Us = ({
4405
4405
  border: n = !1,
4406
4406
  onChange: t,
4407
4407
  container: r,
@@ -5317,7 +5317,7 @@ const Xr = ({ setHours: n, setMinutes: t, switchMode: r, minutes: s, hours: i, o
5317
5317
  function Qr(n, t, r, s, i) {
5318
5318
  return s + (i - s) * ((n - t) / (r - t));
5319
5319
  }
5320
- const Ke = 0, qe = 100, Us = ({ showValue: n = !0, ...t }) => {
5320
+ const Ke = 0, qe = 100, Xs = ({ showValue: n = !0, ...t }) => {
5321
5321
  const [r, s] = g(0), [i, l] = g(!1), o = Z(null), c = Z(null);
5322
5322
  O(() => {
5323
5323
  t.value ? s(t.value) : s(0);
@@ -5347,7 +5347,7 @@ const Ke = 0, qe = 100, Us = ({ showValue: n = !0, ...t }) => {
5347
5347
  ] }),
5348
5348
  t.showMinMax ? /* @__PURE__ */ e.jsx("div", { className: "value right", children: t.max ?? qe }) : null
5349
5349
  ] }) });
5350
- }, Xs = ({ className: n, text: t, title: r, hexColor: s, hexBackground: i, style: l, btn: o }) => /* @__PURE__ */ e.jsxs("div", { className: `alex-evo-sh-ui-kit-empty-page ${n ?? ""}`, style: { background: Jt(i), color: s, ...l }, children: [
5350
+ }, Ks = ({ className: n, text: t, title: r, hexColor: s, hexBackground: i, style: l, btn: o }) => /* @__PURE__ */ e.jsxs("div", { className: `alex-evo-sh-ui-kit-empty-page ${n ?? ""}`, style: { background: Jt(i), color: s, ...l }, children: [
5351
5351
  /* @__PURE__ */ e.jsx("h2", { children: r }),
5352
5352
  t ? /* @__PURE__ */ e.jsx("p", { children: t }) : null,
5353
5353
  o ? /* @__PURE__ */ e.jsx(ye, { styleType: o.styleType ?? "filled", style: o.style, className: o.className, onClick: o.onClick, children: o.text }) : null
@@ -5443,7 +5443,7 @@ const Ke = 0, qe = 100, Us = ({ showValue: n = !0, ...t }) => {
5443
5443
  ] }) }) });
5444
5444
  };
5445
5445
  var et = /* @__PURE__ */ ((n) => (n.NONE = "NONE", n.ARRAY = "ARRAY", n.OBJECT = "OBJECT", n))(et || {});
5446
- const ln = ({ readonly: n, name: t, data: r, onChange: s, onDelete: i, baseType: l, onlyStringValue: o }) => typeof r == "boolean" || typeof r == "number" || typeof r == "string" ? /* @__PURE__ */ e.jsx(ts, { readonly: n, onDelete: i, onChange: s, data: r, name: t }) : r ? Array.isArray(r) ? /* @__PURE__ */ e.jsx(ns, { readonly: n, onDelete: i, onChange: s, data: r, name: t, initComponent: l === "ARRAY", onlyStringValue: o }) : /* @__PURE__ */ e.jsx(es, { readonly: n, onDelete: i, onChange: s, data: r, name: t, initComponent: l === "OBJECT", onlyStringValue: o }) : null, Ks = ({ readonly: n, name: t, data: r, onChange: s, onDelete: i, baseType: l = et.NONE, onlyStringValue: o }) => {
5446
+ const ln = ({ readonly: n, name: t, data: r, onChange: s, onDelete: i, baseType: l, onlyStringValue: o }) => typeof r == "boolean" || typeof r == "number" || typeof r == "string" ? /* @__PURE__ */ e.jsx(ts, { readonly: n, onDelete: i, onChange: s, data: r, name: t }) : r ? Array.isArray(r) ? /* @__PURE__ */ e.jsx(ns, { readonly: n, onDelete: i, onChange: s, data: r, name: t, initComponent: l === "ARRAY", onlyStringValue: o }) : /* @__PURE__ */ e.jsx(es, { readonly: n, onDelete: i, onChange: s, data: r, name: t, initComponent: l === "OBJECT", onlyStringValue: o }) : null, qs = ({ readonly: n, name: t, data: r, onChange: s, onDelete: i, baseType: l = et.NONE, onlyStringValue: o }) => {
5447
5447
  const [c, a] = g(r || void 0), [d, u] = g(""), m = k((C) => {
5448
5448
  n || (a(C), s && s(C));
5449
5449
  }, [s]), h = k(() => {
@@ -5468,7 +5468,7 @@ const ln = ({ readonly: n, name: t, data: r, onChange: s, onDelete: i, baseType:
5468
5468
  /* @__PURE__ */ e.jsx("span", { className: "json-base-data border", children: /* @__PURE__ */ e.jsx("input", { size: d.length || 10, placeholder: "value", onChange: (C) => u(C.target.value), className: "alex-evo-sh-ui-kit-json json-base-data-input", type: "text", value: d }) }),
5469
5469
  /* @__PURE__ */ e.jsx("span", { className: "json-base-data-btn-save json-base-data-btn", onClick: x, children: "save" })
5470
5470
  ] });
5471
- }, qs = ({ btn: n, btnComponent: t, onSearch: r, placeholder: s, autoChenge: i, border: l = !1 }) => {
5471
+ }, Js = ({ btn: n, btnComponent: t, onSearch: r, placeholder: s, autoChenge: i, border: l = !1 }) => {
5472
5472
  const o = Z(null), [c, a] = g(""), [d, u] = g(!1), m = () => {
5473
5473
  o.current && (o.current.focus(), u(!0));
5474
5474
  }, h = () => {
@@ -5526,7 +5526,7 @@ const ln = ({ readonly: n, name: t, data: r, onChange: s, onDelete: i, baseType:
5526
5526
  /* @__PURE__ */ e.jsx(U, { type: "body", children: h })
5527
5527
  ] })) })
5528
5528
  ] }, d)) }) }) });
5529
- }, Js = ({
5529
+ }, Qs = ({
5530
5530
  onSearch: n,
5531
5531
  placeholder: t,
5532
5532
  autoChenge: r,
@@ -5586,7 +5586,7 @@ const ln = ({ readonly: n, name: t, data: r, onChange: s, onDelete: i, baseType:
5586
5586
  ]
5587
5587
  }
5588
5588
  ) : null;
5589
- }, Qs = ({
5589
+ }, e1 = ({
5590
5590
  type: n,
5591
5591
  screensize: t = ee.STANDART,
5592
5592
  weight: r = "standart",
@@ -5807,8 +5807,8 @@ const is = ({ icons: n, value: t, onChange: r, disabled: s, placeholder: i, cont
5807
5807
  id: n,
5808
5808
  name: n.charAt(0).toUpperCase() + n.slice(1),
5809
5809
  component: /* @__PURE__ */ e.jsx(t, {})
5810
- })), e1 = (n) => /* @__PURE__ */ e.jsx(is, { icons: ls, ...n });
5811
- function n1(n) {
5810
+ })), n1 = (n) => /* @__PURE__ */ e.jsx(is, { icons: ls, ...n });
5811
+ function t1(n) {
5812
5812
  if (n)
5813
5813
  return tt[n] ?? void 0;
5814
5814
  }
@@ -5817,7 +5817,7 @@ const as = {
5817
5817
  },
5818
5818
  hideSnackbar: () => {
5819
5819
  }
5820
- }, os = Pe(as), t1 = ({ children: n }) => {
5820
+ }, os = Pe(as), r1 = ({ children: n }) => {
5821
5821
  var o;
5822
5822
  const [t, r] = g({ visible: !1, text: "" }), s = Z(null), i = k((c, a) => {
5823
5823
  r({ visible: !0, text: c, option: a }), s.current && clearTimeout(s.current), a != null && a.closeButton || (s.current = setTimeout(() => l(), (a == null ? void 0 : a.delay) ?? 3e3));
@@ -5839,21 +5839,24 @@ const as = {
5839
5839
  n
5840
5840
  ] });
5841
5841
  }, rt = Pe({});
5842
- function cs(n) {
5843
- return typeof n == "string";
5842
+ function cs() {
5843
+ return _e(rt);
5844
5844
  }
5845
5845
  function ds(n) {
5846
- return typeof n == "number";
5846
+ return typeof n == "string";
5847
5847
  }
5848
5848
  function us(n) {
5849
+ return typeof n == "number";
5850
+ }
5851
+ function hs(n) {
5849
5852
  return typeof n == "boolean";
5850
5853
  }
5851
5854
  const fe = (n) => {
5852
- const { value: t, changeField: r, errors: s } = _e(rt), i = k((a) => {
5855
+ const { value: t, changeField: r, errors: s } = cs(), i = k((a) => {
5853
5856
  r && r(n, a);
5854
5857
  }, [n]), l = k(() => {
5855
5858
  const a = t == null ? void 0 : t[n];
5856
- return us(a) ? !!a : ds(a) ? Number(a) : cs(a) ? a ?? "" : "";
5859
+ return hs(a) ? !!a : us(a) ? Number(a) : ds(a) ? a ?? "" : "";
5857
5860
  }, [t, n]), o = k(() => {
5858
5861
  r && r(n, "");
5859
5862
  }, [n]), c = k(() => {
@@ -5866,16 +5869,16 @@ const fe = (n) => {
5866
5869
  error: c(),
5867
5870
  change: i
5868
5871
  };
5869
- }, hs = (n) => {
5872
+ }, ms = (n) => {
5870
5873
  const { value: t, change: r, error: s } = fe(n.name);
5871
5874
  return /* @__PURE__ */ e.jsx(Gr, { ...n, onChange: r, value: String(t), errorText: s, error: !!s });
5872
- }, ms = (n) => {
5875
+ }, xs = (n) => {
5873
5876
  const { value: t, change: r, error: s } = fe(n.name);
5874
5877
  return /* @__PURE__ */ e.jsx(Jn, { ...n, value: Number(t), onChange: r, errorText: s, error: !!s });
5875
- }, xs = (n) => {
5878
+ }, fs = (n) => {
5876
5879
  const { value: t, change: r, error: s } = fe(n.name);
5877
5880
  return /* @__PURE__ */ e.jsx(nt, { ...n, container: n.container ?? document.body, value: t, onChange: r, errorText: s, error: !!s });
5878
- }, fs = ({ placeholder: n, ref: t, style: r, readOnly: s, className: i, name: l }) => {
5881
+ }, js = ({ placeholder: n, ref: t, style: r, readOnly: s, className: i, name: l }) => {
5879
5882
  const { value: o, change: c } = fe(l), a = (d) => {
5880
5883
  c && c(d.target.checked);
5881
5884
  };
@@ -5890,7 +5893,7 @@ const fe = (n) => {
5890
5893
  onChange: a
5891
5894
  }
5892
5895
  ) });
5893
- }, js = ({ placeholder: n, ref: t, style: r, readOnly: s, className: i, name: l }) => {
5896
+ }, ps = ({ placeholder: n, ref: t, style: r, readOnly: s, className: i, name: l }) => {
5894
5897
  const { value: o, change: c } = fe(l), a = (u) => {
5895
5898
  if (u.length > 0)
5896
5899
  return c && c(!0);
@@ -5909,7 +5912,7 @@ const fe = (n) => {
5909
5912
  onChange: a
5910
5913
  }
5911
5914
  );
5912
- }, ps = (n) => {
5915
+ }, Cs = (n) => {
5913
5916
  const { error: t, value: r, change: s, clearHandler: i } = fe(n.name);
5914
5917
  return /* @__PURE__ */ e.jsx(
5915
5918
  Fe,
@@ -5922,10 +5925,10 @@ const fe = (n) => {
5922
5925
  onClear: i
5923
5926
  }
5924
5927
  );
5925
- }, Cs = (n) => {
5928
+ }, _s = (n) => {
5926
5929
  const { error: t, value: r, change: s, clearHandler: i } = fe(n.name);
5927
5930
  return /* @__PURE__ */ e.jsx(Qn, { ...n, onChange: s, onClear: n.clear ? i : void 0, value: String(r), error: !!t, errorText: t });
5928
- }, _s = (n) => {
5931
+ }, vs = (n) => {
5929
5932
  const { error: t, value: r, change: s } = fe(n.name);
5930
5933
  return /* @__PURE__ */ e.jsx(
5931
5934
  Hr,
@@ -5937,7 +5940,7 @@ const fe = (n) => {
5937
5940
  errorText: t
5938
5941
  }
5939
5942
  );
5940
- }, vs = (n) => {
5943
+ }, gs = (n) => {
5941
5944
  const { error: t, value: r, change: s } = fe(n.name);
5942
5945
  return /* @__PURE__ */ e.jsx(
5943
5946
  Jr,
@@ -5949,7 +5952,7 @@ const fe = (n) => {
5949
5952
  errorText: t
5950
5953
  }
5951
5954
  );
5952
- }, gs = ve(
5955
+ }, bs = ve(
5953
5956
  function({ children: t, value: r, name: s, errors: i, onFinish: l, ...o }, c) {
5954
5957
  const [a, d] = g(r ?? {}), u = k((h) => {
5955
5958
  h.preventDefault(), l == null || l(a);
@@ -5969,16 +5972,16 @@ const fe = (n) => {
5969
5972
  reset: () => d(r ?? {})
5970
5973
  }), [l, a, r]), /* @__PURE__ */ e.jsx(rt.Provider, { value: { value: a, changeField: m, errors: i }, children: /* @__PURE__ */ e.jsx("form", { name: s, onSubmit: u, noValidate: !0, ...o, children: t }) });
5971
5974
  }
5972
- ), r1 = Object.assign(gs, {
5973
- TextInput: ps,
5974
- NumberInput: ms,
5975
- SelectInput: xs,
5976
- SwitchField: fs,
5977
- SwitchButtonField: js,
5978
- MoreTextField: hs,
5979
- TextArea: Cs,
5980
- DateField: _s,
5981
- TimeField: vs
5975
+ ), s1 = Object.assign(bs, {
5976
+ TextInput: Cs,
5977
+ NumberInput: xs,
5978
+ SelectInput: fs,
5979
+ SwitchField: js,
5980
+ SwitchButtonField: ps,
5981
+ MoreTextField: ms,
5982
+ TextArea: _s,
5983
+ DateField: vs,
5984
+ TimeField: gs
5982
5985
  });
5983
5986
  export {
5984
5987
  St as AddUserIcon,
@@ -5986,13 +5989,13 @@ export {
5986
5989
  nn as ArrowLeft,
5987
5990
  vt as ArrowRight,
5988
5991
  gt as ArrowUp,
5989
- Ts as BaseActionCard,
5992
+ Os as BaseActionCard,
5990
5993
  Ve as BaseButton,
5991
5994
  Ut as BaseDialog,
5992
5995
  dr as BaseMenu,
5993
5996
  et as BaseType,
5994
5997
  Ee as BasicTemplateDialog,
5995
- Os as BigContainer,
5998
+ As as BigContainer,
5996
5999
  vn as BottomSheetsUi,
5997
6000
  ye as Button,
5998
6001
  Sn as Calendar,
@@ -6001,17 +6004,17 @@ export {
6001
6004
  Bn as Checkbox,
6002
6005
  Ie as ChevronDown,
6003
6006
  Wn as Chips,
6004
- Rs as CircleInput,
6007
+ Es as CircleInput,
6005
6008
  Ge as CircleMinus,
6006
6009
  rn as CirclePlus,
6007
6010
  en as Clock,
6008
6011
  sn as ColorContext,
6009
- Ys as ColorField,
6010
- Ls as ColorProvider,
6011
- As as ColumnLayout,
6012
+ Us as ColorField,
6013
+ $s as ColorProvider,
6014
+ Ds as ColumnLayout,
6012
6015
  Dt as ConditionerIcon,
6013
6016
  At as ConditionerIcon2,
6014
- Ds as ContentBox,
6017
+ Is as ContentBox,
6015
6018
  Fn as Copy,
6016
6019
  cn as CopyButton,
6017
6020
  Bt as Curtains,
@@ -6020,27 +6023,27 @@ export {
6020
6023
  Hr as DateField,
6021
6024
  Br as DayOfWeekField,
6022
6025
  se as Divider,
6023
- Xs as EmptyPage,
6026
+ Ks as EmptyPage,
6024
6027
  ir as FAB,
6025
6028
  pt as FilledButton,
6026
6029
  jt as FilledTotalButton,
6027
6030
  On as FilterIcon,
6028
- r1 as Form,
6029
- Fs as FullScreenTemplateDialog,
6031
+ s1 as Form,
6032
+ Ts as FullScreenTemplateDialog,
6030
6033
  yt as GearIcon,
6031
- Hs as GridLayout,
6032
- Is as GridLayoutItem,
6034
+ zs as GridLayout,
6035
+ Hs as GridLayoutItem,
6033
6036
  Et as Group,
6034
6037
  Ne as HEXtoRGB,
6035
- Ss as HSLtoHSV,
6036
- Ms as HSVtoHSL,
6038
+ Ms as HSLtoHSV,
6039
+ Ls as HSVtoHSL,
6037
6040
  Le as HSVtoRGB,
6038
6041
  bt as Home,
6039
6042
  de as IconButton,
6040
- Es as IconButtonMenu,
6043
+ Vs as IconButtonMenu,
6041
6044
  is as IconSelectField,
6042
- e1 as IconsSelect,
6043
- Ks as JsonContainer,
6045
+ n1 as IconsSelect,
6046
+ qs as JsonContainer,
6044
6047
  Rn as Keyboard,
6045
6048
  Tt as LampIcon,
6046
6049
  wt as LinkIcon,
@@ -6058,9 +6061,9 @@ export {
6058
6061
  Gr as MoreText,
6059
6062
  Mn as MoreVertical,
6060
6063
  rs as MultiFilter,
6061
- Ws as NavigationBar,
6062
- Gs as NavigationDrawer,
6063
- Zs as NavigationRail,
6064
+ Gs as NavigationBar,
6065
+ Zs as NavigationDrawer,
6066
+ Ys as NavigationRail,
6064
6067
  Jn as NumberField,
6065
6068
  Rt as OkUserIcon,
6066
6069
  Cn as OutlineButton,
@@ -6073,13 +6076,13 @@ export {
6073
6076
  Ae as PopupState,
6074
6077
  De as RGBtoHSV,
6075
6078
  Gn as RadioButton,
6076
- $s as Range,
6079
+ Rs as Range,
6077
6080
  Ft as Room,
6078
- Qs as RunningLine,
6081
+ e1 as RunningLine,
6079
6082
  ee as ScreenSize,
6080
- zs as ScrollContainer,
6081
- qs as Search,
6082
- Js as SearchAndFilter,
6083
+ Ps as ScrollContainer,
6084
+ Js as Search,
6085
+ Qs as SearchAndFilter,
6083
6086
  Zn as SegmentedButton,
6084
6087
  nt as SelectField,
6085
6088
  hr as SelectionDialog,
@@ -6088,21 +6091,21 @@ export {
6088
6091
  zt as Sensor3,
6089
6092
  Pt as SensorWarning,
6090
6093
  we as SizeContext,
6091
- Ns as SizeProvider,
6092
- Us as Slider,
6094
+ ws as SizeProvider,
6095
+ Xs as Slider,
6093
6096
  ur as SmallWindowMenu,
6094
6097
  ss as Snackbar,
6095
6098
  os as SneckbarContext,
6096
- t1 as SneckbarProvider,
6099
+ r1 as SneckbarProvider,
6097
6100
  Yn as Switch,
6098
6101
  Ot as SwitchIcon,
6099
- Bs as Table,
6100
- Ps as Tabs,
6101
- ws as Temp,
6102
+ Ws as Table,
6103
+ Bs as Tabs,
6104
+ Ss as Temp,
6102
6105
  Tn as TempHighIcon,
6103
6106
  Qn as TextArea,
6104
6107
  ce as TextButton,
6105
- Vs as TextDialog,
6108
+ Fs as TextDialog,
6106
6109
  Fe as TextField,
6107
6110
  Jr as TimeField,
6108
6111
  Kr as TimePicker,
@@ -6116,7 +6119,7 @@ export {
6116
6119
  $t as XUserIcon,
6117
6120
  Te as getContainerColor,
6118
6121
  Ye as getContainerData,
6119
- n1 as getIcons,
6122
+ t1 as getIcons,
6120
6123
  Hn as getModalWindowCord,
6121
6124
  re as getTextColor,
6122
6125
  qt as hexToRgb,
@@ -318,7 +318,7 @@ React keys must be passed directly to JSX without using spread:
318
318
  0.209-0.6504 0.209-0.211 0-0.4057-0.0739-0.5781-0.1973v-3.4395c0-1.108
319
319
  -0.892-2-2-2h-3.3418c-0.1412-0.1812-0.2305-0.3868-0.2305-0.6133 0-0.2378
320
320
  0.0974-0.4878 0.252-0.6992a2.5486 2.1008 0 0 0 0.8691-1.5762A2.5486
321
- 2.1008 0 0 0 12 6.01172Z`})})})]})},Ee=({className:n="",children:t,header:r,action:o,onHide:a,style:i,clearStyle:l=!1,disableBackplate:d,marginBottom:s,maxWidth:u="560px",showCloseButton:_=!1,ariaLabel:p})=>{const h=()=>{a&&a()},m={...i,marginBottom:s,maxWidth:typeof u=="number"?`${u}px`:u};return e.jsx(Se,{onHide:h,disableBackplate:d,children:e.jsxs("div",{style:m,className:`${l?"":"dialog-template__container dialog-template_base dialog-template_color_surface-container"} dialog-template ${n}`,role:"dialog","aria-modal":"true","aria-label":p||r,children:[r&&e.jsxs("div",{className:"dialog-template__container__header dialog-template__container__header_color_surface-container",children:[e.jsx(G,{type:"heading",children:r}),_&&e.jsx(re,{className:"dialog-template__container__header__button dialog-template__container__header__button_color_surface-container",onClick:h,"aria-label":"Close dialog",icon:e.jsx(oe,{})})]}),e.jsx("div",{className:"dialog-template__container__content",children:t}),o&&e.jsx("div",{className:"dialog-template__container__action",children:o})]})})},xe=({marginBottom:n=80,forceBottomSheet:t=!1,forceModal:r=!1,...o})=>{const{screen:a}=c.useContext(be);Ue(!0,document.body);const i=()=>{var d;(d=o.onHide)==null||d.call(o)};return t||!r&&a===Q.MOBILE?e.jsx(Xe,{bottom:n,onHide:i,visible:!0,children:e.jsxs("div",{style:o.style,className:`dialog-bottom ${o.className||""}`,children:[o.header&&e.jsx("div",{className:"dialog-bottom__header",children:e.jsx(G,{type:"heading",children:o.header})}),e.jsx("div",{className:"dialog-bottom__content dialog-bottom__content_color_text-surface-color",children:e.jsx("div",{className:"dialog-bottom__content__scroll",children:o.children})}),o.action&&e.jsx("div",{className:"dialog-bottom__action",children:o.action})]})}):e.jsx(Ee,{...o,onHide:i})},Be=({btns:n,onHide:t,onSuccess:r})=>e.jsx(e.Fragment,{children:n.map(o=>o.danger?e.jsx(_t,{text:o.danger.text,header:o.danger.header,style:{backgroundColor:"var(--Error-color)",...o.style},onClick:o.success?r:o.hide?t:o.onClick,disabled:o.disabled,children:o.text},o.text):e.jsx(me,{style:o.style,styleType:o.styleType,onClick:o.success?r:o.hide?t:o.onClick,disabled:o.disabled,children:o.text},o.text))}),ut=({styleContainer:n,text:t,header:r,actionText:o,cancelText:a="Отмена",onSuccess:i,onCancel:l,onHide:d,children:s,disableDefaultButtons:u=!1,customActions:_,btns:p})=>{const h=c.useCallback(()=>{i==null||i(),d==null||d()},[i,d]),m=c.useCallback(()=>{l==null||l(),d==null||d()},[l,d]),x=c.useCallback(()=>_||(u?null:p?e.jsx(Be,{onHide:m,onSuccess:h,btns:p}):e.jsx(Be,{onHide:m,onSuccess:h,btns:[{text:a,hide:!0,styleType:"outline"},{text:o??"OK",success:!0}]})),[_,u,m,h,o,a]);return e.jsxs(xe,{style:n,header:r,onHide:m,action:x(),children:[t&&e.jsx(G,{type:"body",children:t}),s]})},le=({children:n,container:t=document.body})=>t?Rt.createPortal(n,t):e.jsx("p",{children:"container not found"}),_t=({container:n,text:t,header:r,onClick:o,styleType:a,...i})=>{const[l,d]=c.useState(null);return e.jsxs(e.Fragment,{children:[e.jsx(me,{styleType:a??"filled",...i,onClick:d}),l!==null&&e.jsx(le,{container:n,children:e.jsx(ut,{header:r,text:t,onSuccess:()=>o==null?void 0:o(l),onHide:()=>d(null)})})]})},ln=({text:n,supportText:t=!0,copiedTimeout:r=2e3,className:o="",onClick:a,disabled:i,...l})=>{const[d,s]=c.useState(!1),u=c.useCallback(async h=>{if(!i){try{await navigator.clipboard.writeText(n),s(!0),setTimeout(()=>s(!1),r)}catch(m){console.error("Не удалось скопировать текст",m)}a==null||a(h)}},[n,i,r,a]),_=d?e.jsx(se,{"aria-hidden":"true"}):e.jsx(an,{"aria-hidden":"true"}),p=d?"Скопировано!":"Копировать";return t?e.jsxs("div",{className:"copy-button",children:[e.jsx(re,{icon:_,onClick:u,disabled:i,"aria-label":`${p} ${n}`,className:o,...l}),e.jsx(G,{type:"body","aria-live":"polite",children:p})]}):e.jsx(re,{icon:_,onClick:u,disabled:i,"aria-label":`${p} ${n}`,className:o,...l})};var ze=(n=>(n[n.OPEN=0]="OPEN",n[n.HIDING=1]="HIDING",n[n.CLOSE=2]="CLOSE",n))(ze||{});const ht=({valueDisplayDuration:n=2e3})=>{const[t,r]=c.useState(2),o=c.useRef(null),a=c.useRef(null),i=()=>{r(1),a.current=window.setTimeout(()=>{r(2)},500)},l=()=>{r(0),o.current&&window.clearTimeout(o.current),a.current&&window.clearTimeout(a.current),n&&(o.current=window.setTimeout(()=>{i()},n))};return c.useEffect(()=>()=>{o.current&&window.clearTimeout(o.current),a.current&&window.clearTimeout(a.current)},[]),{showPopup:l,popupState:t,hidePopup:i}},dn=({className:n="",text:t,state:r=ze.OPEN})=>r===ze.CLOSE?null:e.jsx("div",{className:`alex-evo-sh-ui-kit-tooltip value-popup ${n} ${r===ze.HIDING?"hiding":""}`,"aria-live":"polite","aria-atomic":"true",children:t});function ar(n,t,r){arguments.length===1&&(t=n.s,r=n.l,n=n.h);var o=n,a,i;return r*=2,t*=r<=1?r:2-r,i=(r+t)/2,a=2*t/(r+t),{h:o,s:a,v:i}}function ir(n,t,r){arguments.length===1&&(t=n.s,r=n.v,n=n.h);var o=(2-t)*r/2;return o!=0&&(o==1?t=0:o<.5?t=t*r/(o*2):t=t*r/(2-o*2)),{h:n,s:t,l:o}}function ke(n,t,r){var o,a,i,l,d,s,u,_;switch(arguments.length===1&&(t=n.s,r=n.v,n=n.h),l=Math.floor(n*6),d=n*6-l,s=r*(1-t),u=r*(1-d*t),_=r*(1-(1-d)*t),l%6){case 0:o=r,a=_,i=s;break;case 1:o=u,a=r,i=s;break;case 2:o=s,a=r,i=_;break;case 3:o=s,a=u,i=r;break;case 4:o=_,a=s,i=r;break;case 5:o=r,a=s,i=u;break}return{r:Math.round(o*255),g:Math.round(a*255),b:Math.round(i*255)}}function ye(n){let t=n.toString(16);return t.length===1&&(t="0"+t),t}function je(n,t=!1){return t?"#"+ye(n.r)+ye(n.g)+ye(n.b):ye(n.r)+ye(n.g)+ye(n.b)}function Fe(n,t,r){arguments.length===1&&(t=n.g,r=n.b,n=n.r);var o=Math.max(n,t,r),a=Math.min(n,t,r),i=o-a,l,d=o===0?0:i/o,s=o/255;switch(o){case a:l=0;break;case n:l=t-r+i*(t<r?6:0),l/=6*i;break;case t:l=r-n+i*2,l/=6*i;break;case r:l=n-t+i*4,l/=6*i;break}return{h:l,s:d,v:s}}function fe(n){var t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;n=n.replace(t,function(o,a,i,l){return a+a+i+i+l+l});var r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return r?{r:parseInt(r[1],16),g:parseInt(r[2],16),b:parseInt(r[3],16)}:null}const pt=fe,cr=n=>{if(!n)return"linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0))";const t=pt(n);return t?`linear-gradient(135deg, rgba(${t.r}, ${t.g}, ${t.b}, 0.1), rgba(${t.r}, ${t.g}, ${t.b}, 0))`:"linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0))"};function mt(n,t,r){if(n===0)return r??"#e0e0e0";if(n===1)return t;const o=r?fe(r):null,a=(o==null?void 0:o.r)??224,i=(o==null?void 0:o.g)??224,l=(o==null?void 0:o.b)??224,d=parseInt(t.substring(1,3),16),s=parseInt(t.substring(3,5),16),u=parseInt(t.substring(5,7),16),_=Math.round(a+n*(d-a)),p=Math.round(i+n*(s-i)),h=Math.round(l+n*(u-l));return`rgb(${_}, ${p}, ${h})`}const ae=(n,t,r="",o)=>{let a,i,l,d,s,u,_,p=Math.round,h=typeof r=="string";if(typeof n!="number"||n<-1||n>1||typeof t!="string"||t[0]!="r"&&t[0]!="#"||r&&!h||(_=t.length>9,_=h?typeof r=="string"&&r.length>9?!0:r=="c"?!_:!1:_,s=ae.pSBCr(t),d=n<0,u=r&&typeof r=="string"&&r!="c"?ae.pSBCr(r):d?{r:0,g:0,b:0,a:-1}:{r:255,g:255,b:255,a:-1},n=d?n*-1:n,d=1-n,!s||!u))return null;o?(a=p(d*(s.r??0)+n*(u.r??0)),i=p(d*(s.g??0)+n*(u.g??0)),l=p(d*(s.b??0)+n*(u.b??0))):(a=p((d*(s.r??0)**2+n*(u.r??0)**2)**.5),i=p((d*(s.g??0)**2+n*(u.g??0)**2)**.5),l=p((d*(s.b??0)**2+n*(u.b??0)**2)**.5));let m=s.a??1;return u=u.a??1,s=m>=0||u>=0,m=m>=0||u>=0?m<0?u:u<0?m:m*d+u*n:0,_?"rgb"+(s?"a(":"(")+a+","+i+","+l+(s?","+p(m*1e3)/1e3:"")+")":"#"+(4294967296+a*16777216+i*65536+l*256+(s?p(m*255):0)).toString(16).slice(1,s?void 0:-2)};ae.pSBCr=n=>{const t=parseInt;let r=n.length,o={};if(r>9){const a=n.split(","),[i,l,d,s]=a;if(r=a.length,r<3||r>4)return null;o.r=t(i[3]=="a"?i.slice(5):i.slice(4)),o.g=t(l),o.b=t(d),o.a=s?parseFloat(s):-1}else{if(r==8||r==6||r<4)return null;r<6&&(n="#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+(r>4?n[4]+n[4]:""));let a=t(n.slice(1),16);r==9||r==5?(o.r=a>>24&255,o.g=a>>16&255,o.b=a>>8&255,o.a=Math.round((a&255)/.255)/1e3):(o.r=a>>16,o.g=a>>8&255,o.b=a&255,o.a=-1)}return o};function R(n){const t=fe(n);return t?t.r*.299+t.g*.589+t.b*.114>186?"#000000":"#FFFFFF":"#fff"}function $e(n,t=!1){return ae(t?-.6:.3,n)??n}const bt={Primary_color:"#6750A4",Secondary_color:"#8c5a9c",Tertiary_color:"#7D5260",Background_color:"#FFFBFE",Surface_container_color:"#FFFBFE",Error_color:"#B3261E",Outline_color:"#79747E",Shadow_color:"#000000",On_primary_color:"#FFFFFF",On_secondary_color:"#FFFFFF",On_tertiary_color:"#FFFFFF",On_background_color:"#1C1B1F",Primary_container_color:"#EADDFF",Secondary_container_color:"#E8DEF8",Tertiary_container_color:"#FFD8E4",Error_container_color:"#F9DEDC",On_primary_container_color:"#21005D",On_secondary_container_color:"#1D192B",On_tertiary_container_color:"#31111D",On_error_container_color:"#410E0B",On_error_color:"#FFFFFF",Surface_container_lowest_color:"#FFFFFF",Surface_container_low_color:"#F7F2FA",Surface_container_high_color:"#D0BCFF",Surface_container_highest_color:"#4F378B",On_surface_color:"#1C1B1F",On_surface_variant_color:"#49454F",Surface_container_hover_color:"#F2E7FE",Outline_variant_color:"#CAC4D0"},sr={Primary_color:(n,t)=>{const r=$e(n,t);return{Primary_color:n,On_primary_color:R(n),Primary_container_color:r,On_primary_container_color:R(r)}},Secondary_color:(n,t)=>{const r=$e(n,t);return{Secondary_color:n,On_secondary_color:R(n),Secondary_container_color:r,On_secondary_container_color:R(r)}},Tertiary_color:(n,t)=>{const r=$e(n,t);return{Tertiary_color:n,On_tertiary_color:R(n),Tertiary_container_color:r,On_tertiary_container_color:R(r)}},Background_color:(n,t)=>({Background_color:n,On_background_color:R(n)}),Error_color:(n,t)=>{const r=$e(n,t);return{Error_color:n,On_error_color:R(n),Error_container_color:r,On_error_container_color:R(r)}},Surface_container_color:(n,t)=>{const r=ae(t?-.2:.2,n)??n,o=ae(t?-.4:.4,n)??n,a=ae(t?.2:-.2,n)??n,i=ae(t?.4:-.4,n)??n,l=ae(t?-.5:.5,n)??n;return{Surface_container_color:n,On_surface_color:R(n),Surface_container_low_color:r,Surface_container_lowest_color:o,Surface_container_high_color:a,Surface_container_highest_color:i,Surface_container_hover_color:l,On_surface_variant_color:ae(t?-.6:.4,R(n))??R(n)}},Outline_color:(n,t)=>({Outline_color:n,Outline_variant_color:ae(t?.1:-.1,n)??n})};function ft(n,t=!1){const[r,o]=c.useState({...bt,...n}),[a,i]=c.useState(t),l=c.useCallback((s,u)=>{const _=sr[s];if(!_)return;const p=_(u,a);o(h=>({...h,...p})),Object.entries(p).forEach(([h,m])=>{document.body.style.setProperty(`--${h.replace(/_/g,"-")}`,m)})},[a]);return{colors:r,setColor:l,setReverse:s=>i(s)}}const un={light:{colors:{Primary_color:"#6750A4",Secondary_color:"#8c5a9c",Tertiary_color:"#7D5260",Background_color:"#FFFBFE",Surface_container_color:"#FFFBFE",Error_color:"#B3261E",Outline_color:"#79747E",Shadow_color:"#000000"}},dark:{reverse:!0,colors:{Primary_color:"#D0BCFF",Secondary_color:"#dbb0e8",Tertiary_color:"#EFB8C8",Background_color:"#1C1B1F",Surface_container_color:"#1C1B1F",Error_color:"#F2B8B5",Outline_color:"#938F99",Shadow_color:"#000000"}}};function vt(n="light"){const[t,r]=c.useState(un),[o,a]=c.useState(n),{colors:i,setColor:l,setReverse:d}=ft(t[o].colors,t[o].reverse),s=c.useCallback(m=>{const x=t[m].colors;x&&(Object.entries(x).forEach(([v,f])=>{l(v,f)}),d(t[m].reverse??!1),a(m))},[t,l]);c.useEffect(()=>{s(o)},[o,s]);const u=c.useCallback((m,x,v)=>{r(f=>({...f,[m]:{colors:{...f[m].colors,[x]:v},reverse:f[m].reverse}}))},[]),_=c.useCallback((m,x="light",v)=>{r(f=>({...f,[m]:{colors:f[x].colors,reverse:v===void 0?f[x].reverse:v}}))},[]),p=c.useCallback(m=>{r(x=>{const v={...x};return delete v[m],v}),o===m&&a("light")},[o]),h=c.useCallback(m=>{un[m]&&r(x=>({...x,[m]:{...un[m]}}))},[]);return{colors:i,themes:t,activeTheme:o,setActiveTheme:s,updateThemeColor:u,createTheme:_,deleteTheme:p,resetTheme:h}}const Te=()=>{},lr={colors:bt,themes:{},activeTheme:"",setActiveTheme:Te,updateThemeColor:Te,createTheme:Te,deleteTheme:Te,resetTheme:Te},He=c.createContext(lr),dr=({children:n})=>{const t=vt();return e.jsx(He.Provider,{value:t,children:n})},gt="var(--range-width)",ur=({colorRange:n,colorBg:t="var(--Surface-container-color)",onChange:r,min:o=0,max:a=100,step:i=1,strokeWidth:l="40px",value:d,orientation:s="horizontal",styleTrack:u="base",showValue:_=!0,valueDisplayDuration:p=2e3,ariaLabel:h="Регулятор значения",startColor:m,className:x="",...v})=>{const f=c.useRef(null),k=c.useRef(null),[j,C]=c.useState(d??o),[y,M]=c.useState("200px"),{colors:$}=c.useContext(He),{showPopup:H,popupState:V}=ht({valueDisplayDuration:p}),N=n??$.Primary_color??"#0000ff";c.useEffect(()=>{var L;if(s==="vertical"&&((L=k.current)!=null&&L.parentElement)){const T=()=>{var Z,g;const q=(g=(Z=k.current)==null?void 0:Z.parentElement)==null?void 0:g.clientHeight;q&&M(`${q}px`)};T();const Y=new ResizeObserver(T);return k.current.parentElement&&Y.observe(k.current.parentElement),()=>Y.disconnect()}},[s]),c.useEffect(()=>{d!==void 0&&(C(d),A())},[d]);const A=c.useCallback(()=>{_&&H()},[H]),P=L=>{const T=parseFloat(L.target.value);C(T),A(),r==null||r(L)},z=c.useMemo(()=>a!==o?(j-o)/(a-o)*100:0,[j,o,a]),w=c.useMemo(()=>({...v.style,[s==="vertical"?"height":"width"]:`${z}%`,background:u==="point"?"transperent":u==="static-color"?N:mt(z/100,N,m)}),[z,N,v.style,s,u]),I=c.useMemo(()=>s==="vertical"?{"--range-width":l,"--point-width":u==="point"?l:"6px","--point-opacity":u==="point"?"1":"0","--truck-color":N,width:gt,height:y,...v.style}:{"--range-width":l,"--point-width":u==="point"?l:"6px","--point-opacity":u==="point"?"1":"0","--truck-color":N,width:"100%",height:gt,...v.style},[s,y,v.style,l,u,N]),S=c.useMemo(()=>s==="vertical"?{width:y}:{width:"100%"},[s,y]);return e.jsxs("div",{ref:k,className:`range-wrapper ${s} ${x}`,style:I,children:[e.jsxs("div",{className:"track",style:{background:t},children:[e.jsx("div",{className:"active-track",style:w}),e.jsx(dn,{text:Math.round(j).toString(),state:V,className:"value-popup"})]}),e.jsx("input",{ref:f,type:"range",min:o,style:S,max:a,step:i,value:j,onChange:P,onFocus:v.onFocus,onBlur:v.onBlur,className:"slider-input","aria-orientation":s,"aria-valuenow":j,"aria-valuemin":o,"aria-valuemax":a,"aria-label":h,"aria-valuetext":`${j} из ${a}`,...v})]})},_r=({min:n=0,max:t=100,value:r=0,onChange:o,onFocus:a,onBlur:i,styleRange:l="circle",styleTrack:d="base",strokeWidth:s=20,radius:u=100,colorBg:_="var(--Surface-container-color)",colorRange:p,pointColor:h,showBase:m=!0,showIndicator:x=!0,showPoint:v=!1,rounding:f=!0,showValue:k=!0,style:j,children:C,className:y,startColor:M})=>{const $=c.useRef(null),H=c.useRef(!1),V=u*2,N=u*2,A=Math.min(V,N),P=V/2,z=N/2,w=A/2-s/2,I=d==="point"?!1:x,S=d==="point"?!0:v,{colors:L}=c.useContext(He),T=p??L.Primary_color??"#0000ff",Y=h??L.Primary_color??"#0000ff",[q,Z]=c.useState(r);c.useEffect(()=>{r!==void 0&&Z(r)},[r]);const g=c.useCallback(()=>{switch(l){case"semicircle":return 180;case"brokenCircle":return 270;default:return 360}},[l]),O=c.useCallback(()=>l==="semicircle"?[w*Math.PI,w*Math.PI]:l==="brokenCircle"?[w*Math.PI*1.25,w*Math.PI*1.5]:[w*Math.PI,w*Math.PI*2],[l,w]),D=c.useMemo(()=>t!==n?(q-n)/(t-n)*100:0,[q,n,t]),X=c.useCallback(()=>{if(!$.current)return;const[W,_e]=O(),pe=(q-n)*_e/(t-n);if(m){const U=$.current.querySelector('[data-el="base"]');U&&(U.style.stroke=_,U.style.strokeWidth=s.toString(),U.style.strokeLinecap=f?"round":"",U.style.strokeDashoffset=W.toString(),U.style.strokeDasharray=`${_e}, ${w*Math.PI*2-_e}`)}if(I){const U=$.current.querySelector('[data-el="indicator"]');if(U){const he=parseFloat(U.dataset.percentage??"");he!==null&&(he<D-2||he>D+2)?U.style.transition=".3s":U.style.transition=H.current?"none":".3s",U.dataset.percentage=D.toString(),U.style.stroke=d==="static-color"?T:mt(D/100,T,M),U.style.strokeWidth=s.toString(),U.style.strokeLinecap=f?"round":"",U.style.strokeDashoffset=W.toString(),U.style.strokeDasharray=`${pe}, ${w*Math.PI*2-pe}`}}if(S){const U=$.current.querySelector('[data-el="point"]');if(U){const he=parseFloat(U.dataset.percentage??"");he!==null&&(he<D-2||he>D+2)?U.style.transition=".3s":U.style.transition=H.current?"none":".3s",U.dataset.percentage=D.toString(),U.style.stroke=Y,U.style.strokeWidth=s.toString(),U.style.strokeLinecap="round",q===t&&l==="semicircle"?U.style.strokeDashoffset="0":U.style.strokeDashoffset=(W-pe).toString(),U.style.strokeDasharray=`0, ${w*Math.PI*2}`}}},[q,O,t,n,w,s,_,T,Y,m,I,S,f,D,M]),K=W=>{H.current=!0,document.addEventListener("mousemove",ne),document.addEventListener("mouseup",J),ie(W)},ne=W=>{W.preventDefault(),H.current&&ie(W)},J=()=>{H.current=!1,document.removeEventListener("mousemove",ne),document.removeEventListener("mouseup",J)},ie=c.useCallback(W=>{if(!$.current)return;const _e=g(),pe=$.current.getBoundingClientRect(),U=pe.left+pe.width/2,he=pe.top+pe.height/2,Io=W.clientX,Do=W.clientY,Ao=he-Do,Bo=U-Io;let ce=Math.atan2(Ao,Bo)*(180/Math.PI);_e===270&&(ce+=45),ce<0&&(ce=360+ce),ce<0&&(ce=0),ce>_e&&q>(t-n)/2?ce=_e:ce>_e&&(ce=0);const Ho=_e,Wo=t-n,Nn=Math.round(ce*Wo/Ho+n);Z(Nn),Nn!==r&&o&&o(Nn)},[g,o,t,n,P,z,q]);c.useEffect(()=>{X()},[X]),c.useEffect(()=>()=>{document.removeEventListener("mousemove",ne),document.removeEventListener("mouseup",J)},[]);const B={"--stroke-width":`${s}px`};return e.jsxs("div",{style:{width:V,height:N,...j},className:"range-circule-wrapper",onFocus:a,onBlur:i,children:[e.jsxs("svg",{ref:$,width:"100%",height:"100%",onMouseDown:K,children:[m&&e.jsx("circle",{"data-el":"base",fill:"none",cx:P,cy:z,r:w}),I&&e.jsx("circle",{"data-el":"indicator",fill:"none",cx:P,cy:z,r:w}),S&&e.jsx("circle",{"data-el":"point",fill:"none",cx:P,cy:z,r:w})]}),e.jsx("div",{className:`range-circule-children ${y}`,style:B,children:C??(k&&e.jsx(dn,{className:"",text:Math.floor(q).toString()}))})]})},xt=c.forwardRef(({icon:n,children:t,size:r="medium",position:o="bottom-right",variant:a="primary",className:i="",...l},d)=>{const s=!!t;return e.jsxs("button",{ref:d,type:"button",className:`fab ${s?"fab--extended":""} fab--${r} fab--${a} ${o!=="none"?`fab--${o}`:""} ${i}`,"aria-label":s?void 0:l["aria-label"]||"Floating action button",...l,children:[n&&e.jsx("span",{className:"fab__icon",children:n}),s&&e.jsx("span",{className:"fab__text",children:t})]})});xt.displayName="FAB";const ee=({style:n,short:t,text:r})=>r?e.jsxs("div",{style:n,className:`divider-and-text ${t?"short":""}`,children:[e.jsx("div",{className:`divider ${t?"short":""}`}),r,e.jsx("div",{className:`divider ${t?"short":""}`})]}):e.jsx("div",{style:n,className:`divider ${t?"short":""}`}),hr=({item:n,isIcon:t,globalClick:r,autoHide:o,onHide:a})=>{const i=()=>{n.onClick&&n.onClick(),r&&r(),o&&(a==null||a())};return e.jsxs("div",{className:`menu-item menu-item__info ${n.disabled?"menu-item_disabled":""}`,onClick:i,children:[t?e.jsx("div",{className:"menu-icon-container",children:n.icon}):null,e.jsx("div",{className:"menu-text-container",children:n.title}),e.jsx("div",{className:"menu-status-container",children:n.activated?e.jsx(se,{}):null})]})},Ve=n=>{if(!n)return;const t=window.getComputedStyle(n),r=n.getBoundingClientRect();return{height:parseFloat(t.getPropertyValue("height")),width:parseFloat(t.getPropertyValue("width")),left:r.left,top:r.top}},_n=(n,t,r,o)=>{let a={x:n,y:t};if(!r)return a;const i=window.getComputedStyle(r),l=parseFloat(i.getPropertyValue("height")),d=parseFloat(i.getPropertyValue("width")),s=t+l-document.documentElement.clientHeight,u=n+d-document.documentElement.clientWidth;return s>0&&(a.y=a.y-s-((o==null?void 0:o.marginBottom)??0)),u>0&&(a.x=a.x-u-((o==null?void 0:o.marginRight)??0)),a},pr=({items:n,onHide:t,smallDisplay:r,globalClick:o,autoHide:a,onGlobalHide:i})=>{const l=c.useRef(null),[d,s]=c.useState({left:"0px",top:"0px"}),[u,_]=c.useState(!1);function p(h){for(let m of h)if(m.icon)return!0;return!1}return c.useEffect(()=>{if(!l.current)return;let h=Ve(l.current.parentElement);if(!h)return;let m=_n(h.left+h.width,h.top,l.current,{marginRight:h.width});s({left:m.x-h.left+"px",top:m.y-h.top+"px"}),_(!0)},[]),e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:l,className:`menu-block menu-block_color_surface-container-highest ${r?"":"menu-block_sub"}`,style:{...d,...u?{}:{display:"none"}},children:n.map((h,m)=>e.jsx(hr,{onHide:i,autoHide:a,item:h,isIcon:p(n),globalClick:o},m))}),r?null:e.jsx("div",{style:{zIndex:4},className:"menu-block-backplate",onClick:t})]})},mr=({onHide:n,autoHide:t,globalClick:r,item:o,isIcon:a,smallDisplay:i})=>{const[l,d]=c.useState(!1),s=c.useCallback(()=>{o.subItems?d(u=>!u):(o.onClick&&o.onClick(),r&&r(),t&&n&&n())},[o.onClick]);return e.jsxs("div",{className:`menu-item ${o.disabled?"menu-item_disabled":""}`,children:[e.jsxs("div",{className:"menu-item__info",onClick:s,children:[a?e.jsx("div",{className:"menu-item__info__icon",children:o.icon}):null,e.jsx("div",{className:"menu-item__info__text",children:o.title}),e.jsx("div",{className:"menu-item__info__status ",children:o.subItems?e.jsx("span",{className:`menu-item__info__status__arrow ${l?"menu-item__info__status__arrow_active":""}`}):o.activated?e.jsx(se,{}):e.jsx("span",{className:"menu-item__info__status__none"})})]}),l&&o.subItems?e.jsx(pr,{autoHide:t,items:o.subItems,onGlobalHide:n,onHide:()=>d(!1),smallDisplay:i}):null]})};function kt({block:n,smallDisplay:t,onHide:r,globalClick:o,autoHide:a}){function i(l){for(let d of l.items)if(d.icon)return!0;return!1}return e.jsx("div",{className:"menu-block",children:n.items.map((l,d)=>e.jsx(mr,{globalClick:o,autoHide:a,onHide:r,item:l,isIcon:i(n),smallDisplay:t},d))})}const br=100,yt=n=>{const t=c.useRef(null),[r,o]=c.useState({left:"0px",top:"0px"}),a=()=>{n.onHide&&n.onHide()};return c.useLayoutEffect(()=>{let i=_n(n.x,n.y,t.current,{marginBottom:br});o({left:i.x+"px",top:i.y+"px"})},[n.x,n.y]),n.visible?e.jsx(Se,{onHide:a,children:e.jsx("div",{ref:t,className:"base-menu base-menu_color_surface-container-high",style:{...r,width:n.width,maxWidth:n.width?"100%":void 0},children:n.blocks.map((i,l)=>e.jsxs(c.Fragment,{children:[l!==0?e.jsx(ee,{}):null,e.jsx(kt,{block:i,smallDisplay:!1,globalClick:n.onClick,autoHide:n.autoHide,onHide:a})]},l))})}):null},jt=n=>{const t=()=>{};return e.jsx(Xe,{onHide:n.onHide||t,visible:n.visible,bottom:n.marginBottom,children:e.jsx("div",{className:"small-window-menu",children:n.blocks.map((r,o)=>e.jsxs(c.Fragment,{children:[o!==0?e.jsx(ee,{}):null,e.jsx(kt,{block:r,smallDisplay:!0,autoHide:n.autoHide,onHide:n.onHide})]},o))})})},hn=n=>n.screensize===Q.MOBILE?e.jsx(le,{container:n.container,children:e.jsx(jt,{...n})}):e.jsx(le,{container:n.container,children:e.jsx(yt,{...n})}),fr=c.forwardRef(({screensize:n,autoHide:t,blocks:r,container:o,onClick:a,...i},l)=>{const[d,s]=c.useState(!1),[u,_]=c.useState(void 0),{screen:p}=c.useContext(be),h=()=>{s(!1),_(void 0)},m=v=>{v.stopPropagation(),s(!0),_({x:v.clientX,y:v.clientY}),a==null||a(v)},x=n??p;return e.jsxs(e.Fragment,{children:[e.jsx(re,{ref:l,onClick:m,...i}),e.jsx(hn,{marginBottom:x===Q.MOBILE?80:0,onHide:h,autoHide:t,screensize:n,visible:d,x:(u==null?void 0:u.x)??0,y:(u==null?void 0:u.y)??0,blocks:r,container:o})]})}),pn=c.forwardRef(({name:n,checked:t,onChange:r,readOnly:o,disabled:a,checkIcon:i=e.jsx(se,{baseColor:"var(--On-primary-color)"}),size:l="medium",className:d,...s},u)=>e.jsxs("label",{className:["checkbox-container",`checkbox--${l}`,a?"checkbox--disabled":"",d].filter(Boolean).join(" "),children:[e.jsx("input",{ref:u,className:"checkbox-input",name:n,type:"checkbox",checked:t,onChange:r,readOnly:o,disabled:a,"aria-checked":t,...s}),e.jsx("span",{className:"checkbox-box",children:e.jsx("span",{className:"checkbox-icon-container",children:e.jsx("span",{className:"checkbox-check-icon",children:i})})})]}));pn.displayName="Checkbox";const mn=c.forwardRef(({text:n,onDelete:t,big:r,onClick:o,screenSize:a,className:i,disabled:l,...d},s)=>{const u=p=>{p.stopPropagation(),t==null||t(p)},_=l?void 0:o;return e.jsxs("div",{...d,ref:s,className:`chips ${r?"chips--big":""} ${l?"disabled":""} ${o?"chips--clickable":""} ${i||""}`,onClick:_,role:d.role??o?"button":void 0,tabIndex:d.tabIndex??o?0:void 0,"aria-label":d["aria-label"]??o?n:void 0,children:[e.jsx(G,{type:"body",screensize:a,children:n}),t&&e.jsx("button",{className:"chips__delete",onClick:u,"aria-label":`Remove ${n}`,disabled:l,type:"button",children:e.jsx(oe,{})})]})});mn.displayName="Chips";const bn=c.forwardRef(({name:n,currentValue:t,value:r,onChange:o,readOnly:a,checked:i,defaultChecked:l,label:d,size:s="medium",variant:u="primary",showLabel:_=!0,className:p,...h},m)=>{const x=t!==void 0?t===r:i!==void 0?i:l;return e.jsxs("label",{className:`radio-button-container ${p||""}`,children:[e.jsx("input",{ref:m,className:"radio-button",name:n,type:"radio",checked:x,value:r,onChange:o,readOnly:a,"aria-checked":x,"aria-label":d||h["aria-label"],...h}),e.jsx("span",{className:`radio-button-ui radio-button-ui--${s} radio-button-ui--${u}`}),_&&d&&e.jsx("span",{className:"radio-button-label",children:d})]})});bn.displayName="RadioButton";const fn=c.forwardRef(({items:n,value:t,multiple:r=!1,name:o,readOnly:a=!1,onChange:i,className:l="",size:d="medium",variant:s="primary",...u},_)=>{const[p,h]=c.useState([]);c.useEffect(()=>{h(m(t))},[t]);const m=v=>v===void 0?[]:Array.isArray(v)?v:[v],x=(v,f)=>{if(a)return;v.preventDefault();let k;r?k=p.includes(f)?p.filter(j=>j!==f):[...p,f]:k=p.includes(f)?[]:[f],h(k),i==null||i(k,v)};return e.jsx("div",{ref:_,className:`segmented-button segmented-button--${d} segmented-button--${s} ${l}`,role:"group",...u,children:n.map(v=>e.jsxs("button",{type:"button",role:"radio","aria-checked":p.includes(v),"aria-label":v,disabled:a,className:`segmented-button__item ${p.includes(v)?"segmented-button__item--active":""}`,onClick:f=>x(f,v),children:[p.includes(v)&&e.jsx("span",{className:"segmented-button__icon",children:e.jsx(se,{})}),e.jsx("span",{className:"segmented-button__text",children:v}),e.jsx("input",{type:r?"checkbox":"radio",name:o,value:v,checked:p.includes(v),readOnly:!0,className:"segmented-button__input"})]},v))})});fn.displayName="SegmentedButton";const vn=c.forwardRef(({size:n="medium",variant:t="primary",className:r="",showLabel:o=!1,labelOn:a="On",labelOff:i="Off",checked:l,onChange:d,...s},u)=>e.jsxs("label",{className:`switch-container ${r}`,children:[e.jsx("input",{ref:u,type:"checkbox",role:"switch","aria-checked":l,checked:l,onChange:d,className:`switch-input switch--${n} switch--${t}`,...s}),o&&e.jsx("span",{className:"switch-label",children:l?a:i})]}));vn.displayName="Switch";function Ct({onSuccess:n,items:t,header:r,onHide:o,noHide:a=!1,name:i="selection_dialog",confirmText:l="Выбрать",cancelText:d="Отмена",defaultValue:s,style:u}){const[_,p]=c.useState(s),h=c.useCallback(()=>{_!==void 0&&(n==null||n(_),p(void 0),!a&&(o==null||o()))},[_,n,a,o]),m=c.useCallback(()=>{o==null||o()},[o]),x=c.useCallback(v=>{p(v)},[]);return e.jsxs(xe,{header:r,style:u,onHide:m,action:e.jsx(vr,{onHide:m,onSuccess:h,disabled:_===void 0,confirmText:l,cancelText:d}),children:[e.jsx(ee,{style:{padding:0}}),e.jsx(St,{transparent:!0,scroll:!0,maxHeight:"300px","aria-label":"Варианты выбора",children:t.map((v,f)=>e.jsx("label",{"aria-disabled":v.disabled,children:e.jsx(Mt,{hovered:!v.disabled,header:v.title,icon:v.icon,description:v.description,onClick:v.disabled?void 0:()=>x(v.data),control:e.jsx(bn,{onClick:v.disabled?void 0:()=>x(v.data),name:i,checked:v.data===_,disabled:v.disabled,"aria-label":`Выбрать ${v.title}`})})},`${i}_${f}`))}),e.jsx(ee,{style:{padding:0}})]})}function vr({onSuccess:n,onHide:t,disabled:r=!1,confirmText:o="OK",cancelText:a="Отмена"}){return e.jsxs("div",{children:[t&&e.jsx(Ye,{onClick:t,children:a}),e.jsx(te,{onClick:n,disabled:r,children:o})]})}const Ce=c.forwardRef(({onClick:n,inputRef:t,styleContainer:r,type:o="text",transparent:a,readOnly:i,password:l,border:d,onClear:s,icon:u,onChange:_,name:p,value:h,placeholder:m,className:x,validEmptyValue:v,onFocus:f,onBlur:k,error:j,max:C,min:y,autoFocus:M,disabled:$,size:H="medium",helperText:V,errorText:N,onKeyDown:A},P)=>{const z=c.useRef(null),[w,I]=c.useState(!1),[S,L]=c.useState(!1),[T,Y]=c.useState(!!h),q=c.useId(),Z=()=>{if(!z.current)return;const K=z.current.querySelector("input");K==null||K.focus()},g=K=>{f==null||f(K),L(!0)},O=K=>{k==null||k(K),L(!1),Y(!!K.target.value)},D=c.useCallback((K,ne)=>I(!!(j||K&&(!ne||ne===""))),[j]);c.useEffect(()=>{D(v,h),Y(!!h)},[h,v,D]);const X={small:"input-field__text-field_small",medium:"input-field__text-field_medium",large:"input-field__text-field_large"};return e.jsxs("div",{className:`input-field-container ${x||""}`,children:[e.jsxs("div",{ref:P,style:r,className:`
321
+ 2.1008 0 0 0 12 6.01172Z`})})})]})},Ee=({className:n="",children:t,header:r,action:o,onHide:a,style:i,clearStyle:l=!1,disableBackplate:d,marginBottom:s,maxWidth:u="560px",showCloseButton:_=!1,ariaLabel:p})=>{const h=()=>{a&&a()},m={...i,marginBottom:s,maxWidth:typeof u=="number"?`${u}px`:u};return e.jsx(Se,{onHide:h,disableBackplate:d,children:e.jsxs("div",{style:m,className:`${l?"":"dialog-template__container dialog-template_base dialog-template_color_surface-container"} dialog-template ${n}`,role:"dialog","aria-modal":"true","aria-label":p||r,children:[r&&e.jsxs("div",{className:"dialog-template__container__header dialog-template__container__header_color_surface-container",children:[e.jsx(G,{type:"heading",children:r}),_&&e.jsx(re,{className:"dialog-template__container__header__button dialog-template__container__header__button_color_surface-container",onClick:h,"aria-label":"Close dialog",icon:e.jsx(oe,{})})]}),e.jsx("div",{className:"dialog-template__container__content",children:t}),o&&e.jsx("div",{className:"dialog-template__container__action",children:o})]})})},xe=({marginBottom:n=80,forceBottomSheet:t=!1,forceModal:r=!1,...o})=>{const{screen:a}=c.useContext(be);Ue(!0,document.body);const i=()=>{var d;(d=o.onHide)==null||d.call(o)};return t||!r&&a===Q.MOBILE?e.jsx(Xe,{bottom:n,onHide:i,visible:!0,children:e.jsxs("div",{style:o.style,className:`dialog-bottom ${o.className||""}`,children:[o.header&&e.jsx("div",{className:"dialog-bottom__header",children:e.jsx(G,{type:"heading",children:o.header})}),e.jsx("div",{className:"dialog-bottom__content dialog-bottom__content_color_text-surface-color",children:e.jsx("div",{className:"dialog-bottom__content__scroll",children:o.children})}),o.action&&e.jsx("div",{className:"dialog-bottom__action",children:o.action})]})}):e.jsx(Ee,{...o,onHide:i})},Be=({btns:n,onHide:t,onSuccess:r})=>e.jsx(e.Fragment,{children:n.map(o=>o.danger?e.jsx(_t,{text:o.danger.text,header:o.danger.header,style:{backgroundColor:"var(--Error-color)",...o.style},onClick:o.success?r:o.hide?t:o.onClick,disabled:o.disabled,children:o.text},o.text):e.jsx(me,{style:o.style,styleType:o.styleType,onClick:o.success?r:o.hide?t:o.onClick,disabled:o.disabled,children:o.text},o.text))}),ut=({styleContainer:n,text:t,header:r,actionText:o,cancelText:a="Отмена",onSuccess:i,onCancel:l,onHide:d,children:s,disableDefaultButtons:u=!1,customActions:_,btns:p})=>{const h=c.useCallback(()=>{i==null||i(),d==null||d()},[i,d]),m=c.useCallback(()=>{l==null||l(),d==null||d()},[l,d]),x=c.useCallback(()=>_||(u?null:p?e.jsx(Be,{onHide:m,onSuccess:h,btns:p}):e.jsx(Be,{onHide:m,onSuccess:h,btns:[{text:a,hide:!0,styleType:"outline"},{text:o??"OK",success:!0}]})),[_,u,m,h,o,a]);return e.jsxs(xe,{style:n,header:r,onHide:m,action:x(),children:[t&&e.jsx(G,{type:"body",children:t}),s]})},le=({children:n,container:t=document.body})=>t?Rt.createPortal(n,t):e.jsx("p",{children:"container not found"}),_t=({container:n,text:t,header:r,onClick:o,styleType:a,...i})=>{const[l,d]=c.useState(null);return e.jsxs(e.Fragment,{children:[e.jsx(me,{styleType:a??"filled",...i,onClick:d}),l!==null&&e.jsx(le,{container:n,children:e.jsx(ut,{header:r,text:t,onSuccess:()=>o==null?void 0:o(l),onHide:()=>d(null)})})]})},ln=({text:n,supportText:t=!0,copiedTimeout:r=2e3,className:o="",onClick:a,disabled:i,...l})=>{const[d,s]=c.useState(!1),u=c.useCallback(async h=>{if(!i){try{await navigator.clipboard.writeText(n),s(!0),setTimeout(()=>s(!1),r)}catch(m){console.error("Не удалось скопировать текст",m)}a==null||a(h)}},[n,i,r,a]),_=d?e.jsx(se,{"aria-hidden":"true"}):e.jsx(an,{"aria-hidden":"true"}),p=d?"Скопировано!":"Копировать";return t?e.jsxs("div",{className:"copy-button",children:[e.jsx(re,{icon:_,onClick:u,disabled:i,"aria-label":`${p} ${n}`,className:o,...l}),e.jsx(G,{type:"body","aria-live":"polite",children:p})]}):e.jsx(re,{icon:_,onClick:u,disabled:i,"aria-label":`${p} ${n}`,className:o,...l})};var ze=(n=>(n[n.OPEN=0]="OPEN",n[n.HIDING=1]="HIDING",n[n.CLOSE=2]="CLOSE",n))(ze||{});const ht=({valueDisplayDuration:n=2e3})=>{const[t,r]=c.useState(2),o=c.useRef(null),a=c.useRef(null),i=()=>{r(1),a.current=window.setTimeout(()=>{r(2)},500)},l=()=>{r(0),o.current&&window.clearTimeout(o.current),a.current&&window.clearTimeout(a.current),n&&(o.current=window.setTimeout(()=>{i()},n))};return c.useEffect(()=>()=>{o.current&&window.clearTimeout(o.current),a.current&&window.clearTimeout(a.current)},[]),{showPopup:l,popupState:t,hidePopup:i}},dn=({className:n="",text:t,state:r=ze.OPEN})=>r===ze.CLOSE?null:e.jsx("div",{className:`alex-evo-sh-ui-kit-tooltip value-popup ${n} ${r===ze.HIDING?"hiding":""}`,"aria-live":"polite","aria-atomic":"true",children:t});function ar(n,t,r){arguments.length===1&&(t=n.s,r=n.l,n=n.h);var o=n,a,i;return r*=2,t*=r<=1?r:2-r,i=(r+t)/2,a=2*t/(r+t),{h:o,s:a,v:i}}function ir(n,t,r){arguments.length===1&&(t=n.s,r=n.v,n=n.h);var o=(2-t)*r/2;return o!=0&&(o==1?t=0:o<.5?t=t*r/(o*2):t=t*r/(2-o*2)),{h:n,s:t,l:o}}function ke(n,t,r){var o,a,i,l,d,s,u,_;switch(arguments.length===1&&(t=n.s,r=n.v,n=n.h),l=Math.floor(n*6),d=n*6-l,s=r*(1-t),u=r*(1-d*t),_=r*(1-(1-d)*t),l%6){case 0:o=r,a=_,i=s;break;case 1:o=u,a=r,i=s;break;case 2:o=s,a=r,i=_;break;case 3:o=s,a=u,i=r;break;case 4:o=_,a=s,i=r;break;case 5:o=r,a=s,i=u;break}return{r:Math.round(o*255),g:Math.round(a*255),b:Math.round(i*255)}}function ye(n){let t=n.toString(16);return t.length===1&&(t="0"+t),t}function je(n,t=!1){return t?"#"+ye(n.r)+ye(n.g)+ye(n.b):ye(n.r)+ye(n.g)+ye(n.b)}function Fe(n,t,r){arguments.length===1&&(t=n.g,r=n.b,n=n.r);var o=Math.max(n,t,r),a=Math.min(n,t,r),i=o-a,l,d=o===0?0:i/o,s=o/255;switch(o){case a:l=0;break;case n:l=t-r+i*(t<r?6:0),l/=6*i;break;case t:l=r-n+i*2,l/=6*i;break;case r:l=n-t+i*4,l/=6*i;break}return{h:l,s:d,v:s}}function fe(n){var t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;n=n.replace(t,function(o,a,i,l){return a+a+i+i+l+l});var r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);return r?{r:parseInt(r[1],16),g:parseInt(r[2],16),b:parseInt(r[3],16)}:null}const pt=fe,cr=n=>{if(!n)return"linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0))";const t=pt(n);return t?`linear-gradient(135deg, rgba(${t.r}, ${t.g}, ${t.b}, 0.1), rgba(${t.r}, ${t.g}, ${t.b}, 0))`:"linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0))"};function mt(n,t,r){if(n===0)return r??"#e0e0e0";if(n===1)return t;const o=r?fe(r):null,a=(o==null?void 0:o.r)??224,i=(o==null?void 0:o.g)??224,l=(o==null?void 0:o.b)??224,d=parseInt(t.substring(1,3),16),s=parseInt(t.substring(3,5),16),u=parseInt(t.substring(5,7),16),_=Math.round(a+n*(d-a)),p=Math.round(i+n*(s-i)),h=Math.round(l+n*(u-l));return`rgb(${_}, ${p}, ${h})`}const ae=(n,t,r="",o)=>{let a,i,l,d,s,u,_,p=Math.round,h=typeof r=="string";if(typeof n!="number"||n<-1||n>1||typeof t!="string"||t[0]!="r"&&t[0]!="#"||r&&!h||(_=t.length>9,_=h?typeof r=="string"&&r.length>9?!0:r=="c"?!_:!1:_,s=ae.pSBCr(t),d=n<0,u=r&&typeof r=="string"&&r!="c"?ae.pSBCr(r):d?{r:0,g:0,b:0,a:-1}:{r:255,g:255,b:255,a:-1},n=d?n*-1:n,d=1-n,!s||!u))return null;o?(a=p(d*(s.r??0)+n*(u.r??0)),i=p(d*(s.g??0)+n*(u.g??0)),l=p(d*(s.b??0)+n*(u.b??0))):(a=p((d*(s.r??0)**2+n*(u.r??0)**2)**.5),i=p((d*(s.g??0)**2+n*(u.g??0)**2)**.5),l=p((d*(s.b??0)**2+n*(u.b??0)**2)**.5));let m=s.a??1;return u=u.a??1,s=m>=0||u>=0,m=m>=0||u>=0?m<0?u:u<0?m:m*d+u*n:0,_?"rgb"+(s?"a(":"(")+a+","+i+","+l+(s?","+p(m*1e3)/1e3:"")+")":"#"+(4294967296+a*16777216+i*65536+l*256+(s?p(m*255):0)).toString(16).slice(1,s?void 0:-2)};ae.pSBCr=n=>{const t=parseInt;let r=n.length,o={};if(r>9){const a=n.split(","),[i,l,d,s]=a;if(r=a.length,r<3||r>4)return null;o.r=t(i[3]=="a"?i.slice(5):i.slice(4)),o.g=t(l),o.b=t(d),o.a=s?parseFloat(s):-1}else{if(r==8||r==6||r<4)return null;r<6&&(n="#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+(r>4?n[4]+n[4]:""));let a=t(n.slice(1),16);r==9||r==5?(o.r=a>>24&255,o.g=a>>16&255,o.b=a>>8&255,o.a=Math.round((a&255)/.255)/1e3):(o.r=a>>16,o.g=a>>8&255,o.b=a&255,o.a=-1)}return o};function R(n){const t=fe(n);return t?t.r*.299+t.g*.589+t.b*.114>186?"#000000":"#FFFFFF":"#fff"}function $e(n,t=!1){return ae(t?-.6:.3,n)??n}const bt={Primary_color:"#6750A4",Secondary_color:"#8c5a9c",Tertiary_color:"#7D5260",Background_color:"#FFFBFE",Surface_container_color:"#FFFBFE",Error_color:"#B3261E",Outline_color:"#79747E",Shadow_color:"#000000",On_primary_color:"#FFFFFF",On_secondary_color:"#FFFFFF",On_tertiary_color:"#FFFFFF",On_background_color:"#1C1B1F",Primary_container_color:"#EADDFF",Secondary_container_color:"#E8DEF8",Tertiary_container_color:"#FFD8E4",Error_container_color:"#F9DEDC",On_primary_container_color:"#21005D",On_secondary_container_color:"#1D192B",On_tertiary_container_color:"#31111D",On_error_container_color:"#410E0B",On_error_color:"#FFFFFF",Surface_container_lowest_color:"#FFFFFF",Surface_container_low_color:"#F7F2FA",Surface_container_high_color:"#D0BCFF",Surface_container_highest_color:"#4F378B",On_surface_color:"#1C1B1F",On_surface_variant_color:"#49454F",Surface_container_hover_color:"#F2E7FE",Outline_variant_color:"#CAC4D0"},sr={Primary_color:(n,t)=>{const r=$e(n,t);return{Primary_color:n,On_primary_color:R(n),Primary_container_color:r,On_primary_container_color:R(r)}},Secondary_color:(n,t)=>{const r=$e(n,t);return{Secondary_color:n,On_secondary_color:R(n),Secondary_container_color:r,On_secondary_container_color:R(r)}},Tertiary_color:(n,t)=>{const r=$e(n,t);return{Tertiary_color:n,On_tertiary_color:R(n),Tertiary_container_color:r,On_tertiary_container_color:R(r)}},Background_color:(n,t)=>({Background_color:n,On_background_color:R(n)}),Error_color:(n,t)=>{const r=$e(n,t);return{Error_color:n,On_error_color:R(n),Error_container_color:r,On_error_container_color:R(r)}},Surface_container_color:(n,t)=>{const r=ae(t?-.2:.2,n)??n,o=ae(t?-.4:.4,n)??n,a=ae(t?.2:-.2,n)??n,i=ae(t?.4:-.4,n)??n,l=ae(t?-.5:.5,n)??n;return{Surface_container_color:n,On_surface_color:R(n),Surface_container_low_color:r,Surface_container_lowest_color:o,Surface_container_high_color:a,Surface_container_highest_color:i,Surface_container_hover_color:l,On_surface_variant_color:ae(t?-.6:.4,R(n))??R(n)}},Outline_color:(n,t)=>({Outline_color:n,Outline_variant_color:ae(t?.1:-.1,n)??n})};function ft(n,t=!1){const[r,o]=c.useState({...bt,...n}),[a,i]=c.useState(t),l=c.useCallback((s,u)=>{const _=sr[s];if(!_)return;const p=_(u,a);o(h=>({...h,...p})),Object.entries(p).forEach(([h,m])=>{document.body.style.setProperty(`--${h.replace(/_/g,"-")}`,m)})},[a]);return{colors:r,setColor:l,setReverse:s=>i(s)}}const un={light:{colors:{Primary_color:"#6750A4",Secondary_color:"#8c5a9c",Tertiary_color:"#7D5260",Background_color:"#FFFBFE",Surface_container_color:"#FFFBFE",Error_color:"#B3261E",Outline_color:"#79747E",Shadow_color:"#000000"}},dark:{reverse:!0,colors:{Primary_color:"#D0BCFF",Secondary_color:"#dbb0e8",Tertiary_color:"#EFB8C8",Background_color:"#1C1B1F",Surface_container_color:"#1C1B1F",Error_color:"#F2B8B5",Outline_color:"#938F99",Shadow_color:"#000000"}}};function vt(n="light"){const[t,r]=c.useState(un),[o,a]=c.useState(n),{colors:i,setColor:l,setReverse:d}=ft(t[o].colors,t[o].reverse),s=c.useCallback(m=>{const x=t[m].colors;x&&(Object.entries(x).forEach(([v,f])=>{l(v,f)}),d(t[m].reverse??!1),a(m))},[t,l]);c.useEffect(()=>{s(o)},[o,s]);const u=c.useCallback((m,x,v)=>{r(f=>({...f,[m]:{colors:{...f[m].colors,[x]:v},reverse:f[m].reverse}}))},[]),_=c.useCallback((m,x="light",v)=>{r(f=>({...f,[m]:{colors:f[x].colors,reverse:v===void 0?f[x].reverse:v}}))},[]),p=c.useCallback(m=>{r(x=>{const v={...x};return delete v[m],v}),o===m&&a("light")},[o]),h=c.useCallback(m=>{un[m]&&r(x=>({...x,[m]:{...un[m]}}))},[]);return{colors:i,themes:t,activeTheme:o,setActiveTheme:s,updateThemeColor:u,createTheme:_,deleteTheme:p,resetTheme:h}}const Te=()=>{},lr={colors:bt,themes:{},activeTheme:"",setActiveTheme:Te,updateThemeColor:Te,createTheme:Te,deleteTheme:Te,resetTheme:Te},He=c.createContext(lr),dr=({children:n})=>{const t=vt();return e.jsx(He.Provider,{value:t,children:n})},gt="var(--range-width)",ur=({colorRange:n,colorBg:t="var(--Surface-container-color)",onChange:r,min:o=0,max:a=100,step:i=1,strokeWidth:l="40px",value:d,orientation:s="horizontal",styleTrack:u="base",showValue:_=!0,valueDisplayDuration:p=2e3,ariaLabel:h="Регулятор значения",startColor:m,className:x="",...v})=>{const f=c.useRef(null),k=c.useRef(null),[j,C]=c.useState(d??o),[y,M]=c.useState("200px"),{colors:$}=c.useContext(He),{showPopup:H,popupState:V}=ht({valueDisplayDuration:p}),N=n??$.Primary_color??"#0000ff";c.useEffect(()=>{var L;if(s==="vertical"&&((L=k.current)!=null&&L.parentElement)){const T=()=>{var Z,g;const q=(g=(Z=k.current)==null?void 0:Z.parentElement)==null?void 0:g.clientHeight;q&&M(`${q}px`)};T();const Y=new ResizeObserver(T);return k.current.parentElement&&Y.observe(k.current.parentElement),()=>Y.disconnect()}},[s]),c.useEffect(()=>{d!==void 0&&(C(d),A())},[d]);const A=c.useCallback(()=>{_&&H()},[H]),P=L=>{const T=parseFloat(L.target.value);C(T),A(),r==null||r(L)},z=c.useMemo(()=>a!==o?(j-o)/(a-o)*100:0,[j,o,a]),w=c.useMemo(()=>({...v.style,[s==="vertical"?"height":"width"]:`${z}%`,background:u==="point"?"transperent":u==="static-color"?N:mt(z/100,N,m)}),[z,N,v.style,s,u]),I=c.useMemo(()=>s==="vertical"?{"--range-width":l,"--point-width":u==="point"?l:"6px","--point-opacity":u==="point"?"1":"0","--truck-color":N,width:gt,height:y,...v.style}:{"--range-width":l,"--point-width":u==="point"?l:"6px","--point-opacity":u==="point"?"1":"0","--truck-color":N,width:"100%",height:gt,...v.style},[s,y,v.style,l,u,N]),S=c.useMemo(()=>s==="vertical"?{width:y}:{width:"100%"},[s,y]);return e.jsxs("div",{ref:k,className:`range-wrapper ${s} ${x}`,style:I,children:[e.jsxs("div",{className:"track",style:{background:t},children:[e.jsx("div",{className:"active-track",style:w}),e.jsx(dn,{text:Math.round(j).toString(),state:V,className:"value-popup"})]}),e.jsx("input",{ref:f,type:"range",min:o,style:S,max:a,step:i,value:j,onChange:P,onFocus:v.onFocus,onBlur:v.onBlur,className:"slider-input","aria-orientation":s,"aria-valuenow":j,"aria-valuemin":o,"aria-valuemax":a,"aria-label":h,"aria-valuetext":`${j} из ${a}`,...v})]})},_r=({min:n=0,max:t=100,value:r=0,onChange:o,onFocus:a,onBlur:i,styleRange:l="circle",styleTrack:d="base",strokeWidth:s=20,radius:u=100,colorBg:_="var(--Surface-container-color)",colorRange:p,pointColor:h,showBase:m=!0,showIndicator:x=!0,showPoint:v=!1,rounding:f=!0,showValue:k=!0,style:j,children:C,className:y,startColor:M})=>{const $=c.useRef(null),H=c.useRef(!1),V=u*2,N=u*2,A=Math.min(V,N),P=V/2,z=N/2,w=A/2-s/2,I=d==="point"?!1:x,S=d==="point"?!0:v,{colors:L}=c.useContext(He),T=p??L.Primary_color??"#0000ff",Y=h??L.Primary_color??"#0000ff",[q,Z]=c.useState(r);c.useEffect(()=>{r!==void 0&&Z(r)},[r]);const g=c.useCallback(()=>{switch(l){case"semicircle":return 180;case"brokenCircle":return 270;default:return 360}},[l]),O=c.useCallback(()=>l==="semicircle"?[w*Math.PI,w*Math.PI]:l==="brokenCircle"?[w*Math.PI*1.25,w*Math.PI*1.5]:[w*Math.PI,w*Math.PI*2],[l,w]),D=c.useMemo(()=>t!==n?(q-n)/(t-n)*100:0,[q,n,t]),X=c.useCallback(()=>{if(!$.current)return;const[W,_e]=O(),pe=(q-n)*_e/(t-n);if(m){const U=$.current.querySelector('[data-el="base"]');U&&(U.style.stroke=_,U.style.strokeWidth=s.toString(),U.style.strokeLinecap=f?"round":"",U.style.strokeDashoffset=W.toString(),U.style.strokeDasharray=`${_e}, ${w*Math.PI*2-_e}`)}if(I){const U=$.current.querySelector('[data-el="indicator"]');if(U){const he=parseFloat(U.dataset.percentage??"");he!==null&&(he<D-2||he>D+2)?U.style.transition=".3s":U.style.transition=H.current?"none":".3s",U.dataset.percentage=D.toString(),U.style.stroke=d==="static-color"?T:mt(D/100,T,M),U.style.strokeWidth=s.toString(),U.style.strokeLinecap=f?"round":"",U.style.strokeDashoffset=W.toString(),U.style.strokeDasharray=`${pe}, ${w*Math.PI*2-pe}`}}if(S){const U=$.current.querySelector('[data-el="point"]');if(U){const he=parseFloat(U.dataset.percentage??"");he!==null&&(he<D-2||he>D+2)?U.style.transition=".3s":U.style.transition=H.current?"none":".3s",U.dataset.percentage=D.toString(),U.style.stroke=Y,U.style.strokeWidth=s.toString(),U.style.strokeLinecap="round",q===t&&l==="semicircle"?U.style.strokeDashoffset="0":U.style.strokeDashoffset=(W-pe).toString(),U.style.strokeDasharray=`0, ${w*Math.PI*2}`}}},[q,O,t,n,w,s,_,T,Y,m,I,S,f,D,M]),K=W=>{H.current=!0,document.addEventListener("mousemove",ne),document.addEventListener("mouseup",J),ie(W)},ne=W=>{W.preventDefault(),H.current&&ie(W)},J=()=>{H.current=!1,document.removeEventListener("mousemove",ne),document.removeEventListener("mouseup",J)},ie=c.useCallback(W=>{if(!$.current)return;const _e=g(),pe=$.current.getBoundingClientRect(),U=pe.left+pe.width/2,he=pe.top+pe.height/2,Do=W.clientX,Ao=W.clientY,Bo=he-Ao,Ho=U-Do;let ce=Math.atan2(Bo,Ho)*(180/Math.PI);_e===270&&(ce+=45),ce<0&&(ce=360+ce),ce<0&&(ce=0),ce>_e&&q>(t-n)/2?ce=_e:ce>_e&&(ce=0);const Wo=_e,Go=t-n,Nn=Math.round(ce*Go/Wo+n);Z(Nn),Nn!==r&&o&&o(Nn)},[g,o,t,n,P,z,q]);c.useEffect(()=>{X()},[X]),c.useEffect(()=>()=>{document.removeEventListener("mousemove",ne),document.removeEventListener("mouseup",J)},[]);const B={"--stroke-width":`${s}px`};return e.jsxs("div",{style:{width:V,height:N,...j},className:"range-circule-wrapper",onFocus:a,onBlur:i,children:[e.jsxs("svg",{ref:$,width:"100%",height:"100%",onMouseDown:K,children:[m&&e.jsx("circle",{"data-el":"base",fill:"none",cx:P,cy:z,r:w}),I&&e.jsx("circle",{"data-el":"indicator",fill:"none",cx:P,cy:z,r:w}),S&&e.jsx("circle",{"data-el":"point",fill:"none",cx:P,cy:z,r:w})]}),e.jsx("div",{className:`range-circule-children ${y}`,style:B,children:C??(k&&e.jsx(dn,{className:"",text:Math.floor(q).toString()}))})]})},xt=c.forwardRef(({icon:n,children:t,size:r="medium",position:o="bottom-right",variant:a="primary",className:i="",...l},d)=>{const s=!!t;return e.jsxs("button",{ref:d,type:"button",className:`fab ${s?"fab--extended":""} fab--${r} fab--${a} ${o!=="none"?`fab--${o}`:""} ${i}`,"aria-label":s?void 0:l["aria-label"]||"Floating action button",...l,children:[n&&e.jsx("span",{className:"fab__icon",children:n}),s&&e.jsx("span",{className:"fab__text",children:t})]})});xt.displayName="FAB";const ee=({style:n,short:t,text:r})=>r?e.jsxs("div",{style:n,className:`divider-and-text ${t?"short":""}`,children:[e.jsx("div",{className:`divider ${t?"short":""}`}),r,e.jsx("div",{className:`divider ${t?"short":""}`})]}):e.jsx("div",{style:n,className:`divider ${t?"short":""}`}),hr=({item:n,isIcon:t,globalClick:r,autoHide:o,onHide:a})=>{const i=()=>{n.onClick&&n.onClick(),r&&r(),o&&(a==null||a())};return e.jsxs("div",{className:`menu-item menu-item__info ${n.disabled?"menu-item_disabled":""}`,onClick:i,children:[t?e.jsx("div",{className:"menu-icon-container",children:n.icon}):null,e.jsx("div",{className:"menu-text-container",children:n.title}),e.jsx("div",{className:"menu-status-container",children:n.activated?e.jsx(se,{}):null})]})},Ve=n=>{if(!n)return;const t=window.getComputedStyle(n),r=n.getBoundingClientRect();return{height:parseFloat(t.getPropertyValue("height")),width:parseFloat(t.getPropertyValue("width")),left:r.left,top:r.top}},_n=(n,t,r,o)=>{let a={x:n,y:t};if(!r)return a;const i=window.getComputedStyle(r),l=parseFloat(i.getPropertyValue("height")),d=parseFloat(i.getPropertyValue("width")),s=t+l-document.documentElement.clientHeight,u=n+d-document.documentElement.clientWidth;return s>0&&(a.y=a.y-s-((o==null?void 0:o.marginBottom)??0)),u>0&&(a.x=a.x-u-((o==null?void 0:o.marginRight)??0)),a},pr=({items:n,onHide:t,smallDisplay:r,globalClick:o,autoHide:a,onGlobalHide:i})=>{const l=c.useRef(null),[d,s]=c.useState({left:"0px",top:"0px"}),[u,_]=c.useState(!1);function p(h){for(let m of h)if(m.icon)return!0;return!1}return c.useEffect(()=>{if(!l.current)return;let h=Ve(l.current.parentElement);if(!h)return;let m=_n(h.left+h.width,h.top,l.current,{marginRight:h.width});s({left:m.x-h.left+"px",top:m.y-h.top+"px"}),_(!0)},[]),e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:l,className:`menu-block menu-block_color_surface-container-highest ${r?"":"menu-block_sub"}`,style:{...d,...u?{}:{display:"none"}},children:n.map((h,m)=>e.jsx(hr,{onHide:i,autoHide:a,item:h,isIcon:p(n),globalClick:o},m))}),r?null:e.jsx("div",{style:{zIndex:4},className:"menu-block-backplate",onClick:t})]})},mr=({onHide:n,autoHide:t,globalClick:r,item:o,isIcon:a,smallDisplay:i})=>{const[l,d]=c.useState(!1),s=c.useCallback(()=>{o.subItems?d(u=>!u):(o.onClick&&o.onClick(),r&&r(),t&&n&&n())},[o.onClick]);return e.jsxs("div",{className:`menu-item ${o.disabled?"menu-item_disabled":""}`,children:[e.jsxs("div",{className:"menu-item__info",onClick:s,children:[a?e.jsx("div",{className:"menu-item__info__icon",children:o.icon}):null,e.jsx("div",{className:"menu-item__info__text",children:o.title}),e.jsx("div",{className:"menu-item__info__status ",children:o.subItems?e.jsx("span",{className:`menu-item__info__status__arrow ${l?"menu-item__info__status__arrow_active":""}`}):o.activated?e.jsx(se,{}):e.jsx("span",{className:"menu-item__info__status__none"})})]}),l&&o.subItems?e.jsx(pr,{autoHide:t,items:o.subItems,onGlobalHide:n,onHide:()=>d(!1),smallDisplay:i}):null]})};function kt({block:n,smallDisplay:t,onHide:r,globalClick:o,autoHide:a}){function i(l){for(let d of l.items)if(d.icon)return!0;return!1}return e.jsx("div",{className:"menu-block",children:n.items.map((l,d)=>e.jsx(mr,{globalClick:o,autoHide:a,onHide:r,item:l,isIcon:i(n),smallDisplay:t},d))})}const br=100,yt=n=>{const t=c.useRef(null),[r,o]=c.useState({left:"0px",top:"0px"}),a=()=>{n.onHide&&n.onHide()};return c.useLayoutEffect(()=>{let i=_n(n.x,n.y,t.current,{marginBottom:br});o({left:i.x+"px",top:i.y+"px"})},[n.x,n.y]),n.visible?e.jsx(Se,{onHide:a,children:e.jsx("div",{ref:t,className:"base-menu base-menu_color_surface-container-high",style:{...r,width:n.width,maxWidth:n.width?"100%":void 0},children:n.blocks.map((i,l)=>e.jsxs(c.Fragment,{children:[l!==0?e.jsx(ee,{}):null,e.jsx(kt,{block:i,smallDisplay:!1,globalClick:n.onClick,autoHide:n.autoHide,onHide:a})]},l))})}):null},jt=n=>{const t=()=>{};return e.jsx(Xe,{onHide:n.onHide||t,visible:n.visible,bottom:n.marginBottom,children:e.jsx("div",{className:"small-window-menu",children:n.blocks.map((r,o)=>e.jsxs(c.Fragment,{children:[o!==0?e.jsx(ee,{}):null,e.jsx(kt,{block:r,smallDisplay:!0,autoHide:n.autoHide,onHide:n.onHide})]},o))})})},hn=n=>n.screensize===Q.MOBILE?e.jsx(le,{container:n.container,children:e.jsx(jt,{...n})}):e.jsx(le,{container:n.container,children:e.jsx(yt,{...n})}),fr=c.forwardRef(({screensize:n,autoHide:t,blocks:r,container:o,onClick:a,...i},l)=>{const[d,s]=c.useState(!1),[u,_]=c.useState(void 0),{screen:p}=c.useContext(be),h=()=>{s(!1),_(void 0)},m=v=>{v.stopPropagation(),s(!0),_({x:v.clientX,y:v.clientY}),a==null||a(v)},x=n??p;return e.jsxs(e.Fragment,{children:[e.jsx(re,{ref:l,onClick:m,...i}),e.jsx(hn,{marginBottom:x===Q.MOBILE?80:0,onHide:h,autoHide:t,screensize:n,visible:d,x:(u==null?void 0:u.x)??0,y:(u==null?void 0:u.y)??0,blocks:r,container:o})]})}),pn=c.forwardRef(({name:n,checked:t,onChange:r,readOnly:o,disabled:a,checkIcon:i=e.jsx(se,{baseColor:"var(--On-primary-color)"}),size:l="medium",className:d,...s},u)=>e.jsxs("label",{className:["checkbox-container",`checkbox--${l}`,a?"checkbox--disabled":"",d].filter(Boolean).join(" "),children:[e.jsx("input",{ref:u,className:"checkbox-input",name:n,type:"checkbox",checked:t,onChange:r,readOnly:o,disabled:a,"aria-checked":t,...s}),e.jsx("span",{className:"checkbox-box",children:e.jsx("span",{className:"checkbox-icon-container",children:e.jsx("span",{className:"checkbox-check-icon",children:i})})})]}));pn.displayName="Checkbox";const mn=c.forwardRef(({text:n,onDelete:t,big:r,onClick:o,screenSize:a,className:i,disabled:l,...d},s)=>{const u=p=>{p.stopPropagation(),t==null||t(p)},_=l?void 0:o;return e.jsxs("div",{...d,ref:s,className:`chips ${r?"chips--big":""} ${l?"disabled":""} ${o?"chips--clickable":""} ${i||""}`,onClick:_,role:d.role??o?"button":void 0,tabIndex:d.tabIndex??o?0:void 0,"aria-label":d["aria-label"]??o?n:void 0,children:[e.jsx(G,{type:"body",screensize:a,children:n}),t&&e.jsx("button",{className:"chips__delete",onClick:u,"aria-label":`Remove ${n}`,disabled:l,type:"button",children:e.jsx(oe,{})})]})});mn.displayName="Chips";const bn=c.forwardRef(({name:n,currentValue:t,value:r,onChange:o,readOnly:a,checked:i,defaultChecked:l,label:d,size:s="medium",variant:u="primary",showLabel:_=!0,className:p,...h},m)=>{const x=t!==void 0?t===r:i!==void 0?i:l;return e.jsxs("label",{className:`radio-button-container ${p||""}`,children:[e.jsx("input",{ref:m,className:"radio-button",name:n,type:"radio",checked:x,value:r,onChange:o,readOnly:a,"aria-checked":x,"aria-label":d||h["aria-label"],...h}),e.jsx("span",{className:`radio-button-ui radio-button-ui--${s} radio-button-ui--${u}`}),_&&d&&e.jsx("span",{className:"radio-button-label",children:d})]})});bn.displayName="RadioButton";const fn=c.forwardRef(({items:n,value:t,multiple:r=!1,name:o,readOnly:a=!1,onChange:i,className:l="",size:d="medium",variant:s="primary",...u},_)=>{const[p,h]=c.useState([]);c.useEffect(()=>{h(m(t))},[t]);const m=v=>v===void 0?[]:Array.isArray(v)?v:[v],x=(v,f)=>{if(a)return;v.preventDefault();let k;r?k=p.includes(f)?p.filter(j=>j!==f):[...p,f]:k=p.includes(f)?[]:[f],h(k),i==null||i(k,v)};return e.jsx("div",{ref:_,className:`segmented-button segmented-button--${d} segmented-button--${s} ${l}`,role:"group",...u,children:n.map(v=>e.jsxs("button",{type:"button",role:"radio","aria-checked":p.includes(v),"aria-label":v,disabled:a,className:`segmented-button__item ${p.includes(v)?"segmented-button__item--active":""}`,onClick:f=>x(f,v),children:[p.includes(v)&&e.jsx("span",{className:"segmented-button__icon",children:e.jsx(se,{})}),e.jsx("span",{className:"segmented-button__text",children:v}),e.jsx("input",{type:r?"checkbox":"radio",name:o,value:v,checked:p.includes(v),readOnly:!0,className:"segmented-button__input"})]},v))})});fn.displayName="SegmentedButton";const vn=c.forwardRef(({size:n="medium",variant:t="primary",className:r="",showLabel:o=!1,labelOn:a="On",labelOff:i="Off",checked:l,onChange:d,...s},u)=>e.jsxs("label",{className:`switch-container ${r}`,children:[e.jsx("input",{ref:u,type:"checkbox",role:"switch","aria-checked":l,checked:l,onChange:d,className:`switch-input switch--${n} switch--${t}`,...s}),o&&e.jsx("span",{className:"switch-label",children:l?a:i})]}));vn.displayName="Switch";function Ct({onSuccess:n,items:t,header:r,onHide:o,noHide:a=!1,name:i="selection_dialog",confirmText:l="Выбрать",cancelText:d="Отмена",defaultValue:s,style:u}){const[_,p]=c.useState(s),h=c.useCallback(()=>{_!==void 0&&(n==null||n(_),p(void 0),!a&&(o==null||o()))},[_,n,a,o]),m=c.useCallback(()=>{o==null||o()},[o]),x=c.useCallback(v=>{p(v)},[]);return e.jsxs(xe,{header:r,style:u,onHide:m,action:e.jsx(vr,{onHide:m,onSuccess:h,disabled:_===void 0,confirmText:l,cancelText:d}),children:[e.jsx(ee,{style:{padding:0}}),e.jsx(St,{transparent:!0,scroll:!0,maxHeight:"300px","aria-label":"Варианты выбора",children:t.map((v,f)=>e.jsx("label",{"aria-disabled":v.disabled,children:e.jsx(Mt,{hovered:!v.disabled,header:v.title,icon:v.icon,description:v.description,onClick:v.disabled?void 0:()=>x(v.data),control:e.jsx(bn,{onClick:v.disabled?void 0:()=>x(v.data),name:i,checked:v.data===_,disabled:v.disabled,"aria-label":`Выбрать ${v.title}`})})},`${i}_${f}`))}),e.jsx(ee,{style:{padding:0}})]})}function vr({onSuccess:n,onHide:t,disabled:r=!1,confirmText:o="OK",cancelText:a="Отмена"}){return e.jsxs("div",{children:[t&&e.jsx(Ye,{onClick:t,children:a}),e.jsx(te,{onClick:n,disabled:r,children:o})]})}const Ce=c.forwardRef(({onClick:n,inputRef:t,styleContainer:r,type:o="text",transparent:a,readOnly:i,password:l,border:d,onClear:s,icon:u,onChange:_,name:p,value:h,placeholder:m,className:x,validEmptyValue:v,onFocus:f,onBlur:k,error:j,max:C,min:y,autoFocus:M,disabled:$,size:H="medium",helperText:V,errorText:N,onKeyDown:A},P)=>{const z=c.useRef(null),[w,I]=c.useState(!1),[S,L]=c.useState(!1),[T,Y]=c.useState(!!h),q=c.useId(),Z=()=>{if(!z.current)return;const K=z.current.querySelector("input");K==null||K.focus()},g=K=>{f==null||f(K),L(!0)},O=K=>{k==null||k(K),L(!1),Y(!!K.target.value)},D=c.useCallback((K,ne)=>I(!!(j||K&&(!ne||ne===""))),[j]);c.useEffect(()=>{D(v,h),Y(!!h)},[h,v,D]);const X={small:"input-field__text-field_small",medium:"input-field__text-field_medium",large:"input-field__text-field_large"};return e.jsxs("div",{className:`input-field-container ${x||""}`,children:[e.jsxs("div",{ref:P,style:r,className:`
322
322
  input-field
323
323
  input-field__text-field
324
324
  ${X[H]}
@@ -423,4 +423,4 @@ React keys must be passed directly to JSX without using spread:
423
423
  ${v?"input-field_transparent":""}
424
424
  ${A?"input-field_error":""}
425
425
  ${j?"input-field_disabled":""}
426
- `,children:e.jsxs("div",{className:"input-field__input-container",onClick:w,children:[e.jsx("input",{ref:n,required:!0,disabled:j,type:"text",className:`input-field__input-container__input ${_?"input-field__input-container__input_error":""}`,name:u,value:y,onFocus:h,onBlur:p,readOnly:!0}),e.jsx("label",{className:"input-field__input-container__label",children:l?e.jsx("span",{className:"input-field__input-container__label__span",children:l}):null})]})}),A&&k&&e.jsx(G,{type:"small",className:"input-field-container__error-text",children:k}),f&&!A&&e.jsx(G,{type:"small",className:"input-field-container__helper-text",children:f}),e.jsx(hn,{marginBottom:r===Q.MOBILE?80:0,width:$.width,screensize:r,x:$.x,y:$.y,onHide:()=>N(!1),container:m,blocks:[{items:o.map(z)}],visible:V})]})});wn.displayName="SelectField";const qt=({icons:n,value:t,onChange:r,disabled:o,placeholder:a,container:i=document.getElementById("root")})=>{const[l,d]=c.useState(!1),s=n.find(_=>_.id===t),u=_=>{r==null||r(_),d(!1)};return e.jsxs(e.Fragment,{children:[e.jsx(Ce,{border:!0,icon:(s==null?void 0:s.component)??void 0,value:s==null?void 0:s.name,readOnly:!0,disabled:o,onClick:()=>d(!0),placeholder:a}),l&&e.jsx(le,{container:i,children:e.jsx(Ct,{header:"Icons",onHide:()=>d(!1),onSuccess:u,items:n.map(_=>({icon:_.component,title:_.name,data:_.id}))})})]})},Kt={Dashboard:lt,Copy:an,LogoutIcon:Kn,Room:Jn,Group:qn,OkUserIcon:Xn,XUserIcon:Un,MinusUserIcon:Yn,AddUserIcon:Gn,UserIcon:Zn,LinkIcon:Wn,UnLinkIcon:Hn,GearIcon:Bn,X:oe,Trash:qe,Pen:nn,Palette:Ke,Home:Dn,MoreHorizontal:Le,MenuIcon:Re,MoreVertical:Qe,CircleMinus:Oe,Calendar:Je,Check:se,ChevronDown:Me,CirclePlus:Ae,Clock:Ie,ArrowLeft:De,ArrowRight:Pn,ArrowUp:In,Keyboard:tn,Search:en,Plus:rn,Minus:on,Plug:An,LampIcon:Qn,SwitchIcon:Rn,ConditionerIcon:nt,ConditionerIcon2:et,TempHighIcon:cn,Sensor:tt,Sensor2:rt,Sensor3:ot,SensorWarning:at,Curtains:it,FilterIcon:sn,Play:ct,ToolsIcon:st,Addons:dt},go=Object.entries(Kt).map(([n,t])=>({id:n,name:n.charAt(0).toUpperCase()+n.slice(1),component:e.jsx(t,{})})),xo=n=>e.jsx(qt,{icons:go,...n});function ko(n){if(n)return Kt[n]??void 0}const yo={showSnackbar:n=>{},hideSnackbar:()=>{}},Jt=c.createContext(yo),jo=({children:n})=>{var l;const[t,r]=c.useState({visible:!1,text:""}),o=c.useRef(null),a=c.useCallback((d,s)=>{r({visible:!0,text:d,option:s}),o.current&&clearTimeout(o.current),s!=null&&s.closeButton||(o.current=setTimeout(()=>i(),(s==null?void 0:s.delay)??3e3))},[]),i=c.useCallback(()=>{o.current&&(clearTimeout(o.current),o.current=null),r({visible:!1,text:""})},[]);return e.jsxs(Jt.Provider,{value:{showSnackbar:a,hideSnackbar:i},children:[e.jsx(Ut,{...t,option:{...t.option,onHide:(l=t.option)!=null&&l.closeButton?i:void 0}}),n]})},Qt=c.createContext({});function Co(n){return typeof n=="string"}function wo(n){return typeof n=="number"}function No(n){return typeof n=="boolean"}const ue=n=>{const{value:t,changeField:r,errors:o}=c.useContext(Qt),a=c.useCallback(s=>{r&&r(n,s)},[n]),i=c.useCallback(()=>{const s=t==null?void 0:t[n];return No(s)?!!s:wo(s)?Number(s):Co(s)?s??"":""},[t,n]),l=c.useCallback(()=>{r&&r(n,"")},[n]),d=c.useCallback(()=>{if(o&&Object.keys(o).includes(n))return o[n]},[o,n]);return{value:i(),clearHandler:l,error:d(),change:a}},So=n=>{const{value:t,change:r,error:o}=ue(n.name);return e.jsx(Ht,{...n,onChange:r,value:String(t),errorText:o,error:!!o})},Mo=n=>{const{value:t,change:r,error:o}=ue(n.name);return e.jsx(gn,{...n,value:Number(t),onChange:r,errorText:o,error:!!o})},Lo=n=>{const{value:t,change:r,error:o}=ue(n.name);return e.jsx(wn,{...n,container:n.container??document.body,value:t,onChange:r,errorText:o,error:!!o})},Oo=({placeholder:n,ref:t,style:r,readOnly:o,className:a,name:i})=>{const{value:l,change:d}=ue(i),s=u=>{d&&d(u.target.checked)};return e.jsx("div",{className:`input-field form-switch ${a}`,style:r,children:e.jsx(vn,{readOnly:o,ref:t,placeholder:n,name:i,checked:!!l,onChange:s})})},Eo=({placeholder:n,ref:t,style:r,readOnly:o,className:a,name:i})=>{const{value:l,change:d}=ue(i),s=_=>{if(_.length>0)return d&&d(!0);d&&d(!1)},u=c.useCallback(()=>l?[n??i]:[],[l,i,n]);return e.jsx(fn,{className:a,style:r,ref:t,readOnly:o,value:u(),multiple:!0,items:[n??i],onChange:s})},zo=n=>{const{error:t,value:r,change:o,clearHandler:a}=ue(n.name);return e.jsx(Ce,{...n,error:!!t,onChange:o,value:String(r),errorText:t,onClear:a})},Fo=n=>{const{error:t,value:r,change:o,clearHandler:a}=ue(n.name);return e.jsx(xn,{...n,onChange:o,onClear:n.clear?a:void 0,value:String(r),error:!!t,errorText:t})},$o=n=>{const{error:t,value:r,change:o}=ue(n.name);return e.jsx(Dt,{...n,error:!!t,onChange:o,value:String(r),errorText:t})},To=n=>{const{error:t,value:r,change:o}=ue(n.name);return e.jsx(Gt,{...n,error:!!t,onChange:o,value:String(r),errorText:t})},Vo=c.forwardRef(function({children:t,value:r,name:o,errors:a,onFinish:i,...l},d){const[s,u]=c.useState(r??{}),_=c.useCallback(h=>{h.preventDefault(),i==null||i(s)},[i,s]),p=c.useCallback((h,m)=>{u(x=>({...x,[h]:m}))},[]);return c.useImperativeHandle(d,()=>({submit:()=>i==null?void 0:i(s),setFieldValue:(h,m)=>{u(x=>({...x,[h]:m}))},setValues:h=>u(h),getValues:()=>s,reset:()=>u(r??{})}),[i,s,r]),e.jsx(Qt.Provider,{value:{value:s,changeField:p,errors:a},children:e.jsx("form",{name:o,onSubmit:_,noValidate:!0,...l,children:t})})}),Po=Object.assign(Vo,{TextInput:zo,NumberInput:Mo,SelectInput:Lo,SwitchField:Oo,SwitchButtonField:Eo,MoreTextField:So,TextArea:Fo,DateField:$o,TimeField:To});b.AddUserIcon=Gn,b.Addons=dt,b.ArrowLeft=De,b.ArrowRight=Pn,b.ArrowUp=In,b.BaseActionCard=kr,b.BaseButton=ve,b.BaseDialog=ut,b.BaseMenu=yt,b.BaseType=jn,b.BasicTemplateDialog=xe,b.BigContainer=yr,b.BottomSheetsUi=Xe,b.Button=me,b.Calendar=Je,b.Card=wt,b.Check=se,b.Checkbox=pn,b.ChevronDown=Me,b.Chips=mn,b.CircleInput=_r,b.CircleMinus=Oe,b.CirclePlus=Ae,b.Clock=Ie,b.ColorContext=He,b.ColorField=Qr,b.ColorProvider=dr,b.ColumnLayout=jr,b.ConditionerIcon=nt,b.ConditionerIcon2=et,b.ContentBox=Nr,b.Copy=an,b.CopyButton=ln,b.Curtains=it,b.DangerButton=_t,b.Dashboard=lt,b.DateField=Dt,b.DayOfWeekField=At,b.Divider=ee,b.EmptyPage=uo,b.FAB=xt,b.FilledButton=En,b.FilledTotalButton=On,b.FilterIcon=sn,b.Form=Po,b.FullScreenTemplateDialog=xr,b.GearIcon=Bn,b.GridLayout=Mr,b.GridLayoutItem=Sr,b.Group=qn,b.HEXtoRGB=fe,b.HSLtoHSV=ar,b.HSVtoHSL=ir,b.HSVtoRGB=ke,b.Home=Dn,b.IconButton=re,b.IconButtonMenu=fr,b.IconSelectField=qt,b.IconsSelect=xo,b.JsonContainer=mo,b.Keyboard=tn,b.LampIcon=Qn,b.LinkIcon=Wn,b.ListContainer=St,b.ListItem=Mt,b.LogoutIcon=Kn,b.Menu=hn,b.MenuIcon=Re,b.Minus=on,b.MinusUserIcon=Yn,b.ModalDialogTemplate=Ee,b.ModalPortal=le,b.ModalTemplate=Se,b.MoreHorizontal=Le,b.MoreText=Ht,b.MoreVertical=Qe,b.MultiFilter=Yt,b.NavigationBar=Ir,b.NavigationDrawer=Ar,b.NavigationRail=Hr,b.NumberField=gn,b.OkUserIcon=Xn,b.OutlineButton=Ye,b.Palette=Ke,b.Panel=Nt,b.Pen=nn,b.Play=ct,b.Plug=An,b.Plus=rn,b.PopupState=ze,b.RGBtoHSV=Fe,b.RadioButton=bn,b.Range=ur,b.Room=Jn,b.RunningLine=vo,b.ScreenSize=Q,b.ScrollContainer=Lr,b.Search=bo,b.SearchAndFilter=fo,b.SegmentedButton=fn,b.SelectField=wn,b.SelectionDialog=Ct,b.Sensor=tt,b.Sensor2=rt,b.Sensor3=ot,b.SensorWarning=at,b.SizeContext=be,b.SizeProvider=rr,b.Slider=lo,b.SmallWindowMenu=jt,b.Snackbar=Ut,b.SneckbarContext=Jt,b.SneckbarProvider=jo,b.Switch=vn,b.SwitchIcon=Rn,b.Table=Tr,b.Tabs=Or,b.Temp=or,b.TempHighIcon=cn,b.TextArea=xn,b.TextButton=te,b.TextDialog=gr,b.TextField=Ce,b.TimeField=Gt,b.TimePicker=Wt,b.ToolsIcon=st,b.Tooltip=dn,b.Trash=qe,b.Typography=G,b.UnLinkIcon=Hn,b.UserIcon=Zn,b.X=oe,b.XUserIcon=Un,b.getContainerColor=$e,b.getContainerData=Ve,b.getIcons=ko,b.getModalWindowCord=_n,b.getTextColor=R,b.hexToRgb=pt,b.map=Zt,b.useColors=ft,b.usePopup=ht,b.useScreenSize=Vn,b.useScrollLock=Ue,b.useThemes=vt,b.СalendarPickers=It,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
426
+ `,children:e.jsxs("div",{className:"input-field__input-container",onClick:w,children:[e.jsx("input",{ref:n,required:!0,disabled:j,type:"text",className:`input-field__input-container__input ${_?"input-field__input-container__input_error":""}`,name:u,value:y,onFocus:h,onBlur:p,readOnly:!0}),e.jsx("label",{className:"input-field__input-container__label",children:l?e.jsx("span",{className:"input-field__input-container__label__span",children:l}):null})]})}),A&&k&&e.jsx(G,{type:"small",className:"input-field-container__error-text",children:k}),f&&!A&&e.jsx(G,{type:"small",className:"input-field-container__helper-text",children:f}),e.jsx(hn,{marginBottom:r===Q.MOBILE?80:0,width:$.width,screensize:r,x:$.x,y:$.y,onHide:()=>N(!1),container:m,blocks:[{items:o.map(z)}],visible:V})]})});wn.displayName="SelectField";const qt=({icons:n,value:t,onChange:r,disabled:o,placeholder:a,container:i=document.getElementById("root")})=>{const[l,d]=c.useState(!1),s=n.find(_=>_.id===t),u=_=>{r==null||r(_),d(!1)};return e.jsxs(e.Fragment,{children:[e.jsx(Ce,{border:!0,icon:(s==null?void 0:s.component)??void 0,value:s==null?void 0:s.name,readOnly:!0,disabled:o,onClick:()=>d(!0),placeholder:a}),l&&e.jsx(le,{container:i,children:e.jsx(Ct,{header:"Icons",onHide:()=>d(!1),onSuccess:u,items:n.map(_=>({icon:_.component,title:_.name,data:_.id}))})})]})},Kt={Dashboard:lt,Copy:an,LogoutIcon:Kn,Room:Jn,Group:qn,OkUserIcon:Xn,XUserIcon:Un,MinusUserIcon:Yn,AddUserIcon:Gn,UserIcon:Zn,LinkIcon:Wn,UnLinkIcon:Hn,GearIcon:Bn,X:oe,Trash:qe,Pen:nn,Palette:Ke,Home:Dn,MoreHorizontal:Le,MenuIcon:Re,MoreVertical:Qe,CircleMinus:Oe,Calendar:Je,Check:se,ChevronDown:Me,CirclePlus:Ae,Clock:Ie,ArrowLeft:De,ArrowRight:Pn,ArrowUp:In,Keyboard:tn,Search:en,Plus:rn,Minus:on,Plug:An,LampIcon:Qn,SwitchIcon:Rn,ConditionerIcon:nt,ConditionerIcon2:et,TempHighIcon:cn,Sensor:tt,Sensor2:rt,Sensor3:ot,SensorWarning:at,Curtains:it,FilterIcon:sn,Play:ct,ToolsIcon:st,Addons:dt},go=Object.entries(Kt).map(([n,t])=>({id:n,name:n.charAt(0).toUpperCase()+n.slice(1),component:e.jsx(t,{})})),xo=n=>e.jsx(qt,{icons:go,...n});function ko(n){if(n)return Kt[n]??void 0}const yo={showSnackbar:n=>{},hideSnackbar:()=>{}},Jt=c.createContext(yo),jo=({children:n})=>{var l;const[t,r]=c.useState({visible:!1,text:""}),o=c.useRef(null),a=c.useCallback((d,s)=>{r({visible:!0,text:d,option:s}),o.current&&clearTimeout(o.current),s!=null&&s.closeButton||(o.current=setTimeout(()=>i(),(s==null?void 0:s.delay)??3e3))},[]),i=c.useCallback(()=>{o.current&&(clearTimeout(o.current),o.current=null),r({visible:!1,text:""})},[]);return e.jsxs(Jt.Provider,{value:{showSnackbar:a,hideSnackbar:i},children:[e.jsx(Ut,{...t,option:{...t.option,onHide:(l=t.option)!=null&&l.closeButton?i:void 0}}),n]})},Qt=c.createContext({});function Co(){return c.useContext(Qt)}function wo(n){return typeof n=="string"}function No(n){return typeof n=="number"}function So(n){return typeof n=="boolean"}const ue=n=>{const{value:t,changeField:r,errors:o}=Co(),a=c.useCallback(s=>{r&&r(n,s)},[n]),i=c.useCallback(()=>{const s=t==null?void 0:t[n];return So(s)?!!s:No(s)?Number(s):wo(s)?s??"":""},[t,n]),l=c.useCallback(()=>{r&&r(n,"")},[n]),d=c.useCallback(()=>{if(o&&Object.keys(o).includes(n))return o[n]},[o,n]);return{value:i(),clearHandler:l,error:d(),change:a}},Mo=n=>{const{value:t,change:r,error:o}=ue(n.name);return e.jsx(Ht,{...n,onChange:r,value:String(t),errorText:o,error:!!o})},Lo=n=>{const{value:t,change:r,error:o}=ue(n.name);return e.jsx(gn,{...n,value:Number(t),onChange:r,errorText:o,error:!!o})},Oo=n=>{const{value:t,change:r,error:o}=ue(n.name);return e.jsx(wn,{...n,container:n.container??document.body,value:t,onChange:r,errorText:o,error:!!o})},Eo=({placeholder:n,ref:t,style:r,readOnly:o,className:a,name:i})=>{const{value:l,change:d}=ue(i),s=u=>{d&&d(u.target.checked)};return e.jsx("div",{className:`input-field form-switch ${a}`,style:r,children:e.jsx(vn,{readOnly:o,ref:t,placeholder:n,name:i,checked:!!l,onChange:s})})},zo=({placeholder:n,ref:t,style:r,readOnly:o,className:a,name:i})=>{const{value:l,change:d}=ue(i),s=_=>{if(_.length>0)return d&&d(!0);d&&d(!1)},u=c.useCallback(()=>l?[n??i]:[],[l,i,n]);return e.jsx(fn,{className:a,style:r,ref:t,readOnly:o,value:u(),multiple:!0,items:[n??i],onChange:s})},Fo=n=>{const{error:t,value:r,change:o,clearHandler:a}=ue(n.name);return e.jsx(Ce,{...n,error:!!t,onChange:o,value:String(r),errorText:t,onClear:a})},$o=n=>{const{error:t,value:r,change:o,clearHandler:a}=ue(n.name);return e.jsx(xn,{...n,onChange:o,onClear:n.clear?a:void 0,value:String(r),error:!!t,errorText:t})},To=n=>{const{error:t,value:r,change:o}=ue(n.name);return e.jsx(Dt,{...n,error:!!t,onChange:o,value:String(r),errorText:t})},Vo=n=>{const{error:t,value:r,change:o}=ue(n.name);return e.jsx(Gt,{...n,error:!!t,onChange:o,value:String(r),errorText:t})},Po=c.forwardRef(function({children:t,value:r,name:o,errors:a,onFinish:i,...l},d){const[s,u]=c.useState(r??{}),_=c.useCallback(h=>{h.preventDefault(),i==null||i(s)},[i,s]),p=c.useCallback((h,m)=>{u(x=>({...x,[h]:m}))},[]);return c.useImperativeHandle(d,()=>({submit:()=>i==null?void 0:i(s),setFieldValue:(h,m)=>{u(x=>({...x,[h]:m}))},setValues:h=>u(h),getValues:()=>s,reset:()=>u(r??{})}),[i,s,r]),e.jsx(Qt.Provider,{value:{value:s,changeField:p,errors:a},children:e.jsx("form",{name:o,onSubmit:_,noValidate:!0,...l,children:t})})}),Io=Object.assign(Po,{TextInput:Fo,NumberInput:Lo,SelectInput:Oo,SwitchField:Eo,SwitchButtonField:zo,MoreTextField:Mo,TextArea:$o,DateField:To,TimeField:Vo});b.AddUserIcon=Gn,b.Addons=dt,b.ArrowLeft=De,b.ArrowRight=Pn,b.ArrowUp=In,b.BaseActionCard=kr,b.BaseButton=ve,b.BaseDialog=ut,b.BaseMenu=yt,b.BaseType=jn,b.BasicTemplateDialog=xe,b.BigContainer=yr,b.BottomSheetsUi=Xe,b.Button=me,b.Calendar=Je,b.Card=wt,b.Check=se,b.Checkbox=pn,b.ChevronDown=Me,b.Chips=mn,b.CircleInput=_r,b.CircleMinus=Oe,b.CirclePlus=Ae,b.Clock=Ie,b.ColorContext=He,b.ColorField=Qr,b.ColorProvider=dr,b.ColumnLayout=jr,b.ConditionerIcon=nt,b.ConditionerIcon2=et,b.ContentBox=Nr,b.Copy=an,b.CopyButton=ln,b.Curtains=it,b.DangerButton=_t,b.Dashboard=lt,b.DateField=Dt,b.DayOfWeekField=At,b.Divider=ee,b.EmptyPage=uo,b.FAB=xt,b.FilledButton=En,b.FilledTotalButton=On,b.FilterIcon=sn,b.Form=Io,b.FullScreenTemplateDialog=xr,b.GearIcon=Bn,b.GridLayout=Mr,b.GridLayoutItem=Sr,b.Group=qn,b.HEXtoRGB=fe,b.HSLtoHSV=ar,b.HSVtoHSL=ir,b.HSVtoRGB=ke,b.Home=Dn,b.IconButton=re,b.IconButtonMenu=fr,b.IconSelectField=qt,b.IconsSelect=xo,b.JsonContainer=mo,b.Keyboard=tn,b.LampIcon=Qn,b.LinkIcon=Wn,b.ListContainer=St,b.ListItem=Mt,b.LogoutIcon=Kn,b.Menu=hn,b.MenuIcon=Re,b.Minus=on,b.MinusUserIcon=Yn,b.ModalDialogTemplate=Ee,b.ModalPortal=le,b.ModalTemplate=Se,b.MoreHorizontal=Le,b.MoreText=Ht,b.MoreVertical=Qe,b.MultiFilter=Yt,b.NavigationBar=Ir,b.NavigationDrawer=Ar,b.NavigationRail=Hr,b.NumberField=gn,b.OkUserIcon=Xn,b.OutlineButton=Ye,b.Palette=Ke,b.Panel=Nt,b.Pen=nn,b.Play=ct,b.Plug=An,b.Plus=rn,b.PopupState=ze,b.RGBtoHSV=Fe,b.RadioButton=bn,b.Range=ur,b.Room=Jn,b.RunningLine=vo,b.ScreenSize=Q,b.ScrollContainer=Lr,b.Search=bo,b.SearchAndFilter=fo,b.SegmentedButton=fn,b.SelectField=wn,b.SelectionDialog=Ct,b.Sensor=tt,b.Sensor2=rt,b.Sensor3=ot,b.SensorWarning=at,b.SizeContext=be,b.SizeProvider=rr,b.Slider=lo,b.SmallWindowMenu=jt,b.Snackbar=Ut,b.SneckbarContext=Jt,b.SneckbarProvider=jo,b.Switch=vn,b.SwitchIcon=Rn,b.Table=Tr,b.Tabs=Or,b.Temp=or,b.TempHighIcon=cn,b.TextArea=xn,b.TextButton=te,b.TextDialog=gr,b.TextField=Ce,b.TimeField=Gt,b.TimePicker=Wt,b.ToolsIcon=st,b.Tooltip=dn,b.Trash=qe,b.Typography=G,b.UnLinkIcon=Hn,b.UserIcon=Zn,b.X=oe,b.XUserIcon=Un,b.getContainerColor=$e,b.getContainerData=Ve,b.getIcons=ko,b.getModalWindowCord=_n,b.getTextColor=R,b.hexToRgb=pt,b.map=Zt,b.useColors=ft,b.usePopup=ht,b.useScreenSize=Vn,b.useScrollLock=Ue,b.useThemes=vt,b.СalendarPickers=It,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
@@ -1,22 +1,23 @@
1
1
  import { FormHTMLAttributes } from 'react';
2
2
 
3
- export interface FormProps<T extends Record<string, unknown>> extends FormHTMLAttributes<HTMLFormElement> {
3
+ export interface FormProps<T> extends FormHTMLAttributes<HTMLFormElement> {
4
4
  children: React.ReactNode;
5
- onFinish?: (data: {
6
- [x: string]: unknown;
7
- }) => void;
8
- value?: T;
5
+ onFinish?: (data: Partial<T>) => void;
6
+ value?: Partial<T>;
9
7
  name?: string;
10
- errors?: Record<string, string>;
8
+ errors?: Partial<Record<keyof T, string>>;
11
9
  }
12
- export interface FormRef {
10
+ export interface FormRef<T> {
13
11
  submit: () => void;
14
- setFieldValue: (name: string, value: unknown) => void;
15
- setValues: (values: Record<string, unknown>) => void;
16
- getValues: () => Record<string, unknown>;
12
+ setFieldValue: (name: keyof T, value: T[keyof T]) => void;
13
+ setValues: (values: Partial<T>) => void;
14
+ getValues: () => Partial<T>;
17
15
  reset: () => void;
18
16
  }
19
- export declare const Form: import('react').ForwardRefExoticComponent<FormProps<Record<string, unknown>> & import('react').RefAttributes<FormRef>> & {
17
+ export type FormComponent = <T>(props: FormProps<T> & {
18
+ ref?: React.Ref<FormRef<T>>;
19
+ }) => React.ReactNode | null;
20
+ export declare const Form: FormComponent & {
20
21
  TextInput: (props: import('./inputs/formTextInput').TextFieldPropsForm) => import("react/jsx-runtime").JSX.Element;
21
22
  NumberInput: (props: import('./inputs/formNumberInput').TextFieldProps) => import("react/jsx-runtime").JSX.Element;
22
23
  SelectInput: (props: import('./inputs/formSelectInput').ISelectFieldPropsForm) => import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,9 @@
1
- export interface IContext<T> {
2
- value?: T;
3
- changeField?: (name: string, data: unknown) => void;
4
- errors?: {
5
- [key: string]: string;
6
- };
1
+ type AnyObject = unknown;
2
+ export interface IContext<T extends AnyObject> {
3
+ value?: Partial<T>;
4
+ changeField?: (name: keyof T, data: T[keyof T]) => void;
5
+ errors?: Partial<Record<string, string>>;
7
6
  }
8
- export declare const formContext: import('react').Context<IContext<{
9
- [x: string]: unknown;
10
- }>>;
7
+ export declare const formContext: import('react').Context<IContext<unknown>>;
8
+ export declare function useFormContext<T>(): IContext<T>;
9
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alex-evo-sh-ui-kit",
3
- "version": "1.1.84",
3
+ "version": "1.1.85",
4
4
  "type": "module",
5
5
  "homepage": "https://alex-evo-2266.github.io/alex-evo-sh-ui-kit/",
6
6
  "scripts": {