@microsoft/teams-js 2.48.0-beta.1 → 2.48.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/README.md +4 -4
  2. package/dist/esm/_virtual/_polyfill-node.buffer.js +1 -1
  3. package/dist/esm/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js +1 -0
  4. package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/browser.js +1 -1
  5. package/dist/esm/node_modules/.pnpm/debug@4.3.5/node_modules/debug/src/common.js +1 -1
  6. package/dist/esm/node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/v4.js +1 -1
  7. package/dist/esm/packages/teams-js/dts/internal/handlers.d.ts +5 -0
  8. package/dist/esm/packages/teams-js/dts/internal/telemetry.d.ts +1 -0
  9. package/dist/esm/packages/teams-js/dts/public/appPerformanceMetrics.d.ts +24 -0
  10. package/dist/esm/packages/teams-js/dts/public/index.d.ts +2 -1
  11. package/dist/esm/packages/teams-js/dts/public/interfaces.d.ts +59 -0
  12. package/dist/esm/packages/teams-js/dts/public/runtime.d.ts +1 -0
  13. package/dist/esm/packages/teams-js/src/artifactsForCDN/validDomains.json.js +1 -1
  14. package/dist/esm/packages/teams-js/src/index.js +1 -1
  15. package/dist/esm/packages/teams-js/src/internal/appHelpers.js +1 -1
  16. package/dist/esm/packages/teams-js/src/internal/childCommunication.js +1 -1
  17. package/dist/esm/packages/teams-js/src/internal/communication.js +1 -1
  18. package/dist/esm/packages/teams-js/src/internal/deepLinkUtilities.js +1 -1
  19. package/dist/esm/packages/teams-js/src/internal/dialogHelpers.js +1 -1
  20. package/dist/esm/packages/teams-js/src/internal/handlers.js +1 -1
  21. package/dist/esm/packages/teams-js/src/internal/idValidation.js +1 -1
  22. package/dist/esm/packages/teams-js/src/internal/internalAPIs.js +1 -1
  23. package/dist/esm/packages/teams-js/src/internal/marketplaceUtils.js +1 -1
  24. package/dist/esm/packages/teams-js/src/internal/mediaUtil.js +1 -1
  25. package/dist/esm/packages/teams-js/src/internal/messageObjects.js +1 -1
  26. package/dist/esm/packages/teams-js/src/internal/pagesHelpers.js +1 -1
  27. package/dist/esm/packages/teams-js/src/internal/utils.js +1 -1
  28. package/dist/esm/packages/teams-js/src/internal/validOrigins.js +1 -1
  29. package/dist/esm/packages/teams-js/src/internal/videoEffectsUtils.js +1 -1
  30. package/dist/esm/packages/teams-js/src/internal/videoFrameTick.js +1 -1
  31. package/dist/esm/packages/teams-js/src/internal/videoPerformanceMonitor.js +1 -1
  32. package/dist/esm/packages/teams-js/src/internal/webStorageHelpers.js +1 -1
  33. package/dist/esm/packages/teams-js/src/private/conversations.js +1 -1
  34. package/dist/esm/packages/teams-js/src/private/copilot/customTelemetry.js +1 -1
  35. package/dist/esm/packages/teams-js/src/private/copilot/eligibility.js +1 -1
  36. package/dist/esm/packages/teams-js/src/private/copilot/sidePanel.js +1 -1
  37. package/dist/esm/packages/teams-js/src/private/copilot/view.js +1 -1
  38. package/dist/esm/packages/teams-js/src/private/externalAppAuthentication.js +1 -1
  39. package/dist/esm/packages/teams-js/src/private/externalAppAuthenticationForCEA.js +1 -1
  40. package/dist/esm/packages/teams-js/src/private/externalAppCardActions.js +1 -1
  41. package/dist/esm/packages/teams-js/src/private/externalAppCardActionsForCEA.js +1 -1
  42. package/dist/esm/packages/teams-js/src/private/externalAppCardActionsForDA.js +1 -1
  43. package/dist/esm/packages/teams-js/src/private/externalAppCommands.js +1 -1
  44. package/dist/esm/packages/teams-js/src/private/hostEntity/tab.js +1 -1
  45. package/dist/esm/packages/teams-js/src/private/logs.js +1 -1
  46. package/dist/esm/packages/teams-js/src/private/meetingRoom.js +1 -1
  47. package/dist/esm/packages/teams-js/src/private/messageChannels/dataLayer.js +1 -1
  48. package/dist/esm/packages/teams-js/src/private/messageChannels/telemetry.js +1 -1
  49. package/dist/esm/packages/teams-js/src/private/privateAPIs.js +1 -1
  50. package/dist/esm/packages/teams-js/src/private/store.js +1 -1
  51. package/dist/esm/packages/teams-js/src/private/teams/fullTrust/fullTrust.js +1 -1
  52. package/dist/esm/packages/teams-js/src/private/teams/fullTrust/joinedTeams.js +1 -1
  53. package/dist/esm/packages/teams-js/src/private/videoEffectsEx.js +1 -1
  54. package/dist/esm/packages/teams-js/src/private/widgetHosting/widgetHosting.js +1 -1
  55. package/dist/esm/packages/teams-js/src/public/app/app.js +1 -1
  56. package/dist/esm/packages/teams-js/src/public/appInstallDialog.js +1 -1
  57. package/dist/esm/packages/teams-js/src/public/appPerformanceMetrics.js +1 -0
  58. package/dist/esm/packages/teams-js/src/public/authentication.js +1 -1
  59. package/dist/esm/packages/teams-js/src/public/barCode.js +1 -1
  60. package/dist/esm/packages/teams-js/src/public/calendar.js +1 -1
  61. package/dist/esm/packages/teams-js/src/public/call.js +1 -1
  62. package/dist/esm/packages/teams-js/src/public/chat.js +1 -1
  63. package/dist/esm/packages/teams-js/src/public/clipboard.js +1 -1
  64. package/dist/esm/packages/teams-js/src/public/dialog/adaptiveCard/adaptiveCard.js +1 -1
  65. package/dist/esm/packages/teams-js/src/public/dialog/adaptiveCard/bot.js +1 -1
  66. package/dist/esm/packages/teams-js/src/public/dialog/url/parentCommunication.js +1 -1
  67. package/dist/esm/packages/teams-js/src/public/geoLocation/geoLocation.js +1 -1
  68. package/dist/esm/packages/teams-js/src/public/liveShareHost.js +1 -1
  69. package/dist/esm/packages/teams-js/src/public/mail/handoff.js +1 -1
  70. package/dist/esm/packages/teams-js/src/public/mail/mail.js +1 -1
  71. package/dist/esm/packages/teams-js/src/public/media.js +1 -1
  72. package/dist/esm/packages/teams-js/src/public/meeting/meeting.js +1 -1
  73. package/dist/esm/packages/teams-js/src/public/monetization.js +1 -1
  74. package/dist/esm/packages/teams-js/src/public/navigation.js +1 -1
  75. package/dist/esm/packages/teams-js/src/public/nestedAppAuth.js +1 -1
  76. package/dist/esm/packages/teams-js/src/public/pages/appButton.js +1 -1
  77. package/dist/esm/packages/teams-js/src/public/pages/backStack.js +1 -1
  78. package/dist/esm/packages/teams-js/src/public/pages/config.js +1 -1
  79. package/dist/esm/packages/teams-js/src/public/pages/currentApp.js +1 -1
  80. package/dist/esm/packages/teams-js/src/public/pages/pages.js +1 -1
  81. package/dist/esm/packages/teams-js/src/public/people.js +1 -1
  82. package/dist/esm/packages/teams-js/src/public/profile.js +1 -1
  83. package/dist/esm/packages/teams-js/src/public/publicAPIs.js +1 -1
  84. package/dist/esm/packages/teams-js/src/public/runtime.js +1 -1
  85. package/dist/esm/packages/teams-js/src/public/search.js +1 -1
  86. package/dist/esm/packages/teams-js/src/public/settings.js +1 -1
  87. package/dist/esm/packages/teams-js/src/public/sharing/history.js +1 -1
  88. package/dist/esm/packages/teams-js/src/public/sharing/sharing.js +1 -1
  89. package/dist/esm/packages/teams-js/src/public/shortcutRelay.js +1 -1
  90. package/dist/esm/packages/teams-js/src/public/stageView/self.js +1 -1
  91. package/dist/esm/packages/teams-js/src/public/stageView/stageView.js +1 -1
  92. package/dist/esm/packages/teams-js/src/public/tasks.js +1 -1
  93. package/dist/esm/packages/teams-js/src/public/teamsAPIs.js +1 -1
  94. package/dist/esm/packages/teams-js/src/public/thirdPartyCloudStorage.js +1 -1
  95. package/dist/esm/packages/teams-js/src/public/uuidObject.js +1 -1
  96. package/dist/esm/packages/teams-js/src/public/version.js +1 -1
  97. package/dist/esm/packages/teams-js/src/public/videoEffects.js +1 -1
  98. package/dist/esm/packages/teams-js/src/public/visualMedia/image.js +1 -1
  99. package/dist/esm/packages/teams-js/src/public/webStorage.js +1 -1
  100. package/dist/umd/MicrosoftTeams.js +520 -466
  101. package/dist/umd/MicrosoftTeams.js.map +1 -1
  102. package/dist/umd/MicrosoftTeams.min.js +1 -1
  103. package/dist/umd/MicrosoftTeams.min.js.map +1 -1
  104. package/package.json +1 -1
  105. package/dist/esm/node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js +0 -1
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.47.2/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.48.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.47.2/js/MicrosoftTeams.min.js"
49
- integrity="sha384-cHYqJ5XgsfEM71MlcRom4ptI0n2cs5QDu4M0wGB6r6xC/iROf3UjrBy7OYPC1r86"
48
+ src="https://res.cdn.office.net/teams-js/2.48.0/js/MicrosoftTeams.min.js"
49
+ integrity="sha384-/Wkorl2FOOvi9PzFSf8fmiTS8SFTMOlR3mKqmOI4Rc6tra6JqJvmlssRiYqDOMjD"
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.47.2/dist/MicrosoftTeams.min.js"></script>
54
+ <script src="node_modules/@microsoft/teams-js@2.48.0/dist/MicrosoftTeams.min.js"></script>
55
55
 
56
56
  <!-- Microsoft Teams JavaScript API (via local) -->
57
57
  <script src="MicrosoftTeams.min.js"></script>
