@tma.js/sdk 3.0.0 → 3.0.1

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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [docs-badge]: https://img.shields.io/badge/documentation-blue?logo=gitbook&logoColor=white
6
6
 
7
- [link]: https://github.com/Telegram-Mini-Apps/telegram-apps/tree/master/tma.js/sdk
7
+ [link]: https://github.com/Telegram-Mini-Apps/tma.js/tree/master/tma.js/sdk
8
8
 
9
9
  [docs-link]: https://docs.telegram-mini-apps.com/packages/tma-js-sdk
10
10
 
@@ -1,4 +1,4 @@
1
1
  var cc=Object.defineProperty;var lc=(p,oe,we)=>oe in p?cc(p,oe,{enumerable:!0,configurable:!0,writable:!0,value:we}):p[oe]=we;var o=(p,oe,we)=>lc(p,typeof oe!="symbol"?oe+"":oe,we);this.tmajs=this.tmajs||{};this.tmajs.sdk=function(p){"use strict";var oe=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))};function we(e,t,n,r,i,s,a,u,l){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return s(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(s(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return u(a(s(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return l(u(a(s(i(r(n(t(e.apply(this,arguments)))))))))}}}function d(e,t,n,r,i,s,a,u,l){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return s(i(r(n(t(e)))));case 7:return a(s(i(r(n(t(e))))));case 8:return u(a(s(i(r(n(t(e)))))));case 9:return l(u(a(s(i(r(n(t(e))))))));default:{for(var c=arguments[0],h=1;h<arguments.length;h++)c=arguments[h](c);return c}}}var Ve=function(e,t){var n=typeof e=="number"?function(r){return r.length>=e}:e;return function(){var r=Array.from(arguments);return n(arguments)?t.apply(this,r):function(i){return t.apply(void 0,oe([i],r,!1))}}},Js={_tag:"None"},Qs=function(e){return{_tag:"Some",value:e}},Zs=function(e){return e._tag==="Left"},kn=function(e){return{_tag:"Left",left:e}},En=function(e){return{_tag:"Right",right:e}},dt={};function Ys(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(s){return t.ap(i,s)}}),n)}}}function Xs(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function _t(e){return function(t,n){return function(r){return e.chain(r,function(i){return e.map(n(i),function(s){var a;return Object.assign({},i,(a={},a[t]=s,a))})})}}}var O=kn,P=En,ei=Ve(2,function(e,t){return ye(e)?e:t(e.right)}),mt=function(e,t){return d(e,Z(t))},$n=function(e,t){return d(e,si(t))},bt="Either",Z=function(e){return function(t){return ye(t)?t:P(e(t.right))}},ti={URI:bt,map:mt},ni=P,ri=function(e){return function(t){return ye(t)?t:ye(e)?e:P(t.right(e.right))}},si=ri,ii={URI:bt,map:mt,ap:$n},oi={URI:bt,map:mt,ap:$n,chain:ei},ai=function(e,t){return function(n){return ye(n)?O(e(n.left)):P(t(n.right))}},ye=Zs,An=function(e,t){return function(n){return ye(n)?e(n.left):t(n.right)}},Re=An,ui=function(e,t){try{return P(e())}catch(n){return O(t(n))}},ci=ni(dt),li=_t(oi),In=li;let Ae;function pi(e,t){Ae?Ae.set(e,t):t()}function Xe(e){if(Ae)return e();Ae=new Map;try{e()}finally{Ae.forEach(t=>t()),Ae=void 0}}function W(e,t){t||(t={});const n=t.equals||Object.is;let r=[],i=e;const s=c=>{if(!n(i,c)){const h=i;i=c,pi(l,()=>{[...r].forEach(([f,b])=>{f(c,h),b&&u(f,!0)})})}};function a(c){const h=typeof c!="object"?{once:c}:c;return{once:h.once||!1,signal:h.signal||!1}}const u=(c,h)=>{const f=a(h),b=r.findIndex(([v,y])=>v===c&&y.once===f.once&&y.signal===f.signal);b>=0&&r.splice(b,1)},l=Object.assign(function(){return hi(l),i},{destroy(){r=[]},set:s,reset(){s(e)},sub(c,h){return r.push([c,a(h)]),()=>u(c,h)},unsub:u,unsubAll(){r=r.filter(c=>c[1].signal)}});return l}const Oe=[];function hi(e){Oe.length&&Oe[Oe.length-1].add(e)}function F(e,t){let n=new Set,r;function i(){return r||(r=W(a(),t))}function s(){i().set(a())}function a(){n.forEach(c=>{c.unsub(s,{signal:!0})});const u=new Set;let l;Oe.push(u);try{l=e()}finally{Oe.pop()}return u.forEach(c=>{c.sub(s,{signal:!0})}),n=u,l}return Object.assign(function(){return i()()},{destroy(){i().destroy()},sub(...u){return i().sub(...u)},unsub(...u){i().unsub(...u)},unsubAll(...u){i().unsubAll(...u)}})}var ae;function gt(e){return{lang:(e==null?void 0:e.lang)??(ae==null?void 0:ae.lang),message:e==null?void 0:e.message,abortEarly:(e==null?void 0:e.abortEarly)??(ae==null?void 0:ae.abortEarly),abortPipeEarly:(e==null?void 0:e.abortPipeEarly)??(ae==null?void 0:ae.abortPipeEarly)}}var vt;function fi(e){return vt==null?void 0:vt.get(e)}var wt;function di(e){return wt==null?void 0:wt.get(e)}var yt;function _i(e,t){var n;return(n=yt==null?void 0:yt.get(e))==null?void 0:n.get(t)}function mi(e){var n,r;const t=typeof e;return t==="string"?`"${e}"`:t==="number"||t==="bigint"||t==="boolean"?`${e}`:t==="object"||t==="function"?(e&&((r=(n=Object.getPrototypeOf(e))==null?void 0:n.constructor)==null?void 0:r.name))??"null":t}function K(e,t,n,r,i){const s=i&&"input"in i?i.input:n.value,a=(i==null?void 0:i.expected)??e.expects??null,u=(i==null?void 0:i.received)??mi(s),l={kind:e.kind,type:e.type,input:s,expected:a,received:u,message:`Invalid ${t}: ${a?`Expected ${a} but r`:"R"}eceived ${u}`,requirement:e.requirement,path:i==null?void 0:i.path,issues:i==null?void 0:i.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},c=e.kind==="schema",h=(i==null?void 0:i.message)??e.message??_i(e.reference,l.lang)??(c?di(l.lang):null)??r.message??fi(l.lang);h!==void 0&&(l.message=typeof h=="function"?h(l):h),c&&(n.typed=!1),n.issues?n.issues.push(l):n.issues=[l]}function J(e){return{version:1,vendor:"valibot",validate(t){return e["~run"]({value:t},gt())}}}function qn(e,t){return Object.hasOwn(e,t)&&t!=="__proto__"&&t!=="prototype"&&t!=="constructor"}function bi(e,t){const n=[...new Set(e)];return n.length>1?`(${n.join(` ${t} `)})`:n[0]??"never"}var gi=class extends Error{constructor(e){super(e[0].message),this.name="ValiError",this.issues=e}};function et(e,t){return{kind:"validation",type:"check",reference:et,async:!1,expects:null,requirement:e,message:t,"~run"(n,r){return n.typed&&!this.requirement(n.value)&&K(this,"input",n,r),n}}}function Ct(e){return{kind:"validation",type:"integer",reference:Ct,async:!1,expects:null,requirement:Number.isInteger,message:e,"~run"(t,n){return t.typed&&!this.requirement(t.value)&&K(this,"integer",t,n),t}}}function ue(e){return{kind:"transformation",type:"transform",reference:ue,async:!1,operation:e,"~run"(t){return t.value=this.operation(t.value),t}}}function vi(e,t,n){return typeof e.fallback=="function"?e.fallback(t,n):e.fallback}function Ft(e,t,n){return typeof e.default=="function"?e.default(t,n):e.default}function St(e,t){return!e["~run"]({value:t},{abortEarly:!0}).issues}function Bn(){return{kind:"schema",type:"any",reference:Bn,expects:"any",async:!1,get"~standard"(){return J(this)},"~run"(e){return e.typed=!0,e}}}function Tn(e,t){return{kind:"schema",type:"array",reference:Tn,expects:"Array",async:!1,item:e,message:t,get"~standard"(){return J(this)},"~run"(n,r){var s;const i=n.value;if(Array.isArray(i)){n.typed=!0,n.value=[];for(let a=0;a<i.length;a++){const u=i[a],l=this.item["~run"]({value:u},r);if(l.issues){const c={type:"array",origin:"value",input:i,key:a,value:u};for(const h of l.issues)h.path?h.path.unshift(c):h.path=[c],(s=n.issues)==null||s.push(h);if(n.issues||(n.issues=l.issues),r.abortEarly){n.typed=!1;break}}l.typed||(n.typed=!1),n.value.push(l.value)}}else K(this,"type",n,r);return n}}}function Ce(e){return{kind:"schema",type:"boolean",reference:Ce,expects:"boolean",async:!1,message:e,get"~standard"(){return J(this)},"~run"(t,n){return typeof t.value=="boolean"?t.typed=!0:K(this,"type",t,n),t}}}function tt(e){return{kind:"schema",type:"date",reference:tt,expects:"Date",async:!1,message:e,get"~standard"(){return J(this)},"~run"(t,n){return t.value instanceof Date?isNaN(t.value)?K(this,"type",t,n,{received:'"Invalid Date"'}):t.typed=!0:K(this,"type",t,n),t}}}function kt(e){return{kind:"schema",type:"function",reference:kt,expects:"Function",async:!1,message:e,get"~standard"(){return J(this)},"~run"(t,n){return typeof t.value=="function"?t.typed=!0:K(this,"type",t,n),t}}}function Et(e,t){return{kind:"schema",type:"instance",reference:Et,expects:e.name,async:!1,class:e,message:t,get"~standard"(){return J(this)},"~run"(n,r){return n.value instanceof this.class?n.typed=!0:K(this,"type",n,r),n}}}function j(e,t){return{kind:"schema",type:"loose_object",reference:j,expects:"Object",async:!1,entries:e,message:t,get"~standard"(){return J(this)},"~run"(n,r){var s;const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const a in this.entries){const u=this.entries[a];if(a in i||(u.type==="exact_optional"||u.type==="optional"||u.type==="nullish")&&u.default!==void 0){const l=a in i?i[a]:Ft(u),c=u["~run"]({value:l},r);if(c.issues){const h={type:"object",origin:"value",input:i,key:a,value:l};for(const f of c.issues)f.path?f.path.unshift(h):f.path=[h],(s=n.issues)==null||s.push(f);if(n.issues||(n.issues=c.issues),r.abortEarly){n.typed=!1;break}}c.typed||(n.typed=!1),n.value[a]=c.value}else if(u.fallback!==void 0)n.value[a]=vi(u);else if(u.type!=="exact_optional"&&u.type!=="optional"&&u.type!=="nullish"&&(K(this,"key",n,r,{input:void 0,expected:`"${a}"`,path:[{type:"object",origin:"key",input:i,key:a,value:i[a]}]}),r.abortEarly))break}if(!n.issues||!r.abortEarly)for(const a in i)qn(i,a)&&!(a in this.entries)&&(n.value[a]=i[a])}else K(this,"type",n,r);return n}}}function Ie(e,t){return{kind:"schema",type:"nullish",reference:Ie,expects:`(${e.expects} | null | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return J(this)},"~run"(n,r){return(n.value===null||n.value===void 0)&&(this.default!==void 0&&(n.value=Ft(this,n,r)),n.value===null||n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,r)}}}function de(e){return{kind:"schema",type:"number",reference:de,expects:"number",async:!1,message:e,get"~standard"(){return J(this)},"~run"(t,n){return typeof t.value=="number"&&!isNaN(t.value)?t.typed=!0:K(this,"type",t,n),t}}}function $(e,t){return{kind:"schema",type:"optional",reference:$,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return J(this)},"~run"(n,r){return n.value===void 0&&(this.default!==void 0&&(n.value=Ft(this,n,r)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,r)}}}function $t(e,t,n){return{kind:"schema",type:"record",reference:$t,expects:"Object",async:!1,key:e,value:t,message:n,get"~standard"(){return J(this)},"~run"(r,i){var a,u;const s=r.value;if(s&&typeof s=="object"){r.typed=!0,r.value={};for(const l in s)if(qn(s,l)){const c=s[l],h=this.key["~run"]({value:l},i);if(h.issues){const b={type:"object",origin:"key",input:s,key:l,value:c};for(const v of h.issues)v.path=[b],(a=r.issues)==null||a.push(v);if(r.issues||(r.issues=h.issues),i.abortEarly){r.typed=!1;break}}const f=this.value["~run"]({value:c},i);if(f.issues){const b={type:"object",origin:"value",input:s,key:l,value:c};for(const v of f.issues)v.path?v.path.unshift(b):v.path=[b],(u=r.issues)==null||u.push(v);if(r.issues||(r.issues=f.issues),i.abortEarly){r.typed=!1;break}}(!h.typed||!f.typed)&&(r.typed=!1),h.typed&&(r.value[h.value]=f.value)}}else K(this,"type",r,i);return r}}}function C(e){return{kind:"schema",type:"string",reference:C,expects:"string",async:!1,message:e,get"~standard"(){return J(this)},"~run"(t,n){return typeof t.value=="string"?t.typed=!0:K(this,"type",t,n),t}}}function Pn(e){let t;if(e)for(const n of e)t?t.push(...n.issues):t=n.issues;return t}function nt(e,t){return{kind:"schema",type:"union",reference:nt,expects:bi(e.map(n=>n.expects),"|"),async:!1,options:e,message:t,get"~standard"(){return J(this)},"~run"(n,r){let i,s,a;for(const u of this.options){const l=u["~run"]({value:n.value},r);if(l.typed)if(l.issues)s?s.push(l):s=[l];else{i=l;break}else a?a.push(l):a=[l]}if(i)return i;if(s){if(s.length===1)return s[0];K(this,"type",n,r,{issues:Pn(s)}),n.typed=!0}else{if((a==null?void 0:a.length)===1)return a[0];K(this,"type",n,r,{issues:Pn(a)})}return n}}}function At(){return{kind:"schema",type:"unknown",reference:At,expects:"unknown",async:!1,get"~standard"(){return J(this)},"~run"(e){return e.typed=!0,e}}}function _e(e,t,n){const r=e["~run"]({value:t},gt(n));if(r.issues)throw new gi(r.issues);return r.value}function se(...e){return{...e[0],pipe:e,get"~standard"(){return J(this)},"~run"(t,n){for(const r of e)if(r.kind!=="metadata"){if(t.issues&&(r.kind==="schema"||r.kind==="transformation")){t.typed=!1;break}(!t.issues||!n.abortEarly&&!n.abortPipeEarly)&&(t=r["~run"](t,n))}return t}}}function It(e,t,n){const r=e["~run"]({value:t},gt(n));return{typed:r.typed,success:!r.issues,output:r.value,issues:r.issues}}var wi=Object.defineProperty,yi=(e,t,n)=>t in e?wi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mn=(e,t,n)=>yi(e,typeof t!="symbol"?t+"":t,n),Ci=Object.defineProperty,Fi=(e,t,n)=>t in e?Ci(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qt=(e,t,n)=>Fi(e,typeof t!="symbol"?t+"":t,n);function Ln(e){return t=>t instanceof e}function Vn(e,t){const n=class extends Error{constructor(...i){const s=typeof t=="function"?t(...i):typeof t=="string"?[t]:t||[];super(...s),this.name=e}};qt(n,"is",Ln(n));let r=n;return Object.defineProperty(r,"name",{value:e}),r}function Si(e,t,n){const r=class extends Vn(e,n){constructor(...s){super(...s),qt(this,"data"),this.data=t(...s)}};qt(r,"is",Ln(r));let i=r;return Object.defineProperty(i,"name",{value:e}),i}let Rn=class extends Vn("CancelledError","Promise was canceled"){},Bt=class extends Si("TimeoutError",t=>({timeout:t}),(t,n)=>[`Timeout reached: ${t}ms`,{cause:n}]){};const ki=Symbol("resolved");function Ei(e){return{tag:ki,value:e}}function On(e,t){return e.reject=t.reject,e.resolve=t.resolve,e}let rt=class Sn extends Promise{constructor(t,n){let r,i,s,a;typeof t=="function"?(s=t,a=n||{}):a=t||{};let u,l;const c=()=>!!l,h=()=>!!u;let f={};const b=[],v=()=>{b.forEach(g=>g()),b.splice(0,b.length),f={}},y=new AbortController,w=()=>h()||c();super((g,S)=>{const{abortOnResolve:_=!0,abortOnReject:D=!0}=a;i=k=>{var L,I;w()||(g(k),u=[k],(L=f.resolved)==null||L.forEach(x=>x(k)),(I=f.finalized)==null||I.forEach(x=>x({kind:"resolved",result:k})),v(),_&&y.abort(Ei(k)))},r=k=>{var L,I;w()||(S(k),l=[k],(L=f.rejected)==null||L.forEach(x=>x(k)),(I=f.finalized)==null||I.forEach(x=>x({kind:"rejected",reason:k})),v(),D&&y.abort(k))};const{abortSignal:M}=a;if(M){if(M.aborted)return r(M.reason);const k=()=>{r(M.reason)};M.addEventListener("abort",k,!0),b.push(()=>{M.removeEventListener("abort",k,!0)})}const{timeout:U}=a;if(U){const k=setTimeout(()=>{r(new Bt(U))},U);b.push(()=>{clearTimeout(k)})}try{const k=()=>{},L=s&&s(i,r,{abortSignal:y.signal,get isRejected(){return c()},get isResolved(){return h()},on(I,x){if(u||l){if(I==="finalized"){const Le=u?{kind:"resolved",result:u[0]}:{kind:"rejected",reason:l[0]};x(Le)}else I==="resolved"&&u?x(u[0]):I==="rejected"&&l&&x(l[0]);return k}return f[I]||(f[I]=[]),f[I].push(x),()=>{const Le=f[I]||[],Ye=Le.indexOf(x);Ye>=0&&Le.splice(Ye,1)}},get result(){return u==null?void 0:u[0]},get rejectReason(){return l==null?void 0:l[0]},throwIfRejected(){if(l)throw l[0]}});L instanceof Promise&&L.catch(r)}catch(k){r(k)}}),Mn(this,"reject"),Mn(this,"resolve"),this.reject=r,this.resolve=i}static fn(t,n){return new Sn(async(r,i,s)=>{try{r(await t(s))}catch(a){i(a)}},n)}static resolve(t){return this.fn(()=>t)}static reject(t){return new Sn((n,r)=>{r(t)})}cancel(){this.reject(new Rn)}catch(t){return this.then(void 0,t)}finally(t){return On(super.finally(t),this)}then(t,n){return On(super.then(t,n),this)}};function jn(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function $i(e){return e.replace(/_[a-z]/g,t=>t[1].toUpperCase())}function Ai(e){return Object.entries(e).reduce((t,[n,r])=>(t[$i(n)]=r,t),{})}function Tt(e){const t=Ai(e);for(const n in t){const r=t[n];r&&typeof r=="object"&&!(r instanceof Date)&&(t[n]=Array.isArray(r)?r.map(Tt):Tt(r))}return t}function Ii(e){return e.replace(/_([a-z])/g,(t,n)=>`-${n.toLowerCase()}`)}function Dn(e){return`tapps/${e}`}function Pt(e,t){sessionStorage.setItem(Dn(e),JSON.stringify(t))}function Un(e){const t=sessionStorage.getItem(Dn(e));try{return t?JSON.parse(t):void 0}catch{}}function st(...e){const t=e.flat(1);return[t.push.bind(t),()=>{t.forEach(n=>{n()})}]}function xn(e,t){t||(t={});const{textColor:n,bgColor:r,shouldLog:i}=t,s=i===void 0?!0:i,a=typeof s=="boolean"?()=>s:s,u=(l,c,...h)=>{if(c||a()){const f="font-weight:bold;padding:0 5px;border-radius:100px",[b,v,y]={log:["#0089c3","white","INFO"],error:["#ff0000F0","white","ERR"],warn:["#D38E15","white","WARN"]}[l];console[l](`%c${y} ${Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3,timeZone:"UTC"}).format(new Date)}%c %c${e}`,`${f};background-color:${b};color:${v}`,"",`${f};${n?`color:${n};`:""}${r?`background-color:${r}`:""}`,...h)}};return[["log","forceLog"],["warn","forceWarn"],["error","forceError"]].reduce((l,[c,h])=>(l[c]=u.bind(void 0,c,!1),l[h]=u.bind(void 0,c,!0),l),{})}var qi=function(e,t,n){if(arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))};function Gn(e,t,n,r,i,s,a,u,l){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return s(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(s(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return u(a(s(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return l(u(a(s(i(r(n(t(e.apply(this,arguments)))))))))}}}function qe(e,t,n,r,i,s,a,u,l){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return s(i(r(n(t(e)))));case 7:return a(s(i(r(n(t(e))))));case 8:return u(a(s(i(r(n(t(e)))))));case 9:return l(u(a(s(i(r(n(t(e))))))));default:{for(var c=arguments[0],h=1;h<arguments.length;h++)c=arguments[h](c);return c}}}var Wn=function(e,t){var n=function(r){return r.length>=e};return function(){var r=Array.from(arguments);return n(arguments)?t.apply(this,r):function(i){return t.apply(void 0,qi([i],r,!1))}}},Bi=function(e){return e._tag==="Left"},Hn=function(e){return{_tag:"Left",left:e}},Nn=function(e){return{_tag:"Right",right:e}},zn=Hn,Kn=Nn,Jn=Bi,Ti=function(e,t){return function(n){return Jn(n)?e(n.left):t(n.right)}},Mt=Ti;function Pi(e){return Gn(Kn,e.of)}function Mi(e){return Gn(zn,e.of)}function Li(e){return function(t,n){return e.chain(t,function(r){return Jn(r)?e.of(r):n(r.right)})}}function Vi(e){return function(t,n){return function(r){return e.map(r,Mt(t,n))}}}var Qn=function(e,t){return qe(e,Oi(t))},Ri=function(e,t){return qe(e,ji(t))},Oi=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},ji=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(n){var r=n[0],i=n[1];return r(i)})}}},Lt=function(e){return function(){return Promise.resolve(e)}},Di=Wn(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),Zn="Task",Ui={URI:Zn,map:Qn},Yn={of:Lt},xi={URI:Zn,map:Qn,of:Lt,ap:Ri,chain:Di},Gi=function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function u(h){try{c(r.next(h))}catch(f){a(f)}}function l(h){try{c(r.throw(h))}catch(f){a(f)}}function c(h){h.done?s(h.value):i(h.value).then(u,l)}c((r=r.apply(e,[])).next())})},Wi=function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(h){return l([c,h])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(h){c=[6,h],i=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Hi=Mi(Yn),Ni=Pi(Yn),zi=Lt,Xn=Vi(Ui),Ki=Xn,Ji=function(e,t){return function(){return Gi(void 0,void 0,void 0,function(){var n;return Wi(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(Nn)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,Hn(t(n))];case 3:return[2]}})})}},Qi=Wn(2,Li(xi)),Zi=Qi;function je(e){const t=n=>{throw n};return typeof e=="function"?rt.resolve(qe(e,Xn(t,n=>n))()):qe(e,Mt(t,n=>n))}function X(e){return Object.assign((...t)=>je(e(...t)),e)}const De=Object.assign((e,t)=>qe(Ji(()=>new rt((n,r,i)=>e(s=>n(Kn(s)),s=>n(zn(s)),i),t),n=>n),Zi(Mt(Hi,Ni))),{fn:(e,t)=>De((n,r,i)=>{const s=e(i);qe(typeof s=="function"?s:zi(s),Ki(r,n))()},t)});function Yi(e,t,n,r,i,s,a,u,l){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return s(i(r(n(t(e)))));case 7:return a(s(i(r(n(t(e))))));case 8:return u(a(s(i(r(n(t(e)))))));case 9:return l(u(a(s(i(r(n(t(e))))))));default:{for(var c=arguments[0],h=1;h<arguments.length;h++)c=arguments[h](c);return c}}}var Xi=function(e){return e._tag==="Left"},eo=function(e){return{_tag:"Left",left:e}},to=function(e){return{_tag:"Right",right:e}},er=eo,Fe=to,no=function(e){return function(t){return ro(t)?t:Fe(e(t.right))}},ro=Xi,tr=function(e,t){try{return Fe(e())}catch(n){return er(t(n))}};function so(e){const t=n=>{const r={};return new URLSearchParams(n).forEach((i,s)=>{const a=r[s];Array.isArray(a)?a.push(i):a===void 0?r[s]=i:r[s]=[a,i]}),_e(e,r)};return se(nt([C(),Et(URLSearchParams)]),et(n=>{try{return t(n),!0}catch{return!1}},"The value doesn't match required schema"),ue(t))}function io(e){return se(C(),et(t=>{try{return JSON.parse(t),!0}catch{return!1}},"Input is not a valid JSON value"),ue(JSON.parse),e)}function me(e){return se(C(),io(e))}function Vt(e){return se(nt([C(),Et(URLSearchParams)]),so(e))}function it(e){return t=>e.test(t)}const nr=it(/^#[\da-f]{3}$/i),rr=it(/^#[\da-f]{4}$/i),Ue=it(/^#[\da-f]{6}$/i),sr=it(/^#[\da-f]{8}$/i);function ir(e){return[Ue,sr,nr,rr].some(t=>t(e))}function or(e){let t="#";for(let n=0;n<e.length-1;n+=1)t+=e[1+n].repeat(2);return t}function ot(e){const t=e.replace(/\s/g,"").toLowerCase();if(/^#[\da-f]{3}$/i.test(t))return Fe(or(t.toLowerCase()+"f"));if(/^#[\da-f]{4}$/i.test(t))return Fe(or(t.toLowerCase()));if(/^#[\da-f]{6}$/i.test(t))return Fe(t.toLowerCase()+"ff");if(/^#[\da-f]{8}$/i.test(t))return Fe(t.toLowerCase());const n=t.match(/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/)||t.match(/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d{1,3})\)$/);return n?Fe(n.slice(1).reduce((r,i)=>r+parseInt(i,10).toString(16).padStart(2,"0"),"#").padEnd(9,"f")):er(new Error(`Value "${e}" does not satisfy any of known RGB formats.`))}function ar(e){return Yi(ot(e),no(t=>t.slice(0,7)))}const oo=X(ar),ao=X(ot);function uo(){return j({id:de(),photo_url:$(C()),type:C(),title:C(),username:$(C())})}function ur(){return j({added_to_attachment_menu:$(Ce()),allows_write_to_pm:$(Ce()),first_name:C(),id:de(),is_bot:$(Ce()),is_premium:$(Ce()),last_name:$(C()),language_code:$(C()),photo_url:$(C()),username:$(C())})}function co(){return j({auth_date:se(C(),ue(e=>new Date(Number(e)*1e3)),tt()),can_send_after:$(se(C(),ue(Number),Ct())),chat:$(me(uo())),chat_type:$(C()),chat_instance:$(C()),hash:C(),query_id:$(C()),receiver:$(me(ur())),start_param:$(C()),signature:C(),user:$(me(ur()))})}function cr(){return Vt(co())}function Rt(){return $t(C(),se(nt([C(),de()]),ue(e=>typeof e=="number"?`#${(e&16777215).toString(16).padStart(6,"0")}`:e),et(ir)))}function lo(){const e=$(se(C(),ue(t=>t==="1")));return j({tgWebAppBotInline:e,tgWebAppData:$(cr()),tgWebAppDefaultColors:$(me(Rt())),tgWebAppFullscreen:e,tgWebAppPlatform:C(),tgWebAppShowSettings:e,tgWebAppStartParam:$(C()),tgWebAppThemeParams:me(Rt()),tgWebAppVersion:C()})}function po(){return Vt(lo())}function lr(){return j({eventType:C(),eventData:$(At())})}function pr(e){return tr(()=>_e(cr(),e),t=>t)}function at(e){return tr(()=>_e(po(),e),t=>t)}const ho=X(pr),hr=X(at);function fr(e,t){return t||(t=(n,r)=>JSON.stringify(r)),new URLSearchParams(Object.entries(e).reduce((n,[r,i])=>(Array.isArray(i)?n.push(...i.map(s=>[r,String(s)])):i!=null&&n.push([r,i instanceof Date?(i.getTime()/1e3|0).toString():typeof i=="string"||typeof i=="number"?String(i):typeof i=="boolean"?i?"1":"0":t(r,i)]),n),[])).toString()}function dr(e){return fr(e)}function _r(e){return fr(e,(t,n)=>t==="tgWebAppData"?dr(n):JSON.stringify(n))}var fo=Object.defineProperty,_o=(e,t,n)=>t in e?fo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ot=(e,t,n)=>_o(e,typeof t!="symbol"?t+"":t,n);function mr(e){return t=>t instanceof e}function H(e,t){const n=class extends Error{constructor(...s){const a=typeof t=="function"?t(...s):typeof t=="string"?[t]:t||[];super(...a),this.name=e}};Ot(n,"is",mr(n));let r=n;return Object.defineProperty(r,"name",{value:e}),r}function br(e,t,n){const r=class extends H(e,n){constructor(...a){super(...a),Ot(this,"data"),this.data=t(...a)}};Ot(r,"is",mr(r));let i=r;return Object.defineProperty(i,"name",{value:e}),i}function mo(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(i){i(n)}),(r=e.get("*"))&&r.slice().map(function(i){i(t,n)})}}}function gr(e){return St(j({TelegramWebviewProxy:j({postEvent:kt()})}),e)}function vr(){try{return window.self!==window.top}catch{return!0}}var bo=function(e,t,n){if(arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))};function go(e){return e}function xe(e,t,n,r,i,s,a,u,l){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return s(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return a(s(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return u(a(s(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return l(u(a(s(i(r(n(t(e.apply(this,arguments)))))))))}}}function ce(e,t,n,r,i,s,a,u,l){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return s(i(r(n(t(e)))));case 7:return a(s(i(r(n(t(e))))));case 8:return u(a(s(i(r(n(t(e)))))));case 9:return l(u(a(s(i(r(n(t(e))))))));default:{for(var c=arguments[0],h=1;h<arguments.length;h++)c=arguments[h](c);return c}}}var jt=function(e,t){var n=function(r){return r.length>=e};return function(){var r=Array.from(arguments);return n(arguments)?t.apply(this,r):function(i){return t.apply(void 0,bo([i],r,!1))}}},vo={_tag:"None"},wo=function(e){return{_tag:"Some",value:e}},yo=function(e){return e._tag==="Left"},Co=function(e){return{_tag:"Left",left:e}},Fo=function(e){return{_tag:"Right",right:e}},Se=Co,te=Fo,wr=jt(2,function(e,t){return Ge(e)?e:t(e.right)}),So=function(e){return function(t){return Ge(t)?t:te(e(t.right))}},ko=function(e){return function(t){return Ge(t)?Se(e(t.left)):t}},Ge=yo,yr=function(e,t){return function(n){return Ge(n)?e(n.left):t(n.right)}},Eo=yr,Dt=yr,$o=Dt,Ut=function(e,t){try{return te(e())}catch(n){return Se(t(n))}},Ao=wr,Io=wr,qo=vo,Bo=wo,To=function(e){return e._tag==="None"},Po=function(e,t){return function(n){return To(n)?e():t(n.value)}},Mo=Po;function Lo(e){return xe(te,e.of)}function Vo(e){return xe(Se,e.of)}function Ro(e){return function(t,n){return e.chain(t,function(r){return Ge(r)?e.of(r):n(r.right)})}}function Oo(e){return function(t,n){return function(r){return e.map(r,Dt(t,n))}}}var Cr=function(e,t){return ce(e,Do(t))},jo=function(e,t){return ce(e,Uo(t))},Do=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},Uo=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(n){var r=n[0],i=n[1];return r(i)})}}},Fr=function(e){return function(){return Promise.resolve(e)}},xo=jt(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),Sr="Task",Go={URI:Sr,map:Cr},kr={of:Fr},Wo={URI:Sr,map:Cr,of:Fr,ap:jo,chain:xo},Ho=Vo(kr),Er=Lo(kr),No=Oo(Go),$r=jt(2,Ro(Wo)),zo=$r,Ko=$r;class Ar extends H("MethodUnsupportedError",(t,n)=>[`Method "${t}" is unsupported in Mini Apps version ${n}`]){}class Ir extends H("MethodParameterUnsupportedError",(t,n,r)=>[`Parameter "${n}" of "${t}" method is unsupported in Mini Apps version ${r}`]){}class qr extends br("LaunchParamsRetrieveError",t=>({errors:t}),t=>[["Unable to retrieve launch parameters from any known source. Perhaps, you have opened your app outside Telegram?","📖 Refer to docs for more information:","https://docs.telegram-mini-apps.com/packages/tma-js-bridge/environment","","Collected errors:",...t.map(({source:n,error:r})=>`Source: ${n} / ${r instanceof Error?r.message:String(r)}`)].join(`
