@blackbaud/sky-addin-client 1.7.4 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.8.0 (2026-09-29)
2
+ - Added canonical add-in type context to initialization arguments.
3
+ - Added independent modal document-transparency and host-overlay style options.
4
+
1
5
  # 1.7.4 (2026-08-21)
2
6
  - Updated `allowedOrigins` to support MCP Apps widgets hosted on the SKY CDN (`sky.blackbaudcdn.net`).
3
7
 
package/README.md CHANGED
@@ -50,6 +50,7 @@ All add-ins must use this library in order to show in the host application. You
50
50
  Your `init` function will be called with an arguments object that contains:
51
51
  - `envId` - The environment ID for the host page
52
52
  - `context` - Additional context of the host page, which will vary for different extension points.
53
+ - `addinType` (Version 1.8+) - Identifies the host's display mode for the add-in (`'action-button'`, `'box'`, `'button'`, `'dataset'`, `'flyout'`, `'generic'`, `'modal'`, `'page'`, `'tab'`, `'tile'`, or `'vertical-tab-form'`). Useful when your add-in is used in multiple display modes. Only compatible hosts provide this value, so it is `undefined` when the host does not provide it or provides a type this version of the library does not recognize.
53
54
  - `supportedEventTypes` - The supported event types that are handled by the host page.
54
55
  - `themeSettings` - The UX theme of the host page.
55
56
  - `ready` - A callback to inform the add-in client that the add-in is initialized and ready to be shown.
@@ -272,7 +273,30 @@ client.showModal({
272
273
  ##### Modal add-in
273
274
  The host page will launch a full screen iframe for the URL provided, and load it as an add-in the same way it does for other types of add-ins. The modal page must also pull in the SKY Add-in Client Library and make use of the `AddinClient`.
274
275
 
275
- The modal add-in will be responsible for rendering the modal element itself (including any chrome around the modal content). To create a native modal experience, the add-in may set the body background to `transparent` and launch a SKY UX modal within its full screen iframe.
276
+ The modal add-in will be responsible for rendering the modal element itself (including any chrome around the modal content). To create a native modal experience, the add-in may make its document background transparent and launch a SKY UX modal within its full screen iframe.
277
+
278
+ Starting in version 1.8, the modal add-in can independently configure its document background and the host's overlay through `modalConfig.style`:
279
+
280
+ | Option | Behavior |
281
+ |---|---|
282
+ | `transparentBackground: true` | Makes the add-in document's `html` and `body` backgrounds transparent. |
283
+ | `transparentBackground: false` or omitted | Preserves the add-in's document background. |
284
+ | `hostOverlay: false` | Asks the host to make its overlay transparent. Hosts that do not support this option ignore it. |
285
+ | `hostOverlay: true` or omitted | Preserves the host's visible overlay. |
286
+
287
+ These options are independent and this library does not default them. The library applies `transparentBackground` as inline `!important` styles, and restores the previous inline styles when a later `ready` call omits it or the client is destroyed.
288
+
289
+ ```js
290
+ args.ready({
291
+ showUI: true,
292
+ modalConfig: {
293
+ style: {
294
+ transparentBackground: true,
295
+ hostOverlay: false
296
+ }
297
+ }
298
+ });
299
+ ```
276
300
 
277
301
  As with a typical add-in, the modal add-in should register for the `init` callback and will receive `envId` in the arguments. The `context` field for arguments will match the context object passed into the `showModal` call from the parent add-in. Note that this is crossing iframes so the object has been serialized and deserialized. It can be used for passing data but not functions.
278
302
 
@@ -45,7 +45,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
45
45
  Object.defineProperty(exports, "__esModule", ({ value: true }));
46
46
  __exportStar(__webpack_require__(2), exports);
47
47
  __exportStar(__webpack_require__(3), exports);
48
- __exportStar(__webpack_require__(34), exports);
48
+ __exportStar(__webpack_require__(35), exports);
49
49
 
50
50
 
51
51
  /***/ }),
@@ -81,6 +81,31 @@ const allowedOrigins = [
81
81
  /^https\:\/\/[\w\-\.]+\.justgiving\.com$/,
82
82
  /^https\:\/\/sky\.blackbaudcdn\.net$/
83
83
  ];
84
+ /**
85
+ * Add-in types recognized by this client. Typed as a record so that every
86
+ * AddinType must be listed here.
87
+ */
88
+ const knownAddinTypes = {
89
+ 'action-button': true,
90
+ 'box': true,
91
+ 'button': true,
92
+ 'dataset': true,
93
+ 'flyout': true,
94
+ 'generic': true,
95
+ 'modal': true,
96
+ 'page': true,
97
+ 'tab': true,
98
+ 'tile': true,
99
+ 'vertical-tab-form': true
100
+ };
101
+ /**
102
+ * Inline declarations that make an element's background transparent. Inline styles
103
+ * are used rather than a style element so they are not blocked by a Content Security Policy.
104
+ */
105
+ const transparentBackgroundDeclarations = [
106
+ { property: 'background-color', value: 'transparent' },
107
+ { property: 'background-image', value: 'none' }
108
+ ];
84
109
  /**
85
110
  * Client for interacting with the parent page hosting the add-in.
86
111
  */
@@ -139,6 +164,14 @@ class AddinClient {
139
164
  * The add-in client will throw an error if an event is attempted but not one the supported types.
140
165
  */
141
166
  this.supportedEventTypes = [];
167
+ /**
168
+ * Indicates whether the client has been destroyed.
169
+ */
170
+ this.destroyed = false;
171
+ /**
172
+ * Inline background declarations replaced by this client to make the document transparent.
173
+ */
174
+ this.replacedBackgroundDeclarations = [];
142
175
  /**
143
176
  * Collection of regexs for our whitelist of host origins.
144
177
  */
@@ -160,6 +193,8 @@ class AddinClient {
160
193
  if (this.heightChangeIntervalId) {
161
194
  clearInterval(this.heightChangeIntervalId);
162
195
  }
196
+ this.cleanupTransparentBackground();
197
+ this.destroyed = true;
163
198
  }
164
199
  /**
165
200
  * Requests the host page to navigate.
@@ -391,6 +426,87 @@ class AddinClient {
391
426
  }, []);
392
427
  }
393
428
  }
429
+ /**
430
+ * Applies the client-owned document transparency for a modal add-in.
431
+ * @param style The modal style from the ready args.
432
+ */
433
+ applyModalStyle(style) {
434
+ if ((style === null || style === void 0 ? void 0 : style.transparentBackground) !== true) {
435
+ this.cleanupTransparentBackground();
436
+ return;
437
+ }
438
+ this.makeBackgroundTransparent(document.documentElement);
439
+ if (document.body) {
440
+ this.makeBackgroundTransparent(document.body);
441
+ }
442
+ else if (!this.bodyReadyHandler) {
443
+ // The body does not exist yet if ready is called while the document is still parsing.
444
+ this.bodyReadyHandler = () => {
445
+ this.bodyReadyHandler = undefined;
446
+ if (document.body) {
447
+ this.makeBackgroundTransparent(document.body);
448
+ }
449
+ };
450
+ document.addEventListener('DOMContentLoaded', this.bodyReadyHandler, { once: true });
451
+ }
452
+ }
453
+ /**
454
+ * Makes an element's background transparent with inline declarations, recording
455
+ * the declarations it replaces so they can be restored.
456
+ * @param element The element to make transparent.
457
+ */
458
+ makeBackgroundTransparent(element) {
459
+ for (const declaration of transparentBackgroundDeclarations) {
460
+ const property = declaration.property;
461
+ const value = element.style.getPropertyValue(property);
462
+ const priority = element.style.getPropertyPriority(property);
463
+ // Leave an existing transparent declaration alone, whether it was set by this client
464
+ // on an earlier ready call or by the add-in itself.
465
+ if (value !== declaration.value || priority !== 'important') {
466
+ this.replacedBackgroundDeclarations.push({
467
+ element,
468
+ priority,
469
+ property,
470
+ transparentValue: declaration.value,
471
+ value
472
+ });
473
+ element.style.setProperty(property, declaration.value, 'important');
474
+ }
475
+ }
476
+ }
477
+ /**
478
+ * Restores document background declarations replaced by this client.
479
+ */
480
+ cleanupTransparentBackground() {
481
+ if (this.bodyReadyHandler) {
482
+ document.removeEventListener('DOMContentLoaded', this.bodyReadyHandler);
483
+ this.bodyReadyHandler = undefined;
484
+ }
485
+ for (const replaced of this.replacedBackgroundDeclarations) {
486
+ const style = replaced.element.style;
487
+ // Don't restore over a declaration the add-in has changed since this client set it.
488
+ if (style.getPropertyValue(replaced.property) === replaced.transparentValue &&
489
+ style.getPropertyPriority(replaced.property) === 'important') {
490
+ if (replaced.value) {
491
+ style.setProperty(replaced.property, replaced.value, replaced.priority);
492
+ }
493
+ else {
494
+ style.removeProperty(replaced.property);
495
+ }
496
+ }
497
+ }
498
+ this.replacedBackgroundDeclarations = [];
499
+ }
500
+ /**
501
+ * Returns the add-in type provided by the host if this client recognizes it.
502
+ * @param addinType The add-in type provided by the host.
503
+ * @returns The add-in type, or undefined if it is missing or unrecognized.
504
+ */
505
+ getKnownAddinType(addinType) {
506
+ if (typeof addinType === 'string' && knownAddinTypes.hasOwnProperty(addinType)) {
507
+ return addinType;
508
+ }
509
+ }
394
510
  /**
395
511
  * Post a message to the host page informing it that the add-in is
396
512
  * now started and listening for messages from the host.
@@ -458,9 +574,14 @@ class AddinClient {
458
574
  this.supportedEventTypes = data.message.supportedEventTypes || [];
459
575
  // Pass key data to the add-in for it to initiailze.
460
576
  this.args.callbacks.init({
577
+ addinType: this.getKnownAddinType(data.message.addinType),
461
578
  context: data.message.context,
462
579
  envId: data.message.envId,
463
580
  ready: (args) => {
581
+ var _a;
582
+ if (!this.destroyed) {
583
+ this.applyModalStyle((_a = args === null || args === void 0 ? void 0 : args.modalConfig) === null || _a === void 0 ? void 0 : _a.style);
584
+ }
464
585
  // Do an immediate height check since the add-in may render something
465
586
  // due to the context provided. No need to wait a full second to reflect.
466
587
  this.checkForHeightChangesOfAddinContent();
@@ -766,6 +887,7 @@ __exportStar(__webpack_require__(30), exports);
766
887
  __exportStar(__webpack_require__(31), exports);
767
888
  __exportStar(__webpack_require__(32), exports);
768
889
  __exportStar(__webpack_require__(33), exports);
890
+ __exportStar(__webpack_require__(34), exports);
769
891
 
770
892
 
771
893
  /***/ }),
