PageSourceSearch

https://visket.ai/assets/SignUp-D7u8TTep.js

js visket.ai collected 2026-10-05 14:31:23 UTC 14,855 bytes, 1 lines download raw bytes

1import{u as W,r as i,t as c,j as e,H as G,L as K,F as Q,B as X,ah as w}from"./index-ClKgTShe.js";import{l as Z}from"./27f105bf26d2bf22b5dd155ea62421d92b36e466-DIApt23T.js";import{D as ee,c as se,d as re,e as ae,f as te}from"./dialog-jeoZkzpR.js";import"./x-D5BHmcmx.js";const H={ko:{google:"Google",kakao:"카카오",naver:"네이버"},default:{google:"Google",kakao:"Kakao",naver:"Naver"}},ne=s=>s==="google"||s==="kakao"||s==="naver",V=(s,d)=>(d.split("-")[0].toLowerCase()==="ko"?H.ko:H.default)[s];function ue(){const{t:s,i18n:d}=W(),[r,v]=i.useState({email:"",password:"",passwordConfirm:"",name:"",phone:""}),[t,P]=i.useState({all:!1,terms:!1,privacy:!1,marketing:!1}),N=i.useRef(null),M=i.useRef(null),_=i.useRef(null),F=i.useRef(null),I=i.useRef(null),O=i.useRef(null),q=i.useRef(null),[T,D]=i.useState(!1),[k,C]=i.useState(null),[Y,U]=i.useState(null),[E,A]=i.useState(!1),l=Y!==null;i.useEffect(()=>{if(l){C(null);return}r.passwordConfirm===""?C(null):C(r.password===r.passwordConfirm)},[r.password,r.passwordConfirm,l]),i.useEffect(()=>{const a=new URLSearchParams(window.location.search),n=a.get("oauth_error"),o=a.get("provider");if(n){n==="config"&&ne(o)?c.info(s("auth.ready_msg",{provider:V(o,d.resolvedLanguage||d.language||"ko")})):c.error(s("auth.oauth_error")),window.history.replaceState({},"","/signup");return}if(a.get("social")!=="pending")return;let u=!0;return(async()=>{try{const h=await fetch(w("oauth.php?action=pending"),{credentials:"include"}),g=await h.json();if(!u)return;if(h.ok&&g.ok&&g.pending){const b=g.pending;U(b),v(j=>({...j,email:b.email,name:"",password:"",passwordConfirm:""}));return}c.error(s("auth.social_signup_expired")),window.history.replaceState({},"","/signup")}catch{u&&c.error(s("auth.server_error"))}})(),()=>{u=!1}},[s,d.language,d.resolvedLanguage]);const x=a=>{a.target.setCustomValidity("");const{name:n,value:o}=a.target;v(u=>({...u,[n]:o}))},f=a=>{a.target.setCustomValidity(s("auth.field_required"))},y=a=>{if(a==="all"){const n=!t.all;P({all:n,terms:n,privacy:n,marketing:n})}else P(n=>{const o={...n,[a]:!n[a]};return o.all=o.terms&&o.privacy&&o.marketing,o})},B=a=>{window.open(`/${a}`,"_blank","noopener,noreferrer")},J=async a=>{var n,o,u,L,h,g,b,j,$,z;if(a.preventDefault(),!r.email){(n=N.current)==null||n.focus();return}if(!l&&!r.password){(o=M.current)==null||o.focus();return}if(!l&&!r.passwordConfirm){(u=_.current)==null||u.focus();return}if(!r.name){(L=F.current)==null||L.focus();return}if(!r.phone){(h=I.current)==null||h.focus();return}if(!t.terms){c.error(s("auth.required_policy_msg")),(g=O.current)==null||g.focus();return}if(!t.privacy){c.error(s("auth.required_policy_msg")),(b=q.current)==null||b.focus();return}if(!l&&r.password!==r.passwordConfirm){c.error(s("auth.password_mismatch")),(j=_.current)==null||j.focus();return}if(l){A(!0);try{const m=await fetch(w("oauth.php?action=complete_signup"),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({name:r.name.trim(),phone:r.phone,agree_terms:t.terms?"Y":"N",agree_privacy:t.privacy?"Y":"N",agree_marketing:t.marketing?"Y":"N"})}),p=await m.json();m.ok&&p.ok&&p.user?(localStorage.setItem("user",JSON.stringify(p.user)),c.success(s("auth.signup_success")),setTimeout(()=>{window.location.href="/"},500)):c.error(s("auth.social_signup_failed"))}catch{c.error(s("auth.server_error"))}finally{A(!1)}return}try{const m=await fetch("/api/member.php?action=signup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r.email,password:r.password,name:r.name,phone:r.phone,agree_terms:t.terms?"Y":"N",agree_privacy:t.privacy?"Y":"N",agree_marketing:t.marketing?"Y":"N"})}),p=await m.json();if(m.ok)D(!0);else{let R=s("auth.signup_failed");p.error&&(p.error.includes("이미 사용")||p.error.includes("존재하는")?R=s("auth.already_account")||s("auth.signup_failed"):R=s("auth.signup_failed")),c.error(R),($=p.error)!=null&&$.includes("이메일")&&((z=N.current)==null||z.focus())}}catch(m){console.error("Sign up error:",m),c.error(s("auth.server_error"))}},S=async a=>{const n=V(a,d.resolvedLanguage||d.language||"ko");try{const o=await fetch(w(`oauth.php?action=status&provider=${a}`),{headers:{Accept:"application/json"},credentials:"include"}),u=await o.json().catch(()=>null);if(!o.ok||!(u!=null&&u.ok)){c.info(s("auth.ready_msg",{provider:n}));return}}catch{c.info(s("auth.ready_msg",{provider:n}));return}window.location.href=w(`oauth.php?action=start&provider=${a}`)};return e.jsxs("div",{className:"min-h-screen flex flex-col bg-gray-50",children:[e.jsx(G,{}),e.jsx("main",{className:"flex-1 flex items-center justify-center px-6 py-12",children:e.jsx("div",{className:"w-full max-w-md",children:e.jsxs("div",{className:"bg-white rounded-2xl shadow-lg p-8",children:[e.jsx("div",{className:"flex justify-center mb-8",children:e.jsx("img",{src:Z,alt:"Visket",className:"h-[57.6px]"})}),e.jsx("h1",{className:"text-2xl font-bold text-center mb-2",children:s(l?"auth.social_signup_t
1itle":"auth.signup")}),e.jsx("p",{className:"text-gray-600 text-center mb-8",children:s(l?"auth.social_signup_desc":"auth.welcome_start")}),!l&&e.jsxs("div",{className:"space-y-3 mb-6",children:[e.jsxs("button",{onClick:()=>S("google"),className:"w-full flex items-center justify-center gap-3 bg-white border-2 border-gray-300 rounded-lg px-4 py-3 hover:bg-gray-50 transition-colors",children:[e.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",children:[e.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),e.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),e.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),e.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),e.jsx("span",{className:"font-medium text-gray-700",children:s("auth.continue_google")})]}),e.jsxs("button",{onClick:()=>S("kakao"),className:"w-full flex items-center justify-center gap-3 rounded-lg px-4 py-3 transition-colors",style:{backgroundColor:"#FEE500"},children:[e.jsx("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",children:e.jsx("path",{fill:"#000000",d:"M12 3C6.486 3 2 6.262 2 10.315c0 2.596 1.687 4.882 4.251 6.212-.18.66-.582 2.137-.663 2.473-.097.4.146.395.307.287.128-.087 2.095-1.415 2.914-1.968.576.078 1.166.119 1.766.119 5.514 0 9.925-3.262 9.925-7.315C21.5 6.262 17.014 3 11.5 3z"})}),e.jsx("span",{className:"font-medium text-gray-900",children:s("auth.continue_kakao")})]}),e.jsxs("button",{onClick:()=>S("naver"),className:"w-full flex items-center justify-center gap-3 rounded-lg px-4 py-3 transition-colors",style:{backgroundColor:"#03C75A"},children:[e.jsx("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"white",children:e.jsx("path",{d:"M16.273 12.845L7.376 0H0v24h7.726V11.156L16.624 24H24V0h-7.727z"})}),e.jsx("span",{className:"font-medium text-white",children:s("auth.continue_naver")})]})]}),!l&&e.jsxs("div",{className:"relative my-6",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-gray-300"})}),e.jsx("div",{className:"relative flex justify-center text-sm",children:e.jsx("span",{className:"px-4 bg-white text-gray-500",children:s("auth.or")})})]}),e.jsxs("form",{onSubmit:J,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-1",children:[s("support.form_label_email")," ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{ref:N,type:"email",id:"email",name:"email",value:r.email,onChange:x,onInvalid:f,readOnly:l,className:`w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none scroll-mt-[160px] ${l?"bg-gray-100 text-gray-600":""}`,placeholder:s("about.placeholder_email"),required:!0})]}),!l&&e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 mb-1",children:[s("auth.password_label")," ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{ref:M,type:"password",id:"password",name:"password",value:r.password,onChange:x,onInvalid:f,className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none scroll-mt-[160px]",placeholder:s("auth.password_placeholder"),required:!0,minLength:8}),e.jsx("p",{className:"mt-1 text-xs text-gray-500",children:s("auth.password_desc")})]}),!l&&e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"passwordConfirm",className:"block text-sm font-medium text-gray-700 mb-1",children:[s("auth.password_confirm")," ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{ref:_,type:"password",id:"passwordConfirm",name:"passwordConfirm",value:r.passwordConfirm,onChange:x,onInvalid:f,className:`w-full px-4 py-3 border rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none scroll-mt-[160px] ${k===!1?"border-red-500":"border-gray-300"}`,placeholder:s("auth.password_confirm_placeholder"),required:!0}),k===!1&&e.jsx("p",{className:"mt-1 text-xs text-red-500 font-medium",children:s("auth.password_mismatch")}),k===!0&&e.jsx("p",{className:"mt-1 text-xs text-green-600 font-medium",children:s("auth.password_match")})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-1",children:[s("support.form_label_requester")," ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{ref:F,type:"text",id:"name",name:"name",value:r.name,onChange:x,onInvalid:f,className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none scroll-mt-[160px]",placeholder:s("auth.name_placeholder"),required:!0})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"phone",className:"block text-sm font-medium text-gray-700 mb-1",children:[s("support.form_label_phone")," ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{ref:I,type:"tel",id:"phone",name:"phone",value:r.phone,onChange:x,onInvalid:f,className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none scroll-mt-[160px]",placeholder:s("auth.phone_placeholder"),required:!0})]}),e.jsxs("div",{className:"border-t border-gray-200 pt-4 space-y-3 scroll-mt-[160px]",children:[e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer group",children:[e.jsx("input",{type:"checkbox",checked:t.all,onChange:()=>y("all"),className:"w-5 h-5 text-blue-600 border-gray-300 rounded focus:ring-blue-500 cursor-pointer"}),e.jsx("span",{className:"font-semibold text-gray-900 group-hover:text-blue-600 transition-colors",children:s("auth.agree_all")})]}),e.jsxs("div",{className:"pl-8 space-y-2 text-sm text-gray-600",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer hover:text-gray-900 group",children:[e.jsx("input",{ref:O,type:"checkbox",checked:t.terms,onChange:()=>y("terms"),className:`w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 ${!t.terms&&"border-red-300"}`}),e.jsxs("span",{className:`${!t.terms&&"text-gray-900 font-medium"}`,children:[s("auth.agree_terms")," ",e.jsx("span",{className:"text-red-500",children:"*"})]})]}),e.jsx("button",{type:"button",onClick:()=>B("terms"),className:"text-blue-600 hover:underline text-xs font-medium focus:outline-none",children:s("auth.view_policy")})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer hover:text-gray-900 group",children:[e.jsx("input",{ref:q,type:"checkbox",checked:t.privacy,onChange:()=>y("privacy"),className:`w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 ${!t.privacy&&"border-red-300"}`}),e.jsxs("span",{className:`${!t.privacy&&"text-gray-900 font-medium"}`,children:[s("auth.agree_privacy")," ",e.jsx("span",{className:"text-red-500",children:"*"})]})]}),e.jsx("button",{type:"button",onClick:()=>B("privacy"),className:"text-blue-600 hover:underline text-xs font-medium focus:outline-none",children:s("auth.view_policy")})]}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer hover:text-gray-900",children:[e.jsx("input",{type:"checkbox",checked:t.marketing,onChange:()=>y("marketing"),className:"w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),e.jsx("span",{children:s("auth.agree_marketing")})]})]}),!t.terms||!t.privacy?e.jsx("p",{className:"pl-8 text-[11px] text-red-500 font-medium",children:s("auth.required_policy_msg")}):null]}),e.jsx("button",{type:"submit",disabled:E,className:"w-full bg-blue-600 text-white rounded-lg px-4 py-4 font-bold hover:bg-blue-700 transition-all active:scale-[0.98] mt-4 shadow-md disabled:cursor-not-allowed disabled:opacity-60",children:s(l?E?"auth.social_signup_submitting":"auth.social_signup_complete":"auth.signup")})]}),!l&&e.jsxs("div",{className:"mt-6 text-center text-sm",children:[e.jsxs("span",{className:"text-gray-600",children:[s("auth.already_account")," "]}),e.jsx(K,{to:"/login",className:"text-blue-600 font-semibold hover:text-blue-700 hover:underline",children:s("auth.login")})]})]})})}),e.jsx(Q,{}),e.jsx(ee,{open:T,onOpenChange:D,children:e.jsxs(se,{className:"sm:max-w-[360px] text-center p-8",children:[e.jsxs(re,{children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center",children:e.jsx("svg",{className:"w-8 h-8 text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M5 13l4 4L19 7"})})})}),e.jsx(ae,{className:"text-2xl font-bold text-gray-900",children:s("auth.signup_success")})]}),e.jsxs("div",{className:"py-4",children:[e.jsx("p",{className:"text-gray-900 font-semibold mb-1",children:s("auth.welcome_msg",{name:r.name})}),e.jsx("p",{className:"text-gray-500 text-sm whitespace-nowrap",children:s("auth.signup_welcome_desc")})]}),e.jsx(te,{className:"sm:justify-center",children:e.jsx(X,{onClick:()=>window.location.href="/login",className:"w-full bg-blue-600 hover:bg-blue-700 text-white font-bold py-6 text-lg rounded-xl shadow-lg transition-all active:scale-95",children:s("auth.go_login")})})]})})]})}export{ue 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.