@microsoft/teams-js 2.34.0-beta.1 → 2.34.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. package/README.md +4 -4
  2. package/dist/esm/_virtual/_polyfill-node.buffer.js +1 -0
  3. package/dist/esm/_virtual/_polyfill-node.global.js +1 -0
  4. package/dist/esm/packages/teams-js/dts/internal/constants.d.ts +8 -0
  5. package/dist/esm/packages/teams-js/dts/internal/internalAPIs.d.ts +1 -1
  6. package/dist/esm/packages/teams-js/dts/internal/messageObjects.d.ts +1 -0
  7. package/dist/esm/packages/teams-js/dts/internal/validOrigins.d.ts +1 -1
  8. package/dist/esm/packages/teams-js/dts/public/app/app.d.ts +9 -0
  9. package/dist/esm/packages/teams-js/dts/public/constants.d.ts +2 -0
  10. package/dist/esm/packages/teams-js/dts/public/interfaces.d.ts +14 -0
  11. package/dist/esm/packages/teams-js/src/internal/communication.js +1 -1
  12. package/dist/esm/packages/teams-js/src/internal/constants.js +1 -1
  13. package/dist/esm/packages/teams-js/src/internal/internalAPIs.js +1 -1
  14. package/dist/esm/packages/teams-js/src/internal/utils.js +1 -1
  15. package/dist/esm/packages/teams-js/src/internal/validOrigins.js +1 -1
  16. package/dist/esm/packages/teams-js/src/public/app/app.js +1 -1
  17. package/dist/esm/packages/teams-js/src/public/constants.js +1 -1
  18. package/dist/esm/packages/teams-js/src/public/nestedAppAuth.js +1 -1
  19. package/dist/esm/packages/teams-js/src/public/runtime.js +1 -1
  20. package/dist/esm/packages/teams-js/src/public/version.js +1 -1
  21. package/dist/esm/packages/teams-js/src/public/webStorage.js +1 -1
  22. package/dist/umd/MicrosoftTeams.js +194 -155
  23. package/dist/umd/MicrosoftTeams.js.map +1 -1
  24. package/dist/umd/MicrosoftTeams.min.js +1 -1
  25. package/dist/umd/MicrosoftTeams.min.js.map +1 -1
  26. package/package.json +53 -1
  27. package/dist/esm/node_modules/.pnpm/rollup-plugin-node-polyfills@0.2.1/node_modules/rollup-plugin-node-polyfills/polyfills/buffer-es6.js +0 -1
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.33.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.34.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.33.0/js/MicrosoftTeams.min.js"
49
- integrity="sha384-hCfPVLNt9JPTceReb/qZGZR7IbUaPeoExYnER2H//kiykKfhcVEMVQiCR0eAtCCs"
48
+ src="https://res.cdn.office.net/teams-js/2.34.0/js/MicrosoftTeams.min.js"
49
+ integrity="sha384-brW9AazbKR2dYw2DucGgWCCcmrm2oBFV4HQidyuyZRI/TnAkmOOnTARSTdps3Hwt"
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.33.0/dist/MicrosoftTeams.min.js"></script>
54
+ <script src="node_modules/@microsoft/teams-js@2.34.0/dist/MicrosoftTeams.min.js"></script>
55
55
 
56
56
  <!-- Microsoft Teams JavaScript API (via local) -->
57
57
  <script src="MicrosoftTeams.min.js"></script>
