PageSourceSearch

https://www.therealmkin.xyz/_next/static/chunks/c1242cbc23077339.js

js therealmkin.xyz collected 2026-10-08 12:43:31 UTC 26,805 bytes, 98 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,86614,e=>{"use strict";var t=e.i(71645);let o={setVisible(e){console.error(a("call","setVisible"))},visible:!1};function a(e,t){return`You have tried to  ${e} "${t}" on a WalletModalContext without providing one. Make sure to render a WalletModalProvider as an ancestor of the component that uses WalletModalContext`}Object.defineProperty(o,"visible",{get:()=>(console.error(a("read","visible")),!1)});let l=(0,t.createContext)(o);function r(){return(0,t.useContext)(l)}e.s(["WalletModalContext",0,l,"useWalletModal",()=>r])},56933,1045,e=>{"use strict";var t=e.i(43476),o=e.i(71645),a=e.i(27261);let l=e=>{if(!e)return!1;try{return new a.PublicKey(e),!0}catch(e){return!1}};e.s(["detectWalletType",0,e=>e&&e.length>=32&&e.length<=44&&/^[1-9A-HJ-NP-Za-km-z]+$/.test(e)?"solana":"unknown","formatAddress",0,(e,t=6,o=4)=>e?e.length<=t+o?e:`${e.slice(0,t)}...${e.slice(-o)}`:"","isValidSolanaAddress",0,l,"isValidWalletAddress",0,e=>!!e&&l(e)],1045);var r=e.i(67762),n=e.i(86614);e.i(51718);var s=e.i(18357);e.i(36180);var i=e.i(98925),c=e.i(59141),d=e.i(18566);let u=new class{async repairUsernameMapping(e){try{console.log("🔧 Repairing username mapping for user:",e);let t=(0,i.doc)(c.db,"users",e),o=await (0,i.getDoc)(t);if(!o.exists())return console.warn("User document not found for UID:",e),!1;let a=o.data();if(a.username&&"string"==typeof a.username){let t=a.username.toLowerCase(),o=(0,i.doc)(c.db,"usernames",t),l=await (0,i.getDoc)(o);if(l.exists()&&l.data()?.uid===e)return console.log("Username mapping already correct for user:",e),!0}let l=(0,i.query)((0,i.collection)(c.db,"usernames"),(0,i.where)("uid","==",e)),r=await (0,i.getDocs)(l);if(r.empty)return console.warn("No username mapping found for user:",e),!1;let n=r.docs[0].id;return console.log("Found correct username:",n),await (0,i.updateDoc)(t,{username:n}),console.log("✅ Successfully repaired username mapping for user:",e),!0}catch(t){return console.error("Error repairing username mapping for user:",e,t),!1}}async repairWalletMapping(e,t){try{console.log("🔧 Repairing wallet mapping for user:",e,t);try{new a.PublicKey(t)}catch(e){return console.error("Invalid wallet address:",t),!1}let o=t.toLowerCase(),l=(0,i.doc)(c.db,"wallets",o),r=await (0,i.getDoc)(l);r.exists()&&r.data()?.uid===e||(await (0,i.setDoc)(l,{uid:e,walletAddress:t,createdAt:new Date}),console.log("✅ Wallet mapping repaired for user:",e));let n=(0,i.doc)(c.db,"users",e),s=await (0,i.getDoc)(n);if(s.exists()){let o=s.data();o.walletAddress&&o.walletAddress===t||(await (0,i.updateDoc)(n,{walletAddress:t}),console.log("✅ User document wallet address updated for user:",e))}return!0}catch(t){return console.error("Error repairing wallet mapping for user:",e,t),!1}}async repairAllUsers(){let e=0;try{for(let t of(console.log("🔧 Starting comprehensive data repair..."),(await (0,i.getDocs)((0,i.collection)(c.db,"users"))).docs)){let o=t.id,a=t.data();try{await this.repairUsernameMapping(o)&&e++,a.walletAddress&&await this.repairWalletMapping(o,a.walletAddress)&&e++}catch(e){console.error("Error repairing user:",o,e)}}return console.log(`✅ Data repair completed. Repaired ${e} issues.`),e}catch(e){return console.error("Error during comprehensive data repair:",e),0}}async validateUserData(e){let t=[];try{let o=(0,i.doc)(c.db,"users",e),l=await (0,i.getDoc)(o);if(!l.exists())return t.push("User document not found"),{isValid:!1,issues:t,userData:{}};let r=l.data();if(r.username){let o=String(r.username).toLowerCase(),a=(0,i.doc)(c.db,"usernames",o),l=await (0,i.getDoc)(a);l.exists()?l.data()?.uid!==e&&t.push("Username mapping UID mismatch"):t.push("Username mapping document not found")}else t.push("Missing username in user document");if(r.walletAddress){try{new a.PublicKey(String(r.walletAddress))}catch(e){t.push("Invalid wallet address format")}let o=String(r.walletAddress).toLowerCase(),l=(0,i.doc)(c.db,"wallets",o),n=await (0,i.getDoc)(l);n.exists()?n.data()?.uid!==e&&t.push("Wallet mapping UID mismatch"):t.push("Wallet mapping document not found")}return{isValid:0===t.length,issues:t,userData:r}}catch(e){return console.error("Error validating user data:",e),{isValid:!1,issues:["Validation error occurred"],userData:{}}}}};e.i(47167);let p=(...e)=>{},m=(e,t=!1)=>{let o=e?.message||"";return o.includes("User rejected")||o.includes("User denied")?{title:"⚔️ CONNECTION REJECTED",message:"The wallet guardian has denied access. Please approve the connection request to link your Solana wallet to the Realmkin realm.",showRetry:!1}:o.includes("Invalid Solana address")?{title:"🔮 INVALID WALLET",message:"Please ensure you're connecting a valid Solana wallet. This app only supports Solana addresses.",showRetry:!0}:o.includes("Connection timeout")?{title:"⏰ CONNECTION TIMEOUT",message:t?"Wallet connection timed out. This can happen when switching between browser and wallet app. Please ensure you return to the browser after approving the connection in Phantom.":"Wallet connection timed out. This can happen when the wallet app is slow to respond. Please try again.",showRetry:!0}:o.includes("Mobile connection failed")?{title:"📱 MOBILE CONNECTION ISSUE",message:"Failed to connect on mobile. Please ensure you have the Phantom app installed and try again. If the issue persists, try clearing your browser cache.",showRetry:!0}:o.includes("network")||o.includes("connection")?{title:"🌐 NETWORK ISSUE",message:"Network connection issue detected. Please check your internet connection and try again.",showRetry:!0}:o.includes("not found")||o.includes("unavailable")?{title:t?"📱 PHANTOM APP REQUIRED":"🔌 WALLET UNAVAILABLE",message:t?"Phantom app not found. Please install Phantom from the App Store or Google Play Store to connect your wallet.":"Wallet extension not detected. Please ensure your wallet is installed and enabled.",showRetry:!1,downloadUrl:t?"https://phantom.app/download":void 0}:{title:t?"📱 MOBILE CONNECTION FAILED":"🔮 CONNECTION FAILED",message:t?"Failed to connect to your Phantom wallet on mobile. This could be due to app switching issues. Please try again and ensure you return to the browser after approving the connection.":"Failed to connect to your Solana wallet. Please try again or ensure your wallet is properly installed.",showRetry:!0}},g=(0,o.createContext)({account:null,uid:null,isConnected:!1,isConnecting:!1,connectWallet:async()=>{},disconnectWallet:()=>{},refreshWalletState:async()=>{},provider:null,isAuthenticating:!1});e.s(["Web3Provider",0,({children:w})=>{let[f,h]=(0,o.useState)(null),[y,b]=(0,o.useState)(null),[v,x]=(0,o.useState)(!1),[S,k]=(0,o.useState)(!1),[P,A]=(0,o.useState)(!1),[E,C]=(0,o.useState)(null),N=(0,o.useRef)(!1),D=(0,o.useRef)(null);(0,o.useEffect)(()=>{},[]);let{publicKey:I,connected:T,connecting:W,select:O,connect:_,disconnect:U,wallet:L,wallets:M}=(0,r.useWallet)(),{setVisible:F}=(0,n.useWalletModal)(),R=(0,d.useRouter)(),K=(0,o.useCallback)(async o=>{try{try{new a.PublicKey(o)}catch(e){throw console.error("Invalid Solana wallet address:",o),Error("Invalid Solana wallet address")}let l=(0,s.getAuth)();if(l.currentUser&&l.currentUser.uid){b(l.currentUser.uid);try{await u.repairUsernameMapping(l.currentUser.uid)}catch(e){console.warn("Failed to repair user data:",e)}return}let r=`${o.toLowerCase()}@wallet.realmkin.com`;p(`🔐 Authenticating wallet: ${o}`),A(!0);let n="true"===localStorage.getItem("onboarding_active");try{let e=await (0,s.signInWithEmailAndPassword)(l,r,o);b(e.user.uid);let t=o.toLowerCase(),a=(0,i.doc)(c.db,"wallets",t);(await (0,i.getDoc)(a)).exists()||(console.log("📝 Creating missing wallet mapping..."),await (0,i.setDoc)(a,{uid:e.user.uid,walletAddress:o,createdAt:new Date}),console.log("✅ Wallet mapping created"));try{let t=(0,i.doc)(c.db,"users",e.user.uid),a=await (0,i.getDoc)(t);if(a.exists()){let t=a.data();if(!t?.username){console.warn("User profile exists but missing username");try{await u.repairUsernameMapping(e.user.uid)&&console.log("✅ Username mapping repaired during login")}catch(e){console.warn("Failed to repair username mapping:",e)}n||localStorage.setItem("realmkin_incomplete_setup","true")}}else console.log("📝 Creating missing user profile..."),await (0,i.setDoc)(t,{walletAddress:o,createdAt:new Date}),console.log("✅ User profile created")}catch(e){console.warn("⚠️ Failed to ensure user profile exists:",e)}console.log("✅ Sign-in successful")}catch(a){if("auth/user-not-found"===a.code||"auth/invalid-credential"===a.code){console.log("ℹ️ No account found. Prompting user for creation...");let a=async()=>{let t=(await e.A(93984)).default,a=t.loading("Creating profile...");try{let e=await (0,s.createUserWithEmailAndPassword)(l,r,o);b(e.user.uid);let n=o.toLowerCase(),d=(0,i.doc)(c.db,"wallets",n);await (0,i.setDoc)(d,{uid:e.user.uid,walletAddress:o,createdAt:new Date});let u=(0,i.doc)(c.db,"users",e.user.uid);await (0,i.setDoc)(u,{walletAddress:o,createdAt:new Date}),console.log("✅ New account created successfully"),t.success("Profile created!",{id:a})}catch(e){console.error("🚨 Failed to create account:",e),t.error("Failed to create profile",{id:a}),console.log("🔄 Triggering onboarding wizard at wallet connection step..."),window.__realmkin_onboarding_trigger?window.__realmkin_onboarding_trigger("wallet"):window.location.pathname.includes("/login")||n||R.push(`/login?wallet=${o}`)}},d=(await e.A(93984)).default;d(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-3 min-w-[250px]",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("p",{className:"font-bold text-[#DA9C2F]",children:"New Wallet Detected"}),(0,t.jsxs)("p",{className:"text-sm text-zinc-300",children:["No profile found for"," ",(0,t.jsxs)("span",{className:"font-mono text-xs bg-zinc-800 px-1 rounded",children:[o.slice(0,4),"...",o.slice(-4)]}),"."]}),(0,t.jsx)("p",{className:"text-sm text-zinc-300",children:"Do you want to create a new profile?"})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("button",{onClick:()=>{d.dismiss(e.id),a()},className:"flex-1 bg-[#DA9C2F] text-black py-2 rounded-md text-sm font-bold hover:bg-[#ffbf00] transition-colors",children:"Create Profile"}),(0,t.jsx)("button",{onClick:()=>{d.dismiss(e.id),Z()},className:"flex-1 bg-zinc-700 text-white py-2 rounded-md text-sm hover:bg-zinc-600 transition-colors",children:"Cancel"})]})]}),{duration:1/0,position:"top-center",style:{background:"#1a1a1a",color:"#fff",border:"1px solid rgba(218, 156, 47, 0.3)"}}),A(!1);return}console.error("🚨 Firebase sign-in error:",a)}A(!1)}catch(t){console.error("🚨 Auto-authentication process failed:",t),A(!1),Z();try{(await e.A(93984)).default.error("Authentication failed. Please try connecting again.",{id:"auth-error",duration:4e3})}catch(e){}}},[R]);(0,o.useEffect)(()=>{console.log("🔄 [Wallet Sync] State changed:",{publicKey:I?.toString(),connected:T,connecting:W,wallet:L?.adapter.name});let t=setTimeout(async()=>{try{let t=!!localStorage.getItem("realmkin_cached_wallet");if(k(!!(W&&(t||T))),I){console.log("✅ [Wallet Sync] Public key detected:",I.toString());let t=I.toBase58?.()??I.toString();try{new a.PublicKey(t)}catch(e){console.error("Invalid Solana wallet address from wallet adapter:",t),h(null),b(null),x(!1);return}if(t&&l(t)){h(e=>e===t?e:t),x(!0),localStorage.setItem("realmkin_cached_wallet",JSON.stringify({type:"adapter",address:t,timestamp:Date.now()})),console.log("🔐 Starting Firebase authentication for wallet:",t);try{(await e.A(93984)).default.loading("Authenticating wallet...",{id:"wallet-auth",duration:2e3})}catch(e){console.warn("Failed to show toast:",e)}await K(t),console.log("✅ Firebase authentication completed");try{(await e.A(93984)).default.success("Wallet connected successfully!",{id:"wallet-auth",duration:2e3})}catch(e){console.warn("Failed to show success toast:",e)}}}else!1===T&&(h(null),b(null),x(!1),A(!1))}catch(e){console.log("Wallet adapter sync error:",e)}},200);return()=>clearTimeout(t)},[I,T,W,L,K]),(0,o.useEffect)(()=>()=>{D.current&&(console.log("🧹 Cleaning up Phantom event listeners"),D.current(),D.current=null)},[]);let j=()=>N.current?(console.log("🔒 Connection attempt already in progress"),!1):(N.current=!0,setTimeout(()=>{N.current&&(console.log("🔓 Connection lock auto-released after timeout"),N.current=!1)},3e4),!0),B=()=>{N.current=!1};(0,o.useEffect)(()=>{let e=setTimeout(()=>{I||T||W?console.log("✅ Adapter already connected or connecting, skipping cache check"):(console.log("🔍 Adapter didn't auto-connect, checking cached connection..."),V())},2e3);return()=>clearTimeout(e)},[I,T,W]);let $=e=>{J();let t=e=>{if(console.log("🔍 Phantom account changed:",e),e&&"object"==typeof e&&"toString"in e){let t=e.toString();l(t)&&(h(t),x(!0),localStorage.setItem("realmkin_cached_wallet",JSON.stringify({type:"phantom",address:t,timestamp:Date.now()})))}else Z()},o=()=>{console.log("🔌 Phantom disconnected"),Z()};e.on&&(e.on("accountChanged",t),e.on("disconnect",o)),D.current=()=>{e.off&&(e.off("accountChanged",t),e.off("disconnect",o))}},J=()=>{D.current&&(D.current(),D.current=null)};async function V(){let e=Date.now();if(e-parseInt(localStorage.getItem("last_connection_check")||"0")<2e3)return void console.log("⏱️ Skipping connection check (too frequent)");if(localStorage.setItem("last_connection_check",e.toString()),!j())return void console.log("🔒 Connection check already in progress");try{window,await z()}catch(e){console.error("Error checking wallet connection:",e)}finally{B()}}(0,o.useEffect)(()=>()=>{J()},[]);let z=async()=>{let e=localStorage.getItem("realmkin_cached_wallet");if(!e)return void console.log("📭 No cached wallet found");try{let t=JSON.parse(e),o=Date.now()-t.timestamp;if(console.log("📦 Found cached wallet:",{type:t.type,age:`${Math.floor(o/1e3)}s`,address:t.address?.substring(0,8)+"..."}),o<9e5){let e=window,o=0;for(;o<2;)try{if("phantom"===t.type&&e.phantom?.solana){let t=e.phantom.solana,o=(await t.connect()).publicKey.toString();if(o&&l(o)){h(o),x(!0),C(null),$(t),localStorage.setItem("realmkin_cached_wallet",JSON.stringify({type:"phantom",address:o,timestamp:Date.now()}));return}}else if("solflare"===t.type&&e.solflare){let t=await e.solflare.connect(),o=null;if(!0===t&&e.solflare.publicKey&&(o=e.solflare.publicKey.toString()),o&&l(o)){h(o),x(!0),C(null),localStorage.setItem("realmkin_cached_wallet",JSON.stringify({type:"solflare",address:o,timestamp:Date.now()}));return}}else if("backpack"===t.type&&e.backpack){let t=(await e.backpack.connect()).publicKey.toString();if(t&&l(t)){h(t),x(!0),C(null),localStorage.setItem("realmkin_cached_wallet",JSON.stringify({type:"backpack",address:t,timestamp:Date.now()}));return}}else if("glow"===t.type&&e.glow){let t=(await e.glow.connect()).publicKey.toString();if(t&&l(t)){h(t),x(!0),C(null),localStorage.setItem("realmkin_cached_wallet",JSON.stringify({type:"glow",address:t,timestamp:Date.now()}));return}}break}catch(e){if(console.log(`Connection attempt ${o+1} failed:`,e),e?.message?.includes("User rejected")||e?.message?.includes("User denied")||e?.name==="WalletConnectionError"){console.log("🛑 User rejected connection, clearing cache and stopping retries"),localStorage.removeItem("realmkin_cached_wallet");break}if(++o>=2){console.log(`Failed to restore ${t.type} connection from cache after 2 attempts:`,e),localStorage.removeItem("realmkin_cached_wallet");break}await new Promise(e=>setTimeout(e,1e3*o))}}else localStorage.removeItem("realmkin_cached_wallet")}catch(e){console.log("Failed to restore cached wallet:",e),localStorage.removeItem("realmkin_cached_wallet")}},G=async()=>
1{if(I&&T)return void p("✅ Wallet already connected via adapter");if(!j()){p("🔒 Connection already in progress");try{(0,(await e.A(93984)).default)("Wallet connection in progress, please wait...",{duration:2e3,id:"connection-in-progress",icon:"ℹ️"})}catch(e){console.warn("Failed to show toast:",e)}return}k(!0);try{let e=window,t=window.solana;if(t?.isBraveWallet&&!t?.isPhantom&&(console.warn("⚠️ Brave Wallet detected - may interfere with Phantom"),!e.phantom?.solana)){Y("⚠️ BRAVE WALLET DETECTED","Brave Wallet is blocking other wallets. Please disable it at brave://settings/wallet and set both Ethereum and Solana default wallets to 'None', then restart your browser."),B();return}let o=!1;try{F&&(console.log("🔔 Opening Solana Wallet Adapter modal via context"),console.log("📋 Available wallets:",M?.map(e=>e.adapter.name)),console.log("🔌 Currently selected wallet:",L?.adapter.name),F(!0),o=!0,console.log("⏳ Waiting for user to select a wallet..."))}catch(e){console.warn("⚠️ Failed to open adapter modal via context:",e)}if(!o)try{console.log("🔔 Dispatching event to open adapter modal"),window.dispatchEvent(new Event("realmkin:open-wallet-modal")),o=!0,await new Promise(e=>setTimeout(e,100))}catch(e){console.warn("⚠️ Failed to open adapter modal via event:",e)}o?setTimeout(()=>{try{document.querySelector('[class*="wallet-adapter"]')||(console.log("⚠️ Adapter modal not detected in DOM; showing custom selector as fallback"),Q())}catch{console.log("Modal presence check failed; showing fallback selector"),Q()}},400):(console.log("🔁 Falling back to custom wallet selector"),Q())}finally{k(!1),B()}},H=(e,t)=>{try{switch(t){case"phantom":return e?.publicKey?.toString()||null;case"solflare":case"backpack":case"glow":return e?.publicKey||null;default:return null}}catch(e){return console.error(`Error extracting address from ${t} response:`,e),null}},q=async e=>{if(!j())return void console.log("🔒 Connection already in progress");k(!0);try{let t=null,o=window,a=0,r=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(;a<3;)try{if("phantom"===e){if(!o.phantom?.solana)if(r)return void Y("📱 PHANTOM APP REQUIRED","Phantom app not found. Please install Phantom from the App Store or Google Play Store to connect your wallet.",!1,"https://phantom.app/download");else return void Y("👻 PHANTOM NOT FOUND","Phantom wallet is not installed. Please install Phantom extension and try again.",!1,"https://phantom.app/");let e=o.phantom.solana;if(r){console.log("📱 Mobile device detected, using mobile connection flow");let o=e.connect(),a=new Promise((e,t)=>setTimeout(()=>t(Error("Connection timeout")),15e3));t=(await Promise.race([o,a])).publicKey.toString()}else{let o=e.connect(),a=new Promise((e,t)=>setTimeout(()=>t(Error("Connection timeout")),1e4));t=(await Promise.race([o,a])).publicKey.toString()}if(!t||!l(t))throw Error("Invalid Solana address received from Phantom wallet");r||$(e),(r?sessionStorage:localStorage).setItem("realmkin_cached_wallet",JSON.stringify({type:"phantom",address:t,timestamp:Date.now(),isMobile:r})),h(t),x(!0),C(null),await K(t);return}if("solflare"===e){if(!o.solflare)return void Y("🔥 SOLFLARE NOT FOUND","Solflare wallet is not installed. Please install Solflare extension and try again.",!1,"https://solflare.com/");let e=o.solflare,a=e.connect(),n=new Promise((e,t)=>setTimeout(()=>t(Error("Connection timeout")),1e4)),s=await Promise.race([a,n]);if(console.log("🔍 Solflare connection response:",s),console.log("🔍 Solflare wallet object after connection:",e),!0===s&&e.publicKey)t=e.publicKey.toString(),console.log("🔍 Solflare publicKey from wallet object:",t);else throw console.error("❌ Solflare connection failed or publicKey not available"),Error("Solflare connection failed or publicKey not available");if(!t||!l(t))throw console.error("❌ Invalid Solana address from Solflare:",t),Error("Invalid Solana address received from Solflare wallet");localStorage.setItem("realmkin_cached_wallet",JSON.stringify({type:"solflare",address:t,timestamp:Date.now(),isMobile:r})),h(t),x(!0),C(null),await K(t);return}if("backpack"===e){if(!o.backpack)return void Y("🎒 BACKPACK NOT FOUND","Backpack wallet is not installed. Please install Backpack extension and try again.",!1,"https://backpack.app/");let e=o.backpack.connect(),a=new Promise((e,t)=>
1setTimeout(()=>t(Error("Connection timeout")),1e4)),r=await Promise.race([e,a]);if(!(t=H(r,"backpack"))||!l(t))throw Error("Invalid Solana address received from Backpack wallet");localStorage.setItem("realmkin_cached_wallet",JSON.stringify({type:"backpack",address:t,timestamp:Date.now()})),h(t),x(!0),C(null),await K(t);return}else{if("glow"!==e)return void Y("🔮 UNSUPPORTED WALLET","This wallet type is not supported. Please use Phantom, Solflare, Backpack, or Glow.");if(!o.glow)return void Y("✨ GLOW NOT FOUND","Glow wallet is not installed. Please install Glow extension and try again.",!1,"https://glow.app/");let a=o.glow.connect(),r=new Promise((e,t)=>setTimeout(()=>t(Error("Connection timeout")),1e4)),n=await Promise.race([a,r]);if(!(t=H(n,"glow"))||!l(t))throw Error("Invalid Solana address received from Glow wallet");localStorage.setItem("realmkin_cached_wallet",JSON.stringify({type:"glow",address:t,timestamp:Date.now()})),h(t),x(!0),C(null),await K(t);return}}catch(e){if(++a>=3){console.error("Error connecting wallet after 3 attempts:",e);let{title:t,message:o,showRetry:a}=m(e);Y(t,o,a);break}await new Promise(e=>setTimeout(e,1e3*a))}}finally{k(!1),B()}},Q=()=>{let e=document.createElement("div");e.className="fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50",e.innerHTML=`
2      <div class="bg-gradient-to-br from-purple-900 to-purple-800 border-2 border-yellow-400 rounded-lg p-6 max-w-lg mx-4 shadow-2xl">
3        <div class="text-center mb-6">
4          <h3 class="text-yellow-400 text-2xl font-bold mb-2">🔮 CONNECT SOLANA WALLET</h3>
5          <p class="text-white text-sm">Choose your preferred Solana wallet to enter the Realmkin realm</p>
6        </div>
7
8        <div class="grid grid-cols-2 gap-4 mb-6">
9          <!-- Phantom -->
10          <button
11            onclick="window.connectWallet('phantom'); this.closest('.fixed').remove();"
12            class="bg-gradient-to-br from-purple-600 to-purple-700 hover:from-purple-500 hover:to-purple-600 border-2 border-yellow-400 text-white font-bold py-4 px-4 rounded-lg transition-all duration-300 transform hover:scale-105"
13          >
14            <div class="flex flex-col items-center space-y-2">
15              <div class="text-3xl">👻</div>
16              <span class="text-sm">Phantom</span>
17            </div>
18          </button>
19
20          <!-- Solflare -->
21          <button
22            onclick="window.connectWallet('solflare'); this.closest('.fixed').remove();"
23            class="bg-gradient-to-br from-orange-600 to-orange-700 hover:from-orange-500 hover:to-orange-600 border-2 border-yellow-400 text-white font-bold py-4 px-4 rounded-lg transition-all duration-300 transform hover:scale-105"
24          >
25            <div class="flex flex-col items-center space-y-2">
26              <div class="text-3xl">🔥</div>
27              <span class="text-sm">Solflare</span>
28            </div>
29          </button>
30
31          <!-- Backpack -->
32          <button
33            onclick="window.connectWallet('backpack'); this.closest('.fixed').remove();"
34            class="bg-gradient-to-br from-blue-600 to-blue-700 hover:from-blue-500 hover:to-blue-600 border-2 border-yellow-400 text-white font-bold py-4 px-4 rounded-lg transition-all duration-300 transform hover:scale-105"
35          >
36            <div class="flex flex-col items-center space-y-2">
37              <div class="text-3xl">🎒</div>
38              <span class="text-sm">Backpack</span>
39            </div>
40          </button>
41
42          <!-- Glow -->
43          <button
44            onclick="window.connectWallet('glow'); this.closest('.fixed').remove();"
45            class="bg-gradient-to-br from-green-600 to-green-700 hover:from-green-500 hover:to-green-600 border-2 border-yellow-400 text-white font-bold py-4 px-4 rounded-lg transition-all duration-300 transform hover:scale-105"
46          >
47            <div class="flex flex-col items-center space-y-2">
48              <div class="text-3xl">✨</div>
49              <span class="text-sm">Glow</span>
50            </div>
51          </button>
52        </div>
53
54        <div class="text-center">
55          <button
56            onclick="this.closest('.fixed').remove()"
57            class="bg-gray-600 hover:bg-gray-500 text-white font-bold py-2 px-6 rounded transition-colors"
58            style="clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%)"
59          >
60            CANCEL
61          </button>
62        </div>
63      </div>
64    `,document.body.appendChild(e),window.connectWallet=e=>{q(e)}},Y=(e,t,o=!1,a)=>
64{let l=document.createElement("div");l.className="fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50";let r=o?`
65      <button
66        onclick="this.closest('.fixed').remove(); window.retryWalletConnection();"
67        class="bg-blue-600 hover:bg-blue-500 text-white font-bold py-2 px-4 rounded transition-colors mr-2"
68        style="clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%)"
69      >
70        RETRY
71      </button>
72    `:"",n=a?`
73      <button
74        onclick="window.open('${a}', '_blank'); this.closest('.fixed').remove();"
75        class="bg-green-600 hover:bg-green-500 text-white font-bold py-2 px-4 rounded transition-colors mr-2"
76        style="clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%)"
77      >
78        INSTALL
79      </button>
80    `:"";l.innerHTML=`
81      <div class="bg-gradient-to-br from-purple-900 to-purple-800 border-2 border-yellow-400 rounded-lg p-6 max-w-md mx-4 shadow-2xl">
82        <div class="text-center">
83          <h3 class="text-yellow-400 text-xl font-bold mb-3">${e}</h3>
84          <p class="text-white text-sm leading-relaxed mb-4 whitespace-pre-line">${t}</p>
85          <div class="flex justify-center">
86            ${n}
87            ${r}
88            <button
89              onclick="this.closest('.fixed').remove()"
90              class="bg-yellow-400 hover:bg-yellow-300 text-black font-bold py-2 px-6 rounded transition-colors"
91              style="clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%)"
92            >
93              UNDERSTOOD
94            </button>
95          </div>
96        </div>
97      </div>
98    `,document.body.appendChild(l),o&&(window.retryWalletConnection=G)},Z=()=>{h(null),x(!1),C(null),localStorage.removeItem("realmkin_cached_wallet");try{U&&U()}catch(e){console.log("Adapter disconnect error:",e)}},X=async()=>{await V()};return(0,t.jsx)(g.Provider,{value:{account:f,uid:y,isConnected:v,isConnecting:S,isAuthenticating:P,connectWallet:G,disconnectWallet:Z,refreshWalletState:X,provider:E},children:w})},"useWeb3",0,()=>(0,o.useContext)(g)],56933)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.