//import * as dotenv from 'dotenv'; import LoginController from './auth/login/loginController'; import LoginModel from './auth/login/loginModel'; import LoginView from './auth/login/loginView'; import OtpController from './auth/otp/otpController'; import OtpModel from './auth/otp/otpModel'; import OtpView from './auth/otp/otpView'; import OtpRequestController from './auth/otpRequest/otpRequestController'; import OtpRequestModel from './auth/otpRequest/otpRequestModel'; import OtpRequestView from './auth/otpRequest/otpRequestView'; import PasswordResetController from './auth/passwordReset/passwordResetController'; import PasswordResetModel from './auth/passwordReset/passwordResetModel'; import PasswordResetView from './auth/passwordReset/passwordResetView'; import DashboardController from './dashboard/controller'; import DashboardModel from './dashboard/model'; import DashboardView from './dashboard/view'; import StagingSubmissionPageController from './stagingSubmission/stagingSubmissionController'; import StagingSubmissionPageModel from './stagingSubmission/stagingSubmissionModel'; import StagingSubmissionPageView from './stagingSubmission/stagingSubmissionView'; import StagingVotePageController from './stagingVote/stagingVoteController'; import StagingVotePageModel from './stagingVote/stagingVoteModel'; import StagingVotePageView from './stagingVote/stagingVoteView'; import VotingController from './voting/voteController'; import VotingModel from './voting/voteModel'; import VotingView from './voting/voteView'; import WorkbookPageController from './workbook/pageController'; import WorkbookPageModel from './workbook/pageModel'; import WorkbookPageView from './workbook/pageView'; window.Webflow = window.Webflow || []; window.Webflow.push(async () => { //dotenv.config(); const pageInfo = document.getElementById('pageInfo'); if (pageInfo) { const pageType = pageInfo?.getAttribute('pageType') as string; switch (pageType) { case 'login': const loginModel = new LoginModel(); const loginController = new LoginController(loginModel); const loginView = new LoginView(loginController); if (pageType === 'login') { loginView.init(pageType); } break; case 'otp': const otpModel = new OtpModel(); const otpView = new OtpView(); const otpController = new OtpController(otpModel, otpView); if (pageType === 'otp') { otpController.init(pageType); } break; case 'otpRequest': const otpRequestModel = new OtpRequestModel(); const otpRequestView = new OtpRequestView(); const otpRequestController = new OtpRequestController(otpRequestModel, otpRequestView); if (pageType === 'otpRequest') { otpRequestController.init(pageType); } break; case 'passwordReset': const passwordResetModel = new PasswordResetModel(); const passwordResetView = new PasswordResetView(); const passwordResetController = new PasswordResetController( passwordResetModel, passwordResetView ); if (pageType === 'passwordReset') { passwordResetController.init(pageType); } break; case 'dashboard': const dashboardModel = new DashboardModel(); const dashboardView = new DashboardView(); const dashboardController = new DashboardController(dashboardModel, dashboardView); dashboardController.init(pageType); break; case 'workbook': const model = new WorkbookPageModel(); const view = new WorkbookPageView(); const controller = new WorkbookPageController(model, view); if (pageType === 'workbook') { controller.init(pageType); view.init(pageType); } break; case 'voting': const votingModel = new VotingModel(); const votingView = new VotingView(); const votingController = new VotingController(votingModel, votingView); if (pageType === 'voting') { votingController.init(pageType); votingView.init(pageType); } break; case 'stagingVote': const stagingVotePageModel = new StagingVotePageModel(); const stagingVotePageView = new StagingVotePageView(); const stagingVotePageContorller = new StagingVotePageController( stagingVotePageModel, stagingVotePageView ); if (pageType === 'stagingVote') { stagingVotePageContorller.init(pageType); stagingVotePageView.init(pageType); } break; case 'stagingSubmission': const stagingSubmissionPageModel = new StagingSubmissionPageModel(); const stagingSubmissionPageView = new StagingSubmissionPageView(); const stagingSubmissionPageContorller = new StagingSubmissionPageController( stagingSubmissionPageModel, stagingSubmissionPageView ); if (pageType === 'stagingSubmission') { stagingSubmissionPageContorller.init(pageType); stagingSubmissionPageView.init(pageType); } break; default: // Handle unknown pageType or provide a fallback console.error(`Unknown pageType: ${pageType}`); break; } } });