@@ -1078,6 +1200,14 @@ var AddinToastStyle;
1078
1200
 
1079
1201
  /***/ }),
1080
1202
  /* 34 */
1203
+ /***/ ((__unused_webpack_module, exports) => {
1204
+
1205
+
1206
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1207
+
1208
+
1209
+ /***/ }),
1210
+ /* 35 */
1081
1211
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1082
1212
 
1083
1213
 
@@ -1096,12 +1226,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
1096
1226
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1097
1227
  };
1098
1228
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1099
- __exportStar(__webpack_require__(35), exports);
1100
1229
  __exportStar(__webpack_require__(36), exports);
1230
+ __exportStar(__webpack_require__(37), exports);
1101
1231
 
1102
1232
 
1103
1233
  /***/ }),
1104
- /* 35 */
1234
+ /* 36 */
1105
1235
  /***/ ((__unused_webpack_module, exports) => {
1106
1236
 
1107
1237
 
@@ -1109,7 +1239,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
1109
1239
 
1110
1240
 
1111
1241
  /***/ }),
1112
- /* 36 */
1242
+ /* 37 */
1113
1243
  /***/ ((__unused_webpack_module, exports) => {
1114
1244
 
1115
1245
 
@@ -1 +1 @@
1
- (()=>{"use strict";var e={789:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var i=Object.getOwnPropertyDescriptor(t,s);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,i)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),i=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),i(s(983),t)},903:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddinClient=void 0;const s=[/^https\:\/\/[\w\-\.]+\.blackbaud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaud\-dev\.com$/,/^http\:\/\/[\w\-\.]+\.blackbaud\-dev\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaud\-test\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudhosting\.com$/,/^https\:\/\/[\w\-\.]+\.bbcloudservices\.com$/,/^https\:\/\/localhost(\:[0-9]+)?$/,/^https\:\/\/secure[2|3|8]\.convio\.net$/,/^https\:\/\/testweb\.convio\.com$/,/^https\:\/\/[\w\-\.]+\.conviocloud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudcloud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudfaith\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudportal\.com$/,/^https\:\/\/[\w\-\.]+\.bbk12\.com$/,/^https\:\/\/[\w\-\.]+\.mycampus\-app\.com$/,/^https\:\/\/[\w\-\.]+\.myschoolapp\.com$/,/^https\:\/\/[\w\-\.]+\.myschoolautomation\.com$/,/^https\:\/\/[\w\-\.]+\.myschooldemo\.com$/,/^https\:\/\/[\w\-\.]+\.myschooltraining\.com$/,/^https\:\/\/[\w\-\.]+\.justgiving\.com$/,/^https\:\/\/sky\.blackbaudcdn\.net$/];class o{static getQueryString(){return window.location.search}constructor(e){this.args=e,this.authTokenRequests=[],this.lastAuthTokenRequestId=0,this.modalRequests=[],this.lastModalRequestId=0,this.registeredAddinEvents={},this.sentEvents={},this.pendingSentEvents={},this.eventRequestId=0,this.supportedEventTypes=[],this.allowedOrigins=s,this.initConfig(e.config),this.windowMessageHandler=e=>{this.handleMessage(e)},window.addEventListener("message",this.windowMessageHandler),this.raiseAddinReadyMessage()}destroy(){window.removeEventListener("message",this.windowMessageHandler),this.heightChangeIntervalId&&clearInterval(this.heightChangeIntervalId)}navigate(e){this.postMessageToHostPage({message:{url:e.url},messageType:"navigate"})}getAuthToken(){return this.getUserIdentityToken()}getUserIdentityToken(){return new Promise(((e,t)=>{const s=++this.lastAuthTokenRequestId;this.authTokenRequests[s]={reject:t,resolve:e},this.postMessageToHostPage({message:{authTokenRequestId:s},messageType:"get-auth-token"})}))}showModal(e){return{modalClosed:new Promise(((t,s)=>{const o=++this.lastModalRequestId;this.modalRequests[o]={reject:s,resolve:t},this.postMessageToHostPage({message:{args:e,modalRequestId:o},messageType:"show-modal"})}))}}closeModal(e){this.postMessageToHostPage({message:e,messageType:"close-modal"})}openHelp(e){this.postMessageToHostPage({message:{helpKey:e.helpKey},messageType:"open-help"})}showToast(e){this.postMessageToHostPage({message:e,messageType:"show-toast"})}showFlyout(e){return{flyoutClosed:new Promise(((t,s)=>{e.defaultWidth=e.defaultWidth,e.maxWidth=e.maxWidth,e.minWidth=e.minWidth,this.flyoutRequest={reject:s,resolve:t},this.postMessageToHostPage({message:e,messageType:"show-flyout"})}))}}closeFlyout(){this.postMessageToHostPage({messageType:"close-flyout"})}showConfirm(e){return new Promise(((t,s)=>{this.confirmRequest={reject:s,resolve:t},this.postMessageToHostPage({message:e,messageType:"show-confirm"})}))}showError(e){this.postMessageToHostPage({message:e,messageType:"show-error"})}showWait(){this.postMessageToHostPage({messageType:"show-wait"})}hideWait(){this.postMessageToHostPage({messageType:"hide-wait"})}addEventHandler(e,t){this.registeredAddinEvents[e]=t}sendEvent(e){return new Promise(((t,s)=>{const o=e.type;this.supportedEventTypes.includes(o)||s("Event type not supported");const i=this.pendingSentEvents[o];i&&(clearTimeout(i.timeoutId),i.reject("Event cancelled"));const a=setTimeout((()=>{delete this.pendingSentEvents[o],this.postMessageToHostPage({message:{event:e,eventRequestId:this.eventRequestId},messageType:"client-event"}),this.sentEvents[this.eventRequestId]=t,this.eventRequestId++}),200);this.pendingSentEvents[o]={reject:s,timeoutId:a}}))}initConfig(e){var t;(null===(t=null==e?void 0:e.allowedOrigins)||void 0===t?void 0:t.length)>0&&(this.allowedOrigins=this.allowedOrigins.concat(e.allowedOrigins),this.allowedOrigins=this.allowedOrigins.reduce(((e,t)=>(e.find((e=>e.source===t.source))||e.push(t),e)),[]))}raiseAddinReadyMessage(){this.postMessageToHostPage({messageType:"ready"},"*")}handleModalClosedMessage(e){const t=this.modalRequests,s=e.modalRequestId;t[s].resolve(e.context),t[s]=void 0}handleAuthTokenMessage(e){const t=this.authTokenRequests,s=e.message.authTokenRequestId,o=t[s];switch(e.messageType){case"auth-token":const t=e.message.authToken;o.resolve(t);break;case"auth-token-fail":o.reject(e.message.reason)}t[s]=void 0}handleMessage(e){const t=e.data;if(t&&"bb-addin-host"===t.source)if("host-ready"===t.messageType)this.setKnownAllowedHostOrigin(e.origin),this.trackHeightChangesOfAddinContent(),this.supportedEventTypes=t.message.supportedEventTypes||[],this.args.callbacks.init({context:t.message.context,envId:t.message.envId,ready:e=>{this.checkForHeightChangesOfAddinContent(),this.postMessageToHostPage({message:e,messageType:"addin-ready"})},supportedEventTypes:this.supportedEventTypes,themeSettings:t.message.themeSettings});else if(this.isFromValidOrigin(e))switch(t.messageType){case"action-click":this.args.callbacks.actionClick&&this.args.callbacks.actionClick(t.message.reason);break;case"auth-token":case"auth-token-fail":this.handleAuthTokenMessage(t);break;case"modal-closed":this.handleModalClosedMessage(t.message);break;case"button-click":this.args.callbacks.buttonClick&&this.args.callbacks.buttonClick();break;case"update-context":this.args.callbacks.updateContext&&this.args.callbacks.updateContext(t.message);break;case"confirm-closed":this.confirmRequest&&(this.confirmRequest.resolve(t.message.reason),this.confirmRequest=void 0);break;case"flyout-closed":this.flyoutRequest&&(this.flyoutRequest.resolve(),this.flyoutRequest=void 0);break;case"flyout-next-click":this.args.callbacks.flyoutNextClick&&this.args.callbacks.flyoutNextClick();break;case"flyout-previous-click":this.args.callbacks.flyoutPreviousClick&&this.args.callbacks.flyoutPreviousClick();break;case"help-click":this.args.callbacks.helpClick&&this.args.callbacks.helpClick();break;case"inline-help-click":this.args.callbacks.inlineHelpClick&&this.args.callbacks.inlineHelpClick();break;case"settings-click":this.args.callbacks.settingsClick&&this.args.callbacks.settingsClick();break;case"theme-change":this.args.callbacks.themeChange&&this.args.callbacks.themeChange(t.message.themeSettings);break;case"host-event":this.processHostEvent(t.message);break;case"event-received":this.resolveClientEvent(t.message)}else this.warnInvalidOrigin()}setKnownAllowedHostOrigin(e){for(const t of this.allowedOrigins)if(t.test(e))return void(this.trustedOrigin=e)}checkForHeightChangesOfAddinContent(){const e=document.documentElement.offsetHeight;e!==this.lastPostedIframeHeight&&(this.lastPostedIframeHeight=e,this.postMessageToHostPage({message:{height:e+"px"},messageType:"height-change"}))}trackHeightChangesOfAddinContent(){this.heightChangeIntervalId=setInterval((()=>{this.checkForHeightChangesOfAddinContent()}),1e3)}postMessageToHostPage(e,t){e.source="bb-addin-client",e.addinId=this.getQueryVariable("addinId"),(t=t||this.trustedOrigin)?window.parent.postMessage(e,t):this.warnInvalidOrigin()}processHostEvent(e){const t=e.context,s=this.registeredAddinEvents[t.type];let o;o=s?this.isBlockingEventType(t.type)?new Promise((e=>{s(t.context,(t=>{e(t)}))})):new Promise((e=>{s(t.context),e(void 0)})):Promise.resolve(),o.then((t=>this.postEventReceivedMessage(e.eventRequestId,t)))}isBlockingEventType(e){switch(e){case"form-save":case"form-cancel":case"load-data":return!0}return!1}postEventReceivedMessage(e,t){this.postMessageToHostPage({message:{eventRequestId:e,data:t},messageType:"event-received"})}resolveClientEvent(e){const t=e.eventRequestId,s=this.sentEvents[t];s&&(s(),delete this.sentEvents[t])}isFromValidOrigin(e){return e.origin===this.trustedOrigin}warnInvalidOrigin(){console.warn("The origin is not trusted because the host-ready message has not been sent or because the host origin is not a whitelisted origin.")}getQueryVariable(e){const t=o.getQueryString().substring(1).split("&");for(const s of t){const t=s.split("=");if(decodeURIComponent(t[0])===e)return decodeURIComponent(t[1])}}}t.AddinClient=o},93:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},294:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},714:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},819:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinButtonStyle=void 0,(s=t.AddinButtonStyle||(t.AddinButtonStyle={}))[s.None=0]="None",s[s.Add=1]="Add",s[s.Edit=2]="Edit",s[s.Delete=3]="Delete"},676:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},233:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},455:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},407:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},75:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},258:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},413:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},954:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},663:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},542:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},610:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},95:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},581:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},342:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},790:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},212:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},88:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},90:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},948:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},468:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinConfirmButtonStyle=void 0,(s=t.AddinConfirmButtonStyle||(t.AddinConfirmButtonStyle={}))[s.Default=0]="Default",s[s.Primary=1]="Primary",s[s.Link=2]="Link"},756:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},545:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},993:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinTabSummaryStyle=void 0,(s=t.AddinTabSummaryStyle||(t.AddinTabSummaryStyle={}))[s.None=0]="None",s[s.Text=1]="Text"},518:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},590:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinTileSummaryStyle=void 0,(s=t.AddinTileSummaryStyle||(t.AddinTileSummaryStyle={}))[s.None=0]="None",s[s.Text=1]="Text",s[s.Check=2]="Check"},480:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinToastStyle=void 0,(s=t.AddinToastStyle||(t.AddinToastStyle={}))[s.Danger=0]="Danger",s[s.Info=1]="Info",s[s.Success=2]="Success",s[s.Warning=3]="Warning"},142:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var i=Object.getOwnPropertyDescriptor(t,s);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,i)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),i=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),i(s(93),t),i(s(294),t),i(s(714),t),i(s(819),t),i(s(676),t),i(s(233),t),i(s(455),t),i(s(407),t),i(s(75),t),i(s(258),t),i(s(413),t),i(s(954),t),i(s(663),t),i(s(542),t),i(s(610),t),i(s(95),t),i(s(581),t),i(s(342),t),i(s(790),t),i(s(212),t),i(s(88),t),i(s(90),t),i(s(948),t),i(s(756),t),i(s(468),t),i(s(545),t),i(s(993),t),i(s(518),t),i(s(590),t),i(s(480),t)},220:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},606:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},57:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var i=Object.getOwnPropertyDescriptor(t,s);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,i)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),i=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),i(s(220),t),i(s(606),t)},983:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var i=Object.getOwnPropertyDescriptor(t,s);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,i)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),i=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),i(s(903),t),i(s(142),t),i(s(57),t)}},t={},s=function s(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={exports:{}};return e[o].call(a.exports,a,a.exports,s),a.exports}(789);window.BBSkyAddinClient=s})();
1
+ (()=>{"use strict";var e={789:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var a=Object.getOwnPropertyDescriptor(t,s);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,a)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),a=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),a(s(983),t)},903:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddinClient=void 0;const s=[/^https\:\/\/[\w\-\.]+\.blackbaud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaud\-dev\.com$/,/^http\:\/\/[\w\-\.]+\.blackbaud\-dev\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaud\-test\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudhosting\.com$/,/^https\:\/\/[\w\-\.]+\.bbcloudservices\.com$/,/^https\:\/\/localhost(\:[0-9]+)?$/,/^https\:\/\/secure[2|3|8]\.convio\.net$/,/^https\:\/\/testweb\.convio\.com$/,/^https\:\/\/[\w\-\.]+\.conviocloud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudcloud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudfaith\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudportal\.com$/,/^https\:\/\/[\w\-\.]+\.bbk12\.com$/,/^https\:\/\/[\w\-\.]+\.mycampus\-app\.com$/,/^https\:\/\/[\w\-\.]+\.myschoolapp\.com$/,/^https\:\/\/[\w\-\.]+\.myschoolautomation\.com$/,/^https\:\/\/[\w\-\.]+\.myschooldemo\.com$/,/^https\:\/\/[\w\-\.]+\.myschooltraining\.com$/,/^https\:\/\/[\w\-\.]+\.justgiving\.com$/,/^https\:\/\/sky\.blackbaudcdn\.net$/],o={"action-button":!0,box:!0,button:!0,dataset:!0,flyout:!0,generic:!0,modal:!0,page:!0,tab:!0,tile:!0,"vertical-tab-form":!0},a=[{property:"background-color",value:"transparent"},{property:"background-image",value:"none"}];class n{static getQueryString(){return window.location.search}constructor(e){this.args=e,this.authTokenRequests=[],this.lastAuthTokenRequestId=0,this.modalRequests=[],this.lastModalRequestId=0,this.registeredAddinEvents={},this.sentEvents={},this.pendingSentEvents={},this.eventRequestId=0,this.supportedEventTypes=[],this.destroyed=!1,this.replacedBackgroundDeclarations=[],this.allowedOrigins=s,this.initConfig(e.config),this.windowMessageHandler=e=>{this.handleMessage(e)},window.addEventListener("message",this.windowMessageHandler),this.raiseAddinReadyMessage()}destroy(){window.removeEventListener("message",this.windowMessageHandler),this.heightChangeIntervalId&&clearInterval(this.heightChangeIntervalId),this.cleanupTransparentBackground(),this.destroyed=!0}navigate(e){this.postMessageToHostPage({message:{url:e.url},messageType:"navigate"})}getAuthToken(){return this.getUserIdentityToken()}getUserIdentityToken(){return new Promise(((e,t)=>{const s=++this.lastAuthTokenRequestId;this.authTokenRequests[s]={reject:t,resolve:e},this.postMessageToHostPage({message:{authTokenRequestId:s},messageType:"get-auth-token"})}))}showModal(e){return{modalClosed:new Promise(((t,s)=>{const o=++this.lastModalRequestId;this.modalRequests[o]={reject:s,resolve:t},this.postMessageToHostPage({message:{args:e,modalRequestId:o},messageType:"show-modal"})}))}}closeModal(e){this.postMessageToHostPage({message:e,messageType:"close-modal"})}openHelp(e){this.postMessageToHostPage({message:{helpKey:e.helpKey},messageType:"open-help"})}showToast(e){this.postMessageToHostPage({message:e,messageType:"show-toast"})}showFlyout(e){return{flyoutClosed:new Promise(((t,s)=>{e.defaultWidth=e.defaultWidth,e.maxWidth=e.maxWidth,e.minWidth=e.minWidth,this.flyoutRequest={reject:s,resolve:t},this.postMessageToHostPage({message:e,messageType:"show-flyout"})}))}}closeFlyout(){this.postMessageToHostPage({messageType:"close-flyout"})}showConfirm(e){return new Promise(((t,s)=>{this.confirmRequest={reject:s,resolve:t},this.postMessageToHostPage({message:e,messageType:"show-confirm"})}))}showError(e){this.postMessageToHostPage({message:e,messageType:"show-error"})}showWait(){this.postMessageToHostPage({messageType:"show-wait"})}hideWait(){this.postMessageToHostPage({messageType:"hide-wait"})}addEventHandler(e,t){this.registeredAddinEvents[e]=t}sendEvent(e){return new Promise(((t,s)=>{const o=e.type;this.supportedEventTypes.includes(o)||s("Event type not supported");const a=this.pendingSentEvents[o];a&&(clearTimeout(a.timeoutId),a.reject("Event cancelled"));const n=setTimeout((()=>{delete this.pendingSentEvents[o],this.postMessageToHostPage({message:{event:e,eventRequestId:this.eventRequestId},messageType:"client-event"}),this.sentEvents[this.eventRequestId]=t,this.eventRequestId++}),200);this.pendingSentEvents[o]={reject:s,timeoutId:n}}))}initConfig(e){var t;(null===(t=null==e?void 0:e.allowedOrigins)||void 0===t?void 0:t.length)>0&&(this.allowedOrigins=this.allowedOrigins.concat(e.allowedOrigins),this.allowedOrigins=this.allowedOrigins.reduce(((e,t)=>(e.find((e=>e.source===t.source))||e.push(t),e)),[]))}applyModalStyle(e){!0===(null==e?void 0:e.transparentBackground)?(this.makeBackgroundTransparent(document.documentElement),document.body?this.makeBackgroundTransparent(document.body):this.bodyReadyHandler||(this.bodyReadyHandler=()=>{this.bodyReadyHandler=void 0,document.body&&this.makeBackgroundTransparent(document.body)},document.addEventListener("DOMContentLoaded",this.bodyReadyHandler,{once:!0}))):this.cleanupTransparentBackground()}makeBackgroundTransparent(e){for(const t of a){const s=t.property,o=e.style.getPropertyValue(s),a=e.style.getPropertyPriority(s);o===t.value&&"important"===a||(this.replacedBackgroundDeclarations.push({element:e,priority:a,property:s,transparentValue:t.value,value:o}),e.style.setProperty(s,t.value,"important"))}}cleanupTransparentBackground(){this.bodyReadyHandler&&(document.removeEventListener("DOMContentLoaded",this.bodyReadyHandler),this.bodyReadyHandler=void 0);for(const e of this.replacedBackgroundDeclarations){const t=e.element.style;t.getPropertyValue(e.property)===e.transparentValue&&"important"===t.getPropertyPriority(e.property)&&(e.value?t.setProperty(e.property,e.value,e.priority):t.removeProperty(e.property))}this.replacedBackgroundDeclarations=[]}getKnownAddinType(e){if("string"==typeof e&&o.hasOwnProperty(e))return e}raiseAddinReadyMessage(){this.postMessageToHostPage({messageType:"ready"},"*")}handleModalClosedMessage(e){const t=this.modalRequests,s=e.modalRequestId;t[s].resolve(e.context),t[s]=void 0}handleAuthTokenMessage(e){const t=this.authTokenRequests,s=e.message.authTokenRequestId,o=t[s];switch(e.messageType){case"auth-token":const t=e.message.authToken;o.resolve(t);break;case"auth-token-fail":o.reject(e.message.reason)}t[s]=void 0}handleMessage(e){const t=e.data;if(t&&"bb-addin-host"===t.source)if("host-ready"===t.messageType)this.setKnownAllowedHostOrigin(e.origin),this.trackHeightChangesOfAddinContent(),this.supportedEventTypes=t.message.supportedEventTypes||[],this.args.callbacks.init({addinType:this.getKnownAddinType(t.message.addinType),context:t.message.context,envId:t.message.envId,ready:e=>{var t;this.destroyed||this.applyModalStyle(null===(t=null==e?void 0:e.modalConfig)||void 0===t?void 0:t.style),this.checkForHeightChangesOfAddinContent(),this.postMessageToHostPage({message:e,messageType:"addin-ready"})},supportedEventTypes:this.supportedEventTypes,themeSettings:t.message.themeSettings});else if(this.isFromValidOrigin(e))switch(t.messageType){case"action-click":this.args.callbacks.actionClick&&this.args.callbacks.actionClick(t.message.reason);break;case"auth-token":case"auth-token-fail":this.handleAuthTokenMessage(t);break;case"modal-closed":this.handleModalClosedMessage(t.message);break;case"button-click":this.args.callbacks.buttonClick&&this.args.callbacks.buttonClick();break;case"update-context":this.args.callbacks.updateContext&&this.args.callbacks.updateContext(t.message);break;case"confirm-closed":this.confirmRequest&&(this.confirmRequest.resolve(t.message.reason),this.confirmRequest=void 0);break;case"flyout-closed":this.flyoutRequest&&(this.flyoutRequest.resolve(),this.flyoutRequest=void 0);break;case"flyout-next-click":this.args.callbacks.flyoutNextClick&&this.args.callbacks.flyoutNextClick();break;case"flyout-previous-click":this.args.callbacks.flyoutPreviousClick&&this.args.callbacks.flyoutPreviousClick();break;case"help-click":this.args.callbacks.helpClick&&this.args.callbacks.helpClick();break;case"inline-help-click":this.args.callbacks.inlineHelpClick&&this.args.callbacks.inlineHelpClick();break;case"settings-click":this.args.callbacks.settingsClick&&this.args.callbacks.settingsClick();break;case"theme-change":this.args.callbacks.themeChange&&this.args.callbacks.themeChange(t.message.themeSettings);break;case"host-event":this.processHostEvent(t.message);break;case"event-received":this.resolveClientEvent(t.message)}else this.warnInvalidOrigin()}setKnownAllowedHostOrigin(e){for(const t of this.allowedOrigins)if(t.test(e))return void(this.trustedOrigin=e)}checkForHeightChangesOfAddinContent(){const e=document.documentElement.offsetHeight;e!==this.lastPostedIframeHeight&&(this.lastPostedIframeHeight=e,this.postMessageToHostPage({message:{height:e+"px"},messageType:"height-change"}))}trackHeightChangesOfAddinContent(){this.heightChangeIntervalId=setInterval((()=>{this.checkForHeightChangesOfAddinContent()}),1e3)}postMessageToHostPage(e,t){e.source="bb-addin-client",e.addinId=this.getQueryVariable("addinId"),(t=t||this.trustedOrigin)?window.parent.postMessage(e,t):this.warnInvalidOrigin()}processHostEvent(e){const t=e.context,s=this.registeredAddinEvents[t.type];let o;o=s?this.isBlockingEventType(t.type)?new Promise((e=>{s(t.context,(t=>{e(t)}))})):new Promise((e=>{s(t.context),e(void 0)})):Promise.resolve(),o.then((t=>this.postEventReceivedMessage(e.eventRequestId,t)))}isBlockingEventType(e){switch(e){case"form-save":case"form-cancel":case"load-data":return!0}return!1}postEventReceivedMessage(e,t){this.postMessageToHostPage({message:{eventRequestId:e,data:t},messageType:"event-received"})}resolveClientEvent(e){const t=e.eventRequestId,s=this.sentEvents[t];s&&(s(),delete this.sentEvents[t])}isFromValidOrigin(e){return e.origin===this.trustedOrigin}warnInvalidOrigin(){console.warn("The origin is not trusted because the host-ready message has not been sent or because the host origin is not a whitelisted origin.")}getQueryVariable(e){const t=n.getQueryString().substring(1).split("&");for(const s of t){const t=s.split("=");if(decodeURIComponent(t[0])===e)return decodeURIComponent(t[1])}}}t.AddinClient=n},93:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},294:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},714:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},819:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinButtonStyle=void 0,(s=t.AddinButtonStyle||(t.AddinButtonStyle={}))[s.None=0]="None",s[s.Add=1]="Add",s[s.Edit=2]="Edit",s[s.Delete=3]="Delete"},676:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},233:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},455:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},407:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},75:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},258:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},413:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},954:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},663:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},542:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},610:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},95:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},581:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},342:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},790:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},212:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},88:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},90:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},948:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},468:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinConfirmButtonStyle=void 0,(s=t.AddinConfirmButtonStyle||(t.AddinConfirmButtonStyle={}))[s.Default=0]="Default",s[s.Primary=1]="Primary",s[s.Link=2]="Link"},756:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},545:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},993:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinTabSummaryStyle=void 0,(s=t.AddinTabSummaryStyle||(t.AddinTabSummaryStyle={}))[s.None=0]="None",s[s.Text=1]="Text"},518:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},590:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinTileSummaryStyle=void 0,(s=t.AddinTileSummaryStyle||(t.AddinTileSummaryStyle={}))[s.None=0]="None",s[s.Text=1]="Text",s[s.Check=2]="Check"},480:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinToastStyle=void 0,(s=t.AddinToastStyle||(t.AddinToastStyle={}))[s.Danger=0]="Danger",s[s.Info=1]="Info",s[s.Success=2]="Success",s[s.Warning=3]="Warning"},671:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},142:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var a=Object.getOwnPropertyDescriptor(t,s);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,a)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),a=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),a(s(93),t),a(s(294),t),a(s(714),t),a(s(819),t),a(s(676),t),a(s(233),t),a(s(455),t),a(s(407),t),a(s(75),t),a(s(258),t),a(s(413),t),a(s(954),t),a(s(663),t),a(s(542),t),a(s(610),t),a(s(95),t),a(s(581),t),a(s(342),t),a(s(790),t),a(s(212),t),a(s(88),t),a(s(90),t),a(s(948),t),a(s(756),t),a(s(468),t),a(s(545),t),a(s(993),t),a(s(518),t),a(s(590),t),a(s(480),t),a(s(671),t)},220:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},606:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},57:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var a=Object.getOwnPropertyDescriptor(t,s);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,a)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),a=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),a(s(220),t),a(s(606),t)},983:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var a=Object.getOwnPropertyDescriptor(t,s);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,a)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),a=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),a(s(903),t),a(s(142),t),a(s(57),t)}},t={},s=function s(o){var a=t[o];if(void 0!==a)return a.exports;var n=t[o]={exports:{}};return e[o].call(n.exports,n,n.exports,s),n.exports}(789);window.BBSkyAddinClient=s})();
@@ -45,7 +45,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
45
45
  Object.defineProperty(exports, "__esModule", ({ value: true }));
