@microsoft/teams-js 2.40.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.40.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.40.0/js/MicrosoftTeams.min.js"
49
- integrity="sha384-QXdQxWIYy1PLsb9pdWIm5k6mjLxVKAF4ISp0BVCZZCiZNyaKXinYNAQVT8+8hEIf"
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.40.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>
@@ -88,6 +88,7 @@ export declare const enum ApiName {
88
88
  Copilot_SidePanel_RegisterOnUserConsentChange = "copilot.sidePanel.registerOnUserConsentChange",
89
89
  Copilot_SidePanel_GetContent = "copilot.sidePanel.getContent",
90
90
  Copilot_SidePanel_PreCheckUserConsent = "copilot.sidePanel.preCheckUserConsent",
91
+ Copilot_View_CloseSidePanel = "copilot.view.closeSidePanel",
91
92
  Dialog_AdaptiveCard_Bot_Open = "dialog.adaptiveCard.bot.open",
92
93
  Dialog_AdaptiveCard_Open = "dialog.adaptiveCard.open",
93
94
  Dialog_RegisterMessageForChildHandler = "dialog.registerMessageForChildHandler",
@@ -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;
@@ -1,4 +1,5 @@
1
1
  import * as customTelemetry from './customTelemetry';
2
2
  import * as eligibility from './eligibility';
3
3
  import * as sidePanel from './sidePanel';
4
- export { customTelemetry, eligibility, sidePanel };
4
+ import * as view from './view';
5
+ export { customTelemetry, eligibility, sidePanel, view };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @hidden
3
+ * @internal
4
+ * Limited to Microsoft-internal use
5
+ * @beta
6
+ * @returns boolean to represent whether copilot.view capability is supported
7
+ *
8
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
9
+ */
10
+ export declare function isSupported(): boolean;
11
+ /**
12
+ * Closes the side panel that is hosting the copilot app.
13
+ *
14
+ * @throws { Error } - Throws a Error if host SDK returns an error as a response to this call
15
+ *
16
+ * @hidden
17
+ * @beta
18
+ * @internal
19
+ * Limited to Microsoft-internal use
20
+ */
21
+ export declare function closeSidePanel(): Promise<void>;
@@ -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.
@@ -103,9 +103,17 @@ export declare enum FrameContexts {
103
103
  */
104
104
  export declare enum RenderingSurfaces {
105
105
  /**
106
- * The mode the copilot app rendered by the host.
106
+ * Copilot running as a side panel in the host application.
107
107
  */
108
- copilotSidePanel = "copilotSidePanel"
108
+ copilotSidePanel = "copilotSidePanel",
109
+ /**
110
+ * Copilot running in the main pane of the host application.
111
+ */
112
+ copilotMainPane = "copilotMainPane",
113
+ /**
114
+ * Copilot running in full screen mode as an embedded app in the host application.
115
+ */
116
+ copilotFullScreen = "copilotFullScreen"
109
117
  }
110
118
  /**
111
119
  * Indicates the team type, currently used to distinguish between different team
@@ -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
@@ -34,6 +34,7 @@ interface IRuntimeV4 extends IBaseRuntime {
34
34
  readonly customTelemetry?: {};
35
35
  readonly eligibility?: {};
36
36
  readonly sidePanel?: {};
37
+ readonly view?: {};
37
38
  };
38
39
  readonly dialog?: {
39
40
  readonly card?: {
@@ -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*as o from"./customTelemetry.js";export{o as customTelemetry};import*as r from"./eligibility.js";export{r as eligibility};import*as e from"./sidePanel.js";export{e as sidePanel};
1
+ import*as o from"./customTelemetry.js";export{o as customTelemetry};import*as r from"./eligibility.js";export{r as eligibility};import*as e from"./sidePanel.js";export{e as sidePanel};import*as t from"./view.js";export{t as view};
@@ -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};
@@ -0,0 +1 @@
1
+ import{__awaiter as e}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{callFunctionInHostAndHandleResponse as i}from"../../internal/communication.js";import{ensureInitialized as o}from"../../internal/internalAPIs.js";import{ResponseHandler as r}from"../../internal/responseHandler.js";import{getApiVersionTag as t}from"../../internal/telemetry.js";import{runtime as n}from"../../public/runtime.js";function l(){var e;return o(n)&&!!(null===(e=n.supports.copilot)||void 0===e?void 0:e.view)}function s(){return e(this,void 0,void 0,(function*(){o(n),yield i("copilot.view.closeSidePanel",[],new p,t("v2","copilot.view.closeSidePanel"))}))}class p extends r{validate(e){return!0}deserialize(e){return e}}export{s as closeSidePanel,l 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
- import{ErrorCode as e}from"./interfaces.js";var o,a,i,s,n,t,r,m;!function(e){e.desktop="desktop",e.web="web",e.android="android",e.ios="ios",e.ipados="ipados",e.macos="macos",e.visionOS="visionOS",e.rigel="rigel",e.surfaceHub="surfaceHub",e.teamsRoomsWindows="teamsRoomsWindows",e.teamsRoomsAndroid="teamsRoomsAndroid",e.teamsPhones="teamsPhones",e.teamsDisplays="teamsDisplays"}(o||(o={})),function(e){e.office="Office",e.outlook="Outlook",e.outlookWin32="OutlookWin32",e.orange="Orange",e.places="Places",e.teams="Teams",e.teamsModern="TeamsModern"}(a||(a={})),function(e){e.settings="settings",e.content="content",e.authentication="authentication",e.remove="remove",e.task="task",e.sidePanel="sidePanel",e.stage="stage",e.meetingStage="meetingStage"}(i||(i={})),function(e){e.copilotSidePanel="copilotSidePanel"}(s||(s={})),function(e){e[e.Standard=0]="Standard",e[e.Edu=1]="Edu",e[e.Class=2]="Class",e[e.Plc=3]="Plc",e[e.Staff=4]="Staff"}(n||(n={})),function(e){e[e.Admin=0]="Admin",e[e.User=1]="User",e[e.Guest=2]="Guest"}(t||(t={})),function(e){e.Large="large",e.Medium="medium",e.Small="small"}(r||(r={})),function(e){e.Regular="Regular",e.Private="Private",e.Shared="Shared"}(m||(m={}));const d={errorCode:e.NOT_SUPPORTED_ON_PLATFORM},l={majorVersion:1,minorVersion:5},u={adaptiveCardSchemaVersion:{majorVersion:1,minorVersion:5}},c=new Error("Invalid input count: Must supply a valid image count (limit of 10)."),f=new Error("Invalid response: Received more images than the specified max limit in the response.");export{m as ChannelType,r as DialogDimension,i as FrameContexts,o as HostClientType,a as HostName,s as RenderingSurfaces,r as TaskModuleDimension,n as TeamType,t as UserTeamRole,c as errorInvalidCount,f as errorInvalidResponse,d as errorNotSupportedOnPlatform,l as minAdaptiveCardVersion,u as teamsMinAdaptiveCardVersion};
1
+ import{ErrorCode as e}from"./interfaces.js";var o,i,a,n,s,t,r,m;!function(e){e.desktop="desktop",e.web="web",e.android="android",e.ios="ios",e.ipados="ipados",e.macos="macos",e.visionOS="visionOS",e.rigel="rigel",e.surfaceHub="surfaceHub",e.teamsRoomsWindows="teamsRoomsWindows",e.teamsRoomsAndroid="teamsRoomsAndroid",e.teamsPhones="teamsPhones",e.teamsDisplays="teamsDisplays"}(o||(o={})),function(e){e.office="Office",e.outlook="Outlook",e.outlookWin32="OutlookWin32",e.orange="Orange",e.places="Places",e.teams="Teams",e.teamsModern="TeamsModern"}(i||(i={})),function(e){e.settings="settings",e.content="content",e.authentication="authentication",e.remove="remove",e.task="task",e.sidePanel="sidePanel",e.stage="stage",e.meetingStage="meetingStage"}(a||(a={})),function(e){e.copilotSidePanel="copilotSidePanel",e.copilotMainPane="copilotMainPane",e.copilotFullScreen="copilotFullScreen"}(n||(n={})),function(e){e[e.Standard=0]="Standard",e[e.Edu=1]="Edu",e[e.Class=2]="Class",e[e.Plc=3]="Plc",e[e.Staff=4]="Staff"}(s||(s={})),function(e){e[e.Admin=0]="Admin",e[e.User=1]="User",e[e.Guest=2]="Guest"}(t||(t={})),function(e){e.Large="large",e.Medium="medium",e.Small="small"}(r||(r={})),function(e){e.Regular="Regular",e.Private="Private",e.Shared="Shared"}(m||(m={}));const l={errorCode:e.NOT_SUPPORTED_ON_PLATFORM},d={majorVersion:1,minorVersion:5},c={adaptiveCardSchemaVersion:{majorVersion:1,minorVersion:5}},u=new Error("Invalid input count: Must supply a valid image count (limit of 10)."),f=new Error("Invalid response: Received more images than the specified max limit in the response.");export{m as ChannelType,r as DialogDimension,a as FrameContexts,o as HostClientType,i as HostName,n as RenderingSurfaces,r as TaskModuleDimension,s as TeamType,t as UserTeamRole,u as errorInvalidCount,f as errorInvalidResponse,l as errorNotSupportedOnPlatform,d as minAdaptiveCardVersion,c as teamsMinAdaptiveCardVersion};
@@ -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.40.0";export{o as version};
1
+ const o="2.42.0";export{o as version};
@@ -1388,13 +1388,22 @@ __webpack_require__.d(sidePanel_namespaceObject, {
1388
1388
  registerUserActionContentSelect: () => (registerUserActionContentSelect)
1389
1389
  });
1390
1390
 
1391
+ // NAMESPACE OBJECT: ./src/private/copilot/view.ts
1392
+ var view_namespaceObject = {};
1393
+ __webpack_require__.r(view_namespaceObject);
1394
+ __webpack_require__.d(view_namespaceObject, {
1395
+ closeSidePanel: () => (closeSidePanel),
1396
+ isSupported: () => (view_isSupported)
1397
+ });
1398
+
1391
1399
  // NAMESPACE OBJECT: ./src/private/copilot/copilot.ts
1392
1400
  var copilot_namespaceObject = {};
1393
1401
  __webpack_require__.r(copilot_namespaceObject);
1394
1402
  __webpack_require__.d(copilot_namespaceObject, {
1395
1403
  customTelemetry: () => (customTelemetry_namespaceObject),
1396
1404
  eligibility: () => (eligibility_namespaceObject),
1397
- sidePanel: () => (sidePanel_namespaceObject)
1405
+ sidePanel: () => (sidePanel_namespaceObject),
1406
+ view: () => (view_namespaceObject)
1398
1407
  });
1399
1408
 
1400
1409
  // NAMESPACE OBJECT: ./src/private/externalAppAuthentication.ts
@@ -2202,7 +2211,12 @@ var LegalAgeGroupClassification;
2202
2211
  * United Kingdom, European Union, or South Korea, and the user's age is between a minor and an adult age
2203
2212
  * (as stipulated based on country or region). Generally, this means that teenagers are considered as notAdult in regulated countries.
2204
2213
  */
2205
- 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";
2206
2220
  })(LegalAgeGroupClassification || (LegalAgeGroupClassification = {}));
