@elcrm/telegram 0.0.68 → 0.0.69

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.
@@ -5,7 +5,7 @@ export type TFooter = {
5
5
  className?: string;
6
6
  page?: string;
7
7
  direction?: "row" | "column";
8
- setPage?: (page: string) => void;
8
+ onPageChange?: (page: string) => void;
9
9
  };
10
10
  export type TAction = {
11
11
  icon: any;
@@ -13,6 +13,6 @@ export type TAction = {
13
13
  page?: string;
14
14
  callback?: () => void;
15
15
  };
16
- declare const Footer: ({ actions, children, className, page, setPage, direction, }: TFooter) => import("react/jsx-runtime").JSX.Element;
16
+ declare const Footer: ({ actions, children, className, page, onPageChange, direction, }: TFooter) => import("react/jsx-runtime").JSX.Element;
17
17
  export default Footer;
18
18
  export { events };
package/dist/index.d.ts CHANGED
@@ -4,19 +4,28 @@ declare namespace Telegram {
4
4
  const WebApp: any;
5
5
  const getUser: () => any;
6
6
  /**
7
- * Показывает уведомление с поддержкой тем оформления и хаптик-отклика.
8
-
9
- * @param {string|object} type - Тип уведомления ('error', 'success', 'warning') или объект: {type, text, thema}.
10
- * @param {string} [text] - Текст уведомления.
11
- * @param {boolean} [thema] - Признак применения темы оформния.
12
- *
13
- * Пример использования:
14
- * Telegram.Notice('error', 'Что-то пошло не так');
15
- * Telegram.Notice({type: 'success', text: 'Операция выполнена', thema: true});
16
- */
7
+ * Показывает уведомление с поддержкой тем оформления и хаптик-отклика.
8
+ * @param {string|object} type - Тип уведомления ('error', 'success', 'warning') или объект: {type, text, thema}.
9
+ * @param {string} [text] - Текст уведомления.
10
+ * @param {boolean} [thema] - Признак применения темы оформния.
11
+ *
12
+ * Пример использования:
13
+ * Telegram.Notice('error', 'Что-то пошло не так');
14
+ * Telegram.Notice({type: 'success', text: 'Операция выполнена', thema: true});
15
+ */
17
16
  const Notice: (type: any, text?: any, thema?: any) => void;
18
17
  const Header: () => import("react/jsx-runtime").JSX.Element;
19
- const Footer: ({ actions, children, className, page, setPage, direction, }: import("./Footer").TFooter) => import("react/jsx-runtime").JSX.Element;
18
+ /**
19
+ * Компонент Footer
20
+ *
21
+ * @param {TAction[]} [actions] - Массив действий для отображения в футере
22
+ * @param {React.ReactNode} [children] - Дополнительные дочерние элементы
23
+ * @param {string} [className] - Пользовательский CSS-класс
24
+ * @param {string} [page] - Текущая страница для определения активного действия
25
+ * @param {"row"|"column"} [direction="row"] - Направление расположения элементов футера
26
+ * @param {(page: string) => void} [onPageChange] - Функция для обработки смены страницы
27
+ */
28
+ const Footer: ({ actions, children, className, page, onPageChange, direction, }: import("./Footer").TFooter) => import("react/jsx-runtime").JSX.Element;
20
29
  /**
21
30
  * Компонент BottomSheet
22
31
  *
@@ -51,7 +60,7 @@ type MainButton = {
51
60
  callback?: () => void;
52
61
  page: string;
53
62
  };
54
- export declare const Header: () => import("react/jsx-runtime").JSX.Element, Footer: ({ actions, children, className, page, setPage, direction, }: import('./Footer').TFooter) => import("react/jsx-runtime").JSX.Element, toggleBottomSheet: () => void, Modal: typeof _Modal, MainButton: {
63
+ export declare const Header: () => import("react/jsx-runtime").JSX.Element, Footer: ({ actions, children, className, page, onPageChange, direction, }: import('./Footer').TFooter) => import("react/jsx-runtime").JSX.Element, toggleBottomSheet: () => void, Modal: typeof _Modal, MainButton: {
55
64
  callback: never[];
56
65
  set: (j: MainButton | boolean) => void;
57
66
  }, BackButton: {
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import P, { useState as Ot, useEffect as Ct } from "react";
2
- import './index.css';var jt = { exports: {} }, Ve = {};
1
+ import P, { useState as Ot, useEffect as jt } from "react";
2
+ import './index.css';var wt = { exports: {} }, Ve = {};
3
3
  /**
4
4
  * @license React
5
5
  * react-jsx-runtime.production.min.js
@@ -14,14 +14,14 @@ function Vt() {
14
14
  if (Pt) return Ve;
15
15
  Pt = 1;
16
16
  var r = P, o = Symbol.for("react.element"), i = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, v = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, y = { key: !0, ref: !0, __self: !0, __source: !0 };
17
- function C(_, h, E) {
18
- var d, R = {}, w = null, N = null;
19
- E !== void 0 && (w = "" + E), h.key !== void 0 && (w = "" + h.key), h.ref !== void 0 && (N = h.ref);
17
+ function j(_, h, E) {
18
+ var d, R = {}, C = null, N = null;
19
+ E !== void 0 && (C = "" + E), h.key !== void 0 && (C = "" + h.key), h.ref !== void 0 && (N = h.ref);
20
20
  for (d in h) c.call(h, d) && !y.hasOwnProperty(d) && (R[d] = h[d]);
21
21
  if (_ && _.defaultProps) for (d in h = _.defaultProps, h) R[d] === void 0 && (R[d] = h[d]);
22
- return { $$typeof: o, type: _, key: w, ref: N, props: R, _owner: v.current };
22
+ return { $$typeof: o, type: _, key: C, ref: N, props: R, _owner: v.current };
23
23
  }
24
- return Ve.Fragment = i, Ve.jsx = C, Ve.jsxs = C, Ve;
24
+ return Ve.Fragment = i, Ve.jsx = j, Ve.jsxs = j, Ve;
25
25
  }
26
26
  var ze = {};
27
27
  /**
@@ -36,7 +36,7 @@ var ze = {};
36
36
  var Tt;
37
37
  function zt() {
38
38
  return Tt || (Tt = 1, process.env.NODE_ENV !== "production" && function() {
39
- var r = P, o = Symbol.for("react.element"), i = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), C = Symbol.for("react.provider"), _ = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), E = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), N = Symbol.for("react.offscreen"), ne = Symbol.iterator, _e = "@@iterator";
39
+ var r = P, o = Symbol.for("react.element"), i = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), j = Symbol.for("react.provider"), _ = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), E = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), N = Symbol.for("react.offscreen"), ne = Symbol.iterator, _e = "@@iterator";
40
40
  function Re(e) {
41
41
  if (e === null || typeof e != "object")
42
42
  return null;
@@ -64,7 +64,7 @@ function zt() {
64
64
  var ke = !1, Ee = !1, m = !1, k = !1, B = !1, $;
65
65
  $ = Symbol.for("react.module.reference");
66
66
  function W(e) {
67
- return !!(typeof e == "string" || typeof e == "function" || e === c || e === y || B || e === v || e === E || e === d || k || e === N || ke || Ee || m || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === R || e.$$typeof === C || e.$$typeof === _ || e.$$typeof === h || // This needs to include all possible module reference object
67
+ return !!(typeof e == "string" || typeof e == "function" || e === c || e === y || B || e === v || e === E || e === d || k || e === N || ke || Ee || m || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === R || e.$$typeof === j || e.$$typeof === _ || e.$$typeof === h || // This needs to include all possible module reference object
68
68
  // types supported by any Flight configuration anywhere since
69
69
  // we don't know which Flight build this will end up being used
70
70
  // with.
@@ -106,7 +106,7 @@ function zt() {
106
106
  case _:
107
107
  var t = e;
108
108
  return ae(t) + ".Consumer";
109
- case C:
109
+ case j:
110
110
  var n = e;
111
111
  return ae(n._context) + ".Provider";
112
112
  case h:
@@ -114,7 +114,7 @@ function zt() {
114
114
  case R:
115
115
  var a = e.displayName || null;
116
116
  return a !== null ? a : T(e.type) || "Memo";
117
- case w: {
117
+ case C: {
118
118
  var f = e, p = f._payload, u = f._init;
119
119
  try {
120
120
  return T(u(p));
@@ -125,18 +125,18 @@ function zt() {
125
125
  }
126
126
  return null;
127
127
  }
128
- var I = Object.assign, D = 0, z, J, q, Se, xe, Oe, Ce;
129
- function je() {
128
+ var I = Object.assign, D = 0, z, J, q, Se, xe, Oe, je;
129
+ function we() {
130
130
  }
131
- je.__reactDisabledLog = !0;
131
+ we.__reactDisabledLog = !0;
132
132
  function Qe() {
133
133
  {
134
134
  if (D === 0) {
135
- z = console.log, J = console.info, q = console.warn, Se = console.error, xe = console.group, Oe = console.groupCollapsed, Ce = console.groupEnd;
135
+ z = console.log, J = console.info, q = console.warn, Se = console.error, xe = console.group, Oe = console.groupCollapsed, je = console.groupEnd;
136
136
  var e = {
137
137
  configurable: !0,
138
138
  enumerable: !0,
139
- value: je,
139
+ value: we,
140
140
  writable: !0
141
141
  };
142
142
  Object.defineProperties(console, {
@@ -180,7 +180,7 @@ function zt() {
180
180
  value: Oe
181
181
  }),
182
182
  groupEnd: I({}, e, {
183
- value: Ce
183
+ value: je
184
184
  })
185
185
  });
186
186
  }
@@ -206,7 +206,7 @@ function zt() {
206
206
  var tt = typeof WeakMap == "function" ? WeakMap : Map;
207
207
  G = new tt();
208
208
  }
209
- function we(e, t) {
209
+ function Ce(e, t) {
210
210
  if (!e || le)
211
211
  return "";
212
212
  {
@@ -278,7 +278,7 @@ function zt() {
278
278
  return typeof e == "function" && G.set(e, M), M;
279
279
  }
280
280
  function rt(e, t, n) {
281
- return we(e, !1);
281
+ return Ce(e, !1);
282
282
  }
283
283
  function nt(e) {
284
284
  var t = e.prototype;
@@ -288,7 +288,7 @@ function zt() {
288
288
  if (e == null)
289
289
  return "";
290
290
  if (typeof e == "function")
291
- return we(e, nt(e));
291
+ return Ce(e, nt(e));
292
292
  if (typeof e == "string")
293
293
  return K(e);
294
294
  switch (e) {
@@ -303,7 +303,7 @@ function zt() {
303
303
  return rt(e.render);
304
304
  case R:
305
305
  return Z(e.type, t, n);
306
- case w: {
306
+ case C: {
307
307
  var a = e, f = a._payload, p = a._init;
308
308
  try {
309
309
  return Z(p(f), t, n);
@@ -623,10 +623,10 @@ React keys must be passed directly to JSX without using spread:
623
623
  ze.Fragment = c, ze.jsx = kt, ze.jsxs = Et;
624
624
  }()), ze;
625
625
  }
626
- process.env.NODE_ENV === "production" ? jt.exports = Vt() : jt.exports = zt();
627
- var l = jt.exports;
626
+ process.env.NODE_ENV === "production" ? wt.exports = Vt() : wt.exports = zt();
627
+ var l = wt.exports;
628
628
  let H = {};
629
- var wt;
629
+ var Ct;
630
630
  ((r) => {
631
631
  function o({ children: _ }) {
632
632
  const [h, E] = Ot(!1), [d, R] = Ot(!1);
@@ -634,7 +634,7 @@ var wt;
634
634
  re.BackButton.set(!1), R(!0), setTimeout(() => {
635
635
  E(!1), R(!1);
636
636
  }, 300);
637
- }, Ct(() => {
637
+ }, jt(() => {
638
638
  h ? H.onClose() : (re.BackButton.set({
639
639
  callback: () => H.onClose()
640
640
  }), E(!0));
@@ -648,7 +648,7 @@ var wt;
648
648
  let [h, E] = Ot([]);
649
649
  return H.x = (d) => {
650
650
  E(d ? h.filter((R) => R.key !== d) : []);
651
- }, Ct(() => {
651
+ }, jt(() => {
652
652
  _ && (H.i = _);
653
653
  }, []), H.add = (d, R = Date.now()) => {
654
654
  E([...h, { key: R, item: d }]);
@@ -673,13 +673,13 @@ var wt;
673
673
  H.onClose();
674
674
  }
675
675
  r.Close = y;
676
- function C(_, h, E) {
676
+ function j(_, h, E) {
677
677
  H.i && H.i(`${_}/modals/${h}.tsx`).then((d) => {
678
678
  d.default.Open(E);
679
679
  });
680
680
  }
681
- r.Open = C;
682
- })(wt || (wt = {}));
681
+ r.Open = j;
682
+ })(Ct || (Ct = {}));
683
683
  function Mt() {
684
684
  return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof self < "u" ? self : typeof global < "u" ? global : {};
685
685
  }
@@ -720,8 +720,8 @@ const Ge = (r) => {
720
720
  const i = new Uint8Array(r.length), c = new Uint8Array(r.length);
721
721
  let v = 0;
722
722
  for (let y = 0; y < r.length; y++) {
723
- const C = y % o.length;
724
- v = o[C] + y + v & 255, c[y] = v;
723
+ const j = y % o.length;
724
+ v = o[j] + y + v & 255, c[y] = v;
725
725
  }
726
726
  for (let y = 0; y < r.length; y++)
727
727
  i[y] = r[y] ^ c[y];
@@ -742,8 +742,8 @@ const Ge = (r) => {
742
742
  try {
743
743
  const o = Ge(
744
744
  Date.now().toString() + Math.random()
745
- ).substring(0, Ke().saltLength * 2), i = Ge(r + o).substring(0, 8), c = Wt(Ke().key, o), v = Jt(r), y = Lt(v, c), C = Ht(y);
746
- return `${o}.${C}.${i}`;
745
+ ).substring(0, Ke().saltLength * 2), i = Ge(r + o).substring(0, 8), c = Wt(Ke().key, o), v = Jt(r), y = Lt(v, c), j = Ht(y);
746
+ return `${o}.${j}.${i}`;
747
747
  } catch {
748
748
  throw new Error("Не удалось зашифровать данные");
749
749
  }
@@ -752,7 +752,7 @@ const Ge = (r) => {
752
752
  const o = r.split(".");
753
753
  if (o.length !== 3)
754
754
  throw new Error("Неверный формат зашифрованных данных");
755
- const i = o[0], c = o[1], v = o[2], y = Wt(Ke().key, i), C = Kt(c), _ = Lt(C, y), h = qt(_);
755
+ const i = o[0], c = o[1], v = o[2], y = Wt(Ke().key, i), j = Kt(c), _ = Lt(j, y), h = qt(_);
756
756
  if (Ge(h + i).substring(
757
757
  0,
758
758
  8
@@ -802,14 +802,14 @@ function Xt() {
802
802
  if (It) return Je;
803
803
  It = 1;
804
804
  var r = P, o = Symbol.for("react.element"), i = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, v = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, y = { key: !0, ref: !0, __self: !0, __source: !0 };
805
- function C(_, h, E) {
806
- var d, R = {}, w = null, N = null;
807
- E !== void 0 && (w = "" + E), h.key !== void 0 && (w = "" + h.key), h.ref !== void 0 && (N = h.ref);
805
+ function j(_, h, E) {
806
+ var d, R = {}, C = null, N = null;
807
+ E !== void 0 && (C = "" + E), h.key !== void 0 && (C = "" + h.key), h.ref !== void 0 && (N = h.ref);
808
808
  for (d in h) c.call(h, d) && !y.hasOwnProperty(d) && (R[d] = h[d]);
809
809
  if (_ && _.defaultProps) for (d in h = _.defaultProps, h) R[d] === void 0 && (R[d] = h[d]);
810
- return { $$typeof: o, type: _, key: w, ref: N, props: R, _owner: v.current };
810
+ return { $$typeof: o, type: _, key: C, ref: N, props: R, _owner: v.current };
811
811
  }
812
- return Je.Fragment = i, Je.jsx = C, Je.jsxs = C, Je;
812
+ return Je.Fragment = i, Je.jsx = j, Je.jsxs = j, Je;
813
813
  }
814
814
  var He = {};
815
815
  /**
@@ -824,7 +824,7 @@ var He = {};
824
824
  var $t;
825
825
  function Qt() {
826
826
  return $t || ($t = 1, process.env.NODE_ENV !== "production" && function() {
827
- var r = P, o = Symbol.for("react.element"), i = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), C = Symbol.for("react.provider"), _ = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), E = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), N = Symbol.for("react.offscreen"), ne = Symbol.iterator, _e = "@@iterator";
827
+ var r = P, o = Symbol.for("react.element"), i = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), j = Symbol.for("react.provider"), _ = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), E = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), N = Symbol.for("react.offscreen"), ne = Symbol.iterator, _e = "@@iterator";
828
828
  function Re(e) {
829
829
  if (e === null || typeof e != "object")
830
830
  return null;
@@ -852,7 +852,7 @@ function Qt() {
852
852
  var ke = !1, Ee = !1, m = !1, k = !1, B = !1, $;
853
853
  $ = Symbol.for("react.module.reference");
854
854
  function W(e) {
855
- return !!(typeof e == "string" || typeof e == "function" || e === c || e === y || B || e === v || e === E || e === d || k || e === N || ke || Ee || m || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === R || e.$$typeof === C || e.$$typeof === _ || e.$$typeof === h || // This needs to include all possible module reference object
855
+ return !!(typeof e == "string" || typeof e == "function" || e === c || e === y || B || e === v || e === E || e === d || k || e === N || ke || Ee || m || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === R || e.$$typeof === j || e.$$typeof === _ || e.$$typeof === h || // This needs to include all possible module reference object
856
856
  // types supported by any Flight configuration anywhere since
857
857
  // we don't know which Flight build this will end up being used
858
858
  // with.
@@ -894,7 +894,7 @@ function Qt() {
894
894
  case _:
895
895
  var t = e;
896
896
  return ae(t) + ".Consumer";
897
- case C:
897
+ case j:
898
898
  var n = e;
899
899
  return ae(n._context) + ".Provider";
900
900
  case h:
@@ -902,7 +902,7 @@ function Qt() {
902
902
  case R:
903
903
  var a = e.displayName || null;
904
904
  return a !== null ? a : T(e.type) || "Memo";
905
- case w: {
905
+ case C: {
906
906
  var f = e, p = f._payload, u = f._init;
907
907
  try {
908
908
  return T(u(p));
@@ -913,18 +913,18 @@ function Qt() {
913
913
  }
914
914
  return null;
915
915
  }
916
- var I = Object.assign, D = 0, z, J, q, Se, xe, Oe, Ce;
917
- function je() {
916
+ var I = Object.assign, D = 0, z, J, q, Se, xe, Oe, je;
917
+ function we() {
918
918
  }
919
- je.__reactDisabledLog = !0;
919
+ we.__reactDisabledLog = !0;
920
920
  function Qe() {
921
921
  {
922
922
  if (D === 0) {
923
- z = console.log, J = console.info, q = console.warn, Se = console.error, xe = console.group, Oe = console.groupCollapsed, Ce = console.groupEnd;
923
+ z = console.log, J = console.info, q = console.warn, Se = console.error, xe = console.group, Oe = console.groupCollapsed, je = console.groupEnd;
924
924
  var e = {
925
925
  configurable: !0,
926
926
  enumerable: !0,
927
- value: je,
927
+ value: we,
928
928
  writable: !0
929
929
  };
930
930
  Object.defineProperties(console, {
@@ -968,7 +968,7 @@ function Qt() {
968
968
  value: Oe
969
969
  }),
970
970
  groupEnd: I({}, e, {
971
- value: Ce
971
+ value: je
972
972
  })
973
973
  });
974
974
  }
@@ -994,7 +994,7 @@ function Qt() {
994
994
  var tt = typeof WeakMap == "function" ? WeakMap : Map;
995
995
  G = new tt();
996
996
  }
997
- function we(e, t) {
997
+ function Ce(e, t) {
998
998
  if (!e || le)
999
999
  return "";
1000
1000
  {
@@ -1066,7 +1066,7 @@ function Qt() {
1066
1066
  return typeof e == "function" && G.set(e, M), M;
1067
1067
  }
1068
1068
  function rt(e, t, n) {
1069
- return we(e, !1);
1069
+ return Ce(e, !1);
1070
1070
  }
1071
1071
  function nt(e) {
1072
1072
  var t = e.prototype;
@@ -1076,7 +1076,7 @@ function Qt() {
1076
1076
  if (e == null)
1077
1077
  return "";
1078
1078
  if (typeof e == "function")
1079
- return we(e, nt(e));
1079
+ return Ce(e, nt(e));
1080
1080
  if (typeof e == "string")
1081
1081
  return K(e);
1082
1082
  switch (e) {
@@ -1091,7 +1091,7 @@ function Qt() {
1091
1091
  return rt(e.render);
1092
1092
  case R:
1093
1093
  return Z(e.type, t, n);
1094
- case w: {
1094
+ case C: {
1095
1095
  var a = e, f = a._payload, p = a._init;
1096
1096
  try {
1097
1097
  return Z(p(f), t, n);
@@ -1431,7 +1431,7 @@ function ee(r) {
1431
1431
  const o = ye();
1432
1432
  o.ROUTER_PARAMS ? o.ROUTER_PARAMS = { ...o.ROUTER_PARAMS, ...r } : o.ROUTER_PARAMS = { ...At, ...r };
1433
1433
  }
1434
- function j() {
1434
+ function w() {
1435
1435
  return ye().ROUTER_PARAMS || At;
1436
1436
  }
1437
1437
  function ge(r) {
@@ -1464,19 +1464,19 @@ var be;
1464
1464
  ee({
1465
1465
  id: 0,
1466
1466
  tab: "",
1467
- page: (m = localStorage.getItem("d")) != null && m.length ? j().page : j().auth,
1468
- module: j().module
1467
+ page: (m = localStorage.getItem("d")) != null && m.length ? w().page : w().auth,
1468
+ module: w().module
1469
1469
  });
1470
1470
  return !0;
1471
1471
  }
1472
1472
  function i() {
1473
- Q.id = 0, Q.tab = "", Q.page = j().page, Q.module = j().module;
1473
+ Q.id = 0, Q.tab = "", Q.page = w().page, Q.module = w().module;
1474
1474
  }
1475
1475
  r.Reset = i;
1476
1476
  function c({
1477
- module: m = j().module,
1478
- page: k = j().page,
1479
- auth: B = j().auth
1477
+ module: m = w().module,
1478
+ page: k = w().page,
1479
+ auth: B = w().auth
1480
1480
  }) {
1481
1481
  ee({ page: k, module: m, auth: B }), o();
1482
1482
  }
@@ -1484,7 +1484,7 @@ var be;
1484
1484
  function v(m) {
1485
1485
  let k = (W) => (ee({ page: W }), W);
1486
1486
  const [B, $] = P.useState(
1487
- C() || m && k(m) || j().page
1487
+ j() || m && k(m) || w().page
1488
1488
  );
1489
1489
  return ge({ page: (W) => {
1490
1490
  $(W);
@@ -1493,42 +1493,42 @@ var be;
1493
1493
  r.usePage = v;
1494
1494
  function y(m, k = !0, B = {}) {
1495
1495
  ee({ page: m, ...B }), sessionStorage.setItem(
1496
- j().STORAGE,
1497
- ie.enCode(j())
1496
+ w().STORAGE,
1497
+ ie.enCode(w())
1498
1498
  ), k && te().page(m);
1499
1499
  }
1500
1500
  r.setPage = y;
1501
- function C() {
1502
- return j().page;
1501
+ function j() {
1502
+ return w().page;
1503
1503
  }
1504
- r.getPage = C;
1504
+ r.getPage = j;
1505
1505
  function _(m) {
1506
- return j().page === m;
1506
+ return w().page === m;
1507
1507
  }
1508
1508
  r.isPage = _;
1509
1509
  function h(m, k) {
1510
1510
  const [B, $] = P.useState(
1511
- d() || m || j().module
1511
+ d() || m || w().module
1512
1512
  );
1513
1513
  return ge({ module: $ }), B;
1514
1514
  }
1515
1515
  r.useModule = h;
1516
1516
  function E(m, k = !0) {
1517
1517
  ee({ module: m }), sessionStorage.setItem(
1518
- j().STORAGE,
1519
- ie.enCode(j())
1518
+ w().STORAGE,
1519
+ ie.enCode(w())
1520
1520
  ), k && te().module(m);
1521
1521
  }
1522
1522
  r.setModule = E;
1523
1523
  function d() {
1524
- return j().module || "";
1524
+ return w().module || "";
1525
1525
  }
1526
1526
  r.getModule = d;
1527
1527
  function R(m) {
1528
- return j().module === m;
1528
+ return w().module === m;
1529
1529
  }
1530
1530
  r.isModule = R;
1531
- function w(m, k) {
1531
+ function C(m, k) {
1532
1532
  if (typeof m != "function") {
1533
1533
  const [B, $] = P.useState(!k), [W, oe] = P.useState(m || ne());
1534
1534
  return ge({ tabs: oe }), k && P.useEffect(() => {
@@ -1537,20 +1537,20 @@ var be;
1537
1537
  } else
1538
1538
  ge({ tabs: m });
1539
1539
  }
1540
- r.useTabs = w;
1540
+ r.useTabs = C;
1541
1541
  async function N(m, k = !0) {
1542
1542
  ee({ tab: m }), sessionStorage.setItem(
1543
- j().STORAGE,
1544
- ie.enCode(j())
1543
+ w().STORAGE,
1544
+ ie.enCode(w())
1545
1545
  ), k && (te().tabs && te().tabs(m));
1546
1546
  }
1547
1547
  r.setTabs = N;
1548
1548
  function ne() {
1549
- return j().tab;
1549
+ return w().tab;
1550
1550
  }
1551
1551
  r.getTabs = ne;
1552
1552
  function _e(m) {
1553
- return j().tab === m;
1553
+ return w().tab === m;
1554
1554
  }
1555
1555
  r.isTabs = _e;
1556
1556
  function Re(m) {
@@ -1568,25 +1568,25 @@ var be;
1568
1568
  r.subId = F;
1569
1569
  async function S(m, k = !0) {
1570
1570
  ee({ id: m }), sessionStorage.setItem(
1571
- j().STORAGE,
1572
- ie.enCode(j())
1571
+ w().STORAGE,
1572
+ ie.enCode(w())
1573
1573
  ), k && te().id(m);
1574
1574
  }
1575
1575
  r.setId = S;
1576
1576
  function me() {
1577
- return j().id;
1577
+ return w().id;
1578
1578
  }
1579
1579
  r.getId = me;
1580
1580
  function ke(m) {
1581
- return Number(j().id) === m;
1581
+ return Number(w().id) === m;
1582
1582
  }
1583
1583
  r.isId = ke;
1584
1584
  async function Ee(m) {
1585
1585
  var k, B, $, W, oe, ae, T, I;
1586
1586
  const { page: D, module: z, tab: J, id: q } = m;
1587
1587
  D !== void 0 && (Q.page = D), z !== void 0 && (Q.module = z), J !== void 0 && (Q.tab = J), q !== void 0 && (Q.id = q), ee({ ...Q }), q !== void 0 && ((B = (k = te()).id) == null || B.call(k, q)), J !== void 0 && ((W = ($ = te()).tabs) == null || W.call($, J)), z !== void 0 && ((ae = (oe = te()).module) == null || ae.call(oe, z)), D !== void 0 && ((I = (T = te()).page) == null || I.call(T, D)), sessionStorage.setItem(
1588
- j().STORAGE,
1589
- ie.enCode(j())
1588
+ w().STORAGE,
1589
+ ie.enCode(w())
1590
1590
  );
1591
1591
  }
1592
1592
  r.navigate = Ee;
@@ -1701,22 +1701,22 @@ const or = ({ children: r, title: o, isOverlay: i = !0 }) => {
1701
1701
  children: o,
1702
1702
  className: i,
1703
1703
  page: c,
1704
- setPage: v,
1704
+ onPageChange: v,
1705
1705
  direction: y = "row"
1706
1706
  }) => {
1707
- const [C, _] = P.useState(null), [h, E] = P.useState(
1707
+ const [j, _] = P.useState(null), [h, E] = P.useState(
1708
1708
  c ? Ft(r || [], c) : 0
1709
1709
  );
1710
1710
  return Yt.onClose = () => {
1711
1711
  _(null), E(c ? Ft(r || [], c) : 0);
1712
- }, Ct(() => {
1712
+ }, jt(() => {
1713
1713
  document.addEventListener("blur", () => {
1714
1714
  document.querySelector("footer").style.display = "flex";
1715
1715
  }), document.addEventListener("focus", () => {
1716
1716
  document.querySelector("footer").style.display = "none";
1717
1717
  });
1718
1718
  }, []), /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
1719
- C,
1719
+ j,
1720
1720
  /* @__PURE__ */ l.jsxs(
1721
1721
  "footer",
1722
1722
  {
@@ -1785,23 +1785,23 @@ V.users = {
1785
1785
  };
1786
1786
  const lr = () => {
1787
1787
  if (location.hostname === "localhost") {
1788
- let [r, o] = P.useState(!1), [i, c] = P.useState(!1), [v, y] = P.useState("dark"), [C, _] = P.useState(!1), [h, E] = P.useState(!1);
1788
+ let [r, o] = P.useState(!1), [i, c] = P.useState(!1), [v, y] = P.useState("dark"), [j, _] = P.useState(!1), [h, E] = P.useState(!1);
1789
1789
  he.is = !0, he.MainButton.set = o, he.BackButton.set = c, P.useEffect(() => {
1790
1790
  V[v]["--tg-theme-bg-color-alpha"] = V[v]["--tg-theme-bg-color"] + "b3", V[v]["--tg-theme-secondary-bg-color-alpha"] = V[v]["--tg-theme-secondary-bg-color"] + "d3";
1791
- for (let w in V[v])
1791
+ for (let C in V[v])
1792
1792
  document.documentElement.style.setProperty(
1793
- w,
1794
- V[v][w]
1793
+ C,
1794
+ V[v][C]
1795
1795
  );
1796
1796
  re.WebApp.safeAreaInset.bottom === 0 && document.documentElement.style.setProperty(
1797
1797
  "--tg-safe-area-inset-bottom",
1798
1798
  "16px"
1799
1799
  );
1800
1800
  }, []);
1801
- let d = (w) => {
1802
- for (let N in V[w])
1803
- document.documentElement.style.setProperty(N, V[w][N]);
1804
- y(w), _(!1);
1801
+ let d = (C) => {
1802
+ for (let N in V[C])
1803
+ document.documentElement.style.setProperty(N, V[C][N]);
1804
+ y(C), _(!1);
1805
1805
  }, R = () => {
1806
1806
  _(!1), E(!0);
1807
1807
  };
@@ -1811,14 +1811,14 @@ const lr = () => {
1811
1811
  "div",
1812
1812
  {
1813
1813
  onClick: () => {
1814
- var w;
1815
- i.page === void 0 ? (w = i.callback) == null || w.call(i) : be.setPage(i.page);
1814
+ var C;
1815
+ i.page === void 0 ? (C = i.callback) == null || C.call(i) : be.setPage(i.page);
1816
1816
  },
1817
1817
  className: "b",
1818
1818
  children: "Назад"
1819
1819
  }
1820
1820
  ),
1821
- /* @__PURE__ */ l.jsx("div", { className: "o", onClick: () => _(!C), children: "Меню" })
1821
+ /* @__PURE__ */ l.jsx("div", { className: "o", onClick: () => _(!j), children: "Меню" })
1822
1822
  ] }),
1823
1823
  /* @__PURE__ */ l.jsx(Xe.Init, {}),
1824
1824
  r && /* @__PURE__ */ l.jsx("div", { className: "mb", children: /* @__PURE__ */ l.jsx(
@@ -1830,7 +1830,7 @@ const lr = () => {
1830
1830
  children: r.text
1831
1831
  }
1832
1832
  ) }),
1833
- C ? /* @__PURE__ */ l.jsxs("div", { className: "tm", children: [
1833
+ j ? /* @__PURE__ */ l.jsxs("div", { className: "tm", children: [
1834
1834
  /* @__PURE__ */ l.jsxs("ul", { children: [
1835
1835
  /* @__PURE__ */ l.jsx("li", { children: /* @__PURE__ */ l.jsx("button", { onClick: R, children: "Authorization" }) }),
1836
1836
  /* @__PURE__ */ l.jsx("li", {})
@@ -1862,7 +1862,7 @@ const lr = () => {
1862
1862
  ) })
1863
1863
  ] })
1864
1864
  ] }),
1865
- /* @__PURE__ */ l.jsx("li", { children: /* @__PURE__ */ l.jsx("button", { onClick: () => _(!C), children: "Closed" }) })
1865
+ /* @__PURE__ */ l.jsx("li", { children: /* @__PURE__ */ l.jsx("button", { onClick: () => _(!j), children: "Closed" }) })
1866
1866
  ] })
1867
1867
  ] }) : "",
