1import{s as v,o as g,F as y,v as d,r as h,d as A,p as k,l as m,e as l,h as s,i as u,A as S,g as i,f as w,k as p,t as C,j as T,m as $}from"./CFxGRstO.js";import{_ as B}from"./6HuN2jx9.js";import{_ as E}from"./DnMM_Yjt.js";import{_ as I}from"./CR0-Au_c.js";import"./DlAUqK2U.js";function N(_){const n=v(),o=h(null),a=h(!1),e=n.authSessionId;function c(){let t=_;if(!t&&o.value&&(t=o.value),!t)throw new Error("No application protocol specified");window.location.href=`${t}://auth?sessionId=${e}`}return g(async()=>{if(e)try{const{client:t}=await $fetch("/api/auth/session/authorize",{method:"POST",body:{authSessionId:e}}),r=t.match(/^(.+)-(\d+\.\d+\.\d+(?:[-+][\w.]+)?)$/);r&&(o.value=r[1]),n.authSessionId=null,c()}catch(t){t instanceof y&&t.statusCode===401?(await n.signOut(),d(`/user/sign-in?provider=google&authSessionId=${e}`)):a.value=!0}else d("/account")}),{showErrorMessage:a,authClient:o,openApplication:c}}const z={class:"container tw-py-12 tw-my-6"},F={class:"xl:tw-w-9/12 tw-mx-auto tw-text-center"},V={class:"tw-text-display-5 !tw-leading-none !tw-font-bold !tw-text-yellow tw-mb-6"},D={key:0},M={key:1,class:"tw-text-center tw-text-fs-5 tw-mb-6"},W={class:"tw-mb-4"},L={class:"tw-mb-4"},q=A({__name:"authorize-app",setup(_){const{showErrorMessage:n,openApplication:o,authClient:a}=N(),e=$(()=>a.value==="rewasdbasic"?"reWASD Basic":"reWASD");return(c,t)=>{const r=S,f=B,x=E,b=I;return l(),k(b,null,{default:m(()=>[s("div",z,[s("div",null,[s("div",F,[s("h1",V,[u(r,{text:"Authorize application"})]),i(n)?(l(),w("div",D,[t[1]||(t[1]=p(" There is an error while authorizing the application. Please ",-1)),u(f,{to:"/help",class:"hover:!tw-text-[#FFECAA] !tw-text-yellow"},{default:m(()=>[...t[0]||(t[0]=[p(" contact support ",-1)])]),_:1}),t[2]||(t[2]=p(" for assistance. ",-1))])):i(a)?(l(),w("div",M,[s("p",W,C(i(e))+" should launch in a few seconds. If not, please click button below. ",1),s("p",L,[u(x,{class:"btn btn-md btn-primary",type:"submit",label:`Launch ${i(e)}`,onClick:i(o)},null,8,["label","onClick"])])])):T("",!0)])])])]),_:1})}}});
1export{q as default};
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.