1var N=Object.defineProperty;var R=(t,e,s)=>e in t?N(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var l=(t,e,s)=>R(t,typeof e!="symbol"?e+"":e,s);import{pG as C,pH as O,hR as h,pI as I,pJ as _,pK as f,pL as u,pM as P,aA as T,ci as g,pN as S,pO as A,pP as E,pQ as b,pR as m,pS as v,pT as k}from"./commonChunk.BS0jzoOr.js";import{t as x,c as L,n as y,s as M,a as G}from"./login.ByY5KC-S.js";import{o as w,s as D,c as q}from"./dialog.CzNH-oPL.js";import{H as F}from"../vendors/vendor-stable.Bob7ohop.js";import"./vendorChunk.LVLHXJtX.js";import"./0_EntryLoginRegisterChunk.CK55L-p4.js";class B{constructor(e,s){l(this,"message");l(this,"code");this.message=e,this.code=s}}const se=O(),oe=h(),re=I(),{OAUTH_START_PARAM_KEY:H,START_PARAM_KEY:K,OAUTH_TYPE:Q,REFERENCE:U}=P,p=(t,e)=>{try{m()?window.TelegramWebviewProxy.postEvent(t,JSON.stringify(e||{})):window.self!==window.top&&window.parent.postMessage(JSON.stringify({eventType:t,eventData:e}),"https://web.telegram.org")}catch(s){}},W=()=>{if(!E())return b();localStorage.clear(),sessionStorage.clear(),location.href=location.origin,m()&&window.close()},Y=async t=>{var s;const e=_.loginProcess.key;try{const o=f();if(u(e,{execute:!0}),!o.token)throw new Error("Token Is Not Found");const{success:n,message:a,code:r}=await x({requester_type:o.oauthType===Q.OPEN_HASH?T.TG_MICRO_APPLICATION_OPEN:T.TG_MICRO_APPLICATION,access_token:o.token,...t});if(!n)throw new B(a,r);if(u(e,{status:!0}),(s=o.modal)!=null&&s.name){const{modal:{name:i,options:c}}=o;w(i,c)}return!0}catch(o){const{message:n="Application Error",code:a="Unknown Code"}=o||{};switch(a){case g.TG_MICRO_APPLICATION_NEED_CURRENCY_FIRST:{const r=n.split(",");return new Promise(i=>{w("switchCurrency",{options:{toRoot:!1,showCloseButton:!1,closeOnRouteChange:!1,checkedIcon:!1,onSelect(c){i(Y({...t,currency:c.currencyCode}))},modifyCurrencyList(c){return c.filter(d=>r.includes(d.currencyCode))}}})})}case g.TGMA_LOGIN_NEED_REGISTER_OR_BIND_FIRST:default:{const r=[g.TGMA_LOGIN_NEED_REGISTER_OR_BIND_FIRST].includes(a),i=r?n:`${n},${a}`;D({error:i,onConfirm:()=>W(),isSomeErrorText:!r})}}return u(e,{status:null}),!1}},ne=()=>{var n,a;const t=_.navigationProcess.key,e=f(),s=(n=e.route)==null?void 0:n.name,o=(a=e.route)==null?void 0:a.query;!s||S(t).execute||(u(t,{execute:!0}),A(_.loginProcess.key,(r,i)=>{if(r.status){const c=L(s,o);c.navigate?c.navigate():y({name:s})}else r.status===null&&i()}))},J=()=>{if(!E()){try{p("web_app_expand"),p("web_app_request_safe_area"),p("web_app_request_content_safe_area"),p("web_app_setup_closing_behavior",{need_confirmation:!0}),p("web_app_setup_swipe_behavior",{allow_vertical_swipe:!1}),M()}catch(e){}G(({href:e})=>{p("web_app_open_link",{url:e})})}const t=q().forbidAutoDialog();A(_.loginProcess.key,(e,s)=>{e.status!==!1&&s(),e.status===!0&&(t==null||t())})},V=()=>{const t=v(),e={...F(t,K,H),[U]:k.APP_NAME};setTimeout(()=>{y({query:e,replace:!0})})},ae=async()=>{V(),J()},ce=C;export{se as client,W as exit,ae as init,Y as loginProcess,ne as navigationProcess,ce as openExternalLink,oe as webApp,re as webView};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.