@microsoft/teams-js 2.4.0-beta.0 → 2.4.0-beta.2

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.
@@ -178,247 +178,6 @@ function plural(ms, msAbs, n, name) {
178
178
  }
179
179
 
180
180
 
181
- /***/ }),
182
-
183
- /***/ 22:
184
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
185
-
186
- var v1 = __webpack_require__(481);
187
- var v4 = __webpack_require__(426);
188
-
189
- var uuid = v4;
190
- uuid.v1 = v1;
191
- uuid.v4 = v4;
192
-
193
- module.exports = uuid;
194
-
195
-
196
- /***/ }),
197
-
198
- /***/ 725:
199
- /***/ ((module) => {
200
-
201
- /**
202
- * Convert array of 16 byte values to UUID string format of the form:
203
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
204
- */
205
- var byteToHex = [];
206
- for (var i = 0; i < 256; ++i) {
207
- byteToHex[i] = (i + 0x100).toString(16).substr(1);
208
- }
209
-
210
- function bytesToUuid(buf, offset) {
211
- var i = offset || 0;
212
- var bth = byteToHex;
213
- // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
214
- return ([
215
- bth[buf[i++]], bth[buf[i++]],
216
- bth[buf[i++]], bth[buf[i++]], '-',
217
- bth[buf[i++]], bth[buf[i++]], '-',
218
- bth[buf[i++]], bth[buf[i++]], '-',
219
- bth[buf[i++]], bth[buf[i++]], '-',
220
- bth[buf[i++]], bth[buf[i++]],
221
- bth[buf[i++]], bth[buf[i++]],
222
- bth[buf[i++]], bth[buf[i++]]
223
- ]).join('');
224
- }
225
-
226
- module.exports = bytesToUuid;
227
-
228
-
229
- /***/ }),
230
-
231
- /***/ 157:
232
- /***/ ((module) => {
233
-
234
- // Unique ID creation requires a high quality random # generator. In the
235
- // browser this is a little complicated due to unknown quality of Math.random()
236
- // and inconsistent support for the `crypto` API. We do the best we can via
237
- // feature-detection
238
-
239
- // getRandomValues needs to be invoked in a context where "this" is a Crypto
240
- // implementation. Also, find the complete implementation of crypto on IE11.
241
- var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
242
- (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
243
-
244
- if (getRandomValues) {
245
- // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
246
- var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
247
-
248
- module.exports = function whatwgRNG() {
249
- getRandomValues(rnds8);
250
- return rnds8;
251
- };
252
- } else {
253
- // Math.random()-based (RNG)
254
- //
255
- // If all else fails, use Math.random(). It's fast, but is of unspecified
256
- // quality.
257
- var rnds = new Array(16);
258
-
259
- module.exports = function mathRNG() {
260
- for (var i = 0, r; i < 16; i++) {
261
- if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
262
- rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
263
- }
264
-
265
- return rnds;
266
- };
267
- }
268
-
269
-
270
- /***/ }),
271
-
272
- /***/ 481:
273
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
274
-
275
- var rng = __webpack_require__(157);
276
- var bytesToUuid = __webpack_require__(725);
277
-
278
- // **`v1()` - Generate time-based UUID**
279
- //
280
- // Inspired by https://github.com/LiosK/UUID.js
281
- // and http://docs.python.org/library/uuid.html
282
-
283
- var _nodeId;
284
- var _clockseq;
285
-
286
- // Previous uuid creation time
287
- var _lastMSecs = 0;
288
- var _lastNSecs = 0;
289
-
290
- // See https://github.com/uuidjs/uuid for API details
291
- function v1(options, buf, offset) {
292
- var i = buf && offset || 0;
293
- var b = buf || [];
294
-
295
- options = options || {};
296
- var node = options.node || _nodeId;
297
- var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
298
-
299
- // node and clockseq need to be initialized to random values if they're not
300
- // specified. We do this lazily to minimize issues related to insufficient
301
- // system entropy. See #189
302
- if (node == null || clockseq == null) {
303
- var seedBytes = rng();
304
- if (node == null) {
305
- // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
306
- node = _nodeId = [
307
- seedBytes[0] | 0x01,
308
- seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
309
- ];
310
- }
311
- if (clockseq == null) {
312
- // Per 4.2.2, randomize (14 bit) clockseq
313
- clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
314
- }
315
- }
316
-
317
- // UUID timestamps are 100 nano-second units since the Gregorian epoch,
318
- // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
319
- // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
320
- // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
321
- var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
322
-
323
- // Per 4.2.1.2, use count of uuid's generated during the current clock
324
- // cycle to simulate higher resolution clock
325
- var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
326
-
327
- // Time since last uuid creation (in msecs)
328
- var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
329
-
330
- // Per 4.2.1.2, Bump clockseq on clock regression
331
- if (dt < 0 && options.clockseq === undefined) {
332
- clockseq = clockseq + 1 & 0x3fff;
333
- }
334
-
335
- // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
336
- // time interval
337
- if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
338
- nsecs = 0;
339
- }
340
-
341
- // Per 4.2.1.2 Throw error if too many uuids are requested
342
- if (nsecs >= 10000) {
343
- throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
344
- }
345
-
346
- _lastMSecs = msecs;
347
- _lastNSecs = nsecs;
348
- _clockseq = clockseq;
349
-
350
- // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
351
- msecs += 12219292800000;
352
-
353
- // `time_low`
354
- var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
355
- b[i++] = tl >>> 24 & 0xff;
356
- b[i++] = tl >>> 16 & 0xff;
357
- b[i++] = tl >>> 8 & 0xff;
358
- b[i++] = tl & 0xff;
359
-
360
- // `time_mid`
361
- var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
362
- b[i++] = tmh >>> 8 & 0xff;
363
- b[i++] = tmh & 0xff;
364
-
365
- // `time_high_and_version`
366
- b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
367
- b[i++] = tmh >>> 16 & 0xff;
368
-
369
- // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
370
- b[i++] = clockseq >>> 8 | 0x80;
371
-
372
- // `clock_seq_low`
373
- b[i++] = clockseq & 0xff;
374
-
375
- // `node`
376
- for (var n = 0; n < 6; ++n) {
377
- b[i + n] = node[n];
378
- }
379
-
380
- return buf ? buf : bytesToUuid(b);
381
- }
382
-
383
- module.exports = v1;
384
-
385
-
386
- /***/ }),
387
-
388
- /***/ 426:
389
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
390
-
391
- var rng = __webpack_require__(157);
392
- var bytesToUuid = __webpack_require__(725);
393
-
394
- function v4(options, buf, offset) {
395
- var i = buf && offset || 0;
396
-
397
- if (typeof(options) == 'string') {
398
- buf = options === 'binary' ? new Array(16) : null;
399
- options = null;
400
- }
401
- options = options || {};
402
-
403
- var rnds = options.random || (options.rng || rng)();
404
-
405
- // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
406
- rnds[6] = (rnds[6] & 0x0f) | 0x40;
407
- rnds[8] = (rnds[8] & 0x3f) | 0x80;
408
-
409
- // Copy bytes to buffer, if provided
410
- if (buf) {
411
- for (var ii = 0; ii < 16; ++ii) {
412
- buf[i + ii] = rnds[ii];
413
- }
414
- }
415
-
416
- return buf || bytesToUuid(rnds);
417
- }
418
-
419
- module.exports = v4;
420
-
421
-
422
181
  /***/ }),
