@microsoft/teams-js 2.48.0 → 2.49.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.
- package/README.md +4 -4
- package/dist/esm/_virtual/_polyfill-node.buffer.js +1 -1
- package/dist/esm/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js +1 -0
- package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/browser.js +1 -1
- package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/common.js +1 -1
- package/dist/esm/node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v4.js +1 -1
- package/dist/esm/packages/teams-js/dts/internal/constants.d.ts +0 -8
- package/dist/esm/packages/teams-js/dts/internal/urlPattern.d.ts +47 -0
- package/dist/esm/packages/teams-js/dts/public/app/app.d.ts +14 -1
- package/dist/esm/packages/teams-js/dts/public/stageView/stageView.d.ts +1 -1
- package/dist/esm/packages/teams-js/src/artifactsForCDN/validDomains.json.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/appHelpers.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/childCommunication.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/communication.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/constants.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/deepLinkUtilities.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/dialogHelpers.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/handlers.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/idValidation.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/internalAPIs.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/marketplaceUtils.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/mediaUtil.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/messageObjects.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/pagesHelpers.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/urlPattern.js +1 -0
- package/dist/esm/packages/teams-js/src/internal/utils.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/validOrigins.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/videoEffectsUtils.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/videoFrameTick.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/videoPerformanceMonitor.js +1 -1
- package/dist/esm/packages/teams-js/src/internal/webStorageHelpers.js +1 -1
- package/dist/esm/packages/teams-js/src/private/conversations.js +1 -1
- package/dist/esm/packages/teams-js/src/private/copilot/customTelemetry.js +1 -1
- package/dist/esm/packages/teams-js/src/private/copilot/eligibility.js +1 -1
- package/dist/esm/packages/teams-js/src/private/copilot/sidePanel.js +1 -1
- package/dist/esm/packages/teams-js/src/private/copilot/view.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppAuthentication.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppAuthenticationForCEA.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppCardActions.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppCardActionsForCEA.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppCardActionsForDA.js +1 -1
- package/dist/esm/packages/teams-js/src/private/externalAppCommands.js +1 -1
- package/dist/esm/packages/teams-js/src/private/hostEntity/tab.js +1 -1
- package/dist/esm/packages/teams-js/src/private/logs.js +1 -1
- package/dist/esm/packages/teams-js/src/private/meetingRoom.js +1 -1
- package/dist/esm/packages/teams-js/src/private/messageChannels/dataLayer.js +1 -1
- package/dist/esm/packages/teams-js/src/private/messageChannels/telemetry.js +1 -1
- package/dist/esm/packages/teams-js/src/private/privateAPIs.js +1 -1
- package/dist/esm/packages/teams-js/src/private/store.js +1 -1
- package/dist/esm/packages/teams-js/src/private/teams/fullTrust/fullTrust.js +1 -1
- package/dist/esm/packages/teams-js/src/private/teams/fullTrust/joinedTeams.js +1 -1
- package/dist/esm/packages/teams-js/src/private/videoEffectsEx.js +1 -1
- package/dist/esm/packages/teams-js/src/private/widgetHosting/widgetHosting.js +1 -1
- package/dist/esm/packages/teams-js/src/public/app/app.js +1 -1
- package/dist/esm/packages/teams-js/src/public/appInstallDialog.js +1 -1
- package/dist/esm/packages/teams-js/src/public/authentication.js +1 -1
- package/dist/esm/packages/teams-js/src/public/barCode.js +1 -1
- package/dist/esm/packages/teams-js/src/public/calendar.js +1 -1
- package/dist/esm/packages/teams-js/src/public/call.js +1 -1
- package/dist/esm/packages/teams-js/src/public/chat.js +1 -1
- package/dist/esm/packages/teams-js/src/public/clipboard.js +1 -1
- package/dist/esm/packages/teams-js/src/public/dialog/adaptiveCard/adaptiveCard.js +1 -1
- package/dist/esm/packages/teams-js/src/public/dialog/adaptiveCard/bot.js +1 -1
- package/dist/esm/packages/teams-js/src/public/dialog/url/parentCommunication.js +1 -1
- package/dist/esm/packages/teams-js/src/public/geoLocation/geoLocation.js +1 -1
- package/dist/esm/packages/teams-js/src/public/liveShareHost.js +1 -1
- package/dist/esm/packages/teams-js/src/public/mail/handoff.js +1 -1
- package/dist/esm/packages/teams-js/src/public/mail/mail.js +1 -1
- package/dist/esm/packages/teams-js/src/public/media.js +1 -1
- package/dist/esm/packages/teams-js/src/public/meeting/meeting.js +1 -1
- package/dist/esm/packages/teams-js/src/public/monetization.js +1 -1
- package/dist/esm/packages/teams-js/src/public/navigation.js +1 -1
- package/dist/esm/packages/teams-js/src/public/nestedAppAuth.js +1 -1
- package/dist/esm/packages/teams-js/src/public/pages/appButton.js +1 -1
- package/dist/esm/packages/teams-js/src/public/pages/backStack.js +1 -1
- package/dist/esm/packages/teams-js/src/public/pages/config.js +1 -1
- package/dist/esm/packages/teams-js/src/public/pages/currentApp.js +1 -1
- package/dist/esm/packages/teams-js/src/public/pages/pages.js +1 -1
- package/dist/esm/packages/teams-js/src/public/people.js +1 -1
- package/dist/esm/packages/teams-js/src/public/profile.js +1 -1
- package/dist/esm/packages/teams-js/src/public/publicAPIs.js +1 -1
- package/dist/esm/packages/teams-js/src/public/runtime.js +1 -1
- package/dist/esm/packages/teams-js/src/public/search.js +1 -1
- package/dist/esm/packages/teams-js/src/public/settings.js +1 -1
- package/dist/esm/packages/teams-js/src/public/sharing/history.js +1 -1
- package/dist/esm/packages/teams-js/src/public/sharing/sharing.js +1 -1
- package/dist/esm/packages/teams-js/src/public/shortcutRelay.js +1 -1
- package/dist/esm/packages/teams-js/src/public/stageView/self.js +1 -1
- package/dist/esm/packages/teams-js/src/public/stageView/stageView.js +1 -1
- package/dist/esm/packages/teams-js/src/public/tasks.js +1 -1
- package/dist/esm/packages/teams-js/src/public/teamsAPIs.js +1 -1
- package/dist/esm/packages/teams-js/src/public/thirdPartyCloudStorage.js +1 -1
- package/dist/esm/packages/teams-js/src/public/uuidObject.js +1 -1
- package/dist/esm/packages/teams-js/src/public/version.js +1 -1
- package/dist/esm/packages/teams-js/src/public/videoEffects.js +1 -1
- package/dist/esm/packages/teams-js/src/public/visualMedia/image.js +1 -1
- package/dist/esm/packages/teams-js/src/public/webStorage.js +1 -1
- package/dist/umd/MicrosoftTeams.js +669 -595
- package/dist/umd/MicrosoftTeams.js.map +1 -1
- package/dist/umd/MicrosoftTeams.min.js +1 -1
- package/dist/umd/MicrosoftTeams.min.js.map +1 -1
- package/package.json +1 -53
- package/dist/esm/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js +0 -1
|
@@ -7,446 +7,12 @@
|
|
|
7
7
|
exports["microsoftTeams"] = factory();
|
|
8
8
|
else
|
|
9
9
|
root["microsoftTeams"] = factory();
|
|
10
|
-
})(typeof self !== 'undefined' ? self : this, () => {
|
|
10
|
+
})(Object(typeof self !== 'undefined' ? self : this), () => {
|
|
11
11
|
return /******/ (() => { // webpackBootstrap
|
|
12
12
|
/******/ var __webpack_modules__ = ({
|
|
13
13
|
|
|
14
|
-
/***/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"use strict";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
exports.byteLength = byteLength
|
|
21
|
-
exports.toByteArray = toByteArray
|
|
22
|
-
exports.fromByteArray = fromByteArray
|
|
23
|
-
|
|
24
|
-
var lookup = []
|
|
25
|
-
var revLookup = []
|
|
26
|
-
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
|
|
27
|
-
|
|
28
|
-
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
|
|
29
|
-
for (var i = 0, len = code.length; i < len; ++i) {
|
|
30
|
-
lookup[i] = code[i]
|
|
31
|
-
revLookup[code.charCodeAt(i)] = i
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Support decoding URL-safe base64 strings, as Node.js does.
|
|
35
|
-
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
|
|
36
|
-
revLookup['-'.charCodeAt(0)] = 62
|
|
37
|
-
revLookup['_'.charCodeAt(0)] = 63
|
|
38
|
-
|
|
39
|
-
function getLens (b64) {
|
|
40
|
-
var len = b64.length
|
|
41
|
-
|
|
42
|
-
if (len % 4 > 0) {
|
|
43
|
-
throw new Error('Invalid string. Length must be a multiple of 4')
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Trim off extra bytes after placeholder bytes are found
|
|
47
|
-
// See: https://github.com/beatgammit/base64-js/issues/42
|
|
48
|
-
var validLen = b64.indexOf('=')
|
|
49
|
-
if (validLen === -1) validLen = len
|
|
50
|
-
|
|
51
|
-
var placeHoldersLen = validLen === len
|
|
52
|
-
? 0
|
|
53
|
-
: 4 - (validLen % 4)
|
|
54
|
-
|
|
55
|
-
return [validLen, placeHoldersLen]
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// base64 is 4/3 + up to two characters of the original data
|
|
59
|
-
function byteLength (b64) {
|
|
60
|
-
var lens = getLens(b64)
|
|
61
|
-
var validLen = lens[0]
|
|
62
|
-
var placeHoldersLen = lens[1]
|
|
63
|
-
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function _byteLength (b64, validLen, placeHoldersLen) {
|
|
67
|
-
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function toByteArray (b64) {
|
|
71
|
-
var tmp
|
|
72
|
-
var lens = getLens(b64)
|
|
73
|
-
var validLen = lens[0]
|
|
74
|
-
var placeHoldersLen = lens[1]
|
|
75
|
-
|
|
76
|
-
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
|
|
77
|
-
|
|
78
|
-
var curByte = 0
|
|
79
|
-
|
|
80
|
-
// if there are placeholders, only get up to the last complete 4 chars
|
|
81
|
-
var len = placeHoldersLen > 0
|
|
82
|
-
? validLen - 4
|
|
83
|
-
: validLen
|
|
84
|
-
|
|
85
|
-
var i
|
|
86
|
-
for (i = 0; i < len; i += 4) {
|
|
87
|
-
tmp =
|
|
88
|
-
(revLookup[b64.charCodeAt(i)] << 18) |
|
|
89
|
-
(revLookup[b64.charCodeAt(i + 1)] << 12) |
|
|
90
|
-
(revLookup[b64.charCodeAt(i + 2)] << 6) |
|
|
91
|
-
revLookup[b64.charCodeAt(i + 3)]
|
|
92
|
-
arr[curByte++] = (tmp >> 16) & 0xFF
|
|
93
|
-
arr[curByte++] = (tmp >> 8) & 0xFF
|
|
94
|
-
arr[curByte++] = tmp & 0xFF
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (placeHoldersLen === 2) {
|
|
98
|
-
tmp =
|
|
99
|
-
(revLookup[b64.charCodeAt(i)] << 2) |
|
|
100
|
-
(revLookup[b64.charCodeAt(i + 1)] >> 4)
|
|
101
|
-
arr[curByte++] = tmp & 0xFF
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (placeHoldersLen === 1) {
|
|
105
|
-
tmp =
|
|
106
|
-
(revLookup[b64.charCodeAt(i)] << 10) |
|
|
107
|
-
(revLookup[b64.charCodeAt(i + 1)] << 4) |
|
|
108
|
-
(revLookup[b64.charCodeAt(i + 2)] >> 2)
|
|
109
|
-
arr[curByte++] = (tmp >> 8) & 0xFF
|
|
110
|
-
arr[curByte++] = tmp & 0xFF
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return arr
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function tripletToBase64 (num) {
|
|
117
|
-
return lookup[num >> 18 & 0x3F] +
|
|
118
|
-
lookup[num >> 12 & 0x3F] +
|
|
119
|
-
lookup[num >> 6 & 0x3F] +
|
|
120
|
-
lookup[num & 0x3F]
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function encodeChunk (uint8, start, end) {
|
|
124
|
-
var tmp
|
|
125
|
-
var output = []
|
|
126
|
-
for (var i = start; i < end; i += 3) {
|
|
127
|
-
tmp =
|
|
128
|
-
((uint8[i] << 16) & 0xFF0000) +
|
|
129
|
-
((uint8[i + 1] << 8) & 0xFF00) +
|
|
130
|
-
(uint8[i + 2] & 0xFF)
|
|
131
|
-
output.push(tripletToBase64(tmp))
|
|
132
|
-
}
|
|
133
|
-
return output.join('')
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
function fromByteArray (uint8) {
|
|
137
|
-
var tmp
|
|
138
|
-
var len = uint8.length
|
|
139
|
-
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
|
|
140
|
-
var parts = []
|
|
141
|
-
var maxChunkLength = 16383 // must be multiple of 3
|
|
142
|
-
|
|
143
|
-
// go through the array every three bytes, we'll deal with trailing stuff later
|
|
144
|
-
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
|
|
145
|
-
parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// pad the end with zeros, but make sure to not forget the extra bytes
|
|
149
|
-
if (extraBytes === 1) {
|
|
150
|
-
tmp = uint8[len - 1]
|
|
151
|
-
parts.push(
|
|
152
|
-
lookup[tmp >> 2] +
|
|
153
|
-
lookup[(tmp << 4) & 0x3F] +
|
|
154
|
-
'=='
|
|
155
|
-
)
|
|
156
|
-
} else if (extraBytes === 2) {
|
|
157
|
-
tmp = (uint8[len - 2] << 8) + uint8[len - 1]
|
|
158
|
-
parts.push(
|
|
159
|
-
lookup[tmp >> 10] +
|
|
160
|
-
lookup[(tmp >> 4) & 0x3F] +
|
|
161
|
-
lookup[(tmp << 2) & 0x3F] +
|
|
162
|
-
'='
|
|
163
|
-
)
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
return parts.join('')
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
/***/ }),
|
|
171
|
-
|
|
172
|
-
/***/ 815:
|
|
173
|
-
/***/ ((module, exports, __webpack_require__) => {
|
|
174
|
-
|
|
175
|
-
/* eslint-env browser */
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* This is the web browser implementation of `debug()`.
|
|
179
|
-
*/
|
|
180
|
-
|
|
181
|
-
exports.formatArgs = formatArgs;
|
|
182
|
-
exports.save = save;
|
|
183
|
-
exports.load = load;
|
|
184
|
-
exports.useColors = useColors;
|
|
185
|
-
exports.storage = localstorage();
|
|
186
|
-
exports.destroy = (() => {
|
|
187
|
-
let warned = false;
|
|
188
|
-
|
|
189
|
-
return () => {
|
|
190
|
-
if (!warned) {
|
|
191
|
-
warned = true;
|
|
192
|
-
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
})();
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Colors.
|
|
199
|
-
*/
|
|
200
|
-
|
|
201
|
-
exports.colors = [
|
|
202
|
-
'#0000CC',
|
|
203
|
-
'#0000FF',
|
|
204
|
-
'#0033CC',
|
|
205
|
-
'#0033FF',
|
|
206
|
-
'#0066CC',
|
|
207
|
-
'#0066FF',
|
|
208
|
-
'#0099CC',
|
|
209
|
-
'#0099FF',
|
|
210
|
-
'#00CC00',
|
|
211
|
-
'#00CC33',
|
|
212
|
-
'#00CC66',
|
|
213
|
-
'#00CC99',
|
|
214
|
-
'#00CCCC',
|
|
215
|
-
'#00CCFF',
|
|
216
|
-
'#3300CC',
|
|
217
|
-
'#3300FF',
|
|
218
|
-
'#3333CC',
|
|
219
|
-
'#3333FF',
|
|
220
|
-
'#3366CC',
|
|
221
|
-
'#3366FF',
|
|
222
|
-
'#3399CC',
|
|
223
|
-
'#3399FF',
|
|
224
|
-
'#33CC00',
|
|
225
|
-
'#33CC33',
|
|
226
|
-
'#33CC66',
|
|
227
|
-
'#33CC99',
|
|
228
|
-
'#33CCCC',
|
|
229
|
-
'#33CCFF',
|
|
230
|
-
'#6600CC',
|
|
231
|
-
'#6600FF',
|
|
232
|
-
'#6633CC',
|
|
233
|
-
'#6633FF',
|
|
234
|
-
'#66CC00',
|
|
235
|
-
'#66CC33',
|
|
236
|
-
'#9900CC',
|
|
237
|
-
'#9900FF',
|
|
238
|
-
'#9933CC',
|
|
239
|
-
'#9933FF',
|
|
240
|
-
'#99CC00',
|
|
241
|
-
'#99CC33',
|
|
242
|
-
'#CC0000',
|
|
243
|
-
'#CC0033',
|
|
244
|
-
'#CC0066',
|
|
245
|
-
'#CC0099',
|
|
246
|
-
'#CC00CC',
|
|
247
|
-
'#CC00FF',
|
|
248
|
-
'#CC3300',
|
|
249
|
-
'#CC3333',
|
|
250
|
-
'#CC3366',
|
|
251
|
-
'#CC3399',
|
|
252
|
-
'#CC33CC',
|
|
253
|
-
'#CC33FF',
|
|
254
|
-
'#CC6600',
|
|
255
|
-
'#CC6633',
|
|
256
|
-
'#CC9900',
|
|
257
|
-
'#CC9933',
|
|
258
|
-
'#CCCC00',
|
|
259
|
-
'#CCCC33',
|
|
260
|
-
'#FF0000',
|
|
261
|
-
'#FF0033',
|
|
262
|
-
'#FF0066',
|
|
263
|
-
'#FF0099',
|
|
264
|
-
'#FF00CC',
|
|
265
|
-
'#FF00FF',
|
|
266
|
-
'#FF3300',
|
|
267
|
-
'#FF3333',
|
|
268
|
-
'#FF3366',
|
|
269
|
-
'#FF3399',
|
|
270
|
-
'#FF33CC',
|
|
271
|
-
'#FF33FF',
|
|
272
|
-
'#FF6600',
|
|
273
|
-
'#FF6633',
|
|
274
|
-
'#FF9900',
|
|
275
|
-
'#FF9933',
|
|
276
|
-
'#FFCC00',
|
|
277
|
-
'#FFCC33'
|
|
278
|
-
];
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
|
|
282
|
-
* and the Firebug extension (any Firefox version) are known
|
|
283
|
-
* to support "%c" CSS customizations.
|
|
284
|
-
*
|
|
285
|
-
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
|
286
|
-
*/
|
|
287
|
-
|
|
288
|
-
// eslint-disable-next-line complexity
|
|
289
|
-
function useColors() {
|
|
290
|
-
// NB: In an Electron preload script, document will be defined but not fully
|
|
291
|
-
// initialized. Since we know we're in Chrome, we'll just detect this case
|
|
292
|
-
// explicitly
|
|
293
|
-
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
|
294
|
-
return true;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
// Internet Explorer and Edge do not support colors.
|
|
298
|
-
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
299
|
-
return false;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
|
303
|
-
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
|
304
|
-
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
|
|
305
|
-
// Is firebug? http://stackoverflow.com/a/398120/376773
|
|
306
|
-
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
|
|
307
|
-
// Is firefox >= v31?
|
|
308
|
-
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
309
|
-
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
|
|
310
|
-
// Double check webkit in userAgent just in case we are in a worker
|
|
311
|
-
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* Colorize log arguments if enabled.
|
|
316
|
-
*
|
|
317
|
-
* @api public
|
|
318
|
-
*/
|
|
319
|
-
|
|
320
|
-
function formatArgs(args) {
|
|
321
|
-
args[0] = (this.useColors ? '%c' : '') +
|
|
322
|
-
this.namespace +
|
|
323
|
-
(this.useColors ? ' %c' : ' ') +
|
|
324
|
-
args[0] +
|
|
325
|
-
(this.useColors ? '%c ' : ' ') +
|
|
326
|
-
'+' + module.exports.humanize(this.diff);
|
|
327
|
-
|
|
328
|
-
if (!this.useColors) {
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
const c = 'color: ' + this.color;
|
|
333
|
-
args.splice(1, 0, c, 'color: inherit');
|
|
334
|
-
|
|
335
|
-
// The final "%c" is somewhat tricky, because there could be other
|
|
336
|
-
// arguments passed either before or after the %c, so we need to
|
|
337
|
-
// figure out the correct index to insert the CSS into
|
|
338
|
-
let index = 0;
|
|
339
|
-
let lastC = 0;
|
|
340
|
-
args[0].replace(/%[a-zA-Z%]/g, match => {
|
|
341
|
-
if (match === '%%') {
|
|
342
|
-
return;
|
|
343
|
-
}
|
|
344
|
-
index++;
|
|
345
|
-
if (match === '%c') {
|
|
346
|
-
// We only are interested in the *last* %c
|
|
347
|
-
// (the user may have provided their own)
|
|
348
|
-
lastC = index;
|
|
349
|
-
}
|
|
350
|
-
});
|
|
351
|
-
|
|
352
|
-
args.splice(lastC, 0, c);
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
/**
|
|
356
|
-
* Invokes `console.debug()` when available.
|
|
357
|
-
* No-op when `console.debug` is not a "function".
|
|
358
|
-
* If `console.debug` is not available, falls back
|
|
359
|
-
* to `console.log`.
|
|
360
|
-
*
|
|
361
|
-
* @api public
|
|
362
|
-
*/
|
|
363
|
-
exports.log = console.debug || console.log || (() => {});
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
* Save `namespaces`.
|
|
367
|
-
*
|
|
368
|
-
* @param {String} namespaces
|
|
369
|
-
* @api private
|
|
370
|
-
*/
|
|
371
|
-
function save(namespaces) {
|
|
372
|
-
try {
|
|
373
|
-
if (namespaces) {
|
|
374
|
-
exports.storage.setItem('debug', namespaces);
|
|
375
|
-
} else {
|
|
376
|
-
exports.storage.removeItem('debug');
|
|
377
|
-
}
|
|
378
|
-
} catch (error) {
|
|
379
|
-
// Swallow
|
|
380
|
-
// XXX (@Qix-) should we be logging these?
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* Load `namespaces`.
|
|
386
|
-
*
|
|
387
|
-
* @return {String} returns the previously persisted debug modes
|
|
388
|
-
* @api private
|
|
389
|
-
*/
|
|
390
|
-
function load() {
|
|
391
|
-
let r;
|
|
392
|
-
try {
|
|
393
|
-
r = exports.storage.getItem('debug');
|
|
394
|
-
} catch (error) {
|
|
395
|
-
// Swallow
|
|
396
|
-
// XXX (@Qix-) should we be logging these?
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
|
400
|
-
if (!r && typeof process !== 'undefined' && 'env' in process) {
|
|
401
|
-
r = process.env.DEBUG;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
return r;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* Localstorage attempts to return the localstorage.
|
|
409
|
-
*
|
|
410
|
-
* This is necessary because safari throws
|
|
411
|
-
* when a user disables cookies/localstorage
|
|
412
|
-
* and you attempt to access it.
|
|
413
|
-
*
|
|
414
|
-
* @return {LocalStorage}
|
|
415
|
-
* @api private
|
|
416
|
-
*/
|
|
417
|
-
|
|
418
|
-
function localstorage() {
|
|
419
|
-
try {
|
|
420
|
-
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
|
|
421
|
-
// The Browser also has localStorage in the global context.
|
|
422
|
-
return localStorage;
|
|
423
|
-
} catch (error) {
|
|
424
|
-
// Swallow
|
|
425
|
-
// XXX (@Qix-) should we be logging these?
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
module.exports = __webpack_require__(530)(exports);
|
|
430
|
-
|
|
431
|
-
const {formatters} = module.exports;
|
|
432
|
-
|
|
433
|
-
/**
|
|
434
|
-
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
|
435
|
-
*/
|
|
436
|
-
|
|
437
|
-
formatters.j = function (v) {
|
|
438
|
-
try {
|
|
439
|
-
return JSON.stringify(v);
|
|
440
|
-
} catch (error) {
|
|
441
|
-
return '[UnexpectedJSONParseError]: ' + error.message;
|
|
442
|
-
}
|
|
443
|
-
};
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
/***/ }),
|
|
447
|
-
|
|
448
|
-
/***/ 530:
|
|
449
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
14
|
+
/***/ 530
|
|
15
|
+
(module, __unused_webpack_exports, __webpack_require__) {
|
|
450
16
|
|
|
451
17
|
|
|
452
18
|
/**
|
|
@@ -588,146 +154,422 @@ function setup(env) {
|
|
|
588
154
|
}
|
|
589
155
|
});
|
|
590
156
|
|
|
591
|
-
// Env-specific initialization logic for debug instances
|
|
592
|
-
if (typeof createDebug.init === 'function') {
|
|
593
|
-
createDebug.init(debug);
|
|
594
|
-
}
|
|
157
|
+
// Env-specific initialization logic for debug instances
|
|
158
|
+
if (typeof createDebug.init === 'function') {
|
|
159
|
+
createDebug.init(debug);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return debug;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function extend(namespace, delimiter) {
|
|
166
|
+
const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
|
|
167
|
+
newDebug.log = this.log;
|
|
168
|
+
return newDebug;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Enables a debug mode by namespaces. This can include modes
|
|
173
|
+
* separated by a colon and wildcards.
|
|
174
|
+
*
|
|
175
|
+
* @param {String} namespaces
|
|
176
|
+
* @api public
|
|
177
|
+
*/
|
|
178
|
+
function enable(namespaces) {
|
|
179
|
+
createDebug.save(namespaces);
|
|
180
|
+
createDebug.namespaces = namespaces;
|
|
181
|
+
|
|
182
|
+
createDebug.names = [];
|
|
183
|
+
createDebug.skips = [];
|
|
184
|
+
|
|
185
|
+
let i;
|
|
186
|
+
const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
|
187
|
+
const len = split.length;
|
|
188
|
+
|
|
189
|
+
for (i = 0; i < len; i++) {
|
|
190
|
+
if (!split[i]) {
|
|
191
|
+
// ignore empty strings
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
namespaces = split[i].replace(/\*/g, '.*?');
|
|
196
|
+
|
|
197
|
+
if (namespaces[0] === '-') {
|
|
198
|
+
createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
|
|
199
|
+
} else {
|
|
200
|
+
createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Disable debug output.
|
|
207
|
+
*
|
|
208
|
+
* @return {String} namespaces
|
|
209
|
+
* @api public
|
|
210
|
+
*/
|
|
211
|
+
function disable() {
|
|
212
|
+
const namespaces = [
|
|
213
|
+
...createDebug.names.map(toNamespace),
|
|
214
|
+
...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
|
|
215
|
+
].join(',');
|
|
216
|
+
createDebug.enable('');
|
|
217
|
+
return namespaces;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Returns true if the given mode name is enabled, false otherwise.
|
|
222
|
+
*
|
|
223
|
+
* @param {String} name
|
|
224
|
+
* @return {Boolean}
|
|
225
|
+
* @api public
|
|
226
|
+
*/
|
|
227
|
+
function enabled(name) {
|
|
228
|
+
if (name[name.length - 1] === '*') {
|
|
229
|
+
return true;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
let i;
|
|
233
|
+
let len;
|
|
234
|
+
|
|
235
|
+
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
|
236
|
+
if (createDebug.skips[i].test(name)) {
|
|
237
|
+
return false;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
|
242
|
+
if (createDebug.names[i].test(name)) {
|
|
243
|
+
return true;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Convert regexp to namespace
|
|
252
|
+
*
|
|
253
|
+
* @param {RegExp} regxep
|
|
254
|
+
* @return {String} namespace
|
|
255
|
+
* @api private
|
|
256
|
+
*/
|
|
257
|
+
function toNamespace(regexp) {
|
|
258
|
+
return regexp.toString()
|
|
259
|
+
.substring(2, regexp.toString().length - 2)
|
|
260
|
+
.replace(/\.\*\?$/, '*');
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Coerce `val`.
|
|
265
|
+
*
|
|
266
|
+
* @param {Mixed} val
|
|
267
|
+
* @return {Mixed}
|
|
268
|
+
* @api private
|
|
269
|
+
*/
|
|
270
|
+
function coerce(val) {
|
|
271
|
+
if (val instanceof Error) {
|
|
272
|
+
return val.stack || val.message;
|
|
273
|
+
}
|
|
274
|
+
return val;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* XXX DO NOT USE. This is a temporary stub function.
|
|
279
|
+
* XXX It WILL be removed in the next major release.
|
|
280
|
+
*/
|
|
281
|
+
function destroy() {
|
|
282
|
+
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
createDebug.enable(createDebug.load());
|
|
286
|
+
|
|
287
|
+
return createDebug;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
module.exports = setup;
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
/***/ },
|
|
294
|
+
|
|
295
|
+
/***/ 815
|
|
296
|
+
(module, exports, __webpack_require__) {
|
|
297
|
+
|
|
298
|
+
/* eslint-env browser */
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* This is the web browser implementation of `debug()`.
|
|
302
|
+
*/
|
|
303
|
+
|
|
304
|
+
exports.formatArgs = formatArgs;
|
|
305
|
+
exports.save = save;
|
|
306
|
+
exports.load = load;
|
|
307
|
+
exports.useColors = useColors;
|
|
308
|
+
exports.storage = localstorage();
|
|
309
|
+
exports.destroy = (() => {
|
|
310
|
+
let warned = false;
|
|
311
|
+
|
|
312
|
+
return () => {
|
|
313
|
+
if (!warned) {
|
|
314
|
+
warned = true;
|
|
315
|
+
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
})();
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Colors.
|
|
322
|
+
*/
|
|
323
|
+
|
|
324
|
+
exports.colors = [
|
|
325
|
+
'#0000CC',
|
|
326
|
+
'#0000FF',
|
|
327
|
+
'#0033CC',
|
|
328
|
+
'#0033FF',
|
|
329
|
+
'#0066CC',
|
|
330
|
+
'#0066FF',
|
|
331
|
+
'#0099CC',
|
|
332
|
+
'#0099FF',
|
|
333
|
+
'#00CC00',
|
|
334
|
+
'#00CC33',
|
|
335
|
+
'#00CC66',
|
|
336
|
+
'#00CC99',
|
|
337
|
+
'#00CCCC',
|
|
338
|
+
'#00CCFF',
|
|
339
|
+
'#3300CC',
|
|
340
|
+
'#3300FF',
|
|
341
|
+
'#3333CC',
|
|
342
|
+
'#3333FF',
|
|
343
|
+
'#3366CC',
|
|
344
|
+
'#3366FF',
|
|
345
|
+
'#3399CC',
|
|
346
|
+
'#3399FF',
|
|
347
|
+
'#33CC00',
|
|
348
|
+
'#33CC33',
|
|
349
|
+
'#33CC66',
|
|
350
|
+
'#33CC99',
|
|
351
|
+
'#33CCCC',
|
|
352
|
+
'#33CCFF',
|
|
353
|
+
'#6600CC',
|
|
354
|
+
'#6600FF',
|
|
355
|
+
'#6633CC',
|
|
356
|
+
'#6633FF',
|
|
357
|
+
'#66CC00',
|
|
358
|
+
'#66CC33',
|
|
359
|
+
'#9900CC',
|
|
360
|
+
'#9900FF',
|
|
361
|
+
'#9933CC',
|
|
362
|
+
'#9933FF',
|
|
363
|
+
'#99CC00',
|
|
364
|
+
'#99CC33',
|
|
365
|
+
'#CC0000',
|
|
366
|
+
'#CC0033',
|
|
367
|
+
'#CC0066',
|
|
368
|
+
'#CC0099',
|
|
369
|
+
'#CC00CC',
|
|
370
|
+
'#CC00FF',
|
|
371
|
+
'#CC3300',
|
|
372
|
+
'#CC3333',
|
|
373
|
+
'#CC3366',
|
|
374
|
+
'#CC3399',
|
|
375
|
+
'#CC33CC',
|
|
376
|
+
'#CC33FF',
|
|
377
|
+
'#CC6600',
|
|
378
|
+
'#CC6633',
|
|
379
|
+
'#CC9900',
|
|
380
|
+
'#CC9933',
|
|
381
|
+
'#CCCC00',
|
|
382
|
+
'#CCCC33',
|
|
383
|
+
'#FF0000',
|
|
384
|
+
'#FF0033',
|
|
385
|
+
'#FF0066',
|
|
386
|
+
'#FF0099',
|
|
387
|
+
'#FF00CC',
|
|
388
|
+
'#FF00FF',
|
|
389
|
+
'#FF3300',
|
|
390
|
+
'#FF3333',
|
|
391
|
+
'#FF3366',
|
|
392
|
+
'#FF3399',
|
|
393
|
+
'#FF33CC',
|
|
394
|
+
'#FF33FF',
|
|
395
|
+
'#FF6600',
|
|
396
|
+
'#FF6633',
|
|
397
|
+
'#FF9900',
|
|
398
|
+
'#FF9933',
|
|
399
|
+
'#FFCC00',
|
|
400
|
+
'#FFCC33'
|
|
401
|
+
];
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
|
|
405
|
+
* and the Firebug extension (any Firefox version) are known
|
|
406
|
+
* to support "%c" CSS customizations.
|
|
407
|
+
*
|
|
408
|
+
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
|
409
|
+
*/
|
|
595
410
|
|
|
596
|
-
|
|
411
|
+
// eslint-disable-next-line complexity
|
|
412
|
+
function useColors() {
|
|
413
|
+
// NB: In an Electron preload script, document will be defined but not fully
|
|
414
|
+
// initialized. Since we know we're in Chrome, we'll just detect this case
|
|
415
|
+
// explicitly
|
|
416
|
+
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
|
417
|
+
return true;
|
|
597
418
|
}
|
|
598
419
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
return newDebug;
|
|
420
|
+
// Internet Explorer and Edge do not support colors.
|
|
421
|
+
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
422
|
+
return false;
|
|
603
423
|
}
|
|
604
424
|
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
createDebug.names = [];
|
|
617
|
-
createDebug.skips = [];
|
|
618
|
-
|
|
619
|
-
let i;
|
|
620
|
-
const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
|
621
|
-
const len = split.length;
|
|
425
|
+
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
|
426
|
+
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
|
427
|
+
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
|
|
428
|
+
// Is firebug? http://stackoverflow.com/a/398120/376773
|
|
429
|
+
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
|
|
430
|
+
// Is firefox >= v31?
|
|
431
|
+
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
432
|
+
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
|
|
433
|
+
// Double check webkit in userAgent just in case we are in a worker
|
|
434
|
+
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
|
|
435
|
+
}
|
|
622
436
|
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
437
|
+
/**
|
|
438
|
+
* Colorize log arguments if enabled.
|
|
439
|
+
*
|
|
440
|
+
* @api public
|
|
441
|
+
*/
|
|
628
442
|
|
|
629
|
-
|
|
443
|
+
function formatArgs(args) {
|
|
444
|
+
args[0] = (this.useColors ? '%c' : '') +
|
|
445
|
+
this.namespace +
|
|
446
|
+
(this.useColors ? ' %c' : ' ') +
|
|
447
|
+
args[0] +
|
|
448
|
+
(this.useColors ? '%c ' : ' ') +
|
|
449
|
+
'+' + module.exports.humanize(this.diff);
|
|
630
450
|
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
} else {
|
|
634
|
-
createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
|
635
|
-
}
|
|
636
|
-
}
|
|
451
|
+
if (!this.useColors) {
|
|
452
|
+
return;
|
|
637
453
|
}
|
|
638
454
|
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
*
|
|
642
|
-
* @return {String} namespaces
|
|
643
|
-
* @api public
|
|
644
|
-
*/
|
|
645
|
-
function disable() {
|
|
646
|
-
const namespaces = [
|
|
647
|
-
...createDebug.names.map(toNamespace),
|
|
648
|
-
...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
|
|
649
|
-
].join(',');
|
|
650
|
-
createDebug.enable('');
|
|
651
|
-
return namespaces;
|
|
652
|
-
}
|
|
455
|
+
const c = 'color: ' + this.color;
|
|
456
|
+
args.splice(1, 0, c, 'color: inherit');
|
|
653
457
|
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
458
|
+
// The final "%c" is somewhat tricky, because there could be other
|
|
459
|
+
// arguments passed either before or after the %c, so we need to
|
|
460
|
+
// figure out the correct index to insert the CSS into
|
|
461
|
+
let index = 0;
|
|
462
|
+
let lastC = 0;
|
|
463
|
+
args[0].replace(/%[a-zA-Z%]/g, match => {
|
|
464
|
+
if (match === '%%') {
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
index++;
|
|
468
|
+
if (match === '%c') {
|
|
469
|
+
// We only are interested in the *last* %c
|
|
470
|
+
// (the user may have provided their own)
|
|
471
|
+
lastC = index;
|
|
664
472
|
}
|
|
473
|
+
});
|
|
665
474
|
|
|
666
|
-
|
|
667
|
-
|
|
475
|
+
args.splice(lastC, 0, c);
|
|
476
|
+
}
|
|
668
477
|
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
478
|
+
/**
|
|
479
|
+
* Invokes `console.debug()` when available.
|
|
480
|
+
* No-op when `console.debug` is not a "function".
|
|
481
|
+
* If `console.debug` is not available, falls back
|
|
482
|
+
* to `console.log`.
|
|
483
|
+
*
|
|
484
|
+
* @api public
|
|
485
|
+
*/
|
|
486
|
+
exports.log = console.debug || console.log || (() => {});
|
|
674
487
|
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
488
|
+
/**
|
|
489
|
+
* Save `namespaces`.
|
|
490
|
+
*
|
|
491
|
+
* @param {String} namespaces
|
|
492
|
+
* @api private
|
|
493
|
+
*/
|
|
494
|
+
function save(namespaces) {
|
|
495
|
+
try {
|
|
496
|
+
if (namespaces) {
|
|
497
|
+
exports.storage.setItem('debug', namespaces);
|
|
498
|
+
} else {
|
|
499
|
+
exports.storage.removeItem('debug');
|
|
679
500
|
}
|
|
680
|
-
|
|
681
|
-
|
|
501
|
+
} catch (error) {
|
|
502
|
+
// Swallow
|
|
503
|
+
// XXX (@Qix-) should we be logging these?
|
|
682
504
|
}
|
|
505
|
+
}
|
|
683
506
|
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
507
|
+
/**
|
|
508
|
+
* Load `namespaces`.
|
|
509
|
+
*
|
|
510
|
+
* @return {String} returns the previously persisted debug modes
|
|
511
|
+
* @api private
|
|
512
|
+
*/
|
|
513
|
+
function load() {
|
|
514
|
+
let r;
|
|
515
|
+
try {
|
|
516
|
+
r = exports.storage.getItem('debug');
|
|
517
|
+
} catch (error) {
|
|
518
|
+
// Swallow
|
|
519
|
+
// XXX (@Qix-) should we be logging these?
|
|
695
520
|
}
|
|
696
521
|
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
* @param {Mixed} val
|
|
701
|
-
* @return {Mixed}
|
|
702
|
-
* @api private
|
|
703
|
-
*/
|
|
704
|
-
function coerce(val) {
|
|
705
|
-
if (val instanceof Error) {
|
|
706
|
-
return val.stack || val.message;
|
|
707
|
-
}
|
|
708
|
-
return val;
|
|
522
|
+
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
|
523
|
+
if (!r && typeof process !== 'undefined' && 'env' in process) {
|
|
524
|
+
r = process.env.DEBUG;
|
|
709
525
|
}
|
|
710
526
|
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
* XXX It WILL be removed in the next major release.
|
|
714
|
-
*/
|
|
715
|
-
function destroy() {
|
|
716
|
-
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
717
|
-
}
|
|
527
|
+
return r;
|
|
528
|
+
}
|
|
718
529
|
|
|
719
|
-
|
|
530
|
+
/**
|
|
531
|
+
* Localstorage attempts to return the localstorage.
|
|
532
|
+
*
|
|
533
|
+
* This is necessary because safari throws
|
|
534
|
+
* when a user disables cookies/localstorage
|
|
535
|
+
* and you attempt to access it.
|
|
536
|
+
*
|
|
537
|
+
* @return {LocalStorage}
|
|
538
|
+
* @api private
|
|
539
|
+
*/
|
|
720
540
|
|
|
721
|
-
|
|
541
|
+
function localstorage() {
|
|
542
|
+
try {
|
|
543
|
+
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
|
|
544
|
+
// The Browser also has localStorage in the global context.
|
|
545
|
+
return localStorage;
|
|
546
|
+
} catch (error) {
|
|
547
|
+
// Swallow
|
|
548
|
+
// XXX (@Qix-) should we be logging these?
|
|
549
|
+
}
|
|
722
550
|
}
|
|
723
551
|
|
|
724
|
-
module.exports =
|
|
552
|
+
module.exports = __webpack_require__(530)(exports);
|
|
553
|
+
|
|
554
|
+
const {formatters} = module.exports;
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
|
558
|
+
*/
|
|
559
|
+
|
|
560
|
+
formatters.j = function (v) {
|
|
561
|
+
try {
|
|
562
|
+
return JSON.stringify(v);
|
|
563
|
+
} catch (error) {
|
|
564
|
+
return '[UnexpectedJSONParseError]: ' + error.message;
|
|
565
|
+
}
|
|
566
|
+
};
|
|
725
567
|
|
|
726
568
|
|
|
727
|
-
/***/ }
|
|
569
|
+
/***/ },
|
|
728
570
|
|
|
729
|
-
/***/ 821
|
|
730
|
-
|
|
571
|
+
/***/ 821
|
|
572
|
+
(module) {
|
|
731
573
|
|
|
732
574
|
/**
|
|
733
575
|
* Helpers.
|
|
@@ -893,7 +735,165 @@ function plural(ms, msAbs, n, name) {
|
|
|
893
735
|
}
|
|
894
736
|
|
|
895
737
|
|
|
896
|
-
/***/ }
|
|
738
|
+
/***/ },
|
|
739
|
+
|
|
740
|
+
/***/ 933
|
|
741
|
+
(__unused_webpack_module, exports) {
|
|
742
|
+
|
|
743
|
+
"use strict";
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
exports.byteLength = byteLength
|
|
747
|
+
exports.toByteArray = toByteArray
|
|
748
|
+
exports.fromByteArray = fromByteArray
|
|
749
|
+
|
|
750
|
+
var lookup = []
|
|
751
|
+
var revLookup = []
|
|
752
|
+
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
|
|
753
|
+
|
|
754
|
+
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
|
|
755
|
+
for (var i = 0, len = code.length; i < len; ++i) {
|
|
756
|
+
lookup[i] = code[i]
|
|
757
|
+
revLookup[code.charCodeAt(i)] = i
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
// Support decoding URL-safe base64 strings, as Node.js does.
|
|
761
|
+
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
|
|
762
|
+
revLookup['-'.charCodeAt(0)] = 62
|
|
763
|
+
revLookup['_'.charCodeAt(0)] = 63
|
|
764
|
+
|
|
765
|
+
function getLens (b64) {
|
|
766
|
+
var len = b64.length
|
|
767
|
+
|
|
768
|
+
if (len % 4 > 0) {
|
|
769
|
+
throw new Error('Invalid string. Length must be a multiple of 4')
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
// Trim off extra bytes after placeholder bytes are found
|
|
773
|
+
// See: https://github.com/beatgammit/base64-js/issues/42
|
|
774
|
+
var validLen = b64.indexOf('=')
|
|
775
|
+
if (validLen === -1) validLen = len
|
|
776
|
+
|
|
777
|
+
var placeHoldersLen = validLen === len
|
|
778
|
+
? 0
|
|
779
|
+
: 4 - (validLen % 4)
|
|
780
|
+
|
|
781
|
+
return [validLen, placeHoldersLen]
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
// base64 is 4/3 + up to two characters of the original data
|
|
785
|
+
function byteLength (b64) {
|
|
786
|
+
var lens = getLens(b64)
|
|
787
|
+
var validLen = lens[0]
|
|
788
|
+
var placeHoldersLen = lens[1]
|
|
789
|
+
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
function _byteLength (b64, validLen, placeHoldersLen) {
|
|
793
|
+
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
function toByteArray (b64) {
|
|
797
|
+
var tmp
|
|
798
|
+
var lens = getLens(b64)
|
|
799
|
+
var validLen = lens[0]
|
|
800
|
+
var placeHoldersLen = lens[1]
|
|
801
|
+
|
|
802
|
+
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
|
|
803
|
+
|
|
804
|
+
var curByte = 0
|
|
805
|
+
|
|
806
|
+
// if there are placeholders, only get up to the last complete 4 chars
|
|
807
|
+
var len = placeHoldersLen > 0
|
|
808
|
+
? validLen - 4
|
|
809
|
+
: validLen
|
|
810
|
+
|
|
811
|
+
var i
|
|
812
|
+
for (i = 0; i < len; i += 4) {
|
|
813
|
+
tmp =
|
|
814
|
+
(revLookup[b64.charCodeAt(i)] << 18) |
|
|
815
|
+
(revLookup[b64.charCodeAt(i + 1)] << 12) |
|
|
816
|
+
(revLookup[b64.charCodeAt(i + 2)] << 6) |
|
|
817
|
+
revLookup[b64.charCodeAt(i + 3)]
|
|
818
|
+
arr[curByte++] = (tmp >> 16) & 0xFF
|
|
819
|
+
arr[curByte++] = (tmp >> 8) & 0xFF
|
|
820
|
+
arr[curByte++] = tmp & 0xFF
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
if (placeHoldersLen === 2) {
|
|
824
|
+
tmp =
|
|
825
|
+
(revLookup[b64.charCodeAt(i)] << 2) |
|
|
826
|
+
(revLookup[b64.charCodeAt(i + 1)] >> 4)
|
|
827
|
+
arr[curByte++] = tmp & 0xFF
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
if (placeHoldersLen === 1) {
|
|
831
|
+
tmp =
|
|
832
|
+
(revLookup[b64.charCodeAt(i)] << 10) |
|
|
833
|
+
(revLookup[b64.charCodeAt(i + 1)] << 4) |
|
|
834
|
+
(revLookup[b64.charCodeAt(i + 2)] >> 2)
|
|
835
|
+
arr[curByte++] = (tmp >> 8) & 0xFF
|
|
836
|
+
arr[curByte++] = tmp & 0xFF
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
return arr
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
function tripletToBase64 (num) {
|
|
843
|
+
return lookup[num >> 18 & 0x3F] +
|
|
844
|
+
lookup[num >> 12 & 0x3F] +
|
|
845
|
+
lookup[num >> 6 & 0x3F] +
|
|
846
|
+
lookup[num & 0x3F]
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
function encodeChunk (uint8, start, end) {
|
|
850
|
+
var tmp
|
|
851
|
+
var output = []
|
|
852
|
+
for (var i = start; i < end; i += 3) {
|
|
853
|
+
tmp =
|
|
854
|
+
((uint8[i] << 16) & 0xFF0000) +
|
|
855
|
+
((uint8[i + 1] << 8) & 0xFF00) +
|
|
856
|
+
(uint8[i + 2] & 0xFF)
|
|
857
|
+
output.push(tripletToBase64(tmp))
|
|
858
|
+
}
|
|
859
|
+
return output.join('')
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
function fromByteArray (uint8) {
|
|
863
|
+
var tmp
|
|
864
|
+
var len = uint8.length
|
|
865
|
+
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
|
|
866
|
+
var parts = []
|
|
867
|
+
var maxChunkLength = 16383 // must be multiple of 3
|
|
868
|
+
|
|
869
|
+
// go through the array every three bytes, we'll deal with trailing stuff later
|
|
870
|
+
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
|
|
871
|
+
parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
// pad the end with zeros, but make sure to not forget the extra bytes
|
|
875
|
+
if (extraBytes === 1) {
|
|
876
|
+
tmp = uint8[len - 1]
|
|
877
|
+
parts.push(
|
|
878
|
+
lookup[tmp >> 2] +
|
|
879
|
+
lookup[(tmp << 4) & 0x3F] +
|
|
880
|
+
'=='
|
|
881
|
+
)
|
|
882
|
+
} else if (extraBytes === 2) {
|
|
883
|
+
tmp = (uint8[len - 2] << 8) + uint8[len - 1]
|
|
884
|
+
parts.push(
|
|
885
|
+
lookup[tmp >> 10] +
|
|
886
|
+
lookup[(tmp >> 4) & 0x3F] +
|
|
887
|
+
lookup[(tmp << 2) & 0x3F] +
|
|
888
|
+
'='
|
|
889
|
+
)
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
return parts.join('')
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
|
|
896
|
+
/***/ }
|
|
897
897
|
|
|
898
898
|
/******/ });
|
|
899
899
|
/************************************************************************/
|
|
@@ -943,7 +943,7 @@ function plural(ms, msAbs, n, name) {
|
|
|
943
943
|
/******/ __webpack_require__.r(ns);
|
|
944
944
|
/******/ var def = {};
|
|
945
945
|
/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
|
|
946
|
-
/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {
|
|
946
|
+
/******/ for(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {
|
|
947
947
|
/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
|
|
948
948
|
/******/ }
|
|
949
949
|
/******/ def['default'] = () => (value);
|
|
@@ -2295,7 +2295,7 @@ var ClipboardSupportedMimeType;
|
|
|
2295
2295
|
})(ClipboardSupportedMimeType || (ClipboardSupportedMimeType = {}));
|
|
2296
2296
|
|
|
2297
2297
|
;// ./src/artifactsForCDN/validDomains.json
|
|
2298
|
-
const validDomains_namespaceObject = /*#__PURE__*/JSON.parse('{"validOrigins":["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.office365.us","outlook-dod.office365.us","webmail.apps.mil","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","*.outlook.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net","fa000000125.officeapps.live.com","fa000000129.officeapps.live.com","fa000000124.officeapps.live.com","fa000000128.officeapps.live.com","fa000000136.mro1cdnstorage.public.cdn.office.net","fa000000136.mro1cdnstorage.public.onecdn.static.microsoft","substrate-msb-bizchatvnext-service.sdf01.substrate-msb-bingatwork.eastus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2sdf1.office-home-m365copilotapp.westus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2test1.office-home-m365copilotapp.westus2-test.cosmic-int.office.net","m365copilotapp.svc.cloud.microsoft","m365copilotapp.svc.cloud.dev.microsoft","ffc-copilot.officeapps.live.com","m365.cloud.dev.microsoft","m365.cloud.dev.microsoft:3001"]}');
|
|
2298
|
+
const validDomains_namespaceObject = /*#__PURE__*/JSON.parse('{"validOrigins":["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.office365.us","outlook-dod.office365.us","webmail.apps.mil","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","*.outlook.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net","fa000000125.officeapps.live.com","fa000000129.officeapps.live.com","fa000000124.officeapps.live.com","fa000000128.officeapps.live.com","fa000000136.mro1cdnstorage.public.cdn.office.net","fa000000136.mro1cdnstorage.public.onecdn.static.microsoft","substrate-msb-bizchatvnext-service.sdf01.substrate-msb-bingatwork.eastus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2sdf1.office-home-m365copilotapp.westus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2test1.office-home-m365copilotapp.westus2-test.cosmic-int.office.net","m365copilotapp.svc.cloud.microsoft","m365copilotapp.svc.cloud.dev.microsoft","ffc-copilot.officeapps.live.com","m365.cloud.dev.microsoft","m365.cloud.dev.microsoft:3001","portal.officeppe.com","ignite.m365.admin.cloud.microsoft","ignite.admin.cloud.microsoft","sdf.m365.admin.cloud.microsoft","admin-sdf.microsoft.com","canary.m365.admin.cloud.microsoft","ring0.m365.admin.cloud.microsoft","portal.office365.us","portal.apps.mil","www.ohome.apps.mil","www.office365.us"]}');
|
|
2299
2299
|
var artifactsForCDN_validDomains_namespaceObject = /*#__PURE__*/__webpack_require__.t(validDomains_namespaceObject, 2);
|
|
2300
2300
|
;// ./src/internal/constants.ts
|
|
2301
2301
|
|
|
@@ -2429,14 +2429,6 @@ const ORIGIN_LIST_FETCH_TIMEOUT_IN_MS = 1500;
|
|
|
2429
2429
|
* Limited to Microsoft-internal use
|
|
2430
2430
|
*/
|
|
2431
2431
|
const validOriginsCdnEndpoint = new URL('https://res.cdn.office.net/teams-js/validDomains/json/validDomains.json');
|
|
2432
|
-
/**
|
|
2433
|
-
* @hidden
|
|
2434
|
-
* USer specified message origins should satisfy this test
|
|
2435
|
-
*
|
|
2436
|
-
* @internal
|
|
2437
|
-
* Limited to Microsoft-internal use
|
|
2438
|
-
*/
|
|
2439
|
-
const userOriginUrlValidationRegExp = /^https:\/\//;
|
|
2440
2432
|
/**
|
|
2441
2433
|
* @hidden
|
|
2442
2434
|
* The protocol used for deep links into Teams
|
|
@@ -4677,7 +4669,7 @@ function isSerializable(arg) {
|
|
|
4677
4669
|
* @hidden
|
|
4678
4670
|
* Package version.
|
|
4679
4671
|
*/
|
|
4680
|
-
const version = "2.
|
|
4672
|
+
const version = "2.49.0-beta.0";
|
|
4681
4673
|
|
|
4682
4674
|
;// ./src/public/featureFlags.ts
|
|
4683
4675
|
// All build feature flags are defined inside this object. Any build feature flag must have its own unique getter and setter function. This pattern allows for client apps to treeshake unused code and avoid including code guarded by this feature flags in the final bundle. If this property isn't desired, use the below runtime feature flags object.
|
|
@@ -4810,6 +4802,92 @@ function flushMessageQueue(targetWindow, targetOrigin, targetMessageQueue, targe
|
|
|
4810
4802
|
}
|
|
4811
4803
|
}
|
|
4812
4804
|
|
|
4805
|
+
;// ./src/internal/urlPattern.ts
|
|
4806
|
+
/**
|
|
4807
|
+
* Regex for validating that a user-provided origin includes a protocol.
|
|
4808
|
+
*/
|
|
4809
|
+
const userOriginUrlValidationRegExp = /^[A-Za-z][A-Za-z\d+.-]*:\/\//;
|
|
4810
|
+
/**
|
|
4811
|
+
* @param pattern - reference pattern
|
|
4812
|
+
* @param host - candidate string
|
|
4813
|
+
* @returns returns true if host matches pre-know valid pattern
|
|
4814
|
+
*
|
|
4815
|
+
* @example
|
|
4816
|
+
* validateHostAgainstPattern('*.teams.microsoft.com', 'subdomain.teams.microsoft.com') returns true
|
|
4817
|
+
* validateHostAgainstPattern('teams.microsoft.com', 'team.microsoft.com') returns false
|
|
4818
|
+
*
|
|
4819
|
+
* @internal
|
|
4820
|
+
* Limited to Microsoft-internal use
|
|
4821
|
+
*/
|
|
4822
|
+
function validateHostAgainstPattern(pattern, host) {
|
|
4823
|
+
const suffix = pattern.substring(1);
|
|
4824
|
+
return (pattern === host ||
|
|
4825
|
+
(pattern.substring(0, 2) === '*.' &&
|
|
4826
|
+
host.length > suffix.length &&
|
|
4827
|
+
host.split('.').length === suffix.split('.').length &&
|
|
4828
|
+
host.substring(host.length - suffix.length) === suffix));
|
|
4829
|
+
}
|
|
4830
|
+
/**
|
|
4831
|
+
* @hidden
|
|
4832
|
+
* @internal
|
|
4833
|
+
* Limited to Microsoft-internal use.
|
|
4834
|
+
*
|
|
4835
|
+
* Internal class when widely-available URLPattern is not available.
|
|
4836
|
+
*/
|
|
4837
|
+
class InternalURLPattern {
|
|
4838
|
+
constructor(protocol, host, logger) {
|
|
4839
|
+
this.protocol = protocol;
|
|
4840
|
+
this.host = host;
|
|
4841
|
+
this.logger = logger;
|
|
4842
|
+
}
|
|
4843
|
+
/**
|
|
4844
|
+
* Checks if InternalURLPattern can be used with the provided pattern.
|
|
4845
|
+
*/
|
|
4846
|
+
static canUse(pattern) {
|
|
4847
|
+
return userOriginUrlValidationRegExp.test(pattern);
|
|
4848
|
+
}
|
|
4849
|
+
/**
|
|
4850
|
+
* Creates an instance of InternalURLPattern with the provided pattern and logger.
|
|
4851
|
+
*/
|
|
4852
|
+
static create(pattern, logger) {
|
|
4853
|
+
const splitPattern = pattern.split('://');
|
|
4854
|
+
return new InternalURLPattern(splitPattern[0], splitPattern[1], logger.extend('InternalURLPattern'));
|
|
4855
|
+
}
|
|
4856
|
+
/**
|
|
4857
|
+
* Tests the URL against the pattern.
|
|
4858
|
+
*/
|
|
4859
|
+
test(url) {
|
|
4860
|
+
this.logger('Testing URL %s against pattern protocol: %s, host: %s', url, this.protocol, this.host);
|
|
4861
|
+
return url.protocol === `${this.protocol}:` && (!url.host || validateHostAgainstPattern(this.host, url.host));
|
|
4862
|
+
}
|
|
4863
|
+
}
|
|
4864
|
+
/**
|
|
4865
|
+
* @hidden
|
|
4866
|
+
* @internal
|
|
4867
|
+
* Limited to Microsoft-internal use.
|
|
4868
|
+
*
|
|
4869
|
+
* Checks if the provided pattern is valid for checking against URLs.
|
|
4870
|
+
* @param pattern - The pattern to validate.
|
|
4871
|
+
* @returns - True if the pattern is valid, false otherwise.
|
|
4872
|
+
*/
|
|
4873
|
+
function isValidPatternUrl(pattern) {
|
|
4874
|
+
return InternalURLPattern.canUse(pattern);
|
|
4875
|
+
}
|
|
4876
|
+
/**
|
|
4877
|
+
* @hidden
|
|
4878
|
+
* @internal
|
|
4879
|
+
* Limited to Microsoft-internal use.
|
|
4880
|
+
*
|
|
4881
|
+
* Creates a URL verifier based on the provided pattern.
|
|
4882
|
+
*/
|
|
4883
|
+
function createURLVerifier(pattern, logger) {
|
|
4884
|
+
if (InternalURLPattern.canUse(pattern)) {
|
|
4885
|
+
return InternalURLPattern.create(pattern, logger);
|
|
4886
|
+
}
|
|
4887
|
+
logger('No URL verifier available for pattern: %s', pattern);
|
|
4888
|
+
return undefined;
|
|
4889
|
+
}
|
|
4890
|
+
|
|
4813
4891
|
;// ./src/internal/internalAPIs.ts
|
|
4814
4892
|
|
|
4815
4893
|
|
|
@@ -4818,6 +4896,7 @@ function flushMessageQueue(targetWindow, targetOrigin, targetMessageQueue, targe
|
|
|
4818
4896
|
|
|
4819
4897
|
|
|
4820
4898
|
|
|
4899
|
+
|
|
4821
4900
|
const internalLogger = getLogger('internal');
|
|
4822
4901
|
const ensureInitializeCalledLogger = internalLogger.extend('ensureInitializeCalled');
|
|
4823
4902
|
const ensureInitializedLogger = internalLogger.extend('ensureInitialized');
|
|
@@ -4927,7 +5006,7 @@ function throwExceptionIfMobileApiIsNotSupported(requiredVersion = defaultSDKVer
|
|
|
4927
5006
|
*/
|
|
4928
5007
|
function processAdditionalValidOrigins(validMessageOrigins) {
|
|
4929
5008
|
let combinedOriginUrls = GlobalVars.additionalValidOrigins.concat(validMessageOrigins.filter((_origin) => {
|
|
4930
|
-
return typeof _origin === 'string' &&
|
|
5009
|
+
return typeof _origin === 'string' && isValidPatternUrl(_origin);
|
|
4931
5010
|
}));
|
|
4932
5011
|
const dedupUrls = {};
|
|
4933
5012
|
combinedOriginUrls = combinedOriginUrls.filter((_originUrl) => {
|
|
@@ -5403,7 +5482,7 @@ logWhereTeamsJsIsBeingUsed();
|
|
|
5403
5482
|
* @param validMessageOrigins - Optionally specify a list of cross-frame message origins. This parameter is used if you know that your app
|
|
5404
5483
|
* will be hosted on a custom domain (i.e., not a standard Microsoft 365 host like Teams, Outlook, etc.) Most apps will never need
|
|
5405
5484
|
* to pass a value for this parameter.
|
|
5406
|
-
* Any domains passed in the array must
|
|
5485
|
+
* Any domains passed in the array must define a scheme to be able to be processed. Examples: https://www.example.com, chrome://
|
|
5407
5486
|
* @returns Promise that will be fulfilled when initialization has completed, or rejected if the initialization fails or times out
|
|
5408
5487
|
*/
|
|
5409
5488
|
function initialize(validMessageOrigins) {
|
|
@@ -5497,12 +5576,16 @@ function registerOnThemeChangeHandler(handler) {
|
|
|
5497
5576
|
registerOnThemeChangeHandlerHelper(getApiVersionTag(appTelemetryVersionNumber, "app.registerOnThemeChangeHandler" /* ApiName.App_RegisterOnThemeChangeHandler */), handler);
|
|
5498
5577
|
}
|
|
5499
5578
|
/**
|
|
5579
|
+
* @hidden
|
|
5500
5580
|
* Registers a handler for content (context) changes.
|
|
5501
5581
|
*
|
|
5502
5582
|
* @remarks
|
|
5503
5583
|
* Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
|
|
5504
5584
|
*
|
|
5505
5585
|
* @param handler - The handler to invoke when the app's content context changes.
|
|
5586
|
+
*
|
|
5587
|
+
* @internal
|
|
5588
|
+
* Limited to Microsoft-internal use
|
|
5506
5589
|
*/
|
|
5507
5590
|
function registerOnContextChangeHandler(handler) {
|
|
5508
5591
|
registerOnContextChangeHandlerHelper(getApiVersionTag(appTelemetryVersionNumber, "app.registerOnContextChangeHandler" /* ApiName.App_RegisterOnContextChangeHandler */), handler);
|
|
@@ -6600,6 +6683,7 @@ function notifyFailureHelper(apiVersiontag, appInitializationFailedRequest) {
|
|
|
6600
6683
|
sendMessageToParent(apiVersiontag, Messages.Failure, [
|
|
6601
6684
|
appInitializationFailedRequest.reason,
|
|
6602
6685
|
appInitializationFailedRequest.message,
|
|
6686
|
+
appInitializationFailedRequest.authHeader,
|
|
6603
6687
|
]);
|
|
6604
6688
|
}
|
|
6605
6689
|
function notifySuccessHelper(apiVersionTag) {
|
|
@@ -6751,6 +6835,7 @@ var validOrigins_awaiter = (undefined && undefined.__awaiter) || function (thisA
|
|
|
6751
6835
|
|
|
6752
6836
|
|
|
6753
6837
|
|
|
6838
|
+
|
|
6754
6839
|
let validOriginsCache = [];
|
|
6755
6840
|
const validateOriginLogger = getLogger('validateOrigin');
|
|
6756
6841
|
let validOriginsPromise;
|
|
@@ -6835,30 +6920,23 @@ function isValidOriginsJSONValid(validOriginsJSON) {
|
|
|
6835
6920
|
return true;
|
|
6836
6921
|
}
|
|
6837
6922
|
/**
|
|
6923
|
+
* Validates the origin against the full pattern including protocol and hostname.
|
|
6838
6924
|
* @param pattern - reference pattern
|
|
6839
|
-
* @param
|
|
6840
|
-
* @returns returns true if host matches pre-know valid pattern
|
|
6841
|
-
*
|
|
6842
|
-
* @example
|
|
6843
|
-
* validateHostAgainstPattern('*.teams.microsoft.com', 'subdomain.teams.microsoft.com') returns true
|
|
6844
|
-
* validateHostAgainstPattern('teams.microsoft.com', 'team.microsoft.com') returns false
|
|
6845
|
-
*
|
|
6846
|
-
* @internal
|
|
6847
|
-
* Limited to Microsoft-internal use
|
|
6925
|
+
* @param origin - candidate URL object
|
|
6848
6926
|
*/
|
|
6849
|
-
function
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
return true;
|
|
6927
|
+
function validateOriginAgainstFullPattern(pattern, origin) {
|
|
6928
|
+
let patternUrl;
|
|
6929
|
+
try {
|
|
6930
|
+
const createdURLVerifier = createURLVerifier(pattern, validateOriginLogger);
|
|
6931
|
+
if (!createdURLVerifier) {
|
|
6932
|
+
return false;
|
|
6856
6933
|
}
|
|
6934
|
+
patternUrl = createdURLVerifier;
|
|
6857
6935
|
}
|
|
6858
|
-
|
|
6859
|
-
return
|
|
6936
|
+
catch (_a) {
|
|
6937
|
+
return false;
|
|
6860
6938
|
}
|
|
6861
|
-
return
|
|
6939
|
+
return patternUrl.test(origin);
|
|
6862
6940
|
}
|
|
6863
6941
|
/**
|
|
6864
6942
|
* @internal
|
|
@@ -6870,29 +6948,25 @@ function validateOrigin(messageOrigin, disableCache) {
|
|
|
6870
6948
|
if (validateOriginWithValidOriginsList(messageOrigin, localList)) {
|
|
6871
6949
|
return Promise.resolve(true);
|
|
6872
6950
|
}
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
return getValidOriginsListFromCDN(disableCache).then((validOriginsList) => {
|
|
6876
|
-
return validateOriginWithValidOriginsList(messageOrigin, validOriginsList);
|
|
6877
|
-
});
|
|
6878
|
-
}
|
|
6951
|
+
validateOriginLogger('Origin %s is not in the local valid origins list, fetching from CDN', messageOrigin);
|
|
6952
|
+
return getValidOriginsListFromCDN(disableCache).then((validOriginsList) => validateOriginWithValidOriginsList(messageOrigin, validOriginsList));
|
|
6879
6953
|
}
|
|
6880
6954
|
function validateOriginWithValidOriginsList(messageOrigin, validOriginsList) {
|
|
6881
|
-
//
|
|
6955
|
+
// User provided additional valid origins take precedence as they do not require https protocol
|
|
6956
|
+
for (const domainOrPattern of GlobalVars.additionalValidOrigins) {
|
|
6957
|
+
if (validateOriginAgainstFullPattern(domainOrPattern, messageOrigin)) {
|
|
6958
|
+
return true;
|
|
6959
|
+
}
|
|
6960
|
+
}
|
|
6961
|
+
const messageOriginHost = messageOrigin.host;
|
|
6962
|
+
// For standard valid origins, only allow https protocol
|
|
6882
6963
|
if (!isValidHttpsURL(messageOrigin)) {
|
|
6883
6964
|
validateOriginLogger('Origin %s is invalid because it is not using https protocol. Protocol being used: %s', messageOrigin, messageOrigin.protocol);
|
|
6884
6965
|
return false;
|
|
6885
6966
|
}
|
|
6886
|
-
const messageOriginHost = messageOrigin.host;
|
|
6887
6967
|
if (validOriginsList.some((pattern) => validateHostAgainstPattern(pattern, messageOriginHost))) {
|
|
6888
6968
|
return true;
|
|
6889
6969
|
}
|
|
6890
|
-
for (const domainOrPattern of GlobalVars.additionalValidOrigins) {
|
|
6891
|
-
const pattern = domainOrPattern.substring(0, 8) === 'https://' ? domainOrPattern.substring(8) : domainOrPattern;
|
|
6892
|
-
if (validateHostAgainstPattern(pattern, messageOriginHost)) {
|
|
6893
|
-
return true;
|
|
6894
|
-
}
|
|
6895
|
-
}
|
|
6896
6970
|
validateOriginLogger('Origin %s is invalid because it is not an origin approved by this library or included in the call to app.initialize.\nOrigins approved by this library: %o\nOrigins included in app.initialize: %o', messageOrigin, validOriginsList, GlobalVars.additionalValidOrigins);
|
|
6897
6971
|
return false;
|
|
6898
6972
|
}
|