@microsoft/teams-js 2.17.0-beta.2 → 2.17.1-beta.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -871,7 +871,7 @@ __webpack_require__.d(__webpack_exports__, {
871
871
  registerFocusEnterHandler: () => (/* reexport */ registerFocusEnterHandler),
872
872
  registerFullScreenHandler: () => (/* reexport */ registerFullScreenHandler),
873
873
  registerOnLoadHandler: () => (/* reexport */ registerOnLoadHandler),
874
- registerOnThemeChangeHandler: () => (/* reexport */ registerOnThemeChangeHandler),
874
+ registerOnThemeChangeHandler: () => (/* reexport */ publicAPIs_registerOnThemeChangeHandler),
875
875
  registerUserSettingsChangeHandler: () => (/* reexport */ registerUserSettingsChangeHandler),
876
876
  remoteCamera: () => (/* reexport */ remoteCamera),
877
877
  returnFocus: () => (/* reexport */ returnFocus),
@@ -895,6 +895,140 @@ __webpack_require__.d(__webpack_exports__, {
895
895
  webStorage: () => (/* reexport */ webStorage)
896
896
  });
897
897
 
898
+ // EXTERNAL MODULE: ../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js
899
+ var browser = __webpack_require__(302);
900
+ ;// CONCATENATED MODULE: ./src/internal/telemetry.ts
901
+
902
+ var topLevelLogger = (0,browser.debug)('teamsJs');
903
+ /**
904
+ * @internal
905
+ * Limited to Microsoft-internal use
906
+ *
907
+ * Returns a logger for a given namespace, within the pre-defined top-level teamsJs namespace
908
+ */
909
+ function getLogger(namespace) {
910
+ return topLevelLogger.extend(namespace);
911
+ }
912
+ /**
913
+ * @hidden
914
+ * Creates a string tag for labeling apiVersionTag, which is used for API function call to create message request
915
+ * sent to host(s).
916
+ *
917
+ * @internal
918
+ * Limited to Microsoft-internal use
919
+ */
920
+ function getApiVersionTag(apiVersionNumber, functionName) {
921
+ return "".concat(apiVersionNumber, "_").concat(functionName);
922
+ }
923
+ /**
924
+ * @hidden
925
+ * Check if apiVersionTag developer sends follows the pattern starting with a lowercase 'v', then
926
+ * followed by one or more digits, then concatenated with underscore and some characters to indicate api name.
927
+ * For example, 'v2_app.getContext'. If yes, return true. Otherwise, return false.
928
+ *
929
+ * @internal
930
+ * Limited to Microsoft-internal use
931
+ */
932
+ function isFollowingApiVersionTagFormat(apiVersionTag) {
933
+ var pattern = /^v\d+_[\w.]+$/;
934
+ return pattern.test(apiVersionTag);
935
+ }
936
+ /**
937
+ * Use enum to set or update API version number
938
+ * Note: V_0 = 'v0' is used for APIs who needs to be passed with correct version number
939
+ * but haven't been implemented yet.
940
+ * @internal
941
+ * Limited to Microsoft-internal use
942
+ */
943
+ var ApiVersionNumber;
944
+ (function (ApiVersionNumber) {
945
+ ApiVersionNumber["V_0"] = "v0";
946
+ ApiVersionNumber["V_1"] = "v1";
947
+ ApiVersionNumber["V_2"] = "v2";
948
+ ApiVersionNumber["V_3"] = "v3";
949
+ })(ApiVersionNumber || (ApiVersionNumber = {}));
950
+ var ApiName;
951
+ (function (ApiName) {
952
+ ApiName["App_GetContext"] = "app.getContext";
953
+ ApiName["App_Initialize"] = "app.initialize";
954
+ ApiName["App_NotifyAppLoaded"] = "app.notifyAppLoaded";
955
+ ApiName["App_NotifyExpectedFailure"] = "app.notifyExpectedFailure";
956
+ ApiName["App_NotifyFailure"] = "app.notifyFailure";
957
+ ApiName["App_NotifySuccess"] = "app.notifySuccess";
958
+ ApiName["App_OpenLink"] = "app.openLink";
959
+ ApiName["App_RegisterOnThemeChangeHandler"] = "app.registerOnThemeChangeHandler";
960
+ ApiName["AppEntity_SelectAppEntity"] = "appEntity.selectAppEntity";
961
+ ApiName["Dialog_AdaptiveCard_Bot_Open"] = "dialog.adaptiveCard.bot.open";
962
+ ApiName["Dialog_AdaptiveCard_Open"] = "dialog.adaptiveCard.open";
963
+ ApiName["Dialog_Update_Resize"] = "dialog.update.resize";
964
+ ApiName["Dialog_Url_Bot_Open"] = "dialog.url.bot.open";
965
+ ApiName["Dialog_Url_Open"] = "dialog.url.open";
966
+ ApiName["Dialog_Url_Submit"] = "dialog.url.submit";
967
+ ApiName["Dialog_Url_SendMessageToParentFromDialog"] = "dialog.url.sendMessageToParentFromDialog";
968
+ ApiName["Dialog_Url_SendMessageToDialog"] = "dialog.url.sendMessageToDialog";
969
+ ApiName["GeoLocation_GetCurrentLocation"] = "geoLocation.getCurrentLocation";
970
+ ApiName["GeoLocation_HasPermission"] = "geoLocation.hasPermission";
971
+ ApiName["GeoLocation_Map_ChooseLocation"] = "geoLocation.map.chooseLocation";
972
+ ApiName["GeoLocation_RequestPermission"] = "geoLocation.hasPermission";
973
+ ApiName["GeoLocation_ShowLocation"] = "geoLocation.showLocation";
974
+ ApiName["Location_GetLocation"] = "location.getLocation";
975
+ ApiName["Location_ShowLocation"] = "location.showLocation";
976
+ ApiName["Navigation_NavigateBack"] = "navigation.navigateBack";
977
+ ApiName["Navigation_NavigateCrossDomain"] = "navigation.navigateCrossDomain";
978
+ ApiName["Navigation_NavigateToTab"] = "navigation.navigateToTab";
979
+ ApiName["Navigation_ReturnFocus"] = "navigation.returnFocus";
980
+ ApiName["Pages_AppButton_OnClick"] = "pages.appButton.onClick";
981
+ ApiName["Pages_AppButton_OnHoverEnter"] = "pages.appButton.onHoverEnter";
982
+ ApiName["Pages_AppButton_OnHoverLeave"] = "pages.appButton.onHoverLeave";
983
+ ApiName["Pages_BackStack_NavigateBack"] = "pages.backStack.navigateBack";
984
+ ApiName["Pages_BackStack_RegisterBackButtonHandler"] = "pages.backStack.registerBackButtonHandler";
985
+ ApiName["Pages_Config_RegisterChangeConfigHandler"] = "pages.config.registerChangeConfigHandler";
986
+ ApiName["Pages_Config_RegisterOnRemoveHandlerHelper"] = "pages.config.registerOnRemoveHandlerHelper";
987
+ ApiName["Pages_Config_RegisterOnSaveHandlerHelper"] = "pages.config.registerOnSaveHandlerHelper";
988
+ ApiName["Pages_Config_SetConfig"] = "pages.config.setConfig";
989
+ ApiName["Pages_Config_SetValidityState"] = "pages.config.setValidityState";
990
+ ApiName["Pages_CurrentApp_NavigateTo"] = "pages.currentApp.navigateTo";
991
+ ApiName["Pages_CurrentApp_NavigateToDefaultPage"] = "pages.currentApp.navigateToDefaultPage";
992
+ ApiName["Pages_FullTrust_EnterFullscreen"] = "pages.fullTrust.enterFullscreen";
993
+ ApiName["Pages_FullTrust_ExitFullscreen"] = "pages.fullTrust.exitFullscreen";
994
+ ApiName["Pages_GetConfig"] = "pages.getConfig.";
995
+ ApiName["Pages_NavigateCrossDomain"] = "pages.navigateCrossDomain";
996
+ ApiName["Pages_NavigateToApp"] = "pages.navigateToApp";
997
+ ApiName["Pages_RegisterFocusEnterHandler"] = "pages.registerFocusEnterHandler";
998
+ ApiName["Pages_RegisterFullScreenHandler"] = "pages.registerFullScreenHandler";
999
+ ApiName["Pages_ReturnFocus"] = "pages.returnFocus";
1000
+ ApiName["Pages_SetCurrentFrame"] = "pages.setCurrentFrame";
1001
+ ApiName["Pages_ShareDeepLink"] = "pages.shareDeepLink";
1002
+ ApiName["Pages_Tabs_GetMruTabInstances"] = "pages.tabs.getMruTabInstances";
1003
+ ApiName["Pages_Tabs_GetTabInstances"] = "pages.tabs.getTabInstances";
1004
+ ApiName["Pages_Tabs_NavigateToTab"] = "pages.tabs.navigateToTab";
1005
+ ApiName["PublicAPIs_ExecuteDeepLink"] = "executeDeepLink";
1006
+ ApiName["PublicAPIs_GetContext"] = "getContext";
1007
+ ApiName["PublicAPIs_GetMruTabInstances"] = "getMruTabInstances";
1008
+ ApiName["PublicAPIs_GetTabInstances"] = "getTabInstances";
1009
+ ApiName["PublicAPIs_Initialize"] = "initialize";
1010
+ ApiName["PublicAPIs_RegisterAppButtonClickHandler"] = "registerAppButtonClickHandler";
1011
+ ApiName["PublicAPIs_RegisterAppButtonHoverEnterHandler"] = "registerAppButtonHoverEnterHandler";
1012
+ ApiName["PublicAPIs_RegisterAppButtonHoverLeaveHandler"] = "registerAppButtonHoverLeaveHandler";
1013
+ ApiName["PublicAPIs_RegisterBackButtonHandler"] = "registerBackButtonHandler";
1014
+ ApiName["PublicAPIs_RegisterChangeSettingsHandler"] = "registerChangeSettingsHandler";
1015
+ ApiName["PublicAPIs_RegisterFocusEnterHandler"] = "registerFocusEnterHandler";
1016
+ ApiName["PublicAPIs_RegisterFullScreenHandler"] = "registerFullScreenHandler";
1017
+ ApiName["PublicAPIs_RegisterOnLoadHandler"] = "registerOnLoadHandler";
1018
+ ApiName["PublicAPIs_RegisterOnThemeChangeHandlerHelper"] = "registerOnThemeChangeHandlerHelper";
1019
+ ApiName["PublicAPIs_SetFrameContext"] = "setFrameContext";
1020
+ ApiName["PublicAPIs_ShareDeepLink"] = "shareDeepLink";
1021
+ ApiName["RegisterHandler"] = "registerHandler";
1022
+ ApiName["RegisterOnThemeChangeHandler"] = "registerOnThemeChangeHandler";
1023
+ ApiName["Settings_Remove_Failure"] = "settings.remove.failure";
1024
+ ApiName["Settings_Remove_Success"] = "settings.remove.success";
1025
+ ApiName["Settings_Save_Failure"] = "settings.save.failure";
1026
+ ApiName["Settings_Save_Success"] = "settings.save.success";
1027
+ ApiName["Tasks_StartTask"] = "tasks.startTask";
1028
+ ApiName["Tasks_SubmitTask"] = "tasks.submitTask";
1029
+ ApiName["Tasks_UpdateTask"] = "tasks.updateTask";
1030
+ })(ApiName || (ApiName = {}));
1031
+
898
1032
  ;// CONCATENATED MODULE: ./src/internal/constants.ts
899
1033
  /**
900
1034
  * @hidden
@@ -1077,27 +1211,15 @@ var GlobalVars = /** @class */ (function () {
1077
1211
  GlobalVars.initializeCalled = false;
1078
1212
  GlobalVars.initializeCompleted = false;
1079
1213
  GlobalVars.additionalValidOrigins = [];
1214
+ GlobalVars.initializePromise = undefined;
1080
1215
  GlobalVars.isFramelessWindow = false;
1216
+ GlobalVars.frameContext = undefined;
1217
+ GlobalVars.hostClientType = undefined;
1081
1218
  GlobalVars.printCapabilityEnabled = false;
1082
1219
  return GlobalVars;
1083
1220
  }());
1084
1221
 
1085
1222
 
1086
- // EXTERNAL MODULE: ../../node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js
1087
- var browser = __webpack_require__(302);
1088
- ;// CONCATENATED MODULE: ./src/internal/telemetry.ts
1089
-
1090
- var topLevelLogger = (0,browser.debug)('teamsJs');
1091
- /**
1092
- * @internal
1093
- * Limited to Microsoft-internal use
1094
- *
1095
- * Returns a logger for a given namespace, within the pre-defined top-level teamsJs namespace
1096
- */
1097
- function getLogger(namespace) {
1098
- return topLevelLogger.extend(namespace);
1099
- }
1100
-
1101
1223
  ;// CONCATENATED MODULE: ../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/native.js
1102
1224
  const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1103
1225
  /* harmony default export */ const esm_browser_native = ({
@@ -1956,6 +2078,15 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
1956
2078
  }
1957
2079
  return t;
1958
2080
  };
2081
+ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
2082
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
2083
+ if (ar || !(i in from)) {
2084
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
2085
+ ar[i] = from[i];
2086
+ }
2087
+ }
2088
+ return to.concat(ar || Array.prototype.slice.call(from));
2089
+ };
1959
2090
 
1960
2091
 
1961
2092
 
@@ -1992,16 +2123,14 @@ function isRuntimeInitialized(runtime) {
1992
2123
  throw new Error(errorRuntimeNotSupported);
1993
2124
  }
1994
2125
  }
1995
- var runtime = _uninitializedRuntime;
2126
+ var runtime_runtime = _uninitializedRuntime;
1996
2127
  var versionAndPlatformAgnosticTeamsRuntimeConfig = {
1997
2128
  apiVersion: 3,
1998
2129
  hostVersionsInfo: teamsMinAdaptiveCardVersion,
1999
2130
  isLegacyTeams: true,
2000
2131
  supports: {
2001
2132
  app: {
2002
- lifecycle: {
2003
- caching: {},
2004
- },
2133
+ lifecycle: {},
2005
2134
  },
2006
2135
  appInstallDialog: {},
2007
2136
  appEntity: {},
@@ -2024,14 +2153,11 @@ var versionAndPlatformAgnosticTeamsRuntimeConfig = {
2024
2153
  monetization: {},
2025
2154
  notifications: {},
2026
2155
  pages: {
2027
- appButton: {},
2028
- tabs: {},
2029
2156
  config: {},
2030
2157
  backStack: {},
2031
2158
  fullTrust: {},
2032
2159
  },
2033
2160
  remoteCamera: {},
2034
- stageView: {},
2035
2161
  teams: {
2036
2162
  fullTrust: {},
2037
2163
  },
@@ -2041,11 +2167,9 @@ var versionAndPlatformAgnosticTeamsRuntimeConfig = {
2041
2167
  },
2042
2168
  },
2043
2169
  };
2044
- var v1HostClientTypes = [
2170
+ var v1NonMobileHostClientTypes = [
2045
2171
  HostClientType.desktop,
2046
2172
  HostClientType.web,
2047
- HostClientType.android,
2048
- HostClientType.ios,
2049
2173
  HostClientType.rigel,
2050
2174
  HostClientType.surfaceHub,
2051
2175
  HostClientType.teamsRoomsWindows,
@@ -2053,6 +2177,8 @@ var v1HostClientTypes = [
2053
2177
  HostClientType.teamsPhones,
2054
2178
  HostClientType.teamsDisplays,
2055
2179
  ];
2180
+ var v1MobileHostClientTypes = [HostClientType.android, HostClientType.ios, HostClientType.ipados];
2181
+ var v1HostClientTypes = __spreadArray(__spreadArray([], v1NonMobileHostClientTypes, true), v1MobileHostClientTypes, true);
2056
2182
  /**
2057
2183
  * @hidden
2058
2184
  * Uses upgradeChain to transform an outdated runtime object to the latest format.
@@ -2116,6 +2242,15 @@ var upgradeChain = [
2116
2242
  },
2117
2243
  ];
2118
2244
  var mapTeamsVersionToSupportedCapabilities = {
2245
+ // 1.0.0 just signifies "these capabilities have practically always been supported." For some of these
2246
+ // we don't know what the real first version that supported them was -- but it was long enough ago that
2247
+ // we can just effectively consider them always supported (on the specified platforms)
2248
+ '1.0.0': [
2249
+ {
2250
+ capability: { pages: { appButton: {}, tabs: {} }, stageView: {} },
2251
+ hostClientTypes: v1NonMobileHostClientTypes,
2252
+ },
2253
+ ],
2119
2254
  '1.9.0': [
2120
2255
  {
2121
2256
  capability: { location: {} },
@@ -2211,7 +2346,8 @@ function generateVersionBasedTeamsRuntimeConfig(highestSupportedVersion, version
2211
2346
  Object.keys(mapVersionToSupportedCapabilities).forEach(function (versionNumber) {
2212
2347
  if (compareSDKVersions(highestSupportedVersion, versionNumber) >= 0) {
2213
2348
  mapVersionToSupportedCapabilities[versionNumber].forEach(function (capabilityReqs) {
2214
- if (capabilityReqs.hostClientTypes.includes(GlobalVars.hostClientType)) {
2349
+ if (GlobalVars.hostClientType !== undefined &&
2350
+ capabilityReqs.hostClientTypes.includes(GlobalVars.hostClientType)) {
2215
2351
  newSupports = mergeRuntimeCapabilities(newSupports, capabilityReqs.capability);
2216
2352
  }
2217
2353
  });
@@ -2236,10 +2372,10 @@ function applyRuntimeConfig(runtimeConfig) {
2236
2372
  applyRuntimeConfigLogger('Fast-forwarding runtime %o', runtimeConfig);
2237
2373
  var ffRuntimeConfig = fastForwardRuntime(runtimeConfig);
2238
2374
  applyRuntimeConfigLogger('Applying runtime %o', ffRuntimeConfig);
2239
- runtime = utils_deepFreeze(ffRuntimeConfig);
2375
+ runtime_runtime = utils_deepFreeze(ffRuntimeConfig);
2240
2376
  }
2241
2377
  function setUnitializedRuntime() {
2242
- runtime = deepFreeze(_uninitializedRuntime);
2378
+ runtime_runtime = deepFreeze(_uninitializedRuntime);
2243
2379
  }
2244
2380
  /**
2245
2381
  * @hidden
@@ -2269,7 +2405,7 @@ var _minRuntimeConfigToUninitialize = {
2269
2405
  * @hidden
2270
2406
  * Package version.
2271
2407
  */
2272
- var version = "2.17.0-beta.2";
2408
+ var version = "2.17.1-beta.0";
2273
2409
 
2274
2410
  ;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
2275
2411
 
@@ -2308,7 +2444,7 @@ function ensureInitializeCalled() {
2308
2444
  * @internal
2309
2445
  * Limited to Microsoft-internal use
2310
2446
  */
2311
- function ensureInitialized(runtime) {
2447
+ function internalAPIs_ensureInitialized(runtime) {
2312
2448
  var expectedFrameContexts = [];
2313
2449
  for (var _i = 1; _i < arguments.length; _i++) {
2314
2450
  expectedFrameContexts[_i - 1] = arguments[_i];
@@ -2406,6 +2542,11 @@ function processAdditionalValidOrigins(validMessageOrigins) {
2406
2542
  GlobalVars.additionalValidOrigins = combinedOriginUrls;
2407
2543
  }
2408
2544
 
2545
+ ;// CONCATENATED MODULE: ./src/internal/typeCheckUtilities.ts
2546
+ function isNullOrUndefined(value) {
2547
+ return value === null || value === undefined;
2548
+ }
2549
+
2409
2550
  ;// CONCATENATED MODULE: ./src/public/authentication.ts
2410
2551
 
2411
2552
 
@@ -2454,7 +2595,7 @@ var authentication;
2454
2595
  if (!authenticateParams) {
2455
2596
  throw new Error('No parameters are provided for authentication');
2456
2597
  }
2457
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
2598
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
2458
2599
  return authenticateHelper(authenticateParams)
2459
2600
  .then(function (value) {
2460
2601
  try {
@@ -2466,7 +2607,7 @@ var authentication;
2466
2607
  }
2467
2608
  finally {
2468
2609
  if (!isDifferentParamsInCall) {
2469
- authParams = null;
2610
+ authParams = undefined;
2470
2611
  }
2471
2612
  }
2472
2613
  })
@@ -2480,7 +2621,7 @@ var authentication;
2480
2621
  }
2481
2622
  finally {
2482
2623
  if (!isDifferentParamsInCall) {
2483
- authParams = null;
2624
+ authParams = undefined;
2484
2625
  }
2485
2626
  }
2486
2627
  });
@@ -2708,7 +2849,7 @@ var authentication;
2708
2849
  */
2709
2850
  function notifySuccess(result, callbackUrl) {
2710
2851
  redirectIfWin32Outlook(callbackUrl, 'result', result);
2711
- ensureInitialized(runtime, FrameContexts.authentication);
2852
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.authentication);
2712
2853
  sendMessageToParent('authentication.authenticate.success', [result]);
2713
2854
  // Wait for the message to be sent before closing the window
2714
2855
  waitForMessageQueue(Communication.parentWindow, function () { return setTimeout(function () { return Communication.currentWindow.close(); }, 200); });
@@ -2731,7 +2872,7 @@ var authentication;
2731
2872
  */
2732
2873
  function notifyFailure(reason, callbackUrl) {
2733
2874
  redirectIfWin32Outlook(callbackUrl, 'reason', reason);
2734
- ensureInitialized(runtime, FrameContexts.authentication);
2875
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.authentication);
2735
2876
  sendMessageToParent('authentication.authenticate.failure', [reason]);
2736
2877
  // Wait for the message to be sent before closing the window
2737
2878
  waitForMessageQueue(Communication.parentWindow, function () { return setTimeout(function () { return Communication.currentWindow.close(); }, 200); });
@@ -2744,7 +2885,7 @@ var authentication;
2744
2885
  }
2745
2886
  }
2746
2887
  finally {
2747
- authHandlers = null;
2888
+ authHandlers = undefined;
2748
2889
  closeAuthenticationWindow();
2749
2890
  }
2750
2891
  }
@@ -2755,7 +2896,7 @@ var authentication;
2755
2896
  }
2756
2897
  }
2757
2898
  finally {
2758
- authHandlers = null;
2899
+ authHandlers = undefined;
2759
2900
  closeAuthenticationWindow();
2760
2901
  }
2761
2902
  }
@@ -2836,6 +2977,60 @@ var authentication;
2836
2977
 
2837
2978
 
2838
2979
 
2980
+
2981
+ /**
2982
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
2983
+ */
2984
+ var dialogTelemetryVersionNumber = ApiVersionNumber.V_2;
2985
+ function updateResizeHelper(apiVersionTag, dimensions) {
2986
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);
2987
+ if (!dialog.update.isSupported()) {
2988
+ throw errorNotSupportedOnPlatform;
2989
+ }
2990
+ communication_sendMessageToParentWithVersion(apiVersionTag, 'tasks.updateTask', [dimensions]);
2991
+ }
2992
+ function urlOpenHelper(apiVersionTag, urlDialogInfo, submitHandler, messageFromChildHandler) {
2993
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
2994
+ if (!dialog.url.isSupported()) {
2995
+ throw errorNotSupportedOnPlatform;
2996
+ }
2997
+ if (messageFromChildHandler) {
2998
+ registerHandler('messageForParent', messageFromChildHandler);
2999
+ }
3000
+ var dialogInfo = dialog.url.getDialogInfoFromUrlDialogInfo(urlDialogInfo);
3001
+ communication_sendMessageToParentWithVersion(apiVersionTag, 'tasks.startTask', [dialogInfo], function (err, result) {
3002
+ submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err: err, result: result });
3003
+ removeHandler('messageForParent');
3004
+ });
3005
+ }
3006
+ function botUrlOpenHelper(apiVersionTag, urlDialogInfo, submitHandler, messageFromChildHandler) {
3007
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3008
+ if (!dialog.url.bot.isSupported()) {
3009
+ throw errorNotSupportedOnPlatform;
3010
+ }
3011
+ if (messageFromChildHandler) {
3012
+ registerHandler('messageForParent', messageFromChildHandler);
3013
+ }
3014
+ var dialogInfo = dialog.url.getDialogInfoFromBotUrlDialogInfo(urlDialogInfo);
3015
+ communication_sendMessageToParentWithVersion(apiVersionTag, 'tasks.startTask', [dialogInfo], function (err, result) {
3016
+ submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err: err, result: result });
3017
+ removeHandler('messageForParent');
3018
+ });
3019
+ }
3020
+ function urlSubmitHelper(apiVersionTag, result, appIds) {
3021
+ // FrameContext content should not be here because dialog.submit can be called only from inside of a dialog (FrameContext task)
3022
+ // but it's here because Teams mobile incorrectly returns FrameContext.content when calling app.getFrameContext().
3023
+ // FrameContexts.content will be removed once the bug is fixed.
3024
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
3025
+ if (!dialog.url.isSupported()) {
3026
+ throw errorNotSupportedOnPlatform;
3027
+ }
3028
+ // Send tasks.completeTask instead of tasks.submitTask message for backward compatibility with Mobile clients
3029
+ communication_sendMessageToParentWithVersion(apiVersionTag, 'tasks.completeTask', [
3030
+ result,
3031
+ appIds ? (Array.isArray(appIds) ? appIds : [appIds]) : [],
3032
+ ]);
3033
+ }
2839
3034
  /**
2840
3035
  * This group of capabilities enables apps to show modal dialogs. There are two primary types of dialogs: URL-based dialogs and [Adaptive Card](https://learn.microsoft.com/adaptive-cards/) dialogs.
2841
3036
  * Both types of dialogs are shown on top of your app, preventing interaction with your app while they are displayed.
@@ -2895,18 +3090,7 @@ var dialog;
2895
3090
  * @beta
2896
3091
  */
2897
3092
  function open(urlDialogInfo, submitHandler, messageFromChildHandler) {
2898
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
2899
- if (!isSupported()) {
2900
- throw errorNotSupportedOnPlatform;
2901
- }
2902
- if (messageFromChildHandler) {
2903
- registerHandler('messageForParent', messageFromChildHandler);
2904
- }
2905
- var dialogInfo = getDialogInfoFromUrlDialogInfo(urlDialogInfo);
2906
- sendMessageToParent('tasks.startTask', [dialogInfo], function (err, result) {
2907
- submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err: err, result: result });
2908
- removeHandler('messageForParent');
2909
- });
3093
+ urlOpenHelper(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_Open), urlDialogInfo, submitHandler, messageFromChildHandler);
2910
3094
  }
2911
3095
  url.open = open;
2912
3096
  /**
@@ -2923,15 +3107,7 @@ var dialog;
2923
3107
  * @beta
2924
3108
  */
2925
3109
  function submit(result, appIds) {
2926
- // FrameContext content should not be here because dialog.submit can be called only from inside of a dialog (FrameContext task)
2927
- // but it's here because Teams mobile incorrectly returns FrameContext.content when calling app.getFrameContext().
2928
- // FrameContexts.content will be removed once the bug is fixed.
2929
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
2930
- if (!isSupported()) {
2931
- throw errorNotSupportedOnPlatform;
2932
- }
2933
- // Send tasks.completeTask instead of tasks.submitTask message for backward compatibility with Mobile clients
2934
- sendMessageToParent('tasks.completeTask', [result, appIds ? (Array.isArray(appIds) ? appIds : [appIds]) : []]);
3110
+ urlSubmitHelper(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_Submit), result, appIds);
2935
3111
  }
2936
3112
  url.submit = submit;
2937
3113
  /**
@@ -2947,11 +3123,11 @@ var dialog;
2947
3123
  function sendMessageToParentFromDialog(
2948
3124
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2949
3125
  message) {
2950
- ensureInitialized(runtime, FrameContexts.task);
3126
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.task);
2951
3127
  if (!isSupported()) {
2952
3128
  throw errorNotSupportedOnPlatform;
2953
3129
  }
2954
- sendMessageToParent('messageForParent', [message]);
3130
+ communication_sendMessageToParentWithVersion(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_SendMessageToParentFromDialog), 'messageForParent', [message]);
2955
3131
  }
2956
3132
  url.sendMessageToParentFromDialog = sendMessageToParentFromDialog;
2957
3133
  /**
@@ -2964,11 +3140,11 @@ var dialog;
2964
3140
  function sendMessageToDialog(
2965
3141
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2966
3142
  message) {
2967
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3143
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
2968
3144
  if (!isSupported()) {
2969
3145
  throw errorNotSupportedOnPlatform;
2970
3146
  }
2971
- sendMessageToParent('messageForChild', [message]);
3147
+ communication_sendMessageToParentWithVersion(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_SendMessageToDialog), 'messageForChild', [message]);
2972
3148
  }
2973
3149
  url.sendMessageToDialog = sendMessageToDialog;
2974
3150
  /**
@@ -2982,7 +3158,7 @@ var dialog;
2982
3158
  * @beta
2983
3159
  */
