@microsoft/teams-js 2.6.1 → 2.7.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@
7
7
  exports["microsoftTeams"] = factory();
8
8
  else
9
9
  root["microsoftTeams"] = factory();
10
- })(self, function() {
10
+ })(this, function() {
11
11
  return /******/ (() => { // webpackBootstrap
12
12
  /******/ var __webpack_modules__ = ({
13
13
 
@@ -1132,227 +1132,6 @@ __webpack_require__.d(__webpack_exports__, {
1132
1132
  "webStorage": () => (/* reexport */ webStorage)
1133
1133
  });
1134
1134
 
1135
- ;// CONCATENATED MODULE: ./src/public/version.ts
1136
- var version = "2.6.1";
1137
-
1138
- ;// CONCATENATED MODULE: ./src/internal/globalVars.ts
1139
- var GlobalVars = /** @class */ (function () {
1140
- function GlobalVars() {
1141
- }
1142
- GlobalVars.initializeCalled = false;
1143
- GlobalVars.initializeCompleted = false;
1144
- GlobalVars.additionalValidOrigins = [];
1145
- GlobalVars.isFramelessWindow = false;
1146
- GlobalVars.printCapabilityEnabled = false;
1147
- return GlobalVars;
1148
- }());
1149
-
1150
-
1151
- ;// CONCATENATED MODULE: ./src/public/interfaces.ts
1152
- /* eslint-disable @typescript-eslint/no-explicit-any*/
1153
- /**
1154
- * Allowed user file open preferences
1155
- */
1156
- var FileOpenPreference;
1157
- (function (FileOpenPreference) {
1158
- FileOpenPreference["Inline"] = "inline";
1159
- FileOpenPreference["Desktop"] = "desktop";
1160
- FileOpenPreference["Web"] = "web";
1161
- })(FileOpenPreference || (FileOpenPreference = {}));
1162
- /**
1163
- * Possible Action Types
1164
- *
1165
- * @beta
1166
- */
1167
- var ActionObjectType;
1168
- (function (ActionObjectType) {
1169
- ActionObjectType["M365Content"] = "m365content";
1170
- })(ActionObjectType || (ActionObjectType = {}));
1171
- /**
1172
- * These correspond with field names in the MSGraph
1173
- *
1174
- * @beta
1175
- */
1176
- var SecondaryM365ContentIdName;
1177
- (function (SecondaryM365ContentIdName) {
1178
- SecondaryM365ContentIdName["DriveId"] = "driveId";
1179
- SecondaryM365ContentIdName["GroupId"] = "groupId";
1180
- SecondaryM365ContentIdName["SiteId"] = "siteId";
1181
- SecondaryM365ContentIdName["UserId"] = "userId";
1182
- })(SecondaryM365ContentIdName || (SecondaryM365ContentIdName = {}));
1183
- var ErrorCode;
1184
- (function (ErrorCode) {
1185
- /**
1186
- * API not supported in the current platform.
1187
- */
1188
- ErrorCode[ErrorCode["NOT_SUPPORTED_ON_PLATFORM"] = 100] = "NOT_SUPPORTED_ON_PLATFORM";
1189
- /**
1190
- * Internal error encountered while performing the required operation.
1191
- */
1192
- ErrorCode[ErrorCode["INTERNAL_ERROR"] = 500] = "INTERNAL_ERROR";
1193
- /**
1194
- * API is not supported in the current context
1195
- */
1196
- ErrorCode[ErrorCode["NOT_SUPPORTED_IN_CURRENT_CONTEXT"] = 501] = "NOT_SUPPORTED_IN_CURRENT_CONTEXT";
1197
- /**
1198
- Permissions denied by user
1199
- */
1200
- ErrorCode[ErrorCode["PERMISSION_DENIED"] = 1000] = "PERMISSION_DENIED";
1201
- /**
1202
- * Network issue
1203
- */
1204
- ErrorCode[ErrorCode["NETWORK_ERROR"] = 2000] = "NETWORK_ERROR";
1205
- /**
1206
- * Underlying hardware doesn't support the capability
1207
- */
1208
- ErrorCode[ErrorCode["NO_HW_SUPPORT"] = 3000] = "NO_HW_SUPPORT";
1209
- /**
1210
- * One or more arguments are invalid
1211
- */
1212
- ErrorCode[ErrorCode["INVALID_ARGUMENTS"] = 4000] = "INVALID_ARGUMENTS";
1213
- /**
1214
- * User is not authorized for this operation
1215
- */
1216
- ErrorCode[ErrorCode["UNAUTHORIZED_USER_OPERATION"] = 5000] = "UNAUTHORIZED_USER_OPERATION";
1217
- /**
1218
- * Could not complete the operation due to insufficient resources
1219
- */
1220
- ErrorCode[ErrorCode["INSUFFICIENT_RESOURCES"] = 6000] = "INSUFFICIENT_RESOURCES";
1221
- /**
1222
- * Platform throttled the request because of API was invoked too frequently
1223
- */
1224
- ErrorCode[ErrorCode["THROTTLE"] = 7000] = "THROTTLE";
1225
- /**
1226
- * User aborted the operation
1227
- */
1228
- ErrorCode[ErrorCode["USER_ABORT"] = 8000] = "USER_ABORT";
1229
- /**
1230
- * Could not complete the operation in the given time interval
1231
- */
1232
- ErrorCode[ErrorCode["OPERATION_TIMED_OUT"] = 8001] = "OPERATION_TIMED_OUT";
1233
- /**
1234
- * Platform code is old and doesn't implement this API
1235
- */
1236
- ErrorCode[ErrorCode["OLD_PLATFORM"] = 9000] = "OLD_PLATFORM";
1237
- /**
1238
- * The file specified was not found on the given location
1239
- */
1240
- ErrorCode[ErrorCode["FILE_NOT_FOUND"] = 404] = "FILE_NOT_FOUND";
1241
- /**
1242
- * The return value is too big and has exceeded our size boundries
1243
- */
1244
- ErrorCode[ErrorCode["SIZE_EXCEEDED"] = 10000] = "SIZE_EXCEEDED";
1245
- })(ErrorCode || (ErrorCode = {}));
1246
- /** @hidden */
1247
- var DevicePermission;
1248
- (function (DevicePermission) {
1249
- DevicePermission["GeoLocation"] = "geolocation";
1250
- DevicePermission["Media"] = "media";
1251
- })(DevicePermission || (DevicePermission = {}));
1252
-
1253
- ;// CONCATENATED MODULE: ./src/public/constants.ts
1254
- var HostClientType;
1255
- (function (HostClientType) {
1256
- HostClientType["desktop"] = "desktop";
1257
- HostClientType["web"] = "web";
1258
- HostClientType["android"] = "android";
1259
- HostClientType["ios"] = "ios";
1260
- HostClientType["ipados"] = "ipados";
1261
- /**
1262
- * @deprecated
1263
- * As of 2.0.0, please use {@link teamsRoomsWindows} instead.
1264
- */
1265
- HostClientType["rigel"] = "rigel";
1266
- HostClientType["surfaceHub"] = "surfaceHub";
1267
- HostClientType["teamsRoomsWindows"] = "teamsRoomsWindows";
1268
- HostClientType["teamsRoomsAndroid"] = "teamsRoomsAndroid";
1269
- HostClientType["teamsPhones"] = "teamsPhones";
1270
- HostClientType["teamsDisplays"] = "teamsDisplays";
1271
- })(HostClientType || (HostClientType = {}));
1272
- var HostName;
1273
- (function (HostName) {
1274
- /**
1275
- * Office.com and Office Windows App
1276
- */
1277
- HostName["office"] = "Office";
1278
- /**
1279
- * For "desktop" specifically, this refers to the new, pre-release version of Outlook for Windows.
1280
- * Also used on other platforms that map to a single Outlook client.
1281
- */
1282
- HostName["outlook"] = "Outlook";
1283
- /**
1284
- * Outlook for Windows: the classic, native, desktop client
1285
- */
1286
- HostName["outlookWin32"] = "OutlookWin32";
1287
- /**
1288
- * Microsoft-internal test Host
1289
- */
1290
- HostName["orange"] = "Orange";
1291
- /**
1292
- * Teams
1293
- */
1294
- HostName["teams"] = "Teams";
1295
- })(HostName || (HostName = {}));
1296
- // Ensure these declarations stay in sync with the framework.
1297
- var FrameContexts;
1298
- (function (FrameContexts) {
1299
- FrameContexts["settings"] = "settings";
1300
- FrameContexts["content"] = "content";
1301
- FrameContexts["authentication"] = "authentication";
1302
- FrameContexts["remove"] = "remove";
1303
- FrameContexts["task"] = "task";
1304
- FrameContexts["sidePanel"] = "sidePanel";
1305
- FrameContexts["stage"] = "stage";
1306
- FrameContexts["meetingStage"] = "meetingStage";
1307
- })(FrameContexts || (FrameContexts = {}));
1308
- /**
1309
- * Indicates the team type, currently used to distinguish between different team
1310
- * types in Office 365 for Education (team types 1, 2, 3, and 4).
1311
- */
1312
- var TeamType;
1313
- (function (TeamType) {
1314
- TeamType[TeamType["Standard"] = 0] = "Standard";
1315
- TeamType[TeamType["Edu"] = 1] = "Edu";
1316
- TeamType[TeamType["Class"] = 2] = "Class";
1317
- TeamType[TeamType["Plc"] = 3] = "Plc";
1318
- TeamType[TeamType["Staff"] = 4] = "Staff";
1319
- })(TeamType || (TeamType = {}));
1320
- /**
1321
- * Indicates the various types of roles of a user in a team.
1322
- */
1323
- var UserTeamRole;
1324
- (function (UserTeamRole) {
1325
- UserTeamRole[UserTeamRole["Admin"] = 0] = "Admin";
1326
- UserTeamRole[UserTeamRole["User"] = 1] = "User";
1327
- UserTeamRole[UserTeamRole["Guest"] = 2] = "Guest";
1328
- })(UserTeamRole || (UserTeamRole = {}));
1329
- /**
1330
- * Dialog module dimension enum
1331
- */
1332
- var DialogDimension;
1333
- (function (DialogDimension) {
1334
- DialogDimension["Large"] = "large";
1335
- DialogDimension["Medium"] = "medium";
1336
- DialogDimension["Small"] = "small";
1337
- })(DialogDimension || (DialogDimension = {}));
1338
-
1339
- /**
1340
- * @deprecated
1341
- * As of 2.0.0, please use {@link DialogDimension} instead.
1342
- */
1343
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
1344
- var TaskModuleDimension = DialogDimension;
1345
- /**
1346
- * The type of the channel with which the content is associated.
1347
- */
1348
- var ChannelType;
1349
- (function (ChannelType) {
1350
- ChannelType["Regular"] = "Regular";
1351
- ChannelType["Private"] = "Private";
1352
- ChannelType["Shared"] = "Shared";
1353
- })(ChannelType || (ChannelType = {}));
1354
- var errorNotSupportedOnPlatform = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };
1355
-
1356
1135
  ;// CONCATENATED MODULE: ./src/internal/constants.ts
1357
1136
  /**
1358
1137
  * @hidden
@@ -1518,6 +1297,23 @@ var teamsDeepLinkProtocol = 'https';
1518
1297
  var teamsDeepLinkHost = 'teams.microsoft.com';
1519
1298
  /** @hidden */
1520
1299
  var errorLibraryNotInitialized = 'The library has not yet been initialized';
1300
+ /** @hidden */
1301
+ var errorRuntimeNotInitialized = 'The runtime has not yet been initialized';
1302
+ /** @hidden */
1303
+ var errorRuntimeNotSupported = 'The runtime version is not supported';
1304
+
1305
+ ;// CONCATENATED MODULE: ./src/internal/globalVars.ts
1306
+ var GlobalVars = /** @class */ (function () {
1307
+ function GlobalVars() {
1308
+ }
1309
+ GlobalVars.initializeCalled = false;
1310
+ GlobalVars.initializeCompleted = false;
1311
+ GlobalVars.additionalValidOrigins = [];
1312
+ GlobalVars.isFramelessWindow = false;
1313
+ GlobalVars.printCapabilityEnabled = false;
1314
+ return GlobalVars;
1315
+ }());
1316
+
1521
1317
 
1522
1318
  // EXTERNAL MODULE: ./node_modules/debug/src/browser.js
1523
1319
  var browser = __webpack_require__(227);
@@ -1669,10 +1465,10 @@ function generateGUID() {
1669
1465
  * @internal
1670
1466
  * Limited to Microsoft-internal use
1671
1467
  */
1672
- function deepFreeze(obj) {
1468
+ function utils_deepFreeze(obj) {
1673
1469
  Object.keys(obj).forEach(function (prop) {
1674
1470
  if (typeof obj[prop] === 'object') {
1675
- deepFreeze(obj[prop]);
1471
+ utils_deepFreeze(obj[prop]);
1676
1472
  }
1677
1473
  });
1678
1474
  return Object.freeze(obj);
@@ -1847,19 +1643,480 @@ function runWithTimeout(action, timeoutInMs, timeoutError) {
1847
1643
  * @internal
1848
1644
  * Limited to Microsoft-internal use
1849
1645
  */
1850
- function createTeamsAppLink(params) {
1851
- var url = new URL('https://teams.microsoft.com/l/entity/' +
1852
- encodeURIComponent(params.appId) +
1853
- '/' +
1854
- encodeURIComponent(params.pageId));
1855
- if (params.webUrl) {
1856
- url.searchParams.append('webUrl', params.webUrl);
1857
- }
1858
- if (params.channelId || params.subPageId) {
1859
- url.searchParams.append('context', JSON.stringify({ channelId: params.channelId, subEntityId: params.subPageId }));
1860
- }
1861
- return url.toString();
1862
- }
1646
+ function createTeamsAppLink(params) {
1647
+ var url = new URL('https://teams.microsoft.com/l/entity/' +
1648
+ encodeURIComponent(params.appId) +
1649
+ '/' +
1650
+ encodeURIComponent(params.pageId));
1651
+ if (params.webUrl) {
1652
+ url.searchParams.append('webUrl', params.webUrl);
1653
+ }
1654
+ if (params.channelId || params.subPageId) {
1655
+ url.searchParams.append('context', JSON.stringify({ channelId: params.channelId, subEntityId: params.subPageId }));
1656
+ }
1657
+ return url.toString();
1658
+ }
1659
+
1660
+ ;// CONCATENATED MODULE: ./src/public/interfaces.ts
1661
+ /* eslint-disable @typescript-eslint/no-explicit-any*/
1662
+ /**
1663
+ * Allowed user file open preferences
1664
+ */
1665
+ var FileOpenPreference;
1666
+ (function (FileOpenPreference) {
1667
+ FileOpenPreference["Inline"] = "inline";
1668
+ FileOpenPreference["Desktop"] = "desktop";
1669
+ FileOpenPreference["Web"] = "web";
1670
+ })(FileOpenPreference || (FileOpenPreference = {}));
1671
+ /**
1672
+ * Possible Action Types
1673
+ *
1674
+ * @beta
1675
+ */
1676
+ var ActionObjectType;
1677
+ (function (ActionObjectType) {
1678
+ ActionObjectType["M365Content"] = "m365content";
1679
+ })(ActionObjectType || (ActionObjectType = {}));
1680
+ /**
1681
+ * These correspond with field names in the MSGraph
1682
+ *
1683
+ * @beta
1684
+ */
1685
+ var SecondaryM365ContentIdName;
1686
+ (function (SecondaryM365ContentIdName) {
1687
+ SecondaryM365ContentIdName["DriveId"] = "driveId";
1688
+ SecondaryM365ContentIdName["GroupId"] = "groupId";
1689
+ SecondaryM365ContentIdName["SiteId"] = "siteId";
1690
+ SecondaryM365ContentIdName["UserId"] = "userId";
1691
+ })(SecondaryM365ContentIdName || (SecondaryM365ContentIdName = {}));
1692
+ var ErrorCode;
1693
+ (function (ErrorCode) {
1694
+ /**
1695
+ * API not supported in the current platform.
1696
+ */
1697
+ ErrorCode[ErrorCode["NOT_SUPPORTED_ON_PLATFORM"] = 100] = "NOT_SUPPORTED_ON_PLATFORM";
1698
+ /**
1699
+ * Internal error encountered while performing the required operation.
1700
+ */
1701
+ ErrorCode[ErrorCode["INTERNAL_ERROR"] = 500] = "INTERNAL_ERROR";
1702
+ /**
1703
+ * API is not supported in the current context
1704
+ */
1705
+ ErrorCode[ErrorCode["NOT_SUPPORTED_IN_CURRENT_CONTEXT"] = 501] = "NOT_SUPPORTED_IN_CURRENT_CONTEXT";
1706
+ /**
1707
+ Permissions denied by user
1708
+ */
1709
+ ErrorCode[ErrorCode["PERMISSION_DENIED"] = 1000] = "PERMISSION_DENIED";
1710
+ /**
1711
+ * Network issue
1712
+ */
1713
+ ErrorCode[ErrorCode["NETWORK_ERROR"] = 2000] = "NETWORK_ERROR";
1714
+ /**
1715
+ * Underlying hardware doesn't support the capability
1716
+ */
1717
+ ErrorCode[ErrorCode["NO_HW_SUPPORT"] = 3000] = "NO_HW_SUPPORT";
1718
+ /**
1719
+ * One or more arguments are invalid
1720
+ */
1721
+ ErrorCode[ErrorCode["INVALID_ARGUMENTS"] = 4000] = "INVALID_ARGUMENTS";
1722
+ /**
1723
+ * User is not authorized for this operation
1724
+ */
1725
+ ErrorCode[ErrorCode["UNAUTHORIZED_USER_OPERATION"] = 5000] = "UNAUTHORIZED_USER_OPERATION";
1726
+ /**
1727
+ * Could not complete the operation due to insufficient resources
1728
+ */
1729
+ ErrorCode[ErrorCode["INSUFFICIENT_RESOURCES"] = 6000] = "INSUFFICIENT_RESOURCES";
1730
+ /**
1731
+ * Platform throttled the request because of API was invoked too frequently
1732
+ */
1733
+ ErrorCode[ErrorCode["THROTTLE"] = 7000] = "THROTTLE";
1734
+ /**
1735
+ * User aborted the operation
1736
+ */
1737
+ ErrorCode[ErrorCode["USER_ABORT"] = 8000] = "USER_ABORT";
1738
+ /**
1739
+ * Could not complete the operation in the given time interval
1740
+ */
1741
+ ErrorCode[ErrorCode["OPERATION_TIMED_OUT"] = 8001] = "OPERATION_TIMED_OUT";
1742
+ /**
1743
+ * Platform code is old and doesn't implement this API
1744
+ */
1745
+ ErrorCode[ErrorCode["OLD_PLATFORM"] = 9000] = "OLD_PLATFORM";
1746
+ /**
1747
+ * The file specified was not found on the given location
1748
+ */
1749
+ ErrorCode[ErrorCode["FILE_NOT_FOUND"] = 404] = "FILE_NOT_FOUND";
1750
+ /**
1751
+ * The return value is too big and has exceeded our size boundries
1752
+ */
1753
+ ErrorCode[ErrorCode["SIZE_EXCEEDED"] = 10000] = "SIZE_EXCEEDED";
1754
+ })(ErrorCode || (ErrorCode = {}));
1755
+ /** @hidden */
1756
+ var DevicePermission;
1757
+ (function (DevicePermission) {
1758
+ DevicePermission["GeoLocation"] = "geolocation";
1759
+ DevicePermission["Media"] = "media";
1760
+ })(DevicePermission || (DevicePermission = {}));
1761
+
1762
+ ;// CONCATENATED MODULE: ./src/public/constants.ts
1763
+ var HostClientType;
1764
+ (function (HostClientType) {
1765
+ HostClientType["desktop"] = "desktop";
1766
+ HostClientType["web"] = "web";
1767
+ HostClientType["android"] = "android";
1768
+ HostClientType["ios"] = "ios";
1769
+ HostClientType["ipados"] = "ipados";
1770
+ /**
1771
+ * @deprecated
1772
+ * As of 2.0.0, please use {@link teamsRoomsWindows} instead.
1773
+ */
1774
+ HostClientType["rigel"] = "rigel";
1775
+ HostClientType["surfaceHub"] = "surfaceHub";
1776
+ HostClientType["teamsRoomsWindows"] = "teamsRoomsWindows";
1777
+ HostClientType["teamsRoomsAndroid"] = "teamsRoomsAndroid";
1778
+ HostClientType["teamsPhones"] = "teamsPhones";
1779
+ HostClientType["teamsDisplays"] = "teamsDisplays";
1780
+ })(HostClientType || (HostClientType = {}));
1781
+ var HostName;
1782
+ (function (HostName) {
1783
+ /**
1784
+ * Office.com and Office Windows App
1785
+ */
1786
+ HostName["office"] = "Office";
1787
+ /**
1788
+ * For "desktop" specifically, this refers to the new, pre-release version of Outlook for Windows.
1789
+ * Also used on other platforms that map to a single Outlook client.
1790
+ */
1791
+ HostName["outlook"] = "Outlook";
1792
+ /**
1793
+ * Outlook for Windows: the classic, native, desktop client
1794
+ */
1795
+ HostName["outlookWin32"] = "OutlookWin32";
1796
+ /**
1797
+ * Microsoft-internal test Host
1798
+ */
1799
+ HostName["orange"] = "Orange";
1800
+ /**
1801
+ * Teams
1802
+ */
1803
+ HostName["teams"] = "Teams";
1804
+ })(HostName || (HostName = {}));
1805
+ // Ensure these declarations stay in sync with the framework.
1806
+ var FrameContexts;
1807
+ (function (FrameContexts) {
1808
+ FrameContexts["settings"] = "settings";
1809
+ FrameContexts["content"] = "content";
1810
+ FrameContexts["authentication"] = "authentication";
1811
+ FrameContexts["remove"] = "remove";
1812
+ FrameContexts["task"] = "task";
1813
+ FrameContexts["sidePanel"] = "sidePanel";
1814
+ FrameContexts["stage"] = "stage";
1815
+ FrameContexts["meetingStage"] = "meetingStage";
1816
+ })(FrameContexts || (FrameContexts = {}));
1817
+ /**
1818
+ * Indicates the team type, currently used to distinguish between different team
1819
+ * types in Office 365 for Education (team types 1, 2, 3, and 4).
1820
+ */
1821
+ var TeamType;
1822
+ (function (TeamType) {
1823
+ TeamType[TeamType["Standard"] = 0] = "Standard";
1824
+ TeamType[TeamType["Edu"] = 1] = "Edu";
1825
+ TeamType[TeamType["Class"] = 2] = "Class";
1826
+ TeamType[TeamType["Plc"] = 3] = "Plc";
1827
+ TeamType[TeamType["Staff"] = 4] = "Staff";
1828
+ })(TeamType || (TeamType = {}));
1829
+ /**
1830
+ * Indicates the various types of roles of a user in a team.
1831
+ */
1832
+ var UserTeamRole;
1833
+ (function (UserTeamRole) {
1834
+ UserTeamRole[UserTeamRole["Admin"] = 0] = "Admin";
1835
+ UserTeamRole[UserTeamRole["User"] = 1] = "User";
1836
+ UserTeamRole[UserTeamRole["Guest"] = 2] = "Guest";
1837
+ })(UserTeamRole || (UserTeamRole = {}));
1838
+ /**
1839
+ * Dialog module dimension enum
1840
+ */
1841
+ var DialogDimension;
1842
+ (function (DialogDimension) {
1843
+ DialogDimension["Large"] = "large";
1844
+ DialogDimension["Medium"] = "medium";
1845
+ DialogDimension["Small"] = "small";
1846
+ })(DialogDimension || (DialogDimension = {}));
1847
+
1848
+ /**
1849
+ * @deprecated
1850
+ * As of 2.0.0, please use {@link DialogDimension} instead.
1851
+ */
1852
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1853
+ var TaskModuleDimension = DialogDimension;
1854
+ /**
1855
+ * The type of the channel with which the content is associated.
1856
+ */
1857
+ var ChannelType;
1858
+ (function (ChannelType) {
1859
+ ChannelType["Regular"] = "Regular";
1860
+ ChannelType["Private"] = "Private";
1861
+ ChannelType["Shared"] = "Shared";
1862
+ })(ChannelType || (ChannelType = {}));
1863
+ var errorNotSupportedOnPlatform = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };
1864
+
1865
+ ;// CONCATENATED MODULE: ./src/public/runtime.ts
1866
+ /* eslint-disable @typescript-eslint/ban-types */
1867
+ var __assign = (undefined && undefined.__assign) || function () {
1868
+ __assign = Object.assign || function(t) {
1869
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
1870
+ s = arguments[i];
1871
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
1872
+ t[p] = s[p];
1873
+ }
1874
+ return t;
1875
+ };
1876
+ return __assign.apply(this, arguments);
1877
+ };
1878
+
1879
+
1880
+
1881
+
1882
+
1883
+ var runtimeLogger = getLogger('runtime');
1884
+ var latestRuntimeApiVersion = 1;
1885
+ function isLatestRuntimeVersion(runtime) {
1886
+ return runtime.apiVersion === latestRuntimeApiVersion;
1887
+ }
1888
+ // Constant used to set the runtime configuration
1889
+ var _uninitializedRuntime = {
1890
+ apiVersion: -1,
1891
+ supports: {},
1892
+ };
1893
+ /**
1894
+ * @hidden
1895
+ * Ensures that the runtime has been initialized
1896
+
1897
+ * @returns True if the runtime has been initialized
1898
+ * @throws Error if the runtime has not been initialized
1899
+ *
1900
+ * @internal
1901
+ * Limited to Microsoft-internal use
1902
+ */
1903
+ function isRuntimeInitialized(runtime) {
1904
+ if (isLatestRuntimeVersion(runtime)) {
1905
+ return true;
1906
+ }
1907
+ else if (runtime.apiVersion === -1) {
1908
+ throw new Error(errorRuntimeNotInitialized);
1909
+ }
1910
+ else {
1911
+ throw new Error(errorRuntimeNotSupported);
1912
+ }
1913
+ }
1914
+ var runtime = _uninitializedRuntime;
1915
+ var teamsRuntimeConfig = {
1916
+ apiVersion: 1,
1917
+ isLegacyTeams: true,
1918
+ supports: {
1919
+ appInstallDialog: {},
1920
+ appEntity: {},
1921
+ call: {},
1922
+ chat: {},
1923
+ conversations: {},
1924
+ dialog: {
1925
+ bot: {},
1926
+ update: {},
1927
+ },
1928
+ logs: {},
1929
+ meetingRoom: {},
1930
+ menus: {},
1931
+ monetization: {},
1932
+ notifications: {},
1933
+ pages: {
1934
+ appButton: {},
1935
+ tabs: {},
1936
+ config: {},
1937
+ backStack: {},
1938
+ fullTrust: {},
1939
+ },
1940
+ remoteCamera: {},
1941
+ sharing: {},
1942
+ stageView: {},
1943
+ teams: {
1944
+ fullTrust: {},
1945
+ },
1946
+ teamsCore: {},
1947
+ video: {},
1948
+ },
1949
+ };
1950
+ var v1HostClientTypes = [
1951
+ HostClientType.desktop,
1952
+ HostClientType.web,
1953
+ HostClientType.android,
1954
+ HostClientType.ios,
1955
+ HostClientType.rigel,
1956
+ HostClientType.surfaceHub,
1957
+ HostClientType.teamsRoomsWindows,
1958
+ HostClientType.teamsRoomsAndroid,
1959
+ HostClientType.teamsPhones,
1960
+ HostClientType.teamsDisplays,
1961
+ ];
1962
+ /**
1963
+ * @hidden
1964
+ * Uses upgradeChain to transform an outdated runtime object to the latest format.
1965
+ * @param outdatedRuntime - The runtime object to be upgraded
1966
+ * @returns The upgraded runtime object
1967
+ * @throws Error if the runtime object could not be upgraded to the latest version
1968
+ *
1969
+ * @internal
1970
+ * Limited to Microsoft-internal use
1971
+ */
1972
+ function fastForwardRuntime(outdatedRuntime) {
1973
+ var runtime = outdatedRuntime;
1974
+ if (runtime.apiVersion < latestRuntimeApiVersion) {
1975
+ upgradeChain.forEach(function (upgrade) {
1976
+ if (runtime.apiVersion === upgrade.versionToUpgradeFrom) {
1977
+ runtime = upgrade.upgradeToNextVersion(runtime);
1978
+ }
1979
+ });
1980
+ }
1981
+ if (isLatestRuntimeVersion(runtime)) {
1982
+ return runtime;
1983
+ }
1984
+ else {
1985
+ throw new Error('Received a runtime that could not be upgraded to the latest version');
1986
+ }
1987
+ }
1988
+ /**
1989
+ * @hidden
1990
+ * List of transformations required to upgrade a runtime object from a previous version to the next higher version.
1991
+ * This list must be ordered from lowest version to highest version
1992
+ *
1993
+ * @internal
1994
+ * Limited to Microsoft-internal use
1995
+ */
1996
+ var upgradeChain = [
1997
+ // This upgrade has been included for testing, it may be removed when there is a real upgrade implemented
1998
+ {
1999
+ versionToUpgradeFrom: 0,
2000
+ upgradeToNextVersion: function (previousVersionRuntime) {
2001
+ return {
2002
+ apiVersion: 1,
2003
+ isLegacyTeams: previousVersionRuntime.isLegacyTeams,
2004
+ supports: __assign(__assign({}, previousVersionRuntime.supports), { calendar: previousVersionRuntime.supports.calendarV0 }),
2005
+ };
2006
+ },
2007
+ },
2008
+ ];
2009
+ var versionConstants = {
2010
+ '1.9.0': [
2011
+ {
2012
+ capability: { location: {} },
2013
+ hostClientTypes: v1HostClientTypes,
2014
+ },
2015
+ ],
2016
+ '2.0.0': [
2017
+ {
2018
+ capability: { people: {} },
2019
+ hostClientTypes: v1HostClientTypes,
2020
+ },
2021
+ ],
2022
+ '2.0.1': [
2023
+ {
2024
+ capability: { teams: { fullTrust: { joinedTeams: {} } } },
2025
+ hostClientTypes: [
2026
+ HostClientType.android,
2027
+ HostClientType.desktop,
2028
+ HostClientType.ios,
2029
+ HostClientType.teamsRoomsAndroid,
2030
+ HostClientType.teamsPhones,
2031
+ HostClientType.teamsDisplays,
2032
+ HostClientType.web,
2033
+ ],
2034
+ },
2035
+ {
2036
+ capability: { webStorage: {} },
2037
+ hostClientTypes: [HostClientType.desktop],
2038
+ },
2039
+ ],
2040
+ '2.0.5': [
2041
+ {
2042
+ capability: { webStorage: {} },
2043
+ hostClientTypes: [HostClientType.android, HostClientType.desktop, HostClientType.ios],
2044
+ },
2045
+ ],
2046
+ };
2047
+ var generateBackCompatRuntimeConfigLogger = runtimeLogger.extend('generateBackCompatRuntimeConfig');
2048
+ /**
2049
+ * @internal
2050
+ * Limited to Microsoft-internal use
2051
+ *
2052
+ * Generates and returns a runtime configuration for host clients which are not on the latest host SDK version
2053
+ * and do not provide their own runtime config. Their supported capabilities are based on the highest
2054
+ * client SDK version that they can support.
2055
+ *
2056
+ * @param highestSupportedVersion - The highest client SDK version that the host client can support.
2057
+ * @returns runtime which describes the APIs supported by the legacy host client.
2058
+ */
2059
+ function generateBackCompatRuntimeConfig(highestSupportedVersion) {
2060
+ generateBackCompatRuntimeConfigLogger('generating back compat runtime config for %s', highestSupportedVersion);
2061
+ var newSupports = __assign({}, teamsRuntimeConfig.supports);
2062
+ generateBackCompatRuntimeConfigLogger('Supported capabilities in config before updating based on highestSupportedVersion: %o', newSupports);
2063
+ Object.keys(versionConstants).forEach(function (versionNumber) {
2064
+ if (compareSDKVersions(highestSupportedVersion, versionNumber) >= 0) {
2065
+ versionConstants[versionNumber].forEach(function (capabilityReqs) {
2066
+ if (capabilityReqs.hostClientTypes.includes(GlobalVars.hostClientType)) {
2067
+ newSupports = __assign(__assign({}, newSupports), capabilityReqs.capability);
2068
+ }
2069
+ });
2070
+ }
2071
+ });
2072
+ var backCompatRuntimeConfig = {
2073
+ apiVersion: 1,
2074
+ isLegacyTeams: true,
2075
+ supports: newSupports,
2076
+ };
2077
+ generateBackCompatRuntimeConfigLogger('Runtime config after updating based on highestSupportedVersion: %o', backCompatRuntimeConfig);
2078
+ return backCompatRuntimeConfig;
2079
+ }
2080
+ var applyRuntimeConfigLogger = runtimeLogger.extend('applyRuntimeConfig');
2081
+ function applyRuntimeConfig(runtimeConfig) {
2082
+ // Some hosts that have not adopted runtime versioning send a string for apiVersion, so we should handle those as v1 inputs
2083
+ if (typeof runtimeConfig.apiVersion === 'string') {
2084
+ applyRuntimeConfigLogger('Trying to apply runtime with string apiVersion, processing as v1: %o', runtimeConfig);
2085
+ runtimeConfig = __assign(__assign({}, runtimeConfig), { apiVersion: 1 });
2086
+ }
2087
+ applyRuntimeConfigLogger('Fast-forwarding runtime %o', runtimeConfig);
2088
+ var ffRuntimeConfig = fastForwardRuntime(runtimeConfig);
2089
+ applyRuntimeConfigLogger('Applying runtime %o', ffRuntimeConfig);
2090
+ runtime = utils_deepFreeze(ffRuntimeConfig);
2091
+ }
2092
+ function setUnitializedRuntime() {
2093
+ runtime = deepFreeze(_uninitializedRuntime);
2094
+ }
2095
+ /**
2096
+ * @hidden
2097
+ * Constant used to set minimum runtime configuration
2098
+ * while un-initializing an app in unit test case.
2099
+ *
2100
+ * @internal
2101
+ * Limited to Microsoft-internal use
2102
+ */
2103
+ var _minRuntimeConfigToUninitialize = {
2104
+ apiVersion: 1,
2105
+ supports: {
2106
+ pages: {
2107
+ appButton: {},
2108
+ tabs: {},
2109
+ config: {},
2110
+ backStack: {},
2111
+ fullTrust: {},
2112
+ },
2113
+ teamsCore: {},
2114
+ logs: {},
2115
+ },
2116
+ };
2117
+
2118
+ ;// CONCATENATED MODULE: ./src/public/version.ts
2119
+ var version = "2.7.0-beta.0";
1863
2120
 
1864
2121
  ;// CONCATENATED MODULE: ./src/internal/internalAPIs.ts
1865
2122
 
@@ -1868,6 +2125,7 @@ function createTeamsAppLink(params) {
1868
2125
 
1869
2126
 
1870
2127
 
2128
+
1871
2129
  var internalLogger = getLogger('internal');
1872
2130
  var ensureInitializeCalledLogger = internalLogger.extend('ensureInitializeCalled');
1873
2131
  var ensureInitializedLogger = internalLogger.extend('ensureInitialized');
@@ -1891,17 +2149,18 @@ function ensureInitializeCalled() {
1891
2149
  }
1892
2150
  }
1893
2151
  /**
1894
- * Ensures `initialize` was called and response from Host was received and processed.
2152
+ * Ensures `initialize` was called and response from Host was received and processed and that `runtime` is initialized.
1895
2153
  * If expected FrameContexts are provided, it also validates that the current FrameContext matches one of the expected ones.
1896
2154
  *
1897
2155
  * @internal
1898
2156
  * Limited to Microsoft-internal use
1899
2157
  */
1900
- function ensureInitialized() {
2158
+ function ensureInitialized(runtime) {
1901
2159
  var expectedFrameContexts = [];
1902
- for (var _i = 0; _i < arguments.length; _i++) {
1903
- expectedFrameContexts[_i] = arguments[_i];
2160
+ for (var _i = 1; _i < arguments.length; _i++) {
2161
+ expectedFrameContexts[_i - 1] = arguments[_i];
1904
2162
  }
2163
+ // This global var can potentially be removed in the future if we use the initialization status of the runtime object as our source of truth
1905
2164
  if (!GlobalVars.initializeCompleted) {
1906
2165
  ensureInitializedLogger('%s. initializeCalled: %s', errorLibraryNotInitialized, GlobalVars.initializeCalled.toString());
1907
2166
  throw new Error(errorLibraryNotInitialized);
@@ -1919,6 +2178,7 @@ function ensureInitialized() {
1919
2178
  ("Current context: \"" + GlobalVars.frameContext + "\"."));
1920
2179
  }
1921
2180
  }
2181
+ return isRuntimeInitialized(runtime);
1922
2182
  }
1923
2183
  /**
1924
2184
  * @hidden
@@ -1997,6 +2257,7 @@ function processAdditionalValidOrigins(validMessageOrigins) {
1997
2257
 
1998
2258
 
1999
2259
 
2260
+
2000
2261
  /**
2001
2262
  * Namespace to interact with the authentication-specific part of the SDK.
2002
2263
  *
@@ -2031,7 +2292,7 @@ var authentication;
2031
2292
  if (!authenticateParams) {
2032
2293
  throw new Error('No parameters are provided for authentication');
2033
2294
  }
2034
- ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
2295
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
2035
2296
  return authenticateHelper(authenticateParams)
2036
2297
  .then(function (value) {
2037
2298
  try {
@@ -2278,7 +2539,7 @@ var authentication;
2278
2539
  */
2279
2540
  function notifySuccess(result, callbackUrl) {
2280
2541
  redirectIfWin32Outlook(callbackUrl, 'result', result);
2281
- ensureInitialized(FrameContexts.authentication);
2542
+ ensureInitialized(runtime, FrameContexts.authentication);
2282
2543
  sendMessageToParent('authentication.authenticate.success', [result]);
2283
2544
  // Wait for the message to be sent before closing the window
2284
2545
  waitForMessageQueue(Communication.parentWindow, function () { return setTimeout(function () { return Communication.currentWindow.close(); }, 200); });
@@ -2296,7 +2557,7 @@ var authentication;
2296
2557
  */
2297
2558
  function notifyFailure(reason, callbackUrl) {
2298
2559
  redirectIfWin32Outlook(callbackUrl, 'reason', reason);
2299
- ensureInitialized(FrameContexts.authentication);
2560
+ ensureInitialized(runtime, FrameContexts.authentication);
2300
2561
  sendMessageToParent('authentication.authenticate.failure', [reason]);
2301
2562
  // Wait for the message to be sent before closing the window
2302
2563
  waitForMessageQueue(Communication.parentWindow, function () { return setTimeout(function () { return Communication.currentWindow.close(); }, 200); });
@@ -2390,183 +2651,6 @@ var authentication;
2390
2651
  })(DataResidency = authentication.DataResidency || (authentication.DataResidency = {}));
2391
2652
  })(authentication || (authentication = {}));
2392
2653
 
2393
- ;// CONCATENATED MODULE: ./src/public/runtime.ts
2394
- /* eslint-disable @typescript-eslint/ban-types */
2395
- var __assign = (undefined && undefined.__assign) || function () {
2396
- __assign = Object.assign || function(t) {
2397
- for (var s, i = 1, n = arguments.length; i < n; i++) {
2398
- s = arguments[i];
2399
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
2400
- t[p] = s[p];
2401
- }
2402
- return t;
2403
- };
2404
- return __assign.apply(this, arguments);
2405
- };
2406
-
2407
-
2408
-
2409
-
2410
- var runtimeLogger = getLogger('runtime');
2411
- /**
2412
- * @hidden
2413
- * Constant used to set the runtime configuration
2414
- * to its uninitialized state.
2415
- *
2416
- * @internal
2417
- * Limited to Microsoft-internal use
2418
- */
2419
- var _uninitializedRuntime = {
2420
- apiVersion: -1,
2421
- supports: {},
2422
- };
2423
- var runtime = _uninitializedRuntime;
2424
- var teamsRuntimeConfig = {
2425
- apiVersion: 1,
2426
- isLegacyTeams: true,
2427
- supports: {
2428
- appInstallDialog: {},
2429
- appEntity: {},
2430
- call: {},
2431
- chat: {},
2432
- conversations: {},
2433
- dialog: {
2434
- bot: {},
2435
- update: {},
2436
- },
2437
- logs: {},
2438
- meetingRoom: {},
2439
- menus: {},
2440
- monetization: {},
2441
- notifications: {},
2442
- pages: {
2443
- appButton: {},
2444
- tabs: {},
2445
- config: {},
2446
- backStack: {},
2447
- fullTrust: {},
2448
- },
2449
- remoteCamera: {},
2450
- sharing: {},
2451
- stageView: {},
2452
- teams: {
2453
- fullTrust: {},
2454
- },
2455
- teamsCore: {},
2456
- video: {},
2457
- },
2458
- };
2459
- var v1HostClientTypes = [
2460
- HostClientType.desktop,
2461
- HostClientType.web,
2462
- HostClientType.android,
2463
- HostClientType.ios,
2464
- HostClientType.rigel,
2465
- HostClientType.surfaceHub,
2466
- HostClientType.teamsRoomsWindows,
2467
- HostClientType.teamsRoomsAndroid,
2468
- HostClientType.teamsPhones,
2469
- HostClientType.teamsDisplays,
2470
- ];
2471
- var versionConstants = {
2472
- '1.9.0': [
2473
- {
2474
- capability: { location: {} },
2475
- hostClientTypes: v1HostClientTypes,
2476
- },
2477
- ],
2478
- '2.0.0': [
2479
- {
2480
- capability: { people: {} },
2481
- hostClientTypes: v1HostClientTypes,
2482
- },
2483
- ],
2484
- '2.0.1': [
2485
- {
2486
- capability: { teams: { fullTrust: { joinedTeams: {} } } },
2487
- hostClientTypes: [
2488
- HostClientType.android,
2489
- HostClientType.desktop,
2490
- HostClientType.ios,
2491
- HostClientType.teamsRoomsAndroid,
2492
- HostClientType.teamsPhones,
2493
- HostClientType.teamsDisplays,
2494
- HostClientType.web,
2495
- ],
2496
- },
2497
- {
2498
- capability: { webStorage: {} },
2499
- hostClientTypes: [HostClientType.desktop],
2500
- },
2501
- ],
2502
- '2.0.5': [
2503
- {
2504
- capability: { webStorage: {} },
2505
- hostClientTypes: [HostClientType.android, HostClientType.desktop, HostClientType.ios],
2506
- },
2507
- ],
2508
- };
2509
- var generateBackCompatRuntimeConfigLogger = runtimeLogger.extend('generateBackCompatRuntimeConfig');
2510
- /**
2511
- * @internal
2512
- * Limited to Microsoft-internal use
2513
- *
2514
- * Generates and returns a runtime configuration for host clients which are not on the latest host SDK version
2515
- * and do not provide their own runtime config. Their supported capabilities are based on the highest
2516
- * client SDK version that they can support.
2517
- *
2518
- * @param highestSupportedVersion - The highest client SDK version that the host client can support.
2519
- * @returns runtime which describes the APIs supported by the legacy host client.
2520
- */
2521
- function generateBackCompatRuntimeConfig(highestSupportedVersion) {
2522
- generateBackCompatRuntimeConfigLogger('generating back compat runtime config for %s', highestSupportedVersion);
2523
- var newSupports = __assign({}, teamsRuntimeConfig.supports);
2524
- generateBackCompatRuntimeConfigLogger('Supported capabilities in config before updating based on highestSupportedVersion: %o', newSupports);
2525
- Object.keys(versionConstants).forEach(function (versionNumber) {
2526
- if (compareSDKVersions(highestSupportedVersion, versionNumber) >= 0) {
2527
- versionConstants[versionNumber].forEach(function (capabilityReqs) {
2528
- if (capabilityReqs.hostClientTypes.includes(GlobalVars.hostClientType)) {
2529
- newSupports = __assign(__assign({}, newSupports), capabilityReqs.capability);
2530
- }
2531
- });
2532
- }
2533
- });
2534
- var backCompatRuntimeConfig = {
2535
- apiVersion: 1,
2536
- isLegacyTeams: true,
2537
- supports: newSupports,
2538
- };
2539
- generateBackCompatRuntimeConfigLogger('Runtime config after updating based on highestSupportedVersion: %o', backCompatRuntimeConfig);
2540
- return backCompatRuntimeConfig;
2541
- }
2542
- var applyRuntimeConfigLogger = runtimeLogger.extend('applyRuntimeConfig');
2543
- function applyRuntimeConfig(runtimeConfig) {
2544
- applyRuntimeConfigLogger('Applying runtime %o', runtimeConfig);
2545
- runtime = deepFreeze(runtimeConfig);
2546
- }
2547
- /**
2548
- * @hidden
2549
- * Constant used to set minimum runtime configuration
2550
- * while un-initializing an app in unit test case.
2551
- *
2552
- * @internal
2553
- * Limited to Microsoft-internal use
2554
- */
2555
- var _minRuntimeConfigToUninitialize = {
2556
- apiVersion: 1,
2557
- supports: {
2558
- pages: {
2559
- appButton: {},
2560
- tabs: {},
2561
- config: {},
2562
- backStack: {},
2563
- fullTrust: {},
2564
- },
2565
- teamsCore: {},
2566
- logs: {},
2567
- },
2568
- };
2569
-
2570
2654
  ;// CONCATENATED MODULE: ./src/public/dialog.ts
2571
2655
  /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
2572
2656
  /* eslint-disable @typescript-eslint/ban-types */
@@ -2628,7 +2712,7 @@ var dialog;
2628
2712
  * @beta
2629
2713
  */
2630
2714
  function open(urlDialogInfo, submitHandler, messageFromChildHandler) {
2631
- ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
2715
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
2632
2716
  if (!isSupported()) {
2633
2717
  throw errorNotSupportedOnPlatform;
2634
2718
  }
@@ -2656,7 +2740,7 @@ var dialog;
2656
2740
  // FrameContext content should not be here because dialog.submit can be called only from inside of a dialog (FrameContext task)
2657
2741
  // but it's here because Teams mobile incorrectly returns FrameContext.content when calling app.getFrameContext().
2658
2742
  // FrameContexts.content will be removed once the bug is fixed.
2659
- ensureInitialized(FrameContexts.content, FrameContexts.task);
2743
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
2660
2744
  if (!isSupported()) {
2661
2745
  throw errorNotSupportedOnPlatform;
2662
2746
  }
@@ -2677,7 +2761,7 @@ var dialog;
2677
2761
  function sendMessageToParentFromDialog(
2678
2762
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2679
2763
  message) {
2680
- ensureInitialized(FrameContexts.task);
2764
+ ensureInitialized(runtime, FrameContexts.task);
2681
2765
  if (!isSupported()) {
2682
2766
  throw errorNotSupportedOnPlatform;
2683
2767
  }
@@ -2694,7 +2778,7 @@ var dialog;
2694
2778
  function sendMessageToDialog(
2695
2779
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2696
2780
  message) {
2697
- ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
2781
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
2698
2782
  if (!isSupported()) {
2699
2783
  throw errorNotSupportedOnPlatform;
2700
2784
  }
@@ -2712,7 +2796,7 @@ var dialog;
2712
2796
  * @beta
2713
2797
  */
2714
2798
  function registerOnMessageFromParent(listener) {
2715
- ensureInitialized(FrameContexts.task);
2799
+ ensureInitialized(runtime, FrameContexts.task);
2716
2800
  if (!isSupported()) {
2717
2801
  throw errorNotSupportedOnPlatform;
2718
2802
  }
@@ -2737,8 +2821,7 @@ var dialog;
2737
2821
  * @beta
2738
2822
  */
2739
2823
  function isSupported() {
2740
- ensureInitialized();
2741
- return runtime.supports.dialog ? true : false;
2824
+ return ensureInitialized(runtime) && runtime.supports.dialog ? true : false;
2742
2825
  }
2743
2826
  dialog.isSupported = isSupported;
2744
2827
  /**
@@ -2756,7 +2839,7 @@ var dialog;
2756
2839
  * @beta
2757
2840
  */
2758
2841
  function resize(dimensions) {
2759
- ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);
2842
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);
2760
2843
  if (!isSupported()) {
2761
2844
  throw errorNotSupportedOnPlatform;
2762
2845
  }
@@ -2772,8 +2855,11 @@ var dialog;
2772
2855
  * @beta
2773
2856
  */
2774
2857
  function isSupported() {
2775
- ensureInitialized();
2776
- return runtime.supports.dialog ? (runtime.supports.dialog.update ? true : false) : false;
2858
+ return ensureInitialized(runtime) && runtime.supports.dialog
2859
+ ? runtime.supports.dialog.update
2860
+ ? true
2861
+ : false
2862
+ : false;
2777
2863
  }
2778
2864
  update.isSupported = isSupported;
2779
2865
  })(update = dialog.update || (dialog.update = {}));
@@ -2796,7 +2882,7 @@ var dialog;
2796
2882
  * @beta
2797
2883
  */
2798
2884
  function open(botUrlDialogInfo, submitHandler, messageFromChildHandler) {
2799
- ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
2885
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
2800
2886
  if (!isSupported()) {
2801
2887
  throw errorNotSupportedOnPlatform;
2802
2888
  }
@@ -2819,8 +2905,11 @@ var dialog;
2819
2905
  * @beta
2820
2906
  */
2821
2907
  function isSupported() {
2822
- ensureInitialized();
2823
- return runtime.supports.dialog ? (runtime.supports.dialog.bot ? true : false) : false;
2908
+ return ensureInitialized(runtime) && runtime.supports.dialog
2909
+ ? runtime.supports.dialog.bot
2910
+ ? true
2911
+ : false
2912
+ : false;
2824
2913
  }
2825
2914
  bot.isSupported = isSupported;
2826
2915
  })(bot = dialog.bot || (dialog.bot = {}));
@@ -2944,7 +3033,7 @@ var menus;
2944
3033
  * @param handler - The handler to invoke when the user selects view configuration.
2945
3034
  */
2946
3035
  function setUpViews(viewConfig, handler) {
2947
- ensureInitialized();
3036
+ ensureInitialized(runtime);
2948
3037
  if (!isSupported()) {
2949
3038
  throw errorNotSupportedOnPlatform;
2950
3039
  }
@@ -2954,7 +3043,7 @@ var menus;
2954
3043
  menus.setUpViews = setUpViews;
2955
3044
  function handleViewConfigItemPress(id) {
2956
3045
  if (!viewConfigItemPressHandler || !viewConfigItemPressHandler(id)) {
2957
- ensureInitialized();
3046
+ ensureInitialized(runtime);
2958
3047
  sendMessageToParent('viewConfigItemPress', [id]);
2959
3048
  }
2960
3049
  }
@@ -2966,7 +3055,7 @@ var menus;
2966
3055
  * @param handler The handler to invoke when the user selects menu item.
2967
3056
  */
2968
3057
  function setNavBarMenu(items, handler) {
2969
- ensureInitialized();
3058
+ ensureInitialized(runtime);
2970
3059
  if (!isSupported()) {
2971
3060
  throw errorNotSupportedOnPlatform;
2972
3061
  }
@@ -2976,7 +3065,7 @@ var menus;
2976
3065
  menus.setNavBarMenu = setNavBarMenu;
2977
3066
  function handleNavBarMenuItemPress(id) {
2978
3067
  if (!navBarMenuItemPressHandler || !navBarMenuItemPressHandler(id)) {
2979
- ensureInitialized();
3068
+ ensureInitialized(runtime);
2980
3069
  sendMessageToParent('handleNavBarMenuItemPress', [id]);
2981
3070
  }
2982
3071
  }
@@ -2988,7 +3077,7 @@ var menus;
2988
3077
  * @param handler - The handler to invoke when the user selects menu item.
2989
3078
  */
2990
3079
  function showActionMenu(params, handler) {
2991
- ensureInitialized();
3080
+ ensureInitialized(runtime);
2992
3081
  if (!isSupported()) {
2993
3082
  throw errorNotSupportedOnPlatform;
2994
3083
  }
@@ -2998,7 +3087,7 @@ var menus;
2998
3087
  menus.showActionMenu = showActionMenu;
2999
3088
  function handleActionMenuItemPress(id) {
3000
3089
  if (!actionMenuItemPressHandler || !actionMenuItemPressHandler(id)) {
3001
- ensureInitialized();
3090
+ ensureInitialized(runtime);
3002
3091
  sendMessageToParent('handleActionMenuItemPress', [id]);
3003
3092
  }
3004
3093
  }
@@ -3009,8 +3098,7 @@ var menus;
3009
3098
  * @throws Error if {@linkcode app.initialize} has not successfully completed
3010
3099
  */
3011
3100
  function isSupported() {
3012
- ensureInitialized();
3013
- return runtime.supports.menus ? true : false;
3101
+ return ensureInitialized(runtime) && runtime.supports.menus ? true : false;
3014
3102
  }
3015
3103
  menus.isSupported = isSupported;
3016
3104
  })(menus || (menus = {}));
@@ -3031,7 +3119,7 @@ var teamsCore;
3031
3119
  */
3032
3120
  function enablePrintCapability() {
3033
3121
  if (!GlobalVars.printCapabilityEnabled) {
3034
- ensureInitialized();
3122
+ ensureInitialized(runtime);
3035
3123
  if (!isSupported()) {
3036
3124
  throw errorNotSupportedOnPlatform;
3037
3125
  }
@@ -3090,7 +3178,7 @@ var teamsCore;
3090
3178
  */
3091
3179
  function registerOnLoadHandlerHelper(handler, versionSpecificHelper) {
3092
3180
  // allow for registration cleanup even when not finished initializing
3093
- handler && ensureInitialized();
3181
+ handler && ensureInitialized(runtime);
3094
3182
  if (handler && versionSpecificHelper) {
3095
3183
  versionSpecificHelper();
3096
3184
  }
@@ -3127,7 +3215,7 @@ var teamsCore;
3127
3215
  */
3128
3216
  function registerBeforeUnloadHandlerHelper(handler, versionSpecificHelper) {
3129
3217
  // allow for registration cleanup even when not finished initializing
3130
- handler && ensureInitialized();
3218
+ handler && ensureInitialized(runtime);
3131
3219
  if (handler && versionSpecificHelper) {
3132
3220
  versionSpecificHelper();
3133
3221
  }
@@ -3143,8 +3231,7 @@ var teamsCore;
3143
3231
  *
3144
3232
  */
3145
3233
  function isSupported() {
3146
- ensureInitialized();
3147
- return runtime.supports.teamsCore ? true : false;
3234
+ return ensureInitialized(runtime) && runtime.supports.teamsCore ? true : false;
3148
3235
  }
3149
3236
  teamsCore.isSupported = isSupported;
3150
3237
  })(teamsCore || (teamsCore = {}));
@@ -3254,7 +3341,7 @@ var app_app;
3254
3341
  * Initialize must have completed successfully (as determined by the resolved Promise) before any other library calls are made
3255
3342
  *
3256
3343
  * @param validMessageOrigins - Optionally specify a list of cross frame message origins. They must have
3257
- * https: protocol otherwise they will be ignored. Example: https:www.example.com
3344
+ * https: protocol otherwise they will be ignored. Example: https://www.example.com
3258
3345
  * @returns Promise that will be fulfilled when initialization has completed, or rejected if the initialization fails or times out
3259
3346
  */
3260
3347
  function initialize(validMessageOrigins) {
@@ -3296,7 +3383,7 @@ var app_app;
3296
3383
  initializeHelperLogger('Parsing %s', runtimeConfig);
3297
3384
  var givenRuntimeConfig = JSON.parse(runtimeConfig);
3298
3385
  initializeHelperLogger('Checking if %o is a valid runtime object', givenRuntimeConfig !== null && givenRuntimeConfig !== void 0 ? givenRuntimeConfig : 'null');
3299
- // Check that givenRuntimeConfig is a valid instance of IRuntimeConfig
3386
+ // Check that givenRuntimeConfig is a valid instance of IBaseRuntime
3300
3387
  if (!givenRuntimeConfig || !givenRuntimeConfig.apiVersion) {
3301
3388
  throw new Error('Received runtime config is invalid');
3302
3389
  }
@@ -3474,7 +3561,7 @@ var app_app;
3474
3561
  */
3475
3562
  function openLink(deepLink) {
3476
3563
  return new Promise(function (resolve) {
3477
- ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
3564
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
3478
3565
  resolve(sendAndHandleStatusAndReason('executeDeepLink', deepLink));
3479
3566
  });
3480
3567
  }
@@ -3605,7 +3692,7 @@ var pages;
3605
3692
  * @param navigateForward - Determines the direction to focus in host.
3606
3693
  */
3607
3694
  function returnFocus(navigateForward) {
3608
- ensureInitialized();
3695
+ ensureInitialized(runtime);
3609
3696
  if (!isSupported()) {
3610
3697
  throw errorNotSupportedOnPlatform;
3611
3698
  }
@@ -3639,7 +3726,7 @@ var pages;
3639
3726
  * user clicks 'Go To Website'
3640
3727
  */
3641
3728
  function setCurrentFrame(frameInfo) {
3642
- ensureInitialized(FrameContexts.content);
3729
+ ensureInitialized(runtime, FrameContexts.content);
3643
3730
  if (!isSupported()) {
3644
3731
  throw errorNotSupportedOnPlatform;
3645
3732
  }
@@ -3666,7 +3753,7 @@ var pages;
3666
3753
  */
3667
3754
  function getConfig() {
3668
3755
  return new Promise(function (resolve) {
3669
- ensureInitialized(FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
3756
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
3670
3757
  if (!isSupported()) {
3671
3758
  throw errorNotSupportedOnPlatform;
3672
3759
  }
@@ -3685,7 +3772,7 @@ var pages;
3685
3772
  */
3686
3773
  function navigateCrossDomain(url) {
3687
3774
  return new Promise(function (resolve) {
3688
- ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
3775
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
3689
3776
  if (!isSupported()) {
3690
3777
  throw errorNotSupportedOnPlatform;
3691
3778
  }
@@ -3705,7 +3792,7 @@ var pages;
3705
3792
  */
3706
3793
  function navigateToApp(params) {
3707
3794
  return new Promise(function (resolve) {
3708
- ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
3795
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
3709
3796
  if (!isSupported()) {
3710
3797
  throw errorNotSupportedOnPlatform;
3711
3798
  }
@@ -3725,7 +3812,7 @@ var pages;
3725
3812
  * @param deepLinkParameters - ID and label for the link and fallback URL.
3726
3813
  */
3727
3814
  function shareDeepLink(deepLinkParameters) {
3728
- ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3815
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
3729
3816
  if (!isSupported()) {
3730
3817
  throw errorNotSupportedOnPlatform;
3731
3818
  }
@@ -3758,8 +3845,7 @@ var pages;
3758
3845
  * @throws Error if {@linkcode app.initialize} has not successfully completed
3759
3846
  */
3760
3847
  function isSupported() {
3761
- ensureInitialized();
3762
- return runtime.supports.pages ? true : false;
3848
+ return ensureInitialized(runtime) && runtime.supports.pages ? true : false;
3763
3849
  }
3764
3850
  pages.isSupported = isSupported;
3765
3851
  /**
@@ -3775,7 +3861,7 @@ var pages;
3775
3861
  */
3776
3862
  function navigateToTab(tabInstance) {
3777
3863
  return new Promise(function (resolve) {
3778
- ensureInitialized();
3864
+ ensureInitialized(runtime);
3779
3865
  if (!isSupported()) {
3780
3866
  throw errorNotSupportedOnPlatform;
3781
3867
  }
@@ -3792,7 +3878,7 @@ var pages;
3792
3878
  */
3793
3879
  function getTabInstances(tabInstanceParameters) {
3794
3880
  return new Promise(function (resolve) {
3795
- ensureInitialized();
3881
+ ensureInitialized(runtime);
3796
3882
  if (!isSupported()) {
3797
3883
  throw errorNotSupportedOnPlatform;
3798
3884
  }
@@ -3808,7 +3894,7 @@ var pages;
3808
3894
  */
3809
3895
  function getMruTabInstances(tabInstanceParameters) {
3810
3896
  return new Promise(function (resolve) {
3811
- ensureInitialized();
3897
+ ensureInitialized(runtime);
3812
3898
  if (!isSupported()) {
3813
3899
  throw errorNotSupportedOnPlatform;
3814
3900
  }
@@ -3824,8 +3910,11 @@ var pages;
3824
3910
  * @throws Error if {@linkcode app.initialize} has not successfully completed
3825
3911
  */
3826
3912
  function isSupported() {
3827
- ensureInitialized();
3828
- return runtime.supports.pages ? (runtime.supports.pages.tabs ? true : false) : false;
3913
+ return ensureInitialized(runtime) && runtime.supports.pages
3914
+ ? runtime.supports.pages.tabs
3915
+ ? true
3916
+ : false
3917
+ : false;
3829
3918
  }
3830
3919
  tabs.isSupported = isSupported;
3831
3920
  })(tabs = pages.tabs || (pages.tabs = {}));
@@ -3856,7 +3945,7 @@ var pages;
3856
3945
  * @param validityState - Indicates whether the save or remove button is enabled for the user.
3857
3946
  */
3858
3947
  function setValidityState(validityState) {
3859
- ensureInitialized(FrameContexts.settings, FrameContexts.remove);
3948
+ ensureInitialized(runtime, FrameContexts.settings, FrameContexts.remove);
3860
3949
  if (!isSupported()) {
3861
3950
  throw errorNotSupportedOnPlatform;
3862
3951
  }
@@ -3871,7 +3960,7 @@ var pages;
3871
3960
  */
3872
3961
  function setConfig(instanceConfig) {
3873
3962
  return new Promise(function (resolve) {
3874
- ensureInitialized(FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
3963
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
3875
3964
  if (!isSupported()) {
3876
3965
  throw errorNotSupportedOnPlatform;
3877
3966
  }
@@ -3906,7 +3995,7 @@ var pages;
3906
3995
  */
3907
3996
  function registerOnSaveHandlerHelper(handler, versionSpecificHelper) {
3908
3997
  // allow for registration cleanup even when not finished initializing
3909
- handler && ensureInitialized(FrameContexts.settings);
3998
+ handler && ensureInitialized(runtime, FrameContexts.settings);
3910
3999
  if (versionSpecificHelper) {
3911
4000
  versionSpecificHelper();
3912
4001
  }
@@ -3941,7 +4030,7 @@ var pages;
3941
4030
  */
3942
4031
  function registerOnRemoveHandlerHelper(handler, versionSpecificHelper) {
3943
4032
  // allow for registration cleanup even when not finished initializing
3944
- handler && ensureInitialized(FrameContexts.remove, FrameContexts.settings);
4033
+ handler && ensureInitialized(runtime, FrameContexts.remove, FrameContexts.settings);
3945
4034
  if (versionSpecificHelper) {
3946
4035
  versionSpecificHelper();
3947
4036
  }
@@ -4045,8 +4134,11 @@ var pages;
4045
4134
  * @throws Error if {@linkcode app.initialize} has not successfully completed
4046
4135
  */
4047
4136
  function isSupported() {
4048
- ensureInitialized();
4049
- return runtime.supports.pages ? (runtime.supports.pages.config ? true : false) : false;
4137
+ return ensureInitialized(runtime) && runtime.supports.pages
4138
+ ? runtime.supports.pages.config
4139
+ ? true
4140
+ : false
4141
+ : false;
4050
4142
  }
4051
4143
  config.isSupported = isSupported;
4052
4144
  })(config = pages.config || (pages.config = {}));
@@ -4066,7 +4158,7 @@ var pages;
4066
4158
  */
4067
4159
  function navigateBack() {
4068
4160
  return new Promise(function (resolve) {
4069
- ensureInitialized();
4161
+ ensureInitialized(runtime);
4070
4162
  if (!isSupported()) {
4071
4163
  throw errorNotSupportedOnPlatform;
4072
4164
  }
@@ -4102,7 +4194,7 @@ var pages;
4102
4194
  */
4103
4195
  function registerBackButtonHandlerHelper(handler, versionSpecificHelper) {
4104
4196
  // allow for registration cleanup even when not finished initializing
4105
- handler && ensureInitialized();
4197
+ handler && ensureInitialized(runtime);
4106
4198
  if (versionSpecificHelper) {
4107
4199
  versionSpecificHelper();
4108
4200
  }
@@ -4128,8 +4220,11 @@ var pages;
4128
4220
  * @throws Error if {@linkcode app.initialize} has not successfully completed
4129
4221
  */
4130
4222
  function isSupported() {
4131
- ensureInitialized();
4132
- return runtime.supports.pages ? (runtime.supports.pages.backStack ? true : false) : false;
4223
+ return ensureInitialized(runtime) && runtime.supports.pages
4224
+ ? runtime.supports.pages.backStack
4225
+ ? true
4226
+ : false
4227
+ : false;
4133
4228
  }
4134
4229
  backStack.isSupported = isSupported;
4135
4230
  })(backStack = pages.backStack || (pages.backStack = {}));
@@ -4148,7 +4243,7 @@ var pages;
4148
4243
  * Place the tab into full-screen mode.
4149
4244
  */
4150
4245
  function enterFullscreen() {
4151
- ensureInitialized(FrameContexts.content);
4246
+ ensureInitialized(runtime, FrameContexts.content);
4152
4247
  if (!isSupported()) {
4153
4248
  throw errorNotSupportedOnPlatform;
4154
4249
  }
@@ -4162,7 +4257,7 @@ var pages;
4162
4257
  * Reverts the tab into normal-screen mode.
4163
4258
  */
4164
4259
  function exitFullscreen() {
4165
- ensureInitialized(FrameContexts.content);
4260
+ ensureInitialized(runtime, FrameContexts.content);
4166
4261
  if (!isSupported()) {
4167
4262
  throw errorNotSupportedOnPlatform;
4168
4263
  }
@@ -4178,8 +4273,11 @@ var pages;
4178
4273
  * @throws Error if {@linkcode app.initialize} has not successfully completed
4179
4274
  */
4180
4275
  function isSupported() {
4181
- ensureInitialized();
4182
- return runtime.supports.pages ? (runtime.supports.pages.fullTrust ? true : false) : false;
4276
+ return ensureInitialized(runtime) && runtime.supports.pages
4277
+ ? runtime.supports.pages.fullTrust
4278
+ ? true
4279
+ : false
4280
+ : false;
4183
4281
  }
4184
4282
  fullTrust.isSupported = isSupported;
4185
4283
  })(fullTrust = pages.fullTrust || (pages.fullTrust = {}));
@@ -4234,8 +4332,11 @@ var pages;
4234
4332
  * @throws Error if {@linkcode app.initialize} has not successfully completed
4235
4333
  */
4236
4334
  function isSupported() {
4237
- ensureInitialized();
4238
- return runtime.supports.pages ? (runtime.supports.pages.appButton ? true : false) : false;
4335
+ return ensureInitialized(runtime) && runtime.supports.pages
4336
+ ? runtime.supports.pages.appButton
4337
+ ? true
4338
+ : false
4339
+ : false;
4239
4340
  }
4240
4341
  appButton.isSupported = isSupported;
4241
4342
  })(appButton = pages.appButton || (pages.appButton = {}));
@@ -4256,7 +4357,7 @@ var pages;
4256
4357
  */
4257
4358
  function navigateTo(params) {
4258
4359
  return new Promise(function (resolve) {
4259
- ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4360
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4260
4361
  if (!isSupported()) {
4261
4362
  throw errorNotSupportedOnPlatform;
4262
4363
  }
@@ -4271,7 +4372,7 @@ var pages;
4271
4372
  */
4272
4373
  function navigateToDefaultPage() {
4273
4374
  return new Promise(function (resolve) {
4274
- ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4375
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4275
4376
  if (!isSupported()) {
4276
4377
  throw errorNotSupportedOnPlatform;
4277
4378
  }
@@ -4283,12 +4384,16 @@ var pages;
4283
4384
  * Checks if pages.currentApp capability is supported by the host
4284
4385
  * @returns boolean to represent whether the pages.currentApp capability is supported
4285
4386
  *
4286
- * @throws Error if {@linkcode app.initialize} has not successfully complete
4387
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
4287
4388
  *
4288
4389
  * @beta
4289
4390
  */
4290
4391
  function isSupported() {
4291
- return runtime.supports.pages ? (runtime.supports.pages.currentApp ? true : false) : false;
4392
+ return ensureInitialized(runtime) && runtime.supports.pages
4393
+ ? runtime.supports.pages.currentApp
4394
+ ? true
4395
+ : false
4396
+ : false;
4292
4397
  }
4293
4398
  currentApp.isSupported = isSupported;
4294
4399
  })(currentApp = pages.currentApp || (pages.currentApp = {}));
@@ -4309,6 +4414,7 @@ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from
4309
4414
 
4310
4415
 
4311
4416
 
4417
+
4312
4418
  var handlersLogger = getLogger('handlers');
4313
4419
  /**
4314
4420
  * @internal
@@ -4395,7 +4501,7 @@ function doesHandlerExist(name) {
4395
4501
  */
4396
4502
  function registerHandlerHelper(name, handler, contexts, registrationHelper) {
4397
4503
  // allow for registration cleanup even when not finished initializing
4398
- handler && ensureInitialized.apply(void 0, contexts);
4504
+ handler && ensureInitialized.apply(void 0, __spreadArray([runtime], contexts, false));
4399
4505
  if (registrationHelper) {
4400
4506
  registrationHelper();
4401
4507
  }
@@ -4484,6 +4590,7 @@ var communication_spreadArray = (undefined && undefined.__spreadArray) || functi
4484
4590
 
4485
4591
 
4486
4592
 
4593
+
4487
4594
  var communicationLogger = getLogger('communication');
4488
4595
  /**
4489
4596
  * @internal
@@ -4543,7 +4650,10 @@ function initializeCommunication(validMessageOrigins) {
4543
4650
  // Send the initialized message to any origin, because at this point we most likely don't know the origin
4544
4651
  // of the parent window, and this message contains no data that could pose a security risk.
4545
4652
  Communication.parentOrigin = '*';
4546
- return sendMessageToParentAsync('initialize', [version]).then(function (_a) {
4653
+ return sendMessageToParentAsync('initialize', [
4654
+ version,
4655
+ latestRuntimeApiVersion,
4656
+ ]).then(function (_a) {
4547
4657
  var context = _a[0], clientType = _a[1], runtimeConfig = _a[2], clientSupportedSDKVersion = _a[3];
4548
4658
  return { context: context, clientType: clientType, runtimeConfig: runtimeConfig, clientSupportedSDKVersion: clientSupportedSDKVersion };
4549
4659
  });
@@ -5012,7 +5122,7 @@ var logs;
5012
5122
  */
5013
5123
  function registerGetLogHandler(handler) {
5014
5124
  // allow for registration cleanup even when not finished initializing
5015
- handler && ensureInitialized();
5125
+ handler && ensureInitialized(runtime);
5016
5126
  if (handler && !isSupported()) {
5017
5127
  throw errorNotSupportedOnPlatform;
5018
5128
  }
@@ -5039,8 +5149,7 @@ var logs;
5039
5149
  * Limited to Microsoft-internal use
5040
5150
  */
5041
5151
  function isSupported() {
5042
- ensureInitialized();
5043
- return runtime.supports.logs ? true : false;
5152
+ return ensureInitialized(runtime) && runtime.supports.logs ? true : false;
5044
5153
  }
5045
5154
  logs.isSupported = isSupported;
5046
5155
  })(logs || (logs = {}));
@@ -5101,6 +5210,7 @@ var UserSettingTypes;
5101
5210
 
5102
5211
 
5103
5212
 
5213
+
5104
5214
  /**
5105
5215
  * @hidden
5106
5216
  * Upload a custom App manifest directly to both team and personal scopes.
@@ -5110,7 +5220,7 @@ var UserSettingTypes;
5110
5220
  * Limited to Microsoft-internal use
5111
5221
  */
5112
5222
  function uploadCustomApp(manifestBlob, onComplete) {
5113
- ensureInitialized();
5223
+ ensureInitialized(runtime);
5114
5224
  sendMessageToParent('uploadCustomApp', [manifestBlob], onComplete ? onComplete : getGenericOnCompleteHandler());
5115
5225
  }
5116
5226
  /**
@@ -5126,7 +5236,7 @@ function uploadCustomApp(manifestBlob, onComplete) {
5126
5236
  * Limited to Microsoft-internal use
5127
5237
  */
5128
5238
  function sendCustomMessage(actionName, args, callback) {
5129
- ensureInitialized();
5239
+ ensureInitialized(runtime);
5130
5240
  sendMessageToParent(actionName, args, callback);
5131
5241
  }
5132
5242
  /**
@@ -5142,7 +5252,7 @@ function sendCustomMessage(actionName, args, callback) {
5142
5252
  * Limited to Microsoft-internal use
5143
5253
  */
5144
5254
  function sendCustomEvent(actionName, args) {
5145
- ensureInitialized();
5255
+ ensureInitialized(runtime);
5146
5256
  //validate childWindow
5147
5257
  if (!Communication.childWindow) {
5148
5258
  throw new Error('The child window has not yet been initialized or is not present');
@@ -5161,7 +5271,7 @@ function sendCustomEvent(actionName, args) {
5161
5271
  */
5162
5272
  function registerCustomHandler(actionName, customHandler) {
5163
5273
  var _this = this;
5164
- ensureInitialized();
5274
+ ensureInitialized(runtime);
5165
5275
  registerHandler(actionName, function () {
5166
5276
  var args = [];
5167
5277
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -5181,7 +5291,7 @@ function registerCustomHandler(actionName, customHandler) {
5181
5291
  * Limited to Microsoft-internal use
5182
5292
  */
5183
5293
  function registerUserSettingsChangeHandler(settingTypes, handler) {
5184
- ensureInitialized();
5294
+ ensureInitialized(runtime);
5185
5295
  registerHandler('userSettingsChange', handler, true, [settingTypes]);
5186
5296
  }
5187
5297
  /**
@@ -5194,7 +5304,7 @@ function registerUserSettingsChangeHandler(settingTypes, handler) {
5194
5304
  * Limited to Microsoft-internal use
5195
5305
  */
5196
5306
  function openFilePreview(filePreviewParameters) {
5197
- ensureInitialized(FrameContexts.content, FrameContexts.task);
5307
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
5198
5308
  var params = [
5199
5309
  filePreviewParameters.entityId,
5200
5310
  filePreviewParameters.title,
@@ -5242,7 +5352,7 @@ var conversations;
5242
5352
  */
5243
5353
  function openConversation(openConversationRequest) {
5244
5354
  return new Promise(function (resolve) {
5245
- ensureInitialized(FrameContexts.content);
5355
+ ensureInitialized(runtime, FrameContexts.content);
5246
5356
  if (!isSupported()) {
5247
5357
  throw errorNotSupportedOnPlatform;
5248
5358
  }
@@ -5286,7 +5396,7 @@ var conversations;
5286
5396
  * Limited to Microsoft-internal use
5287
5397
  */
5288
5398
  function closeConversation() {
5289
- ensureInitialized(FrameContexts.content);
5399
+ ensureInitialized(runtime, FrameContexts.content);
5290
5400
  if (!isSupported()) {
5291
5401
  throw errorNotSupportedOnPlatform;
5292
5402
  }
@@ -5310,7 +5420,7 @@ var conversations;
5310
5420
  */
5311
5421
  function getChatMembers() {
5312
5422
  return new Promise(function (resolve) {
5313
- ensureInitialized();
5423
+ ensureInitialized(runtime);
5314
5424
  if (!isSupported()) {
5315
5425
  throw errorNotSupportedOnPlatform;
5316
5426
  }
@@ -5328,8 +5438,7 @@ var conversations;
5328
5438
  * Limited to Microsoft-internal use
5329
5439
  */
5330
5440
  function isSupported() {
5331
- ensureInitialized();
5332
- return runtime.supports.conversations ? true : false;
5441
+ return ensureInitialized(runtime) && runtime.supports.conversations ? true : false;
5333
5442
  }
5334
5443
  conversations.isSupported = isSupported;
5335
5444
  })(conversations || (conversations = {}));
@@ -5412,7 +5521,7 @@ var appInstallDialog;
5412
5521
  (function (appInstallDialog) {
5413
5522
  function openAppInstallDialog(openAPPInstallDialogParams) {
5414
5523
  return new Promise(function (resolve) {
5415
- ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
5524
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
5416
5525
  if (!isSupported()) {
5417
5526
  throw new Error('Not supported');
5418
5527
  }
@@ -5433,8 +5542,7 @@ var appInstallDialog;
5433
5542
  * @throws Error if {@linkcode app.initialize} has not successfully completed
5434
5543
  */
5435
5544
  function isSupported() {
5436
- ensureInitialized();
5437
- return runtime.supports.appInstallDialog ? true : false;
5545
+ return ensureInitialized(runtime) && runtime.supports.appInstallDialog ? true : false;
5438
5546
  }
5439
5547
  appInstallDialog.isSupported = isSupported;
5440
5548
  })(appInstallDialog || (appInstallDialog = {}));
@@ -5465,6 +5573,7 @@ var __extends = (undefined && undefined.__extends) || (function () {
5465
5573
 
5466
5574
 
5467
5575
 
5576
+
5468
5577
  var media;
5469
5578
  (function (media) {
5470
5579
  /**
@@ -5498,7 +5607,7 @@ var media;
5498
5607
  if (!callback) {
5499
5608
  throw new Error('[captureImage] Callback cannot be null');
5500
5609
  }
5501
- ensureInitialized(FrameContexts.content, FrameContexts.task);
5610
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
5502
5611
  if (!GlobalVars.isFramelessWindow) {
5503
5612
  var notSupportedError = { errorCode: ErrorCode.NOT_SUPPORTED_ON_PLATFORM };
5504
5613
  /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
@@ -5541,7 +5650,7 @@ var media;
5541
5650
  if (!callback) {
5542
5651
  throw new Error('[get Media] Callback cannot be null');
5543
5652
  }
5544
- ensureInitialized(FrameContexts.content, FrameContexts.task);
5653
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
5545
5654
  if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {
5546
5655
  var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
5547
5656
  /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
@@ -5661,7 +5770,7 @@ var media;
5661
5770
  * Optional; @param callback is used to send app if host client has successfully handled the notification event or not
5662
5771
  */
5663
5772
  MediaController.prototype.notifyEventToHost = function (mediaEvent, callback) {
5664
- ensureInitialized(FrameContexts.content, FrameContexts.task);
5773
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
5665
5774
  try {
5666
5775
  throwExceptionIfMobileApiIsNotSupported(nonFullScreenVideoModeAPISupportVersion);
5667
5776
  }
@@ -5777,7 +5886,7 @@ var media;
5777
5886
  if (!callback) {
5778
5887
  throw new Error('[select Media] Callback cannot be null');
5779
5888
  }
5780
- ensureInitialized(FrameContexts.content, FrameContexts.task);
5889
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
5781
5890
  if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {
5782
5891
  var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
5783
5892
  /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
@@ -5834,7 +5943,7 @@ var media;
5834
5943
  if (!callback) {
5835
5944
  throw new Error('[view images] Callback cannot be null');
5836
5945
  }
5837
- ensureInitialized(FrameContexts.content, FrameContexts.task);
5946
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
5838
5947
  if (!isCurrentSDKVersionAtLeast(mediaAPISupportVersion)) {
5839
5948
  var oldPlatformError = { errorCode: ErrorCode.OLD_PLATFORM };
5840
5949
  callback(oldPlatformError);
@@ -5865,7 +5974,7 @@ var media;
5865
5974
  if (!callback) {
5866
5975
  throw new Error('[media.scanBarCode] Callback cannot be null');
5867
5976
  }
5868
- ensureInitialized(FrameContexts.content, FrameContexts.task);
5977
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
5869
5978
  if (GlobalVars.hostClientType === HostClientType.desktop ||
5870
5979
  GlobalVars.hostClientType === HostClientType.web ||
5871
5980
  GlobalVars.hostClientType === HostClientType.rigel ||
@@ -6138,7 +6247,7 @@ var barCode;
6138
6247
  */
6139
6248
  function scanBarCode(barCodeConfig) {
6140
6249
  return new Promise(function (resolve) {
6141
- ensureInitialized(FrameContexts.content, FrameContexts.task);
6250
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6142
6251
  if (!isSupported()) {
6143
6252
  throw errorNotSupportedOnPlatform;
6144
6253
  }
@@ -6157,7 +6266,7 @@ var barCode;
6157
6266
  * @beta
6158
6267
  */
6159
6268
  function hasPermission() {
6160
- ensureInitialized(FrameContexts.content, FrameContexts.task);
6269
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6161
6270
  if (!isSupported()) {
6162
6271
  throw errorNotSupportedOnPlatform;
6163
6272
  }
@@ -6175,7 +6284,7 @@ var barCode;
6175
6284
  * @beta
6176
6285
  */
6177
6286
  function requestPermission() {
6178
- ensureInitialized(FrameContexts.content, FrameContexts.task);
6287
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6179
6288
  if (!isSupported()) {
6180
6289
  throw errorNotSupportedOnPlatform;
6181
6290
  }
@@ -6194,8 +6303,7 @@ var barCode;
6194
6303
  * @beta
6195
6304
  */
6196
6305
  function isSupported() {
6197
- ensureInitialized();
6198
- return runtime.supports.barCode && runtime.supports.permissions ? true : false;
6306
+ return ensureInitialized(runtime) && runtime.supports.barCode && runtime.supports.permissions ? true : false;
6199
6307
  }
6200
6308
  barCode.isSupported = isSupported;
6201
6309
  })(barCode || (barCode = {}));
@@ -6225,7 +6333,7 @@ var chat;
6225
6333
  */
6226
6334
  function openChat(openChatRequest) {
6227
6335
  return new Promise(function (resolve) {
6228
- ensureInitialized(FrameContexts.content, FrameContexts.task);
6336
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6229
6337
  if (!isSupported()) {
6230
6338
  throw errorNotSupportedOnPlatform;
6231
6339
  }
@@ -6266,7 +6374,7 @@ var chat;
6266
6374
  openChat(chatRequest);
6267
6375
  }
6268
6376
  else {
6269
- ensureInitialized(FrameContexts.content, FrameContexts.task);
6377
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6270
6378
  if (!isSupported()) {
6271
6379
  throw errorNotSupportedOnPlatform;
6272
6380
  }
@@ -6294,8 +6402,7 @@ var chat;
6294
6402
  * @beta
6295
6403
  */
6296
6404
  function isSupported() {
6297
- ensureInitialized();
6298
- return runtime.supports.chat ? true : false;
6405
+ return ensureInitialized(runtime) && runtime.supports.chat ? true : false;
6299
6406
  }
6300
6407
  chat.isSupported = isSupported;
6301
6408
  })(chat || (chat = {}));
@@ -6320,7 +6427,7 @@ var geoLocation;
6320
6427
  * @beta
6321
6428
  */
6322
6429
  function getCurrentLocation() {
6323
- ensureInitialized(FrameContexts.content, FrameContexts.task);
6430
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6324
6431
  if (!isSupported()) {
6325
6432
  throw errorNotSupportedOnPlatform;
6326
6433
  }
@@ -6336,7 +6443,7 @@ var geoLocation;
6336
6443
  * @beta
6337
6444
  */
6338
6445
  function hasPermission() {
6339
- ensureInitialized(FrameContexts.content, FrameContexts.task);
6446
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6340
6447
  if (!isSupported()) {
6341
6448
  throw errorNotSupportedOnPlatform;
6342
6449
  }
@@ -6356,7 +6463,7 @@ var geoLocation;
6356
6463
  * @beta
6357
6464
  */
6358
6465
  function requestPermission() {
6359
- ensureInitialized(FrameContexts.content, FrameContexts.task);
6466
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6360
6467
  if (!isSupported()) {
6361
6468
  throw errorNotSupportedOnPlatform;
6362
6469
  }
@@ -6375,8 +6482,7 @@ var geoLocation;
6375
6482
  * @beta
6376
6483
  */
6377
6484
  function isSupported() {
6378
- ensureInitialized();
6379
- return runtime.supports.geoLocation && runtime.supports.permissions ? true : false;
6485
+ return ensureInitialized(runtime) && runtime.supports.geoLocation && runtime.supports.permissions ? true : false;
6380
6486
  }
6381
6487
  geoLocation.isSupported = isSupported;
6382
6488
  /**
@@ -6394,7 +6500,7 @@ var geoLocation;
6394
6500
  * @beta
6395
6501
  */
6396
6502
  function chooseLocation() {
6397
- ensureInitialized(FrameContexts.content, FrameContexts.task);
6503
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6398
6504
  if (!isSupported()) {
6399
6505
  throw errorNotSupportedOnPlatform;
6400
6506
  }
@@ -6410,7 +6516,7 @@ var geoLocation;
6410
6516
  * @beta
6411
6517
  */
6412
6518
  function showLocation(location) {
6413
- ensureInitialized(FrameContexts.content, FrameContexts.task);
6519
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6414
6520
  if (!isSupported()) {
6415
6521
  throw errorNotSupportedOnPlatform;
6416
6522
  }
@@ -6429,8 +6535,10 @@ var geoLocation;
6429
6535
  * @beta
6430
6536
  */
6431
6537
  function isSupported() {
6432
- ensureInitialized();
6433
- return runtime.supports.geoLocation && runtime.supports.geoLocation.map && runtime.supports.permissions
6538
+ return ensureInitialized(runtime) &&
6539
+ runtime.supports.geoLocation &&
6540
+ runtime.supports.geoLocation.map &&
6541
+ runtime.supports.permissions
6434
6542
  ? true
6435
6543
  : false;
6436
6544
  }
@@ -6447,6 +6555,7 @@ var geoLocation;
6447
6555
 
6448
6556
 
6449
6557
 
6558
+
6450
6559
  var ChildAppWindow = /** @class */ (function () {
6451
6560
  function ChildAppWindow() {
6452
6561
  }
@@ -6457,7 +6566,7 @@ var ChildAppWindow = /** @class */ (function () {
6457
6566
  * @param onComplete - The callback to know if the postMessage has been success/failed.
6458
6567
  */
6459
6568
  ChildAppWindow.prototype.postMessage = function (message, onComplete) {
6460
- ensureInitialized();
6569
+ ensureInitialized(runtime);
6461
6570
  sendMessageToParent('messageForChild', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
6462
6571
  };
6463
6572
  /**
@@ -6467,7 +6576,7 @@ var ChildAppWindow = /** @class */ (function () {
6467
6576
  * @param listener - The listener that will be called
6468
6577
  */
6469
6578
  ChildAppWindow.prototype.addEventListener = function (type, listener) {
6470
- ensureInitialized();
6579
+ ensureInitialized(runtime);
6471
6580
  if (type === 'message') {
6472
6581
  registerHandler('messageForParent', listener);
6473
6582
  }
@@ -6493,7 +6602,7 @@ var ParentAppWindow = /** @class */ (function () {
6493
6602
  * @param onComplete - The callback to know if the postMessage has been success/failed.
6494
6603
  */
6495
6604
  ParentAppWindow.prototype.postMessage = function (message, onComplete) {
6496
- ensureInitialized(FrameContexts.task);
6605
+ ensureInitialized(runtime, FrameContexts.task);
6497
6606
  sendMessageToParent('messageForParent', [message], onComplete ? onComplete : getGenericOnCompleteHandler());
6498
6607
  };
6499
6608
  /**
@@ -6503,7 +6612,7 @@ var ParentAppWindow = /** @class */ (function () {
6503
6612
  * @param listener - The listener that will be called
6504
6613
  */
6505
6614
  ParentAppWindow.prototype.addEventListener = function (type, listener) {
6506
- ensureInitialized(FrameContexts.task);
6615
+ ensureInitialized(runtime, FrameContexts.task);
6507
6616
  if (type === 'message') {
6508
6617
  registerHandler('messageForChild', listener);
6509
6618
  }
@@ -6541,7 +6650,7 @@ var location_location;
6541
6650
  if (!callback) {
6542
6651
  throw new Error('[location.getLocation] Callback cannot be null');
6543
6652
  }
6544
- ensureInitialized(FrameContexts.content, FrameContexts.task);
6653
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6545
6654
  if (!isCurrentSDKVersionAtLeast(locationAPIsRequiredVersion)) {
6546
6655
  throw { errorCode: ErrorCode.OLD_PLATFORM };
6547
6656
  }
@@ -6567,7 +6676,7 @@ var location_location;
6567
6676
  if (!callback) {
6568
6677
  throw new Error('[location.showLocation] Callback cannot be null');
6569
6678
  }
6570
- ensureInitialized(FrameContexts.content, FrameContexts.task);
6679
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
6571
6680
  if (!isCurrentSDKVersionAtLeast(locationAPIsRequiredVersion)) {
6572
6681
  throw { errorCode: ErrorCode.OLD_PLATFORM };
6573
6682
  }
@@ -6591,8 +6700,7 @@ var location_location;
6591
6700
  * @returns boolean to represent whether Location is supported
6592
6701
  */
6593
6702
  function isSupported() {
6594
- ensureInitialized();
6595
- return runtime.supports.location ? true : false;
6703
+ return ensureInitialized(runtime) && runtime.supports.location ? true : false;
6596
6704
  }
6597
6705
  location_1.isSupported = isSupported;
6598
6706
  })(location_location || (location_location = {}));
@@ -6602,6 +6710,7 @@ var location_location;
6602
6710
 
6603
6711
 
6604
6712
 
6713
+
6605
6714
  var meeting;
6606
6715
  (function (meeting) {
6607
6716
  /**
@@ -6644,7 +6753,7 @@ var meeting;
6644
6753
  if (!callback) {
6645
6754
  throw new Error('[get incoming client audio state] Callback cannot be null');
6646
6755
  }
6647
- ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
6756
+ ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
6648
6757
  sendMessageToParent('getIncomingClientAudioState', callback);
6649
6758
  }
6650
6759
  meeting.getIncomingClientAudioState = getIncomingClientAudioState;
@@ -6660,7 +6769,7 @@ var meeting;
6660
6769
  if (!callback) {
6661
6770
  throw new Error('[toggle incoming client audio] Callback cannot be null');
6662
6771
  }
6663
- ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
6772
+ ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
6664
6773
  sendMessageToParent('toggleIncomingClientAudio', callback);
6665
6774
  }
6666
6775
  meeting.toggleIncomingClientAudio = toggleIncomingClientAudio;
@@ -6679,7 +6788,7 @@ var meeting;
6679
6788
  if (!callback) {
6680
6789
  throw new Error('[get meeting details] Callback cannot be null');
6681
6790
  }
6682
- ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage, FrameContexts.settings, FrameContexts.content);
6791
+ ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage, FrameContexts.settings, FrameContexts.content);
6683
6792
  sendMessageToParent('meeting.getMeetingDetails', callback);
6684
6793
  }
6685
6794
  meeting.getMeetingDetails = getMeetingDetails;
@@ -6698,7 +6807,7 @@ var meeting;
6698
6807
  if (!callback) {
6699
6808
  throw new Error('[get Authentication Token For AnonymousUser] Callback cannot be null');
6700
6809
  }
6701
- ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
6810
+ ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
6702
6811
  sendMessageToParent('meeting.getAuthenticationTokenForAnonymousUser', callback);
6703
6812
  }
6704
6813
  meeting.getAuthenticationTokenForAnonymousUser = getAuthenticationTokenForAnonymousUser;
@@ -6713,7 +6822,7 @@ var meeting;
6713
6822
  if (!callback) {
6714
6823
  throw new Error('[get live stream state] Callback cannot be null');
6715
6824
  }
6716
- ensureInitialized(FrameContexts.sidePanel);
6825
+ ensureInitialized(runtime, FrameContexts.sidePanel);
6717
6826
  sendMessageToParent('meeting.getLiveStreamState', callback);
6718
6827
  }
6719
6828
  meeting.getLiveStreamState = getLiveStreamState;
@@ -6731,7 +6840,7 @@ var meeting;
6731
6840
  if (!callback) {
6732
6841
  throw new Error('[request start live streaming] Callback cannot be null');
6733
6842
  }
6734
- ensureInitialized(FrameContexts.sidePanel);
6843
+ ensureInitialized(runtime, FrameContexts.sidePanel);
6735
6844
  sendMessageToParent('meeting.requestStartLiveStreaming', [streamUrl, streamKey], callback);
6736
6845
  }
6737
6846
  meeting.requestStartLiveStreaming = requestStartLiveStreaming;
@@ -6747,7 +6856,7 @@ var meeting;
6747
6856
  if (!callback) {
6748
6857
  throw new Error('[request stop live streaming] Callback cannot be null');
6749
6858
  }
6750
- ensureInitialized(FrameContexts.sidePanel);
6859
+ ensureInitialized(runtime, FrameContexts.sidePanel);
6751
6860
  sendMessageToParent('meeting.requestStopLiveStreaming', callback);
6752
6861
  }
6753
6862
  meeting.requestStopLiveStreaming = requestStopLiveStreaming;
@@ -6763,7 +6872,7 @@ var meeting;
6763
6872
  if (!handler) {
6764
6873
  throw new Error('[register live stream changed handler] Handler cannot be null');
6765
6874
  }
6766
- ensureInitialized(FrameContexts.sidePanel);
6875
+ ensureInitialized(runtime, FrameContexts.sidePanel);
6767
6876
  registerHandler('meeting.liveStreamChanged', handler);
6768
6877
  }
6769
6878
  meeting.registerLiveStreamChangedHandler = registerLiveStreamChangedHandler;
@@ -6779,7 +6888,7 @@ var meeting;
6779
6888
  if (!callback) {
6780
6889
  throw new Error('[share app content to stage] Callback cannot be null');
6781
6890
  }
6782
- ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
6891
+ ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
6783
6892
  sendMessageToParent('meeting.shareAppContentToStage', [appContentUrl], callback);
6784
6893
  }
6785
6894
  meeting.shareAppContentToStage = shareAppContentToStage;
@@ -6795,7 +6904,7 @@ var meeting;
6795
6904
  if (!callback) {
6796
6905
  throw new Error('[get app content stage sharing capabilities] Callback cannot be null');
6797
6906
  }
6798
- ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
6907
+ ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
6799
6908
  sendMessageToParent('meeting.getAppContentStageSharingCapabilities', callback);
6800
6909
  }
6801
6910
  meeting.getAppContentStageSharingCapabilities = getAppContentStageSharingCapabilities;
@@ -6812,7 +6921,7 @@ var meeting;
6812
6921
  if (!callback) {
6813
6922
  throw new Error('[stop sharing app content to stage] Callback cannot be null');
6814
6923
  }
6815
- ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
6924
+ ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
6816
6925
  sendMessageToParent('meeting.stopSharingAppContentToStage', callback);
6817
6926
  }
6818
6927
  meeting.stopSharingAppContentToStage = stopSharingAppContentToStage;
@@ -6828,7 +6937,7 @@ var meeting;
6828
6937
  if (!callback) {
6829
6938
  throw new Error('[get app content stage sharing state] Callback cannot be null');
6830
6939
  }
6831
- ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
6940
+ ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
6832
6941
  sendMessageToParent('meeting.getAppContentStageSharingState', callback);
6833
6942
  }
6834
6943
  meeting.getAppContentStageSharingState = getAppContentStageSharingState;
@@ -6843,7 +6952,7 @@ var meeting;
6843
6952
  if (!handler) {
6844
6953
  throw new Error('[registerSpeakingStateChangeHandler] Handler cannot be null');
6845
6954
  }
6846
- ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
6955
+ ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
6847
6956
  registerHandler('meeting.speakingStateChanged', handler);
6848
6957
  }
6849
6958
  meeting.registerSpeakingStateChangeHandler = registerSpeakingStateChangeHandler;
@@ -6861,7 +6970,7 @@ var meeting;
6861
6970
  if (!handler) {
6862
6971
  throw new Error('[registerRaiseHandStateChangedHandler] Handler cannot be null');
6863
6972
  }
6864
- ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
6973
+ ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
6865
6974
  registerHandler('meeting.raiseHandStateChanged', handler);
6866
6975
  }
6867
6976
  meeting.registerRaiseHandStateChangedHandler = registerRaiseHandStateChangedHandler;
@@ -6877,7 +6986,7 @@ var meeting;
6877
6986
  if (!handler) {
6878
6987
  throw new Error('[registerMeetingReactionReceivedHandler] Handler cannot be null');
6879
6988
  }
6880
- ensureInitialized(FrameContexts.sidePanel, FrameContexts.meetingStage);
6989
+ ensureInitialized(runtime, FrameContexts.sidePanel, FrameContexts.meetingStage);
6881
6990
  registerHandler('meeting.meetingReactionReceived', handler);
6882
6991
  }
6883
6992
  meeting.registerMeetingReactionReceivedHandler = registerMeetingReactionReceivedHandler;
@@ -6899,7 +7008,7 @@ var meeting;
6899
7008
  * @beta
6900
7009
  */
6901
7010
  function setOptions(shareInformation) {
6902
- ensureInitialized(FrameContexts.sidePanel);
7011
+ ensureInitialized(runtime, FrameContexts.sidePanel);
6903
7012
  if (shareInformation.contentUrl) {
6904
7013
  new URL(shareInformation.contentUrl);
6905
7014
  }
@@ -6945,7 +7054,7 @@ var monetization;
6945
7054
  resolve(sendAndHandleSdkError('monetization.openPurchaseExperience', planInfo));
6946
7055
  });
6947
7056
  };
6948
- ensureInitialized(FrameContexts.content);
7057
+ ensureInitialized(runtime, FrameContexts.content);
6949
7058
  return callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise(wrappedFunction, callback);
6950
7059
  }
6951
7060
  monetization.openPurchaseExperience = openPurchaseExperience;
@@ -6958,8 +7067,7 @@ var monetization;
6958
7067
  * @throws Error if {@linkcode app.initialize} has not successfully completed
6959
7068
  */
6960
7069
  function isSupported() {
6961
- ensureInitialized();
6962
- return runtime.supports.monetization ? true : false;
7070
+ return ensureInitialized(runtime) && runtime.supports.monetization ? true : false;
6963
7071
  }
6964
7072
  monetization.isSupported = isSupported;
6965
7073
  })(monetization || (monetization = {}));
@@ -6974,7 +7082,7 @@ var calendar;
6974
7082
  (function (calendar) {
6975
7083
  function openCalendarItem(openCalendarItemParams) {
6976
7084
  return new Promise(function (resolve) {
6977
- ensureInitialized(FrameContexts.content);
7085
+ ensureInitialized(runtime, FrameContexts.content);
6978
7086
  if (!isSupported()) {
6979
7087
  throw new Error('Not supported');
6980
7088
  }
@@ -6987,7 +7095,7 @@ var calendar;
6987
7095
  calendar.openCalendarItem = openCalendarItem;
6988
7096
  function composeMeeting(composeMeetingParams) {
6989
7097
  return new Promise(function (resolve) {
6990
- ensureInitialized(FrameContexts.content);
7098
+ ensureInitialized(runtime, FrameContexts.content);
6991
7099
  if (!isSupported()) {
6992
7100
  throw new Error('Not supported');
6993
7101
  }
@@ -7007,8 +7115,7 @@ var calendar;
7007
7115
  * @throws Error if {@linkcode app.initialize} has not successfully completed
7008
7116
  */
7009
7117
  function isSupported() {
7010
- ensureInitialized();
7011
- return runtime.supports.calendar ? true : false;
7118
+ return ensureInitialized(runtime) && runtime.supports.calendar ? true : false;
7012
7119
  }
7013
7120
  calendar.isSupported = isSupported;
7014
7121
  })(calendar || (calendar = {}));
@@ -7022,7 +7129,7 @@ var mail;
7022
7129
  (function (mail) {
7023
7130
  function openMailItem(openMailItemParams) {
7024
7131
  return new Promise(function (resolve) {
7025
- ensureInitialized(FrameContexts.content);
7132
+ ensureInitialized(runtime, FrameContexts.content);
7026
7133
  if (!isSupported()) {
7027
7134
  throw new Error('Not supported');
7028
7135
  }
@@ -7035,7 +7142,7 @@ var mail;
7035
7142
  mail.openMailItem = openMailItem;
7036
7143
  function composeMail(composeMailParams) {
7037
7144
  return new Promise(function (resolve) {
7038
- ensureInitialized(FrameContexts.content);
7145
+ ensureInitialized(runtime, FrameContexts.content);
7039
7146
  if (!isSupported()) {
7040
7147
  throw new Error('Not supported');
7041
7148
  }
@@ -7050,8 +7157,7 @@ var mail;
7050
7157
  * @throws Error if {@linkcode app.initialize} has not successfully completed
7051
7158
  */
7052
7159
  function isSupported() {
7053
- ensureInitialized();
7054
- return runtime.supports.mail ? true : false;
7160
+ return ensureInitialized(runtime) && runtime.supports.mail ? true : false;
7055
7161
  }
7056
7162
  mail.isSupported = isSupported;
7057
7163
  var ComposeMailType;
@@ -7085,7 +7191,7 @@ var people;
7085
7191
  */
7086
7192
  function selectPeople(param1, param2) {
7087
7193
  var _a;
7088
- ensureInitialized(FrameContexts.content, FrameContexts.task, FrameContexts.settings);
7194
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task, FrameContexts.settings);
7089
7195
  /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
7090
7196
  var callback;
7091
7197
  /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
@@ -7122,8 +7228,7 @@ var people;
7122
7228
  * @throws Error if {@linkcode app.initialize} has not successfully completed
7123
7229
  */
7124
7230
  function isSupported() {
7125
- ensureInitialized();
7126
- return runtime.supports.people ? true : false;
7231
+ return ensureInitialized(runtime) && runtime.supports.people ? true : false;
7127
7232
  }
7128
7233
  people_1.isSupported = isSupported;
7129
7234
  })(people || (people = {}));
@@ -7213,7 +7318,7 @@ var profile;
7213
7318
  * @beta
7214
7319
  */
7215
7320
  function showProfile(showProfileRequest) {
7216
- ensureInitialized(FrameContexts.content);
7321
+ ensureInitialized(runtime, FrameContexts.content);
7217
7322
  return new Promise(function (resolve) {
7218
7323
  var _a = validateShowProfileRequest(showProfileRequest), isValid = _a[0], message = _a[1];
7219
7324
  if (!isValid) {
@@ -7244,8 +7349,7 @@ var profile;
7244
7349
  * @beta
7245
7350
  */
7246
7351
  function isSupported() {
7247
- ensureInitialized();
7248
- return runtime.supports.profile ? true : false;
7352
+ return ensureInitialized(runtime) && runtime.supports.profile ? true : false;
7249
7353
  }
7250
7354
  profile.isSupported = isSupported;
7251
7355
  })(profile || (profile = {}));
@@ -7292,7 +7396,7 @@ var video;
7292
7396
  * @param config - VideoFrameConfig to customize generated video frame parameters
7293
7397
  */
7294
7398
  function registerForVideoFrame(frameCallback, config) {
7295
- ensureInitialized(FrameContexts.sidePanel);
7399
+ ensureInitialized(runtime, FrameContexts.sidePanel);
7296
7400
  if (!isSupported()) {
7297
7401
  throw errorNotSupportedOnPlatform;
7298
7402
  }
@@ -7316,7 +7420,7 @@ var video;
7316
7420
  * @param effectId - Newly selected effect id.
7317
7421
  */
7318
7422
  function notifySelectedVideoEffectChanged(effectChangeType, effectId) {
7319
- ensureInitialized(FrameContexts.sidePanel);
7423
+ ensureInitialized(runtime, FrameContexts.sidePanel);
7320
7424
  if (!isSupported()) {
7321
7425
  throw errorNotSupportedOnPlatform;
7322
7426
  }
@@ -7329,7 +7433,7 @@ var video;
7329
7433
  * @param callback - The VideoEffectCallback to invoke when registerForVideoEffect has completed
7330
7434
  */
7331
7435
  function registerForVideoEffect(callback) {
7332
- ensureInitialized(FrameContexts.sidePanel);
7436
+ ensureInitialized(runtime, FrameContexts.sidePanel);
7333
7437
  if (!isSupported()) {
7334
7438
  throw errorNotSupportedOnPlatform;
7335
7439
  }
@@ -7362,8 +7466,7 @@ var video;
7362
7466
  *
7363
7467
  */
7364
7468
  function isSupported() {
7365
- ensureInitialized();
7366
- return runtime.supports.video ? true : false;
7469
+ return ensureInitialized(runtime) && runtime.supports.video ? true : false;
7367
7470
  }
7368
7471
  video.isSupported = isSupported;
7369
7472
  })(video || (video = {})); //end of video namespace
@@ -7429,7 +7532,7 @@ var search;
7429
7532
  * @beta
7430
7533
  */
7431
7534
  function registerHandlers(onClosedHandler, onExecuteHandler, onChangeHandler) {
7432
- ensureInitialized(FrameContexts.content);
7535
+ ensureInitialized(runtime, FrameContexts.content);
7433
7536
  if (!isSupported()) {
7434
7537
  throw errorNotSupportedOnPlatform;
7435
7538
  }
@@ -7447,7 +7550,7 @@ var search;
7447
7550
  * @beta
7448
7551
  */
7449
7552
  function unregisterHandlers() {
7450
- ensureInitialized(FrameContexts.content);
7553
+ ensureInitialized(runtime, FrameContexts.content);
7451
7554
  if (!isSupported()) {
7452
7555
  throw errorNotSupportedOnPlatform;
7453
7556
  }
@@ -7468,8 +7571,7 @@ var search;
7468
7571
  * @beta
7469
7572
  */
7470
7573
  function isSupported() {
7471
- ensureInitialized();
7472
- return runtime.supports.search ? true : false;
7574
+ return ensureInitialized(runtime) && runtime.supports.search ? true : false;
7473
7575
  }
7474
7576
  search.isSupported = isSupported;
7475
7577
  })(search || (search = {}));
@@ -7498,7 +7600,7 @@ var sharing;
7498
7600
  var wrappedFunction = function () { return Promise.reject(err); };
7499
7601
  return callCallbackWithSdkErrorFromPromiseAndReturnPromise(wrappedFunction, callback);
7500
7602
  }
7501
- ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
7603
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
7502
7604
  return callCallbackWithSdkErrorFromPromiseAndReturnPromise(shareWebContentHelper, callback, shareWebContentRequest);
7503
7605
  }
7504
7606
  sharing.shareWebContent = shareWebContent;
@@ -7565,8 +7667,7 @@ var sharing;
7565
7667
  * @throws Error if {@linkcode app.initialize} has not successfully completed
7566
7668
  */
7567
7669
  function isSupported() {
7568
- ensureInitialized();
7569
- return runtime.supports.sharing ? true : false;
7670
+ return ensureInitialized(runtime) && runtime.supports.sharing ? true : false;
7570
7671
  }
7571
7672
  sharing.isSupported = isSupported;
7572
7673
  })(sharing || (sharing = {}));
@@ -7594,7 +7695,7 @@ var stageView;
7594
7695
  */
7595
7696
  function open(stageViewParams) {
7596
7697
  return new Promise(function (resolve) {
7597
- ensureInitialized(FrameContexts.content);
7698
+ ensureInitialized(runtime, FrameContexts.content);
7598
7699
  if (!isSupported()) {
7599
7700
  throw errorNotSupportedOnPlatform;
7600
7701
  }
@@ -7614,8 +7715,7 @@ var stageView;
7614
7715
  *
7615
7716
  */
7616
7717
  function isSupported() {
7617
- ensureInitialized();
7618
- return runtime.supports.stageView ? true : false;
7718
+ return ensureInitialized(runtime) && runtime.supports.stageView ? true : false;
7619
7719
  }
7620
7720
  stageView.isSupported = isSupported;
7621
7721
  })(stageView || (stageView = {}));
@@ -7638,7 +7738,7 @@ var webStorage;
7638
7738
  * @beta
7639
7739
  */
7640
7740
  function isWebStorageClearedOnUserLogOut() {
7641
- ensureInitialized();
7741
+ ensureInitialized(runtime);
7642
7742
  return isSupported();
7643
7743
  }
7644
7744
  webStorage.isWebStorageClearedOnUserLogOut = isWebStorageClearedOnUserLogOut;
@@ -7651,8 +7751,7 @@ var webStorage;
7651
7751
  * @beta
7652
7752
  */
7653
7753
  function isSupported() {
7654
- ensureInitialized();
7655
- return runtime.supports.webStorage ? true : false;
7754
+ return ensureInitialized(runtime) && runtime.supports.webStorage ? true : false;
7656
7755
  }
7657
7756
  webStorage.isSupported = isSupported;
7658
7757
  })(webStorage || (webStorage = {}));
@@ -7683,7 +7782,7 @@ var call;
7683
7782
  function startCall(startCallParams) {
7684
7783
  return new Promise(function (resolve) {
7685
7784
  var _a;
7686
- ensureInitialized(FrameContexts.content, FrameContexts.task);
7785
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.task);
7687
7786
  if (!isSupported()) {
7688
7787
  throw errorNotSupportedOnPlatform;
7689
7788
  }
@@ -7703,8 +7802,7 @@ var call;
7703
7802
  * @throws Error if {@linkcode app.initialize} has not successfully completed
7704
7803
  */
7705
7804
  function isSupported() {
7706
- ensureInitialized();
7707
- return runtime.supports.call ? true : false;
7805
+ return ensureInitialized(runtime) && runtime.supports.call ? true : false;
7708
7806
  }
7709
7807
  call.isSupported = isSupported;
7710
7808
  })(call || (call = {}));
@@ -7788,6 +7886,7 @@ var appInitialization;
7788
7886
 
7789
7887
 
7790
7888
 
7889
+
7791
7890
  /**
7792
7891
  * @deprecated
7793
7892
  * As of 2.0.0, please use {@link app.initialize app.initialize(validMessageOrigins?: string[]): Promise\<void\>} instead.
@@ -7999,7 +8098,7 @@ function registerChangeSettingsHandler(handler) {
7999
8098
  * @param tabInstanceParameters - OPTIONAL Flags that specify whether to scope call to favorite teams or channels.
8000
8099
  */
8001
8100
  function getTabInstances(callback, tabInstanceParameters) {
8002
- ensureInitialized();
8101
+ ensureInitialized(runtime);
8003
8102
  pages.tabs.getTabInstances(tabInstanceParameters).then(function (tabInfo) {
8004
8103
  callback(tabInfo);
8005
8104
  });
@@ -8014,7 +8113,7 @@ function getTabInstances(callback, tabInstanceParameters) {
8014
8113
  * @param tabInstanceParameters - OPTIONAL Ignored, kept for future use
8015
8114
  */
8016
8115
  function getMruTabInstances(callback, tabInstanceParameters) {
8017
- ensureInitialized();
8116
+ ensureInitialized(runtime);
8018
8117
  pages.tabs.getMruTabInstances(tabInstanceParameters).then(function (tabInfo) {
8019
8118
  callback(tabInfo);
8020
8119
  });
@@ -8043,7 +8142,7 @@ function shareDeepLink(deepLinkParameters) {
8043
8142
  * @param deepLink - deep link.
8044
8143
  */
8045
8144
  function executeDeepLink(deepLink, onComplete) {
8046
- ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
8145
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
8047
8146
  onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();
8048
8147
  app_app.openLink(deepLink)
8049
8148
  .then(function () {
@@ -8164,6 +8263,7 @@ function transformAppContextToLegacyContext(appContext) {
8164
8263
 
8165
8264
 
8166
8265
 
8266
+
8167
8267
  /**
8168
8268
  * Navigation specific part of the SDK.
8169
8269
  */
@@ -8188,7 +8288,7 @@ function returnFocus(navigateForward) {
8188
8288
  * @param onComplete - The callback to invoke when the action is complete.
8189
8289
  */
8190
8290
  function navigateToTab(tabInstance, onComplete) {
8191
- ensureInitialized();
8291
+ ensureInitialized(runtime);
8192
8292
  onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();
8193
8293
  pages.tabs.navigateToTab(tabInstance)
8194
8294
  .then(function () {
@@ -8212,7 +8312,7 @@ function navigateToTab(tabInstance, onComplete) {
8212
8312
  * @param onComplete - The callback to invoke when the action is complete.
8213
8313
  */
8214
8314
  function navigateCrossDomain(url, onComplete) {
8215
- ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
8315
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.remove, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
8216
8316
  onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();
8217
8317
  pages.navigateCrossDomain(url)
8218
8318
  .then(function () {
@@ -8232,7 +8332,7 @@ function navigateCrossDomain(url, onComplete) {
8232
8332
  * @param onComplete - The callback to invoke when the action is complete.
8233
8333
  */
8234
8334
  function navigateBack(onComplete) {
8235
- ensureInitialized();
8335
+ ensureInitialized(runtime);
8236
8336
  onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();
8237
8337
  pages.backStack.navigateBack()
8238
8338
  .then(function () {
@@ -8248,6 +8348,7 @@ function navigateBack(onComplete) {
8248
8348
 
8249
8349
 
8250
8350
 
8351
+
8251
8352
  /**
8252
8353
  * @deprecated
8253
8354
  * As of 2.0.0, please use {@link pages.config} namespace instead.
@@ -8279,7 +8380,7 @@ var settings;
8279
8380
  * @param callback - The callback to invoke when the {@link Settings} object is retrieved.
8280
8381
  */
8281
8382
  function getSettings(callback) {
8282
- ensureInitialized(FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
8383
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.remove, FrameContexts.sidePanel);
8283
8384
  pages.getConfig().then(function (config) {
8284
8385
  callback(config);
8285
8386
  });
@@ -8295,7 +8396,7 @@ var settings;
8295
8396
  * @param - Set the desired settings for this instance.
8296
8397
  */
8297
8398
  function setSettings(instanceSettings, onComplete) {
8298
- ensureInitialized(FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
8399
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.settings, FrameContexts.sidePanel);
8299
8400
  onComplete = onComplete ? onComplete : getGenericOnCompleteHandler();
8300
8401
  pages.config.setConfig(instanceSettings)
8301
8402
  .then(function () {
@@ -8356,6 +8457,7 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
8356
8457
 
8357
8458
 
8358
8459
 
8460
+
8359
8461
  /**
8360
8462
  * @deprecated
8361
8463
  * As of 2.0.0, please use {@link dialog} namespace instead.
@@ -8383,7 +8485,7 @@ var tasks;
8383
8485
  function (sdkResponse) { return submitHandler(sdkResponse.err, sdkResponse.result); }
8384
8486
  : undefined;
8385
8487
  if (taskInfo.card !== undefined || taskInfo.url === undefined) {
8386
- ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
8488
+ ensureInitialized(runtime, FrameContexts.content, FrameContexts.sidePanel, FrameContexts.meetingStage);
8387
8489
  sendMessageToParent('tasks.startTask', [taskInfo], submitHandler);
8388
8490
  }
8389
8491
  else if (taskInfo.completionBotId !== undefined) {
@@ -8481,6 +8583,7 @@ var tasks;
8481
8583
 
8482
8584
 
8483
8585
 
8586
+
8484
8587
  /**
8485
8588
  * @hidden
8486
8589
  * Allowed roles during a meeting.
@@ -8538,7 +8641,7 @@ var LiveShareHost = /** @class */ (function () {
8538
8641
  */
8539
8642
  LiveShareHost.prototype.getFluidTenantInfo = function () {
8540
8643
  return new Promise(function (resolve) {
8541
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8644
+ ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);
8542
8645
  resolve(sendAndHandleSdkError('interactive.getFluidTenantInfo'));
8543
8646
  });
8544
8647
  };
@@ -8553,7 +8656,7 @@ var LiveShareHost = /** @class */ (function () {
8553
8656
  */
8554
8657
  LiveShareHost.prototype.getFluidToken = function (containerId) {
8555
8658
  return new Promise(function (resolve) {
8556
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8659
+ ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);
8557
8660
  // eslint-disable-next-line strict-null-checks/all
8558
8661
  resolve(sendAndHandleSdkError('interactive.getFluidToken', containerId));
8559
8662
  });
@@ -8566,7 +8669,7 @@ var LiveShareHost = /** @class */ (function () {
8566
8669
  */
8567
8670
  LiveShareHost.prototype.getFluidContainerId = function () {
8568
8671
  return new Promise(function (resolve) {
8569
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8672
+ ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);
8570
8673
  resolve(sendAndHandleSdkError('interactive.getFluidContainerId'));
8571
8674
  });
8572
8675
  };
@@ -8584,7 +8687,7 @@ var LiveShareHost = /** @class */ (function () {
8584
8687
  */
8585
8688
  LiveShareHost.prototype.setFluidContainerId = function (containerId) {
8586
8689
  return new Promise(function (resolve) {
8587
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8690
+ ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);
8588
8691
  resolve(sendAndHandleSdkError('interactive.setFluidContainerId', containerId));
8589
8692
  });
8590
8693
  };
@@ -8596,7 +8699,7 @@ var LiveShareHost = /** @class */ (function () {
8596
8699
  */
8597
8700
  LiveShareHost.prototype.getNtpTime = function () {
8598
8701
  return new Promise(function (resolve) {
8599
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8702
+ ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);
8600
8703
  resolve(sendAndHandleSdkError('interactive.getNtpTime'));
8601
8704
  });
8602
8705
  };
@@ -8611,7 +8714,7 @@ var LiveShareHost = /** @class */ (function () {
8611
8714
  */
8612
8715
  LiveShareHost.prototype.registerClientId = function (clientId) {
8613
8716
  return new Promise(function (resolve) {
8614
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8717
+ ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);
8615
8718
  resolve(sendAndHandleSdkError('interactive.registerClientId', clientId));
8616
8719
  });
8617
8720
  };
@@ -8626,7 +8729,7 @@ var LiveShareHost = /** @class */ (function () {
8626
8729
  */
8627
8730
  LiveShareHost.prototype.getClientRoles = function (clientId) {
8628
8731
  return new Promise(function (resolve) {
8629
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8732
+ ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);
8630
8733
  resolve(sendAndHandleSdkError('interactive.getClientRoles', clientId));
8631
8734
  });
8632
8735
  };
@@ -8639,7 +8742,7 @@ var LiveShareHost = /** @class */ (function () {
8639
8742
  * @beta
8640
8743
  */
8641
8744
  LiveShareHost.create = function () {
8642
- ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8745
+ ensureInitialized(runtime, FrameContexts.meetingStage, FrameContexts.sidePanel);
8643
8746
  return new LiveShareHost();
8644
8747
  };
8645
8748
  return LiveShareHost;
@@ -8687,6 +8790,7 @@ var LiveShareHost = /** @class */ (function () {
8687
8790
 
8688
8791
 
8689
8792
 
8793
+
8690
8794
  /**
8691
8795
  * @hidden
8692
8796
  *
@@ -8800,7 +8904,7 @@ var files;
8800
8904
  * Limited to Microsoft-internal use
8801
8905
  */
8802
8906
  function getCloudStorageFolders(channelId, callback) {
8803
- ensureInitialized(FrameContexts.content);
8907
+ ensureInitialized(runtime, FrameContexts.content);
8804
8908
  if (!channelId || channelId.length === 0) {
8805
8909
  throw new Error('[files.getCloudStorageFolders] channelId name cannot be null or empty');
8806
8910
  }
@@ -8823,7 +8927,7 @@ var files;
8823
8927
  * Limited to Microsoft-internal use
8824
8928
  */
8825
8929
  function addCloudStorageFolder(channelId, callback) {
8826
- ensureInitialized(FrameContexts.content);
8930
+ ensureInitialized(runtime, FrameContexts.content);
8827
8931
  if (!channelId || channelId.length === 0) {
8828
8932
  throw new Error('[files.addCloudStorageFolder] channelId name cannot be null or empty');
8829
8933
  }
@@ -8848,7 +8952,7 @@ var files;
8848
8952
  * Limited to Microsoft-internal use
8849
8953
  */
8850
8954
  function deleteCloudStorageFolder(channelId, folderToDelete, callback) {
8851
- ensureInitialized(FrameContexts.content);
8955
+ ensureInitialized(runtime, FrameContexts.content);
8852
8956
  if (!channelId) {
8853
8957
  throw new Error('[files.deleteCloudStorageFolder] channelId name cannot be null or empty');
8854
8958
  }
@@ -8876,7 +8980,7 @@ var files;
8876
8980
  * Limited to Microsoft-internal use
8877
8981
  */
8878
8982
  function getCloudStorageFolderContents(folder, providerCode, callback) {
8879
- ensureInitialized(FrameContexts.content);
8983
+ ensureInitialized(runtime, FrameContexts.content);
8880
8984
  if (!folder || !providerCode) {
8881
8985
  throw new Error('[files.getCloudStorageFolderContents] folder/providerCode name cannot be null or empty');
8882
8986
  }
@@ -8904,7 +9008,7 @@ var files;
8904
9008
  * Limited to Microsoft-internal use
8905
9009
  */
8906
9010
  function openCloudStorageFile(file, providerCode, fileOpenPreference) {
8907
- ensureInitialized(FrameContexts.content);
9011
+ ensureInitialized(runtime, FrameContexts.content);
8908
9012
  if (!file || !providerCode) {
8909
9013
  throw new Error('[files.openCloudStorageFile] file/providerCode cannot be null or empty');
8910
9014
  }
@@ -8926,7 +9030,7 @@ var files;
8926
9030
  */
8927
9031
  function getExternalProviders(excludeAddedProviders, callback) {
8928
9032
  if (excludeAddedProviders === void 0) { excludeAddedProviders = false; }
8929
- ensureInitialized(FrameContexts.content);
9033
+ ensureInitialized(runtime, FrameContexts.content);
8930
9034
  if (!callback) {
8931
9035
  throw new Error('[files.getExternalProviders] Callback cannot be null');
8932
9036
  }
@@ -8943,7 +9047,7 @@ var files;
8943
9047
  */
8944
9048
  function copyMoveFiles(selectedFiles, providerCode, destinationFolder, destinationProviderCode, isMove, callback) {
8945
9049
  if (isMove === void 0) { isMove = false; }
8946
- ensureInitialized(FrameContexts.content);
9050
+ ensureInitialized(runtime, FrameContexts.content);
8947
9051
  if (!selectedFiles || selectedFiles.length === 0) {
8948
9052
  throw new Error('[files.copyMoveFiles] selectedFiles cannot be null or empty');
8949
9053
  }
@@ -8974,7 +9078,7 @@ var files;
8974
9078
  * Limited to Microsoft-internal use
8975
9079
  */
8976
9080
  function getFileDownloads(callback) {
8977
- ensureInitialized(FrameContexts.content);
9081
+ ensureInitialized(runtime, FrameContexts.content);
8978
9082
  if (!callback) {
8979
9083
  throw new Error('[files.getFileDownloads] Callback cannot be null');
8980
9084
  }
@@ -8994,7 +9098,7 @@ var files;
8994
9098
  */
8995
9099
  function openDownloadFolder(fileObjectId, callback) {
8996
9100
  if (fileObjectId === void 0) { fileObjectId = undefined; }
8997
- ensureInitialized(FrameContexts.content);
9101
+ ensureInitialized(runtime, FrameContexts.content);
8998
9102
  if (!callback) {
8999
9103
  throw new Error('[files.openDownloadFolder] Callback cannot be null');
9000
9104
  }
@@ -9018,7 +9122,7 @@ var files;
9018
9122
  * Limited to Microsoft-internal use
9019
9123
  */
9020
9124
  function addCloudStorageProvider(callback) {
9021
- ensureInitialized(FrameContexts.content);
9125
+ ensureInitialized(runtime, FrameContexts.content);
9022
9126
  if (!callback) {
9023
9127
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.addCloudStorageProvider] callback cannot be null');
9024
9128
  }
@@ -9040,7 +9144,7 @@ var files;
9040
9144
  * Limited to Microsoft-internal use
9041
9145
  */
9042
9146
  function removeCloudStorageProvider(logoutRequest, callback) {
9043
- ensureInitialized(FrameContexts.content);
9147
+ ensureInitialized(runtime, FrameContexts.content);
9044
9148
  if (!callback) {
9045
9149
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.removeCloudStorageProvider] callback cannot be null');
9046
9150
  }
@@ -9063,7 +9167,7 @@ var files;
9063
9167
  * Limited to Microsoft-internal use
9064
9168
  */
9065
9169
  function addCloudStorageProviderFile(addNewFileRequest, callback) {
9066
- ensureInitialized(FrameContexts.content);
9170
+ ensureInitialized(runtime, FrameContexts.content);
9067
9171
  if (!callback) {
9068
9172
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.addCloudStorageProviderFile] callback cannot be null');
9069
9173
  }
@@ -9086,7 +9190,7 @@ var files;
9086
9190
  * Limited to Microsoft-internal use
9087
9191
  */
9088
9192
  function renameCloudStorageProviderFile(renameFileRequest, callback) {
9089
- ensureInitialized(FrameContexts.content);
9193
+ ensureInitialized(runtime, FrameContexts.content);
9090
9194
  if (!callback) {
9091
9195
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.renameCloudStorageProviderFile] callback cannot be null');
9092
9196
  }
@@ -9110,7 +9214,7 @@ var files;
9110
9214
  * Limited to Microsoft-internal use
9111
9215
  */
9112
9216
  function deleteCloudStorageProviderFile(deleteFileRequest, callback) {
9113
- ensureInitialized(FrameContexts.content);
9217
+ ensureInitialized(runtime, FrameContexts.content);
9114
9218
  if (!callback) {
9115
9219
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.deleteCloudStorageProviderFile] callback cannot be null');
9116
9220
  }
@@ -9137,7 +9241,7 @@ var files;
9137
9241
  * Limited to Microsoft-internal use
9138
9242
  */
9139
9243
  function downloadCloudStorageProviderFile(downloadFileRequest, callback) {
9140
- ensureInitialized(FrameContexts.content);
9244
+ ensureInitialized(runtime, FrameContexts.content);
9141
9245
  if (!callback) {
9142
9246
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.downloadCloudStorageProviderFile] callback cannot be null');
9143
9247
  }
@@ -9164,7 +9268,7 @@ var files;
9164
9268
  * Limited to Microsoft-internal use
9165
9269
  */
9166
9270
  function uploadCloudStorageProviderFile(uploadFileRequest, callback) {
9167
- ensureInitialized(FrameContexts.content);
9271
+ ensureInitialized(runtime, FrameContexts.content);
9168
9272
  if (!callback) {
9169
9273
  throw getSdkError(ErrorCode.INVALID_ARGUMENTS, '[files.uploadCloudStorageProviderFile] callback cannot be null');
9170
9274
  }
@@ -9192,7 +9296,7 @@ var files;
9192
9296
  * @internal Limited to Microsoft-internal use
9193
9297
  */
9194
9298
  function registerCloudStorageProviderListChangeHandler(handler) {
9195
- ensureInitialized();
9299
+ ensureInitialized(runtime);
9196
9300
  if (!handler) {
9197
9301
  throw new Error('[registerCloudStorageProviderListChangeHandler] Handler cannot be null');
9198
9302
  }
@@ -9212,7 +9316,7 @@ var files;
9212
9316
  * Limited to Microsoft-internal use
9213
9317
  */
9214
9318
  function registerCloudStorageProviderContentChangeHandler(handler) {
9215
- ensureInitialized();
9319
+ ensureInitialized(runtime);
9216
9320
  if (!handler) {
9217
9321
  throw new Error('[registerCloudStorageProviderContentChangeHandler] Handler cannot be null');
9218
9322
  }
@@ -9253,7 +9357,7 @@ var meetingRoom;
9253
9357
  */
9254
9358
  function getPairedMeetingRoomInfo() {
9255
9359
  return new Promise(function (resolve) {
9256
- ensureInitialized();
9360
+ ensureInitialized(runtime);
9257
9361
  if (!isSupported()) {
9258
9362
  throw errorNotSupportedOnPlatform;
9259
9363
  }
@@ -9276,7 +9380,7 @@ var meetingRoom;
9276
9380
  if (!commandName || commandName.length == 0) {
9277
9381
  throw new Error('[meetingRoom.sendCommandToPairedMeetingRoom] Command name cannot be null or empty');
9278
9382
  }
9279
- ensureInitialized();
9383
+ ensureInitialized(runtime);
9280
9384
  if (!isSupported()) {
9281
9385
  throw errorNotSupportedOnPlatform;
9282
9386
  }
@@ -9298,12 +9402,12 @@ var meetingRoom;
9298
9402
  if (!handler) {
9299
9403
  throw new Error('[meetingRoom.registerMeetingRoomCapabilitiesUpdateHandler] Handler cannot be null');
9300
9404
  }
9301
- ensureInitialized();
9405
+ ensureInitialized(runtime);
9302
9406
  if (!isSupported()) {
9303
9407
  throw errorNotSupportedOnPlatform;
9304
9408
  }
9305
9409
  registerHandler('meetingRoom.meetingRoomCapabilitiesUpdate', function (capabilities) {
9306
- ensureInitialized();
9410
+ ensureInitialized(runtime);
9307
9411
  handler(capabilities);
9308
9412
  });
9309
9413
  }
@@ -9323,12 +9427,12 @@ var meetingRoom;
9323
9427
  if (!handler) {
9324
9428
  throw new Error('[meetingRoom.registerMeetingRoomStatesUpdateHandler] Handler cannot be null');
9325
9429
  }
9326
- ensureInitialized();
9430
+ ensureInitialized(runtime);
9327
9431
  if (!isSupported()) {
9328
9432
  throw errorNotSupportedOnPlatform;
9329
9433
  }
9330
9434
  registerHandler('meetingRoom.meetingRoomStatesUpdate', function (states) {
9331
- ensureInitialized();
9435
+ ensureInitialized(runtime);
9332
9436
  handler(states);
9333
9437
  });
9334
9438
  }
@@ -9345,8 +9449,7 @@ var meetingRoom;
9345
9449
  * Limited to Microsoft-internal use
9346
9450
  */
9347
9451
  function isSupported() {
9348
- ensureInitialized();
9349
- return runtime.supports.meetingRoom ? true : false;
9452
+ return ensureInitialized(runtime) && runtime.supports.meetingRoom ? true : false;
9350
9453
  }
9351
9454
  meetingRoom.isSupported = isSupported;
9352
9455
  })(meetingRoom || (meetingRoom = {}));
@@ -9369,7 +9472,7 @@ var notifications;
9369
9472
  * Limited to Microsoft-internal use
9370
9473
  */
9371
9474
  function showNotification(showNotificationParameters) {
9372
- ensureInitialized(FrameContexts.content);
9475
+ ensureInitialized(runtime, FrameContexts.content);
9373
9476
  if (!isSupported()) {
9374
9477
  throw errorNotSupportedOnPlatform;
9375
9478
  }
@@ -9388,8 +9491,7 @@ var notifications;
9388
9491
  * Limited to Microsoft-internal use
9389
9492
  */
9390
9493
  function isSupported() {
9391
- ensureInitialized();
9392
- return runtime.supports.notifications ? true : false;
9494
+ return ensureInitialized(runtime) && runtime.supports.notifications ? true : false;
9393
9495
  }
9394
9496
  notifications.isSupported = isSupported;
9395
9497
  })(notifications || (notifications = {}));
@@ -9480,7 +9582,7 @@ var remoteCamera;
9480
9582
  if (!callback) {
9481
9583
  throw new Error('[remoteCamera.getCapableParticipants] Callback cannot be null');
9482
9584
  }
9483
- ensureInitialized(FrameContexts.sidePanel);
9585
+ ensureInitialized(runtime, FrameContexts.sidePanel);
9484
9586
  if (!isSupported()) {
9485
9587
  throw errorNotSupportedOnPlatform;
9486
9588
  }
@@ -9507,7 +9609,7 @@ var remoteCamera;
9507
9609
  if (!callback) {
9508
9610
  throw new Error('[remoteCamera.requestControl] Callback cannot be null');
9509
9611
  }
9510
- ensureInitialized(FrameContexts.sidePanel);
9612
+ ensureInitialized(runtime, FrameContexts.sidePanel);
9511
9613
  if (!isSupported()) {
9512
9614
  throw errorNotSupportedOnPlatform;
9513
9615
  }
@@ -9531,7 +9633,7 @@ var remoteCamera;
9531
9633
  if (!callback) {
9532
9634
  throw new Error('[remoteCamera.sendControlCommand] Callback cannot be null');
9533
9635
  }
9534
- ensureInitialized(FrameContexts.sidePanel);
9636
+ ensureInitialized(runtime, FrameContexts.sidePanel);
9535
9637
  if (!isSupported()) {
9536
9638
  throw errorNotSupportedOnPlatform;
9537
9639
  }
@@ -9551,7 +9653,7 @@ var remoteCamera;
9551
9653
  if (!callback) {
9552
9654
  throw new Error('[remoteCamera.terminateSession] Callback cannot be null');
9553
9655
  }
9554
- ensureInitialized(FrameContexts.sidePanel);
9656
+ ensureInitialized(runtime, FrameContexts.sidePanel);
9555
9657
  if (!isSupported()) {
9556
9658
  throw errorNotSupportedOnPlatform;
9557
9659
  }
@@ -9572,7 +9674,7 @@ var remoteCamera;
9572
9674
  if (!handler) {
9573
9675
  throw new Error('[remoteCamera.registerOnCapableParticipantsChangeHandler] Handler cannot be null');
9574
9676
  }
9575
- ensureInitialized(FrameContexts.sidePanel);
9677
+ ensureInitialized(runtime, FrameContexts.sidePanel);
9576
9678
  if (!isSupported()) {
9577
9679
  throw errorNotSupportedOnPlatform;
9578
9680
  }
@@ -9593,7 +9695,7 @@ var remoteCamera;
9593
9695
  if (!handler) {
9594
9696
  throw new Error('[remoteCamera.registerOnErrorHandler] Handler cannot be null');
9595
9697
  }
9596
- ensureInitialized(FrameContexts.sidePanel);
9698
+ ensureInitialized(runtime, FrameContexts.sidePanel);
9597
9699
  if (!isSupported()) {
9598
9700
  throw errorNotSupportedOnPlatform;
9599
9701
  }
@@ -9614,7 +9716,7 @@ var remoteCamera;
9614
9716
  if (!handler) {
9615
9717
  throw new Error('[remoteCamera.registerOnDeviceStateChangeHandler] Handler cannot be null');
9616
9718
  }
9617
- ensureInitialized(FrameContexts.sidePanel);
9719
+ ensureInitialized(runtime, FrameContexts.sidePanel);
9618
9720
  if (!isSupported()) {
9619
9721
  throw errorNotSupportedOnPlatform;
9620
9722
  }
@@ -9635,7 +9737,7 @@ var remoteCamera;
9635
9737
  if (!handler) {
9636
9738
  throw new Error('[remoteCamera.registerOnSessionStatusChangeHandler] Handler cannot be null');
9637
9739
  }
9638
- ensureInitialized(FrameContexts.sidePanel);
9740
+ ensureInitialized(runtime, FrameContexts.sidePanel);
9639
9741
  if (!isSupported()) {
9640
9742
  throw errorNotSupportedOnPlatform;
9641
9743
  }
@@ -9654,8 +9756,7 @@ var remoteCamera;
9654
9756
  * Limited to Microsoft-internal use
9655
9757
  */
9656
9758
  function isSupported() {
9657
- ensureInitialized();
9658
- return runtime.supports.remoteCamera ? true : false;
9759
+ return ensureInitialized(runtime) && runtime.supports.remoteCamera ? true : false;
9659
9760
  }
9660
9761
  remoteCamera.isSupported = isSupported;
9661
9762
  })(remoteCamera || (remoteCamera = {}));
@@ -9692,7 +9793,7 @@ var appEntity;
9692
9793
  * Limited to Microsoft-internal use
9693
9794
  */
9694
9795
  function selectAppEntity(threadId, categories, subEntityId, callback) {
9695
- ensureInitialized(FrameContexts.content);
9796
+ ensureInitialized(runtime, FrameContexts.content);
9696
9797
  if (!isSupported()) {
9697
9798
  throw errorNotSupportedOnPlatform;
9698
9799
  }
@@ -9717,8 +9818,7 @@ var appEntity;
9717
9818
  * Limited to Microsoft-internal use
9718
9819
  */
9719
9820
  function isSupported() {
9720
- ensureInitialized();
9721
- return runtime.supports.appEntity ? true : false;
9821
+ return ensureInitialized(runtime) && runtime.supports.appEntity ? true : false;
9722
9822
  }
9723
9823
  appEntity_1.isSupported = isSupported;
9724
9824
  })(appEntity || (appEntity = {}));
@@ -9756,7 +9856,7 @@ var teams;
9756
9856
  * Limited to Microsoft-internal use
9757
9857
  */
9758
9858
  function getTeamChannels(groupId, callback) {
9759
- ensureInitialized(FrameContexts.content);
9859
+ ensureInitialized(runtime, FrameContexts.content);
9760
9860
  if (!isSupported()) {
9761
9861
  throw errorNotSupportedOnPlatform;
9762
9862
  }
@@ -9781,7 +9881,7 @@ var teams;
9781
9881
  * Limited to Microsoft-internal use
9782
9882
  */
9783
9883
  function refreshSiteUrl(threadId, callback) {
9784
- ensureInitialized();
9884
+ ensureInitialized(runtime);
9785
9885
  if (!isSupported()) {
9786
9886
  throw errorNotSupportedOnPlatform;
9787
9887
  }
@@ -9806,8 +9906,7 @@ var teams;
9806
9906
  * Limited to Microsoft-internal use
9807
9907
  */
9808
9908
  function isSupported() {
9809
- ensureInitialized();
9810
- return runtime.supports.teams ? true : false;
9909
+ return ensureInitialized(runtime) && runtime.supports.teams ? true : false;
9811
9910
  }
9812
9911
  teams.isSupported = isSupported;
9813
9912
  /**
@@ -9836,7 +9935,7 @@ var teams;
9836
9935
  */
9837
9936
  function getUserJoinedTeams(teamInstanceParameters) {
9838
9937
  return new Promise(function (resolve) {
9839
- ensureInitialized();
9938
+ ensureInitialized(runtime);
9840
9939
  if (!isSupported()) {
9841
9940
  throw errorNotSupportedOnPlatform;
9842
9941
  }
@@ -9865,8 +9964,7 @@ var teams;
9865
9964
  * Limited to Microsoft-internal use
9866
9965
  */
9867
9966
  function isSupported() {
9868
- ensureInitialized();
9869
- return runtime.supports.teams
9967
+ return ensureInitialized(runtime) && runtime.supports.teams
9870
9968
  ? runtime.supports.teams.fullTrust
9871
9969
  ? runtime.supports.teams.fullTrust.joinedTeams
9872
9970
  ? true
@@ -9888,7 +9986,7 @@ var teams;
9888
9986
  */
9889
9987
  function getConfigSetting(key) {
9890
9988
  return new Promise(function (resolve) {
9891
- ensureInitialized();
9989
+ ensureInitialized(runtime);
9892
9990
  if (!isSupported()) {
9893
9991
  throw errorNotSupportedOnPlatform;
9894
9992
  }
@@ -9908,8 +10006,11 @@ var teams;
9908
10006
  * Limited to Microsoft-internal use
9909
10007
  */
9910
10008
  function isSupported() {
9911
- ensureInitialized();
9912
- return runtime.supports.teams ? (runtime.supports.teams.fullTrust ? true : false) : false;
10009
+ return ensureInitialized(runtime) && runtime.supports.teams
10010
+ ? runtime.supports.teams.fullTrust
10011
+ ? true
10012
+ : false
10013
+ : false;
9913
10014
  }
9914
10015
  fullTrust.isSupported = isSupported;
9915
10016
  })(fullTrust = teams.fullTrust || (teams.fullTrust = {}));
@@ -9921,6 +10022,7 @@ var teams;
9921
10022
 
9922
10023
 
9923
10024
 
10025
+
9924
10026
  /**
9925
10027
  * @hidden
9926
10028
  * Extended video API
@@ -9956,7 +10058,7 @@ var videoEx;
9956
10058
  * Limited to Microsoft-internal use
9957
10059
  */
9958
10060
  function registerForVideoFrame(frameCallback, config) {
9959
- ensureInitialized(FrameContexts.sidePanel);
10061
+ ensureInitialized(runtime, FrameContexts.sidePanel);
9960
10062
  if (!isSupported()) {
9961
10063
  throw errorNotSupportedOnPlatform;
9962
10064
  }
@@ -9985,7 +10087,7 @@ var videoEx;
9985
10087
  * Limited to Microsoft-internal use
9986
10088
  */
9987
10089
  function notifySelectedVideoEffectChanged(effectChangeType, effectId, effectParam) {
9988
- ensureInitialized(FrameContexts.sidePanel);
10090
+ ensureInitialized(runtime, FrameContexts.sidePanel);
9989
10091
  if (!isSupported()) {
9990
10092
  throw errorNotSupportedOnPlatform;
9991
10093
  }
@@ -10002,7 +10104,7 @@ var videoEx;
10002
10104
  * Limited to Microsoft-internal use
10003
10105
  */
10004
10106
  function registerForVideoEffect(callback) {
10005
- ensureInitialized(FrameContexts.sidePanel);
10107
+ ensureInitialized(runtime, FrameContexts.sidePanel);
10006
10108
  if (!isSupported()) {
10007
10109
  throw errorNotSupportedOnPlatform;
10008
10110
  }
@@ -10019,7 +10121,7 @@ var videoEx;
10019
10121
  * Limited to Microsoft-internal use
10020
10122
  */
10021
10123
  function updatePersonalizedEffects(effects) {
10022
- ensureInitialized(FrameContexts.sidePanel);
10124
+ ensureInitialized(runtime, FrameContexts.sidePanel);
10023
10125
  if (!video.isSupported()) {
10024
10126
  throw errorNotSupportedOnPlatform;
10025
10127
  }
@@ -10040,7 +10142,7 @@ var videoEx;
10040
10142
  * Limited to Microsoft-internal use
10041
10143
  */
10042
10144
  function isSupported() {
10043
- ensureInitialized();
10145
+ ensureInitialized(runtime);
10044
10146
  return video.isSupported();
10045
10147
  }
10046
10148
  videoEx.isSupported = isSupported;
@@ -10081,7 +10183,7 @@ var videoEx;
10081
10183
  * Limited to Microsoft-internal use
10082
10184
  */
10083
10185
  function notifyFatalError(errorMessage) {
10084
- ensureInitialized();
10186
+ ensureInitialized(runtime);
10085
10187
  if (!video.isSupported()) {
10086
10188
  throw errorNotSupportedOnPlatform;
10087
10189
  }