!function(){var n={},e="";try{e=location.hash.toString()}catch(e){}var t=c(e),r=b("initParams");if(r)for(var o in r)void 0===t[o]&&(t[o]=r[o]);d("initParams",t);var i,a=!1;try{if(a=null!=window.parent&&window!=window.parent){window.addEventListener("message",function(e){if(e.source===window.parent){try{var t=JSON.parse(e.data)}catch(e){return}if(t&&t.eventType)if("set_custom_style"==t.eventType)"https://web.telegram.org"===e.origin&&(i.innerHTML=t.eventData);else if("reload_iframe"==t.eventType){try{window.parent.postMessage(JSON.stringify({eventType:"iframe_will_reload"}),"*")}catch(e){}location.reload()}else p(t.eventType,t.eventData)}}),i=document.createElement("style"),document.head.appendChild(i);try{window.parent.postMessage(JSON.stringify({eventType:"iframe_ready",eventData:{reload_supported:!0}}),"*")}catch(e){}}}catch(e){}function s(t){try{return t=t.replace(/\+/g,"%20"),decodeURIComponent(t)}catch(e){return t}}function c(e){var t={};if(!(e=e.replace(/^#/,"")).length)return t;if(e.indexOf("=")<0&&e.indexOf("?")<0)return t._path=s(e),t;var r,o=e.indexOf("?");0<=o&&(r=e.substr(0,o),t._path=s(r),e=e.substr(o+1));var n,i=l(e);for(n in i)t[n]=i[n];return t}function l(e){var t={};if(!e.length)return t;for(var r,o,n=e.split("&"),i=0;i postEvent",e,r),void 0!==window.TelegramWebviewProxy)TelegramWebviewProxy.postEvent(e,JSON.stringify(r)),t();else if(window.external&&"notify"in window.external)window.external.notify(JSON.stringify({eventType:e,eventData:r})),t();else if(a)try{window.parent.postMessage(JSON.stringify({eventType:e,eventData:r}),"*"),t()}catch(e){t(e)}else t({notAvailable:!0})},receiveEvent:p,callEventCallbacks:u},window.Telegram.Utils={urlSafeDecode:s,urlParseQueryString:l,urlParseHashParams:c,urlAppendHashParams:function(e,t){var r=e.indexOf("#");return r<0?e+"#"+t:0<=(r=e.substr(r+1)).indexOf("=")||0<=r.indexOf("?")?e+"&"+t:0')+"')":"none",h.style.backgroundColor=t.color,h.style.color=t.text_color):h.style.display="none",ve()))}return v.setText=function(e){return v.setParams({text:e})},v.onClick=function(e){return O(o,e),v},v.offClick=function(e){return I(o,e),v},v.show=function(){return v.setParams({is_visible:!0})},v.hide=function(){return v.setParams({is_visible:!1})},v.enable=function(){return v.setParams({is_active:!0})},v.disable=function(){return v.setParams({is_active:!1})},v.showProgress=function(e){return l=!!e,u=!0,W(),v},v.hideProgress=function(){return v.isActive||(l=!0),u=!1,W(),v},v.setParams=function(e){if(void 0!==e.text){var t=S(e.text);if(!t.length)throw console.error("[Telegram.WebApp] Bottom button text is required",e.text),Error("WebAppBottomButtonParamInvalid");if(64