@tma.js/sdk-react 2.1.4 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as mt } from "react/jsx-runtime";
2
- import { createContext as Xt, useContext as te, useState as bt, useEffect as C, useMemo as vt, useRef as dt, useCallback as ee } from "react";
3
- var se = Object.defineProperty, ne = (e, t, s) => t in e ? se(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, c = (e, t, s) => (ne(e, typeof t != "symbol" ? t + "" : t, s), s);
2
+ import { createContext as te, useContext as ee, useState as bt, useEffect as S, useMemo as vt, useRef as dt, useCallback as se } from "react";
3
+ var ne = Object.defineProperty, re = (e, t, s) => t in e ? ne(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, c = (e, t, s) => (re(e, typeof t != "symbol" ? t + "" : t, s), s);
4
4
  function yt(e, t) {
5
5
  let s;
6
6
  const n = () => {
@@ -9,13 +9,13 @@ function yt(e, t) {
9
9
  return [() => s === void 0 ? s = e(n) : s, n];
10
10
  }
11
11
  function Et(e) {
12
- const t = G(), { count: s } = t;
12
+ const t = j(), { count: s } = t;
13
13
  t.unsubscribe(e), s && !t.count && Ce();
14
14
  }
15
- function re(e) {
16
- return G().subscribe(e), () => Et(e);
15
+ function ie(e) {
16
+ return j().subscribe(e), () => Et(e);
17
17
  }
18
- class ie {
18
+ class oe {
19
19
  constructor(t, s = {}) {
20
20
  this.scope = t, this.options = s;
21
21
  }
@@ -31,12 +31,12 @@ class ie {
31
31
  second: "2-digit",
32
32
  fractionalSecondDigits: 3,
33
33
  timeZone: "UTC"
34
- }).format(n), { textColor: i, bgColor: a } = this.options, o = "font-weight: bold;padding: 0 5px;border-radius:5px";
34
+ }).format(n), { textColor: i, bgColor: o } = this.options, a = "font-weight: bold;padding: 0 5px;border-radius:5px";
35
35
  console[t](
36
36
  `%c${r}%c / %c${this.scope}`,
37
- `${o};background-color: lightblue;color:black`,
37
+ `${a};background-color: lightblue;color:black`,
38
38
  "",
39
- `${o};${i ? `color:${i};` : ""}${a ? `background-color:${a}` : ""}`,
39
+ `${a};${i ? `color:${i};` : ""}${o ? `background-color:${o}` : ""}`,
40
40
  ...s
41
41
  );
42
42
  }
@@ -55,21 +55,21 @@ class ie {
55
55
  this.print("log", ...t);
56
56
  }
57
57
  }
58
- const st = new ie("SDK", {
58
+ const st = new oe("SDK", {
59
59
  bgColor: "forestgreen",
60
60
  textColor: "white"
61
61
  });
62
62
  let X = !1;
63
- const _t = ({ event: e, args: [t] }) => {
64
- st.log("Event received:", t === void 0 ? { name: e } : { name: e, data: t });
63
+ const _t = ({ name: e, payload: t }) => {
64
+ st.log("Event received:", t ? { name: e, payload: t } : { name: e });
65
65
  };
66
- function oe(e) {
67
- X !== e && (X = e, e ? re(_t) : Et(_t));
66
+ function ae(e) {
67
+ X !== e && (X = e, e ? ie(_t) : Et(_t));
68
68
  }
69
- function ae(...e) {
69
+ function ce(...e) {
70
70
  X && st.log(...e);
71
71
  }
72
- class H {
72
+ class N {
73
73
  constructor() {
74
74
  c(this, "listeners", /* @__PURE__ */ new Map()), c(this, "listenersCount", 0), c(this, "subscribeListeners", []);
75
75
  }
@@ -142,6 +142,17 @@ class H {
142
142
  function tt(e, t, s) {
143
143
  return window.addEventListener(e, t, s), () => window.removeEventListener(e, t, s);
144
144
  }
145
+ function Pt(...e) {
146
+ let t = !1;
147
+ const s = [...e];
148
+ return [
149
+ (n) => !t && s.push(n),
150
+ () => {
151
+ t || (t = !0, s.forEach((n) => n()));
152
+ },
153
+ t
154
+ ];
155
+ }
145
156
  class W extends Error {
146
157
  constructor(t, s, n) {
147
158
  super(s, { cause: n }), this.type = t, Object.setPrototypeOf(this, W.prototype);
@@ -150,11 +161,11 @@ class W extends Error {
150
161
  function m(e, t, s) {
151
162
  return new W(e, t, s);
152
163
  }
153
- const ce = "ERR_METHOD_UNSUPPORTED", he = "ERR_METHOD_PARAMETER_UNSUPPORTED", pe = "ERR_UNKNOWN_ENV", ue = "ERR_INVOKE_CUSTOM_METHOD_RESPONSE", le = "ERR_TIMED_OUT", de = "ERR_UNEXPECTED_TYPE", Pt = "ERR_PARSE", _e = "ERR_NAVIGATION_LIST_EMPTY", ge = "ERR_NAVIGATION_CURSOR_INVALID", _n = "ERR_NAVIGATION_ITEM_INVALID", gn = "ERR_SSR_INIT", we = "ERR_INVALID_PATH_BASE";
164
+ const he = "ERR_METHOD_UNSUPPORTED", pe = "ERR_METHOD_PARAMETER_UNSUPPORTED", ue = "ERR_UNKNOWN_ENV", le = "ERR_INVOKE_CUSTOM_METHOD_RESPONSE", de = "ERR_TIMED_OUT", _e = "ERR_UNEXPECTED_TYPE", Rt = "ERR_PARSE", ge = "ERR_NAVIGATION_LIST_EMPTY", we = "ERR_NAVIGATION_CURSOR_INVALID", dn = "ERR_NAVIGATION_ITEM_INVALID", _n = "ERR_SSR_INIT", fe = "ERR_INVALID_PATH_BASE";
154
165
  function T() {
155
- return m(de, "Value has unexpected type");
166
+ return m(_e, "Value has unexpected type");
156
167
  }
157
- class j {
168
+ class G {
158
169
  constructor(t, s, n) {
159
170
  this.parser = t, this.isOptional = s, this.type = n;
160
171
  }
@@ -170,7 +181,7 @@ class j {
170
181
  return this.parser(t);
171
182
  } catch (s) {
172
183
  throw m(
173
- Pt,
184
+ Rt,
174
185
  `Unable to parse value${this.type ? ` as ${this.type}` : ""}`,
175
186
  s
176
187
  );
@@ -181,7 +192,7 @@ class j {
181
192
  }
182
193
  }
183
194
  function A(e, t) {
184
- return () => new j(e, !1, t);
195
+ return () => new G(e, !1, t);
185
196
  }
186
197
  const P = A((e) => {
187
198
  if (typeof e == "boolean")
@@ -193,24 +204,24 @@ const P = A((e) => {
193
204
  return !1;
194
205
  throw T();
195
206
  }, "boolean");
196
- function Rt(e, t) {
207
+ function xt(e, t) {
197
208
  const s = {};
198
209
  for (const n in e) {
199
210
  const r = e[n];
200
211
  if (!r)
201
212
  continue;
202
- let i, a;
213
+ let i, o;
203
214
  if (typeof r == "function" || "parse" in r)
204
- i = n, a = typeof r == "function" ? r : r.parse.bind(r);
215
+ i = n, o = typeof r == "function" ? r : r.parse.bind(r);
205
216
  else {
206
- const { type: o } = r;
207
- i = r.from || n, a = typeof o == "function" ? o : o.parse.bind(o);
217
+ const { type: a } = r;
218
+ i = r.from || n, o = typeof a == "function" ? a : a.parse.bind(a);
208
219
  }
209
220
  try {
210
- const o = a(t(i));
211
- o !== void 0 && (s[n] = o);
212
- } catch (o) {
213
- throw m(Pt, `Unable to parse field "${n}"`, o);
221
+ const a = o(t(i));
222
+ a !== void 0 && (s[n] = a);
223
+ } catch (a) {
224
+ throw m(Rt, `Unable to parse field "${n}"`, a);
214
225
  }
215
226
  }
216
227
  return s;
@@ -222,9 +233,9 @@ function nt(e) {
222
233
  return t;
223
234
  }
224
235
  function g(e, t) {
225
- return new j((s) => {
236
+ return new G((s) => {
226
237
  const n = nt(s);
227
- return Rt(e, (r) => n[r]);
238
+ return xt(e, (r) => n[r]);
228
239
  }, !1, t);
229
240
  }
230
241
  const x = A((e) => {
@@ -240,14 +251,14 @@ const x = A((e) => {
240
251
  function rt(e) {
241
252
  return /^#[\da-f]{6}$/i.test(e);
242
253
  }
243
- function fe(e) {
254
+ function me(e) {
244
255
  return /^#[\da-f]{3}$/i.test(e);
245
256
  }
246
- function xt(e) {
257
+ function Ct(e) {
247
258
  const t = e.replace(/\s/g, "").toLowerCase();
248
259
  if (rt(t))
249
260
  return t;
250
- if (fe(t)) {
261
+ if (me(t)) {
251
262
  let n = "#";
252
263
  for (let r = 0; r < 3; r += 1)
253
264
  n += t[1 + r].repeat(2);
@@ -265,26 +276,26 @@ const p = A((e) => {
265
276
  if (typeof e == "string" || typeof e == "number")
266
277
  return e.toString();
267
278
  throw T();
268
- }, "string"), Ct = A((e) => xt(p().parse(e)), "rgb");
269
- function me(e) {
279
+ }, "string"), St = A((e) => Ct(p().parse(e)), "rgb");
280
+ function be(e) {
270
281
  return g({
271
282
  eventType: p(),
272
283
  eventData: (t) => t
273
284
  }).parse(e);
274
285
  }
275
- function be() {
286
+ function ve() {
276
287
  ["TelegramGameProxy_receiveEvent", "TelegramGameProxy", "Telegram"].forEach((e) => {
277
288
  delete window[e];
278
289
  });
279
290
  }
280
- function ve(e, t) {
291
+ function ye(e, t) {
281
292
  window.dispatchEvent(new MessageEvent("message", {
282
293
  data: JSON.stringify({ eventType: e, eventData: t }),
283
294
  // We specify window.parent to imitate the case, the parent iframe sent us this event.
284
295
  source: window.parent
285
296
  }));
286
297
  }
287
- function ye() {
298
+ function Ee() {
288
299
  [
289
300
  ["TelegramGameProxy_receiveEvent"],
290
301
  // Windows Phone.
@@ -296,16 +307,14 @@ function ye() {
296
307
  let t = window;
297
308
  e.forEach((s, n, r) => {
298
309
  if (n === r.length - 1) {
299
- t[s] = ve;
310
+ t[s] = ye;
300
311
  return;
301
312
  }
302
313
  s in t || (t[s] = {}), t = t[s];
303
314
  });
304
315
  });
305
316
  }
306
- const Ee = g({
307
- button_id: (e) => e == null ? void 0 : p().parse(e)
308
- }), Pe = {
317
+ const Pe = {
309
318
  clipboard_text_received: g({
310
319
  req_id: p(),
311
320
  data: (e) => e === null ? e : p().optional().parse(e)
@@ -315,22 +324,19 @@ const Ee = g({
315
324
  result: (e) => e,
316
325
  error: p().optional()
317
326
  }),
318
- invoice_closed: g({
319
- slug: p(),
320
- status: p()
321
- }),
322
- phone_requested: g({
323
- status: p()
324
- }),
327
+ invoice_closed: g({ slug: p(), status: p() }),
328
+ phone_requested: g({ status: p() }),
325
329
  popup_closed: {
326
- parse: (e) => Ee.parse(e ?? {})
330
+ parse(e) {
331
+ return g({
332
+ button_id: (t) => t == null ? void 0 : p().parse(t)
333
+ }).parse(e ?? {});
334
+ }
327
335
  },
328
- qr_text_received: g({
329
- data: p().optional()
330
- }),
336
+ qr_text_received: g({ data: p().optional() }),
331
337
  theme_changed: g({
332
338
  theme_params: (e) => {
333
- const t = Ct().optional();
339
+ const t = St().optional();
334
340
  return Object.entries(nt(e)).reduce((s, [n, r]) => (s[n] = t.parse(r), s), {});
335
341
  }
336
342
  }),
@@ -340,23 +346,23 @@ const Ee = g({
340
346
  is_state_stable: P(),
341
347
  is_expanded: P()
342
348
  }),
343
- write_access_requested: g({
344
- status: p()
345
- })
349
+ write_access_requested: g({ status: p() })
346
350
  };
347
351
  function Re() {
348
- const e = new H();
349
- ye();
350
- let t = [
352
+ const e = new N(), t = new N();
353
+ t.subscribe((n) => {
354
+ e.emit("event", { name: n.event, payload: n.args[0] });
355
+ }), Ee();
356
+ const [, s] = Pt(
351
357
  // Don't forget to remove created handlers.
352
- be,
358
+ ve,
353
359
  // Add "resize" event listener to make sure, we always have fresh viewport information.
354
360
  // Desktop version of Telegram is sometimes not sending the viewport_changed
355
361
  // event. For example, when the MainButton is shown. That's why we should
356
362
  // add our own listener to make sure, viewport information is always fresh.
357
363
  // Issue: https://github.com/Telegram-Mini-Apps/tma.js/issues/10
358
364
  tt("resize", () => {
359
- e.emit("viewport_changed", {
365
+ t.emit("viewport_changed", {
360
366
  width: window.innerWidth,
361
367
  height: window.innerHeight,
362
368
  is_state_stable: !0,
@@ -365,69 +371,80 @@ function Re() {
365
371
  }),
366
372
  // Add listener, which handles events sent from the Telegram web application and also events
367
373
  // generated by the local emitEvent function.
368
- tt("message", (s) => {
369
- if (s.source !== window.parent)
374
+ tt("message", (n) => {
375
+ if (n.source !== window.parent)
370
376
  return;
371
- let n;
377
+ let r;
372
378
  try {
373
- n = me(s.data);
379
+ r = be(n.data);
374
380
  } catch {
375
381
  return;
376
382
  }
377
- const { eventType: r, eventData: i } = n, a = Pe[r];
383
+ const { eventType: i, eventData: o } = r, a = Pe[i];
378
384
  try {
379
- const o = a ? a.parse(i) : i;
380
- e.emit(...o ? [r, o] : [r]);
381
- } catch (o) {
385
+ const u = a ? a.parse(o) : o;
386
+ t.emit(...u ? [i, u] : [i]);
387
+ } catch (u) {
382
388
  st.error(
383
- `An error occurred processing the "${r}" event from the Telegram application. Please, file an issue here: https://github.com/Telegram-Mini-Apps/tma.js/issues/new/choose`,
384
- n,
385
- o
389
+ `An error occurred processing the "${i}" event from the Telegram application. Please, file an issue here: https://github.com/Telegram-Mini-Apps/tma.js/issues/new/choose`,
390
+ r,
391
+ u
386
392
  );
387
393
  }
388
394
  }),
389
- // Clear emitter bound events.
390
- () => e.clear()
391
- ];
392
- return [e, () => {
393
- t.forEach((s) => s()), t = [];
394
- }];
395
+ // Clear emitters.
396
+ () => e.clear(),
397
+ () => t.clear()
398
+ );
399
+ return [{
400
+ on: t.on.bind(t),
401
+ off: t.off.bind(t),
402
+ subscribe(n) {
403
+ return e.on("event", n);
404
+ },
405
+ unsubscribe(n) {
406
+ e.off("event", n);
407
+ },
408
+ get count() {
409
+ return t.count + e.count;
410
+ }
411
+ }, s];
395
412
  }
396
413
  const [xe, Ce] = yt(
397
414
  (e) => {
398
415
  const [t, s] = Re(), n = t.off.bind(t);
399
416
  return t.off = (r, i) => {
400
- const { count: a } = t;
401
- n(r, i), a && !t.count && e();
417
+ const { count: o } = t;
418
+ n(r, i), o && !t.count && e();
402
419
  }, [t, s];
403
420
  },
404
421
  ([, e]) => e()
405
422
  );
406
- function G() {
423
+ function j() {
407
424
  return xe()[0];
408
425
  }
409
426
  function z(e, t) {
410
- G().off(e, t);
427
+ j().off(e, t);
411
428
  }
412
429
  function E(e, t, s) {
413
- return G().on(e, t, s);
430
+ return j().on(e, t, s);
414
431
  }
415
- function M(e) {
432
+ function V(e) {
416
433
  return typeof e == "object" && e !== null && !Array.isArray(e);
417
434
  }
418
435
  function Se(e, t) {
419
436
  const s = e.split("."), n = t.split("."), r = Math.max(s.length, n.length);
420
437
  for (let i = 0; i < r; i += 1) {
421
- const a = parseInt(s[i] || "0", 10), o = parseInt(n[i] || "0", 10);
422
- if (a !== o)
423
- return a > o ? 1 : -1;
438
+ const o = parseInt(s[i] || "0", 10), a = parseInt(n[i] || "0", 10);
439
+ if (o !== a)
440
+ return o > a ? 1 : -1;
424
441
  }
425
442
  return 0;
426
443
  }
427
444
  function y(e, t) {
428
445
  return Se(e, t) <= 0;
429
446
  }
430
- function S(e, t, s) {
447
+ function C(e, t, s) {
431
448
  if (typeof s == "string") {
432
449
  if (e === "web_app_open_link" && t === "try_instant_view")
433
450
  return y("6.4", s);
@@ -479,30 +496,30 @@ function S(e, t, s) {
479
496
  }
480
497
  }
481
498
  function Te(e) {
482
- return "external" in e && M(e.external) && "notify" in e.external && typeof e.external.notify == "function";
499
+ return "external" in e && V(e.external) && "notify" in e.external && typeof e.external.notify == "function";
483
500
  }
484
- function St(e) {
485
- return "TelegramWebviewProxy" in e && M(e.TelegramWebviewProxy) && "postEvent" in e.TelegramWebviewProxy && typeof e.TelegramWebviewProxy.postEvent == "function";
501
+ function Tt(e) {
502
+ return "TelegramWebviewProxy" in e && V(e.TelegramWebviewProxy) && "postEvent" in e.TelegramWebviewProxy && typeof e.TelegramWebviewProxy.postEvent == "function";
486
503
  }
487
- function Tt() {
504
+ function At() {
488
505
  try {
489
506
  return window.self !== window.top;
490
507
  } catch {
491
508
  return !0;
492
509
  }
493
510
  }
494
- let At = "https://web.telegram.org";
495
- function wn(e) {
496
- At = e;
511
+ let It = "https://web.telegram.org";
512
+ function gn(e) {
513
+ It = e;
497
514
  }
498
515
  function Ae() {
499
- return At;
516
+ return It;
500
517
  }
501
- function N(e, t, s) {
518
+ function B(e, t, s) {
502
519
  let n = {}, r;
503
520
  t === void 0 && s === void 0 ? n = {} : t !== void 0 && s !== void 0 ? (n = s, r = t) : t !== void 0 && ("targetOrigin" in t ? n = t : r = t);
504
521
  const { targetOrigin: i = Ae() } = n;
505
- if (ae("Posting event:", r ? { event: e, data: r } : { event: e }), Tt()) {
522
+ if (ce("Posting event:", r ? { event: e, data: r } : { event: e }), At()) {
506
523
  window.parent.postMessage(JSON.stringify({ eventType: e, eventData: r }), i);
507
524
  return;
508
525
  }
@@ -510,42 +527,42 @@ function N(e, t, s) {
510
527
  window.external.notify(JSON.stringify({ eventType: e, eventData: r }));
511
528
  return;
512
529
  }
513
- if (St(window)) {
530
+ if (Tt(window)) {
514
531
  window.TelegramWebviewProxy.postEvent(e, JSON.stringify(r));
515
532
  return;
516
533
  }
517
534
  throw m(
518
- pe,
535
+ ue,
519
536
  "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."
520
537
  );
521
538
  }
522
- function ke(e) {
539
+ function Ie(e) {
523
540
  return (t, s) => {
524
- if (!S(t, e))
525
- throw m(ce, `Method "${t}" is unsupported in Mini Apps version ${e}`);
526
- if (M(s)) {
541
+ if (!C(t, e))
542
+ throw m(he, `Method "${t}" is unsupported in Mini Apps version ${e}`);
543
+ if (V(s)) {
527
544
  let n;
528
- 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 && !S(t, n, e))
545
+ 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))
529
546
  throw m(
530
- he,
547
+ pe,
531
548
  `Parameter "${n}" of "${t}" method is unsupported in Mini Apps version ${e}`
532
549
  );
533
550
  }
534
- return N(t, s);
551
+ return B(t, s);
535
552
  };
536
553
  }
537
554
  function kt(e) {
538
555
  return ({ req_id: t }) => t === e;
539
556
  }
540
- function It(e) {
541
- return m(le, `Timeout reached: ${e}ms`);
557
+ function qt(e) {
558
+ return m(de, `Timeout reached: ${e}ms`);
542
559
  }
543
560
  function Ot(e, t) {
544
561
  return Promise.race([
545
562
  typeof e == "function" ? e() : e,
546
563
  new Promise((s, n) => {
547
564
  setTimeout(() => {
548
- n(It(t));
565
+ n(qt(t));
549
566
  }, t);
550
567
  })
551
568
  ]);
@@ -558,18 +575,18 @@ async function w(e) {
558
575
  method: n,
559
576
  event: r,
560
577
  capture: i,
561
- postEvent: a = N,
562
- timeout: o
578
+ postEvent: o = B,
579
+ timeout: a
563
580
  } = e, u = (Array.isArray(r) ? r : [r]).map(
564
581
  (h) => E(h, (v) => (!i || i(v)) && t(v))
565
582
  );
566
583
  try {
567
- return a(n, e.params), await (o ? Ot(s, o) : s);
584
+ return o(n, e.params), await (a ? Ot(s, a) : s);
568
585
  } finally {
569
586
  u.forEach((h) => h());
570
587
  }
571
588
  }
572
- async function q(e, t, s, n = {}) {
589
+ async function O(e, t, s, n = {}) {
573
590
  const {
574
591
  result: r,
575
592
  error: i
@@ -585,27 +602,27 @@ async function q(e, t, s, n = {}) {
585
602
  capture: kt(s)
586
603
  });
587
604
  if (i)
588
- throw m(ue, i);
605
+ throw m(le, i);
589
606
  return r;
590
607
  }
591
608
  function et(...e) {
592
609
  return e.map((t) => {
593
610
  if (typeof t == "string")
594
611
  return t;
595
- if (M(t))
612
+ if (V(t))
596
613
  return et(Object.entries(t).map((s) => s[1] && s[0]));
597
614
  if (Array.isArray(t))
598
615
  return et(...t);
599
616
  }).filter(Boolean).join(" ");
600
617
  }
601
- function fn(...e) {
602
- return e.reduce((t, s) => (M(s) && Object.entries(s).forEach(([n, r]) => {
618
+ function wn(...e) {
619
+ return e.reduce((t, s) => (V(s) && Object.entries(s).forEach(([n, r]) => {
603
620
  const i = et(t[n], r);
604
621
  i.length && (t[n] = i);
605
622
  }), t), {});
606
623
  }
607
- function qt(e) {
608
- const t = xt(e);
624
+ function Dt(e) {
625
+ const t = Ct(e);
609
626
  return Math.sqrt(
610
627
  [0.299, 0.587, 0.114].reduce((s, n, r) => {
611
628
  const i = parseInt(t.slice(1 + r * 2, 1 + (r + 1) * 2), 16);
@@ -613,9 +630,9 @@ function qt(e) {
613
630
  }, 0)
614
631
  ) < 120;
615
632
  }
616
- class Ie {
633
+ class ke {
617
634
  constructor(t) {
618
- c(this, "ee", new H()), c(this, "on", this.ee.on.bind(this.ee)), c(this, "off", this.ee.off.bind(this.ee)), this.state = t;
635
+ c(this, "ee", new N()), c(this, "on", this.ee.on.bind(this.ee)), c(this, "off", this.ee.off.bind(this.ee)), this.state = t;
619
636
  }
620
637
  /**
621
638
  * Clones current state and returns its copy.
@@ -636,18 +653,18 @@ class Ie {
636
653
  }
637
654
  class it {
638
655
  constructor(t) {
639
- c(this, "state"), c(this, "get"), c(this, "set"), c(this, "clone"), this.state = new Ie(t), this.set = this.state.set.bind(this.state), this.get = this.state.get.bind(this.state), this.clone = this.state.clone.bind(this.state);
656
+ c(this, "state"), c(this, "get"), c(this, "set"), c(this, "clone"), this.state = new ke(t), this.set = this.state.set.bind(this.state), this.get = this.state.get.bind(this.state), this.clone = this.state.clone.bind(this.state);
640
657
  }
641
658
  }
642
- function Dt(e, t) {
643
- return (s) => S(t[s], e);
659
+ function Nt(e, t) {
660
+ return (s) => C(t[s], e);
644
661
  }
645
662
  class ot extends it {
646
663
  constructor(t, s, n) {
647
- super(t), c(this, "supports"), this.supports = Dt(s, n);
664
+ super(t), c(this, "supports"), this.supports = Nt(s, n);
648
665
  }
649
666
  }
650
- class Oe extends ot {
667
+ class qe extends ot {
651
668
  constructor(t, s, n) {
652
669
  super({ isVisible: t }, s, {
653
670
  show: "web_app_setup_back_button",
@@ -676,19 +693,19 @@ class Oe extends ot {
676
693
  this.isVisible = !0;
677
694
  }
678
695
  }
679
- const Nt = A((e) => e instanceof Date ? e : new Date(x().parse(e) * 1e3), "Date");
696
+ const Bt = A((e) => e instanceof Date ? e : new Date(x().parse(e) * 1e3), "Date");
680
697
  function at(e, t) {
681
- return new j((s) => {
698
+ return new G((s) => {
682
699
  if (typeof s != "string" && !(s instanceof URLSearchParams))
683
700
  throw T();
684
701
  const n = typeof s == "string" ? new URLSearchParams(s) : s;
685
- return Rt(e, (r) => {
702
+ return xt(e, (r) => {
686
703
  const i = n.get(r);
687
704
  return i === null ? void 0 : i;
688
705
  });
689
706
  }, !1, t);
690
707
  }
691
- const qe = g({
708
+ const Oe = g({
692
709
  id: x(),
693
710
  type: p(),
694
711
  title: p(),
@@ -733,17 +750,17 @@ const qe = g({
733
750
  },
734
751
  username: p().optional()
735
752
  }, "User").optional();
736
- function Bt() {
753
+ function Mt() {
737
754
  return at({
738
755
  authDate: {
739
- type: Nt(),
756
+ type: Bt(),
740
757
  from: "auth_date"
741
758
  },
742
759
  canSendAfter: {
743
760
  type: x().optional(),
744
761
  from: "can_send_after"
745
762
  },
746
- chat: qe,
763
+ chat: Oe,
747
764
  chatInstance: {
748
765
  type: p().optional(),
749
766
  from: "chat_instance"
@@ -771,21 +788,21 @@ function De(e) {
771
788
  function Ne(e) {
772
789
  return e.replace(/[A-Z]/g, (t) => `_${t.toLowerCase()}`);
773
790
  }
774
- const Mt = A(
791
+ const Vt = A(
775
792
  (e) => {
776
- const t = Ct().optional();
793
+ const t = St().optional();
777
794
  return Object.entries(nt(e)).reduce((s, [n, r]) => (s[De(n)] = t.parse(r), s), {});
778
795
  },
779
796
  "ThemeParams"
780
797
  );
781
- function Vt(e) {
798
+ function $t(e) {
782
799
  return at({
783
800
  botInline: {
784
801
  type: P().optional(),
785
802
  from: "tgWebAppBotInline"
786
803
  },
787
804
  initData: {
788
- type: Bt().optional(),
805
+ type: Mt().optional(),
789
806
  from: "tgWebAppData"
790
807
  },
791
808
  initDataRaw: {
@@ -805,7 +822,7 @@ function Vt(e) {
805
822
  from: "tgWebAppStartParam"
806
823
  },
807
824
  themeParams: {
808
- type: Mt(),
825
+ type: Vt(),
809
826
  from: "tgWebAppThemeParams"
810
827
  },
811
828
  version: {
@@ -814,30 +831,30 @@ function Vt(e) {
814
831
  }
815
832
  }).parse(e);
816
833
  }
817
- function $t(e) {
818
- return Vt(
834
+ function Lt(e) {
835
+ return $t(
819
836
  e.replace(/^[^?#]*[?#]/, "").replace(/[?#]/g, "&")
820
837
  );
821
838
  }
822
839
  function Be() {
823
- return $t(window.location.href);
840
+ return Lt(window.location.href);
824
841
  }
825
- function Lt() {
842
+ function Ht() {
826
843
  return performance.getEntriesByType("navigation")[0];
827
844
  }
828
845
  function Me() {
829
- const e = Lt();
846
+ const e = Ht();
830
847
  if (!e)
831
848
  throw new Error("Unable to get first navigation entry.");
832
- return $t(e.name);
849
+ return Lt(e.name);
833
850
  }
834
851
  function Ut(e) {
835
852
  return `tma.js/${e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`)}`;
836
853
  }
837
- function Ht(e, t) {
854
+ function Wt(e, t) {
838
855
  sessionStorage.setItem(Ut(e), JSON.stringify(t));
839
856
  }
840
- function Wt(e) {
857
+ function Gt(e) {
841
858
  const t = sessionStorage.getItem(Ut(e));
842
859
  try {
843
860
  return t ? JSON.parse(t) : void 0;
@@ -845,7 +862,7 @@ function Wt(e) {
845
862
  }
846
863
  }
847
864
  function Ve() {
848
- return Vt(Wt("launchParams") || "");
865
+ return $t(Gt("launchParams") || "");
849
866
  }
850
867
  function $e(e) {
851
868
  return JSON.stringify(
@@ -861,13 +878,13 @@ function Le(e) {
861
878
  platform: n,
862
879
  version: r,
863
880
  showSettings: i,
864
- startParam: a,
865
- botInline: o
881
+ startParam: o,
882
+ botInline: a
866
883
  } = e, u = new URLSearchParams();
867
- return u.set("tgWebAppPlatform", n), u.set("tgWebAppThemeParams", $e(s)), u.set("tgWebAppVersion", r), t && u.set("tgWebAppData", t), a && u.set("tgWebAppStartParam", a), typeof i == "boolean" && u.set("tgWebAppShowSettings", i ? "1" : "0"), typeof o == "boolean" && u.set("tgWebAppBotInline", o ? "1" : "0"), u.toString();
884
+ return u.set("tgWebAppPlatform", n), u.set("tgWebAppThemeParams", $e(s)), u.set("tgWebAppVersion", r), t && u.set("tgWebAppData", t), o && u.set("tgWebAppStartParam", o), typeof i == "boolean" && u.set("tgWebAppShowSettings", i ? "1" : "0"), typeof a == "boolean" && u.set("tgWebAppBotInline", a ? "1" : "0"), u.toString();
868
885
  }
869
- function Ue(e) {
870
- Ht("launchParams", Le(e));
886
+ function He(e) {
887
+ Wt("launchParams", Le(e));
871
888
  }
872
889
  function jt() {
873
890
  for (const e of [
@@ -881,54 +898,43 @@ function jt() {
881
898
  ])
882
899
  try {
883
900
  const t = e();
884
- return Ue(t), t;
901
+ return He(t), t;
885
902
  } catch {
886
903
  }
887
904
  throw new Error("Unable to retrieve launch parameters from any known source.");
888
905
  }
889
- function Gt() {
890
- const e = Lt();
906
+ function zt() {
907
+ const e = Ht();
891
908
  return !!(e && e.type === "reload");
892
909
  }
893
- function He() {
910
+ function Ue() {
894
911
  let e = 0;
895
912
  return () => (e += 1).toString();
896
913
  }
897
- function We() {
898
- let e = !1;
899
- const t = [];
900
- return [
901
- (s) => !e && t.push(s),
902
- () => {
903
- e || (e = !0, t.forEach((s) => s()));
904
- },
905
- e
906
- ];
907
- }
908
- const [je] = yt(He);
914
+ const [We] = yt(Ue);
909
915
  function l(e, t) {
910
916
  return () => {
911
917
  const s = jt(), n = {
912
918
  ...s,
913
- postEvent: ke(s.version),
914
- createRequestId: je()
919
+ postEvent: Ie(s.version),
920
+ createRequestId: We()
915
921
  };
916
922
  if (typeof e == "function")
917
923
  return e(n);
918
- const [r, i, a] = We(), o = t({
924
+ const [r, i, o] = Pt(), a = t({
919
925
  ...n,
920
926
  // State should only be passed only in case, current page was reloaded. If we don't add
921
927
  // this check, state restoration will work improperly in the web version of Telegram,
922
928
  // when we are always working in the same "session" (tab).
923
- state: Gt() ? Wt(e) : void 0,
929
+ state: zt() ? Gt(e) : void 0,
924
930
  addCleanup: r
925
- }), u = (h) => (a || r(
931
+ }), u = (h) => (o || r(
926
932
  h.on("change", (v) => {
927
- Ht(e, v);
933
+ Wt(e, v);
928
934
  })
929
935
  ), h);
930
936
  return [
931
- o instanceof Promise ? o.then(u) : u(o),
937
+ a instanceof Promise ? a.then(u) : u(a),
932
938
  i
933
939
  ];
934
940
  };
@@ -937,13 +943,13 @@ const Ge = l("backButton", ({
937
943
  postEvent: e,
938
944
  version: t,
939
945
  state: s = { isVisible: !1 }
940
- }) => new Oe(s.isVisible, t, e));
941
- class V extends ot {
946
+ }) => new qe(s.isVisible, t, e));
947
+ class $ extends ot {
942
948
  constructor() {
943
949
  super(...arguments), c(this, "on", this.state.on.bind(this.state)), c(this, "off", this.state.off.bind(this.state));
944
950
  }
945
951
  }
946
- function zt(e) {
952
+ function Kt(e) {
947
953
  const t = e.available ? e : {
948
954
  available: !1,
949
955
  device_id: "",
@@ -961,7 +967,7 @@ function zt(e) {
961
967
  accessGranted: t.access_granted
962
968
  };
963
969
  }
964
- class ze extends V {
970
+ class je extends $ {
965
971
  constructor({ postEvent: t, version: s, ...n }) {
966
972
  super(n, s, {
967
973
  auth: "web_app_biometry_request_auth",
@@ -1039,7 +1045,7 @@ class ze extends V {
1039
1045
  event: "biometry_info_received",
1040
1046
  params: { reason: t || "" }
1041
1047
  }).then((n) => {
1042
- const r = zt(n);
1048
+ const r = Kt(n);
1043
1049
  return this.set(r), r.accessGranted;
1044
1050
  }).finally(() => this.accessPromise = void 0)), this.accessPromise;
1045
1051
  }
@@ -1071,8 +1077,8 @@ class ze extends V {
1071
1077
  );
1072
1078
  }
1073
1079
  }
1074
- async function Ke(e) {
1075
- return zt(
1080
+ async function ze(e) {
1081
+ return Kt(
1076
1082
  await w({
1077
1083
  ...e || {},
1078
1084
  method: "web_app_biometry_get_info",
@@ -1080,10 +1086,16 @@ async function Ke(e) {
1080
1086
  })
1081
1087
  );
1082
1088
  }
1083
- const Je = l(
1089
+ const Ke = l(
1084
1090
  "biometryManager",
1085
- async ({ postEvent: e, version: t, state: s }) => new ze({
1086
- ...s || await Ke({ timeout: 1e3 }),
1091
+ async ({ postEvent: e, version: t, state: s }) => new je({
1092
+ ...s || C("web_app_biometry_get_info", t) ? s || await ze({ timeout: 1e3 }) : {
1093
+ available: !1,
1094
+ accessGranted: !1,
1095
+ accessRequested: !1,
1096
+ tokenSaved: !1,
1097
+ deviceId: ""
1098
+ },
1087
1099
  version: t,
1088
1100
  postEvent: e
1089
1101
  })
@@ -1093,7 +1105,7 @@ class ct extends it {
1093
1105
  super(...arguments), c(this, "on", this.state.on.bind(this.state)), c(this, "off", this.state.off.bind(this.state));
1094
1106
  }
1095
1107
  }
1096
- class Qe extends ct {
1108
+ class Je extends ct {
1097
1109
  constructor(t, s) {
1098
1110
  super({ isConfirmationNeeded: t }), this.postEvent = s;
1099
1111
  }
@@ -1125,14 +1137,14 @@ const Fe = l(
1125
1137
  ({
1126
1138
  postEvent: e,
1127
1139
  state: t = { isConfirmationNeeded: !1 }
1128
- }) => new Qe(t.isConfirmationNeeded, e)
1140
+ }) => new Je(t.isConfirmationNeeded, e)
1129
1141
  );
1130
1142
  class ht {
1131
1143
  constructor(t, s) {
1132
- c(this, "supports"), this.supports = Dt(t, s);
1144
+ c(this, "supports"), this.supports = Nt(t, s);
1133
1145
  }
1134
1146
  }
1135
- function Ye(e) {
1147
+ function Qe(e) {
1136
1148
  if (Array.isArray(e))
1137
1149
  return e;
1138
1150
  if (typeof e == "string")
@@ -1144,9 +1156,9 @@ function Ye(e) {
1144
1156
  }
1145
1157
  throw T();
1146
1158
  }
1147
- class Ze extends j {
1159
+ class Ye extends G {
1148
1160
  constructor(t, s, n) {
1149
- super(Ye, s, n), c(this, "itemParser"), this.itemParser = typeof t == "function" ? t : t.parse.bind(t);
1161
+ super(Qe, s, n), c(this, "itemParser"), this.itemParser = typeof t == "function" ? t : t.parse.bind(t);
1150
1162
  }
1151
1163
  /**
1152
1164
  * Attempts to parse passed value
@@ -1162,13 +1174,13 @@ class Ze extends j {
1162
1174
  return this.itemParser = typeof t == "function" ? t : t.parse.bind(t), this;
1163
1175
  }
1164
1176
  }
1165
- function Xe(e) {
1166
- return new Ze((t) => t, !1, e);
1177
+ function Ze(e) {
1178
+ return new Ye((t) => t, !1, e);
1167
1179
  }
1168
1180
  function wt(e, t) {
1169
1181
  return Object.fromEntries(e.map((s) => [s, t]));
1170
1182
  }
1171
- class ts extends ht {
1183
+ class Xe extends ht {
1172
1184
  constructor(t, s, n) {
1173
1185
  super(t, {
1174
1186
  delete: "web_app_invoke_custom_method",
@@ -1184,7 +1196,7 @@ class ts extends ht {
1184
1196
  */
1185
1197
  async delete(t, s = {}) {
1186
1198
  const n = Array.isArray(t) ? t : [t];
1187
- n.length && await q(
1199
+ n.length && await O(
1188
1200
  "deleteStorageValues",
1189
1201
  { keys: n },
1190
1202
  this.createRequestId(),
@@ -1196,8 +1208,8 @@ class ts extends ht {
1196
1208
  * @param options - request execution options.
1197
1209
  */
1198
1210
  async getKeys(t = {}) {
1199
- return Xe().of(p()).parse(
1200
- await q(
1211
+ return Ze().of(p()).parse(
1212
+ await O(
1201
1213
  "getStorageKeys",
1202
1214
  {},
1203
1215
  this.createRequestId(),
@@ -1209,7 +1221,7 @@ class ts extends ht {
1209
1221
  const n = Array.isArray(t) ? t : [t];
1210
1222
  if (!n.length)
1211
1223
  return wt(n, "");
1212
- const r = await q(
1224
+ const r = await O(
1213
1225
  "getStorageValues",
1214
1226
  { keys: n },
1215
1227
  this.createRequestId(),
@@ -1224,7 +1236,7 @@ class ts extends ht {
1224
1236
  * @param options - request execution options.
1225
1237
  */
1226
1238
  async set(t, s, n = {}) {
1227
- await q(
1239
+ await O(
1228
1240
  "saveStorageValue",
1229
1241
  { key: t, value: s },
1230
1242
  this.createRequestId(),
@@ -1232,10 +1244,10 @@ class ts extends ht {
1232
1244
  );
1233
1245
  }
1234
1246
  }
1235
- const es = l(
1236
- ({ createRequestId: e, postEvent: t, version: s }) => new ts(s, e, t)
1247
+ const ts = l(
1248
+ ({ createRequestId: e, postEvent: t, version: s }) => new Xe(s, e, t)
1237
1249
  );
1238
- class ss extends ht {
1250
+ class es extends ht {
1239
1251
  constructor(t, s) {
1240
1252
  super(t, {
1241
1253
  impactOccurred: "web_app_trigger_haptic_feedback",
@@ -1277,10 +1289,10 @@ class ss extends ht {
1277
1289
  this.postEvent("web_app_trigger_haptic_feedback", { type: "selection_change" });
1278
1290
  }
1279
1291
  }
1280
- const ns = l(
1281
- ({ version: e, postEvent: t }) => new ss(e, t)
1292
+ const ss = l(
1293
+ ({ version: e, postEvent: t }) => new es(e, t)
1282
1294
  );
1283
- class rs {
1295
+ class ns {
1284
1296
  constructor(t) {
1285
1297
  this.initData = t;
1286
1298
  }
@@ -1353,13 +1365,13 @@ class rs {
1353
1365
  return this.initData.user;
1354
1366
  }
1355
1367
  }
1356
- const is = l(
1357
- ({ initData: e }) => e ? new rs(e) : void 0
1368
+ const rs = l(
1369
+ ({ initData: e }) => e ? new ns(e) : void 0
1358
1370
  );
1359
- function mn(e) {
1360
- return Bt().parse(e);
1371
+ function fn(e) {
1372
+ return Mt().parse(e);
1361
1373
  }
1362
- class os extends V {
1374
+ class is extends $ {
1363
1375
  constructor(t, s, n) {
1364
1376
  super({ isOpened: t }, s, { open: "web_app_open_invoice" }), this.postEvent = n;
1365
1377
  }
@@ -1382,10 +1394,10 @@ class os extends V {
1382
1394
  const { hostname: r, pathname: i } = new URL(t, window.location.href);
1383
1395
  if (r !== "t.me")
1384
1396
  throw new Error(`Incorrect hostname: ${r}`);
1385
- const a = i.match(/^\/(\$|invoice\/)([A-Za-z0-9\-_=]+)$/);
1386
- if (!a)
1397
+ const o = i.match(/^\/(\$|invoice\/)([A-Za-z0-9\-_=]+)$/);
1398
+ if (!o)
1387
1399
  throw new Error('Link pathname has incorrect format. Expected to receive "/invoice/{slug}" or "/${slug}"');
1388
- [, , n] = a;
1400
+ [, , n] = o;
1389
1401
  }
1390
1402
  this.isOpened = !0;
1391
1403
  try {
@@ -1403,13 +1415,19 @@ class os extends V {
1403
1415
  }
1404
1416
  }
1405
1417
  }
1406
- const as = l(
1407
- ({ version: e, postEvent: t }) => new os(!1, e, t)
1418
+ const os = l(
1419
+ ({ version: e, postEvent: t }) => new is(!1, e, t)
1408
1420
  );
1409
- class cs extends it {
1421
+ class as extends it {
1410
1422
  constructor({ postEvent: t, ...s }) {
1411
1423
  super(s), c(this, "postEvent"), c(this, "on", (n, r) => n === "click" ? E("main_button_pressed", r) : this.state.on(n, r)), c(this, "off", (n, r) => n === "click" ? z("main_button_pressed", r) : this.state.off(n, r)), this.postEvent = t;
1412
1424
  }
1425
+ /**
1426
+ * The MainButton background color.
1427
+ */
1428
+ get bgColor() {
1429
+ return this.get("bgColor");
1430
+ }
1413
1431
  /**
1414
1432
  * Sends current local state to the Telegram application.
1415
1433
  */
@@ -1419,10 +1437,35 @@ class cs extends it {
1419
1437
  is_active: this.isEnabled,
1420
1438
  is_progress_visible: this.isLoaderVisible,
1421
1439
  text: this.text,
1422
- color: this.backgroundColor,
1440
+ color: this.bgColor,
1423
1441
  text_color: this.textColor
1424
1442
  });
1425
1443
  }
1444
+ /**
1445
+ * Disables the MainButton.
1446
+ * @see Does not work on Android: https://github.com/Telegram-Mini-Apps/issues/issues/1
1447
+ */
1448
+ disable() {
1449
+ return this.isEnabled = !1, this;
1450
+ }
1451
+ /**
1452
+ * Enables the MainButton.
1453
+ */
1454
+ enable() {
1455
+ return this.isEnabled = !0, this;
1456
+ }
1457
+ /**
1458
+ * Hides the MainButton.
1459
+ */
1460
+ hide() {
1461
+ return this.isVisible = !1, this;
1462
+ }
1463
+ /**
1464
+ * Hides the MainButton loading indicator.
1465
+ */
1466
+ hideLoader() {
1467
+ return this.isLoaderVisible = !1, this;
1468
+ }
1426
1469
  set isEnabled(t) {
1427
1470
  this.setParams({ isEnabled: t });
1428
1471
  }
@@ -1450,49 +1493,6 @@ class cs extends it {
1450
1493
  get isVisible() {
1451
1494
  return this.get("isVisible");
1452
1495
  }
1453
- /**
1454
- * The MainButton background color.
1455
- */
1456
- get backgroundColor() {
1457
- return this.get("backgroundColor");
1458
- }
1459
- /**
1460
- * The MainButton text.
1461
- */
1462
- get text() {
1463
- return this.get("text");
1464
- }
1465
- /**
1466
- * The MainButton text color.
1467
- */
1468
- get textColor() {
1469
- return this.get("textColor");
1470
- }
1471
- /**
1472
- * Disables the MainButton.
1473
- * @see Does not work on Android: https://github.com/Telegram-Mini-Apps/issues/issues/1
1474
- */
1475
- disable() {
1476
- return this.isEnabled = !1, this;
1477
- }
1478
- /**
1479
- * Enables the MainButton.
1480
- */
1481
- enable() {
1482
- return this.isEnabled = !0, this;
1483
- }
1484
- /**
1485
- * Hides the MainButton.
1486
- */
1487
- hide() {
1488
- return this.isVisible = !1, this;
1489
- }
1490
- /**
1491
- * Hides the MainButton loading indicator.
1492
- */
1493
- hideLoader() {
1494
- return this.isLoaderVisible = !1, this;
1495
- }
1496
1496
  /**
1497
1497
  * Shows the MainButton.
1498
1498
  *
@@ -1524,10 +1524,10 @@ class cs extends it {
1524
1524
  }
1525
1525
  /**
1526
1526
  * Updates current Main Button color.
1527
- * @param backgroundColor - color to set.
1527
+ * @param bgColor - color to set.
1528
1528
  */
1529
- setBackgroundColor(t) {
1530
- return this.setParams({ backgroundColor: t });
1529
+ setBgColor(t) {
1530
+ return this.setParams({ bgColor: t });
1531
1531
  }
1532
1532
  /**
1533
1533
  * Allows setting multiple Main Button parameters.
@@ -1536,8 +1536,20 @@ class cs extends it {
1536
1536
  setParams(t) {
1537
1537
  return this.set(t), this.commit(), this;
1538
1538
  }
1539
+ /**
1540
+ * The MainButton text.
1541
+ */
1542
+ get text() {
1543
+ return this.get("text");
1544
+ }
1545
+ /**
1546
+ * The MainButton text color.
1547
+ */
1548
+ get textColor() {
1549
+ return this.get("textColor");
1550
+ }
1539
1551
  }
1540
- const hs = l(
1552
+ const cs = l(
1541
1553
  "mainButton",
1542
1554
  ({
1543
1555
  postEvent: e,
@@ -1548,11 +1560,11 @@ const hs = l(
1548
1560
  text: "",
1549
1561
  isLoaderVisible: !1,
1550
1562
  textColor: t.buttonTextColor || "#ffffff",
1551
- backgroundColor: t.buttonColor || "#000000"
1563
+ bgColor: t.buttonColor || "#000000"
1552
1564
  }
1553
- }) => new cs({ ...s, postEvent: e })
1565
+ }) => new as({ ...s, postEvent: e })
1554
1566
  );
1555
- function ps() {
1567
+ function hs() {
1556
1568
  return at({
1557
1569
  contact: g({
1558
1570
  userId: {
@@ -1573,24 +1585,24 @@ function ps() {
1573
1585
  }
1574
1586
  }),
1575
1587
  authDate: {
1576
- type: Nt(),
1588
+ type: Bt(),
1577
1589
  from: "auth_date"
1578
1590
  },
1579
1591
  hash: p()
1580
1592
  }, "RequestedContact");
1581
1593
  }
1582
- function Kt(e, t) {
1594
+ function Jt(e, t) {
1583
1595
  return (s) => {
1584
1596
  const [n, r] = t[s];
1585
- return S(n, r, e);
1597
+ return C(n, r, e);
1586
1598
  };
1587
1599
  }
1588
- function us(e) {
1600
+ function ps(e) {
1589
1601
  return new Promise((t) => {
1590
1602
  setTimeout(t, e);
1591
1603
  });
1592
1604
  }
1593
- class ls extends V {
1605
+ class us extends $ {
1594
1606
  constructor({ postEvent: t, createRequestId: s, version: n, botInline: r, ...i }) {
1595
1607
  super(i, n, {
1596
1608
  requestPhoneAccess: "web_app_request_phone",
@@ -1599,8 +1611,8 @@ class ls extends V {
1599
1611
  setHeaderColor: "web_app_set_header_color",
1600
1612
  setBackgroundColor: "web_app_set_background_color"
1601
1613
  }), c(this, "botInline"), c(this, "postEvent"), c(this, "createRequestId"), c(this, "requestPhoneAccessPromise"), c(this, "requestWriteAccessPromise"), c(this, "supportsParam"), this.createRequestId = s, this.postEvent = t, this.botInline = r;
1602
- const a = this.supports.bind(this);
1603
- this.supports = (o) => a(o) ? o !== "switchInlineQuery" || r : !1, this.supportsParam = Kt(n, {
1614
+ const o = this.supports.bind(this);
1615
+ this.supports = (a) => o(a) ? a !== "switchInlineQuery" || r : !1, this.supportsParam = Jt(n, {
1604
1616
  "setHeaderColor.color": ["web_app_set_header_color", "color"]
1605
1617
  });
1606
1618
  }
@@ -1611,8 +1623,8 @@ class ls extends V {
1611
1623
  async getRequestedContact({
1612
1624
  timeout: t = 1e4
1613
1625
  } = {}) {
1614
- return ps().parse(
1615
- await q(
1626
+ return hs().parse(
1627
+ await O(
1616
1628
  "getRequestedContact",
1617
1629
  {},
1618
1630
  this.createRequestId(),
@@ -1651,7 +1663,7 @@ class ls extends V {
1651
1663
  * True if current Mini App background color is recognized as dark.
1652
1664
  */
1653
1665
  get isDark() {
1654
- return qt(this.bgColor);
1666
+ return Dt(this.bgColor);
1655
1667
  }
1656
1668
  /**
1657
1669
  * Informs the Telegram app that the Mini App is ready to be displayed.
@@ -1686,9 +1698,9 @@ class ls extends V {
1686
1698
  return await this.getRequestedContact();
1687
1699
  } catch {
1688
1700
  }
1689
- await us(n), n += 50;
1701
+ await ps(n), n += 50;
1690
1702
  }
1691
- throw It(t);
1703
+ throw qt(t);
1692
1704
  }, t);
1693
1705
  }
1694
1706
  /**
@@ -1771,7 +1783,7 @@ class ls extends V {
1771
1783
  this.postEvent("web_app_switch_inline_query", { query: t, chat_types: s });
1772
1784
  }
1773
1785
  }
1774
- const ds = l(
1786
+ const ls = l(
1775
1787
  "miniApp",
1776
1788
  ({
1777
1789
  themeParams: e,
@@ -1781,9 +1793,9 @@ const ds = l(
1781
1793
  headerColor: e.headerBgColor || "#000000"
1782
1794
  },
1783
1795
  ...n
1784
- }) => new ls({ ...n, ...s, botInline: t })
1796
+ }) => new us({ ...n, ...s, botInline: t })
1785
1797
  );
1786
- function _s(e) {
1798
+ function ds(e) {
1787
1799
  const t = e.message.trim(), s = (e.title || "").trim(), n = e.buttons || [];
1788
1800
  let r;
1789
1801
  if (s.length > 64)
@@ -1793,21 +1805,21 @@ function _s(e) {
1793
1805
  if (n.length > 3)
1794
1806
  throw new Error(`Buttons have incorrect size: ${n.length}`);
1795
1807
  return n.length ? r = n.map((i) => {
1796
- const { id: a = "" } = i;
1797
- if (a.length > 64)
1798
- throw new Error(`Button ID has incorrect size: ${a}`);
1808
+ const { id: o = "" } = i;
1809
+ if (o.length > 64)
1810
+ throw new Error(`Button ID has incorrect size: ${o}`);
1799
1811
  if (!i.type || i.type === "default" || i.type === "destructive") {
1800
- const o = i.text.trim();
1801
- if (!o.length || o.length > 64) {
1812
+ const a = i.text.trim();
1813
+ if (!a.length || a.length > 64) {
1802
1814
  const u = i.type || "default";
1803
1815
  throw new Error(`Button text with type "${u}" has incorrect size: ${i.text.length}`);
1804
1816
  }
1805
- return { ...i, text: o, id: a };
1817
+ return { ...i, text: a, id: o };
1806
1818
  }
1807
- return { ...i, id: a };
1819
+ return { ...i, id: o };
1808
1820
  }) : r = [{ type: "close", id: "" }], { title: s, message: t, buttons: r };
1809
1821
  }
1810
- class gs extends V {
1822
+ class _s extends $ {
1811
1823
  constructor(t, s, n) {
1812
1824
  super({ isOpened: t }, s, { open: "web_app_open_popup" }), this.postEvent = n;
1813
1825
  }
@@ -1840,7 +1852,7 @@ class gs extends V {
1840
1852
  event: "popup_closed",
1841
1853
  method: "web_app_open_popup",
1842
1854
  postEvent: this.postEvent,
1843
- params: _s(t)
1855
+ params: ds(t)
1844
1856
  });
1845
1857
  return s;
1846
1858
  } finally {
@@ -1848,10 +1860,10 @@ class gs extends V {
1848
1860
  }
1849
1861
  }
1850
1862
  }
1851
- const ws = l(
1852
- ({ postEvent: e, version: t }) => new gs(!1, t, e)
1863
+ const gs = l(
1864
+ ({ postEvent: e, version: t }) => new _s(!1, t, e)
1853
1865
  );
1854
- class fs extends V {
1866
+ class ws extends $ {
1855
1867
  constructor(t, s, n) {
1856
1868
  super({ isOpened: t }, s, {
1857
1869
  close: "web_app_close_scan_qr_popup",
@@ -1895,10 +1907,10 @@ class fs extends V {
1895
1907
  }
1896
1908
  }
1897
1909
  }
1898
- const ms = l(
1899
- ({ version: e, postEvent: t }) => new fs(!1, e, t)
1910
+ const fs = l(
1911
+ ({ version: e, postEvent: t }) => new ws(!1, e, t)
1900
1912
  );
1901
- class bs extends ot {
1913
+ class ms extends ot {
1902
1914
  constructor(t, s, n) {
1903
1915
  super({ isVisible: t }, s, {
1904
1916
  show: "web_app_setup_settings_button",
@@ -1927,18 +1939,18 @@ class bs extends ot {
1927
1939
  this.isVisible = !0;
1928
1940
  }
1929
1941
  }
1930
- const vs = l(
1942
+ const bs = l(
1931
1943
  "settingsButton",
1932
1944
  ({
1933
1945
  version: e,
1934
1946
  postEvent: t,
1935
1947
  state: s = { isVisible: !1 }
1936
- }) => new bs(s.isVisible, e, t)
1948
+ }) => new ms(s.isVisible, e, t)
1937
1949
  );
1938
- function Jt(e) {
1939
- return Mt().parse(e);
1950
+ function Ft(e) {
1951
+ return Vt().parse(e);
1940
1952
  }
1941
- class ys extends ct {
1953
+ class vs extends ct {
1942
1954
  /**
1943
1955
  * @since v6.10
1944
1956
  */
@@ -1977,7 +1989,7 @@ class ys extends ct {
1977
1989
  * value is calculated according to theme bg color.
1978
1990
  */
1979
1991
  get isDark() {
1980
- return !this.bgColor || qt(this.bgColor);
1992
+ return !this.bgColor || Dt(this.bgColor);
1981
1993
  }
1982
1994
  get linkColor() {
1983
1995
  return this.get("linkColor");
@@ -2003,7 +2015,7 @@ class ys extends ct {
2003
2015
  */
2004
2016
  listen() {
2005
2017
  return E("theme_changed", (t) => {
2006
- this.set(Jt(t.theme_params));
2018
+ this.set(Ft(t.theme_params));
2007
2019
  });
2008
2020
  }
2009
2021
  /**
@@ -2016,23 +2028,23 @@ class ys extends ct {
2016
2028
  return this.get("textColor");
2017
2029
  }
2018
2030
  }
2019
- const Es = l(
2031
+ const ys = l(
2020
2032
  "themeParams",
2021
2033
  ({ themeParams: e, state: t = e, addCleanup: s }) => {
2022
- const n = new ys(t);
2034
+ const n = new vs(t);
2023
2035
  return s(n.listen()), n;
2024
2036
  }
2025
2037
  );
2026
- function bn(e = {}) {
2038
+ function mn(e = {}) {
2027
2039
  return w({
2028
2040
  ...e,
2029
2041
  method: "web_app_request_theme",
2030
2042
  event: "theme_changed"
2031
- }).then(Jt);
2043
+ }).then(Ft);
2032
2044
  }
2033
- class Ps extends ht {
2045
+ class Es extends ht {
2034
2046
  constructor(t, s, n) {
2035
- super(t, { readTextFromClipboard: "web_app_read_text_from_clipboard" }), c(this, "supportsParam"), this.version = t, this.createRequestId = s, this.postEvent = n, this.supportsParam = Kt(t, {
2047
+ super(t, { readTextFromClipboard: "web_app_read_text_from_clipboard" }), c(this, "supportsParam"), this.version = t, this.createRequestId = s, this.postEvent = n, this.supportsParam = Jt(t, {
2036
2048
  "openLink.tryInstantView": ["web_app_open_link", "try_instant_view"]
2037
2049
  });
2038
2050
  }
@@ -2047,7 +2059,7 @@ class Ps extends ht {
2047
2059
  */
2048
2060
  openLink(t, s) {
2049
2061
  const n = new URL(t, window.location.href).toString();
2050
- if (!S("web_app_open_link", this.version)) {
2062
+ if (!C("web_app_open_link", this.version)) {
2051
2063
  window.open(n, "_blank");
2052
2064
  return;
2053
2065
  }
@@ -2066,7 +2078,7 @@ class Ps extends ht {
2066
2078
  const { hostname: s, pathname: n, search: r } = new URL(t, window.location.href);
2067
2079
  if (s !== "t.me")
2068
2080
  throw new Error(`URL has not allowed hostname: ${s}. Only "t.me" is allowed`);
2069
- if (!S("web_app_open_tg_link", this.version)) {
2081
+ if (!C("web_app_open_tg_link", this.version)) {
2070
2082
  window.location.href = t;
2071
2083
  return;
2072
2084
  }
@@ -2091,8 +2103,8 @@ class Ps extends ht {
2091
2103
  return s;
2092
2104
  }
2093
2105
  }
2094
- const Rs = l(
2095
- ({ version: e, postEvent: t, createRequestId: s }) => new Ps(e, s, t)
2106
+ const Ps = l(
2107
+ ({ version: e, postEvent: t, createRequestId: s }) => new Es(e, s, t)
2096
2108
  );
2097
2109
  async function Qt(e = {}) {
2098
2110
  const {
@@ -2106,16 +2118,16 @@ async function Qt(e = {}) {
2106
2118
  });
2107
2119
  return { ...n, isExpanded: t, isStateStable: s };
2108
2120
  }
2109
- function O(e) {
2121
+ function q(e) {
2110
2122
  return e < 0 ? 0 : e;
2111
2123
  }
2112
- class xs extends ct {
2124
+ class Rs extends ct {
2113
2125
  constructor({ postEvent: t, stableHeight: s, height: n, width: r, isExpanded: i }) {
2114
2126
  super({
2115
- height: O(n),
2127
+ height: q(n),
2116
2128
  isExpanded: i,
2117
- stableHeight: O(s),
2118
- width: O(r)
2129
+ stableHeight: q(s),
2130
+ width: q(r)
2119
2131
  }), c(this, "postEvent"), this.postEvent = t;
2120
2132
  }
2121
2133
  /**
@@ -2177,12 +2189,12 @@ class xs extends ct {
2177
2189
  width: n,
2178
2190
  is_expanded: r,
2179
2191
  is_state_stable: i
2180
- } = t, a = O(s);
2192
+ } = t, o = q(s);
2181
2193
  this.set({
2182
- height: a,
2194
+ height: o,
2183
2195
  isExpanded: r,
2184
- width: O(n),
2185
- ...i ? { stableHeight: a } : {}
2196
+ width: q(n),
2197
+ ...i ? { stableHeight: o } : {}
2186
2198
  });
2187
2199
  });
2188
2200
  }
@@ -2216,23 +2228,23 @@ class xs extends ct {
2216
2228
  return this.stableHeight === this.height;
2217
2229
  }
2218
2230
  }
2219
- const Cs = l(
2231
+ const xs = l(
2220
2232
  "viewport",
2221
2233
  async ({ state: e, platform: t, postEvent: s, addCleanup: n }) => {
2222
- let r = !1, i = 0, a = 0, o = 0;
2234
+ let r = !1, i = 0, o = 0, a = 0;
2223
2235
  if (e)
2224
- r = e.isExpanded, i = e.height, a = e.width, o = e.stableHeight;
2236
+ r = e.isExpanded, i = e.height, o = e.width, a = e.stableHeight;
2225
2237
  else if (["macos", "tdesktop", "unigram", "webk", "weba", "web"].includes(t))
2226
- r = !0, i = window.innerHeight, a = window.innerWidth, o = window.innerHeight;
2238
+ r = !0, i = window.innerHeight, o = window.innerWidth, a = window.innerHeight;
2227
2239
  else {
2228
2240
  const h = await Qt({ timeout: 1e3, postEvent: s });
2229
- r = h.isExpanded, i = h.height, a = h.width, o = h.isStateStable ? i : 0;
2241
+ r = h.isExpanded, i = h.height, o = h.width, a = h.isStateStable ? i : 0;
2230
2242
  }
2231
- const u = new xs({
2243
+ const u = new Rs({
2232
2244
  postEvent: s,
2233
2245
  height: i,
2234
- width: a,
2235
- stableHeight: o,
2246
+ width: o,
2247
+ stableHeight: a,
2236
2248
  isExpanded: r
2237
2249
  });
2238
2250
  return n(u.listen()), u;
@@ -2241,24 +2253,24 @@ const Cs = l(
2241
2253
  function R(e, t) {
2242
2254
  document.documentElement.style.setProperty(e, t);
2243
2255
  }
2244
- function vn(e, t, s) {
2245
- s || (s = (o) => `--tg-${o}-color`);
2256
+ function bn(e, t, s) {
2257
+ s || (s = (a) => `--tg-${a}-color`);
2246
2258
  const n = s("header"), r = s("bg"), i = () => {
2247
- const { headerColor: o } = e;
2248
- if (rt(o))
2249
- R(n, o);
2259
+ const { headerColor: a } = e;
2260
+ if (rt(a))
2261
+ R(n, a);
2250
2262
  else {
2251
2263
  const { bgColor: u, secondaryBgColor: h } = t;
2252
- o === "bg_color" && u ? R(n, u) : o === "secondary_bg_color" && h && R(n, h);
2264
+ a === "bg_color" && u ? R(n, u) : a === "secondary_bg_color" && h && R(n, h);
2253
2265
  }
2254
2266
  R(r, e.bgColor);
2255
- }, a = [
2267
+ }, o = [
2256
2268
  t.on("change", i),
2257
2269
  e.on("change", i)
2258
2270
  ];
2259
- return i(), () => a.forEach((o) => o());
2271
+ return i(), () => o.forEach((a) => a());
2260
2272
  }
2261
- function yn(e, t) {
2273
+ function vn(e, t) {
2262
2274
  t || (t = (n) => `--tg-theme-${n.replace(/[A-Z]/g, (r) => `-${r.toLowerCase()}`)}`);
2263
2275
  const s = () => {
2264
2276
  Object.entries(e.getState()).forEach(([n, r]) => {
@@ -2267,23 +2279,23 @@ function yn(e, t) {
2267
2279
  };
2268
2280
  return s(), e.on("change", s);
2269
2281
  }
2270
- function En(e, t) {
2282
+ function yn(e, t) {
2271
2283
  t || (t = (h) => `--tg-viewport-${h}`);
2272
2284
  const [
2273
2285
  s,
2274
2286
  n,
2275
2287
  r
2276
- ] = ["height", "width", "stable-height"].map((h) => t(h)), i = () => R(s, `${e.height}px`), a = () => R(n, `${e.width}px`), o = () => R(r, `${e.stableHeight}px`), u = [
2288
+ ] = ["height", "width", "stable-height"].map((h) => t(h)), i = () => R(s, `${e.height}px`), o = () => R(n, `${e.width}px`), a = () => R(r, `${e.stableHeight}px`), u = [
2277
2289
  e.on("change:height", i),
2278
- e.on("change:width", a),
2279
- e.on("change:stableHeight", o)
2290
+ e.on("change:width", o),
2291
+ e.on("change:stableHeight", a)
2280
2292
  ];
2281
- return i(), a(), o(), () => u.forEach((h) => h());
2293
+ return i(), o(), a(), () => u.forEach((h) => h());
2282
2294
  }
2283
- function Ss(e = !0) {
2295
+ function Cs(e = !0) {
2284
2296
  const t = [
2285
2297
  E("reload_iframe", () => {
2286
- N("iframe_will_reload"), window.location.reload();
2298
+ B("iframe_will_reload"), window.location.reload();
2287
2299
  })
2288
2300
  ], s = () => t.forEach((n) => n());
2289
2301
  if (e) {
@@ -2295,13 +2307,13 @@ function Ss(e = !0) {
2295
2307
  () => document.head.removeChild(n)
2296
2308
  );
2297
2309
  }
2298
- return N("iframe_ready", { reload_supported: !0 }), s;
2310
+ return B("iframe_ready", { reload_supported: !0 }), s;
2299
2311
  }
2300
- function Ts() {
2312
+ function Ss() {
2301
2313
  return typeof window > "u";
2302
2314
  }
2303
- async function Pn() {
2304
- if (St(window))
2315
+ async function En() {
2316
+ if (Tt(window))
2305
2317
  return !0;
2306
2318
  try {
2307
2319
  return await w({ method: "web_app_request_theme", event: "theme_changed", timeout: 100 }), !0;
@@ -2309,11 +2321,11 @@ async function Pn() {
2309
2321
  return !1;
2310
2322
  }
2311
2323
  }
2312
- function As(e) {
2324
+ function Ts(e) {
2313
2325
  return e instanceof W;
2314
2326
  }
2315
- function Rn(e, t) {
2316
- return As(e) && e.type === t;
2327
+ function Pn(e, t) {
2328
+ return Ts(e) && e.type === t;
2317
2329
  }
2318
2330
  function J(e, t) {
2319
2331
  let s, n, r;
@@ -2323,13 +2335,13 @@ function J(e, t) {
2323
2335
  params: n
2324
2336
  });
2325
2337
  }
2326
- class ks {
2327
- constructor(t, s, n = N) {
2328
- if (c(this, "history"), c(this, "ee", new H()), 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)
2329
- throw m(_e, "History should not be empty.");
2338
+ class As {
2339
+ constructor(t, s, n = B) {
2340
+ if (c(this, "history"), c(this, "ee", new N()), 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)
2341
+ throw m(ge, "History should not be empty.");
2330
2342
  if (s < 0 || s >= t.length)
2331
2343
  throw m(
2332
- ge,
2344
+ we,
2333
2345
  "Index should not be zero and higher or equal than history size."
2334
2346
  );
2335
2347
  this.history = t.map((r) => J(r, ""));
@@ -2444,30 +2456,30 @@ class ks {
2444
2456
  this.postEvent("web_app_setup_back_button", { is_visible: !!this.index });
2445
2457
  }
2446
2458
  }
2447
- function Q({
2459
+ function F({
2448
2460
  params: e,
2449
2461
  ...t
2450
2462
  }) {
2451
2463
  return { ...e || { hash: "", search: "" }, ...t };
2452
2464
  }
2453
- function B(e, t) {
2465
+ function M(e, t) {
2454
2466
  return e.startsWith(t) ? e : `${t}${e}`;
2455
2467
  }
2456
- function L(e) {
2468
+ function H(e) {
2457
2469
  return new URL(
2458
- typeof e == "string" ? e : `${e.pathname || ""}${B(e.search || "", "?")}${B(e.hash || "", "#")}`,
2470
+ typeof e == "string" ? e : `${e.pathname || ""}${M(e.search || "", "?")}${M(e.hash || "", "#")}`,
2459
2471
  "http://a"
2460
2472
  );
2461
2473
  }
2462
2474
  function U(e) {
2463
- const t = typeof e == "string" ? e.startsWith("/") : !!(e.pathname && e.pathname.startsWith("/")), s = L(e);
2475
+ const t = typeof e == "string" ? e.startsWith("/") : !!(e.pathname && e.pathname.startsWith("/")), s = H(e);
2464
2476
  return `${t ? s.pathname : s.pathname.slice(1)}${s.search}${s.hash}`;
2465
2477
  }
2466
- function F(e, t, s) {
2478
+ function Q(e, t, s) {
2467
2479
  let n, r;
2468
2480
  typeof e == "string" ? n = e : (n = U(e), s = e.state, r = e.id);
2469
- const { pathname: i, search: a, hash: o } = new URL(n, `http://a${B(t, "/")}`);
2470
- return { id: r, pathname: i, params: { hash: o, search: a, state: s } };
2481
+ const { pathname: i, search: o, hash: a } = new URL(n, `http://a${M(t, "/")}`);
2482
+ return { id: r, pathname: i, params: { hash: a, search: o, state: s } };
2471
2483
  }
2472
2484
  async function D(e) {
2473
2485
  return e === 0 ? !0 : Promise.race([
@@ -2490,32 +2502,32 @@ async function Is() {
2490
2502
  for (; e; )
2491
2503
  e = await D(-1);
2492
2504
  }
2493
- function Ft(e) {
2494
- return L(e).pathname;
2505
+ function Yt(e) {
2506
+ return H(e).pathname;
2495
2507
  }
2496
2508
  const ft = 0, Y = 1, Z = 2;
2497
- class Yt {
2509
+ class Zt {
2498
2510
  constructor(t, s, { postEvent: n, hashMode: r = "classic", base: i } = {}) {
2499
- c(this, "navigator"), c(this, "ee", new H()), c(this, "hashMode"), c(this, "base"), c(this, "attached", !1), c(this, "onPopState", ({ state: a }) => {
2500
- if (a === null)
2511
+ c(this, "navigator"), c(this, "ee", new N()), c(this, "hashMode"), c(this, "base"), c(this, "attached", !1), c(this, "onPopState", ({ state: o }) => {
2512
+ if (o === null)
2501
2513
  return this.push(this.parsePath(window.location.href));
2502
- a === ft ? window.history.forward() : a === Y && this.back(), a === Z && this.forward();
2514
+ o === ft ? window.history.forward() : o === Y && this.back(), o === Z && this.forward();
2503
2515
  }), c(this, "onNavigatorChange", async ({
2504
- to: a,
2505
- from: o,
2516
+ to: o,
2517
+ from: a,
2506
2518
  delta: u
2507
2519
  }) => {
2508
2520
  this.attached && await this.syncHistory(), this.ee.emit("change", {
2509
2521
  delta: u,
2510
- from: Q(o),
2511
- to: Q(a),
2522
+ from: F(a),
2523
+ to: F(o),
2512
2524
  navigator: this
2513
2525
  });
2514
- }), c(this, "on", this.ee.on.bind(this.ee)), c(this, "off", this.ee.off.bind(this.ee)), this.navigator = new ks(
2515
- t.map((a) => F(a, "/")),
2526
+ }), c(this, "on", this.ee.on.bind(this.ee)), c(this, "off", this.ee.off.bind(this.ee)), this.navigator = new As(
2527
+ t.map((o) => Q(o, "/")),
2516
2528
  s,
2517
2529
  n
2518
- ), this.navigator.on("change", this.onNavigatorChange), this.hashMode = r, this.base = Ft(i || "");
2530
+ ), this.navigator.on("change", this.onNavigatorChange), this.hashMode = r, this.base = Yt(i || "");
2519
2531
  }
2520
2532
  /**
2521
2533
  * Attaches current navigator to the browser history allowing navigator to manipulate it.
@@ -2599,7 +2611,7 @@ class Yt {
2599
2611
  * Navigation history.
2600
2612
  */
2601
2613
  get history() {
2602
- return this.navigator.history.map(Q);
2614
+ return this.navigator.history.map(F);
2603
2615
  }
2604
2616
  /**
2605
2617
  * Path, including pathname, search and hash.
@@ -2642,19 +2654,19 @@ class Yt {
2642
2654
  * // { pathname: '/tma', search: '?is=cool', hash: '#yeah' }
2643
2655
  */
2644
2656
  parsePath(t) {
2645
- let s = L(t);
2646
- return this.hashMode && (s = L(s.hash.slice(1))), {
2657
+ let s = H(t);
2658
+ return this.hashMode && (s = H(s.hash.slice(1))), {
2647
2659
  pathname: s.pathname,
2648
2660
  search: s.search,
2649
2661
  hash: s.hash
2650
2662
  };
2651
2663
  }
2652
2664
  push(t, s) {
2653
- const n = F(t, this.path), { state: r = s } = n.params;
2665
+ const n = Q(t, this.path), { state: r = s } = n.params;
2654
2666
  this.navigator.push({ ...n, params: { ...n.params, state: r } });
2655
2667
  }
2656
2668
  replace(t, s) {
2657
- const n = F(t, this.path), { state: r = s } = n.params;
2669
+ const n = Q(t, this.path), { state: r = s } = n.params;
2658
2670
  this.navigator.replace({ ...n, params: { ...n.params, state: r } });
2659
2671
  }
2660
2672
  /**
@@ -2663,8 +2675,8 @@ class Yt {
2663
2675
  * @param value - path presented as string or URLLike.
2664
2676
  */
2665
2677
  renderPath(t) {
2666
- const s = (this.base.length === 1 ? "" : this.base) + B(U(t), "/");
2667
- return this.hashMode ? B(s.slice(1), this.hashMode === "classic" ? "#" : "#/") : s;
2678
+ const s = (this.base.length === 1 ? "" : this.base) + M(U(t), "/");
2679
+ return this.hashMode ? M(s.slice(1), this.hashMode === "classic" ? "#" : "#/") : s;
2668
2680
  }
2669
2681
  /**
2670
2682
  * Synchronizes current navigator state with browser history.
@@ -2690,41 +2702,41 @@ class Yt {
2690
2702
  return (this.navigator.current.params || {}).state;
2691
2703
  }
2692
2704
  }
2693
- function Os(e) {
2705
+ function ks(e) {
2694
2706
  e || (e = {});
2695
2707
  const { href: t, hash: s } = window.location;
2696
2708
  let n = U(
2697
2709
  e.hashMode === null ? t : s.includes("?") ? s.slice(1) : `?${s.slice(1)}`
2698
2710
  );
2699
- const r = e.base ? Ft(e.base) : void 0;
2711
+ const r = e.base ? Yt(e.base) : void 0;
2700
2712
  if (r) {
2701
2713
  if (!n.startsWith(r))
2702
2714
  throw m(
2703
- we,
2715
+ fe,
2704
2716
  `Path "${n}" expected to be starting with "${r}"`
2705
2717
  );
2706
2718
  n = n.slice(r.length);
2707
2719
  }
2708
- return new Yt([n], 0, e);
2720
+ return new Zt([n], 0, e);
2709
2721
  }
2710
- function xn(e) {
2722
+ function Rn(e) {
2711
2723
  const t = e.match(/#(.+)/);
2712
2724
  return t ? t[1] : null;
2713
2725
  }
2714
2726
  function qs(e, t) {
2715
- if (Gt()) {
2727
+ if (zt()) {
2716
2728
  const s = sessionStorage.getItem(e);
2717
2729
  if (s)
2718
2730
  try {
2719
2731
  const { index: n, history: r } = JSON.parse(s);
2720
- return new Yt(r, n, t);
2732
+ return new Zt(r, n, t);
2721
2733
  } catch (n) {
2722
2734
  console.error("Unable to restore hash navigator state.", n);
2723
2735
  }
2724
2736
  }
2725
- return Os(t);
2737
+ return ks(t);
2726
2738
  }
2727
- function Cn(e, t) {
2739
+ function xn(e, t) {
2728
2740
  const s = qs(e, t), n = () => sessionStorage.setItem(e, JSON.stringify({
2729
2741
  index: s.index,
2730
2742
  history: s.history
@@ -2733,31 +2745,36 @@ function Cn(e, t) {
2733
2745
  }
2734
2746
  function d(e, t) {
2735
2747
  function s(n) {
2736
- return (r, i, a) => (o) => {
2737
- const u = o[i] || [], h = { ...o, [r]: n(...u) };
2738
- return /* @__PURE__ */ mt(a, { ...h });
2748
+ return function(i, o, a) {
2749
+ return (u) => {
2750
+ const h = {
2751
+ ...u,
2752
+ [i]: n(o)
2753
+ };
2754
+ return /* @__PURE__ */ mt(a, { ...h });
2755
+ };
2739
2756
  };
2740
2757
  }
2741
2758
  return [s(e), s(t)];
2742
2759
  }
2743
- const Zt = Xt(void 0);
2744
- function Ds() {
2745
- const e = te(Zt);
2760
+ const Xt = te(void 0);
2761
+ function Os() {
2762
+ const e = ee(Xt);
2746
2763
  if (!e)
2747
2764
  throw new Error("useSDK was used outside the SDKProvider.");
2748
2765
  return e;
2749
2766
  }
2750
2767
  function _(e) {
2751
2768
  function t(n) {
2752
- const r = Ds(), [i, a] = bt(
2769
+ const r = Os(), [i, o] = bt(
2753
2770
  n ? void 0 : () => {
2754
- if (Ts())
2771
+ if (Ss())
2755
2772
  throw new Error("Using hooks on the server side, you must explicitly specify ssr = true option");
2756
2773
  return r.use(e);
2757
2774
  }
2758
2775
  );
2759
- return C(() => {
2760
- a(r.use(e));
2776
+ return S(() => {
2777
+ o(r.use(e));
2761
2778
  }, [r]), i;
2762
2779
  }
2763
2780
  function s(n) {
@@ -2770,31 +2787,31 @@ function _(e) {
2770
2787
  }
2771
2788
  return [t, s];
2772
2789
  }
2773
- const [Ns, Bs] = _(Ge), [Sn, Tn] = d(
2774
- Ns,
2775
- Bs
2776
- ), [Ms, Vs] = _(Je), [An, kn] = d(
2777
- Ms,
2778
- Vs
2779
- ), [$s, Ls] = _(Fe), [In, On] = d(
2780
- $s,
2781
- Ls
2782
- ), [Us, Hs] = _(es), [qn, Dn] = d(
2783
- Us,
2790
+ const [Ds, Ns] = _(Ge), [Cn, Sn] = d(
2791
+ Ds,
2792
+ Ns
2793
+ ), [Bs, Ms] = _(Ke), [Tn, An] = d(
2794
+ Bs,
2795
+ Ms
2796
+ ), [Vs, $s] = _(Fe), [In, kn] = d(
2797
+ Vs,
2798
+ $s
2799
+ ), [Ls, Hs] = _(ts), [qn, On] = d(
2800
+ Ls,
2784
2801
  Hs
2785
- ), [Ws, js] = _(ns), [Nn, Bn] = d(
2786
- Ws,
2787
- js
2788
- ), [Gs, zs] = _(is), [Mn, Vn] = d(Gs, zs), [Ks, Js] = _(as), [$n, Ln] = d(Ks, Js), [Qs, Fs] = _(hs), [Un, Hn] = d(Qs, Fs), [Ys, Zs] = _(ds), [Wn, jn] = d(Ys, Zs), [Xs, tn] = _(ws), [Gn, zn] = d(Xs, tn), [en, sn] = _(ms), [Kn, Jn] = d(en, sn), [nn, rn] = _(vs), [Qn, Fn] = d(
2789
- nn,
2790
- rn
2791
- ), [on, an] = _(Es), [Yn, Zn] = d(on, an);
2792
- function Xn() {
2802
+ ), [Us, Ws] = _(ss), [Dn, Nn] = d(
2803
+ Us,
2804
+ Ws
2805
+ ), [Gs, js] = _(rs), [Bn, Mn] = d(Gs, js), [zs, Ks] = _(os), [Vn, $n] = d(zs, Ks), [Js, Fs] = _(cs), [Ln, Hn] = d(Js, Fs), [Qs, Ys] = _(ls), [Un, Wn] = d(Qs, Ys), [Zs, Xs] = _(gs), [Gn, jn] = d(Zs, Xs), [tn, en] = _(fs), [zn, Kn] = d(tn, en), [sn, nn] = _(bs), [Jn, Fn] = d(
2806
+ sn,
2807
+ nn
2808
+ ), [rn, on] = _(ys), [Qn, Yn] = d(rn, on);
2809
+ function Zn() {
2793
2810
  return vt(jt, []);
2794
2811
  }
2795
- const [cn, hn] = _(Rs), [tr, er] = d(cn, hn), [pn, un] = _(Cs), [sr, nr] = d(pn, un);
2796
- function rr({ children: e, acceptCustomStyles: t, debug: s }) {
2797
- const n = dt(!0), [r, i] = bt(/* @__PURE__ */ new Map()), a = dt(r), o = ee(
2812
+ const [an, cn] = _(Ps), [Xn, tr] = d(an, cn), [hn, pn] = _(xs), [er, sr] = d(hn, pn);
2813
+ function nr({ children: e, acceptCustomStyles: t, debug: s }) {
2814
+ const n = dt(!0), [r, i] = bt(/* @__PURE__ */ new Map()), o = dt(r), a = se(
2798
2815
  (h) => {
2799
2816
  n.current && i((v) => (h && h(v), new Map(v)));
2800
2817
  },
@@ -2810,208 +2827,208 @@ function rr({ children: e, acceptCustomStyles: t, debug: s }) {
2810
2827
  } catch (f) {
2811
2828
  K = f;
2812
2829
  }
2813
- function $(f) {
2830
+ function L(f) {
2814
2831
  return r.set(h, f), f;
2815
2832
  }
2816
2833
  if (K)
2817
- return $({ error: K });
2818
- let k;
2819
- if (Array.isArray(b) && (k = b[1], b = b[0]), !b)
2820
- return $({ result: b, cleanup: k });
2834
+ return L({ error: K });
2835
+ let I;
2836
+ if (Array.isArray(b) && (I = b[1], b = b[0]), !b)
2837
+ return L({ result: b, cleanup: I });
2821
2838
  function ut(f) {
2822
2839
  if ("on" in f) {
2823
- const I = f.on("change", () => o()), lt = k;
2824
- k = () => {
2825
- lt && lt(), I();
2840
+ const k = f.on("change", () => a()), lt = I;
2841
+ I = () => {
2842
+ lt && lt(), k();
2826
2843
  };
2827
2844
  }
2828
- return { result: f, cleanup: k };
2845
+ return { result: f, cleanup: I };
2829
2846
  }
2830
2847
  return b instanceof Promise ? (b.then(
2831
- (f) => o((I) => I.set(h, ut(f))),
2832
- (f) => o((I) => I.set(h, { error: f }))
2833
- ), $({})) : $(ut(b));
2848
+ (f) => a((k) => k.set(h, ut(f))),
2849
+ (f) => a((k) => k.set(h, { error: f }))
2850
+ ), L({})) : L(ut(b));
2834
2851
  }
2835
2852
  }), [r]);
2836
- return C(() => (n.current = !0, () => {
2853
+ return S(() => (n.current = !0, () => {
2837
2854
  n.current = !1;
2838
- }), []), C(() => {
2839
- if (Tt())
2840
- return Ss(t);
2841
- }, [t]), C(() => {
2842
- oe(s || !1);
2843
- }, [s]), C(() => {
2844
- a.current = r;
2845
- }, [r]), C(() => () => {
2846
- a.current.forEach((h) => {
2855
+ }), []), S(() => {
2856
+ if (At())
2857
+ return Cs(t);
2858
+ }, [t]), S(() => {
2859
+ ae(s || !1);
2860
+ }, [s]), S(() => {
2861
+ o.current = r;
2862
+ }, [r]), S(() => () => {
2863
+ o.current.forEach((h) => {
2847
2864
  "cleanup" in h && h.cleanup && h.cleanup();
2848
2865
  });
2849
- }, []), /* @__PURE__ */ mt(Zt.Provider, { value: u, children: e });
2866
+ }, []), /* @__PURE__ */ mt(Xt.Provider, { value: u, children: e });
2850
2867
  }
2851
2868
  export {
2852
- Oe as BackButton,
2853
- ks as BasicNavigator,
2854
- ze as BiometryManager,
2855
- Yt as BrowserNavigator,
2856
- Qe as ClosingBehavior,
2857
- ts as CloudStorage,
2858
- we as ERR_INVALID_PATH_BASE,
2859
- ue as ERR_INVOKE_CUSTOM_METHOD_RESPONSE,
2860
- he as ERR_METHOD_PARAMETER_UNSUPPORTED,
2861
- ce as ERR_METHOD_UNSUPPORTED,
2862
- _e as ERR_NAVIGATION_HISTORY_EMPTY,
2863
- ge as ERR_NAVIGATION_INDEX_INVALID,
2864
- _n as ERR_NAVIGATION_ITEM_INVALID,
2865
- Pt as ERR_PARSE,
2866
- gn as ERR_SSR_INIT,
2867
- le as ERR_TIMED_OUT,
2868
- de as ERR_UNEXPECTED_TYPE,
2869
- pe as ERR_UNKNOWN_ENV,
2870
- H as EventEmitter,
2871
- ss as HapticFeedback,
2872
- rs as InitData,
2873
- os as Invoice,
2874
- cs as MainButton,
2875
- ls as MiniApp,
2876
- gs as Popup,
2877
- fs as QRScanner,
2869
+ qe as BackButton,
2870
+ As as BasicNavigator,
2871
+ je as BiometryManager,
2872
+ Zt as BrowserNavigator,
2873
+ Je as ClosingBehavior,
2874
+ Xe as CloudStorage,
2875
+ fe as ERR_INVALID_PATH_BASE,
2876
+ le as ERR_INVOKE_CUSTOM_METHOD_RESPONSE,
2877
+ pe as ERR_METHOD_PARAMETER_UNSUPPORTED,
2878
+ he as ERR_METHOD_UNSUPPORTED,
2879
+ ge as ERR_NAVIGATION_HISTORY_EMPTY,
2880
+ we as ERR_NAVIGATION_INDEX_INVALID,
2881
+ dn as ERR_NAVIGATION_ITEM_INVALID,
2882
+ Rt as ERR_PARSE,
2883
+ _n as ERR_SSR_INIT,
2884
+ de as ERR_TIMED_OUT,
2885
+ _e as ERR_UNEXPECTED_TYPE,
2886
+ ue as ERR_UNKNOWN_ENV,
2887
+ N as EventEmitter,
2888
+ es as HapticFeedback,
2889
+ ns as InitData,
2890
+ is as Invoice,
2891
+ as as MainButton,
2892
+ us as MiniApp,
2893
+ _s as Popup,
2894
+ ws as QRScanner,
2878
2895
  W as SDKError,
2879
- rr as SDKProvider,
2880
- bs as SettingsButton,
2881
- ys as ThemeParams,
2882
- Ps as Utils,
2883
- xs as Viewport,
2884
- Xe as array,
2885
- vn as bindMiniAppCSSVars,
2886
- yn as bindThemeParamsCSSVars,
2887
- En as bindViewportCSSVars,
2896
+ nr as SDKProvider,
2897
+ ms as SettingsButton,
2898
+ vs as ThemeParams,
2899
+ Es as Utils,
2900
+ Rs as Viewport,
2901
+ Ze as array,
2902
+ bn as bindMiniAppCSSVars,
2903
+ vn as bindThemeParamsCSSVars,
2904
+ yn as bindViewportCSSVars,
2888
2905
  P as boolean,
2889
2906
  kt as captureSameReq,
2890
2907
  et as classNames,
2891
2908
  Se as compareVersions,
2892
- Os as createBrowserNavigatorFromLocation,
2893
- ke as createPostEvent,
2894
- L as createSafeURL,
2895
- Nt as date,
2896
- xn as getHash,
2897
- Ft as getPathname,
2909
+ ks as createBrowserNavigatorFromLocation,
2910
+ Ie as createPostEvent,
2911
+ H as createSafeURL,
2912
+ Bt as date,
2913
+ Rn as getHash,
2914
+ Yt as getPathname,
2898
2915
  Ge as initBackButton,
2899
- Je as initBiometryManager,
2916
+ Ke as initBiometryManager,
2900
2917
  Fe as initClosingBehavior,
2901
- es as initCloudStorage,
2902
- ns as initHapticFeedback,
2903
- is as initInitData,
2904
- as as initInvoice,
2905
- hs as initMainButton,
2906
- ds as initMiniApp,
2907
- Cn as initNavigator,
2908
- ws as initPopup,
2909
- ms as initQRScanner,
2910
- vs as initSettingsButton,
2911
- Es as initThemeParams,
2912
- Rs as initUtils,
2913
- Cs as initViewport,
2914
- Ss as initWeb,
2915
- q as invokeCustomMethod,
2916
- qt as isColorDark,
2917
- Tt as isIframe,
2918
- Gt as isPageReload,
2918
+ ts as initCloudStorage,
2919
+ ss as initHapticFeedback,
2920
+ rs as initInitData,
2921
+ os as initInvoice,
2922
+ cs as initMainButton,
2923
+ ls as initMiniApp,
2924
+ xn as initNavigator,
2925
+ gs as initPopup,
2926
+ fs as initQRScanner,
2927
+ bs as initSettingsButton,
2928
+ ys as initThemeParams,
2929
+ Ps as initUtils,
2930
+ xs as initViewport,
2931
+ Cs as initWeb,
2932
+ O as invokeCustomMethod,
2933
+ Dt as isColorDark,
2934
+ At as isIframe,
2935
+ zt as isPageReload,
2919
2936
  rt as isRGB,
2920
- fe as isRGBShort,
2921
- As as isSDKError,
2922
- Rn as isSDKErrorOfType,
2923
- Ts as isSSR,
2924
- Pn as isTMA,
2937
+ me as isRGBShort,
2938
+ Ts as isSDKError,
2939
+ Pn as isSDKErrorOfType,
2940
+ Ss as isSSR,
2941
+ En as isTMA,
2925
2942
  g as json,
2926
- fn as mergeClassNames,
2943
+ wn as mergeClassNames,
2927
2944
  x as number,
2928
2945
  z as off,
2929
2946
  E as on,
2930
- mn as parseInitData,
2931
- Vt as parseLaunchParams,
2932
- Jt as parseThemeParams,
2933
- N as postEvent,
2947
+ fn as parseInitData,
2948
+ $t as parseLaunchParams,
2949
+ Ft as parseThemeParams,
2950
+ B as postEvent,
2934
2951
  w as request,
2935
- Ke as requestBiometryInfo,
2936
- bn as requestThemeParams,
2952
+ ze as requestBiometryInfo,
2953
+ mn as requestThemeParams,
2937
2954
  Qt as requestViewport,
2938
2955
  jt as retrieveLaunchParams,
2939
- Ct as rgb,
2956
+ St as rgb,
2940
2957
  at as searchParams,
2941
2958
  Le as serializeLaunchParams,
2942
2959
  $e as serializeThemeParams,
2943
2960
  R as setCSSVar,
2944
- oe as setDebug,
2945
- wn as setTargetOrigin,
2961
+ ae as setDebug,
2962
+ gn as setTargetOrigin,
2946
2963
  p as string,
2947
- re as subscribe,
2948
- S as supports,
2964
+ ie as subscribe,
2965
+ C as supports,
2949
2966
  Ae as targetOrigin,
2950
- xt as toRGB,
2967
+ Ct as toRGB,
2951
2968
  Et as unsubscribe,
2952
2969
  U as urlToPath,
2953
- Bs as useBackButton,
2954
- Ns as useBackButtonRaw,
2955
- Vs as useBiometryManager,
2956
- Ms as useBiometryManagerRaw,
2957
- Ls as useClosingBehavior,
2958
- $s as useClosingBehaviorRaw,
2970
+ Ns as useBackButton,
2971
+ Ds as useBackButtonRaw,
2972
+ Ms as useBiometryManager,
2973
+ Bs as useBiometryManagerRaw,
2974
+ $s as useClosingBehavior,
2975
+ Vs as useClosingBehaviorRaw,
2959
2976
  Hs as useCloudStorage,
2960
- Us as useCloudStorageRaw,
2961
- js as useHapticFeedback,
2962
- Ws as useHapticFeedbackRaw,
2963
- zs as useInitData,
2977
+ Ls as useCloudStorageRaw,
2978
+ Ws as useHapticFeedback,
2979
+ Us as useHapticFeedbackRaw,
2980
+ js as useInitData,
2964
2981
  Gs as useInitDataRaw,
2965
- Js as useInvoice,
2966
- Ks as useInvoiceRaw,
2967
- Xn as useLaunchParams,
2982
+ Ks as useInvoice,
2983
+ zs as useInvoiceRaw,
2984
+ Zn as useLaunchParams,
2968
2985
  Fs as useMainButton,
2969
- Qs as useMainButtonRaw,
2970
- Zs as useMiniApp,
2971
- Ys as useMiniAppRaw,
2972
- tn as usePopup,
2973
- Xs as usePopupRaw,
2974
- sn as useQRScanner,
2975
- en as useQRScannerRaw,
2976
- Ds as useSDK,
2977
- rn as useSettingsButton,
2978
- nn as useSettingsButtonRaw,
2979
- an as useThemeParams,
2980
- on as useThemeParamsRaw,
2981
- hn as useUtils,
2982
- cn as useUtilsRaw,
2983
- un as useViewport,
2984
- pn as useViewportRaw,
2985
- Tn as withBackButton,
2986
- Sn as withBackButtonRaw,
2987
- kn as withBiometryManager,
2988
- An as withBiometryManagerRaw,
2989
- On as withClosingBehavior,
2986
+ Js as useMainButtonRaw,
2987
+ Ys as useMiniApp,
2988
+ Qs as useMiniAppRaw,
2989
+ Xs as usePopup,
2990
+ Zs as usePopupRaw,
2991
+ en as useQRScanner,
2992
+ tn as useQRScannerRaw,
2993
+ Os as useSDK,
2994
+ nn as useSettingsButton,
2995
+ sn as useSettingsButtonRaw,
2996
+ on as useThemeParams,
2997
+ rn as useThemeParamsRaw,
2998
+ cn as useUtils,
2999
+ an as useUtilsRaw,
3000
+ pn as useViewport,
3001
+ hn as useViewportRaw,
3002
+ Sn as withBackButton,
3003
+ Cn as withBackButtonRaw,
3004
+ An as withBiometryManager,
3005
+ Tn as withBiometryManagerRaw,
3006
+ kn as withClosingBehavior,
2990
3007
  In as withClosingBehaviorRaw,
2991
- Dn as withCloudStorage,
3008
+ On as withCloudStorage,
2992
3009
  qn as withCloudStorageRaw,
2993
- Bn as withHapticFeedback,
2994
- Nn as withHapticFeedbackRaw,
2995
- Vn as withInitData,
2996
- Mn as withInitDataRaw,
2997
- Ln as withInvoice,
2998
- $n as withInvoiceRaw,
3010
+ Nn as withHapticFeedback,
3011
+ Dn as withHapticFeedbackRaw,
3012
+ Mn as withInitData,
3013
+ Bn as withInitDataRaw,
3014
+ $n as withInvoice,
3015
+ Vn as withInvoiceRaw,
2999
3016
  Hn as withMainButton,
3000
- Un as withMainButtonRaw,
3001
- jn as withMiniApp,
3002
- Wn as withMiniAppRaw,
3003
- zn as withPopup,
3017
+ Ln as withMainButtonRaw,
3018
+ Wn as withMiniApp,
3019
+ Un as withMiniAppRaw,
3020
+ jn as withPopup,
3004
3021
  Gn as withPopupRaw,
3005
- Jn as withQRScanner,
3006
- Kn as withQRScannerRaw,
3022
+ Kn as withQRScanner,
3023
+ zn as withQRScannerRaw,
3007
3024
  Fn as withSettingsButton,
3008
- Qn as withSettingsButtonRaw,
3009
- Zn as withThemeParams,
3010
- Yn as withThemeParamsRaw,
3025
+ Jn as withSettingsButtonRaw,
3026
+ Yn as withThemeParams,
3027
+ Qn as withThemeParamsRaw,
3011
3028
  Ot as withTimeout,
3012
- er as withUtils,
3013
- tr as withUtilsRaw,
3014
- nr as withViewport,
3015
- sr as withViewportRaw
3029
+ tr as withUtils,
3030
+ Xn as withUtilsRaw,
3031
+ sr as withViewport,
3032
+ er as withViewportRaw
3016
3033
  };
3017
3034
  //# sourceMappingURL=index.js.map