window.Redirect = class { static routes = { "preLoginUser": "/do/preLoginUser", "doCreateCompany": "/do/doCreateCompany", "companysTable": "/companysTable", "doSaveProfile": "/do/doSaveProfile", "doRemoveUser": "/do/doRemoveUser", "usersEditTable": "/get/usersEditTable", "calculationResultsByCompanyAndItem": "/calculation_results/${type}/${item_name}", "doUnserialize": "/do/unserialize", "consoleAuthorization": "consoleAuthorization", "cliLogin": "cliLogin", "doLogin": "/do/login", "logout": "/do/logout", "login": "/door", "404": "/404", "routes": "/routes.js" }; static route(name, parameters = {}) { if (!this.routes[name]) { console.error(`Route "${name}" not found.`); return null; } let path = this.routes[name]; for (const [key, value] of Object.entries(parameters)) { path = path.replace(new RegExp(`\\$\\{${key}\\}`, "g"), value); } return path; } };