@@ -1 +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};
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){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function f(t,r,e){for(var n,i=[],o=r;o<e;o+=3)n=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(u(n));return i.join("")}function s(t){var e;i||o();for(var n=t.length,u=n%3,s="",h=[],a=16383,c=0,l=n-u;c<l;c+=a)h.push(f(t,c,c+a>l?l:c+a));return 1===u?(e=t[n-1],s+=r[e>>2],s+=r[e<<4&63],s+="=="):2===u&&(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 h(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 a(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 c={}.toString,l=Array.isArray||function(t){return"[object Array]"==c.call(t)},p=50;function g(){return w.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function y(t,r){if(g()<r)throw new RangeError("Invalid typed array length");return w.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=w.prototype:(null===t&&(t=new w(r)),t.length=r),t}function w(t,r,e){if(!(w.TYPED_ARRAY_SUPPORT||this instanceof w))return new w(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 E(this,t)}return d(this,t,r,e)}function d(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);w.TYPED_ARRAY_SUPPORT?(t=r).__proto__=w.prototype:t=A(t,r);return t}(t,r,e,n):"string"==typeof r?function(t,r,e){"string"==typeof e&&""!==e||(e="utf8");if(!w.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|m(r,e);t=y(t,n);var i=t.write(r,e);i!==n&&(t=t.slice(0,i));return t}(t,r,e):function(t,r){if(b(r)){var e=0|R(r.length);return 0===(t=y(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?y(t,0):A(t,r);if("Buffer"===r.type&&l(r.data))return A(t,r.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function v(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 E(t,r){if(v(r),t=y(t,r<0?0:0|R(r)),!w.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function A(t,r){var e=r.length<0?0:0|R(r.length);t=y(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function R(t){if(t>=g())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+g().toString(16)+" bytes");return 0|t}function b(t){return!(null==t||!t._isBuffer)}function m(t,r){if(b(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 Q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return W(t).length;default:if(n)return Q(t).length;r=(""+r).toLowerCase(),n=!0}}function _(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 N(this,r,e);case"utf8":case"utf-8":return M(this,r,e);case"ascii":return x(this,r,e);case"latin1":case"binary":return k(this,r,e);case"base64":return L(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function P(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function T(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=w.from(r,n)),b(r))return 0===r.length?-1:U(t,r,e,n,i);if("number"==typeof r)return r&=255,w.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):U(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function U(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 B(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 S(t,r,e,n){return X(Q(r,t.length-e),t,e,n)}function Y(t,r,e,n){return X(function(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}(r),t,e,n)}function I(t,r,e,n){return Y(t,r,e,n)}function C(t,r,e,n){return X(W(r),t,e,n)}function O(t,r,e,n){return X(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 L(t,r,e){return 0===r&&e===t.length?s(t):s(t.slice(r,e))}function M(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<=D)return String.fromCharCode.apply(String,t);var e="",n=0;for(;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=D));return e}(n)}w.TYPED_ARRAY_SUPPORT=void 0===t.TYPED_ARRAY_SUPPORT||t.TYPED_ARRAY_SUPPORT,g(),w.poolSize=8192,w._augment=function(t){return t.__proto__=w.prototype,t},w.from=function(t,r,e){return d(null,t,r,e)},w.TYPED_ARRAY_SUPPORT&&(w.prototype.__proto__=Uint8Array.prototype,w.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&w[Symbol.species]),w.alloc=function(t,r,e){return function(t,r,e,n){return v(r),r<=0?y(t,r):void 0!==e?"string"==typeof n?y(t,r).fill(e,n):y(t,r).fill(e):y(t,r)}(null,t,r,e)},w.allocUnsafe=function(t){return E(null,t)},w.allocUnsafeSlow=function(t){return E(null,t)},w.isBuffer=$,w.compare=function(t,r){if(!b(t)||!b(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},w.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}},w.concat=function(t,r){if(!l(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return w.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var n=w.allocUnsafe(r),i=0;for(e=0;e<t.length;++e){var o=t[e];if(!b(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},w.byteLength=m,w.prototype._isBuffer=!0,w.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)P(this,r,r+1);return this},w.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)P(this,r,r+3),P(this,r+1,r+2);return this},w.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)P(this,r,r+7),P(this,r+1,r+6),P(this,r+2,r+5),P(this,r+3,r+4);return this},w.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?M(this,0,t):_.apply(this,arguments)},w.prototype.equals=function(t){if(!b(t))throw new TypeError("Argument must be a Buffer");return this===t||0===w.compare(this,t)},w.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+">"},w.prototype.compare=function(t,r,e,n,i){if(!b(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},w.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},w.prototype.indexOf=function(t,r,e){return T(this,t,r,e,!0)},w.prototype.lastIndexOf=function(t,r,e){return T(this,t,r,e,!1)},w.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 B(this,t,r,e);case"utf8":case"utf-8":return S(this,t,r,e);case"ascii":return Y(this,t,r,e);case"latin1":case"binary":return I(this,t,r,e);case"base64":return C(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},w.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function x(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 k(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 N(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+=K(t[o]);return i}function z(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 F(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 j(t,r,e,n,i,o){if(!b(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 V(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 q(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 J(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 Z(t,r,e,n,i){return i||J(t,0,e,4),a(t,r,e,n,23,4),e+4}function G(t,r,e,n,i){return i||J(t,0,e,8),a(t,r,e,n,52,8),e+8}w.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),w.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=w.prototype;else{var i=r-t;e=new w(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},w.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||F(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},w.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||F(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},w.prototype.readUInt8=function(t,r){return r||F(t,1,this.length),this[t]},w.prototype.readUInt16LE=function(t,r){return r||F(t,2,this.length),this[t]|this[t+1]<<8},w.prototype.readUInt16BE=function(t,r){return r||F(t,2,this.length),this[t]<<8|this[t+1]},w.prototype.readUInt32LE=function(t,r){return r||F(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},w.prototype.readUInt32BE=function(t,r){return r||F(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},w.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||F(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},w.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||F(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},w.prototype.readInt8=function(t,r){return r||F(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},w.prototype.readInt16LE=function(t,r){r||F(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},w.prototype.readInt16BE=function(t,r){r||F(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},w.prototype.readInt32LE=function(t,r){return r||F(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},w.prototype.readInt32BE=function(t,r){return r||F(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},w.prototype.readFloatLE=function(t,r){return r||F(t,4,this.length),h(this,t,!0,23,4)},w.prototype.readFloatBE=function(t,r){return r||F(t,4,this.length),h(this,t,!1,23,4)},w.prototype.readDoubleLE=function(t,r){return r||F(t,8,this.length),h(this,t,!0,52,8)},w.prototype.readDoubleBE=function(t,r){return r||F(t,8,this.length),h(this,t,!1,52,8)},w.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||j(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},w.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||j(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},w.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,1,255,0),w.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},w.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,65535,0),w.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):V(this,t,r,!0),r+2},w.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,65535,0),w.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):V(this,t,r,!1),r+2},w.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,4294967295,0),w.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):q(this,t,r,!0),r+4},w.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,4294967295,0),w.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):q(this,t,r,!1),r+4},w.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);j(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},w.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);j(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},w.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,1,127,-128),w.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},w.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,32767,-32768),w.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):V(this,t,r,!0),r+2},w.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,32767,-32768),w.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):V(this,t,r,!1),r+2},w.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,2147483647,-2147483648),w.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):q(this,t,r,!0),r+4},w.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),w.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):q(this,t,r,!1),r+4},w.prototype.writeFloatLE=function(t,r,e){return Z(this,t,r,!0,e)},w.prototype.writeFloatBE=function(t,r,e){return Z(this,t,r,!1,e)},w.prototype.writeDoubleLE=function(t,r,e){return G(this,t,r,!0,e)},w.prototype.writeDoubleBE=function(t,r,e){return G(this,t,r,!1,e)},w.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||!w.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},w.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&&!w.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=b(t)?t:Q(new w(t,n).toString()),f=u.length;for(o=0;o<e-r;++o)this[o+r]=u[o%f]}return this};var H=/[^+\/0-9A-Za-z-_]/g;function K(t){return t<16?"0"+t.toString(16):t.toString(16)}function Q(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 W(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(H,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function X(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 $(t){return null!=t&&(!!t._isBuffer||tt(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&tt(t.slice(0,0))}(t))}function tt(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}export{w as Buffer,p as INSPECT_MAX_BYTES,$ as isBuffer};
@@ -0,0 +1 @@
1
+ function t(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]])}return e}function n(t,n,e,r){return new(e||(e=Promise))(function(o,c){function p(t){try{u(r.next(t))}catch(t){c(t)}}function f(t){try{u(r.throw(t))}catch(t){c(t)}}function u(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e(function(t){t(n)})).then(p,f)}u((r=r.apply(t,n||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;export{n as __awaiter,t as __rest};
@@ -1 +1 @@
1
- import{__module as e}from"../../../../../../_virtual/browser.js";import{c as o}from"./common.js";!function(e,C){C.formatArgs=function(o){if(o[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+o[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const C="color: "+this.color;o.splice(1,0,C,"color: inherit");let t=0,n=0;o[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(t++,"%c"===e&&(n=t))})),o.splice(n,0,C)},C.save=function(e){try{e?C.storage.setItem("debug",e):C.storage.removeItem("debug")}catch(e){}},C.load=function(){let e;try{e=C.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},C.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},C.storage=function(){try{return localStorage}catch(e){}}(),C.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),C.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],C.log=console.debug||console.log||(()=>{}),e.exports=o(C);const{formatters:t}=e.exports;t.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(e,e.exports);var C=e.exports;export{C as b};
1
+ import{__module as e}from"../../../../../../_virtual/browser.js";import{c as o}from"./common.js";!function(e,C){C.formatArgs=function(o){if(o[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+o[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const C="color: "+this.color;o.splice(1,0,C,"color: inherit");let t=0,n=0;o[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(t++,"%c"===e&&(n=t))}),o.splice(n,0,C)},C.save=function(e){try{e?C.storage.setItem("debug",e):C.storage.removeItem("debug")}catch(e){}},C.load=function(){let e;try{e=C.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},C.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},C.storage=function(){try{return localStorage}catch(e){}}(),C.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),C.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],C.log=console.debug||console.log||(()=>{}),e.exports=o(C);const{formatters:t}=e.exports;t.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(e,e.exports);var C=e.exports;export{C as b};
@@ -1 +1 @@
1
- import{__require as e}from"../../../../ms@2.1.2/node_modules/ms/index.js";var n=function(n){function t(e){let n,s,o,a=null;function l(...e){if(!l.enabled)return;const r=l,s=Number(new Date),o=s-(n||s);r.diff=o,r.prev=n,r.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,s)=>{if("%%"===n)return"%";a++;const o=t.formatters[s];if("function"==typeof o){const t=e[a];n=o.call(r,t),e.splice(a,1),a--}return n})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return l.namespace=e,l.useColors=t.useColors(),l.color=t.selectColor(e),l.extend=r,l.destroy=t.destroy,Object.defineProperty(l,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(s!==t.namespaces&&(s=t.namespaces,o=t.enabled(e)),o),set:e=>{a=e}}),"function"==typeof t.init&&t.init(l),l}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(s),...t.skips.map(s).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),s=r.length;for(n=0;n<s;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=e(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(n).forEach((e=>{t[e]=n[e]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t};export{n as c};
1
+ import{__require as e}from"../../../../ms@2.1.2/node_modules/ms/index.js";var n=function(n){function t(e){let n,s,o,a=null;function l(...e){if(!l.enabled)return;const r=l,s=Number(new Date),o=s-(n||s);r.diff=o,r.prev=n,r.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,s)=>{if("%%"===n)return"%";a++;const o=t.formatters[s];if("function"==typeof o){const t=e[a];n=o.call(r,t),e.splice(a,1),a--}return n}),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return l.namespace=e,l.useColors=t.useColors(),l.color=t.selectColor(e),l.extend=r,l.destroy=t.destroy,Object.defineProperty(l,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(s!==t.namespaces&&(s=t.namespaces,o=t.enabled(e)),o),set:e=>{a=e}}),"function"==typeof t.init&&t.init(l),l}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function s(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(s),...t.skips.map(s).map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),s=r.length;for(n=0;n<s;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=e(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(n).forEach(e=>{t[e]=n[e]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t};export{n as c};
@@ -1 +1 @@
1
- import r from"./native.js";import n from"./rng.js";import{unsafeStringify as o}from"./stringify.js";function t(t,m,i){if(r.randomUUID&&!m&&!t)return r.randomUUID();const f=(t=t||{}).random||(t.rng||n)();return f[6]=15&f[6]|64,f[8]=63&f[8]|128,o(f)}export{t as default};
1
+ import r from"./native.js";import n from"./rng.js";import{unsafeStringify as o}from"./stringify.js";function t(t,m,i){if(r.randomUUID&&!t)return r.randomUUID();const f=(t=t||{}).random||(t.rng||n)();return f[6]=15&f[6]|64,f[8]=63&f[8]|128,o(f)}export{t as default};
@@ -60,6 +60,11 @@ export declare function registerOnContextChangeHandler(apiVersionTag: string, ha
60
60
  * Limited to Microsoft-internal use
61
61
  */
62
62
  export declare function handleThemeChange(theme: string): void;
63
+ /**
64
+ * @internal
65
+ * Limited to Microsoft-internal use
66
+ */
67
+ export declare function handleContextChange(context: Context): void;
63
68
  /**
64
69
  * @internal
65
70
  * Limited to Microsoft-internal use
@@ -53,6 +53,7 @@ export declare const enum ApiName {
53
53
  AppInitialization_NotifyFailure = "appInitialization.notifyFailure",
54
54
  AppInitialization_NotifySuccess = "appInitialization.notifySuccess",
55
55
  AppEntity_SelectAppEntity = "appEntity.selectAppEntity",
56
+ AppPerformanceMetrics_RegisterHostMemoryMetricsHandler = "appPerformanceMetrics.memoryUsageHeartbeat",
56
57
  AppInstallDialog_OpenAppInstallDialog = "appInstallDialog.openAppInstallDialog",
57
58
  AppWindow_ChildAppWindow_AddEventListener = "appWindow.childAppWindow.addEventListener",
58
59
  AppWindow_ChildAppWindow_PostMessage = "appWindow.childAppWindow.postMessage",
@@ -0,0 +1,24 @@
1
+ import { HostMemoryMetrics } from './interfaces';
2
+ /**
3
+ * @beta
4
+ * Indicates whether the app performance metrics capability is supported in the current host.
5
+ * @returns boolean to represent whether the shortcutRelay capability is supported
6
+ *
7
+ * @throws Error if {@link app.initialize} has not successfully completed
8
+ *
9
+ */
10
+ export declare function isSupported(): boolean;
11
+ /**
12
+ * This function is passed to registerHostMemoryMetricsHandler. See {@link HostMemoryMetrics} to see which metrics are passed to the handler during a certain interval of time.
13
+ */
14
+ export type HostMemoryMetricsHandler = (metrics: HostMemoryMetrics) => void;
15
+ /**
16
+ * @beta
17
+ * Registers a function to handle memory metrics heartbeat sent from the host periodically.
18
+ *
19
+ * @remarks
20
+ * Only one handler can be registered at a time. A subsequent registration replaces an existing registration.
21
+ *
22
+ * @param handler - The handler to invoke each time memory metrics heartbeat is received from the host.
23
+ */
24
+ export declare function registerHostMemoryMetricsHandler(handler: HostMemoryMetricsHandler): void;
@@ -1,8 +1,9 @@
1
1
  export * as authentication from './authentication';
2
2
  export { ChannelType, DialogDimension, FrameContexts, HostClientType, HostName, RenderingSurfaces, TaskModuleDimension, TeamType, UserTeamRole, } from './constants';
3
- export { ActionInfo, ActionObjectType, AdaptiveCardVersion, AdaptiveCardDialogInfo, BaseActionObject, BotAdaptiveCardDialogInfo, BotUrlDialogInfo, Context, DeepLinkParameters, DialogInfo, DialogSize, EduType, ErrorCode, FileOpenPreference, FrameContext, FrameInfo, HostToAppPerformanceMetrics, LoadContext, LocaleInfo, M365ContentAction, ResumeContext, SdkError, SecondaryId, SecondaryM365ContentIdName, ShareDeepLinkParameters, TabInformation, TabInstance, TabInstanceParameters, TaskInfo, TeamInformation, UrlDialogInfo, } from './interfaces';
3
+ export { ActionInfo, ActionObjectType, AdaptiveCardVersion, AdaptiveCardDialogInfo, BaseActionObject, BotAdaptiveCardDialogInfo, BotUrlDialogInfo, Context, DeepLinkParameters, DialogInfo, DialogSize, EduType, ErrorCode, FileOpenPreference, FrameContext, FrameInfo, HostMemoryMetrics, HostToAppFrameMemoryMetrics, HostToAppPerformanceMetrics, LoadContext, LocaleInfo, M365ContentAction, ResumeContext, SdkError, SecondaryId, SecondaryM365ContentIdName, ShareDeepLinkParameters, TabInformation, TabInstance, TabInstanceParameters, TaskInfo, TeamInformation, UrlDialogInfo, } from './interfaces';
4
4
  export * as app from './app/app';
5
5
  export { AppId } from './appId';
6
+ export * as appPerformanceMetrics from './appPerformanceMetrics';
6
7
  export { EmailAddress } from './emailAddress';
7
8
  export * as appInstallDialog from './appInstallDialog';
8
9
  export * as barCode from './barCode';
@@ -161,6 +161,11 @@ export interface LocaleInfo {
161
161
  * @example 10:10:42 AM
162
162
  */
163
163
  longTime: string;
164
+ /**
165
+ * A string representing the timezone of the user's locale in IANA format
166
+ * @example 'America/Los_Angeles'
167
+ */
168
+ timezone?: string;
164
169
  }
165
170
  /**
166
171
  * Allowed user file open preferences
@@ -1241,3 +1246,57 @@ export interface HostToAppPerformanceMetrics {
1241
1246
  /** The time when the request was dispatched */
1242
1247
  requestStartedAt: number;
1243
1248
  }
1249
+ /**
1250
+ * Memory metrics for a specific frame within the app.
1251
+ */
1252
+ export type HostToAppFrameMemoryMetrics = {
1253
+ /**
1254
+ * The amount of RAM consumed by this frame of the app (in KB).
1255
+ */
1256
+ workingSetSizeKB: number;
1257
+ /**
1258
+ * The amount of memory allocated by this frame of the app (in KB).
1259
+ */
1260
+ commitSizeKB: number;
1261
+ /**
1262
+ * Identifies the frame by host and path, e.g. https://example.com/path/.
1263
+ */
1264
+ hostAndPath: string;
1265
+ /**
1266
+ * Identifies the frame by the process hosting its web contents.
1267
+ */
1268
+ processId: number;
1269
+ /**
1270
+ * The nesting level of this frame within the app frame. The top-level frame is 0.
1271
+ */
1272
+ treeLevel: number;
1273
+ };
1274
+ /**
1275
+ * Memory metrics provided by the host for the app.
1276
+ */
1277
+ export type HostMemoryMetrics = {
1278
+ /**
1279
+ * Indicates if the app is in a hidden state to accelerate future launches.
1280
+ */
1281
+ isCached: boolean;
1282
+ /**
1283
+ * Indicates if the app is in a preloaded state to accelerate its first launch in the session.
1284
+ */
1285
+ isPrecached: boolean;
1286
+ /**
1287
+ * Indicates whether the app is sharing its hosting process (and therefore its memory metrics) with another top-level app frame.
1288
+ */
1289
+ isSharingProcess: boolean;
1290
+ /**
1291
+ * The amount of RAM currently consumed by all frames of the app (in KB).
1292
+ */
1293
+ totalFrameWorkingSetSizeKB: number;
1294
+ /**
1295
+ * The amount of memory allocated by all frames of the app (in KB).
1296
+ */
1297
+ totalFrameCommitSizeKB: number;
1298
+ /**
1299
+ * A breakdown of the memory metrics by each frame.
1300
+ */
1301
+ frameMemoryMetrics: HostToAppFrameMemoryMetrics[];
1302
+ };
@@ -24,6 +24,7 @@ interface IRuntimeV4 extends IBaseRuntime {
24
24
  };
25
25
  readonly appEntity?: {};
26
26
  readonly appInstallDialog?: {};
27
+ readonly appPerformanceMetrics?: {};
27
28
  readonly barCode?: {};
28
29
  readonly calendar?: {};
29
30
  readonly call?: {};
@@ -1 +1 @@
1
- var o=["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.office365.us","outlook-dod.office365.us","webmail.apps.mil","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","*.outlook.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net","fa000000125.officeapps.live.com","fa000000129.officeapps.live.com","fa000000124.officeapps.live.com","fa000000128.officeapps.live.com","fa000000136.mro1cdnstorage.public.onecdn.static.microsoft","substrate-msb-bizchatvnext-service.sdf01.substrate-msb-bingatwork.eastus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2sdf1.office-home-m365copilotapp.westus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2test1.office-home-m365copilotapp.westus2-test.cosmic-int.office.net","m365copilotapp.svc.cloud.microsoft","m365copilotapp.svc.cloud.dev.microsoft","ffc-copilot.officeapps.live.com","m365.cloud.dev.microsoft","m365.cloud.dev.microsoft:3001"],c={validOrigins:o};export{c as default,o as validOrigins};
1
+ var o=["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.office365.us","outlook-dod.office365.us","webmail.apps.mil","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","*.outlook.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net","fa000000125.officeapps.live.com","fa000000129.officeapps.live.com","fa000000124.officeapps.live.com","fa000000128.officeapps.live.com","fa000000136.mro1cdnstorage.public.cdn.office.net","fa000000136.mro1cdnstorage.public.onecdn.static.microsoft","substrate-msb-bizchatvnext-service.sdf01.substrate-msb-bingatwork.eastus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2sdf1.office-home-m365copilotapp.westus2-sdf.cosmic-ppe.office.net","office-home-m365copilotapp.wus2test1.office-home-m365copilotapp.westus2-test.cosmic-int.office.net","m365copilotapp.svc.cloud.microsoft","m365copilotapp.svc.cloud.dev.microsoft","ffc-copilot.officeapps.live.com","m365.cloud.dev.microsoft","m365.cloud.dev.microsoft:3001"],c={validOrigins:o};export{c as default,o as validOrigins};
@@ -1 +1 @@
1
- export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";import*as e from"./private/externalAppAuthentication.js";export{e as externalAppAuthentication};export{UserAuthenticationState}from"./private/externalAppAuthentication.js";import*as r from"./private/logs.js";export{r as logs};import*as t from"./private/conversations.js";export{t as conversations};import*as o from"./private/copilot/copilot.js";export{o as copilot};import*as p from"./private/copilot/sidePanelInterfaces.js";export{p as sidePanelInterfaces};import*as i from"./private/externalAppAuthenticationForCEA.js";export{i as externalAppAuthenticationForCEA};import*as a from"./private/externalAppCardActions.js";export{a as externalAppCardActions};import*as s from"./private/externalAppCardActionsForCEA.js";export{s as externalAppCardActionsForCEA};import*as m from"./private/externalAppCardActionsForDA.js";export{m as externalAppCardActionsForDA};import*as n from"./private/externalAppCommands.js";export{n as externalAppCommands};import*as l from"./private/files.js";export{l as files};import*as c from"./private/meetingRoom.js";export{c as meetingRoom};import*as f from"./private/messageChannels/messageChannels.js";export{f as messageChannels};import*as u from"./private/nestedAppAuth/nestedAppAuthBridge.js";export{u as nestedAppAuthBridge};import*as x from"./private/notifications.js";export{x as notifications};import*as j from"./private/otherAppStateChange.js";export{j as otherAppStateChange};import*as d from"./private/remoteCamera.js";export{d as remoteCamera};import*as g from"./private/appEntity.js";export{g as appEntity};import*as b from"./private/teams/teams.js";export{b as teams};import*as v from"./private/videoEffectsEx.js";export{v as videoEffectsEx};import*as A from"./private/hostEntity/hostEntity.js";export{A as hostEntity};import*as C from"./private/store.js";export{C as store};import*as h from"./private/widgetHosting/widgetHosting.js";export{h as widgetHosting};export{ChannelType,DialogDimension,FrameContexts,HostClientType,HostName,RenderingSurfaces,DialogDimension as TaskModuleDimension,TeamType,UserTeamRole}from"./public/constants.js";export{ActionObjectType,EduType,ErrorCode,FileOpenPreference,SecondaryM365ContentIdName}from"./public/interfaces.js";export{AppId}from"./public/appId.js";export{EmailAddress}from"./public/emailAddress.js";export{activateChildProxyingCommunication,getCurrentFeatureFlagsState,overwriteFeatureFlagsState,setFeatureFlagsState}from"./public/featureFlags.js";export{getAdaptiveCardSchemaVersion}from"./public/adaptiveCards.js";export{ChildAppWindow,ParentAppWindow}from"./public/appWindow.js";export{ValidatedSafeString}from"./public/validatedSafeString.js";export{version}from"./public/version.js";export{enablePrintCapability,executeDeepLink,getContext,getMruTabInstances,getTabInstances,initialize,initializeWithFrameContext,print,registerAppButtonClickHandler,registerAppButtonHoverEnterHandler,registerAppButtonHoverLeaveHandler,registerBackButtonHandler,registerBeforeUnloadHandler,registerChangeSettingsHandler,registerFocusEnterHandler,registerFullScreenHandler,registerOnLoadHandler,registerOnThemeChangeHandler,setFrameContext,shareDeepLink}from"./public/publicAPIs.js";export{navigateBack,navigateCrossDomain,navigateToTab,returnFocus}from"./public/navigation.js";export{UUID}from"./public/uuidObject.js";import*as S from"./public/liveShareHost.js";export{S as liveShare};export{LiveShareHost}from"./public/liveShareHost.js";import*as H from"./public/authentication.js";export{H as authentication};import*as F from"./public/app/app.js";export{F as app};import*as y from"./public/appInstallDialog.js";export{y as appInstallDialog};import*as T from"./public/barCode.js";export{T as barCode};import*as E from"./public/chat.js";export{E as chat};import*as w from"./public/clipboard.js";export{w as clipboard};import*as I from"./public/dialog/dialog.js";export{I as dialog};import*as D from"./public/nestedAppAuth.js";export{D as nestedAppAuth};import*as P from"./public/geoLocation/geoLocation.js";export{P as geoLocation};import*as B from"./public/pages/pages.js";export{B as pages};import*as k from"./public/menus.js";export{k as menus};import*as L from"./public/media.js";export{L as media};import*as U from"./public/secondaryBrowser.js";export{U as secondaryBrowser};import*as M from"./public/location.js";export{M as location};import*as O from"./public/meeting/meeting.js";export{O as meeting};import*as V from"./public/monetization.js";export{V as monetization};import*as z from"./public/calendar.js";export{z as calendar};import*as R from"./public/mail/mail.js";export{R as mail};import*as W from"./public/teamsAPIs.js";export{W as teamsCore};import*as N from"./public/people.js";export{N as people};import*as q from"./public/profile.js";export{q as profile};import*as G from"./public/videoEffects.js";export{G as videoEffects};import*as J from"./public/search.js";export{J as search};import*as K from"./public/sharing/sharing.js";export{K as sharing};import*as Q from"./public/stageView/stageView.js";export{Q as stageView};import*as X from"./public/visualMedia/visualMedia.js";export{X as visualMedia};import*as Y from"./public/webStorage.js";export{Y as webStorage};import*as Z from"./public/call.js";export{Z as call};import*as $ from"./public/appInitialization.js";export{$ as appInitialization};import*as _ from"./public/thirdPartyCloudStorage.js";export{_ as thirdPartyCloudStorage};import*as ee from"./public/settings.js";export{ee as settings};import*as re from"./public/tasks.js";export{re as tasks};import*as te from"./public/marketplace.js";export{te as marketplace};import*as oe from"./public/shortcutRelay.js";export{oe as shortcutRelay};
1
+ export{NotificationTypes,UserSettingTypes,ViewerActionTypes}from"./private/interfaces.js";export{openFilePreview,registerCustomHandler,registerUserSettingsChangeHandler,sendCustomEvent,sendCustomMessage,uploadCustomApp}from"./private/privateAPIs.js";import*as e from"./private/externalAppAuthentication.js";export{e as externalAppAuthentication};export{UserAuthenticationState}from"./private/externalAppAuthentication.js";import*as r from"./private/logs.js";export{r as logs};import*as t from"./private/conversations.js";export{t as conversations};import*as o from"./private/copilot/copilot.js";export{o as copilot};import*as p from"./private/copilot/sidePanelInterfaces.js";export{p as sidePanelInterfaces};import*as i from"./private/externalAppAuthenticationForCEA.js";export{i as externalAppAuthenticationForCEA};import*as a from"./private/externalAppCardActions.js";export{a as externalAppCardActions};import*as s from"./private/externalAppCardActionsForCEA.js";export{s as externalAppCardActionsForCEA};import*as m from"./private/externalAppCardActionsForDA.js";export{m as externalAppCardActionsForDA};import*as n from"./private/externalAppCommands.js";export{n as externalAppCommands};import*as l from"./private/files.js";export{l as files};import*as c from"./private/meetingRoom.js";export{c as meetingRoom};import*as f from"./private/messageChannels/messageChannels.js";export{f as messageChannels};import*as u from"./private/nestedAppAuth/nestedAppAuthBridge.js";export{u as nestedAppAuthBridge};import*as x from"./private/notifications.js";export{x as notifications};import*as j from"./private/otherAppStateChange.js";export{j as otherAppStateChange};import*as d from"./private/remoteCamera.js";export{d as remoteCamera};import*as g from"./private/appEntity.js";export{g as appEntity};import*as b from"./private/teams/teams.js";export{b as teams};import*as v from"./private/videoEffectsEx.js";export{v as videoEffectsEx};import*as A from"./private/hostEntity/hostEntity.js";export{A as hostEntity};import*as C from"./private/store.js";export{C as store};import*as h from"./private/widgetHosting/widgetHosting.js";export{h as widgetHosting};export{ChannelType,DialogDimension,FrameContexts,HostClientType,HostName,RenderingSurfaces,DialogDimension as TaskModuleDimension,TeamType,UserTeamRole}from"./public/constants.js";export{ActionObjectType,EduType,ErrorCode,FileOpenPreference,SecondaryM365ContentIdName}from"./public/interfaces.js";export{AppId}from"./public/appId.js";export{EmailAddress}from"./public/emailAddress.js";export{activateChildProxyingCommunication,getCurrentFeatureFlagsState,overwriteFeatureFlagsState,setFeatureFlagsState}from"./public/featureFlags.js";export{getAdaptiveCardSchemaVersion}from"./public/adaptiveCards.js";export{ChildAppWindow,ParentAppWindow}from"./public/appWindow.js";export{ValidatedSafeString}from"./public/validatedSafeString.js";export{version}from"./public/version.js";export{enablePrintCapability,executeDeepLink,getContext,getMruTabInstances,getTabInstances,initialize,initializeWithFrameContext,print,registerAppButtonClickHandler,registerAppButtonHoverEnterHandler,registerAppButtonHoverLeaveHandler,registerBackButtonHandler,registerBeforeUnloadHandler,registerChangeSettingsHandler,registerFocusEnterHandler,registerFullScreenHandler,registerOnLoadHandler,registerOnThemeChangeHandler,setFrameContext,shareDeepLink}from"./public/publicAPIs.js";export{navigateBack,navigateCrossDomain,navigateToTab,returnFocus}from"./public/navigation.js";export{UUID}from"./public/uuidObject.js";import*as S from"./public/liveShareHost.js";export{S as liveShare};export{LiveShareHost}from"./public/liveShareHost.js";import*as H from"./public/authentication.js";export{H as authentication};import*as F from"./public/app/app.js";export{F as app};import*as y from"./public/appPerformanceMetrics.js";export{y as appPerformanceMetrics};import*as T from"./public/appInstallDialog.js";export{T as appInstallDialog};import*as E from"./public/barCode.js";export{E as barCode};import*as w from"./public/chat.js";export{w as chat};import*as I from"./public/clipboard.js";export{I as clipboard};import*as D from"./public/dialog/dialog.js";export{D as dialog};import*as P from"./public/nestedAppAuth.js";export{P as nestedAppAuth};import*as B from"./public/geoLocation/geoLocation.js";export{B as geoLocation};import*as k from"./public/pages/pages.js";export{k as pages};import*as L from"./public/menus.js";export{L as menus};import*as M from"./public/media.js";export{M as media};import*as U from"./public/secondaryBrowser.js";export{U as secondaryBrowser};import*as O from"./public/location.js";export{O as location};import*as V from"./public/meeting/meeting.js";export{V as meeting};import*as z from"./public/monetization.js";export{z as monetization};import*as R from"./public/calendar.js";export{R as calendar};import*as W from"./public/mail/mail.js";export{W as mail};import*as N from"./public/teamsAPIs.js";export{N as teamsCore};import*as q from"./public/people.js";export{q as people};import*as G from"./public/profile.js";export{G as profile};import*as J from"./public/videoEffects.js";export{J as videoEffects};import*as K from"./public/search.js";export{K as search};import*as Q from"./public/sharing/sharing.js";export{Q as sharing};import*as X from"./public/stageView/stageView.js";export{X as stageView};import*as Y from"./public/visualMedia/visualMedia.js";export{Y as visualMedia};import*as Z from"./public/webStorage.js";export{Z as webStorage};import*as $ from"./public/call.js";export{$ as call};import*as _ from"./public/appInitialization.js";export{_ as appInitialization};import*as ee from"./public/thirdPartyCloudStorage.js";export{ee as thirdPartyCloudStorage};import*as re from"./public/settings.js";export{re as settings};import*as te from"./public/tasks.js";export{te as tasks};import*as oe from"./public/marketplace.js";export{oe as marketplace};import*as pe from"./public/shortcutRelay.js";export{pe as shortcutRelay};
@@ -1 +1 @@
1
- import{__awaiter as i}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.24.4_tslib@2.6.3_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendMessageToParent as e,sendAndHandleStatusAndReason as t,callFunctionInHostAndHandleResponse as n,initializeCommunication as o}from"./communication.js";import{errorLibraryNotInitialized as r,defaultSDKVersionForCompatCheck as s}from"./constants.js";import{GlobalVars as l}from"./globalVars.js";import{registerOnThemeChangeHandler as a,registerOnContextChangeHandler as p,initializeHandlers as u}from"./handlers.js";import{ensureInitializeCalled as m,ensureInitialized as c,processAdditionalValidOrigins as f}from"./internalAPIs.js";import{getLogger as d}from"./telemetry.js";import{isNullOrUndefined as g}from"./typeCheckUtilities.js";import{inServerSideRenderingEnvironment as h,runWithTimeout as S,normalizeAgeGroupValue as j,compareSDKVersions as v}from"./utils.js";import{Messages as w}from"../public/app/app.js";import{FrameContexts as y}from"../public/constants.js";import{initialize as z}from"../public/dialog/dialog.js";import{initialize as b}from"../public/menus.js";import{runtime as P,applyRuntimeConfig as C,generateVersionBasedTeamsRuntimeConfig as x,mapTeamsVersionToSupportedCapabilities as D,versionAndPlatformAgnosticTeamsRuntimeConfig as E}from"../public/runtime.js";import{version as V}from"../public/version.js";import{SimpleTypeResponseHandler as K}from"./responseHandler.js";import{initialize as _}from"../public/pages/config.js";const k=d("app");function A(i,e){if(h()){return k.extend("initialize")("window object undefined at initialization"),Promise.resolve()}return S((()=>function(i,e){return new Promise((t=>{l.initializeCalled||(l.initializeCalled=!0,u(),l.initializePromise=o(e,i).then((({context:i,clientType:e,runtimeConfig:t,clientSupportedSDKVersion:n=s})=>{l.frameContext=i,l.hostClientType=e,l.clientSupportedSDKVersion=n;try{L("Parsing %s",t);let i=JSON.parse(t);if(L("Checking if %o is a valid runtime object",null!=i?i:"null"),!i||!i.apiVersion)throw new Error("Received runtime config is invalid");i=j(i),t&&C(i)}catch(i){if(!(i instanceof SyntaxError))throw i;try{L("Attempting to parse %s as an SDK version",t),isNaN(v(t,s))||(l.clientSupportedSDKVersion=t);let i=JSON.parse(n);if(L("givenRuntimeConfig parsed to %o",null!=i?i:"null"),!i)throw new Error("givenRuntimeConfig string was successfully parsed. However, it parsed to value of null");i=j(i),C(i)}catch(i){if(!(i instanceof SyntaxError))throw i;C(x(l.clientSupportedSDKVersion,E,D))}}l.initializeCompleted=!0})),b(),_(),z()),Array.isArray(e)&&f(e),void 0!==l.initializePromise?t(l.initializePromise):L("GlobalVars.initializePromise is unexpectedly undefined")}))}(i,e)),6e4,new Error("SDK initialization timed out."))}function F(i){e(i,w.AppLoaded,[V])}function N(i,t){e(i,w.ExpectedFailure,[t.reason,t.message])}function R(i,t){e(i,w.Failure,[t.reason,t.message])}function H(e){return i(this,void 0,void 0,(function*(){if(l.initializeCompleted)return J(e);if(!l.initializePromise)throw new Error(r);return l.initializePromise.then((()=>J(e)))}))}function J(t){return i(this,void 0,void 0,(function*(){return c(P)&&(null===(i=P.supports.app)||void 0===i?void 0:i.notifySuccessResponse)?n(w.Success,[V],new K,t).then((()=>({hasFinishedSuccessfully:!0}))):(e(t,w.Success,[V]),{hasFinishedSuccessfully:"unknown"});var i}))}const L=k.extend("initializeHelper");function O(i,e){!g(e)&&m(),a(i,e)}function T(i,e){!g(e)&&m(),p(i,e)}function G(i,e){return new Promise((n=>{c(P,y.content,y.sidePanel,y.settings,y.task,y.stage,y.meetingStage),n(t(i,"executeDeepLink",e))}))}export{A as appInitializeHelper,J as callNotifySuccessInHost,F as notifyAppLoadedHelper,N as notifyExpectedFailureHelper,R as notifyFailureHelper,H as notifySuccessHelper,G as openLinkHelper,T as registerOnContextChangeHandlerHelper,O as registerOnThemeChangeHandlerHelper};
1
+ import{__awaiter as i}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{sendAndHandleStatusAndReason as e,sendMessageToParent as t,callFunctionInHostAndHandleResponse as n,initializeCommunication as o}from"./communication.js";import{errorLibraryNotInitialized as r,defaultSDKVersionForCompatCheck as s}from"./constants.js";import{GlobalVars as l}from"./globalVars.js";import{registerOnThemeChangeHandler as a,registerOnContextChangeHandler as p,initializeHandlers as u}from"./handlers.js";import{ensureInitialized as m,ensureInitializeCalled as c,processAdditionalValidOrigins as f}from"./internalAPIs.js";import{getLogger as d}from"./telemetry.js";import{isNullOrUndefined as g}from"./typeCheckUtilities.js";import{inServerSideRenderingEnvironment as h,runWithTimeout as S,normalizeAgeGroupValue as j,compareSDKVersions as v}from"./utils.js";import{Messages as w}from"../public/app/app.js";import{FrameContexts as y}from"../public/constants.js";import{initialize as z}from"../public/dialog/dialog.js";import{initialize as b}from"../public/menus.js";import{runtime as P,applyRuntimeConfig as C,generateVersionBasedTeamsRuntimeConfig as x,mapTeamsVersionToSupportedCapabilities as D,versionAndPlatformAgnosticTeamsRuntimeConfig as E}from"../public/runtime.js";import{version as V}from"../public/version.js";import{SimpleTypeResponseHandler as K}from"./responseHandler.js";import{initialize as _}from"../public/pages/config.js";const k=d("app");function A(i,e){if(h()){return k.extend("initialize")("window object undefined at initialization"),Promise.resolve()}return S(()=>function(i,e){return new Promise(t=>{l.initializeCalled||(l.initializeCalled=!0,u(),l.initializePromise=o(e,i).then(({context:i,clientType:e,runtimeConfig:t,clientSupportedSDKVersion:n=s})=>{l.frameContext=i,l.hostClientType=e,l.clientSupportedSDKVersion=n;try{L("Parsing %s",t);let i=JSON.parse(t);if(L("Checking if %o is a valid runtime object",null!=i?i:"null"),!i||!i.apiVersion)throw new Error("Received runtime config is invalid");i=j(i),t&&C(i)}catch(i){if(!(i instanceof SyntaxError))throw i;try{L("Attempting to parse %s as an SDK version",t),isNaN(v(t,s))||(l.clientSupportedSDKVersion=t);let i=JSON.parse(n);if(L("givenRuntimeConfig parsed to %o",null!=i?i:"null"),!i)throw new Error("givenRuntimeConfig string was successfully parsed. However, it parsed to value of null");i=j(i),C(i)}catch(i){if(!(i instanceof SyntaxError))throw i;C(x(l.clientSupportedSDKVersion,E,D))}}l.initializeCompleted=!0}),b(),_(),z()),Array.isArray(e)&&f(e),void 0!==l.initializePromise?t(l.initializePromise):L("GlobalVars.initializePromise is unexpectedly undefined")})}(i,e),6e4,new Error("SDK initialization timed out."))}function F(i){t(i,w.AppLoaded,[V])}function N(i,e){t(i,w.ExpectedFailure,[e.reason,e.message])}function R(i,e){t(i,w.Failure,[e.reason,e.message])}function H(e){return i(this,void 0,void 0,function*(){if(l.initializeCompleted)return J(e);if(!l.initializePromise)throw new Error(r);return l.initializePromise.then(()=>J(e))})}function J(e){return i(this,void 0,void 0,function*(){return m(P)&&(null===(i=P.supports.app)||void 0===i?void 0:i.notifySuccessResponse)?n(w.Success,[V],new K,e).then(()=>({hasFinishedSuccessfully:!0})):(t(e,w.Success,[V]),{hasFinishedSuccessfully:"unknown"});var i})}const L=k.extend("initializeHelper");function O(i,e){!g(e)&&c(),a(i,e)}function T(i,e){!g(e)&&c(),p(i,e)}function G(i,t){return new Promise(n=>{m(P,y.content,y.sidePanel,y.settings,y.task,y.stage,y.meetingStage),n(e(i,"executeDeepLink",t))})}export{A as appInitializeHelper,J as callNotifySuccessInHost,F as notifyAppLoadedHelper,N as notifyExpectedFailureHelper,R as notifyFailureHelper,H as notifySuccessHelper,G as openLinkHelper,T as registerOnContextChangeHandlerHelper,O as registerOnThemeChangeHandlerHelper};
@@ -1 +1 @@
1
- import{__awaiter as n}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{isChildProxyingEnabled as i,getCurrentFeatureFlagsState as o}from"../public/featureFlags.js";import{flushMessageQueue as s,getMessageIdsAsLogString as e}from"./communicationUtils.js";import{callHandler as r}from"./handlers.js";import{deserializeMessageRequest as t,serializeMessageResponse as d}from"./messageObjects.js";import{getLogger as a,getApiVersionTag as u}from"./telemetry.js";const c=a("childProxyingCommunication");class l{}function g(){l.window=null,l.origin=null,l.messageQueue=[]}function m(){return!!i()&&!!l.window}function f(n,o){return!!i()&&(l.window&&!l.window.closed&&n!==l.window||(l.window=n,l.origin=o),l.window&&l.window.closed?(l.window=null,l.origin=null,!1):l.window===n)}function w(i,d,a,c){return n(this,void 0,void 0,(function*(){l.window===d&&(s(l.window,l.origin,l.messageQueue,"child"),function(n,i,s){if(void 0===n.data.id||void 0===n.data.func)return;const d=t(n.data),[a,c]=r(d.func,d.args);if(a&&void 0!==c)return p("Handler called in response to message %s from child. Returning response from handler to child, action: %s.",e(d),d.func),void h(d.id,d.uuid,Array.isArray(c)?c:[c]);p("No handler for message %s from child found; relaying message on to parent, action: %s. Relayed message will have a new id.",e(d),d.func),function(n,i,s){const r=i(u("v2","tasks.startTask"),n.func,n.args,!0,n.teamsJsInstanceId),t=l.origin;s(r.uuid,((...i)=>{if(!l.window)return;if(!o().disableEnforceOriginMatchForChildResponses&&t!==l.origin)return void p("Origin of child window has changed, not sending response back to child window");const s=i.pop();p("Message from parent being relayed to child, id: %s",e(n)),h(n.id,n.uuid,i,s)}))}(d,i,s)}(i,a,c))}))}l.messageQueue=[];const p=c.extend("handleIncomingMessageFromChild");function h(n,i,o,s){const r=l.window,t=function(n,i,o,s){return{id:n,uuid:i,args:o||[],isPartialResponse:s}}(n,i,o,s),a=d(t),u=l.origin;r&&u&&(p("Sending message %s to %s via postMessage, args = %o",e(a),"child",a.args),r.postMessage(a,u))}function v(n,i){const o=l.window,s=function(n,i){return{func:n,args:i||[]}}(n,i),e=l.origin;o&&e?o.postMessage(s,e):l.messageQueue.push(s)}export{w as handleIncomingMessageFromChild,v as sendMessageEventToChild,m as shouldEventBeRelayedToChild,f as shouldProcessChildMessage,g as uninitializeChildCommunication};
1
+ import{__awaiter as n}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{isChildProxyingEnabled as i,getCurrentFeatureFlagsState as o}from"../public/featureFlags.js";import{flushMessageQueue as s,getMessageIdsAsLogString as e}from"./communicationUtils.js";import{callHandler as r}from"./handlers.js";import{deserializeMessageRequest as t,serializeMessageResponse as d}from"./messageObjects.js";import{getLogger as a,getApiVersionTag as u}from"./telemetry.js";const c=a("childProxyingCommunication");class l{}function g(){l.window=null,l.origin=null,l.messageQueue=[]}function m(){return!!i()&&!!l.window}function f(n,o){return!!i()&&(l.window&&!l.window.closed&&n!==l.window||(l.window=n,l.origin=o),l.window&&l.window.closed?(l.window=null,l.origin=null,!1):l.window===n)}function w(i,d,a,c){return n(this,void 0,void 0,function*(){l.window===d&&(s(l.window,l.origin,l.messageQueue,"child"),function(n,i,s){if(void 0===n.data.id||void 0===n.data.func)return;const d=t(n.data),[a,c]=r(d.func,d.args);if(a&&void 0!==c)return p("Handler called in response to message %s from child. Returning response from handler to child, action: %s.",e(d),d.func),void h(d.id,d.uuid,Array.isArray(c)?c:[c]);p("No handler for message %s from child found; relaying message on to parent, action: %s. Relayed message will have a new id.",e(d),d.func),function(n,i,s){const r=i(u("v2","tasks.startTask"),n.func,n.args,!0,n.teamsJsInstanceId),t=l.origin;s(r.uuid,(...i)=>{if(!l.window)return;if(!o().disableEnforceOriginMatchForChildResponses&&t!==l.origin)return void p("Origin of child window has changed, not sending response back to child window");const s=i.pop();p("Message from parent being relayed to child, id: %s",e(n)),h(n.id,n.uuid,i,s)})}(d,i,s)}(i,a,c))})}l.messageQueue=[];const p=c.extend("handleIncomingMessageFromChild");function h(n,i,o,s){const r=l.window,t=function(n,i,o,s){return{id:n,uuid:i,args:o||[],isPartialResponse:s}}(n,i,o,s),a=d(t),u=l.origin;r&&u&&(p("Sending message %s to %s via postMessage, args = %o",e(a),"child",a.args),r.postMessage(a,u))}function v(n,i){const o=l.window,s=function(n,i){return{func:n,args:i||[]}}(n,i),e=l.origin;o&&e?o.postMessage(s,e):l.messageQueue.push(s)}export{w as handleIncomingMessageFromChild,v as sendMessageEventToChild,m as shouldEventBeRelayedToChild,f as shouldProcessChildMessage,g as uninitializeChildCommunication};
@@ -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{isSdkError as n,ErrorCode as t}from"../public/interfaces.js";import{latestRuntimeApiVersion as o}from"../public/runtime.js";import{isSerializable as r}from"../public/serializable.interface.js";import{UUID as i}from"../public/uuidObject.js";import{version as s}from"../public/version.js";import{uninitializeChildCommunication as a,shouldProcessChildMessage as c,handleIncomingMessageFromChild as d}from"./childCommunication.js";import{getMessageIdsAsLogString as u,flushMessageQueue as l}from"./communicationUtils.js";import{GlobalVars as g}from"./globalVars.js";import{callHandler as p}from"./handlers.js";import f from"./hostToAppTelemetry.js";import{serializeMessageRequest as m,deserializeMessageResponse as w}from"./messageObjects.js";import{tryPolyfillWithNestedAppAuthBridge as h}from"./nestedAppAuthUtils.js";import{getLogger as v,isFollowingApiVersionTagFormat as b}from"./telemetry.js";import{getCurrentTimestamp as W,ssrSafeWindow as M}from"./utils.js";import{validateOrigin as y}from"./validOrigins.js";const k=v("communication");class I{}class T{}function E(n,t){if(T.messageListener=n=>function(n){return e(this,void 0,void 0,(function*(){if(!n||!n.data||"object"!=typeof n.data)return void J("Unrecognized message format received by app, message being ignored. Message: %o",n);const e=n.source||n.originalEvent&&n.originalEvent.source,t=n.origin||n.originalEvent&&n.originalEvent.origin;return B(e,t).then((o=>{o?(!function(e,n){g.isFramelessWindow||I.parentWindow&&!I.parentWindow.closed&&e!==I.parentWindow||(I.parentWindow=e,I.parentOrigin=n);I.parentWindow&&I.parentWindow.closed&&(I.parentWindow=null,I.parentOrigin=null);l(I.parentWindow,I.parentOrigin,T.parentMessageQueue,"parent")}(e,t),e!==I.parentWindow?c(e,t)&&d(n,e,V,((e,n)=>T.callbacks.set(e,n))):Y(n)):J("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,t)}))}))}(n),I.currentWindow=I.currentWindow||M(),I.parentWindow=I.currentWindow.parent!==I.currentWindow.self?I.currentWindow.parent:I.currentWindow.opener,I.topWindow=I.currentWindow.top,(I.parentWindow||n)&&I.currentWindow.addEventListener("message",T.messageListener,!1),!I.parentWindow){const e=I.currentWindow;if(!e.nativeInterface)return Promise.reject(new Error("Initialization Failed. No Parent window found."));g.isFramelessWindow=!0,e.onNativeMessage=Y}try{return I.parentOrigin="*",S(t,"initialize",[s,o,n]).then((([e,n,t,o])=>(h(o,I.currentWindow,{onMessage:D,sendPostMessage:L}),{context:e,clientType:n,runtimeConfig:t,clientSupportedSDKVersion:o})))}finally{I.parentOrigin=null}}function j(){I.currentWindow&&I.currentWindow.removeEventListener("message",T.messageListener,!1),I.currentWindow=null,I.parentWindow=null,I.parentOrigin=null,T.parentMessageQueue=[],T.nextMessageId=0,T.callbacks.clear(),T.promiseCallbacks.clear(),T.portCallbacks.clear(),T.legacyMessageIdsToUuidMap={},f.clearMessages(),a()}function O(e,n,...t){return S(e,n,t).then((([e])=>e))}function R(e,n,...t){return S(e,n,t).then((([e,n])=>{if(!e)throw new Error(n)}))}function C(e,n,t,...o){return S(e,n,o).then((([e,n])=>{if(!e)throw new Error(n||t)}))}function P(e,n,...t){return S(e,n,t).then((([e,n])=>{if(e)throw e;return n}))}function S(e,n,t=void 0){if(!b(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((o=>{const r=V(e,n,t);var i;o((i=r.uuid,new Promise((e=>{T.promiseCallbacks.set(i,e)}))))}))}function x(e){return e.map((e=>r(e)?e.serialize():e))}function N(o,r,i,s,a){var c;return e(this,void 0,void 0,(function*(){const e=x(r),[d]=yield S(s,o,e);if(a&&a(d)||!a&&n(d))throw new Error(`${d.errorCode}, message: ${null!==(c=d.message)&&void 0!==c?c:"None"}`);if(i.validate(d))return i.deserialize(d);throw new Error(`${t.INTERNAL_ERROR}, message: Invalid response from host - ${JSON.stringify(d)}`)}))}function A(o,r,i,s){var a;return e(this,void 0,void 0,(function*(){const e=x(r),[c]=yield S(i,o,e);if(s&&s(c)||!s&&n(c))throw new Error(`${c.errorCode}, message: ${null!==(a=c.message)&&void 0!==a?a:"None"}`);if(void 0!==c)throw new Error(`${t.INTERNAL_ERROR}, message: Invalid response from host`)}))}function U(e,n,t=void 0){if(!b(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 o=V(e,n,t);return r=o.uuid,new Promise(((e,n)=>{T.portCallbacks.set(r,((t,o)=>{t instanceof MessagePort?e(t):n(o&&o.length>0?o[0]:new Error("Host responded without port or error details."))}))}));var r}function $(e,n,t,o){let r;if(t instanceof Function?o=t:t instanceof Array&&(r=t),!b(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 i=V(e,n,r);o&&T.callbacks.set(i.uuid,o)}T.parentMessageQueue=[],T.topMessageQueue=[],T.nextMessageId=0,T.callbacks=new Map,T.promiseCallbacks=new Map,T.portCallbacks=new Map,T.legacyMessageIdsToUuidMap={};const z=k.extend("sendNestedAuthRequestToTopWindow");function L(e,n){const t=z,o=I.topWindow,r=function(e,n){const t=T.nextMessageId++,o=new i;return T.legacyMessageIdsToUuidMap[t]=o,{id:t,uuid:o,func:"nestedAppAuth.execute",timestamp:Date.now(),monotonicTimestamp:W(),apiVersionTag:n,args:[],data:e}}(e,n);return t("Message %s information: %o",u(r),{actionName:r.func}),F(o,r)}const _=k.extend("sendRequestToTargetWindowHelper");function F(e,n){const t=_,o=function(e){return e===I.topWindow&&Z()?"top":e===I.parentWindow?"parent":null}(e),r=m(n);if(g.isFramelessWindow)I.currentWindow&&I.currentWindow.nativeInterface&&(t("Sending message %s to %s via framelessPostMessage interface",u(r),o),I.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(r)));else{const i=function(e){return e===I.topWindow&&Z()?I.topOrigin:e===I.parentWindow?I.parentOrigin:null}(e);e&&i?(t("Sending message %s to %s via postMessage",u(r),o),e.postMessage(r,i)):(t("Adding message %s to %s message queue",u(r),o),ee(e).push(n))}return n}const Q=k.extend("sendMessageToParentHelper");function V(e,n,t,o,r){const s=Q,a=I.parentWindow,c=function(e,n,t,o,r){const s=T.nextMessageId++,a=new i;T.legacyMessageIdsToUuidMap[s]=a;const c=!0===o?r:g.teamsJsInstanceId;return{id:s,uuid:a,func:n,timestamp:Date.now(),monotonicTimestamp:W(),args:t||[],apiVersionTag:e,isProxiedFromChild:null!=o&&o,teamsJsInstanceId:c}}(e,n,t,o,r);return f.storeCallbackInformation(c.uuid,{name:n,calledAt:c.timestamp}),s("Message %s information: %o",u(c),{actionName:n,args:t}),F(a,c)}const J=k.extend("processIncomingMessage");const q=k.extend("processAuthBridgeMessage");function D(e,n){var t,o;const r=q;if(!e||!e.data||"object"!=typeof e.data)return void r("Unrecognized message format received by app, message being ignored. Message: %o",e);const{args:i}=e.data,[,s]=null!=i?i:[],a=(()=>{try{return JSON.parse(s)}catch(e){return null}})();if(!a||"object"!=typeof a||"NestedAppAuthResponse"!==a.messageType)return void r("Unrecognized data format received by app, message being ignored. Message: %o",e);const c=e.source||(null===(t=null==e?void 0:e.originalEvent)||void 0===t?void 0:t.source),d=e.origin||(null===(o=null==e?void 0:e.originalEvent)||void 0===o?void 0:o.origin);c?B(c,d)?(I.topWindow&&!I.topWindow.closed&&c!==I.topWindow||(I.topWindow=c,I.topOrigin=d),I.topWindow&&I.topWindow.closed&&(I.topWindow=null,I.topOrigin=null),l(I.topWindow,I.topOrigin,T.topMessageQueue,"top"),n(s)):r("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):r("Message being ignored by app because it is coming for a target that is null")}const H=k.extend("shouldProcessIncomingMessage");function B(n,t){return e(this,void 0,void 0,(function*(){if(I.currentWindow&&n===I.currentWindow)return H("Should not process message because it is coming from the current window"),!1;if(I.currentWindow&&I.currentWindow.location&&t&&t===I.currentWindow.location.origin)return!0;{let e;try{e=new URL(t)}catch(e){return H("Message has an invalid origin of %s",t),!1}const n=yield y(e);return n||H("Message has an invalid origin of %s",t),n}}))}const K=k.extend("handleIncomingMessageFromParent");function G(e,n){if(n){const t=[...e].find((([e,t])=>e.toString()===n.toString()));if(t)return t[0]}}function X(e,n){const t=G(n,e.uuid);t&&n.delete(t),e.uuid?T.legacyMessageIdsToUuidMap={}:delete T.legacyMessageIdsToUuidMap[e.id]}function Y(e){const n=K,t=W();if("id"in e.data&&"number"==typeof e.data.id){const o=e.data,r=w(o),i=function(e){const n=K;if(!e.uuid)return T.legacyMessageIdsToUuidMap[e.id];{const n=e.uuid,t=G(T.callbacks,n);if(t)return t;const o=G(T.promiseCallbacks,n);if(o)return o;const r=G(T.portCallbacks,n);if(r)return r}n("Received message %s that failed to produce a callbackId",u(e))}(r);if(i){const o=T.callbacks.get(i);n("Received a response from parent for message %s",i.toString()),f.handlePerformanceMetrics(i,r,n,t),o&&(n("Invoking the registered callback for message %s with arguments %o",i.toString(),r.args),o.apply(null,[...r.args,r.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(n("Removing registered callback for message %s",i.toString()),X(r,T.callbacks)));const s=T.promiseCallbacks.get(i);s&&(n("Invoking the registered promise callback for message %s with arguments %o",i.toString(),r.args),s(r.args),n("Removing registered promise callback for message %s",i.toString()),X(r,T.promiseCallbacks));const a=T.portCallbacks.get(i);if(a){let t;n("Invoking the registered port callback for message %s with arguments %o",i.toString(),r.args),e.ports&&e.ports[0]instanceof MessagePort&&(t=e.ports[0]),a(t,r.args),n("Removing registered port callback for message %s",i.toString()),X(r,T.portCallbacks)}r.uuid&&(T.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const o=e.data;f.handleOneWayPerformanceMetrics(o,n,t),n('Received a message from parent %s, action: "%s"',u(o),o.func),p(o.func,o.args)}else n("Received an unknown message: %O",e)}function Z(){return I.topWindow!==I.parentWindow}function ee(e){return e===I.topWindow&&Z()?T.topMessageQueue:e===I.parentWindow?T.parentMessageQueue:[]}function ne(e,n){let t;t=I.currentWindow.setInterval((()=>{0===ee(e).length&&(clearInterval(t),n())}),100)}export{I as Communication,A as callFunctionInHost,N as callFunctionInHostAndHandleResponse,E as initializeCommunication,U as requestPortFromParentWithVersion,P as sendAndHandleSdkError,R as sendAndHandleStatusAndReason,C as sendAndHandleStatusAndReasonWithDefaultError,O as sendAndUnwrap,$ as sendMessageToParent,S as sendMessageToParentAsync,L as sendNestedAuthRequestToTopWindow,j as uninitializeCommunication,ne as waitForMessageQueue};
1
+ import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{isSdkError as n,ErrorCode as t}from"../public/interfaces.js";import{latestRuntimeApiVersion as o}from"../public/runtime.js";import{isSerializable as r}from"../public/serializable.interface.js";import{UUID as i}from"../public/uuidObject.js";import{version as s}from"../public/version.js";import{uninitializeChildCommunication as a,shouldProcessChildMessage as c,handleIncomingMessageFromChild as d}from"./childCommunication.js";import{getMessageIdsAsLogString as u,flushMessageQueue as l}from"./communicationUtils.js";import{GlobalVars as g}from"./globalVars.js";import{callHandler as p}from"./handlers.js";import f from"./hostToAppTelemetry.js";import{serializeMessageRequest as m,deserializeMessageResponse as w}from"./messageObjects.js";import{tryPolyfillWithNestedAppAuthBridge as h}from"./nestedAppAuthUtils.js";import{isFollowingApiVersionTagFormat as v,getLogger as b}from"./telemetry.js";import{getCurrentTimestamp as W,ssrSafeWindow as M}from"./utils.js";import{validateOrigin as y}from"./validOrigins.js";const k=b("communication");class I{}class T{}function E(n,t){if(T.messageListener=n=>function(n){return e(this,void 0,void 0,function*(){if(!n||!n.data||"object"!=typeof n.data)return void J("Unrecognized message format received by app, message being ignored. Message: %o",n);const e=n.source||n.originalEvent&&n.originalEvent.source,t=n.origin||n.originalEvent&&n.originalEvent.origin;return B(e,t).then(o=>{o?(!function(e,n){g.isFramelessWindow||I.parentWindow&&!I.parentWindow.closed&&e!==I.parentWindow||(I.parentWindow=e,I.parentOrigin=n);I.parentWindow&&I.parentWindow.closed&&(I.parentWindow=null,I.parentOrigin=null);l(I.parentWindow,I.parentOrigin,T.parentMessageQueue,"parent")}(e,t),e!==I.parentWindow?c(e,t)&&d(n,e,V,(e,n)=>T.callbacks.set(e,n)):Y(n)):J("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,t)})})}(n),I.currentWindow=I.currentWindow||M(),I.parentWindow=I.currentWindow.parent!==I.currentWindow.self?I.currentWindow.parent:I.currentWindow.opener,I.topWindow=I.currentWindow.top,(I.parentWindow||n)&&I.currentWindow.addEventListener("message",T.messageListener,!1),!I.parentWindow){const e=I.currentWindow;if(!e.nativeInterface)return Promise.reject(new Error("Initialization Failed. No Parent window found."));g.isFramelessWindow=!0,e.onNativeMessage=Y}try{return I.parentOrigin="*",S(t,"initialize",[s,o,n]).then(([e,n,t,o])=>(h(o,I.currentWindow,{onMessage:D,sendPostMessage:L}),{context:e,clientType:n,runtimeConfig:t,clientSupportedSDKVersion:o}))}finally{I.parentOrigin=null}}function j(){I.currentWindow&&I.currentWindow.removeEventListener("message",T.messageListener,!1),I.currentWindow=null,I.parentWindow=null,I.parentOrigin=null,T.parentMessageQueue=[],T.nextMessageId=0,T.callbacks.clear(),T.promiseCallbacks.clear(),T.portCallbacks.clear(),T.legacyMessageIdsToUuidMap={},f.clearMessages(),a()}function O(e,n,...t){return S(e,n,t).then(([e])=>e)}function R(e,n,...t){return S(e,n,t).then(([e,n])=>{if(!e)throw new Error(n)})}function C(e,n,t,...o){return S(e,n,o).then(([e,n])=>{if(!e)throw new Error(n||t)})}function P(e,n,...t){return S(e,n,t).then(([e,n])=>{if(e)throw e;return n})}function S(e,n,t=void 0){if(!v(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(o=>{const r=V(e,n,t);var i;o((i=r.uuid,new Promise(e=>{T.promiseCallbacks.set(i,e)})))})}function x(e){return e.map(e=>r(e)?e.serialize():e)}function N(o,r,i,s,a){var c;return e(this,void 0,void 0,function*(){const e=x(r),[d]=yield S(s,o,e);if(a&&a(d)||!a&&n(d))throw new Error(`${d.errorCode}, message: ${null!==(c=d.message)&&void 0!==c?c:"None"}`);if(i.validate(d))return i.deserialize(d);throw new Error(`${t.INTERNAL_ERROR}, message: Invalid response from host - ${JSON.stringify(d)}`)})}function A(o,r,i,s){var a;return e(this,void 0,void 0,function*(){const e=x(r),[c]=yield S(i,o,e);if(s&&s(c)||!s&&n(c))throw new Error(`${c.errorCode}, message: ${null!==(a=c.message)&&void 0!==a?a:"None"}`);if(void 0!==c)throw new Error(`${t.INTERNAL_ERROR}, message: Invalid response from host`)})}function U(e,n,t=void 0){if(!v(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 o=V(e,n,t);return r=o.uuid,new Promise((e,n)=>{T.portCallbacks.set(r,(t,o)=>{t instanceof MessagePort?e(t):n(o&&o.length>0?o[0]:new Error("Host responded without port or error details."))})});var r}function $(e,n,t,o){let r;if(t instanceof Function?o=t:t instanceof Array&&(r=t),!v(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 i=V(e,n,r);o&&T.callbacks.set(i.uuid,o)}T.parentMessageQueue=[],T.topMessageQueue=[],T.nextMessageId=0,T.callbacks=new Map,T.promiseCallbacks=new Map,T.portCallbacks=new Map,T.legacyMessageIdsToUuidMap={};const z=k.extend("sendNestedAuthRequestToTopWindow");function L(e,n){const t=z,o=I.topWindow,r=function(e,n){const t=T.nextMessageId++,o=new i;return T.legacyMessageIdsToUuidMap[t]=o,{id:t,uuid:o,func:"nestedAppAuth.execute",timestamp:Date.now(),monotonicTimestamp:W(),apiVersionTag:n,args:[],data:e}}(e,n);return t("Message %s information: %o",u(r),{actionName:r.func}),F(o,r)}const _=k.extend("sendRequestToTargetWindowHelper");function F(e,n){const t=_,o=function(e){return e===I.topWindow&&Z()?"top":e===I.parentWindow?"parent":null}(e),r=m(n);if(g.isFramelessWindow)I.currentWindow&&I.currentWindow.nativeInterface&&(t("Sending message %s to %s via framelessPostMessage interface",u(r),o),I.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(r)));else{const i=function(e){return e===I.topWindow&&Z()?I.topOrigin:e===I.parentWindow?I.parentOrigin:null}(e);e&&i?(t("Sending message %s to %s via postMessage",u(r),o),e.postMessage(r,i)):(t("Adding message %s to %s message queue",u(r),o),ee(e).push(n))}return n}const Q=k.extend("sendMessageToParentHelper");function V(e,n,t,o,r){const s=Q,a=I.parentWindow,c=function(e,n,t,o,r){const s=T.nextMessageId++,a=new i;T.legacyMessageIdsToUuidMap[s]=a;const c=!0===o?r:g.teamsJsInstanceId;return{id:s,uuid:a,func:n,timestamp:Date.now(),monotonicTimestamp:W(),args:t||[],apiVersionTag:e,isProxiedFromChild:null!=o&&o,teamsJsInstanceId:c}}(e,n,t,o,r);return f.storeCallbackInformation(c.uuid,{name:n,calledAt:c.timestamp}),s("Message %s information: %o",u(c),{actionName:n,args:t}),F(a,c)}const J=k.extend("processIncomingMessage");const q=k.extend("processAuthBridgeMessage");function D(e,n){var t,o;const r=q;if(!e||!e.data||"object"!=typeof e.data)return void r("Unrecognized message format received by app, message being ignored. Message: %o",e);const{args:i}=e.data,[,s]=null!=i?i:[],a=(()=>{try{return JSON.parse(s)}catch(e){return null}})();if(!a||"object"!=typeof a||"NestedAppAuthResponse"!==a.messageType)return void r("Unrecognized data format received by app, message being ignored. Message: %o",e);const c=e.source||(null===(t=null==e?void 0:e.originalEvent)||void 0===t?void 0:t.source),d=e.origin||(null===(o=null==e?void 0:e.originalEvent)||void 0===o?void 0:o.origin);c?B(c,d)?(I.topWindow&&!I.topWindow.closed&&c!==I.topWindow||(I.topWindow=c,I.topOrigin=d),I.topWindow&&I.topWindow.closed&&(I.topWindow=null,I.topOrigin=null),l(I.topWindow,I.topOrigin,T.topMessageQueue,"top"),n(s)):r("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):r("Message being ignored by app because it is coming for a target that is null")}const H=k.extend("shouldProcessIncomingMessage");function B(n,t){return e(this,void 0,void 0,function*(){if(I.currentWindow&&n===I.currentWindow)return H("Should not process message because it is coming from the current window"),!1;if(I.currentWindow&&I.currentWindow.location&&t&&t===I.currentWindow.location.origin)return!0;{let e;try{e=new URL(t)}catch(e){return H("Message has an invalid origin of %s",t),!1}const n=yield y(e);return n||H("Message has an invalid origin of %s",t),n}})}const K=k.extend("handleIncomingMessageFromParent");function G(e,n){if(n){const t=[...e].find(([e,t])=>e.toString()===n.toString());if(t)return t[0]}}function X(e,n){const t=G(n,e.uuid);t&&n.delete(t),e.uuid?T.legacyMessageIdsToUuidMap={}:delete T.legacyMessageIdsToUuidMap[e.id]}function Y(e){const n=K,t=W();if("id"in e.data&&"number"==typeof e.data.id){const o=e.data,r=w(o),i=function(e){const n=K;if(!e.uuid)return T.legacyMessageIdsToUuidMap[e.id];{const n=e.uuid,t=G(T.callbacks,n);if(t)return t;const o=G(T.promiseCallbacks,n);if(o)return o;const r=G(T.portCallbacks,n);if(r)return r}n("Received message %s that failed to produce a callbackId",u(e))}(r);if(i){const o=T.callbacks.get(i);n("Received a response from parent for message %s",i.toString()),f.handlePerformanceMetrics(i,r,n,t),o&&(n("Invoking the registered callback for message %s with arguments %o",i.toString(),r.args),o.apply(null,[...r.args,r.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(n("Removing registered callback for message %s",i.toString()),X(r,T.callbacks)));const s=T.promiseCallbacks.get(i);s&&(n("Invoking the registered promise callback for message %s with arguments %o",i.toString(),r.args),s(r.args),n("Removing registered promise callback for message %s",i.toString()),X(r,T.promiseCallbacks));const a=T.portCallbacks.get(i);if(a){let t;n("Invoking the registered port callback for message %s with arguments %o",i.toString(),r.args),e.ports&&e.ports[0]instanceof MessagePort&&(t=e.ports[0]),a(t,r.args),n("Removing registered port callback for message %s",i.toString()),X(r,T.portCallbacks)}r.uuid&&(T.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const o=e.data;f.handleOneWayPerformanceMetrics(o,n,t),n('Received a message from parent %s, action: "%s"',u(o),o.func),p(o.func,o.args)}else n("Received an unknown message: %O",e)}function Z(){return I.topWindow!==I.parentWindow}function ee(e){return e===I.topWindow&&Z()?T.topMessageQueue:e===I.parentWindow?T.parentMessageQueue:[]}function ne(e,n){let t;t=I.currentWindow.setInterval(()=>{0===ee(e).length&&(clearInterval(t),n())},100)}export{I as Communication,A as callFunctionInHost,N as callFunctionInHostAndHandleResponse,E as initializeCommunication,U as requestPortFromParentWithVersion,P as sendAndHandleSdkError,R as sendAndHandleStatusAndReason,C as sendAndHandleStatusAndReasonWithDefaultError,O as sendAndUnwrap,$ as sendMessageToParent,S as sendMessageToParentAsync,L as sendNestedAuthRequestToTopWindow,j as uninitializeCommunication,ne as waitForMessageQueue};
@@ -1 +1 @@
1
- import{teamsDeepLinkProtocol as n,teamsDeepLinkHost as o}from"./constants.js";import{teamsDeepLinkUsersUrlParameterName as e,teamsDeepLinkUrlPathForChat as t,teamsDeepLinkUrlPathForCall as $,teamsDeepLinkAttendeesUrlParameterName as i,teamsDeepLinkUrlPathForCalendar as r,teamsDeepLinkUrlPathForAppInstall as d,teamsDeepLinkTopicUrlParameterName as p,teamsDeepLinkMessageUrlParameterName as c,teamsDeepLinkWithVideoUrlParameterName as a,teamsDeepLinkSourceUrlParameterName as m,teamsDeepLinkStartTimeUrlParameterName as s,teamsDeepLinkEndTimeUrlParameterName as C,teamsDeepLinkSubjectUrlParameterName as I,teamsDeepLinkContentUrlParameterName as l}from"./deepLinkConstants.js";function u($,i,r){if(0===$.length)throw new Error("Must have at least one user when creating a chat deep link");const d=`${e}=`+$.map((n=>encodeURIComponent(n))).join(","),a=void 0===i?"":`&${p}=${encodeURIComponent(i)}`,m=void 0===r?"":`&${c}=${encodeURIComponent(r)}`;return`${n}://${o}${t}?${d}${a}${m}`}function R(t,i,r){if(0===t.length)throw new Error("Must have at least one target when creating a call deep link");const d=`${e}=`+t.map((n=>encodeURIComponent(n))).join(","),p=void 0===i?"":`&${a}=${encodeURIComponent(i)}`,c=void 0===r?"":`&${m}=${encodeURIComponent(r)}`;return`${n}://${o}${$}?${d}${p}${c}`}function U(e,t,$,d,p){const c=void 0===e?"":`${i}=`+e.map((n=>encodeURIComponent(n))).join(","),a=void 0===t?"":`&${s}=${encodeURIComponent(t)}`,m=void 0===$?"":`&${C}=${encodeURIComponent($)}`,u=void 0===d?"":`&${I}=${encodeURIComponent(d)}`,R=void 0===p?"":`&${l}=${encodeURIComponent(p)}`;return`${n}://${o}${r}?${c}${a}${m}${u}${R}`}function h(e){if(!e)throw new Error("App ID must be set when creating an app install dialog deep link");return`${n}://${o}${d}${encodeURIComponent(e)}`}export{h as createTeamsDeepLinkForAppInstallDialog,U as createTeamsDeepLinkForCalendar,R as createTeamsDeepLinkForCall,u as createTeamsDeepLinkForChat};
1
+ import{teamsDeepLinkProtocol as n,teamsDeepLinkHost as o}from"./constants.js";import{teamsDeepLinkUrlPathForAppInstall as e,teamsDeepLinkUsersUrlParameterName as t,teamsDeepLinkUrlPathForChat as $,teamsDeepLinkTopicUrlParameterName as i,teamsDeepLinkMessageUrlParameterName as r,teamsDeepLinkAttendeesUrlParameterName as d,teamsDeepLinkUrlPathForCalendar as p,teamsDeepLinkStartTimeUrlParameterName as c,teamsDeepLinkEndTimeUrlParameterName as a,teamsDeepLinkSubjectUrlParameterName as m,teamsDeepLinkContentUrlParameterName as s,teamsDeepLinkUrlPathForCall as C,teamsDeepLinkWithVideoUrlParameterName as I,teamsDeepLinkSourceUrlParameterName as l}from"./deepLinkConstants.js";function u(e,d,p){if(0===e.length)throw new Error("Must have at least one user when creating a chat deep link");const c=`${t}=`+e.map(n=>encodeURIComponent(n)).join(","),a=void 0===d?"":`&${i}=${encodeURIComponent(d)}`,m=void 0===p?"":`&${r}=${encodeURIComponent(p)}`;return`${n}://${o}${$}?${c}${a}${m}`}function R(e,$,i){if(0===e.length)throw new Error("Must have at least one target when creating a call deep link");const r=`${t}=`+e.map(n=>encodeURIComponent(n)).join(","),d=void 0===$?"":`&${I}=${encodeURIComponent($)}`,p=void 0===i?"":`&${l}=${encodeURIComponent(i)}`;return`${n}://${o}${C}?${r}${d}${p}`}function U(e,t,$,i,r){const C=void 0===e?"":`${d}=`+e.map(n=>encodeURIComponent(n)).join(","),I=void 0===t?"":`&${c}=${encodeURIComponent(t)}`,l=void 0===$?"":`&${a}=${encodeURIComponent($)}`,u=void 0===i?"":`&${m}=${encodeURIComponent(i)}`,R=void 0===r?"":`&${s}=${encodeURIComponent(r)}`;return`${n}://${o}${p}?${C}${I}${l}${u}${R}`}function h(t){if(!t)throw new Error("App ID must be set when creating an app install dialog deep link");return`${n}://${o}${e}${encodeURIComponent(t)}`}export{h as createTeamsDeepLinkForAppInstallDialog,U as createTeamsDeepLinkForCalendar,R as createTeamsDeepLinkForCall,u as createTeamsDeepLinkForChat};
@@ -1 +1 @@
1
- import{ensureInitialized as t}from"./internalAPIs.js";import{FrameContexts as e,errorNotSupportedOnPlatform as o,DialogDimension as r}from"../public/constants.js";import{runtime as s}from"../public/runtime.js";import{sendMessageToParent as i}from"./communication.js";import{GlobalVars as n}from"./globalVars.js";import{registerHandler as a,removeHandler as l}from"./handlers.js";import{getApiVersionTag as m}from"./telemetry.js";import{isSupported as c}from"../public/dialog/update.js";import{isSupported as u,getDialogInfoFromUrlDialogInfo as d,getDialogInfoFromBotUrlDialogInfo as g}from"../public/dialog/url/url.js";import{isSupported as f}from"../public/dialog/url/bot.js";const p="v2";function h(r,n){if(t(s,e.content,e.sidePanel,e.task,e.meetingStage),!c())throw o;i(r,"tasks.updateTask",[n])}function b(r,n,c,g){if(t(s,e.content,e.sidePanel,e.meetingStage),!u())throw o;g&&a(m(p,"dialog.url.registerMessageForParentHandler"),"messageForParent",g);const f=d(n);i(r,"tasks.startTask",[f],((t,e)=>{null==c||c({err:t,result:e}),l("messageForParent")}))}function k(r,n,c,u){if(t(s,e.content,e.sidePanel,e.meetingStage),!f())throw o;u&&a(m(p,"dialog.url.bot.registerMessageForParentHandler"),"messageForParent",u);const d=g(n);i(r,"tasks.startTask",[d],((t,e)=>{null==c||c({err:t,result:e}),l("messageForParent")}))}function j(r,a,l){if(t(s,e.content,e.task),!u())throw o;n.frameContext===e.content&&console.warn("dialog.submit should not be called from FrameContext.content.\nIf dialog.submit was called from inside the dialog, please disregard this message.\nThis issue occurs due to a bug in Teams mobile where the dialog is incorrectly identified as being in the content FrameContext.\nWe are working to resolve this."),i(r,"tasks.completeTask",[a,l?Array.isArray(l)?l:[l]:[]])}function w(t){return{card:t.card,height:t.size?t.size.height:r.Small,width:t.size?t.size.width:r.Small,title:t.title}}function P(t){const e=w(t);return e.completionBotId=t.completionBotId,e}const F=[];function S(t){n.frameContext&&(n.frameContext===e.task?F.push(t):l("messageForChild"))}export{k as botUrlOpenHelper,p as dialogTelemetryVersionNumber,w as getDialogInfoFromAdaptiveCardDialogInfo,P as getDialogInfoFromBotAdaptiveCardDialogInfo,S as handleDialogMessage,F as storedMessages,h as updateResizeHelper,b as urlOpenHelper,j as urlSubmitHelper};
1
+ import{ensureInitialized as t}from"./internalAPIs.js";import{DialogDimension as e,FrameContexts as o,errorNotSupportedOnPlatform as r}from"../public/constants.js";import{runtime as s}from"../public/runtime.js";import{sendMessageToParent as i}from"./communication.js";import{GlobalVars as n}from"./globalVars.js";import{registerHandler as a,removeHandler as l}from"./handlers.js";import{getApiVersionTag as m}from"./telemetry.js";import{isSupported as c,getDialogInfoFromUrlDialogInfo as u,getDialogInfoFromBotUrlDialogInfo as d}from"../public/dialog/url/url.js";import{isSupported as g}from"../public/dialog/url/bot.js";import{isSupported as f}from"../public/dialog/update.js";const p="v2";function h(e,n){if(t(s,o.content,o.sidePanel,o.task,o.meetingStage),!f())throw r;i(e,"tasks.updateTask",[n])}function b(e,n,d,g){if(t(s,o.content,o.sidePanel,o.meetingStage),!c())throw r;g&&a(m(p,"dialog.url.registerMessageForParentHandler"),"messageForParent",g);const f=u(n);i(e,"tasks.startTask",[f],(t,e)=>{null==d||d({err:t,result:e}),l("messageForParent")})}function k(e,n,c,u){if(t(s,o.content,o.sidePanel,o.meetingStage),!g())throw r;u&&a(m(p,"dialog.url.bot.registerMessageForParentHandler"),"messageForParent",u);const f=d(n);i(e,"tasks.startTask",[f],(t,e)=>{null==c||c({err:t,result:e}),l("messageForParent")})}function j(e,a,l){if(t(s,o.content,o.task),!c())throw r;n.frameContext===o.content&&console.warn("dialog.submit should not be called from FrameContext.content.\nIf dialog.submit was called from inside the dialog, please disregard this message.\nThis issue occurs due to a bug in Teams mobile where the dialog is incorrectly identified as being in the content FrameContext.\nWe are working to resolve this."),i(e,"tasks.completeTask",[a,l?Array.isArray(l)?l:[l]:[]])}function w(t){return{card:t.card,height:t.size?t.size.height:e.Small,width:t.size?t.size.width:e.Small,title:t.title}}function P(t){const e=w(t);return e.completionBotId=t.completionBotId,e}const F=[];function S(t){n.frameContext&&(n.frameContext===o.task?F.push(t):l("messageForChild"))}export{k as botUrlOpenHelper,p as dialogTelemetryVersionNumber,w as getDialogInfoFromAdaptiveCardDialogInfo,P as getDialogInfoFromBotAdaptiveCardDialogInfo,S as handleDialogMessage,F as storedMessages,h as updateResizeHelper,b as urlOpenHelper,j as urlSubmitHelper};
@@ -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,getApiVersionTag as r}from"./telemetry.js";import{runtime as l}from"../public/runtime.js";import{shouldEventBeRelayedToChild as a,sendMessageEventToChild as o}from"./childCommunication.js";import{sendMessageToParent as t}from"./communication.js";import{ensureInitialized as d}from"./internalAPIs.js";import{initializeBackStackHelper as i}from"./pagesHelpers.js";import{isNullOrUndefined as s}from"./typeCheckUtilities.js";const u=n("handlers");class f{static initializeHandlers(){f.handlers.themeChange=v,f.handlers.load=x,f.handlers.beforeUnload=_,i()}static uninitializeHandlers(){f.handlers={},f.themeChangeHandler=null,f.beforeUnloadHandler=null,f.beforeSuspendOrTerminateHandler=null,f.resumeHandler=null,f.contextChangeHandler=null}}function m(){f.initializeHandlers()}function c(){f.uninitializeHandlers()}f.handlers={},f.themeChangeHandler=null,f.loadHandler=null,f.beforeUnloadHandler=null,f.beforeSuspendOrTerminateHandler=null,f.resumeHandler=null,f.hostToAppPerformanceMetricsHandler=null,f.contextChangeHandler=null;const H=u.extend("callHandler");function h(e,n){const r=f.handlers[e];if(r){H("Invoking the registered handler for message %s with arguments %o",e,n);return[!0,r.apply(this,n)]}return a()?(o(e,n),[!1,void 0]):(H("Handler for action message %s not found.",e),[!1,void 0])}function p(e,n,r,l=!0,a=[]){r?(f.handlers[n]=r,l&&t(e,"registerHandler",[n,...a])):delete f.handlers[n]}function g(e){delete f.handlers[e]}function b(e){return null!=f.handlers[e]}function U(e,n,r,a,o){r&&d(l,...a),o&&o(),p(e,n,r)}function C(e,n){f.themeChangeHandler=n,!s(n)&&t(e,"registerHandler",["themeChange"])}function T(e,n){f.contextChangeHandler=n,!s(n)&&t(e,"registerHandler",["contextChange"])}function v(e){f.themeChangeHandler&&f.themeChangeHandler(e),a()&&o("themeChange",[e])}function y(e){f.hostToAppPerformanceMetricsHandler=e}function j(e){f.hostToAppPerformanceMetricsHandler&&f.hostToAppPerformanceMetricsHandler(e)}function O(e,n){f.loadHandler=n,!s(n)&&t(e,"registerHandler",["load"])}function x(e){const n={entityId:(r=e).entityId,contentUrl:new URL(r.contentUrl)};var r;f.resumeHandler?(f.resumeHandler(n),a()&&o("load",[n])):f.loadHandler&&(f.loadHandler(e),a()&&o("load",[e]))}function S(e,n){f.beforeUnloadHandler=n,!s(n)&&t(e,"registerHandler",["beforeUnload"])}function _(){return e(this,void 0,void 0,(function*(){const e=()=>{t(r("v2","handleBeforeUnload"),"readyToUnload",[])};f.beforeSuspendOrTerminateHandler?(yield f.beforeSuspendOrTerminateHandler(),a()?o("beforeUnload"):e()):f.beforeUnloadHandler&&f.beforeUnloadHandler(e)||(a()?o("beforeUnload"):e())}))}function A(e){f.beforeSuspendOrTerminateHandler=e,!s(e)&&t(r("v2","registerBeforeSuspendOrTerminateHandler"),"registerHandler",["beforeUnload"])}function P(e){f.resumeHandler=e,!s(e)&&t(r("v2","registerOnResumeHandler"),"registerHandler",["load"])}export{h as callHandler,b as doesHandlerExist,j as handleHostToAppPerformanceMetrics,v as handleThemeChange,m as initializeHandlers,A as registerBeforeSuspendOrTerminateHandler,S as registerBeforeUnloadHandler,p as registerHandler,U as registerHandlerHelper,y as registerHostToAppPerformanceMetricsHandler,T as registerOnContextChangeHandler,O as registerOnLoadHandler,P as registerOnResumeHandler,C as registerOnThemeChangeHandler,g as removeHandler,c as uninitializeHandlers};
1
+ import{__awaiter as e}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{getApiVersionTag as n,getLogger as r}from"./telemetry.js";import{runtime as l}from"../public/runtime.js";import{shouldEventBeRelayedToChild as a,sendMessageEventToChild as t}from"./childCommunication.js";import{sendMessageToParent as o}from"./communication.js";import{ensureInitialized as d}from"./internalAPIs.js";import{initializeBackStackHelper as i}from"./pagesHelpers.js";import{isNullOrUndefined as s}from"./typeCheckUtilities.js";const u=r("handlers");class c{static initializeHandlers(){c.handlers.themeChange=x,c.handlers.contextChange=v,c.handlers.load=S,c.handlers.beforeUnload=A,i()}static uninitializeHandlers(){c.handlers={},c.themeChangeHandler=null,c.beforeUnloadHandler=null,c.beforeSuspendOrTerminateHandler=null,c.resumeHandler=null,c.contextChangeHandler=null}}function f(){c.initializeHandlers()}function m(){c.uninitializeHandlers()}c.handlers={},c.themeChangeHandler=null,c.loadHandler=null,c.beforeUnloadHandler=null,c.beforeSuspendOrTerminateHandler=null,c.resumeHandler=null,c.hostToAppPerformanceMetricsHandler=null,c.contextChangeHandler=null;const H=u.extend("callHandler");function h(e,n){const r=c.handlers[e];if(r){H("Invoking the registered handler for message %s with arguments %o",e,n);return[!0,r.apply(this,n)]}return a()?(t(e,n),[!1,void 0]):(H("Handler for action message %s not found.",e),[!1,void 0])}function p(e,n,r,l=!0,a=[]){r?(c.handlers[n]=r,l&&o(e,"registerHandler",[n,...a])):delete c.handlers[n]}function g(e){delete c.handlers[e]}function b(e){return null!=c.handlers[e]}function C(e,n,r,a,t){r&&d(l,...a),t&&t(),p(e,n,r)}function U(e,n){c.themeChangeHandler=n,!s(n)&&o(e,"registerHandler",["themeChange"])}function T(e,n){c.contextChangeHandler=n,!s(n)&&o(e,"registerHandler",["contextChange"])}function x(e){c.themeChangeHandler&&c.themeChangeHandler(e),a()&&t("themeChange",[e])}function v(e){c.contextChangeHandler&&c.contextChangeHandler(e),a()&&t("contextChange",[e])}function y(e){c.hostToAppPerformanceMetricsHandler=e}function j(e){c.hostToAppPerformanceMetricsHandler&&c.hostToAppPerformanceMetricsHandler(e)}function O(e,n){c.loadHandler=n,!s(n)&&o(e,"registerHandler",["load"])}function S(e){const n={entityId:(r=e).entityId,contentUrl:new URL(r.contentUrl)};var r;c.resumeHandler?(c.resumeHandler(n),a()&&t("load",[n])):c.loadHandler&&(c.loadHandler(e),a()&&t("load",[e]))}function _(e,n){c.beforeUnloadHandler=n,!s(n)&&o(e,"registerHandler",["beforeUnload"])}function A(){return e(this,void 0,void 0,function*(){const e=()=>{o(n("v2","handleBeforeUnload"),"readyToUnload",[])};c.beforeSuspendOrTerminateHandler?(yield c.beforeSuspendOrTerminateHandler(),a()?t("beforeUnload"):e()):c.beforeUnloadHandler&&c.beforeUnloadHandler(e)||(a()?t("beforeUnload"):e())})}function P(e){c.beforeSuspendOrTerminateHandler=e,!s(e)&&o(n("v2","registerBeforeSuspendOrTerminateHandler"),"registerHandler",["beforeUnload"])}function z(e){c.resumeHandler=e,!s(e)&&o(n("v2","registerOnResumeHandler"),"registerHandler",["load"])}export{h as callHandler,b as doesHandlerExist,v as handleContextChange,j as handleHostToAppPerformanceMetrics,x as handleThemeChange,f as initializeHandlers,P as registerBeforeSuspendOrTerminateHandler,_ as registerBeforeUnloadHandler,p as registerHandler,C as registerHandlerHelper,y as registerHostToAppPerformanceMetricsHandler,T as registerOnContextChangeHandler,O as registerOnLoadHandler,z as registerOnResumeHandler,U as registerOnThemeChangeHandler,g as removeHandler,m as uninitializeHandlers};
@@ -1 +1 @@
1
- import{AppId as i}from"../public/appId.js";import{hasScriptTags as t}from"./utils.js";function n(i){if(!e(i))throw new Error(`Potential app id (${i}) is invalid; its length ${i.length} is not within the length limits (${r}-${a}).`)}function o(i){if(t(i))throw new Error(`Potential app id (${i}) is invalid; it contains script tags.`);if(s(i))throw new Error(`Potential app id (${i}) is invalid; it contains non-printable characters.`)}const r=4,a=256;function e(i){return i.length<a&&i.length>r}function s(i){return[...i].some((i=>{const t=i.charCodeAt(0);return t<32||t>126}))}function l(t){if(!(t instanceof i))throw new Error(`Potential app id (${t}) is invalid; it is not an instance of AppId class.`)}export{s as doesStringContainNonPrintableCharacters,e as isStringWithinAppIdLengthLimits,a as maximumValidAppIdLength,r as minimumValidAppIdLength,l as validateAppIdInstance,o as validateSafeContent,n as validateStringLength};
1
+ import{AppId as i}from"../public/appId.js";import{hasScriptTags as t}from"./utils.js";function n(i){if(!e(i))throw new Error(`Potential app id (${i}) is invalid; its length ${i.length} is not within the length limits (${r}-${a}).`)}function o(i){if(t(i))throw new Error(`Potential app id (${i}) is invalid; it contains script tags.`);if(s(i))throw new Error(`Potential app id (${i}) is invalid; it contains non-printable characters.`)}const r=4,a=256;function e(i){return i.length<a&&i.length>r}function s(i){return[...i].some(i=>{const t=i.charCodeAt(0);return t<32||t>126})}function l(t){if(!(t instanceof i))throw new Error(`Potential app id (${t}) is invalid; it is not an instance of AppId class.`)}export{s as doesStringContainNonPrintableCharacters,e as isStringWithinAppIdLengthLimits,a as maximumValidAppIdLength,r as minimumValidAppIdLength,l as validateAppIdInstance,o as validateSafeContent,n as validateStringLength};
@@ -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 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
+ 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{defaultSDKVersionForCompatCheck as n,errorLibraryNotInitialized 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(o),new Error(o)}function m(i,...t){if(!l.initializeCompleted)throw d("%s. initializeCalled: %s",o,l.initializeCalled.toString()),new Error(o);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||l.hostClientType==i.visionOS}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&&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{__rest as r}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{CartStatus as e}from"../public/marketplace.js";import t from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js";function o(r){try{return r.cartItems=s(r.cartItems),r}catch(r){throw new Error("Error deserializing cart")}}function s(r){return r.map((r=>{if(r.imageURL){const e=new URL(r.imageURL);r.imageURL=e}return r.accessories&&(r.accessories=s(r.accessories)),r}))}const i=e=>{try{return e.map((e=>{const{imageURL:t,accessories:o}=e,s=r(e,["imageURL","accessories"]),n=Object.assign({},s);return t&&(n.imageURL=t.href),o&&(n.accessories=i(o)),n}))}catch(r){throw new Error("Error serializing cart items")}};function n(r){if(!Array.isArray(r)||0===r.length)throw new Error("cartItems must be a non-empty array");for(const e of r)c(e),a(e.accessories)}function a(r){if(null!=r){if(!Array.isArray(r)||0===r.length)throw new Error("CartItem.accessories must be a non-empty array");for(const e of r){if(e.accessories)throw new Error("Item in CartItem.accessories cannot have accessories");c(e)}}}function c(r){if(!r.id)throw new Error("cartItem.id must not be empty");if(!r.name)throw new Error("cartItem.name must not be empty");u(r.price),f(r.quantity)}function m(r){if(null!=r){if(!r)throw new Error("id must not be empty");if(!1===t(r))throw new Error("id must be a valid UUID")}}function u(r){if("number"!=typeof r||r<0)throw new Error(`price ${r} must be a number not less than 0`);if(parseFloat(r.toFixed(3))!==r)throw new Error(`price ${r} must have at most 3 decimal places`)}function f(r){if("number"!=typeof r||r<=0||parseInt(r.toString())!==r)throw new Error(`quantity ${r} must be an integer greater than 0`)}function p(r){if(!Object.values(e).includes(r))throw new Error(`cartStatus ${r} is not valid`)}export{o as deserializeCart,s as deserializeCartItems,i as serializeCartItems,a as validateAccessoryItems,c as validateBasicCartItem,n as validateCartItems,p as validateCartStatus,u as validatePrice,f as validateQuantity,m as validateUuid};
1
+ import{__rest as r}from"../../../../node_modules/.pnpm/@rollup_plugin-typescript@11.1.6_rollup@4.55.1_tslib@2.8.1_typescript@4.9.5/node_modules/tslib/tslib.es6.js";import{CartStatus as e}from"../public/marketplace.js";import t from"../../../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-browser/validate.js";function o(r){try{return r.cartItems=s(r.cartItems),r}catch(r){throw new Error("Error deserializing cart")}}function s(r){return r.map(r=>{if(r.imageURL){const e=new URL(r.imageURL);r.imageURL=e}return r.accessories&&(r.accessories=s(r.accessories)),r})}const i=e=>{try{return e.map(e=>{const{imageURL:t,accessories:o}=e,s=r(e,["imageURL","accessories"]),n=Object.assign({},s);return t&&(n.imageURL=t.href),o&&(n.accessories=i(o)),n})}catch(r){throw new Error("Error serializing cart items")}};function n(r){if(!Array.isArray(r)||0===r.length)throw new Error("cartItems must be a non-empty array");for(const e of r)c(e),a(e.accessories)}function a(r){if(null!=r){if(!Array.isArray(r)||0===r.length)throw new Error("CartItem.accessories must be a non-empty array");for(const e of r){if(e.accessories)throw new Error("Item in CartItem.accessories cannot have accessories");c(e)}}}function c(r){if(!r.id)throw new Error("cartItem.id must not be empty");if(!r.name)throw new Error("cartItem.name must not be empty");u(r.price),f(r.quantity)}function m(r){if(null!=r){if(!r)throw new Error("id must not be empty");if(!1===t(r))throw new Error("id must be a valid UUID")}}function u(r){if("number"!=typeof r||r<0)throw new Error(`price ${r} must be a number not less than 0`);if(parseFloat(r.toFixed(3))!==r)throw new Error(`price ${r} must have at most 3 decimal places`)}function f(r){if("number"!=typeof r||r<=0||parseInt(r.toString())!==r)throw new Error(`quantity ${r} must be an integer greater than 0`)}function p(r){if(!Object.values(e).includes(r))throw new Error(`cartStatus ${r} is not valid`)}export{o as deserializeCart,s as deserializeCartItems,i as serializeCartItems,a as validateAccessoryItems,c as validateBasicCartItem,n as validateCartItems,p as validateCartStatus,u as validatePrice,f as validateQuantity,m as validateUuid};