{"version":3,"file":"public-BLfGTGSH.js","sources":["../../src/public.mjs"],"sourcesContent":["import header from './content/header.jsx';\r\nimport zalozky from './content/zalozky.jsx';\r\nimport footer from './content/footer.jsx';\r\n\r\nimport { initHeader } from './services/headerService.mjs';\r\nimport { initRozcestnik } from './services/rozcestnik/rozcestnikService.js';\r\nimport { initSluzby } from './services/sluzbyService.mjs';\r\nimport { initMujKatastr } from './services/mujKatastrService.mjs';\r\nimport { renderLoginComponent } from './components/Login';\r\nimport { getValidSetting, clearGovCookies } from './utils/common.mjs';\r\nimport { settings } from './config/settingsFactory.mjs';\r\nimport { initInfoBar } from './components/InfoBar/infoBarService.mjs';\r\n\r\nconst headerDiv = document.querySelector('#header');\r\nheaderDiv.appendChild(header());\r\n\r\nconst footerDiv = document.querySelector('#footer');\r\nfooterDiv.appendChild(footer());\r\n\r\ninitHeader(true);\r\n\r\nconst queryString = window.location.search;\r\nconst urlParams = new URLSearchParams(queryString);\r\nconst userData = urlParams.get('userData')?.toLowerCase() || '';\r\n\r\nconst zalozkyDiv = document.querySelector('#divZalozky');\r\nconst openServiceCodes = getValidSetting(settings.clientSettings.openServices, [], 'clientSettings.openServices')\r\n.flatMap(group => group.services.filter(service => service.openUrl).map(service => service.code));\r\nconst openLinksCodes = getValidSetting(settings.clientSettings.openLinks, [], 'clientSettings.openLinks')\r\n.map(link => link.code);\r\n\r\nif (userData === 'mujkatastr') {\r\n zalozkyDiv.appendChild(zalozky('mujKatastr', true));\r\n} else if (userData === 'sluzby') {\r\n zalozkyDiv.appendChild(zalozky('sluzby', true));\r\n} else if (userData === 'oportalu') {\r\n zalozkyDiv.appendChild(zalozky('oPortalu', true));\r\n} else if (userData === 'zivotnisituace' || !userData) {\r\n zalozkyDiv.appendChild(zalozky('zivotniSituace', true));\r\n} else {\r\n zalozkyDiv.appendChild(zalozky('zivotniSituace', true));\r\n if (openServiceCodes.includes(userData.toUpperCase()) || openLinksCodes.includes(userData.toUpperCase())) {\r\n renderLoginComponent(userData.toUpperCase(), null);\r\n } else {\r\n window.location.href = '/';\r\n }\r\n}\r\n\r\ninitMujKatastr(true);\r\ninitRozcestnik(true);\r\ninitSluzby(userData, true);\r\ninitInfoBar(true);\r\n\r\nwindow.addEventListener('load', clearGovCookies);\r\n"],"names":["headerDiv","header","footerDiv","footer","initHeader","queryString","urlParams","userData","_a","zalozkyDiv","openServiceCodes","getValidSetting","settings","group","service","openLinksCodes","link","zalozky","renderLoginComponent","initMujKatastr","initRozcestnik","initSluzby","initInfoBar","clearGovCookies"],"mappings":"8HAaA,MAAMA,EAAY,SAAS,cAAc,SAAS,EAClDA,EAAU,YAAYC,EAAM,CAAE,EAE9B,MAAMC,EAAY,SAAS,cAAc,SAAS,EAClDA,EAAU,YAAYC,EAAM,CAAE,EAE9BC,EAAW,EAAI,EAEf,MAAMC,EAAc,OAAO,SAAS,OAC9BC,EAAY,IAAI,gBAAgBD,CAAW,QACjD,MAAME,IAAWC,EAAAF,EAAU,IAAI,UAAU,IAAxB,YAAAE,EAA2B,gBAAiB,GAEvDC,EAAa,SAAS,cAAc,aAAa,EACjDC,EAAmBC,EAAgBC,EAAS,eAAe,aAAc,CAAE,EAAE,6BAA6B,EAC/G,QAAQC,GAASA,EAAM,SAAS,OAAOC,GAAWA,EAAQ,OAAO,EAAE,IAAIA,GAAWA,EAAQ,IAAI,CAAC,EAC1FC,EAAiBJ,EAAgBC,EAAS,eAAe,UAAW,CAAE,EAAE,0BAA0B,EACvG,IAAII,GAAQA,EAAK,IAAI,EAElBT,IAAa,aACbE,EAAW,YAAYQ,EAAQ,aAAc,EAAI,CAAC,EAC3CV,IAAa,SACpBE,EAAW,YAAYQ,EAAQ,SAAU,EAAI,CAAC,EACvCV,IAAa,WACpBE,EAAW,YAAYQ,EAAQ,WAAY,EAAI,CAAC,EACzCV,IAAa,kBAAoB,CAACA,EACzCE,EAAW,YAAYQ,EAAQ,iBAAkB,EAAI,CAAC,GAEtDR,EAAW,YAAYQ,EAAQ,iBAAkB,EAAI,CAAC,EAClDP,EAAiB,SAASH,EAAS,YAAa,CAAA,GAAKQ,EAAe,SAASR,EAAS,YAAW,CAAE,EACnGW,EAAqBX,EAAS,YAAa,EAAE,IAAI,EAEjD,OAAO,SAAS,KAAO,KAI/BY,EAAe,EAAI,EACnBC,EAAe,EAAI,EACnBC,EAAWd,EAAU,EAAI,EACzBe,EAAY,EAAI,EAEhB,OAAO,iBAAiB,OAAQC,CAAe"}