2
- `)]){}class Br extends H("InvalidLaunchParamsError",(t,n)=>[`Invalid value for launch params: ${t}`,{cause:n}]){}class Tr extends H("UnknownEnvError"){}class Pr extends H("InvokeCustomMethodError",t=>[`Server returned error: ${t}`]){}const Mr="launchParams";function Lr(e){return e.replace(/^[^?#]*[?#]/,"").replace(/[?#]/g,"&")}const Be=xe(We,Ao(at)),Jo=X(Be),xt=xe(We,So(e=>{const t=new URLSearchParams(e).get("tgWebAppData");return t?Bo(t):qo})),Qo=xe(xt,$o(e=>{throw e},e=>e),Mo(()=>{},e=>e));function We(){const e=[];for(const[t,n]of[[()=>Lr(window.location.href),"window.location.href"],[()=>{const r=performance.getEntriesByType("navigation")[0];return r&&Lr(r.name)},"performance navigation entries"],[()=>Un(Mr),"local storage"]]){const r=t();if(!r){e.push({source:n,error:new Error("Source is empty")});continue}const i=ce(at(r),Eo(s=>s,()=>!0));if(typeof i!="boolean"){e.push({source:n,error:i});continue}return Pt(Mr,r),te(r)}return Se(new qr(e))}const Zo=X(We);function Yo(e,t){const n=new Map,r=mo(),i=(s,a,u=!1)=>{const l=n.get(s)||new Map;n.set(s,l);const c=l.get(a)||[];l.set(a,c);const h=c.findIndex(f=>f[1]===u);if(h>=0&&(r.off(s,c[h][0]),c.splice(h,1),!c.length&&(l.delete(a),!l.size))){const f=n.size;n.delete(s),f&&!n.size&&t()}};return{on(s,a,u){!n.size&&e();const l=()=>{i(s,a,u)},c=(...b)=>{u&&l(),s==="*"?a({name:b[0],payload:b[1]}):a(...b)};r.on(s,c);const h=n.get(s)||new Map;n.set(s,h);const f=h.get(a)||[];return h.set(a,f),f.push([c,u||!1]),l},off:i,emit:r.emit,clear(){const s=n.size;r.all.clear(),n.clear(),s&&t()}}}function Gt(e,t){window.dispatchEvent(new MessageEvent("message",{data:JSON.stringify({eventType:e,eventData:t}),source:window.parent}))}function Wt(e,t,n){const r=[n],i=e[t];typeof i=="function"&&r.push(i);const s=(...u)=>{r.forEach(l=>l(...u))},a=Object.assign((...u)=>{s(...u)},{unwrap(){const{length:u}=r;if(u===1){delete e[t];return}if(u===2){Or(e,t,r[1]);return}r.unshift(1),Or(e,t,s)}});Rr(e,t,()=>a,u=>r.push(u))}function Vr(e,t){const n=e[t];Rr(e,t,()=>n,r=>{Object.entries(r).forEach(([i,s])=>{n[i]=s})})}function Rr(e,t,n,r){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:n,set:r})}function Or(e,t,n){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n})}const Xo={clipboard_text_received:j({req_id:C(),data:Ie(C())}),custom_method_invoked:j({req_id:C(),result:$(At()),error:$(C())}),popup_closed:Ie(j({button_id:Ie(C(),()=>{})}),{}),viewport_changed:Ie(j({height:de(),width:Ie(de(),()=>window.innerWidth),is_state_stable:Ce(),is_expanded:Ce()}),()=>({height:window.innerHeight,is_state_stable:!0,is_expanded:!0})),theme_changed:j({theme_params:Rt()})};function jr(e){if(e.source!==window.parent)return;let t;try{t=_e(me(lr()),e.data)}catch{return}const{eventType:n,eventData:r}=t,i=Xo[n];let s;try{s=i?_e(i,r):r}catch(a){return le().forceError([`An error occurred processing the "${n}" event from the Telegram application.`,"Please, file an issue here:","https://github.com/Telegram-Mini-Apps/telegram-apps/issues/new/choose"].join(`
2
+ `)]){}class Br extends H("InvalidLaunchParamsError",(t,n)=>[`Invalid value for launch params: ${t}`,{cause:n}]){}class Tr extends H("UnknownEnvError"){}class Pr extends H("InvokeCustomMethodError",t=>[`Server returned error: ${t}`]){}const Mr="launchParams";function Lr(e){return e.replace(/^[^?#]*[?#]/,"").replace(/[?#]/g,"&")}const Be=xe(We,Ao(at)),Jo=X(Be),xt=xe(We,So(e=>{const t=new URLSearchParams(e).get("tgWebAppData");return t?Bo(t):qo})),Qo=xe(xt,$o(e=>{throw e},e=>e),Mo(()=>{},e=>e));function We(){const e=[];for(const[t,n]of[[()=>Lr(window.location.href),"window.location.href"],[()=>{const r=performance.getEntriesByType("navigation")[0];return r&&Lr(r.name)},"performance navigation entries"],[()=>Un(Mr),"local storage"]]){const r=t();if(!r){e.push({source:n,error:new Error("Source is empty")});continue}const i=ce(at(r),Eo(s=>s,()=>!0));if(typeof i!="boolean"){e.push({source:n,error:i});continue}return Pt(Mr,r),te(r)}return Se(new qr(e))}const Zo=X(We);function Yo(e,t){const n=new Map,r=mo(),i=(s,a,u=!1)=>{const l=n.get(s)||new Map;n.set(s,l);const c=l.get(a)||[];l.set(a,c);const h=c.findIndex(f=>f[1]===u);if(h>=0&&(r.off(s,c[h][0]),c.splice(h,1),!c.length&&(l.delete(a),!l.size))){const f=n.size;n.delete(s),f&&!n.size&&t()}};return{on(s,a,u){!n.size&&e();const l=()=>{i(s,a,u)},c=(...b)=>{u&&l(),s==="*"?a({name:b[0],payload:b[1]}):a(...b)};r.on(s,c);const h=n.get(s)||new Map;n.set(s,h);const f=h.get(a)||[];return h.set(a,f),f.push([c,u||!1]),l},off:i,emit:r.emit,clear(){const s=n.size;r.all.clear(),n.clear(),s&&t()}}}function Gt(e,t){window.dispatchEvent(new MessageEvent("message",{data:JSON.stringify({eventType:e,eventData:t}),source:window.parent}))}function Wt(e,t,n){const r=[n],i=e[t];typeof i=="function"&&r.push(i);const s=(...u)=>{r.forEach(l=>l(...u))},a=Object.assign((...u)=>{s(...u)},{unwrap(){const{length:u}=r;if(u===1){delete e[t];return}if(u===2){Or(e,t,r[1]);return}r.unshift(1),Or(e,t,s)}});Rr(e,t,()=>a,u=>r.push(u))}function Vr(e,t){const n=e[t];Rr(e,t,()=>n,r=>{Object.entries(r).forEach(([i,s])=>{n[i]=s})})}function Rr(e,t,n,r){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:n,set:r})}function Or(e,t,n){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n})}const Xo={clipboard_text_received:j({req_id:C(),data:Ie(C())}),custom_method_invoked:j({req_id:C(),result:$(At()),error:$(C())}),popup_closed:Ie(j({button_id:Ie(C(),()=>{})}),{}),viewport_changed:Ie(j({height:de(),width:Ie(de(),()=>window.innerWidth),is_state_stable:Ce(),is_expanded:Ce()}),()=>({height:window.innerHeight,is_state_stable:!0,is_expanded:!0})),theme_changed:j({theme_params:Rt()})};function jr(e){if(e.source!==window.parent)return;let t;try{t=_e(me(lr()),e.data)}catch{return}const{eventType:n,eventData:r}=t,i=Xo[n];let s;try{s=i?_e(i,r):r}catch(a){return le().forceError([`An error occurred processing the "${n}" event from the Telegram application.`,"Please, file an issue here:","https://github.com/Telegram-Mini-Apps/tma.js/issues/new/choose"].join(`
3
3
  `),t,a)}ea(n,s)}const{on:ee,off:ke,emit:ea,clear:ta}=Yo(()=>{const e=window;!e.TelegramGameProxy&&(e.TelegramGameProxy={}),Wt(e.TelegramGameProxy,"receiveEvent",Gt),Vr(e,"TelegramGameProxy"),!e.Telegram&&(e.Telegram={}),!e.Telegram.WebView&&(e.Telegram.WebView={}),Wt(e.Telegram.WebView,"receiveEvent",Gt),Vr(e.Telegram,"WebView"),Wt(e,"TelegramGameProxy_receiveEvent",Gt),window.addEventListener("message",jr)},()=>{[["TelegramGameProxy_receiveEvent"],["TelegramGameProxy","receiveEvent"],["Telegram","WebView","receiveEvent"]].forEach(e=>{const t=window;let n=[void 0,t];for(const s of e)if(n=[n[1],n[1][s]],!n[1])return;const[r,i]=n;"unwrap"in i&&(i.unwrap(),r&&r!==t&&!Object.keys(r).length&&delete t[e[0]])}),window.removeEventListener("message",jr)}),Ht=W(!1),Dr=W("https://web.telegram.org"),na=e=>{le().log("Event received:",e)},Ur=F(Ht);function ra(e){e!==Ht()&&(Ht.set(e),(e?ee:ke)("*",na))}const xr=F(Dr);function sa(e){Dr.set(e),le().log("New target origin set",e)}const ut=W((...e)=>{window.parent.postMessage(...e)}),le=W(xn("Bridge",{bgColor:"#9147ff",textColor:"white",shouldLog:Ur})),ia=(...e)=>ut()(...e);function oa(e,t){ce(Nt(e,t),ko(n=>{throw n}))}function Nt(e,t){le().log("Posting event:",t?{eventType:e,eventData:t}:{eventType:e});const n=window,r=JSON.stringify({eventType:e,eventData:t});return vr()?(ia(r,xr()),te(void 0)):gr(n)?(n.TelegramWebviewProxy.postEvent(e,JSON.stringify(t)),te(void 0)):St(j({external:j({notify:kt()})}),n)?(n.external.notify(r),te(void 0)):Se(new Tr)}function zt(e,t,n={}){const{capture:r=()=>!0,postEvent:i=Nt}=n;return ce(async()=>i(e,n.params),Ko(()=>De((s,a,u)=>{const[l,c]=st();(Array.isArray(t)?t:[t]).forEach(h=>{l(ee(h,f=>{(Array.isArray(t)?r({event:h,payload:f}):r(f))&&s(f)}))}),u.on("finalized",c)},n)))}function aa(e,t){const n=Kt(e,t);return typeof n=="function"?rt.fn(()=>je(n)):n}function Kt(e,t){const n=gr(window);if(!e)return n||ce(We(),Dt(()=>!1,()=>!0));if(n)return Er(!0);const{timeout:r=100}=t||{};return ce(zt("web_app_request_theme","theme_changed",{...t,timeout:r}),No(i=>Bt.is(i)?te(!1):Se(i),()=>te(!0)))}function ua({launchParams:e,onEvent:t,resetPostMessage:n}={}){if(e){const s=typeof e=="string"||e instanceof URLSearchParams?e.toString():_r({...e,tgWebAppData:void 0})+(e.tgWebAppData?`&tgWebAppData=${encodeURIComponent(e.tgWebAppData.toString())}`:"");try{hr(s)}catch(a){throw new Br(s,a)}Pt("launchParams",s)}if(vr()){if(!t)return;n&&ut.reset();const s=ut();ut.set((...a)=>{const[u]=a,l=()=>{s(...a)};try{const c=_e(me(lr()),u);t([c.eventType,c.eventData],l)}catch{l()}});return}const r=window.TelegramWebviewProxy||{},i=r.postEvent||(()=>{});window.TelegramWebviewProxy={...r,postEvent(s,a){const u=()=>{i(s,a)};t?t([s,a?JSON.parse(a):void 0],u):u()}},le().log("Environment was mocked by the mockTelegramEnv function")}function Gr(e){return({req_id:t})=>t===e}function Wr(e){return e.split(".").map(Number)}function ca(e,t){const n=Wr(e),r=Wr(t),i=Math.max(n.length,r.length);for(let s=0;s<i;s+=1){const a=n[s]||0,u=r[s]||0;if(a!==u)return a>u?1:-1}return 0}const Hr={"6.0":["iframe_ready","iframe_will_reload","web_app_close","web_app_data_send","web_app_expand","web_app_open_link","web_app_ready","web_app_request_theme","web_app_request_viewport","web_app_setup_main_button","web_app_setup_closing_behavior"],6.1:["web_app_open_tg_link","web_app_open_invoice","web_app_setup_back_button","web_app_set_background_color","web_app_set_header_color","web_app_trigger_haptic_feedback"],6.2:["web_app_open_popup"],6.4:["web_app_close_scan_qr_popup","web_app_open_scan_qr_popup","web_app_read_text_from_clipboard",{method:"web_app_open_link",param:"try_instant_view"}],6.7:["web_app_switch_inline_query"],6.9:["web_app_invoke_custom_method","web_app_request_write_access","web_app_request_phone",{method:"web_app_set_header_color",param:"color"}],"6.10":["web_app_setup_settings_button"],7.2:["web_app_biometry_get_info","web_app_biometry_open_settings","web_app_biometry_request_access","web_app_biometry_request_auth","web_app_biometry_update_token"],7.6:[{method:"web_app_open_link",param:"try_browser"},{method:"web_app_close",param:"return_back"}],7.7:["web_app_setup_swipe_behavior"],7.8:["web_app_share_to_story"],"7.10":["web_app_setup_secondary_button","web_app_set_bottom_bar_color",{method:"web_app_setup_main_button",param:"has_shine_effect"}],"8.0":["web_app_request_safe_area","web_app_request_content_safe_area","web_app_request_fullscreen","web_app_exit_fullscreen","web_app_set_emoji_status","web_app_add_to_home_screen","web_app_check_home_screen","web_app_request_emoji_status_access","web_app_check_location","web_app_open_location_settings","web_app_request_file_download","web_app_request_location","web_app_send_prepared_message","web_app_start_accelerometer","web_app_start_device_orientation","web_app_start_gyroscope","web_app_stop_accelerometer","web_app_stop_device_orientation","web_app_stop_gyroscope","web_app_toggle_orientation_lock"],"9.0":["web_app_device_storage_clear","web_app_device_storage_get_key","web_app_device_storage_save_key","web_app_secure_storage_clear","web_app_secure_storage_get_key","web_app_secure_storage_restore_key","web_app_secure_storage_save_key"],9.1:["web_app_hide_keyboard"]};function Jt(e,t){return Object.keys(Hr).find(n=>Hr[n].some(r=>t?typeof r=="object"&&r.method===e&&r.param===t:r===e))||null}function pe(e,t,n){const r=n?Jt(e,t):Jt(e);return r?ca(r,n||t)<=0:!1}function la(e,t="strict"){const n=typeof t=="function"?t:r=>{const{method:i,version:s}=r,a="param"in r?new Ir(i,r.param,s):new Ar(i,s);if(t==="strict")throw a;return le().forceWarn(a.message)};return(r,i)=>pe(r,e)?r==="web_app_set_header_color"&&St(j({color:Bn()}),i)&&!pe(r,"color",e)?n({version:e,method:r,param:"color"}):oa(r,i):n({version:e,method:r})}function pa(e,t,n,r){return ce(zt("web_app_invoke_custom_method","custom_method_invoked",{...r||{},params:{method:e,params:t,req_id:n},capture:Gr(n)}),zo(({result:i,error:s})=>s?Ho(new Pr(s)):Er(i)))}function ha(){Object.hasOwn||(Object.hasOwn=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)})}function Qt(e){return Ut(()=>decodeURIComponent(atob(e).replace(/-/g,"+").replace(/_/g,"/").split("").map(t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join("")),t=>t)}const fa=X(Qt);function Zt(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,n)=>String.fromCharCode(parseInt(`0x${n}`)))).replace(/\+/g,"-").replace(/\//g,"_")}var da=function(e){return Ut(function(){return JSON.parse(e)},go)};function Nr(e){const t=Zt(typeof e=="string"?e:JSON.stringify(e));return t.length>512?Se(new Error("Value is too long for start parameter")):te(t)}const _a=X(Nr);function ma(e,t){return je(zr(e,typeof t=="function"?n=>Ut(()=>t(n),r=>r):t))}function zr(e,t){return ce(Qt(e),Io(n=>t?typeof t=="function"?t(n):da(n):te(n)))}function ba(e){return Zt(e).length<=512}function Q(e){return typeof e=="function"?e():e}function ie(e,t){return F(()=>pe(e,Q(t)))}var Te=Js,He=Qs,ga=function(e,t){return d(e,ya(t))},va=function(e,t){return d(e,Fa(t))},wa="Option",ya=function(e){return function(t){return Ne(t)?Te:He(e(t.value))}},Ca=He,Fa=function(e){return function(t){return Ne(t)||Ne(e)?Te:He(t.value(e.value))}},Sa=Ve(2,function(e,t){return Ne(e)?Te:t(e.value)}),ka={URI:wa,map:ga,ap:va,chain:Sa},Ne=function(e){return e._tag==="None"},Ea=function(e,t){return function(n){return Ne(n)?e():t(n.value)}},Kr=Ea,$a=Ca(dt),Jr=_t(ka);function Aa(e){return we(P,e.of)}function Ia(e){return we(O,e.of)}function qa(e){return Xs(e,ti)}function Ba(e){return Ys(e,ii)}function Ta(e){return function(t,n){return e.chain(t,function(r){return ye(r)?e.of(r):n(r.right)})}}function Pa(e){return function(t,n,r){return e.map(t,ai(n,r))}}function Ma(e){return function(t,n){return function(r){return e.map(r,Re(t,n))}}}var Yt=function(e,t){return d(e,La(t))},Qr=function(e,t){return d(e,Va(t))},La=function(e){return function(t){return function(){return Promise.resolve().then(t).then(e)}}},Va=function(e){return function(t){return function(){return Promise.all([Promise.resolve().then(t),Promise.resolve().then(e)]).then(function(n){var r=n[0],i=n[1];return r(i)})}}},Xt=function(e){return function(){return Promise.resolve(e)}},Ra=Ve(2,function(e,t){return function(){return Promise.resolve().then(e).then(function(n){return t(n)()})}}),en="Task",tn={URI:en,map:Yt},Zr={of:Xt},Oa={URI:en,map:Yt,ap:Qr},ja={URI:en,map:Yt,of:Xt,ap:Qr,chain:Ra},Da=function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function u(h){try{c(r.next(h))}catch(f){a(f)}}function l(h){try{c(r.throw(h))}catch(f){a(f)}}function c(h){h.done?s(h.value):i(h.value).then(u,l)}c((r=r.apply(e,t||[])).next())})},Ua=function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(h){return l([c,h])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(h){c=[6,h],i=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},N=Ia(Zr),R=Aa(Zr),Yr=Xt,xa=Ma(tn),Ga=function(e,t){return function(){return Da(void 0,void 0,void 0,function(){var n;return Ua(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e().then(En)];case 1:return[2,r.sent()];case 2:return n=r.sent(),[2,kn(t(n))];case 3:return[2]}})})}},Wa=function(e,t){return d(e,V(t))},Ha=function(e,t){return d(e,Na(t))},V=qa(tn),nn=Ve(3,Pa(tn)),Na=Ba(Oa),rn=Ve(2,Ta(ja)),za=R,Ka="TaskEither",Ja={URI:Ka,map:Wa,ap:Ha,chain:rn},Qa=za(dt),Za=_t(Ja),ct=Za,he=rn,Pe=rn;function Ee(e){return[e]}class ze extends br("ValidationError",(t,n)=>({input:t,issues:n}),"Validation error"){}class lt extends H("CSSVarsBoundError","CSS variables are already bound"){}class Xr extends H("NotAvailableError",Ee){}class Ya extends H("InvalidEnvError",Ee){}class es extends H("FunctionNotAvailableError",Ee){}class ne extends H("InvalidArgumentsError",(t,n)=>[t,{cause:n}]){}class pt extends H("ConcurrentCallError",Ee){}class ts extends H("SetEmojiStatusError",t=>[`Failed to set emoji status: ${t}`]){}class sn extends H("AccessDeniedError",Ee){}class ns extends H("FullscreenFailedError",Ee){}class rs extends H("ShareMessageError",Ee){}class ss extends H("UnknownThemeParamsKeyError",t=>[`Unknown theme params key passed: ${t}`]){}function T(e,t){const n=F(()=>Q(t.version)||"100"),r=F(()=>Q(t.isTma)),{requires:i}=t,s=i?typeof i=="object"?i:{every:[i]}:void 0,a=y=>{if(!t.supports)return!0;const w=t.supports[y];return pe(w.method,w.param,n())},u=()=>{if(!s)return;const[y,w]="every"in s?["every",s.every]:["some",s.some];for(let g=0;g<w.length;g++){const S=w[g],_=typeof S=="function"?S():pe(S,n())?void 0:`it is unsupported in Mini Apps version ${n()}`;if(_&&(y==="every"||g===w.length-1))return _}},l=(...y)=>{for(const w in t.supports)if(t.supports[w].shouldCheck(...y)&&!a(w))return`option ${w} is not supported in Mini Apps version ${n()}`},c=F(()=>!u()),h=F(()=>n()!=="0.0"),f=F(()=>t.isMounted?t.isMounted():!0),b=F(()=>r()&&h()&&c()&&f()),v=y=>{const w=new es(y);return["task","promise"].includes(t.returns)?N(w):O(w)};return Object.assign((...y)=>{var D;const w="Unable to call function:";if(!r())return v(`${w} it can't be called outside Mini Apps`);if(!h())return v(`${w} the SDK was not initialized. Use the SDK init() function`);const g=u();if(g)return v(`${w} ${g}`);const S=l(...y);if(S)return v(`${w} ${S}`);if(!f()){const M=(D=t.isMounting)!=null&&D.call(t)?"mounting. Wait for the mount completion":"unmounted. Use the mount() method";return v(`${w} the component is ${M}`)}const{returns:_}=t;return _==="plain"?ui(()=>e(...y),M=>M):_==="promise"?Ga(()=>e(...y),M=>M):e(...y)},e,{isAvailable:b,ifAvailable(...y){return b()?He(e(...y)):Te}},s?{isSupported:c}:{},t.supports?{supports:a}:{})}function B(e){return t=>T(t,e)}function m(e){return Object.assign(X(e),{ifAvailable(...t){return d(e.ifAvailable(...t),Kr(()=>({ok:!1}),n=>({ok:!0,data:je(n)})))}})}function on(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=r)}return t}function an(e,t){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>Object.prototype.hasOwnProperty.call(t,i)&&e[i]===t[i])}class be{constructor({initialState:t,onChange:n}){o(this,"_state");o(this,"state");o(this,"setState",t=>{const n={...this.state(),...on(t)};an(n,this.state())||this._state.set(n)});this._state=W(t,{equals:an}),this.state=F(this._state),this.state.sub(n)}getter(t){return F(()=>this._state()[t])}hasDiff(t){return!an({...this.state(),...on(t)},this.state())}}class Ke{constructor({onMounted:t,restoreState:n,initialState:r,onUnmounted:i,isPageReload:s}){o(this,"_isMounted",W(!1));o(this,"isMounted",F(this._isMounted));o(this,"mount");o(this,"unmount");this.mount=()=>{if(this.isMounted())return P(void 0);const a=Q(s)?n():void 0,u=a?P(a):typeof r=="function"?r():P(r);return d(u,Z(l=>{Xe(()=>{this._isMounted.set(!0),t==null||t(l)})}))},this.unmount=()=>{this._isMounted()&&Xe(()=>{this._isMounted.set(!1),i==null||i()})}}}class ht{constructor({isTma:t,storage:n,onClick:r,offClick:i,initialState:s,isPageReload:a,postEvent:u,payload:l,method:c,version:h}){o(this,"isMounted");o(this,"isSupported");o(this,"state");o(this,"stateSetters");o(this,"stateBoolSetters");o(this,"setStateFp");o(this,"setState");o(this,"onClickFp");o(this,"onClick");o(this,"offClickFp");o(this,"offClick");o(this,"mountFp");o(this,"mount");o(this,"unmount");const f=new be({initialState:s,onChange(g){n.set(g)}}),b=new Ke({initialState:s,isPageReload:a,onMounted:f.setState,restoreState:n.get}),v={version:h,requires:c,isTma:t},y=B({...v,returns:"plain"}),w=B({...v,returns:"either",isMounted:b.isMounted});this.isMounted=b.isMounted,this.isSupported=ie(c,h),this.state=f.state,this.setStateFp=w(g=>{const S={...this.state(),...on(g)};return f.hasDiff(S)?d(u(c,l(S)),Z(()=>{f.setState(S)})):P(void 0)}),this.setState=m(this.setStateFp),this.onClickFp=y(r),this.onClick=m(this.onClickFp),this.offClickFp=y(i),this.offClick=m(this.offClickFp),this.mountFp=y(()=>{const g=()=>{};return d(b.mount(),Re(g,g))}),this.mount=m(this.mountFp),this.unmount=b.unmount,this.stateSetters=g=>{const S=w(_=>this.setStateFp({[g]:_}));return[m(S),S]},this.stateBoolSetters=g=>{const[,S]=this.stateSetters(g),_=w(()=>S(!1)),D=w(()=>S(!0));return[[m(_),_],[m(D),D]]}}stateGetter(t){return F(()=>this.state()[t])}}class is{constructor(t){o(this,"isVisible");o(this,"isMounted");o(this,"isSupported");o(this,"hideFp");o(this,"hide");o(this,"showFp");o(this,"show");o(this,"onClickFp");o(this,"onClick");o(this,"offClickFp");o(this,"offClick");o(this,"mountFp");o(this,"mount");o(this,"unmount");const n=new ht({...t,method:"web_app_setup_back_button",payload:r=>({is_visible:r.isVisible}),initialState:{isVisible:!1}});this.isVisible=n.stateGetter("isVisible"),this.isMounted=n.isMounted,this.isSupported=n.isSupported,[[this.hide,this.hideFp],[this.show,this.showFp]]=n.stateBoolSetters("isVisible"),this.onClick=n.onClick,this.onClickFp=n.onClickFp,this.offClick=n.offClick,this.offClickFp=n.offClickFp,this.mount=n.mount,this.mountFp=n.mountFp,this.unmount=n.unmount}}function E(){return{isTma:F(()=>Kt())}}function Xa(e){return{get:()=>Un(e),set(t){Pt(e,t)}}}function eu(){return performance.getEntriesByType("navigation")[0]}function tu(){const e=eu();return!!e&&e.type==="reload"}function Je(e){return t=>({...t,...Q(e)})}function ge(e){return Je({storage:Xa(e),isPageReload:tu})}function Qe(e,t){return W(e,t)}const os=Qe(Nt),Me=(...e)=>os()(...e),as=(...e)=>je(Me(...e)),z=Je({postEvent:Me}),un=Qe("0.0"),A=Je({version:un});function cn(e,t){return{...d(E(),z,A,ge(e)),onClick(n,r){return ee(t,n,r)},offClick(n,r){ke(t,n,r)}}}const nu=new is(cn("backButton","back_button_pressed"));class ln{constructor({initialState:t,onMounted:n,restoreState:r,onUnmounted:i,isPageReload:s}){o(this,"_isMounted",W(!1));o(this,"isMounted",F(this._isMounted));o(this,"mount");o(this,"unmount");this.mount=a=>{if(this._isMounted())return R(void 0);const u=Q(s)?r():void 0;return d(u?R(u):t(a),V(l=>{this._isMounted()||Xe(()=>{this._isMounted.set(!0),n==null||n(l)})}))},this.unmount=()=>{this._isMounted()&&Xe(()=>{this._isMounted.set(!1),i==null||i()})}}}const us=new Xr("Biometry is not available");function pn(e){let t=!1,n=!1,r="",i=!1,s="",a=!1;return e.available&&(t=!0,n=e.token_saved,r=e.device_id,i=e.access_requested,s=e.type,a=e.access_granted),{available:t,tokenSaved:n,deviceId:r,type:s,accessGranted:a,accessRequested:i}}class cs{constructor({version:t,request:n,postEvent:r,storage:i,onInfoReceived:s,offInfoReceived:a,isTma:u,isPageReload:l}){o(this,"isAvailable");o(this,"isSupported");o(this,"isMounted");o(this,"state");o(this,"authenticateFp");o(this,"authenticate");o(this,"openSettingsFp");o(this,"openSettings");o(this,"requestAccessFp");o(this,"requestAccess");o(this,"updateTokenFp");o(this,"updateToken");o(this,"mountFp");o(this,"mount");o(this,"unmount");const c=g=>{h.setState(pn(g))},h=new be({initialState:{available:!1,type:"unknown",accessGranted:!1,accessRequested:!1,deviceId:"",tokenSaved:!1},onChange:i.set}),f=new ln({initialState(g){return d(n("web_app_biometry_get_info","biometry_info_received",g),V(pn))},isPageReload:l,onMounted(g){h.setState(g),s(c)},onUnmounted(){a(c)},restoreState:i.get}),b={version:t,requires:"web_app_biometry_request_auth",isTma:u},v=B({...b,returns:"either"}),y=B({...b,returns:"task"}),w=B({...b,isMounted:f.isMounted,returns:"task"});this.isAvailable=h.getter("available"),this.isMounted=f.isMounted,this.isSupported=ie("web_app_biometry_request_auth",t),this.state=h.state,this.unmount=f.unmount,this.mountFp=y(f.mount),this.authenticateFp=w(g=>this.isAvailable()?d(n("web_app_biometry_request_auth","biometry_auth_requested",{...g,params:{reason:((g||{}).reason||"").trim()}}),V(S=>(h.setState({token:S.token}),S))):N(us)),this.openSettingsFp=v(()=>r("web_app_biometry_open_settings")),this.requestAccessFp=w(g=>d(n("web_app_biometry_request_access","biometry_info_received",{...g,params:{reason:((g||{}).reason||"").trim()}}),he(S=>{const _=pn(S);return _.available?(h.setState(_),R(_.accessRequested)):N(us)}))),this.updateTokenFp=w((g={})=>{var S;return d(n("web_app_biometry_update_token","biometry_token_updated",{...g,params:{token:g.token||"",reason:(S=g.reason)==null?void 0:S.trim()}}),V(_=>_.status))}),this.authenticate=m(this.authenticateFp),this.openSettings=m(this.openSettingsFp),this.requestAccess=m(this.requestAccessFp),this.updateToken=m(this.updateTokenFp),this.mount=m(this.mountFp)}}const hn=(e,t,n)=>zt(e,t,{postEvent:Me,...n}),ru=(...e)=>rt.fn(()=>hn(...e)()),Y=Je({request:hn}),su=new cs({...d(E(),z,A,Y,ge("biometry")),offInfoReceived(e){ke("biometry_info_received",e)},onInfoReceived(e){return ee("biometry_info_received",e)}});class ls{constructor({postEvent:t,storage:n,isTma:r,isPageReload:i}){o(this,"isConfirmationEnabled");o(this,"isMounted");o(this,"mountFp");o(this,"mount");o(this,"unmount");o(this,"disableConfirmationFp");o(this,"disableConfirmation");o(this,"enableConfirmationFp");o(this,"enableConfirmation");const s=new be({initialState:{isConfirmationEnabled:!1},onChange(f){n.set(f)}}),a=new Ke({onMounted:s.setState,restoreState:n.get,initialState:{isConfirmationEnabled:!1},isPageReload:i}),u={requires:"web_app_setup_closing_behavior",isTma:r},l=B({...u,returns:"plain"}),c=B({...u,returns:"either",isMounted:a.isMounted}),h=f=>f===this.isConfirmationEnabled()?P(void 0):(s.setState({isConfirmationEnabled:f}),t("web_app_setup_closing_behavior",{need_confirmation:f}));this.isConfirmationEnabled=s.getter("isConfirmationEnabled"),this.isMounted=a.isMounted,this.disableConfirmationFp=c(()=>h(!1)),this.enableConfirmationFp=c(()=>h(!0)),this.mountFp=l(()=>{const f=()=>{};return d(a.mount(),Re(f,f))}),this.unmount=a.unmount,this.disableConfirmation=m(this.disableConfirmationFp),this.enableConfirmation=m(this.enableConfirmationFp),this.mount=m(this.mountFp)}}const iu=new ls(d(E(),ge("closingBehavior"),z));class ps{constructor({version:t,isTma:n,invokeCustomMethod:r}){o(this,"isSupported");o(this,"deleteItemFp");o(this,"deleteItem");o(this,"getItemFp");o(this,"getItem");o(this,"getItemsFp");o(this,"getItems");o(this,"getKeysFp");o(this,"getKeys");o(this,"setItemFp");o(this,"setItem");o(this,"clearFp");o(this,"clear");const i=B({version:t,requires:"web_app_invoke_custom_method",isTma:n,returns:"task"});this.isSupported=ie("web_app_invoke_custom_method",t),this.deleteItemFp=i((s,a)=>{const u=Array.isArray(s)?s:[s];return d(u.length?r("deleteStorageValues",{keys:u},a):R(void 0),V(()=>{}))}),this.getItemFp=i((s,a)=>d(this.getItemsFp([s],a),V(u=>u[s]||""))),this.getItemsFp=i((s,a)=>d(s.length?r("getStorageValues",{keys:s},a):R({}),V(u=>({...s.reduce((l,c)=>(l[c]="",l),{}),..._e($t(C(),C()),u)})))),this.getKeysFp=i(s=>d(r("getStorageKeys",{},s),V(a=>_e(Tn(C()),a)))),this.setItemFp=i((s,a,u)=>d(r("saveStorageValue",{key:s,value:a},u),V(()=>{}))),this.clearFp=i(s=>d(this.getKeysFp(s),he(this.deleteItemFp))),this.deleteItem=m(this.deleteItemFp),this.getItem=m(this.getItemFp),this.getItems=m(this.getItemsFp),this.getKeys=m(this.getKeysFp),this.setItem=m(this.setItemFp),this.clear=m(this.clearFp)}}const fn=Qe(0);function dn(){return fn.set(fn()+1),fn().toString()}function hs(e,t,n){return pa(e,t,dn(),{...n||{},postEvent:Me})}const _n=Je({invokeCustomMethod:hs}),ou=new ps(d(E(),A,_n));function au({request:e,...t}){return T(n=>d(e("web_app_request_emoji_status_access","emoji_status_access_requested",n),V(r=>r.status)),{...t,requires:"web_app_request_emoji_status_access",returns:"task"})}const fs=au(d(E(),A,Y)),uu=m(fs);function cu({request:e,...t}){return T((n,r)=>d(e("web_app_set_emoji_status",["emoji_status_set","emoji_status_failed"],{params:{custom_emoji_id:n,duration:(r||{}).duration},...r}),Pe(i=>i&&"error"in i?N(new ts(i.error)):R(void 0))),{...t,requires:"web_app_set_emoji_status",returns:"task"})}const ds=cu(d(E(),Y,A)),lu=m(ds);class _s{constructor({postEvent:t,isTma:n,version:r}){o(this,"isSupported");o(this,"impactOccurredFp");o(this,"impactOccurred");o(this,"notificationOccurredFp");o(this,"notificationOccurred");o(this,"selectionChangedFp");o(this,"selectionChanged");const i="web_app_trigger_haptic_feedback",s=B({requires:i,isTma:n,version:r,returns:"plain"});this.isSupported=ie(i,r),this.impactOccurredFp=s(a=>t(i,{type:"impact",impact_style:a})),this.notificationOccurredFp=s(a=>t(i,{type:"notification",notification_type:a})),this.selectionChangedFp=s(()=>t(i,{type:"selection_change"})),this.impactOccurred=m(this.impactOccurredFp),this.notificationOccurred=m(this.notificationOccurredFp),this.selectionChanged=m(this.selectionChangedFp)}}const pu=new _s(d(E(),z,A));function hu({postEvent:e,...t}){return T(()=>e("web_app_add_to_home_screen"),{...t,requires:"web_app_add_to_home_screen",returns:"either"})}const ms=hu(d(E(),A,z)),fu=m(ms);function du({request:e,...t}){return T(n=>d(e("web_app_check_home_screen","home_screen_checked",n),V(r=>r.status||"unknown")),{...t,requires:"web_app_check_home_screen",returns:"task"})}const bs=du(d(E(),A,Y)),_u=m(bs);class gs{constructor({retrieveInitData:t}){o(this,"_state",W());o(this,"_raw",W());o(this,"state",F(this._state));o(this,"authDate",this.fromState("auth_date"));o(this,"canSendAfter",this.fromState("can_send_after"));o(this,"canSendAfterDate",F(()=>{const t=this.authDate(),n=this.canSendAfter();return n&&t?new Date(t.getTime()+n*1e3):void 0}));o(this,"chat",this.fromState("chat"));o(this,"chatType",this.fromState("chat_type"));o(this,"chatInstance",this.fromState("chat_instance"));o(this,"hash",this.fromState("hash"));o(this,"queryId",this.fromState("query_id"));o(this,"raw",F(this._raw));o(this,"receiver",this.fromState("receiver"));o(this,"signature",this.fromState("signature"));o(this,"startParam",this.fromState("start_param"));o(this,"user",this.fromState("user"));o(this,"restoreFp");o(this,"restore");this.restoreFp=()=>d(t(),Z(Kr(()=>{},({raw:n,obj:r})=>{this._state.set(r),this._raw.set(n)}))),this.restore=X(this.restoreFp)}fromState(t){return F(()=>{const n=this._state();return n?n[t]:void 0})}}const mu=new gs({retrieveInitData(){return d(ci,In("obj",()=>d(Be(),Z(({tgWebAppData:e})=>e?He(e):Te))),In("raw",xt),Z(({obj:e,raw:t})=>d($a,Jr("obj",()=>e),Jr("raw",()=>t))))}});class vs{constructor({version:t,request:n,isTma:r}){o(this,"isOpened");o(this,"isSupported");o(this,"openSlugFp");o(this,"openSlug");o(this,"openUrlFp");o(this,"openUrl");const i=B({version:t,isTma:r,requires:"web_app_open_invoice",returns:"task"}),s=W(!1),a=()=>{s.set(!1)};this.isSupported=ie("web_app_open_invoice",t),this.isOpened=F(s),this.openSlugFp=i((u,l)=>d(this.isOpened()?N(new pt("Invoice is already opened")):R(void 0),he(()=>(s.set(!0),n("web_app_open_invoice","invoice_closed",{...l,params:{slug:u},capture:c=>u===c.slug}))),nn(c=>(a(),c),c=>(a(),c.status)))),this.openUrlFp=i((u,l)=>{const{hostname:c,pathname:h}=new URL(u,window.location.href);if(c!=="t.me")return N(new ne(`Link has unexpected hostname: ${c}`));const f=h.match(/^\/(\$|invoice\/)([A-Za-z0-9\-_=]+)$/);return f?this.openSlugFp(f[2],l):N(new ne('Expected to receive a link with a pathname in format "/invoice/{slug}" or "/${slug}"'))}),this.openUrl=m(this.openUrlFp),this.openSlug=m(this.openSlugFp)}}const bu=new vs(d(E(),Y,A));function gu({postEvent:e,...t}){return T((n,r={})=>{if(typeof n=="string")try{n=new URL(n)}catch(i){return O(new ne(`"${n.toString()}" is invalid URL`,i))}return e("web_app_open_link",{url:n.toString(),try_browser:r.tryBrowser,try_instant_view:r.tryInstantView})},{...t,returns:"either"})}const ws=gu(d(E(),z)),vu=m(ws);function wu({postEvent:e,version:t,...n}){return T(r=>{const i=r.toString();return i.match(/^https:\/\/t.me\/.+/)?pe("web_app_open_tg_link",Q(t))?(r=new URL(r),e("web_app_open_tg_link",{path_full:r.pathname+r.search})):(window.location.href=i,P(void 0)):O(new ne(`"${i}" is invalid URL`))},{...n,returns:"either"})}const mn=wu(d(E(),z,A)),yu=m(mn);function Cu({openTelegramLink:e,...t}){return T((n,r)=>e("https://t.me/share/url?"+new URLSearchParams({url:n,text:r||""}).toString().replace(/\+/g,"%20")),{...t,returns:"either"})}const ys=Cu({...E(),openTelegramLink:mn}),Fu=m(ys);function Su(e){let t=!1,n,r;return e.available&&(t=!0,n=e.access_requested,r=e.access_granted),{available:t,accessGranted:r||!1,accessRequested:n||!1}}class Cs{constructor({version:t,request:n,postEvent:r,storage:i,isTma:s,isPageReload:a}){o(this,"state");o(this,"isAvailable");o(this,"isAccessGranted");o(this,"isAccessRequested");o(this,"isMounted");o(this,"isSupported");o(this,"openSettingsFp");o(this,"openSettings");o(this,"requestLocationFp");o(this,"requestLocation");o(this,"mountFp");o(this,"mount");o(this,"unmount");const u=new be({initialState:{available:!1,accessGranted:!1,accessRequested:!1},onChange:i.set}),l=new ln({isPageReload:a,restoreState:i.get,onMounted:u.setState,initialState(v){return d(n("web_app_check_location","location_checked",v),V(Su))}}),c={version:t,requires:"web_app_check_location",isTma:s},h=B({...c,returns:"either"}),f=B({...c,returns:"task"}),b=B({...c,returns:"task",isMounted:l.isMounted});this.isAvailable=u.getter("available"),this.isAccessRequested=u.getter("accessRequested"),this.isAccessGranted=u.getter("accessGranted"),this.isSupported=ie("web_app_check_location",t),this.isMounted=l.isMounted,this.state=u.state,this.unmount=l.unmount,this.mountFp=f(l.mount),this.openSettingsFp=h(()=>r("web_app_open_location_settings")),this.requestLocationFp=b(v=>d(n("web_app_request_location","location_requested",v),V(y=>{if(!y.available)return u.setState({available:!1}),null;const{available:w,...g}=y;return g}))),this.mount=m(this.mountFp),this.openSettings=m(this.openSettingsFp),this.requestLocation=m(this.requestLocationFp)}}const ku=new Cs(d(E(),z,A,Y,ge("locationManager")));class Fs{constructor({defaults:t,...n}){o(this,"bgColor");o(this,"hasShineEffect");o(this,"isEnabled");o(this,"isLoaderVisible");o(this,"isVisible");o(this,"isMounted");o(this,"state");o(this,"text");o(this,"textColor");o(this,"showFp");o(this,"show");o(this,"hideFp");o(this,"hide");o(this,"enableFp");o(this,"enable");o(this,"enableShineEffectFp");o(this,"enableShineEffect");o(this,"disableFp");o(this,"disable");o(this,"disableShineEffectFp");o(this,"disableShineEffect");o(this,"setBgColorFp");o(this,"setBgColor");o(this,"setTextColorFp");o(this,"setTextColor");o(this,"setTextFp");o(this,"setText");o(this,"showLoaderFp");o(this,"showLoader");o(this,"hideLoaderFp");o(this,"hideLoader");o(this,"setParamsFp");o(this,"setParams");o(this,"mountFp");o(this,"mount");o(this,"unmount");o(this,"onClickFp");o(this,"onClick");o(this,"offClickFp");o(this,"offClick");const r=new ht({...n,version:"100",initialState:{hasShineEffect:!1,isEnabled:!0,isLoaderVisible:!1,isVisible:!1,text:"Continue"},method:"web_app_setup_main_button",payload:s=>({has_shine_effect:s.hasShineEffect,is_visible:s.isVisible,is_active:s.isEnabled,is_progress_visible:s.isLoaderVisible,text:s.text,color:s.bgColor,text_color:s.textColor})}),i=(s,a)=>{const u=r.stateGetter(s);return F(()=>u()||Q(a))};this.bgColor=i("bgColor",t.bgColor),this.textColor=i("textColor",t.textColor),this.hasShineEffect=r.stateGetter("hasShineEffect"),this.isEnabled=r.stateGetter("isEnabled"),this.isLoaderVisible=r.stateGetter("isLoaderVisible"),this.text=r.stateGetter("text"),this.isVisible=r.stateGetter("isVisible"),this.isMounted=r.isMounted,this.state=r.state,[this.setBgColor,this.setBgColorFp]=r.stateSetters("bgColor"),[this.setTextColor,this.setTextColorFp]=r.stateSetters("textColor"),[[this.disableShineEffect,this.disableShineEffectFp],[this.enableShineEffect,this.enableShineEffectFp]]=r.stateBoolSetters("hasShineEffect"),[[this.disable,this.disableFp],[this.enable,this.enableFp]]=r.stateBoolSetters("isEnabled"),[[this.hideLoader,this.hideLoaderFp],[this.showLoader,this.showLoaderFp]]=r.stateBoolSetters("isLoaderVisible"),[this.setText,this.setTextFp]=r.stateSetters("text"),[[this.hide,this.hideFp],[this.show,this.showFp]]=r.stateBoolSetters("isVisible"),this.setParams=r.setState,this.setParamsFp=r.setStateFp,this.onClick=r.onClick,this.onClickFp=r.onClickFp,this.offClick=r.offClick,this.offClickFp=r.offClickFp,this.mount=r.mount,this.mountFp=r.mountFp,this.unmount=r.unmount}}function Ss(e,t,n){return d(cn(e,t),r=>({...r,defaults:n}))}const bn=Qe({});function gn(e,t){document.documentElement.style.setProperty(e,t)}function vn(e){document.documentElement.style.removeProperty(e)}function ks(e){return d(ot(e),Z(t=>Math.sqrt([.299,.587,.114].reduce((n,r,i)=>{const s=parseInt(t.slice(1+i*2,1+(i+1)*2),16);return n+s*s*r},0))<120))}const wn=X(ks);class Es{constructor({initialState:t,onChange:n,offChange:r,isTma:i,storage:s,isPageReload:a}){o(this,"accentTextColor");o(this,"bgColor");o(this,"buttonColor");o(this,"buttonTextColor");o(this,"bottomBarBgColor");o(this,"destructiveTextColor");o(this,"headerBgColor");o(this,"hintColor");o(this,"linkColor");o(this,"secondaryBgColor");o(this,"sectionBgColor");o(this,"sectionHeaderTextColor");o(this,"sectionSeparatorColor");o(this,"subtitleTextColor");o(this,"textColor");o(this,"_isCssVarsBound",W(!1));o(this,"isCssVarsBound",F(this._isCssVarsBound));o(this,"bindCssVarsFp");o(this,"bindCssVars");o(this,"state");o(this,"isDark",F(()=>{const t=this.bgColor();return!t||wn(t)}));o(this,"isMounted");o(this,"mountFp");o(this,"mount");o(this,"unmount");const u=new be({initialState:{},onChange:s.set}),l=v=>{u.setState(v.theme_params)},c=new Ke({initialState:()=>P(Q(t)),isPageReload:a,onMounted(v){u.setState(v),n(l)},onUnmounted(){r(l)},restoreState:s.get}),h={isTma:i,returns:"either"},f=B(h),b=B({...h,isMounted:c.isMounted});this.accentTextColor=u.getter("accent_text_color"),this.bgColor=u.getter("bg_color"),this.buttonColor=u.getter("button_color"),this.buttonTextColor=u.getter("button_text_color"),this.bottomBarBgColor=u.getter("bottom_bar_bg_color"),this.destructiveTextColor=u.getter("destructive_text_color"),this.headerBgColor=u.getter("header_bg_color"),this.hintColor=u.getter("hint_color"),this.linkColor=u.getter("link_color"),this.secondaryBgColor=u.getter("secondary_bg_color"),this.sectionBgColor=u.getter("section_bg_color"),this.sectionHeaderTextColor=u.getter("section_header_text_color"),this.sectionSeparatorColor=u.getter("section_separator_color"),this.subtitleTextColor=u.getter("subtitle_text_color"),this.textColor=u.getter("text_color"),this.state=u.state,this.isMounted=c.isMounted,this.bindCssVarsFp=b(v=>{if(this._isCssVarsBound())return O(new lt);v||(v=g=>`--tg-theme-${Ii(g)}`);const y=g=>{Object.entries(u.state()).forEach(([S,_])=>{_&&g(S,_)})},w=()=>{y((g,S)=>{gn(v(g),S)})};return w(),u.state.sub(w),this._isCssVarsBound.set(!0),P(()=>{y(vn),u.state.unsub(w),this._isCssVarsBound.set(!1)})}),this.mountFp=f(c.mount),this.unmount=c.unmount,this.bindCssVars=m(this.bindCssVarsFp),this.mount=m(this.mountFp)}}const Ze=new Es({...d(E(),ge("themeParams")),offChange(e){ke("theme_changed",e)},onChange(e){ee("theme_changed",e)},initialState:bn}),Eu=new Fs(Ss("mainButton","main_button_pressed",{bgColor:F(()=>Ze.buttonColor()||"#2481cc"),textColor:F(()=>Ze.buttonTextColor()||"#ffffff")}));class $s{constructor({storage:t,isPageReload:n,version:r,postEvent:i,isTma:s,theme:a,onVisibilityChanged:u,offVisibilityChanged:l}){o(this,"isSupported");o(this,"isDark",F(()=>{const t=this.bgColorRgb();return t?wn(t):!1}));o(this,"isActive");o(this,"state");o(this,"isCssVarsBound");o(this,"bindCssVarsFp");o(this,"bindCssVars");o(this,"isMounted");o(this,"mountFp");o(this,"mount");o(this,"unmount");o(this,"bgColor");o(this,"bgColorRgb");o(this,"setBgColorFp");o(this,"setBgColor");o(this,"headerColor");o(this,"headerColorRgb");o(this,"setHeaderColorFp");o(this,"setHeaderColor");o(this,"bottomBarColor");o(this,"bottomBarColorRgb");o(this,"setBottomBarColorFp");o(this,"setBottomBarColor");o(this,"closeFp");o(this,"close");o(this,"readyFp");o(this,"ready");const c=_=>{b.setState({isActive:_.is_visible})},h=_=>{[[this.headerColor,"web_app_set_header_color"],[this.bgColor,"web_app_set_background_color"],[this.bottomBarColor,"web_app_set_bottom_bar_color"]].forEach(([D,M])=>{const U=D();if(!Ue(U)&&(M==="web_app_set_header_color"||!["bg_color","secondary_bg_color"].includes(U))){const k=_[U];k&&i(M,{color:k})}})},f=new Ke({initialState(){const _=Q(a);return P({bgColor:_.bg_color||"bg_color",headerColor:_.header_bg_color||"header_bg_color",bottomBarColor:_.bottom_bar_bg_color||"bottom_bar_bg_color",isActive:!0})},isPageReload:n,onMounted:_=>{this.setBgColorFp.ifAvailable(_.bgColor),this.setBottomBarColorFp.ifAvailable(_.bottomBarColor),this.setHeaderColorFp.ifAvailable(_.headerColor),u(c),a.sub(h),b.setState(_)},onUnmounted(){l(c),a.unsub(h)},restoreState:t.get});this.isMounted=f.isMounted,this.mountFp=T(()=>{const _=()=>{};return d(f.mount(),Re(_,_))},{isTma:s,returns:"plain"}),this.mount=m(this.mountFp),this.unmount=f.unmount;const b=new be({initialState:{bgColor:"bg_color",bottomBarColor:"bottom_bar_bg_color",headerColor:"bg_color",isActive:!1},onChange:t.set});this.state=b.state;const v=_=>Ue(_)?_:Q(a)[_],y=_=>F(()=>v(_()));this.isActive=b.getter("isActive"),this.isSupported=F(()=>["web_app_set_header_color","web_app_set_background_color","web_app_set_bottom_bar_color"].some(_=>pe(_,Q(r))));const w=W(!1);this.isCssVarsBound=F(w),this.bindCssVarsFp=T(_=>{if(w())return O(new lt);const[D,M]=st(()=>{w.set(!1)}),U=(k,L)=>{const I=()=>{gn(k,L()||null)};I(),D(L.sub(I),vn.bind(null,k))};return _||(_=k=>`--tg-${jn(k)}`),U(_("bgColor"),this.bgColorRgb),U(_("bottomBarColor"),this.bottomBarColorRgb),U(_("headerColor"),this.headerColorRgb),w.set(!0),P(M)},{isTma:s,returns:"either",isMounted:this.isMounted}),this.bindCssVars=m(this.bindCssVarsFp);const g=_=>{const D=b.getter(_),M=y(D),U={headerColor:"web_app_set_header_color",bgColor:"web_app_set_background_color",bottomBarColor:"web_app_set_bottom_bar_color"}[_],k=T(L=>{if(L===D())return P(void 0);if(U==="web_app_set_header_color"&&(L==="bg_color"||L==="secondary_bg_color"))return i("web_app_set_header_color",{color_key:L});const I=v(L);return d(I?i(U,{color:I}):O(new ss(L)),Z(()=>{b.setState({[_]:I})}))},{isTma:s,version:r,requires:U,isMounted:this.isMounted,returns:"either",supports:_==="headerColor"?{rgb:{method:"web_app_set_header_color",param:"color",shouldCheck:Ue}}:void 0});return[D,M,m(k),k]};[this.bgColor,this.bgColorRgb,this.setBgColor,this.setBgColorFp]=g("bgColor"),[this.headerColor,this.headerColorRgb,this.setHeaderColor,this.setHeaderColorFp]=g("headerColor"),[this.bottomBarColor,this.bottomBarColorRgb,this.setBottomBarColor,this.setBottomBarColorFp]=g("bottomBarColor");const S=B({isTma:s,returns:"either"});this.closeFp=S(_=>i("web_app_close",{return_back:_})),this.close=m(this.closeFp),this.readyFp=S(()=>i("web_app_ready")),this.ready=m(this.readyFp)}}const As=new $s({...d(E(),z,A,ge("miniApp")),offVisibilityChanged(e){ke("visibility_changed",e)},onVisibilityChanged(e){ee("visibility_changed",e)},theme:Ze.state});function $u(e){const t=e.message.trim(),n=(e.title||"").trim(),r=e.buttons||[];if(n.length>64)return O(new ne(`Invalid title: ${n}`));if(!t||t.length>256)return O(new ne(`Invalid message: ${t}`));if(r.length>3)return O(new ne(`Invalid buttons count: ${r.length}`));const i=[];if(!r.length)i.push({type:"close",id:""});else for(let s=0;s<r.length;s++){const a=r[s],u=a.id||"";if(u.length>64)return O(new ne(`Button with index ${s} has invalid id: ${u}`));if(!a.type||a.type==="default"||a.type==="destructive"){const l=a.text.trim();if(!l||l.length>64)return O(new ne(`Button with index ${s} has invalid text: ${l}`));i.push({type:a.type,text:l,id:u})}else i.push({type:a.type,id:u})}return P({title:n,message:t,buttons:i})}class Is{constructor({version:t,isTma:n,request:r}){o(this,"isOpened");o(this,"isSupported");o(this,"showFp");o(this,"show");const i=W(!1),s=()=>{i.set(!1)},a=B({version:t,isTma:n,requires:"web_app_open_popup",returns:"task"});this.isSupported=ie("web_app_open_popup",t),this.isOpened=F(i),this.showFp=a(u=>d(this.isOpened()?N(new pt("A popup is already opened")):R(void 0),Pe(()=>Yr($u(u))),he(l=>(i.set(!0),r("web_app_open_popup","popup_closed",{...u,params:l}))),nn(l=>(s(),l),l=>(s(),l.button_id)))),this.show=m(this.showFp)}}const Au=new Is(d(E(),Y,A));function Iu({request:e,...t}){return T(n=>d(e("web_app_request_phone","phone_requested",n),V(r=>r.status)),{...t,requires:"web_app_request_phone",returns:"task"})}const yn=Iu(d(E(),A,Y)),qu=m(yn);function Bu({invokeCustomMethod:e,requestPhoneAccess:t,...n}){const r=a=>d(e("getRequestedContact",{},{...a,timeout:(a||{}).timeout||5e3}),Pe(u=>{const l=It(C(),u);if(!l.success)return N(new ze(u,l.issues));if(!l.output)return R(void 0);const c=It(Vt(j({contact:me(j({user_id:de(),phone_number:C(),first_name:C(),last_name:$(C())})),auth_date:se(C(),ue(h=>new Date(Number(h)*1e3)),tt()),hash:C()})),l.output);return c.success?R({raw:l.output,parsed:c.output}):N(new ze(l.output,c.issues))})),i=a=>d(r(a),xa(u=>ze.is(u)?O(u):P(void 0),u=>P(u))),s=a=>De(async(u,l,c)=>{let h=50;for(;!c.isRejected;){const f=await i(c)();if(f._tag==="Left")return l(f.left);if(f.right)return u(f.right);await new Promise(b=>setTimeout(b,h)),h+=50}},a);return T(a=>De.fn(u=>d(i(u),he(l=>l?R(l):d(t(u),Pe(c=>c==="sent"?s(u):N(new sn("User denied access")))))),a),{...n,returns:"task",requires:"web_app_request_phone"})}function Tu({requestContact:e,...t}){return T(e,{...t,returns:"task",requires:"web_app_request_phone"})}const Cn=Bu({...d(E(),_n,A),requestPhoneAccess:yn}),Pu=m(Cn),qs=Tu({...d(E(),A),requestContact(e){return d(Cn(e),V(t=>t.parsed))}}),Mu=m(qs);function Lu({request:e,...t}){return T(n=>d(e("web_app_request_write_access","write_access_requested",n),V(r=>r.status)),{...t,requires:"web_app_request_write_access",returns:"task"})}const Bs=Lu(d(E(),A,Y)),Vu=m(Bs);class Ts{constructor({version:t,onClosed:n,onTextReceived:r,isTma:i,postEvent:s}){o(this,"isOpened");o(this,"isSupported");o(this,"captureFp");o(this,"capture");o(this,"closeFp");o(this,"close");o(this,"openFp");o(this,"open");const a={version:t,requires:"web_app_open_scan_qr_popup",isTma:i},u=B({...a,returns:"either"}),l=B({...a,returns:"task"}),c=W(!1),h=()=>{c.set(!1)};this.isSupported=ie("web_app_open_scan_qr_popup",t),this.isOpened=F(c),this.captureFp=l(f=>{let b;return d(this.openFp({...f,onCaptured:v=>{f.capture(v)&&(b=v,this.close())}}),V(()=>b))}),this.closeFp=u(()=>d(s("web_app_close_scan_qr_popup"),Z(h))),this.openFp=l(f=>d(this.isOpened()?N(new pt("The QR Scanner is already opened")):async()=>s("web_app_open_scan_qr_popup",{text:f.text}),Pe(()=>{const[b,v]=st(),y=w=>(v(),w);return d(De(w=>{b(n(w),r(f.onCaptured))},f),nn(y,y))}))),this.open=m(this.openFp),this.capture=m(this.captureFp),this.close=m(this.closeFp)}}const Ru=new Ts({...d(E(),z,A),onClosed(e){return ee("scan_qr_popup_closed",e)},onTextReceived(e){return ee("qr_text_received",t=>{e(t.data)})}});class Ps{constructor({defaults:t,...n}){o(this,"isSupported");o(this,"position");o(this,"bgColor");o(this,"hasShineEffect");o(this,"isEnabled");o(this,"isLoaderVisible");o(this,"isVisible");o(this,"isMounted");o(this,"state");o(this,"text");o(this,"textColor");o(this,"showFp");o(this,"show");o(this,"hideFp");o(this,"hide");o(this,"enableFp");o(this,"enable");o(this,"enableShineEffectFp");o(this,"enableShineEffect");o(this,"disableFp");o(this,"disable");o(this,"disableShineEffectFp");o(this,"disableShineEffect");o(this,"setBgColorFp");o(this,"setBgColor");o(this,"setTextColorFp");o(this,"setTextColor");o(this,"setTextFp");o(this,"setText");o(this,"setPositionFp");o(this,"setPosition");o(this,"showLoaderFp");o(this,"showLoader");o(this,"hideLoaderFp");o(this,"hideLoader");o(this,"setParamsFp");o(this,"setParams");o(this,"mountFp");o(this,"mount");o(this,"unmount");o(this,"onClickFp");o(this,"onClick");o(this,"offClickFp");o(this,"offClick");const r=new ht({...n,initialState:{hasShineEffect:!1,isEnabled:!0,isLoaderVisible:!1,isVisible:!1,text:"Cancel",position:"left"},method:"web_app_setup_secondary_button",payload:s=>({has_shine_effect:s.hasShineEffect,is_visible:s.isVisible,is_active:s.isEnabled,is_progress_visible:s.isLoaderVisible,text:s.text,color:s.bgColor,text_color:s.textColor,position:s.position})}),i=(s,a)=>{const u=r.stateGetter(s);return F(()=>u()||Q(a))};this.isSupported=ie("web_app_setup_secondary_button",n.version),this.bgColor=i("bgColor",t.bgColor),this.textColor=i("textColor",t.textColor),this.position=r.stateGetter("position"),this.hasShineEffect=r.stateGetter("hasShineEffect"),this.isEnabled=r.stateGetter("isEnabled"),this.isLoaderVisible=r.stateGetter("isLoaderVisible"),this.text=r.stateGetter("text"),this.isVisible=r.stateGetter("isVisible"),this.isMounted=r.isMounted,this.state=r.state,[this.setPosition,this.setPositionFp]=r.stateSetters("position"),[this.setBgColor,this.setBgColorFp]=r.stateSetters("bgColor"),[this.setTextColor,this.setTextColorFp]=r.stateSetters("textColor"),[[this.disableShineEffect,this.disableShineEffectFp],[this.enableShineEffect,this.enableShineEffectFp]]=r.stateBoolSetters("hasShineEffect"),[[this.disable,this.disableFp],[this.enable,this.enableFp]]=r.stateBoolSetters("isEnabled"),[[this.hideLoader,this.hideLoaderFp],[this.showLoader,this.showLoaderFp]]=r.stateBoolSetters("isLoaderVisible"),[this.setText,this.setTextFp]=r.stateSetters("text"),[[this.hide,this.hideFp],[this.show,this.showFp]]=r.stateBoolSetters("isVisible"),this.setParams=r.setState,this.setParamsFp=r.setStateFp,this.onClick=r.onClick,this.onClickFp=r.onClickFp,this.offClick=r.offClick,this.offClickFp=r.offClickFp,this.mount=r.mount,this.mountFp=r.mountFp,this.unmount=r.unmount}}const Ou=new Ps(Ss("secondaryButton","secondary_button_pressed",{bgColor:F(()=>As.bottomBarColorRgb()||"#000000"),textColor:F(()=>Ze.buttonColor()||"#2481cc")}));class Ms{constructor(t){o(this,"isVisible");o(this,"isMounted");o(this,"isSupported");o(this,"hideFp");o(this,"hide");o(this,"showFp");o(this,"show");o(this,"onClickFp");o(this,"onClick");o(this,"offClickFp");o(this,"offClick");o(this,"mountFp");o(this,"mount");o(this,"unmount");const n=new ht({...t,method:"web_app_setup_settings_button",payload:r=>({is_visible:r.isVisible}),initialState:{isVisible:!1}});this.isVisible=n.stateGetter("isVisible"),this.isMounted=n.isMounted,this.isSupported=n.isSupported,[[this.hide,this.hideFp],[this.show,this.showFp]]=n.stateBoolSetters("isVisible"),this.onClick=n.onClick,this.onClickFp=n.onClickFp,this.offClick=n.offClick,this.offClickFp=n.offClickFp,this.mount=n.mount,this.mountFp=n.mountFp,this.unmount=n.unmount}}const ju=new Ms(cn("settingsButton","settings_button_pressed"));class Ls{constructor({postEvent:t,storage:n,isTma:r,isPageReload:i,version:s}){o(this,"isSupported");o(this,"isVerticalEnabled");o(this,"isMounted");o(this,"mountFp");o(this,"mount");o(this,"unmount");o(this,"disableVerticalFp");o(this,"disableVertical");o(this,"enableVerticalFp");o(this,"enableVertical");const a=new be({initialState:{isVerticalEnabled:!1},onChange(b){n.set(b)}}),u=new Ke({initialState:{isVerticalEnabled:!1},isPageReload:i,onMounted:a.setState,restoreState:n.get}),l={requires:"web_app_setup_swipe_behavior",isTma:r,version:s},c=B({...l,returns:"plain"}),h=B({...l,isMounted:u.isMounted,returns:"either"}),f=b=>{const v={isVerticalEnabled:b};return a.hasDiff(v)?d(t("web_app_setup_swipe_behavior",{allow_vertical_swipe:b}),Z(()=>{a.setState(v)})):P(void 0)};this.isSupported=ie("web_app_setup_swipe_behavior",s),this.isVerticalEnabled=a.getter("isVerticalEnabled"),this.isMounted=u.isMounted,this.disableVerticalFp=h(()=>f(!1)),this.enableVerticalFp=h(()=>f(!0)),this.mountFp=c(()=>{const b=()=>{};return d(u.mount(),Re(b,b))}),this.unmount=u.unmount,this.disableVertical=m(this.disableVerticalFp),this.enableVertical=m(this.enableVerticalFp),this.mount=m(this.mountFp)}}const Du=new Ls(d(E(),z,A,ge("swipeBehavior")));async function Uu(e){try{const{clipboard:n}=navigator;if(n)return await n.writeText(e)}catch{}const t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}finally{document.body.removeChild(t)}}function xu({request:e,...t}){return T((n,r,i)=>d(e("web_app_request_file_download","file_download_requested",{...i,params:{url:n,file_name:r}}),he(s=>s.status==="downloading"?R(void 0):N(new sn("User denied the action")))),{...t,requires:"web_app_request_file_download",returns:"task"})}const Vs=xu(d(E(),Y,A)),Gu=m(Vs);function Wu({invokeCustomMethod:e,...t}){return T(n=>d(e("getCurrentTime",{},n),he(r=>{const i=It(se(de(),Ct(),ue(s=>new Date(s*1e3)),tt()),r);return i.success?R(i.output):N(new ze(r,i.issues))})),{...t,requires:"web_app_invoke_custom_method",returns:"task"})}const Rs=Wu(d(E(),_n,A)),Hu=m(Rs);function Nu({postEvent:e,...t}){return T(()=>e("web_app_hide_keyboard"),{...t,returns:"either",requires:"web_app_hide_keyboard"})}const Os=Nu(d(E(),z,A)),zu=m(Os);function Ku({request:e,createRequestId:t,...n}){return T(r=>{const i=t();return d(e("web_app_read_text_from_clipboard","clipboard_text_received",{...r,params:{req_id:i},capture:Gr(i)}),V(({data:s=null})=>s))},{...n,requires:"web_app_read_text_from_clipboard",returns:"task"})}const js=Ku({...d(E(),A,Y),createRequestId:dn}),Ju=m(js);function Ds(e){const t={},n=e.match(/Telegram-Android(?:\/([^ ]+))?(?: (\([^)]+\))?|$)/);if(n){const[,r,i]=n;r&&(t.appVersion=r),i&&i.slice(1,i.length-1).split(";").forEach(s=>{const[a,u]=s.trim().split(" ");if(a==="Android")t.androidVersion=u;else if(a==="SDK"){const l=parseInt(u,10);l&&(t.sdkVersion=l)}else u?(t.manufacturer=a,t.model=u):t.performanceClass=a})}return t}function Qu(){return Ds(navigator.userAgent)}function Zu({postEvent:e,...t}){return T(n=>{const{size:r}=new Blob([n]);return!r||r>4096?O(new ne(r?"Maximum size of data to send is 4096 bytes":"Attempted to send empty data")):e("web_app_data_send",{data:n})},{...t,returns:"either"})}const Us=Zu(d(E(),z)),Yu=m(Us);function Xu({request:e,...t}){return T((n,r)=>d(e("web_app_send_prepared_message",["prepared_message_failed","prepared_message_sent"],{...r,params:{id:n}}),he(i=>i&&"error"in i?N(new rs(i.error)):R(void 0))),{...t,requires:"web_app_send_prepared_message",returns:"task"})}const xs=Xu(d(E(),Y,A)),ec=m(xs);function tc({postEvent:e,...t}){return T((n,r={})=>e("web_app_share_to_story",{text:r.text,media_url:n,widget_link:r.widgetLink}),{...t,requires:"web_app_share_to_story",returns:"either"})}const Gs=tc(d(E(),z,A)),nc=m(Gs),Fn=Qe(!1);function rc({isInlineMode:e,postEvent:t,...n}){return T((r,i)=>t("web_app_switch_inline_query",{query:r,chat_types:i||[]}),{...n,requires:{every:["web_app_switch_inline_query",()=>Q(e)?void 0:"The application must be launched in the inline mode"]},returns:"either"})}const Ws=rc({...d(E(),z,A),isInlineMode:Fn}),sc=m(Ws);class Hs{constructor({storage:t,isPageReload:n,onContentSafeAreaInsetsChanged:r,onSafeAreaInsetsChanged:i,onViewportChanged:s,onFullscreenChanged:a,offContentSafeAreaInsetsChanged:u,offFullscreenChanged:l,offSafeAreaInsetsChanged:c,offViewportChanged:h,request:f,isViewportStable:b,isFullscreen:v,isTma:y,version:w,postEvent:g}){o(this,"state");o(this,"height");o(this,"stableHeight");o(this,"width");o(this,"isExpanded");o(this,"isStable",F(()=>this.height()===this.stableHeight()));o(this,"contentSafeAreaInsets");o(this,"contentSafeAreaInsetTop");o(this,"contentSafeAreaInsetLeft");o(this,"contentSafeAreaInsetRight");o(this,"contentSafeAreaInsetBottom");o(this,"safeAreaInsets");o(this,"safeAreaInsetTop");o(this,"safeAreaInsetLeft");o(this,"safeAreaInsetRight");o(this,"safeAreaInsetBottom");o(this,"isFullscreen");o(this,"requestFullscreenFp");o(this,"requestFullscreen");o(this,"exitFullscreenFp");o(this,"exitFullscreen");o(this,"isCssVarsBound");o(this,"bindCssVarsFp");o(this,"bindCssVars");o(this,"isMounted");o(this,"mountFp");o(this,"mount");o(this,"expandFp");o(this,"expand");const S={top:0,right:0,left:0,bottom:0},_=new be({initialState:{contentSafeAreaInsets:S,height:0,isExpanded:!1,isFullscreen:!1,safeAreaInsets:S,stableHeight:0,width:0},onChange:t.set}),D=q=>{_.setState({isExpanded:q.is_expanded,height:q.height,width:q.width,stableHeight:q.is_state_stable?q.height:void 0})},M=q=>{_.setState({isFullscreen:q.is_fullscreen})},U=q=>{_.setState({safeAreaInsets:q})},k=q=>{_.setState({contentSafeAreaInsets:q})},L=new ln({initialState(q){const $e=fe=>()=>{const[ve,re]=fe==="safe-area"?["web_app_request_safe_area","safe_area_changed"]:["web_app_request_content_safe_area","content_safe_area_changed"];return pe(ve,Q(w))?f(ve,re,q):R({top:0,left:0,right:0,bottom:0})},G=fe=>()=>typeof fe=="boolean"?R(fe):Yr(fe());return d(Qa,ct("safeAreaInsets",$e("safe-area")),ct("contentSafeAreaInsets",$e("content-safe-area")),ct("isFullscreen",G(v)),ct("isViewportStable",G(b)),Pe(({isViewportStable:fe,...ve})=>fe?R({...ve,height:window.innerHeight,isExpanded:!0,stableHeight:window.innerHeight,width:window.innerWidth}):d(f("web_app_request_viewport","viewport_changed",q),V(re=>({...ve,height:re.height,isExpanded:re.is_expanded,stableHeight:re.is_state_stable?re.height:0,width:re.width})))))},isPageReload:n,onMounted(q){s(D),a(M),i(U),r(k),_.setState(q)},onUnmounted(){h(D),l(M),c(U),u(k)},restoreState:t.get}),I=q=>F(()=>this.safeAreaInsets()[q]),x=q=>F(()=>this.contentSafeAreaInsets()[q]);this.state=_.state,this.height=_.getter("height"),this.stableHeight=_.getter("stableHeight"),this.width=_.getter("width"),this.isExpanded=_.getter("isExpanded"),this.safeAreaInsets=_.getter("safeAreaInsets"),this.safeAreaInsetTop=I("top"),this.safeAreaInsetBottom=I("bottom"),this.safeAreaInsetLeft=I("left"),this.safeAreaInsetRight=I("right"),this.contentSafeAreaInsets=_.getter("contentSafeAreaInsets"),this.contentSafeAreaInsetTop=x("top"),this.contentSafeAreaInsetBottom=x("bottom"),this.contentSafeAreaInsetLeft=x("left"),this.contentSafeAreaInsetRight=x("right");const Le=B({isTma:y,returns:"task"}),Ye=B({isTma:y,returns:"either"}),uc=B({isTma:y,requires:"web_app_request_fullscreen",version:w,returns:"task"}),zs=q=>uc($e=>d(f(q?"web_app_request_fullscreen":"web_app_exit_fullscreen",["fullscreen_changed","fullscreen_failed"],$e),he(G=>"error"in G&&G.error!=="ALREADY_FULLSCREEN"?N(new ns(G.error)):(_.setState({isFullscreen:"is_fullscreen"in G?G.is_fullscreen:!0}),R(void 0)))));this.isMounted=L.isMounted,this.mountFp=Le(L.mount),this.mount=m(this.mountFp),this.isFullscreen=_.getter("isFullscreen"),this.requestFullscreenFp=zs(!0),this.requestFullscreen=m(this.requestFullscreenFp),this.exitFullscreenFp=zs(!1),this.exitFullscreen=m(this.exitFullscreenFp);const ft=W(!1);this.isCssVarsBound=F(ft),this.bindCssVarsFp=Ye(q=>{if(ft())return O(new lt);q||(q=G=>`--tg-viewport-${jn(G)}`);const $e=[["height",this.height],["stableHeight",this.stableHeight],["width",this.width],["safeAreaInsetTop",this.safeAreaInsetTop],["safeAreaInsetBottom",this.safeAreaInsetBottom],["safeAreaInsetLeft",this.safeAreaInsetLeft],["safeAreaInsetRight",this.safeAreaInsetRight],["contentSafeAreaInsetTop",this.contentSafeAreaInsetTop],["contentSafeAreaInsetBottom",this.contentSafeAreaInsetBottom],["contentSafeAreaInsetLeft",this.contentSafeAreaInsetLeft],["contentSafeAreaInsetRight",this.contentSafeAreaInsetRight]].reduce((G,[fe,ve])=>{const re=q(fe);if(re){const Ks=()=>{gn(re,`${ve()}px`)};G.push({update:Ks,removeListener:ve.sub(Ks),cssVar:re})}return G},[]);return $e.forEach(G=>{G.update()}),ft.set(!0),P(()=>{$e.forEach(G=>{G.removeListener(),vn(G.cssVar)}),ft.set(!1)})}),this.bindCssVars=m(this.bindCssVarsFp),this.expandFp=Ye(()=>g("web_app_expand")),this.expand=m(this.expandFp)}}function ic(){const e=s=>({on:a=>{ee(s,a)},off:a=>{ke(s,a)}}),t=e("viewport_changed"),n=e("fullscreen_changed"),r=e("safe_area_changed"),i=e("content_safe_area_changed");return new Hs({...d(E(),ge("viewport"),A,z,Y),isFullscreen(){return d(Be(),Z(s=>!!s.tgWebAppFullscreen))},isViewportStable(){return d(Be(),Z(s=>["macos","tdesktop","unigram","webk","weba","web"].includes(s.tgWebAppPlatform)))},offContentSafeAreaInsetsChanged:i.off,offFullscreenChanged:n.off,offSafeAreaInsetsChanged:r.off,offViewportChanged:t.off,onContentSafeAreaInsetsChanged:i.on,onFullscreenChanged:n.on,onSafeAreaInsetsChanged:r.on,onViewportChanged:t.on})}const oc=ic();function Ns(e={}){const{version:t,isInlineMode:n,themeParams:r}=e;if(t&&typeof n=="boolean"&&r)un.set(t),Fn.set(n),bn.set(r);else{const u=d(Be(),An(l=>l,l=>{un.set(t||l.tgWebAppVersion),Fn.set(typeof n=="boolean"?n:!!l.tgWebAppBotInline),bn.set(r||l.tgWebAppThemeParams)}));if(u)return O(u)}e.postEvent&&os.set(e.postEvent);const[i,s]=st(ee("reload_iframe",()=>{le().log("Received a request to reload the page"),as("iframe_will_reload"),window.location.reload()})),{acceptCustomStyles:a=!0}=e;if(a){const u=document.createElement("style");u.id="telegram-custom-styles",document.head.appendChild(u),i(ee("set_custom_style",l=>{u.innerHTML=l}),()=>{document.head.removeChild(u)})}return d(Me("iframe_ready",{reload_supported:!0}),Z(()=>(le().log("The package was initialized"),s)))}const ac=X(Ns);return p.AccessDeniedError=sn,p.BackButton=is,p.Biometry=cs,p.CSSVarsBoundError=lt,p.CancelledError=Rn,p.ClosingBehavior=ls,p.CloudStorage=ps,p.ConcurrentCallError=pt,p.FullscreenFailedError=ns,p.FunctionUnavailableError=es,p.HapticFeedback=_s,p.InitData=gs,p.InvalidArgumentsError=ne,p.InvalidEnvError=Ya,p.InvalidLaunchParamsError=Br,p.Invoice=vs,p.InvokeCustomMethodFailedError=Pr,p.LaunchParamsRetrieveError=qr,p.LocationManager=Cs,p.MainButton=Fs,p.MethodParameterUnsupportedError=Ir,p.MethodUnsupportedError=Ar,p.MiniApp=$s,p.NotAvailableError=Xr,p.Popup=Is,p.QrScanner=Ts,p.SecondaryButton=Ps,p.SetEmojiStatusError=ts,p.SettingsButton=Ms,p.ShareMessageError=rs,p.SwipeBehavior=Ls,p.ThemeParams=Es,p.TimeoutError=Bt,p.UnknownEnvError=Tr,p.UnknownThemeParamsKeyError=ss,p.ValidationError=ze,p.Viewport=Hs,p.addToHomeScreen=fu,p.addToHomeScreenFp=ms,p.applyPolyfills=ha,p.backButton=nu,p.biometry=su,p.checkHomeScreenStatus=_u,p.checkHomeScreenStatusFp=bs,p.closingBehavior=iu,p.cloudStorage=ou,p.copyTextToClipboard=Uu,p.createLogger=xn,p.createPostEvent=la,p.createRequestId=dn,p.createStartParam=_a,p.createStartParamFp=Nr,p.debug=Ur,p.decodeBase64Url=fa,p.decodeBase64UrlFp=Qt,p.decodeStartParam=ma,p.decodeStartParamFp=zr,p.deepSnakeToCamelObjKeys=Tt,p.downloadFile=Gu,p.downloadFileFp=Vs,p.encodeBase64Url=Zt,p.getCurrentTime=Hu,p.getCurrentTimeFp=Rs,p.getReleaseVersion=Jt,p.hapticFeedback=pu,p.hideKeyboard=zu,p.hideKeyboardFp=Os,p.init=ac,p.initData=mu,p.initFp=Ns,p.invoice=bu,p.invokeCustomMethod=hs,p.isAnyRGB=ir,p.isColorDark=wn,p.isColorDarkFp=ks,p.isRGB=Ue,p.isRGBA=sr,p.isRGBAShort=rr,p.isRGBShort=nr,p.isSafeToCreateStartParam=ba,p.isTMA=aa,p.isTMAFp=Kt,p.locationManager=ku,p.logger=le,p.mainButton=Eu,p.miniApp=As,p.mockTelegramEnv=ua,p.off=ke,p.offAll=ta,p.on=ee,p.openLink=vu,p.openLinkFp=ws,p.openTelegramLink=yu,p.openTelegramLinkFp=mn,p.parseInitDataQuery=ho,p.parseInitDataQueryFp=pr,p.parseLaunchParamsQuery=hr,p.parseLaunchParamsQueryFp=at,p.popup=Au,p.postEvent=as,p.postEventFp=Me,p.qrScanner=Ru,p.readTextFromClipboard=Ju,p.readTextFromClipboardFp=js,p.request=ru,p.requestContact=Mu,p.requestContactComplete=Pu,p.requestContactCompleteFp=Cn,p.requestContactFp=qs,p.requestEmojiStatusAccess=uu,p.requestEmojiStatusAccessFp=fs,p.requestFp=hn,p.requestPhoneAccess=qu,p.requestPhoneAccessFp=yn,p.requestWriteAccess=Vu,p.requestWriteAccessFp=Bs,p.retrieveAndroidDeviceData=Qu,p.retrieveAndroidDeviceDataFrom=Ds,p.retrieveLaunchParams=Jo,p.retrieveLaunchParamsFp=Be,p.retrieveRawInitData=Qo,p.retrieveRawInitDataFp=xt,p.retrieveRawLaunchParams=Zo,p.retrieveRawLaunchParamsFp=We,p.secondaryButton=Ou,p.sendData=Yu,p.sendDataFp=Us,p.serializeInitDataQuery=dr,p.serializeLaunchParamsQuery=_r,p.setDebug=ra,p.setEmojiStatus=lu,p.setEmojiStatusFp=ds,p.setTargetOrigin=sa,p.settingsButton=ju,p.shareMessage=ec,p.shareMessageFp=xs,p.shareStory=nc,p.shareStoryFp=Gs,p.shareURL=Fu,p.shareURLFp=ys,p.supports=pe,p.swipeBehavior=Du,p.switchInlineQuery=sc,p.switchInlineQueryFp=Ws,p.targetOrigin=xr,p.themeParams=Ze,p.toRGB=oo,p.toRGBFp=ar,p.toRGBFull=ao,p.toRGBFullFp=ot,p.viewport=oc,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),p}({});
4
4
  //# sourceMappingURL=index.iife.js.map