Spaces:
Paused
Paused
CBV01 commited on
Commit ·
6b2f36c
1
Parent(s): 5bef62b
feat: manual payment system with bank transfer, crypto, country selection, whatsapp verification, and email alerts
Browse filesFiles changed (6)
364 unmodified lines36536636736836937010 unmodified lines381382383384385386364 unmodified linescontacted_at DATETIME DEFAULT CURRENT_TIMESTAMP,UNIQUE(user_id, target_identifier))""",]conn = cast(Any, get_db_connection())10 unmodified linesconn.execute("ALTER TABLE scraped_groups ADD COLUMN can_send_messages INTEGER DEFAULT 1")except:pass# Fast path: check if database schema and seed data already exist to avoid 50+ sequential network round-tripstry:364 unmodified lines36536636736836937037137237337437537637737837938038138238338410 unmodified lines395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427364 unmodified linescontacted_at DATETIME DEFAULT CURRENT_TIMESTAMP,UNIQUE(user_id, target_identifier))""","""CREATE TABLE IF NOT EXISTS payment_requests (id INTEGER PRIMARY KEY AUTOINCREMENT,user_id TEXT NOT NULL,username TEXT,email TEXT,plan_key TEXT NOT NULL,method TEXT NOT NULL,currency TEXT NOT NULL,amount REAL NOT NULL,proof_details TEXT,status TEXT DEFAULT 'pending',created_at DATETIME DEFAULT CURRENT_TIMESTAMP,verified_at DATETIME)""",]conn = cast(Any, get_db_connection())10 unmodified linesconn.execute("ALTER TABLE scraped_groups ADD COLUMN can_send_messages INTEGER DEFAULT 1")except:passtry:conn.execute("ALTER TABLE users ADD COLUMN country TEXT DEFAULT 'Nigeria'")except:passtry:conn.execute("""CREATE TABLE IF NOT EXISTS payment_requests (id INTEGER PRIMARY KEY AUTOINCREMENT,user_id TEXT NOT NULL,username TEXT,email TEXT,plan_key TEXT NOT NULL,method TEXT NOT NULL,currency TEXT NOT NULL,amount REAL NOT NULL,proof_details TEXT,status TEXT DEFAULT 'pending',created_at DATETIME DEFAULT CURRENT_TIMESTAMP,verified_at DATETIME)""")except:passtry:conn.execute("INSERT OR IGNORE INTO system_settings (key, value) VALUES ('whatsapp_number', '2349077750956')")conn.execute("INSERT OR IGNORE INTO system_settings (key, value) VALUES ('support_email', 'support@arkitel.app')")conn.execute("INSERT OR IGNORE INTO system_settings (key, value) VALUES ('telegram_support', 'arkitel_support')")except:pass# Fast path: check if database schema and seed data already exist to avoid 50+ sequential network round-tripstry:
1093 unmodified lines10941095109610971098109943 unmodified lines1143114411451146114711481149115011511152115311541155115654 unmodified lines121112121213121412151216121712181219122012211222122312241225122612272129 unmodified lines33573358335933603361336221 unmodified lines33843385338633873388338943 unmodified lines343334343435343634373438343913 unmodified lines34533454345534563457345878 unmodified lines35373538353935403541354222 unmodified lines35653566356735683569357060 unmodified lines3631363236333634363536361093 unmodified linesusername: strpassword: stremail: Optional[str] = Noneclass PasskeyVerify(BaseModel):passkey: str43 unmodified linesuser_id = str(uuid.uuid4())pw_hash = get_password_hash(user.password)conn.execute("INSERT INTO users (id, username, password_hash, role, email) VALUES (?, ?, ?, ?, ?)",(user_id, user.username, pw_hash, "user", user.email))if hasattr(conn, "commit"): conn.commit()if hasattr(conn, "close"): conn.close()print(f"AUTH: Registered new user {user.username} with ID {user_id}")return {"status": "success", "message": "Registered successfully"}@app.post("/api/auth/login")54 unmodified lines"username": "System Administrator","role": "admin","plan": "unlimited","passkey_verified": True}conn = get_db_connection()user = conn.execute("SELECT username, role, passkey_verified FROM users WHERE id = ?", (user_id,)).fetchone()if hasattr(conn, "close"): conn.close()if not user:raise HTTPException(status_code=401, detail="User not found")return {"username": user[0], "role": user[1], "passkey_verified": bool(user[2])}@app.post("/api/telegram/send-code")async def send_code(req: PhoneLoginRequest, user_id: str = Depends(get_current_user_id)):2129 unmodified lines# --- Monetization & Plans ---class UserVitalsUpdateRequest(BaseModel):plan: strscrape_limit: Optional[int] = None21 unmodified linesreturn {"users": [dict(id=r["id"],username=r["username"],plan=r["plan"],# Dynamically pulling from plan if user fields are the system default (1 or NULL)max_templates=r["plan_max_templates"] if r["max_templates"] == 1 or r["max_templates"] is None else r["max_templates"],43 unmodified linesexpires_at = None# Check current user status for payment loggingcurr_user = conn.execute("SELECT plan, is_approved, username FROM users WHERE id = ?", (uid,)).fetchone()already_paid = (curr_user and curr_user["is_approved"] == 1 and curr_user["plan"] != 'free')if req.plan != 'free' and req.is_approved:13 unmodified lineslog_debug(f"MONEY: Logged payment of #{price} for {uname} (Plan: {req.plan})")except Exception as pay_err:log_debug(f"MONEY: Payment log skipped (table may not exist): {pay_err}")# Perform the actual user updateconn.execute(78 unmodified lines"max_templates": cfg["max_templates"],"template_count": 0,"email": "admin@arkitel.app","is_approved": 1,"has_proof": True}22 unmodified lines"plan": row["plan"] or "free","username": row["username"],"email": row["email"] or f"{row['username']}@arkitel.app","scrape_limit": row["scrape_limit"] or p_cfg["scrape_limit"],"max_accounts": row["max_accounts"] or p_cfg["max_accounts"],"max_daily_campaigns": row["max_daily_campaigns"] or p_cfg["max_daily_campaigns"],60 unmodified linesfinally:if hasattr(conn, "close"): conn.close()class PaystackVerifyRequest(BaseModel):reference: strplan_key: str1093 unmodified lines109410951096109710981099110043 unmodified lines114411451146114711481149115011511152115311541155115611571158115954 unmodified lines121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812392129 unmodified lines33693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346121 unmodified lines3483348434853486348734883489349043 unmodified lines353435353536353735383539354013 unmodified lines35543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357778 unmodified lines365636573658365936603661366222 unmodified lines368536863687368836893690369160 unmodified lines3752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138921093 unmodified linesusername: strpassword: stremail: Optional[str] = Nonecountry: Optional[str] = "Nigeria"class PasskeyVerify(BaseModel):passkey: str43 unmodified linesuser_id = str(uuid.uuid4())pw_hash = get_password_hash(user.password)email_val = user.email or user.usernamecountry_val = user.country or "Nigeria"conn.execute("INSERT INTO users (id, username, password_hash, role, email, country) VALUES (?, ?, ?, ?, ?, ?)",(user_id, user.username, pw_hash, "user", email_val, country_val))if hasattr(conn, "commit"): conn.commit()if hasattr(conn, "close"): conn.close()print(f"AUTH: Registered new user {user.username} with ID {user_id} (Country: {country_val})")return {"status": "success", "message": "Registered successfully"}@app.post("/api/auth/login")54 unmodified lines"username": "System Administrator","role": "admin","plan": "unlimited","email": "admin@arkitel.app","country": "Nigeria","passkey_verified": True}conn = get_db_connection()user = conn.execute("SELECT username, role, passkey_verified, email, country, plan FROM users WHERE id = ?", (user_id,)).fetchone()if hasattr(conn, "close"): conn.close()if not user:raise HTTPException(status_code=401, detail="User not found")return {"username": user["username"],"role": user["role"],"passkey_verified": bool(user["passkey_verified"]),"email": user["email"] or user["username"],"country": user["country"] or "Nigeria","plan": user["plan"] or "free"}@app.post("/api/telegram/send-code")async def send_code(req: PhoneLoginRequest, user_id: str = Depends(get_current_user_id)):2129 unmodified lines# --- Monetization & Plans ---def send_plan_activation_email(to_email: str, username: str, plan_name: str, expires_at: Optional[str] = None):"""Dispatches a stylized email to user upon payment verification and plan activation."""if not to_email or "@" not in to_email:log_debug(f"EMAIL: Skipped sending to invalid email: {to_email}")return Falsesmtp_host = os.getenv("SMTP_HOST", "smtp.gmail.com")smtp_port = int(os.getenv("SMTP_PORT", "587"))smtp_user = os.getenv("SMTP_USER", "")smtp_pass = os.getenv("SMTP_PASS", "")smtp_from = os.getenv("SMTP_FROM", f"ArkiTel Automation <{smtp_user or 'support@arkitel.app'}>")subject = f"🚀 Payment Verified: Your ArkiTel {plan_name.title()} Plan is Active!"frontend_url = os.getenv("FRONTEND_URL", "http://localhost:3000")formatted_date = expires_at[:10] if expires_at else "30-Day Active Cycle"html_content = f"""<!DOCTYPE html><html><head><meta charset="utf-8"><style>body {{ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; background-color: #07080c; color: #ffffff; margin: 0; padding: 24px; }}.card {{ max-width: 540px; margin: 0 auto; background: #0f1118; border: 1px solid rgba(255,255,255,0.08); border-radius: 24px; padding: 36px; box-shadow: 0 20px 50px rgba(0,0,0,0.6); }}.badge {{ display: inline-block; background: rgba(99,102,241,0.15); color: #818cf8; border: 1px solid rgba(99,102,241,0.3); padding: 6px 14px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }}h1 {{ font-size: 24px; font-weight: 800; margin: 20px 0 8px 0; color: #ffffff; letter-spacing: -0.5px; }}p {{ color: rgba(255,255,255,0.7); font-size: 14px; line-height: 1.6; margin: 10px 0; }}.plan-box {{ background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; padding: 20px; margin: 24px 0; }}.btn {{ display: inline-block; background: #6366f1; color: #ffffff !important; text-decoration: none; font-size: 13px; font-weight: 700; padding: 14px 32px; border-radius: 12px; margin-top: 14px; text-align: center; }}.footer {{ margin-top: 32px; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 20px; font-size: 11px; color: rgba(255,255,255,0.35); }}</style></head><body><div class="card"><span class="badge">ArkiTel Fleet Verification</span><h1>Payment Verified & Active!</h1><p>Hello <strong>{username}</strong>,</p><p>Your payment has been successfully confirmed and verified by the ArkiTel team. Your account limits have been unlocked.</p><div class="plan-box"><div style="font-size: 11px; color: #818cf8; font-weight: 700; text-transform: uppercase;">Activated Membership Tier</div><div style="font-size: 22px; font-weight: 900; color: #ffffff; margin-top: 4px;">{plan_name.title()} Plan</div><div style="font-size: 12px; color: rgba(255,255,255,0.45); margin-top: 6px;">Status: Verified | Valid until: {formatted_date}</div></div><p>You can now access your Group Scraper, Vault Leads, DM Automation, Multi-Account Fleet, and high-frequency Campaigns without restrictions.</p><div style="text-align: center; margin: 28px 0;"><a href="{frontend_url}" class="btn">Open Your Dashboard</a></div><div class="footer">Need assistance? Reply directly to this email or reach us on WhatsApp or Telegram support.<br><br>© ArkiTel Telegram Growth Engine.</div></div></body></html>"""if not smtp_user or not smtp_pass:log_debug(f"EMAIL [SIMULATED]: SMTP_USER/PASS not configured. Notification sent to {to_email} ({plan_name} plan).")return Truetry:import smtplibfrom email.mime.multipart import MIMEMultipartfrom email.mime.text import MIMETextmsg = MIMEMultipart("alternative")msg["Subject"] = subjectmsg["From"] = smtp_frommsg["To"] = to_emailpart = MIMEText(html_content, "html")msg.attach(part)with smtplib.SMTP(smtp_host, smtp_port, timeout=10) as server:server.starttls()server.login(smtp_user, smtp_pass)server.sendmail(smtp_from, [to_email], msg.as_string())log_debug(f"EMAIL: Dispatched confirmation email to {to_email}")return Trueexcept Exception as e:log_debug(f"EMAIL ERROR: Failed sending email to {to_email}: {e}")return Falseclass UserVitalsUpdateRequest(BaseModel):plan: strscrape_limit: Optional[int] = None21 unmodified linesreturn {"users": [dict(id=r["id"],username=r["username"],email=r["email"] if ("email" in r.keys() and r["email"]) else r["username"],country=r["country"] if ("country" in r.keys() and r["country"]) else "Nigeria",plan=r["plan"],# Dynamically pulling from plan if user fields are the system default (1 or NULL)max_templates=r["plan_max_templates"] if r["max_templates"] == 1 or r["max_templates"] is None else r["max_templates"],43 unmodified linesexpires_at = None# Check current user status for payment loggingcurr_user = conn.execute("SELECT plan, is_approved, username, email FROM users WHERE id = ?", (uid,)).fetchone()already_paid = (curr_user and curr_user["is_approved"] == 1 and curr_user["plan"] != 'free')if req.plan != 'free' and req.is_approved:13 unmodified lineslog_debug(f"MONEY: Logged payment of #{price} for {uname} (Plan: {req.plan})")except Exception as pay_err:log_debug(f"MONEY: Payment log skipped (table may not exist): {pay_err}")# Also mark any pending payment_requests for this user as approvedtry:conn.execute("UPDATE payment_requests SET status = 'approved', verified_at = ? WHERE user_id = ? AND status = 'pending'",(activated_at, uid))except Exception as pr_err:log_debug(f"Payment requests update: {pr_err}")# Send Email Notificationif not already_paid:try:to_email = (curr_user["email"] if curr_user and curr_user["email"] else curr_user["username"]) if curr_user else Noneif to_email:send_plan_activation_email(to_email, curr_user["username"], req.plan, expires_at)except Exception as mail_err:log_debug(f"Email dispatch error: {mail_err}")# Perform the actual user updateconn.execute(78 unmodified lines"max_templates": cfg["max_templates"],"template_count": 0,"email": "admin@arkitel.app","country": "Nigeria","is_approved": 1,"has_proof": True}22 unmodified lines"plan": row["plan"] or "free","username": row["username"],"email": row["email"] or f"{row['username']}@arkitel.app","country": row["country"] if ("country" in row.keys() and row["country"]) else "Nigeria","scrape_limit": row["scrape_limit"] or p_cfg["scrape_limit"],"max_accounts": row["max_accounts"] or p_cfg["max_accounts"],"max_daily_campaigns": row["max_daily_campaigns"] or p_cfg["max_daily_campaigns"],60 unmodified linesfinally:if hasattr(conn, "close"): conn.close()class PaymentSubmissionRequest(BaseModel):plan_key: strmethod: str # 'bank' or 'crypto'currency: str # 'NGN', 'USD', 'GBP', 'EUR', 'USDT', 'BTC', 'SOL'amount: floatproof_details: Optional[str] = ""@app.post("/api/monetization/submit-payment")async def submit_payment(req: PaymentSubmissionRequest, user_id: str = Depends(get_current_user_id)):conn = get_db_connection()try:user_row = conn.execute("SELECT username, email, country FROM users WHERE id = ?", (user_id,)).fetchone()uname = user_row["username"] if user_row else "Unknown"email_addr = (user_row["email"] if user_row and user_row["email"] else uname) or f"{uname}@arkitel.app"proof_summary = f"[{req.method.upper()}-{req.currency}] {req.amount} | {req.proof_details or 'WhatsApp DM Verification'}"# Save to users table so UI status has_proof becomes trueconn.execute("UPDATE users SET payment_proof = ? WHERE id = ?", (proof_summary, user_id))# Save to payment_requests tableconn.execute("""INSERT INTO payment_requests(user_id, username, email, plan_key, method, currency, amount, proof_details, status)VALUES (?, ?, ?, ?, ?, ?, ?, ?, 'pending')""",(user_id, uname, email_addr, req.plan_key, req.method, req.currency, req.amount, req.proof_details or "WhatsApp DM Proof"))if hasattr(conn, "commit"): conn.commit()return {"status": "success","message": "Payment recorded. Please proceed to WhatsApp DM to send your screenshot."}finally:if hasattr(conn, "close"): conn.close()@app.get("/api/admin/monetization/payment-requests")async def get_payment_requests(admin_id: str = Depends(get_current_admin)):conn = get_db_connection()try:rows = conn.execute("SELECT * FROM payment_requests ORDER BY id DESC LIMIT 100").fetchall()return {"requests": [dict(r) for r in rows]}finally:if hasattr(conn, "close"): conn.close()@app.post("/api/admin/monetization/payment-requests/{req_id}/approve")async def approve_payment_request(req_id: int, admin_id: str = Depends(get_current_admin)):conn = get_db_connection()try:pay_req = conn.execute("SELECT * FROM payment_requests WHERE id = ?", (req_id,)).fetchone()if not pay_req:raise HTTPException(status_code=404, detail="Payment request not found")uid = pay_req["user_id"]plan_key = pay_req["plan_key"]# Plan config lookupplan_row = conn.execute("SELECT * FROM plans WHERE key = ?", (plan_key,)).fetchone()DEFAULTS = {"free": {"scrape_limit": 50, "max_accounts": 1, "max_daily_campaigns": 20, "max_daily_keywords": 5, "max_templates": 1, "price": 0},"basic": {"scrape_limit": 100, "max_accounts": 2, "max_daily_campaigns": 50, "max_daily_keywords": 10, "max_templates": 1, "price": 2000},"standard": {"scrape_limit": 250, "max_accounts": 5, "max_daily_campaigns": 150, "max_daily_keywords": 25, "max_templates": 2, "price": 3500},"premium": {"scrape_limit": 500, "max_accounts": 10, "max_daily_campaigns": 300, "max_daily_keywords": 50, "max_templates": 2, "price": 5000},"unlimited": {"scrape_limit": 1000, "max_accounts": 99, "max_daily_campaigns": 999999, "max_daily_keywords": 999999, "max_templates": 999, "price": 0},}plan_cfg = dict(plan_row) if plan_row else DEFAULTS.get(plan_key, DEFAULTS["basic"])now = datetime.now()act_date = now.strftime('%Y-%m-%dT%H:%M')exp_date = (now + timedelta(days=30)).strftime('%Y-%m-%dT%H:%M')# Update user recordconn.execute("""UPDATE users SETplan = ?, is_approved = 1,scrape_limit = ?, max_accounts = ?,max_daily_campaigns = ?, max_daily_keywords = ?,max_templates = ?,plan_activated_at = ?, plan_expires_at = ?WHERE id = ?""",(plan_key, plan_cfg["scrape_limit"], plan_cfg["max_accounts"],plan_cfg["max_daily_campaigns"], plan_cfg["max_daily_keywords"],plan_cfg.get("max_templates", 1), act_date, exp_date, uid))# Update payment_request statusconn.execute("UPDATE payment_requests SET status = 'approved', verified_at = ? WHERE id = ?",(act_date, req_id))if hasattr(conn, "commit"): conn.commit()# Send Email Notificationuser_row = conn.execute("SELECT username, email FROM users WHERE id = ?", (uid,)).fetchone()if user_row:to_email = user_row["email"] or user_row["username"]send_plan_activation_email(to_email, user_row["username"], plan_key, exp_date)return {"status": "success", "message": f"Payment #{req_id} approved and user upgraded to {plan_key}!"}finally:if hasattr(conn, "close"): conn.close()@app.get("/api/system/settings")async def get_system_settings():conn = get_db_connection()try:rows = conn.execute("SELECT key, value FROM system_settings").fetchall()settings = {r["key"]: r["value"] for r in rows}return {"whatsapp_number": settings.get("whatsapp_number", "2349077750956"),"support_email": settings.get("support_email", "support@arkitel.app"),"telegram_support": settings.get("telegram_support", "arkitel_support")}finally:if hasattr(conn, "close"): conn.close()class UpdateSystemSettingsRequest(BaseModel):whatsapp_number: Optional[str] = Nonesupport_email: Optional[str] = Nonetelegram_support: Optional[str] = None@app.post("/api/admin/system/settings")async def update_system_settings(req: UpdateSystemSettingsRequest, admin_id: str = Depends(get_current_admin)):conn = get_db_connection()try:if req.whatsapp_number:conn.execute("INSERT OR REPLACE INTO system_settings (key, value) VALUES ('whatsapp_number', ?)", (req.whatsapp_number.strip(),))if req.support_email:conn.execute("INSERT OR REPLACE INTO system_settings (key, value) VALUES ('support_email', ?)", (req.support_email.strip(),))if req.telegram_support:conn.execute("INSERT OR REPLACE INTO system_settings (key, value) VALUES ('telegram_support', ?)", (req.telegram_support.strip(),))if hasattr(conn, "commit"): conn.commit()return {"status": "success", "message": "Support settings updated successfully"}finally:if hasattr(conn, "close"): conn.close()class PaystackVerifyRequest(BaseModel):reference: strplan_key: str
2095 unmodified lines20962097209820992100210121024 unmodified lines21072108210921102111211221132114118 unmodified lines22332234223522362237223822392095 unmodified lines<table className="min-w-[700px] w-full text-left"><thead className="text-[10px] uppercase tracking-[0.2em] text-foreground/40 border-b border-white/10 sticky top-0 bg-[#0d0f12] z-10 shadow-sm"><tr><th className="px-5 py-3.5 font-bold">User Identity</th><th className="px-5 py-3.5 font-bold">Plan Vitals</th><th className="px-5 py-3.5 font-bold">Limits & Quota Capsule</th><th className="px-5 py-3.5 font-bold">Payment Proof</th>4 unmodified lines{pagedMonoUsers.map((u) => (<tr key={u.id} className="hover:bg-white/[0.03] transition-colors group"><td className="px-5 py-3.5"><div className="font-bold text-foreground text-sm group-hover:text-red-400 transition-colors">{u.username}</div><div className="text-[10px] text-foreground/35 font-mono">ID: {u.id}</div></td>{/* Compact Plan Vitals with Micro Dates */}118 unmodified linesbody: JSON.stringify({ plan: planToApprove, is_approved: 1 })});if (res.ok) {setSuccessMsg(`Approved ${u.username} on ${planToApprove}!`);setTimeout(() => setSuccessMsg(''), 5000);} else {setErrorMsg('Approval failed.');2095 unmodified lines20962097209820992100210121024 unmodified lines21072108210921102111211221132114211521162117211821192120212121222123118 unmodified lines22422243224422452246224722482095 unmodified lines<table className="min-w-[700px] w-full text-left"><thead className="text-[10px] uppercase tracking-[0.2em] text-foreground/40 border-b border-white/10 sticky top-0 bg-[#0d0f12] z-10 shadow-sm"><tr><th className="px-5 py-3.5 font-bold">User Identity & Country</th><th className="px-5 py-3.5 font-bold">Plan Vitals</th><th className="px-5 py-3.5 font-bold">Limits & Quota Capsule</th><th className="px-5 py-3.5 font-bold">Payment Proof</th>4 unmodified lines{pagedMonoUsers.map((u) => (<tr key={u.id} className="hover:bg-white/[0.03] transition-colors group"><td className="px-5 py-3.5"><div className="flex items-center gap-2"><div className="font-bold text-foreground text-sm group-hover:text-red-400 transition-colors">{u.username}</div>{u.country && (<span className="text-[9px] font-bold px-1.5 py-0.5 rounded bg-white/5 border border-white/10 text-foreground/70">🌍 {u.country}</span>)}</div><div className="text-[10px] text-foreground/40 font-mono truncate max-w-[200px]" title={u.email || u.id}>{u.email || u.id}</div></td>{/* Compact Plan Vitals with Micro Dates */}118 unmodified linesbody: JSON.stringify({ plan: planToApprove, is_approved: 1 })});if (res.ok) {setSuccessMsg(`Approved ${u.username} on ${planToApprove}! Plan activated & email confirmation sent.`);setTimeout(() => setSuccessMsg(''), 5000);} else {setErrorMsg('Approval failed.');
2 unmodified lines345678910111213141520 unmodified lines3637383940414250 unmodified lines9394959697982 unmodified linesimport React, { useState, useEffect } from "react";import { useRouter } from "next/navigation";import Link from "next/link";import { User, Lock, KeyRound, Loader2, ArrowRight, ShieldCheck, Mail, Eye, EyeOff } from "lucide-react";import { getApiBase } from "@/lib/auth";export default function RegisterPage() {const [username, setUsername] = useState("");const [password, setPassword] = useState("");const [confirmPassword, setConfirmPassword] = useState("");const [showPassword, setShowPassword] = useState(false);const [showConfirmPassword, setShowConfirmPassword] = useState(false);const [error, setError] = useState("");20 unmodified linesconst res = await fetch(`${apiUrl}/api/auth/register`, {method: "POST",headers: { "Content-Type": "application/json" },body: JSON.stringify({ username, password, email: username }),});const data = await res.json();50 unmodified lines</div></div><div className="grid grid-cols-1 md:grid-cols-2 gap-4"><div className="space-y-2"><label className="text-[13px] font-medium text-white/70 ml-1">2 unmodified lines3456789101112131415161718192021222324252627282930313220 unmodified lines5354555657585950 unmodified lines1101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401412 unmodified linesimport React, { useState, useEffect } from "react";import { useRouter } from "next/navigation";import Link from "next/link";import { User, Lock, KeyRound, Loader2, ArrowRight, ShieldCheck, Mail, Eye, EyeOff, Globe } from "lucide-react";import { getApiBase } from "@/lib/auth";const COUNTRIES = [{ code: "NG", name: "Nigeria", flag: "🇳🇬" },{ code: "US", name: "United States", flag: "🇺🇸" },{ code: "GB", name: "United Kingdom", flag: "🇬🇧" },{ code: "DE", name: "Germany", flag: "🇩🇪" },{ code: "FR", name: "France", flag: "🇫🇷" },{ code: "CA", name: "Canada", flag: "🇨🇦" },{ code: "AU", name: "Australia", flag: "🇦🇺" },{ code: "ZA", name: "South Africa", flag: "🇿🇦" },{ code: "GH", name: "Ghana", flag: "🇬🇭" },{ code: "KE", name: "Kenya", flag: "🇰🇪" },{ code: "AE", name: "United Arab Emirates", flag: "🇦🇪" },{ code: "IN", name: "India", flag: "🇮🇳" },{ code: "OTHER", name: "Other / International", flag: "🌐" }];export default function RegisterPage() {const [username, setUsername] = useState("");const [password, setPassword] = useState("");const [confirmPassword, setConfirmPassword] = useState("");const [country, setCountry] = useState("Nigeria");const [showPassword, setShowPassword] = useState(false);const [showConfirmPassword, setShowConfirmPassword] = useState(false);const [error, setError] = useState("");20 unmodified linesconst res = await fetch(`${apiUrl}/api/auth/register`, {method: "POST",headers: { "Content-Type": "application/json" },body: JSON.stringify({ username, password, email: username, country }),});const data = await res.json();50 unmodified lines</div></div>{/* Country Selection Field */}<div className="space-y-1.5"><label className="text-[13px] font-medium text-white/70 ml-1">Country / Region</label><div className="relative group/input"><div className="absolute left-4 top-1/2 -translate-y-1/2 text-white/30 pointer-events-none"><Globe size={18} /></div><selectvalue={country}onChange={(e) => setCountry(e.target.value)}className="w-full bg-[#1c2231] border border-transparent rounded-[10px] pl-12 pr-4 py-3 text-white focus:outline-none transition-all text-sm cursor-pointer appearance-none">{COUNTRIES.map((c) => (<option key={c.name} value={c.name} className="bg-[#1c2231] text-white">{c.flag} {c.name}</option>))}</select><div className="absolute right-4 top-1/2 -translate-y-1/2 text-white/30 pointer-events-none text-xs">▼</div></div></div><div className="grid grid-cols-1 md:grid-cols-2 gap-4"><div className="space-y-2"><label className="text-[13px] font-medium text-white/70 ml-1">
12345676 unmodified lines141516171819202122234 unmodified lines28293031323334353637383940414243444546474849505152535455565758596061624 unmodified lines6768697071727374757677785 unmodified lines848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271288 unmodified lines1371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102114 unmodified lines2162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512525 unmodified lines2582592602612622632642652662672682692702712722732742752762772782792802812822831 unmodified line2852862872882892902912922931 unmodified line295296297298299300'use client';import React, { useState, useEffect } from 'react';import { apiFetch } from '@/lib/auth';import { Lock, Ticket, CreditCard, CheckCircle2, X, AlertCircle, Zap, Star, Crown } from 'lucide-react';interface MonetizationOverlayProps {children: React.ReactNode;6 unmodified linespremium: { icon: Crown, color: 'from-indigo-600 to-indigo-400', glow: 'shadow-indigo-500/20' },};const PLAN_URLS: Record<string, string> = {basic: 'https://paystack.com/buy/basic-plan-bqchpb',standard: 'https://paystack.com/buy/standard-plan-ivjtuf',premium: 'https://paystack.com/buy/premium-pgnifo'};export const MonetizationOverlay: React.FC<MonetizationOverlayProps> = ({ children, featureName }) => {4 unmodified linesconst [couponCode, setCouponCode] = useState('');const [applying, setApplying] = useState(false);const [msg, setMsg] = useState({ type: '', text: '' });const [showProofForm, setShowProofForm] = useState(false);const [appliedDiscount, setAppliedDiscount] = useState<number | null>(null);const [proof, setProof] = useState({ name: '', bank: '' });const fetchStatus = async () => {try {const [statusRes, plansRes] = await Promise.all([apiFetch('/api/monetization/status'),apiFetch('/api/monetization/plans')]);if (statusRes.ok) {const data = await statusRes.json();setStatus(data);}if (plansRes.ok) {const pData = await plansRes.json();// Filter: Only show Basic, Standard, Premiumconst filtered = pData.filter((p: any) => ['basic', 'standard', 'premium'].includes(p.key));setPlans(filtered);}} catch (e) {console.error("Failed to fetch monetization data");} finally {setLoading(false);}};useEffect(() => { fetchStatus(); }, []);const applyCoupon = async () => {if (!couponCode.trim()) return;4 unmodified linesconst data = await res.json();if (res.ok) {if (data.discount === 'free') {setMsg({ type: 'success', text: '🎉 Access Granted! Reloading...' });setTimeout(() => window.location.reload(), 2000);} else {setAppliedDiscount(data.new_price);setMsg({ type: 'success', text: data.message });setShowProofForm(true);}} else {setMsg({ type: 'error', text: data.detail || 'Invalid or expired coupon code.' });5 unmodified lines}};const handlePayNow = () => {const url = PLAN_URLS[selectedPlan];if (url) {setMsg({ type: 'success', text: 'Opening secure payment gateway...' });window.open(url, '_blank');// Give them the option to submit proof after payingsetTimeout(() => {setShowProofForm(true);setMsg({ type: '', text: '' });}, 2000);} else {setMsg({ type: 'error', text: 'Please select a valid plan.' });}};const submitProof = async () => {if (!proof.name.trim() || !proof.bank.trim()) {setMsg({ type: 'error', text: 'Please fill in your name and bank name.' });return;}setApplying(true);try {const plan = plans.find(p => p.key === selectedPlan)!;const finalAmount = appliedDiscount ?? plan.price;const proofStr = `[${plan.name}] ${proof.name} | ${proof.bank} | ₦${finalAmount.toLocaleString()}`;const res = await apiFetch('/api/monetization/submit-proof', {method: 'POST',body: JSON.stringify({ proof_details: proofStr, amount: finalAmount })});if (res.ok) {setMsg({ type: 'success', text: 'Proof submitted! Admin will verify within minutes.' });setStatus({ ...status, has_proof: true });setShowProofForm(false);} else {const err = await res.json();setMsg({ type: 'error', text: err.detail || 'Submission failed.' });}} catch {setMsg({ type: 'error', text: 'Failed to submit. Please try again.' });} finally {setApplying(false);}8 unmodified lines{isLocked && (<><div className="absolute inset-0 z-50 flex items-center justify-center p-4">{/* Backdrop - Minimalist Deep Dark */}<div className="absolute inset-0 bg-[#0a0a0c]/95 backdrop-blur-md" />{/* Centered Compact Card */}<div className="relative w-full max-w-[400px] bg-[#111115] border border-white/5 rounded-[2.5rem] p-8 shadow-2xl animate-in fade-in zoom-in-95 duration-500 overflow-hidden">{/* Header Area */}<div className="text-center mb-6"><div className="relative inline-flex mb-3"><div className="absolute inset-0 bg-indigo-500/20 blur-2xl rounded-full" /><div className="relative w-12 h-12 rounded-2xl bg-gradient-to-br from-indigo-500 to-indigo-700 flex items-center justify-center text-white shadow-lg"><Crown size={22} fill="currentColor" /></div></div><h2 className="text-xl font-black text-white tracking-tight">Unlock <span className="text-indigo-400">Mastery</span></h2><p className="text-foreground/30 text-[9px] font-bold uppercase tracking-[0.2em] mt-1.5 px-4">{featureName} is available on paid plans</p></div>{status?.has_proof ? (<div className="bg-emerald-500/5 border border-emerald-500/10 p-6 rounded-3xl text-center space-y-3"><CheckCircle2 className="mx-auto text-emerald-400" size={28} /><p className="font-bold text-xs text-emerald-400 uppercase tracking-widest">Verification Pending</p><p className="text-[10px] text-foreground/40 leading-relaxed max-w-[200px] mx-auto">Admin will unlock your account manually within a few minutes.</p></div>) : showProofForm ? (<div className="space-y-4"><div className="flex items-center justify-between px-1"><h3 className="font-black text-xs text-white/90 uppercase tracking-widest">Verify Identity</h3><button onClick={() => setShowProofForm(false)} className="text-foreground/20 hover:text-white transition-colors"><X size={16} /></button></div><p className="text-[9px] text-foreground/40 font-bold uppercase tracking-wider text-center">If you have already paid via the link, please enter your details below so we can activate your account.</p><div className="space-y-2"><inputplaceholder="Name on your Bank Account"className="w-full bg-white/5 border border-white/10 rounded-xl px-4 py-3 text-xs text-foreground outline-none focus:border-indigo-500/40 placeholder:text-foreground/20 transition-all font-bold"value={proof.name}onChange={(e) => setProof({ ...proof, name: e.target.value })}/><inputplaceholder="Bank Name (Opay, GTB, etc)"className="w-full bg-white/5 border border-white/10 rounded-xl px-4 py-3 text-xs text-foreground outline-none focus:border-indigo-500/40 placeholder:text-foreground/20 transition-all font-bold"value={proof.bank}onChange={(e) => setProof({ ...proof, bank: e.target.value })}/></div><buttononClick={submitProof}disabled={applying}className="w-full bg-indigo-500 hover:bg-indigo-400 disabled:opacity-50 text-white font-black py-3.5 rounded-xl transition-all text-xs shadow-lg shadow-indigo-500/20">{applying ? 'Processing...' : 'Submit Verification'}</button><button onClick={() => setShowProofForm(false)} className="w-full text-foreground/20 text-[9px] font-black uppercase tracking-[0.2em] hover:text-indigo-400 transition-colors py-2 text-center">Back to plans</button></div>) : (<div className="space-y-5">{/* Horizontal Plan Scroll/Tabs */}<div className="grid grid-cols-3 gap-2">{plans.map((plan) => {const meta = PLAN_METADATA[plan.key] || { icon: Star, color: 'from-gray-500 to-gray-700' };4 unmodified lineskey={plan.key}type="button"onClick={() => setSelectedPlan(plan.key)}className={`relative flex flex-col items-center p-3 rounded-2xl border transition-all duration-300${isSelected? 'bg-indigo-500/10 border-indigo-500/40 scale-[1.05] shadow-xl': 'bg-white/[0.03] border-white/5 hover:bg-white/5 opacity-60'}`}><div className={`w-8 h-8 rounded-xl bg-gradient-to-br ${meta.color} flex items-center justify-center text-white mb-2 shadow-inner`}><Icon size={14} /></div><div className="font-extrabold text-[10px] text-white/90 whitespace-nowrap">{plan.name}</div><div className="text-[9px] font-bold text-foreground/40 mt-0.5">₦{plan.price.toLocaleString()}</div></button>);})}</div>{/* Dynamic Perks - Centered and Boxed */}{(() => {const plan = plans.find(p => p.key === selectedPlan);if (!plan) return null;const perks = typeof plan.perks === 'string' ? JSON.parse(plan.perks) : plan.perks;return (<div className="bg-[#18181b] border border-white/5 rounded-2xl p-4 overflow-hidden"><div className="flex items-center gap-2 mb-2 px-1"><div className="w-1 h-3 bg-indigo-500 rounded-full" /><span className="text-[9px] font-black uppercase tracking-widest text-foreground/40">Includes</span></div><div className="space-y-2 max-h-[120px] overflow-y-auto pr-2 custom-scrollbar">{perks.map((perk: string) => (<div key={perk} className="flex items-center gap-2.5 text-[10px] font-bold text-foreground/60 leading-tight"><div className="w-1 h-1 rounded-full bg-indigo-500/50 flex-shrink-0" />{perk}</div>))}5 unmodified lines{/* Action Buttons */}<div className="space-y-3"><buttononClick={handlePayNow}type="button"className="w-full bg-indigo-500 hover:bg-indigo-600 text-white font-black py-4 rounded-2xl transition-all flex items-center justify-center gap-2.5 text-xs shadow-2xl shadow-indigo-500/20 active:scale-95"><CreditCard size={14} />Pay & Upgrade to {plans.find(p => p.key === selectedPlan)?.name}</button><div className="flex gap-2"><inputtype="text"placeholder="USE COUPON?"value={couponCode}onChange={(e) => setCouponCode(e.target.value.toUpperCase())}className="flex-1 bg-white/5 border border-white/5 rounded-xl px-4 py-2.5 text-[10px] font-black outline-none focus:border-indigo-500/20 text-white placeholder:text-foreground/15 transition-all text-center tracking-widest"/><buttononClick={applyCoupon}disabled={applying || !couponCode.trim()}className="px-4 rounded-xl bg-white/5 text-[9px] font-black uppercase text-foreground/30 hover:bg-indigo-500/20 hover:text-indigo-400 transition-all border border-white/5">Apply</button>1 unmodified line</div>{msg.text && (<div className={`mt-2 flex items-center justify-center gap-2 py-2 px-4 rounded-full text-[9px] font-bold border transition-all animate-in slide-in-from-top-1${msg.type === 'error' ? 'bg-red-500/5 text-red-400 border-red-500/10' : 'bg-emerald-500/5 text-emerald-400 border-emerald-500/10'}`}><AlertCircle size={10} />{msg.text}</div>)}1 unmodified line)}</div></div></>)}</div>12345678910116 unmodified lines181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291304 unmodified lines1351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042054 unmodified lines2102112122132142152162172182192205 unmodified lines2262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882898 unmodified lines2982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463474 unmodified lines3523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893905 unmodified lines3963973983994004014024034044054064074084094104114124134144154164174184194204214224234244251 unmodified line4274284294304314324334344351 unmodified line437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736'use client';import React, { useState, useEffect } from 'react';import { apiFetch } from '@/lib/auth';import {Lock, Ticket, CreditCard, CheckCircle2, X, AlertCircle,Zap, Star, Crown, Copy, Check, ExternalLink, ShieldCheck,Building2, Coins, ArrowRight, MessageCircle, Globe, ChevronRight} from 'lucide-react';interface MonetizationOverlayProps {children: React.ReactNode;6 unmodified linespremium: { icon: Crown, color: 'from-indigo-600 to-indigo-400', glow: 'shadow-indigo-500/20' },};// Accurate baseline exchange conversion rates from NGN (base)const EXCHANGE_RATES: Record<string, number> = {NGN: 1,USD: 1 / 1500,EUR: 1 / 1650,GBP: 1 / 1950,USDT: 1 / 1500,BTC: (1 / 1500) / 65000,SOL: (1 / 1500) / 150,};// Bank Detailsconst BANK_ACCOUNTS: Record<string, {currency: string;label: string;symbol: string;flag: string;details: { label: string; value: string }[];}> = {NGN: {currency: 'NGN',label: 'Nigerian Naira (NGN)',symbol: '₦',flag: '🇳🇬',details: [{ label: 'Bank Name', value: 'PAGA' },{ label: 'Account Name', value: 'Ademola Adeleye' },{ label: 'Account Number', value: '1391953270' }]},USD: {currency: 'USD',label: 'United States Dollar (USD)',symbol: '$',flag: '🇺🇸',details: [{ label: 'Bank Name', value: 'Lead Bank' },{ label: 'Account Name', value: 'Ademola Victor Adeleye' },{ label: 'Account Number', value: '216157536315' },{ label: 'Routing Number', value: '101019644' },{ label: 'Account Type', value: 'Personal Checking' },{ label: 'Bank Address', value: '9450 Southwest Gemini Drive, Beaverton, OR, 97008, USA' }]},GBP: {currency: 'GBP',label: 'British Pound (GBP)',symbol: '£',flag: '🇬🇧',details: [{ label: 'Bank Name', value: 'Banking Circle S.A.' },{ label: 'Account Name', value: 'Bridge Building S.A.' },{ label: 'Account Number', value: '49412630' },{ label: 'Sort Code', value: '608382' },{ label: 'Account Type', value: 'Business' },{ label: 'Bank Address', value: '2 Boulevard de la Foire, L-1528 Luxembourg' }]},EUR: {currency: 'EUR',label: 'Euro (EUR)',symbol: '€',flag: '🇪🇺',details: [{ label: 'Bank Name', value: 'Banking Circle S.A.' },{ label: 'Account Name', value: 'Ademola Victor Adeleye' },{ label: 'Account Number / IBAN', value: 'LU644080000074755809' },{ label: 'SWIFT / BIC Code', value: 'BCIRLULL' },{ label: 'Account Type', value: 'Personal' },{ label: 'Bank Address', value: '2 Boulevard de la Foire, L-1528 Luxembourg' }]}};// Crypto Detailsconst CRYPTO_WALLETS: Record<string, {key: string;name: string;symbol: string;network: string;address: string;icon: string;}> = {USDT: {key: 'USDT',name: 'Tether USDT',symbol: 'USDT',network: 'TRON (TRC20)',address: 'TCNaMTfadY1KePJ5sVrbu2evFZ9Zu5nfaQ',icon: '₮'},BTC: {key: 'BTC',name: 'Bitcoin',symbol: 'BTC',network: 'Bitcoin Native',address: '1LWf9VhzTsV1aSjd5oJJ152E4wNmkt4XFc',icon: '₿'},SOL: {key: 'SOL',name: 'Solana',symbol: 'SOL',network: 'Solana Mainnet',address: '3fMAT91KZfQAmU8FEEPEYpS1ZxKyDzqg6DtJQoQcJai9',icon: '◎'}};export const MonetizationOverlay: React.FC<MonetizationOverlayProps> = ({ children, featureName }) => {4 unmodified linesconst [couponCode, setCouponCode] = useState('');const [applying, setApplying] = useState(false);const [msg, setMsg] = useState({ type: '', text: '' });const [appliedDiscount, setAppliedDiscount] = useState<number | null>(null);// Payment Modal Statesconst [showPaymentModal, setShowPaymentModal] = useState(false);const [paymentMethod, setPaymentMethod] = useState<'bank' | 'crypto'>('bank');const [selectedCurrency, setSelectedCurrency] = useState('NGN');const [selectedCrypto, setSelectedCrypto] = useState('USDT');const [modalStep, setModalStep] = useState<'details' | 'verify'>('details');const [senderRef, setSenderRef] = useState('');const [copiedKey, setCopiedKey] = useState<string | null>(null);const [supportSettings, setSupportSettings] = useState({whatsapp_number: '2349077750956',support_email: 'support@arkitel.app',telegram_support: 'arkitel_support'});const fetchStatus = async () => {try {const [statusRes, plansRes, settingsRes] = await Promise.all([apiFetch('/api/monetization/status'),apiFetch('/api/monetization/plans'),apiFetch('/api/system/settings').catch(() => null)]);if (statusRes.ok) {const data = await statusRes.json();setStatus(data);// Auto-detect currency based on user countryconst userCountry = (data.country || '').toLowerCase();if (userCountry.includes('nigeria') || userCountry.includes('ng')) {setSelectedCurrency('NGN');} else if (userCountry.includes('united kingdom') || userCountry.includes('uk') || userCountry.includes('britain')) {setSelectedCurrency('GBP');} else if (userCountry.includes('germany') || userCountry.includes('france') || userCountry.includes('spain') || userCountry.includes('italy') || userCountry.includes('europe')) {setSelectedCurrency('EUR');} else {setSelectedCurrency('USD');}}if (plansRes.ok) {const pData = await plansRes.json();const filtered = pData.filter((p: any) => ['basic', 'standard', 'premium'].includes(p.key));setPlans(filtered);}if (settingsRes && settingsRes.ok) {const sData = await settingsRes.json();setSupportSettings(sData);}} catch (e) {console.error("Failed to fetch monetization data", e);} finally {setLoading(false);}};useEffect(() => {fetchStatus();}, []);const copyToClipboard = (text: string, key: string) => {navigator.clipboard.writeText(text);setCopiedKey(key);setTimeout(() => setCopiedKey(null), 2000);};const applyCoupon = async () => {if (!couponCode.trim()) return;4 unmodified linesconst data = await res.json();if (res.ok) {if (data.discount === 'free') {setMsg({ type: 'success', text: '🎉 Free Pass Granted! Activating...' });setTimeout(() => window.location.reload(), 2000);} else {setAppliedDiscount(data.new_price);setMsg({ type: 'success', text: data.message });}} else {setMsg({ type: 'error', text: data.detail || 'Invalid or expired coupon code.' });5 unmodified lines}};// Calculate converted priceconst getConvertedPrice = (cur: string) => {const plan = plans.find(p => p.key === selectedPlan);const baseNgn = appliedDiscount ?? (plan?.price || 3500);if (cur === 'NGN') return `₦${baseNgn.toLocaleString()}`;if (cur === 'USD') return `$${(baseNgn * EXCHANGE_RATES.USD).toFixed(2)}`;if (cur === 'EUR') return `€${(baseNgn * EXCHANGE_RATES.EUR).toFixed(2)}`;if (cur === 'GBP') return `£${(baseNgn * EXCHANGE_RATES.GBP).toFixed(2)}`;if (cur === 'USDT') return `${(baseNgn * EXCHANGE_RATES.USDT).toFixed(2)} USDT`;if (cur === 'BTC') return `${(baseNgn * EXCHANGE_RATES.BTC).toFixed(6)} BTC`;if (cur === 'SOL') return `${(baseNgn * EXCHANGE_RATES.SOL).toFixed(4)} SOL`;return `${baseNgn}`;};const handleConfirmPaymentMade = () => {setModalStep('verify');};const handleWhatsAppSubmit = async () => {setApplying(true);try {const plan = plans.find(p => p.key === selectedPlan);const planName = plan ? plan.name : selectedPlan;const cur = paymentMethod === 'bank' ? selectedCurrency : selectedCrypto;const convertedAmountStr = getConvertedPrice(cur);// 1. Submit payment request to backendawait apiFetch('/api/monetization/submit-payment', {method: 'POST',body: JSON.stringify({plan_key: selectedPlan,method: paymentMethod,currency: cur,amount: appliedDiscount ?? (plan?.price || 0),proof_details: senderRef.trim() ? `Sender/Ref: ${senderRef.trim()}` : `Manual ${paymentMethod.toUpperCase()} (${cur})`})});// 2. Open WhatsApp with prefilled verification messageconst cleanPhone = supportSettings.whatsapp_number.replace(/[^0-9]/g, '');const msgBody = `Hello ArkiTel Verification Desk,\n\nI just completed payment for the *${planName}* plan.\n\n` +`• Amount: *${convertedAmountStr}*\n` +`• Method: *${paymentMethod === 'bank' ? 'Bank Transfer' : 'Crypto'} (${cur})*\n` +`• Username: *${status?.username || 'My Account'}*\n` +`• Email: *${status?.email || 'N/A'}*\n` +(senderRef.trim() ? `• Reference/Sender: *${senderRef.trim()}*\n\n` : `\n`) +`I have attached my payment receipt screenshot below for confirmation. Please verify and activate my account!`;const waUrl = `https://wa.me/${cleanPhone}?text=${encodeURIComponent(msgBody)}`;window.open(waUrl, '_blank');// 3. Update local statussetStatus((prev: any) => ({ ...prev, has_proof: true }));setShowPaymentModal(false);setModalStep('details');} catch (e) {console.error("Submission failed", e);} finally {setApplying(false);}8 unmodified lines{isLocked && (<><div className="absolute inset-0 z-50 flex items-center justify-center p-4">{/* Backdrop */}<div className="absolute inset-0 bg-[#07080a]/95 backdrop-blur-md" />{/* Centered Main Upgrade Card */}<div className="relative w-full max-w-[420px] bg-[#0f1117] border border-white/10 rounded-[2.5rem] p-8 shadow-2xl animate-in fade-in zoom-in-95 duration-300 overflow-hidden">{/* Header Area */}<div className="text-center mb-6"><div className="relative inline-flex mb-3"><div className="absolute inset-0 bg-indigo-500/25 blur-2xl rounded-full" /><div className="relative w-12 h-12 rounded-2xl bg-gradient-to-br from-indigo-500 to-indigo-700 flex items-center justify-center text-white shadow-xl border border-indigo-400/30"><Crown size={22} fill="currentColor" /></div></div><h2 className="text-xl font-black text-white tracking-tight">Unlock <span className="text-indigo-400">Mastery</span></h2><p className="text-foreground/40 text-[10px] font-bold uppercase tracking-[0.2em] mt-1.5 px-4">{featureName} is available on paid plans</p></div>{status?.has_proof ? (<div className="bg-emerald-500/5 border border-emerald-500/20 p-6 rounded-3xl text-center space-y-3"><div className="w-12 h-12 mx-auto rounded-2xl bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center text-emerald-400"><CheckCircle2 size={26} /></div><p className="font-extrabold text-xs text-emerald-400 uppercase tracking-widest">Verification In Progress</p><p className="text-[11px] text-foreground/50 leading-relaxed max-w-[260px] mx-auto">Your payment details have been submitted. Admin will verify your screenshot and activate your plan shortly. You will also receive an email notification!</p><buttononClick={() => {setStatus((prev: any) => ({ ...prev, has_proof: false }));setShowPaymentModal(true);}}className="text-[10px] text-indigo-400 hover:text-indigo-300 font-bold underline cursor-pointer pt-2">Submit another payment proof</button></div>) : (<div className="space-y-5">{/* Plan Selector Tabs */}<div className="grid grid-cols-3 gap-2">{plans.map((plan) => {const meta = PLAN_METADATA[plan.key] || { icon: Star, color: 'from-gray-500 to-gray-700' };4 unmodified lineskey={plan.key}type="button"onClick={() => setSelectedPlan(plan.key)}className={`relative flex flex-col items-center p-3 rounded-2xl border transition-all duration-200 cursor-pointer${isSelected? 'bg-indigo-500/15 border-indigo-500/50 scale-[1.03] shadow-lg shadow-indigo-500/10': 'bg-white/[0.03] border-white/5 hover:bg-white/5 opacity-70'}`}><div className={`w-8 h-8 rounded-xl bg-gradient-to-br ${meta.color} flex items-center justify-center text-white mb-2 shadow-inner`}><Icon size={14} /></div><div className="font-black text-[11px] text-white whitespace-nowrap">{plan.name}</div><div className="text-[10px] font-extrabold text-foreground/50 mt-0.5">₦{plan.price.toLocaleString()}</div></button>);})}</div>{/* Dynamic Perks Box */}{(() => {const plan = plans.find(p => p.key === selectedPlan);if (!plan) return null;const perks = typeof plan.perks === 'string' ? JSON.parse(plan.perks) : plan.perks;return (<div className="bg-white/[0.02] border border-white/5 rounded-2xl p-4"><div className="flex items-center gap-2 mb-2 px-1"><div className="w-1 h-3 bg-indigo-500 rounded-full" /><span className="text-[9px] font-black uppercase tracking-widest text-foreground/40">Includes</span></div><div className="space-y-1.5 max-h-[110px] overflow-y-auto pr-1 custom-scrollbar">{perks.map((perk: string) => (<div key={perk} className="flex items-center gap-2 text-[11px] font-medium text-foreground/75 leading-tight"><div className="w-1.5 h-1.5 rounded-full bg-indigo-400 flex-shrink-0" />{perk}</div>))}5 unmodified lines{/* Action Buttons */}<div className="space-y-3"><buttononClick={() => {setModalStep('details');setShowPaymentModal(true);}}type="button"className="w-full bg-indigo-600 hover:bg-indigo-500 text-white font-black py-4 rounded-2xl transition-all flex items-center justify-center gap-2.5 text-xs shadow-xl shadow-indigo-600/25 active:scale-95 cursor-pointer"><CreditCard size={15} />Pay & Upgrade to {plans.find(p => p.key === selectedPlan)?.name || 'Plan'}</button>{/* Coupon Row */}<div className="flex gap-2"><inputtype="text"placeholder="DISCOUNT CODE?"value={couponCode}onChange={(e) => setCouponCode(e.target.value.toUpperCase())}className="flex-1 bg-white/5 border border-white/10 rounded-xl px-4 py-2.5 text-[10px] font-black outline-none focus:border-indigo-500/40 text-white placeholder:text-foreground/20 transition-all text-center tracking-widest uppercase"/><buttononClick={applyCoupon}disabled={applying || !couponCode.trim()}className="px-4 rounded-xl bg-white/5 text-[9px] font-black uppercase text-foreground/50 hover:bg-indigo-500/20 hover:text-indigo-400 transition-all border border-white/5 cursor-pointer disabled:opacity-40">Apply</button>1 unmodified line</div>{msg.text && (<div className={`mt-2 flex items-center justify-center gap-2 py-2 px-4 rounded-full text-[10px] font-bold border transition-all animate-in slide-in-from-top-1${msg.type === 'error' ? 'bg-red-500/10 text-red-400 border-red-500/20' : 'bg-emerald-500/10 text-emerald-400 border-emerald-500/20'}`}><AlertCircle size={12} />{msg.text}</div>)}1 unmodified line)}</div></div>{/* MODAL: Payment Instructions & Details */}{showPaymentModal && (<div className="fixed inset-0 z-[60] flex items-center justify-center p-4"><divclassName="absolute inset-0 bg-black/80 backdrop-blur-md"onClick={() => setShowPaymentModal(false)}/><div className="relative w-full max-w-[520px] bg-[#0c0d12] border border-white/10 rounded-[28px] p-6 md:p-8 shadow-2xl animate-in fade-in zoom-in-95 duration-200 overflow-hidden max-h-[92vh] flex flex-col">{/* Modal Header */}<div className="flex items-center justify-between pb-4 border-b border-white/5"><div className="flex items-center gap-3"><div className="w-10 h-10 rounded-xl bg-indigo-500/15 border border-indigo-500/30 flex items-center justify-center text-indigo-400">{paymentMethod === 'bank' ? <Building2 size={20} /> : <Coins size={20} />}</div><div><h3 className="font-black text-sm text-white tracking-tight">{modalStep === 'details' ? 'Choose Payment Channel' : 'Confirm & Send Proof'}</h3><p className="text-[10px] font-semibold text-foreground/40">{plans.find(p => p.key === selectedPlan)?.name} • {getConvertedPrice(paymentMethod === 'bank' ? selectedCurrency : selectedCrypto)}</p></div></div><buttononClick={() => setShowPaymentModal(false)}className="p-2 rounded-xl text-foreground/40 hover:text-white hover:bg-white/5 transition-colors cursor-pointer"><X size={18} /></button></div>{/* Modal Content */}<div className="overflow-y-auto custom-scrollbar flex-1 py-4 space-y-5">{modalStep === 'details' ? (<>{/* Toggle: Bank Transfer vs Crypto */}<div className="grid grid-cols-2 gap-2 p-1 bg-white/[0.03] border border-white/5 rounded-2xl"><buttontype="button"onClick={() => setPaymentMethod('bank')}className={`flex items-center justify-center gap-2 py-3 rounded-xl text-xs font-black transition-all cursor-pointer ${paymentMethod === 'bank'? 'bg-indigo-600 text-white shadow-lg shadow-indigo-600/20': 'text-foreground/50 hover:text-white hover:bg-white/5'}`}><Building2 size={16} />Bank Transfer</button><buttontype="button"onClick={() => setPaymentMethod('crypto')}className={`flex items-center justify-center gap-2 py-3 rounded-xl text-xs font-black transition-all cursor-pointer ${paymentMethod === 'crypto'? 'bg-indigo-600 text-white shadow-lg shadow-indigo-600/20': 'text-foreground/50 hover:text-white hover:bg-white/5'}`}><Coins size={16} />Crypto Payment</button></div>{/* Currency / Crypto Selection Tabs */}{paymentMethod === 'bank' ? (<div><div className="text-[10px] font-extrabold text-foreground/40 uppercase tracking-wider mb-2 flex items-center justify-between"><span>Select Currency</span><span className="text-indigo-400">Fair Rate Converted</span></div><div className="grid grid-cols-4 gap-2">{Object.entries(BANK_ACCOUNTS).map(([currKey, acc]) => {const isSel = selectedCurrency === currKey;return (<buttonkey={currKey}type="button"onClick={() => setSelectedCurrency(currKey)}className={`flex flex-col items-center py-2.5 px-2 rounded-xl border transition-all cursor-pointer ${isSel? 'bg-indigo-500/20 border-indigo-500 text-white shadow-md': 'bg-white/[0.02] border-white/5 text-foreground/50 hover:bg-white/5'}`}><span className="text-base">{acc.flag}</span><span className="text-[11px] font-black mt-1">{currKey}</span><span className="text-[9px] font-bold text-foreground/40">{getConvertedPrice(currKey)}</span></button>);})}</div></div>) : (<div><div className="text-[10px] font-extrabold text-foreground/40 uppercase tracking-wider mb-2 flex items-center justify-between"><span>Select Crypto Asset</span><span className="text-indigo-400">Direct Deposit</span></div><div className="grid grid-cols-3 gap-2">{Object.entries(CRYPTO_WALLETS).map(([cKey, cw]) => {const isSel = selectedCrypto === cKey;return (<buttonkey={cKey}type="button"onClick={() => setSelectedCrypto(cKey)}className={`flex flex-col items-center py-2.5 px-2 rounded-xl border transition-all cursor-pointer ${isSel? 'bg-indigo-500/20 border-indigo-500 text-white shadow-md': 'bg-white/[0.02] border-white/5 text-foreground/50 hover:bg-white/5'}`}><span className="text-lg font-black text-indigo-400">{cw.icon}</span><span className="text-[11px] font-black mt-0.5">{cw.symbol}</span><span className="text-[8px] font-bold text-foreground/40 truncate max-w-full">{cw.network}</span></button>);})}</div></div>)}{/* Details Card */}<div className="bg-[#12141c] border border-white/10 rounded-2xl p-4 md:p-5 space-y-3">{/* Price Badge in Selected Currency */}<div className="flex items-center justify-between pb-3 border-b border-white/5"><div><div className="text-[9px] uppercase tracking-wider font-extrabold text-foreground/40">Amount to Transfer</div><div className="text-xl font-black text-emerald-400 mt-0.5">{getConvertedPrice(paymentMethod === 'bank' ? selectedCurrency : selectedCrypto)}</div></div><div className="text-right"><span className="px-2 py-0.5 rounded-full text-[9px] font-black bg-indigo-500/10 text-indigo-400 border border-indigo-500/20 uppercase">{paymentMethod === 'bank' ? BANK_ACCOUNTS[selectedCurrency]?.label : CRYPTO_WALLETS[selectedCrypto]?.network}</span></div></div>{/* Bank Fields with individual 1-click Copy buttons */}{paymentMethod === 'bank' && (<div className="space-y-2.5 pt-1">{BANK_ACCOUNTS[selectedCurrency]?.details.map((field, idx) => (<div key={idx} className="flex items-center justify-between p-2.5 rounded-xl bg-white/[0.02] border border-white/5 hover:border-white/10 transition-colors"><div className="space-y-0.5 min-w-0 pr-2"><div className="text-[9px] uppercase tracking-wider font-bold text-foreground/40">{field.label}</div><div className="text-xs font-mono font-bold text-white truncate select-all">{field.value}</div></div><buttontype="button"onClick={() => copyToClipboard(field.value, `field-${idx}`)}className={`p-2 rounded-lg text-xs font-bold flex items-center gap-1.5 transition-all shrink-0 cursor-pointer ${copiedKey === `field-${idx}`? 'bg-emerald-500 text-black': 'bg-white/5 text-foreground/60 hover:text-white hover:bg-white/10'}`}title="Copy to clipboard">{copiedKey === `field-${idx}` ? (<><Check size={13} /><span className="text-[10px]">Copied</span></>) : (<><Copy size={13} /><span className="text-[10px]">Copy</span></>)}</button></div>))}</div>)}{/* Crypto Details with 1-click Copy */}{paymentMethod === 'crypto' && (() => {const cw = CRYPTO_WALLETS[selectedCrypto];return (<div className="space-y-3 pt-1"><div className="p-3 rounded-xl bg-indigo-500/5 border border-indigo-500/20 text-indigo-300 text-[11px] leading-relaxed">⚠️ Send only <strong>{cw.name}</strong> on the <strong>{cw.network}</strong> network. Sending on any other network will result in lost funds.</div><div className="space-y-1"><div className="text-[9px] uppercase tracking-wider font-bold text-foreground/40">Network</div><div className="text-xs font-bold text-white font-mono bg-white/[0.02] p-2.5 rounded-xl border border-white/5">{cw.network}</div></div><div className="space-y-1"><div className="text-[9px] uppercase tracking-wider font-bold text-foreground/40">Deposit Wallet Address</div><div className="flex items-center gap-2 p-2.5 rounded-xl bg-white/[0.02] border border-white/5"><div className="font-mono text-xs font-bold text-white break-all flex-1 select-all">{cw.address}</div><buttontype="button"onClick={() => copyToClipboard(cw.address, 'crypto-addr')}className={`p-2 rounded-lg text-xs font-bold flex items-center gap-1.5 transition-all shrink-0 cursor-pointer ${copiedKey === 'crypto-addr'? 'bg-emerald-500 text-black': 'bg-white/5 text-foreground/60 hover:text-white hover:bg-white/10'}`}>{copiedKey === 'crypto-addr' ? (<><Check size={13} /><span className="text-[10px]">Copied</span></>) : (<><Copy size={13} /><span className="text-[10px]">Copy</span></>)}</button></div></div></div>);})()}</div>{/* "I've made payment" CTA */}<buttontype="button"onClick={handleConfirmPaymentMade}className="w-full bg-emerald-500 hover:bg-emerald-400 text-black font-black py-4 rounded-2xl transition-all flex items-center justify-center gap-2 text-xs shadow-xl shadow-emerald-500/20 active:scale-95 cursor-pointer"><span>I've Made Payment</span><ArrowRight size={15} /></button></>) : (/* Step 2: Verification Instructions & WhatsApp Dispatch */<div className="space-y-5 animate-in fade-in duration-200"><div className="bg-emerald-500/5 border border-emerald-500/20 p-5 rounded-2xl space-y-3"><div className="flex items-center gap-2 text-emerald-400 font-extrabold text-xs uppercase tracking-wider"><ShieldCheck size={18} />Payment Verification Steps</div><ol className="text-xs text-foreground/80 space-y-2 list-decimal list-inside leading-relaxed"><li>Take a clear screenshot of your transaction confirmation or bank invoice receipt.</li><li>Click the green button below to open our WhatsApp Verification Desk.</li><li>Send your screenshot alongside your account email address.</li><li>Once verified, your plan will be activated immediately and you will receive a confirmation email!</li></ol></div><div className="space-y-1.5"><label className="text-[11px] font-bold text-foreground/70 ml-1">Your Sender Account Name or Ref / Tx Hash (Optional)</label><inputtype="text"placeholder="e.g. John Doe / Bank Reference"value={senderRef}onChange={(e) => setSenderRef(e.target.value)}className="w-full bg-white/5 border border-white/10 rounded-xl px-4 py-3 text-xs text-white placeholder:text-foreground/30 focus:outline-none focus:border-indigo-500/50 transition-all font-medium"/></div>{/* Big WhatsApp CTA */}<buttontype="button"onClick={handleWhatsAppSubmit}disabled={applying}className="w-full bg-[#25D366] hover:bg-[#20ba59] text-black font-extrabold py-4 rounded-2xl transition-all flex items-center justify-center gap-2.5 text-xs shadow-xl shadow-[#25D366]/20 active:scale-95 cursor-pointer disabled:opacity-50"><MessageCircle size={18} /><span>{applying ? 'Submitting...' : 'Send Proof on WhatsApp DM'}</span></button><buttontype="button"onClick={() => setModalStep('details')}className="w-full text-foreground/40 hover:text-foreground text-[10px] font-bold uppercase tracking-wider transition-colors py-2 text-center cursor-pointer">← Back to Account Details</button></div>)}</div></div></div>)}</>)}</div>
22 unmodified lines232425262728294 unmodified lines34353637383918 unmodified lines5859606162636465665 unmodified lines727374757677210 unmodified lines288289290291292293132 unmodified lines42642742842943043122 unmodified linesBookmark,FileText,Sparkles,Inbox} from "lucide-react";import { getToken, removeToken, apiFetch } from "@/lib/auth";import { BroadcastBanner } from "./BroadcastBanner";4 unmodified linesconst [isFooterCollapsed, setIsFooterCollapsed] = useState(false);const [footerHeight, setFooterHeight] = useState<number>(300);const [isDragging, setIsDragging] = useState(false);const pathname = usePathname();const router = useRouter();const { theme, setTheme } = useTheme();18 unmodified lines}try {const [meRes, statusRes] = await Promise.all([apiFetch('/api/auth/me'),apiFetch('/api/monetization/status')]);if (meRes.ok) {5 unmodified linessetStatus(sData);}// Admin route protectionif (isAdminRoute && data.role !== 'admin' && pathname !== '/admin/login') {router.push('/');210 unmodified lines</Link>);})}</div>{/* Draggable & Collapsible Divider Bar */}132 unmodified lines{children}</div></main></div>);}22 unmodified lines2324252627282930313233344 unmodified lines39404142434445464748495018 unmodified lines697071727374757677785 unmodified lines8485868788899091929394210 unmodified lines305306307308309310311312313314315316317318319320321322323324325326327328132 unmodified lines46146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155222 unmodified linesBookmark,FileText,Sparkles,Inbox,HelpCircle,MessageCircle,Send,Mail,ExternalLink} from "lucide-react";import { getToken, removeToken, apiFetch } from "@/lib/auth";import { BroadcastBanner } from "./BroadcastBanner";4 unmodified linesconst [isFooterCollapsed, setIsFooterCollapsed] = useState(false);const [footerHeight, setFooterHeight] = useState<number>(300);const [isDragging, setIsDragging] = useState(false);const [showSupportModal, setShowSupportModal] = useState(false);const [supportConfig, setSupportConfig] = useState({whatsapp_number: '2349077750956',support_email: 'support@arkitel.app',telegram_support: 'arkitel_support'});const pathname = usePathname();const router = useRouter();const { theme, setTheme } = useTheme();18 unmodified lines}try {const [meRes, statusRes, settingsRes] = await Promise.all([apiFetch('/api/auth/me'),apiFetch('/api/monetization/status'),apiFetch('/api/system/settings').catch(() => null)]);if (meRes.ok) {5 unmodified linessetStatus(sData);}if (settingsRes && settingsRes.ok) {const setts = await settingsRes.json();setSupportConfig(setts);}// Admin route protectionif (isAdminRoute && data.role !== 'admin' && pathname !== '/admin/login') {router.push('/');210 unmodified lines</Link>);})}{/* Support Desk Trigger */}<buttontype="button"onClick={() => {setIsMobileOpen(false);setShowSupportModal(true);}}className={`flex items-center gap-2.5 py-2.5 rounded-xl text-xs font-medium transition-all group w-full text-left cursor-pointer${isCollapsed ? "justify-center px-0" : "px-3"}text-foreground/60 hover:text-foreground hover:bg-foreground/5`}title={isCollapsed ? "Support Desk" : ""}><HelpCircle size={18} className="text-foreground/50 group-hover:text-indigo-400 transition-colors" />{!isCollapsed && <span className="animate-in fade-in duration-300 truncate">Support</span>}</button></div>{/* Draggable & Collapsible Divider Bar */}132 unmodified lines{children}</div></main>{/* Support Modal */}{showSupportModal && (<div className="fixed inset-0 z-[70] flex items-center justify-center p-4"><divclassName="absolute inset-0 bg-black/80 backdrop-blur-md"onClick={() => setShowSupportModal(false)}/><div className="relative w-full max-w-[440px] bg-[#0c0d12] border border-white/10 rounded-[28px] p-6 shadow-2xl animate-in fade-in zoom-in-95 duration-200"><div className="flex items-center justify-between pb-4 border-b border-white/5 mb-4"><div className="flex items-center gap-2.5"><div className="w-9 h-9 rounded-xl bg-indigo-500/15 border border-indigo-500/30 flex items-center justify-center text-indigo-400"><HelpCircle size={20} /></div><div><h3 className="font-black text-sm text-white">ArkiTel Support Desk</h3><p className="text-[10px] text-foreground/40 font-semibold">Choose your preferred support channel</p></div></div><buttononClick={() => setShowSupportModal(false)}className="p-1.5 rounded-lg text-foreground/40 hover:text-white hover:bg-white/5 transition-colors cursor-pointer"><X size={18} /></button></div><div className="space-y-3">{/* Email Mailto Link */}<ahref={`mailto:${supportConfig.support_email}?subject=ArkiTel%20Support%20Request%20-%20${encodeURIComponent(user?.username || '')}`}className="flex items-center justify-between p-3.5 rounded-2xl bg-white/[0.03] border border-white/5 hover:border-indigo-500/30 hover:bg-white/[0.05] transition-all group cursor-pointer"><div className="flex items-center gap-3"><div className="w-10 h-10 rounded-xl bg-blue-500/10 text-blue-400 flex items-center justify-center"><Mail size={20} /></div><div><div className="text-xs font-bold text-white group-hover:text-indigo-400 transition-colors">Email Support</div><div className="text-[10px] text-foreground/40 font-mono">{supportConfig.support_email}</div></div></div><ExternalLink size={14} className="text-foreground/30 group-hover:text-white transition-colors" /></a>{/* WhatsApp Direct Link */}<ahref={`https://wa.me/${supportConfig.whatsapp_number.replace(/[^0-9]/g, '')}?text=${encodeURIComponent(`Hello ArkiTel Support, I need assistance with my account: ${user?.username || ''}`)}`}target="_blank"rel="noopener noreferrer"className="flex items-center justify-between p-3.5 rounded-2xl bg-[#25D366]/5 border border-[#25D366]/20 hover:bg-[#25D366]/10 transition-all group cursor-pointer"><div className="flex items-center gap-3"><div className="w-10 h-10 rounded-xl bg-[#25D366]/20 text-[#25D366] flex items-center justify-center"><MessageCircle size={20} /></div><div><div className="text-xs font-bold text-white group-hover:text-[#25D366] transition-colors">WhatsApp Live DM</div><div className="text-[10px] text-foreground/40 font-mono">+{supportConfig.whatsapp_number}</div></div></div><ExternalLink size={14} className="text-foreground/30 group-hover:text-white transition-colors" /></a>{/* Telegram Support Link */}<ahref={supportConfig.telegram_support.startsWith('http') ? supportConfig.telegram_support : `https://t.me/${supportConfig.telegram_support.replace('@', '')}`}target="_blank"rel="noopener noreferrer"className="flex items-center justify-between p-3.5 rounded-2xl bg-[#229ED9]/5 border border-[#229ED9]/20 hover:bg-[#229ED9]/10 transition-all group cursor-pointer"><div className="flex items-center gap-3"><div className="w-10 h-10 rounded-xl bg-[#229ED9]/20 text-[#229ED9] flex items-center justify-center"><Send size={20} /></div><div><div className="text-xs font-bold text-white group-hover:text-[#229ED9] transition-colors">Telegram Support</div><div className="text-[10px] text-foreground/40 font-mono">@{supportConfig.telegram_support.replace('@', '')}</div></div></div><ExternalLink size={14} className="text-foreground/30 group-hover:text-white transition-colors" /></a></div></div></div>)}</div>);}
backend/database.py+41
backend/main.py+262-6
frontend/src/app/admin/page.tsx+13-4
frontend/src/app/register/page.tsx+45-2
frontend/src/components/MonetizationOverlay.tsx+550-114
frontend/src/components/Sidebar.tsx+124-3