46
46
  __exportStar(__webpack_require__(2), exports);
47
47
  __exportStar(__webpack_require__(3), exports);
48
- __exportStar(__webpack_require__(34), exports);
48
+ __exportStar(__webpack_require__(35), exports);
49
49
 
50
50
 
51
51
  /***/ }),
@@ -81,6 +81,31 @@ var allowedOrigins = [
81
81
  /^https\:\/\/[\w\-\.]+\.justgiving\.com$/,
82
82
  /^https\:\/\/sky\.blackbaudcdn\.net$/
83
83
  ];
84
+ /**
85
+ * Add-in types recognized by this client. Typed as a record so that every
86
+ * AddinType must be listed here.
87
+ */
88
+ var knownAddinTypes = {
89
+ 'action-button': true,
90
+ 'box': true,
91
+ 'button': true,
92
+ 'dataset': true,
93
+ 'flyout': true,
94
+ 'generic': true,
95
+ 'modal': true,
96
+ 'page': true,
97
+ 'tab': true,
98
+ 'tile': true,
99
+ 'vertical-tab-form': true
100
+ };
101
+ /**
102
+ * Inline declarations that make an element's background transparent. Inline styles
103
+ * are used rather than a style element so they are not blocked by a Content Security Policy.
104
+ */
105
+ var transparentBackgroundDeclarations = [
106
+ { property: 'background-color', value: 'transparent' },
107
+ { property: 'background-image', value: 'none' }
108
+ ];
84
109
  /**
85
110
  * Client for interacting with the parent page hosting the add-in.
86
111
  */
