{"version":3,"sources":["utils/GetAppStudioHost.ts","constants/Config.ts","utils/GetEnvironmentType.ts","utils/MetadataUtils.ts","utils/LoadTimeUtils.ts","utils/BrowserUtils.ts","constants/Enums/EnvironmentType.ts","AppHost.tsx","index.tsx"],"names":["HostType","getAppStudioHost","getQueryValue","TEAMS","VS","VSCODE","E2E","WEB","Config","baseUrl","process","apiUrl","isProd","isLocal","authServiceBaseUri","authServiceScope","appStudioHost","environment","URL","hostname","EnvironmentType","Local","Int","Prod","getEnvironmentType","buildDate","_document$head$datase2","document","head","dataset","getBuildDate","commitHast","_document$head$datase","getCommitHash","instrumentationKey","ecsAgentName","ecsClientName","ecsHosts","ecsClientVersion","monetResourceUri","monetEndpointUri","subscriptionAPIPath","sampleMode","supportCentralBaseUrl","supportCentralAuthSource","acDesignerSampleCatalogUrl","AC_DESIGNER_SAMPLE_CATALOG_URL","ServiceToken","LoadTimeUtils","_classCallCheck","_createClass","key","value","time","this","startTime","concat","comp","performance","measure","getEntriesByName","duration","toString","e","variable","window","location","search","_step","vars","substring","split","_iterator","_createForOfIteratorHelper","s","n","done","pair","decodeURIComponent","err","f","isInternetExplorer","navigator","userAgent","indexOf","match","AppStateInit","lazy","AppHost","useEffect","teamsSDK","notifySuccess","error","console","React","createElement","Suspense","fallback","Fragment","appStart","mark","setAppStartTime","ReactDOM","render","StrictMode","getElementById"],"mappings":"+GAAA,+EAQYA,EAAQ,SAARA,GAAQ,OAARA,EAAQ,cAARA,EAAQ,QAARA,EAAQ,gBAARA,EAAQ,UAARA,EAAQ,UAARA,EAAQ,UAARA,CAAQ,MASb,SAASC,IAGd,OAFuCC,YAAc,SAGnD,KAAKF,EAASG,MACZ,OAAOH,EAASG,MAElB,KAAKH,EAASI,GACZ,OAAOJ,EAASI,GAElB,KAAKJ,EAASK,OACZ,OAAOL,EAASK,OAElB,KAAKL,EAASM,IACZ,OAAON,EAASM,IAElB,QACE,OAAON,EAASO,IAEtB,C,+HCLaC,EAAkB,CAC7BC,QAASC,s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":["/**\r\n * ---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * ---------------------------------------------------------------------------------------------\r\n */\r\n\r\nimport { getQueryValue } from \"./BrowserUtils\";\r\n\r\nexport enum HostType {\r\n  TEAMS = \"teams\",\r\n  VS = \"vs\",\r\n  VSCODE = \"vscode\",\r\n  WEB = \"web\",\r\n  PWA = \"pwa\",\r\n  E2E = \"e2e\"\r\n}\r\n\r\nexport function getAppStudioHost() {\r\n  const queryParam: string | undefined = getQueryValue(\"host\");\r\n\r\n  switch (queryParam) {\r\n    case HostType.TEAMS:\r\n      return HostType.TEAMS;\r\n\r\n    case HostType.VS:\r\n      return HostType.VS;\r\n\r\n    case HostType.VSCODE:\r\n      return HostType.VSCODE;\r\n\r\n    case HostType.E2E:\r\n      return HostType.E2E;\r\n\r\n    default:\r\n      return HostType.WEB;\r\n  }\r\n}\r\n","import { getAppStudioHost, HostType } from \"../utils/GetAppStudioHost\";\r\nimport { getEnvironmentType } from \"../utils/GetEnvironmentType\";\r\nimport { EnvironmentType } from \"./Enums/EnvironmentType\";\r\nimport { getCommitHash, getBuildDate } from \"../utils/MetadataUtils\";\r\nimport { getQueryValue } from \"../utils/BrowserUtils\";\r\n\r\nexport interface IConfig {\r\n  baseUrl: string;\r\n  apiUrl: string;\r\n  isProd: boolean;\r\n  isLocal: boolean;\r\n  authServiceBaseUri: string;\r\n  authServiceScope: string;\r\n  appStudioHost: HostType;\r\n  environment: EnvironmentType;\r\n  instrumentationKey: string;\r\n  ecsAgentName: string;\r\n  ecsClientName: string;\r\n  ecsHosts: string[];\r\n  ecsClientVersion: string;\r\n  monetResourceUri: string;\r\n  monetEndpointUri: string;\r\n  subscriptionAPIPath: string;\r\n  buildDate: string;\r\n  commitHast: string;\r\n  sampleMode: boolean;\r\n  supportCentralBaseUrl: string;\r\n  supportCentralAuthSource: string;\r\n  acDesignerSampleCatalogUrl: string;\r\n}\r\n\r\nexport const Config: IConfig = {\r\n  baseUrl: process.env.REACT_APP_API_TOKEN_SOURCE || \"https://dev.teams.microsoft.com\",\r\n  apiUrl: process.env.REACT_APP_API_HOST || \"https://dev.teams.microsoft.com/api\",\r\n  isProd: process.env.REACT_APP_API_TOKEN_SOURCE === \"https://dev.teams.microsoft.com\",\r\n  isLocal: process.env.REACT_APP_ENV === \"localhost\",\r\n  authServiceBaseUri: process.env.REACT_APP_AUTH_SVC_APP_API_ENDPOINT || \"https://teams.microsoft.com/api/authsvc\",\r\n  authServiceScope: process.env.REACT_APP_AUTH_SVC_APP_API_TOKEN_SOURCE || \"https://api.spaces.skype.com\",\r\n  appStudioHost: getAppStudioHost(),\r\n  environment: getEnvironmentType(),\r\n  buildDate: getBuildDate(),\r\n  commitHast: getCommitHash(),\r\n  instrumentationKey: \"79e3a208c99846bb928947c2d9605feb-74353774-1476-4bb2-81f0-80180cb15fb1-7142\",\r\n  ecsAgentName: \"TeamsDevCenter\",\r\n  ecsClientName: \"MicrosoftTeams\",\r\n  ecsHosts: [\"https://config.teams.microsoft.com\"],\r\n  ecsClientVersion: \"1.0.0.0\",\r\n  monetResourceUri: \"https://teamsappmonet.prod.teams.microsoft.com\",\r\n  monetEndpointUri: \"https://monet.teams.microsoft.com\",\r\n  subscriptionAPIPath: \"api/v1.0/Offers\",\r\n  sampleMode: !!getQueryValue(\"sampleMode\"),\r\n  supportCentralBaseUrl: process.env.REACT_APP_M365_ADMIN_PORTAL_BASE_URL || \"https://portal.office.com\",\r\n  supportCentralAuthSource: process.env.REACT_APP_M365_ADMIN_PORTAL_AUTH_SOURCE || \"https://portal.office.com\",\r\n  acDesignerSampleCatalogUrl: process.env.AC_DESIGNER_SAMPLE_CATALOG_URL || \"https://res-1.cdn.office.net/assets/adaptive-cards/samples/catalog.json\"\r\n};\r\n\r\nexport enum ServiceToken {\r\n  AppStudio = 0,\r\n  AuthSvc = 1,\r\n  Monet = 2,\r\n  SupportCentral = 3\r\n}\r\n","import { EnvironmentType } from \"../constants/Enums/EnvironmentType\";\r\nexport const getEnvironmentType = () => {\r\n  const url = process.env.REACT_APP_LOGIN_REDIRECT;\r\n  var hostname = new URL(url!).hostname;\r\n  switch (hostname) {\r\n    case \"localhost\":\r\n      return EnvironmentType.Local;\r\n    case \"dev-int.teams.microsoft.com\":\r\n      return EnvironmentType.Int;\r\n    default:\r\n      return EnvironmentType.Prod;\r\n  }\r\n};\r\n","/**\r\n * ---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * ---------------------------------------------------------------------------------------------\r\n */\r\n\r\nexport const getCommitHash = () => {\r\n  return document.head.dataset[\"commitHash\"] ?? \"\";\r\n};\r\n\r\nexport const getBuildDate = () => {\r\n  return document.head.dataset[\"buildDate\"] ?? \"\";\r\n};\r\n","export abstract class LoadTimeUtils {\r\n  private static startTime: number | null = null;\r\n\r\n  public static setAppStartTime(time: number | null): void {\r\n    time && (this.startTime = time);\r\n  }\r\n\r\n  public static getAppContentDownloadLog(): string {\r\n    return `App content download time: ${this.startTime}ms`;\r\n  }\r\n\r\n  public static getComponentLoadTimeLog(comp: string): string {\r\n    try {\r\n      performance.measure(comp.concat(\"measure\"), \"AppStart\", comp);\r\n      return `${comp}, loadtime ${performance.getEntriesByName(comp.concat(\"measure\"))[0].duration.toString()}ms`;\r\n    } catch (e) {\r\n      return `Error Logging : ${comp} }`;\r\n    }\r\n  }\r\n}\r\n","/**\r\n * ---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * ---------------------------------------------------------------------------------------------\r\n */\r\n\r\nexport function getQueryValue(variable: string): string | undefined {\r\n  if (window.location.search) {\r\n    const query: string = window.location.search.substring(1);\r\n    const vars: string[] = query.split(\"&\");\r\n    for (const varPairs of vars) {\r\n      const pair: string[] = varPairs.split(\"=\");\r\n      if (decodeURIComponent(pair[0]) === variable) {\r\n        return decodeURIComponent(pair[1]);\r\n      }\r\n    }\r\n  }\r\n\r\n  return undefined;\r\n}\r\n\r\nexport function isInternetExplorer() {\r\n  const ua = window.navigator.userAgent;\r\n  const msie = ua.indexOf('MSIE ');\r\n\r\n  return (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./));\r\n}\r\n","export enum EnvironmentType {\r\n  Local,\r\n  Int,\r\n  Prod\r\n}\r\n","import React, { Suspense, lazy, useEffect } from \"react\";\r\nimport { HostType } from \"./utils/GetAppStudioHost\";\r\nimport * as teamsSDK from \"@microsoft/teams-js\";\r\nimport { Config } from \"./constants/Config\";\r\nconst AppStateInit = lazy(() => import(\"./AppStateInit\"));\r\n\r\n// This Component Checks for The host and doesnt render app if Teams SDK is not initialized\r\nexport const AppHost: React.FC = () => {\r\n  /* initialize the SDK once and send the success notification */\r\n  useEffect(() => {\r\n    try {\r\n      if (Config.appStudioHost === HostType.TEAMS) {\r\n        teamsSDK.initialize(() => {\r\n          teamsSDK.appInitialization.notifySuccess();\r\n        });\r\n      }\r\n    } catch (error) {\r\n      console.error(\"Error occurred during Teams SDK initialization:\", error);\r\n    }\r\n  }, []);\r\n\r\n  // Add loading shimmer to FallBack\r\n  return <Suspense fallback={<></>}>{<AppStateInit />}</Suspense>;\r\n};\r\n","/**\r\n * ---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * ---------------------------------------------------------------------------------------------\r\n */\r\n\r\nimport React from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\n// import * as serviceWorker from \"./serviceWorker\";\r\nimport { AppHost } from \"./AppHost\";\r\nimport { LoadTimeUtils } from \"./utils/LoadTimeUtils\";\r\nconst appStart = performance.mark(\"AppStart\");\r\nLoadTimeUtils.setAppStartTime(appStart.startTime);\r\n\r\nReactDOM.render(\r\n  <React.StrictMode>\r\n    <AppHost />\r\n  </React.StrictMode>,\r\n  document.getElementById(\"root\")\r\n);\r\n\r\n// We dont use service workers, hence commenting this out\r\n// serviceWorker.unregister();\r\n"],"sourceRoot":""}