One course stays free forever (trial). Upgrade to access AI role-play, certifications, and the full catalog.
After payment we’ll unlock all courses in your browser automatically.
Start free. Upgrade anytime.
Prices are examples. Set your own later.
Sales Fundamentals stays free. All other courses remain locked for unpaid users.
Complete checkout. We mark your browser as paid and unlock all content immediately.
Yes. Script vaults now live in one shared folder and each vault is a separate ₹99 unlock. Right now that includes Objection Handling Scripts and Loan Scripts. The full courses remain separately priced and still include the scripts where applicable.
In this no-backend version, access is stored on the device. For cross-device access, add login + database later (Firebase/Auth).
). Requirements for your markup are listed below in section 2. ========================================================================== */ (function(){ // Minimal CSS fallback for .hidden if Tailwind isn't present very early try { if (!document.querySelector('#bns-hidden-style')) { const s = document.createElement('style'); s.id = 'bns-hidden-style'; s.textContent = '.hidden{display:none!important}'; document.head.appendChild(s); } } catch {} // Load compat SDKs if not present function loadScript(src){ return new Promise((res, rej)=>{ const s=document.createElement('script'); s.src=src; s.async=true; s.onload=res; s.onerror=rej; document.head.appendChild(s); }); } async function ensureFirebase(){ if (window.firebase?.apps?.length) return; if (!window.firebase){ await loadScript("https://www.gstatic.com/firebasejs/10.12.4/firebase-app-compat.js"); await loadScript("https://www.gstatic.com/firebasejs/10.12.4/firebase-auth-compat.js"); await loadScript("https://www.gstatic.com/firebasejs/10.12.4/firebase-firestore-compat.js"); } window.firebaseConfig = window.firebaseConfig || { apiKey: "AIzaSyBI-9skCIGmCbjcQTHwPs7ZE3EdzTiipAw", authDomain: "bechnaseekho.firebaseapp.com", projectId: "bechnaseekho", storageBucket: "bechnaseekho.firebasestorage.app", messagingSenderId: "773192695111", appId: "1:773192695111:web:0b0d2153892d1395472062" }; if (!firebase.apps.length) firebase.initializeApp(window.firebaseConfig); } // Shared state const state = { authed:false, plan:'free', name:null, first:null, email:null }; window.__BNS__ = state; // expose for other scripts // Helpers const BLOCKED_PUBLIC_NAMES = new Set(['brij', 'brijmohan', 'sam']); function sanitizePublicName(value=''){ const raw = String(value || '').trim(); if(!raw) return ''; const normalized = raw.toLowerCase().replace(/\s+/g,' '); const first = normalized.split(' ')[0] || ''; if(BLOCKED_PUBLIC_NAMES.has(normalized) || BLOCKED_PUBLIC_NAMES.has(first)) return ''; return raw; } const firstNameOf = (s='') => { const clean = sanitizePublicName(s); const p=(clean||'').trim().split(/\s+/)[0]||''; return p ? (p[0].toUpperCase()+p.slice(1)) : ''; }; function deriveDisplayName(userDoc, fbUser){ const docName = sanitizePublicName(userDoc && (userDoc.name||userDoc.fullName)); if (docName) return docName; const authName = sanitizePublicName(fbUser && fbUser.displayName); if (authName) return authName; const email = (fbUser && fbUser.email) ? fbUser.email : ''; if (email){ const base = email.split('@')[0].replace(/[._-]+/g,' ').trim(); return sanitizePublicName(base.split(' ').map(w=>w? w[0].toUpperCase()+w.slice(1) : '').join(' ')); } return ''; } function applyDom(){ // Toggle blocks document.querySelectorAll('[data-auth-show]').forEach(el=>{ const need = el.getAttribute('data-auth-show'); // "in" | "out" | "pro" let show=false; if (need==='in') show = state.authed; if (need==='out') show = !state.authed; if (need==='pro') show = (state.plan==='pro'||state.plan==='corp'); el.classList.toggle('hidden', !show); }); // Names document.querySelectorAll('[data-user-name]').forEach(el=> el.textContent = state.name || ''); document.querySelectorAll('[data-user-first]').forEach(el=> el.textContent = state.first || 'there'); // Plan pill: only fill when authed; visibility is controlled by data-auth-show="in" const planPill = document.querySelector('[data-plan-pill]'); if (planPill && state.authed){ planPill.textContent = 'Plan: ' + (state.plan==='pro' ? 'Pro' : (state.plan==='corp' ? 'Corporate' : 'Free')); } // Dashboard links document.querySelectorAll('[data-dashboard-link]').forEach(a=>{ if (state.authed){ a.classList.remove('hidden'); a.setAttribute('href','/dashboard.html'); } else { a.classList.add('hidden'); } }); // Login link “next” param const loginLink = document.querySelector('[data-login-link]'); if (loginLink){ const next = encodeURIComponent(location.pathname + location.search); loginLink.setAttribute('href', `/login.html?next=${next}`); } } function primeFromCache(){ try{ const cached = JSON.parse(localStorage.getItem('bns_name_cache') || 'null'); const cachedName = sanitizePublicName(cached && cached.name); if (!cachedName){ if (cached && cached.name) localStorage.removeItem('bns_name_cache'); return; } if (cached && (Date.now() - (cached.t||0)) < 5*60*1000){ state.name = cachedName || null; state.first = cached.first || firstNameOf(cachedName) || null; } }catch{} } function cacheName(name){ const clean = sanitizePublicName(name); try{ if (!clean){ localStorage.removeItem('bns_name_cache'); return; } localStorage.setItem('bns_name_cache', JSON.stringify({ t:Date.now(), name:clean, first:firstNameOf(clean) })); }catch{} } async function getUserDocPlan(db, uid){ try{ const snap = await db.collection('users').doc(uid).get(); if (snap.exists){ const data = snap.data()||{}; return { plan:(data.plan||'free').toLowerCase(), name:data.name||data.fullName||null }; } }catch(_e){} return { plan:'free', name:null }; } (async function boot(){ await ensureFirebase(); const auth = firebase.auth(); const db = firebase.firestore(); // pessimistic render (logged out) + quick name from cache primeFromCache(); applyDom(); auth.onAuthStateChanged(async (user)=>{ if (!user){ state.authed=false; state.plan='free'; state.name=null; state.first=null; state.email=null; applyDom(); return; } state.authed = true; state.email = user.email || null; const profile = await getUserDocPlan(db, user.uid); const dispName = deriveDisplayName({ name: profile.name }, user) || ''; state.plan = profile.plan || 'free'; state.name = dispName || null; state.first = firstNameOf(dispName); cacheName(state.name || ''); applyDom(); }); // Optional: wire logout buttons anywhere document.querySelectorAll('[data-logout-btn]').forEach(btn=>{ btn.addEventListener('click', ()=>firebase.auth().signOut()); }); })(); })();