{"roots":["1:2"],"nodeById":{"1:2":{"type":"WEBPAGE","id":"1:2","name":"/","absoluteBoundingBox":{"x":0.0,"y":0.0,"width":1408.0,"height":1244.0},"isolatedAbsoluteRenderBounds":{"x":0.0,"y":0.0,"width":1408.0,"height":1244.0},"relativeTransform":[[1.0,0.0,0.0],[0.0,1.0,0.0]],"size":{"x":1408.0,"y":1244.0},"fills":[{"opacity":0.0470588244497776,"blendMode":"NORMAL","type":"SOLID","color":{"r":1.0,"g":1.0,"b":1.0,"a":1.0},"visible":true}],"strokeAlign":"INSIDE","strokes":[],"accessibleHTMLTag":"AUTO","isDecorativeImage":false,"ariaAttributes":{},"interactions":[],"children":["1:3"]},"1:3":{"type":"FRAME","id":"1:3","name":"Desktop","absoluteBoundingBox":{"x":64.0,"y":100.0,"width":1280.0,"height":1080.0},"isolatedAbsoluteRenderBounds":{"x":64.0,"y":100.0,"width":1280.0,"height":1080.0},"relativeTransform":[[1.0,0.0,64.0],[0.0,1.0,100.0]],"size":{"x":1280.0,"y":1080.0},"fills":[{"blendMode":"NORMAL","type":"SOLID","color":{"r":1.0,"g":1.0,"b":1.0,"a":1.0},"visible":true,"opacity":1.0}],"strokeAlign":"INSIDE","strokes":[],"accessibleHTMLTag":"AUTO","isDecorativeImage":false,"ariaAttributes":{},"interactions":[],"clipsContent":true,"overflowDirection":"VERTICAL_SCROLLING","layoutMode":"VERTICAL","counterAxisSizingMode":"FIXED","isBreakpointFrame":true,"children":["1:6"]},"1:6":{"type":"CODE_INSTANCE","id":"1:6","name":"App","absoluteBoundingBox":{"x":64.0,"y":100.0,"width":1280.0,"height":1080.0},"isolatedAbsoluteRenderBounds":{"x":64.0,"y":100.0,"width":1280.0,"height":1080.0},"relativeTransform":[[1.0,0.0,0.0],[0.0,1.0,0.0]],"size":{"x":1280.0,"y":1080.0},"fills":[],"strokeAlign":"INSIDE","layoutAlign":"STRETCH","layoutGrow":1.0,"strokes":[],"accessibleHTMLTag":"AUTO","isDecorativeImage":false,"ariaAttributes":{},"interactions":[],"codeExportName":"Code1_7.default","componentProperties":{}}},"assetIdToGuid":{},"guidToUrl":{"1:2":"/"},"fonts":{},"assets":{},"stablePathToAssetInfo":{},"animateRootIds":[],"siteSettings":{"title":"M-Theory","description":"Collaborative platform for artists to create, manage, and monetize multimedia projects with transparent revenue splits and AI training options.","scalingMode":"REFLOW","blockSearchIndexing":true,"customCodeBodyEnd":"<script>\n  console.log('🔥 [1] Main script tag is ALIVE and running!');\n\n  // Load Supabase CDN\n  var s = document.createElement('script');\n  s.src = 'https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2/dist/umd/supabase.min.js';\n  \n  s.onload = function() {\n    console.log('✅ [2] Supabase CDN loaded successfully!');\n\n    // 🔥 PASTE YOUR REAL SUPABASE CREDENTIALS HERE\n    var SUPABASE_URL = 'https://avvcrsakgcohukvyiidx.supabase.co';\n    var SUPABASE_ANON_KEY = 'sb_publishable_OXW4gE6g3wy3Mkb4TQSM1Q_UyV2w4KS';\n\n    var supabaseClient = supabase.createClient(SUPABASE_URL, SUPABASE_ANON_KEY);\n\n    // ========== CRITICAL: Listen for auth changes ==========\n    // This fires when the OAuth redirect returns and sets the session\n    supabaseClient.auth.onAuthStateChange(function(event, session) {\n      console.log('🔄 Auth state changed:', event);\n      \n      if (event === 'SIGNED_IN' || event === 'TOKEN_REFRESHED') {\n        console.log('✅ LOGIN SUCCESS! Logged in as:', session.user.email);\n        \n        // ---- UPDATE YOUR UI HERE ----\n        // Try to hide the login button and show a welcome message\n        var loginBtn = document.getElementById('google-login-btn');\n        var greeting = document.getElementById('user-greeting');\n        var logoutBtn = document.getElementById('logout-btn');\n        \n        if (loginBtn) loginBtn.style.display = 'none';\n        if (logoutBtn) logoutBtn.style.display = 'inline-block';\n        if (greeting) {\n          greeting.textContent = 'Welcome, ' + session.user.email + '!';\n          greeting.style.display = 'block';\n        }\n        // -----------------------------\n\n        // Clean the URL (remove ?code or # fragments)\n        if (window.history && window.history.replaceState) {\n          window.history.replaceState({}, document.title, window.location.pathname);\n        }\n      }\n    });\n\n    // Initial check on page load\n    supabaseClient.auth.getSession().then(function(result) {\n      if (result.data.session) {\n        console.log('✅ [3] Session found on load! Logged in as:', result.data.session.user.email);\n        // Trigger the same UI update\n        var loginBtn = document.getElementById('google-login-btn');\n        var greeting = document.getElementById('user-greeting');\n        var logoutBtn = document.getElementById('logout-btn');\n        if (loginBtn) loginBtn.style.display = 'none';\n        if (logoutBtn) logoutBtn.style.display = 'inline-block';\n        if (greeting) {\n          greeting.textContent = 'Welcome, ' + result.data.session.user.email + '!';\n          greeting.style.display = 'block';\n        }\n      } else {\n        console.log('🔓 [3] No session found yet. Waiting for login...');\n      }\n    });\n\n    // Expose login/logout to your HTML buttons\n    window.login = async function() {\n      console.log('🔄 Login button clicked! Redirecting to Google...');\n      await supabaseClient.auth.signInWithOAuth({ \n        provider: 'google',\n        options: { redirectTo: window.location.origin + '/discover' }\n      });\n    };\n\n    window.logout = async function() {\n      console.log('🔄 Logging out...');\n      await supabaseClient.auth.signOut();\n      // Reload to reset the UI\n      window.location.reload();\n    };\n\n    console.log('🚀 Supabase auth is READY! Click \"Sign in with Google\" to test.');\n  };\n\n  s.onerror = function() {\n    console.error('❌ [2] Supabase CDN FAILED to load!');\n  };\n\n  document.head.appendChild(s);\n  console.log('🔥 [1] Script injection complete. Waiting for CDN...');\n</script>","labs":{"E5FBBA911B2B7A09E649D4BE6CDF8591EAEFC881":false}},"sourceCodeHash":"0fbf386df6bf6534f38ff49c9a07c369b57f563d"}