{"version":3,"sources":["Provider/msalAuthProvider.ts","Provider/context.ts","App.tsx","serviceWorker.ts","index.tsx"],"names":["msalAuthProvider","MsalAuthProvider","auth","authority","process","clientId","postLogoutRedirectUri","cache","storeAuthStateInCookie","scopes","loginType","LoginType","Redirect","context","createContext","accountInfo","App","useState","url","setUrl","fetchData","useCallback","a","async","getAccessToken","token","fetch","method","headers","Headers","accessToken","then","body","text","data","useEffect","provider","forceLogin","login","logout","authenticationState","AuthenticationState","Unauthenticated","className","onClick","InProgress","Authenticated","Provider","value","id","href","target","rel","title","src","alt","account","name","userName","toLowerCase","type","color","height","width","Boolean","window","location","hostname","match","ReactDOM","render","document","getElementById","navigator","serviceWorker","ready","registration","unregister"],"mappings":"uTAEaA,EAAmB,IAAIC,mBAAiB,CACpDC,KAAM,CACLC,UAAU,qCAAD,OAAuCC,uCAAvC,KACTC,SAAS,GAAD,OAAKD,wCACbE,sBAAuB,8BAExBC,MAAO,CACNC,wBAAwB,IAEvB,CACFC,OAAQ,CAAC,SAAD,OACEL,uCADF,yBAGN,CACFM,UAAWC,YAAUC,WCZTC,EAAUC,wBAAc,CACpCd,mBACAe,YAAa,K,yBC+ECC,EA7EO,WAAO,IAAD,EACJC,mBAAS,IADL,mBACnBC,EADmB,KACdC,EADc,KAOpBC,EAAYC,uBAAY,0BAAAC,EAAAC,OAAA,kEAAAD,EAAA,MACRtB,EAAiBwB,kBADT,OACtBC,EADsB,OAG5BC,MAAM,GAAD,OAAItB,kCAAJ,0CAA+E,CAClFuB,OAAQ,MACRC,QAAS,IAAIC,QACX,CACE,cAAiB,UAAYJ,EAAMK,YACnC,eAAgB,gCAGnBC,MAAK,SAAUC,GAAQ,OAAOA,EAAKC,UACnCF,MAAK,SAAUG,GACdf,EAAOe,MAbiB,uCAe3B,IAMH,OAJAC,qBAAU,WACRf,MACC,CAACA,IAEG,kBAAC,aAAD,KACL,kBAAC,IAAD,CAASgB,SAAUpC,EAAkBqC,YAAY,IAC9C,YAAiF,IAA9EC,EAA6E,EAA7EA,MAAOC,EAAsE,EAAtEA,OAAQC,EAA8D,EAA9DA,oBAAqBzB,EAAyC,EAAzCA,YACtC,OAAQyB,GACN,KAAKC,sBAAoBC,gBACvB,OAAO,yBAAKC,UAAU,OACpB,2BACE,uDACA,4BAAQC,QAASN,GAAjB,WAGN,KAAKG,sBAAoBI,WACvB,OAAO,gDACT,KAAKJ,sBAAoBK,cACvB,GAAI/B,EACF,OAAO,kBAACF,EAAQkC,SAAT,CAAkBC,MAAO,CAAEhD,mBAAkBe,gBAClD,yBAAK4B,UAAU,OACb,yBAAKM,GAAG,SAASN,UAAU,OACzB,yBAAKM,GAAG,SAASN,UAAU,aACzB,uBAAGO,KAAK,4BAA4BD,GAAG,OAAOE,OAAO,SACnDC,IAAI,sBAAsBC,MAAM,cAChC,yBAAKC,IAAI,oFACPC,IAAI,gFAIZ,yBAAKN,GAAG,OAAON,UAAU,aACvB,uCAAY,2BAAI5B,EAAYyC,QAAQC,KAAxB,KAAgC1C,EAAYyC,QAAQE,SAASC,cAA7D,MACH,KAARzC,GAAc,oCACb,4DACA,uBAAG+B,GAAG,QACJ,uBAAGC,KAAMhC,EAAKiC,OAAO,SAASC,IAAI,uBAAuBlC,IAE3D,wGACA,6GAEO,KAARA,GAAc,oCACb,kBAAC,IAAD,CAAQ0C,KAAK,YAAYC,MAAM,UAAUC,OAAQ,GAAIC,MAAO,MAE9D,4BAAQnB,QAASL,GAAjB,mBC/DAyB,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2DCZNC,IAASC,OAAO,kBAAC,EAAD,MAASC,SAASC,eAAe,SDqI3C,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAM5C,MAAK,SAAA6C,GACjCA,EAAaC,kB","file":"static/js/main.4b074107.chunk.js","sourcesContent":["import { MsalAuthProvider, LoginType } from \"react-aad-msal\"\n\nexport const msalAuthProvider = new MsalAuthProvider({\n\tauth: {\n\t\tauthority: `https://login.microsoftonline.com/${process.env.REACT_APP_MICROSOFT_IDENTITY_AUTHORITY}/`,\n\t\tclientId: `${process.env.REACT_APP_MICROSOFT_IDENTITY_CLIENT_ID}`,\t\t\t\t\t\t\t\n\t\tpostLogoutRedirectUri: 'https://www.fh-krems.ac.at'\n\t},\n\tcache: {\t\t\t\t\t\t\n\t\tstoreAuthStateInCookie: false\n\t}\n}, {\n\tscopes: [\n\t\t`api://${process.env.REACT_APP_MICROSOFT_IDENTITY_WEB_API_CLIENT_ID}/user_impersonation`\n\t]\n}, {\n\tloginType: LoginType.Redirect\t\n})","import { createContext } from \"react\"\nimport { msalAuthProvider } from \"./msalAuthProvider\"\nimport { IAccountInfo } from \"react-aad-msal\"\n\nexport const context = createContext({\n\tmsalAuthProvider,\n\taccountInfo: {} as IAccountInfo\n})","import React, { StrictMode, useState, useEffect, useCallback } from \"react\"\nimport './App.css'\nimport AzureAD, { IAzureADFunctionProps, AuthenticationState } from \"react-aad-msal\"\nimport { msalAuthProvider } from \"./Provider/msalAuthProvider\"\nimport { context } from \"./Provider/context\"\nimport \"react-loader-spinner/dist/loader/css/react-spinner-loader.css\"\nimport Loader from \"react-loader-spinner\"\n\nconst App: React.FC = () => { \n const [url, setUrl] = useState(\"\")\n\n const generateOnlineMeetingUrl = (event: any) => {\n fetchData()\n }\n \n const fetchData = useCallback(async () => {\n const token = await msalAuthProvider.getAccessToken();\n \n fetch(`${process.env.REACT_APP_API_BASEURL}/staff/selfservice/GetOnlineMeetingUrl`, {\n method: 'get',\n headers: new Headers(\n {\n 'Authorization': 'Bearer ' + token.accessToken,\n 'Content-Type': 'text/plain; charset=utf-8'\n })\n })\n .then(function (body) { return body.text() })\n .then(function (data) { \n setUrl(data)\n })\n }, []); \n\n useEffect(() => {\n fetchData()\n }, [fetchData])\n\n return \n \n {({ login, logout, authenticationState, accountInfo }: IAzureADFunctionProps) => {\n switch (authenticationState) {\n case AuthenticationState.Unauthenticated:\n return
\n

\n Click button to login\n \n

\n
\n case AuthenticationState.InProgress:\n return

Authenticating...

\n case AuthenticationState.Authenticated:\n if (accountInfo)\n return \n
\n
\n
\n \n \"IMC\n \n
\n
\n
\n

Account: {accountInfo.account.name} ({accountInfo.account.userName.toLowerCase()})

\n {url !== \"\" && <>\n

This is your livestream link:

\n

\n {url}\n

\n

Click the url to enter your livestream. Copy and send it to someone else.

\n

Close this window and refresh the eDesktop to show the livestream link again.

\n }\n {url === \"\" && <>\n \n }\n \n
\n
\n
\n }\n }}\n
\n
\n}\n\nexport default App\n","// This optional code is used to register a service worker.\n// register() is not called by default.\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 subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\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.0/8 are 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\ntype Config = {\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\n};\n\nexport function register(config?: Config) {\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(\n process.env.PUBLIC_URL,\n window.location.href\n );\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/facebook/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. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl: string, config?: Config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\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 // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' }\n })\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.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, config);\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 from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(, document.getElementById('root'));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}