2207
2221
  /**
2208
2222
  * @hidden
@@ -2236,7 +2250,7 @@ var ClipboardSupportedMimeType;
2236
2250
  })(ClipboardSupportedMimeType || (ClipboardSupportedMimeType = {}));
2237
2251
 
2238
2252
  ;// ./src/artifactsForCDN/validDomains.json
2239
- 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"]}');
2240
2254
  var artifactsForCDN_validDomains_namespaceObject = /*#__PURE__*/__webpack_require__.t(validDomains_namespaceObject, 2);
2241
2255
  ;// ./src/internal/constants.ts
2242
2256
 
@@ -3475,9 +3489,17 @@ var FrameContexts;
3475
3489
  var RenderingSurfaces;
3476
3490
  (function (RenderingSurfaces) {
3477
3491
  /**
3478
- * The mode the copilot app rendered by the host.
3492
+ * Copilot running as a side panel in the host application.
3479
3493
  */
3480
3494
  RenderingSurfaces["copilotSidePanel"] = "copilotSidePanel";
3495
+ /**
3496
+ * Copilot running in the main pane of the host application.
3497
+ */
3498
+ RenderingSurfaces["copilotMainPane"] = "copilotMainPane";
3499
+ /**
3500
+ * Copilot running in full screen mode as an embedded app in the host application.
3501
+ */
3502
+ RenderingSurfaces["copilotFullScreen"] = "copilotFullScreen";
3481
3503
  })(RenderingSurfaces || (RenderingSurfaces = {}));
