@tma.js/sdk-react 2.2.5 → 2.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { jsx as Rt } from "react/jsx-runtime";
2
- import { createContext as re, useContext as ie, useState as rt, useEffect as R, useRef as bt, useCallback as oe, useMemo as ae } from "react";
1
+ import { jsx as xt } from "react/jsx-runtime";
2
+ import { createContext as re, useContext as ie, useState as rt, useEffect as x, useRef as bt, useCallback as oe, useMemo as ae } from "react";
3
3
  var ce = Object.defineProperty, he = (e, t, s) => t in e ? ce(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, c = (e, t, s) => he(e, typeof t != "symbol" ? t + "" : t, s);
4
- function xt(e, t) {
4
+ function Rt(e, t) {
5
5
  let s;
6
6
  const n = () => {
7
7
  s !== void 0 && t && t(s), s = void 0;
@@ -158,12 +158,12 @@ class W extends Error {
158
158
  super(s, { cause: n }), this.type = t, Object.setPrototypeOf(this, W.prototype);
159
159
  }
160
160
  }
161
- function m(e, t, s) {
161
+ function b(e, t, s) {
162
162
  return new W(e, t, s);
163
163
  }
164
164
  const _e = "ERR_METHOD_UNSUPPORTED", we = "ERR_METHOD_PARAMETER_UNSUPPORTED", ge = "ERR_UNKNOWN_ENV", fe = "ERR_INVOKE_CUSTOM_METHOD_RESPONSE", me = "ERR_TIMED_OUT", be = "ERR_UNEXPECTED_TYPE", St = "ERR_PARSE", ve = "ERR_NAVIGATION_LIST_EMPTY", ye = "ERR_NAVIGATION_CURSOR_INVALID", dn = "ERR_NAVIGATION_ITEM_INVALID", _n = "ERR_SSR_INIT", Ee = "ERR_INVALID_PATH_BASE";
165
165
  function T() {
166
- return m(be, "Value has unexpected type");
166
+ return b(be, "Value has unexpected type");
167
167
  }
168
168
  class G {
169
169
  constructor(t, s, n) {
@@ -180,7 +180,7 @@ class G {
180
180
  try {
181
181
  return this.parser(t);
182
182
  } catch (s) {
183
- throw m(
183
+ throw b(
184
184
  St,
185
185
  `Unable to parse value${this.type ? ` as ${this.type}` : ""}`,
186
186
  s
@@ -221,7 +221,7 @@ function Tt(e, t) {
221
221
  const a = o(t(i));
222
222
  a !== void 0 && (s[n] = a);
223
223
  } catch (a) {
224
- throw m(St, `Unable to parse field "${n}"`, a);
224
+ throw b(St, `Unable to parse field "${n}"`, a);
225
225
  }
226
226
  }
227
227
  return s;
@@ -238,7 +238,7 @@ function w(e, t) {
238
238
  return Tt(e, (r) => n[r]);
239
239
  }, !1, t);
240
240
  }
241
- const x = A((e) => {
241
+ const R = A((e) => {
242
242
  if (typeof e == "number")
243
243
  return e;
244
244
  if (typeof e == "string") {
@@ -283,7 +283,7 @@ function kt(e) {
283
283
  eventData: (t) => t
284
284
  }).parse(e);
285
285
  }
286
- function Re() {
286
+ function xe() {
287
287
  ["TelegramGameProxy_receiveEvent", "TelegramGameProxy", "Telegram"].forEach((e) => {
288
288
  delete window[e];
289
289
  });
@@ -295,7 +295,7 @@ function et(e, t) {
295
295
  source: window.parent
296
296
  }));
297
297
  }
298
- function xe() {
298
+ function Re() {
299
299
  [
300
300
  ["TelegramGameProxy_receiveEvent"],
301
301
  // Windows Phone.
@@ -341,8 +341,8 @@ const Ce = {
341
341
  }
342
342
  }),
343
343
  viewport_changed: w({
344
- height: x(),
345
- width: (e) => e == null ? window.innerWidth : x().parse(e),
344
+ height: R(),
345
+ width: (e) => e == null ? window.innerWidth : R().parse(e),
346
346
  is_state_stable: E(),
347
347
  is_expanded: E()
348
348
  }),
@@ -352,10 +352,10 @@ function Se() {
352
352
  const e = new D(), t = new D();
353
353
  t.subscribe((n) => {
354
354
  e.emit("event", { name: n.event, payload: n.args[0] });
355
- }), xe();
355
+ }), Re();
356
356
  const [, s] = ot(
357
357
  // Don't forget to remove created handlers.
358
- Re,
358
+ xe,
359
359
  // Add "resize" event listener to make sure, we always have fresh viewport information.
360
360
  // Desktop version of Telegram is sometimes not sending the viewport_changed
361
361
  // event. For example, when the MainButton is shown. That's why we should
@@ -410,7 +410,7 @@ function Se() {
410
410
  }
411
411
  }, s];
412
412
  }
413
- const [Te, Ae] = xt(
413
+ const [Te, Ae] = Rt(
414
414
  (e) => {
415
415
  const [t, s] = Se(), n = t.off.bind(t);
416
416
  return t.off = (r, i) => {
@@ -441,15 +441,21 @@ function Ie(e, t) {
441
441
  }
442
442
  return 0;
443
443
  }
444
- function v(e, t) {
444
+ function m(e, t) {
445
445
  return Ie(e, t) <= 0;
446
446
  }
447
447
  function C(e, t, s) {
448
448
  if (typeof s == "string") {
449
- if (e === "web_app_open_link" && t === "try_instant_view")
450
- return v("6.4", s);
449
+ if (e === "web_app_open_link") {
450
+ if (t === "try_instant_view")
451
+ return m("6.4", s);
452
+ if (t === "try_browser")
453
+ return m("7.6", s);
454
+ }
451
455
  if (e === "web_app_set_header_color" && t === "color")
452
- return v("6.9", s);
456
+ return m("6.9", s);
457
+ if (e === "web_app_close" && t === "return_back")
458
+ return m("7.6", s);
453
459
  }
454
460
  switch (e) {
455
461
  case "web_app_open_tg_link":
@@ -458,27 +464,27 @@ function C(e, t, s) {
458
464
  case "web_app_set_background_color":
459
465
  case "web_app_set_header_color":
460
466
  case "web_app_trigger_haptic_feedback":
461
- return v("6.1", t);
467
+ return m("6.1", t);
462
468
  case "web_app_open_popup":
463
- return v("6.2", t);
469
+ return m("6.2", t);
464
470
  case "web_app_close_scan_qr_popup":
465
471
  case "web_app_open_scan_qr_popup":
466
472
  case "web_app_read_text_from_clipboard":
467
- return v("6.4", t);
473
+ return m("6.4", t);
468
474
  case "web_app_switch_inline_query":
469
- return v("6.7", t);
475
+ return m("6.7", t);
470
476
  case "web_app_invoke_custom_method":
471
477
  case "web_app_request_write_access":
472
478
  case "web_app_request_phone":
473
- return v("6.9", t);
479
+ return m("6.9", t);
474
480
  case "web_app_setup_settings_button":
475
- return v("6.10", t);
481
+ return m("6.10", t);
476
482
  case "web_app_biometry_get_info":
477
483
  case "web_app_biometry_open_settings":
478
484
  case "web_app_biometry_request_access":
479
485
  case "web_app_biometry_request_auth":
480
486
  case "web_app_biometry_update_token":
481
- return v("7.2", t);
487
+ return m("7.2", t);
482
488
  default:
483
489
  return [
484
490
  "iframe_ready",
@@ -531,7 +537,7 @@ function B(e, t, s) {
531
537
  window.TelegramWebviewProxy.postEvent(e, JSON.stringify(r));
532
538
  return;
533
539
  }
534
- throw m(
540
+ throw b(
535
541
  ge,
536
542
  "Unable to determine current environment and possible way to send event. You are probably trying to use Mini Apps method outside of Telegram application environment."
537
543
  );
@@ -539,11 +545,11 @@ function B(e, t, s) {
539
545
  function qe(e) {
540
546
  return (t, s) => {
541
547
  if (!C(t, e))
542
- throw m(_e, `Method "${t}" is unsupported in Mini Apps version ${e}`);
548
+ throw b(_e, `Method "${t}" is unsupported in Mini Apps version ${e}`);
543
549
  if (V(s)) {
544
550
  let n;
545
551
  if (t === "web_app_open_link" && "try_instant_view" in s ? n = "try_instant_view" : t === "web_app_set_header_color" && "color" in s && (n = "color"), n && !C(t, n, e))
546
- throw m(
552
+ throw b(
547
553
  we,
548
554
  `Parameter "${n}" of "${t}" method is unsupported in Mini Apps version ${e}`
549
555
  );
@@ -555,7 +561,7 @@ function Dt(e) {
555
561
  return ({ req_id: t }) => t === e;
556
562
  }
557
563
  function Bt(e) {
558
- return m(me, `Timeout reached: ${e}ms`);
564
+ return b(me, `Timeout reached: ${e}ms`);
559
565
  }
560
566
  function Mt(e, t) {
561
567
  return Promise.race([
@@ -598,7 +604,7 @@ async function O(e, t, s, n = {}) {
598
604
  capture: Dt(s)
599
605
  });
600
606
  if (i)
601
- throw m(fe, i);
607
+ throw b(fe, i);
602
608
  return r;
603
609
  }
604
610
  function st(...e) {
@@ -689,7 +695,7 @@ class Ne extends ut {
689
695
  this.isVisible = !0;
690
696
  }
691
697
  }
692
- const $t = A((e) => e instanceof Date ? e : new Date(x().parse(e) * 1e3), "Date");
698
+ const $t = A((e) => e instanceof Date ? e : new Date(R().parse(e) * 1e3), "Date");
693
699
  function lt(e, t) {
694
700
  return new G((s) => {
695
701
  if (typeof s != "string" && !(s instanceof URLSearchParams))
@@ -702,7 +708,7 @@ function lt(e, t) {
702
708
  }, !1, t);
703
709
  }
704
710
  const De = w({
705
- id: x(),
711
+ id: R(),
706
712
  type: h(),
707
713
  title: h(),
708
714
  photoUrl: {
@@ -723,7 +729,7 @@ const De = w({
723
729
  type: h(),
724
730
  from: "first_name"
725
731
  },
726
- id: x(),
732
+ id: R(),
727
733
  isBot: {
728
734
  type: E().optional(),
729
735
  from: "is_bot"
@@ -746,14 +752,14 @@ const De = w({
746
752
  },
747
753
  username: h().optional()
748
754
  }, "User").optional();
749
- function Ut() {
755
+ function Ht() {
750
756
  return lt({
751
757
  authDate: {
752
758
  type: $t(),
753
759
  from: "auth_date"
754
760
  },
755
761
  canSendAfter: {
756
- type: x().optional(),
762
+ type: R().optional(),
757
763
  from: "can_send_after"
758
764
  },
759
765
  chat: De,
@@ -784,7 +790,7 @@ function Be(e) {
784
790
  function Me(e) {
785
791
  return e.replace(/[A-Z]/g, (t) => `_${t.toLowerCase()}`);
786
792
  }
787
- const Ht = A(
793
+ const Ut = A(
788
794
  (e) => {
789
795
  const t = It().optional();
790
796
  return Object.entries(at(e)).reduce((s, [n, r]) => (s[Be(n)] = t.parse(r), s), {});
@@ -798,7 +804,7 @@ function dt(e) {
798
804
  from: "tgWebAppBotInline"
799
805
  },
800
806
  initData: {
801
- type: Ut().optional(),
807
+ type: Ht().optional(),
802
808
  from: "tgWebAppData"
803
809
  },
804
810
  initDataRaw: {
@@ -818,7 +824,7 @@ function dt(e) {
818
824
  from: "tgWebAppStartParam"
819
825
  },
820
826
  themeParams: {
821
- type: Ht(),
827
+ type: Ut(),
822
828
  from: "tgWebAppThemeParams"
823
829
  },
824
830
  version: {
@@ -867,7 +873,7 @@ function Jt(e) {
867
873
  )
868
874
  );
869
875
  }
870
- function Ue(e) {
876
+ function He(e) {
871
877
  const {
872
878
  initDataRaw: t,
873
879
  themeParams: s,
@@ -880,7 +886,7 @@ function Ue(e) {
880
886
  return p.set("tgWebAppPlatform", n), p.set("tgWebAppThemeParams", Jt(s)), p.set("tgWebAppVersion", r), t && p.set("tgWebAppData", t), o && p.set("tgWebAppStartParam", o), typeof i == "boolean" && p.set("tgWebAppShowSettings", i ? "1" : "0"), typeof a == "boolean" && p.set("tgWebAppBotInline", a ? "1" : "0"), p.toString();
881
887
  }
882
888
  function Ft(e) {
883
- zt("launchParams", Ue(e));
889
+ zt("launchParams", He(e));
884
890
  }
885
891
  function nt() {
886
892
  for (const e of [
@@ -903,11 +909,11 @@ function Qt() {
903
909
  const e = Gt();
904
910
  return !!(e && e.type === "reload");
905
911
  }
906
- function He() {
912
+ function Ue() {
907
913
  let e = 0;
908
914
  return () => (e += 1).toString();
909
915
  }
910
- const [We] = xt(He);
916
+ const [We] = Rt(Ue);
911
917
  function l(e, t) {
912
918
  return () => {
913
919
  const s = nt(), n = {
@@ -1365,7 +1371,7 @@ const rs = l(
1365
1371
  ({ initData: e }) => e ? new ns(e) : void 0
1366
1372
  );
1367
1373
  function fn(e) {
1368
- return Ut().parse(e);
1374
+ return Ht().parse(e);
1369
1375
  }
1370
1376
  class is extends L {
1371
1377
  constructor(t, s, n) {
@@ -1564,7 +1570,7 @@ function hs() {
1564
1570
  return lt({
1565
1571
  contact: w({
1566
1572
  userId: {
1567
- type: x(),
1573
+ type: R(),
1568
1574
  from: "user_id"
1569
1575
  },
1570
1576
  phoneNumber: {
@@ -1867,7 +1873,7 @@ class gs extends L {
1867
1873
  }), this.postEvent = n;
1868
1874
  }
1869
1875
  /**
1870
- * Closes scanner.
1876
+ * Closes the scanner.
1871
1877
  */
1872
1878
  close() {
1873
1879
  this.postEvent("web_app_close_scan_qr_popup"), this.isOpened = !1;
@@ -1876,14 +1882,14 @@ class gs extends L {
1876
1882
  this.set("isOpened", t);
1877
1883
  }
1878
1884
  /**
1879
- * Returns true in case, QR scanner is currently opened.
1885
+ * Returns true if the scanner is currently opened.
1880
1886
  */
1881
1887
  get isOpened() {
1882
1888
  return this.get("isOpened");
1883
1889
  }
1884
1890
  async open(t) {
1885
1891
  if (this.isOpened)
1886
- throw new Error("QR scanner is already opened.");
1892
+ throw new Error("The scanner is already opened");
1887
1893
  const { text: s, capture: n } = (typeof t == "string" ? { text: t } : t) || {};
1888
1894
  this.isOpened = !0;
1889
1895
  try {
@@ -1897,10 +1903,11 @@ class gs extends L {
1897
1903
  }
1898
1904
  }) || {}).data || null;
1899
1905
  return r && this.close(), r;
1900
- } catch (r) {
1901
- throw this.isOpened = !1, r;
1906
+ } finally {
1907
+ this.isOpened = !1;
1902
1908
  }
1903
1909
  }
1910
+ // TODO: Streaming mode, allowing to scan several QRs until closed.
1904
1911
  }
1905
1912
  const fs = l(
1906
1913
  ({ version: e, postEvent: t }) => new gs(!1, e, t)
@@ -1943,7 +1950,7 @@ const bs = l(
1943
1950
  }) => new ms(s.isVisible, e, t)
1944
1951
  );
1945
1952
  function Xt(e) {
1946
- return Ht().parse(e);
1953
+ return Ut().parse(e);
1947
1954
  }
1948
1955
  class vs extends _t {
1949
1956
  /**
@@ -2004,6 +2011,12 @@ class vs extends _t {
2004
2011
  get sectionHeaderTextColor() {
2005
2012
  return this.get("sectionHeaderTextColor");
2006
2013
  }
2014
+ /**
2015
+ * @since v7.6
2016
+ */
2017
+ get sectionSeparatorColor() {
2018
+ return this.get("sectionHeaderTextColor");
2019
+ }
2007
2020
  /**
2008
2021
  * Starts listening to the external theme changes and applies them.
2009
2022
  * @returns Function to stop listening.
@@ -2131,7 +2144,7 @@ async function te(e = {}) {
2131
2144
  function q(e) {
2132
2145
  return e < 0 ? 0 : e;
2133
2146
  }
2134
- class Rs extends _t {
2147
+ class xs extends _t {
2135
2148
  constructor({ postEvent: t, stableHeight: s, height: n, width: r, isExpanded: i }) {
2136
2149
  super({
2137
2150
  height: q(n),
@@ -2238,7 +2251,7 @@ class Rs extends _t {
2238
2251
  return this.stableHeight === this.height;
2239
2252
  }
2240
2253
  }
2241
- const xs = l(
2254
+ const Rs = l(
2242
2255
  "viewport",
2243
2256
  async ({ state: e, platform: t, postEvent: s, addCleanup: n }) => {
2244
2257
  let r = !1, i = 0, o = 0, a = 0;
@@ -2250,7 +2263,7 @@ const xs = l(
2250
2263
  const u = await te({ timeout: 1e3, postEvent: s });
2251
2264
  r = u.isExpanded, i = u.height, o = u.width, a = u.isStateStable ? i : 0;
2252
2265
  }
2253
- const p = new Rs({
2266
+ const p = new xs({
2254
2267
  postEvent: s,
2255
2268
  height: i,
2256
2269
  width: o,
@@ -2374,7 +2387,7 @@ function Pn(e) {
2374
2387
  function Ts(e) {
2375
2388
  return e instanceof W;
2376
2389
  }
2377
- function Rn(e, t) {
2390
+ function xn(e, t) {
2378
2391
  return Ts(e) && e.type === t;
2379
2392
  }
2380
2393
  function J(e, t) {
@@ -2388,9 +2401,9 @@ function J(e, t) {
2388
2401
  class As {
2389
2402
  constructor(t, s, n = B) {
2390
2403
  if (c(this, "history"), c(this, "ee", new D()), c(this, "attached", !1), c(this, "back", () => this.go(-1)), c(this, "on", this.ee.on.bind(this.ee)), c(this, "off", this.ee.off.bind(this.ee)), this._index = s, this.postEvent = n, t.length === 0)
2391
- throw m(ve, "History should not be empty.");
2404
+ throw b(ve, "History should not be empty.");
2392
2405
  if (s < 0 || s >= t.length)
2393
- throw m(
2406
+ throw b(
2394
2407
  ye,
2395
2408
  "Index should not be zero and higher or equal than history size."
2396
2409
  );
@@ -2515,19 +2528,19 @@ function F({
2515
2528
  function M(e, t) {
2516
2529
  return e.startsWith(t) ? e : `${t}${e}`;
2517
2530
  }
2518
- function U(e) {
2531
+ function H(e) {
2519
2532
  return new URL(
2520
2533
  typeof e == "string" ? e : `${e.pathname || ""}${M(e.search || "", "?")}${M(e.hash || "", "#")}`,
2521
2534
  "http://a"
2522
2535
  );
2523
2536
  }
2524
- function H(e) {
2525
- const t = typeof e == "string" ? e.startsWith("/") : !!(e.pathname && e.pathname.startsWith("/")), s = U(e);
2537
+ function U(e) {
2538
+ const t = typeof e == "string" ? e.startsWith("/") : !!(e.pathname && e.pathname.startsWith("/")), s = H(e);
2526
2539
  return `${t ? s.pathname : s.pathname.slice(1)}${s.search}${s.hash}`;
2527
2540
  }
2528
2541
  function Q(e, t, s) {
2529
2542
  let n, r;
2530
- typeof e == "string" ? n = e : (n = H(e), s = e.state, r = e.id);
2543
+ typeof e == "string" ? n = e : (n = U(e), s = e.state, r = e.id);
2531
2544
  const { pathname: i, search: o, hash: a } = new URL(n, `http://a${M(t, "/")}`);
2532
2545
  return { id: r, pathname: i, params: { hash: a, search: o, state: s } };
2533
2546
  }
@@ -2553,7 +2566,7 @@ async function Is() {
2553
2566
  e = await N(-1);
2554
2567
  }
2555
2568
  function ee(e) {
2556
- return U(e).pathname;
2569
+ return H(e).pathname;
2557
2570
  }
2558
2571
  const Pt = 0, Y = 1, Z = 2;
2559
2572
  class se {
@@ -2677,7 +2690,7 @@ class se {
2677
2690
  * "/pathname?search#hash"
2678
2691
  */
2679
2692
  get path() {
2680
- return H(this);
2693
+ return U(this);
2681
2694
  }
2682
2695
  /**
2683
2696
  * Current pathname. Always starts with the slash.
@@ -2706,8 +2719,8 @@ class se {
2706
2719
  * // { pathname: '/tma', search: '?is=cool', hash: '#yeah' }
2707
2720
  */
2708
2721
  parsePath(t) {
2709
- let s = U(t);
2710
- return this.hashMode && (s = U(s.hash.slice(1))), {
2722
+ let s = H(t);
2723
+ return this.hashMode && (s = H(s.hash.slice(1))), {
2711
2724
  pathname: s.pathname,
2712
2725
  search: s.search,
2713
2726
  hash: s.hash
@@ -2727,7 +2740,7 @@ class se {
2727
2740
  * @param value - path presented as string or URLLike.
2728
2741
  */
2729
2742
  renderPath(t) {
2730
- const s = (this.base.length === 1 ? "" : this.base) + M(H(t), "/");
2743
+ const s = (this.base.length === 1 ? "" : this.base) + M(U(t), "/");
2731
2744
  return this.hashMode ? M(s.slice(1), this.hashMode === "classic" ? "#" : "#/") : s;
2732
2745
  }
2733
2746
  /**
@@ -2757,13 +2770,13 @@ class se {
2757
2770
  function ks(e) {
2758
2771
  e || (e = {});
2759
2772
  const { href: t, hash: s } = window.location;
2760
- let n = H(
2773
+ let n = U(
2761
2774
  e.hashMode === null ? t : s.includes("?") ? s.slice(1) : `?${s.slice(1)}`
2762
2775
  );
2763
2776
  const r = e.base ? ee(e.base) : void 0;
2764
2777
  if (r) {
2765
2778
  if (!n.startsWith(r))
2766
- throw m(
2779
+ throw b(
2767
2780
  Ee,
2768
2781
  `Path "${n}" expected to be starting with "${r}"`
2769
2782
  );
@@ -2771,7 +2784,7 @@ function ks(e) {
2771
2784
  }
2772
2785
  return new se([n], 0, e);
2773
2786
  }
2774
- function xn(e) {
2787
+ function Rn(e) {
2775
2788
  const t = e.match(/#(.+)/);
2776
2789
  return t ? t[1] : null;
2777
2790
  }
@@ -2807,7 +2820,7 @@ function d(e, t) {
2807
2820
  ...p,
2808
2821
  [i]: n(o)
2809
2822
  };
2810
- return /* @__PURE__ */ Rt(a, { ...u });
2823
+ return /* @__PURE__ */ xt(a, { ...u });
2811
2824
  };
2812
2825
  };
2813
2826
  }
@@ -2829,7 +2842,7 @@ function _(e) {
2829
2842
  return r.use(e);
2830
2843
  }
2831
2844
  );
2832
- return R(() => {
2845
+ return x(() => {
2833
2846
  o(r.use(e));
2834
2847
  }, [r]), i;
2835
2848
  }
@@ -2852,23 +2865,23 @@ const [Ns, Ds] = _(Ge), [Sn, Tn] = d(
2852
2865
  ), [Vs, Ls] = _(Fe), [kn, qn] = d(
2853
2866
  Vs,
2854
2867
  Ls
2855
- ), [$s, Us] = _(ts), [On, Nn] = d(
2868
+ ), [$s, Hs] = _(ts), [On, Nn] = d(
2856
2869
  $s,
2857
- Us
2858
- ), [Hs, Ws] = _(ss), [Dn, Bn] = d(
2859
- Hs,
2870
+ Hs
2871
+ ), [Us, Ws] = _(ss), [Dn, Bn] = d(
2872
+ Us,
2860
2873
  Ws
2861
- ), [Gs, js] = _(rs), [Mn, Vn] = d(Gs, js), [zs, Ks] = _(os), [Ln, $n] = d(zs, Ks), [Js, Fs] = _(cs), [Un, Hn] = d(Js, Fs), [Qs, Ys] = _(ls), [Wn, Gn] = d(Qs, Ys), [Zs, Xs] = _(ws), [jn, zn] = d(Zs, Xs), [tn, en] = _(fs), [Kn, Jn] = d(tn, en), [sn, nn] = _(bs), [Fn, Qn] = d(
2874
+ ), [Gs, js] = _(rs), [Mn, Vn] = d(Gs, js), [zs, Ks] = _(os), [Ln, $n] = d(zs, Ks), [Js, Fs] = _(cs), [Hn, Un] = d(Js, Fs), [Qs, Ys] = _(ls), [Wn, Gn] = d(Qs, Ys), [Zs, Xs] = _(ws), [jn, zn] = d(Zs, Xs), [tn, en] = _(fs), [Kn, Jn] = d(tn, en), [sn, nn] = _(bs), [Fn, Qn] = d(
2862
2875
  sn,
2863
2876
  nn
2864
2877
  ), [rn, on] = _(ys), [Yn, Zn] = d(rn, on);
2865
2878
  function Xn(e) {
2866
2879
  const [t, s] = rt(() => e ? void 0 : nt());
2867
- return R(() => {
2880
+ return x(() => {
2868
2881
  e && s(nt());
2869
2882
  }, []), t;
2870
2883
  }
2871
- const [an, cn] = _(Ps), [tr, er] = d(an, cn), [hn, pn] = _(xs), [sr, nr] = d(hn, pn);
2884
+ const [an, cn] = _(Ps), [tr, er] = d(an, cn), [hn, pn] = _(Rs), [sr, nr] = d(hn, pn);
2872
2885
  function rr({ children: e, acceptCustomStyles: t, debug: s }) {
2873
2886
  const n = bt(!0), [r, i] = rt(/* @__PURE__ */ new Map()), o = bt(r), a = oe(
2874
2887
  (u) => {
@@ -2880,9 +2893,9 @@ function rr({ children: e, acceptCustomStyles: t, debug: s }) {
2880
2893
  const gt = r.get(u);
2881
2894
  if (gt)
2882
2895
  return gt;
2883
- let b, K;
2896
+ let v, K;
2884
2897
  try {
2885
- b = u(...S);
2898
+ v = u(...S);
2886
2899
  } catch (f) {
2887
2900
  K = f;
2888
2901
  }
@@ -2892,8 +2905,8 @@ function rr({ children: e, acceptCustomStyles: t, debug: s }) {
2892
2905
  if (K)
2893
2906
  return $({ error: K });
2894
2907
  let I;
2895
- if (Array.isArray(b) && (I = b[1], b = b[0]), !b)
2896
- return $({ result: b, cleanup: I });
2908
+ if (Array.isArray(v) && (I = v[1], v = v[0]), !v)
2909
+ return $({ result: v, cleanup: I });
2897
2910
  function ft(f) {
2898
2911
  if ("on" in f) {
2899
2912
  const k = f.on("change", () => a()), mt = I;
@@ -2903,26 +2916,26 @@ function rr({ children: e, acceptCustomStyles: t, debug: s }) {
2903
2916
  }
2904
2917
  return { result: f, cleanup: I };
2905
2918
  }
2906
- return b instanceof Promise ? (b.then(
2919
+ return v instanceof Promise ? (v.then(
2907
2920
  (f) => a((k) => k.set(u, ft(f))),
2908
2921
  (f) => a((k) => k.set(u, { error: f }))
2909
- ), $({})) : $(ft(b));
2922
+ ), $({})) : $(ft(v));
2910
2923
  }
2911
2924
  }), [r]);
2912
- return R(() => (n.current = !0, () => {
2925
+ return x(() => (n.current = !0, () => {
2913
2926
  n.current = !1;
2914
- }), []), R(() => {
2927
+ }), []), x(() => {
2915
2928
  if (ht())
2916
2929
  return Cs(t);
2917
- }, [t]), R(() => {
2930
+ }, [t]), x(() => {
2918
2931
  le(s || !1);
2919
- }, [s]), R(() => {
2932
+ }, [s]), x(() => {
2920
2933
  o.current = r;
2921
- }, [r]), R(() => () => {
2934
+ }, [r]), x(() => () => {
2922
2935
  o.current.forEach((u) => {
2923
2936
  "cleanup" in u && u.cleanup && u.cleanup();
2924
2937
  });
2925
- }, []), /* @__PURE__ */ Rt(ne.Provider, { value: p, children: e });
2938
+ }, []), /* @__PURE__ */ xt(ne.Provider, { value: p, children: e });
2926
2939
  }
2927
2940
  export {
2928
2941
  Ne as BackButton,
@@ -2956,7 +2969,7 @@ export {
2956
2969
  ms as SettingsButton,
2957
2970
  vs as ThemeParams,
2958
2971
  Es as Utils,
2959
- Rs as Viewport,
2972
+ xs as Viewport,
2960
2973
  Ze as array,
2961
2974
  bn as bindMiniAppCSSVars,
2962
2975
  vn as bindThemeParamsCSSVars,
@@ -2967,9 +2980,9 @@ export {
2967
2980
  Ie as compareVersions,
2968
2981
  ks as createBrowserNavigatorFromLocation,
2969
2982
  qe as createPostEvent,
2970
- U as createSafeURL,
2983
+ H as createSafeURL,
2971
2984
  $t as date,
2972
- xn as getHash,
2985
+ Rn as getHash,
2973
2986
  ee as getPathname,
2974
2987
  Ge as initBackButton,
2975
2988
  Ke as initBiometryManager,
@@ -2986,7 +2999,7 @@ export {
2986
2999
  bs as initSettingsButton,
2987
3000
  ys as initThemeParams,
2988
3001
  Ps as initUtils,
2989
- xs as initViewport,
3002
+ Rs as initViewport,
2990
3003
  Cs as initWeb,
2991
3004
  O as invokeCustomMethod,
2992
3005
  Vt as isColorDark,
@@ -2995,13 +3008,13 @@ export {
2995
3008
  ct as isRGB,
2996
3009
  Pe as isRGBShort,
2997
3010
  Ts as isSDKError,
2998
- Rn as isSDKErrorOfType,
3011
+ xn as isSDKErrorOfType,
2999
3012
  Ss as isSSR,
3000
3013
  En as isTMA,
3001
3014
  w as json,
3002
3015
  gn as mergeClassNames,
3003
3016
  Pn as mockTelegramEnv,
3004
- x as number,
3017
+ R as number,
3005
3018
  z as off,
3006
3019
  y as on,
3007
3020
  fn as parseInitData,
@@ -3015,7 +3028,7 @@ export {
3015
3028
  nt as retrieveLaunchParams,
3016
3029
  It as rgb,
3017
3030
  lt as searchParams,
3018
- Ue as serializeLaunchParams,
3031
+ He as serializeLaunchParams,
3019
3032
  Jt as serializeThemeParams,
3020
3033
  P as setCSSVar,
3021
3034
  le as setDebug,
@@ -3026,17 +3039,17 @@ export {
3026
3039
  ke as targetOrigin,
3027
3040
  At as toRGB,
3028
3041
  Ct as unsubscribe,
3029
- H as urlToPath,
3042
+ U as urlToPath,
3030
3043
  Ds as useBackButton,
3031
3044
  Ns as useBackButtonRaw,
3032
3045
  Ms as useBiometryManager,
3033
3046
  Bs as useBiometryManagerRaw,
3034
3047
  Ls as useClosingBehavior,
3035
3048
  Vs as useClosingBehaviorRaw,
3036
- Us as useCloudStorage,
3049
+ Hs as useCloudStorage,
3037
3050
  $s as useCloudStorageRaw,
3038
3051
  Ws as useHapticFeedback,
3039
- Hs as useHapticFeedbackRaw,
3052
+ Us as useHapticFeedbackRaw,
3040
3053
  js as useInitData,
3041
3054
  Gs as useInitDataRaw,
3042
3055
  Ks as useInvoice,
@@ -3073,8 +3086,8 @@ export {
3073
3086
  Mn as withInitDataRaw,
3074
3087
  $n as withInvoice,
3075
3088
  Ln as withInvoiceRaw,
3076
- Hn as withMainButton,
3077
- Un as withMainButtonRaw,
3089
+ Un as withMainButton,
3090
+ Hn as withMainButtonRaw,
3078
3091
  Gn as withMiniApp,
3079
3092
  Wn as withMiniAppRaw,
3080
3093
  zn as withPopup,