(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9566],{88053:function(e,t,r){Promise.resolve().then(r.bind(r,98414))},98998:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,r(87461).Z)("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},57976:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,r(87461).Z)("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},51930:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,r(87461).Z)("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]])},37841:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,r(87461).Z)("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},18994:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,r(87461).Z)("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},51652:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,r(87461).Z)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},90684:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,r(87461).Z)("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]])},11213:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});/**
 * @license lucide-react v0.344.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let s=(0,r(87461).Z)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},47907:function(e,t,r){"use strict";var s=r(15313);r.o(s,"useParams")&&r.d(t,{useParams:function(){return s.useParams}}),r.o(s,"usePathname")&&r.d(t,{usePathname:function(){return s.usePathname}}),r.o(s,"useRouter")&&r.d(t,{useRouter:function(){return s.useRouter}}),r.o(s,"useSearchParams")&&r.d(t,{useSearchParams:function(){return s.useSearchParams}})},98414:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return g}});var s=r(3827),a=r(64090),n=r(71126),l=r(47907),i=r(8792),o=r(98998),c=r(11213),u=r(90684),d=r(51652),h=r(51930),x=r(37841),m=r(18994),y=r(57976),f=r(71774);function g(){let e=(0,l.useRouter)(),{t}=(0,f.Z)(),[r,g]=(0,a.useState)(""),[p,b]=(0,a.useState)(""),[w,j]=(0,a.useState)(""),[v,N]=(0,a.useState)(!1),[k,Z]=(0,a.useState)(""),[S,P]=(0,a.useState)(!1),C=0===w.length?0:w.length<6?1:w.length<10?2:3,M=["","bg-red-500","bg-yellow-500","bg-green-500"],A=async t=>{t.preventDefault(),Z(""),P(!0);try{let t=await fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:r,email:p,password:w})}),s=await t.json();if(!t.ok){Z(s.error||"Something went wrong"),P(!1);return}let a=await (0,n.signIn)("credentials",{email:p,password:w,redirect:!1});(null==a?void 0:a.error)?(Z(a.error),P(!1)):(e.push("/dashboard"),e.refresh())}catch(e){Z("Something went wrong. Please try again."),P(!1)}};return(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"mb-8",children:[(0,s.jsx)("h1",{className:"text-3xl font-bold text-white mb-2",children:t("createAccount")}),(0,s.jsx)("p",{className:"text-gray-400",children:t("startBuildingWithAI")})]}),k&&(0,s.jsxs)("div",{className:"flex items-center gap-3 p-4 mb-6 rounded-xl bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:[(0,s.jsx)(o.Z,{className:"h-4 w-4 shrink-0"}),k]}),(0,s.jsxs)("form",{onSubmit:A,className:"space-y-5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:t("fullName")}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(c.Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-500"}),(0,s.jsx)("input",{type:"text",placeholder:"محمد أحمد",value:r,onChange:e=>g(e.target.value),required:!0,className:"w-full bg-white/[0.04] border border-white/[0.08] text-white rounded-xl pl-10 pr-4 py-3 text-sm placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/60 focus:bg-white/[0.06] transition-all"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:t("email")}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(u.Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-500"}),(0,s.jsx)("input",{type:"email",placeholder:"you@example.com",value:p,onChange:e=>b(e.target.value),required:!0,className:"w-full bg-white/[0.04] border border-white/[0.08] text-white rounded-xl pl-10 pr-4 py-3 text-sm placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/60 focus:bg-white/[0.06] transition-all"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:t("password")}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(d.Z,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-500"}),(0,s.jsx)("input",{type:v?"text":"password",placeholder:t("atLeast8Chars"),value:w,onChange:e=>j(e.target.value),minLength:8,required:!0,className:"w-full bg-white/[0.04] border border-white/[0.08] text-white rounded-xl pl-10 pr-11 py-3 text-sm placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/60 focus:bg-white/[0.06] transition-all"}),(0,s.jsx)("button",{type:"button",onClick:()=>N(!v),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300 transition-colors",children:v?(0,s.jsx)(h.Z,{className:"h-4 w-4"}):(0,s.jsx)(x.Z,{className:"h-4 w-4"})})]}),w.length>0&&(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsx)("div",{className:"flex gap-1",children:[1,2,3].map(e=>(0,s.jsx)("div",{className:"h-1 flex-1 rounded-full transition-all duration-300 ".concat(C>=e?M[C]:"bg-white/[0.08]")},e))}),(0,s.jsxs)("p",{className:"text-xs mt-1 ".concat(1===C?"text-red-400":2===C?"text-yellow-400":"text-green-400"),children:["قوة كلمة المرور: ",["","ضعيفة","متوسطة","قوية"][C]]})]})]}),(0,s.jsxs)("button",{type:"submit",disabled:S,className:"w-full bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-500 hover:to-purple-500 disabled:opacity-60 disabled:cursor-not-allowed text-white font-semibold py-3 px-6 rounded-xl transition-all duration-200 flex items-center justify-center gap-2 shadow-lg shadow-indigo-500/20 mt-2",children:[S?(0,s.jsx)(m.Z,{className:"h-4 w-4 animate-spin"}):(0,s.jsx)(y.Z,{className:"h-4 w-4"}),S?"جاري إنشاء الحساب...":t("createAccount")]})]}),(0,s.jsxs)("p",{className:"text-center text-sm text-gray-500 mt-8",children:[t("alreadyHaveAccount")," ",(0,s.jsx)(i.default,{href:"/login",className:"text-indigo-400 hover:text-indigo-300 font-medium transition-colors",children:t("signIn")})]})]})}}},function(e){e.O(0,[2807,1126,1774,2971,8069,1744],function(){return e(e.s=88053)}),_N_E=e.O()}]);