@@ -133,6 +158,14 @@ var AddinClient = /** @class */ (function () {
133
158
  * The add-in client will throw an error if an event is attempted but not one the supported types.
134
159
  */
135
160
  this.supportedEventTypes = [];
161
+ /**
162
+ * Indicates whether the client has been destroyed.
163
+ */
164
+ this.destroyed = false;
165
+ /**
166
+ * Inline background declarations replaced by this client to make the document transparent.
167
+ */
168
+ this.replacedBackgroundDeclarations = [];
136
169
  /**
137
170
  * Collection of regexs for our whitelist of host origins.
138
171
  */
@@ -161,6 +194,8 @@ var AddinClient = /** @class */ (function () {
161
194
  if (this.heightChangeIntervalId) {
162
195
  clearInterval(this.heightChangeIntervalId);
163
196
  }
197
+ this.cleanupTransparentBackground();
198
+ this.destroyed = true;
164
199
  };
165
200
  /**
166
201
  * Requests the host page to navigate.
@@ -397,6 +432,90 @@ var AddinClient = /** @class */ (function () {
397
432
  }, []);
398
433
  }
399
434
  };
435
+ /**
436
+ * Applies the client-owned document transparency for a modal add-in.
437
+ * @param style The modal style from the ready args.
438
+ */
439
+ AddinClient.prototype.applyModalStyle = function (style) {
440
+ var _this = this;
441
+ if ((style === null || style === void 0 ? void 0 : style.transparentBackground) !== true) {
442
+ this.cleanupTransparentBackground();
443
+ return;
444
+ }
445
+ this.makeBackgroundTransparent(document.documentElement);
446
+ if (document.body) {
447
+ this.makeBackgroundTransparent(document.body);
448
+ }
449
+ else if (!this.bodyReadyHandler) {
450
+ // The body does not exist yet if ready is called while the document is still parsing.
451
+ this.bodyReadyHandler = function () {
452
+ _this.bodyReadyHandler = undefined;
453
+ if (document.body) {
454
+ _this.makeBackgroundTransparent(document.body);
455
+ }
456
+ };
457
+ document.addEventListener('DOMContentLoaded', this.bodyReadyHandler, { once: true });
458
+ }
459
+ };
460
+ /**
461
+ * Makes an element's background transparent with inline declarations, recording
462
+ * the declarations it replaces so they can be restored.
463
+ * @param element The element to make transparent.
464
+ */
465
+ AddinClient.prototype.makeBackgroundTransparent = function (element) {
466
+ for (var _i = 0, transparentBackgroundDeclarations_1 = transparentBackgroundDeclarations; _i < transparentBackgroundDeclarations_1.length; _i++) {
467
+ var declaration = transparentBackgroundDeclarations_1[_i];
468
+ var property = declaration.property;
469
+ var value = element.style.getPropertyValue(property);
470
+ var priority = element.style.getPropertyPriority(property);
471
+ // Leave an existing transparent declaration alone, whether it was set by this client
472
+ // on an earlier ready call or by the add-in itself.
473
+ if (value !== declaration.value || priority !== 'important') {
474
+ this.replacedBackgroundDeclarations.push({
475
+ element: element,
476
+ priority: priority,
477
+ property: property,
478
+ transparentValue: declaration.value,
479
+ value: value
480
+ });
481
+ element.style.setProperty(property, declaration.value, 'important');
482
+ }
483
+ }
484
+ };
485
+ /**
486
+ * Restores document background declarations replaced by this client.
487
+ */
488
+ AddinClient.prototype.cleanupTransparentBackground = function () {
489
+ if (this.bodyReadyHandler) {
490
+ document.removeEventListener('DOMContentLoaded', this.bodyReadyHandler);
491
+ this.bodyReadyHandler = undefined;
492
+ }
493
+ for (var _i = 0, _a = this.replacedBackgroundDeclarations; _i < _a.length; _i++) {
494
+ var replaced = _a[_i];
495
+ var style = replaced.element.style;
496
+ // Don't restore over a declaration the add-in has changed since this client set it.
497
+ if (style.getPropertyValue(replaced.property) === replaced.transparentValue &&
498
+ style.getPropertyPriority(replaced.property) === 'important') {
499
+ if (replaced.value) {
500
+ style.setProperty(replaced.property, replaced.value, replaced.priority);
501
+ }
502
+ else {
503
+ style.removeProperty(replaced.property);
504
+ }
505
+ }
506
+ }
507
+ this.replacedBackgroundDeclarations = [];
508
+ };
509
+ /**
510
+ * Returns the add-in type provided by the host if this client recognizes it.
511
+ * @param addinType The add-in type provided by the host.
512
+ * @returns The add-in type, or undefined if it is missing or unrecognized.
513
+ */
514
+ AddinClient.prototype.getKnownAddinType = function (addinType) {
515
+ if (typeof addinType === 'string' && knownAddinTypes.hasOwnProperty(addinType)) {
516
+ return addinType;
517
+ }
518
+ };
400
519
  /**
401
520
  * Post a message to the host page informing it that the add-in is
402
521
  * now started and listening for messages from the host.
@@ -465,9 +584,14 @@ var AddinClient = /** @class */ (function () {
465
584
  this.supportedEventTypes = data.message.supportedEventTypes || [];
466
585
  // Pass key data to the add-in for it to initiailze.
467
586
  this.args.callbacks.init({
587
+ addinType: this.getKnownAddinType(data.message.addinType),
468
588
  context: data.message.context,
469
589
  envId: data.message.envId,
470
590
  ready: function (args) {
591
+ var _a;
592
+ if (!_this.destroyed) {
593
+ _this.applyModalStyle((_a = args === null || args === void 0 ? void 0 : args.modalConfig) === null || _a === void 0 ? void 0 : _a.style);
594
+ }
471
595
  // Do an immediate height check since the add-in may render something
472
596
  // due to the context provided. No need to wait a full second to reflect.
473
597
  _this.checkForHeightChangesOfAddinContent();
@@ -778,6 +902,7 @@ __exportStar(__webpack_require__(30), exports);
778
902
  __exportStar(__webpack_require__(31), exports);
779
903
  __exportStar(__webpack_require__(32), exports);
780
904
  __exportStar(__webpack_require__(33), exports);
905
+ __exportStar(__webpack_require__(34), exports);
781
906
 
782
907
 
783
908
  /***/ }),
@@ -1090,6 +1215,14 @@ var AddinToastStyle;
1090
1215
 
1091
1216
  /***/ }),
1092
1217
  /* 34 */
1218
+ /***/ ((__unused_webpack_module, exports) => {
1219
+
1220
+
1221
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
1222
+
1223
+
1224
+ /***/ }),
1225
+ /* 35 */
1093
1226
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1094
1227
 
1095
1228
 
@@ -1108,12 +1241,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
1108
1241
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1109
1242
  };
1110
1243
  Object.defineProperty(exports, "__esModule", ({ value: true }));
1111
- __exportStar(__webpack_require__(35), exports);
1112
1244
  __exportStar(__webpack_require__(36), exports);
1245
+ __exportStar(__webpack_require__(37), exports);
1113
1246
 
1114
1247
 
1115
1248
  /***/ }),