1868
1868
  h ? /* @__PURE__ */ l.jsx(cr, { setAuthorization: E }) : ""
@@ -1889,7 +1889,7 @@ var re;
1889
1889
  }, r.Notice = (o, i, c) => {
1890
1890
  var v, y;
1891
1891
  i !== void 0 ? (Xe.Send({ type: o, text: i, thema: c }), (v = r.WebApp.HapticFeedback) == null || v.notificationOccurred(o)) : (Xe.Send(o), (y = r.WebApp.HapticFeedback) == null || y.notificationOccurred(o.type));
1892
- }, r.Header = lr, r.Footer = ur, r.BottomSheet = or, r.toggleBottomSheet = qe, r.Modal = wt, r.MainButton = {
1892
+ }, r.Header = lr, r.Footer = ur, r.BottomSheet = or, r.toggleBottomSheet = qe, r.Modal = Ct, r.MainButton = {
1893
1893
  callback: [],
1894
1894
  set: (o) => {
1895
1895
  he.is ? he.MainButton.set(o) : (r.WebApp.MainButton.callback.forEach((i) => {
package/dist/index.umd.js CHANGED
@@ -57,4 +57,4 @@ Check the top-level render call using <`+o+">.")}return t}}function Ye(e,t){{if(
57
57
  <%s {...props} />
58
58
  React keys must be passed directly to JSX without using spread:
59
59
  let props = %s;
60
- <%s key={someKey} {...props} />`,me,N,Ot,N),Je[N+me]=!0}}return e===u?_t(y):kt(y),y}}function wt(e,t,o){return He(e,t,o,!0)}function St(e,t,o){return He(e,t,o,!1)}var Et=St,Rt=wt;Ge.Fragment=u,Ge.jsx=Et,Ge.jsxs=Rt}()),Ge}process.env.NODE_ENV==="production"?Zt():Xt();const Qt="0.0.37",Nt={version:Qt},G={},tt={module:"",v:Nt.version,page:"Main",auth:"Auth",STORAGE:"f",LISTENER:{}};function se(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:typeof global<"u"?global:{}}se().elcrm||(se().elcrm={}),Object.assign(se().elcrm,{router:Nt.version});function Z(r){const n=se();n.ROUTER_PARAMS?n.ROUTER_PARAMS={...n.ROUTER_PARAMS,...r}:n.ROUTER_PARAMS={...tt,...r}}function C(){return se().ROUTER_PARAMS||tt}function be(r){const n=se();n.ROUTER_PARAMS?n.ROUTER_PARAMS.LISTENER={...n.ROUTER_PARAMS.LISTENER,...r}:n.ROUTER_PARAMS.LISTENER={...r}}function X(){return se().ROUTER_PARAMS.LISTENER||tt.LISTENER}var ve;(r=>{function n(){var b;let _=sessionStorage.getItem("f");if(_){if(_=oe.deCode(_),!_)return!1;Z({id:_.id,tab:_.tab,page:_.page,module:_.module,time:_.time,payment:{active:!0},module_admin:_.module_admin})}else Z({id:0,tab:"",page:(b=localStorage.getItem("d"))!=null&&b.length?C().page:C().auth,module:C().module});return!0}function i(){G.id=0,G.tab="",G.page=C().page,G.module=C().module}r.Reset=i;function u({module:b=C().module,page:_=C().page,auth:I=C().auth}){Z({page:_,module:b,auth:I}),n()}r.Default=u;function h(b){let _=U=>(Z({page:U}),U);const[I,D]=w.useState(A()||b&&_(b)||C().page);return be({page:U=>{D(U)}}),I}r.usePage=h;function m(b,_=!0,I={}){Z({page:b,...I}),sessionStorage.setItem(C().STORAGE,oe.enCode(C())),_&&X().page(b)}r.setPage=m;function A(){return C().page}r.getPage=A;function x(b){return C().page===b}r.isPage=x;function g(b,_){const[I,D]=w.useState(d()||b||C().module);return be({module:D}),I}r.useModule=g;function S(b,_=!0){Z({module:b}),sessionStorage.setItem(C().STORAGE,oe.enCode(C())),_&&X().module(b)}r.setModule=S;function d(){return C().module||""}r.getModule=d;function k(b){return C().module===b}r.isModule=k;function P(b,_){if(typeof b!="function"){const[I,D]=w.useState(!_),[U,ae]=w.useState(b||ne());return be({tabs:ae}),_&&w.useEffect(()=>{D(!0)},[]),[U,I]}else be({tabs:b})}r.useTabs=P;async function W(b,_=!0){Z({tab:b}),sessionStorage.setItem(C().STORAGE,oe.enCode(C())),_&&(X().tabs&&X().tabs(b))}r.setTabs=W;function ne(){return C().tab}r.getTabs=ne;function Se(b){return C().tab===b}r.isTabs=Se;function Ee(b){if(typeof b!="function"){const[_,I]=w.useState(b||ye());return be({id:D=>{I(D)}}),_}else be({id:b})}r.useId=Ee;function F(b){}r.subId=F;async function E(b,_=!0){Z({id:b}),sessionStorage.setItem(C().STORAGE,oe.enCode(C())),_&&X().id(b)}r.setId=E;function ye(){return C().id}r.getId=ye;function Re(b){return Number(C().id)===b}r.isId=Re;async function Oe(b){var _,I,D,U,ae,ie,B,M;const{page:$,module:H,tab:q,id:K}=b;$!==void 0&&(G.page=$),H!==void 0&&(G.module=H),q!==void 0&&(G.tab=q),K!==void 0&&(G.id=K),Z({...G}),K!==void 0&&((I=(_=X()).id)==null||I.call(_,K)),q!==void 0&&((U=(D=X()).tabs)==null||U.call(D,q)),H!==void 0&&((ie=(ae=X()).module)==null||ie.call(ae,H)),$!==void 0&&((M=(B=X()).page)==null||M.call(B,$)),sessionStorage.setItem(C().STORAGE,oe.enCode(C()))}r.navigate=Oe})(ve||(ve={}));let Ze={};function er(){const[r,n]=w.useState([]);return Ze.set=i=>{n([...r,i])},Ze.del=i=>{r.forEach((u,h)=>{u.key===i&&r.splice(h,1)}),n(r)},r.length===0?c.jsx(c.Fragment,{}):c.jsx("div",{className:"notice",children:r.map(i=>i.item)})}function tr(r){let n=new Date().getTime();r.key=n,Ze.set({item:c.jsx(rr,{data:r},n),key:n})}function rr(r){const n=r.data;let[i]=w.useState("show"),[u,h]=w.useState(!1);w.useEffect(()=>{setTimeout(function(){h(!0),Ze.del(n.key)},5e3)},[n.key]);let m;switch(n.type){case"error":m=c.jsx("path",{d:"M12 2.25c-5.376 0-9.75 4.374-9.75 9.75s4.374 9.75 9.75 9.75 9.75-4.374 9.75-9.75S17.376 2.25 12 2.25Zm3.53 12.22a.75.75 0 1 1-1.06 1.06L12 13.06l-2.47 2.47a.75.75 0 0 1-1.06-1.06L10.94 12 8.47 9.53a.75.75 0 0 1 1.06-1.06L12 10.94l2.47-2.47a.75.75 0 0 1 1.06 1.06L13.06 12l2.47 2.47Z"});break;case"success":m=c.jsx("path",{d:"M12 2.25c-5.376 0-9.75 4.374-9.75 9.75s4.374 9.75 9.75 9.75 9.75-4.374 9.75-9.75S17.376 2.25 12 2.25Zm5.074 6.482-6.3 7.5a.748.748 0 0 1-.562.268h-.013a.75.75 0 0 1-.557-.248l-2.7-3a.751.751 0 0 1 .88-1.186c.09.045.17.107.234.182l2.123 2.36 5.747-6.84a.75.75 0 0 1 1.148.964Z"});break;case"warning":m=c.jsx("path",{d:"M12 2.625c-5.17 0-9.375 4.206-9.375 9.375 0 5.17 4.206 9.375 9.375 9.375 5.17 0 9.375-4.206 9.375-9.375 0-5.17-4.206-9.375-9.375-9.375Zm0 3.844a1.219 1.219 0 1 1 0 2.437 1.219 1.219 0 0 1 0-2.437Zm2.25 10.593h-4.125a.75.75 0 1 1 0-1.5h1.313v-4.124h-.75a.75.75 0 1 1 0-1.5h1.5a.75.75 0 0 1 .75.75v4.874h1.312a.75.75 0 1 1 0 1.5Z"});break;default:m="icon fa fa-exclamation-circle";break}return c.jsx(c.Fragment,{children:u?c.jsx(c.Fragment,{}):c.jsxs("div",{className:"item "+n.type+` ${n.thema!==void 0?" thema":""}`,"data-status":i,children:[c.jsx("svg",{type:"solid",fill:"currentColor",stroke:"none",strokeWidth:"0",width:"24",height:"24",viewBox:"0 0 24 24",children:m}),c.jsx("span",{className:"text",children:n.text})]})})}let Xe={Send:tr,Init:er},we=()=>{};const or=({children:r,title:n,isOverlay:i=!0})=>{const[u,h]=w.useState(!1);return we=()=>{h(!0),setTimeout(()=>{Ut.onClose()},300)},c.jsx("div",{className:`footer-menu-overlay ${i?"is-overlay":""} ${u?"closing":""}`,onClick:we,children:c.jsxs("div",{className:`footer-menu-popup-book ${u?"closing":""}`,onClick:m=>m.stopPropagation(),children:[c.jsxs("div",{className:"footer-menu-header",children:[c.jsx("h3",{children:n}),c.jsx("button",{className:"footer-menu-close-btn",onClick:we,children:"✕"})]}),r]})})},Wt={h:"_h_rl5ga_1",row:"_row_rl5ga_14",column:"_column_rl5ga_17"},Ut=[],Lt=(r,n)=>r.findIndex(i=>(i==null?void 0:i.page)===n),nr=({actions:r,children:n,className:i,page:u,setPage:h,direction:m="row"})=>{const[A,x]=w.useState(null),[g,S]=w.useState(u?Lt(r||[],u):0);return Ut.onClose=()=>{x(null),S(u?Lt(r||[],u):0)},w.useEffect(()=>{document.addEventListener("blur",()=>{document.querySelector("footer").style.display="flex"}),document.addEventListener("focus",()=>{document.querySelector("footer").style.display="none"})},[]),c.jsxs(c.Fragment,{children:[A,c.jsxs("footer",{className:`${Wt.h} ${Wt[m]} ${i} `,children:[n,r&&r.map((d,k)=>c.jsx("div",{"data-active":g===k?"true":"false",onClick:()=>{d.page&&(S(k),h==null||h(d.page)),d.callback&&(d.callback(),S(k)),d.component&&(g===k?we():(x(d.component),S(k)))},children:d.icon},k))]})]})},le={is:!1,MainButton:{},BackButton:{}};let Y={};Y.dark={"--tg-theme-subtitle-text-color":"#98989e","--tg-theme-destructive-text-color":"#e53935","--tg-theme-section-separator-color":"#545458","--tg-theme-link-color":"#3e88f7","--tg-theme-accent-text-color":"#3e88f7","--tg-theme-bg-color":"#000000","--tg-theme-secondary-bg-color":"#1c1c1d","--tg-theme-button-color":"#3e88f7","--tg-theme-button-text-color":"#ffffff","--tg-theme-bottom-bar-bg-color":"#1d1d1d","--tg-theme-section-header-text-color":"#8d8e93","--tg-theme-header-bg-color":"#1a1a1a","--tg-theme-hint-color":"#98989e","--tg-theme-text-color":"#ffffff","--tg-theme-section-bg-color":"#2c2c2e"},Y.light={"--tg-theme-subtitle-text-color":"#8e8e93","--tg-theme-destructive-text-color":"#ff3b30","--tg-theme-section-separator-color":"#c8c7cc","--tg-theme-link-color":"#007aff","--tg-theme-accent-text-color":"#007aff","--tg-theme-bg-color":"#ffffff","--tg-theme-secondary-bg-color":"#efeff4","--tg-theme-button-color":"#007aff","--tg-theme-button-text-color":"#ffffff","--tg-theme-bottom-bar-bg-color":"#f2f2f2","--tg-theme-section-header-text-color":"#6d6d72","--tg-theme-header-bg-color":"#f8f8f8","--tg-theme-hint-color":"#8e8e93","--tg-theme-text-color":"#000000","--tg-theme-section-bg-color":"#ffffff"},Y.users={"--tg-theme-bg-color":"#000000","--tg-theme-text-color":"#ffffff","--tg-theme-hint-color":"#98989e","--tg-theme-link-color":"#ffffff","--tg-theme-button-color":"#ffffff","--tg-theme-button-text-color":"#000000","--tg-theme-secondary-bg-color":"#000000"};const ar=()=>{if(location.hostname==="localhost"){let[r,n]=w.useState(!1),[i,u]=w.useState(!1),[h,m]=w.useState("dark"),[A,x]=w.useState(!1),[g,S]=w.useState(!1);le.is=!0,le.MainButton.set=n,le.BackButton.set=u,w.useEffect(()=>{Y[h]["--tg-theme-bg-color-alpha"]=Y[h]["--tg-theme-bg-color"]+"b3",Y[h]["--tg-theme-secondary-bg-color-alpha"]=Y[h]["--tg-theme-secondary-bg-color"]+"d3";for(let P in Y[h])document.documentElement.style.setProperty(P,Y[h][P]);j.default.WebApp.safeAreaInset.bottom===0&&document.documentElement.style.setProperty("--tg-safe-area-inset-bottom","16px")},[]);let d=P=>{for(let W in Y[P])document.documentElement.style.setProperty(W,Y[P][W]);m(P),x(!1)},k=()=>{x(!1),S(!0)};return c.jsxs(c.Fragment,{children:[c.jsxs("header",{className:"debug",children:[i===!1?c.jsx("div",{className:"b",children:"Отмена"}):c.jsx("div",{onClick:()=>{var P;i.page===void 0?(P=i.callback)==null||P.call(i):ve.setPage(i.page)},className:"b",children:"Назад"}),c.jsx("div",{className:"o",onClick:()=>x(!A),children:"Меню"})]}),c.jsx(Xe.Init,{}),r&&c.jsx("div",{className:"mb",children:c.jsx("button",{onClick:()=>{r.page&&ve.setPage(r.page),r.callback&&r.callback()},children:r.text})}),A?c.jsxs("div",{className:"tm",children:[c.jsxs("ul",{children:[c.jsx("li",{children:c.jsx("button",{onClick:k,children:"Authorization"})}),c.jsx("li",{})]}),c.jsxs("ul",{children:[c.jsxs("li",{children:[c.jsx("button",{children:"Thema"}),c.jsxs("ol",{children:[c.jsx("li",{children:c.jsx("button",{onClick:()=>d("dark"),children:"Dark"})}),c.jsx("li",{children:c.jsx("button",{onClick:()=>d("light"),children:"Light"})}),c.jsx("li",{children:c.jsx("button",{onClick:()=>d("users"),children:"Users"})})]})]}),c.jsx("li",{children:c.jsx("button",{onClick:()=>x(!A),children:"Closed"})})]})]}):"",g?c.jsx(ir,{setAuthorization:S}):""]})}else return w.useEffect(()=>{document.documentElement.style.setProperty("--tg-theme-secondary-bg-color-alpha",j.default.WebApp.themeParams.secondary_bg_color+"d3"),document.documentElement.style.setProperty("--tg-theme-bg-color-alpha",j.default.WebApp.themeParams.bg_color+"b3"),j.default.WebApp.safeAreaInset.bottom===0&&document.documentElement.style.setProperty("--tg-safe-area-inset-bottom","16px")},[]),c.jsx(c.Fragment,{children:c.jsx(Xe.Init,{})})};j.default=void 0,(r=>{r.WebApp=window.Telegram.WebApp,r.getUser=()=>{var n;return((n=r.WebApp.initDataUnsafe)==null?void 0:n.user)===void 0?{}:r.WebApp.initDataUnsafe},r.Notice=(n,i,u)=>{var h,m;i!==void 0?(Xe.Send({type:n,text:i,thema:u}),(h=r.WebApp.HapticFeedback)==null||h.notificationOccurred(n)):(Xe.Send(n),(m=r.WebApp.HapticFeedback)==null||m.notificationOccurred(n.type))},r.Header=ar,r.Footer=nr,r.BottomSheet=or,r.toggleBottomSheet=we,r.Modal=et,r.MainButton={callback:[],set:n=>{le.is?le.MainButton.set(n):(r.WebApp.MainButton.callback.forEach(i=>{r.WebApp.MainButton.offClick(i)}),r.WebApp.MainButton.callback=[],typeof n=="boolean"?r.WebApp.MainButton.isVisible=!1:(r.WebApp.MainButton.text=n.text,n.color&&(r.WebApp.MainButton.color=n.color),n.textColor&&(r.WebApp.MainButton.textColor=n.textColor),r.WebApp.MainButton.isVisible=!0,r.WebApp.MainButton.isActive=n.isActive===void 0?!0:n.isActive,r.WebApp.MainButton.callback.push(()=>{var i;n.page===void 0?(i=n.callback)==null||i.call(n):ve.setPage(n.page)}),r.WebApp.MainButton.onClick(r.WebApp.MainButton.callback[0])))}},r.BackButton={state:[!1],listen:[],router:n=>{n===!1?(r.WebApp.BackButton.isVisible=!1,r.WebApp.BackButton.offClick(r.BackButton.listen[0]),r.BackButton.listen.shift(),r.WebApp.BackButton.state.length!==1&&r.WebApp.BackButton.state.pop()):(r.WebApp.BackButton.isVisible=!0,r.WebApp.BackButton.offClick(r.BackButton.listen[0]),r.BackButton.listen.shift(),r.BackButton.listen.push(()=>{var u;let i=r.WebApp.BackButton.state.pop();i.page!==void 0?ve.setPage(i.page):(u=i.callback)==null||u.call(i)}),r.WebApp.BackButton.onClick(r.BackButton.listen[0]))},set:n=>{le.is?le.BackButton.set(n):(r.BackButton.state.push(n),r.BackButton.router(n))}}})(j.default||(j.default={}));const ir=({setAuthorization:r})=>{let n={},i=()=>{localStorage.setItem("auth",n)};return c.jsx("div",{className:"ta",children:c.jsxs("div",{className:"--body",children:[c.jsx("fieldset",{}),c.jsx("div",{onClick:i,children:" Сохранить "})]})})},{Header:sr,Footer:lr,toggleBottomSheet:cr,Modal:ur,MainButton:fr,BackButton:dr,BottomSheet:pr,WebApp:hr,getUser:gr,Notice:mr}=j.default;j.BackButton=dr,j.BottomSheet=pr,j.Footer=lr,j.Header=sr,j.MainButton=fr,j.Modal=ur,j.Notice=mr,j.WebApp=hr,j.getUser=gr,j.toggleBottomSheet=cr,Object.defineProperties(j,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
60
+ <%s key={someKey} {...props} />`,me,N,Ot,N),Je[N+me]=!0}}return e===u?_t(y):kt(y),y}}function wt(e,t,o){return He(e,t,o,!0)}function St(e,t,o){return He(e,t,o,!1)}var Et=St,Rt=wt;Ge.Fragment=u,Ge.jsx=Et,Ge.jsxs=Rt}()),Ge}process.env.NODE_ENV==="production"?Zt():Xt();const Qt="0.0.37",Nt={version:Qt},G={},tt={module:"",v:Nt.version,page:"Main",auth:"Auth",STORAGE:"f",LISTENER:{}};function se(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:typeof global<"u"?global:{}}se().elcrm||(se().elcrm={}),Object.assign(se().elcrm,{router:Nt.version});function Z(r){const n=se();n.ROUTER_PARAMS?n.ROUTER_PARAMS={...n.ROUTER_PARAMS,...r}:n.ROUTER_PARAMS={...tt,...r}}function C(){return se().ROUTER_PARAMS||tt}function be(r){const n=se();n.ROUTER_PARAMS?n.ROUTER_PARAMS.LISTENER={...n.ROUTER_PARAMS.LISTENER,...r}:n.ROUTER_PARAMS.LISTENER={...r}}function X(){return se().ROUTER_PARAMS.LISTENER||tt.LISTENER}var ve;(r=>{function n(){var b;let _=sessionStorage.getItem("f");if(_){if(_=oe.deCode(_),!_)return!1;Z({id:_.id,tab:_.tab,page:_.page,module:_.module,time:_.time,payment:{active:!0},module_admin:_.module_admin})}else Z({id:0,tab:"",page:(b=localStorage.getItem("d"))!=null&&b.length?C().page:C().auth,module:C().module});return!0}function i(){G.id=0,G.tab="",G.page=C().page,G.module=C().module}r.Reset=i;function u({module:b=C().module,page:_=C().page,auth:I=C().auth}){Z({page:_,module:b,auth:I}),n()}r.Default=u;function h(b){let _=U=>(Z({page:U}),U);const[I,D]=w.useState(A()||b&&_(b)||C().page);return be({page:U=>{D(U)}}),I}r.usePage=h;function m(b,_=!0,I={}){Z({page:b,...I}),sessionStorage.setItem(C().STORAGE,oe.enCode(C())),_&&X().page(b)}r.setPage=m;function A(){return C().page}r.getPage=A;function x(b){return C().page===b}r.isPage=x;function g(b,_){const[I,D]=w.useState(d()||b||C().module);return be({module:D}),I}r.useModule=g;function S(b,_=!0){Z({module:b}),sessionStorage.setItem(C().STORAGE,oe.enCode(C())),_&&X().module(b)}r.setModule=S;function d(){return C().module||""}r.getModule=d;function k(b){return C().module===b}r.isModule=k;function P(b,_){if(typeof b!="function"){const[I,D]=w.useState(!_),[U,ae]=w.useState(b||ne());return be({tabs:ae}),_&&w.useEffect(()=>{D(!0)},[]),[U,I]}else be({tabs:b})}r.useTabs=P;async function W(b,_=!0){Z({tab:b}),sessionStorage.setItem(C().STORAGE,oe.enCode(C())),_&&(X().tabs&&X().tabs(b))}r.setTabs=W;function ne(){return C().tab}r.getTabs=ne;function Se(b){return C().tab===b}r.isTabs=Se;function Ee(b){if(typeof b!="function"){const[_,I]=w.useState(b||ye());return be({id:D=>{I(D)}}),_}else be({id:b})}r.useId=Ee;function F(b){}r.subId=F;async function E(b,_=!0){Z({id:b}),sessionStorage.setItem(C().STORAGE,oe.enCode(C())),_&&X().id(b)}r.setId=E;function ye(){return C().id}r.getId=ye;function Re(b){return Number(C().id)===b}r.isId=Re;async function Oe(b){var _,I,D,U,ae,ie,B,M;const{page:$,module:H,tab:q,id:K}=b;$!==void 0&&(G.page=$),H!==void 0&&(G.module=H),q!==void 0&&(G.tab=q),K!==void 0&&(G.id=K),Z({...G}),K!==void 0&&((I=(_=X()).id)==null||I.call(_,K)),q!==void 0&&((U=(D=X()).tabs)==null||U.call(D,q)),H!==void 0&&((ie=(ae=X()).module)==null||ie.call(ae,H)),$!==void 0&&((M=(B=X()).page)==null||M.call(B,$)),sessionStorage.setItem(C().STORAGE,oe.enCode(C()))}r.navigate=Oe})(ve||(ve={}));let Ze={};function er(){const[r,n]=w.useState([]);return Ze.set=i=>{n([...r,i])},Ze.del=i=>{r.forEach((u,h)=>{u.key===i&&r.splice(h,1)}),n(r)},r.length===0?c.jsx(c.Fragment,{}):c.jsx("div",{className:"notice",children:r.map(i=>i.item)})}function tr(r){let n=new Date().getTime();r.key=n,Ze.set({item:c.jsx(rr,{data:r},n),key:n})}function rr(r){const n=r.data;let[i]=w.useState("show"),[u,h]=w.useState(!1);w.useEffect(()=>{setTimeout(function(){h(!0),Ze.del(n.key)},5e3)},[n.key]);let m;switch(n.type){case"error":m=c.jsx("path",{d:"M12 2.25c-5.376 0-9.75 4.374-9.75 9.75s4.374 9.75 9.75 9.75 9.75-4.374 9.75-9.75S17.376 2.25 12 2.25Zm3.53 12.22a.75.75 0 1 1-1.06 1.06L12 13.06l-2.47 2.47a.75.75 0 0 1-1.06-1.06L10.94 12 8.47 9.53a.75.75 0 0 1 1.06-1.06L12 10.94l2.47-2.47a.75.75 0 0 1 1.06 1.06L13.06 12l2.47 2.47Z"});break;case"success":m=c.jsx("path",{d:"M12 2.25c-5.376 0-9.75 4.374-9.75 9.75s4.374 9.75 9.75 9.75 9.75-4.374 9.75-9.75S17.376 2.25 12 2.25Zm5.074 6.482-6.3 7.5a.748.748 0 0 1-.562.268h-.013a.75.75 0 0 1-.557-.248l-2.7-3a.751.751 0 0 1 .88-1.186c.09.045.17.107.234.182l2.123 2.36 5.747-6.84a.75.75 0 0 1 1.148.964Z"});break;case"warning":m=c.jsx("path",{d:"M12 2.625c-5.17 0-9.375 4.206-9.375 9.375 0 5.17 4.206 9.375 9.375 9.375 5.17 0 9.375-4.206 9.375-9.375 0-5.17-4.206-9.375-9.375-9.375Zm0 3.844a1.219 1.219 0 1 1 0 2.437 1.219 1.219 0 0 1 0-2.437Zm2.25 10.593h-4.125a.75.75 0 1 1 0-1.5h1.313v-4.124h-.75a.75.75 0 1 1 0-1.5h1.5a.75.75 0 0 1 .75.75v4.874h1.312a.75.75 0 1 1 0 1.5Z"});break;default:m="icon fa fa-exclamation-circle";break}return c.jsx(c.Fragment,{children:u?c.jsx(c.Fragment,{}):c.jsxs("div",{className:"item "+n.type+` ${n.thema!==void 0?" thema":""}`,"data-status":i,children:[c.jsx("svg",{type:"solid",fill:"currentColor",stroke:"none",strokeWidth:"0",width:"24",height:"24",viewBox:"0 0 24 24",children:m}),c.jsx("span",{className:"text",children:n.text})]})})}let Xe={Send:tr,Init:er},we=()=>{};const or=({children:r,title:n,isOverlay:i=!0})=>{const[u,h]=w.useState(!1);return we=()=>{h(!0),setTimeout(()=>{Ut.onClose()},300)},c.jsx("div",{className:`footer-menu-overlay ${i?"is-overlay":""} ${u?"closing":""}`,onClick:we,children:c.jsxs("div",{className:`footer-menu-popup-book ${u?"closing":""}`,onClick:m=>m.stopPropagation(),children:[c.jsxs("div",{className:"footer-menu-header",children:[c.jsx("h3",{children:n}),c.jsx("button",{className:"footer-menu-close-btn",onClick:we,children:"✕"})]}),r]})})},Wt={h:"_h_rl5ga_1",row:"_row_rl5ga_14",column:"_column_rl5ga_17"},Ut=[],Lt=(r,n)=>r.findIndex(i=>(i==null?void 0:i.page)===n),nr=({actions:r,children:n,className:i,page:u,onPageChange:h,direction:m="row"})=>{const[A,x]=w.useState(null),[g,S]=w.useState(u?Lt(r||[],u):0);return Ut.onClose=()=>{x(null),S(u?Lt(r||[],u):0)},w.useEffect(()=>{document.addEventListener("blur",()=>{document.querySelector("footer").style.display="flex"}),document.addEventListener("focus",()=>{document.querySelector("footer").style.display="none"})},[]),c.jsxs(c.Fragment,{children:[A,c.jsxs("footer",{className:`${Wt.h} ${Wt[m]} ${i} `,children:[n,r&&r.map((d,k)=>c.jsx("div",{"data-active":g===k?"true":"false",onClick:()=>{d.page&&(S(k),h==null||h(d.page)),d.callback&&(d.callback(),S(k)),d.component&&(g===k?we():(x(d.component),S(k)))},children:d.icon},k))]})]})},le={is:!1,MainButton:{},BackButton:{}};let Y={};Y.dark={"--tg-theme-subtitle-text-color":"#98989e","--tg-theme-destructive-text-color":"#e53935","--tg-theme-section-separator-color":"#545458","--tg-theme-link-color":"#3e88f7","--tg-theme-accent-text-color":"#3e88f7","--tg-theme-bg-color":"#000000","--tg-theme-secondary-bg-color":"#1c1c1d","--tg-theme-button-color":"#3e88f7","--tg-theme-button-text-color":"#ffffff","--tg-theme-bottom-bar-bg-color":"#1d1d1d","--tg-theme-section-header-text-color":"#8d8e93","--tg-theme-header-bg-color":"#1a1a1a","--tg-theme-hint-color":"#98989e","--tg-theme-text-color":"#ffffff","--tg-theme-section-bg-color":"#2c2c2e"},Y.light={"--tg-theme-subtitle-text-color":"#8e8e93","--tg-theme-destructive-text-color":"#ff3b30","--tg-theme-section-separator-color":"#c8c7cc","--tg-theme-link-color":"#007aff","--tg-theme-accent-text-color":"#007aff","--tg-theme-bg-color":"#ffffff","--tg-theme-secondary-bg-color":"#efeff4","--tg-theme-button-color":"#007aff","--tg-theme-button-text-color":"#ffffff","--tg-theme-bottom-bar-bg-color":"#f2f2f2","--tg-theme-section-header-text-color":"#6d6d72","--tg-theme-header-bg-color":"#f8f8f8","--tg-theme-hint-color":"#8e8e93","--tg-theme-text-color":"#000000","--tg-theme-section-bg-color":"#ffffff"},Y.users={"--tg-theme-bg-color":"#000000","--tg-theme-text-color":"#ffffff","--tg-theme-hint-color":"#98989e","--tg-theme-link-color":"#ffffff","--tg-theme-button-color":"#ffffff","--tg-theme-button-text-color":"#000000","--tg-theme-secondary-bg-color":"#000000"};const ar=()=>{if(location.hostname==="localhost"){let[r,n]=w.useState(!1),[i,u]=w.useState(!1),[h,m]=w.useState("dark"),[A,x]=w.useState(!1),[g,S]=w.useState(!1);le.is=!0,le.MainButton.set=n,le.BackButton.set=u,w.useEffect(()=>{Y[h]["--tg-theme-bg-color-alpha"]=Y[h]["--tg-theme-bg-color"]+"b3",Y[h]["--tg-theme-secondary-bg-color-alpha"]=Y[h]["--tg-theme-secondary-bg-color"]+"d3";for(let P in Y[h])document.documentElement.style.setProperty(P,Y[h][P]);j.default.WebApp.safeAreaInset.bottom===0&&document.documentElement.style.setProperty("--tg-safe-area-inset-bottom","16px")},[]);let d=P=>{for(let W in Y[P])document.documentElement.style.setProperty(W,Y[P][W]);m(P),x(!1)},k=()=>{x(!1),S(!0)};return c.jsxs(c.Fragment,{children:[c.jsxs("header",{className:"debug",children:[i===!1?c.jsx("div",{className:"b",children:"Отмена"}):c.jsx("div",{onClick:()=>{var P;i.page===void 0?(P=i.callback)==null||P.call(i):ve.setPage(i.page)},className:"b",children:"Назад"}),c.jsx("div",{className:"o",onClick:()=>x(!A),children:"Меню"})]}),c.jsx(Xe.Init,{}),r&&c.jsx("div",{className:"mb",children:c.jsx("button",{onClick:()=>{r.page&&ve.setPage(r.page),r.callback&&r.callback()},children:r.text})}),A?c.jsxs("div",{className:"tm",children:[c.jsxs("ul",{children:[c.jsx("li",{children:c.jsx("button",{onClick:k,children:"Authorization"})}),c.jsx("li",{})]}),c.jsxs("ul",{children:[c.jsxs("li",{children:[c.jsx("button",{children:"Thema"}),c.jsxs("ol",{children:[c.jsx("li",{children:c.jsx("button",{onClick:()=>d("dark"),children:"Dark"})}),c.jsx("li",{children:c.jsx("button",{onClick:()=>d("light"),children:"Light"})}),c.jsx("li",{children:c.jsx("button",{onClick:()=>d("users"),children:"Users"})})]})]}),c.jsx("li",{children:c.jsx("button",{onClick:()=>x(!A),children:"Closed"})})]})]}):"",g?c.jsx(ir,{setAuthorization:S}):""]})}else return w.useEffect(()=>{document.documentElement.style.setProperty("--tg-theme-secondary-bg-color-alpha",j.default.WebApp.themeParams.secondary_bg_color+"d3"),document.documentElement.style.setProperty("--tg-theme-bg-color-alpha",j.default.WebApp.themeParams.bg_color+"b3"),j.default.WebApp.safeAreaInset.bottom===0&&document.documentElement.style.setProperty("--tg-safe-area-inset-bottom","16px")},[]),c.jsx(c.Fragment,{children:c.jsx(Xe.Init,{})})};j.default=void 0,(r=>{r.WebApp=window.Telegram.WebApp,r.getUser=()=>{var n;return((n=r.WebApp.initDataUnsafe)==null?void 0:n.user)===void 0?{}:r.WebApp.initDataUnsafe},r.Notice=(n,i,u)=>{var h,m;i!==void 0?(Xe.Send({type:n,text:i,thema:u}),(h=r.WebApp.HapticFeedback)==null||h.notificationOccurred(n)):(Xe.Send(n),(m=r.WebApp.HapticFeedback)==null||m.notificationOccurred(n.type))},r.Header=ar,r.Footer=nr,r.BottomSheet=or,r.toggleBottomSheet=we,r.Modal=et,r.MainButton={callback:[],set:n=>{le.is?le.MainButton.set(n):(r.WebApp.MainButton.callback.forEach(i=>{r.WebApp.MainButton.offClick(i)}),r.WebApp.MainButton.callback=[],typeof n=="boolean"?r.WebApp.MainButton.isVisible=!1:(r.WebApp.MainButton.text=n.text,n.color&&(r.WebApp.MainButton.color=n.color),n.textColor&&(r.WebApp.MainButton.textColor=n.textColor),r.WebApp.MainButton.isVisible=!0,r.WebApp.MainButton.isActive=n.isActive===void 0?!0:n.isActive,r.WebApp.MainButton.callback.push(()=>{var i;n.page===void 0?(i=n.callback)==null||i.call(n):ve.setPage(n.page)}),r.WebApp.MainButton.onClick(r.WebApp.MainButton.callback[0])))}},r.BackButton={state:[!1],listen:[],router:n=>{n===!1?(r.WebApp.BackButton.isVisible=!1,r.WebApp.BackButton.offClick(r.BackButton.listen[0]),r.BackButton.listen.shift(),r.WebApp.BackButton.state.length!==1&&r.WebApp.BackButton.state.pop()):(r.WebApp.BackButton.isVisible=!0,r.WebApp.BackButton.offClick(r.BackButton.listen[0]),r.BackButton.listen.shift(),r.BackButton.listen.push(()=>{var u;let i=r.WebApp.BackButton.state.pop();i.page!==void 0?ve.setPage(i.page):(u=i.callback)==null||u.call(i)}),r.WebApp.BackButton.onClick(r.BackButton.listen[0]))},set:n=>{le.is?le.BackButton.set(n):(r.BackButton.state.push(n),r.BackButton.router(n))}}})(j.default||(j.default={}));const ir=({setAuthorization:r})=>{let n={},i=()=>{localStorage.setItem("auth",n)};return c.jsx("div",{className:"ta",children:c.jsxs("div",{className:"--body",children:[c.jsx("fieldset",{}),c.jsx("div",{onClick:i,children:" Сохранить "})]})})},{Header:sr,Footer:lr,toggleBottomSheet:cr,Modal:ur,MainButton:fr,BackButton:dr,BottomSheet:pr,WebApp:hr,getUser:gr,Notice:mr}=j.default;j.BackButton=dr,j.BottomSheet=pr,j.Footer=lr,j.Header=sr,j.MainButton=fr,j.Modal=ur,j.Notice=mr,j.WebApp=hr,j.getUser=gr,j.toggleBottomSheet=cr,Object.defineProperties(j,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elcrm/telegram",
3
- "version": "0.0.68",
3
+ "version": "0.0.69",
4
4
  "description": "plugin for elCRM to work with telegram",
5
5
  "type": "module",
6
6
  "author": "MaSkal <dev@elcrm.online>",