(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,92743,e=>{"use strict";var t=e.i(43476),o=e.i(71645);let i="patchtrail-forge-oauth";e.s(["ForgeOAuthCallbackClient",0,function(){let[e,n]=(0,o.useState)({phase:"relaying"});return(0,o.useEffect)(()=>{let e=window.setTimeout(()=>{let e=new URLSearchParams(window.location.search),t=e.get("error"),o=e.get("code"),r=e.get("state"),s=window.opener;if(!s||s.closed)return void n({phase:"error",message:"This window was not opened by PatchTrail. Close it and start the GitHub connection again from Settings."});let a=window.location.origin;if(t){s.postMessage({type:i,error:String(t).slice(0,200)},a),n({phase:"done"}),window.close();return}if(!o||!r){s.postMessage({type:i,error:"missing_code_or_state"},a),n({phase:"error",message:"GitHub did not return an authorization code."}),window.close();return}s.postMessage({type:i,code:o,state:r},a),n({phase:"done"}),window.close()},0);return()=>window.clearTimeout(e)},[]),(0,t.jsx)("main",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",padding:"2rem",fontFamily:"system-ui, sans-serif",textAlign:"center"},children:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{style:{fontWeight:600},children:"error"===e.phase?"GitHub connection could not complete":"Finishing GitHub connection…"}),(0,t.jsx)("p",{style:{marginTop:"0.5rem",color:"#666"},children:"error"===e.phase?e.message:"You can close this window and return to PatchTrail."})]})})}])}]);