@microsoft/teams-js 2.41.0 → 2.42.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 CHANGED
@@ -24,7 +24,7 @@ To install the stable [version](https://learn.microsoft.com/javascript/api/overv
24
24
 
25
25
  ### Production
26
26
 
27
- You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.41.0/js/MicrosoftTeams.min.js) or point your package manager at them.
27
+ You can reference these files directly [from here](https://res.cdn.office.net/teams-js/2.42.0/js/MicrosoftTeams.min.js) or point your package manager at them.
28
28
 
29
29
  ## Usage
30
30
 
@@ -45,13 +45,13 @@ Reference the library inside of your `.html` page using:
45
45
  ```html
46
46
  <!-- Microsoft Teams JavaScript API (via CDN) -->
47
47
  <script
48
- src="https://res.cdn.office.net/teams-js/2.41.0/js/MicrosoftTeams.min.js"
49
- integrity="sha384-foat9bCJflCyiUx3dfsImCX29CW3tNCWjj2SYbHfO8fhbVBR6Z/UsY6i2ihfwpvZ"
48
+ src="https://res.cdn.office.net/teams-js/2.42.0/js/MicrosoftTeams.min.js"
49
+ integrity="sha384-kKQjKs75BOHapvR+ooLO1oHO5e6YewZT5fp0U6EgT22v+ADFCcVPHqj1cSs4iIBO"
50
50
  crossorigin="anonymous"
51
51
  ></script>
52
52
 
53
53
  <!-- Microsoft Teams JavaScript API (via npm) -->
54
- <script src="node_modules/@microsoft/teams-js@2.41.0/dist/MicrosoftTeams.min.js"></script>
54
+ <script src="node_modules/@microsoft/teams-js@2.42.0/dist/MicrosoftTeams.min.js"></script>
55
55
 
56
56
  <!-- Microsoft Teams JavaScript API (via local) -->
57
57
  <script src="MicrosoftTeams.min.js"></script>
@@ -1,5 +1,6 @@
1
1
  import { AdaptiveCardVersion, SdkError } from '../public/interfaces';
2
2
  import * as pages from '../public/pages/pages';
3
+ import { IBaseRuntime } from '../public/runtime';
3
4
  /**
4
5
  * @internal
5
6
  * Limited to Microsoft-internal use
@@ -217,3 +218,9 @@ export declare function getCurrentTimestamp(): number | undefined;
217
218
  *
218
219
  */
219
220
  export declare function isPrimitiveOrPlainObject(value: unknown, depth?: number): boolean;
221
+ /**
222
+ * Normalizes legacy ageGroup values for backward compatibility
223
+ * @param runtimeConfig - The runtime configuration object to normalize
224
+ * @returns A new IBaseRuntime object with normalized ageGroup values
225
+ */
226
+ export declare function normalizeAgeGroupValue(runtimeConfig: IBaseRuntime): IBaseRuntime;
@@ -130,6 +130,11 @@ export interface AppInfo {
130
130
  * For displaying the time when the user clicked on the app, please use {@link app.AppInfo.userClickTime | app.Context.app.userClickTime} as it uses the date.
131
131
  */
132
132
  userClickTimeV2?: number;
133
+ /**
134
+ * The ID of the message from which this task module was launched.
135
+ * This is only available in task modules launched from bot cards.
136
+ */
137
+ messageId?: string;
133
138
  /**
134
139
  * The ID of the parent message from which this task module was launched.
135
140
  * This is only available in task modules launched from bot cards.
@@ -540,6 +540,14 @@ export interface Context {
540
540
  * The license type for the current user.
541
541
  */
542
542
  userLicenseType?: string;
543
+ /**
544
+ * @deprecated
545
+ * As of TeamsJS v2.0.0, please use {@link app.AppInfo.messageId | app.Context.app.messageId} instead
546
+ *
547
+ * The ID of the message from which this task module was launched.
548
+ * This is only available in task modules launched from bot cards.
549
+ */
550
+ messageId?: string;
543
551
  /**
544
552
  * @deprecated
545
553
  * As of TeamsJS v2.0.0, please use {@link app.AppInfo.parentMessageId | app.Context.app.parentMessageId} instead
@@ -1144,7 +1152,11 @@ export declare enum LegalAgeGroupClassification {
1144
1152
  * United Kingdom, European Union, or South Korea, and the user's age is between a minor and an adult age
1145
1153
  * (as stipulated based on country or region). Generally, this means that teenagers are considered as notAdult in regulated countries.
1146
1154
  */
1147
- NonAdult = "nonAdult"
1155
+ NotAdult = "notAdult",
1156
+ /**
1157
+ * @deprecated To provide back compatibility for the NonAdult enum value coming from the hubs
1158
+ */
1159
+ NonAdult = "notAdult"
1148
1160
  }
1149
1161
  /**
1150
1162
  * @hidden
@@ -1 +1 @@
1
- var o=["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.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"],c={validOrigins:o};export{c as default,o as validOrigins};
1
+ var o=["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"],c={validOrigins:o};export{c as default,o as validOrigins};
@@ -1 +1 @@
1
- import{__awaiter as i}from"../../../../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";import{sendMessageToParent as e,sendAndHandleStatusAndReason as n,callFunctionInHostAndHandleResponse as t,initializeCommunication as o}from"./communication.js";import{errorLibraryNotInitialized as r,defaultSDKVersionForCompatCheck as s}from"./constants.js";import{GlobalVars as l}from"./globalVars.js";import{registerOnThemeChangeHandler as a,initializeHandlers as p}from"./handlers.js";import{ensureInitializeCalled as u,ensureInitialized as m,processAdditionalValidOrigins as c}from"./internalAPIs.js";import{getLogger as f}from"./telemetry.js";import{isNullOrUndefined as d}from"./typeCheckUtilities.js";import{inServerSideRenderingEnvironment as g,runWithTimeout as h,compareSDKVersions as S}from"./utils.js";import{Messages as j}from"../public/app/app.js";import{FrameContexts as v}from"../public/constants.js";import{initialize as w}from"../public/dialog/dialog.js";import{initialize as y}from"../public/menus.js";import{runtime as z,applyRuntimeConfig as b,generateVersionBasedTeamsRuntimeConfig as P,mapTeamsVersionToSupportedCapabilities as C,versionAndPlatformAgnosticTeamsRuntimeConfig as x}from"../public/runtime.js";import{version as D}from"../public/version.js";import{SimpleTypeResponseHandler as E}from"./responseHandler.js";import{initialize as V}from"../public/pages/config.js";const K=f("app");function _(i,e){if(g()){return K.extend("initialize")("window object undefined at initialization"),Promise.resolve()}return h((()=>function(i,e){return new Promise((n=>{l.initializeCalled||(l.initializeCalled=!0,p(),l.initializePromise=o(e,i).then((({context:i,clientType:e,runtimeConfig:n,clientSupportedSDKVersion:t=s})=>{l.frameContext=i,l.hostClientType=e,l.clientSupportedSDKVersion=t;try{H("Parsing %s",n);const i=JSON.parse(n);if(H("Checking if %o is a valid runtime object",null!=i?i:"null"),!i||!i.apiVersion)throw new Error("Received runtime config is invalid");n&&b(i)}catch(i){if(!(i instanceof SyntaxError))throw i;try{H("Attempting to parse %s as an SDK version",n),isNaN(S(n,s))||(l.clientSupportedSDKVersion=n);const i=JSON.parse(t);if(H("givenRuntimeConfig parsed to %o",null!=i?i:"null"),!i)throw new Error("givenRuntimeConfig string was successfully parsed. However, it parsed to value of null");b(i)}catch(i){if(!(i instanceof SyntaxError))throw i;b(P(l.clientSupportedSDKVersion,x,C))}}l.initializeCompleted=!0})),y(),V(),w()),Array.isArray(e)&&c(e),void 0!==l.initializePromise?n(l.initializePromise):H("GlobalVars.initializePromise is unexpectedly undefined")}))}(i,e)),6e4,new Error("SDK initialization timed out."))}function k(i){e(i,j.AppLoaded,[D])}function A(i,n){e(i,j.ExpectedFailure,[n.reason,n.message])}function F(i,n){e(i,j.Failure,[n.reason,n.message])}function N(e){return i(this,void 0,void 0,(function*(){if(l.initializeCompleted)return R(e);if(!l.initializePromise)throw new Error(r);return l.initializePromise.then((()=>R(e)))}))}function R(n){return i(this,void 0,void 0,(function*(){return m(z)&&(null===(i=z.supports.app)||void 0===i?void 0:i.notifySuccessResponse)?t(j.Success,[D],new E,n).then((()=>({hasFinishedSuccessfully:!0}))):(e(n,j.Success,[D]),{hasFinishedSuccessfully:"unknown"});var i}))}const H=K.extend("initializeHelper");function J(i,e){!d(e)&&u(),a(i,e)}function L(i,e){return new Promise((t=>{m(z,v.content,v.sidePanel,v.settings,v.task,v.stage,v.meetingStage),t(n(i,"executeDeepLink",e))}))}export{_ as appInitializeHelper,R as callNotifySuccessInHost,k as notifyAppLoadedHelper,A as notifyExpectedFailureHelper,F as notifyFailureHelper,N as notifySuccessHelper,L as openLinkHelper,J as registerOnThemeChangeHandlerHelper};
1
+ import{__awaiter as i}from"../../../../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";import{sendMessageToParent as e,sendAndHandleStatusAndReason as t,callFunctionInHostAndHandleResponse as n,initializeCommunication as o}from"./communication.js";import{errorLibraryNotInitialized as r,defaultSDKVersionForCompatCheck as s}from"./constants.js";import{GlobalVars as l}from"./globalVars.js";import{registerOnThemeChangeHandler as a,initializeHandlers as p}from"./handlers.js";import{ensureInitializeCalled as u,ensureInitialized as m,processAdditionalValidOrigins as c}from"./internalAPIs.js";import{getLogger as f}from"./telemetry.js";import{isNullOrUndefined as d}from"./typeCheckUtilities.js";import{inServerSideRenderingEnvironment as g,runWithTimeout as h,normalizeAgeGroupValue as S,compareSDKVersions as j}from"./utils.js";import{Messages as v}from"../public/app/app.js";import{FrameContexts as w}from"../public/constants.js";import{initialize as y}from"../public/dialog/dialog.js";import{initialize as z}from"../public/menus.js";import{runtime as b,applyRuntimeConfig as P,generateVersionBasedTeamsRuntimeConfig as C,mapTeamsVersionToSupportedCapabilities as x,versionAndPlatformAgnosticTeamsRuntimeConfig as D}from"../public/runtime.js";import{version as E}from"../public/version.js";import{SimpleTypeResponseHandler as V}from"./responseHandler.js";import{initialize as K}from"../public/pages/config.js";const _=f("app");function k(i,e){if(g()){return _.extend("initialize")("window object undefined at initialization"),Promise.resolve()}return h((()=>function(i,e){return new Promise((t=>{l.initializeCalled||(l.initializeCalled=!0,p(),l.initializePromise=o(e,i).then((({context:i,clientType:e,runtimeConfig:t,clientSupportedSDKVersion:n=s})=>{l.frameContext=i,l.hostClientType=e,l.clientSupportedSDKVersion=n;try{J("Parsing %s",t);let i=JSON.parse(t);if(J("Checking if %o is a valid runtime object",null!=i?i:"null"),!i||!i.apiVersion)throw new Error("Received runtime config is invalid");i=S(i),t&&P(i)}catch(i){if(!(i instanceof SyntaxError))throw i;try{J("Attempting to parse %s as an SDK version",t),isNaN(j(t,s))||(l.clientSupportedSDKVersion=t);let i=JSON.parse(n);if(J("givenRuntimeConfig parsed to %o",null!=i?i:"null"),!i)throw new Error("givenRuntimeConfig string was successfully parsed. However, it parsed to value of null");i=S(i),P(i)}catch(i){if(!(i instanceof SyntaxError))throw i;P(C(l.clientSupportedSDKVersion,D,x))}}l.initializeCompleted=!0})),z(),K(),y()),Array.isArray(e)&&c(e),void 0!==l.initializePromise?t(l.initializePromise):J("GlobalVars.initializePromise is unexpectedly undefined")}))}(i,e)),6e4,new Error("SDK initialization timed out."))}function A(i){e(i,v.AppLoaded,[E])}function F(i,t){e(i,v.ExpectedFailure,[t.reason,t.message])}function N(i,t){e(i,v.Failure,[t.reason,t.message])}function R(e){return i(this,void 0,void 0,(function*(){if(l.initializeCompleted)return H(e);if(!l.initializePromise)throw new Error(r);return l.initializePromise.then((()=>H(e)))}))}function H(t){return i(this,void 0,void 0,(function*(){return m(b)&&(null===(i=b.supports.app)||void 0===i?void 0:i.notifySuccessResponse)?n(v.Success,[E],new V,t).then((()=>({hasFinishedSuccessfully:!0}))):(e(t,v.Success,[E]),{hasFinishedSuccessfully:"unknown"});var i}))}const J=_.extend("initializeHelper");function L(i,e){!d(e)&&u(),a(i,e)}function O(i,e){return new Promise((n=>{m(b,w.content,w.sidePanel,w.settings,w.task,w.stage,w.meetingStage),n(t(i,"executeDeepLink",e))}))}export{k as appInitializeHelper,H as callNotifySuccessInHost,A as notifyAppLoadedHelper,F as notifyExpectedFailureHelper,N as notifyFailureHelper,R as notifySuccessHelper,O as openLinkHelper,L as registerOnThemeChangeHandlerHelper};
@@ -1 +1 @@
1
- import{Buffer as t}from"../../../../_virtual/_polyfill-node.buffer.js";import{minAdaptiveCardVersion as e}from"../public/constants.js";import r from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v4.js";import n from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js";function o(t){return(t,e)=>{if(!t)throw new Error(e)}}function i(t,e){if("string"!=typeof t||"string"!=typeof e)return NaN;const r=t.split("."),n=e.split(".");function o(t){return/^\d+$/.test(t)}if(!r.every(o)||!n.every(o))return NaN;for(;r.length<n.length;)r.push("0");for(;n.length<r.length;)n.push("0");for(let t=0;t<r.length;++t)if(Number(r[t])!=Number(n[t]))return Number(r[t])>Number(n[t])?1:-1;return 0}function c(){return r()}function u(t){return Object.keys(t).forEach((e=>{null!==t[e]&&void 0!==t[e]&&"object"==typeof t[e]&&u(t[e])})),Object.freeze(t)}function s(t,e,...r){const n=t(...r);return n.then((t=>{e&&e(void 0,t)})).catch((t=>{e&&e(t)})),n}function f(t,e,...r){const n=t(...r);return n.then((()=>{e&&e(null)})).catch((t=>{e&&e(t)})),n}function l(t,e,...r){const n=t(...r);return n.then((t=>{e&&e(null,t)})).catch((t=>{e&&e(t,null)})),n}function a(t,e,r){return new Promise(((n,o)=>{const i=setTimeout(o,e,r);t().then((t=>{clearTimeout(i),n(t)})).catch((t=>{clearTimeout(i),o(t)}))}))}function p(t){const e=new URL("https://teams.microsoft.com/l/entity/"+encodeURIComponent(t.appId.toString())+"/"+encodeURIComponent(t.pageId));return t.webUrl&&e.searchParams.append("webUrl",t.webUrl.toString()),(t.chatId||t.channelId||t.subPageId)&&e.searchParams.append("context",JSON.stringify({chatId:t.chatId,channelId:t.channelId,subEntityId:t.subPageId})),e.toString()}function d(t){return!(i(`${t.majorVersion}.${t.minorVersion}`,`${e.majorVersion}.${e.minorVersion}`)>=0)}function m(t){return"https:"===t.protocol}function h(e,r){return new Promise(((n,o)=>{if(e||o("MimeType cannot be null or empty."),r||o("Base64 string cannot be null or empty."),e.startsWith("image/")){const t=atob(r),o=new Uint8Array(t.length);for(let e=0;e<t.length;e++)o[e]=t.charCodeAt(e);n(new Blob([o],{type:e}))}const i=t.from(r,"base64").toString();n(new Blob([i],{type:e}))}))}function b(t){return new Promise(((e,r)=>{0===t.size&&r(new Error("Blob cannot be empty."));const n=new FileReader;n.onloadend=()=>{n.result?e(n.result.toString().split(",")[1]):r(new Error("Failed to read the blob"))},n.onerror=()=>{r(n.error)},n.readAsDataURL(t)}))}function w(){if(g())throw new Error("window object undefined at SSR check");return window}function g(){return"undefined"==typeof window}function y(t,e){if(v(t)||!function(t){return t.length<256&&t.length>4}(t)||!function(t){for(let e=0;e<t.length;e++){const r=t.charCodeAt(e);if(r<32||r>126)return!1}return!0}(t))throw e||new Error("id is not valid.")}function j(t,e){const r=t.toString().toLocaleLowerCase();if(v(r))throw new Error("Invalid Url");if(r.length>2048)throw new Error("Url exceeds the maximum size of 2048 characters");if(!m(t))throw new Error("Url should be a valid https url")}function E(t){const e=document.createElement("a");return e.href=t,new URL(e.href)}function v(t){return new RegExp(`${/<script[^>]*>|&lt;script[^&]*&gt;|%3Cscript[^%]*%3E/gi.source}|${/<\/script[^>]*>|&lt;\/script[^&]*&gt;|%3C\/script[^%]*%3E/gi.source}`,"gi").test(t)}function I(t){if(!t)throw new Error("id must not be empty");if(!1===n(t))throw new Error("id must be a valid UUID")}const U=!!performance&&"now"in performance;function O(){return U?performance.now()+performance.timeOrigin:void 0}function S(t,e=0){if(e>1e3)return!1;if(void 0===t||"boolean"==typeof t||"number"==typeof t||"bigint"==typeof t||"string"==typeof t||null===t)return!0;if(Array.isArray(t))return t.every((t=>S(t,e+1)));return!("object"!=typeof t||"[object Object]"!==Object.prototype.toString.call(t)||Object.getPrototypeOf(t)!==Object.prototype&&null!==Object.getPrototypeOf(t))&&Object.keys(t).every((r=>S(t[r],e+1)))}export{h as base64ToBlob,s as callCallbackWithErrorOrResultFromPromiseAndReturnPromise,l as callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise,f as callCallbackWithSdkErrorFromPromiseAndReturnPromise,i as compareSDKVersions,p as createTeamsAppLink,u as deepFreeze,E as fullyQualifyUrlString,c as generateGUID,b as getBase64StringFromBlob,O as getCurrentTimestamp,o as getGenericOnCompleteHandler,v as hasScriptTags,g as inServerSideRenderingEnvironment,d as isHostAdaptiveCardSchemaVersionUnsupported,S as isPrimitiveOrPlainObject,m as isValidHttpsURL,a as runWithTimeout,w as ssrSafeWindow,y as validateId,j as validateUrl,I as validateUuid};
1
+ import{Buffer as t}from"../../../../_virtual/_polyfill-node.buffer.js";import{minAdaptiveCardVersion as e}from"../public/constants.js";import{LegalAgeGroupClassification as n}from"../public/interfaces.js";import r from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v4.js";import o from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js";function i(t){return(t,e)=>{if(!t)throw new Error(e)}}function s(t,e){if("string"!=typeof t||"string"!=typeof e)return NaN;const n=t.split("."),r=e.split(".");function o(t){return/^\d+$/.test(t)}if(!n.every(o)||!r.every(o))return NaN;for(;n.length<r.length;)n.push("0");for(;r.length<n.length;)r.push("0");for(let t=0;t<n.length;++t)if(Number(n[t])!=Number(r[t]))return Number(n[t])>Number(r[t])?1:-1;return 0}function u(){return r()}function c(t){return Object.keys(t).forEach((e=>{null!==t[e]&&void 0!==t[e]&&"object"==typeof t[e]&&c(t[e])})),Object.freeze(t)}function a(t,e,...n){const r=t(...n);return r.then((t=>{e&&e(void 0,t)})).catch((t=>{e&&e(t)})),r}function l(t,e,...n){const r=t(...n);return r.then((()=>{e&&e(null)})).catch((t=>{e&&e(t)})),r}function f(t,e,...n){const r=t(...n);return r.then((t=>{e&&e(null,t)})).catch((t=>{e&&e(t,null)})),r}function p(t,e,n){return new Promise(((r,o)=>{const i=setTimeout(o,e,n);t().then((t=>{clearTimeout(i),r(t)})).catch((t=>{clearTimeout(i),o(t)}))}))}function d(t){const e=new URL("https://teams.microsoft.com/l/entity/"+encodeURIComponent(t.appId.toString())+"/"+encodeURIComponent(t.pageId));return t.webUrl&&e.searchParams.append("webUrl",t.webUrl.toString()),(t.chatId||t.channelId||t.subPageId)&&e.searchParams.append("context",JSON.stringify({chatId:t.chatId,channelId:t.channelId,subEntityId:t.subPageId})),e.toString()}function m(t){return!(s(`${t.majorVersion}.${t.minorVersion}`,`${e.majorVersion}.${e.minorVersion}`)>=0)}function h(t){return"https:"===t.protocol}function b(e,n){return new Promise(((r,o)=>{if(e||o("MimeType cannot be null or empty."),n||o("Base64 string cannot be null or empty."),e.startsWith("image/")){const t=atob(n),o=new Uint8Array(t.length);for(let e=0;e<t.length;e++)o[e]=t.charCodeAt(e);r(new Blob([o],{type:e}))}const i=t.from(n,"base64").toString();r(new Blob([i],{type:e}))}))}function g(t){return new Promise(((e,n)=>{0===t.size&&n(new Error("Blob cannot be empty."));const r=new FileReader;r.onloadend=()=>{r.result?e(r.result.toString().split(",")[1]):n(new Error("Failed to read the blob"))},r.onerror=()=>{n(r.error)},r.readAsDataURL(t)}))}function w(){if(y())throw new Error("window object undefined at SSR check");return window}function y(){return"undefined"==typeof window}function j(t,e){if(E(t)||!function(t){return t.length<256&&t.length>4}(t)||!function(t){for(let e=0;e<t.length;e++){const n=t.charCodeAt(e);if(n<32||n>126)return!1}return!0}(t))throw e||new Error("id is not valid.")}function I(t,e){const n=t.toString().toLocaleLowerCase();if(E(n))throw new Error("Invalid Url");if(n.length>2048)throw new Error("Url exceeds the maximum size of 2048 characters");if(!h(t))throw new Error("Url should be a valid https url")}function v(t){const e=document.createElement("a");return e.href=t,new URL(e.href)}function E(t){return new RegExp(`${/<script[^>]*>|&lt;script[^&]*&gt;|%3Cscript[^%]*%3E/gi.source}|${/<\/script[^>]*>|&lt;\/script[^&]*&gt;|%3C\/script[^%]*%3E/gi.source}`,"gi").test(t)}function O(t){if(!t)throw new Error("id must not be empty");if(!1===o(t))throw new Error("id must be a valid UUID")}const U=!!performance&&"now"in performance;function N(){return U?performance.now()+performance.timeOrigin:void 0}function S(t,e=0){if(e>1e3)return!1;if(void 0===t||"boolean"==typeof t||"number"==typeof t||"bigint"==typeof t||"string"==typeof t||null===t)return!0;if(Array.isArray(t))return t.every((t=>S(t,e+1)));return!("object"!=typeof t||"[object Object]"!==Object.prototype.toString.call(t)||Object.getPrototypeOf(t)!==Object.prototype&&null!==Object.getPrototypeOf(t))&&Object.keys(t).every((n=>S(t[n],e+1)))}function P(t){var e,r;if(!(null===(r=null===(e=t.hostVersionsInfo)||void 0===e?void 0:e.appEligibilityInformation)||void 0===r?void 0:r.ageGroup))return t;const o=t.hostVersionsInfo.appEligibilityInformation.ageGroup;return"nonadult"!==(null==o?void 0:o.toLowerCase())?t:Object.assign(Object.assign({},t),{hostVersionsInfo:Object.assign(Object.assign({},t.hostVersionsInfo),{appEligibilityInformation:Object.assign(Object.assign({},t.hostVersionsInfo.appEligibilityInformation),{ageGroup:n.NotAdult})})})}export{b as base64ToBlob,a as callCallbackWithErrorOrResultFromPromiseAndReturnPromise,f as callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise,l as callCallbackWithSdkErrorFromPromiseAndReturnPromise,s as compareSDKVersions,d as createTeamsAppLink,c as deepFreeze,v as fullyQualifyUrlString,u as generateGUID,g as getBase64StringFromBlob,N as getCurrentTimestamp,i as getGenericOnCompleteHandler,E as hasScriptTags,y as inServerSideRenderingEnvironment,m as isHostAdaptiveCardSchemaVersionUnsupported,S as isPrimitiveOrPlainObject,h as isValidHttpsURL,P as normalizeAgeGroupValue,p as runWithTimeout,w as ssrSafeWindow,j as validateId,I as validateUrl,O as validateUuid};
@@ -1 +1 @@
1
- import{__awaiter as i}from"../../../../../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";import{sendAndUnwrap as o}from"../../internal/communication.js";import{ensureInitialized as t}from"../../internal/internalAPIs.js";import{getLogger as r,getApiVersionTag as e}from"../../internal/telemetry.js";import{errorNotSupportedOnPlatform as n}from"../../public/constants.js";import{isSdkError as l}from"../../public/interfaces.js";import{runtime as s}from"../../public/runtime.js";const a=r("copilot");function p(){var i,o;return t(s)&&(!!(null===(i=s.hostVersionsInfo)||void 0===i?void 0:i.appEligibilityInformation)||!!(null===(o=s.supports.copilot)||void 0===o?void 0:o.eligibility))}function u(r){var u,m;return i(this,void 0,void 0,(function*(){if(t(s),!p())throw new Error(`Error code: ${n.errorCode}, message: Not supported on platform`);if((null===(u=s.hostVersionsInfo)||void 0===u?void 0:u.appEligibilityInformation)&&!r)return a("Eligibility information is already available on runtime."),s.hostVersionsInfo.appEligibilityInformation;a("Eligibility information is not available on runtime. Requesting from host.");const i=yield o(e("v2","copilot.eligibility.getEligibilityInfo"),"copilot.eligibility.getEligibilityInfo",r);if(l(i))throw new Error(`Error code: ${i.errorCode}, message: ${null!==(m=i.message)&&void 0!==m?m:"Failed to get eligibility information from the host."}`);if(!function(i){if(void 0===i.ageGroup||void 0===i.cohort||void 0===i.userClassification||void 0===i.isCopilotEligible||void 0===i.isCopilotEnabledRegion||void 0===i.isOptedOutByAdmin||i.featureSet&&(void 0===i.featureSet.serverFeatures||void 0===i.featureSet.uxFeatures))return!1;return!0}(i))throw new Error("Error deserializing eligibility information");return i}))}export{u as getEligibilityInfo,p as isSupported};
1
+ import{__awaiter as i}from"../../../../../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";import{sendAndUnwrap as o}from"../../internal/communication.js";import{ensureInitialized as t}from"../../internal/internalAPIs.js";import{getLogger as r,getApiVersionTag as e}from"../../internal/telemetry.js";import{errorNotSupportedOnPlatform as n}from"../../public/constants.js";import{isSdkError as l,LegalAgeGroupClassification as s}from"../../public/interfaces.js";import{runtime as a}from"../../public/runtime.js";const u=r("copilot");function p(){var i,o;return t(a)&&(!!(null===(i=a.hostVersionsInfo)||void 0===i?void 0:i.appEligibilityInformation)||!!(null===(o=a.supports.copilot)||void 0===o?void 0:o.eligibility))}function d(r){var d,m,f;return i(this,void 0,void 0,(function*(){if(t(a),!p())throw new Error(`Error code: ${n.errorCode}, message: Not supported on platform`);if((null===(d=a.hostVersionsInfo)||void 0===d?void 0:d.appEligibilityInformation)&&!r)return u("Eligibility information is already available on runtime."),a.hostVersionsInfo.appEligibilityInformation;u("Eligibility information is not available on runtime. Requesting from host.");const i=yield o(e("v2","copilot.eligibility.getEligibilityInfo"),"copilot.eligibility.getEligibilityInfo",r);if(l(i))throw new Error(`Error code: ${i.errorCode}, message: ${null!==(m=i.message)&&void 0!==m?m:"Failed to get eligibility information from the host."}`);if(!function(i){if(void 0===i.ageGroup||void 0===i.cohort||void 0===i.userClassification||void 0===i.isCopilotEligible||void 0===i.isCopilotEnabledRegion||void 0===i.isOptedOutByAdmin||i.featureSet&&(void 0===i.featureSet.serverFeatures||void 0===i.featureSet.uxFeatures))return!1;return!0}(i))throw new Error("Error deserializing eligibility information");return"nonadult"===(null===(f=i.ageGroup)||void 0===f?void 0:f.toLowerCase())&&(i.ageGroup=s.NotAdult),i}))}export{d as getEligibilityInfo,p as isSupported};
@@ -1 +1 @@
1
- import{appInitializeHelper as e,notifyAppLoadedHelper as i,notifySuccessHelper as t,notifyFailureHelper as n,notifyExpectedFailureHelper as a,registerOnThemeChangeHandlerHelper as o,openLinkHelper as r}from"../../internal/appHelpers.js";import{uninitializeCommunication as s,sendAndUnwrap as l,Communication as m}from"../../internal/communication.js";import{GlobalVars as d}from"../../internal/globalVars.js";import{uninitializeHandlers as p,registerHostToAppPerformanceMetricsHandler as c}from"../../internal/handlers.js";import{ensureInitializeCalled as u}from"../../internal/internalAPIs.js";import{getLogger as f,getApiVersionTag as h}from"../../internal/telemetry.js";import{inServerSideRenderingEnvironment as g}from"../../internal/utils.js";import{AppId as I}from"../appId.js";import{HostName as y,HostClientType as S}from"../constants.js";import{version as T}from"../version.js";import*as C from"./lifecycle.js";export{C as lifecycle};import{_clearTelemetryPort as v}from"../../private/messageChannels/telemetry.js";import{_clearDataLayerPort as P}from"../../private/messageChannels/dataLayer.js";const j="v2",w=f("app"),N={AppLoaded:"appInitialization.appLoaded",Success:"appInitialization.success",Failure:"appInitialization.failure",ExpectedFailure:"appInitialization.expectedFailure"};var O,b;function F(){return d.initializeCompleted}function x(){return d.frameContext}function L(i){return e(h(j,"app.initialize"),i)}function A(e){m.currentWindow=e}function z(){d.initializeCalled&&(p(),d.initializeCalled=!1,d.initializeCompleted=!1,d.initializePromise=void 0,d.additionalValidOrigins=[],d.frameContext=void 0,d.hostClientType=void 0,d.isFramelessWindow=!1,v(),P(),s())}function D(){return new Promise((e=>{u(),e(l(h(j,"app.getContext"),"getContext"))})).then((e=>function(e){var i;const t={actionInfo:e.actionInfo,app:{locale:e.locale,sessionId:e.appSessionId?e.appSessionId:"",theme:e.theme?e.theme:"default",iconPositionVertical:e.appIconPosition,osLocaleInfo:e.osLocaleInfo,parentMessageId:e.parentMessageId,userClickTime:e.userClickTime,userClickTimeV2:e.userClickTimeV2,userFileOpenPreference:e.userFileOpenPreference,host:{name:e.hostName?e.hostName:y.teams,clientType:e.hostClientType?e.hostClientType:S.web,sessionId:e.sessionId?e.sessionId:"",ringId:e.ringId},appLaunchId:e.appLaunchId,appId:e.appId?new I(e.appId):void 0,manifestVersion:e.manifestVersion},page:{id:e.entityId,frameContext:e.frameContext?e.frameContext:d.frameContext,renderingSurface:e.renderingSurface?e.renderingSurface:void 0,subPageId:e.subEntityId,isFullScreen:e.isFullScreen,isMultiWindow:e.isMultiWindow,isBackgroundLoad:e.isBackgroundLoad,sourceOrigin:e.sourceOrigin},user:{id:null!==(i=e.userObjectId)&&void 0!==i?i:"",displayName:e.userDisplayName,isCallingAllowed:e.isCallingAllowed,isPSTNCallingAllowed:e.isPSTNCallingAllowed,licenseType:e.userLicenseType,loginHint:e.loginHint,userPrincipalName:e.userPrincipalName,tenant:e.tid?{id:e.tid,teamsSku:e.tenantSKU}:void 0},channel:e.channelId?{id:e.channelId,displayName:e.channelName,relativeUrl:e.channelRelativeUrl,membershipType:e.channelType,defaultOneNoteSectionId:e.defaultOneNoteSectionId,ownerGroupId:e.hostTeamGroupId,ownerTenantId:e.hostTeamTenantId}:void 0,chat:e.chatId?{id:e.chatId}:void 0,meeting:e.meetingId?{id:e.meetingId}:void 0,sharepoint:e.sharepoint,team:e.teamId?{internalId:e.teamId,displayName:e.teamName,type:e.teamType,groupId:e.groupId,templateId:e.teamTemplateId,isArchived:e.isTeamArchived,userRole:e.userTeamRole}:void 0,sharePointSite:e.teamSiteUrl||e.teamSiteDomain||e.teamSitePath||e.mySitePath||e.mySiteDomain?{teamSiteUrl:e.teamSiteUrl,teamSiteDomain:e.teamSiteDomain,teamSitePath:e.teamSitePath,teamSiteId:e.teamSiteId,mySitePath:e.mySitePath,mySiteDomain:e.mySiteDomain}:void 0,dialogParameters:e.dialogParameters||{}};return t}(e)))}function k(){u(),i(h(j,"app.notifyAppLoaded"))}function U(){return t(h(j,"app.notifySuccess"))}function V(e){u(),n(h(j,"app.notifyFailure"),e)}function E(e){u(),a(h(j,"app.notifyExpectedFailure"),e)}function H(e){o(h(j,"app.registerOnThemeChangeHandler"),e)}function M(e){c(e)}function W(e){return r(h(j,"app.openLink"),e)}!function(e){e.AuthFailed="AuthFailed",e.Timeout="Timeout",e.Other="Other"}(O||(O={})),function(e){e.PermissionError="PermissionError",e.NotFound="NotFound",e.Throttling="Throttling",e.Offline="Offline",e.Other="Other"}(b||(b={})),w("teamsjs instance is version %s, starting at %s UTC (%s local)",T,(new Date).toISOString(),(new Date).toLocaleString()),function(){if(g())return;const e=document.getElementsByTagName("script"),i=e&&e[e.length-1]&&e[e.length-1].src,t="Today, teamsjs can only be used from a single script or you may see undefined behavior. This log line is used to help detect cases where teamsjs is loaded multiple times -- it is always written. The presence of the log itself does not indicate a multi-load situation, but multiples of these log lines will. If you would like to use teamjs from more than one script at the same time, please open an issue at https://github.com/OfficeDev/microsoft-teams-library-js/issues";i&&0!==i.length?w("teamsjs is being used from %s. %s",i,t):w("teamsjs is being used from a script tag embedded directly in your html. %s",t)}();export{b as ExpectedFailureReason,O as FailedReason,N as Messages,A as _initialize,z as _uninitialize,D as getContext,x as getFrameContext,L as initialize,F as isInitialized,k as notifyAppLoaded,E as notifyExpectedFailure,V as notifyFailure,U as notifySuccess,W as openLink,M as registerHostToAppPerformanceMetricsHandler,H as registerOnThemeChangeHandler};
1
+ import{appInitializeHelper as e,notifyAppLoadedHelper as i,notifySuccessHelper as t,notifyFailureHelper as n,notifyExpectedFailureHelper as a,registerOnThemeChangeHandlerHelper as o,openLinkHelper as s}from"../../internal/appHelpers.js";import{uninitializeCommunication as r,sendAndUnwrap as l,Communication as m}from"../../internal/communication.js";import{GlobalVars as d}from"../../internal/globalVars.js";import{uninitializeHandlers as p,registerHostToAppPerformanceMetricsHandler as c}from"../../internal/handlers.js";import{ensureInitializeCalled as u}from"../../internal/internalAPIs.js";import{getLogger as f,getApiVersionTag as h}from"../../internal/telemetry.js";import{inServerSideRenderingEnvironment as g}from"../../internal/utils.js";import{AppId as I}from"../appId.js";import{HostName as y,HostClientType as S}from"../constants.js";import{version as T}from"../version.js";import*as C from"./lifecycle.js";export{C as lifecycle};import{_clearTelemetryPort as v}from"../../private/messageChannels/telemetry.js";import{_clearDataLayerPort as P}from"../../private/messageChannels/dataLayer.js";const j="v2",w=f("app"),N={AppLoaded:"appInitialization.appLoaded",Success:"appInitialization.success",Failure:"appInitialization.failure",ExpectedFailure:"appInitialization.expectedFailure"};var O,b;function F(){return d.initializeCompleted}function x(){return d.frameContext}function L(i){return e(h(j,"app.initialize"),i)}function A(e){m.currentWindow=e}function z(){d.initializeCalled&&(p(),d.initializeCalled=!1,d.initializeCompleted=!1,d.initializePromise=void 0,d.additionalValidOrigins=[],d.frameContext=void 0,d.hostClientType=void 0,d.isFramelessWindow=!1,v(),P(),r())}function D(){return new Promise((e=>{u(),e(l(h(j,"app.getContext"),"getContext"))})).then((e=>function(e){var i;const t={actionInfo:e.actionInfo,app:{locale:e.locale,sessionId:e.appSessionId?e.appSessionId:"",theme:e.theme?e.theme:"default",iconPositionVertical:e.appIconPosition,osLocaleInfo:e.osLocaleInfo,messageId:e.messageId,parentMessageId:e.parentMessageId,userClickTime:e.userClickTime,userClickTimeV2:e.userClickTimeV2,userFileOpenPreference:e.userFileOpenPreference,host:{name:e.hostName?e.hostName:y.teams,clientType:e.hostClientType?e.hostClientType:S.web,sessionId:e.sessionId?e.sessionId:"",ringId:e.ringId},appLaunchId:e.appLaunchId,appId:e.appId?new I(e.appId):void 0,manifestVersion:e.manifestVersion},page:{id:e.entityId,frameContext:e.frameContext?e.frameContext:d.frameContext,renderingSurface:e.renderingSurface?e.renderingSurface:void 0,subPageId:e.subEntityId,isFullScreen:e.isFullScreen,isMultiWindow:e.isMultiWindow,isBackgroundLoad:e.isBackgroundLoad,sourceOrigin:e.sourceOrigin},user:{id:null!==(i=e.userObjectId)&&void 0!==i?i:"",displayName:e.userDisplayName,isCallingAllowed:e.isCallingAllowed,isPSTNCallingAllowed:e.isPSTNCallingAllowed,licenseType:e.userLicenseType,loginHint:e.loginHint,userPrincipalName:e.userPrincipalName,tenant:e.tid?{id:e.tid,teamsSku:e.tenantSKU}:void 0},channel:e.channelId?{id:e.channelId,displayName:e.channelName,relativeUrl:e.channelRelativeUrl,membershipType:e.channelType,defaultOneNoteSectionId:e.defaultOneNoteSectionId,ownerGroupId:e.hostTeamGroupId,ownerTenantId:e.hostTeamTenantId}:void 0,chat:e.chatId?{id:e.chatId}:void 0,meeting:e.meetingId?{id:e.meetingId}:void 0,sharepoint:e.sharepoint,team:e.teamId?{internalId:e.teamId,displayName:e.teamName,type:e.teamType,groupId:e.groupId,templateId:e.teamTemplateId,isArchived:e.isTeamArchived,userRole:e.userTeamRole}:void 0,sharePointSite:e.teamSiteUrl||e.teamSiteDomain||e.teamSitePath||e.mySitePath||e.mySiteDomain?{teamSiteUrl:e.teamSiteUrl,teamSiteDomain:e.teamSiteDomain,teamSitePath:e.teamSitePath,teamSiteId:e.teamSiteId,mySitePath:e.mySitePath,mySiteDomain:e.mySiteDomain}:void 0,dialogParameters:e.dialogParameters||{}};return t}(e)))}function k(){u(),i(h(j,"app.notifyAppLoaded"))}function U(){return t(h(j,"app.notifySuccess"))}function V(e){u(),n(h(j,"app.notifyFailure"),e)}function E(e){u(),a(h(j,"app.notifyExpectedFailure"),e)}function H(e){o(h(j,"app.registerOnThemeChangeHandler"),e)}function M(e){c(e)}function W(e){return s(h(j,"app.openLink"),e)}!function(e){e.AuthFailed="AuthFailed",e.Timeout="Timeout",e.Other="Other"}(O||(O={})),function(e){e.PermissionError="PermissionError",e.NotFound="NotFound",e.Throttling="Throttling",e.Offline="Offline",e.Other="Other"}(b||(b={})),w("teamsjs instance is version %s, starting at %s UTC (%s local)",T,(new Date).toISOString(),(new Date).toLocaleString()),function(){if(g())return;const e=document.getElementsByTagName("script"),i=e&&e[e.length-1]&&e[e.length-1].src,t="Today, teamsjs can only be used from a single script or you may see undefined behavior. This log line is used to help detect cases where teamsjs is loaded multiple times -- it is always written. The presence of the log itself does not indicate a multi-load situation, but multiples of these log lines will. If you would like to use teamjs from more than one script at the same time, please open an issue at https://github.com/OfficeDev/microsoft-teams-library-js/issues";i&&0!==i.length?w("teamsjs is being used from %s. %s",i,t):w("teamsjs is being used from a script tag embedded directly in your html. %s",t)}();export{b as ExpectedFailureReason,O as FailedReason,N as Messages,A as _initialize,z as _uninitialize,D as getContext,x as getFrameContext,L as initialize,F as isInitialized,k as notifyAppLoaded,E as notifyExpectedFailure,V as notifyFailure,U as notifySuccess,W as openLink,M as registerHostToAppPerformanceMetricsHandler,H as registerOnThemeChangeHandler};
@@ -1 +1 @@
1
- var n,e,t,E,O,R,o,T,N,_;function i(n){return void 0!==(null==n?void 0:n.errorCode)}!function(n){n.Inline="inline",n.Desktop="desktop",n.Web="web"}(n||(n={})),function(n){n.M365Content="m365content"}(e||(e={})),function(n){n.DriveId="driveId",n.GroupId="groupId",n.SiteId="siteId",n.UserId="userId"}(t||(t={})),function(n){n[n.NOT_SUPPORTED_ON_PLATFORM=100]="NOT_SUPPORTED_ON_PLATFORM",n[n.INTERNAL_ERROR=500]="INTERNAL_ERROR",n[n.NOT_SUPPORTED_IN_CURRENT_CONTEXT=501]="NOT_SUPPORTED_IN_CURRENT_CONTEXT",n[n.PERMISSION_DENIED=1e3]="PERMISSION_DENIED",n[n.NETWORK_ERROR=2e3]="NETWORK_ERROR",n[n.NO_HW_SUPPORT=3e3]="NO_HW_SUPPORT",n[n.INVALID_ARGUMENTS=4e3]="INVALID_ARGUMENTS",n[n.UNAUTHORIZED_USER_OPERATION=5e3]="UNAUTHORIZED_USER_OPERATION",n[n.INSUFFICIENT_RESOURCES=6e3]="INSUFFICIENT_RESOURCES",n[n.THROTTLE=7e3]="THROTTLE",n[n.USER_ABORT=8e3]="USER_ABORT",n[n.OPERATION_TIMED_OUT=8001]="OPERATION_TIMED_OUT",n[n.OLD_PLATFORM=9e3]="OLD_PLATFORM",n[n.FILE_NOT_FOUND=404]="FILE_NOT_FOUND",n[n.SIZE_EXCEEDED=1e4]="SIZE_EXCEEDED"}(E||(E={})),function(n){n.GeoLocation="geolocation",n.Media="media"}(O||(O={})),function(n){n.BCAIS="bcais",n.BCWAF="bcwaf",n.BCWBF="bcwbf"}(R||(R={})),function(n){n.Faculty="faculty",n.Student="student",n.Other="other"}(o||(o={})),function(n){n.Adult="adult",n.MinorNoParentalConsentRequired="minorNoParentalConsentRequired",n.MinorWithoutParentalConsent="minorWithoutParentalConsent",n.MinorWithParentalConsent="minorWithParentalConsent",n.NonAdult="nonAdult"}(T||(T={})),function(n){n.HigherEducation="higherEducation",n.K12="k12",n.Other="other"}(N||(N={})),function(n){n.TextPlain="text/plain",n.TextHtml="text/html",n.ImagePNG="image/png",n.ImageJPEG="image/jpeg"}(_||(_={}));export{e as ActionObjectType,_ as ClipboardSupportedMimeType,R as Cohort,O as DevicePermission,N as EduType,E as ErrorCode,n as FileOpenPreference,T as LegalAgeGroupClassification,o as Persona,t as SecondaryM365ContentIdName,i as isSdkError};
1
+ var t,n,e,E,O,R,o,T,N,_;function i(t){return void 0!==(null==t?void 0:t.errorCode)}!function(t){t.Inline="inline",t.Desktop="desktop",t.Web="web"}(t||(t={})),function(t){t.M365Content="m365content"}(n||(n={})),function(t){t.DriveId="driveId",t.GroupId="groupId",t.SiteId="siteId",t.UserId="userId"}(e||(e={})),function(t){t[t.NOT_SUPPORTED_ON_PLATFORM=100]="NOT_SUPPORTED_ON_PLATFORM",t[t.INTERNAL_ERROR=500]="INTERNAL_ERROR",t[t.NOT_SUPPORTED_IN_CURRENT_CONTEXT=501]="NOT_SUPPORTED_IN_CURRENT_CONTEXT",t[t.PERMISSION_DENIED=1e3]="PERMISSION_DENIED",t[t.NETWORK_ERROR=2e3]="NETWORK_ERROR",t[t.NO_HW_SUPPORT=3e3]="NO_HW_SUPPORT",t[t.INVALID_ARGUMENTS=4e3]="INVALID_ARGUMENTS",t[t.UNAUTHORIZED_USER_OPERATION=5e3]="UNAUTHORIZED_USER_OPERATION",t[t.INSUFFICIENT_RESOURCES=6e3]="INSUFFICIENT_RESOURCES",t[t.THROTTLE=7e3]="THROTTLE",t[t.USER_ABORT=8e3]="USER_ABORT",t[t.OPERATION_TIMED_OUT=8001]="OPERATION_TIMED_OUT",t[t.OLD_PLATFORM=9e3]="OLD_PLATFORM",t[t.FILE_NOT_FOUND=404]="FILE_NOT_FOUND",t[t.SIZE_EXCEEDED=1e4]="SIZE_EXCEEDED"}(E||(E={})),function(t){t.GeoLocation="geolocation",t.Media="media"}(O||(O={})),function(t){t.BCAIS="bcais",t.BCWAF="bcwaf",t.BCWBF="bcwbf"}(R||(R={})),function(t){t.Faculty="faculty",t.Student="student",t.Other="other"}(o||(o={})),function(t){t.Adult="adult",t.MinorNoParentalConsentRequired="minorNoParentalConsentRequired",t.MinorWithoutParentalConsent="minorWithoutParentalConsent",t.MinorWithParentalConsent="minorWithParentalConsent",t.NotAdult="notAdult",t.NonAdult="notAdult"}(T||(T={})),function(t){t.HigherEducation="higherEducation",t.K12="k12",t.Other="other"}(N||(N={})),function(t){t.TextPlain="text/plain",t.TextHtml="text/html",t.ImagePNG="image/png",t.ImageJPEG="image/jpeg"}(_||(_={}));export{n as ActionObjectType,_ as ClipboardSupportedMimeType,R as Cohort,O as DevicePermission,N as EduType,E as ErrorCode,t as FileOpenPreference,T as LegalAgeGroupClassification,o as Persona,e as SecondaryM365ContentIdName,i as isSdkError};
@@ -1 +1 @@
1
- const o="2.41.0";export{o as version};
1
+ const o="2.42.0";export{o as version};
@@ -2211,7 +2211,12 @@ var LegalAgeGroupClassification;
2211
2211
  * United Kingdom, European Union, or South Korea, and the user's age is between a minor and an adult age
2212
2212
  * (as stipulated based on country or region). Generally, this means that teenagers are considered as notAdult in regulated countries.
2213
2213
  */
2214
- LegalAgeGroupClassification["NonAdult"] = "nonAdult";
2214
+ LegalAgeGroupClassification["NotAdult"] = "notAdult";
2215
+ /**
2216
+ * @deprecated To provide back compatibility for the NonAdult enum value coming from the hubs
2217
+ */
2218
+ // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
2219
+ LegalAgeGroupClassification["NonAdult"] = "notAdult";
2215
2220
  })(LegalAgeGroupClassification || (LegalAgeGroupClassification = {}));
2216
2221
  /**
2217
2222
  * @hidden
@@ -2245,7 +2250,7 @@ var ClipboardSupportedMimeType;
2245
2250
  })(ClipboardSupportedMimeType || (ClipboardSupportedMimeType = {}));
2246
2251
 
2247
2252
  ;// ./src/artifactsForCDN/validDomains.json
2248
- 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.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"]}');
2253
+ 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"]}');
2249
2254
  var artifactsForCDN_validDomains_namespaceObject = /*#__PURE__*/__webpack_require__.t(validDomains_namespaceObject, 2);
2250
2255
  ;// ./src/internal/constants.ts
2251
2256
 
@@ -3597,6 +3602,7 @@ const errorInvalidResponse = new Error('Invalid response: Received more images t
3597
3602
 
3598
3603
 
3599
3604
 
3605
+
3600
3606
  /**
3601
3607
  * @internal
3602
3608
  * Limited to Microsoft-internal use
@@ -4074,6 +4080,25 @@ function isPrimitiveOrPlainObject(value, depth = 0) {
4074
4080
  // Check all properties of the object recursively
4075
4081
  return Object.keys(value).every((key) => isPrimitiveOrPlainObject(value[key], depth + 1));
4076
4082
  }
4083
+ /**
4084
+ * Normalizes legacy ageGroup values for backward compatibility
4085
+ * @param runtimeConfig - The runtime configuration object to normalize
4086
+ * @returns A new IBaseRuntime object with normalized ageGroup values
4087
+ */
4088
+ function normalizeAgeGroupValue(runtimeConfig) {
4089
+ var _a, _b;
4090
+ // If no ageGroup exists, return the original config
4091
+ if (!((_b = (_a = runtimeConfig.hostVersionsInfo) === null || _a === void 0 ? void 0 : _a.appEligibilityInformation) === null || _b === void 0 ? void 0 : _b.ageGroup)) {
4092
+ return runtimeConfig;
4093
+ }
4094
+ const ageGroup = runtimeConfig.hostVersionsInfo.appEligibilityInformation.ageGroup;
4095
+ // If the ageGroup doesn't need normalization, return the original config
4096
+ if ((ageGroup === null || ageGroup === void 0 ? void 0 : ageGroup.toLowerCase()) !== 'nonadult') {
4097
+ return runtimeConfig;
4098
+ }
4099
+ // Create a new config with the normalized ageGroup value
4100
+ return Object.assign(Object.assign({}, runtimeConfig), { hostVersionsInfo: Object.assign(Object.assign({}, runtimeConfig.hostVersionsInfo), { appEligibilityInformation: Object.assign(Object.assign({}, runtimeConfig.hostVersionsInfo.appEligibilityInformation), { ageGroup: LegalAgeGroupClassification.NotAdult }) }) });
4101
+ }
4077
4102
 
4078
4103
  ;// ./src/public/uuidObject.ts
4079
4104
 
@@ -4607,7 +4632,7 @@ function isSerializable(arg) {
4607
4632
  * @hidden
4608
4633
  * Package version.
4609
4634
  */
4610
- const version = "2.41.0";
4635
+ const version = "2.42.0";
4611
4636
 
4612
4637
  ;// ./src/public/featureFlags.ts
4613
4638
  // 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.
@@ -5489,6 +5514,7 @@ function transformLegacyContextToAppContext(legacyContext) {
5489
5514
  theme: legacyContext.theme ? legacyContext.theme : 'default',
5490
5515
  iconPositionVertical: legacyContext.appIconPosition,
5491
5516
  osLocaleInfo: legacyContext.osLocaleInfo,
5517
+ messageId: legacyContext.messageId,
5492
5518
  parentMessageId: legacyContext.parentMessageId,
5493
5519
  userClickTime: legacyContext.userClickTime,
5494
5520
  userClickTimeV2: legacyContext.userClickTimeV2,
@@ -6575,12 +6601,14 @@ function initializeHelper(apiVersionTag, validMessageOrigins) {
6575
6601
  // After Teams updates its client code, we can remove this default code.
6576
6602
  try {
6577
6603
  initializeHelperLogger('Parsing %s', runtimeConfig);
6578
- const givenRuntimeConfig = JSON.parse(runtimeConfig);
6604
+ let givenRuntimeConfig = JSON.parse(runtimeConfig);
6579
6605
  initializeHelperLogger('Checking if %o is a valid runtime object', givenRuntimeConfig !== null && givenRuntimeConfig !== void 0 ? givenRuntimeConfig : 'null');
6580
6606
  // Check that givenRuntimeConfig is a valid instance of IBaseRuntime
6581
6607
  if (!givenRuntimeConfig || !givenRuntimeConfig.apiVersion) {
6582
6608
  throw new Error('Received runtime config is invalid');
6583
6609
  }
6610
+ // Normalize ageGroup value for backward compatibility
6611
+ givenRuntimeConfig = normalizeAgeGroupValue(givenRuntimeConfig);
6584
6612
  runtimeConfig && applyRuntimeConfig(givenRuntimeConfig);
6585
6613
  }
6586
6614
  catch (e) {
@@ -6594,12 +6622,13 @@ function initializeHelper(apiVersionTag, validMessageOrigins) {
6594
6622
  if (!isNaN(compareSDKVersions(runtimeConfig, defaultSDKVersionForCompatCheck))) {
6595
6623
  GlobalVars.clientSupportedSDKVersion = runtimeConfig;
6596
6624
  }
6597
- const givenRuntimeConfig = JSON.parse(clientSupportedSDKVersion);
6625
+ let givenRuntimeConfig = JSON.parse(clientSupportedSDKVersion);
6598
6626
  initializeHelperLogger('givenRuntimeConfig parsed to %o', givenRuntimeConfig !== null && givenRuntimeConfig !== void 0 ? givenRuntimeConfig : 'null');
6599
6627
  if (!givenRuntimeConfig) {
6600
6628
  throw new Error('givenRuntimeConfig string was successfully parsed. However, it parsed to value of null');
6601
6629
  }
6602
6630
  else {
6631
+ givenRuntimeConfig = normalizeAgeGroupValue(givenRuntimeConfig);
6603
6632
  applyRuntimeConfig(givenRuntimeConfig);
6604
6633
  }
6605
6634
  }
@@ -9431,7 +9460,7 @@ function eligibility_isSupported() {
9431
9460
  * @beta
9432
9461
  */
9433
9462
  function getEligibilityInfo(forceRefresh) {
9434
- var _a, _b;
9463
+ var _a, _b, _c;
9435
9464
  return eligibility_awaiter(this, void 0, void 0, function* () {
9436
9465
  ensureInitialized(runtime);
9437
9466
  if (!eligibility_isSupported()) {
@@ -9452,6 +9481,10 @@ function getEligibilityInfo(forceRefresh) {
9452
9481
  if (!isEligibilityInfoValid(response)) {
9453
9482
  throw new Error('Error deserializing eligibility information');
9454
9483
  }
9484
+ // convert nonAdult age group to NotAdult
9485
+ if (((_c = response.ageGroup) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'nonadult') {
9486
+ response.ageGroup = LegalAgeGroupClassification.NotAdult;
9487
+ }
9455
9488
  return response;
9456
9489
  });
9457
9490
  }