@everymatrix/casino-challenge-details 0.3.19 → 0.4.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.
@@ -21,7 +21,7 @@ function _interopNamespace(e) {
21
21
  }
22
22
 
23
23
  const NAMESPACE = 'casino-challenge-details';
24
- const BUILD = /* casino-challenge-details */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
24
+ const BUILD = /* casino-challenge-details */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
25
25
 
26
26
  /*
27
27
  Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
@@ -106,6 +106,22 @@ var plt = {
106
106
  rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
107
107
  ce: (eventName, opts) => new CustomEvent(eventName, opts)
108
108
  };
109
+ var supportsListenerOptions = /* @__PURE__ */ (() => {
110
+ let supportsListenerOptions2 = false;
111
+ try {
112
+ doc.addEventListener(
113
+ "e",
114
+ null,
115
+ Object.defineProperty({}, "passive", {
116
+ get() {
117
+ supportsListenerOptions2 = true;
118
+ }
119
+ })
120
+ );
121
+ } catch (e) {
122
+ }
123
+ return supportsListenerOptions2;
124
+ })();
109
125
  var promiseResolve = (v) => Promise.resolve(v);
110
126
  var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
111
127
  try {
@@ -761,6 +777,13 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
761
777
  }
762
778
  let maybePromise;
763
779
  if (isInitialLoad) {
780
+ {
781
+ hostRef.$flags$ |= 256 /* isListenReady */;
782
+ if (hostRef.$queuedListeners$) {
783
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
784
+ hostRef.$queuedListeners$ = void 0;
785
+ }
786
+ }
764
787
  {
765
788
  maybePromise = safeCall(instance, "componentWillLoad");
766
789
  }
@@ -1092,6 +1115,7 @@ var connectedCallback = (elm) => {
1092
1115
  initializeComponent(elm, hostRef, cmpMeta);
1093
1116
  }
1094
1117
  } else {
1118
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1095
1119
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1096
1120
  fireConnectedCallback(hostRef.$lazyInstance$);
1097
1121
  } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
@@ -1109,6 +1133,12 @@ var disconnectInstance = (instance) => {
1109
1133
  var disconnectedCallback = async (elm) => {
1110
1134
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1111
1135
  const hostRef = getHostRef(elm);
1136
+ {
1137
+ if (hostRef.$rmListeners$) {
1138
+ hostRef.$rmListeners$.map((rmListener) => rmListener());
1139
+ hostRef.$rmListeners$ = void 0;
1140
+ }
1141
+ }
1112
1142
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1113
1143
  disconnectInstance(hostRef.$lazyInstance$);
1114
1144
  } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
@@ -1148,6 +1178,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1148
1178
  {
1149
1179
  cmpMeta.$members$ = compactMeta[2];
1150
1180
  }
1181
+ {
1182
+ cmpMeta.$listeners$ = compactMeta[3];
1183
+ }
1151
1184
  {
1152
1185
  cmpMeta.$attrsToReflect$ = [];
1153
1186
  }
@@ -1179,9 +1212,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1179
1212
  }
1180
1213
  }
1181
1214
  connectedCallback() {
1182
- getHostRef(this);
1215
+ const hostRef = getHostRef(this);
1183
1216
  if (!this.hasRegisteredEventListeners) {
1184
1217
  this.hasRegisteredEventListeners = true;
1218
+ addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
1185
1219
  }
1186
1220
  if (appLoadFallback) {
1187
1221
  clearTimeout(appLoadFallback);
@@ -1236,6 +1270,39 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1236
1270
  }
1237
1271
  endBootstrap();
1238
1272
  };
