import app from '../app.js'; import './login-view.js'; import './file-list.js'; import './file-upload-view.js'; import './share-modal.js'; import './photo-gallery.js'; import './file-preview.js'; import './deleted-files.js'; import './admin-dashboard.js'; import './toast-notification.js'; import './starred-items.js'; import './recent-files.js'; import './shared-items.js'; import './billing-dashboard.js'; import './admin-billing.js'; import './code-editor-view.js'; import { shortcuts } from '../shortcuts.js'; const api = app.getAPI(); const logger = app.getLogger(); const appState = app.getState(); export class RBoxApp extends HTMLElement { constructor() { super(); this.currentView = 'files'; this.user = null; this.navigationStack = []; this.boundHandlePopState = this.handlePopState.bind(this); this.popstateAttached = false; this.currentSearchId = 0; } async connectedCallback() { try { await this.init(); this.addEventListener('show-toast', this.handleShowToast); if (!this.popstateAttached) { window.addEventListener('popstate', this.boundHandlePopState); this.popstateAttached = true; logger.debug('Popstate listener attached'); } } catch (error) { logger.error('Failed to initialize RBoxApp', error); this.innerHTML = `
${error.message}