2984
3160
  function registerOnMessageFromParent(listener) {
2985
- ensureInitialized(runtime, FrameContexts.task);
3161
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.task);
2986
3162
  if (!isSupported()) {
2987
3163
  throw errorNotSupportedOnPlatform;
2988
3164
  }
@@ -3008,7 +3184,7 @@ var dialog;
3008
3184
  * @beta
3009
3185
  */
3010
3186
  function isSupported() {
3011
- return ensureInitialized(runtime) && (runtime.supports.dialog && runtime.supports.dialog.url) !== undefined;
3187
+ return internalAPIs_ensureInitialized(runtime_runtime) && (runtime_runtime.supports.dialog && runtime_runtime.supports.dialog.url) !== undefined;
3012
3188
  }
3013
3189
  url.isSupported = isSupported;
3014
3190
  /**
@@ -3030,18 +3206,7 @@ var dialog;
3030
3206
  * @beta
3031
3207
  */
3032
3208
  function open(botUrlDialogInfo, submitHandler, messageFromChildHandler) {
3033
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3034
- if (!isSupported()) {
3035
- throw errorNotSupportedOnPlatform;
3036
- }
3037
- if (messageFromChildHandler) {
3038
- registerHandler('messageForParent', messageFromChildHandler);
3039
- }
3040
- var dialogInfo = getDialogInfoFromBotUrlDialogInfo(botUrlDialogInfo);
3041
- sendMessageToParent('tasks.startTask', [dialogInfo], function (err, result) {
3042
- submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err: err, result: result });
3043
- removeHandler('messageForParent');
3044
- });
3209
+ botUrlOpenHelper(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Url_Bot_Open), botUrlDialogInfo, submitHandler, messageFromChildHandler);
3045
3210
  }
3046
3211
  bot.open = open;
3047
3212
  /**
@@ -3054,8 +3219,8 @@ var dialog;
3054
3219
  * @beta
3055
3220
  */
3056
3221
  function isSupported() {
3057
- return (ensureInitialized(runtime) &&
3058
- (runtime.supports.dialog && runtime.supports.dialog.url && runtime.supports.dialog.url.bot) !== undefined);
3222
+ return (internalAPIs_ensureInitialized(runtime_runtime) &&
3223
+ (runtime_runtime.supports.dialog && runtime_runtime.supports.dialog.url && runtime_runtime.supports.dialog.url.bot) !== undefined);
3059
3224
  }
3060
3225
  bot.isSupported = isSupported;
3061
3226
  })(bot = url.bot || (url.bot = {}));
@@ -3101,7 +3266,7 @@ var dialog;
3101
3266
  * @hidden
3102
3267
  */
3103
3268
  function isSupported() {
3104
- return ensureInitialized(runtime) && runtime.supports.dialog ? true : false;
3269
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.dialog ? true : false;
3105
3270
  }
3106
3271
  dialog.isSupported = isSupported;
3107
3272
  /**
@@ -3119,11 +3284,7 @@ var dialog;
3119
3284
  * @beta
3120
3285
  */
3121
3286
  function resize(dimensions) {
3122
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);
3123
- if (!isSupported()) {
3124
- throw errorNotSupportedOnPlatform;
3125
- }
3126
- sendMessageToParent('tasks.updateTask', [dimensions]);
3287
+ updateResizeHelper(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_Update_Resize), dimensions);
3127
3288
  }
3128
3289
  update.resize = resize;
3129
3290
  /**
@@ -3135,8 +3296,8 @@ var dialog;
3135
3296
  * @beta
3136
3297
  */
3137
3298
  function isSupported() {
3138
- return ensureInitialized(runtime) && runtime.supports.dialog
3139
- ? runtime.supports.dialog.update
3299
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.dialog
3300
+ ? runtime_runtime.supports.dialog.update
3140
3301
  ? true
3141
3302
  : false
3142
3303
  : false;
@@ -3161,12 +3322,12 @@ var dialog;
3161
3322
  * @beta
3162
3323
  */
3163
3324
  function open(adaptiveCardDialogInfo, submitHandler) {
3164
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3325
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3165
3326
  if (!isSupported()) {
3166
3327
  throw errorNotSupportedOnPlatform;
3167
3328
  }
3168
3329
  var dialogInfo = getDialogInfoFromAdaptiveCardDialogInfo(adaptiveCardDialogInfo);
3169
- sendMessageToParent('tasks.startTask', [dialogInfo], function (err, result) {
3330
+ communication_sendMessageToParentWithVersion(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_AdaptiveCard_Open), 'tasks.startTask', [dialogInfo], function (err, result) {
3170
3331
  submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err: err, result: result });
3171
3332
  });
3172
3333
  }
@@ -3181,11 +3342,11 @@ var dialog;
3181
3342
  * @beta
3182
3343
  */
3183
3344
  function isSupported() {
3184
- var isAdaptiveCardVersionSupported = runtime.hostVersionsInfo &&
3185
- runtime.hostVersionsInfo.adaptiveCardSchemaVersion &&
3186
- !isHostAdaptiveCardSchemaVersionUnsupported(runtime.hostVersionsInfo.adaptiveCardSchemaVersion);
3187
- return (ensureInitialized(runtime) &&
3188
- (isAdaptiveCardVersionSupported && runtime.supports.dialog && runtime.supports.dialog.card) !== undefined);
3345
+ var isAdaptiveCardVersionSupported = runtime_runtime.hostVersionsInfo &&
3346
+ runtime_runtime.hostVersionsInfo.adaptiveCardSchemaVersion &&
3347
+ !isHostAdaptiveCardSchemaVersionUnsupported(runtime_runtime.hostVersionsInfo.adaptiveCardSchemaVersion);
3348
+ return (internalAPIs_ensureInitialized(runtime_runtime) &&
3349
+ (isAdaptiveCardVersionSupported && runtime_runtime.supports.dialog && runtime_runtime.supports.dialog.card) !== undefined);
3189
3350
  }
3190
3351
  adaptiveCard.isSupported = isSupported;
3191
3352
  /**
@@ -3204,12 +3365,12 @@ var dialog;
3204
3365
  * @beta
3205
3366
  */
3206
3367
  function open(botAdaptiveCardDialogInfo, submitHandler) {
3207
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3368
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3208
3369
  if (!isSupported()) {
3209
3370
  throw errorNotSupportedOnPlatform;
3210
3371
  }
3211
3372
  var dialogInfo = getDialogInfoFromBotAdaptiveCardDialogInfo(botAdaptiveCardDialogInfo);
3212
- sendMessageToParent('tasks.startTask', [dialogInfo], function (err, result) {
3373
+ communication_sendMessageToParentWithVersion(getApiVersionTag(dialogTelemetryVersionNumber, ApiName.Dialog_AdaptiveCard_Bot_Open), 'tasks.startTask', [dialogInfo], function (err, result) {
3213
3374
  submitHandler === null || submitHandler === void 0 ? void 0 : submitHandler({ err: err, result: result });
3214
3375
  });
3215
3376
  }
@@ -3224,14 +3385,14 @@ var dialog;
3224
3385
  * @beta
3225
3386
  */
3226
3387
  function isSupported() {
3227
- var isAdaptiveCardVersionSupported = runtime.hostVersionsInfo &&
3228
- runtime.hostVersionsInfo.adaptiveCardSchemaVersion &&
3229
- !isHostAdaptiveCardSchemaVersionUnsupported(runtime.hostVersionsInfo.adaptiveCardSchemaVersion);
3230
- return (ensureInitialized(runtime) &&
3388
+ var isAdaptiveCardVersionSupported = runtime_runtime.hostVersionsInfo &&
3389
+ runtime_runtime.hostVersionsInfo.adaptiveCardSchemaVersion &&
3390
+ !isHostAdaptiveCardSchemaVersionUnsupported(runtime_runtime.hostVersionsInfo.adaptiveCardSchemaVersion);
3391
+ return (internalAPIs_ensureInitialized(runtime_runtime) &&
3231
3392
  (isAdaptiveCardVersionSupported &&
3232
- runtime.supports.dialog &&
3233
- runtime.supports.dialog.card &&
3234
- runtime.supports.dialog.card.bot) !== undefined);
3393
+ runtime_runtime.supports.dialog &&
3394
+ runtime_runtime.supports.dialog.card &&
3395
+ runtime_runtime.supports.dialog.card.bot) !== undefined);
3235
3396
  }
3236
3397
  bot.isSupported = isSupported;
3237
3398
  })(bot = adaptiveCard.bot || (adaptiveCard.bot = {}));
@@ -3350,7 +3511,7 @@ var menus;
3350
3511
  * @param handler - The handler to invoke when the user selects view configuration.
3351
3512
  */
3352
3513
  function setUpViews(viewConfig, handler) {
3353
- ensureInitialized(runtime);
3514
+ internalAPIs_ensureInitialized(runtime_runtime);
3354
3515
  if (!isSupported()) {
3355
3516
  throw errorNotSupportedOnPlatform;
3356
3517
  }
@@ -3360,7 +3521,7 @@ var menus;
3360
3521
  menus.setUpViews = setUpViews;
3361
3522
  function handleViewConfigItemPress(id) {
3362
3523
  if (!viewConfigItemPressHandler || !viewConfigItemPressHandler(id)) {
3363
- ensureInitialized(runtime);
3524
+ internalAPIs_ensureInitialized(runtime_runtime);
3364
3525
  sendMessageToParent('viewConfigItemPress', [id]);
3365
3526
  }
3366
3527
  }
@@ -3372,7 +3533,7 @@ var menus;
3372
3533
  * @param handler The handler to invoke when the user selects menu item.
3373
3534
  */
3374
3535
  function setNavBarMenu(items, handler) {
3375
- ensureInitialized(runtime);
3536
+ internalAPIs_ensureInitialized(runtime_runtime);
3376
3537
  if (!isSupported()) {
3377
3538
  throw errorNotSupportedOnPlatform;
3378
3539
  }
@@ -3382,7 +3543,7 @@ var menus;
3382
3543
  menus.setNavBarMenu = setNavBarMenu;
3383
3544
  function handleNavBarMenuItemPress(id) {
3384
3545
  if (!navBarMenuItemPressHandler || !navBarMenuItemPressHandler(id)) {
3385
- ensureInitialized(runtime);
3546
+ internalAPIs_ensureInitialized(runtime_runtime);
3386
3547
  sendMessageToParent('handleNavBarMenuItemPress', [id]);
3387
3548
  }
3388
3549
  }
@@ -3394,7 +3555,7 @@ var menus;
3394
3555
  * @param handler - The handler to invoke when the user selects menu item.
3395
3556
  */
3396
3557
  function showActionMenu(params, handler) {
3397
- ensureInitialized(runtime);
3558
+ internalAPIs_ensureInitialized(runtime_runtime);
3398
3559
  if (!isSupported()) {
3399
3560
  throw errorNotSupportedOnPlatform;
3400
3561
  }
@@ -3404,7 +3565,7 @@ var menus;
3404
3565
  menus.showActionMenu = showActionMenu;
3405
3566
  function handleActionMenuItemPress(id) {
3406
3567
  if (!actionMenuItemPressHandler || !actionMenuItemPressHandler(id)) {
3407
- ensureInitialized(runtime);
3568
+ internalAPIs_ensureInitialized(runtime_runtime);
3408
3569
  sendMessageToParent('handleActionMenuItemPress', [id]);
3409
3570
  }
3410
3571
  }
@@ -3415,7 +3576,7 @@ var menus;
3415
3576
  * @throws Error if {@linkcode app.initialize} has not successfully completed
3416
3577
  */
3417
3578
  function isSupported() {
3418
- return ensureInitialized(runtime) && runtime.supports.menus ? true : false;
3579
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.menus ? true : false;
3419
3580
  }
3420
3581
  menus.isSupported = isSupported;
3421
3582
  })(menus || (menus = {}));
@@ -3438,6 +3599,125 @@ var menus;
3438
3599
 
3439
3600
 
3440
3601
 
3602
+
3603
+
3604
+ /**
3605
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
3606
+ */
3607
+ var appTelemetryVersionNumber = ApiVersionNumber.V_2;
3608
+ /**
3609
+ * Number of milliseconds we'll give the initialization call to return before timing it out
3610
+ */
3611
+ var initializationTimeoutInMs = 5000;
3612
+ var appLogger = getLogger('app');
3613
+ function appInitializeHelper(apiVersionTag, validMessageOrigins) {
3614
+ if (!inServerSideRenderingEnvironment()) {
3615
+ return runWithTimeout(function () { return initializeHelper(apiVersionTag, validMessageOrigins); }, initializationTimeoutInMs, new Error('SDK initialization timed out.'));
3616
+ }
3617
+ else {
3618
+ var initializeLogger = appLogger.extend('initialize');
3619
+ // This log statement should NEVER actually be written. This code path exists only to enable compilation in server-side rendering environments.
3620
+ // If you EVER see this statement in ANY log file, something has gone horribly wrong and a bug needs to be filed.
3621
+ initializeLogger('window object undefined at initialization');
3622
+ return Promise.resolve();
3623
+ }
3624
+ }
3625
+ var initializeHelperLogger = appLogger.extend('initializeHelper');
3626
+ function initializeHelper(apiVersionTag, validMessageOrigins) {
3627
+ return new Promise(function (resolve) {
3628
+ // Independent components might not know whether the SDK is initialized so might call it to be safe.
3629
+ // Just no-op if that happens to make it easier to use.
3630
+ if (!GlobalVars.initializeCalled) {
3631
+ GlobalVars.initializeCalled = true;
3632
+ initializeHandlers();
3633
+ GlobalVars.initializePromise = initializeCommunication(validMessageOrigins, apiVersionTag).then(function (_a) {
3634
+ var context = _a.context, clientType = _a.clientType, runtimeConfig = _a.runtimeConfig, _b = _a.clientSupportedSDKVersion, clientSupportedSDKVersion = _b === void 0 ? defaultSDKVersionForCompatCheck : _b;
3635
+ GlobalVars.frameContext = context;
3636
+ GlobalVars.hostClientType = clientType;
3637
+ GlobalVars.clientSupportedSDKVersion = clientSupportedSDKVersion;
3638
+ // Temporary workaround while the Host is updated with the new argument order.
3639
+ // For now, we might receive any of these possibilities:
3640
+ // - `runtimeConfig` in `runtimeConfig` and `clientSupportedSDKVersion` in `clientSupportedSDKVersion`.
3641
+ // - `runtimeConfig` in `clientSupportedSDKVersion` and `clientSupportedSDKVersion` in `runtimeConfig`.
3642
+ // - `clientSupportedSDKVersion` in `runtimeConfig` and no `clientSupportedSDKVersion`.
3643
+ // This code supports any of these possibilities
3644
+ // Teams AppHost won't provide this runtime config
3645
+ // so we assume that if we don't have it, we must be running in Teams.
3646
+ // After Teams updates its client code, we can remove this default code.
3647
+ try {
3648
+ initializeHelperLogger('Parsing %s', runtimeConfig);
3649
+ var givenRuntimeConfig = JSON.parse(runtimeConfig);
3650
+ initializeHelperLogger('Checking if %o is a valid runtime object', givenRuntimeConfig !== null && givenRuntimeConfig !== void 0 ? givenRuntimeConfig : 'null');
3651
+ // Check that givenRuntimeConfig is a valid instance of IBaseRuntime
3652
+ if (!givenRuntimeConfig || !givenRuntimeConfig.apiVersion) {
3653
+ throw new Error('Received runtime config is invalid');
3654
+ }
3655
+ runtimeConfig && applyRuntimeConfig(givenRuntimeConfig);
3656
+ }
3657
+ catch (e) {
3658
+ if (e instanceof SyntaxError) {
3659
+ try {
3660
+ initializeHelperLogger('Attempting to parse %s as an SDK version', runtimeConfig);
3661
+ // if the given runtime config was actually meant to be a SDK version, store it as such.
3662
+ // TODO: This is a temporary workaround to allow Teams to store clientSupportedSDKVersion even when
3663
+ // it doesn't provide the runtimeConfig. After Teams updates its client code, we should
3664
+ // remove this feature.
3665
+ if (!isNaN(compareSDKVersions(runtimeConfig, defaultSDKVersionForCompatCheck))) {
3666
+ GlobalVars.clientSupportedSDKVersion = runtimeConfig;
3667
+ }
3668
+ var givenRuntimeConfig = JSON.parse(clientSupportedSDKVersion);
3669
+ initializeHelperLogger('givenRuntimeConfig parsed to %o', givenRuntimeConfig !== null && givenRuntimeConfig !== void 0 ? givenRuntimeConfig : 'null');
3670
+ if (!givenRuntimeConfig) {
3671
+ throw new Error('givenRuntimeConfig string was successfully parsed. However, it parsed to value of null');
3672
+ }
3673
+ else {
3674
+ applyRuntimeConfig(givenRuntimeConfig);
3675
+ }
3676
+ }
3677
+ catch (e) {
3678
+ if (e instanceof SyntaxError) {
3679
+ applyRuntimeConfig(generateVersionBasedTeamsRuntimeConfig(GlobalVars.clientSupportedSDKVersion, versionAndPlatformAgnosticTeamsRuntimeConfig, mapTeamsVersionToSupportedCapabilities));
3680
+ }
3681
+ else {
3682
+ throw e;
3683
+ }
3684
+ }
3685
+ }
3686
+ else {
3687
+ // If it's any error that's not a JSON parsing error, we want the program to fail.
3688
+ throw e;
3689
+ }
3690
+ }
3691
+ GlobalVars.initializeCompleted = true;
3692
+ });
3693
+ authentication.initialize();
3694
+ menus.initialize();
3695
+ pages.config.initialize();
3696
+ dialog.initialize();
3697
+ }
3698
+ // Handle additional valid message origins if specified
3699
+ if (Array.isArray(validMessageOrigins)) {
3700
+ processAdditionalValidOrigins(validMessageOrigins);
3701
+ }
3702
+ if (GlobalVars.initializePromise !== undefined) {
3703
+ resolve(GlobalVars.initializePromise);
3704
+ }
3705
+ else {
3706
+ initializeHelperLogger('GlobalVars.initializePromise is unexpectedly undefined');
3707
+ }
3708
+ });
3709
+ }
3710
+ function registerOnThemeChangeHandlerHelper(apiVersionTag, handler) {
3711
+ // allow for registration cleanup even when not called initialize
3712
+ !isNullOrUndefined(handler) && ensureInitializeCalled();
3713
+ registerOnThemeChangeHandler(apiVersionTag, handler);
3714
+ }
3715
+ function openLinkHelper(apiVersionTag, deepLink) {
3716
+ return new Promise(function (resolve) {
3717
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
3718
+ resolve(sendAndHandleStatusAndReasonWithVersion(apiVersionTag, 'executeDeepLink', deepLink));
3719
+ });
3720
+ }
3441
3721
  /**
3442
3722
  * Namespace to interact with app initialization and lifecycle.
3443
3723
  */
@@ -3517,10 +3797,24 @@ var app;
3517
3797
  return GlobalVars.frameContext;
3518
3798
  }
3519
3799
  app.getFrameContext = getFrameContext;
3520
- /**
3521
- * Number of milliseconds we'll give the initialization call to return before timing it out
3522
- */
3523
- var initializationTimeoutInMs = 5000;
3800
+ function logWhereTeamsJsIsBeingUsed() {
3801
+ if (inServerSideRenderingEnvironment()) {
3802
+ return;
3803
+ }
3804
+ var scripts = document.getElementsByTagName('script');
3805
+ // This will always be the current script because browsers load and execute scripts in order.
3806
+ // Whenever a script is executing for the first time it will be the last script in this array.
3807
+ var currentScriptSrc = scripts && scripts[scripts.length - 1] && scripts[scripts.length - 1].src;
3808
+ var scriptUsageWarning = 'Today, teamsjs can only be used from a single script or you may see undefined behavior. This log line is used to help detect cases where teamsjs is loaded multiple times -- it is always written. The presence of the log itself does not indicate a multi-load situation, but multiples of these log lines will. If you would like to use teamjs from more than one script at the same time, please open an issue at https://github.com/OfficeDev/microsoft-teams-library-js/issues';
3809
+ if (!currentScriptSrc || currentScriptSrc.length === 0) {
3810
+ appLogger('teamsjs is being used from a script tag embedded directly in your html. %s', scriptUsageWarning);
3811
+ }
3812
+ else {
3813
+ appLogger('teamsjs is being used from %s. %s', currentScriptSrc, scriptUsageWarning);
3814
+ }
3815
+ }
3816
+ // This is called right away to make sure that we capture which script is being executed correctly
3817
+ logWhereTeamsJsIsBeingUsed();
3524
3818
  /**
3525
3819
  * Initializes the library.
3526
3820
  *
@@ -3532,98 +3826,9 @@ var app;
3532
3826
  * @returns Promise that will be fulfilled when initialization has completed, or rejected if the initialization fails or times out
3533
3827
  */
3534
3828
  function initialize(validMessageOrigins) {
3535
- if (!inServerSideRenderingEnvironment()) {
3536
- return runWithTimeout(function () { return initializeHelper(validMessageOrigins); }, initializationTimeoutInMs, new Error('SDK initialization timed out.'));
3537
- }
3538
- else {
3539
- var initializeLogger = appLogger.extend('initialize');
3540
- // This log statement should NEVER actually be written. This code path exists only to enable compilation in server-side rendering environments.
3541
- // If you EVER see this statement in ANY log file, something has gone horribly wrong and a bug needs to be filed.
3542
- initializeLogger('window object undefined at initialization');
3543
- return Promise.resolve();
3544
- }
3829
+ return appInitializeHelper(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_Initialize), validMessageOrigins);
3545
3830
  }
3546
3831
  app.initialize = initialize;
3547
- var initializeHelperLogger = appLogger.extend('initializeHelper');
3548
- function initializeHelper(validMessageOrigins) {
3549
- return new Promise(function (resolve) {
3550
- // Independent components might not know whether the SDK is initialized so might call it to be safe.
3551
- // Just no-op if that happens to make it easier to use.
3552
- if (!GlobalVars.initializeCalled) {
3553
- GlobalVars.initializeCalled = true;
3554
- initializeHandlers();
3555
- GlobalVars.initializePromise = initializeCommunication(validMessageOrigins).then(function (_a) {
3556
- var context = _a.context, clientType = _a.clientType, runtimeConfig = _a.runtimeConfig, _b = _a.clientSupportedSDKVersion, clientSupportedSDKVersion = _b === void 0 ? defaultSDKVersionForCompatCheck : _b;
3557
- GlobalVars.frameContext = context;
3558
- GlobalVars.hostClientType = clientType;
3559
- GlobalVars.clientSupportedSDKVersion = clientSupportedSDKVersion;
3560
- // Temporary workaround while the Host is updated with the new argument order.
3561
- // For now, we might receive any of these possibilities:
3562
- // - `runtimeConfig` in `runtimeConfig` and `clientSupportedSDKVersion` in `clientSupportedSDKVersion`.
3563
- // - `runtimeConfig` in `clientSupportedSDKVersion` and `clientSupportedSDKVersion` in `runtimeConfig`.
3564
- // - `clientSupportedSDKVersion` in `runtimeConfig` and no `clientSupportedSDKVersion`.
3565
- // This code supports any of these possibilities
3566
- // Teams AppHost won't provide this runtime config
3567
- // so we assume that if we don't have it, we must be running in Teams.
3568
- // After Teams updates its client code, we can remove this default code.
3569
- try {
3570
- initializeHelperLogger('Parsing %s', runtimeConfig);
3571
- var givenRuntimeConfig = JSON.parse(runtimeConfig);
3572
- initializeHelperLogger('Checking if %o is a valid runtime object', givenRuntimeConfig !== null && givenRuntimeConfig !== void 0 ? givenRuntimeConfig : 'null');
3573
- // Check that givenRuntimeConfig is a valid instance of IBaseRuntime
3574
- if (!givenRuntimeConfig || !givenRuntimeConfig.apiVersion) {
3575
- throw new Error('Received runtime config is invalid');
3576
- }
3577
- runtimeConfig && applyRuntimeConfig(givenRuntimeConfig);
3578
- }
3579
- catch (e) {
3580
- if (e instanceof SyntaxError) {
3581
- try {
3582
- initializeHelperLogger('Attempting to parse %s as an SDK version', runtimeConfig);
3583
- // if the given runtime config was actually meant to be a SDK version, store it as such.
3584
- // TODO: This is a temporary workaround to allow Teams to store clientSupportedSDKVersion even when
3585
- // it doesn't provide the runtimeConfig. After Teams updates its client code, we should
3586
- // remove this feature.
3587
- if (!isNaN(compareSDKVersions(runtimeConfig, defaultSDKVersionForCompatCheck))) {
3588
- GlobalVars.clientSupportedSDKVersion = runtimeConfig;
3589
- }
3590
- var givenRuntimeConfig = JSON.parse(clientSupportedSDKVersion);
3591
- initializeHelperLogger('givenRuntimeConfig parsed to %o', givenRuntimeConfig !== null && givenRuntimeConfig !== void 0 ? givenRuntimeConfig : 'null');
3592
- if (!givenRuntimeConfig) {
3593
- throw new Error('givenRuntimeConfig string was successfully parsed. However, it parsed to value of null');
3594
- }
3595
- else {
3596
- applyRuntimeConfig(givenRuntimeConfig);
3597
- }
3598
- }
3599
- catch (e) {
3600
- if (e instanceof SyntaxError) {
3601
- applyRuntimeConfig(generateVersionBasedTeamsRuntimeConfig(GlobalVars.clientSupportedSDKVersion, versionAndPlatformAgnosticTeamsRuntimeConfig, mapTeamsVersionToSupportedCapabilities));
3602
- }
3603
- else {
3604
- throw e;
3605
- }
3606
- }
3607
- }
3608
- else {
3609
- // If it's any error that's not a JSON parsing error, we want the program to fail.
3610
- throw e;
3611
- }
3612
- }
3613
- GlobalVars.initializeCompleted = true;
3614
- });
3615
- authentication.initialize();
3616
- menus.initialize();
3617
- pages.config.initialize();
3618
- dialog.initialize();
3619
- }
3620
- // Handle additional valid message origins if specified
3621
- if (Array.isArray(validMessageOrigins)) {
3622
- processAdditionalValidOrigins(validMessageOrigins);
3623
- }
3624
- resolve(GlobalVars.initializePromise);
3625
- });
3626
- }
3627
3832
  /**
3628
3833
  * @hidden
3629
3834
  * Undocumented function used to set a mock window for unit tests
@@ -3649,10 +3854,10 @@ var app;
3649
3854
  uninitializeHandlers();
3650
3855
  GlobalVars.initializeCalled = false;
3651
3856
  GlobalVars.initializeCompleted = false;
3652
- GlobalVars.initializePromise = null;
3857
+ GlobalVars.initializePromise = undefined;
3653
3858
  GlobalVars.additionalValidOrigins = [];
3654
- GlobalVars.frameContext = null;
3655
- GlobalVars.hostClientType = null;
3859
+ GlobalVars.frameContext = undefined;
3860
+ GlobalVars.hostClientType = undefined;
3656
3861
  GlobalVars.isFramelessWindow = false;
3657
3862
  uninitializeCommunication();
3658
3863
  }
@@ -3665,7 +3870,7 @@ var app;
3665
3870
  function getContext() {
3666
3871
  return new Promise(function (resolve) {
3667
3872
  ensureInitializeCalled();
3668
- resolve(sendAndUnwrap('getContext'));
3873
+ resolve(sendAndUnwrapWithVersion(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_GetContext), 'getContext'));
3669
3874
  }).then(function (legacyContext) { return transformLegacyContextToAppContext(legacyContext); }); // converts globalcontext to app.context
3670
3875
  }
3671
3876
  app.getContext = getContext;
@@ -3674,7 +3879,7 @@ var app;
3674
3879
  */
3675
3880
  function notifyAppLoaded() {
3676
3881
  ensureInitializeCalled();
3677
- sendMessageToParent(app.Messages.AppLoaded, [version]);
3882
+ communication_sendMessageToParentWithVersion(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_NotifyAppLoaded), app.Messages.AppLoaded, [version]);
3678
3883
  }
3679
3884
  app.notifyAppLoaded = notifyAppLoaded;
3680
3885
  /**
@@ -3682,7 +3887,7 @@ var app;
3682
3887
  */
3683
3888
  function notifySuccess() {
3684
3889
  ensureInitializeCalled();
3685
- sendMessageToParent(app.Messages.Success, [version]);
3890
+ communication_sendMessageToParentWithVersion(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_NotifySuccess), app.Messages.Success, [version]);
3686
3891
  }
3687
3892
  app.notifySuccess = notifySuccess;
3688
3893
  /**
@@ -3693,10 +3898,7 @@ var app;
3693
3898
  */
3694
3899
  function notifyFailure(appInitializationFailedRequest) {
3695
3900
  ensureInitializeCalled();
3696
- sendMessageToParent(app.Messages.Failure, [
3697
- appInitializationFailedRequest.reason,
3698
- appInitializationFailedRequest.message,
3699
- ]);
3901
+ communication_sendMessageToParentWithVersion(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_NotifyFailure), app.Messages.Failure, [appInitializationFailedRequest.reason, appInitializationFailedRequest.message]);
3700
3902
  }
3701
3903
  app.notifyFailure = notifyFailure;
