1import{u as e,A as o}from"./B0yA2vfI.js";import{p as a,g as t,a as s}from"./3VrSCEgw.js";import{H as n,r,P as i,a6 as c,af as l,ad as d,p,a2 as u}from"./CF0HNS9x.js";import{a as w,p as h,b as m,c as f}from"./BfggIaMj.js";const g={class:"oauth-callback","aria-live":"polite"},y=f(n({__name:"callback",setup(n){const f=w(),y=h(),{getRequiredAuthHeaders:_}=e(),b=r("Finishing connection...");m({title:"Connection callback",meta:[{name:"robots",content:"noindex, nofollow"}]});const v=(e,o,a)=>{b.value=o,((e,o="",a)=>{window.opener&&window.opener.postMessage({source:"finevoice-gdrive-oauth",status:e,...o?{message:o}:{},...a?{access_token:a.access_token,expires_in:a.expires_in,scope:a.scope}:{}},window.location.origin)})(e,"error"===e?o:"",a),window.setTimeout(()=>{window.opener?window.close():y.replace({path:"/app/aunio",query:{connect:"gdrive",status:e}})},"success"===e?300:1200)};return i(async()=>{const e=a(f.query,window.location.hash),n=t(window.location.origin);if(window.history.replaceState(null,"",f.path),e.error)v("error",e.errorDescription||e.error);else if(e.code&&e.state)try{const a=await(async(e,a,t)=>$fetch(`${o}/api/gdrive/oauth/exchange`,{method:"POST",headers:{...await _(),"Content-Type":"application/json"},body:s(e,a,t)}))(e.code,e.state,n);if(!a.access_token)throw new Error("Authorization exchange did not return an access token.");v("success","Connection complete. This window will close automatically.",a)}catch(r){v("error",r instanceof Error?r.message:"Unable to complete the connection.")}else v("error","Authorization did not return a valid code and state.")}),(e,o)=>(u(),c("main",g,[l("p",null,d(p(b)),1)]))}}),[["__scopeId","data-v-9b96dac5"]]);export{y 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.