@@ -0,0 +1 @@
1
+ import t from"./_polyfill-node.global.js";var r=[],e=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i=!1;function o(){i=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0;n<64;++n)r[n]=t[n],e[t.charCodeAt(n)]=n;e["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63}function u(t,e,n){for(var i,o,u=[],f=e;f<n;f+=3)i=(t[f]<<16)+(t[f+1]<<8)+t[f+2],u.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return u.join("")}function f(t){var e;i||o();for(var n=t.length,f=n%3,s="",h=[],a=16383,c=0,l=n-f;c<l;c+=a)h.push(u(t,c,c+a>l?l:c+a));return 1===f?(e=t[n-1],s+=r[e>>2],s+=r[e<<4&63],s+="=="):2===f&&(e=(t[n-2]<<8)+t[n-1],s+=r[e>>10],s+=r[e>>4&63],s+=r[e<<2&63],s+="="),h.push(s),h.join("")}function s(t,r,e,n,i){var o,u,f=8*i-n-1,s=(1<<f)-1,h=s>>1,a=-7,c=e?i-1:0,l=e?-1:1,p=t[r+c];for(c+=l,o=p&(1<<-a)-1,p>>=-a,a+=f;a>0;o=256*o+t[r+c],c+=l,a-=8);for(u=o&(1<<-a)-1,o>>=-a,a+=n;a>0;u=256*u+t[r+c],c+=l,a-=8);if(0===o)o=1-h;else{if(o===s)return u?NaN:1/0*(p?-1:1);u+=Math.pow(2,n),o-=h}return(p?-1:1)*u*Math.pow(2,o-n)}function h(t,r,e,n,i,o){var u,f,s,h=8*o-i-1,a=(1<<h)-1,c=a>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,y=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(f=isNaN(r)?1:0,u=a):(u=Math.floor(Math.log(r)/Math.LN2),r*(s=Math.pow(2,-u))<1&&(u--,s*=2),(r+=u+c>=1?l/s:l*Math.pow(2,1-c))*s>=2&&(u++,s/=2),u+c>=a?(f=0,u=a):u+c>=1?(f=(r*s-1)*Math.pow(2,i),u+=c):(f=r*Math.pow(2,c-1)*Math.pow(2,i),u=0));i>=8;t[e+p]=255&f,p+=g,f/=256,i-=8);for(u=u<<i|f,h+=i;h>0;t[e+p]=255&u,p+=g,u/=256,h-=8);t[e+p-g]|=128*y}var a={}.toString,c=Array.isArray||function(t){return"[object Array]"==a.call(t)},l=50;function p(){return y.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function g(t,r){if(p()<r)throw new RangeError("Invalid typed array length");return y.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=y.prototype:(null===t&&(t=new y(r)),t.length=r),t}function y(t,r,e){if(!(y.TYPED_ARRAY_SUPPORT||this instanceof y))return new y(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return v(this,t)}return w(this,t,r,e)}function w(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n);y.TYPED_ARRAY_SUPPORT?(t=r).__proto__=y.prototype:t=E(t,r);return t}(t,r,e,n):"string"==typeof r?function(t,r,e){"string"==typeof e&&""!==e||(e="utf8");if(!y.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|b(r,e);t=g(t,n);var i=t.write(r,e);i!==n&&(t=t.slice(0,i));return t}(t,r,e):function(t,r){if(R(r)){var e=0|A(r.length);return 0===(t=g(t,e)).length||r.copy(t,0,0,e),t}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(n=r.length)!=n?g(t,0):E(t,r);if("Buffer"===r.type&&c(r.data))return E(t,r.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function d(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function v(t,r){if(d(r),t=g(t,r<0?0:0|A(r)),!y.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function E(t,r){var e=r.length<0?0:0|A(r.length);t=g(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function A(t){if(t>=p())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+p().toString(16)+" bytes");return 0|t}function R(t){return!(null==t||!t._isBuffer)}function b(t,r){if(R(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return Q(t).length;default:if(n)return K(t).length;r=(""+r).toLowerCase(),n=!0}}function m(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,r,e);case"utf8":case"utf-8":return L(this,r,e);case"ascii":return D(this,r,e);case"latin1":case"binary":return x(this,r,e);case"base64":return O(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function _(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function P(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=y.from(r,n)),R(r))return 0===r.length?-1:T(t,r,e,n,i);if("number"==typeof r)return r&=255,y.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):T(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function T(t,r,e,n,i){var o,u=1,f=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}function h(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(i){var a=-1;for(o=e;o<f;o++)if(h(t,o)===h(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===s)return a*u}else-1!==a&&(o-=o-a),a=-1}else for(e+s>f&&(e=f-s),o=e;o>=0;o--){for(var c=!0,l=0;l<s;l++)if(h(t,o+l)!==h(r,l)){c=!1;break}if(c)return o}return-1}function U(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var f=parseInt(r.substr(2*u,2),16);if(isNaN(f))return u;t[e+u]=f}return u}function B(t,r,e,n){return W(K(r,t.length-e),t,e,n)}function S(t,r,e,n){return W(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function Y(t,r,e,n){return S(t,r,e,n)}function I(t,r,e,n){return W(Q(r),t,e,n)}function C(t,r,e,n){return W(function(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)n=(e=t.charCodeAt(u))>>8,i=e%256,o.push(i),o.push(n);return o}(r,t.length-e),t,e,n)}function O(t,r,e){return 0===r&&e===t.length?f(t):f(t.slice(r,e))}function L(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,u,f,s,h=t[i],a=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=e)switch(c){case 1:h<128&&(a=h);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&h)<<6|63&o)>127&&(a=s);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(s=(15&h)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:o=t[i+1],u=t[i+2],f=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&f)&&(s=(15&h)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(a=s)}null===a?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=c}return function(t){var r=t.length;if(r<=M)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=M));return e}(n)}y.TYPED_ARRAY_SUPPORT=void 0===t.TYPED_ARRAY_SUPPORT||t.TYPED_ARRAY_SUPPORT,p(),y.poolSize=8192,y._augment=function(t){return t.__proto__=y.prototype,t},y.from=function(t,r,e){return w(null,t,r,e)},y.TYPED_ARRAY_SUPPORT&&(y.prototype.__proto__=Uint8Array.prototype,y.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&y[Symbol.species]),y.alloc=function(t,r,e){return function(t,r,e,n){return d(r),r<=0?g(t,r):void 0!==e?"string"==typeof n?g(t,r).fill(e,n):g(t,r).fill(e):g(t,r)}(null,t,r,e)},y.allocUnsafe=function(t){return v(null,t)},y.allocUnsafeSlow=function(t){return v(null,t)},y.isBuffer=X,y.compare=function(t,r){if(!R(t)||!R(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},y.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},y.concat=function(t,r){if(!c(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return y.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var n=y.allocUnsafe(r),i=0;for(e=0;e<t.length;++e){var o=t[e];if(!R(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},y.byteLength=b,y.prototype._isBuffer=!0,y.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)_(this,r,r+1);return this},y.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)_(this,r,r+3),_(this,r+1,r+2);return this},y.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)_(this,r,r+7),_(this,r+1,r+6),_(this,r+2,r+5),_(this,r+3,r+4);return this},y.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?L(this,0,t):m.apply(this,arguments)},y.prototype.equals=function(t){if(!R(t))throw new TypeError("Argument must be a Buffer");return this===t||0===y.compare(this,t)},y.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},y.prototype.compare=function(t,r,e,n,i){if(!R(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),f=Math.min(o,u),s=this.slice(n,i),h=t.slice(r,e),a=0;a<f;++a)if(s[a]!==h[a]){o=s[a],u=h[a];break}return o<u?-1:u<o?1:0},y.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},y.prototype.indexOf=function(t,r,e){return P(this,t,r,e,!0)},y.prototype.lastIndexOf=function(t,r,e){return P(this,t,r,e,!1)},y.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return U(this,t,r,e);case"utf8":case"utf-8":return B(this,t,r,e);case"ascii":return S(this,t,r,e);case"latin1":case"binary":return Y(this,t,r,e);case"base64":return I(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var M=4096;function D(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function x(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function k(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=H(t[o]);return i}function N(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function z(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function F(t,r,e,n,i,o){if(!R(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function j(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function V(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function q(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function J(t,r,e,n,i){return i||q(t,0,e,4),h(t,r,e,n,23,4),e+4}function Z(t,r,e,n,i){return i||q(t,0,e,8),h(t,r,e,n,52,8),e+8}y.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),y.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=y.prototype;else{var i=r-t;e=new y(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},y.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||z(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},y.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||z(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},y.prototype.readUInt8=function(t,r){return r||z(t,1,this.length),this[t]},y.prototype.readUInt16LE=function(t,r){return r||z(t,2,this.length),this[t]|this[t+1]<<8},y.prototype.readUInt16BE=function(t,r){return r||z(t,2,this.length),this[t]<<8|this[t+1]},y.prototype.readUInt32LE=function(t,r){return r||z(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},y.prototype.readUInt32BE=function(t,r){return r||z(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},y.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||z(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},y.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||z(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},y.prototype.readInt8=function(t,r){return r||z(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},y.prototype.readInt16LE=function(t,r){r||z(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},y.prototype.readInt16BE=function(t,r){r||z(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},y.prototype.readInt32LE=function(t,r){return r||z(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},y.prototype.readInt32BE=function(t,r){return r||z(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},y.prototype.readFloatLE=function(t,r){return r||z(t,4,this.length),s(this,t,!0,23,4)},y.prototype.readFloatBE=function(t,r){return r||z(t,4,this.length),s(this,t,!1,23,4)},y.prototype.readDoubleLE=function(t,r){return r||z(t,8,this.length),s(this,t,!0,52,8)},y.prototype.readDoubleBE=function(t,r){return r||z(t,8,this.length),s(this,t,!1,52,8)},y.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||F(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},y.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||F(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},y.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,1,255,0),y.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},y.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,2,65535,0),y.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):j(this,t,r,!0),r+2},y.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,2,65535,0),y.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):j(this,t,r,!1),r+2},y.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,4,4294967295,0),y.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):V(this,t,r,!0),r+4},y.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,4,4294967295,0),y.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):V(this,t,r,!1),r+4},y.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);F(this,t,r,e,i-1,-i)}var o=0,u=1,f=0;for(this[r]=255&t;++o<e&&(u*=256);)t<0&&0===f&&0!==this[r+o-1]&&(f=1),this[r+o]=(t/u|0)-f&255;return r+e},y.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);F(this,t,r,e,i-1,-i)}var o=e-1,u=1,f=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[r+o+1]&&(f=1),this[r+o]=(t/u|0)-f&255;return r+e},y.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,1,127,-128),y.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},y.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,2,32767,-32768),y.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):j(this,t,r,!0),r+2},y.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,2,32767,-32768),y.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):j(this,t,r,!1),r+2},y.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,4,2147483647,-2147483648),y.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):V(this,t,r,!0),r+4},y.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||F(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),y.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):V(this,t,r,!1),r+4},y.prototype.writeFloatLE=function(t,r,e){return J(this,t,r,!0,e)},y.prototype.writeFloatBE=function(t,r,e){return J(this,t,r,!1,e)},y.prototype.writeDoubleLE=function(t,r,e){return Z(this,t,r,!0,e)},y.prototype.writeDoubleBE=function(t,r,e){return Z(this,t,r,!1,e)},y.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!y.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},y.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!y.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var u=R(t)?t:K(new y(t,n).toString()),f=u.length;for(o=0;o<e-r;++o)this[o+r]=u[o%f]}return this};var G=/[^+\/0-9A-Za-z-_]/g;function H(t){return t<16?"0"+t.toString(16):t.toString(16)}function K(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function Q(t){return function(t){var r,u,f,s,h,a;i||o();var c=t.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");h="="===t[c-2]?2:"="===t[c-1]?1:0,a=new n(3*c/4-h),f=h>0?c-4:c;var l=0;for(r=0,u=0;r<f;r+=4,u+=3)s=e[t.charCodeAt(r)]<<18|e[t.charCodeAt(r+1)]<<12|e[t.charCodeAt(r+2)]<<6|e[t.charCodeAt(r+3)],a[l++]=s>>16&255,a[l++]=s>>8&255,a[l++]=255&s;return 2===h?(s=e[t.charCodeAt(r)]<<2|e[t.charCodeAt(r+1)]>>4,a[l++]=255&s):1===h&&(s=e[t.charCodeAt(r)]<<10|e[t.charCodeAt(r+1)]<<4|e[t.charCodeAt(r+2)]>>2,a[l++]=s>>8&255,a[l++]=255&s),a}(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(G,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function X(t){return null!=t&&(!!t._isBuffer||$(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&$(t.slice(0,0))}(t))}function $(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}export{y as Buffer,l as INSPECT_MAX_BYTES,X as isBuffer};
@@ -0,0 +1 @@
1
+ var e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};export{e as default};
@@ -104,6 +104,14 @@ export declare const scanBarCodeAPIMobileSupportVersion = "1.9.0";
104
104
  * Limited to Microsoft-internal use
105
105
  */
106
106
  export declare const validOriginsFallback: string[];
107
+ /**
108
+ * @hidden
109
+ * Timeout length for Fetch Call for Valid Origins
110
+ *
111
+ * @internal
112
+ * Limited to Microsoft-internal use
113
+ */
114
+ export declare const ORIGIN_LIST_FETCH_TIMEOUT_IN_MS: number;
107
115
  /**
108
116
  * @hidden
109
117
  * CDN endpoint of the list of valid origins
@@ -34,7 +34,7 @@ export declare function ensureInitialized(runtime: IBaseRuntime, ...expectedFram
34
34
  export declare function isCurrentSDKVersionAtLeast(requiredVersion?: string): boolean;
35
35
  /**
36
36
  * @hidden
37
- * Helper function to identify if host client is either android, ios, or ipados
37
+ * Helper function to identify if host client is either android, ios, ipados, or visionOS
38
38
  *
39
39
  * @internal
40
40
  * Limited to Microsoft-internal use
@@ -19,6 +19,7 @@ export interface MessageRequest {
19
19
  args?: any[];
20
20
  apiVersionTag?: string;
21
21
  isPartialResponse?: boolean;
22
+ isProxiedFromChild?: boolean;
22
23
  }
23
24
  /**
24
25
  * @internal
@@ -3,4 +3,4 @@ export declare function prefetchOriginsFromCDN(): Promise<void>;
3
3
  * @internal
4
4
  * Limited to Microsoft-internal use
5
5
  */
6
- export declare function validateOrigin(messageOrigin: URL): Promise<boolean>;
6
+ export declare function validateOrigin(messageOrigin: URL, disableCache?: boolean): Promise<boolean>;
@@ -3,6 +3,7 @@
3
3
  * @module
4
4
  */
5
5
  import * as appHelpers from '../../internal/appHelpers';
6
+ import { AppId } from '../appId';
6
7
  import { ChannelType, FrameContexts, HostClientType, HostName, TeamType, UserTeamRole } from '../constants';
7
8
  import { ActionInfo, FileOpenPreference, HostToAppPerformanceMetrics, LocaleInfo } from '../interfaces';
8
9
  import * as lifecycle from './lifecycle';
@@ -142,6 +143,14 @@ export interface AppInfo {
142
143
  * ID for the current visible app which is different for across cached sessions. Used for correlating telemetry data.
143
144
  */
144
145
  appLaunchId?: string;
146
+ /**
147
+ * This ID is the unique identifier assigned to the app after deployment and is critical for ensuring the correct app instance is recognized across hosts.
148
+ */
149
+ appId?: AppId;
150
+ /**
151
+ * The version of the manifest that the app is running.
152
+ */
153
+ manifestVersion?: string;
145
154
  }
146
155
  /**
147
156
  * Represents information about the application's host.
@@ -12,6 +12,8 @@ export declare enum HostClientType {
12
12
  ipados = "ipados",
13
13
  /** The host is running on a macOS client, which runs on devices such as MacBooks. */
14
14
  macos = "macos",
15
+ /** The host is running on a visionOS client, which runs on devices such as Apple Vision. */
16
+ visionOS = "visionOS",
15
17
  /**
16
18
  * @deprecated
17
19
  * As of TeamsJS v2.0.0, please use {@link teamsRoomsWindows} instead.
@@ -687,6 +687,20 @@ export interface Context {
687
687
  * They help pre-fill the dialog with necessary information (`dialogParameters`) along with other details.
688
688
  */
689
689
  dialogParameters?: Record<string, string>;
690
+ /**
691
+ * @deprecated
692
+ * As of TeamsJS v2.0.0, please use {@link app.AppInfo.appId | app.Context.app.appId} instead
693
+ *
694
+ * This ID is the unique identifier assigned to the app after deployment and is critical for ensuring the correct app instance is recognized across hosts.
695
+ */
696
+ appId?: string;
697
+ /**
698
+ * @deprecated
699
+ * As of TeamsJS v2.0.0, please use {@link app.AppInfo.manifestVersion | app.Context.app.manifestVersion} instead
700
+ *
701
+ * The version of the manifest that the app is running.
702
+ */
703
+ manifestVersion?: string;
690
704
  }
691
705
  /** Represents the parameters used to share a deep link. */
