(()=>{var e={};e.id=7656,e.ids=[7656],e.modules={53524:e=>{"use strict";e.exports=require("@prisma/client")},47849:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external")},72934:e=>{"use strict";e.exports=require("next/dist/client/components/action-async-storage.external.js")},55403:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external")},54580:e=>{"use strict";e.exports=require("next/dist/client/components/request-async-storage.external.js")},94749:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external")},45869:e=>{"use strict";e.exports=require("next/dist/client/components/static-generation-async-storage.external.js")},20399:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},50852:e=>{"use strict";e.exports=require("async_hooks")},32081:e=>{"use strict";e.exports=require("child_process")},82361:e=>{"use strict";e.exports=require("events")},57147:e=>{"use strict";e.exports=require("fs")},73292:e=>{"use strict";e.exports=require("fs/promises")},22037:e=>{"use strict";e.exports=require("os")},71017:e=>{"use strict";e.exports=require("path")},76224:e=>{"use strict";e.exports=require("tty")},73837:e=>{"use strict";e.exports=require("util")},19602:(e,t,s)=>{"use strict";s.r(t),s.d(t,{GlobalError:()=>l.ZP,__next_app__:()=>m,originalPathname:()=>c,pages:()=>d,routeModule:()=>x,tree:()=>o});var a=s(50482),r=s(69108),l=s(83543),i=s(68300),n={};for(let e in i)0>["default","tree","pages","GlobalError","originalPathname","__next_app__","routeModule"].indexOf(e)&&(n[e]=()=>i[e]);s.d(t,n);let o=["",{children:["install",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(s.bind(s,48525)),"C:\\test2\\pagecraft-ai\\src\\app\\install\\page.tsx"]}]},{layout:[()=>Promise.resolve().then(s.bind(s,21638)),"C:\\test2\\pagecraft-ai\\src\\app\\install\\layout.tsx"]}]},{layout:[()=>Promise.resolve().then(s.bind(s,43625)),"C:\\test2\\pagecraft-ai\\src\\app\\layout.tsx"],error:[()=>Promise.resolve().then(s.bind(s,24117)),"C:\\test2\\pagecraft-ai\\src\\app\\error.tsx"],"not-found":[()=>Promise.resolve().then(s.bind(s,48206)),"C:\\test2\\pagecraft-ai\\src\\app\\not-found.tsx"]}],d=["C:\\test2\\pagecraft-ai\\src\\app\\install\\page.tsx"],c="/install/page",m={require:s,loadChunk:()=>Promise.resolve()},x=new a.AppPageRouteModule({definition:{kind:r.x.APP_PAGE,page:"/install/page",pathname:"/install",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:o}})},36419:(e,t,s)=>{Promise.resolve().then(s.bind(s,62745))},35303:()=>{},64290:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(0,s(69224).Z)("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},71532:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(0,s(69224).Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},97751:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(0,s(69224).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},99046:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(0,s(69224).Z)("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]])},1222:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(0,s(69224).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"}]])},53148:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(0,s(69224).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"}]])},42739:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(0,s(69224).Z)("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},83918:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(0,s(69224).Z)("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]])},75203:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(0,s(69224).Z)("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]])},18822:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(0,s(69224).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"}]])},73229:(e,t,s)=>{"use strict";s.d(t,{Z:()=>a});/**
 * @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 a=(0,s(69224).Z)("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},62745:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>f});var a=s(95344),r=s(3729),l=s(73229),i=s(75203),n=s(42739),o=s(64290),d=s(99046),c=s(1222),m=s(53148),x=s(30304),u=s(18822);/**
 * @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 p=(0,s(69224).Z)("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);var h=s(83918),g=s(71532),b=s(97751);let y={en:{title:"Install PageCraft AI",subtitle:"Setup wizard — follow the steps to configure your application",steps:["Requirements","Database","Site Info","Admin Account","API Keys","Install","Done!"],next:"Next",back:"Back",testConnection:"Test Connection",testKey:"Test",install:"Start Installation",regenerate:"Regenerate",required:"Required",optional:"Optional",checkingRequirements:"Checking system requirements...",allPassed:"All checks passed! You can proceed.",someFailures:"Some checks failed. Please fix the issues above.",dbTypeLabel:"Database Type",hostLabel:"Host",portLabel:"Port",databaseLabel:"Database Name",usernameLabel:"Username",passwordLabel:"Password",sslLabel:"Use SSL",connectionSuccess:"Connection successful!",siteNameLabel:"Site Name",siteUrlLabel:"Site URL",languageLabel:"Default Language",fullNameLabel:"Full Name",emailLabel:"Email",passwordLabel2:"Password",confirmPasswordLabel:"Confirm Password",passwordMismatch:"Passwords do not match",passwordTooShort:"Password must be at least 8 characters",openRouterLabel:"OpenRouter API Key",unsplashLabel:"Unsplash Access Key",googleIdLabel:"Google Client ID",googleSecretLabel:"Google Client Secret",installing:"Installing...",congratulations:"Installation Complete!",goToDashboard:"Go to Dashboard",loginInfo:"Login with:"},ar:{title:"تثبيت PageCraft AI",subtitle:"معالج الإعداد — اتبع الخطوات لتهيئة التطبيق",steps:["المتطلبات","قاعدة البيانات","معلومات الموقع","حساب المدير","مفاتيح API","التثبيت","تم!"],next:"التالي",back:"السابق",testConnection:"اختبار الاتصال",testKey:"اختبار",install:"بدء التثبيت",regenerate:"إعادة توليد",required:"مطلوب",optional:"اختياري",checkingRequirements:"جاري فحص متطلبات النظام...",allPassed:"جميع الفحوصات نجحت! يمكنك المتابعة.",someFailures:"بعض الفحوصات فشلت. يرجى إصلاح المشاكل أعلاه.",dbTypeLabel:"نوع قاعدة البيانات",hostLabel:"المضيف",portLabel:"المنفذ",databaseLabel:"اسم قاعدة البيانات",usernameLabel:"اسم المستخدم",passwordLabel:"كلمة المرور",sslLabel:"استخدام SSL",connectionSuccess:"الاتصال ناجح!",siteNameLabel:"اسم الموقع",siteUrlLabel:"رابط الموقع",languageLabel:"اللغة الافتراضية",fullNameLabel:"الاسم الكامل",emailLabel:"البريد الإلكتروني",passwordLabel2:"كلمة المرور",confirmPasswordLabel:"تأكيد كلمة المرور",passwordMismatch:"كلمتا المرور غير متطابقتين",passwordTooShort:"كلمة المرور يجب أن تكون 8 أحرف على الأقل",openRouterLabel:"مفتاح OpenRouter API",unsplashLabel:"مفتاح Unsplash",googleIdLabel:"معرّف عميل Google",googleSecretLabel:"سر عميل Google",installing:"جاري التثبيت...",congratulations:"اكتمل التثبيت!",goToDashboard:"الذهاب للوحة التحكم",loginInfo:"تسجيل الدخول بـ:"}};function f(){let[e,t]=(0,r.useState)("en"),[s,f]=(0,r.useState)(0),[j,w]=(0,r.useState)(!1),[N,v]=(0,r.useState)(""),[k,C]=(0,r.useState)([]),[P,L]=(0,r.useState)(!1),[S,q]=(0,r.useState)(!1),[Z,_]=(0,r.useState)([]),[I,E]=(0,r.useState)(!1),[T,A]=(0,r.useState)({dbType:"postgresql",dbHost:"localhost",dbPort:"5432",dbName:"pagecraft_ai",dbUser:"",dbPass:"",dbSsl:!1,siteName:"PageCraft AI",siteUrl:"",siteLang:"ar",adminName:"",adminEmail:"",adminPass:"",adminPassConfirm:"",openRouterKey:"",unsplashKey:"",googleClientId:"",googleClientSecret:""}),[M,R]=(0,r.useState)({db:!1,admin:!1}),U=y[e],O="ar"===e,K=(e,t)=>{A(s=>{let a={...s,[e]:t};return"dbType"===e&&(a.dbPort="mysql"===t?"3306":"5432"),a}),v(""),e.startsWith("db")&&L(!1)},D=async()=>{w(!0),v("");try{let e=await fetch("/api/install/check"),t=await e.json();C(t.checks)}catch(e){v(e.message)}w(!1)};(0,r.useEffect)(()=>{0===s&&D()},[s]);let G=async()=>{w(!0),v("");try{let e=await fetch("/api/install/test-db",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:T.dbType,host:T.dbHost,port:parseInt(T.dbPort),database:T.dbName,username:T.dbUser,password:T.dbPass,ssl:T.dbSsl})}),t=await e.json();t.success?(L(!0),v("")):(v(t.error),L(!1))}catch(e){v(e.message)}w(!1)},z=async(e,t)=>{w(!0),v("");try{let s=await fetch("/api/install/test-api",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({service:e,apiKey:t})}),a=await s.json();a.success?("openrouter"===e&&q(!0),v("")):v(a.error)}catch(e){v(e.message)}w(!1)},$=async()=>{w(!0),v(""),_([]);try{let e=await fetch("/api/install/execute",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({db:{type:T.dbType,host:T.dbHost,port:parseInt(T.dbPort),database:T.dbName,username:T.dbUser,password:T.dbPass,ssl:T.dbSsl},site:{name:T.siteName,url:T.siteUrl,language:T.siteLang},admin:{name:T.adminName,email:T.adminEmail,password:T.adminPass},api:{openRouterKey:T.openRouterKey,unsplashKey:T.unsplashKey,googleClientId:T.googleClientId,googleClientSecret:T.googleClientSecret}})}),t=await e.json();_(t.steps||[]),t.success?(E(!0),f(6)):v(t.error||"Installation failed")}catch(e){v(e.message)}w(!1)},H=()=>{switch(s){case 0:return k.length>0&&k.every(e=>e.ok);case 1:return P;case 2:return!!T.siteName&&!!T.siteUrl;case 3:return!!T.adminName&&!!T.adminEmail&&T.adminPass.length>=8&&T.adminPass===T.adminPassConfirm;case 4:return S;default:return!0}},B=({label:e,value:t,onChange:s,type:r="text",placeholder:l="",required:i=!1,badge:n=""})=>(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx("label",{className:"text-sm font-medium text-gray-300",children:e}),n&&a.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${n===U.required?"bg-red-500/20 text-red-400":"bg-gray-500/20 text-gray-400"}`,children:n})]}),a.jsx("input",{type:r,value:t,onChange:e=>s(e.target.value),placeholder:l,required:i,className:"w-full bg-white/[0.04] border border-white/[0.08] text-white rounded-xl px-4 py-3 text-sm placeholder:text-gray-600 focus:outline-none focus:border-indigo-500/60 focus:bg-white/[0.06] transition-all"})]});return(0,a.jsxs)("div",{className:`min-h-screen bg-[#0a0a14] text-white ${O?"rtl":"ltr"}`,dir:O?"rtl":"ltr",children:[(0,a.jsxs)("div",{className:"absolute top-4 right-4 flex gap-2",children:[a.jsx("button",{onClick:()=>t("en"),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-all ${"en"===e?"bg-indigo-500 text-white":"bg-white/[0.04] text-gray-400"}`,children:"EN"}),a.jsx("button",{onClick:()=>t("ar"),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-all ${"ar"===e?"bg-indigo-500 text-white":"bg-white/[0.04] text-gray-400"}`,children:"عربي"})]}),(0,a.jsxs)("div",{className:"max-w-2xl mx-auto px-6 py-12",children:[(0,a.jsxs)("div",{className:"text-center mb-8",children:[a.jsx("h1",{className:"text-3xl font-bold bg-gradient-to-r from-indigo-400 to-purple-400 bg-clip-text text-transparent",children:U.title}),a.jsx("p",{className:"text-gray-400 mt-2 text-sm",children:U.subtitle})]}),a.jsx(()=>a.jsx("div",{className:"flex items-center justify-center gap-1 mb-10",children:U.steps.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center",children:[a.jsx("div",{className:`flex items-center justify-center w-8 h-8 rounded-full text-xs font-bold transition-all ${t<s?"bg-green-500 text-white":t===s?"bg-indigo-500 text-white":"bg-white/[0.06] text-gray-500"}`,children:t<s?"✓":t+1}),a.jsx("span",{className:`hidden sm:inline text-xs mx-2 ${t===s?"text-white":"text-gray-500"}`,children:e}),t<U.steps.length-1&&a.jsx("div",{className:`w-8 h-0.5 ${t<s?"bg-green-500":"bg-white/[0.06]"}`})]},t))}),{}),N&&(0,a.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:[a.jsx(l.Z,{className:"h-4 w-4 shrink-0"}),N]}),(0,a.jsxs)("div",{className:"bg-white/[0.02] border border-white/[0.06] rounded-2xl p-8",children:[0===s&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-xl font-bold mb-6 flex items-center gap-2",children:[a.jsx(i.Z,{className:"h-5 w-5 text-indigo-400"}),U.steps[0]]}),j?(0,a.jsxs)("div",{className:"flex items-center gap-3 text-gray-400",children:[a.jsx(n.Z,{className:"h-5 w-5 animate-spin"}),U.checkingRequirements]}):(0,a.jsxs)("div",{className:"space-y-3",children:[k.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-white/[0.02]",children:[e.ok?a.jsx(o.Z,{className:"h-5 w-5 text-green-400"}):a.jsx(l.Z,{className:"h-5 w-5 text-red-400"}),a.jsx("span",{className:e.ok?"text-gray-300":"text-red-400",children:e.message})]},e.name)),k.length>0&&a.jsx("p",{className:`text-sm mt-4 ${k.every(e=>e.ok)?"text-green-400":"text-red-400"}`,children:k.every(e=>e.ok)?U.allPassed:U.someFailures})]})]}),1===s&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-xl font-bold mb-6 flex items-center gap-2",children:[a.jsx(d.Z,{className:"h-5 w-5 text-indigo-400"}),U.steps[1]]}),a.jsx("div",{className:"flex gap-3 mb-6",children:["postgresql","mysql"].map(e=>a.jsx("button",{onClick:()=>K("dbType",e),className:`flex-1 p-4 rounded-xl border text-center transition-all ${T.dbType===e?"border-indigo-500 bg-indigo-500/10 text-white":"border-white/[0.08] bg-white/[0.02] text-gray-400 hover:border-white/[0.15]"}`,children:a.jsx("span",{className:"text-sm font-semibold",children:"postgresql"===e?"PostgreSQL":"MySQL"})},e))}),a.jsx(B,{label:U.hostLabel,value:T.dbHost,onChange:e=>K("dbHost",e),placeholder:"localhost"}),a.jsx(B,{label:U.portLabel,value:T.dbPort,onChange:e=>K("dbPort",e),placeholder:"mysql"===T.dbType?"3306":"5432"}),a.jsx(B,{label:U.databaseLabel,value:T.dbName,onChange:e=>K("dbName",e),placeholder:"pagecraft_ai",required:!0}),a.jsx(B,{label:U.usernameLabel,value:T.dbUser,onChange:e=>K("dbUser",e),required:!0}),(0,a.jsxs)("div",{className:"mb-4 relative",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:U.passwordLabel}),a.jsx("input",{type:M.db?"text":"password",value:T.dbPass,onChange:e=>K("dbPass",e.target.value),className:"w-full bg-white/[0.04] border border-white/[0.08] text-white rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-indigo-500/60 transition-all"}),a.jsx("button",{type:"button",onClick:()=>R(e=>({...e,db:!e.db})),className:"absolute right-3 top-10 text-gray-500 hover:text-gray-300",children:M.db?a.jsx(c.Z,{className:"h-4 w-4"}):a.jsx(m.Z,{className:"h-4 w-4"})})]}),(0,a.jsxs)("label",{className:"flex items-center gap-3 cursor-pointer mb-6",children:[a.jsx("input",{type:"checkbox",checked:T.dbSsl,onChange:e=>K("dbSsl",e.target.checked),className:"w-4 h-4 rounded border-gray-600 text-indigo-500 focus:ring-indigo-500"}),a.jsx("span",{className:"text-sm text-gray-300",children:U.sslLabel})]}),(0,a.jsxs)("button",{onClick:G,disabled:j||!T.dbUser||!T.dbName,className:"w-full bg-white/[0.06] hover:bg-white/[0.10] border border-white/[0.08] text-white font-medium py-3 rounded-xl transition-all disabled:opacity-40 flex items-center justify-center gap-2",children:[j?a.jsx(n.Z,{className:"h-4 w-4 animate-spin"}):a.jsx(d.Z,{className:"h-4 w-4"}),U.testConnection]}),P&&(0,a.jsxs)("p",{className:"text-green-400 text-sm mt-3 flex items-center gap-2",children:[a.jsx(o.Z,{className:"h-4 w-4"}),U.connectionSuccess]})]}),2===s&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-xl font-bold mb-6 flex items-center gap-2",children:[a.jsx(x.Z,{className:"h-5 w-5 text-indigo-400"}),U.steps[2]]}),a.jsx(B,{label:U.siteNameLabel,value:T.siteName,onChange:e=>K("siteName",e),placeholder:"PageCraft AI",required:!0}),a.jsx(B,{label:U.siteUrlLabel,value:T.siteUrl,onChange:e=>K("siteUrl",e),placeholder:"https://example.com",required:!0}),(0,a.jsxs)("div",{className:"mb-4",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:U.languageLabel}),a.jsx("div",{className:"flex gap-3",children:["ar","en"].map(e=>a.jsx("button",{onClick:()=>K("siteLang",e),className:`flex-1 p-3 rounded-xl border text-center transition-all ${T.siteLang===e?"border-indigo-500 bg-indigo-500/10 text-white":"border-white/[0.08] text-gray-400"}`,children:"ar"===e?"العربية":"English"},e))})]})]}),3===s&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-xl font-bold mb-6 flex items-center gap-2",children:[a.jsx(u.Z,{className:"h-5 w-5 text-indigo-400"}),U.steps[3]]}),a.jsx(B,{label:U.fullNameLabel,value:T.adminName,onChange:e=>K("adminName",e),required:!0}),a.jsx(B,{label:U.emailLabel,value:T.adminEmail,onChange:e=>K("adminEmail",e),type:"email",required:!0}),a.jsx(B,{label:U.passwordLabel2,value:T.adminPass,onChange:e=>K("adminPass",e),type:"password",required:!0}),a.jsx(B,{label:U.confirmPasswordLabel,value:T.adminPassConfirm,onChange:e=>K("adminPassConfirm",e),type:"password",required:!0}),T.adminPass&&T.adminPassConfirm&&T.adminPass!==T.adminPassConfirm&&a.jsx("p",{className:"text-red-400 text-sm",children:U.passwordMismatch}),T.adminPass&&T.adminPass.length<8&&a.jsx("p",{className:"text-amber-400 text-sm",children:U.passwordTooShort})]}),4===s&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-xl font-bold mb-6 flex items-center gap-2",children:[a.jsx(p,{className:"h-5 w-5 text-indigo-400"}),U.steps[4]]}),a.jsx(B,{label:U.openRouterLabel,value:T.openRouterKey,onChange:e=>{K("openRouterKey",e),q(!1)},badge:U.required}),(0,a.jsxs)("button",{onClick:()=>z("openrouter",T.openRouterKey),disabled:j||!T.openRouterKey,className:"w-full mb-6 bg-white/[0.06] hover:bg-white/[0.10] border border-white/[0.08] text-white font-medium py-2.5 rounded-xl transition-all disabled:opacity-40 flex items-center justify-center gap-2 text-sm",children:[j?a.jsx(n.Z,{className:"h-4 w-4 animate-spin"}):null,U.testKey," OpenRouter"]}),S&&(0,a.jsxs)("p",{className:"text-green-400 text-sm mb-4 flex items-center gap-2",children:[a.jsx(o.Z,{className:"h-4 w-4"}),"OpenRouter OK"]}),a.jsx("hr",{className:"border-white/[0.06] my-6"}),a.jsx(B,{label:U.unsplashLabel,value:T.unsplashKey,onChange:e=>K("unsplashKey",e),badge:U.optional}),a.jsx(B,{label:U.googleIdLabel,value:T.googleClientId,onChange:e=>K("googleClientId",e),badge:U.optional}),a.jsx(B,{label:U.googleSecretLabel,value:T.googleClientSecret,onChange:e=>K("googleClientSecret",e),badge:U.optional})]}),5===s&&!I&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-xl font-bold mb-6 flex items-center gap-2",children:[a.jsx(h.Z,{className:"h-5 w-5 text-indigo-400"}),U.steps[5]]}),0===Z.length&&!j&&(0,a.jsxs)("div",{className:"text-center py-8",children:[a.jsx(h.Z,{className:"h-12 w-12 text-indigo-400 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-400 mb-6",children:O?"كل شيء جاهز. اضغط لبدء التثبيت.":"Everything is ready. Click to start installation."}),a.jsx("button",{onClick:$,className:"bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-500 hover:to-purple-500 text-white font-bold py-4 px-10 rounded-xl text-lg transition-all shadow-lg shadow-indigo-500/20",children:U.install})]}),(j||Z.length>0)&&(0,a.jsxs)("div",{className:"space-y-3",children:[Z.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-white/[0.02]",children:["ok"===e.status?a.jsx(o.Z,{className:"h-5 w-5 text-green-400"}):a.jsx(l.Z,{className:"h-5 w-5 text-red-400"}),a.jsx("span",{className:"ok"===e.status?"text-gray-300":"text-red-400",children:e.message})]},t)),j&&(0,a.jsxs)("div",{className:"flex items-center gap-3 text-gray-400",children:[a.jsx(n.Z,{className:"h-5 w-5 animate-spin"}),U.installing]})]})]}),6===s&&I&&(0,a.jsxs)("div",{className:"text-center py-8",children:[a.jsx("div",{className:"w-20 h-20 rounded-full bg-green-500/20 flex items-center justify-center mx-auto mb-6",children:a.jsx(o.Z,{className:"h-10 w-10 text-green-400"})}),a.jsx("h2",{className:"text-2xl font-bold mb-2",children:U.congratulations}),a.jsx("p",{className:"text-gray-400 mb-2",children:U.loginInfo}),a.jsx("p",{className:"text-indigo-400 font-mono text-sm mb-8",children:T.adminEmail}),a.jsx("a",{href:"/login",className:"inline-block bg-gradient-to-r from-indigo-600 to-purple-600 hover:from-indigo-500 hover:to-purple-500 text-white font-bold py-4 px-10 rounded-xl text-lg transition-all shadow-lg shadow-indigo-500/20",children:U.goToDashboard})]})]}),s<5&&(0,a.jsxs)("div",{className:"flex justify-between mt-6",children:[(0,a.jsxs)("button",{onClick:()=>{f(s-1),v("")},disabled:0===s,className:"flex items-center gap-2 px-6 py-3 rounded-xl bg-white/[0.04] text-gray-400 hover:bg-white/[0.08] disabled:opacity-30 transition-all",children:[a.jsx(g.Z,{className:"h-4 w-4"}),U.back]}),(0,a.jsxs)("button",{onClick:()=>{H()&&(f(s+1),v(""))},disabled:!H(),className:"flex items-center gap-2 px-6 py-3 rounded-xl bg-indigo-600 hover:bg-indigo-500 text-white font-medium disabled:opacity-30 transition-all",children:[U.next,a.jsx(b.Z,{className:"h-4 w-4"})]})]})]})]})}},48096:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var s in t)Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}(t,{DynamicServerError:function(){return a},isDynamicServerError:function(){return r}});let s="DYNAMIC_SERVER_USAGE";class a extends Error{constructor(e){super("Dynamic server usage: "+e),this.description=e,this.digest=s}}function r(e){return"object"==typeof e&&null!==e&&"digest"in e&&"string"==typeof e.digest&&e.digest===s}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},72973:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var s in t)Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}(t,{isStaticGenBailoutError:function(){return n},staticGenerationBailout:function(){return d}});let a=s(48096),r=s(45869),l="NEXT_STATIC_GEN_BAILOUT";class i extends Error{constructor(...e){super(...e),this.code=l}}function n(e){return"object"==typeof e&&null!==e&&"code"in e&&e.code===l}function o(e,t){let{dynamic:s,link:a}=t||{};return"Page"+(s?' with `dynamic = "'+s+'"`':"")+" couldn't be rendered statically because it used `"+e+"`."+(a?" See more info here: "+a:"")}let d=(e,t)=>{let{dynamic:s,link:l}=void 0===t?{}:t,n=r.staticGenerationAsyncStorage.getStore();if(!n)return!1;if(n.forceStatic)return!0;if(n.dynamicShouldError)throw new i(o(e,{link:l,dynamic:null!=s?s:"error"}));let d=o(e,{dynamic:s,link:"https://nextjs.org/docs/messages/dynamic-server-error"});if(null==n.postpone||n.postpone.call(n,e),n.revalidate=0,n.isStaticGeneration){let t=new a.DynamicServerError(d);throw n.dynamicUsageDescription=e,n.dynamicUsageStack=t.stack,t}return!1};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},21638:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>l,metadata:()=>r});var a=s(25036);let r={title:"Install PageCraft AI",description:"Setup wizard for PageCraft AI"};function l({children:e}){return a.jsx("div",{className:"min-h-screen bg-[#0a0a14] text-white",children:e})}},48525:(e,t,s)=>{"use strict";s.r(t),s.d(t,{$$typeof:()=>l,__esModule:()=>r,default:()=>i});let a=(0,s(86843).createProxy)(String.raw`C:\test2\pagecraft-ai\src\app\install\page.tsx`),{__esModule:r,$$typeof:l}=a,i=a.default}};var t=require("../../webpack-runtime.js");t.C(e);var s=e=>t(t.s=e),a=t.X(0,[1638,5312,6632,3910],()=>s(19602));module.exports=a})();