1273
+ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
1274
+ if (listeners) {
1275
+ listeners.map(([flags, name, method]) => {
1276
+ const target = getHostListenerTarget(elm, flags) ;
1277
+ const handler = hostListenerProxy(hostRef, method);
1278
+ const opts = hostListenerOpts(flags);
1279
+ plt.ael(target, name, handler, opts);
1280
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
1281
+ });
1282
+ }
1283
+ };
1284
+ var hostListenerProxy = (hostRef, methodName) => (ev) => {
1285
+ var _a;
1286
+ try {
1287
+ {
1288
+ if (hostRef.$flags$ & 256 /* isListenReady */) {
1289
+ (_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
1290
+ } else {
1291
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
1292
+ }
1293
+ }
1294
+ } catch (e) {
1295
+ consoleError(e);
1296
+ }
1297
+ };
1298
+ var getHostListenerTarget = (elm, flags) => {
1299
+ if (flags & 8 /* TargetWindow */) return win;
1300
+ return elm;
1301
+ };
1302
+ var hostListenerOpts = (flags) => supportsListenerOptions ? {
1303
+ passive: (flags & 1 /* Passive */) !== 0,
1304
+ capture: (flags & 2 /* Capture */) !== 0
1305
+ } : (flags & 2 /* Capture */) !== 0;
1239
1306
 
1240
1307
  // src/runtime/nonce.ts
1241
1308
  var setNonce = (nonce) => plt.$nonce$ = nonce;
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const casinoChallengeDetails = require('./casino-challenge-details-d250a83a.js');
6
- require('./index-2a30d71d.js');
5
+ const casinoChallengeDetails = require('./casino-challenge-details-3c309aa3.js');
6
+ require('./index-1b30d7ac.js');
7
7
 
8
8
 
9
9
 
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-2a30d71d.js');
5
+ const index = require('./index-1b30d7ac.js');
6
6
  const appGlobals = require('./app-globals-3a1e7e63.js');
7
7
 
8
8
  const defineCustomElements = async (win, options) => {
9
9
  if (typeof window === 'undefined') return undefined;
10
10
  await appGlobals.globalScripts();
11
- return index.bootstrapLazy([["casino-challenge-details_4.cjs",[[1,"casino-challenge-details",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"endpoint":[513],"domain":[513],"session":[513],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"isUserAuthorized":[516,"is-user-authorized"],"challengeId":[513,"challenge-id"],"activeChallengeTabIndex":[513,"active-challenge-tab-index"],"userId":[513,"user-id"],"timeLeft":[32],"activeTabIndex":[32],"actionLoading":[32],"isMobile":[32],"error":[32],"hasError":[32],"games":[32],"gamesAreLoading":[32],"challenge":[32],"loading":[32],"isChallengePaused":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"challengeId":["handleCombinedChange"],"isUserAuthorized":["handleCombinedChange"],"session":["handleCombinedChange"],"challenge":["onEntityChange"]}],[1,"casino-challenge-expandable-paragraph",{"maxHeight":[2,"max-height"],"active":[4],"expanded":[32],"needsTruncation":[32],"isSmallScreen":[32]}],[1,"casino-challenge-level-progress-bar",{"height":[1],"active":[4],"value":[2]}],[1,"casino-challenge-progress-bar",{"challenge":[16],"isUserAuthorized":[4,"is-user-authorized"],"language":[1]}]]]], options);
11
+ return index.bootstrapLazy([["casino-challenge-details_4.cjs",[[1,"casino-challenge-details",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"endpoint":[513],"domain":[513],"session":[513],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"isUserAuthorized":[516,"is-user-authorized"],"challengeId":[513,"challenge-id"],"activeChallengeTabIndex":[513,"active-challenge-tab-index"],"userId":[513,"user-id"],"timeLeft":[32],"activeTabIndex":[32],"actionLoading":[32],"isMobile":[32],"error":[32],"hasError":[32],"games":[32],"gamesAreLoading":[32],"challenge":[32],"loading":[32],"isChallengePaused":[32]},[[8,"message","handleEvent"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"challengeId":["handleCombinedChange"],"isUserAuthorized":["handleCombinedChange"],"session":["handleCombinedChange"],"challenge":["onEntityChange"]}],[1,"casino-challenge-expandable-paragraph",{"maxHeight":[2,"max-height"],"active":[4],"expanded":[32],"needsTruncation":[32],"isSmallScreen":[32]}],[1,"casino-challenge-level-progress-bar",{"height":[1],"active":[4],"value":[2]}],[1,"casino-challenge-progress-bar",{"challenge":[16],"isUserAuthorized":[4,"is-user-authorized"],"language":[1]}]]]], options);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;
@@ -157,6 +157,29 @@ export class CasinoChallengeDetails {
157
157
  this.loading = false;
158
158
  this.isChallengePaused = false;
159
159
  }
160
+ handleEvent(e) {
161
+ const { data } = e === null || e === void 0 ? void 0 : e.data;
162
+ switch (data === null || data === void 0 ? void 0 : data.messageType) {
163
+ case 'disabledChallengeNotification': {
164
+ if (this.challenge.ChallengeId === (data === null || data === void 0 ? void 0 : data.challengeId)) {
165
+ this.challenge = Object.assign(Object.assign({}, this.challenge), { StatusName: 'Paused', ChallengeStatus: EChallengeStatus.Paused });
166
+ }
167
+ break;
168
+ }
169
+ case 'enabledChallengeNotification': {
170
+ if (this.challenge.ChallengeId === (data === null || data === void 0 ? void 0 : data.challengeId)) {
171
+ this.challenge = Object.assign(Object.assign({}, this.challenge), { StatusName: 'Enabled', ChallengeStatus: EChallengeStatus.Enabled });
172
+ }
173
+ break;
174
+ }
175
+ case 'forfeitedChallengeProgressNotification': {
176
+ if (this.challenge.Id === (data === null || data === void 0 ? void 0 : data.challengeProgressId)) {
177
+ this.challenge = Object.assign(Object.assign({}, this.challenge), { Status: EChallengeProgressStatus.Forfeited });
178
+ }
179
+ break;
180
+ }
181
+ }
182
+ }
160
183
  handleClientStylingChange(newValue, oldValue) {
161
184
  if (newValue != oldValue) {
162
185
  setClientStyling(this.stylingContainer, this.clientStyling);
@@ -494,7 +517,7 @@ export class CasinoChallengeDetails {
494
517
  return (((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.Status) === 4 && (h("div", { class: "notification" }, h("img", { class: "notification__icon", src: infoIcon }), h("span", { class: "notification__message" }, translate('expiredNotification', this.language)))));
495
518
  }
496
519
  render() {
497
- return (h("div", { key: '0ccce42fa6edb63817eb8dc8d5c6300bd53d2a8b', ref: (el) => (this.stylingContainer = el), class: "container" }, this.pageHeader, this.loading ? (h("div", { class: "lds-dual-ring" })) : (h("div", null, h("button", { class: "back-button", onClick: this.goBack }, h("img", { class: "back-button__icon", src: backIcon }), this.getBackButtonText()), this.forfeitedNofitication, this.completedNotification, this.expiredNotification, h("div", { class: "details" }, this.cardGeneralInfo, h("div", { class: "details__tabs-container" }, this.challengeTabs, this.activeTabIndex === 0 && this.levelsTab, this.activeTabIndex === 1 && this.gamesTab, this.activeTabIndex === 2 && this.rulesTab), this.footer)))));
520
+ return (h("div", { key: '466f802c75818cdd980fb0413dabb7c4d3c03ab2', ref: (el) => (this.stylingContainer = el), class: "container" }, this.pageHeader, this.loading ? (h("div", { class: "lds-dual-ring" })) : (h("div", null, h("button", { class: "back-button", onClick: this.goBack }, h("img", { class: "back-button__icon", src: backIcon }), this.getBackButtonText()), this.forfeitedNofitication, this.completedNotification, this.expiredNotification, h("div", { class: "details" }, this.cardGeneralInfo, h("div", { class: "details__tabs-container" }, this.challengeTabs, this.activeTabIndex === 0 && this.levelsTab, this.activeTabIndex === 1 && this.gamesTab, this.activeTabIndex === 2 && this.rulesTab), this.footer)))));
498
521
  }
499
522
  static get is() { return "casino-challenge-details"; }
500
523
  static get encapsulation() { return "shadow"; }
@@ -782,4 +805,13 @@ export class CasinoChallengeDetails {
782
805
  "methodName": "onEntityChange"
783
806
  }];
784
807
  }
808
+ static get listeners() {
809
+ return [{
810
+ "name": "message",
811
+ "method": "handleEvent",
812
+ "target": "window",
813
+ "capture": false,
814
+ "passive": false
815
+ }];
816
+ }
785
817
  }
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-30adf0cb.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-662208df.js';
2
2
 
3
3
  /**
4
4
  * @name setClientStyling
@@ -532,6 +532,29 @@ const CasinoChallengeDetails = class {
532
532
  this.loading = false;
533
533
  this.isChallengePaused = false;
534
534
  }
535
+ handleEvent(e) {
536
+ const { data } = e === null || e === void 0 ? void 0 : e.data;
537
+ switch (data === null || data === void 0 ? void 0 : data.messageType) {
538
+ case 'disabledChallengeNotification': {
539
+ if (this.challenge.ChallengeId === (data === null || data === void 0 ? void 0 : data.challengeId)) {
540
+ this.challenge = Object.assign(Object.assign({}, this.challenge), { StatusName: 'Paused', ChallengeStatus: EChallengeStatus.Paused });
541
+ }
542
+ break;
543
+ }
544
+ case 'enabledChallengeNotification': {
545
+ if (this.challenge.ChallengeId === (data === null || data === void 0 ? void 0 : data.challengeId)) {
546
+ this.challenge = Object.assign(Object.assign({}, this.challenge), { StatusName: 'Enabled', ChallengeStatus: EChallengeStatus.Enabled });
547
+ }
548
+ break;
549
+ }
550
+ case 'forfeitedChallengeProgressNotification': {
551
+ if (this.challenge.Id === (data === null || data === void 0 ? void 0 : data.challengeProgressId)) {
552
+ this.challenge = Object.assign(Object.assign({}, this.challenge), { Status: EChallengeProgressStatus.Forfeited });
553
+ }
554
+ break;
555
+ }
556
+ }
557
+ }
535
558
  handleClientStylingChange(newValue, oldValue) {
536
559
  if (newValue != oldValue) {
537
560
  setClientStyling(this.stylingContainer, this.clientStyling);
@@ -869,7 +892,7 @@ const CasinoChallengeDetails = class {
869
892
  return (((_a = this.challenge) === null || _a === void 0 ? void 0 : _a.Status) === 4 && (h("div", { class: "notification" }, h("img", { class: "notification__icon", src: infoCircleSvg }), h("span", { class: "notification__message" }, translate('expiredNotification', this.language)))));
870
893
  }
871
894
  render() {
872
- return (h("div", { key: '0ccce42fa6edb63817eb8dc8d5c6300bd53d2a8b', ref: (el) => (this.stylingContainer = el), class: "container" }, this.pageHeader, this.loading ? (h("div", { class: "lds-dual-ring" })) : (h("div", null, h("button", { class: "back-button", onClick: this.goBack }, h("img", { class: "back-button__icon", src: backArrowSvg }), this.getBackButtonText()), this.forfeitedNofitication, this.completedNotification, this.expiredNotification, h("div", { class: "details" }, this.cardGeneralInfo, h("div", { class: "details__tabs-container" }, this.challengeTabs, this.activeTabIndex === 0 && this.levelsTab, this.activeTabIndex === 1 && this.gamesTab, this.activeTabIndex === 2 && this.rulesTab), this.footer)))));
895
+ return (h("div", { key: '466f802c75818cdd980fb0413dabb7c4d3c03ab2', ref: (el) => (this.stylingContainer = el), class: "container" }, this.pageHeader, this.loading ? (h("div", { class: "lds-dual-ring" })) : (h("div", null, h("button", { class: "back-button", onClick: this.goBack }, h("img", { class: "back-button__icon", src: backArrowSvg }), this.getBackButtonText()), this.forfeitedNofitication, this.completedNotification, this.expiredNotification, h("div", { class: "details" }, this.cardGeneralInfo, h("div", { class: "details__tabs-container" }, this.challengeTabs, this.activeTabIndex === 0 && this.levelsTab, this.activeTabIndex === 1 && this.gamesTab, this.activeTabIndex === 2 && this.rulesTab), this.footer)))));
873
896
  }
874
897
  static get watchers() { return {
875
898
  "clientStyling": ["handleClientStylingChange"],
@@ -1,5 +1,5 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-30adf0cb.js';
2
- export { s as setNonce } from './index-30adf0cb.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-662208df.js';
2
+ export { s as setNonce } from './index-662208df.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  /*
@@ -16,5 +16,5 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["casino-challenge-details_4",[[1,"casino-challenge-details",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"endpoint":[513],"domain":[513],"session":[513],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"isUserAuthorized":[516,"is-user-authorized"],"challengeId":[513,"challenge-id"],"activeChallengeTabIndex":[513,"active-challenge-tab-index"],"userId":[513,"user-id"],"timeLeft":[32],"activeTabIndex":[32],"actionLoading":[32],"isMobile":[32],"error":[32],"hasError":[32],"games":[32],"gamesAreLoading":[32],"challenge":[32],"loading":[32],"isChallengePaused":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"challengeId":["handleCombinedChange"],"isUserAuthorized":["handleCombinedChange"],"session":["handleCombinedChange"],"challenge":["onEntityChange"]}],[1,"casino-challenge-expandable-paragraph",{"maxHeight":[2,"max-height"],"active":[4],"expanded":[32],"needsTruncation":[32],"isSmallScreen":[32]}],[1,"casino-challenge-level-progress-bar",{"height":[1],"active":[4],"value":[2]}],[1,"casino-challenge-progress-bar",{"challenge":[16],"isUserAuthorized":[4,"is-user-authorized"],"language":[1]}]]]], options);
19
+ return bootstrapLazy([["casino-challenge-details_4",[[1,"casino-challenge-details",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"endpoint":[513],"domain":[513],"session":[513],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"isUserAuthorized":[516,"is-user-authorized"],"challengeId":[513,"challenge-id"],"activeChallengeTabIndex":[513,"active-challenge-tab-index"],"userId":[513,"user-id"],"timeLeft":[32],"activeTabIndex":[32],"actionLoading":[32],"isMobile":[32],"error":[32],"hasError":[32],"games":[32],"gamesAreLoading":[32],"challenge":[32],"loading":[32],"isChallengePaused":[32]},[[8,"message","handleEvent"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"challengeId":["handleCombinedChange"],"isUserAuthorized":["handleCombinedChange"],"session":["handleCombinedChange"],"challenge":["onEntityChange"]}],[1,"casino-challenge-expandable-paragraph",{"maxHeight":[2,"max-height"],"active":[4],"expanded":[32],"needsTruncation":[32],"isSmallScreen":[32]}],[1,"casino-challenge-level-progress-bar",{"height":[1],"active":[4],"value":[2]}],[1,"casino-challenge-progress-bar",{"challenge":[16],"isUserAuthorized":[4,"is-user-authorized"],"language":[1]}]]]], options);
20
20
  });
@@ -1,6 +1,6 @@
1
- import { E as EChallengeProgressLevelStatus, a as EChallengeStatus, b as EChallengeProgressStatus, t as translate } from './casino-challenge-details-55a3a560.js';
2
- export { C as casino_challenge_details } from './casino-challenge-details-55a3a560.js';
3
- import { r as registerInstance, h, g as getElement, H as Host } from './index-30adf0cb.js';
1
+ import { E as EChallengeProgressLevelStatus, a as EChallengeStatus, b as EChallengeProgressStatus, t as translate } from './casino-challenge-details-6d8eeca9.js';
2
+ export { C as casino_challenge_details } from './casino-challenge-details-6d8eeca9.js';
3
+ import { r as registerInstance, h, g as getElement, H as Host } from './index-662208df.js';
4
4
 
5
5
  const activeChevronSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iOCIgdmlld0JveD0iMCAwIDEyIDgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMC40MTA4MjYgMC45MTEwN0MwLjczNjI2MyAwLjU4NTYzMyAxLjI2MzkgMC41ODU2MzMgMS41ODkzNCAwLjkxMTA3TDYuMDAwMDggNS4zMjE4MUwxMC40MTA4IDAuOTExMDdDMTAuNzM2MyAwLjU4NTYzMyAxMS4yNjM5IDAuNTg1NjMzIDExLjU4OTMgMC45MTEwN0MxMS45MTQ4IDEuMjM2NTEgMTEuOTE0OCAxLjc2NDE0IDExLjU4OTMgMi4wODk1OEw2LjU4OTM0IDcuMDg5NThDNi4yNjM5IDcuNDE1MDIgNS43MzYyNiA3LjQxNTAyIDUuNDEwODMgNy4wODk1OEwwLjQxMDgyNiAyLjA4OTU4QzAuMDg1Mzg4OCAxLjc2NDE0IDAuMDg1Mzg4OCAxLjIzNjUxIDAuNDEwODI2IDAuOTExMDdaIiBmaWxsPSIjMDBCNzRGIi8+Cjwvc3ZnPgo=';
6
6
 
@@ -1,5 +1,5 @@
1
1
  const NAMESPACE = 'casino-challenge-details';
2
- const BUILD = /* casino-challenge-details */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
2
+ const BUILD = /* casino-challenge-details */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
3
3
 
4
4
  /*
5
5
  Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
@@ -84,6 +84,22 @@ var plt = {
84
84
  rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
85
85
  ce: (eventName, opts) => new CustomEvent(eventName, opts)
86
86
  };
87
+ var supportsListenerOptions = /* @__PURE__ */ (() => {
88
+ let supportsListenerOptions2 = false;
89
+ try {
90
+ doc.addEventListener(
91
+ "e",
92
+ null,
93
+ Object.defineProperty({}, "passive", {
94
+ get() {
95
+ supportsListenerOptions2 = true;
96
+ }
97
+ })
98
+ );
99
+ } catch (e) {
100
+ }
101
+ return supportsListenerOptions2;
102
+ })();
87
103
  var promiseResolve = (v) => Promise.resolve(v);
88
104
  var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
89
105
  try {
@@ -739,6 +755,13 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
739
755
  }
740
756
  let maybePromise;
741
757
  if (isInitialLoad) {
758
+ {
759
+ hostRef.$flags$ |= 256 /* isListenReady */;
760
+ if (hostRef.$queuedListeners$) {
761
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
762
+ hostRef.$queuedListeners$ = void 0;
763
+ }
764
+ }
742
765
  {
743
766
  maybePromise = safeCall(instance, "componentWillLoad");
744
767
  }
@@ -1070,6 +1093,7 @@ var connectedCallback = (elm) => {
1070
1093
  initializeComponent(elm, hostRef, cmpMeta);
1071
1094
  }
1072
1095
  } else {
1096
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1073
1097
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1074
1098
  fireConnectedCallback(hostRef.$lazyInstance$);
1075
1099
  } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
@@ -1087,6 +1111,12 @@ var disconnectInstance = (instance) => {
1087
1111
  var disconnectedCallback = async (elm) => {
1088
1112
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1089
1113
  const hostRef = getHostRef(elm);
1114
+ {
1115
+ if (hostRef.$rmListeners$) {
1116
+ hostRef.$rmListeners$.map((rmListener) => rmListener());
1117
+ hostRef.$rmListeners$ = void 0;
1118
+ }
1119
+ }
1090
1120
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1091
1121
  disconnectInstance(hostRef.$lazyInstance$);
1092
1122
  } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
@@ -1126,6 +1156,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1126
1156
  {
1127
1157
  cmpMeta.$members$ = compactMeta[2];
1128
1158
  }
1159
+ {
1160
+ cmpMeta.$listeners$ = compactMeta[3];
1161
+ }
1129
1162
  {
1130
1163
  cmpMeta.$attrsToReflect$ = [];
1131
1164
  }
@@ -1157,9 +1190,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1157
1190
  }
1158
1191
  }