3482
3504
  /**
3483
3505
  * Indicates the team type, currently used to distinguish between different team
@@ -3580,6 +3602,7 @@ const errorInvalidResponse = new Error('Invalid response: Received more images t
3580
3602
 
3581
3603
 
3582
3604
 
3605
+
3583
3606
  /**
3584
3607
  * @internal
3585
3608
  * Limited to Microsoft-internal use
@@ -4057,6 +4080,25 @@ function isPrimitiveOrPlainObject(value, depth = 0) {
4057
4080
  // Check all properties of the object recursively
4058
4081
  return Object.keys(value).every((key) => isPrimitiveOrPlainObject(value[key], depth + 1));
4059
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
+ }
4060
4102
 
4061
4103
  ;// ./src/public/uuidObject.ts
4062
4104
 
@@ -4590,7 +4632,7 @@ function isSerializable(arg) {
4590
4632
  * @hidden
4591
4633
  * Package version.
4592
4634
  */
4593
- const version = "2.40.0";
4635
+ const version = "2.42.0";
4594
4636
 
4595
4637
  ;// ./src/public/featureFlags.ts
4596
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.
@@ -5472,6 +5514,7 @@ function transformLegacyContextToAppContext(legacyContext) {
5472
5514
  theme: legacyContext.theme ? legacyContext.theme : 'default',
5473
5515
  iconPositionVertical: legacyContext.appIconPosition,
5474
5516
  osLocaleInfo: legacyContext.osLocaleInfo,
5517
+ messageId: legacyContext.messageId,
5475
5518
  parentMessageId: legacyContext.parentMessageId,
5476
5519
  userClickTime: legacyContext.userClickTime,
5477
5520
  userClickTimeV2: legacyContext.userClickTimeV2,
@@ -6558,12 +6601,14 @@ function initializeHelper(apiVersionTag, validMessageOrigins) {
6558
6601
  // After Teams updates its client code, we can remove this default code.
6559
6602
  try {
6560
6603
  initializeHelperLogger('Parsing %s', runtimeConfig);
6561
- const givenRuntimeConfig = JSON.parse(runtimeConfig);
6604
+ let givenRuntimeConfig = JSON.parse(runtimeConfig);
6562
6605
  initializeHelperLogger('Checking if %o is a valid runtime object', givenRuntimeConfig !== null && givenRuntimeConfig !== void 0 ? givenRuntimeConfig : 'null');
6563
6606
  // Check that givenRuntimeConfig is a valid instance of IBaseRuntime
6564
6607
  if (!givenRuntimeConfig || !givenRuntimeConfig.apiVersion) {
6565
6608
  throw new Error('Received runtime config is invalid');
6566
6609
  }
6610
+ // Normalize ageGroup value for backward compatibility
6611
+ givenRuntimeConfig = normalizeAgeGroupValue(givenRuntimeConfig);
6567
6612
  runtimeConfig && applyRuntimeConfig(givenRuntimeConfig);
6568
6613
  }
6569
6614
  catch (e) {
@@ -6577,12 +6622,13 @@ function initializeHelper(apiVersionTag, validMessageOrigins) {
6577
6622
  if (!isNaN(compareSDKVersions(runtimeConfig, defaultSDKVersionForCompatCheck))) {
6578
6623
  GlobalVars.clientSupportedSDKVersion = runtimeConfig;
6579
6624
  }
6580
- const givenRuntimeConfig = JSON.parse(clientSupportedSDKVersion);
6625
+ let givenRuntimeConfig = JSON.parse(clientSupportedSDKVersion);
6581
6626
  initializeHelperLogger('givenRuntimeConfig parsed to %o', givenRuntimeConfig !== null && givenRuntimeConfig !== void 0 ? givenRuntimeConfig : 'null');
6582
6627
  if (!givenRuntimeConfig) {
6583
6628
  throw new Error('givenRuntimeConfig string was successfully parsed. However, it parsed to value of null');
6584
6629
  }
6585
6630
  else {
6631
+ givenRuntimeConfig = normalizeAgeGroupValue(givenRuntimeConfig);
6586
6632
  applyRuntimeConfig(givenRuntimeConfig);
6587
6633
  }
6588
6634
  }
@@ -9414,7 +9460,7 @@ function eligibility_isSupported() {
9414
9460
  * @beta
9415
9461
  */
9416
9462
  function getEligibilityInfo(forceRefresh) {
9417
- var _a, _b;
9463
+ var _a, _b, _c;
9418
9464
  return eligibility_awaiter(this, void 0, void 0, function* () {
9419
9465
  ensureInitialized(runtime);
9420
9466
  if (!eligibility_isSupported()) {
@@ -9435,6 +9481,10 @@ function getEligibilityInfo(forceRefresh) {
9435
9481
  if (!isEligibilityInfoValid(response)) {
9436
9482
  throw new Error('Error deserializing eligibility information');
9437
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
+ }
9438
9488
  return response;
9439
9489
  });
9440
9490
  }
@@ -9762,11 +9812,66 @@ class SerializableContentRequest {
9762
9812
  }
9763
9813
  }
9764
9814
 
9815
+ ;// ./src/private/copilot/view.ts
9816
+ var view_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
9817
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
9818
+ return new (P || (P = Promise))(function (resolve, reject) {
9819
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9820
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9821
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9822
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9823
+ });
9824
+ };
9825
+
9826
+
9827
+
9828
+
9829
+
9830
+ const view_copilotTelemetryVersionNumber = "v2" /* ApiVersionNumber.V_2 */;
9831
+ /**
9832
+ * @hidden
9833
+ * @internal
9834
+ * Limited to Microsoft-internal use
9835
+ * @beta
9836
+ * @returns boolean to represent whether copilot.view capability is supported
9837
+ *
9838
+ * @throws Error if {@linkcode app.initialize} has not successfully completed
9839
+ */
9840
+ function view_isSupported() {
9841
+ var _a;
9842
+ return ensureInitialized(runtime) && !!((_a = runtime.supports.copilot) === null || _a === void 0 ? void 0 : _a.view);
9843
+ }
9844
+ /**
9845
+ * Closes the side panel that is hosting the copilot app.
9846
+ *
9847
+ * @throws { Error } - Throws a Error if host SDK returns an error as a response to this call
9848
+ *
9849
+ * @hidden
9850
+ * @beta
9851
+ * @internal
9852
+ * Limited to Microsoft-internal use
9853
+ */
9854
+ function closeSidePanel() {
9855
+ return view_awaiter(this, void 0, void 0, function* () {
9856
+ ensureInitialized(runtime);
9857
+ yield callFunctionInHostAndHandleResponse("copilot.view.closeSidePanel" /* ApiName.Copilot_View_CloseSidePanel */, [], new CloseSidePanelResponseHandler(), getApiVersionTag(view_copilotTelemetryVersionNumber, "copilot.view.closeSidePanel" /* ApiName.Copilot_View_CloseSidePanel */));
9858
+ });
9859
+ }
9860
+ class CloseSidePanelResponseHandler extends ResponseHandler {
9861
+ validate(_response) {
9862
+ return true;
9863
+ }
9864
+ deserialize(response) {
9865
+ return response;
9866
+ }
9867
+ }
9868
+
9765
9869
  ;// ./src/private/copilot/copilot.ts
9766
9870
 
9767
9871
 
9768
9872
 
9769
9873
 
9874
+
9770
9875
 
9771
9876
  ;// ./src/private/externalAppAuthentication.ts
9772
9877
  /**