3702
3904
  /**
@@ -3706,7 +3908,7 @@ var app;
3706
3908
  */
3707
3909
  function notifyExpectedFailure(expectedFailureRequest) {
3708
3910
  ensureInitializeCalled();
3709
- sendMessageToParent(app.Messages.ExpectedFailure, [expectedFailureRequest.reason, expectedFailureRequest.message]);
3911
+ communication_sendMessageToParentWithVersion(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_NotifyExpectedFailure), app.Messages.ExpectedFailure, [expectedFailureRequest.reason, expectedFailureRequest.message]);
3710
3912
  }
3711
3913
  app.notifyExpectedFailure = notifyExpectedFailure;
3712
3914
  /**
@@ -3718,9 +3920,7 @@ var app;
3718
3920
  * @param handler - The handler to invoke when the user changes their theme.
3719
3921
  */
3720
3922
  function registerOnThemeChangeHandler(handler) {
3721
- // allow for registration cleanup even when not called initialize
3722
- handler && ensureInitializeCalled();
3723
- handlers_registerOnThemeChangeHandler(handler);
3923
+ registerOnThemeChangeHandlerHelper(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_RegisterOnThemeChangeHandler), handler);
3724
3924
  }
3725
3925
  app.registerOnThemeChangeHandler = registerOnThemeChangeHandler;
3726
3926
  /**
@@ -3730,10 +3930,7 @@ var app;
3730
3930
  * @returns Promise that will be fulfilled when the operation has completed
3731
3931
  */
3732
3932
  function openLink(deepLink) {
3733
- return new Promise(function (resolve) {
3734
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
3735
- resolve(sendAndHandleStatusAndReason('executeDeepLink', deepLink));
3736
- });
3933
+ return openLinkHelper(getApiVersionTag(appTelemetryVersionNumber, ApiName.App_OpenLink), deepLink);
3737
3934
  }
3738
3935
  app.openLink = openLink;
3739
3936
  /**
@@ -3759,9 +3956,7 @@ var app;
3759
3956
  if (!handler) {
3760
3957
  throw new Error('[app.lifecycle.registerBeforeSuspendOrTerminateHandler] Handler cannot be null');
3761
3958
  }
3762
- if (!isSupported()) {
3763
- throw errorNotSupportedOnPlatform;
3764
- }
3959
+ internalAPIs_ensureInitialized(runtime_runtime);
3765
3960
  handlers_registerBeforeSuspendOrTerminateHandler(handler);
3766
3961
  }
3767
3962
  lifecycle.registerBeforeSuspendOrTerminateHandler = registerBeforeSuspendOrTerminateHandler;
@@ -3777,24 +3972,10 @@ var app;
3777
3972
  if (!handler) {
3778
3973
  throw new Error('[app.lifecycle.registerOnResumeHandler] Handler cannot be null');
3779
3974
  }
3780
- if (!isSupported()) {
3781
- throw errorNotSupportedOnPlatform;
3782
- }
3975
+ internalAPIs_ensureInitialized(runtime_runtime);
3783
3976
  handlers_registerOnResumeHandler(handler);
3784
3977
  }
3785
3978
  lifecycle.registerOnResumeHandler = registerOnResumeHandler;
3786
- /**
3787
- * Checks if app.lifecycle is supported by the host.
3788
- * @returns boolean to represent whether the lifecycle capability is supported
3789
- * @throws Error if {@linkcode app.initialize} has not successfully completed
3790
- *
3791
- * @beta
3792
- */
3793
- function isSupported() {
3794
- var _a;
3795
- return ensureInitialized(runtime) && !!((_a = runtime.supports.app) === null || _a === void 0 ? void 0 : _a.lifecycle);
3796
- }
3797
- lifecycle.isSupported = isSupported;
3798
3979
  })(lifecycle = app.lifecycle || (app.lifecycle = {}));
3799
3980
  })(app || (app = {}));
3800
3981
  /**
@@ -3805,6 +3986,7 @@ var app;
3805
3986
  * Limited to Microsoft-internal use
3806
3987
  */
3807
3988
  function transformLegacyContextToAppContext(legacyContext) {
3989
+ var _a;
3808
3990
  var context = {
3809
3991
  actionInfo: legacyContext.actionInfo,
3810
3992
  app: {
@@ -3826,6 +4008,8 @@ function transformLegacyContextToAppContext(legacyContext) {
3826
4008
  },
3827
4009
  page: {
3828
4010
  id: legacyContext.entityId,
4011
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
4012
+ // @ts-ignore
3829
4013
  frameContext: legacyContext.frameContext ? legacyContext.frameContext : GlobalVars.frameContext,
3830
4014
  subPageId: legacyContext.subEntityId,
3831
4015
  isFullScreen: legacyContext.isFullScreen,
@@ -3833,7 +4017,7 @@ function transformLegacyContextToAppContext(legacyContext) {
3833
4017
  sourceOrigin: legacyContext.sourceOrigin,
3834
4018
  },
3835
4019
  user: {
3836
- id: legacyContext.userObjectId,
4020
+ id: (_a = legacyContext.userObjectId) !== null && _a !== void 0 ? _a : '',
3837
4021
  displayName: legacyContext.userDisplayName,
3838
4022
  isCallingAllowed: legacyContext.isCallingAllowed,
3839
4023
  isPSTNCallingAllowed: legacyContext.isPSTNCallingAllowed,
@@ -3906,6 +4090,87 @@ function transformLegacyContextToAppContext(legacyContext) {
3906
4090
 
3907
4091
 
3908
4092
 
4093
+
4094
+
4095
+ /**
4096
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
4097
+ */
4098
+ var pagesTelemetryVersionNumber = ApiVersionNumber.V_2;
4099
+ function navigateCrossDomainHelper(apiVersionTag, url) {
4100
+ return new Promise(function (resolve) {
4101
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4102
+ if (!pages.isSupported()) {
4103
+ throw errorNotSupportedOnPlatform;
4104
+ }
4105
+ var errorMessage = 'Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.';
4106
+ resolve(sendAndHandleStatusAndReasonWithDefaultErrorWithVersion(apiVersionTag, 'navigateCrossDomain', errorMessage, url));
4107
+ });
4108
+ }
4109
+ function backStackNavigateBackHelper(apiVersionTag) {
4110
+ return new Promise(function (resolve) {
4111
+ internalAPIs_ensureInitialized(runtime_runtime);
4112
+ if (!pages.backStack.isSupported()) {
4113
+ throw errorNotSupportedOnPlatform;
4114
+ }
4115
+ var errorMessage = 'Back navigation is not supported in the current client or context.';
4116
+ resolve(sendAndHandleStatusAndReasonWithDefaultErrorWithVersion(apiVersionTag, 'navigateBack', errorMessage));
4117
+ });
4118
+ }
4119
+ function tabsNavigateToTabHelper(apiVersionTag, tabInstance) {
4120
+ return new Promise(function (resolve) {
4121
+ internalAPIs_ensureInitialized(runtime_runtime);
4122
+ if (!pages.tabs.isSupported()) {
4123
+ throw errorNotSupportedOnPlatform;
4124
+ }
4125
+ var errorMessage = 'Invalid internalTabInstanceId and/or channelId were/was provided';
4126
+ resolve(sendAndHandleStatusAndReasonWithDefaultErrorWithVersion(apiVersionTag, 'navigateToTab', errorMessage, tabInstance));
4127
+ });
4128
+ }
4129
+ function returnFocusHelper(apiVersionTag, navigateForward) {
4130
+ internalAPIs_ensureInitialized(runtime_runtime);
4131
+ if (!pages.isSupported()) {
4132
+ throw errorNotSupportedOnPlatform;
4133
+ }
4134
+ communication_sendMessageToParentWithVersion(apiVersionTag, 'returnFocus', [navigateForward]);
4135
+ }
4136
+ function getTabInstancesHelper(apiVersionTag, tabInstanceParameters) {
4137
+ return new Promise(function (resolve) {
4138
+ internalAPIs_ensureInitialized(runtime_runtime);
4139
+ if (!pages.tabs.isSupported()) {
4140
+ throw errorNotSupportedOnPlatform;
4141
+ }
4142
+ /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
4143
+ resolve(sendAndUnwrapWithVersion(apiVersionTag, 'getTabInstances', tabInstanceParameters));
4144
+ });
4145
+ }
4146
+ function getMruTabInstancesHelper(apiVersionTag, tabInstanceParameters) {
4147
+ return new Promise(function (resolve) {
4148
+ internalAPIs_ensureInitialized(runtime_runtime);
4149
+ if (!pages.tabs.isSupported()) {
4150
+ throw errorNotSupportedOnPlatform;
4151
+ }
4152
+ /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
4153
+ resolve(sendAndUnwrapWithVersion(apiVersionTag, 'getMruTabInstances', tabInstanceParameters));
4154
+ });
4155
+ }
4156
+ function shareDeepLinkHelper(apiVersionTag, deepLinkParameters) {
4157
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
4158
+ if (!pages.isSupported()) {
4159
+ throw errorNotSupportedOnPlatform;
4160
+ }
4161
+ communication_sendMessageToParentWithVersion(apiVersionTag, 'shareDeepLink', [
4162
+ deepLinkParameters.subPageId,
4163
+ deepLinkParameters.subPageLabel,
4164
+ deepLinkParameters.subPageWebUrl,
4165
+ ]);
4166
+ }
4167
+ function setCurrentFrameHelper(apiVersionTag, frameInfo) {
4168
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
4169
+ if (!pages.isSupported()) {
4170
+ throw errorNotSupportedOnPlatform;
4171
+ }
4172
+ communication_sendMessageToParentWithVersion(apiVersionTag, 'setFrameContext', [frameInfo]);
4173
+ }
3909
4174
  /**
3910
4175
  * Navigation-specific part of the SDK.
3911
4176
  */
@@ -3919,11 +4184,7 @@ var pages;
3919
4184
  * @param navigateForward - Determines the direction to focus in host.
3920
4185
  */
3921
4186
  function returnFocus(navigateForward) {
3922
- ensureInitialized(runtime);
3923
- if (!isSupported()) {
3924
- throw errorNotSupportedOnPlatform;
3925
- }
3926
- sendMessageToParent('returnFocus', [navigateForward]);
4187
+ returnFocusHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_ReturnFocus), navigateForward);
3927
4188
  }
3928
4189
  pages.returnFocus = returnFocus;
3929
4190
  /**
@@ -3939,7 +4200,7 @@ var pages;
3939
4200
  * Limited to Microsoft-internal use
3940
4201
  */
3941
4202
  function registerFocusEnterHandler(handler) {
3942
- registerHandlerHelper('focusEnter', handler, [], function () {
4203
+ registerHandlerHelperWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_RegisterFocusEnterHandler), 'focusEnter', handler, [], function () {
3943
4204
  if (!isSupported()) {
3944
4205
  throw errorNotSupportedOnPlatform;
3945
4206
  }
@@ -3953,11 +4214,7 @@ var pages;
3953
4214
  * user clicks 'Go To Website'
3954
4215
  */
3955
4216
  function setCurrentFrame(frameInfo) {
3956
- ensureInitialized(runtime, FrameContexts.content);
3957
- if (!isSupported()) {
3958
- throw errorNotSupportedOnPlatform;
3959
- }
3960
- sendMessageToParent('setFrameContext', [frameInfo]);
4217
+ setCurrentFrameHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_SetCurrentFrame), frameInfo);
3961
4218
  }
3962
4219
  pages.setCurrentFrame = setCurrentFrame;
3963
4220
  /**
@@ -3980,11 +4237,11 @@ var pages;
3980
4237
  */
3981
4238
  function getConfig() {
3982
4239
  return new Promise(function (resolve) {
3983
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
4240
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
3984
4241
  if (!isSupported()) {
3985
4242
  throw errorNotSupportedOnPlatform;
3986
4243
  }
3987
- resolve(sendAndUnwrap('settings.getSettings'));
4244
+ resolve(sendAndUnwrapWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_GetConfig), 'settings.getSettings'));
3988
4245
  });
3989
4246
  }
3990
4247
  pages.getConfig = getConfig;
@@ -3998,14 +4255,7 @@ var pages;
3998
4255
  * @returns Promise that resolves when the navigation has completed.
3999
4256
  */
4000
4257
  function navigateCrossDomain(url) {
4001
- return new Promise(function (resolve) {
4002
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4003
- if (!isSupported()) {
4004
- throw errorNotSupportedOnPlatform;
4005
- }
4006
- var errorMessage = 'Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.';
4007
- resolve(sendAndHandleStatusAndReasonWithDefaultError('navigateCrossDomain', errorMessage, url));
4008
- });
4258
+ return navigateCrossDomainHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_NavigateCrossDomain), url);
4009
4259
  }
4010
4260
  pages.navigateCrossDomain = navigateCrossDomain;
4011
4261
  /**
@@ -4019,15 +4269,16 @@ var pages;
4019
4269
  */
4020
4270
  function navigateToApp(params) {
4021
4271
  return new Promise(function (resolve) {
4022
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4272
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4023
4273
  if (!isSupported()) {
4024
4274
  throw errorNotSupportedOnPlatform;
4025
4275
  }
4026
- if (runtime.isLegacyTeams) {
4027
- resolve(sendAndHandleStatusAndReason('executeDeepLink', createTeamsAppLink(params)));
4276
+ var apiVersionTag = getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_NavigateCrossDomain);
4277
+ if (runtime_runtime.isLegacyTeams) {
4278
+ resolve(sendAndHandleStatusAndReasonWithVersion(apiVersionTag, 'executeDeepLink', createTeamsAppLink(params)));
4028
4279
  }
4029
4280
  else {
4030
- resolve(sendAndHandleStatusAndReason('pages.navigateToApp', params));
4281
+ resolve(sendAndHandleStatusAndReasonWithVersion(apiVersionTag, 'pages.navigateToApp', params));
4031
4282
  }
4032
4283
  });
4033
4284
  }
@@ -4039,15 +4290,7 @@ var pages;
4039
4290
  * @param deepLinkParameters - ID and label for the link and fallback URL.
4040
4291
  */
4041
4292
  function shareDeepLink(deepLinkParameters) {
4042
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
4043
- if (!isSupported()) {
4044
- throw errorNotSupportedOnPlatform;
4045
- }
4046
- sendMessageToParent('shareDeepLink', [
4047
- deepLinkParameters.subPageId,
4048
- deepLinkParameters.subPageLabel,
4049
- deepLinkParameters.subPageWebUrl,
4050
- ]);
4293
+ return shareDeepLinkHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_ShareDeepLink), deepLinkParameters);
4051
4294
  }
4052
4295
  pages.shareDeepLink = shareDeepLink;
4053
4296
  /**
@@ -4058,8 +4301,8 @@ var pages;
4058
4301
  * @param handler - The handler to invoke when the user toggles full-screen view for a tab.
4059
4302
  */
4060
4303
  function registerFullScreenHandler(handler) {
4061
- registerHandlerHelper('fullScreenChange', handler, [], function () {
4062
- if (handler && !isSupported()) {
4304
+ registerHandlerHelperWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_RegisterFullScreenHandler), 'fullScreenChange', handler, [], function () {
4305
+ if (!isNullOrUndefined(handler) && !isSupported()) {
4063
4306
  throw errorNotSupportedOnPlatform;
4064
4307
  }
4065
4308
  });
@@ -4072,7 +4315,7 @@ var pages;
4072
4315
  * @throws Error if {@linkcode app.initialize} has not successfully completed
4073
4316
  */
4074
4317
  function isSupported() {
4075
- return ensureInitialized(runtime) && runtime.supports.pages ? true : false;
4318
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.pages ? true : false;
4076
4319
  }
4077
4320
  pages.isSupported = isSupported;
4078
4321
  /**
@@ -4087,14 +4330,7 @@ var pages;
4087
4330
  * @returns Promise that resolves when the navigation has completed.
4088
4331
  */
4089
4332
  function navigateToTab(tabInstance) {
4090
- return new Promise(function (resolve) {
4091
- ensureInitialized(runtime);
4092
- if (!isSupported()) {
4093
- throw errorNotSupportedOnPlatform;
4094
- }
4095
- var errorMessage = 'Invalid internalTabInstanceId and/or channelId were/was provided';
4096
- resolve(sendAndHandleStatusAndReasonWithDefaultError('navigateToTab', errorMessage, tabInstance));
4097
- });
4333
+ return tabsNavigateToTabHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Tabs_NavigateToTab), tabInstance);
4098
4334
  }
4099
4335
  tabs.navigateToTab = navigateToTab;
4100
4336
  /**
@@ -4104,14 +4340,7 @@ var pages;
4104
4340
  * @returns Promise that resolves with the {@link TabInformation}. Contains information for the user's tabs that are owned by this application {@link TabInstance}.
4105
4341
  */
4106
4342
  function getTabInstances(tabInstanceParameters) {
4107
- return new Promise(function (resolve) {
4108
- ensureInitialized(runtime);
4109
- if (!isSupported()) {
4110
- throw errorNotSupportedOnPlatform;
4111
- }
4112
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
4113
- resolve(sendAndUnwrap('getTabInstances', tabInstanceParameters));
4114
- });
4343
+ return getTabInstancesHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Tabs_GetTabInstances), tabInstanceParameters);
4115
4344
  }
4116
4345
  tabs.getTabInstances = getTabInstances;
4117
4346
  /**
@@ -4120,14 +4349,7 @@ var pages;
4120
4349
  * @returns Promise that resolves with the {@link TabInformation}. Contains information for the users' most recently used tabs {@link TabInstance}.
4121
4350
  */
4122
4351
  function getMruTabInstances(tabInstanceParameters) {
4123
- return new Promise(function (resolve) {
4124
- ensureInitialized(runtime);
4125
- if (!isSupported()) {
4126
- throw errorNotSupportedOnPlatform;
4127
- }
4128
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
4129
- resolve(sendAndUnwrap('getMruTabInstances', tabInstanceParameters));
4130
- });
4352
+ return getMruTabInstancesHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Tabs_GetMruTabInstances), tabInstanceParameters);
4131
4353
  }
4132
4354
  tabs.getMruTabInstances = getMruTabInstances;
4133
4355
  /**
@@ -4137,8 +4359,8 @@ var pages;
4137
4359
  * @throws Error if {@linkcode app.initialize} has not successfully completed
4138
4360
  */
4139
4361
  function isSupported() {
4140
- return ensureInitialized(runtime) && runtime.supports.pages
4141
- ? runtime.supports.pages.tabs
4362
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.pages
4363
+ ? runtime_runtime.supports.pages.tabs
4142
4364
  ? true
4143
4365
  : false
4144
4366
  : false;
@@ -4172,11 +4394,11 @@ var pages;
4172
4394
  * @param validityState - Indicates whether the save or remove button is enabled for the user.
4173
4395
  */
4174
4396
  function setValidityState(validityState) {
4175
- ensureInitialized(runtime, FrameContexts.settings, FrameContexts.remove);
4397
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.settings, FrameContexts.remove);
4176
4398
  if (!isSupported()) {
4177
4399
  throw errorNotSupportedOnPlatform;
4178
4400
  }
4179
- sendMessageToParent('settings.setValidityState', [validityState]);
4401
+ communication_sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_SetValidityState), 'settings.setValidityState', [validityState]);
4180
4402
  }
4181
4403
  config.setValidityState = setValidityState;
4182
4404
  /**
@@ -4187,11 +4409,11 @@ var pages;
4187
4409
  */
4188
4410
  function setConfig(instanceConfig) {
4189
4411
  return new Promise(function (resolve) {
4190
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
4412
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
4191
4413
  if (!isSupported()) {
4192
4414
  throw errorNotSupportedOnPlatform;
4193
4415
  }
4194
- resolve(sendAndHandleStatusAndReason('settings.setSettings', instanceConfig));
4416
+ resolve(sendAndHandleStatusAndReasonWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_SetConfig), 'settings.setSettings', instanceConfig));
4195
4417
  });
4196
4418
  }
4197
4419
  config.setConfig = setConfig;
@@ -4204,7 +4426,7 @@ var pages;
4204
4426
  */
4205
4427
  function registerOnSaveHandler(handler) {
4206
4428
  registerOnSaveHandlerHelper(handler, function () {
4207
- if (handler && !isSupported()) {
4429
+ if (!isNullOrUndefined(handler) && !isSupported()) {
4208
4430
  throw errorNotSupportedOnPlatform;
4209
4431
  }
4210
4432
  });
@@ -4222,12 +4444,13 @@ var pages;
4222
4444
  */
4223
4445
  function registerOnSaveHandlerHelper(handler, versionSpecificHelper) {
4224
4446
  // allow for registration cleanup even when not finished initializing
4225
- handler && ensureInitialized(runtime, FrameContexts.settings);
4447
+ !isNullOrUndefined(handler) && internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.settings);
4226
4448
  if (versionSpecificHelper) {
4227
4449
  versionSpecificHelper();
4228
4450
  }
4229
4451
  saveHandler = handler;
4230
- handler && sendMessageToParent('registerHandler', ['save']);
4452
+ !isNullOrUndefined(handler) &&
4453
+ communication_sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_RegisterOnSaveHandlerHelper), 'registerHandler', ['save']);
4231
4454
  }
4232
4455
  config.registerOnSaveHandlerHelper = registerOnSaveHandlerHelper;
4233
4456
  /**
@@ -4239,7 +4462,7 @@ var pages;
4239
4462
  */
4240
4463
  function registerOnRemoveHandler(handler) {
4241
4464
  registerOnRemoveHandlerHelper(handler, function () {
4242
- if (handler && !isSupported()) {
4465
+ if (!isNullOrUndefined(handler) && !isSupported()) {
4243
4466
  throw errorNotSupportedOnPlatform;
4244
4467
  }
4245
4468
  });
@@ -4257,12 +4480,13 @@ var pages;
4257
4480
  */
4258
4481
  function registerOnRemoveHandlerHelper(handler, versionSpecificHelper) {
4259
4482
  // allow for registration cleanup even when not finished initializing
4260
- handler && ensureInitialized(runtime, FrameContexts.remove, FrameContexts.settings);
4483
+ !isNullOrUndefined(handler) && internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.remove, FrameContexts.settings);
4261
4484
  if (versionSpecificHelper) {
4262
4485
  versionSpecificHelper();
4263
4486
  }
4264
4487
  removeHandler = handler;
4265
- handler && sendMessageToParent('registerHandler', ['remove']);
4488
+ !isNullOrUndefined(handler) &&
4489
+ communication_sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_RegisterOnRemoveHandlerHelper), 'registerHandler', ['remove']);
4266
4490
  }
4267
4491
  config.registerOnRemoveHandlerHelper = registerOnRemoveHandlerHelper;
4268
4492
  function handleSave(result) {
@@ -4283,7 +4507,7 @@ var pages;
4283
4507
  * @param handler - The handler to invoke when the user clicks on Settings.
4284
4508
  */
4285
4509
  function registerChangeConfigHandler(handler) {
4286
- registerHandlerHelper('changeSettings', handler, [FrameContexts.content], function () {
4510
+ registerHandlerHelperWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_Config_RegisterChangeConfigHandler), 'changeSettings', handler, [FrameContexts.content], function () {
4287
4511
  if (!isSupported()) {
4288
4512
  throw errorNotSupportedOnPlatform;
4289
4513
  }
@@ -4301,12 +4525,12 @@ var pages;
4301
4525
  }
4302
4526
  SaveEventImpl.prototype.notifySuccess = function () {
4303
4527
  this.ensureNotNotified();
4304
- sendMessageToParent('settings.save.success');
4528
+ communication_sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Settings_Save_Success), 'settings.save.success');
4305
4529
  this.notified = true;
4306
4530
  };
4307
4531
  SaveEventImpl.prototype.notifyFailure = function (reason) {
4308
4532
  this.ensureNotNotified();
4309
- sendMessageToParent('settings.save.failure', [reason]);
4533
+ communication_sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Settings_Save_Failure), 'settings.save.failure', [reason]);
4310
4534
  this.notified = true;
4311
4535
  };
4312
4536
  SaveEventImpl.prototype.ensureNotNotified = function () {
@@ -4339,12 +4563,12 @@ var pages;
4339
4563
  }
4340
4564
  RemoveEventImpl.prototype.notifySuccess = function () {
4341
4565
  this.ensureNotNotified();
4342
- sendMessageToParent('settings.remove.success');
4566
+ communication_sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Settings_Remove_Success), 'settings.remove.success');
4343
4567
  this.notified = true;
4344
4568
  };
4345
4569
  RemoveEventImpl.prototype.notifyFailure = function (reason) {
4346
4570
  this.ensureNotNotified();
4347
- sendMessageToParent('settings.remove.failure', [reason]);
4571
+ communication_sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Settings_Remove_Failure), 'settings.remove.failure', [reason]);
4348
4572
  this.notified = true;
4349
4573
  };
4350
4574
  RemoveEventImpl.prototype.ensureNotNotified = function () {
@@ -4361,8 +4585,8 @@ var pages;
4361
4585
  * @throws Error if {@linkcode app.initialize} has not successfully completed
4362
4586
  */
4363
4587
  function isSupported() {
4364
- return ensureInitialized(runtime) && runtime.supports.pages
4365
- ? runtime.supports.pages.config
4588
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.pages
4589
+ ? runtime_runtime.supports.pages.config
4366
4590
  ? true
4367
4591
  : false
4368
4592
  : false;
@@ -4391,14 +4615,7 @@ var pages;
4391
4615
  * @returns Promise that resolves when the navigation has completed.
4392
4616
  */
4393
4617
  function navigateBack() {
4394
- return new Promise(function (resolve) {
4395
- ensureInitialized(runtime);
4396
- if (!isSupported()) {
4397
- throw errorNotSupportedOnPlatform;
4398
- }
4399
- var errorMessage = 'Back navigation is not supported in the current client or context.';
4400
- resolve(sendAndHandleStatusAndReasonWithDefaultError('navigateBack', errorMessage));
4401
- });
4618
+ return backStackNavigateBackHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_BackStack_NavigateBack));
4402
4619
  }
4403
4620
  backStack.navigateBack = navigateBack;
4404
4621
  /**
@@ -4409,8 +4626,8 @@ var pages;
4409
4626
  * @param handler - The handler to invoke when the user presses the host client's back button.
4410
4627
  */
