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