692
706
  export interface ShareDeepLinkParameters {
@@ -1 +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{getLogger as n,isFollowingApiVersionTagFormat as i,getApiVersionTag as o}from"./telemetry.js";import{isSdkError as t,ErrorCode as s}from"../public/interfaces.js";import{latestRuntimeApiVersion as r}from"../public/runtime.js";import{isSerializable as a}from"../public/serializable.interface.js";import{UUID as d}from"../public/uuidObject.js";import{version as c}from"../public/version.js";import{GlobalVars as u}from"./globalVars.js";import{callHandler as l}from"./handlers.js";import g from"./hostToAppTelemetry.js";import{serializeMessageRequest as p,deserializeMessageResponse as f,deserializeMessageRequest as m,serializeMessageResponse as w}from"./messageObjects.js";import{tryPolyfillWithNestedAppAuthBridge as h}from"./nestedAppAuthUtils.js";import{getCurrentTimestamp as W,ssrSafeWindow as v}from"./utils.js";import{validateOrigin as M}from"./validOrigins.js";const b=n("communication");class y{}class k{}function I(n,i){if(k.messageListener=n=>function(n){return e(this,void 0,void 0,(function*(){if(!n||!n.data||"object"!=typeof n.data)return void _("Unrecognized message format received by app, message being ignored. Message: %o",n);const e=n.source||n.originalEvent&&n.originalEvent.source,i=n.origin||n.originalEvent&&n.originalEvent.origin;return D(e,i).then((t=>{t?(function(e,n){u.isFramelessWindow||y.parentWindow&&!y.parentWindow.closed&&e!==y.parentWindow?y.childWindow&&!y.childWindow.closed&&e!==y.childWindow||(y.childWindow=e,y.childOrigin=n):(y.parentWindow=e,y.parentOrigin=n);y.parentWindow&&y.parentWindow.closed&&(y.parentWindow=null,y.parentOrigin=null);y.childWindow&&y.childWindow.closed&&(y.childWindow=null,y.childOrigin=null);oe(y.parentWindow),oe(y.childWindow)}(e,i),e===y.parentWindow?G(n):e===y.childWindow&&function(e){if("id"in e.data&&"func"in e.data){const n=m(e.data),[i,t]=l(n.func,n.args);i&&void 0!==t?(X("Handler called in response to message %s from child. Returning response from handler to child, action: %s.",ae(n),n.func),se(n.id,n.uuid,Array.isArray(t)?t:[t])):(X("No handler for message %s from child found; relaying message on to parent, action: %s. Relayed message will have a new id.",ae(n),n.func),N(o("v2","tasks.startTask"),n.func,n.args,((...e)=>{if(y.childWindow){const i=e.pop();X("Message from parent being relayed to child, id: %s",ae(n)),se(n.id,n.uuid,e,i)}})))}}(n)):_("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin, message: %o, source: %o, origin: %o",n,e,i)}))}))}(n),y.currentWindow=y.currentWindow||v(),y.parentWindow=y.currentWindow.parent!==y.currentWindow.self?y.currentWindow.parent:y.currentWindow.opener,y.topWindow=y.currentWindow.top,(y.parentWindow||n)&&y.currentWindow.addEventListener("message",k.messageListener,!1),!y.parentWindow){const e=y.currentWindow;if(!e.nativeInterface)return Promise.reject(new Error("Initialization Failed. No Parent window found."));u.isFramelessWindow=!0,e.onNativeMessage=G}try{return y.parentOrigin="*",j(i,"initialize",[c,r,n]).then((([e,n,i,o])=>(h(o,y.currentWindow,{onMessage:q,sendPostMessage:U}),{context:e,clientType:n,runtimeConfig:i,clientSupportedSDKVersion:o})))}finally{y.parentOrigin=null}}function T(){y.currentWindow&&y.currentWindow.removeEventListener("message",k.messageListener,!1),y.currentWindow=null,y.parentWindow=null,y.parentOrigin=null,y.childWindow=null,y.childOrigin=null,k.parentMessageQueue=[],k.childMessageQueue=[],k.nextMessageId=0,k.callbacks.clear(),k.promiseCallbacks.clear(),k.portCallbacks.clear(),k.legacyMessageIdsToUuidMap={},g.clearMessages()}function R(e,n,...i){return j(e,n,i).then((([e])=>e))}function E(e,n,...i){return j(e,n,i).then((([e,n])=>{if(!e)throw new Error(n)}))}function O(e,n,i,...o){return j(e,n,o).then((([e,n])=>{if(!e)throw new Error(n||i)}))}function S(e,n,...i){return j(e,n,i).then((([e,n])=>{if(e)throw e;return n}))}function j(e,n,o=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);return new Promise((i=>{const t=L(e,n,o);var s;i((s=t.uuid,new Promise((e=>{k.promiseCallbacks.set(s,e)}))))}))}function A(e){return e.map((e=>a(e)?e.serialize():e))}function P(n,i,o,r,a){var d;return e(this,void 0,void 0,(function*(){const e=A(i),[c]=yield j(r,n,e);if(a&&a(c)||!a&&t(c))throw new Error(`${c.errorCode}, message: ${null!==(d=c.message)&&void 0!==d?d:"None"}`);if(o.validate(c))return o.deserialize(c);throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host - ${JSON.stringify(c)}`)}))}function C(n,i,o,r){var a;return e(this,void 0,void 0,(function*(){const e=A(i),[d]=yield j(o,n,e);if(r&&r(d)||!r&&t(d))throw new Error(`${d.errorCode}, message: ${null!==(a=d.message)&&void 0!==a?a:"None"}`);if(void 0!==d)throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host`)}))}function x(e,n,o=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const t=L(e,n,o);return s=t.uuid,new Promise(((e,n)=>{k.portCallbacks.set(s,((i,o)=>{i instanceof MessagePort?e(i):n(o&&o.length>0?o[0]:new Error("Host responded without port or error details."))}))}));var s}function N(e,n,o,t){let s;if(o instanceof Function?t=o:o instanceof Array&&(s=o),!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const r=L(e,n,s);t&&k.callbacks.set(r.uuid,t)}k.parentMessageQueue=[],k.childMessageQueue=[],k.topMessageQueue=[],k.nextMessageId=0,k.callbacks=new Map,k.promiseCallbacks=new Map,k.portCallbacks=new Map,k.legacyMessageIdsToUuidMap={};const $=b.extend("sendNestedAuthRequestToTopWindow");function U(e){const n=$,i=y.topWindow,o=function(e){const n=k.nextMessageId++,i=new d;return k.legacyMessageIdsToUuidMap[n]=i,{id:n,uuid:i,func:"nestedAppAuth.execute",timestamp:Date.now(),monotonicTimestamp:W(),args:[],data:e}}(e);return n("Message %s information: %o",ae(o),{actionName:o.func}),z(i,o)}const Q=b.extend("sendRequestToTargetWindowHelper");function z(e,n){const i=Q,o=ne(e),t=p(n);if(u.isFramelessWindow)y.currentWindow&&y.currentWindow.nativeInterface&&(i("Sending message %s to %s via framelessPostMessage interface",ae(t),o),y.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(t)));else{const s=ee(e);e&&s?(i("Sending message %s to %s via postMessage",ae(t),o),e.postMessage(t,s)):(i("Adding message %s to %s message queue",ae(t),o),Z(e).push(n))}return n}const F=b.extend("sendMessageToParentHelper");function L(e,n,i){const o=F,t=y.parentWindow,s=function(e,n,i){const o=k.nextMessageId++,t=new d;return k.legacyMessageIdsToUuidMap[o]=t,{id:o,uuid:t,func:n,timestamp:Date.now(),monotonicTimestamp:W(),args:i||[],apiVersionTag:e}}(e,n,i);return g.storeCallbackInformation(s.uuid,{name:n,calledAt:s.timestamp}),o("Message %s information: %o",ae(s),{actionName:n,args:i}),z(t,s)}const _=b.extend("processIncomingMessage");const V=b.extend("processAuthBridgeMessage");function q(e,n){var i,o;const t=V;if(!e||!e.data||"object"!=typeof e.data)return void t("Unrecognized message format received by app, message being ignored. Message: %o",e);const{args:s}=e.data,[,r]=null!=s?s:[],a=(()=>{try{return JSON.parse(r)}catch(e){return null}})();if(!a||"object"!=typeof a||"NestedAppAuthResponse"!==a.messageType)return void t("Unrecognized data format received by app, message being ignored. Message: %o",e);const d=e.source||(null===(i=null==e?void 0:e.originalEvent)||void 0===i?void 0:i.source),c=e.origin||(null===(o=null==e?void 0:e.originalEvent)||void 0===o?void 0:o.origin);d?D(d,c)?(y.topWindow&&!y.topWindow.closed&&d!==y.topWindow||(y.topWindow=d,y.topOrigin=c),y.topWindow&&y.topWindow.closed&&(y.topWindow=null,y.topOrigin=null),oe(y.topWindow),n(r)):t("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):t("Message being ignored by app because it is coming for a target that is null")}const H=b.extend("shouldProcessIncomingMessage");function D(n,i){return e(this,void 0,void 0,(function*(){if(y.currentWindow&&n===y.currentWindow)return H("Should not process message because it is coming from the current window"),!1;if(y.currentWindow&&y.currentWindow.location&&i&&i===y.currentWindow.location.origin)return!0;{let e;try{e=new URL(i)}catch(e){return H("Message has an invalid origin of %s",i),!1}const n=yield M(e);return n||H("Message has an invalid origin of %s",i),n}}))}const J=b.extend("handleIncomingMessageFromParent");function B(e,n){if(n){const i=[...e].find((([e,i])=>e.toString()===n.toString()));if(i)return i[0]}}function K(e,n){const i=B(n,e.uuid);i&&n.delete(i),e.uuid?k.legacyMessageIdsToUuidMap={}:delete k.legacyMessageIdsToUuidMap[e.id]}function G(e){const n=J,i=W();if("id"in e.data&&"number"==typeof e.data.id){const o=e.data,t=f(o),s=function(e){const n=J;if(!e.uuid)return k.legacyMessageIdsToUuidMap[e.id];{const n=e.uuid,i=B(k.callbacks,n);if(i)return i;const o=B(k.promiseCallbacks,n);if(o)return o;const t=B(k.portCallbacks,n);if(t)return t}n("Received message %s that failed to produce a callbackId",ae(e))}(t);if(s){const o=k.callbacks.get(s);n("Received a response from parent for message %s",s.toString()),g.handlePerformanceMetrics(s,t,n,i),o&&(n("Invoking the registered callback for message %s with arguments %o",s.toString(),t.args),o.apply(null,[...t.args,t.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(n("Removing registered callback for message %s",s.toString()),K(t,k.callbacks)));const r=k.promiseCallbacks.get(s);r&&(n("Invoking the registered promise callback for message %s with arguments %o",s.toString(),t.args),r(t.args),n("Removing registered promise callback for message %s",s.toString()),K(t,k.promiseCallbacks));const a=k.portCallbacks.get(s);if(a){let i;n("Invoking the registered port callback for message %s with arguments %o",s.toString(),t.args),e.ports&&e.ports[0]instanceof MessagePort&&(i=e.ports[0]),a(i,t.args),n("Removing registered port callback for message %s",s.toString()),K(t,k.portCallbacks)}t.uuid&&(k.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const o=e.data;g.handleOneWayPerformanceMetrics(o,n,i),n('Received a message from parent %s, action: "%s"',ae(o),o.func),l(o.func,o.args)}else n("Received an unknown message: %O",e)}const X=b.extend("handleIncomingMessageFromChild");function Y(){return y.topWindow!==y.parentWindow}function Z(e){return e===y.topWindow&&Y()?k.topMessageQueue:e===y.parentWindow?k.parentMessageQueue:e===y.childWindow?k.childMessageQueue:[]}function ee(e){return e===y.topWindow&&Y()?y.topOrigin:e===y.parentWindow?y.parentOrigin:e===y.childWindow?y.childOrigin:null}function ne(e){return e===y.topWindow&&Y()?"top":e===y.parentWindow?"parent":e===y.childWindow?"child":null}const ie=b.extend("flushMessageQueue");function oe(e){const n=ee(e),i=Z(e),o=ne(e);for(;e&&n&&i.length>0;){const t=i.shift();if(t){const i=p(t);ie("Flushing message %s from %s message queue via postMessage.",ae(i),o),e.postMessage(i,n)}}}function te(e,n){let i;i=y.currentWindow.setInterval((()=>{0===Z(e).length&&(clearInterval(i),n())}),100)}function se(e,n,i,o){const t=y.childWindow,s=function(e,n,i,o){return{id:e,uuid:n,args:i||[],isPartialResponse:o}}(e,n,i,o),r=w(s),a=ee(t);t&&a&&(X("Sending message %s to %s via postMessage, args = %o",ae(r),ne(t),r.args),t.postMessage(r,a))}function re(e,n){const i=y.childWindow,o=function(e,n){return{func:e,args:n||[]}}(e,n),t=ee(i);i&&t?i.postMessage(o,t):Z(i).push(o)}function ae(e){return"uuidAsString"in e?`${e.uuidAsString} (legacy id: ${e.id})`:"uuid"in e&&void 0!==e.uuid?`${e.uuid.toString()} (legacy id: ${e.id})`:`legacy id: ${e.id} (no uuid)`}export{y as Communication,C as callFunctionInHost,P as callFunctionInHostAndHandleResponse,I as initializeCommunication,x as requestPortFromParentWithVersion,S as sendAndHandleSdkError,E as sendAndHandleStatusAndReason,O as sendAndHandleStatusAndReasonWithDefaultError,R as sendAndUnwrap,re as sendMessageEventToChild,N as sendMessageToParent,j as sendMessageToParentAsync,U as sendNestedAuthRequestToTopWindow,T as uninitializeCommunication,te as waitForMessageQueue};
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{getLogger as n,isFollowingApiVersionTagFormat as i,getApiVersionTag as o}from"./telemetry.js";import{isSdkError as t,ErrorCode as s}from"../public/interfaces.js";import{latestRuntimeApiVersion as r}from"../public/runtime.js";import{isSerializable as a}from"../public/serializable.interface.js";import{UUID as d}from"../public/uuidObject.js";import{version as c}from"../public/version.js";import{GlobalVars as u}from"./globalVars.js";import{callHandler as l}from"./handlers.js";import g from"./hostToAppTelemetry.js";import{serializeMessageRequest as p,deserializeMessageResponse as f,deserializeMessageRequest as m,serializeMessageResponse as w}from"./messageObjects.js";import{tryPolyfillWithNestedAppAuthBridge as h}from"./nestedAppAuthUtils.js";import{getCurrentTimestamp as W,ssrSafeWindow as v}from"./utils.js";import{validateOrigin as M}from"./validOrigins.js";const b=n("communication");class y{}class k{}function I(n,i){if(k.messageListener=n=>function(n){return e(this,void 0,void 0,(function*(){if(!n||!n.data||"object"!=typeof n.data)return void _("Unrecognized message format received by app, message being ignored. Message: %o",n);const e=n.source||n.originalEvent&&n.originalEvent.source,i=n.origin||n.originalEvent&&n.originalEvent.origin;return D(e,i).then((t=>{t?(function(e,n){u.isFramelessWindow||y.parentWindow&&!y.parentWindow.closed&&e!==y.parentWindow?y.childWindow&&!y.childWindow.closed&&e!==y.childWindow||(y.childWindow=e,y.childOrigin=n):(y.parentWindow=e,y.parentOrigin=n);y.parentWindow&&y.parentWindow.closed&&(y.parentWindow=null,y.parentOrigin=null);y.childWindow&&y.childWindow.closed&&(y.childWindow=null,y.childOrigin=null);oe(y.parentWindow),oe(y.childWindow)}(e,i),e===y.parentWindow?G(n):e===y.childWindow&&function(e){if("id"in e.data&&"func"in e.data){const n=m(e.data),[i,t]=l(n.func,n.args);i&&void 0!==t?(X("Handler called in response to message %s from child. Returning response from handler to child, action: %s.",ae(n),n.func),se(n.id,n.uuid,Array.isArray(t)?t:[t])):(X("No handler for message %s from child found; relaying message on to parent, action: %s. Relayed message will have a new id.",ae(n),n.func),function(e){const n=L(o("v2","tasks.startTask"),e.func,e.args,!0);k.callbacks.set(n.uuid,((...n)=>{if(y.childWindow){const i=n.pop();X("Message from parent being relayed to child, id: %s",ae(e)),se(e.id,e.uuid,n,i)}}))}(n))}}(n)):_("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin, message: %o, source: %o, origin: %o",n,e,i)}))}))}(n),y.currentWindow=y.currentWindow||v(),y.parentWindow=y.currentWindow.parent!==y.currentWindow.self?y.currentWindow.parent:y.currentWindow.opener,y.topWindow=y.currentWindow.top,(y.parentWindow||n)&&y.currentWindow.addEventListener("message",k.messageListener,!1),!y.parentWindow){const e=y.currentWindow;if(!e.nativeInterface)return Promise.reject(new Error("Initialization Failed. No Parent window found."));u.isFramelessWindow=!0,e.onNativeMessage=G}try{return y.parentOrigin="*",j(i,"initialize",[c,r,n]).then((([e,n,i,o])=>(h(o,y.currentWindow,{onMessage:q,sendPostMessage:U}),{context:e,clientType:n,runtimeConfig:i,clientSupportedSDKVersion:o})))}finally{y.parentOrigin=null}}function T(){y.currentWindow&&y.currentWindow.removeEventListener("message",k.messageListener,!1),y.currentWindow=null,y.parentWindow=null,y.parentOrigin=null,y.childWindow=null,y.childOrigin=null,k.parentMessageQueue=[],k.childMessageQueue=[],k.nextMessageId=0,k.callbacks.clear(),k.promiseCallbacks.clear(),k.portCallbacks.clear(),k.legacyMessageIdsToUuidMap={},g.clearMessages()}function R(e,n,...i){return j(e,n,i).then((([e])=>e))}function E(e,n,...i){return j(e,n,i).then((([e,n])=>{if(!e)throw new Error(n)}))}function O(e,n,i,...o){return j(e,n,o).then((([e,n])=>{if(!e)throw new Error(n||i)}))}function S(e,n,...i){return j(e,n,i).then((([e,n])=>{if(e)throw e;return n}))}function j(e,n,o=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);return new Promise((i=>{const t=L(e,n,o);var s;i((s=t.uuid,new Promise((e=>{k.promiseCallbacks.set(s,e)}))))}))}function P(e){return e.map((e=>a(e)?e.serialize():e))}function A(n,i,o,r,a){var d;return e(this,void 0,void 0,(function*(){const e=P(i),[c]=yield j(r,n,e);if(a&&a(c)||!a&&t(c))throw new Error(`${c.errorCode}, message: ${null!==(d=c.message)&&void 0!==d?d:"None"}`);if(o.validate(c))return o.deserialize(c);throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host - ${JSON.stringify(c)}`)}))}function C(n,i,o,r){var a;return e(this,void 0,void 0,(function*(){const e=P(i),[d]=yield j(o,n,e);if(r&&r(d)||!r&&t(d))throw new Error(`${d.errorCode}, message: ${null!==(a=d.message)&&void 0!==a?a:"None"}`);if(void 0!==d)throw new Error(`${s.INTERNAL_ERROR}, message: Invalid response from host`)}))}function x(e,n,o=void 0){if(!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const t=L(e,n,o);return s=t.uuid,new Promise(((e,n)=>{k.portCallbacks.set(s,((i,o)=>{i instanceof MessagePort?e(i):n(o&&o.length>0?o[0]:new Error("Host responded without port or error details."))}))}));var s}function N(e,n,o,t){let s;if(o instanceof Function?t=o:o instanceof Array&&(s=o),!i(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const r=L(e,n,s);t&&k.callbacks.set(r.uuid,t)}k.parentMessageQueue=[],k.childMessageQueue=[],k.topMessageQueue=[],k.nextMessageId=0,k.callbacks=new Map,k.promiseCallbacks=new Map,k.portCallbacks=new Map,k.legacyMessageIdsToUuidMap={};const $=b.extend("sendNestedAuthRequestToTopWindow");function U(e){const n=$,i=y.topWindow,o=function(e){const n=k.nextMessageId++,i=new d;return k.legacyMessageIdsToUuidMap[n]=i,{id:n,uuid:i,func:"nestedAppAuth.execute",timestamp:Date.now(),monotonicTimestamp:W(),args:[],data:e}}(e);return n("Message %s information: %o",ae(o),{actionName:o.func}),Q(i,o)}const F=b.extend("sendRequestToTargetWindowHelper");function Q(e,n){const i=F,o=ne(e),t=p(n);if(u.isFramelessWindow)y.currentWindow&&y.currentWindow.nativeInterface&&(i("Sending message %s to %s via framelessPostMessage interface",ae(t),o),y.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(t)));else{const s=ee(e);e&&s?(i("Sending message %s to %s via postMessage",ae(t),o),e.postMessage(t,s)):(i("Adding message %s to %s message queue",ae(t),o),Z(e).push(n))}return n}const z=b.extend("sendMessageToParentHelper");function L(e,n,i,o){const t=z,s=y.parentWindow,r=function(e,n,i,o){const t=k.nextMessageId++,s=new d;return k.legacyMessageIdsToUuidMap[t]=s,{id:t,uuid:s,func:n,timestamp:Date.now(),monotonicTimestamp:W(),args:i||[],apiVersionTag:e,isProxiedFromChild:null!=o&&o}}(e,n,i,o);return g.storeCallbackInformation(r.uuid,{name:n,calledAt:r.timestamp}),t("Message %s information: %o",ae(r),{actionName:n,args:i}),Q(s,r)}const _=b.extend("processIncomingMessage");const V=b.extend("processAuthBridgeMessage");function q(e,n){var i,o;const t=V;if(!e||!e.data||"object"!=typeof e.data)return void t("Unrecognized message format received by app, message being ignored. Message: %o",e);const{args:s}=e.data,[,r]=null!=s?s:[],a=(()=>{try{return JSON.parse(r)}catch(e){return null}})();if(!a||"object"!=typeof a||"NestedAppAuthResponse"!==a.messageType)return void t("Unrecognized data format received by app, message being ignored. Message: %o",e);const d=e.source||(null===(i=null==e?void 0:e.originalEvent)||void 0===i?void 0:i.source),c=e.origin||(null===(o=null==e?void 0:e.originalEvent)||void 0===o?void 0:o.origin);d?D(d,c)?(y.topWindow&&!y.topWindow.closed&&d!==y.topWindow||(y.topWindow=d,y.topOrigin=c),y.topWindow&&y.topWindow.closed&&(y.topWindow=null,y.topOrigin=null),oe(y.topWindow),n(r)):t("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):t("Message being ignored by app because it is coming for a target that is null")}const H=b.extend("shouldProcessIncomingMessage");function D(n,i){return e(this,void 0,void 0,(function*(){if(y.currentWindow&&n===y.currentWindow)return H("Should not process message because it is coming from the current window"),!1;if(y.currentWindow&&y.currentWindow.location&&i&&i===y.currentWindow.location.origin)return!0;{let e;try{e=new URL(i)}catch(e){return H("Message has an invalid origin of %s",i),!1}const n=yield M(e);return n||H("Message has an invalid origin of %s",i),n}}))}const J=b.extend("handleIncomingMessageFromParent");function B(e,n){if(n){const i=[...e].find((([e,i])=>e.toString()===n.toString()));if(i)return i[0]}}function K(e,n){const i=B(n,e.uuid);i&&n.delete(i),e.uuid?k.legacyMessageIdsToUuidMap={}:delete k.legacyMessageIdsToUuidMap[e.id]}function G(e){const n=J,i=W();if("id"in e.data&&"number"==typeof e.data.id){const o=e.data,t=f(o),s=function(e){const n=J;if(!e.uuid)return k.legacyMessageIdsToUuidMap[e.id];{const n=e.uuid,i=B(k.callbacks,n);if(i)return i;const o=B(k.promiseCallbacks,n);if(o)return o;const t=B(k.portCallbacks,n);if(t)return t}n("Received message %s that failed to produce a callbackId",ae(e))}(t);if(s){const o=k.callbacks.get(s);n("Received a response from parent for message %s",s.toString()),g.handlePerformanceMetrics(s,t,n,i),o&&(n("Invoking the registered callback for message %s with arguments %o",s.toString(),t.args),o.apply(null,[...t.args,t.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(n("Removing registered callback for message %s",s.toString()),K(t,k.callbacks)));const r=k.promiseCallbacks.get(s);r&&(n("Invoking the registered promise callback for message %s with arguments %o",s.toString(),t.args),r(t.args),n("Removing registered promise callback for message %s",s.toString()),K(t,k.promiseCallbacks));const a=k.portCallbacks.get(s);if(a){let i;n("Invoking the registered port callback for message %s with arguments %o",s.toString(),t.args),e.ports&&e.ports[0]instanceof MessagePort&&(i=e.ports[0]),a(i,t.args),n("Removing registered port callback for message %s",s.toString()),K(t,k.portCallbacks)}t.uuid&&(k.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const o=e.data;g.handleOneWayPerformanceMetrics(o,n,i),n('Received a message from parent %s, action: "%s"',ae(o),o.func),l(o.func,o.args)}else n("Received an unknown message: %O",e)}const X=b.extend("handleIncomingMessageFromChild");function Y(){return y.topWindow!==y.parentWindow}function Z(e){return e===y.topWindow&&Y()?k.topMessageQueue:e===y.parentWindow?k.parentMessageQueue:e===y.childWindow?k.childMessageQueue:[]}function ee(e){return e===y.topWindow&&Y()?y.topOrigin:e===y.parentWindow?y.parentOrigin:e===y.childWindow?y.childOrigin:null}function ne(e){return e===y.topWindow&&Y()?"top":e===y.parentWindow?"parent":e===y.childWindow?"child":null}const ie=b.extend("flushMessageQueue");function oe(e){const n=ee(e),i=Z(e),o=ne(e);for(;e&&n&&i.length>0;){const t=i.shift();if(t){const i=p(t);ie("Flushing message %s from %s message queue via postMessage.",ae(i),o),e.postMessage(i,n)}}}function te(e,n){let i;i=y.currentWindow.setInterval((()=>{0===Z(e).length&&(clearInterval(i),n())}),100)}function se(e,n,i,o){const t=y.childWindow,s=function(e,n,i,o){return{id:e,uuid:n,args:i||[],isPartialResponse:o}}(e,n,i,o),r=w(s),a=ee(t);t&&a&&(X("Sending message %s to %s via postMessage, args = %o",ae(r),ne(t),r.args),t.postMessage(r,a))}function re(e,n){const i=y.childWindow,o=function(e,n){return{func:e,args:n||[]}}(e,n),t=ee(i);i&&t?i.postMessage(o,t):Z(i).push(o)}function ae(e){return"uuidAsString"in e?`${e.uuidAsString} (legacy id: ${e.id})`:"uuid"in e&&void 0!==e.uuid?`${e.uuid.toString()} (legacy id: ${e.id})`:`legacy id: ${e.id} (no uuid)`}export{y as Communication,C as callFunctionInHost,A as callFunctionInHostAndHandleResponse,I as initializeCommunication,x as requestPortFromParentWithVersion,S as sendAndHandleSdkError,E as sendAndHandleStatusAndReason,O as sendAndHandleStatusAndReasonWithDefaultError,R as sendAndUnwrap,re as sendMessageEventToChild,N as sendMessageToParent,j as sendMessageToParentAsync,U as sendNestedAuthRequestToTopWindow,T as uninitializeCommunication,te as waitForMessageQueue};
@@ -1 +1 @@
1
- import*as t from"../artifactsForCDN/validDomains.json.js";const i="2.0.1",s="2.0.2",e="2.0.3",n="2.0.4",o="2.0.1",a="1.9.0",r="2.0.0",m="1.7.0",l="1.8.0",d="2.0.0",h="1.9.0",p=t.validOrigins,c=new URL("https://res.cdn.office.net/teams-js/validDomains/json/validDomains.json"),f=/^https:\/\//,j="https",v="teams.microsoft.com",y="The library has not yet been initialized",D="The runtime has not yet been initialized",T="The runtime version is not supported",b="The call was not properly started";export{m as captureImageMobileSupportVersion,i as defaultSDKVersionForCompatCheck,b as errorCallNotStarted,y as errorLibraryNotInitialized,D as errorRuntimeNotInitialized,T as errorRuntimeNotSupported,d as getMediaCallbackSupportVersion,o as getUserJoinedTeamsSupportedAndroidClientVersion,n as imageOutputFormatsAPISupportVersion,a as locationAPIsRequiredVersion,l as mediaAPISupportVersion,e as nonFullScreenVideoModeAPISupportVersion,r as peoplePickerRequiredVersion,h as scanBarCodeAPIMobileSupportVersion,v as teamsDeepLinkHost,j as teamsDeepLinkProtocol,f as userOriginUrlValidationRegExp,c as validOriginsCdnEndpoint,p as validOriginsFallback,s as videoAndImageMediaAPISupportVersion};
1
+ import*as t from"../artifactsForCDN/validDomains.json.js";const i="2.0.1",s="2.0.2",e="2.0.3",n="2.0.4",o="2.0.1",a="1.9.0",r="2.0.0",m="1.7.0",l="1.8.0",d="2.0.0",h="1.9.0",p=t.validOrigins,c=1500,f=new URL("https://res.cdn.office.net/teams-js/validDomains/json/validDomains.json"),j=/^https:\/\//,v="https",y="teams.microsoft.com",D="The library has not yet been initialized",T="The runtime has not yet been initialized",b="The runtime version is not supported",u="The call was not properly started";export{c as ORIGIN_LIST_FETCH_TIMEOUT_IN_MS,m as captureImageMobileSupportVersion,i as defaultSDKVersionForCompatCheck,u as errorCallNotStarted,D as errorLibraryNotInitialized,T as errorRuntimeNotInitialized,b as errorRuntimeNotSupported,d as getMediaCallbackSupportVersion,o as getUserJoinedTeamsSupportedAndroidClientVersion,n as imageOutputFormatsAPISupportVersion,a as locationAPIsRequiredVersion,l as mediaAPISupportVersion,e as nonFullScreenVideoModeAPISupportVersion,r as peoplePickerRequiredVersion,h as scanBarCodeAPIMobileSupportVersion,y as teamsDeepLinkHost,v as teamsDeepLinkProtocol,j as userOriginUrlValidationRegExp,f as validOriginsCdnEndpoint,p as validOriginsFallback,s as videoAndImageMediaAPISupportVersion};
@@ -1 +1 @@
1
- import{HostClientType as i}from"../public/constants.js";import{ErrorCode as t}from"../public/interfaces.js";import{isRuntimeInitialized as e}from"../public/runtime.js";import{errorLibraryNotInitialized as r,defaultSDKVersionForCompatCheck as n,userOriginUrlValidationRegExp as o}from"./constants.js";import{GlobalVars as l}from"./globalVars.js";import{getLogger as s}from"./telemetry.js";import{compareSDKVersions as a}from"./utils.js";const f=s("internal"),c=f.extend("ensureInitializeCalled"),d=f.extend("ensureInitialized");function m(){if(!l.initializeCalled)throw c(r),new Error(r)}function p(i,...t){if(!l.initializeCompleted)throw d("%s. initializeCalled: %s",r,l.initializeCalled.toString()),new Error(r);if(t&&t.length>0){let i=!1;for(let e=0;e<t.length;e++)if(t[e]===l.frameContext){i=!0;break}if(!i)throw new Error(`This call is only allowed in following contexts: ${JSON.stringify(t)}. Current context: "${l.frameContext}".`)}return e(i)}function u(i=n){const t=a(l.clientSupportedSDKVersion,i);return!isNaN(t)&&t>=0}function C(){return l.hostClientType==i.android||l.hostClientType==i.ios||l.hostClientType==i.ipados}function h(i=n){if(!C()){throw{errorCode:t.NOT_SUPPORTED_ON_PLATFORM}}if(!u(i)){throw{errorCode:t.OLD_PLATFORM}}}function w(i){let t=l.additionalValidOrigins.concat(i.filter((i=>"string"==typeof i&&o.test(i))));const e={};t=t.filter((i=>!e[i]&&(e[i]=!0,!0))),l.additionalValidOrigins=t}export{m as ensureInitializeCalled,p as ensureInitialized,u as isCurrentSDKVersionAtLeast,C as isHostClientMobile,w as processAdditionalValidOrigins,h as throwExceptionIfMobileApiIsNotSupported};
1
+ import{HostClientType as i}from"../public/constants.js";import{ErrorCode as t}from"../public/interfaces.js";import{isRuntimeInitialized as e}from"../public/runtime.js";import{errorLibraryNotInitialized as n,defaultSDKVersionForCompatCheck as o,userOriginUrlValidationRegExp as r}from"./constants.js";import{GlobalVars as l}from"./globalVars.js";import{getLogger as s}from"./telemetry.js";import{compareSDKVersions as a}from"./utils.js";const f=s("internal"),c=f.extend("ensureInitializeCalled"),d=f.extend("ensureInitialized");function p(){if(!l.initializeCalled)throw c(n),new Error(n)}function m(i,...t){if(!l.initializeCompleted)throw d("%s. initializeCalled: %s",n,l.initializeCalled.toString()),new Error(n);if(t&&t.length>0){let i=!1;for(let e=0;e<t.length;e++)if(t[e]===l.frameContext){i=!0;break}if(!i)throw new Error(`This call is only allowed in following contexts: ${JSON.stringify(t)}. Current context: "${l.frameContext}".`)}return e(i)}function u(i=o){const t=a(l.clientSupportedSDKVersion,i);return!isNaN(t)&&t>=0}function C(){return l.hostClientType==i.android||l.hostClientType==i.ios||l.hostClientType==i.ipados||l.hostClientType==i.visionOS}function h(i=o){if(!C()){throw{errorCode:t.NOT_SUPPORTED_ON_PLATFORM}}if(!u(i)){throw{errorCode:t.OLD_PLATFORM}}}function w(i){let t=l.additionalValidOrigins.concat(i.filter((i=>"string"==typeof i&&r.test(i))));const e={};t=t.filter((i=>!e[i]&&(e[i]=!0,!0))),l.additionalValidOrigins=t}export{p as ensureInitializeCalled,m as ensureInitialized,u as isCurrentSDKVersionAtLeast,C as isHostClientMobile,w as processAdditionalValidOrigins,h as throwExceptionIfMobileApiIsNotSupported};
@@ -1 +1 @@
1
- import{Buffer as e}from"../../../../node_modules/.pnpm/rollup-plugin-node-polyfills@0.2.1/node_modules/rollup-plugin-node-polyfills/polyfills/buffer-es6.js";import{minAdaptiveCardVersion as t}from"../public/constants.js";import n from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v4.js";import r from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js";function o(e){return(e,t)=>{if(!e)throw new Error(t)}}function i(e,t){if("string"!=typeof e||"string"!=typeof t)return NaN;const n=e.split("."),r=t.split(".");function o(e){return/^\d+$/.test(e)}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 e=0;e<n.length;++e)if(Number(n[e])!=Number(r[e]))return Number(n[e])>Number(r[e])?1:-1;return 0}function u(){return n()}function c(e){return Object.keys(e).forEach((t=>{null!==e[t]&&void 0!==e[t]&&"object"==typeof e[t]&&c(e[t])})),Object.freeze(e)}function s(e,t,...n){const r=e(...n);return r.then((e=>{t&&t(void 0,e)})).catch((e=>{t&&t(e)})),r}function l(e,t,...n){const r=e(...n);return r.then((()=>{t&&t(null)})).catch((e=>{t&&t(e)})),r}function f(e,t,...n){const r=e(...n);return r.then((e=>{t&&t(null,e)})).catch((e=>{t&&t(e,null)})),r}function a(e,t,n){return new Promise(((r,o)=>{const i=setTimeout(o,t,n);e().then((e=>{clearTimeout(i),r(e)})).catch((e=>{clearTimeout(i),o(e)}))}))}function p(e){const t=new URL("https://teams.microsoft.com/l/entity/"+encodeURIComponent(e.appId.toString())+"/"+encodeURIComponent(e.pageId));return e.webUrl&&t.searchParams.append("webUrl",e.webUrl.toString()),(e.chatId||e.channelId||e.subPageId)&&t.searchParams.append("context",JSON.stringify({chatId:e.chatId,channelId:e.channelId,subEntityId:e.subPageId})),t.toString()}function d(e){return!(i(`${e.majorVersion}.${e.minorVersion}`,`${t.majorVersion}.${t.minorVersion}`)>=0)}function m(e){return"https:"===e.protocol}function h(t,n){return new Promise(((r,o)=>{if(t||o("MimeType cannot be null or empty."),n||o("Base64 string cannot be null or empty."),t.startsWith("image/")){const e=atob(n),o=new Uint8Array(e.length);for(let t=0;t<e.length;t++)o[t]=e.charCodeAt(t);r(new Blob([o],{type:t}))}const i=e.from(n,"base64").toString();r(new Blob([i],{type:t}))}))}function b(e){return new Promise(((t,n)=>{0===e.size&&n(new Error("Blob cannot be empty."));const r=new FileReader;r.onloadend=()=>{r.result?t(r.result.toString().split(",")[1]):n(new Error("Failed to read the blob"))},r.onerror=()=>{n(r.error)},r.readAsDataURL(e)}))}function w(){if(g())throw new Error("window object undefined at SSR check");return window}function g(){return"undefined"==typeof window}function y(e,t){if(I(e)||!function(e){return e.length<256&&e.length>4}(e)||!function(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<32||n>126)return!1}return!0}(e))throw t||new Error("id is not valid.")}function j(e,t){const n=e.toString().toLocaleLowerCase();if(I(n))throw new Error("Invalid Url");if(n.length>2048)throw new Error("Url exceeds the maximum size of 2048 characters");if(!m(e))throw new Error("Url should be a valid https url")}function E(e){const t=document.createElement("a");return t.href=e,new URL(t.href)}function I(e){return new RegExp(`${/<script[^>]*>|&lt;script[^&]*&gt;|%3Cscript[^%]*%3E/gi.source}|${/<\/script[^>]*>|&lt;\/script[^&]*&gt;|%3C\/script[^%]*%3E/gi.source}`,"gi").test(e)}function v(e){if(!e)throw new Error("id must not be empty");if(!1===r(e))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(e,t=0){if(t>1e3)return!1;if(void 0===e||"boolean"==typeof e||"number"==typeof e||"bigint"==typeof e||"string"==typeof e||null===e)return!0;if(Array.isArray(e))return e.every((e=>S(e,t+1)));return!("object"!=typeof e||"[object Object]"!==Object.prototype.toString.call(e)||Object.getPrototypeOf(e)!==Object.prototype&&null!==Object.getPrototypeOf(e))&&Object.keys(e).every((n=>S(e[n],t+1)))}export{h as base64ToBlob,s as callCallbackWithErrorOrResultFromPromiseAndReturnPromise,f as callCallbackWithErrorOrResultOrNullFromPromiseAndReturnPromise,l as callCallbackWithSdkErrorFromPromiseAndReturnPromise,i as compareSDKVersions,p as createTeamsAppLink,c as deepFreeze,E as fullyQualifyUrlString,u as generateGUID,b as getBase64StringFromBlob,O as getCurrentTimestamp,o as getGenericOnCompleteHandler,I 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,v as validateUuid};
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 +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{validOriginsCdnEndpoint as t,validOriginsFallback as r}from"./constants.js";import{GlobalVars as n}from"./globalVars.js";import{getLogger as s}from"./telemetry.js";import{inServerSideRenderingEnvironment as o,isValidHttpsURL as e}from"./utils.js";let l=[];const a=s("validateOrigin");function u(){return i(this,void 0,void 0,(function*(){yield d()}))}function d(){return i(this,void 0,void 0,(function*(){return 0!==l.length?l:o()?(l=r,r):fetch(t).then((i=>{if(!i.ok)throw new Error("Invalid Response from Fetch Call");return i.json().then((i=>{if(function(i){let t=JSON.parse(i);try{t=JSON.parse(i)}catch(i){return!1}if(!t.validOrigins)return!1;for(const i of t.validOrigins)try{new URL("https://"+i)}catch(t){return a("isValidOriginsFromCDN call failed to validate origin: %s",i),!1}return!0}(JSON.stringify(i)))return l=i.validOrigins,l;throw new Error("Valid Origins List Is Invalid")}))})).catch((i=>(a("validOrigins fetch call to CDN failed with error: %s. Defaulting to fallback list",i),l=r,l)))}))}function c(i,t){if("*."===i.substring(0,2)){const r=i.substring(1);if(t.length>r.length&&t.split(".").length===r.split(".").length&&t.substring(t.length-r.length)===r)return!0}else if(i===t)return!0;return!1}function f(i){return d().then((t=>{if(!e(i))return a("Origin %s is invalid because it is not using https protocol. Protocol being used: %s",i,i.protocol),!1;const r=i.host;if(t.some((i=>c(i,r))))return!0;for(const i of n.additionalValidOrigins){if(c("https://"===i.substring(0,8)?i.substring(8):i,r))return!0}return a("Origin %s is invalid because it is not an origin approved by this library or included in the call to app.initialize.\nOrigins approved by this library: %o\nOrigins included in app.initialize: %o",i,t,n.additionalValidOrigins),!1}))}export{u as prefetchOriginsFromCDN,f as validateOrigin};
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{ORIGIN_LIST_FETCH_TIMEOUT_IN_MS as t,validOriginsCdnEndpoint as r,validOriginsFallback as n}from"./constants.js";import{GlobalVars as e}from"./globalVars.js";import{getLogger as o}from"./telemetry.js";import{inServerSideRenderingEnvironment as l,isValidHttpsURL as s}from"./utils.js";let a=[];const u=o("validateOrigin");function c(){return i(this,void 0,void 0,(function*(){yield d()}))}function d(e=!1){return i(this,void 0,void 0,(function*(){if(0!==a.length&&!e)return a;if(l())return a=n,n;{u("Initiating fetch call to acquire valid origins list from CDN");const i=new AbortController,e=setTimeout((()=>i.abort()),t);return fetch(r,{signal:i.signal}).then((i=>{if(clearTimeout(e),!i.ok)throw new Error("Invalid Response from Fetch Call");return u("Fetch call completed and retrieved valid origins list from CDN"),i.json().then((i=>{if(function(i){let t=JSON.parse(i);try{t=JSON.parse(i)}catch(i){return!1}if(!t.validOrigins)return!1;for(const i of t.validOrigins)try{new URL("https://"+i)}catch(t){return u("isValidOriginsFromCDN call failed to validate origin: %s",i),!1}return!0}(JSON.stringify(i)))return a=i.validOrigins,a;throw new Error("Valid origins list retrieved from CDN is invalid")}))})).catch((i=>("AbortError"===i.name?u(`validOrigins fetch call to CDN failed due to Timeout of ${t} ms. Defaulting to fallback list`):u("validOrigins fetch call to CDN failed with error: %s. Defaulting to fallback list",i),a=n,a)))}}))}function f(i,t){if("*."===i.substring(0,2)){const r=i.substring(1);if(t.length>r.length&&t.split(".").length===r.split(".").length&&t.substring(t.length-r.length)===r)return!0}else if(i===t)return!0;return!1}function g(i,t){return d(t).then((t=>{if(!s(i))return u("Origin %s is invalid because it is not using https protocol. Protocol being used: %s",i,i.protocol),!1;const r=i.host;if(t.some((i=>f(i,r))))return!0;for(const i of e.additionalValidOrigins){if(f("https://"===i.substring(0,8)?i.substring(8):i,r))return!0}return u("Origin %s is invalid because it is not an origin approved by this library or included in the call to app.initialize.\nOrigins approved by this library: %o\nOrigins included in app.initialize: %o",i,t,e.additionalValidOrigins),!1}))}c();export{c as prefetchOriginsFromCDN,g as validateOrigin};
@@ -1 +1 @@
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{prefetchOriginsFromCDN as I}from"../../internal/validOrigins.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"),O={AppLoaded:"appInitialization.appLoaded",Success:"appInitialization.success",Failure:"appInitialization.failure",ExpectedFailure:"appInitialization.expectedFailure"};var N,b;function F(){return d.initializeCompleted}function x(){return d.frameContext}function L(i){return I(),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,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},page:{id:e.entityId,frameContext:e.frameContext?e.frameContext:d.frameContext,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 E(e){u(),n(h(j,"app.notifyFailure"),e)}function H(e){u(),a(h(j,"app.notifyExpectedFailure"),e)}function M(e){o(h(j,"app.registerOnThemeChangeHandler"),e)}function V(e){c(e)}function W(e){return s(h(j,"app.openLink"),e)}!function(e){e.AuthFailed="AuthFailed",e.Timeout="Timeout",e.Other="Other"}(N||(N={})),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,N as FailedReason,O as Messages,A as _initialize,z as _uninitialize,D as getContext,x as getFrameContext,L as initialize,F as isInitialized,k as notifyAppLoaded,H as notifyExpectedFailure,E as notifyFailure,U as notifySuccess,W as openLink,V as registerHostToAppPerformanceMetricsHandler,M 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 I}from"../../internal/utils.js";import{AppId as g}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,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 g(e.appId):void 0,manifestVersion:e.manifestVersion},page:{id:e.entityId,frameContext:e.frameContext?e.frameContext:d.frameContext,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(I())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,s,n,i,t,r;!function(e){e.desktop="desktop",e.web="web",e.android="android",e.ios="ios",e.ipados="ipados",e.macos="macos",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"}(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"}(i||(i={})),function(e){e.Large="large",e.Medium="medium",e.Small="small"}(t||(t={})),function(e){e.Regular="Regular",e.Private="Private",e.Shared="Shared"}(r||(r={}));const m={errorCode:e.NOT_SUPPORTED_ON_PLATFORM},d={majorVersion:1,minorVersion:5},u={adaptiveCardSchemaVersion:{majorVersion:1,minorVersion:5}},l=new Error("Invalid input count: Must supply a valid image count (limit of 10)."),c=new Error("Invalid response: Received more images than the specified max limit in the response.");export{r as ChannelType,t as DialogDimension,s as FrameContexts,o as HostClientType,a as HostName,t as TaskModuleDimension,n as TeamType,i as UserTeamRole,l as errorInvalidCount,c as errorInvalidResponse,m as errorNotSupportedOnPlatform,d as minAdaptiveCardVersion,u as teamsMinAdaptiveCardVersion};
1
+ import{ErrorCode as e}from"./interfaces.js";var o,s,a,i,n,t,r;!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"}(s||(s={})),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[e.Standard=0]="Standard",e[e.Edu=1]="Edu",e[e.Class=2]="Class",e[e.Plc=3]="Plc",e[e.Staff=4]="Staff"}(i||(i={})),function(e){e[e.Admin=0]="Admin",e[e.User=1]="User",e[e.Guest=2]="Guest"}(n||(n={})),function(e){e.Large="large",e.Medium="medium",e.Small="small"}(t||(t={})),function(e){e.Regular="Regular",e.Private="Private",e.Shared="Shared"}(r||(r={}));const m={errorCode:e.NOT_SUPPORTED_ON_PLATFORM},d={majorVersion:1,minorVersion:5},u={adaptiveCardSchemaVersion:{majorVersion:1,minorVersion:5}},l=new Error("Invalid input count: Must supply a valid image count (limit of 10)."),c=new Error("Invalid response: Received more images than the specified max limit in the response.");export{r as ChannelType,t as DialogDimension,a as FrameContexts,o as HostClientType,s as HostName,t as TaskModuleDimension,i as TeamType,n as UserTeamRole,l as errorInvalidCount,c as errorInvalidResponse,m as errorNotSupportedOnPlatform,d as minAdaptiveCardVersion,u as teamsMinAdaptiveCardVersion};
@@ -1 +1 @@
1
- import{GlobalVars as t}from"../internal/globalVars.js";import{ensureInitialized as n}from"../internal/internalAPIs.js";import{HostClientType as o}from"./constants.js";import{runtime as e}from"./runtime.js";function r(){var r;return null!==(r=n(e)&&(e.isNAAChannelRecommended||!(!n(e)||t.hostClientType!==o.android&&t.hostClientType!==o.ios&&t.hostClientType!==o.ipados||!e.isLegacyTeams||!e.supports.nestedAppAuth)))&&void 0!==r&&r}export{r as isNAAChannelRecommended};
1
+ import{GlobalVars as t}from"../internal/globalVars.js";import{ensureInitialized as n}from"../internal/internalAPIs.js";import{HostClientType as o}from"./constants.js";import{runtime as e}from"./runtime.js";function i(){var i;return null!==(i=n(e)&&(e.isNAAChannelRecommended||!(!n(e)||t.hostClientType!==o.android&&t.hostClientType!==o.ios&&t.hostClientType!==o.ipados&&t.hostClientType!==o.visionOS||!e.isLegacyTeams||!e.supports.nestedAppAuth)))&&void 0!==i&&i}export{i as isNAAChannelRecommended};
@@ -1 +1 @@
1
- import{__rest as o}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{errorRuntimeNotInitialized as e,errorRuntimeNotSupported as s}from"../internal/constants.js";import{GlobalVars as i}from"../internal/globalVars.js";import{getLogger as t}from"../internal/telemetry.js";import{compareSDKVersions as n,deepFreeze as a}from"../internal/utils.js";import{HostClientType as r,teamsMinAdaptiveCardVersion as p}from"./constants.js";const l=t("runtime"),d=4;function u(o){return o.apiVersion===d}function c(o){if(u(o))return!0;throw-1===o.apiVersion?new Error(e):new Error(s)}let g={apiVersion:-1,supports:{}};const m={apiVersion:4,isNAAChannelRecommended:!1,hostVersionsInfo:p,isLegacyTeams:!0,supports:{appInstallDialog:{},appEntity:{},call:{},chat:{},conversations:{},dialog:{card:{bot:{}},url:{bot:{},parentCommunication:{}},update:{}},interactive:{},logs:{},meetingRoom:{},menus:{},monetization:{},notifications:{},pages:{config:{},backStack:{},fullTrust:{}},remoteCamera:{},teams:{fullTrust:{}},teamsCore:{},video:{sharedFrame:{}}}},b=[r.desktop,r.web,r.rigel,r.surfaceHub,r.teamsRoomsWindows,r.teamsRoomsAndroid,r.teamsPhones,r.teamsDisplays],y=[r.android,r.ios,r.ipados],f=[...b,...y];function h(o){let e=o;if(e.apiVersion<d&&T.forEach((o=>{e.apiVersion===o.versionToUpgradeFrom&&(e=o.upgradeToNextVersion(e))})),u(e))return e;throw new Error("Received a runtime that could not be upgraded to the latest version")}const T=[{versionToUpgradeFrom:1,upgradeToNextVersion:o=>{var e;return{apiVersion:2,hostVersionsInfo:void 0,isLegacyTeams:o.isLegacyTeams,supports:Object.assign(Object.assign({},o.supports),{dialog:o.supports.dialog?{card:void 0,url:o.supports.dialog,update:null===(e=o.supports.dialog)||void 0===e?void 0:e.update}:void 0})}}},{versionToUpgradeFrom:2,upgradeToNextVersion:e=>{const s=e.supports,i=o(s,["appNotification"]);return Object.assign(Object.assign({},e),{apiVersion:3,supports:i})}},{versionToUpgradeFrom:3,upgradeToNextVersion:o=>{var e,s,i,t,n;return{apiVersion:4,hostVersionsInfo:o.hostVersionsInfo,isNAAChannelRecommended:o.isNAAChannelRecommended,isLegacyTeams:o.isLegacyTeams,supports:Object.assign(Object.assign({},o.supports),{dialog:o.supports.dialog?{card:null===(e=o.supports.dialog)||void 0===e?void 0:e.card,url:{bot:null===(i=null===(s=o.supports.dialog)||void 0===s?void 0:s.url)||void 0===i?void 0:i.bot,parentCommunication:(null===(t=o.supports.dialog)||void 0===t?void 0:t.url)?{}:void 0},update:null===(n=o.supports.dialog)||void 0===n?void 0:n.update}:void 0})}}}],v={"1.0.0":[{capability:{pages:{appButton:{},tabs:{}},stageView:{}},hostClientTypes:b}],"1.9.0":[{capability:{location:{}},hostClientTypes:f}],"2.0.0":[{capability:{people:{}},hostClientTypes:f},{capability:{sharing:{}},hostClientTypes:[r.desktop,r.web]}],"2.0.1":[{capability:{teams:{fullTrust:{joinedTeams:{}}}},hostClientTypes:[r.android,r.desktop,r.ios,r.teamsRoomsAndroid,r.teamsPhones,r.teamsDisplays,r.web]},{capability:{webStorage:{}},hostClientTypes:[r.desktop]}],"2.0.5":[{capability:{webStorage:{}},hostClientTypes:[r.android,r.ios]}],"2.0.8":[{capability:{sharing:{}},hostClientTypes:[r.android,r.ios]}],"2.1.1":[{capability:{nestedAppAuth:{}},hostClientTypes:[r.android,r.ios,r.ipados]}]},V=l.extend("generateBackCompatRuntimeConfig");function C(o,e){const s=Object.assign({},o);for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&("object"!=typeof e[i]||Array.isArray(e[i])?i in o||(s[i]=e[i]):s[i]=C(o[i]||{},e[i]));return s}function j(o,e,s){V("generating back compat runtime config for %s",o);let t=Object.assign({},e.supports);V("Supported capabilities in config before updating based on highestSupportedVersion: %o",t),Object.keys(s).forEach((e=>{n(o,e)>=0&&s[e].forEach((o=>{void 0!==i.hostClientType&&o.hostClientTypes.includes(i.hostClientType)&&(t=C(t,o.capability))}))}));const a={apiVersion:d,hostVersionsInfo:p,isLegacyTeams:!0,supports:t};return V("Runtime config after updating based on highestSupportedVersion: %o",a),a}const w=l.extend("applyRuntimeConfig");function A(o){"string"==typeof o.apiVersion&&(w("Trying to apply runtime with string apiVersion, processing as v1: %o",o),o=Object.assign(Object.assign({},o),{apiVersion:1})),w("Fast-forwarding runtime %o",o);const e=h(o);w("Applying runtime %o",e),g=a(e)}export{A as applyRuntimeConfig,h as fastForwardRuntime,j as generateVersionBasedTeamsRuntimeConfig,c as isRuntimeInitialized,d as latestRuntimeApiVersion,v as mapTeamsVersionToSupportedCapabilities,g as runtime,T as upgradeChain,f as v1HostClientTypes,y as v1MobileHostClientTypes,m as versionAndPlatformAgnosticTeamsRuntimeConfig};
1
+ import{__rest as o}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{errorRuntimeNotInitialized as e,errorRuntimeNotSupported as s}from"../internal/constants.js";import{GlobalVars as i}from"../internal/globalVars.js";import{getLogger as t}from"../internal/telemetry.js";import{compareSDKVersions as n,deepFreeze as a}from"../internal/utils.js";import{HostClientType as r,teamsMinAdaptiveCardVersion as p}from"./constants.js";const l=t("runtime"),d=4;function u(o){return o.apiVersion===d}function c(o){if(u(o))return!0;throw-1===o.apiVersion?new Error(e):new Error(s)}let g={apiVersion:-1,supports:{}};const m={apiVersion:4,isNAAChannelRecommended:!1,hostVersionsInfo:p,isLegacyTeams:!0,supports:{appInstallDialog:{},appEntity:{},call:{},chat:{},conversations:{},dialog:{card:{bot:{}},url:{bot:{},parentCommunication:{}},update:{}},interactive:{},logs:{},meetingRoom:{},menus:{},monetization:{},notifications:{},pages:{config:{},backStack:{},fullTrust:{}},remoteCamera:{},teams:{fullTrust:{}},teamsCore:{},video:{sharedFrame:{}}}},b=[r.desktop,r.web,r.rigel,r.surfaceHub,r.teamsRoomsWindows,r.teamsRoomsAndroid,r.teamsPhones,r.teamsDisplays],y=[r.android,r.ios,r.ipados,r.visionOS],f=[...b,...y];function h(o){let e=o;if(e.apiVersion<d&&v.forEach((o=>{e.apiVersion===o.versionToUpgradeFrom&&(e=o.upgradeToNextVersion(e))})),u(e))return e;throw new Error("Received a runtime that could not be upgraded to the latest version")}const v=[{versionToUpgradeFrom:1,upgradeToNextVersion:o=>{var e;return{apiVersion:2,hostVersionsInfo:void 0,isLegacyTeams:o.isLegacyTeams,supports:Object.assign(Object.assign({},o.supports),{dialog:o.supports.dialog?{card:void 0,url:o.supports.dialog,update:null===(e=o.supports.dialog)||void 0===e?void 0:e.update}:void 0})}}},{versionToUpgradeFrom:2,upgradeToNextVersion:e=>{const s=e.supports,i=o(s,["appNotification"]);return Object.assign(Object.assign({},e),{apiVersion:3,supports:i})}},{versionToUpgradeFrom:3,upgradeToNextVersion:o=>{var e,s,i,t,n;return{apiVersion:4,hostVersionsInfo:o.hostVersionsInfo,isNAAChannelRecommended:o.isNAAChannelRecommended,isLegacyTeams:o.isLegacyTeams,supports:Object.assign(Object.assign({},o.supports),{dialog:o.supports.dialog?{card:null===(e=o.supports.dialog)||void 0===e?void 0:e.card,url:{bot:null===(i=null===(s=o.supports.dialog)||void 0===s?void 0:s.url)||void 0===i?void 0:i.bot,parentCommunication:(null===(t=o.supports.dialog)||void 0===t?void 0:t.url)?{}:void 0},update:null===(n=o.supports.dialog)||void 0===n?void 0:n.update}:void 0})}}}],T={"1.0.0":[{capability:{pages:{appButton:{},tabs:{}},stageView:{}},hostClientTypes:b}],"1.9.0":[{capability:{location:{}},hostClientTypes:f}],"2.0.0":[{capability:{people:{}},hostClientTypes:f},{capability:{sharing:{}},hostClientTypes:[r.desktop,r.web]}],"2.0.1":[{capability:{teams:{fullTrust:{joinedTeams:{}}}},hostClientTypes:[r.android,r.desktop,r.ios,r.teamsRoomsAndroid,r.teamsPhones,r.teamsDisplays,r.web]},{capability:{webStorage:{}},hostClientTypes:[r.desktop]}],"2.0.5":[{capability:{webStorage:{}},hostClientTypes:[r.android,r.ios]}],"2.0.8":[{capability:{sharing:{}},hostClientTypes:[r.android,r.ios]}],"2.1.1":[{capability:{nestedAppAuth:{}},hostClientTypes:[r.android,r.ios,r.ipados,r.visionOS]}]},V=l.extend("generateBackCompatRuntimeConfig");function C(o,e){const s=Object.assign({},o);for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&("object"!=typeof e[i]||Array.isArray(e[i])?i in o||(s[i]=e[i]):s[i]=C(o[i]||{},e[i]));return s}function j(o,e,s){V("generating back compat runtime config for %s",o);let t=Object.assign({},e.supports);V("Supported capabilities in config before updating based on highestSupportedVersion: %o",t),Object.keys(s).forEach((e=>{n(o,e)>=0&&s[e].forEach((o=>{void 0!==i.hostClientType&&o.hostClientTypes.includes(i.hostClientType)&&(t=C(t,o.capability))}))}));const a={apiVersion:d,hostVersionsInfo:p,isLegacyTeams:!0,supports:t};return V("Runtime config after updating based on highestSupportedVersion: %o",a),a}const w=l.extend("applyRuntimeConfig");function O(o){"string"==typeof o.apiVersion&&(w("Trying to apply runtime with string apiVersion, processing as v1: %o",o),o=Object.assign(Object.assign({},o),{apiVersion:1})),w("Fast-forwarding runtime %o",o);const e=h(o);w("Applying runtime %o",e),g=a(e)}export{O as applyRuntimeConfig,h as fastForwardRuntime,j as generateVersionBasedTeamsRuntimeConfig,c as isRuntimeInitialized,d as latestRuntimeApiVersion,T as mapTeamsVersionToSupportedCapabilities,g as runtime,v as upgradeChain,f as v1HostClientTypes,y as v1MobileHostClientTypes,m as versionAndPlatformAgnosticTeamsRuntimeConfig};
@@ -1 +1 @@
1
- const t="2.34.0-beta.1";export{t as version};
1
+ const o="2.34.0";export{o as version};
@@ -1 +1 @@
1
- import{__awaiter as t}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 e}from"../internal/communication.js";import{GlobalVars as r}from"../internal/globalVars.js";import{ensureInitialized as o}from"../internal/internalAPIs.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{getCachedHostName as n}from"../internal/webStorageHelpers.js";import{errorNotSupportedOnPlatform as s,HostClientType as l,HostName as m}from"./constants.js";import{runtime as p}from"./runtime.js";function a(){return t(this,void 0,void 0,(function*(){if(o(p),!u())throw s;return!(!p.isLegacyTeams||r.hostClientType!==l.android&&r.hostClientType!==l.ios&&r.hostClientType!==l.ipados||(yield function(){return t(this,void 0,void 0,(function*(){return n()}))}())!==m.teams)||(yield e(i("v2","webStorage.isWebStorageClearedOnUserLogOut"),"webStorage.isWebStorageClearedOnUserLogOut"))}))}function u(){return o(p)&&void 0!==p.supports.webStorage}export{u as isSupported,a as isWebStorageClearedOnUserLogOut};
1
+ import{__awaiter as t}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 e}from"../internal/communication.js";import{GlobalVars as o}from"../internal/globalVars.js";import{ensureInitialized as r}from"../internal/internalAPIs.js";import{getApiVersionTag as i}from"../internal/telemetry.js";import{getCachedHostName as n}from"../internal/webStorageHelpers.js";import{errorNotSupportedOnPlatform as s,HostClientType as l,HostName as p}from"./constants.js";import{runtime as m}from"./runtime.js";function a(){return t(this,void 0,void 0,(function*(){if(r(m),!u())throw s;return!(!m.isLegacyTeams||o.hostClientType!==l.android&&o.hostClientType!==l.ios&&o.hostClientType!==l.ipados&&o.hostClientType!==l.visionOS||(yield function(){return t(this,void 0,void 0,(function*(){return n()}))}())!==p.teams)||(yield e(i("v2","webStorage.isWebStorageClearedOnUserLogOut"),"webStorage.isWebStorageClearedOnUserLogOut"))}))}function u(){return r(m)&&void 0!==m.supports.webStorage}export{u as isSupported,a as isWebStorageClearedOnUserLogOut};