1import{P as b,r as a,e as x,j as e,i as j,G as p}from"./index-CfJxxrWq.js";import{C as v,a as w}from"./circle-check-big-C1HeWj4h.js";const m=({className:t="w-16 h-16"})=>e.jsxs("svg",{className:t,viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"onedrive-gradient",x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:[e.jsx("stop",{offset:"0%",style:{stopColor:"#0078D4",stopOpacity:1}}),e.jsx("stop",{offset:"100%",style:{stopColor:"#00BCF2",stopOpacity:1}})]})}),e.jsx("path",{fill:"url(#onedrive-gradient)",d:"M29.5 14c-5.2 0-9.6 3.2-11.4 7.7C16.3 21.3 14 23.2 12 25.8c-2.5 3.3-2.5 7.8 0 11.1 2 2.6 5.2 4.1 8.5 4.1h17c5.5 0 10-4.5 10-10 0-5.2-4-9.4-9-9.9-.2-3.9-3.4-7.1-7.5-7.1-.5 0-1 .1-1.5.2z"}),e.jsx("path",{fill:"#0078D4",opacity:"0.8",d:"M18.1 21.7c-2.3.5-4.3 1.8-5.8 3.6-2.5 3.3-2.5 7.8 0 11.1 2 2.6 5.2 4.1 8.5 4.1h16.7c-5.5 0-10-4.5-10-10 0-5.2 4-9.4 9-9.9-.2-3.9-3.4-7.1-7.5-7.1-4.1 0-7.5 2.8-8.4 6.5-.9-.2-1.8-.3-2.5-.3z"})]}),C=()=>{const[t]=b(),[c,r]=a.useState("processing"),[h,n]=a.useState(""),[l,u]=a.useState("");a.useEffect(()=>{document.title=`OneDrive - ${x}`;const s=document.createElement("meta");return s.name="robots",s.content="noindex",document.head.appendChild(s),()=>{document.head.removeChild(s)}},[]);const f=async()=>{try{const s=t.get("code"),o=t.get("state"),d=t.get("error"),g=t.get("error_description");if(d){r("error"),n(g||`OAuth error: ${d}`);return}if(!s){r("error"),n("Missing authorization code from OneDrive");return}if(!o){r("error"),n("Missing state parameter from OneDrive");return}const i=await j().OneDriveVerifyAndGetURL({code:s,state:o});i.Success&&i.URL?(r("success"),u(i.URL),n("OneDrive connected successfully!")):(r("error"),n(p(i.MsgCode)||"Failed to connect to OneDrive. Please try again."))}catch(s){r("error");const o=s instanceof Error?s.message:"An unexpected error occurred. Please try again.";n(o),console.error("OneDrive verification error:",s)}};return a.useEffect(()=>{f()},[t]),e.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center px-4",children:e.jsx("div",{className:"max-w-md w-full",children:e.jsxs("div",{className:"bg-white rounded-lg shadow-md p-8",children:[e.jsx("div",{className:"flex justify-center mb-6",children:e.jsx("img",{src:"/images/logo.png",alt:x,className:"w-16 h-16"})}),c==="processing"&&e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx(m,{})}),e.jsx("div",{className:"w-12 h-12 border-4 border-blue-600 border-t-transparent rounded-full animate-spin mx-auto mb-4"}),e.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-2",children:"Connecting to OneDrive"}),e.jsx("p",{className:"text-slate-600",children:"Please wait while we verify your authentication..."})]}),c==="success"&&e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx(m,{})}),e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx(v,{className:"w-16 h-16 text-green-600"})}),e.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-2",children:"Success!"}),e.jsx("p",{className:"text-slate-600 mb-4",children:"Your OneDrive has been connected successfully."}),l&&e.jsxs("div",{className:"mb-6 p-4 bg-slate-100 rounded-lg",children:[e.jsx("p",{className:"text-sm font-semibold text-slate-700 mb-2",children:"Drive URL:"}),e.jsx("div",{className:"text-sm text-slate-900 break-all font-mono bg-white p-3 rounded border border-slate-200",children:l}),e.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"inline-block mt-3 text-sm text-blue-600 hover:text-blue-700 underline",children:"Open in OneDrive"})]}),e.jsx("button",{onClick:()=>window.close(),className:"w-full px-6 py-3 bg-slate-600 text-white font-semibold rounded-lg hover:bg-slate-700 transition-colors",children:"Close window"})]}),c==="error"&&e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx(w,{className:"w-16 h-16 text-red-600"})}),e.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-2",children:"Connection Failed"}),e.jsx("p",{className:"text-slate-600 mb-6",children:h||"There was a problem connecting to OneDrive. Please try again."}),e.jsx("button",{onClick:()=>window.close(),className:"w-full px-6 py-3 bg-slate-600 text-white font-semibold rounded-lg hover:bg-slate-700 transition-colors",children:"Close window"})]})]})})})};export{C 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.