1159
1192
  connectedCallback() {
1160
- getHostRef(this);
1193
+ const hostRef = getHostRef(this);
1161
1194
  if (!this.hasRegisteredEventListeners) {
1162
1195
  this.hasRegisteredEventListeners = true;
1196
+ addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
1163
1197
  }
1164
1198
  if (appLoadFallback) {
1165
1199
  clearTimeout(appLoadFallback);
@@ -1214,6 +1248,39 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1214
1248
  }
1215
1249
  endBootstrap();
1216
1250
  };
1251
+ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
1252
+ if (listeners) {
1253
+ listeners.map(([flags, name, method]) => {
1254
+ const target = getHostListenerTarget(elm, flags) ;
1255
+ const handler = hostListenerProxy(hostRef, method);
1256
+ const opts = hostListenerOpts(flags);
1257
+ plt.ael(target, name, handler, opts);
1258
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
1259
+ });
1260
+ }
1261
+ };
1262
+ var hostListenerProxy = (hostRef, methodName) => (ev) => {
1263
+ var _a;
1264
+ try {
1265
+ {
1266
+ if (hostRef.$flags$ & 256 /* isListenReady */) {
1267
+ (_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
1268
+ } else {
1269
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
1270
+ }
1271
+ }
1272
+ } catch (e) {
1273
+ consoleError(e);
1274
+ }
1275
+ };
1276
+ var getHostListenerTarget = (elm, flags) => {
1277
+ if (flags & 8 /* TargetWindow */) return win;
1278
+ return elm;
1279
+ };
1280
+ var hostListenerOpts = (flags) => supportsListenerOptions ? {
1281
+ passive: (flags & 1 /* Passive */) !== 0,
1282
+ capture: (flags & 2 /* Capture */) !== 0
1283
+ } : (flags & 2 /* Capture */) !== 0;
1217
1284
 
1218
1285
  // src/runtime/nonce.ts
1219
1286
  var setNonce = (nonce) => plt.$nonce$ = nonce;
package/dist/esm/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { C as CasinoChallengeDetails } from './casino-challenge-details-55a3a560.js';
2
- import './index-30adf0cb.js';
1
+ export { C as CasinoChallengeDetails } from './casino-challenge-details-6d8eeca9.js';
2
+ import './index-662208df.js';
@@ -1,11 +1,11 @@
1
- import { b as bootstrapLazy } from './index-30adf0cb.js';
2
- export { s as setNonce } from './index-30adf0cb.js';
1
+ import { b as bootstrapLazy } from './index-662208df.js';
2
+ export { s as setNonce } from './index-662208df.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  const defineCustomElements = async (win, options) => {
6
6
  if (typeof window === 'undefined') return undefined;
7
7
  await globalScripts();
8
- return bootstrapLazy([["casino-challenge-details_4",[[1,"casino-challenge-details",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"endpoint":[513],"domain":[513],"session":[513],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"isUserAuthorized":[516,"is-user-authorized"],"challengeId":[513,"challenge-id"],"activeChallengeTabIndex":[513,"active-challenge-tab-index"],"userId":[513,"user-id"],"timeLeft":[32],"activeTabIndex":[32],"actionLoading":[32],"isMobile":[32],"error":[32],"hasError":[32],"games":[32],"gamesAreLoading":[32],"challenge":[32],"loading":[32],"isChallengePaused":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"challengeId":["handleCombinedChange"],"isUserAuthorized":["handleCombinedChange"],"session":["handleCombinedChange"],"challenge":["onEntityChange"]}],[1,"casino-challenge-expandable-paragraph",{"maxHeight":[2,"max-height"],"active":[4],"expanded":[32],"needsTruncation":[32],"isSmallScreen":[32]}],[1,"casino-challenge-level-progress-bar",{"height":[1],"active":[4],"value":[2]}],[1,"casino-challenge-progress-bar",{"challenge":[16],"isUserAuthorized":[4,"is-user-authorized"],"language":[1]}]]]], options);
8
+ return bootstrapLazy([["casino-challenge-details_4",[[1,"casino-challenge-details",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"endpoint":[513],"domain":[513],"session":[513],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"isUserAuthorized":[516,"is-user-authorized"],"challengeId":[513,"challenge-id"],"activeChallengeTabIndex":[513,"active-challenge-tab-index"],"userId":[513,"user-id"],"timeLeft":[32],"activeTabIndex":[32],"actionLoading":[32],"isMobile":[32],"error":[32],"hasError":[32],"games":[32],"gamesAreLoading":[32],"challenge":[32],"loading":[32],"isChallengePaused":[32]},[[8,"message","handleEvent"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"challengeId":["handleCombinedChange"],"isUserAuthorized":["handleCombinedChange"],"session":["handleCombinedChange"],"challenge":["onEntityChange"]}],[1,"casino-challenge-expandable-paragraph",{"maxHeight":[2,"max-height"],"active":[4],"expanded":[32],"needsTruncation":[32],"isSmallScreen":[32]}],[1,"casino-challenge-level-progress-bar",{"height":[1],"active":[4],"value":[2]}],[1,"casino-challenge-progress-bar",{"challenge":[16],"isUserAuthorized":[4,"is-user-authorized"],"language":[1]}]]]], options);
9
9
  };
10
10
 
11
11
  export { defineCustomElements };
@@ -70,6 +70,7 @@ export declare class CasinoChallengeDetails {
70
70
  private stylingSubscription;
71
71
  private timerId;
72
72
  private abortController;
73
+ handleEvent(e: any): void;
73
74
  handleClientStylingChange(newValue: any, oldValue: any): void;
74
75
  handleClientStylingUrlChange(newValue: any, oldValue: any): void;
75
76
  handleMbSourceChange(newValue: any, oldValue: any): void;
@@ -110,6 +110,7 @@ export interface ILevelProgress {
110
110
  }
111
111
  export interface IChallenge {
112
112
  Status: EChallengeProgressStatus;
113
+ StatusName: string;
113
114
  ChallengeStatus: EChallengeStatus;
114
115
  ChallengePresentation: IChallengePresentation;
115
116
  DomainId: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/casino-challenge-details",
3
- "version": "0.3.19",
3
+ "version": "0.4.0",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",