4411
4628
  function registerBackButtonHandler(handler) {
4412
- registerBackButtonHandlerHelper(handler, function () {
4413
- if (handler && !isSupported()) {
4629
+ registerBackButtonHandlerHelper(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_BackStack_RegisterBackButtonHandler), handler, function () {
4630
+ if (!isNullOrUndefined(handler) && !isSupported()) {
4414
4631
  throw errorNotSupportedOnPlatform;
4415
4632
  }
4416
4633
  });
@@ -4422,18 +4639,18 @@ var pages;
4422
4639
  *
4423
4640
  * @internal
4424
4641
  * Limited to Microsoft-internal use
4425
- *
4642
+ * @param apiVersionTag - The tag indicating API version number with name
4426
4643
  * @param handler - The handler to invoke when the user presses the host client's back button.
4427
4644
  * @param versionSpecificHelper - The helper function containing logic pertaining to a specific version of the API.
4428
4645
  */
4429
- function registerBackButtonHandlerHelper(handler, versionSpecificHelper) {
4646
+ function registerBackButtonHandlerHelper(apiVersionTag, handler, versionSpecificHelper) {
4430
4647
  // allow for registration cleanup even when not finished initializing
4431
- handler && ensureInitialized(runtime);
4648
+ !isNullOrUndefined(handler) && internalAPIs_ensureInitialized(runtime_runtime);
4432
4649
  if (versionSpecificHelper) {
4433
4650
  versionSpecificHelper();
4434
4651
  }
4435
4652
  backButtonPressHandler = handler;
4436
- handler && sendMessageToParent('registerHandler', ['backButton']);
4653
+ !isNullOrUndefined(handler) && communication_sendMessageToParentWithVersion(apiVersionTag, 'registerHandler', ['backButton']);
4437
4654
  }
4438
4655
  backStack.registerBackButtonHandlerHelper = registerBackButtonHandlerHelper;
4439
4656
  function handleBackButtonPress() {
@@ -4454,8 +4671,8 @@ var pages;
4454
4671
  * @throws Error if {@linkcode app.initialize} has not successfully completed
4455
4672
  */
4456
4673
  function isSupported() {
4457
- return ensureInitialized(runtime) && runtime.supports.pages
4458
- ? runtime.supports.pages.backStack
4674
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.pages
4675
+ ? runtime_runtime.supports.pages.backStack
4459
4676
  ? true
4460
4677
  : false
4461
4678
  : false;
@@ -4477,11 +4694,11 @@ var pages;
4477
4694
  * Place the tab into full-screen mode.
4478
4695
  */
4479
4696
  function enterFullscreen() {
4480
- ensureInitialized(runtime, FrameContexts.content);
4697
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
4481
4698
  if (!isSupported()) {
4482
4699
  throw errorNotSupportedOnPlatform;
4483
4700
  }
4484
- sendMessageToParent('enterFullscreen', []);
4701
+ communication_sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_FullTrust_EnterFullscreen), 'enterFullscreen', []);
4485
4702
  }
4486
4703
  fullTrust.enterFullscreen = enterFullscreen;
4487
4704
  /**
@@ -4491,11 +4708,11 @@ var pages;
4491
4708
  * Reverts the tab into normal-screen mode.
4492
4709
  */
4493
4710
  function exitFullscreen() {
4494
- ensureInitialized(runtime, FrameContexts.content);
4711
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
4495
4712
  if (!isSupported()) {
4496
4713
  throw errorNotSupportedOnPlatform;
4497
4714
  }
4498
- sendMessageToParent('exitFullscreen', []);
4715
+ communication_sendMessageToParentWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_FullTrust_ExitFullscreen), 'exitFullscreen', []);
4499
4716
  }
4500
4717
  fullTrust.exitFullscreen = exitFullscreen;
4501
4718
  /**
@@ -4507,8 +4724,8 @@ var pages;
4507
4724
  * @throws Error if {@linkcode app.initialize} has not successfully completed
4508
4725
  */
4509
4726
  function isSupported() {
4510
- return ensureInitialized(runtime) && runtime.supports.pages
4511
- ? runtime.supports.pages.fullTrust
4727
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.pages
4728
+ ? runtime_runtime.supports.pages.fullTrust
4512
4729
  ? true
4513
4730
  : false
4514
4731
  : false;
@@ -4526,7 +4743,7 @@ var pages;
4526
4743
  * @param handler - The handler to invoke when the personal app button is clicked in the app bar.
4527
4744
  */
4528
4745
  function onClick(handler) {
4529
- registerHandlerHelper('appButtonClick', handler, [FrameContexts.content], function () {
4746
+ registerHandlerHelperWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_AppButton_OnClick), 'appButtonClick', handler, [FrameContexts.content], function () {
4530
4747
  if (!isSupported()) {
4531
4748
  throw errorNotSupportedOnPlatform;
4532
4749
  }
@@ -4539,7 +4756,7 @@ var pages;
4539
4756
  * @param handler - The handler to invoke when entering hover of the personal app button in the app bar.
4540
4757
  */
4541
4758
  function onHoverEnter(handler) {
4542
- registerHandlerHelper('appButtonHoverEnter', handler, [FrameContexts.content], function () {
4759
+ registerHandlerHelperWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_AppButton_OnHoverEnter), 'appButtonHoverEnter', handler, [FrameContexts.content], function () {
4543
4760
  if (!isSupported()) {
4544
4761
  throw errorNotSupportedOnPlatform;
4545
4762
  }
@@ -4552,7 +4769,7 @@ var pages;
4552
4769
  * @param handler - The handler to invoke when exiting hover of the personal app button in the app bar.
4553
4770
  */
4554
4771
  function onHoverLeave(handler) {
4555
- registerHandlerHelper('appButtonHoverLeave', handler, [FrameContexts.content], function () {
4772
+ registerHandlerHelperWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_AppButton_OnHoverLeave), 'appButtonHoverLeave', handler, [FrameContexts.content], function () {
4556
4773
  if (!isSupported()) {
4557
4774
  throw errorNotSupportedOnPlatform;
4558
4775
  }
@@ -4566,8 +4783,8 @@ var pages;
4566
4783
  * @throws Error if {@linkcode app.initialize} has not successfully completed
4567
4784
  */
4568
4785
  function isSupported() {
4569
- return ensureInitialized(runtime) && runtime.supports.pages
4570
- ? runtime.supports.pages.appButton
4786
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.pages
4787
+ ? runtime_runtime.supports.pages.appButton
4571
4788
  ? true
4572
4789
  : false
4573
4790
  : false;
@@ -4591,11 +4808,11 @@ var pages;
4591
4808
  */
4592
4809
  function navigateTo(params) {
4593
4810
  return new Promise(function (resolve) {
4594
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4811
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4595
4812
  if (!isSupported()) {
4596
4813
  throw errorNotSupportedOnPlatform;
4597
4814
  }
4598
- resolve(sendAndHandleSdkError('pages.currentApp.navigateTo', params));
4815
+ resolve(sendAndHandleSdkErrorWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_CurrentApp_NavigateTo), 'pages.currentApp.navigateTo', params));
4599
4816
  });
4600
4817
  }
4601
4818
  currentApp.navigateTo = navigateTo;
@@ -4606,11 +4823,11 @@ var pages;
4606
4823
  */
4607
4824
  function navigateToDefaultPage() {
4608
4825
  return new Promise(function (resolve) {
4609
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4826
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4610
4827
  if (!isSupported()) {
4611
4828
  throw errorNotSupportedOnPlatform;
4612
4829
  }
4613
- resolve(sendAndHandleSdkError('pages.currentApp.navigateToDefaultPage'));
4830
+ resolve(sendAndHandleSdkErrorWithVersion(getApiVersionTag(pagesTelemetryVersionNumber, ApiName.Pages_CurrentApp_NavigateToDefaultPage), 'pages.currentApp.navigateToDefaultPage'));
4614
4831
  });
4615
4832
  }
4616
4833
  currentApp.navigateToDefaultPage = navigateToDefaultPage;
@@ -4623,8 +4840,8 @@ var pages;
4623
4840
  * @beta
4624
4841
  */
4625
4842
  function isSupported() {
4626
- return ensureInitialized(runtime) && runtime.supports.pages
4627
- ? runtime.supports.pages.currentApp
4843
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.pages
4844
+ ? runtime_runtime.supports.pages.currentApp
4628
4845
  ? true
4629
4846
  : false
4630
4847
  : false;
@@ -4635,7 +4852,7 @@ var pages;
4635
4852
 
4636
4853
  ;// CONCATENATED MODULE: ./src/internal/handlers.ts
4637
4854
  /* eslint-disable @typescript-eslint/ban-types */
4638
- var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
4855
+ var handlers_spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
4639
4856
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4640
4857
  if (ar || !(i in from)) {
4641
4858
  if (!ar) ar = Array.prototype.slice.call(from, 0, i);
@@ -4649,6 +4866,8 @@ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from
4649
4866
 
4650
4867
 
4651
4868
 
4869
+
4870
+
4652
4871
  var handlersLogger = getLogger('handlers');
4653
4872
  /**
4654
4873
  * @internal
@@ -4683,6 +4902,17 @@ var HandlersPrivate = /** @class */ (function () {
4683
4902
  HandlersPrivate.resumeHandler = null;
4684
4903
  };
4685
4904
  HandlersPrivate.handlers = {};
4905
+ HandlersPrivate.themeChangeHandler = null;
4906
+ /**
4907
+ * @deprecated
4908
+ */
4909
+ HandlersPrivate.loadHandler = null;
4910
+ /**
4911
+ * @deprecated
4912
+ */
4913
+ HandlersPrivate.beforeUnloadHandler = null;
4914
+ HandlersPrivate.beforeSuspendOrTerminateHandler = null;
4915
+ HandlersPrivate.resumeHandler = null;
4686
4916
  return HandlersPrivate;
4687
4917
  }());
4688
4918
  /**
@@ -4720,6 +4950,21 @@ function callHandler(name, args) {
4720
4950
  return [false, undefined];
4721
4951
  }
4722
4952
  }
4953
+ /**
4954
+ * @internal
4955
+ * Limited to Microsoft-internal use
4956
+ */
4957
+ function registerHandlerWithVersion(getApiVersionTag, name, handler, sendMessage, args) {
4958
+ if (sendMessage === void 0) { sendMessage = true; }
4959
+ if (args === void 0) { args = []; }
4960
+ if (handler) {
4961
+ HandlersPrivate.handlers[name] = handler;
4962
+ sendMessage && sendMessageToParentWithVersion(getApiVersionTag, 'registerHandler', handlers_spreadArray([name], args, true));
4963
+ }
4964
+ else {
4965
+ delete HandlersPrivate.handlers[name];
4966
+ }
4967
+ }
4723
4968
  /**
4724
4969
  * @internal
4725
4970
  * Limited to Microsoft-internal use
@@ -4729,7 +4974,8 @@ function registerHandler(name, handler, sendMessage, args) {
4729
4974
  if (args === void 0) { args = []; }
4730
4975
  if (handler) {
4731
4976
  HandlersPrivate.handlers[name] = handler;
4732
- sendMessage && sendMessageToParent('registerHandler', __spreadArray([name], args, true));
4977
+ sendMessage &&
4978
+ communication_sendMessageToParentWithVersion(getApiVersionTag(ApiVersionNumber.V_0, ApiName.RegisterHandler), 'registerHandler', handlers_spreadArray([name], args, true));
4733
4979
  }
4734
4980
  else {
4735
4981
  delete HandlersPrivate.handlers[name];
@@ -4749,6 +4995,27 @@ function removeHandler(name) {
4749
4995
  function doesHandlerExist(name) {
4750
4996
  return HandlersPrivate.handlers[name] != null;
4751
4997
  }
4998
+ /**
4999
+ * @hidden
5000
+ * Undocumented helper function with shared code between deprecated version and current version of register*Handler APIs
5001
+ *
5002
+ * @internal
5003
+ * Limited to Microsoft-internal use
5004
+ *
5005
+ * @param apiVersionTag - The tag to indicate API version number with name
5006
+ * @param name - The name of the handler to register.
5007
+ * @param handler - The handler to invoke.
5008
+ * @param contexts - The context within which it is valid to register this handler.
5009
+ * @param registrationHelper - The helper function containing logic pertaining to a specific version of the API.
5010
+ */
5011
+ function registerHandlerHelperWithVersion(apiVersionTag, name, handler, contexts, registrationHelper) {
5012
+ // allow for registration cleanup even when not finished initializing
5013
+ handler && internalAPIs_ensureInitialized.apply(void 0, handlers_spreadArray([runtime_runtime], contexts, false));
5014
+ if (registrationHelper) {
5015
+ registrationHelper();
5016
+ }
5017
+ registerHandler(name, handler);
5018
+ }
4752
5019
  /**
4753
5020
  * @hidden
4754
5021
  * Undocumented helper function with shared code between deprecated version and current version of register*Handler APIs
@@ -4763,7 +5030,7 @@ function doesHandlerExist(name) {
4763
5030
  */
4764
5031
  function registerHandlerHelper(name, handler, contexts, registrationHelper) {
4765
5032
  // allow for registration cleanup even when not finished initializing
4766
- handler && ensureInitialized.apply(void 0, __spreadArray([runtime], contexts, false));
5033
+ handler && ensureInitialized.apply(void 0, handlers_spreadArray([runtime], contexts, false));
4767
5034
  if (registrationHelper) {
4768
5035
  registrationHelper();
4769
5036
  }
@@ -4773,9 +5040,9 @@ function registerHandlerHelper(name, handler, contexts, registrationHelper) {
4773
5040
  * @internal
4774
5041
  * Limited to Microsoft-internal use
4775
5042
  */
4776
- function handlers_registerOnThemeChangeHandler(handler) {
5043
+ function registerOnThemeChangeHandler(apiVersionTag, handler) {
4777
5044
  HandlersPrivate.themeChangeHandler = handler;
4778
- handler && sendMessageToParent('registerHandler', ['themeChange']);
5045
+ !isNullOrUndefined(handler) && communication_sendMessageToParentWithVersion(apiVersionTag, 'registerHandler', ['themeChange']);
4779
5046
  }
4780
5047
  /**
4781
5048
  * @internal
@@ -4797,7 +5064,10 @@ function handleThemeChange(theme) {
4797
5064
  */
4798
5065
  function handlers_registerOnLoadHandler(handler) {
4799
5066
  HandlersPrivate.loadHandler = handler;
4800
- handler && sendMessageToParent('registerHandler', ['load']);
5067
+ !isNullOrUndefined(handler) &&
5068
+ communication_sendMessageToParentWithVersion(getApiVersionTag(ApiVersionNumber.V_2, ApiName.RegisterHandler), 'registerHandler', [
5069
+ 'load',
5070
+ ]);
4801
5071
  }
4802
5072
  /**
4803
5073
  * @internal
@@ -4822,7 +5092,10 @@ function handleLoad(context) {
4822
5092
  */
4823
5093
  function handlers_registerBeforeUnloadHandler(handler) {
4824
5094
  HandlersPrivate.beforeUnloadHandler = handler;
4825
- handler && sendMessageToParent('registerHandler', ['beforeUnload']);
5095
+ !isNullOrUndefined(handler) &&
5096
+ communication_sendMessageToParentWithVersion(getApiVersionTag(ApiVersionNumber.V_2, ApiName.RegisterHandler), 'registerHandler', [
5097
+ 'beforeUnload',
5098
+ ]);
4826
5099
  }
4827
5100
  /**
4828
5101
  * @internal
@@ -4856,7 +5129,7 @@ function handleBeforeUnload() {
4856
5129
  */
4857
5130
  function handlers_registerBeforeSuspendOrTerminateHandler(handler) {
4858
5131
  HandlersPrivate.beforeSuspendOrTerminateHandler = handler;
4859
- handler && sendMessageToParent('registerHandler', ['beforeUnload']);
5132
+ !isNullOrUndefined(handler) && sendMessageToParent('registerHandler', ['beforeUnload']);
4860
5133
  }
4861
5134
  /**
4862
5135
  * @internal
@@ -4864,12 +5137,13 @@ function handlers_registerBeforeSuspendOrTerminateHandler(handler) {
4864
5137
  */
4865
5138
  function handlers_registerOnResumeHandler(handler) {
4866
5139
  HandlersPrivate.resumeHandler = handler;
4867
- handler && sendMessageToParent('registerHandler', ['load']);
5140
+ !isNullOrUndefined(handler) && sendMessageToParent('registerHandler', ['load']);
4868
5141
  }
4869
5142
 
4870
5143
  ;// CONCATENATED MODULE: ./src/internal/communication.ts
4871
5144
  /* eslint-disable @typescript-eslint/ban-types */
4872
5145
  /* eslint-disable @typescript-eslint/no-explicit-any */
5146
+ /* eslint-disable strict-null-checks/all */
4873
5147
  var communication_spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
4874
5148
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4875
5149
  if (ar || !(i in from)) {
@@ -4885,6 +5159,7 @@ var communication_spreadArray = (undefined && undefined.__spreadArray) || functi
4885
5159
 
4886
5160
 
4887
5161
 
5162
+
4888
5163
  var communicationLogger = getLogger('communication');
4889
5164
  /**
4890
5165
  * @internal
@@ -4914,7 +5189,7 @@ var CommunicationPrivate = /** @class */ (function () {
4914
5189
  * @internal
4915
5190
  * Limited to Microsoft-internal use
4916
5191
  */
4917
- function initializeCommunication(validMessageOrigins) {
5192
+ function initializeCommunication(validMessageOrigins, apiVersionTag) {
4918
5193
  // Listen for messages post to our window
4919
5194
  CommunicationPrivate.messageListener = function (evt) { return processMessage(evt); };
4920
5195
  // If we are in an iframe, our parent window is the one hosting us (i.e., window.parent); otherwise,
@@ -4944,7 +5219,7 @@ function initializeCommunication(validMessageOrigins) {
4944
5219
  // Send the initialized message to any origin, because at this point we most likely don't know the origin
4945
5220
  // of the parent window, and this message contains no data that could pose a security risk.
4946
5221
  Communication.parentOrigin = '*';
4947
- return sendMessageToParentAsync('initialize', [
5222
+ return sendMessageToParentAsyncWithVersion(apiVersionTag, 'initialize', [
4948
5223
  version,
4949
5224
  latestRuntimeApiVersion,
4950
5225
  ]).then(function (_a) {
@@ -4975,6 +5250,26 @@ function uninitializeCommunication() {
4975
5250
  CommunicationPrivate.callbacks = {};
4976
5251
  CommunicationPrivate.promiseCallbacks = {};
4977
5252
  }
5253
+ /**
5254
+ * @hidden
5255
+ * Send a message to parent and then unwrap result. Uses nativeInterface on mobile to communicate with parent context
5256
+ * Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
5257
+ * for telemetry work. The code inside of this function will be used to replace sendAndUnwrap function
5258
+ * and this function will be removed when the project is completed.
5259
+ *
5260
+ * @internal
5261
+ * Limited to Microsoft-internal use
5262
+ */
5263
+ function sendAndUnwrapWithVersion(apiVersionTag, actionName) {
5264
+ var args = [];
5265
+ for (var _i = 2; _i < arguments.length; _i++) {
5266
+ args[_i - 2] = arguments[_i];
5267
+ }
5268
+ return sendMessageToParentAsyncWithVersion(apiVersionTag, actionName, args).then(function (_a) {
5269
+ var result = _a[0];
5270
+ return result;
5271
+ });
5272
+ }
4978
5273
  /**
4979
5274
  * @internal
4980
5275
  * Limited to Microsoft-internal use
@@ -4989,6 +5284,25 @@ function sendAndUnwrap(actionName) {
4989
5284
  return result;
4990
5285
  });
4991
5286
  }
5287
+ /**
5288
+ * @hidden
5289
+ * Send a message to parent and then handle status and reason. Uses nativeInterface on mobile to communicate with parent context
5290
+ * Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
5291
+ * for telemetry work. The code inside of this function will be used to replace sendAndHandleStatusAndReason function
5292
+ * and this function will be removed when the project is completed.
5293
+ */
5294
+ function sendAndHandleStatusAndReasonWithVersion(apiVersionTag, actionName) {
5295
+ var args = [];
5296
+ for (var _i = 2; _i < arguments.length; _i++) {
5297
+ args[_i - 2] = arguments[_i];
5298
+ }
5299
+ return sendMessageToParentAsyncWithVersion(apiVersionTag, actionName, args).then(function (_a) {
5300
+ var wasSuccessful = _a[0], reason = _a[1];
5301
+ if (!wasSuccessful) {
5302
+ throw new Error(reason);
5303
+ }
5304
+ });
5305
+ }
4992
5306
  function sendAndHandleStatusAndReason(actionName) {
4993
5307
  var args = [];
4994
5308
  for (var _i = 1; _i < arguments.length; _i++) {
@@ -5001,6 +5315,28 @@ function sendAndHandleStatusAndReason(actionName) {
5001
5315
  }
5002
5316
  });
5003
5317
  }
5318
+ /**
5319
+ * @hidden
5320
+ * Send a message to parent and then handle status and reason with default error. Uses nativeInterface on mobile to communicate with parent context
5321
+ * Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
5322
+ * for telemetry work. The code inside of this function will be used to replace sendAndHandleStatusAndReasonWithDefaultError function
5323
+ * and this function will be removed when the project is completed.
5324
+ *
5325
+ * @internal
5326
+ * Limited to Microsoft-internal use
5327
+ */
5328
+ function sendAndHandleStatusAndReasonWithDefaultErrorWithVersion(apiVersionTag, actionName, defaultError) {
5329
+ var args = [];
5330
+ for (var _i = 3; _i < arguments.length; _i++) {
5331
+ args[_i - 3] = arguments[_i];
5332
+ }
5333
+ return sendMessageToParentAsyncWithVersion(apiVersionTag, actionName, args).then(function (_a) {
5334
+ var wasSuccessful = _a[0], reason = _a[1];
5335
+ if (!wasSuccessful) {
5336
+ throw new Error(reason ? reason : defaultError);
5337
+ }
5338
+ });
5339
+ }
5004
5340
  /**
5005
5341
  * @internal
5006
5342
  * Limited to Microsoft-internal use
@@ -5017,6 +5353,29 @@ function sendAndHandleStatusAndReasonWithDefaultError(actionName, defaultError)
5017
5353
  }
5018
5354
  });
5019
5355
  }
5356
+ /**
5357
+ * @hidden
5358
+ * Send a message to parent and then handle SDK error. Uses nativeInterface on mobile to communicate with parent context
5359
+ * Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
5360
+ * for telemetry work. The code inside of this function will be used to replace sendAndHandleSdkError function
5361
+ * and this function will be removed when the project is completed.
5362
+ *
5363
+ * @internal
5364
+ * Limited to Microsoft-internal use
5365
+ */
5366
+ function sendAndHandleSdkErrorWithVersion(apiVersionTag, actionName) {
5367
+ var args = [];
5368
+ for (var _i = 2; _i < arguments.length; _i++) {
5369
+ args[_i - 2] = arguments[_i];
5370
+ }
5371
+ return sendMessageToParentAsyncWithVersion(apiVersionTag, actionName, args).then(function (_a) {
5372
+ var error = _a[0], result = _a[1];
5373
+ if (error) {
5374
+ throw error;
5375
+ }
5376
+ return result;
5377
+ });
5378
+ }
5020
5379
  /**
5021
5380
  * @internal
5022
5381
  * Limited to Microsoft-internal use
@@ -5034,6 +5393,28 @@ function sendAndHandleSdkError(actionName) {
5034
5393
  return result;
5035
5394
  });
5036
5395
  }
5396
+ /**
5397
+ * @hidden
5398
+ * Send a message to parent asynchronously. Uses nativeInterface on mobile to communicate with parent context
5399
+ * Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
5400
+ * for telemetry work. The code inside of this function will be used to replace sendMessageToParentAsync function
5401
+ * and this function will be removed when the project is completed.
5402
+ *
5403
+ * @internal
5404
+ * Limited to Microsoft-internal use
5405
+ */
5406
+ function sendMessageToParentAsyncWithVersion(apiVersionTag, actionName, args) {
5407
+ if (args === void 0) { args = undefined; }
5408
+ if (!isFollowingApiVersionTagFormat(apiVersionTag)) {
5409
+ throw Error("apiVersionTag: ".concat(apiVersionTag, " passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check."));
5410
+ }
5411
+ return new Promise(function (resolve) {
5412
+ var request = sendMessageToParentHelper(apiVersionTag, actionName, args);
5413
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5414
+ // @ts-ignore
5415
+ resolve(waitForResponse(request.id));
5416
+ });
5417
+ }
5037
5418
  /**
5038
5419
  * @hidden
5039
5420
  * Send a message to parent. Uses nativeInterface on mobile to communicate with parent context
@@ -5044,8 +5425,7 @@ function sendAndHandleSdkError(actionName) {
5044
5425
  function sendMessageToParentAsync(actionName, args) {
5045
5426
  if (args === void 0) { args = undefined; }
5046
5427
  return new Promise(function (resolve) {
5047
- var request = sendMessageToParentHelper(actionName, args);
5048
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5428
+ var request = sendMessageToParentHelper(getApiVersionTag(ApiVersionNumber.V_0, 'testing'), actionName, args);
5049
5429
  resolve(waitForResponse(request.id));
5050
5430
  });
5051
5431
  }
@@ -5058,6 +5438,34 @@ function waitForResponse(requestId) {
5058
5438
  CommunicationPrivate.promiseCallbacks[requestId] = resolve;
5059
5439
  });
5060
5440
  }
5441
+ /**
5442
+ * @hidden
5443
+ * Send a message to parent. Uses nativeInterface on mobile to communicate with parent context
5444
+ * Additional apiVersionTag parameter is added, which provides the ability to send api version number to parent
5445
+ * for telemetry work. The code inside of this function will be used to replace sendMessageToParent function
5446
+ * and this function will be removed when the project is completed.
5447
+ */
5448
+ function communication_sendMessageToParentWithVersion(apiVersionTag, actionName, argsOrCallback, callback) {
5449
+ var args;
5450
+ if (argsOrCallback instanceof Function) {
5451
+ callback = argsOrCallback;
5452
+ }
5453
+ else if (argsOrCallback instanceof Array) {
5454
+ args = argsOrCallback;
5455
+ }
5456
+ if (!isFollowingApiVersionTagFormat(apiVersionTag)) {
5457
+ throw Error("apiVersionTag: ".concat(apiVersionTag, " passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check."));
5458
+ }
5459
+ // APIs with v0 represents beta changes haven't been implemented on them
5460
+ // Otherwise, minimum version number will be v1
5461
+ /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5462
+ var request = sendMessageToParentHelper(apiVersionTag, actionName, args);
5463
+ if (callback) {
5464
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5465
+ // @ts-ignore
5466
+ CommunicationPrivate.callbacks[request.id] = callback;
5467
+ }
5468
+ }
5061
5469
  /**
5062
5470
  * @internal
5063
5471
  * Limited to Microsoft-internal use
@@ -5070,9 +5478,10 @@ function sendMessageToParent(actionName, argsOrCallback, callback) {
5070
5478
  else if (argsOrCallback instanceof Array) {
5071
5479
  args = argsOrCallback;
5072
5480
  }
5073
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5074
- var request = sendMessageToParentHelper(actionName, args);
5481
+ var request = sendMessageToParentHelper(getApiVersionTag(ApiVersionNumber.V_0, 'testing'), actionName, args);
5075
5482
  if (callback) {
5483
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5484
+ // @ts-ignore
5076
5485
  CommunicationPrivate.callbacks[request.id] = callback;
5077
5486
  }
5078
5487
  }
@@ -5081,15 +5490,13 @@ var sendMessageToParentHelperLogger = communicationLogger.extend('sendMessageToP
5081
5490
  * @internal
5082
5491
  * Limited to Microsoft-internal use
5083
5492
  */
5084
- function sendMessageToParentHelper(actionName, args) {
5493
+ function sendMessageToParentHelper(apiVersionTag, actionName, args) {
5085
5494
  var logger = sendMessageToParentHelperLogger;
5086
5495
  var targetWindow = Communication.parentWindow;
5087
- var request = createMessageRequest(actionName, args);
5088
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5496
+ var request = createMessageRequest(apiVersionTag, actionName, args);
5089
5497
  logger('Message %i information: %o', request.id, { actionName: actionName, args: args });
5090
5498
  if (GlobalVars.isFramelessWindow) {
5091
5499
  if (Communication.currentWindow && Communication.currentWindow.nativeInterface) {
5092
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5093
5500
  logger('Sending message %i to parent via framelessPostMessage interface', request.id);
5094
5501
  Communication.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(request));
5095
5502
  }
@@ -5099,12 +5506,10 @@ function sendMessageToParentHelper(actionName, args) {
5099
5506
  // If the target window isn't closed and we already know its origin, send the message right away; otherwise,
5100
5507
  // queue the message and send it after the origin is established
5101
5508
  if (targetWindow && targetOrigin) {
5102
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5103
5509
  logger('Sending message %i to parent via postMessage', request.id);
5104
5510
  targetWindow.postMessage(request, targetOrigin);
5105
5511
  }
5106
5512
  else {
5107
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5108
5513
  logger('Adding message %i to parent message queue', request.id);
5109
5514
  getTargetMessageQueue(targetWindow).push(request);
5110
5515
  }
@@ -5216,6 +5621,8 @@ function handleParentMessage(evt) {
5216
5621
  logger('Received a response from parent for message %i', message.id);
5217
5622
  if (callback) {
5218
5623
  logger('Invoking the registered callback for message %i with arguments %o', message.id, message.args);
5624
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5625
+ // @ts-ignore
5219
5626
  callback.apply(null, communication_spreadArray(communication_spreadArray([], message.args, true), [message.isPartialResponse], false));
5220
5627
  // Remove the callback to ensure that the callback is called only once and to free up memory if response is a complete response
5221
5628
  if (!isPartialResponse(evt)) {
@@ -5258,7 +5665,8 @@ function handleChildMessage(evt) {
5258
5665
  var message_1 = evt.data;
5259
5666
  var _a = callHandler(message_1.func, message_1.args), called = _a[0], result = _a[1];
5260
5667
  if (called && typeof result !== 'undefined') {
5261
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5668
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5669
+ // @ts-ignore
5262
5670
  sendMessageResponseToChild(message_1.id, Array.isArray(result) ? result : [result]);
5263
5671
  }
5264
5672
  else {
@@ -5270,7 +5678,8 @@ function handleChildMessage(evt) {
5270
5678
  }
5271
5679
  if (Communication.childWindow) {
5272
5680
  var isPartialResponse_1 = args.pop();
5273
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5681
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5682
+ // @ts-ignore
5274
5683
  sendMessageResponseToChild(message_1.id, args, isPartialResponse_1);
5275
5684
  }
5276
5685
  });
@@ -5311,7 +5720,7 @@ function flushMessageQueue(targetWindow) {
5311
5720
  while (targetWindow && targetOrigin && targetMessageQueue.length > 0) {
5312
5721
  var request = targetMessageQueue.shift();
5313
5722
  /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5314
- flushMessageQueueLogger('Flushing message %i from ' + target + ' message queue via postMessage.', request.id);
5723
+ flushMessageQueueLogger('Flushing message %i from ' + target + ' message queue via postMessage.', request === null || request === void 0 ? void 0 : request.id);
5315
5724
  targetWindow.postMessage(request, targetOrigin);
5316
5725
  }
5317
5726
  }
@@ -5336,7 +5745,6 @@ function waitForMessageQueue(targetWindow, callback) {
5336
5745
  */
5337
5746
  function sendMessageResponseToChild(id, args, isPartialResponse) {
5338
5747
  var targetWindow = Communication.childWindow;
5339
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5340
5748
  var response = createMessageResponse(id, args, isPartialResponse);
5341
5749
  var targetOrigin = getTargetOrigin(targetWindow);
5342
5750
  if (targetWindow && targetOrigin) {
@@ -5369,12 +5777,13 @@ function sendMessageEventToChild(actionName, args) {
5369
5777
  * @internal
5370
5778
  * Limited to Microsoft-internal use
5371
5779
  */
5372
- function createMessageRequest(func, args) {
5780
+ function createMessageRequest(apiVersionTag, func, args) {
5373
5781
  return {
5374
5782
  id: CommunicationPrivate.nextMessageId++,
5375
5783
  func: func,
5376
5784
  timestamp: Date.now(),
5377
5785
  args: args || [],
5786
+ apiversiontag: apiVersionTag,
5378
5787
  };
5379
5788
  }
5380
5789
  /**
@@ -5390,7 +5799,7 @@ function createMessageResponse(id, args, isPartialResponse) {
5390
5799
  }
5391
5800
  /**
5392
5801
  * @hidden
5393
- * Creates a message object without any id, used for custom actions being sent to child frame/window
5802
+ * Creates a message object without any id and api version, used for custom actions being sent to child frame/window
5394
5803
  *
5395
5804
  * @internal
5396
5805
  * Limited to Microsoft-internal use
@@ -5408,6 +5817,7 @@ function createMessageEvent(func, args) {
5408
5817
 
5409
5818
 
5410
5819
 
5820
+
5411
5821
  /**
5412
5822
  * @hidden
5413
5823
  * Namespace to interact with the logging part of the SDK.
@@ -5430,8 +5840,8 @@ var logs;
5430
5840
  */
5431
5841
  function registerGetLogHandler(handler) {
5432
5842
  // allow for registration cleanup even when not finished initializing
5433
- handler && ensureInitialized(runtime);
5434
- if (handler && !isSupported()) {
5843
+ !isNullOrUndefined(handler) && internalAPIs_ensureInitialized(runtime_runtime);
5844
+ if (!isNullOrUndefined(handler) && !isSupported()) {
5435
5845
  throw errorNotSupportedOnPlatform;
5436
5846
  }
5437
5847
  if (handler) {
@@ -5457,7 +5867,7 @@ var logs;
5457
5867
  * Limited to Microsoft-internal use
5458
5868
  */
5459
5869
  function isSupported() {
5460
- return ensureInitialized(runtime) && runtime.supports.logs ? true : false;
5870
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.logs ? true : false;
5461
5871
  }
5462
5872
  logs.isSupported = isSupported;
5463
5873
  })(logs || (logs = {}));
@@ -5528,7 +5938,7 @@ var UserSettingTypes;
5528
5938
  * Limited to Microsoft-internal use
5529
5939
  */
5530
5940
  function uploadCustomApp(manifestBlob, onComplete) {
5531
- ensureInitialized(runtime);
5941
+ internalAPIs_ensureInitialized(runtime_runtime);
5532
5942
  sendMessageToParent('uploadCustomApp', [manifestBlob], onComplete ? onComplete : getGenericOnCompleteHandler());
5533
5943
  }
5534
5944
  /**
@@ -5544,7 +5954,7 @@ function uploadCustomApp(manifestBlob, onComplete) {
5544
5954
  * Limited to Microsoft-internal use
5545
5955
  */
5546
5956
  function sendCustomMessage(actionName, args, callback) {
5547
- ensureInitialized(runtime);
5957
+ internalAPIs_ensureInitialized(runtime_runtime);
5548
5958
  sendMessageToParent(actionName, args, callback);
5549
5959
  }
5550
5960
  /**
@@ -5560,7 +5970,7 @@ function sendCustomMessage(actionName, args, callback) {
5560
5970
  * Limited to Microsoft-internal use
5561
5971
  */
5562
5972
  function sendCustomEvent(actionName, args) {
5563
- ensureInitialized(runtime);
5973
+ internalAPIs_ensureInitialized(runtime_runtime);
5564
5974
  //validate childWindow
5565
5975
  if (!Communication.childWindow) {
5566
5976
  throw new Error('The child window has not yet been initialized or is not present');
@@ -5579,7 +5989,7 @@ function sendCustomEvent(actionName, args) {
5579
5989
  */
5580
5990
  function registerCustomHandler(actionName, customHandler) {
5581
5991
  var _this = this;
5582
- ensureInitialized(runtime);
5992
+ internalAPIs_ensureInitialized(runtime_runtime);
5583
5993
  registerHandler(actionName, function () {
5584
5994
  var args = [];
5585
5995
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -5599,7 +6009,7 @@ function registerCustomHandler(actionName, customHandler) {
5599
6009
  * Limited to Microsoft-internal use
5600
6010
  */
5601
6011
  function registerUserSettingsChangeHandler(settingTypes, handler) {
5602
- ensureInitialized(runtime);
6012
+ internalAPIs_ensureInitialized(runtime_runtime);
5603
6013
  registerHandler('userSettingsChange', handler, true, [settingTypes]);
5604
6014
  }
5605
6015
  /**
@@ -5612,7 +6022,7 @@ function registerUserSettingsChangeHandler(settingTypes, handler) {
5612
6022
  * Limited to Microsoft-internal use
5613
6023
  */
5614
6024
  function openFilePreview(filePreviewParameters) {
5615
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6025
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
5616
6026
  var params = [
5617
6027
  filePreviewParameters.entityId,
5618
6028
  filePreviewParameters.title,
@@ -5660,7 +6070,7 @@ var conversations;
5660
6070
  */
5661
6071
  function openConversation(openConversationRequest) {
5662
6072
  return new Promise(function (resolve) {
5663
- ensureInitialized(runtime, FrameContexts.content);
6073
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
5664
6074
  if (!isSupported()) {
5665
6075
  throw errorNotSupportedOnPlatform;
5666
6076
  }
@@ -5673,7 +6083,8 @@ var conversations;
5673
6083
  });
5674
6084
  if (openConversationRequest.onStartConversation) {
5675
6085
  registerHandler('startConversation', function (subEntityId, conversationId, channelId, entityId) {
5676
- return openConversationRequest.onStartConversation({
6086
+ var _a;
6087
+ return (_a = openConversationRequest.onStartConversation) === null || _a === void 0 ? void 0 : _a.call(openConversationRequest, {
5677
6088
  subEntityId: subEntityId,
5678
6089
  conversationId: conversationId,
5679
6090
  channelId: channelId,
@@ -5683,7 +6094,8 @@ var conversations;
5683
6094
  }
5684
6095
  if (openConversationRequest.onCloseConversation) {
5685
6096
  registerHandler('closeConversation', function (subEntityId, conversationId, channelId, entityId) {
5686
- return openConversationRequest.onCloseConversation({
6097
+ var _a;
6098
+ return (_a = openConversationRequest.onCloseConversation) === null || _a === void 0 ? void 0 : _a.call(openConversationRequest, {
5687
6099
  subEntityId: subEntityId,
5688
6100
  conversationId: conversationId,
5689
6101
  channelId: channelId,
@@ -5704,7 +6116,7 @@ var conversations;
5704
6116
  * Limited to Microsoft-internal use
5705
6117
  */
5706
6118
  function closeConversation() {
5707
- ensureInitialized(runtime, FrameContexts.content);
6119
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
5708
6120
  if (!isSupported()) {
5709
6121
  throw errorNotSupportedOnPlatform;
5710
6122
  }
@@ -5728,7 +6140,7 @@ var conversations;
5728
6140
  */
5729
6141
  function getChatMembers() {
5730
6142
  return new Promise(function (resolve) {
5731
- ensureInitialized(runtime);
6143
+ internalAPIs_ensureInitialized(runtime_runtime);
5732
6144
  if (!isSupported()) {
5733
6145
  throw errorNotSupportedOnPlatform;
5734
6146
  }
@@ -5746,7 +6158,7 @@ var conversations;
5746
6158
  * Limited to Microsoft-internal use
5747
6159
  */
5748
6160
  function isSupported() {
5749
- return ensureInitialized(runtime) && runtime.supports.conversations ? true : false;
6161
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.conversations ? true : false;
5750
6162
  }
5751
6163
  conversations.isSupported = isSupported;
5752
6164
  })(conversations || (conversations = {}));
@@ -5834,11 +6246,11 @@ var appInstallDialog;
5834
6246
  */
5835
6247
  function openAppInstallDialog(openAPPInstallDialogParams) {
5836
6248
  return new Promise(function (resolve) {
5837
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
6249
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
5838
6250
  if (!isSupported()) {
5839
6251
  throw new Error('Not supported');
5840
6252
  }
5841
- if (runtime.isLegacyTeams) {
6253
+ if (runtime_runtime.isLegacyTeams) {
5842
6254
  resolve(sendAndHandleStatusAndReason('executeDeepLink', createTeamsDeepLinkForAppInstallDialog(openAPPInstallDialogParams.appId)));
5843
6255
  }
5844
6256
  else {
@@ -5855,7 +6267,7 @@ var appInstallDialog;
5855
6267
  * @throws Error if {@linkcode app.initialize} has not successfully completed
5856
6268
  */
5857
6269
  function isSupported() {
5858
- return ensureInitialized(runtime) && runtime.supports.appInstallDialog ? true : false;
6270
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.appInstallDialog ? true : false;
5859
6271
  }
5860
6272
  appInstallDialog.isSupported = isSupported;
5861
6273
  })(appInstallDialog || (appInstallDialog = {}));
@@ -5887,6 +6299,9 @@ var __extends = (undefined && undefined.__extends) || (function () {
5887
6299
 
5888
6300
 
5889
6301
 
6302
+
6303
+
6304
+ var mediaLogger = getLogger('media');
5890
6305
  /**
5891
6306
  * Interact with media, including capturing and viewing images.
5892
6307
  */
@@ -5925,17 +6340,17 @@ var media;
5925
6340
  if (!callback) {
5926
6341
  throw new Error('[captureImage] Callback cannot be null');
5927
6342
  }
5928
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6343
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
5929
6344
  if (!GlobalVars.isFramelessWindow) {
5930
6345
  var notSupportedError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };
5931
6346
  /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5932
- callback(notSupportedError, undefined);
6347
+ callback(notSupportedError, []);
5933
6348
  return;
5934
6349
  }
5935
6350
  if (!isCurrentSDKVersionAtLeast(captureImageMobileSupportVersion)) {
5936
6351
  var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
5937
6352
  /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5938
- callback(oldPlatformError, undefined);
6353
+ callback(oldPlatformError, []);
5939
6354
  return;
5940
6355
  }
5941
6356
  sendMessageToParent('captureImage', callback);
@@ -5950,7 +6365,7 @@ var media;
5950
6365
  * @beta
5951
6366
  */
5952
6367
  function hasPermission() {
5953
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6368
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
5954
6369
  if (!isPermissionSupported()) {
5955
6370
  throw errorNotSupportedOnPlatform;
5956
6371
  }
@@ -5969,7 +6384,7 @@ var media;
5969
6384
  * @beta
5970
6385
  */
5971
6386
  function requestPermission() {
5972
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6387
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
5973
6388
  if (!isPermissionSupported()) {
5974
6389
  throw errorNotSupportedOnPlatform;
5975
6390
  }
@@ -5986,7 +6401,7 @@ var media;
5986
6401
  * @throws Error if {@linkcode app.initialize} has not successfully completed
5987
6402
  */
5988
6403
  function isPermissionSupported() {
5989
- return ensureInitialized(runtime) && runtime.supports.permissions ? true : false;
6404
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.permissions ? true : false;
5990
6405
  }
5991
6406
  /**
5992
6407
  * Media object returned by the select Media API
@@ -5994,7 +6409,6 @@ var media;
5994
6409
  var Media = /** @class */ (function (_super) {
5995
6410
  __extends(Media, _super);
5996
6411
  function Media(that) {
5997
- if (that === void 0) { that = null; }
5998
6412
  var _this = _super.call(this) || this;
5999
6413
  if (that) {
6000
6414
  _this.content = that.content;
@@ -6015,17 +6429,15 @@ var media;
6015
6429
  if (!callback) {
6016
6430
  throw new Error('[get Media] Callback cannot be null');
6017
6431
  }
6018
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6432
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6019
6433
  if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {
6020
6434
  var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
6021
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6022
- callback(oldPlatformError, null);
6435
+ callback(oldPlatformError, new Blob());
6023
6436
  return;
6024
6437
  }
6025
6438
  if (!validateGetMediaInputs(this.mimeType, this.format, this.content)) {
6026
6439
  var invalidInput = { errorCode: ErrorCode.INVALID_ARGUMENTS };
6027
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6028
- callback(invalidInput, null);
6440
+ callback(invalidInput, new Blob());
6029
6441
  return;
6030
6442
  }
6031
6443
  // Call the new get media implementation via callbacks if the client version is greater than or equal to '2.0.0'
@@ -6046,8 +6458,7 @@ var media;
6046
6458
  function handleGetMediaCallbackRequest(mediaResult) {
6047
6459
  if (callback) {
6048
6460
  if (mediaResult && mediaResult.error) {
6049
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6050
- callback(mediaResult.error, null);
6461
+ callback(mediaResult.error, new Blob());
6051
6462
  }
6052
6463
  else {
6053
6464
  if (mediaResult && mediaResult.mediaChunk) {
@@ -6055,17 +6466,21 @@ var media;
6055
6466
  // create file/blob when all chunks have arrived and we get 0/-1 as chunksequence number
6056
6467
  if (mediaResult.mediaChunk.chunkSequence <= 0) {
6057
6468
  var file = createFile(helper.assembleAttachment, helper.mediaMimeType);
6058
- callback(mediaResult.error, file);
6469
+ callback(mediaResult.error, file !== null && file !== void 0 ? file : new Blob());
6059
6470
  }
6060
6471
  else {
6061
6472
  // Keep pushing chunks into assemble attachment
6062
6473
  var assemble = decodeAttachment(mediaResult.mediaChunk, helper.mediaMimeType);
6063
- helper.assembleAttachment.push(assemble);
6474
+ if (assemble) {
6475
+ helper.assembleAttachment.push(assemble);
6476
+ }
6477
+ else {
6478
+ mediaLogger("Received a null assemble attachment for when decoding chunk sequence ".concat(mediaResult.mediaChunk.chunkSequence, "; not including the chunk in the assembled file."));
6479
+ }
6064
6480
  }
6065
6481
  }
6066
6482
  else {
6067
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6068
- callback({ errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' }, null);
6483
+ callback({ errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' }, new Blob());
6069
6484
  }
6070
6485
  }
6071
6486
  }
@@ -6080,14 +6495,13 @@ var media;
6080
6495
  assembleAttachment: [],
6081
6496
  };
6082
6497
  var params = [actionName, this.content];
6083
- this.content && callback && sendMessageToParent('getMedia', params);
6498
+ this.content && !isNullOrUndefined(callback) && sendMessageToParent('getMedia', params);
6084
6499
  function handleGetMediaRequest(response) {
6085
6500
  if (callback) {
6086
6501
  /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6087
6502
  var mediaResult = JSON.parse(response);
6088
6503
  if (mediaResult.error) {
6089
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6090
- callback(mediaResult.error, null);
6504
+ callback(mediaResult.error, new Blob());
6091
6505
  removeHandler('getMedia' + actionName);
6092
6506
  }
6093
6507
  else {
@@ -6096,18 +6510,19 @@ var media;
6096
6510
  // create file/blob when all chunks have arrived and we get 0/-1 as chunksequence number
6097
6511
  if (mediaResult.mediaChunk.chunkSequence <= 0) {
6098
6512
  var file = createFile(helper.assembleAttachment, helper.mediaMimeType);
6099
- callback(mediaResult.error, file);
6513
+ callback(mediaResult.error, file !== null && file !== void 0 ? file : new Blob());
6100
6514
  removeHandler('getMedia' + actionName);
6101
6515
  }
6102
6516
  else {
6103
6517
  // Keep pushing chunks into assemble attachment
6104
6518
  var assemble = decodeAttachment(mediaResult.mediaChunk, helper.mediaMimeType);
6105
- helper.assembleAttachment.push(assemble);
6519
+ if (assemble) {
6520
+ helper.assembleAttachment.push(assemble);
6521
+ }
6106
6522
  }
6107
6523
  }
6108
6524
  else {
6109
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6110
- callback({ errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' }, null);
6525
+ callback({ errorCode: ErrorCode.INTERNAL_ERROR, message: 'data received is null' }, new Blob());
6111
6526
  removeHandler('getMedia' + actionName);
6112
6527
  }
6113
6528
  }
@@ -6137,7 +6552,7 @@ var media;
6137
6552
  * Optional; @param callback is used to send app if host client has successfully handled the notification event or not
6138
6553
  */
6139
6554
  MediaController.prototype.notifyEventToHost = function (mediaEvent, callback) {
6140
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6555
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6141
6556
  try {
6142
6557
  throwExceptionIfMobileApiIsNotSupported(nonFullScreenVideoModeAPISupportVersion);
6143
6558
  }
@@ -6271,42 +6686,38 @@ var media;
6271
6686
  if (!callback) {
6272
6687
  throw new Error('[select Media] Callback cannot be null');
6273
6688
  }
6274
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6689
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6275
6690
  if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {
6276
6691
  var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
6277
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6278
- callback(oldPlatformError, null);
6692
+ callback(oldPlatformError, []);
6279
6693
  return;
6280
6694
  }
6281
6695
  try {
6282
6696
  throwExceptionIfMediaCallIsNotSupportedOnMobile(mediaInputs);
6283
6697
  }
6284
6698
  catch (err) {
6285
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6286
- callback(err, null);
6699
+ callback(err, []);
6287
6700
  return;
6288
6701
  }
6289
6702
  if (!validateSelectMediaInputs(mediaInputs)) {
6290
6703
  var invalidInput = { errorCode: ErrorCode.INVALID_ARGUMENTS };
6291
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6292
- callback(invalidInput, null);
6704
+ callback(invalidInput, []);
6293
6705
  return;
6294
6706
  }
6295
6707
  var params = [mediaInputs];
6296
6708
  // What comes back from native as attachments would just be objects and will be missing getMedia method on them
6297
6709
  sendMessageToParent('selectMedia', params, function (err, localAttachments, mediaEvent) {
6710
+ var _a, _b;
6298
6711
  // MediaControllerEvent response is used to notify the app about events and is a partial response to selectMedia
6299
6712
  if (mediaEvent) {
6300
6713
  if (isVideoControllerRegistered(mediaInputs)) {
6301
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6302
- mediaInputs.videoProps.videoController.notifyEventToApp(mediaEvent);
6714
+ (_b = (_a = mediaInputs === null || mediaInputs === void 0 ? void 0 : mediaInputs.videoProps) === null || _a === void 0 ? void 0 : _a.videoController) === null || _b === void 0 ? void 0 : _b.notifyEventToApp(mediaEvent);
6303
6715
  }
6304
6716
  return;
6305
6717
  }
6306
6718
  // Media Attachments are final response to selectMedia
6307
6719
  if (!localAttachments) {
6308
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6309
- callback(err, null);
6720
+ callback(err, []);
6310
6721
  return;
6311
6722
  }
6312
6723
  var mediaArray = [];
@@ -6328,7 +6739,7 @@ var media;
6328
6739
  if (!callback) {
6329
6740
  throw new Error('[view images] Callback cannot be null');
6330
6741
  }
6331
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6742
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6332
6743
  if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {
6333
6744
  var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
6334
6745
  callback(oldPlatformError);
@@ -6359,7 +6770,7 @@ var media;
6359
6770
  if (!callback) {
6360
6771
  throw new Error('[media.scanBarCode] Callback cannot be null');
6361
6772
  }
6362
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6773
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6363
6774
  if (GlobalVars.hostClientType === HostClientType.desktop ||
6364
6775
  GlobalVars.hostClientType === HostClientType.web ||
6365
6776
  GlobalVars.hostClientType === HostClientType.rigel ||
@@ -6368,21 +6779,17 @@ var media;
6368
6779
  GlobalVars.hostClientType === HostClientType.teamsPhones ||
6369
6780
  GlobalVars.hostClientType === HostClientType.teamsDisplays) {
6370
6781
  var notSupportedError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };
6371
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6372
- callback(notSupportedError, null);
6782
+ callback(notSupportedError, '');
6373
6783
  return;
6374
6784
  }
6375
6785
  if (!isCurrentSDKVersionAtLeast(scanBarCodeAPIMobileSupportVersion)) {
6376
6786
  var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
6377
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6378
- callback(oldPlatformError, null);
6787
+ callback(oldPlatformError, '');
6379
6788
  return;
6380
6789
  }
6381
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6382
6790
  if (!validateScanBarCodeInput(config)) {
6383
6791
  var invalidInput = { errorCode: ErrorCode.INVALID_ARGUMENTS };
6384
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6385
- callback(invalidInput, null);
6792
+ callback(invalidInput, '');
6386
6793
  return;
6387
6794
  }
6388
6795
  sendMessageToParent('media.scanBarCode', [config], callback);
@@ -6405,7 +6812,7 @@ function createFile(assembleAttachment, mimeType) {
6405
6812
  if (assembleAttachment == null || mimeType == null || assembleAttachment.length <= 0) {
6406
6813
  return null;
6407
6814
  }
6408
- var file;
6815
+ var file = null;
6409
6816
  var sequence = 1;
6410
6817
  assembleAttachment.sort(function (a, b) { return (a.sequence > b.sequence ? 1 : -1); });
6411
6818
  assembleAttachment.forEach(function (item) {
@@ -6568,8 +6975,8 @@ function validateViewImagesInput(uriList) {
6568
6975
  function validateScanBarCodeInput(barCodeConfig) {
6569
6976
  if (barCodeConfig) {
6570
6977
  if (barCodeConfig.timeOutIntervalInSec === null ||
6571
- barCodeConfig.timeOutIntervalInSec <= 0 ||
6572
- barCodeConfig.timeOutIntervalInSec > 60) {
6978
+ (barCodeConfig.timeOutIntervalInSec != undefined && barCodeConfig.timeOutIntervalInSec <= 0) ||
6979
+ (barCodeConfig.timeOutIntervalInSec != undefined && barCodeConfig.timeOutIntervalInSec > 60)) {
6573
6980
  return false;
6574
6981
  }
6575
6982
  }
@@ -6632,7 +7039,7 @@ var barCode;
6632
7039
  */
6633
7040
  function scanBarCode(barCodeConfig) {
6634
7041
  return new Promise(function (resolve) {
6635
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7042
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6636
7043
  if (!isSupported()) {
6637
7044
  throw errorNotSupportedOnPlatform;
6638
7045
  }
@@ -6651,7 +7058,7 @@ var barCode;
6651
7058
  * @beta
6652
7059
  */
6653
7060
  function hasPermission() {
6654
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7061
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6655
7062
  if (!isSupported()) {
6656
7063
  throw errorNotSupportedOnPlatform;
6657
7064
  }
@@ -6669,7 +7076,7 @@ var barCode;
6669
7076
  * @beta
6670
7077
  */
6671
7078
  function requestPermission() {
6672
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7079
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6673
7080
  if (!isSupported()) {
6674
7081
  throw errorNotSupportedOnPlatform;
6675
7082
  }
@@ -6688,7 +7095,7 @@ var barCode;
6688
7095
  * @beta
6689
7096
  */
6690
7097
  function isSupported() {
6691
- return ensureInitialized(runtime) && runtime.supports.barCode && runtime.supports.permissions ? true : false;
7098
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.barCode && runtime_runtime.supports.permissions ? true : false;
6692
7099
  }
6693
7100
  barCode.isSupported = isSupported;
6694
7101
  })(barCode || (barCode = {}));
@@ -6718,11 +7125,11 @@ var chat;
6718
7125
  */
6719
7126
  function openChat(openChatRequest) {
6720
7127
  return new Promise(function (resolve) {
6721
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7128
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6722
7129
  if (!isSupported()) {
6723
7130
  throw errorNotSupportedOnPlatform;
6724
7131
  }
6725
- if (runtime.isLegacyTeams) {
7132
+ if (runtime_runtime.isLegacyTeams) {
6726
7133
  resolve(sendAndHandleStatusAndReason('executeDeepLink', createTeamsDeepLinkForChat([openChatRequest.user], undefined /*topic*/, openChatRequest.message)));
6727
7134
  }
6728
7135
  else {
@@ -6759,11 +7166,11 @@ var chat;
6759
7166
  openChat(chatRequest);
6760
7167
  }
6761
7168
  else {
6762
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7169
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6763
7170
  if (!isSupported()) {
6764
7171
  throw errorNotSupportedOnPlatform;
6765
7172
  }
6766
- if (runtime.isLegacyTeams) {
7173
+ if (runtime_runtime.isLegacyTeams) {
6767
7174
  resolve(sendAndHandleStatusAndReason('executeDeepLink', createTeamsDeepLinkForChat(openChatRequest.users, openChatRequest.topic, openChatRequest.message)));
6768
7175
  }
6769
7176
  else {
@@ -6787,7 +7194,7 @@ var chat;
6787
7194
  * @beta
6788
7195
  */
6789
7196
  function isSupported() {
6790
- return ensureInitialized(runtime) && runtime.supports.chat ? true : false;
7197
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.chat ? true : false;
6791
7198
  }
6792
7199
  chat.isSupported = isSupported;
6793
7200
  })(chat || (chat = {}));
@@ -6860,7 +7267,7 @@ var clipboard;
6860
7267
  return __generator(this, function (_a) {
6861
7268
  switch (_a.label) {
6862
7269
  case 0:
6863
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task, FrameContexts.stage, FrameContexts.sidePanel);
7270
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.meetingStage, FrameContexts.task, FrameContexts.settings, FrameContexts.stage, FrameContexts.sidePanel);
6864
7271
  if (!isSupported()) {
6865
7272
  throw errorNotSupportedOnPlatform;
6866
7273
  }
@@ -6893,7 +7300,7 @@ var clipboard;
6893
7300
  return __generator(this, function (_c) {
6894
7301
  switch (_c.label) {
6895
7302
  case 0:
6896
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task, FrameContexts.stage, FrameContexts.sidePanel);
7303
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.meetingStage, FrameContexts.task, FrameContexts.settings, FrameContexts.stage, FrameContexts.sidePanel);
6897
7304
  if (!isSupported()) {
6898
7305
  throw errorNotSupportedOnPlatform;
6899
7306
  }
@@ -6918,7 +7325,7 @@ var clipboard;
6918
7325
  * @beta
6919
7326
  */
6920
7327
  function isSupported() {
6921
- return ensureInitialized(runtime) && navigator && navigator.clipboard && runtime.supports.clipboard ? true : false;
7328
+ return internalAPIs_ensureInitialized(runtime_runtime) && navigator && navigator.clipboard && runtime_runtime.supports.clipboard ? true : false;
6922
7329
  }
6923
7330
  clipboard.isSupported = isSupported;
6924
7331
  })(clipboard || (clipboard = {}));
@@ -6929,6 +7336,11 @@ var clipboard;
6929
7336
 
6930
7337
 
6931
7338
 
7339
+
7340
+ /**
7341
+ * v2 APIs telemetry file: All of APIs in this capability file should send out API version v2 ONLY
7342
+ */
7343
+ var geoLocationTelemetryVersionNumber = ApiVersionNumber.V_2;
6932
7344
  /**
6933
7345
  * Namespace to interact with the geoLocation module-specific part of the SDK. This is the newer version of location module.
6934
7346
  *
@@ -6943,11 +7355,14 @@ var geoLocation;
6943
7355
  * @beta
6944
7356
  */
6945
7357
  function getCurrentLocation() {
6946
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7358
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6947
7359
  if (!isSupported()) {
6948
7360
  throw errorNotSupportedOnPlatform;
6949
7361
  }
6950
- return sendAndHandleSdkError('location.getLocation', { allowChooseLocation: false, showMap: false });
7362
+ return sendAndHandleSdkErrorWithVersion(getApiVersionTag(geoLocationTelemetryVersionNumber, ApiName.GeoLocation_GetCurrentLocation), 'location.getLocation', {
7363
+ allowChooseLocation: false,
7364
+ showMap: false,
7365
+ });
6951
7366
  }
6952
7367
  geoLocation.getCurrentLocation = getCurrentLocation;
6953
7368
  /**
@@ -6959,13 +7374,13 @@ var geoLocation;
6959
7374
  * @beta
6960
7375
  */
6961
7376
  function hasPermission() {
6962
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7377
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6963
7378
  if (!isSupported()) {
6964
7379
  throw errorNotSupportedOnPlatform;
6965
7380
  }
6966
7381
  var permissions = DevicePermission.GeoLocation;
6967
7382
  return new Promise(function (resolve) {
6968
- resolve(sendAndHandleSdkError('permissions.has', permissions));
7383
+ resolve(sendAndHandleSdkErrorWithVersion(getApiVersionTag(geoLocationTelemetryVersionNumber, ApiName.GeoLocation_HasPermission), 'permissions.has', permissions));
6969
7384
  });
6970
7385
  }
6971
7386
  geoLocation.hasPermission = hasPermission;
@@ -6979,13 +7394,13 @@ var geoLocation;
6979
7394
  * @beta
6980
7395
  */
6981
7396
  function requestPermission() {
6982
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7397
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
6983
7398
  if (!isSupported()) {
6984
7399
  throw errorNotSupportedOnPlatform;
6985
7400
  }
6986
7401
  var permissions = DevicePermission.GeoLocation;
6987
7402
  return new Promise(function (resolve) {
6988
- resolve(sendAndHandleSdkError('permissions.request', permissions));
7403
+ resolve(sendAndHandleSdkErrorWithVersion(getApiVersionTag(geoLocationTelemetryVersionNumber, ApiName.GeoLocation_RequestPermission), 'permissions.request', permissions));
6989
7404
  });
6990
7405
  }
6991
7406
  geoLocation.requestPermission = requestPermission;
@@ -6998,7 +7413,7 @@ var geoLocation;
6998
7413
  * @beta
6999
7414
  */
7000
7415
  function isSupported() {
7001
- return ensureInitialized(runtime) && runtime.supports.geoLocation && runtime.supports.permissions ? true : false;
7416
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.geoLocation && runtime_runtime.supports.permissions ? true : false;
7002
7417
  }
7003
7418
  geoLocation.isSupported = isSupported;
7004
7419
  /**
@@ -7016,11 +7431,14 @@ var geoLocation;
7016
7431
  * @beta
7017
7432
  */
7018
7433
  function chooseLocation() {
7019
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7434
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
7020
7435
  if (!isSupported()) {
7021
7436
  throw errorNotSupportedOnPlatform;
7022
7437
  }
7023
- return sendAndHandleSdkError('location.getLocation', { allowChooseLocation: true, showMap: true });
7438
+ return sendAndHandleSdkErrorWithVersion(getApiVersionTag(geoLocationTelemetryVersionNumber, ApiName.GeoLocation_Map_ChooseLocation), 'location.getLocation', {
7439
+ allowChooseLocation: true,
7440
+ showMap: true,
7441
+ });
7024
7442
  }
7025
7443
  map.chooseLocation = chooseLocation;
7026
7444
  /**
@@ -7032,14 +7450,14 @@ var geoLocation;
7032
7450
  * @beta
7033
7451
  */
7034
7452
  function showLocation(location) {
7035
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7453
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
7036
7454
  if (!isSupported()) {
7037
7455
  throw errorNotSupportedOnPlatform;
7038
7456
  }
7039
7457
  if (!location) {
7040
7458
  throw { errorCode: ErrorCode.INVALID_ARGUMENTS };
7041
7459
  }
7042
- return sendAndHandleSdkError('location.showLocation', location);
7460
+ return sendAndHandleSdkErrorWithVersion(getApiVersionTag(geoLocationTelemetryVersionNumber, ApiName.GeoLocation_ShowLocation), 'location.showLocation', location);
7043
7461
  }
7044
7462
  map.showLocation = showLocation;
7045
7463
  /**
@@ -7051,10 +7469,10 @@ var geoLocation;
7051
7469
  * @beta
7052
7470
  */
7053
7471
  function isSupported() {
7054
- return ensureInitialized(runtime) &&
7055
- runtime.supports.geoLocation &&
7056
- runtime.supports.geoLocation.map &&
7057
- runtime.supports.permissions
7472
+ return internalAPIs_ensureInitialized(runtime_runtime) &&
7473
+ runtime_runtime.supports.geoLocation &&
7474
+ runtime_runtime.supports.geoLocation.map &&
7475
+ runtime_runtime.supports.permissions
7058
7476
  ? true
7059
7477
  : false;
7060
7478
  }
@@ -7069,11 +7487,11 @@ var geoLocation;
7069
7487
  * version supported by the host, or undefined if the host does not support Adaptive Cards
7070
7488
  */
7071
7489
  function getAdaptiveCardSchemaVersion() {
7072
- if (!runtime.hostVersionsInfo) {
7490
+ if (!runtime_runtime.hostVersionsInfo) {
7073
7491
  return undefined;
7074
7492
  }
7075
7493
  else {
7076
- return runtime.hostVersionsInfo.adaptiveCardSchemaVersion;
7494
+ return runtime_runtime.hostVersionsInfo.adaptiveCardSchemaVersion;
7077
7495
  }
7078
7496
  }
7079
7497
 
@@ -7101,7 +7519,7 @@ var ChildAppWindow = /** @class */ (function () {
7101
7519
  * @param onComplete - The callback to know if the postMessage has been success/failed.
7102
7520
  */
7103
7521
  ChildAppWindow.prototype.postMessage = function (message, onComplete) {
7104
- ensureInitialized(runtime);
7522
+ internalAPIs_ensureInitialized(runtime_runtime);
7105
7523
  sendMessageToParent('messageForChild', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
7106
7524
  };
7107
7525
  /**
@@ -7111,7 +7529,7 @@ var ChildAppWindow = /** @class */ (function () {
7111
7529
  * @param listener - The listener that will be called
7112
7530
  */
7113
7531
  ChildAppWindow.prototype.addEventListener = function (type, listener) {
7114
- ensureInitialized(runtime);
7532
+ internalAPIs_ensureInitialized(runtime_runtime);
7115
7533
  if (type === 'message') {
7116
7534
  registerHandler('messageForParent', listener);
7117
7535
  }
@@ -7143,7 +7561,7 @@ var ParentAppWindow = /** @class */ (function () {
7143
7561
  * @param onComplete - The callback to know if the postMessage has been success/failed.
7144
7562
  */
7145
7563
  ParentAppWindow.prototype.postMessage = function (message, onComplete) {
7146
- ensureInitialized(runtime, FrameContexts.task);
7564
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.task);
7147
7565
  sendMessageToParent('messageForParent', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
7148
7566
  };
7149
7567
  /**
@@ -7153,7 +7571,7 @@ var ParentAppWindow = /** @class */ (function () {
7153
7571
  * @param listener - The listener that will be called
7154
7572
  */
7155
7573
  ParentAppWindow.prototype.addEventListener = function (type, listener) {
7156
- ensureInitialized(runtime, FrameContexts.task);
7574
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.task);
7157
7575
  if (type === 'message') {
7158
7576
  registerHandler('messageForChild', listener);
7159
7577
  }
@@ -7170,15 +7588,19 @@ var ParentAppWindow = /** @class */ (function () {
7170
7588
 
7171
7589
 
7172
7590
  /**
7173
- * Namespace to power up the in-app browser experiences in the Host App.
7174
- * For e.g., opening a URL in the Host App inside a browser
7591
+ * Namespace to power up the in-app browser experiences in the host app.
7592
+ * For e.g., opening a URL in the host app inside a browser
7175
7593
  *
7176
7594
  * @beta
7177
7595
  */
7178
7596
  var secondaryBrowser;
7179
7597
  (function (secondaryBrowser) {
7180
7598
  /**
7181
- * Open a URL in the secondary browser aka in-app browser
7599
+ * Open a URL in the secondary browser.
7600
+ *
7601
+ * On mobile, this is the in-app browser.
7602
+ *
7603
+ * On web and desktop, please use the `window.open()` method or other native external browser methods.
7182
7604
  *
7183
7605
  * @param url Url to open in the browser
7184
7606
  * @returns Promise that successfully resolves if the URL opens in the secondaryBrowser
@@ -7188,7 +7610,7 @@ var secondaryBrowser;
7188
7610
  * @beta
7189
7611
  */
7190
7612
  function open(url) {
7191
- ensureInitialized(runtime, FrameContexts.content);
7613
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
7192
7614
  if (!isSupported()) {
7193
7615
  throw errorNotSupportedOnPlatform;
7194
7616
  }
@@ -7207,7 +7629,7 @@ var secondaryBrowser;
7207
7629
  * @beta
7208
7630
  */
7209
7631
  function isSupported() {
7210
- return ensureInitialized(runtime) && runtime.supports.secondaryBrowser ? true : false;
7632
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.secondaryBrowser ? true : false;
7211
7633
  }
7212
7634
  secondaryBrowser.isSupported = isSupported;
7213
7635
  })(secondaryBrowser || (secondaryBrowser = {}));
@@ -7219,6 +7641,11 @@ var secondaryBrowser;
7219
7641
 
7220
7642
 
7221
7643
 
7644
+
7645
+ /**
7646
+ * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
7647
+ */
7648
+ var locationTelemetryVersionNumber = ApiVersionNumber.V_1;
7222
7649
  /**
7223
7650
  * @deprecated
7224
7651
  * As of 2.1.0, please use geoLocation namespace.
@@ -7241,7 +7668,7 @@ var location_location;
7241
7668
  if (!callback) {
7242
7669
  throw new Error('[location.getLocation] Callback cannot be null');
7243
7670
  }
7244
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7671
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
7245
7672
  if (!isCurrentSDKVersionAtLeast(locationAPIsRequiredVersion)) {
7246
7673
  throw { errorCode: ErrorCode.OLD_PLATFORM };
7247
7674
  }
@@ -7251,7 +7678,7 @@ var location_location;
7251
7678
  if (!isSupported()) {
7252
7679
  throw errorNotSupportedOnPlatform;
7253
7680
  }
7254
- sendMessageToParent('location.getLocation', [props], callback);
7681
+ communication_sendMessageToParentWithVersion(getApiVersionTag(locationTelemetryVersionNumber, ApiName.Location_GetLocation), 'location.getLocation', [props], callback);
7255
7682
  }
7256
7683
  location_1.getLocation = getLocation;
7257
7684
  /**
@@ -7267,7 +7694,7 @@ var location_location;
7267
7694
  if (!callback) {
7268
7695
  throw new Error('[location.showLocation] Callback cannot be null');
7269
7696
  }
7270
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7697
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
7271
7698
  if (!isCurrentSDKVersionAtLeast(locationAPIsRequiredVersion)) {
7272
7699
  throw { errorCode: ErrorCode.OLD_PLATFORM };
7273
7700
  }
@@ -7277,7 +7704,7 @@ var location_location;
7277
7704
  if (!isSupported()) {
7278
7705
  throw errorNotSupportedOnPlatform;
7279
7706
  }
7280
- sendMessageToParent('location.showLocation', [location], callback);
7707
+ communication_sendMessageToParentWithVersion(getApiVersionTag(locationTelemetryVersionNumber, ApiName.Location_ShowLocation), 'location.showLocation', [location], callback);
7281
7708
  }
7282
7709
  location_1.showLocation = showLocation;
7283
7710
  /**
@@ -7291,7 +7718,7 @@ var location_location;
7291
7718
  * @returns boolean to represent whether Location is supported
7292
7719
  */
7293
7720
  function isSupported() {
7294
- return ensureInitialized(runtime) && runtime.supports.location ? true : false;
7721
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.location ? true : false;
7295
7722
  }
7296
7723
  location_1.isSupported = isSupported;
7297
7724
  })(location_location || (location_location = {}));
@@ -7476,7 +7903,7 @@ var meeting;
7476
7903
  if (!callback) {
7477
7904
  throw new Error('[get incoming client audio state] Callback cannot be null');
7478
7905
  }
7479
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7906
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7480
7907
  sendMessageToParent('getIncomingClientAudioState', callback);
7481
7908
  }
7482
7909
  meeting.getIncomingClientAudioState = getIncomingClientAudioState;
@@ -7498,7 +7925,7 @@ var meeting;
7498
7925
  if (!callback) {
7499
7926
  throw new Error('[toggle incoming client audio] Callback cannot be null');
7500
7927
  }
7501
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7928
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7502
7929
  sendMessageToParent('toggleIncomingClientAudio', callback);
7503
7930
  }
7504
7931
  meeting.toggleIncomingClientAudio = toggleIncomingClientAudio;
@@ -7517,7 +7944,7 @@ var meeting;
7517
7944
  if (!callback) {
7518
7945
  throw new Error('[get meeting details] Callback cannot be null');
7519
7946
  }
7520
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage, FrameContexts.settings, FrameContexts.content);
7947
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage, FrameContexts.settings, FrameContexts.content);
7521
7948
  sendMessageToParent('meeting.getMeetingDetails', callback);
7522
7949
  }
7523
7950
  meeting.getMeetingDetails = getMeetingDetails;
@@ -7536,7 +7963,7 @@ var meeting;
7536
7963
  if (!callback) {
7537
7964
  throw new Error('[get Authentication Token For AnonymousUser] Callback cannot be null');
7538
7965
  }
7539
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage, FrameContexts.task);
7966
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage, FrameContexts.task);
7540
7967
  sendMessageToParent('meeting.getAuthenticationTokenForAnonymousUser', callback);
7541
7968
  }
7542
7969
  meeting.getAuthenticationTokenForAnonymousUser = getAuthenticationTokenForAnonymousUser;
@@ -7557,7 +7984,7 @@ var meeting;
7557
7984
  if (!callback) {
7558
7985
  throw new Error('[get live stream state] Callback cannot be null');
7559
7986
  }
7560
- ensureInitialized(runtime, FrameContexts.sidePanel);
7987
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
7561
7988
  sendMessageToParent('meeting.getLiveStreamState', callback);
7562
7989
  }
7563
7990
  meeting.getLiveStreamState = getLiveStreamState;
@@ -7581,7 +8008,7 @@ var meeting;
7581
8008
  if (!callback) {
7582
8009
  throw new Error('[request start live streaming] Callback cannot be null');
7583
8010
  }
7584
- ensureInitialized(runtime, FrameContexts.sidePanel);
8011
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
7585
8012
  sendMessageToParent('meeting.requestStartLiveStreaming', [streamUrl, streamKey], callback);
7586
8013
  }
7587
8014
  meeting.requestStartLiveStreaming = requestStartLiveStreaming;
@@ -7600,7 +8027,7 @@ var meeting;
7600
8027
  if (!callback) {
7601
8028
  throw new Error('[request stop live streaming] Callback cannot be null');
7602
8029
  }
7603
- ensureInitialized(runtime, FrameContexts.sidePanel);
8030
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
7604
8031
  sendMessageToParent('meeting.requestStopLiveStreaming', callback);
7605
8032
  }
7606
8033
  meeting.requestStopLiveStreaming = requestStopLiveStreaming;
@@ -7620,7 +8047,7 @@ var meeting;
7620
8047
  if (!handler) {
7621
8048
  throw new Error('[register live stream changed handler] Handler cannot be null');
7622
8049
  }
7623
- ensureInitialized(runtime, FrameContexts.sidePanel);
8050
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
7624
8051
  registerHandler('meeting.liveStreamChanged', handler);
7625
8052
  }
7626
8053
  meeting.registerLiveStreamChangedHandler = registerLiveStreamChangedHandler;
@@ -7646,7 +8073,7 @@ var meeting;
7646
8073
  if (!callback) {
7647
8074
  throw new Error('[share app content to stage] Callback cannot be null');
7648
8075
  }
7649
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
8076
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7650
8077
  sendMessageToParent('meeting.shareAppContentToStage', [appContentUrl], callback);
7651
8078
  }
7652
8079
  meeting.shareAppContentToStage = shareAppContentToStage;
@@ -7671,7 +8098,7 @@ var meeting;
7671
8098
  if (!callback) {
7672
8099
  throw new Error('[get app content stage sharing capabilities] Callback cannot be null');
7673
8100
  }
7674
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
8101
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7675
8102
  sendMessageToParent('meeting.getAppContentStageSharingCapabilities', callback);
7676
8103
  }
7677
8104
  meeting.getAppContentStageSharingCapabilities = getAppContentStageSharingCapabilities;
@@ -7688,7 +8115,7 @@ var meeting;
7688
8115
  if (!callback) {
7689
8116
  throw new Error('[stop sharing app content to stage] Callback cannot be null');
7690
8117
  }
7691
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
8118
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7692
8119
  sendMessageToParent('meeting.stopSharingAppContentToStage', callback);
7693
8120
  }
7694
8121
  meeting.stopSharingAppContentToStage = stopSharingAppContentToStage;
@@ -7710,7 +8137,7 @@ var meeting;
7710
8137
  if (!callback) {
7711
8138
  throw new Error('[get app content stage sharing state] Callback cannot be null');
7712
8139
  }
7713
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
8140
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7714
8141
  sendMessageToParent('meeting.getAppContentStageSharingState', callback);
7715
8142
  }
7716
8143
  meeting.getAppContentStageSharingState = getAppContentStageSharingState;
@@ -7733,7 +8160,7 @@ var meeting;
7733
8160
  if (!handler) {
7734
8161
  throw new Error('[registerSpeakingStateChangeHandler] Handler cannot be null');
7735
8162
  }
7736
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
8163
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7737
8164
  registerHandler('meeting.speakingStateChanged', handler);
7738
8165
  }
7739
8166
  meeting.registerSpeakingStateChangeHandler = registerSpeakingStateChangeHandler;
@@ -7757,7 +8184,7 @@ var meeting;
7757
8184
  if (!handler) {
7758
8185
  throw new Error('[registerRaiseHandStateChangedHandler] Handler cannot be null');
7759
8186
  }
7760
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
8187
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7761
8188
  registerHandler('meeting.raiseHandStateChanged', handler);
7762
8189
  }
7763
8190
  meeting.registerRaiseHandStateChangedHandler = registerRaiseHandStateChangedHandler;
@@ -7779,7 +8206,7 @@ var meeting;
7779
8206
  if (!handler) {
7780
8207
  throw new Error('[registerMeetingReactionReceivedHandler] Handler cannot be null');
7781
8208
  }
7782
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
8209
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7783
8210
  registerHandler('meeting.meetingReactionReceived', handler);
7784
8211
  }
7785
8212
  meeting.registerMeetingReactionReceivedHandler = registerMeetingReactionReceivedHandler;
@@ -7814,7 +8241,7 @@ var meeting;
7814
8241
  * @beta
7815
8242
  */
7816
8243
  function setOptions(shareInformation) {
7817
- ensureInitialized(runtime, FrameContexts.sidePanel);
8244
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
7818
8245
  if (shareInformation.contentUrl) {
7819
8246
  new URL(shareInformation.contentUrl);
7820
8247
  }
@@ -7854,7 +8281,7 @@ var meeting;
7854
8281
  if (!requestAppAudioHandlingParams.micMuteStateChangedCallback) {
7855
8282
  throw new Error('[requestAppAudioHandling] Callback Mic mute state handler cannot be null');
7856
8283
  }
7857
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
8284
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7858
8285
  if (requestAppAudioHandlingParams.isAppHandlingAudio) {
7859
8286
  startAppAudioHandling(requestAppAudioHandlingParams, callback);
7860
8287
  }
@@ -7936,7 +8363,7 @@ var meeting;
7936
8363
  }
7937
8364
  meeting.updateMicState = updateMicState;
7938
8365
  function setMicStateWithReason(micState, reason) {
7939
- ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
8366
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
7940
8367
  sendMessageToParent('meeting.updateMicState', [micState, reason]);
7941
8368
  }
7942
8369
  })(meeting || (meeting = {}));
@@ -7960,7 +8387,6 @@ var monetization;
7960
8387
  */
7961
8388
  function openPurchaseExperience(param1, param2) {
7962
8389
  var callback;
7963
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
7964
8390
  var planInfo;
7965
8391
  if (typeof param1 === 'function') {
7966
8392
  callback = param1;
@@ -7974,10 +8400,11 @@ var monetization;
7974
8400
  if (!isSupported()) {
7975
8401
  throw errorNotSupportedOnPlatform;
7976
8402
  }
8403
+ /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
7977
8404
  resolve(sendAndHandleSdkError('monetization.openPurchaseExperience', planInfo));
7978
8405
  });
7979
8406
  };
7980
- ensureInitialized(runtime, FrameContexts.content);
8407
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
7981
8408
  return callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise(wrappedFunction, callback);
7982
8409
  }
7983
8410
  monetization.openPurchaseExperience = openPurchaseExperience;
@@ -7990,7 +8417,7 @@ var monetization;
7990
8417
  * @throws Error if {@linkcode app.initialize} has not successfully completed
7991
8418
  */
7992
8419
  function isSupported() {
7993
- return ensureInitialized(runtime) && runtime.supports.monetization ? true : false;
8420
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.monetization ? true : false;
7994
8421
  }
7995
8422
  monetization.isSupported = isSupported;
7996
8423
  })(monetization || (monetization = {}));
@@ -8013,7 +8440,7 @@ var calendar;
8013
8440
  */
8014
8441
  function openCalendarItem(openCalendarItemParams) {
8015
8442
  return new Promise(function (resolve) {
8016
- ensureInitialized(runtime, FrameContexts.content);
8443
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
8017
8444
  if (!isSupported()) {
8018
8445
  throw new Error('Not supported');
8019
8446
  }
@@ -8031,11 +8458,11 @@ var calendar;
8031
8458
  */
8032
8459
  function composeMeeting(composeMeetingParams) {
8033
8460
  return new Promise(function (resolve) {
8034
- ensureInitialized(runtime, FrameContexts.content);
8461
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
8035
8462
  if (!isSupported()) {
8036
8463
  throw new Error('Not supported');
8037
8464
  }
8038
- if (runtime.isLegacyTeams) {
8465
+ if (runtime_runtime.isLegacyTeams) {
8039
8466
  resolve(sendAndHandleStatusAndReason('executeDeepLink', createTeamsDeepLinkForCalendar(composeMeetingParams.attendees, composeMeetingParams.startTime, composeMeetingParams.endTime, composeMeetingParams.subject, composeMeetingParams.content)));
8040
8467
  }
8041
8468
  else {
@@ -8051,7 +8478,7 @@ var calendar;
8051
8478
  * @throws Error if {@linkcode app.initialize} has not successfully completed
8052
8479
  */
8053
8480
  function isSupported() {
8054
- return ensureInitialized(runtime) && runtime.supports.calendar ? true : false;
8481
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.calendar ? true : false;
8055
8482
  }
8056
8483
  calendar.isSupported = isSupported;
8057
8484
  })(calendar || (calendar = {}));
@@ -8073,7 +8500,7 @@ var mail;
8073
8500
  */
8074
8501
  function openMailItem(openMailItemParams) {
8075
8502
  return new Promise(function (resolve) {
8076
- ensureInitialized(runtime, FrameContexts.content);
8503
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
8077
8504
  if (!isSupported()) {
8078
8505
  throw new Error('Not supported');
8079
8506
  }
@@ -8092,7 +8519,7 @@ var mail;
8092
8519
  */
8093
8520
  function composeMail(composeMailParams) {
8094
8521
  return new Promise(function (resolve) {
8095
- ensureInitialized(runtime, FrameContexts.content);
8522
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
8096
8523
  if (!isSupported()) {
8097
8524
  throw new Error('Not supported');
8098
8525
  }
@@ -8107,7 +8534,7 @@ var mail;
8107
8534
  * @throws Error if {@linkcode app.initialize} has not successfully completed
8108
8535
  */
8109
8536
  function isSupported() {
8110
- return ensureInitialized(runtime) && runtime.supports.mail ? true : false;
8537
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.mail ? true : false;
8111
8538
  }
8112
8539
  mail.isSupported = isSupported;
8113
8540
  /** Defines compose mail types. */
@@ -8131,6 +8558,7 @@ var mail;
8131
8558
 
8132
8559
 
8133
8560
 
8561
+
8134
8562
  /**
8135
8563
  * Namespace containing the set of APIs that support Teams-specific functionalities.
8136
8564
  */
@@ -8141,7 +8569,7 @@ var teamsCore;
8141
8569
  */
8142
8570
  function enablePrintCapability() {
8143
8571
  if (!GlobalVars.printCapabilityEnabled) {
8144
- ensureInitialized(runtime);
8572
+ internalAPIs_ensureInitialized(runtime_runtime);
8145
8573
  if (!isSupported()) {
8146
8574
  throw errorNotSupportedOnPlatform;
8147
8575
  }
@@ -8177,7 +8605,7 @@ var teamsCore;
8177
8605
  */
8178
8606
  function registerOnLoadHandler(handler) {
8179
8607
  registerOnLoadHandlerHelper(handler, function () {
8180
- if (handler && !isSupported()) {
8608
+ if (!isNullOrUndefined(handler) && !isSupported()) {
8181
8609
  throw errorNotSupportedOnPlatform;
8182
8610
  }
8183
8611
  });
@@ -8197,8 +8625,8 @@ var teamsCore;
8197
8625
  */
8198
8626
  function registerOnLoadHandlerHelper(handler, versionSpecificHelper) {
8199
8627
  // allow for registration cleanup even when not finished initializing
8200
- handler && ensureInitialized(runtime);
8201
- if (handler && versionSpecificHelper) {
8628
+ !isNullOrUndefined(handler) && internalAPIs_ensureInitialized(runtime_runtime);
8629
+ if (!isNullOrUndefined(handler) && versionSpecificHelper) {
8202
8630
  versionSpecificHelper();
8203
8631
  }
8204
8632
  handlers_registerOnLoadHandler(handler);
@@ -8217,7 +8645,7 @@ var teamsCore;
8217
8645
  */
8218
8646
  function registerBeforeUnloadHandler(handler) {
8219
8647
  registerBeforeUnloadHandlerHelper(handler, function () {
8220
- if (handler && !isSupported()) {
8648
+ if (!isNullOrUndefined(handler) && !isSupported()) {
8221
8649
  throw errorNotSupportedOnPlatform;
8222
8650
  }
8223
8651
  });
@@ -8238,8 +8666,8 @@ var teamsCore;
8238
8666
  */
8239
8667
  function registerBeforeUnloadHandlerHelper(handler, versionSpecificHelper) {
8240
8668
  // allow for registration cleanup even when not finished initializing
8241
- handler && ensureInitialized(runtime);
8242
- if (handler && versionSpecificHelper) {
8669
+ !isNullOrUndefined(handler) && internalAPIs_ensureInitialized(runtime_runtime);
8670
+ if (!isNullOrUndefined(handler) && versionSpecificHelper) {
8243
8671
  versionSpecificHelper();
8244
8672
  }
8245
8673
  handlers_registerBeforeUnloadHandler(handler);
@@ -8254,7 +8682,7 @@ var teamsCore;
8254
8682
  *
8255
8683
  */
8256
8684
  function isSupported() {
8257
- return ensureInitialized(runtime) && runtime.supports.teamsCore ? true : false;
8685
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.teamsCore ? true : false;
8258
8686
  }
8259
8687
  teamsCore.isSupported = isSupported;
8260
8688
  })(teamsCore || (teamsCore = {}));
@@ -8281,18 +8709,16 @@ var people;
8281
8709
  */
8282
8710
  function selectPeople(param1, param2) {
8283
8711
  var _a;
8284
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task, FrameContexts.settings);
8285
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
8286
- var callback;
8287
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
8288
- var peoplePickerInputs;
8712
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task, FrameContexts.settings);
8713
+ var callback = undefined;
8714
+ var peoplePickerInputs = undefined;
8289
8715
  if (typeof param1 === 'function') {
8290
8716
  _a = [param1, param2], callback = _a[0], peoplePickerInputs = _a[1];
8291
8717
  }
8292
8718
  else {
8293
8719
  peoplePickerInputs = param1;
8294
8720
  }
8295
- return callCallbackWithErrorOrResultFromPromiseAndReturnPromise(selectPeopleHelper, callback, peoplePickerInputs);
8721
+ return callCallbackWithErrorOrResultFromPromiseAndReturnPromise(selectPeopleHelper, callback /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */, peoplePickerInputs);
8296
8722
  }
8297
8723
  people_1.selectPeople = selectPeople;
8298
8724
  function selectPeopleHelper(peoplePickerInputs) {
@@ -8300,7 +8726,6 @@ var people;
8300
8726
  if (!isCurrentSDKVersionAtLeast(peoplePickerRequiredVersion)) {
8301
8727
  throw { errorCode: ErrorCode.OLD_PLATFORM };
8302
8728
  }
8303
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
8304
8729
  if (!validatePeoplePickerInput(peoplePickerInputs)) {
8305
8730
  throw { errorCode: ErrorCode.INVALID_ARGUMENTS };
8306
8731
  }
@@ -8318,7 +8743,7 @@ var people;
8318
8743
  * @throws Error if {@linkcode app.initialize} has not successfully completed
8319
8744
  */
8320
8745
  function isSupported() {
8321
- return ensureInitialized(runtime) && runtime.supports.people ? true : false;
8746
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.people ? true : false;
8322
8747
  }
8323
8748
  people_1.isSupported = isSupported;
8324
8749
  })(people || (people = {}));
@@ -8408,7 +8833,7 @@ var profile;
8408
8833
  * @beta
8409
8834
  */
8410
8835
  function showProfile(showProfileRequest) {
8411
- ensureInitialized(runtime, FrameContexts.content);
8836
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
8412
8837
  return new Promise(function (resolve) {
8413
8838
  var _a = validateShowProfileRequest(showProfileRequest), isValid = _a[0], message = _a[1];
8414
8839
  if (!isValid) {
@@ -8439,7 +8864,7 @@ var profile;
8439
8864
  * @beta
8440
8865
  */
8441
8866
  function isSupported() {
8442
- return ensureInitialized(runtime) && runtime.supports.profile ? true : false;
8867
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.profile ? true : false;
8443
8868
  }
8444
8869
  profile.isSupported = isSupported;
8445
8870
  })(profile || (profile = {}));
@@ -9330,7 +9755,7 @@ var videoEffects;
9330
9755
  * ```
9331
9756
  */
9332
9757
  function registerForVideoFrame(parameters) {
9333
- ensureInitialized(runtime, FrameContexts.sidePanel);
9758
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
9334
9759
  if (!isSupported()) {
9335
9760
  throw errorNotSupportedOnPlatform;
9336
9761
  }
@@ -9362,7 +9787,7 @@ var videoEffects;
9362
9787
  * @param effectId - Newly selected effect id.
9363
9788
  */
9364
9789
  function notifySelectedVideoEffectChanged(effectChangeType, effectId) {
9365
- ensureInitialized(runtime, FrameContexts.sidePanel);
9790
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
9366
9791
  if (!isSupported()) {
9367
9792
  throw errorNotSupportedOnPlatform;
9368
9793
  }
@@ -9375,7 +9800,7 @@ var videoEffects;
9375
9800
  * @param callback - Function to be called when new video effect is applied.
9376
9801
  */
9377
9802
  function registerForVideoEffect(callback) {
9378
- ensureInitialized(runtime, FrameContexts.sidePanel);
9803
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
9379
9804
  if (!isSupported()) {
9380
9805
  throw errorNotSupportedOnPlatform;
9381
9806
  }
@@ -9408,15 +9833,15 @@ var videoEffects;
9408
9833
  *
9409
9834
  */
9410
9835
  function isSupported() {
9411
- return (ensureInitialized(runtime) &&
9412
- !!runtime.supports.video &&
9836
+ return (internalAPIs_ensureInitialized(runtime_runtime) &&
9837
+ !!runtime_runtime.supports.video &&
9413
9838
  /** A host should support either mediaStream or sharedFrame sub-capability to support the video capability */
9414
- (!!runtime.supports.video.mediaStream || !!runtime.supports.video.sharedFrame));
9839
+ (!!runtime_runtime.supports.video.mediaStream || !!runtime_runtime.supports.video.sharedFrame));
9415
9840
  }
9416
9841
  videoEffects.isSupported = isSupported;
9417
9842
  function registerForMediaStream(videoFrameHandler, config) {
9418
9843
  var _this = this;
9419
- ensureInitialized(runtime, FrameContexts.sidePanel);
9844
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
9420
9845
  if (!isSupported() || !doesSupportMediaStream()) {
9421
9846
  throw errorNotSupportedOnPlatform;
9422
9847
  }
@@ -9455,7 +9880,7 @@ var videoEffects;
9455
9880
  }); };
9456
9881
  }
9457
9882
  function registerForVideoBuffer(videoBufferHandler, config) {
9458
- ensureInitialized(runtime, FrameContexts.sidePanel);
9883
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
9459
9884
  if (!isSupported() || !doesSupportSharedFrame()) {
9460
9885
  throw errorNotSupportedOnPlatform;
9461
9886
  }
@@ -9485,9 +9910,9 @@ var videoEffects;
9485
9910
  }
9486
9911
  function doesSupportMediaStream() {
9487
9912
  var _a;
9488
- return (ensureInitialized(runtime, FrameContexts.sidePanel) &&
9913
+ return (internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel) &&
9489
9914
  isTextureStreamAvailable() &&
9490
- !!((_a = runtime.supports.video) === null || _a === void 0 ? void 0 : _a.mediaStream));
9915
+ !!((_a = runtime_runtime.supports.video) === null || _a === void 0 ? void 0 : _a.mediaStream));
9491
9916
  }
9492
9917
  function isTextureStreamAvailable() {
9493
9918
  var _a, _b, _c, _d;
@@ -9495,7 +9920,7 @@ var videoEffects;
9495
9920
  }
9496
9921
  function doesSupportSharedFrame() {
9497
9922
  var _a;
9498
- return ensureInitialized(runtime, FrameContexts.sidePanel) && !!((_a = runtime.supports.video) === null || _a === void 0 ? void 0 : _a.sharedFrame);
9923
+ return internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel) && !!((_a = runtime_runtime.supports.video) === null || _a === void 0 ? void 0 : _a.sharedFrame);
9499
9924
  }
9500
9925
  })(videoEffects || (videoEffects = {})); //end of video namespace
9501
9926
 
@@ -9560,7 +9985,7 @@ var search;
9560
9985
  * @beta
9561
9986
  */
9562
9987
  function registerHandlers(onClosedHandler, onExecuteHandler, onChangeHandler) {
9563
- ensureInitialized(runtime, FrameContexts.content);
9988
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
9564
9989
  if (!isSupported()) {
9565
9990
  throw errorNotSupportedOnPlatform;
9566
9991
  }
@@ -9578,7 +10003,7 @@ var search;
9578
10003
  * @beta
9579
10004
  */
9580
10005
  function unregisterHandlers() {
9581
- ensureInitialized(runtime, FrameContexts.content);
10006
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
9582
10007
  if (!isSupported()) {
9583
10008
  throw errorNotSupportedOnPlatform;
9584
10009
  }
@@ -9599,7 +10024,7 @@ var search;
9599
10024
  * @beta
9600
10025
  */
9601
10026
  function isSupported() {
9602
- return ensureInitialized(runtime) && runtime.supports.search ? true : false;
10027
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.search ? true : false;
9603
10028
  }
9604
10029
  search.isSupported = isSupported;
9605
10030
  /**
@@ -9609,7 +10034,7 @@ var search;
9609
10034
  */
9610
10035
  function closeSearch() {
9611
10036
  return new Promise(function (resolve) {
9612
- ensureInitialized(runtime, FrameContexts.content);
10037
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
9613
10038
  if (!isSupported()) {
9614
10039
  throw new Error('Not supported');
9615
10040
  }
@@ -9652,7 +10077,7 @@ var sharing;
9652
10077
  var wrappedFunction = function () { return Promise.reject(err); };
9653
10078
  return callCallbackWithSdkErrorFromPromiseAndReturnPromise(wrappedFunction, callback);
9654
10079
  }
9655
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
10080
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
9656
10081
  return callCallbackWithSdkErrorFromPromiseAndReturnPromise(shareWebContentHelper, callback, shareWebContentRequest);
9657
10082
  }
9658
10083
  sharing.shareWebContent = shareWebContent;
@@ -9719,7 +10144,7 @@ var sharing;
9719
10144
  * @throws Error if {@linkcode app.initialize} has not successfully completed
9720
10145
  */
9721
10146
  function isSupported() {
9722
- return ensureInitialized(runtime) && runtime.supports.sharing ? true : false;
10147
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.sharing ? true : false;
9723
10148
  }
9724
10149
  sharing.isSupported = isSupported;
9725
10150
  })(sharing || (sharing = {}));
@@ -9765,7 +10190,7 @@ var stageView;
9765
10190
  */
9766
10191
  function open(stageViewParams) {
9767
10192
  return new Promise(function (resolve) {
9768
- ensureInitialized(runtime, FrameContexts.content);
10193
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
9769
10194
  if (!isSupported()) {
9770
10195
  throw errorNotSupportedOnPlatform;
9771
10196
  }
@@ -9785,7 +10210,7 @@ var stageView;
9785
10210
  *
9786
10211
  */
9787
10212
  function isSupported() {
9788
- return ensureInitialized(runtime) && runtime.supports.stageView ? true : false;
10213
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.stageView ? true : false;
9789
10214
  }
9790
10215
  stageView.isSupported = isSupported;
9791
10216
  })(stageView || (stageView = {}));
@@ -9880,7 +10305,7 @@ var visualMedia;
9880
10305
  * @beta
9881
10306
  */
9882
10307
  function hasPermission() {
9883
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
10308
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
9884
10309
  if (!image.isSupported()) {
9885
10310
  throw errorNotSupportedOnPlatform;
9886
10311
  }
@@ -9898,7 +10323,7 @@ var visualMedia;
9898
10323
  * @beta
9899
10324
  */
9900
10325
  function requestPermission() {
9901
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
10326
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
9902
10327
  if (!image.isSupported()) {
9903
10328
  throw errorNotSupportedOnPlatform;
9904
10329
  }
@@ -9929,7 +10354,7 @@ var visualMedia;
9929
10354
  return visualMedia_generator(this, function (_a) {
9930
10355
  switch (_a.label) {
9931
10356
  case 0:
9932
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
10357
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
9933
10358
  ensureSupported();
9934
10359
  ensureImageInputValid(cameraImageInputs);
9935
10360
  return [4 /*yield*/, sendAndHandleSdkError('visualMedia.image.captureImages', cameraImageInputs)];
@@ -9957,7 +10382,7 @@ var visualMedia;
9957
10382
  return visualMedia_generator(this, function (_a) {
9958
10383
  switch (_a.label) {
9959
10384
  case 0:
9960
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
10385
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
9961
10386
  ensureSupported();
9962
10387
  ensureImageInputValid(galleryImageInputs);
9963
10388
  return [4 /*yield*/, sendAndHandleSdkError('visualMedia.image.retrieveImages', galleryImageInputs)];
@@ -9979,10 +10404,10 @@ var visualMedia;
9979
10404
  * @beta
9980
10405
  */
9981
10406
  function isSupported() {
9982
- return ensureInitialized(runtime) &&
9983
- runtime.supports.visualMedia &&
9984
- runtime.supports.visualMedia.image &&
9985
- runtime.supports.permissions
10407
+ return internalAPIs_ensureInitialized(runtime_runtime) &&
10408
+ runtime_runtime.supports.visualMedia &&
10409
+ runtime_runtime.supports.visualMedia.image &&
10410
+ runtime_runtime.supports.permissions
9986
10411
  ? true
9987
10412
  : false;
9988
10413
  }
@@ -10049,7 +10474,7 @@ var webStorage;
10049
10474
  * @beta
10050
10475
  */
10051
10476
  function isWebStorageClearedOnUserLogOut() {
10052
- ensureInitialized(runtime);
10477
+ internalAPIs_ensureInitialized(runtime_runtime);
10053
10478
  return isSupported();
10054
10479
  }
10055
10480
  webStorage.isWebStorageClearedOnUserLogOut = isWebStorageClearedOnUserLogOut;
@@ -10062,7 +10487,7 @@ var webStorage;
10062
10487
  * @beta
10063
10488
  */
10064
10489
  function isSupported() {
10065
- return ensureInitialized(runtime) && runtime.supports.webStorage ? true : false;
10490
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.webStorage ? true : false;
10066
10491
  }
10067
10492
  webStorage.isSupported = isSupported;
10068
10493
  })(webStorage || (webStorage = {}));
@@ -10105,11 +10530,11 @@ var call;
10105
10530
  function startCall(startCallParams) {
10106
10531
  return new Promise(function (resolve) {
10107
10532
  var _a;
10108
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
10533
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
10109
10534
  if (!isSupported()) {
10110
10535
  throw errorNotSupportedOnPlatform;
10111
10536
  }
10112
- if (runtime.isLegacyTeams) {
10537
+ if (runtime_runtime.isLegacyTeams) {
10113
10538
  resolve(sendAndUnwrap('executeDeepLink', createTeamsDeepLinkForCall(startCallParams.targets, (_a = startCallParams.requestedModalities) === null || _a === void 0 ? void 0 : _a.includes(CallModalities.Video), startCallParams.source)).then(function (result) {
10114
10539
  if (!result) {
10115
10540
  throw new Error(errorCallNotStarted);
@@ -10130,7 +10555,7 @@ var call;
10130
10555
  * @throws Error if {@linkcode app.initialize} has not successfully completed
10131
10556
  */
10132
10557
  function isSupported() {
10133
- return ensureInitialized(runtime) && runtime.supports.call ? true : false;
10558
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.call ? true : false;
10134
10559
  }
10135
10560
  call.isSupported = isSupported;
10136
10561
  })(call || (call = {}));
@@ -10217,6 +10642,12 @@ var appInitialization;
10217
10642
 
10218
10643
 
10219
10644
 
10645
+
10646
+
10647
+ /**
10648
+ * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
10649
+ */
10650
+ var publicAPIsTelemetryVersionNumber = ApiVersionNumber.V_1;
10220
10651
  /**
10221
10652
  * @deprecated
10222
10653
  * As of 2.0.0, please use {@link app.initialize app.initialize(validMessageOrigins?: string[]): Promise\<void\>} instead.
@@ -10228,7 +10659,7 @@ var appInitialization;
10228
10659
  * https: protocol otherwise they will be ignored. Example: https://www.example.com
10229
10660
  */
10230
10661
  function initialize(callback, validMessageOrigins) {
10231
- app.initialize(validMessageOrigins).then(function () {
10662
+ appInitializeHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_Initialize), validMessageOrigins).then(function () {
10232
10663
  if (callback) {
10233
10664
  callback();
10234
10665
  }
@@ -10262,7 +10693,7 @@ function print() {
10262
10693
  */
10263
10694
  function getContext(callback) {
10264
10695
  ensureInitializeCalled();
10265
- sendMessageToParent('getContext', function (context) {
10696
+ communication_sendMessageToParentWithVersion(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_GetContext), 'getContext', function (context) {
10266
10697
  if (!context.frameContext) {
10267
10698
  // Fallback logic for frameContext properties
10268
10699
  context.frameContext = GlobalVars.frameContext;
@@ -10279,8 +10710,8 @@ function getContext(callback) {
10279
10710
  *
10280
10711
  * @param handler - The handler to invoke when the user changes their theme.
10281
10712
  */
10282
- function registerOnThemeChangeHandler(handler) {
10283
- app.registerOnThemeChangeHandler(handler);
10713
+ function publicAPIs_registerOnThemeChangeHandler(handler) {
10714
+ registerOnThemeChangeHandlerHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterOnThemeChangeHandlerHelper), handler);
10284
10715
  }
10285
10716
  /**
10286
10717
  * @deprecated
@@ -10292,7 +10723,7 @@ function registerOnThemeChangeHandler(handler) {
10292
10723
  * @param handler - The handler to invoke when the user toggles full-screen view for a tab.
10293
10724
  */
10294
10725
  function registerFullScreenHandler(handler) {
10295
- registerHandlerHelper('fullScreenChange', handler, []);
10726
+ registerHandlerHelperWithVersion(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterFullScreenHandler), 'fullScreenChange', handler, []);
10296
10727
  }
10297
10728
  /**
10298
10729
  * @deprecated
@@ -10304,7 +10735,7 @@ function registerFullScreenHandler(handler) {
10304
10735
  * @param handler - The handler to invoke when the personal app button is clicked in the app bar.
10305
10736
  */
10306
10737
  function registerAppButtonClickHandler(handler) {
10307
- registerHandlerHelper('appButtonClick', handler, [FrameContexts.content]);
10738
+ registerHandlerHelperWithVersion(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterAppButtonClickHandler), 'appButtonClick', handler, [FrameContexts.content]);
10308
10739
  }
10309
10740
  /**
10310
10741
  * @deprecated
@@ -10316,7 +10747,7 @@ function registerAppButtonClickHandler(handler) {
10316
10747
  * @param handler - The handler to invoke when entering hover of the personal app button in the app bar.
10317
10748
  */
10318
10749
  function registerAppButtonHoverEnterHandler(handler) {
10319
- registerHandlerHelper('appButtonHoverEnter', handler, [FrameContexts.content]);
10750
+ registerHandlerHelperWithVersion(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterAppButtonHoverEnterHandler), 'appButtonHoverEnter', handler, [FrameContexts.content]);
10320
10751
  }
10321
10752
  /**
10322
10753
  * @deprecated
@@ -10328,7 +10759,7 @@ function registerAppButtonHoverEnterHandler(handler) {
10328
10759
  *
10329
10760
  */
10330
10761
  function registerAppButtonHoverLeaveHandler(handler) {
10331
- registerHandlerHelper('appButtonHoverLeave', handler, [FrameContexts.content]);
10762
+ registerHandlerHelperWithVersion(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterAppButtonHoverLeaveHandler), 'appButtonHoverLeave', handler, [FrameContexts.content]);
10332
10763
  }
10333
10764
  /**
10334
10765
  * @deprecated
@@ -10342,7 +10773,7 @@ function registerAppButtonHoverLeaveHandler(handler) {
10342
10773
  * @param handler - The handler to invoke when the user presses their Team client's back button.
10343
10774
  */
10344
10775
  function registerBackButtonHandler(handler) {
10345
- pages.backStack.registerBackButtonHandlerHelper(handler);
10776
+ pages.backStack.registerBackButtonHandlerHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterBackButtonHandler), handler);
10346
10777
  }
10347
10778
  /**
10348
10779
  * @deprecated
@@ -10379,7 +10810,7 @@ function registerBeforeUnloadHandler(handler) {
10379
10810
  * @param handler - The handler to invoked by the app when they want the focus to be in the place of their choice.
10380
10811
  */
10381
10812
  function registerFocusEnterHandler(handler) {
10382
- registerHandlerHelper('focusEnter', handler, []);
10813
+ registerHandlerHelperWithVersion(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterFocusEnterHandler), 'focusEnter', handler, []);
10383
10814
  }
10384
10815
  /**
10385
10816
  * @deprecated
@@ -10390,7 +10821,7 @@ function registerFocusEnterHandler(handler) {
10390
10821
  * @param handler - The handler to invoke when the user click on Settings.
10391
10822
  */
10392
10823
  function registerChangeSettingsHandler(handler) {
10393
- registerHandlerHelper('changeSettings', handler, [FrameContexts.content]);
10824
+ registerHandlerHelperWithVersion(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_RegisterChangeSettingsHandler), 'changeSettings', handler, [FrameContexts.content]);
10394
10825
  }
10395
10826
  /**
10396
10827
  * @deprecated
@@ -10403,8 +10834,8 @@ function registerChangeSettingsHandler(handler) {
10403
10834
  * @param tabInstanceParameters - OPTIONAL Flags that specify whether to scope call to favorite teams or channels.
10404
10835
  */
10405
10836
  function getTabInstances(callback, tabInstanceParameters) {
10406
- ensureInitialized(runtime);
10407
- pages.tabs.getTabInstances(tabInstanceParameters).then(function (tabInfo) {
10837
+ internalAPIs_ensureInitialized(runtime_runtime);
10838
+ getTabInstancesHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_GetTabInstances), tabInstanceParameters).then(function (tabInfo) {
10408
10839
  callback(tabInfo);
10409
10840
  });
10410
10841
  }
@@ -10418,8 +10849,8 @@ function getTabInstances(callback, tabInstanceParameters) {
10418
10849
  * @param tabInstanceParameters - OPTIONAL Ignored, kept for future use
10419
10850
  */
10420
10851
  function getMruTabInstances(callback, tabInstanceParameters) {
10421
- ensureInitialized(runtime);
10422
- pages.tabs.getMruTabInstances(tabInstanceParameters).then(function (tabInfo) {
10852
+ internalAPIs_ensureInitialized(runtime_runtime);
10853
+ getMruTabInstancesHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_GetMruTabInstances), tabInstanceParameters).then(function (tabInfo) {
10423
10854
  callback(tabInfo);
10424
10855
  });
10425
10856
  }
@@ -10432,7 +10863,7 @@ function getMruTabInstances(callback, tabInstanceParameters) {
10432
10863
  * @param deepLinkParameters - ID and label for the link and fallback URL.
10433
10864
  */
10434
10865
  function shareDeepLink(deepLinkParameters) {
10435
- pages.shareDeepLink({
10866
+ shareDeepLinkHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_ShareDeepLink), {
10436
10867
  subPageId: deepLinkParameters.subEntityId,
10437
10868
  subPageLabel: deepLinkParameters.subEntityLabel,
10438
10869
  subPageWebUrl: deepLinkParameters.subEntityWebUrl,
@@ -10447,15 +10878,14 @@ function shareDeepLink(deepLinkParameters) {
10447
10878
  * @param deepLink - deep link.
10448
10879
  */
10449
10880
  function executeDeepLink(deepLink, onComplete) {
10450
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
10451
- onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();
10452
- app
10453
- .openLink(deepLink)
10881
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
10882
+ var completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
10883
+ openLinkHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_ExecuteDeepLink), deepLink)
10454
10884
  .then(function () {
10455
- onComplete(true);
10885
+ completionHandler(true);
10456
10886
  })
10457
10887
  .catch(function (err) {
10458
- onComplete(false, err.message);
10888
+ completionHandler(false, err.message);
10459
10889
  });
10460
10890
  }
10461
10891
  /**
@@ -10467,7 +10897,7 @@ function executeDeepLink(deepLink, onComplete) {
10467
10897
  * @param frameContext - FrameContext information to be set
10468
10898
  */
10469
10899
  function setFrameContext(frameContext) {
10470
- pages.setCurrentFrame(frameContext);
10900
+ setCurrentFrameHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_SetFrameContext), frameContext);
10471
10901
  }
10472
10902
  /**
10473
10903
  * @deprecated
@@ -10481,7 +10911,8 @@ function setFrameContext(frameContext) {
10481
10911
  * They must have https: protocol otherwise they will be ignored. Example: https:www.example.com
10482
10912
  */
10483
10913
  function initializeWithFrameContext(frameContext, callback, validMessageOrigins) {
10484
- pages.initializeWithFrameContext(frameContext, callback, validMessageOrigins);
10914
+ appInitializeHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_Initialize), validMessageOrigins).then(function () { return callback && callback(); });
10915
+ setCurrentFrameHelper(getApiVersionTag(publicAPIsTelemetryVersionNumber, ApiName.PublicAPIs_SetFrameContext), frameContext);
10485
10916
  }
10486
10917
 
10487
10918
  ;// CONCATENATED MODULE: ./src/public/navigation.ts
@@ -10490,6 +10921,11 @@ function initializeWithFrameContext(frameContext, callback, validMessageOrigins)
10490
10921
 
10491
10922
 
10492
10923
 
10924
+
10925
+ /**
10926
+ * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
10927
+ */
10928
+ var navigationTelemetryVersionNumber = ApiVersionNumber.V_1;
10493
10929
  /**
10494
10930
  * @deprecated
10495
10931
  * As of 2.0.0, please use {@link pages.returnFocus pages.returnFocus(navigateForward?: boolean): void} instead.
@@ -10499,7 +10935,7 @@ function initializeWithFrameContext(frameContext, callback, validMessageOrigins)
10499
10935
  * @param navigateForward - Determines the direction to focus in teams app.
10500
10936
  */
10501
10937
  function returnFocus(navigateForward) {
10502
- pages.returnFocus(navigateForward);
10938
+ returnFocusHelper(getApiVersionTag(navigationTelemetryVersionNumber, ApiName.Navigation_ReturnFocus), navigateForward);
10503
10939
  }
10504
10940
  /**
10505
10941
  * @deprecated
@@ -10511,15 +10947,14 @@ function returnFocus(navigateForward) {
10511
10947
  * @param onComplete - The callback to invoke when the action is complete.
10512
10948
  */
10513
10949
  function navigateToTab(tabInstance, onComplete) {
10514
- ensureInitialized(runtime);
10515
- onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();
10516
- pages.tabs
10517
- .navigateToTab(tabInstance)
10950
+ internalAPIs_ensureInitialized(runtime_runtime);
10951
+ var completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
10952
+ tabsNavigateToTabHelper(getApiVersionTag(navigationTelemetryVersionNumber, ApiName.Navigation_NavigateToTab), tabInstance)
10518
10953
  .then(function () {
10519
- onComplete(true);
10954
+ completionHandler(true);
10520
10955
  })
10521
10956
  .catch(function (error) {
10522
- onComplete(false, error.message);
10957
+ completionHandler(false, error.message);
10523
10958
  });
10524
10959
  }
10525
10960
  /**
@@ -10536,15 +10971,14 @@ function navigateToTab(tabInstance, onComplete) {
10536
10971
  * @param onComplete - The callback to invoke when the action is complete.
10537
10972
  */
10538
10973
  function navigateCrossDomain(url, onComplete) {
10539
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
10540
- onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();
10541
- pages
10542
- .navigateCrossDomain(url)
10974
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
10975
+ var completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
10976
+ navigateCrossDomainHelper(getApiVersionTag(navigationTelemetryVersionNumber, ApiName.Navigation_NavigateCrossDomain), url)
10543
10977
  .then(function () {
10544
- onComplete(true);
10978
+ completionHandler(true);
10545
10979
  })
10546
10980
  .catch(function (error) {
10547
- onComplete(false, error.message);
10981
+ completionHandler(false, error.message);
10548
10982
  });
10549
10983
  }
10550
10984
  /**
@@ -10557,15 +10991,14 @@ function navigateCrossDomain(url, onComplete) {
10557
10991
  * @param onComplete - The callback to invoke when the action is complete.
10558
10992
  */
10559
10993
  function navigateBack(onComplete) {
10560
- ensureInitialized(runtime);
10561
- onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();
10562
- pages.backStack
10563
- .navigateBack()
10994
+ internalAPIs_ensureInitialized(runtime_runtime);
10995
+ var completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
10996
+ backStackNavigateBackHelper(getApiVersionTag(navigationTelemetryVersionNumber, ApiName.Navigation_NavigateBack))
10564
10997
  .then(function () {
10565
- onComplete(true);
10998
+ completionHandler(true);
10566
10999
  })
10567
11000
  .catch(function (error) {
10568
- onComplete(false, error.message);
11001
+ completionHandler(false, error.message);
10569
11002
  });
10570
11003
  }
10571
11004
 
@@ -10606,7 +11039,7 @@ var settings;
10606
11039
  * @param callback - The callback to invoke when the {@link Settings} object is retrieved.
10607
11040
  */
10608
11041
  function getSettings(callback) {
10609
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
11042
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
10610
11043
  pages.getConfig().then(function (config) {
10611
11044
  callback(config);
10612
11045
  });
@@ -10622,15 +11055,15 @@ var settings;
10622
11055
  * @param - Set the desired settings for this instance.
10623
11056
  */
10624
11057
  function setSettings(instanceSettings, onComplete) {
10625
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
10626
- onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();
11058
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
11059
+ var completionHandler = onComplete !== null && onComplete !== void 0 ? onComplete : getGenericOnCompleteHandler();
10627
11060
  pages.config
10628
11061
  .setConfig(instanceSettings)
10629
11062
  .then(function () {
10630
- onComplete(true);
11063
+ completionHandler(true);
10631
11064
  })
10632
11065
  .catch(function (error) {
10633
- onComplete(false, error.message);
11066
+ completionHandler(false, error.message);
10634
11067
  });
10635
11068
  }
10636
11069
  settings.setSettings = setSettings;
@@ -10685,6 +11118,11 @@ var tasks_rest = (undefined && undefined.__rest) || function (s, e) {
10685
11118
 
10686
11119
 
10687
11120
 
11121
+
11122
+ /**
11123
+ * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
11124
+ */
11125
+ var tasksTelemetryVersionNumber = ApiVersionNumber.V_1;
10688
11126
  /**
10689
11127
  * @deprecated
10690
11128
  * As of 2.0.0, please use {@link dialog} namespace instead.
@@ -10711,23 +11149,23 @@ var tasks;
10711
11149
  * @param submitHandler - Handler to call when the task module is completed
10712
11150
  */
10713
11151
  function startTask(taskInfo, submitHandler) {
11152
+ var apiVersionTag = getApiVersionTag(tasksTelemetryVersionNumber, ApiName.Tasks_StartTask);
10714
11153
  var dialogSubmitHandler = submitHandler
10715
- ? /* eslint-disable-next-line strict-null-checks/all */ /* fix tracked by 5730662 */
10716
- function (sdkResponse) { return submitHandler(sdkResponse.err, sdkResponse.result); }
11154
+ ? function (sdkResponse) { var _a, _b; return submitHandler((_a = sdkResponse.err) !== null && _a !== void 0 ? _a : '', (_b = sdkResponse.result) !== null && _b !== void 0 ? _b : ''); }
10717
11155
  : undefined;
10718
11156
  if (taskInfo.card === undefined && taskInfo.url === undefined) {
10719
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
10720
- sendMessageToParent('tasks.startTask', [taskInfo], submitHandler);
11157
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
11158
+ communication_sendMessageToParentWithVersion(apiVersionTag, 'tasks.startTask', [taskInfo], submitHandler);
10721
11159
  }
10722
11160
  else if (taskInfo.card) {
10723
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
10724
- sendMessageToParent('tasks.startTask', [taskInfo], submitHandler);
11161
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
11162
+ communication_sendMessageToParentWithVersion(apiVersionTag, 'tasks.startTask', [taskInfo], submitHandler);
10725
11163
  }
10726
11164
  else if (taskInfo.completionBotId !== undefined) {
10727
- dialog.url.bot.open(getBotUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);
11165
+ botUrlOpenHelper(apiVersionTag, getBotUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);
10728
11166
  }
10729
11167
  else {
10730
- dialog.url.open(getUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);
11168
+ urlOpenHelper(apiVersionTag, getUrlDialogInfoFromTaskInfo(taskInfo), dialogSubmitHandler);
10731
11169
  }
10732
11170
  return new ChildAppWindow();
10733
11171
  }
@@ -10747,7 +11185,7 @@ var tasks;
10747
11185
  if (Object.keys(extra).length) {
10748
11186
  throw new Error('resize requires a TaskInfo argument containing only width and height');
10749
11187
  }
10750
- dialog.update.resize(taskInfo);
11188
+ updateResizeHelper(getApiVersionTag(tasksTelemetryVersionNumber, ApiName.Tasks_UpdateTask), taskInfo);
10751
11189
  }
10752
11190
  tasks.updateTask = updateTask;
10753
11191
  /**
@@ -10760,7 +11198,7 @@ var tasks;
10760
11198
  * @param appIds - Valid application(s) that can receive the result of the submitted dialogs. Specifying this parameter helps prevent malicious apps from retrieving the dialog result. Multiple app IDs can be specified because a web app from a single underlying domain can power multiple apps across different environments and branding schemes.
10761
11199
  */
10762
11200
  function submitTask(result, appIds) {
10763
- dialog.url.submit(result, appIds);
11201
+ urlSubmitHelper(getApiVersionTag(tasksTelemetryVersionNumber, ApiName.Tasks_SubmitTask), result, appIds);
10764
11202
  }
10765
11203
  tasks.submitTask = submitTask;
10766
11204
  /**
@@ -10769,7 +11207,9 @@ var tasks;
10769
11207
  * @returns - Converted UrlDialogInfo object
10770
11208
  */
10771
11209
  function getUrlDialogInfoFromTaskInfo(taskInfo) {
10772
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
11210
+ if (taskInfo.url === undefined) {
11211
+ throw new Error("url property of taskInfo object can't be undefined");
11212
+ }
10773
11213
  var urldialogInfo = {
10774
11214
  url: taskInfo.url,
10775
11215
  size: {
@@ -10787,7 +11227,9 @@ var tasks;
10787
11227
  * @returns - converted BotUrlDialogInfo object
10788
11228
  */
10789
11229
  function getBotUrlDialogInfoFromTaskInfo(taskInfo) {
10790
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
11230
+ if (taskInfo.url === undefined || taskInfo.completionBotId === undefined) {
11231
+ throw new Error("Both url ".concat(taskInfo.url, " and completionBotId ").concat(taskInfo.completionBotId, " are required for bot url dialog. At least one is undefined."));
11232
+ }
10791
11233
  var botUrldialogInfo = {
10792
11234
  url: taskInfo.url,
10793
11235
  size: {
@@ -10887,8 +11329,8 @@ var liveShare;
10887
11329
  * @throws Error if {@linkcode app.initialize} has not successfully completed
10888
11330
  */
10889
11331
  function isSupported() {
10890
- return ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel) &&
10891
- runtime.supports.interactive
11332
+ return internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.meetingStage, FrameContexts.sidePanel) &&
11333
+ runtime_runtime.supports.interactive
10892
11334
  ? true
10893
11335
  : false;
10894
11336
  }
@@ -11361,7 +11803,7 @@ var marketplace;
11361
11803
  * @beta
11362
11804
  */
11363
11805
  function getCart() {
11364
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
11806
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
11365
11807
  if (!isSupported()) {
11366
11808
  throw errorNotSupportedOnPlatform;
11367
11809
  }
@@ -11376,7 +11818,7 @@ var marketplace;
11376
11818
  * @beta
11377
11819
  */
11378
11820
  function addOrUpdateCartItems(addOrUpdateCartItemsParams) {
11379
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
11821
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
11380
11822
  if (!isSupported()) {
11381
11823
  throw errorNotSupportedOnPlatform;
11382
11824
  }
@@ -11396,7 +11838,7 @@ var marketplace;
11396
11838
  * @beta
11397
11839
  */
11398
11840
  function removeCartItems(removeCartItemsParams) {
11399
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
11841
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
11400
11842
  if (!isSupported()) {
11401
11843
  throw errorNotSupportedOnPlatform;
11402
11844
  }
@@ -11418,7 +11860,7 @@ var marketplace;
11418
11860
  * @beta
11419
11861
  */
11420
11862
  function updateCartStatus(updateCartStatusParams) {
11421
- ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
11863
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content, FrameContexts.task);
11422
11864
  if (!isSupported()) {
11423
11865
  throw errorNotSupportedOnPlatform;
11424
11866
  }
@@ -11438,7 +11880,7 @@ var marketplace;
11438
11880
  * @beta
11439
11881
  */
11440
11882
  function isSupported() {
11441
- return ensureInitialized(runtime) && runtime.supports.marketplace ? true : false;
11883
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.marketplace ? true : false;
11442
11884
  }
11443
11885
  marketplace.isSupported = isSupported;
11444
11886
  })(marketplace || (marketplace = {}));
@@ -11603,7 +12045,7 @@ var files;
11603
12045
  * Limited to Microsoft-internal use
11604
12046
  */
11605
12047
  function getCloudStorageFolders(channelId, callback) {
11606
- ensureInitialized(runtime, FrameContexts.content);
12048
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11607
12049
  if (!channelId || channelId.length === 0) {
11608
12050
  throw new Error('[files.getCloudStorageFolders] channelId name cannot be null or empty');
11609
12051
  }
@@ -11626,7 +12068,7 @@ var files;
11626
12068
  * Limited to Microsoft-internal use
11627
12069
  */
11628
12070
  function addCloudStorageFolder(channelId, callback) {
11629
- ensureInitialized(runtime, FrameContexts.content);
12071
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11630
12072
  if (!channelId || channelId.length === 0) {
11631
12073
  throw new Error('[files.addCloudStorageFolder] channelId name cannot be null or empty');
11632
12074
  }
@@ -11651,7 +12093,7 @@ var files;
11651
12093
  * Limited to Microsoft-internal use
11652
12094
  */
11653
12095
  function deleteCloudStorageFolder(channelId, folderToDelete, callback) {
11654
- ensureInitialized(runtime, FrameContexts.content);
12096
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11655
12097
  if (!channelId) {
11656
12098
  throw new Error('[files.deleteCloudStorageFolder] channelId name cannot be null or empty');
11657
12099
  }
@@ -11679,7 +12121,7 @@ var files;
11679
12121
  * Limited to Microsoft-internal use
11680
12122
  */
11681
12123
  function getCloudStorageFolderContents(folder, providerCode, callback) {
11682
- ensureInitialized(runtime, FrameContexts.content);
12124
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11683
12125
  if (!folder || !providerCode) {
11684
12126
  throw new Error('[files.getCloudStorageFolderContents] folder/providerCode name cannot be null or empty');
11685
12127
  }
@@ -11707,7 +12149,7 @@ var files;
11707
12149
  * Limited to Microsoft-internal use
11708
12150
  */
11709
12151
  function openCloudStorageFile(file, providerCode, fileOpenPreference) {
11710
- ensureInitialized(runtime, FrameContexts.content);
12152
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11711
12153
  if (!file || !providerCode) {
11712
12154
  throw new Error('[files.openCloudStorageFile] file/providerCode cannot be null or empty');
11713
12155
  }
@@ -11729,7 +12171,7 @@ var files;
11729
12171
  */
11730
12172
  function getExternalProviders(excludeAddedProviders, callback) {
11731
12173
  if (excludeAddedProviders === void 0) { excludeAddedProviders = false; }
11732
- ensureInitialized(runtime, FrameContexts.content);
12174
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11733
12175
  if (!callback) {
11734
12176
  throw new Error('[files.getExternalProviders] Callback cannot be null');
11735
12177
  }
@@ -11746,7 +12188,7 @@ var files;
11746
12188
  */
11747
12189
  function copyMoveFiles(selectedFiles, providerCode, destinationFolder, destinationProviderCode, isMove, callback) {
11748
12190
  if (isMove === void 0) { isMove = false; }
11749
- ensureInitialized(runtime, FrameContexts.content);
12191
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11750
12192
  if (!selectedFiles || selectedFiles.length === 0) {
11751
12193
  throw new Error('[files.copyMoveFiles] selectedFiles cannot be null or empty');
11752
12194
  }
@@ -11777,7 +12219,7 @@ var files;
11777
12219
  * Limited to Microsoft-internal use
11778
12220
  */
11779
12221
  function getFileDownloads(callback) {
11780
- ensureInitialized(runtime, FrameContexts.content);
12222
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11781
12223
  if (!callback) {
11782
12224
  throw new Error('[files.getFileDownloads] Callback cannot be null');
11783
12225
  }
@@ -11797,7 +12239,7 @@ var files;
11797
12239
  */
11798
12240
  function openDownloadFolder(fileObjectId, callback) {
11799
12241
  if (fileObjectId === void 0) { fileObjectId = undefined; }
11800
- ensureInitialized(runtime, FrameContexts.content);
12242
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11801
12243
  if (!callback) {
11802
12244
  throw new Error('[files.openDownloadFolder] Callback cannot be null');
11803
12245
  }
@@ -11821,7 +12263,7 @@ var files;
11821
12263
  * Limited to Microsoft-internal use
11822
12264
  */
11823
12265
  function addCloudStorageProvider(callback) {
11824
- ensureInitialized(runtime, FrameContexts.content);
12266
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11825
12267
  if (!callback) {
11826
12268
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.addCloudStorageProvider] callback cannot be null');
11827
12269
  }
@@ -11843,7 +12285,7 @@ var files;
11843
12285
  * Limited to Microsoft-internal use
11844
12286
  */
11845
12287
  function removeCloudStorageProvider(logoutRequest, callback) {
11846
- ensureInitialized(runtime, FrameContexts.content);
12288
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11847
12289
  if (!callback) {
11848
12290
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.removeCloudStorageProvider] callback cannot be null');
11849
12291
  }
@@ -11866,7 +12308,7 @@ var files;
11866
12308
  * Limited to Microsoft-internal use
11867
12309
  */
11868
12310
  function addCloudStorageProviderFile(addNewFileRequest, callback) {
11869
- ensureInitialized(runtime, FrameContexts.content);
12311
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11870
12312
  if (!callback) {
11871
12313
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.addCloudStorageProviderFile] callback cannot be null');
11872
12314
  }
@@ -11889,7 +12331,7 @@ var files;
11889
12331
  * Limited to Microsoft-internal use
11890
12332
  */
11891
12333
  function renameCloudStorageProviderFile(renameFileRequest, callback) {
11892
- ensureInitialized(runtime, FrameContexts.content);
12334
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11893
12335
  if (!callback) {
11894
12336
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.renameCloudStorageProviderFile] callback cannot be null');
11895
12337
  }
@@ -11913,7 +12355,7 @@ var files;
11913
12355
  * Limited to Microsoft-internal use
11914
12356
  */
11915
12357
  function deleteCloudStorageProviderFile(deleteFileRequest, callback) {
11916
- ensureInitialized(runtime, FrameContexts.content);
12358
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11917
12359
  if (!callback) {
11918
12360
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.deleteCloudStorageProviderFile] callback cannot be null');
11919
12361
  }
@@ -11940,7 +12382,7 @@ var files;
11940
12382
  * Limited to Microsoft-internal use
11941
12383
  */
11942
12384
  function downloadCloudStorageProviderFile(downloadFileRequest, callback) {
11943
- ensureInitialized(runtime, FrameContexts.content);
12385
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11944
12386
  if (!callback) {
11945
12387
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.downloadCloudStorageProviderFile] callback cannot be null');
11946
12388
  }
@@ -11967,7 +12409,7 @@ var files;
11967
12409
  * Limited to Microsoft-internal use
11968
12410
  */
11969
12411
  function uploadCloudStorageProviderFile(uploadFileRequest, callback) {
11970
- ensureInitialized(runtime, FrameContexts.content);
12412
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
11971
12413
  if (!callback) {
11972
12414
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.uploadCloudStorageProviderFile] callback cannot be null');
11973
12415
  }
@@ -11995,7 +12437,7 @@ var files;
11995
12437
  * @internal Limited to Microsoft-internal use
11996
12438
  */
11997
12439
  function registerCloudStorageProviderListChangeHandler(handler) {
11998
- ensureInitialized(runtime);
12440
+ internalAPIs_ensureInitialized(runtime_runtime);
11999
12441
  if (!handler) {
12000
12442
  throw new Error('[registerCloudStorageProviderListChangeHandler] Handler cannot be null');
12001
12443
  }
@@ -12015,7 +12457,7 @@ var files;
12015
12457
  * Limited to Microsoft-internal use
12016
12458
  */
12017
12459
  function registerCloudStorageProviderContentChangeHandler(handler) {
12018
- ensureInitialized(runtime);
12460
+ internalAPIs_ensureInitialized(runtime_runtime);
12019
12461
  if (!handler) {
12020
12462
  throw new Error('[registerCloudStorageProviderContentChangeHandler] Handler cannot be null');
12021
12463
  }
@@ -12056,7 +12498,7 @@ var meetingRoom;
12056
12498
  */
12057
12499
  function getPairedMeetingRoomInfo() {
12058
12500
  return new Promise(function (resolve) {
12059
- ensureInitialized(runtime);
12501
+ internalAPIs_ensureInitialized(runtime_runtime);
12060
12502
  if (!isSupported()) {
12061
12503
  throw errorNotSupportedOnPlatform;
12062
12504
  }
@@ -12079,7 +12521,7 @@ var meetingRoom;
12079
12521
  if (!commandName || commandName.length == 0) {
12080
12522
  throw new Error('[meetingRoom.sendCommandToPairedMeetingRoom] Command name cannot be null or empty');
12081
12523
  }
12082
- ensureInitialized(runtime);
12524
+ internalAPIs_ensureInitialized(runtime_runtime);
12083
12525
  if (!isSupported()) {
12084
12526
  throw errorNotSupportedOnPlatform;
12085
12527
  }
@@ -12101,12 +12543,12 @@ var meetingRoom;
12101
12543
  if (!handler) {
12102
12544
  throw new Error('[meetingRoom.registerMeetingRoomCapabilitiesUpdateHandler] Handler cannot be null');
12103
12545
  }
12104
- ensureInitialized(runtime);
12546
+ internalAPIs_ensureInitialized(runtime_runtime);
12105
12547
  if (!isSupported()) {
12106
12548
  throw errorNotSupportedOnPlatform;
12107
12549
  }
12108
12550
  registerHandler('meetingRoom.meetingRoomCapabilitiesUpdate', function (capabilities) {
12109
- ensureInitialized(runtime);
12551
+ internalAPIs_ensureInitialized(runtime_runtime);
12110
12552
  handler(capabilities);
12111
12553
  });
12112
12554
  }
@@ -12126,12 +12568,12 @@ var meetingRoom;
12126
12568
  if (!handler) {
12127
12569
  throw new Error('[meetingRoom.registerMeetingRoomStatesUpdateHandler] Handler cannot be null');
12128
12570
  }
12129
- ensureInitialized(runtime);
12571
+ internalAPIs_ensureInitialized(runtime_runtime);
12130
12572
  if (!isSupported()) {
12131
12573
  throw errorNotSupportedOnPlatform;
12132
12574
  }
12133
12575
  registerHandler('meetingRoom.meetingRoomStatesUpdate', function (states) {
12134
- ensureInitialized(runtime);
12576
+ internalAPIs_ensureInitialized(runtime_runtime);
12135
12577
  handler(states);
12136
12578
  });
12137
12579
  }
@@ -12148,7 +12590,7 @@ var meetingRoom;
12148
12590
  * Limited to Microsoft-internal use
12149
12591
  */
12150
12592
  function isSupported() {
12151
- return ensureInitialized(runtime) && runtime.supports.meetingRoom ? true : false;
12593
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.meetingRoom ? true : false;
12152
12594
  }
12153
12595
  meetingRoom.isSupported = isSupported;
12154
12596
  })(meetingRoom || (meetingRoom = {}));
@@ -12171,7 +12613,7 @@ var notifications;
12171
12613
  * Limited to Microsoft-internal use
12172
12614
  */
12173
12615
  function showNotification(showNotificationParameters) {
12174
- ensureInitialized(runtime, FrameContexts.content);
12616
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
12175
12617
  if (!isSupported()) {
12176
12618
  throw errorNotSupportedOnPlatform;
12177
12619
  }
@@ -12190,7 +12632,7 @@ var notifications;
12190
12632
  * Limited to Microsoft-internal use
12191
12633
  */
12192
12634
  function isSupported() {
12193
- return ensureInitialized(runtime) && runtime.supports.notifications ? true : false;
12635
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.notifications ? true : false;
12194
12636
  }
12195
12637
  notifications.isSupported = isSupported;
12196
12638
  })(notifications || (notifications = {}));
@@ -12281,7 +12723,7 @@ var remoteCamera;
12281
12723
  if (!callback) {
12282
12724
  throw new Error('[remoteCamera.getCapableParticipants] Callback cannot be null');
12283
12725
  }
12284
- ensureInitialized(runtime, FrameContexts.sidePanel);
12726
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12285
12727
  if (!isSupported()) {
12286
12728
  throw errorNotSupportedOnPlatform;
12287
12729
  }
@@ -12308,7 +12750,7 @@ var remoteCamera;
12308
12750
  if (!callback) {
12309
12751
  throw new Error('[remoteCamera.requestControl] Callback cannot be null');
12310
12752
  }
12311
- ensureInitialized(runtime, FrameContexts.sidePanel);
12753
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12312
12754
  if (!isSupported()) {
12313
12755
  throw errorNotSupportedOnPlatform;
12314
12756
  }
@@ -12332,7 +12774,7 @@ var remoteCamera;
12332
12774
  if (!callback) {
12333
12775
  throw new Error('[remoteCamera.sendControlCommand] Callback cannot be null');
12334
12776
  }
12335
- ensureInitialized(runtime, FrameContexts.sidePanel);
12777
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12336
12778
  if (!isSupported()) {
12337
12779
  throw errorNotSupportedOnPlatform;
12338
12780
  }
@@ -12352,7 +12794,7 @@ var remoteCamera;
12352
12794
  if (!callback) {
12353
12795
  throw new Error('[remoteCamera.terminateSession] Callback cannot be null');
12354
12796
  }
12355
- ensureInitialized(runtime, FrameContexts.sidePanel);
12797
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12356
12798
  if (!isSupported()) {
12357
12799
  throw errorNotSupportedOnPlatform;
12358
12800
  }
@@ -12373,7 +12815,7 @@ var remoteCamera;
12373
12815
  if (!handler) {
12374
12816
  throw new Error('[remoteCamera.registerOnCapableParticipantsChangeHandler] Handler cannot be null');
12375
12817
  }
12376
- ensureInitialized(runtime, FrameContexts.sidePanel);
12818
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12377
12819
  if (!isSupported()) {
12378
12820
  throw errorNotSupportedOnPlatform;
12379
12821
  }
@@ -12394,7 +12836,7 @@ var remoteCamera;
12394
12836
  if (!handler) {
12395
12837
  throw new Error('[remoteCamera.registerOnErrorHandler] Handler cannot be null');
12396
12838
  }
12397
- ensureInitialized(runtime, FrameContexts.sidePanel);
12839
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12398
12840
  if (!isSupported()) {
12399
12841
  throw errorNotSupportedOnPlatform;
12400
12842
  }
@@ -12415,7 +12857,7 @@ var remoteCamera;
12415
12857
  if (!handler) {
12416
12858
  throw new Error('[remoteCamera.registerOnDeviceStateChangeHandler] Handler cannot be null');
12417
12859
  }
12418
- ensureInitialized(runtime, FrameContexts.sidePanel);
12860
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12419
12861
  if (!isSupported()) {
12420
12862
  throw errorNotSupportedOnPlatform;
12421
12863
  }
@@ -12436,7 +12878,7 @@ var remoteCamera;
12436
12878
  if (!handler) {
12437
12879
  throw new Error('[remoteCamera.registerOnSessionStatusChangeHandler] Handler cannot be null');
12438
12880
  }
12439
- ensureInitialized(runtime, FrameContexts.sidePanel);
12881
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12440
12882
  if (!isSupported()) {
12441
12883
  throw errorNotSupportedOnPlatform;
12442
12884
  }
@@ -12455,7 +12897,7 @@ var remoteCamera;
12455
12897
  * Limited to Microsoft-internal use
12456
12898
  */
12457
12899
  function isSupported() {
12458
- return ensureInitialized(runtime) && runtime.supports.remoteCamera ? true : false;
12900
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.remoteCamera ? true : false;
12459
12901
  }
12460
12902
  remoteCamera.isSupported = isSupported;
12461
12903
  })(remoteCamera || (remoteCamera = {}));
@@ -12466,6 +12908,11 @@ var remoteCamera;
12466
12908
 
12467
12909
 
12468
12910
 
12911
+
12912
+ /**
12913
+ * v1 APIs telemetry file: All of APIs in this capability file should send out API version v1 ONLY
12914
+ */
12915
+ var appEntityTelemetryVersionNumber = ApiVersionNumber.V_1;
12469
12916
  /**
12470
12917
  * @hidden
12471
12918
  * Namespace to interact with the application entities specific part of the SDK.
@@ -12492,7 +12939,7 @@ var appEntity;
12492
12939
  * Limited to Microsoft-internal use
12493
12940
  */
12494
12941
  function selectAppEntity(threadId, categories, subEntityId, callback) {
12495
- ensureInitialized(runtime, FrameContexts.content);
12942
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
12496
12943
  if (!isSupported()) {
12497
12944
  throw errorNotSupportedOnPlatform;
12498
12945
  }
@@ -12502,7 +12949,7 @@ var appEntity;
12502
12949
  if (!callback) {
12503
12950
  throw new Error('[appEntity.selectAppEntity] Callback cannot be null');
12504
12951
  }
12505
- sendMessageToParent('appEntity.selectAppEntity', [threadId, categories, subEntityId], callback);
12952
+ communication_sendMessageToParentWithVersion(getApiVersionTag(appEntityTelemetryVersionNumber, ApiName.AppEntity_SelectAppEntity), 'appEntity.selectAppEntity', [threadId, categories, subEntityId], callback);
12506
12953
  }
12507
12954
  appEntity_1.selectAppEntity = selectAppEntity;
12508
12955
  /**
@@ -12517,7 +12964,7 @@ var appEntity;
12517
12964
  * Limited to Microsoft-internal use
12518
12965
  */
12519
12966
  function isSupported() {
12520
- return ensureInitialized(runtime) && runtime.supports.appEntity ? true : false;
12967
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.appEntity ? true : false;
12521
12968
  }
12522
12969
  appEntity_1.isSupported = isSupported;
12523
12970
  })(appEntity || (appEntity = {}));
@@ -12555,7 +13002,7 @@ var teams;
12555
13002
  * Limited to Microsoft-internal use
12556
13003
  */
12557
13004
  function getTeamChannels(groupId, callback) {
12558
- ensureInitialized(runtime, FrameContexts.content);
13005
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.content);
12559
13006
  if (!isSupported()) {
12560
13007
  throw errorNotSupportedOnPlatform;
12561
13008
  }
@@ -12580,7 +13027,7 @@ var teams;
12580
13027
  * Limited to Microsoft-internal use
12581
13028
  */
12582
13029
  function refreshSiteUrl(threadId, callback) {
12583
- ensureInitialized(runtime);
13030
+ internalAPIs_ensureInitialized(runtime_runtime);
12584
13031
  if (!isSupported()) {
12585
13032
  throw errorNotSupportedOnPlatform;
12586
13033
  }
@@ -12605,7 +13052,7 @@ var teams;
12605
13052
  * Limited to Microsoft-internal use
12606
13053
  */
12607
13054
  function isSupported() {
12608
- return ensureInitialized(runtime) && runtime.supports.teams ? true : false;
13055
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.teams ? true : false;
12609
13056
  }
12610
13057
  teams.isSupported = isSupported;
12611
13058
  /**
@@ -12634,7 +13081,7 @@ var teams;
12634
13081
  */
12635
13082
  function getUserJoinedTeams(teamInstanceParameters) {
12636
13083
  return new Promise(function (resolve) {
12637
- ensureInitialized(runtime);
13084
+ internalAPIs_ensureInitialized(runtime_runtime);
12638
13085
  if (!isSupported()) {
12639
13086
  throw errorNotSupportedOnPlatform;
12640
13087
  }
@@ -12663,9 +13110,9 @@ var teams;
12663
13110
  * Limited to Microsoft-internal use
12664
13111
  */
12665
13112
  function isSupported() {
12666
- return ensureInitialized(runtime) && runtime.supports.teams
12667
- ? runtime.supports.teams.fullTrust
12668
- ? runtime.supports.teams.fullTrust.joinedTeams
13113
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.teams
13114
+ ? runtime_runtime.supports.teams.fullTrust
13115
+ ? runtime_runtime.supports.teams.fullTrust.joinedTeams
12669
13116
  ? true
12670
13117
  : false
12671
13118
  : false
@@ -12685,7 +13132,7 @@ var teams;
12685
13132
  */
12686
13133
  function getConfigSetting(key) {
12687
13134
  return new Promise(function (resolve) {
12688
- ensureInitialized(runtime);
13135
+ internalAPIs_ensureInitialized(runtime_runtime);
12689
13136
  if (!isSupported()) {
12690
13137
  throw errorNotSupportedOnPlatform;
12691
13138
  }
@@ -12705,8 +13152,8 @@ var teams;
12705
13152
  * Limited to Microsoft-internal use
12706
13153
  */
12707
13154
  function isSupported() {
12708
- return ensureInitialized(runtime) && runtime.supports.teams
12709
- ? runtime.supports.teams.fullTrust
13155
+ return internalAPIs_ensureInitialized(runtime_runtime) && runtime_runtime.supports.teams
13156
+ ? runtime_runtime.supports.teams.fullTrust
12710
13157
  ? true
12711
13158
  : false
12712
13159
  : false;
@@ -12808,9 +13255,9 @@ var videoEffectsEx;
12808
13255
  if (!parameters.videoFrameHandler || !parameters.videoBufferHandler) {
12809
13256
  throw new Error('Both videoFrameHandler and videoBufferHandler must be provided');
12810
13257
  }
12811
- if (ensureInitialized(runtime, FrameContexts.sidePanel)) {
13258
+ if (internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel)) {
12812
13259
  registerHandler('video.setFrameProcessTimeLimit', function (timeLimit) { return videoPerformanceMonitor === null || videoPerformanceMonitor === void 0 ? void 0 : videoPerformanceMonitor.setFrameProcessTimeLimit(timeLimit); }, false);
12813
- if ((_a = runtime.supports.video) === null || _a === void 0 ? void 0 : _a.mediaStream) {
13260
+ if ((_a = runtime_runtime.supports.video) === null || _a === void 0 ? void 0 : _a.mediaStream) {
12814
13261
  registerHandler('video.startVideoExtensibilityVideoStream', function (mediaStreamInfo) { return videoEffectsEx_awaiter(_this, void 0, void 0, function () {
12815
13262
  var streamId, metadataInTexture, handler, _a;
12816
13263
  return videoEffectsEx_generator(this, function (_b) {
@@ -12837,7 +13284,7 @@ var videoEffectsEx;
12837
13284
  }); }, false);
12838
13285
  sendMessageToParent('video.mediaStream.registerForVideoFrame', [parameters.config]);
12839
13286
  }
12840
- else if ((_b = runtime.supports.video) === null || _b === void 0 ? void 0 : _b.sharedFrame) {
13287
+ else if ((_b = runtime_runtime.supports.video) === null || _b === void 0 ? void 0 : _b.sharedFrame) {
12841
13288
  registerHandler('video.newVideoFrame', function (videoBufferData) {
12842
13289
  if (videoBufferData) {
12843
13290
  videoPerformanceMonitor === null || videoPerformanceMonitor === void 0 ? void 0 : videoPerformanceMonitor.reportStartFrameProcessing(videoBufferData.width, videoBufferData.height);
@@ -12895,7 +13342,7 @@ var videoEffectsEx;
12895
13342
  * Limited to Microsoft-internal use
12896
13343
  */
12897
13344
  function notifySelectedVideoEffectChanged(effectChangeType, effectId, effectParam) {
12898
- ensureInitialized(runtime, FrameContexts.sidePanel);
13345
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12899
13346
  if (!isSupported()) {
12900
13347
  throw errorNotSupportedOnPlatform;
12901
13348
  }
@@ -12912,7 +13359,7 @@ var videoEffectsEx;
12912
13359
  * Limited to Microsoft-internal use
12913
13360
  */
12914
13361
  function registerForVideoEffect(callback) {
12915
- ensureInitialized(runtime, FrameContexts.sidePanel);
13362
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12916
13363
  if (!isSupported()) {
12917
13364
  throw errorNotSupportedOnPlatform;
12918
13365
  }
@@ -12929,7 +13376,7 @@ var videoEffectsEx;
12929
13376
  * Limited to Microsoft-internal use
12930
13377
  */
12931
13378
  function updatePersonalizedEffects(effects) {
12932
- ensureInitialized(runtime, FrameContexts.sidePanel);
13379
+ internalAPIs_ensureInitialized(runtime_runtime, FrameContexts.sidePanel);
12933
13380
  if (!videoEffects.isSupported()) {
12934
13381
  throw errorNotSupportedOnPlatform;
12935
13382
  }
@@ -12950,7 +13397,7 @@ var videoEffectsEx;
12950
13397
  * Limited to Microsoft-internal use
12951
13398
  */
12952
13399
  function isSupported() {
12953
- ensureInitialized(runtime);
13400
+ internalAPIs_ensureInitialized(runtime_runtime);
12954
13401
  return videoEffects.isSupported();
12955
13402
  }
12956
13403
  videoEffectsEx.isSupported = isSupported;
@@ -12991,7 +13438,7 @@ var videoEffectsEx;
12991
13438
  * Limited to Microsoft-internal use
12992
13439
  */
12993
13440
  function notifyFatalError(errorMessage) {
12994
- ensureInitialized(runtime);
13441
+ internalAPIs_ensureInitialized(runtime_runtime);
12995
13442
  if (!videoEffects.isSupported()) {
12996
13443
  throw errorNotSupportedOnPlatform;
12997
13444
  }