1import{r as i,j as e}from"./jsx-runtime-C2UBfbyc.js";import{u as M,T as P,V as _,A as N,a as w,C as O,H as L}from"./HostedSignInButtons-BY3xXxUD.js";import{l as $,z as W,A as B,B as Y}from"./index-CHoi3jgE.js";import{d as D,i as q,c as G,e as V,f as y}from"./resume-DQ2pc8eQ.js";import{d as z,a as f,i as S,e as J}from"./auth-BYwTrny6.js";import{H as K}from"./amplify_outputs-ByhBuvRU.js";import"./API-DAFHaofH.js";import"./index-qtUc8lsi.js";import"./index-DgoachrA.js";const b=typeof window<"u",x="/login";G({redirectPath:x});K.listen("auth",({payload:t})=>{b&&((t.event==="signedIn"||t.event==="signedOut")&&V(x),(t.event==="signedIn"||t.event==="signInWithRedirect"||t.event==="signedOut")&&y(),t.event==="signInWithRedirect_failure"&&(y(),console.error("Auth failure:",t.data)))});const Q=()=>b&&q(),X=1200;function Z({user:t,children:d,isResolvingSession:g,setIsResolvingSession:c,loginSyncInFlightRef:o,sendIdforDetails:m}){const r=i.useRef(null);return i.useEffect(()=>()=>{r.current!==null&&window.clearTimeout(r.current)},[]),i.useEffect(()=>{if(r.current!==null&&(window.clearTimeout(r.current),r.current=null),!t)return r.current=window.setTimeout(()=>{o.current=null,f.set(null),S.set(!1),c(!1)},X),()=>{r.current!==null&&(window.clearTimeout(r.current),r.current=null)};const n=t.userId||t.username;if(!n)return;if(D(),f.set({username:t.username||n,email:t.signInDetails?.loginId,name:t.username||n}),J.set(!1),S.set(!0),o.current===n){c(!1);return}o.current=n,c(!0);let a=!1;return m(n).then(u=>{!u||a||f.set({username:u.name||t.username||n,email:t.signInDetails?.loginId||u.email,name:u.name,contact:u.phone_number})}).finally(()=>{!a&&o.current===n&&c(!1)}),()=>{a=!0}},[o,m,c,t]),t&&g?e.jsxs("div",{className:"auth-transition-loader","aria-live":"polite","aria-busy":"true",children:[e.jsx("div",{className:"auth-transition-spinner"}),e.jsx("div",{className:"auth-transition-text",children:"Signing you in..."}),e.jsx("div",{className:"auth-transition-subtext",children:"Preparing your workspace"})]}):e.jsx("div",{className:"authenticated-app",children:t?d:null})}function ce({children:t,initialState:d="signIn"}){const[g,c]=i.useState(!1),[o,m]=i.useState(d),r=i.useRef(null),n=i.useCallback(async s=>{try{const p=await z(s);if(p==="User not found")return null;try{return JSON.parse(p)}catch(j){return console.error("Error parsing user details:",j),null}}catch(p){return console.error("Error fetching user details:",p),null}},[]),{tokens:a}=M(),u={name:"Auth Theme",tokens:{components:{authenticator:{router:{boxShadow:`0 0 16px ${a.colors.overlay[10]}`,borderWidth:"0",margin:"0 auto",maxWidth:"500px"},form:{padding:`${a.space.medium} ${a.space.xl} ${a.space.medium}`}},button:{primary:{backgroundColor:a.colors.neutral[100]},link:{color:a.colors.purple[80]}},fieldcontrol:{_focus:{boxShadow:`0 0 0 2px ${a.colors.purple[60]}`}},tabs:{item:{color:a.colors.neutral[80],_active:{borderColor:a.colors.neutral[100],color:a.colors.purple[100]}}}}}},l=o==="signUp"||o==="confirmSignUp",C=l?"/startup.webp":"/agency-ai.webp",A=l?"People setting up an AI app workspace with CloudMySite":"Team building AI apps with CloudMySite",k=l?"Create Your Workspace":"AI App Builder",I=l?"Start building with AI from day one.":"Turn ideas into intelligent apps faster.",E=l?"Create your CloudMySite account and bring your first AI-powered app workspace online in minutes.":"Sign in to build, manage, and launch AI-powered applications from one CloudMySite workspace.",T=l?["Guided setup","AI-ready tools","Workspace included"]:["Prompt to app","Secure workspace","Launch ready"],h={Header(){const{route:s}=w();return i.useEffect(()=>{m(s)},[s]),e.jsxs("div",{className:"auth-form-header",children:[e.jsx("h2",{className:"auth-title",children:e.jsx("span",{className:"auth-title-text",children:s==="signUp"?"Create Your Account":"Sign in to get started"})}),e.jsx("p",{className:"auth-subtitle",children:s==="signUp"?"Join us today and unlock premium features":"Access your account to continue"})]})},SignIn:{Header(){return e.jsx(L,{ssoScope:x,autoRedirect:"interactive"})}},Footer(){return e.jsx("div",{className:"auth-form-footer",children:e.jsxs("span",{className:"auth-security",children:[e.jsx(Y,{className:"auth-icon auth-icon-small"}),"Your data is encrypted and protected with enterprise-level security."]})})},SignUp:{FormFields(){const{validationErrors:s}=w();return e.jsxs(e.Fragment,{children:[e.jsx(N.SignUp.FormFields,{}),e.jsx(O,{errorMessage:s.acknowledgement,hasError:!!s.acknowledgement,name:"acknowledgement",value:"yes",label:e.jsxs(e.Fragment,{children:["I agree to the",e.jsxs("a",{href:"https://cloudmysite.com/terms-condition",className:"terms-link",children:[" ","Terms and Conditions"]})]})})]})}}},R={Header:h.Header,Footer:h.Footer,SignUp:h.SignUp},v=Q(),U=v?h:R,[F,H]=i.useState(!1);return i.useEffect(()=>{const s=window.setTimeout(()=>H(!0),1e3);return()=>window.clearTimeout(s)},[]),e.jsx("div",{className:"auth-shell",children:e.jsx(P,{theme:u,children:e.jsxs("div",{className:"auth-container",children:[e.jsx("header",{className:"auth-page-header",children:e.jsx("div",{className:"auth-branding",children:e.jsx("img",{src:"/headerlogo.png",alt:"CloudMySite logo",className:"auth-logo-image"})})}),e.jsx("main",{className:"auth-main-content",children:e.jsxs("div",{className:"auth-login-layout",children:[e.jsxs("section",{className:"auth-visual-panel","aria-label":"CloudMySite AI a
1pp builder",children:[F?e.jsx("img",{src:C,alt:A,className:`auth-visual-image ${l?"auth-visual-image-signup":"auth-visual-image-signin"}`,width:900,height:650,decoding:"async",loading:"lazy",fetchPriority:"low"}):e.jsx("div",{className:`auth-visual-image auth-visual-image-placeholder ${l?"auth-visual-image-signup":"auth-visual-image-signin"}`,"aria-hidden":"true"}),e.jsx("div",{className:"auth-visual-shade"}),e.jsxs("div",{className:"auth-visual-content",children:[e.jsx("p",{className:"auth-visual-kicker",children:k}),e.jsx("h1",{className:"auth-visual-title",children:I}),e.jsx("p",{className:"auth-visual-copy",children:E}),e.jsx("div",{className:"auth-visual-highlights","aria-label":"CloudMySite capabilities",children:T.map(s=>e.jsx("span",{children:s},s))})]})]}),e.jsx("section",{className:"auth-form-panel","aria-label":"CloudMySite account access",children:e.jsx(_,{className:`auth-amplify-view${v?" auth-hosted-signin-view":""}`,children:e.jsx(N,{initialState:d,formFields:{signUp:{name:{label:"Full Name",placeholder:"Enter your Name",isRequired:!0,order:1},phone_number:{label:"Phone Number",placeholder:"Enter your phone Number",isRequired:!0,order:2},preferred_username:{label:"Preferred Username",placeholder:"Enter your preferred Username",isRequired:!0,order:3}}},components:U,services:{async validateCustomSignUp(s){if(!s.acknowledgement)return{acknowledgement:"You must agree to the Terms and Conditions"}}},children:({user:s})=>e.jsx(Z,{user:s,isResolvingSession:g,setIsResolvingSession:c,loginSyncInFlightRef:r,sendIdforDetails:n,children:t})})})})]})}),e.jsxs("footer",{className:"auth-page-footer",children:[e.jsxs("div",{className:"footer-content",children:[e.jsxs("h6",{className:"footer-highlight",children:[e.jsx($,{className:"footer-icon"})," Power up your experience with ",e.jsx("strong",{children:"CloudMySite"}),"!"]}),e.jsxs("div",{className:"footer-links",children:[e.jsxs("a",{href:"/contact",className:"footer-link",children:[e.jsx(W,{className:"footer-icon"})," Support Center"]}),e.jsx("span",{className:"footer-divider",children:"|"}),e.jsxs("a",{href:"https://cloudmysite.com/terms-condition",className:"footer-link",children:[e.jsx(B,{className:"footer-icon"})," Terms & Privacy"]})]})]}),e.jsxs("div",{className:"footer-copyright",children:["(c) ",new Date().getFullYear()," CloudMySite. All rights reserved."]})]})]})})})}export{ce as AuthWrapper};
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.