1116
- /* 35 */
1249
+ /* 36 */
1117
1250
  /***/ ((__unused_webpack_module, exports) => {
1118
1251
 
1119
1252
 
@@ -1121,7 +1254,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
1121
1254
 
1122
1255
 
1123
1256
  /***/ }),
1124
- /* 36 */
1257
+ /* 37 */
1125
1258
  /***/ ((__unused_webpack_module, exports) => {
1126
1259
 
1127
1260
 
@@ -1 +1 @@
1
- (()=>{"use strict";var e={789:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var n=Object.getOwnPropertyDescriptor(t,s);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,n)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),n=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(s(983),t)},903:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddinClient=void 0;var s=[/^https\:\/\/[\w\-\.]+\.blackbaud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaud\-dev\.com$/,/^http\:\/\/[\w\-\.]+\.blackbaud\-dev\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaud\-test\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudhosting\.com$/,/^https\:\/\/[\w\-\.]+\.bbcloudservices\.com$/,/^https\:\/\/localhost(\:[0-9]+)?$/,/^https\:\/\/secure[2|3|8]\.convio\.net$/,/^https\:\/\/testweb\.convio\.com$/,/^https\:\/\/[\w\-\.]+\.conviocloud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudcloud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudfaith\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudportal\.com$/,/^https\:\/\/[\w\-\.]+\.bbk12\.com$/,/^https\:\/\/[\w\-\.]+\.mycampus\-app\.com$/,/^https\:\/\/[\w\-\.]+\.myschoolapp\.com$/,/^https\:\/\/[\w\-\.]+\.myschoolautomation\.com$/,/^https\:\/\/[\w\-\.]+\.myschooldemo\.com$/,/^https\:\/\/[\w\-\.]+\.myschooltraining\.com$/,/^https\:\/\/[\w\-\.]+\.justgiving\.com$/,/^https\:\/\/sky\.blackbaudcdn\.net$/],o=function(){function e(e){var t=this;this.args=e,this.authTokenRequests=[],this.lastAuthTokenRequestId=0,this.modalRequests=[],this.lastModalRequestId=0,this.registeredAddinEvents={},this.sentEvents={},this.pendingSentEvents={},this.eventRequestId=0,this.supportedEventTypes=[],this.allowedOrigins=s,this.initConfig(e.config),this.windowMessageHandler=function(e){t.handleMessage(e)},window.addEventListener("message",this.windowMessageHandler),this.raiseAddinReadyMessage()}return e.getQueryString=function(){return window.location.search},e.prototype.destroy=function(){window.removeEventListener("message",this.windowMessageHandler),this.heightChangeIntervalId&&clearInterval(this.heightChangeIntervalId)},e.prototype.navigate=function(e){this.postMessageToHostPage({message:{url:e.url},messageType:"navigate"})},e.prototype.getAuthToken=function(){return this.getUserIdentityToken()},e.prototype.getUserIdentityToken=function(){var e=this;return new Promise((function(t,s){var o=++e.lastAuthTokenRequestId;e.authTokenRequests[o]={reject:s,resolve:t},e.postMessageToHostPage({message:{authTokenRequestId:o},messageType:"get-auth-token"})}))},e.prototype.showModal=function(e){var t=this;return{modalClosed:new Promise((function(s,o){var n=++t.lastModalRequestId;t.modalRequests[n]={reject:o,resolve:s},t.postMessageToHostPage({message:{args:e,modalRequestId:n},messageType:"show-modal"})}))}},e.prototype.closeModal=function(e){this.postMessageToHostPage({message:e,messageType:"close-modal"})},e.prototype.openHelp=function(e){this.postMessageToHostPage({message:{helpKey:e.helpKey},messageType:"open-help"})},e.prototype.showToast=function(e){this.postMessageToHostPage({message:e,messageType:"show-toast"})},e.prototype.showFlyout=function(e){var t=this;return{flyoutClosed:new Promise((function(s,o){e.defaultWidth=e.defaultWidth,e.maxWidth=e.maxWidth,e.minWidth=e.minWidth,t.flyoutRequest={reject:o,resolve:s},t.postMessageToHostPage({message:e,messageType:"show-flyout"})}))}},e.prototype.closeFlyout=function(){this.postMessageToHostPage({messageType:"close-flyout"})},e.prototype.showConfirm=function(e){var t=this;return new Promise((function(s,o){t.confirmRequest={reject:o,resolve:s},t.postMessageToHostPage({message:e,messageType:"show-confirm"})}))},e.prototype.showError=function(e){this.postMessageToHostPage({message:e,messageType:"show-error"})},e.prototype.showWait=function(){this.postMessageToHostPage({messageType:"show-wait"})},e.prototype.hideWait=function(){this.postMessageToHostPage({messageType:"hide-wait"})},e.prototype.addEventHandler=function(e,t){this.registeredAddinEvents[e]=t},e.prototype.sendEvent=function(e){var t=this;return new Promise((function(s,o){var n=e.type;t.supportedEventTypes.includes(n)||o("Event type not supported");var i=t.pendingSentEvents[n];i&&(clearTimeout(i.timeoutId),i.reject("Event cancelled"));var a=setTimeout((function(){delete t.pendingSentEvents[n],t.postMessageToHostPage({message:{event:e,eventRequestId:t.eventRequestId},messageType:"client-event"}),t.sentEvents[t.eventRequestId]=s,t.eventRequestId++}),200);t.pendingSentEvents[n]={reject:o,timeoutId:a}}))},e.prototype.initConfig=function(e){var t;(null===(t=null==e?void 0:e.allowedOrigins)||void 0===t?void 0:t.length)>0&&(this.allowedOrigins=this.allowedOrigins.concat(e.allowedOrigins),this.allowedOrigins=this.allowedOrigins.reduce((function(e,t){return e.find((function(e){return e.source===t.source}))||e.push(t),e}),[]))},e.prototype.raiseAddinReadyMessage=function(){this.postMessageToHostPage({messageType:"ready"},"*")},e.prototype.handleModalClosedMessage=function(e){var t=this.modalRequests,s=e.modalRequestId;t[s].resolve(e.context),t[s]=void 0},e.prototype.handleAuthTokenMessage=function(e){var t=this.authTokenRequests,s=e.message.authTokenRequestId,o=t[s];switch(e.messageType){case"auth-token":var n=e.message.authToken;o.resolve(n);break;case"auth-token-fail":o.reject(e.message.reason)}t[s]=void 0},e.prototype.handleMessage=function(e){var t=this,s=e.data;if(s&&"bb-addin-host"===s.source)if("host-ready"===s.messageType)this.setKnownAllowedHostOrigin(e.origin),this.trackHeightChangesOfAddinContent(),this.supportedEventTypes=s.message.supportedEventTypes||[],this.args.callbacks.init({context:s.message.context,envId:s.message.envId,ready:function(e){t.checkForHeightChangesOfAddinContent(),t.postMessageToHostPage({message:e,messageType:"addin-ready"})},supportedEventTypes:this.supportedEventTypes,themeSettings:s.message.themeSettings});else if(this.isFromValidOrigin(e))switch(s.messageType){case"action-click":this.args.callbacks.actionClick&&this.args.callbacks.actionClick(s.message.reason);break;case"auth-token":case"auth-token-fail":this.handleAuthTokenMessage(s);break;case"modal-closed":this.handleModalClosedMessage(s.message);break;case"button-click":this.args.callbacks.buttonClick&&this.args.callbacks.buttonClick();break;case"update-context":this.args.callbacks.updateContext&&this.args.callbacks.updateContext(s.message);break;case"confirm-closed":this.confirmRequest&&(this.confirmRequest.resolve(s.message.reason),this.confirmRequest=void 0);break;case"flyout-closed":this.flyoutRequest&&(this.flyoutRequest.resolve(),this.flyoutRequest=void 0);break;case"flyout-next-click":this.args.callbacks.flyoutNextClick&&this.args.callbacks.flyoutNextClick();break;case"flyout-previous-click":this.args.callbacks.flyoutPreviousClick&&this.args.callbacks.flyoutPreviousClick();break;case"help-click":this.args.callbacks.helpClick&&this.args.callbacks.helpClick();break;case"inline-help-click":this.args.callbacks.inlineHelpClick&&this.args.callbacks.inlineHelpClick();break;case"settings-click":this.args.callbacks.settingsClick&&this.args.callbacks.settingsClick();break;case"theme-change":this.args.callbacks.themeChange&&this.args.callbacks.themeChange(s.message.themeSettings);break;case"host-event":this.processHostEvent(s.message);break;case"event-received":this.resolveClientEvent(s.message)}else this.warnInvalidOrigin()},e.prototype.setKnownAllowedHostOrigin=function(e){for(var t=0,s=this.allowedOrigins;t<s.length;t++)if(s[t].test(e))return void(this.trustedOrigin=e)},e.prototype.checkForHeightChangesOfAddinContent=function(){var e=document.documentElement.offsetHeight;e!==this.lastPostedIframeHeight&&(this.lastPostedIframeHeight=e,this.postMessageToHostPage({message:{height:e+"px"},messageType:"height-change"}))},e.prototype.trackHeightChangesOfAddinContent=function(){var e=this;this.heightChangeIntervalId=setInterval((function(){e.checkForHeightChangesOfAddinContent()}),1e3)},e.prototype.postMessageToHostPage=function(e,t){e.source="bb-addin-client",e.addinId=this.getQueryVariable("addinId"),(t=t||this.trustedOrigin)?window.parent.postMessage(e,t):this.warnInvalidOrigin()},e.prototype.processHostEvent=function(e){var t=this,s=e.context,o=this.registeredAddinEvents[s.type];(o?this.isBlockingEventType(s.type)?new Promise((function(e){o(s.context,(function(t){e(t)}))})):new Promise((function(e){o(s.context),e(void 0)})):Promise.resolve()).then((function(s){return t.postEventReceivedMessage(e.eventRequestId,s)}))},e.prototype.isBlockingEventType=function(e){switch(e){case"form-save":case"form-cancel":case"load-data":return!0}return!1},e.prototype.postEventReceivedMessage=function(e,t){this.postMessageToHostPage({message:{eventRequestId:e,data:t},messageType:"event-received"})},e.prototype.resolveClientEvent=function(e){var t=e.eventRequestId,s=this.sentEvents[t];s&&(s(),delete this.sentEvents[t])},e.prototype.isFromValidOrigin=function(e){return e.origin===this.trustedOrigin},e.prototype.warnInvalidOrigin=function(){console.warn("The origin is not trusted because the host-ready message has not been sent or because the host origin is not a whitelisted origin.")},e.prototype.getQueryVariable=function(t){for(var s=0,o=e.getQueryString().substring(1).split("&");s<o.length;s++){var n=o[s].split("=");if(decodeURIComponent(n[0])===t)return decodeURIComponent(n[1])}},e}();t.AddinClient=o},93:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},294:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},714:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},819:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinButtonStyle=void 0,(s=t.AddinButtonStyle||(t.AddinButtonStyle={}))[s.None=0]="None",s[s.Add=1]="Add",s[s.Edit=2]="Edit",s[s.Delete=3]="Delete"},676:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},233:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},455:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},407:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},75:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},258:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},413:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},954:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},663:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},542:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},610:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},95:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},581:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},342:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},790:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},212:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},88:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},90:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},948:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},468:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinConfirmButtonStyle=void 0,(s=t.AddinConfirmButtonStyle||(t.AddinConfirmButtonStyle={}))[s.Default=0]="Default",s[s.Primary=1]="Primary",s[s.Link=2]="Link"},756:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},545:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},993:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinTabSummaryStyle=void 0,(s=t.AddinTabSummaryStyle||(t.AddinTabSummaryStyle={}))[s.None=0]="None",s[s.Text=1]="Text"},518:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},590:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinTileSummaryStyle=void 0,(s=t.AddinTileSummaryStyle||(t.AddinTileSummaryStyle={}))[s.None=0]="None",s[s.Text=1]="Text",s[s.Check=2]="Check"},480:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinToastStyle=void 0,(s=t.AddinToastStyle||(t.AddinToastStyle={}))[s.Danger=0]="Danger",s[s.Info=1]="Info",s[s.Success=2]="Success",s[s.Warning=3]="Warning"},142:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var n=Object.getOwnPropertyDescriptor(t,s);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,n)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),n=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(s(93),t),n(s(294),t),n(s(714),t),n(s(819),t),n(s(676),t),n(s(233),t),n(s(455),t),n(s(407),t),n(s(75),t),n(s(258),t),n(s(413),t),n(s(954),t),n(s(663),t),n(s(542),t),n(s(610),t),n(s(95),t),n(s(581),t),n(s(342),t),n(s(790),t),n(s(212),t),n(s(88),t),n(s(90),t),n(s(948),t),n(s(756),t),n(s(468),t),n(s(545),t),n(s(993),t),n(s(518),t),n(s(590),t),n(s(480),t)},220:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},606:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},57:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var n=Object.getOwnPropertyDescriptor(t,s);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,n)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),n=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(s(220),t),n(s(606),t)},983:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var n=Object.getOwnPropertyDescriptor(t,s);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,n)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),n=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(s(903),t),n(s(142),t),n(s(57),t)}},t={},s=function s(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,s),i.exports}(789);window.BBSkyAddinClient=s})();
1
+ (()=>{"use strict";var e={789:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var n=Object.getOwnPropertyDescriptor(t,s);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,n)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),n=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(s(983),t)},903:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddinClient=void 0;var s=[/^https\:\/\/[\w\-\.]+\.blackbaud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaud\-dev\.com$/,/^http\:\/\/[\w\-\.]+\.blackbaud\-dev\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaud\-test\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudhosting\.com$/,/^https\:\/\/[\w\-\.]+\.bbcloudservices\.com$/,/^https\:\/\/localhost(\:[0-9]+)?$/,/^https\:\/\/secure[2|3|8]\.convio\.net$/,/^https\:\/\/testweb\.convio\.com$/,/^https\:\/\/[\w\-\.]+\.conviocloud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudcloud\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudfaith\.com$/,/^https\:\/\/[\w\-\.]+\.blackbaudportal\.com$/,/^https\:\/\/[\w\-\.]+\.bbk12\.com$/,/^https\:\/\/[\w\-\.]+\.mycampus\-app\.com$/,/^https\:\/\/[\w\-\.]+\.myschoolapp\.com$/,/^https\:\/\/[\w\-\.]+\.myschoolautomation\.com$/,/^https\:\/\/[\w\-\.]+\.myschooldemo\.com$/,/^https\:\/\/[\w\-\.]+\.myschooltraining\.com$/,/^https\:\/\/[\w\-\.]+\.justgiving\.com$/,/^https\:\/\/sky\.blackbaudcdn\.net$/],o={"action-button":!0,box:!0,button:!0,dataset:!0,flyout:!0,generic:!0,modal:!0,page:!0,tab:!0,tile:!0,"vertical-tab-form":!0},n=[{property:"background-color",value:"transparent"},{property:"background-image",value:"none"}],a=function(){function e(e){var t=this;this.args=e,this.authTokenRequests=[],this.lastAuthTokenRequestId=0,this.modalRequests=[],this.lastModalRequestId=0,this.registeredAddinEvents={},this.sentEvents={},this.pendingSentEvents={},this.eventRequestId=0,this.supportedEventTypes=[],this.destroyed=!1,this.replacedBackgroundDeclarations=[],this.allowedOrigins=s,this.initConfig(e.config),this.windowMessageHandler=function(e){t.handleMessage(e)},window.addEventListener("message",this.windowMessageHandler),this.raiseAddinReadyMessage()}return e.getQueryString=function(){return window.location.search},e.prototype.destroy=function(){window.removeEventListener("message",this.windowMessageHandler),this.heightChangeIntervalId&&clearInterval(this.heightChangeIntervalId),this.cleanupTransparentBackground(),this.destroyed=!0},e.prototype.navigate=function(e){this.postMessageToHostPage({message:{url:e.url},messageType:"navigate"})},e.prototype.getAuthToken=function(){return this.getUserIdentityToken()},e.prototype.getUserIdentityToken=function(){var e=this;return new Promise((function(t,s){var o=++e.lastAuthTokenRequestId;e.authTokenRequests[o]={reject:s,resolve:t},e.postMessageToHostPage({message:{authTokenRequestId:o},messageType:"get-auth-token"})}))},e.prototype.showModal=function(e){var t=this;return{modalClosed:new Promise((function(s,o){var n=++t.lastModalRequestId;t.modalRequests[n]={reject:o,resolve:s},t.postMessageToHostPage({message:{args:e,modalRequestId:n},messageType:"show-modal"})}))}},e.prototype.closeModal=function(e){this.postMessageToHostPage({message:e,messageType:"close-modal"})},e.prototype.openHelp=function(e){this.postMessageToHostPage({message:{helpKey:e.helpKey},messageType:"open-help"})},e.prototype.showToast=function(e){this.postMessageToHostPage({message:e,messageType:"show-toast"})},e.prototype.showFlyout=function(e){var t=this;return{flyoutClosed:new Promise((function(s,o){e.defaultWidth=e.defaultWidth,e.maxWidth=e.maxWidth,e.minWidth=e.minWidth,t.flyoutRequest={reject:o,resolve:s},t.postMessageToHostPage({message:e,messageType:"show-flyout"})}))}},e.prototype.closeFlyout=function(){this.postMessageToHostPage({messageType:"close-flyout"})},e.prototype.showConfirm=function(e){var t=this;return new Promise((function(s,o){t.confirmRequest={reject:o,resolve:s},t.postMessageToHostPage({message:e,messageType:"show-confirm"})}))},e.prototype.showError=function(e){this.postMessageToHostPage({message:e,messageType:"show-error"})},e.prototype.showWait=function(){this.postMessageToHostPage({messageType:"show-wait"})},e.prototype.hideWait=function(){this.postMessageToHostPage({messageType:"hide-wait"})},e.prototype.addEventHandler=function(e,t){this.registeredAddinEvents[e]=t},e.prototype.sendEvent=function(e){var t=this;return new Promise((function(s,o){var n=e.type;t.supportedEventTypes.includes(n)||o("Event type not supported");var a=t.pendingSentEvents[n];a&&(clearTimeout(a.timeoutId),a.reject("Event cancelled"));var i=setTimeout((function(){delete t.pendingSentEvents[n],t.postMessageToHostPage({message:{event:e,eventRequestId:t.eventRequestId},messageType:"client-event"}),t.sentEvents[t.eventRequestId]=s,t.eventRequestId++}),200);t.pendingSentEvents[n]={reject:o,timeoutId:i}}))},e.prototype.initConfig=function(e){var t;(null===(t=null==e?void 0:e.allowedOrigins)||void 0===t?void 0:t.length)>0&&(this.allowedOrigins=this.allowedOrigins.concat(e.allowedOrigins),this.allowedOrigins=this.allowedOrigins.reduce((function(e,t){return e.find((function(e){return e.source===t.source}))||e.push(t),e}),[]))},e.prototype.applyModalStyle=function(e){var t=this;!0===(null==e?void 0:e.transparentBackground)?(this.makeBackgroundTransparent(document.documentElement),document.body?this.makeBackgroundTransparent(document.body):this.bodyReadyHandler||(this.bodyReadyHandler=function(){t.bodyReadyHandler=void 0,document.body&&t.makeBackgroundTransparent(document.body)},document.addEventListener("DOMContentLoaded",this.bodyReadyHandler,{once:!0}))):this.cleanupTransparentBackground()},e.prototype.makeBackgroundTransparent=function(e){for(var t=0,s=n;t<s.length;t++){var o=s[t],a=o.property,i=e.style.getPropertyValue(a),r=e.style.getPropertyPriority(a);i===o.value&&"important"===r||(this.replacedBackgroundDeclarations.push({element:e,priority:r,property:a,transparentValue:o.value,value:i}),e.style.setProperty(a,o.value,"important"))}},e.prototype.cleanupTransparentBackground=function(){this.bodyReadyHandler&&(document.removeEventListener("DOMContentLoaded",this.bodyReadyHandler),this.bodyReadyHandler=void 0);for(var e=0,t=this.replacedBackgroundDeclarations;e<t.length;e++){var s=t[e],o=s.element.style;o.getPropertyValue(s.property)===s.transparentValue&&"important"===o.getPropertyPriority(s.property)&&(s.value?o.setProperty(s.property,s.value,s.priority):o.removeProperty(s.property))}this.replacedBackgroundDeclarations=[]},e.prototype.getKnownAddinType=function(e){if("string"==typeof e&&o.hasOwnProperty(e))return e},e.prototype.raiseAddinReadyMessage=function(){this.postMessageToHostPage({messageType:"ready"},"*")},e.prototype.handleModalClosedMessage=function(e){var t=this.modalRequests,s=e.modalRequestId;t[s].resolve(e.context),t[s]=void 0},e.prototype.handleAuthTokenMessage=function(e){var t=this.authTokenRequests,s=e.message.authTokenRequestId,o=t[s];switch(e.messageType){case"auth-token":var n=e.message.authToken;o.resolve(n);break;case"auth-token-fail":o.reject(e.message.reason)}t[s]=void 0},e.prototype.handleMessage=function(e){var t=this,s=e.data;if(s&&"bb-addin-host"===s.source)if("host-ready"===s.messageType)this.setKnownAllowedHostOrigin(e.origin),this.trackHeightChangesOfAddinContent(),this.supportedEventTypes=s.message.supportedEventTypes||[],this.args.callbacks.init({addinType:this.getKnownAddinType(s.message.addinType),context:s.message.context,envId:s.message.envId,ready:function(e){var s;t.destroyed||t.applyModalStyle(null===(s=null==e?void 0:e.modalConfig)||void 0===s?void 0:s.style),t.checkForHeightChangesOfAddinContent(),t.postMessageToHostPage({message:e,messageType:"addin-ready"})},supportedEventTypes:this.supportedEventTypes,themeSettings:s.message.themeSettings});else if(this.isFromValidOrigin(e))switch(s.messageType){case"action-click":this.args.callbacks.actionClick&&this.args.callbacks.actionClick(s.message.reason);break;case"auth-token":case"auth-token-fail":this.handleAuthTokenMessage(s);break;case"modal-closed":this.handleModalClosedMessage(s.message);break;case"button-click":this.args.callbacks.buttonClick&&this.args.callbacks.buttonClick();break;case"update-context":this.args.callbacks.updateContext&&this.args.callbacks.updateContext(s.message);break;case"confirm-closed":this.confirmRequest&&(this.confirmRequest.resolve(s.message.reason),this.confirmRequest=void 0);break;case"flyout-closed":this.flyoutRequest&&(this.flyoutRequest.resolve(),this.flyoutRequest=void 0);break;case"flyout-next-click":this.args.callbacks.flyoutNextClick&&this.args.callbacks.flyoutNextClick();break;case"flyout-previous-click":this.args.callbacks.flyoutPreviousClick&&this.args.callbacks.flyoutPreviousClick();break;case"help-click":this.args.callbacks.helpClick&&this.args.callbacks.helpClick();break;case"inline-help-click":this.args.callbacks.inlineHelpClick&&this.args.callbacks.inlineHelpClick();break;case"settings-click":this.args.callbacks.settingsClick&&this.args.callbacks.settingsClick();break;case"theme-change":this.args.callbacks.themeChange&&this.args.callbacks.themeChange(s.message.themeSettings);break;case"host-event":this.processHostEvent(s.message);break;case"event-received":this.resolveClientEvent(s.message)}else this.warnInvalidOrigin()},e.prototype.setKnownAllowedHostOrigin=function(e){for(var t=0,s=this.allowedOrigins;t<s.length;t++)if(s[t].test(e))return void(this.trustedOrigin=e)},e.prototype.checkForHeightChangesOfAddinContent=function(){var e=document.documentElement.offsetHeight;e!==this.lastPostedIframeHeight&&(this.lastPostedIframeHeight=e,this.postMessageToHostPage({message:{height:e+"px"},messageType:"height-change"}))},e.prototype.trackHeightChangesOfAddinContent=function(){var e=this;this.heightChangeIntervalId=setInterval((function(){e.checkForHeightChangesOfAddinContent()}),1e3)},e.prototype.postMessageToHostPage=function(e,t){e.source="bb-addin-client",e.addinId=this.getQueryVariable("addinId"),(t=t||this.trustedOrigin)?window.parent.postMessage(e,t):this.warnInvalidOrigin()},e.prototype.processHostEvent=function(e){var t=this,s=e.context,o=this.registeredAddinEvents[s.type];(o?this.isBlockingEventType(s.type)?new Promise((function(e){o(s.context,(function(t){e(t)}))})):new Promise((function(e){o(s.context),e(void 0)})):Promise.resolve()).then((function(s){return t.postEventReceivedMessage(e.eventRequestId,s)}))},e.prototype.isBlockingEventType=function(e){switch(e){case"form-save":case"form-cancel":case"load-data":return!0}return!1},e.prototype.postEventReceivedMessage=function(e,t){this.postMessageToHostPage({message:{eventRequestId:e,data:t},messageType:"event-received"})},e.prototype.resolveClientEvent=function(e){var t=e.eventRequestId,s=this.sentEvents[t];s&&(s(),delete this.sentEvents[t])},e.prototype.isFromValidOrigin=function(e){return e.origin===this.trustedOrigin},e.prototype.warnInvalidOrigin=function(){console.warn("The origin is not trusted because the host-ready message has not been sent or because the host origin is not a whitelisted origin.")},e.prototype.getQueryVariable=function(t){for(var s=0,o=e.getQueryString().substring(1).split("&");s<o.length;s++){var n=o[s].split("=");if(decodeURIComponent(n[0])===t)return decodeURIComponent(n[1])}},e}();t.AddinClient=a},93:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},294:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},714:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},819:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinButtonStyle=void 0,(s=t.AddinButtonStyle||(t.AddinButtonStyle={}))[s.None=0]="None",s[s.Add=1]="Add",s[s.Edit=2]="Edit",s[s.Delete=3]="Delete"},676:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},233:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},455:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},407:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},75:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},258:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},413:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},954:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},663:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},542:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},610:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},95:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},581:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},342:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},790:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},212:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},88:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},90:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},948:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},468:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinConfirmButtonStyle=void 0,(s=t.AddinConfirmButtonStyle||(t.AddinConfirmButtonStyle={}))[s.Default=0]="Default",s[s.Primary=1]="Primary",s[s.Link=2]="Link"},756:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},545:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},993:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinTabSummaryStyle=void 0,(s=t.AddinTabSummaryStyle||(t.AddinTabSummaryStyle={}))[s.None=0]="None",s[s.Text=1]="Text"},518:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},590:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinTileSummaryStyle=void 0,(s=t.AddinTileSummaryStyle||(t.AddinTileSummaryStyle={}))[s.None=0]="None",s[s.Text=1]="Text",s[s.Check=2]="Check"},480:(e,t)=>{var s;Object.defineProperty(t,"__esModule",{value:!0}),t.AddinToastStyle=void 0,(s=t.AddinToastStyle||(t.AddinToastStyle={}))[s.Danger=0]="Danger",s[s.Info=1]="Info",s[s.Success=2]="Success",s[s.Warning=3]="Warning"},671:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},142:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var n=Object.getOwnPropertyDescriptor(t,s);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,n)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),n=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(s(93),t),n(s(294),t),n(s(714),t),n(s(819),t),n(s(676),t),n(s(233),t),n(s(455),t),n(s(407),t),n(s(75),t),n(s(258),t),n(s(413),t),n(s(954),t),n(s(663),t),n(s(542),t),n(s(610),t),n(s(95),t),n(s(581),t),n(s(342),t),n(s(790),t),n(s(212),t),n(s(88),t),n(s(90),t),n(s(948),t),n(s(756),t),n(s(468),t),n(s(545),t),n(s(993),t),n(s(518),t),n(s(590),t),n(s(480),t),n(s(671),t)},220:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},606:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},57:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var n=Object.getOwnPropertyDescriptor(t,s);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,n)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),n=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(s(220),t),n(s(606),t)},983:function(e,t,s){var o=this&&this.__createBinding||(Object.create?function(e,t,s,o){void 0===o&&(o=s);var n=Object.getOwnPropertyDescriptor(t,s);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,o,n)}:function(e,t,s,o){void 0===o&&(o=s),e[o]=t[s]}),n=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||o(t,e,s)};Object.defineProperty(t,"__esModule",{value:!0}),n(s(903),t),n(s(142),t),n(s(57),t)}},t={},s=function s(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}};return e[o].call(a.exports,a,a.exports,s),a.exports}(789);window.BBSkyAddinClient=s})();