423
182
 
424
183
  /***/ 227:
@@ -976,6 +735,25 @@ function setup(env) {
976
735
  module.exports = setup;
977
736
 
978
737
 
738
+ /***/ }),
739
+
740
+ /***/ 703:
741
+ /***/ ((module) => {
742
+
743
+ function webpackEmptyAsyncContext(req) {
744
+ // Here Promise.resolve().then() is used instead of new Promise() to prevent
745
+ // uncaught exception popping up in devtools
746
+ return Promise.resolve().then(() => {
747
+ var e = new Error("Cannot find module '" + req + "'");
748
+ e.code = 'MODULE_NOT_FOUND';
749
+ throw e;
750
+ });
751
+ }
752
+ webpackEmptyAsyncContext.keys = () => ([]);
753
+ webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
754
+ webpackEmptyAsyncContext.id = 703;
755
+ module.exports = webpackEmptyAsyncContext;
756
+
979
757
  /***/ })
980
758
 
981
759
  /******/ });
@@ -1080,6 +858,7 @@ __webpack_require__.d(__webpack_exports__, {
1080
858
  "getTabInstances": () => (/* reexport */ getTabInstances),
1081
859
  "initialize": () => (/* reexport */ initialize),
1082
860
  "initializeWithFrameContext": () => (/* reexport */ initializeWithFrameContext),
861
+ "liveShare": () => (/* reexport */ liveShare),
1083
862
  "location": () => (/* reexport */ location_location),
1084
863
  "logs": () => (/* reexport */ logs),
1085
864
  "mail": () => (/* reexport */ mail),
@@ -1130,7 +909,7 @@ __webpack_require__.d(__webpack_exports__, {
1130
909
  });
1131
910
 
1132
911
  ;// CONCATENATED MODULE: ./src/public/version.ts
1133
- var version = "2.4.0-beta.0";
912
+ var version = "2.4.0-beta.2";
1134
913
 
1135
914
  ;// CONCATENATED MODULE: ./src/internal/globalVars.ts
1136
915
  var GlobalVars = /** @class */ (function () {
@@ -1510,8 +1289,92 @@ var teamsDeepLinkProtocol = 'https';
1510
1289
  */
1511
1290
  var teamsDeepLinkHost = 'teams.microsoft.com';
1512
1291
 
1513
- // EXTERNAL MODULE: ../../node_modules/uuid/index.js
1514
- var uuid = __webpack_require__(22);
1292
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/rng.js
1293
+ // Unique ID creation requires a high quality random # generator. In the browser we therefore
1294
+ // require the crypto API and do not support built-in fallback to lower quality random number
1295
+ // generators (like Math.random()).
1296
+ var getRandomValues;
1297
+ var rnds8 = new Uint8Array(16);
1298
+ function rng() {
1299
+ // lazy load so that environments that need to polyfill have a chance to do so
1300
+ if (!getRandomValues) {
1301
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
1302
+ // find the complete implementation of crypto (msCrypto) on IE11.
1303
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
1304
+
1305
+ if (!getRandomValues) {
1306
+ throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
1307
+ }
1308
+ }
1309
+
1310
+ return getRandomValues(rnds8);
1311
+ }
1312
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/regex.js
1313
+ /* harmony default export */ const regex = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i);
1314
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/validate.js
1315
+
1316
+
1317
+ function validate(uuid) {
1318
+ return typeof uuid === 'string' && regex.test(uuid);
1319
+ }
1320
+
1321
+ /* harmony default export */ const esm_browser_validate = (validate);
1322
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/stringify.js
1323
+
1324
+ /**
1325
+ * Convert array of 16 byte values to UUID string format of the form:
1326
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
1327
+ */
1328
+
1329
+ var byteToHex = [];
1330
+
1331
+ for (var i = 0; i < 256; ++i) {
1332
+ byteToHex.push((i + 0x100).toString(16).substr(1));
1333
+ }
1334
+
1335
+ function stringify(arr) {
1336
+ var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1337
+ // Note: Be careful editing this code! It's been tuned for performance
1338
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
1339
+ var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
1340
+ // of the following:
1341
+ // - One or more input array values don't map to a hex octet (leading to
1342
+ // "undefined" in the uuid)
1343
+ // - Invalid input values for the RFC `version` or `variant` fields
1344
+
1345
+ if (!esm_browser_validate(uuid)) {
1346
+ throw TypeError('Stringified UUID is invalid');
1347
+ }
1348
+
1349
+ return uuid;
1350
+ }
1351
+
1352
+ /* harmony default export */ const esm_browser_stringify = (stringify);
1353
+ ;// CONCATENATED MODULE: ../../node_modules/uuid/dist/esm-browser/v4.js
1354
+
1355
+
1356
+
1357
+ function v4(options, buf, offset) {
1358
+ options = options || {};
1359
+ var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
1360
+
1361
+ rnds[6] = rnds[6] & 0x0f | 0x40;
1362
+ rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
1363
+
1364
+ if (buf) {
1365
+ offset = offset || 0;
1366
+
1367
+ for (var i = 0; i < 16; ++i) {
1368
+ buf[offset + i] = rnds[i];
1369
+ }
1370
+
1371
+ return buf;
1372
+ }
1373
+
1374
+ return esm_browser_stringify(rnds);
1375
+ }
1376
+
1377
+ /* harmony default export */ const esm_browser_v4 = (v4);
1515
1378
  ;// CONCATENATED MODULE: ./src/internal/utils.ts
1516
1379
  /* eslint-disable @typescript-eslint/ban-types */
1517
1380
  /* eslint-disable @typescript-eslint/no-unused-vars */
@@ -1639,7 +1502,7 @@ function compareSDKVersions(v1, v2) {
1639
1502
  * Limited to Microsoft-internal use
1640
1503
  */
1641
1504
  function generateGUID() {
1642
- return uuid.v4();
1505
+ return esm_browser_v4();
1643
1506
  }
1644
1507
  /**
1645
1508
  * @internal
@@ -1970,16 +1833,13 @@ function getLogger(namespace) {
1970
1833
  */
1971
1834
  var authentication;
1972
1835
  (function (authentication) {
1973
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
1974
1836
  var authHandlers;
1975
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
1976
1837
  var authWindowMonitor;
1977
1838
  function initialize() {
1978
1839
  registerHandler('authentication.authenticate.success', handleSuccess, false);
1979
1840
  registerHandler('authentication.authenticate.failure', handleFailure, false);
1980
1841
  }
1981
1842
  authentication.initialize = initialize;
1982
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
1983
1843
  var authParams;
1984
1844
  /**
1985
1845
  * @deprecated
@@ -1994,8 +1854,9 @@ var authentication;
1994
1854
  authentication.registerAuthenticationHandlers = registerAuthenticationHandlers;
1995
1855
  function authenticate(authenticateParameters) {
1996
1856
  var isDifferentParamsInCall = authenticateParameters !== undefined;
1997
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
1998
- var authenticateParams = isDifferentParamsInCall ? authenticateParameters : authParams;
1857
+ var authenticateParams = isDifferentParamsInCall
1858
+ ? authenticateParameters
1859
+ : authParams;
1999
1860
  if (!authenticateParams) {
2000
1861
  throw new Error('No parameters are provided for authentication');
2001
1862
  }
@@ -2380,10 +2241,11 @@ var runtime = {
2380
2241
  notifications: undefined,
2381
2242
  pages: {
2382
2243
  appButton: undefined,
2383
- tabs: undefined,
2384
- config: undefined,
2385
2244
  backStack: undefined,
2245
+ config: undefined,
2246
+ currentApp: undefined,
2386
2247
  fullTrust: undefined,
2248
+ tabs: undefined,
2387
2249
  },
2388
2250
  people: undefined,
2389
2251
  permissions: undefined,
@@ -2622,7 +2484,7 @@ var dialog;
2622
2484
  * Submit the dialog module and close the dialog
2623
2485
  *
2624
2486
  * @param result - The result to be sent to the bot or the app. Typically a JSON object or a serialized version of it
2625
- * @param appIds - Helps to validate that the call originates from the same appId as the one that invoked the task module
2487
+ * @param appIds - Valid application(s) that can receive the result of the submitted dialogs. Specifying this parameter helps prevent malicious apps from retrieving the dialog result. Multiple app IDs can be specified because a web app from a single underlying domain can power multiple apps across different environments and branding schemes.
2626
2488
  */
2627
2489
  function submit(result, appIds) {
2628
2490
  ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.task, FrameContexts.meetingStage);
@@ -2865,11 +2727,9 @@ var menus;
2865
2727
  MenuListType["dropDown"] = "dropDown";
2866
2728
  MenuListType["popOver"] = "popOver";
2867
2729
  })(MenuListType = menus.MenuListType || (menus.MenuListType = {}));
2868
- /* eslint-disable strict-null-checks/all */ /* Fix tracked by 5730662 */
2869
2730
  var navBarMenuItemPressHandler;
2870
2731
  var actionMenuItemPressHandler;
2871
2732
  var viewConfigItemPressHandler;
2872
- /* eslint-enable strict-null-checks/all */ /* Fix tracked by 5730662 */
2873
2733
  function initialize() {
2874
2734
  registerHandler('navBarMenuItemPress', handleNavBarMenuItemPress, false);
2875
2735
  registerHandler('actionMenuItemPress', handleActionMenuItemPress, false);
@@ -3174,8 +3034,7 @@ var app_app;
3174
3034
  * Initializes the library.
3175
3035
  *
3176
3036
  * @remarks
3177
- * This must be called before any other SDK calls
3178
- * but after the frame is loaded successfully.
3037
+ * Initialize must have completed successfully (as determined by the resolved Promise) before any other library calls are made
3179
3038
  *
3180
3039
  * @param validMessageOrigins - Optionally specify a list of cross frame message origins. They must have
3181
3040
  * https: protocol otherwise they will be ignored. Example: https:www.example.com
@@ -3209,9 +3068,8 @@ var app_app;
3209
3068
  // After Teams updates its client code, we can remove this default code.
3210
3069
  try {
3211
3070
  initializeHelperLogger('Parsing %s', runtimeConfig);
3212
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
3213
3071
  var givenRuntimeConfig = JSON.parse(runtimeConfig);
3214
- initializeHelperLogger('Checking if %o is a valid runtime object', givenRuntimeConfig);
3072
+ initializeHelperLogger('Checking if %o is a valid runtime object', givenRuntimeConfig !== null && givenRuntimeConfig !== void 0 ? givenRuntimeConfig : 'null');
3215
3073
  // Check that givenRuntimeConfig is a valid instance of IRuntimeConfig
3216
3074
  if (!givenRuntimeConfig || !givenRuntimeConfig.apiVersion) {
3217
3075
  throw new Error('Received runtime config is invalid');
@@ -3229,9 +3087,14 @@ var app_app;
3229
3087
  if (!isNaN(compareSDKVersions(runtimeConfig, defaultSDKVersionForCompatCheck))) {
3230
3088
  GlobalVars.clientSupportedSDKVersion = runtimeConfig;
3231
3089
  }
3232
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
3233
3090
  var givenRuntimeConfig = JSON.parse(clientSupportedSDKVersion);
3234
- clientSupportedSDKVersion && applyRuntimeConfig(givenRuntimeConfig);
3091
+ initializeHelperLogger('givenRuntimeConfig parsed to %o', givenRuntimeConfig !== null && givenRuntimeConfig !== void 0 ? givenRuntimeConfig : 'null');
3092
+ if (!givenRuntimeConfig) {
3093
+ throw new Error('givenRuntimeConfig string was successfully parsed. However, it parsed to value of null');
3094
+ }
3095
+ else {
3096
+ applyRuntimeConfig(givenRuntimeConfig);
3097
+ }
3235
3098
  }
3236
3099
  catch (e) {
3237
3100
  if (e instanceof SyntaxError) {
@@ -3733,9 +3596,7 @@ var pages;
3733
3596
  */
3734
3597
  var config;
3735
3598
  (function (config) {
3736
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
3737
3599
  var saveHandler;
3738
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
3739
3600
  var removeHandler;
3740
3601
  /**
3741
3602
  * @hidden
@@ -3945,7 +3806,6 @@ var pages;
3945
3806
  */
3946
3807
  var backStack;
3947
3808
  (function (backStack) {
3948
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
3949
3809
  var backButtonPressHandler;
3950
3810
  function _initialize() {
3951
3811
  registerHandler('backButtonPress', handleBackButtonPress, false);
@@ -4002,7 +3862,13 @@ var pages;
4002
3862
  backStack.registerBackButtonHandlerHelper = registerBackButtonHandlerHelper;
4003
3863
  function handleBackButtonPress() {
4004
3864
  if (!backButtonPressHandler || !backButtonPressHandler()) {
4005
- navigateBack();
3865
+ if (Communication.childWindow) {
3866
+ // If the current window did not handle it let the child window
3867
+ sendMessageEventToChild('backButtonPress', []);
3868
+ }
3869
+ else {
3870
+ navigateBack();
3871
+ }
4006
3872
  }
4007
3873
  }
4008
3874
  /**
@@ -4118,6 +3984,58 @@ var pages;
4118
3984
  }
4119
3985
  appButton.isSupported = isSupported;
4120
3986
  })(appButton = pages.appButton || (pages.appButton = {}));
3987
+ /**
3988
+ * Provides functions for navigating without needing to specify your application ID.
3989
+ *
3990
+ * @beta
3991
+ */
3992
+ var currentApp;
3993
+ (function (currentApp) {
3994
+ /**
3995
+ * Navigate within the currently running application with page ID, and sub-page ID (for navigating to
3996
+ * specific content within the page).
3997
+ * @param params - Parameters for the navigation
3998
+ * @returns a promise that will resolve if the navigation was successful
3999
+ *
4000
+ * @beta
4001
+ */
4002
+ function navigateTo(params) {
4003
+ return new Promise(function (resolve) {
4004
+ ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4005
+ if (!isSupported()) {
4006
+ throw errorNotSupportedOnPlatform;
4007
+ }
4008
+ resolve(sendAndHandleSdkError('pages.currentApp.navigateTo', params));
4009
+ });
4010
+ }
4011
+ currentApp.navigateTo = navigateTo;
4012
+ /**
4013
+ * Navigate to the currently running application's first static page defined in the application
4014
+ * manifest.
4015
+ * @beta
4016
+ */
4017
+ function navigateToDefaultPage() {
4018
+ return new Promise(function (resolve) {
4019
+ ensureInitialized(FrameContexts.content, FrameContexts.sidePanel, FrameContexts.settings, FrameContexts.task, FrameContexts.stage, FrameContexts.meetingStage);
4020
+ if (!isSupported()) {
4021
+ throw errorNotSupportedOnPlatform;
4022
+ }
4023
+ resolve(sendAndHandleSdkError('pages.currentApp.navigateToDefaultPage'));
4024
+ });
4025
+ }
4026
+ currentApp.navigateToDefaultPage = navigateToDefaultPage;
4027
+ /**
4028
+ * Checks if pages.currentApp capability is supported by the host
4029
+ * @returns true if the pages.currentApp capability is enabled in runtime.supports.pages.currentApp and
4030
+ * false if it is disabled
4031
+ *
4032
+ * @beta
4033
+ */
4034
+ function isSupported() {
4035
+ return runtime.supports.pages ? (runtime.supports.pages.currentApp ? true : false) : false;
4036
+ }
4037
+ currentApp.isSupported = isSupported;
4038
+ })(currentApp = pages.currentApp || (pages.currentApp = {}));
4121
4039
  })(pages || (pages = {}));
4122
4040
 
4123
4041
  ;// CONCATENATED MODULE: ./src/internal/handlers.ts
@@ -4169,6 +4087,10 @@ function callHandler(name, args) {
4169
4087
  var result = handler.apply(this, args);
4170
4088
  return [true, result];
4171
4089
  }
4090
+ else if (Communication.childWindow) {
4091
+ sendMessageEventToChild(name, [args]);
4092
+ return [false, undefined];
4093
+ }
4172
4094
  else {
4173
4095
  callHandlerLogger('Handler for action message %s not found.', name);
4174
4096
  return [false, undefined];
@@ -4279,7 +4201,12 @@ function handleBeforeUnload() {
4279
4201
  sendMessageToParent('readyToUnload', []);
4280
4202
  };
4281
4203
  if (!HandlersPrivate.beforeUnloadHandler || !HandlersPrivate.beforeUnloadHandler(readyToUnload)) {
4282
- readyToUnload();
4204
+ if (Communication.childWindow) {
4205
+ sendMessageEventToChild('beforeUnload');
4206
+ }
4207
+ else {
4208
+ readyToUnload();
4209
+ }
4283
4210
  }
4284
4211
  }
4285
4212
 
@@ -5725,7 +5652,6 @@ function createFile(assembleAttachment, mimeType) {
5725
5652
  if (assembleAttachment == null || mimeType == null || assembleAttachment.length <= 0) {
5726
5653
  return null;
5727
5654
  }
5728
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
5729
5655
  var file;
5730
5656
  var sequence = 1;
5731
5657
  assembleAttachment.sort(function (a, b) { return (a.sequence > b.sequence ? 1 : -1); });
@@ -6694,7 +6620,6 @@ var monetization;
6694
6620
  * @returns Promise that will be resolved when the operation has completed or rejected with SdkError value
6695
6621
  */
6696
6622
  function openPurchaseExperience(param1, param2) {
6697
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6698
6623
  var callback;
6699
6624
  /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
6700
6625
  var planInfo;
@@ -7245,7 +7170,6 @@ var sharing;
7245
7170
  }
7246
7171
  }
7247
7172
  function validateTypeConsistency(shareRequest) {
7248
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
7249
7173
  var err;
7250
7174
  if (shareRequest.content.some(function (item) { return !item.type; })) {
7251
7175
  err = {
@@ -7263,7 +7187,6 @@ var sharing;
7263
7187
  }
7264
7188
  }
7265
7189
  function validateContentForSupportedTypes(shareRequest) {
7266
- /* eslint-disable-next-line strict-null-checks/all */ /* Fix tracked by 5730662 */
7267
7190
  var err;
7268
7191
  if (shareRequest.content[0].type === 'URL') {
7269
7192
  if (shareRequest.content.some(function (item) { return !item.url; })) {
@@ -8125,7 +8048,7 @@ var tasks;
8125
8048
  * Submit the task module.
8126
8049
  *
8127
8050
  * @param result - Contains the result to be sent to the bot or the app. Typically a JSON object or a serialized version of it
8128
- * @param appIds - Helps to validate that the call originates from the same appId as the one that invoked the task module
8051
+ * @param appIds - Valid application(s) that can receive the result of the submitted dialogs. Specifying this parameter helps prevent malicious apps from retrieving the dialog result. Multiple app IDs can be specified because a web app from a single underlying domain can power multiple apps across different environments and branding schemes.
8129
8052
  */
8130
8053
  function submitTask(result, appIds) {
8131
8054
  dialog.submit(result, appIds);
@@ -8182,6 +8105,302 @@ var tasks;
8182
8105
  tasks.getDefaultSizeIfNotProvided = getDefaultSizeIfNotProvided;
8183
8106
  })(tasks || (tasks = {}));
8184
8107
 
8108
+ ;// CONCATENATED MODULE: ./src/internal/liveShareHost.ts
8109
+
8110
+
8111
+
8112
+ /**
8113
+ * @hidden
8114
+ * @internal
8115
+ * Limited to Microsoft-internal use
8116
+ * ------
8117
+ * Allowed roles during a meeting.
8118
+ */
8119
+ var UserMeetingRole;
8120
+ (function (UserMeetingRole) {
8121
+ UserMeetingRole["guest"] = "Guest";
8122
+ UserMeetingRole["attendee"] = "Attendee";
8123
+ UserMeetingRole["presenter"] = "Presenter";
8124
+ UserMeetingRole["organizer"] = "Organizer";
8125
+ })(UserMeetingRole || (UserMeetingRole = {}));
8126
+ /**
8127
+ * @hidden
8128
+ * @internal
8129
+ * Limited to Microsoft-internal use
8130
+ * ------
8131
+ * State of the current Live Share sessions backing fluid container.
8132
+ */
8133
+ var ContainerState;
8134
+ (function (ContainerState) {
8135
+ /**
8136
+ * The call to `LiveShareHost.setContainerId()` successfully created the container mapping
8137
+ * for the current Live Share session.
8138
+ */
8139
+ ContainerState["added"] = "Added";
8140
+ /**
8141
+ * A container mapping for the current Live Share Session already exists and should be used
8142
+ * when joining the sessions Fluid container.
8143
+ */
8144
+ ContainerState["alreadyExists"] = "AlreadyExists";
8145
+ /**
8146
+ * The call to `LiveShareHost.setContainerId()` failed to create the container mapping due to
8147
+ * another client having already set the container ID for the current Live Share session.
8148
+ */
8149
+ ContainerState["conflict"] = "Conflict";
8150
+ /**
8151
+ * A container mapping for the current Live Share session doesn't exist yet.
8152
+ */
8153
+ ContainerState["notFound"] = "NotFound";
8154
+ })(ContainerState || (ContainerState = {}));
8155
+ /**
8156
+ * @hidden
8157
+ * @internal
8158
+ * Limited to Microsoft-internal use
8159
+ * ------
8160
+ * Interface for hosting a Live Share session within a client like Teams.
8161
+ */
8162
+ var LiveShareHost = /** @class */ (function () {
8163
+ function LiveShareHost() {
8164
+ }
8165
+ /**
8166
+ * @hidden
8167
+ * @internal
8168
+ * Limited to Microsoft-internal use
8169
+ * ------
8170
+ * Returns the Fluid Tenant connection info for user's current context.
8171
+ */
8172
+ LiveShareHost.prototype.getFluidTenantInfo = function () {
8173
+ return new Promise(function (resolve) {
8174
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8175
+ resolve(sendAndHandleSdkError('interactive.getFluidTenantInfo'));
8176
+ });
8177
+ };
8178
+ /**
8179
+ * @hidden
8180
+ * @internal
8181
+ * Limited to Microsoft-internal use
8182
+ * ------
8183
+ * Returns the fluid access token for mapped container Id.
8184
+ *
8185
+ * @param containerId Fluid's container Id for the request. Undefined for new containers.
8186
+ * @returns token for connecting to Fluid's session.
8187
+ */
8188
+ LiveShareHost.prototype.getFluidToken = function (containerId) {
8189
+ return new Promise(function (resolve) {
8190
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8191
+ // eslint-disable-next-line strict-null-checks/all
8192
+ resolve(sendAndHandleSdkError('interactive.getFluidToken', containerId));
8193
+ });
8194
+ };
8195
+ /**
8196
+ * @hidden
8197
+ * @internal
8198
+ * Limited to Microsoft-internal use
8199
+ * ------
8200
+ * Returns the ID of the fluid container associated with the user's current context.
8201
+ */
8202
+ LiveShareHost.prototype.getFluidContainerId = function () {
8203
+ return new Promise(function (resolve) {
8204
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8205
+ resolve(sendAndHandleSdkError('interactive.getFluidContainerId'));
8206
+ });
8207
+ };
8208
+ /**
8209
+ * @hidden
8210
+ * @internal
8211
+ * Limited to Microsoft-internal use
8212
+ * ------
8213
+ * Sets the ID of the fluid container associated with the current context.
8214
+ *
8215
+ * @remarks
8216
+ * If this returns false, the client should delete the container they created and then call
8217
+ * `getFluidContainerId()` to get the ID of the container being used.
8218
+ * @param containerId ID of the fluid container the client created.
8219
+ * @returns A data structure with a `containerState` indicating the success or failure of the request.
8220
+ */
8221
+ LiveShareHost.prototype.setFluidContainerId = function (containerId) {
8222
+ return new Promise(function (resolve) {
8223
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8224
+ resolve(sendAndHandleSdkError('interactive.setFluidContainerId', containerId));
8225
+ });
8226
+ };
8227
+ /**
8228
+ * @hidden
8229
+ * @internal
8230
+ * Limited to Microsoft-internal use
8231
+ * ------
8232
+ * Returns the shared clock server's current time.
8233
+ */
8234
+ LiveShareHost.prototype.getNtpTime = function () {
8235
+ return new Promise(function (resolve) {
8236
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8237
+ resolve(sendAndHandleSdkError('interactive.getNtpTime'));
8238
+ });
8239
+ };
8240
+ /**
8241
+ * @hidden
8242
+ * @internal
8243
+ * Limited to Microsoft-internal use
8244
+ * ------
8245
+ * Associates the fluid client ID with a set of user roles.
8246
+ *
8247
+ * @param clientId The ID for the current user's Fluid client. Changes on reconnects.
8248
+ * @returns The roles for the current user.
8249
+ */
8250
+ LiveShareHost.prototype.registerClientId = function (clientId) {
8251
+ return new Promise(function (resolve) {
8252
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8253
+ resolve(sendAndHandleSdkError('interactive.registerClientId', clientId));
8254
+ });
8255
+ };
8256
+ /**
8257
+ * @hidden
8258
+ * @internal
8259
+ * Limited to Microsoft-internal use
8260
+ * ------
8261
+ * Returns the roles associated with a client ID.
8262
+ *
8263
+ * @param clientId The Client ID the message was received from.
8264
+ * @returns The roles for a given client. Returns `undefined` if the client ID hasn't been registered yet.
8265
+ */
8266
+ LiveShareHost.prototype.getClientRoles = function (clientId) {
8267
+ return new Promise(function (resolve) {
8268
+ ensureInitialized(FrameContexts.meetingStage, FrameContexts.sidePanel);
8269
+ resolve(sendAndHandleSdkError('interactive.getClientRoles', clientId));
8270
+ });
8271
+ };
8272
+ return LiveShareHost;
8273
+ }());
8274
+
8275
+
8276
+ ;// CONCATENATED MODULE: ./src/public/liveShare.ts
8277
+ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
8278
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
8279
+ return new (P || (P = Promise))(function (resolve, reject) {
8280
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8281
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8282
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8283
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8284
+ });
8285
+ };
8286
+ var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
8287
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
8288
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
8289
+ function verb(n) { return function (v) { return step([n, v]); }; }
8290
+ function step(op) {
8291
+ if (f) throw new TypeError("Generator is already executing.");
8292
+ while (_) try {
8293
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
8294
+ if (y = 0, t) op = [op[0] & 2, t.value];
8295
+ switch (op[0]) {
8296
+ case 0: case 1: t = op; break;
8297
+ case 4: _.label++; return { value: op[1], done: false };
8298
+ case 5: _.label++; y = op[1]; op = [0]; continue;
8299
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
8300
+ default:
8301
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
8302
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
8303
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
8304
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
8305
+ if (t[2]) _.ops.pop();
8306
+ _.trys.pop(); continue;
8307
+ }
8308
+ op = body.call(thisArg, _);
8309
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
8310
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
8311
+ }
8312
+ };
8313
+
8314
+ /**
8315
+ * Namespace to interact with the Live Share module-specific part of the SDK.
8316
+ *
8317
+ * @beta
8318
+ */
8319
+ var liveShare;
8320
+ (function (liveShare) {
8321
+ var LIVE_SHARE_PACKAGE = '@microsoft/live-share';
8322
+ var LIVE_SHARE_HOST = new LiveShareHost();
8323
+ var client;
8324
+ var initializing = false;
8325
+ /**
8326
+ * Initializes the Live Share client.
8327
+ * @param options Optional. Configuration options passed to the Live Share client.
8328
+ *
8329
+ * @beta
8330
+ */
8331
+ function initialize(options) {
8332
+ return __awaiter(this, void 0, void 0, function () {
8333
+ var pkg, err_1;
8334
+ return __generator(this, function (_a) {
8335
+ switch (_a.label) {
8336
+ case 0:
8337
+ if (initializing || client) {
8338
+ throw new Error('Live Share has already been initialized.');
8339
+ }
8340
+ _a.label = 1;
8341
+ case 1:
8342
+ _a.trys.push([1, 3, 4, 5]);
8343
+ initializing = true;
8344
+ return [4 /*yield*/, __webpack_require__(703)(LIVE_SHARE_PACKAGE)];
8345
+ case 2:
8346
+ pkg = (_a.sent());
8347
+ client = new pkg.LiveShareClient(options, LIVE_SHARE_HOST);
8348
+ return [3 /*break*/, 5];
8349
+ case 3:
8350
+ err_1 = _a.sent();
8351
+ throw new Error('Unable to initialize Live Share client. Ensure that your project includes "@microsoft/live-share"');
8352
+ case 4:
8353
+ initializing = false;
8354
+ return [7 /*endfinally*/];
8355
+ case 5: return [2 /*return*/];
8356
+ }
8357
+ });
8358
+ });
8359
+ }
8360
+ liveShare.initialize = initialize;
8361
+ /**
8362
+ * Connects to the fluid container for the current teams context.
8363
+ *
8364
+ * @remarks
8365
+ * The first client joining the container will create the container resulting in the
8366
+ * `onContainerFirstCreated` callback being called. This callback can be used to set the initial
8367
+ * state of of the containers object prior to the container being attached.
8368
+ * @param fluidContainerSchema Fluid objects to create.
8369
+ * @param onContainerFirstCreated Optional. Callback that's called when the container is first created.
8370
+ * @returns The fluid `container` and `services` objects to use along with a `created` flag that if true means the container had to be created.
8371
+ *
8372
+ * @beta
8373
+ */
8374
+ function joinContainer(fluidContainerSchema, onContainerFirstCreated) {
8375
+ return __awaiter(this, void 0, void 0, function () {
8376
+ return __generator(this, function (_a) {
8377
+ switch (_a.label) {
8378
+ case 0:
8379
+ if (!client) return [3 /*break*/, 2];
8380
+ return [4 /*yield*/, client.joinContainer(fluidContainerSchema, onContainerFirstCreated)];
8381
+ case 1: return [2 /*return*/, _a.sent()];
8382
+ case 2: throw new Error('Live Share must first be initialized');
8383
+ }
8384
+ });
8385
+ });
8386
+ }
8387
+ liveShare.joinContainer = joinContainer;
8388
+ /**
8389
+ * @hidden
8390
+ * Hide from docs
8391
+ * ------
8392
+ * Returns the LiveShareHost object. Called by existing apps that use the TeamsFluidClient
8393
+ * directly. This prevents existing apps from breaking and will be removed when Live Share
8394
+ * goes GA.
8395
+ *
8396
+ * @beta
8397
+ */
8398
+ function getHost() {
8399
+ return LIVE_SHARE_HOST;
8400
+ }
8401
+ liveShare.getHost = getHost;
8402
+ })(liveShare || (liveShare = {}));
8403
+
8185
8404
  ;// CONCATENATED MODULE: ./src/public/index.ts
8186
8405
 
8187
8406
 
@@ -8214,6 +8433,7 @@ var tasks;
8214
8433
 
8215
8434
 
8216
8435
 
8436
+
8217
8437
 
8218
8438
 
8219
8439