{"version":3,"sources":["registerServiceWorker.js","index.js","store/GlobalFeaturesStore.tsx"],"names":["Boolean","window","location","hostname","match","navigator","serviceWorker","ready","then","registration","unregister","queryClient","QueryClient","useGlobalFeaturesStore","getState","getGlobalFeatureFlags","ConfigureStore","default","App","history","initialState","store","persistor","baseUrl","document","getElementsByTagName","getAttribute","createBrowserHistory","basename","initialReduxState","rootElment","getElementById","ReactDOM","render","loading","client","create","set","globalFeatures","a","Axios","get","request","data","console","error"],"mappings":"gRAUoBA,QACa,cAA7BC,OAAOC,SAASC,UAEa,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACrB,2D,6BAsFA,kBAAmBC,WACnBA,UAAUC,cAAcC,MAAMC,MAAK,SAAAC,GAC/BA,EAAaC,gBCzFzB,IAAMC,EAAc,IAAIC,cAGVC,IAAuBC,WAC/BC,wBACHP,MAAK,WAEJ,mEAAiCA,MAAK,YAAkC,IAAtBQ,EAAqB,EAA9BC,QACvC,mEAAgBT,MAAK,YAAuB,IAAXU,EAAU,EAAnBD,QACtB,EAA6BD,EAAeG,EAASC,GAA7CC,EAAR,EAAQA,MAAOC,EAAf,EAAeA,UACTC,EAAUC,SAASC,qBAAqB,QAAQ,GAAGC,aAAa,QAChEP,EAAUQ,YAAqB,CAAEC,SAAUL,IAC3CH,EAAenB,OAAO4B,kBACtBC,EAAaN,SAASO,eAAe,QAE3CC,IAASC,OACP,kBAAC,IAAD,CAAUZ,MAAOA,GACf,kBAAC,IAAD,CAAiBF,QAASA,GACxB,kBAAC,IAAD,CAAae,QAAS,KAAMZ,UAAWA,GACrC,kBAAC,sBAAD,CAAqBa,OAAQxB,GAC3B,kBAACO,EAAD,UAKRY,a,iIC5BGjB,EAAyBuB,KAA2B,SAACC,GAAD,MAAU,CACzEC,eAAgB,KAChBvB,sBAAsB,WAAD,4BAAE,4BAAAwB,EAAA,+EAEGC,IAAMC,IAAwB,+BAFjC,OAEbC,EAFa,OAGnBL,EAAI,CAAEC,eAAgBI,EAAQC,OAHX,gDAKnBC,QAAQC,MAAM,uCAAd,MALmB,yDAAF,kDAAC,S","file":"static/js/main.75b9cfe3.chunk.js","sourcesContent":["// In production, we register a service worker to serve assets from local cache.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on the \"N+1\" visit to a page, since previously\n// cached resources are updated in the background.\n\n// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.\n// This link also includes instructions on opting out of this behavior.\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport default function register() {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Lets check if a service worker still exists or not.\n checkValidServiceWorker(swUrl);\n } else {\n // Is not local host. Just register service worker\n registerValidSW(swUrl);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the old content will have been purged and\n // the fresh content will have been added to the cache.\n // It's the perfect time to display a \"New content is\n // available; please refresh.\" message in your web app.\n console.log('New content is available; please refresh.');\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n if (\n response.status === 404 ||\n response.headers.get('content-type').indexOf('javascript') === -1\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import \"react-app-polyfill/ie11\";\nimport \"semantic-ui-css/semantic.min.css\";\nimport \"./index.css\";\nimport ReactDOM from \"react-dom\";\nimport React, { useEffect, useState } from \"react\";\nimport { Provider } from \"react-redux\";\nimport { ConnectedRouter } from \"react-router-redux\";\nimport { createBrowserHistory } from \"history\";\nimport { unregister } from \"./registerServiceWorker\";\nimport { PersistGate } from 'redux-persist/integration/react'\nimport { QueryClient, QueryClientProvider } from 'react-query'\nimport { useGlobalFeaturesStore } from \"store/GlobalFeaturesStore\";\n\nunregister();\n\nconst queryClient = new QueryClient();\n\n// get global feature flag\nconst store = useGlobalFeaturesStore.getState();\nstore.getGlobalFeatureFlags()\n .then(() => {\n //Dynamically import App and Configure to prevent load of UserManager before GlobalFeature flag is fetched\n import(\"./store/configureStore\").then(({ default: ConfigureStore }) => {\n import(\"./App\").then(({ default: App }) => {\n const { store, persistor } = ConfigureStore(history, initialState);\n const baseUrl = document.getElementsByTagName(\"base\")[0].getAttribute(\"href\");\n const history = createBrowserHistory({ basename: baseUrl });\n const initialState = window.initialReduxState;\n const rootElment = document.getElementById(\"root\");\n\n ReactDOM.render(\n \n \n \n \n \n \n \n \n ,\n rootElment\n )\n })\n })\n })\n","import create from \"zustand\";\nimport Axios from \"axios\";\nconst sessionGlobalFeatureFlagKey = \"_session_global_flag_key\";\n\nexport type GlobalFeatureFlags = {\n feMfaLogin: boolean;\n};\n\ninterface GlobalFeatureState {\n globalFeatures: GlobalFeatureFlags | null;\n getGlobalFeatureFlags: () => Promise;\n}\nexport const useGlobalFeaturesStore = create((set) => ({\n globalFeatures: null,\n getGlobalFeatureFlags: async () => {\n try {\n const request = await Axios.get(\"/api/system/global-features\");\n set({ globalFeatures: request.data });\n } catch (error) {\n console.error(\"Error fetching global feature flags:\", error);\n }\n },\n}));\n"],"sourceRoot":""}