ngx-beacon-notify 1.0.0 → 1.1.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.
Files changed (71) hide show
  1. package/esm2022/lib/beacon/beacon.component.mjs +142 -0
  2. package/esm2022/lib/beacon-notify.module.mjs +58 -0
  3. package/esm2022/lib/beacon-notify.service.mjs +605 -0
  4. package/esm2022/lib/container/container.component.mjs +71 -0
  5. package/esm2022/lib/icons/beacon-icon-alert/beacon-icon-alert.component.mjs +11 -0
  6. package/esm2022/lib/icons/beacon-icon-error/beacon-icon-error.component.mjs +11 -0
  7. package/esm2022/lib/icons/beacon-icon-info/beacon-icon-info.component.mjs +11 -0
  8. package/esm2022/lib/icons/beacon-icon-success/beacon-icon-success.component.mjs +11 -0
  9. package/esm2022/lib/icons/beacon-icon-warning/beacon-icon-warning.component.mjs +11 -0
  10. package/esm2022/lib/index.mjs +3 -0
  11. package/esm2022/lib/pipes/beacon-type-resolve.pipe.mjs +39 -0
  12. package/esm2022/lib/types/constants/index.mjs +6 -0
  13. package/esm2022/lib/types/index.mjs +3 -0
  14. package/esm2022/lib/types/interfaces/index.mjs +2 -0
  15. package/esm2022/ngx-beacon-notify.mjs +5 -0
  16. package/esm2022/public-api.mjs +4 -0
  17. package/fesm2022/ngx-beacon-notify.mjs +941 -0
  18. package/fesm2022/ngx-beacon-notify.mjs.map +1 -0
  19. package/index.d.ts +5 -1
  20. package/lib/beacon/beacon.component.d.ts +22 -0
  21. package/lib/beacon-notify.module.d.ts +18 -0
  22. package/lib/beacon-notify.service.d.ts +103 -0
  23. package/lib/container/container.component.d.ts +18 -0
  24. package/lib/icons/beacon-icon-alert/beacon-icon-alert.component.d.ts +5 -0
  25. package/lib/icons/beacon-icon-error/beacon-icon-error.component.d.ts +5 -0
  26. package/lib/icons/beacon-icon-info/beacon-icon-info.component.d.ts +5 -0
  27. package/lib/icons/beacon-icon-success/beacon-icon-success.component.d.ts +5 -0
  28. package/lib/icons/beacon-icon-warning/beacon-icon-warning.component.d.ts +5 -0
  29. package/lib/index.d.ts +2 -0
  30. package/lib/pipes/beacon-type-resolve.pipe.d.ts +9 -0
  31. package/lib/types/constants/index.d.ts +6 -0
  32. package/lib/types/index.d.ts +2 -0
  33. package/lib/types/interfaces/index.d.ts +99 -0
  34. package/package.json +35 -6
  35. package/public-api.d.ts +3 -0
  36. package/beacon/beacon.component.css +0 -175
  37. package/beacon/beacon.component.html +0 -46
  38. package/beacon/beacon.component.spec.ts +0 -21
  39. package/beacon/beacon.component.ts +0 -142
  40. package/beacon-notify.module.ts +0 -43
  41. package/beacon-notify.service.ts +0 -634
  42. package/container/container.component.css +0 -10
  43. package/container/container.component.html +0 -3
  44. package/container/container.component.spec.ts +0 -21
  45. package/container/container.component.ts +0 -62
  46. package/icons/beacon-icon-alert/beacon-icon-alert.component.css +0 -6
  47. package/icons/beacon-icon-alert/beacon-icon-alert.component.html +0 -10
  48. package/icons/beacon-icon-alert/beacon-icon-alert.component.spec.ts +0 -21
  49. package/icons/beacon-icon-alert/beacon-icon-alert.component.ts +0 -10
  50. package/icons/beacon-icon-error/beacon-icon-error.component.css +0 -6
  51. package/icons/beacon-icon-error/beacon-icon-error.component.html +0 -13
  52. package/icons/beacon-icon-error/beacon-icon-error.component.spec.ts +0 -21
  53. package/icons/beacon-icon-error/beacon-icon-error.component.ts +0 -10
  54. package/icons/beacon-icon-info/beacon-icon-info.component.css +0 -6
  55. package/icons/beacon-icon-info/beacon-icon-info.component.html +0 -14
  56. package/icons/beacon-icon-info/beacon-icon-info.component.spec.ts +0 -21
  57. package/icons/beacon-icon-info/beacon-icon-info.component.ts +0 -10
  58. package/icons/beacon-icon-success/beacon-icon-success.component.css +0 -6
  59. package/icons/beacon-icon-success/beacon-icon-success.component.html +0 -13
  60. package/icons/beacon-icon-success/beacon-icon-success.component.spec.ts +0 -21
  61. package/icons/beacon-icon-success/beacon-icon-success.component.ts +0 -9
  62. package/icons/beacon-icon-warning/beacon-icon-warning.component.css +0 -6
  63. package/icons/beacon-icon-warning/beacon-icon-warning.component.html +0 -15
  64. package/icons/beacon-icon-warning/beacon-icon-warning.component.spec.ts +0 -21
  65. package/icons/beacon-icon-warning/beacon-icon-warning.component.ts +0 -10
  66. package/index.ts +0 -2
  67. package/pipes/beacon-type-resolve.pipe.spec.ts +0 -8
  68. package/pipes/beacon-type-resolve.pipe.ts +0 -33
  69. package/types/constants/index.ts +0 -8
  70. package/types/index.ts +0 -3
  71. package/types/interfaces/index.ts +0 -110
@@ -0,0 +1,941 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, EventEmitter, Injectable, Inject, Component, Pipe, Input, ViewChild, NgModule } from '@angular/core';
3
+ import * as i1 from '@angular/platform-browser';
4
+ import * as i3 from '@angular/common';
5
+ import { CommonModule } from '@angular/common';
6
+
7
+ const BEACON_GLOBAL_CONFIG = new InjectionToken('IBeaconGlobalConfig');
8
+ const BEACON_OVERLAY_COLOR = '#000000DD';
9
+ const BEACON_OVERLAY_ID = 'beacon-notify-focus-overlay_x';
10
+ const BEACON_TYPE_KEYS = ['a.a', 'a.e', 'a.i', 'a.s', 'a.w'];
11
+
12
+ class BeaconNotifyService {
13
+ sanitizer;
14
+ globalConfig;
15
+ beaconDefaultIconKeys = BEACON_TYPE_KEYS;
16
+ beaconConfigMap = {
17
+ alert: { icon: this.beaconDefaultIconKeys[0], fontIcon: 'false', class: 'beacon-message-alert', title: 'Alert', style: '', animation: '', type: 'alert' },
18
+ error: { icon: this.beaconDefaultIconKeys[1], fontIcon: 'false', class: 'beacon-message-error', title: 'Error', style: '', animation: '', type: 'error' },
19
+ info: { icon: this.beaconDefaultIconKeys[2], fontIcon: 'false', class: 'beacon-message-info', title: 'Information', style: '', animation: '', type: 'info' },
20
+ success: { icon: this.beaconDefaultIconKeys[3], fontIcon: 'false', class: 'beacon-message-success', title: 'Success', style: '', animation: '', type: 'success' },
21
+ warning: { icon: this.beaconDefaultIconKeys[4], fontIcon: 'false', class: 'beacon-message-warning', title: 'Warning', style: '', animation: '', type: 'warning' }
22
+ };
23
+ beaconTypeMap = {
24
+ a: 'success', b: 'error', c: 'warning', d: 'info', e: 'alert'
25
+ };
26
+ beaconTitle;
27
+ beaconMessage;
28
+ beaconIcon;
29
+ beaconManualId;
30
+ beaconSelectedManualId;
31
+ beaconIconFromFont;
32
+ beaconStatic;
33
+ beaconFixed;
34
+ beaconBlockOthers;
35
+ beaconPreventClickClose;
36
+ beaconAllowDuplicate;
37
+ beaconFocus;
38
+ beaconFocusShine;
39
+ beaconOverlayColor;
40
+ beaconStyleClass;
41
+ beaconReplacementClass;
42
+ beaconAnimationClass;
43
+ beaconNoHoverEffect;
44
+ beaconGlobalStatic;
45
+ beaconGlobalFixed;
46
+ beaconGlobalBlockOthers;
47
+ beaconGlobalPreventClickClose;
48
+ beaconGlobalDuplicate;
49
+ beaconGlobalNoHoverEffect;
50
+ beaconGlobalPositioning;
51
+ beaconGlobalFocusOverlayColor;
52
+ beaconContainer;
53
+ beaconDefaultAnimationClassName = 'beacon-message-control-animate';
54
+ beaconSuccessorBlockerAutoId;
55
+ beaconWithActiveFocusAutoId;
56
+ beaconButtons = {};
57
+ beaconFocusOrderLibrary = [];
58
+ beaconSubscribedEventLibrary = {};
59
+ beaconWatchedEventLibrary = new Map([]);
60
+ beaconWatchedEventTaskMaster = new EventEmitter();
61
+ beaconAllEventTaskMaster = new EventEmitter();
62
+ beaconFocusOverlayDOM;
63
+ beaconEventTaskMaster = new EventEmitter();
64
+ beaconLibrary = [];
65
+ beaconLibraryQueue = [];
66
+ constructor(sanitizer, globalConfig) {
67
+ this.sanitizer = sanitizer;
68
+ this.globalConfig = globalConfig;
69
+ this.globalConfig && this.resolveGlobalConfig(this.globalConfig);
70
+ // Resolve events
71
+ this.resolveBeaconEvents();
72
+ }
73
+ // Resolve global config
74
+ resolveGlobalConfig(globalConfig) {
75
+ if (globalConfig.static) {
76
+ if (typeof globalConfig.static == 'boolean') {
77
+ this.beaconGlobalFixed = undefined;
78
+ this.beaconGlobalStatic = true;
79
+ }
80
+ else
81
+ this.beaconGlobalStatic = globalConfig.static;
82
+ }
83
+ if (globalConfig.fixed) {
84
+ this.beaconGlobalStatic = undefined;
85
+ this.beaconGlobalFixed = true;
86
+ }
87
+ globalConfig.preventClickClose && (this.beaconGlobalPreventClickClose = globalConfig.preventClickClose);
88
+ globalConfig.blockOthers && (this.beaconGlobalBlockOthers = globalConfig.blockOthers);
89
+ globalConfig.overlayColor && (this.beaconGlobalFocusOverlayColor = globalConfig.overlayColor);
90
+ globalConfig.duplicate && (this.beaconGlobalDuplicate = globalConfig.duplicate);
91
+ globalConfig.icon && this.resolveGlobalIconConfig(globalConfig.icon);
92
+ globalConfig.styleClass && this.resolveGlobalPropertyConfig(globalConfig.styleClass, 'style');
93
+ globalConfig.replacementClass && this.resolveGlobalPropertyConfig(globalConfig.replacementClass, 'class');
94
+ globalConfig.animationClass && this.resolveGlobalPropertyConfig(globalConfig.animationClass, 'animation');
95
+ globalConfig.position && (this.beaconGlobalPositioning = globalConfig.position);
96
+ globalConfig.noHoverEffect && (this.beaconGlobalNoHoverEffect = globalConfig.noHoverEffect);
97
+ }
98
+ // Resolve global config / for property
99
+ resolveGlobalPropertyConfig(config, property) {
100
+ config.alert && (this.beaconConfigMap.alert[property] = config.alert);
101
+ config.error && (this.beaconConfigMap.error[property] = config.error);
102
+ config.info && (this.beaconConfigMap.info[property] = config.info);
103
+ config.success && (this.beaconConfigMap.success[property] = config.success);
104
+ config.warning && (this.beaconConfigMap.warning[property] = config.warning);
105
+ }
106
+ // Resolve global config / for icons
107
+ resolveGlobalIconConfig(config) {
108
+ config?.alert?.icon && (this.beaconConfigMap.alert.icon = config.alert.icon) && (this.beaconConfigMap.alert.fontIcon = String((config?.alert?.fontIcon || false)));
109
+ config?.error?.icon && (this.beaconConfigMap.error.icon = config.error.icon) && (this.beaconConfigMap.error.fontIcon = String((config?.error?.fontIcon || false)));
110
+ config?.info?.icon && (this.beaconConfigMap.info.icon = config.info.icon) && (this.beaconConfigMap.info.fontIcon = String((config.info.fontIcon || false)));
111
+ config?.success?.icon && (this.beaconConfigMap.success.icon = config.success.icon) && (this.beaconConfigMap.success.fontIcon = String((config.success.fontIcon || false)));
112
+ config?.warning?.icon && (this.beaconConfigMap.warning.icon = config.warning.icon) && (this.beaconConfigMap.warning.fontIcon = String((config.warning.fontIcon || false)));
113
+ }
114
+ // Resolve beacon events
115
+ resolveBeaconEvents() {
116
+ this.beaconEventTaskMaster.subscribe((message) => {
117
+ const id = String(message.id);
118
+ if (message.delete) {
119
+ this.resolvePossibleBlockedBeacons(id);
120
+ this.resolvePossibleQueuedFocus(id);
121
+ this.performEventTask(id, { on: false, off: true });
122
+ delete this.beaconSubscribedEventLibrary[id];
123
+ }
124
+ else if (message.mount) {
125
+ this.performEventTask(id, { on: true, off: false });
126
+ }
127
+ });
128
+ }
129
+ // Perform event task
130
+ performEventTask(id, eventObject) {
131
+ const stamp = this.beaconSubscribedEventLibrary[id];
132
+ const event = stamp.event;
133
+ const manualId = stamp?.manualId?.toString().replace(/undefined/, '');
134
+ event.emit(eventObject);
135
+ this.beaconAllEventTaskMaster.emit({ id: manualId || null, type: String(stamp.type), ...eventObject });
136
+ // Check if this manual id is watched
137
+ if (manualId && this.beaconWatchedEventLibrary.has(manualId)) {
138
+ this.beaconWatchedEventTaskMaster.emit({ id: manualId, type: String(stamp.type), ...eventObject });
139
+ // Check if beacon is off
140
+ if (eventObject.off)
141
+ this.beaconWatchedEventLibrary.delete(manualId);
142
+ }
143
+ }
144
+ // Resolve possible blocked beacons
145
+ resolvePossibleBlockedBeacons(id) {
146
+ // Check if this id is blocking others
147
+ if (id == this.beaconSuccessorBlockerAutoId) {
148
+ if (this.beaconLibraryQueue.length) {
149
+ const queueLength = this.beaconLibraryQueue.length;
150
+ // Loop through queue
151
+ for (let x = 0; x < queueLength; x++) {
152
+ const nextInLine = this.beaconLibraryQueue.shift();
153
+ // Add message to library
154
+ if (this.getBeaconGlobalPositionConfig?.topBottom == 'top')
155
+ this.beaconLibrary.unshift(nextInLine);
156
+ else
157
+ this.beaconLibrary.push(nextInLine);
158
+ // Check if set to block
159
+ if (nextInLine.blockOthers) {
160
+ this.beaconSuccessorBlockerAutoId = nextInLine.bid;
161
+ break;
162
+ }
163
+ }
164
+ // Check if no new beacon is set as blocker and unset previous value
165
+ if (id == this.beaconSuccessorBlockerAutoId)
166
+ this.beaconSuccessorBlockerAutoId = undefined;
167
+ }
168
+ else
169
+ this.beaconSuccessorBlockerAutoId = undefined;
170
+ }
171
+ }
172
+ // Resolve queued beacon focus
173
+ resolvePossibleQueuedFocus(id) {
174
+ // Check if this id is active focus beacon
175
+ if (id == this.beaconWithActiveFocusAutoId) {
176
+ if (this.beaconFocusOrderLibrary.length) {
177
+ // Pass the next focus
178
+ this.beaconWithActiveFocusAutoId = this.beaconFocusOrderLibrary.shift();
179
+ this.beaconEventTaskMaster.emit({ autoDetectNextFocusBeacon: true });
180
+ }
181
+ else {
182
+ this.beaconWithActiveFocusAutoId = undefined;
183
+ this.destroyBeaconFocusOverlay();
184
+ }
185
+ }
186
+ }
187
+ // Generate unique id for item
188
+ get getId() {
189
+ return crypto.getRandomValues(new Uint32Array(2)).toString().split(',').join('');
190
+ }
191
+ // Set beacon container
192
+ setBeaconContainer(container) {
193
+ this.beaconContainer = container;
194
+ }
195
+ // Get beacon container
196
+ get getBeaconContainer() {
197
+ return this.beaconContainer;
198
+ }
199
+ // Get beacon global position config
200
+ get getBeaconGlobalPositionConfig() {
201
+ return this.beaconGlobalPositioning;
202
+ }
203
+ // Get default icon keys
204
+ get getBeaconDefaultIconKeys() {
205
+ return this.beaconDefaultIconKeys;
206
+ }
207
+ // Get active focus beacon id
208
+ get getActiveFocusBeaconId() {
209
+ return this.beaconWithActiveFocusAutoId;
210
+ }
211
+ // Create overlay for focused beacon
212
+ createBeaconFocusOverlay(overlayColor) {
213
+ const overlay = document.createElement('div');
214
+ overlay.setAttribute('id', BEACON_OVERLAY_ID);
215
+ overlay.style.position = 'fixed';
216
+ overlay.style.top = '0';
217
+ overlay.style.bottom = '0';
218
+ overlay.style.right = '0';
219
+ overlay.style.left = '0';
220
+ overlay.style.zIndex = '9002';
221
+ overlay.style.background = overlayColor || this.beaconGlobalFocusOverlayColor || BEACON_OVERLAY_COLOR;
222
+ document.body.style.overflow = 'hidden';
223
+ // Pass overlay element
224
+ this.beaconFocusOverlayDOM = overlay;
225
+ this.beaconContainer.nativeElement.appendChild(overlay);
226
+ }
227
+ // Repaint overlay for focused beacon
228
+ repaintBeaconFocusOverlay(overlayColor) {
229
+ if (this.beaconFocusOverlayDOM)
230
+ this.beaconFocusOverlayDOM.style.background = overlayColor || this.beaconGlobalFocusOverlayColor || BEACON_OVERLAY_COLOR;
231
+ }
232
+ // Destroy overlay for focused beacon
233
+ destroyBeaconFocusOverlay() {
234
+ document.body.style.overflow = 'auto';
235
+ this.beaconContainer.nativeElement.querySelector('div#' + BEACON_OVERLAY_ID).remove();
236
+ this.beaconFocusOverlayDOM = undefined;
237
+ }
238
+ // Set id for beacon
239
+ id(id) {
240
+ id && (this.beaconManualId = id);
241
+ return this;
242
+ }
243
+ // Set notification title
244
+ title(title) {
245
+ title && (this.beaconTitle = title);
246
+ return this;
247
+ }
248
+ // Set notification message
249
+ message(message) {
250
+ message && (this.beaconMessage = message);
251
+ return this;
252
+ }
253
+ // Highlight id of beacon to update
254
+ select(id) {
255
+ id && (this.beaconSelectedManualId = id);
256
+ return this;
257
+ }
258
+ // Change notification title
259
+ setTitle(title) {
260
+ // Check for active manual id / and if a beacon is tied to it
261
+ if (this.beaconSelectedManualId) {
262
+ const beaconIndex = this.beaconLibrary.findIndex(x => x.mid == this.beaconSelectedManualId);
263
+ if (beaconIndex >= 0)
264
+ this.beaconLibrary[beaconIndex].title = title;
265
+ }
266
+ }
267
+ // Change notification message
268
+ setMessage(message) {
269
+ // Check for active manual id / and if a beacon is tied to it
270
+ if (this.beaconSelectedManualId) {
271
+ const beaconIndex = this.beaconLibrary.findIndex(x => x.mid == this.beaconSelectedManualId);
272
+ if (beaconIndex >= 0)
273
+ this.beaconLibrary[beaconIndex].body = message;
274
+ }
275
+ }
276
+ // Change notification title & message
277
+ setContent(title, message) {
278
+ // Check for active manual id / and if a beacon is tied to it
279
+ if (this.beaconSelectedManualId) {
280
+ const beaconIndex = this.beaconLibrary.findIndex(x => x.mid == this.beaconSelectedManualId);
281
+ if (beaconIndex >= 0)
282
+ this.beaconLibrary[beaconIndex].title = title;
283
+ this.beaconLibrary[beaconIndex].body = message;
284
+ }
285
+ }
286
+ // Update beacon button 1
287
+ setButtonOne(text, canDismiss, callback, callbackArgs, position) {
288
+ // Check for active manual id / and if a beacon is tied to it
289
+ if (this.beaconSelectedManualId) {
290
+ const beaconIndex = this.beaconLibrary.findIndex(x => x.mid == this.beaconSelectedManualId);
291
+ if (beaconIndex >= 0) {
292
+ this.beaconLibrary[beaconIndex].buttons.one = {
293
+ text: text.substring(0, 15),
294
+ canDismiss,
295
+ callback,
296
+ callbackArgs,
297
+ position
298
+ };
299
+ }
300
+ }
301
+ }
302
+ // Update beacon button 2
303
+ setButtonTwo(text, canDismiss, callback, callbackArgs, position) {
304
+ // Check for active manual id / and if a beacon is tied to it
305
+ if (this.beaconSelectedManualId) {
306
+ const beaconIndex = this.beaconLibrary.findIndex(x => x.mid == this.beaconSelectedManualId);
307
+ if (beaconIndex >= 0) {
308
+ if (this.beaconLibrary[beaconIndex].buttons?.one) {
309
+ this.beaconLibrary[beaconIndex].buttons.two = {
310
+ text: text.substring(0, 15),
311
+ canDismiss,
312
+ callback,
313
+ callbackArgs,
314
+ position
315
+ };
316
+ }
317
+ else
318
+ this.setButtonOne(text, canDismiss, callback, callbackArgs, position);
319
+ }
320
+ }
321
+ }
322
+ // Remove beacon button 1
323
+ removeButtonOne() {
324
+ // Check for active manual id / and if a beacon is tied to it
325
+ if (this.beaconSelectedManualId) {
326
+ const beaconIndex = this.beaconLibrary.findIndex(x => x.mid == this.beaconSelectedManualId);
327
+ if (beaconIndex >= 0) {
328
+ this.beaconLibrary[beaconIndex].buttons.one = undefined;
329
+ }
330
+ }
331
+ }
332
+ // Remove beacon button 2
333
+ removeButtonTwo() {
334
+ // Check for active manual id / and if a beacon is tied to it
335
+ if (this.beaconSelectedManualId) {
336
+ const beaconIndex = this.beaconLibrary.findIndex(x => x.mid == this.beaconSelectedManualId);
337
+ if (beaconIndex >= 0) {
338
+ this.beaconLibrary[beaconIndex].buttons.two = undefined;
339
+ }
340
+ }
341
+ }
342
+ // Remove beacon buttons
343
+ removeButtons() {
344
+ // Check for active manual id / and if a beacon is tied to it
345
+ if (this.beaconSelectedManualId) {
346
+ const beaconIndex = this.beaconLibrary.findIndex(x => x.mid == this.beaconSelectedManualId);
347
+ if (beaconIndex >= 0) {
348
+ this.beaconLibrary[beaconIndex].buttons.one = undefined;
349
+ this.beaconLibrary[beaconIndex].buttons.two = undefined;
350
+ }
351
+ }
352
+ }
353
+ // Set beacon as static or with delay
354
+ static(delay) {
355
+ this.beaconStatic = delay || true;
356
+ this.beaconFixed = undefined;
357
+ return this;
358
+ }
359
+ // Set beacon as fixed which removes the close button and disallows close on click
360
+ fixed() {
361
+ this.beaconStatic = undefined;
362
+ this.beaconFixed = true;
363
+ return this;
364
+ }
365
+ // Allow beacon to block others
366
+ block() {
367
+ this.beaconBlockOthers = true;
368
+ return this;
369
+ }
370
+ // Focus on beacon
371
+ focus(overlayColor) {
372
+ overlayColor && (this.beaconOverlayColor = overlayColor);
373
+ this.beaconFocus = true;
374
+ return this;
375
+ }
376
+ // Focus beacon on center screen
377
+ shine(overlayColor) {
378
+ overlayColor && (this.beaconOverlayColor = overlayColor);
379
+ this.beaconFocusShine = this.beaconFocus = true;
380
+ return this;
381
+ }
382
+ // Add button for beacon
383
+ button(text, canDismiss, callback, callbackArgs, position) {
384
+ if (!this.beaconButtons?.one) {
385
+ this.beaconButtons.one = {
386
+ text: text.substring(0, 15),
387
+ canDismiss,
388
+ callback,
389
+ callbackArgs,
390
+ position
391
+ };
392
+ }
393
+ else if (this.beaconButtons.one && !this.beaconButtons.two) {
394
+ this.beaconButtons.two = {
395
+ text: text.substring(0, 15),
396
+ canDismiss,
397
+ callback,
398
+ callbackArgs,
399
+ position
400
+ };
401
+ }
402
+ return this;
403
+ }
404
+ // Allow duplicate for beacon
405
+ duplicate() {
406
+ this.beaconAllowDuplicate = true;
407
+ return this;
408
+ }
409
+ // Set config values for beacon
410
+ build(config) {
411
+ if (config.static) {
412
+ if (typeof config.static == 'boolean')
413
+ this.static();
414
+ else
415
+ this.static(Number(config.static));
416
+ }
417
+ config.fixed && this.fixed();
418
+ config.duplicate && this.duplicate();
419
+ config.preventClickClose && (this.beaconPreventClickClose = config.preventClickClose);
420
+ config.blockOthers && (this.beaconBlockOthers = config.blockOthers);
421
+ config.focus && (this.beaconFocus = config.focus);
422
+ config.shine && (this.beaconFocusShine = this.beaconFocus = config.shine);
423
+ config.icon && (this.beaconIcon = config.icon);
424
+ config.fontIcon && (this.beaconIconFromFont = config.fontIcon);
425
+ config.styleClass && (this.beaconStyleClass = config.styleClass);
426
+ config.replacementClass && (this.beaconReplacementClass = config.replacementClass);
427
+ config.animationClass && (this.beaconAnimationClass = config.animationClass);
428
+ config.animationClass && (this.beaconAnimationClass = config.animationClass);
429
+ config.overlayColor && (this.beaconOverlayColor = config.overlayColor);
430
+ config.noHoverEffect && (this.beaconNoHoverEffect = config.noHoverEffect);
431
+ return this;
432
+ }
433
+ // create notification beacon
434
+ beacon(message, type) {
435
+ // Get signature
436
+ const signature = window.btoa((this.beaconTitle || this.beaconConfigMap[type].title) + '.' + message);
437
+ // Generate beacon id
438
+ const beaconId = this.getId;
439
+ // Register beacon in event library
440
+ this.beaconSubscribedEventLibrary[beaconId] = Object.create({});
441
+ // Check for duplicate if set to prevent or proceed if turned off
442
+ if (this.beaconAllowDuplicate || (([undefined, false].includes(this.beaconGlobalDuplicate) && this.isNewBeaconADuplicate(signature) == !1) || this.beaconGlobalDuplicate)) {
443
+ const beaconObject = {
444
+ bid: beaconId,
445
+ mid: this.beaconManualId,
446
+ type: this.beaconConfigMap[type].class,
447
+ icon: this.beaconIcon || this.beaconConfigMap[type].icon,
448
+ fontIcon: this.beaconIconFromFont || (this.beaconConfigMap[type].fontIcon == 'true' ? true : undefined),
449
+ title: this.beaconTitle || this.beaconConfigMap[type].title,
450
+ static: this.beaconStatic || this.beaconGlobalStatic,
451
+ fixed: this.beaconFixed || this.beaconGlobalFixed,
452
+ preventClickClose: this.beaconPreventClickClose || this.beaconGlobalPreventClickClose,
453
+ styleClass: this.beaconStyleClass || this.beaconConfigMap[type].style,
454
+ replacementClass: this.beaconReplacementClass,
455
+ animationClass: this.beaconAnimationClass || this.beaconConfigMap[type].animation || this.beaconDefaultAnimationClassName,
456
+ blockOthers: this.beaconBlockOthers || this.beaconGlobalBlockOthers,
457
+ buttons: this.beaconButtons,
458
+ overlayColor: this.beaconOverlayColor,
459
+ bodyHtml: this.sanitizer.bypassSecurityTrustHtml(message),
460
+ body: message,
461
+ focus: this.beaconFocus,
462
+ shine: this.beaconFocusShine,
463
+ noHoverEffect: this.beaconNoHoverEffect || this.beaconGlobalNoHoverEffect,
464
+ signature
465
+ };
466
+ // Sanitize icon if passed
467
+ if (!beaconObject.fontIcon && beaconObject.icon && !this.beaconDefaultIconKeys.includes(beaconObject.icon)) {
468
+ beaconObject.svgIcon = this.sanitizer.bypassSecurityTrustHtml(beaconObject.icon);
469
+ }
470
+ // Check if there is an active beacon blocking others and add build beacon to queue
471
+ if (this.beaconSuccessorBlockerAutoId) {
472
+ this.beaconLibraryQueue.push(beaconObject);
473
+ }
474
+ else {
475
+ // Check if beacon can block and register id
476
+ if (beaconObject.blockOthers)
477
+ this.beaconSuccessorBlockerAutoId = beaconObject.bid;
478
+ // Add message to library
479
+ if (this.getBeaconGlobalPositionConfig?.topBottom == 'top')
480
+ this.beaconLibrary.unshift(beaconObject);
481
+ else
482
+ this.beaconLibrary.push(beaconObject);
483
+ }
484
+ // Check if beacon has focus
485
+ if (this.beaconFocus) {
486
+ if (this.beaconWithActiveFocusAutoId)
487
+ this.beaconFocusOrderLibrary.push(beaconObject.bid);
488
+ else
489
+ this.beaconWithActiveFocusAutoId = beaconObject.bid;
490
+ }
491
+ // Check if id is set and register it
492
+ if (this.beaconManualId) {
493
+ this.beaconSubscribedEventLibrary[beaconId].manualId = this.beaconManualId;
494
+ // Map the defined id to the auto-gen id
495
+ this.beaconWatchedEventLibrary.set(this.beaconManualId, beaconId);
496
+ }
497
+ // Register beacon type
498
+ this.beaconSubscribedEventLibrary[beaconId].type = this.beaconConfigMap[type].type;
499
+ }
500
+ // Register event for beacon
501
+ this.beaconSubscribedEventLibrary[beaconId].event = new EventEmitter();
502
+ // Reset
503
+ this.beaconTitle = undefined;
504
+ this.beaconMessage = undefined;
505
+ this.beaconStatic = undefined;
506
+ this.beaconFixed = undefined;
507
+ this.beaconBlockOthers = undefined;
508
+ this.beaconManualId = undefined;
509
+ this.beaconFocus = undefined;
510
+ this.beaconFocusShine = undefined;
511
+ this.beaconOverlayColor = undefined;
512
+ this.beaconAllowDuplicate = undefined;
513
+ this.beaconNoHoverEffect = undefined;
514
+ this.beaconIcon = undefined;
515
+ this.beaconIconFromFont = undefined;
516
+ this.beaconStyleClass = undefined;
517
+ this.beaconReplacementClass = undefined;
518
+ this.beaconAnimationClass = undefined;
519
+ this.beaconButtons = {};
520
+ return this.beaconSubscribedEventLibrary[beaconId].event;
521
+ }
522
+ // Set notification message / success
523
+ success(...message) {
524
+ // Set title
525
+ (message.length > 1) && message[0] && this.title(message[0]);
526
+ // Set body
527
+ return this.beacon(message[1] || message[0] || this.beaconMessage || this.beaconConfigMap.success.title, this.beaconTypeMap.a);
528
+ }
529
+ // Set notification message / error
530
+ error(...message) {
531
+ // Set title
532
+ (message.length > 1) && message[0] && this.title(message[0]);
533
+ // Set body
534
+ return this.beacon(message[1] || message[0] || this.beaconMessage || this.beaconConfigMap.error.title, this.beaconTypeMap.b);
535
+ }
536
+ // Set notification message / warning
537
+ warning(...message) {
538
+ // Set title
539
+ (message.length > 1) && message[0] && this.title(message[0]);
540
+ // Set body
541
+ return this.beacon(message[1] || message[0] || this.beaconMessage || this.beaconConfigMap.warning.title, this.beaconTypeMap.c);
542
+ }
543
+ // Set notification message / info
544
+ info(...message) {
545
+ // Set title
546
+ (message.length > 1) && message[0] && this.title(message[0]);
547
+ // Set body
548
+ return this.beacon(message[1] || message[0] || this.beaconMessage || this.beaconConfigMap.info.title, this.beaconTypeMap.d);
549
+ }
550
+ // Set notification message / alert
551
+ alert(...message) {
552
+ // Set title
553
+ (message.length > 1) && message[0] && this.title(message[0]);
554
+ // Set body
555
+ return this.beacon(message[1] || message[0] || this.beaconMessage || this.beaconConfigMap.alert.title, this.beaconTypeMap.e);
556
+ }
557
+ // Watch events for beacon with specified id
558
+ watch(id) {
559
+ // Register watched id
560
+ if (Array.isArray(id))
561
+ id.forEach(k => this.beaconWatchedEventLibrary.set(k, String()));
562
+ else
563
+ this.beaconWatchedEventLibrary.set(id, String());
564
+ return this.beaconWatchedEventTaskMaster;
565
+ }
566
+ // Watch events for all beacons
567
+ events() {
568
+ return this.beaconAllEventTaskMaster;
569
+ }
570
+ // Close beacon with id
571
+ closeOne(id) {
572
+ if (this.beaconWatchedEventLibrary.has(id)) {
573
+ const autoId = this.beaconWatchedEventLibrary.get(id);
574
+ // Remove the beacon
575
+ this.beaconLibrary = this.beaconLibrary.filter(x => {
576
+ return (x.bid != autoId);
577
+ });
578
+ this.beaconEventTaskMaster.emit({
579
+ delete: true,
580
+ id: autoId
581
+ });
582
+ }
583
+ }
584
+ // Close all beacons
585
+ closeAll() {
586
+ this.beaconLibrary = this.beaconLibrary.filter(x => {
587
+ this.beaconEventTaskMaster.emit({
588
+ delete: true,
589
+ id: x.bid
590
+ });
591
+ return !(x.bid);
592
+ });
593
+ }
594
+ // Check for possible duplicate
595
+ isNewBeaconADuplicate(signature) {
596
+ const duplicate = this.beaconLibrary.find(x => x.signature == signature);
597
+ const beacon = this.beaconContainer.nativeElement.querySelector(`div#bc_${duplicate?.bid}`);
598
+ return Boolean(beacon && window.getComputedStyle(beacon).opacity == '1');
599
+ }
600
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconNotifyService, deps: [{ token: i1.DomSanitizer }, { token: BEACON_GLOBAL_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable });
601
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconNotifyService, providedIn: 'root' });
602
+ }
603
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconNotifyService, decorators: [{
604
+ type: Injectable,
605
+ args: [{
606
+ providedIn: 'root'
607
+ }]
608
+ }], ctorParameters: () => [{ type: i1.DomSanitizer }, { type: undefined, decorators: [{
609
+ type: Inject,
610
+ args: [BEACON_GLOBAL_CONFIG]
611
+ }] }] });
612
+
613
+ class BeaconIconAlertComponent {
614
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconIconAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
615
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: BeaconIconAlertComponent, selector: "app-beacon-icon-alert", ngImport: i0, template: "<svg fill=\"currentColor\" viewBox=\"0 0 48 48\" data-name=\"Layer 1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\">\n <g id=\"SVGRepo_bgCarrier\" stroke-width=\"0\"></g>\n <g id=\"SVGRepo_tracerCarrier\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></g>\n <g id=\"SVGRepo_iconCarrier\">\n <title></title>\n <path\n d=\"M40.62,28.34l-.87-.7A2,2,0,0,1,39,26.08V18A15,15,0,0,0,26.91,3.29a3,3,0,0,0-5.81,0A15,15,0,0,0,9,18v8.08a2,2,0,0,1-.75,1.56l-.87.7a9,9,0,0,0-3.38,7V37a4,4,0,0,0,4,4h8.26a8,8,0,0,0,15.47,0H40a4,4,0,0,0,4-4V35.36A9,9,0,0,0,40.62,28.34ZM24,43a4,4,0,0,1-3.44-2h6.89A4,4,0,0,1,24,43Zm16-6H8V35.36a5,5,0,0,1,1.88-3.9l.87-.7A6,6,0,0,0,13,26.08V18a11,11,0,0,1,22,0v8.08a6,6,0,0,0,2.25,4.69l.87.7A5,5,0,0,1,40,35.36Z\"\n ></path>\n </g>\n</svg>\n", styles: ["svg{width:20px!important;height:20px!important;margin-right:7px!important;margin-top:-2px}\n"] });
616
+ }
617
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconIconAlertComponent, decorators: [{
618
+ type: Component,
619
+ args: [{ selector: 'app-beacon-icon-alert', template: "<svg fill=\"currentColor\" viewBox=\"0 0 48 48\" data-name=\"Layer 1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\">\n <g id=\"SVGRepo_bgCarrier\" stroke-width=\"0\"></g>\n <g id=\"SVGRepo_tracerCarrier\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></g>\n <g id=\"SVGRepo_iconCarrier\">\n <title></title>\n <path\n d=\"M40.62,28.34l-.87-.7A2,2,0,0,1,39,26.08V18A15,15,0,0,0,26.91,3.29a3,3,0,0,0-5.81,0A15,15,0,0,0,9,18v8.08a2,2,0,0,1-.75,1.56l-.87.7a9,9,0,0,0-3.38,7V37a4,4,0,0,0,4,4h8.26a8,8,0,0,0,15.47,0H40a4,4,0,0,0,4-4V35.36A9,9,0,0,0,40.62,28.34ZM24,43a4,4,0,0,1-3.44-2h6.89A4,4,0,0,1,24,43Zm16-6H8V35.36a5,5,0,0,1,1.88-3.9l.87-.7A6,6,0,0,0,13,26.08V18a11,11,0,0,1,22,0v8.08a6,6,0,0,0,2.25,4.69l.87.7A5,5,0,0,1,40,35.36Z\"\n ></path>\n </g>\n</svg>\n", styles: ["svg{width:20px!important;height:20px!important;margin-right:7px!important;margin-top:-2px}\n"] }]
620
+ }] });
621
+
622
+ class BeaconIconErrorComponent {
623
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconIconErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
624
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: BeaconIconErrorComponent, selector: "app-beacon-icon-error", ngImport: i0, template: "<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g id=\"SVGRepo_bgCarrier\" stroke-width=\"0\"></g>\n <g id=\"SVGRepo_tracerCarrier\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></g>\n <g id=\"SVGRepo_iconCarrier\">\n <path\n d=\"M11.3586 20.6831C11.5639 20.7901 11.6666 20.8436 11.809 20.8713C11.92 20.8929 12.08 20.8929 12.191 20.8713C12.3334 20.8436 12.4361 20.7901 12.6414 20.6831C14.54 19.6939 20 16.4612 20 12.0001V8.21772C20 7.4182 20 7.01845 19.8692 6.67482C19.7537 6.37126 19.566 6.10039 19.3223 5.88564C19.0465 5.64255 18.6722 5.50219 17.9236 5.22146L12.5618 3.21079C12.3539 3.13283 12.25 3.09385 12.143 3.07839C12.0482 3.06469 11.9518 3.06469 11.857 3.07839C11.75 3.09385 11.6461 3.13283 11.4382 3.21079L6.0764 5.22146C5.3278 5.50219 4.9535 5.64255 4.67766 5.88564C4.43398 6.10039 4.24627 6.37126 4.13076 6.67482C4 7.01845 4 7.4182 4 8.21772V12.0001C4 16.4612 9.45996 19.6939 11.3586 20.6831Z\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n </g>\n</svg>\n", styles: ["svg{width:22px!important;height:22px!important;margin-right:7px!important;margin-top:-2px}\n"] });
625
+ }
626
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconIconErrorComponent, decorators: [{
627
+ type: Component,
628
+ args: [{ selector: 'app-beacon-icon-error', template: "<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g id=\"SVGRepo_bgCarrier\" stroke-width=\"0\"></g>\n <g id=\"SVGRepo_tracerCarrier\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></g>\n <g id=\"SVGRepo_iconCarrier\">\n <path\n d=\"M11.3586 20.6831C11.5639 20.7901 11.6666 20.8436 11.809 20.8713C11.92 20.8929 12.08 20.8929 12.191 20.8713C12.3334 20.8436 12.4361 20.7901 12.6414 20.6831C14.54 19.6939 20 16.4612 20 12.0001V8.21772C20 7.4182 20 7.01845 19.8692 6.67482C19.7537 6.37126 19.566 6.10039 19.3223 5.88564C19.0465 5.64255 18.6722 5.50219 17.9236 5.22146L12.5618 3.21079C12.3539 3.13283 12.25 3.09385 12.143 3.07839C12.0482 3.06469 11.9518 3.06469 11.857 3.07839C11.75 3.09385 11.6461 3.13283 11.4382 3.21079L6.0764 5.22146C5.3278 5.50219 4.9535 5.64255 4.67766 5.88564C4.43398 6.10039 4.24627 6.37126 4.13076 6.67482C4 7.01845 4 7.4182 4 8.21772V12.0001C4 16.4612 9.45996 19.6939 11.3586 20.6831Z\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n </g>\n</svg>\n", styles: ["svg{width:22px!important;height:22px!important;margin-right:7px!important;margin-top:-2px}\n"] }]
629
+ }] });
630
+
631
+ class BeaconIconInfoComponent {
632
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconIconInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
633
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: BeaconIconInfoComponent, selector: "app-beacon-icon-info", ngImport: i0, template: "<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g id=\"SVGRepo_bgCarrier\" stroke-width=\"0\"></g>\n <g id=\"SVGRepo_tracerCarrier\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></g>\n <g id=\"SVGRepo_iconCarrier\">\n <path\n d=\"M10 22H14M5 9C5 5.13401 8.13401 2 12 2C15.866 2 19 5.13401 19 9C19 11.3787 17.8135 13.4694 16 14.7344L15.4582 17.3004C15.3097 18.2778 14.4695 19 13.4809 19H10.5191C9.53052 19 8.69027 18.2778 8.54177 17.3004L8 14.7453C6.18652 13.4804 5 11.3787 5 9Z\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n <path d=\"M8 15H16\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </g>\n</svg>\n", styles: ["svg{width:22px!important;height:22px!important;margin-right:7px!important;margin-top:-2px}\n"] });
634
+ }
635
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconIconInfoComponent, decorators: [{
636
+ type: Component,
637
+ args: [{ selector: 'app-beacon-icon-info', template: "<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g id=\"SVGRepo_bgCarrier\" stroke-width=\"0\"></g>\n <g id=\"SVGRepo_tracerCarrier\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></g>\n <g id=\"SVGRepo_iconCarrier\">\n <path\n d=\"M10 22H14M5 9C5 5.13401 8.13401 2 12 2C15.866 2 19 5.13401 19 9C19 11.3787 17.8135 13.4694 16 14.7344L15.4582 17.3004C15.3097 18.2778 14.4695 19 13.4809 19H10.5191C9.53052 19 8.69027 18.2778 8.54177 17.3004L8 14.7453C6.18652 13.4804 5 11.3787 5 9Z\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n <path d=\"M8 15H16\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </g>\n</svg>\n", styles: ["svg{width:22px!important;height:22px!important;margin-right:7px!important;margin-top:-2px}\n"] }]
638
+ }] });
639
+
640
+ class BeaconIconSuccessComponent {
641
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconIconSuccessComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
642
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: BeaconIconSuccessComponent, selector: "app-beacon-icon-success", ngImport: i0, template: "<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g id=\"SVGRepo_bgCarrier\" stroke-width=\"0\"></g>\n <g id=\"SVGRepo_tracerCarrier\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></g>\n <g id=\"SVGRepo_iconCarrier\">\n <path\n d=\"M8.5 12.5L10.0089 14.0089C10.3526 14.3526 10.5245 14.5245 10.7198 14.5822C10.8914 14.6328 11.0749 14.6245 11.2412 14.5585C11.4305 14.4834 11.5861 14.2967 11.8973 13.9232L16 9M16.3287 4.75855C17.0676 4.77963 17.8001 5.07212 18.364 5.636C18.9278 6.19989 19.2203 6.9324 19.2414 7.67121C19.2623 8.40232 19.2727 8.76787 19.2942 8.85296C19.3401 9.0351 19.2867 8.90625 19.383 9.06752C19.428 9.14286 19.6792 9.40876 20.1814 9.94045C20.6889 10.4778 21 11.2026 21 12C21 12.7974 20.6889 13.5222 20.1814 14.0595C19.6792 14.5912 19.428 14.8571 19.383 14.9325C19.2867 15.0937 19.3401 14.9649 19.2942 15.147C19.2727 15.2321 19.2623 15.5977 19.2414 16.3288C19.2203 17.0676 18.9278 17.8001 18.364 18.364C17.8001 18.9279 17.0676 19.2204 16.3287 19.2414C15.5976 19.2623 15.2321 19.2727 15.147 19.2942C14.9649 19.3401 15.0937 19.2868 14.9325 19.3831C14.8571 19.4281 14.5912 19.6792 14.0595 20.1814C13.5222 20.6889 12.7974 21 12 21C11.2026 21 10.4778 20.6889 9.94047 20.1814C9.40874 19.6792 9.14287 19.4281 9.06753 19.3831C8.90626 19.2868 9.0351 19.3401 8.85296 19.2942C8.76788 19.2727 8.40225 19.2623 7.67121 19.2414C6.93238 19.2204 6.19986 18.9279 5.63597 18.364C5.07207 17.8001 4.77959 17.0676 4.75852 16.3287C4.73766 15.5976 4.72724 15.2321 4.70578 15.147C4.65985 14.9649 4.71322 15.0937 4.61691 14.9324C4.57192 14.8571 4.32082 14.5912 3.81862 14.0595C3.31113 13.5222 3 12.7974 3 12C3 11.2026 3.31113 10.4778 3.81862 9.94048C4.32082 9.40876 4.57192 9.14289 4.61691 9.06755C4.71322 8.90628 4.65985 9.03512 4.70578 8.85299C4.72724 8.7679 4.73766 8.40235 4.75852 7.67126C4.77959 6.93243 5.07207 6.1999 5.63597 5.636C6.19986 5.07211 6.93238 4.77963 7.67121 4.75855C8.40232 4.73769 8.76788 4.72727 8.85296 4.70581C9.0351 4.65988 8.90626 4.71325 9.06753 4.61694C9.14287 4.57195 9.40876 4.32082 9.94047 3.81863C10.4778 3.31113 11.2026 3 12 3C12.7974 3 13.5222 3.31114 14.0595 3.81864C14.5913 4.32084 14.8571 4.57194 14.9325 4.61693C15.0937 4.71324 14.9649 4.65988 15.147 4.70581C15.2321 4.72726 15.5976 4.73769 16.3287 4.75855Z\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n </g>\n</svg>", styles: ["svg{width:22px!important;height:22px!important;margin-right:7px!important;margin-top:-2px}\n"] });
643
+ }
644
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconIconSuccessComponent, decorators: [{
645
+ type: Component,
646
+ args: [{ selector: 'app-beacon-icon-success', template: "<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g id=\"SVGRepo_bgCarrier\" stroke-width=\"0\"></g>\n <g id=\"SVGRepo_tracerCarrier\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></g>\n <g id=\"SVGRepo_iconCarrier\">\n <path\n d=\"M8.5 12.5L10.0089 14.0089C10.3526 14.3526 10.5245 14.5245 10.7198 14.5822C10.8914 14.6328 11.0749 14.6245 11.2412 14.5585C11.4305 14.4834 11.5861 14.2967 11.8973 13.9232L16 9M16.3287 4.75855C17.0676 4.77963 17.8001 5.07212 18.364 5.636C18.9278 6.19989 19.2203 6.9324 19.2414 7.67121C19.2623 8.40232 19.2727 8.76787 19.2942 8.85296C19.3401 9.0351 19.2867 8.90625 19.383 9.06752C19.428 9.14286 19.6792 9.40876 20.1814 9.94045C20.6889 10.4778 21 11.2026 21 12C21 12.7974 20.6889 13.5222 20.1814 14.0595C19.6792 14.5912 19.428 14.8571 19.383 14.9325C19.2867 15.0937 19.3401 14.9649 19.2942 15.147C19.2727 15.2321 19.2623 15.5977 19.2414 16.3288C19.2203 17.0676 18.9278 17.8001 18.364 18.364C17.8001 18.9279 17.0676 19.2204 16.3287 19.2414C15.5976 19.2623 15.2321 19.2727 15.147 19.2942C14.9649 19.3401 15.0937 19.2868 14.9325 19.3831C14.8571 19.4281 14.5912 19.6792 14.0595 20.1814C13.5222 20.6889 12.7974 21 12 21C11.2026 21 10.4778 20.6889 9.94047 20.1814C9.40874 19.6792 9.14287 19.4281 9.06753 19.3831C8.90626 19.2868 9.0351 19.3401 8.85296 19.2942C8.76788 19.2727 8.40225 19.2623 7.67121 19.2414C6.93238 19.2204 6.19986 18.9279 5.63597 18.364C5.07207 17.8001 4.77959 17.0676 4.75852 16.3287C4.73766 15.5976 4.72724 15.2321 4.70578 15.147C4.65985 14.9649 4.71322 15.0937 4.61691 14.9324C4.57192 14.8571 4.32082 14.5912 3.81862 14.0595C3.31113 13.5222 3 12.7974 3 12C3 11.2026 3.31113 10.4778 3.81862 9.94048C4.32082 9.40876 4.57192 9.14289 4.61691 9.06755C4.71322 8.90628 4.65985 9.03512 4.70578 8.85299C4.72724 8.7679 4.73766 8.40235 4.75852 7.67126C4.77959 6.93243 5.07207 6.1999 5.63597 5.636C6.19986 5.07211 6.93238 4.77963 7.67121 4.75855C8.40232 4.73769 8.76788 4.72727 8.85296 4.70581C9.0351 4.65988 8.90626 4.71325 9.06753 4.61694C9.14287 4.57195 9.40876 4.32082 9.94047 3.81863C10.4778 3.31113 11.2026 3 12 3C12.7974 3 13.5222 3.31114 14.0595 3.81864C14.5913 4.32084 14.8571 4.57194 14.9325 4.61693C15.0937 4.71324 14.9649 4.65988 15.147 4.70581C15.2321 4.72726 15.5976 4.73769 16.3287 4.75855Z\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n </g>\n</svg>", styles: ["svg{width:22px!important;height:22px!important;margin-right:7px!important;margin-top:-2px}\n"] }]
647
+ }] });
648
+
649
+ class BeaconIconWarningComponent {
650
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconIconWarningComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
651
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: BeaconIconWarningComponent, selector: "app-beacon-icon-warning", ngImport: i0, template: "<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g id=\"SVGRepo_bgCarrier\" stroke-width=\"0\"></g>\n <g id=\"SVGRepo_tracerCarrier\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></g>\n <g id=\"SVGRepo_iconCarrier\">\n <path d=\"M12 7.75V13\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path\n d=\"M21.08 8.58003V15.42C21.08 16.54 20.48 17.58 19.51 18.15L13.57 21.58C12.6 22.14 11.4 22.14 10.42 21.58L4.47998 18.15C3.50998 17.59 2.90997 16.55 2.90997 15.42V8.58003C2.90997 7.46003 3.50998 6.41999 4.47998 5.84999L10.42 2.42C11.39 1.86 12.59 1.86 13.57 2.42L19.51 5.84999C20.48 6.41999 21.08 7.45003 21.08 8.58003Z\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n <path d=\"M12 16.2V16.2999\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </g>\n</svg>\n", styles: ["svg{width:22px!important;height:22px!important;margin-right:7px!important;margin-top:-2px}\n"] });
652
+ }
653
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconIconWarningComponent, decorators: [{
654
+ type: Component,
655
+ args: [{ selector: 'app-beacon-icon-warning', template: "<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g id=\"SVGRepo_bgCarrier\" stroke-width=\"0\"></g>\n <g id=\"SVGRepo_tracerCarrier\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></g>\n <g id=\"SVGRepo_iconCarrier\">\n <path d=\"M12 7.75V13\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path\n d=\"M21.08 8.58003V15.42C21.08 16.54 20.48 17.58 19.51 18.15L13.57 21.58C12.6 22.14 11.4 22.14 10.42 21.58L4.47998 18.15C3.50998 17.59 2.90997 16.55 2.90997 15.42V8.58003C2.90997 7.46003 3.50998 6.41999 4.47998 5.84999L10.42 2.42C11.39 1.86 12.59 1.86 13.57 2.42L19.51 5.84999C20.48 6.41999 21.08 7.45003 21.08 8.58003Z\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n ></path>\n <path d=\"M12 16.2V16.2999\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </g>\n</svg>\n", styles: ["svg{width:22px!important;height:22px!important;margin-right:7px!important;margin-top:-2px}\n"] }]
656
+ }] });
657
+
658
+ class BeaconTypeResolvePipe {
659
+ beaconTypeKeys;
660
+ constructor() {
661
+ this.beaconTypeKeys = BEACON_TYPE_KEYS;
662
+ }
663
+ transform(value, ...args) {
664
+ let status = false;
665
+ switch (args[0]) {
666
+ case 'alert':
667
+ status = value == this.beaconTypeKeys[0];
668
+ break;
669
+ case 'error':
670
+ status = value == this.beaconTypeKeys[1];
671
+ break;
672
+ case 'info':
673
+ status = value == this.beaconTypeKeys[2];
674
+ break;
675
+ case 'success':
676
+ status = value == this.beaconTypeKeys[3];
677
+ break;
678
+ case 'warning':
679
+ status = value == this.beaconTypeKeys[4];
680
+ break;
681
+ }
682
+ return status;
683
+ }
684
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconTypeResolvePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
685
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.1.2", ngImport: i0, type: BeaconTypeResolvePipe, name: "beaconTypeResolve" });
686
+ }
687
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconTypeResolvePipe, decorators: [{
688
+ type: Pipe,
689
+ args: [{
690
+ name: 'beaconTypeResolve'
691
+ }]
692
+ }], ctorParameters: () => [] });
693
+
694
+ class BeaconNotifyComponent {
695
+ beaconService;
696
+ sanitizer;
697
+ beacon;
698
+ beaconDOM;
699
+ beaconDefaultIconKeys;
700
+ constructor(beaconService, sanitizer) {
701
+ this.beaconService = beaconService;
702
+ this.sanitizer = sanitizer;
703
+ this.beaconDefaultIconKeys = this.beaconService.getBeaconDefaultIconKeys;
704
+ }
705
+ ngOnInit() {
706
+ // Fire mount event
707
+ this.beaconService.beaconEventTaskMaster.emit({
708
+ mount: true,
709
+ id: this.beacon.bid
710
+ });
711
+ }
712
+ ngAfterViewInit() {
713
+ // Get beacon
714
+ const beacon = this.beaconDOM = this.beaconService.getBeaconContainer.nativeElement.querySelector(`#bc_${this.beacon.bid}`);
715
+ // Resolve possible focus for beacon
716
+ this.resolvePossibleFocusForBeacon(beacon);
717
+ setTimeout(() => {
718
+ // Resolve delay setting
719
+ this.resolveDelayForBeacon(beacon, true);
720
+ // Set beacon listener
721
+ this.setListenerForBeacon(beacon, this.beacon);
722
+ // Sanitize svg content if not font icon
723
+ if (this.beacon.svgIcon) {
724
+ const beaconSvgIcon = beacon.querySelector('span.beacon-message-svg-control svg');
725
+ beaconSvgIcon.style.width = '20px';
726
+ beaconSvgIcon.style.height = '20px';
727
+ beaconSvgIcon.style.marginRight = '7px';
728
+ beaconSvgIcon.style.marginTop = '-2px';
729
+ }
730
+ }, 0);
731
+ // Listen for event
732
+ this.beaconService.beaconEventTaskMaster.subscribe((message) => {
733
+ // Check for next for focus event
734
+ if (message.autoDetectNextFocusBeacon)
735
+ this.resolvePossibleFocusForBeacon(this.beaconDOM, false);
736
+ });
737
+ }
738
+ // When beacon button is clicked
739
+ beaconButtonClick(e, no) {
740
+ e.stopPropagation();
741
+ switch (no) {
742
+ case 1:
743
+ // Check for callback
744
+ if (this.beacon?.buttons?.one?.callback)
745
+ this.beacon?.buttons?.one?.callback(this.beacon?.buttons?.one?.callbackArgs);
746
+ // Check if can dismiss
747
+ if (this.beacon?.buttons?.one?.canDismiss)
748
+ this.closeBeacon(this.beaconDOM, this.beacon);
749
+ break;
750
+ case 2:
751
+ // Check for callback
752
+ if (this.beacon?.buttons?.two?.callback)
753
+ this.beacon?.buttons?.two?.callback(this.beacon?.buttons?.two?.callbackArgs);
754
+ // Check if can dismiss
755
+ if (this.beacon?.buttons?.two?.canDismiss)
756
+ this.closeBeacon(this.beaconDOM, this.beacon);
757
+ break;
758
+ }
759
+ }
760
+ // Set listener for beacon changes
761
+ setListenerForBeacon(beacon, beaconData) {
762
+ ((b, d) => {
763
+ beacon?.addEventListener('animationend', (e) => this.closeBeacon(b, d));
764
+ beacon?.addEventListener('webkitAnimationEnd', (e) => this.closeBeacon(b, d));
765
+ beacon?.addEventListener('oAnimationEnd', (e) => this.closeBeacon(b, d));
766
+ })(beacon, beaconData);
767
+ }
768
+ // Toggle auto-close
769
+ autoClose(status, control) {
770
+ status
771
+ ? (control.getAttribute('data-beacon-static') != 'true' && this.resolveDelayForBeacon(control, false))
772
+ : control.classList.remove(String(this.beacon.animationClass));
773
+ }
774
+ // Resolve delay for beacon
775
+ resolveDelayForBeacon(beacon, onLoad) {
776
+ // Check if delay set
777
+ if (this.beacon.static && typeof this.beacon.static == 'number') {
778
+ beacon && (beacon.style.animationDelay = this.beacon.static + 's');
779
+ }
780
+ else {
781
+ if (onLoad == !1 && this.beacon?.fixed != true)
782
+ beacon.classList.add(String(this.beacon.animationClass));
783
+ }
784
+ }
785
+ // Resolve focus beacon
786
+ resolvePossibleFocusForBeacon(beacon, createOverlay = true) {
787
+ const activeFocusBeaconId = this.beaconService.getActiveFocusBeaconId;
788
+ if (activeFocusBeaconId == this.beacon.bid) {
789
+ beacon.style.zIndex = '9003';
790
+ // Check if beacon should be centered
791
+ if (this.beacon.shine) {
792
+ beacon.style.position = 'fixed';
793
+ beacon.style.right = '0';
794
+ beacon.style.left = '0';
795
+ beacon.style.bottom = '50%';
796
+ beacon.style.margin = 'auto';
797
+ beacon.style.transform = 'scale(1.6)';
798
+ }
799
+ // Create overlay
800
+ if (createOverlay)
801
+ this.beaconService.createBeaconFocusOverlay(this.beacon.overlayColor);
802
+ else
803
+ this.beaconService.repaintBeaconFocusOverlay(this.beacon.overlayColor);
804
+ }
805
+ }
806
+ // Trigger close beacon
807
+ closeBeacon(beaconControl, beaconData) {
808
+ if (!this.beacon?.fixed) {
809
+ this.beaconService.beaconEventTaskMaster.emit({
810
+ delete: true,
811
+ id: beaconControl.getAttribute('id').replace(/bc_/, '')
812
+ });
813
+ }
814
+ }
815
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconNotifyComponent, deps: [{ token: BeaconNotifyService }, { token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
816
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: BeaconNotifyComponent, selector: "app-beacon", inputs: { beacon: "beacon" }, ngImport: i0, template: "<div #beaconControl \n\t\t[id]=\"'bc_' + beacon.bid\"\n\t\t(mouseenter)=\"autoClose(false, beaconControl)\" \n\t\t(mouseleave)=\"autoClose(true, beaconControl)\"\n\t\t(click)=\"beacon.preventClickClose ? null : closeBeacon(beaconControl, beacon)\"\n\t\t[attr.data-beacon-static]=\"beacon.static\"\n\t\tclass=\"beacon-message-control {{ (beacon.static !== true && beacon.fixed !== true) ? beacon.animationClass : '' }} {{ beacon.replacementClass || beacon.type }} {{ beacon.styleClass }}\"\n\t\t[class.beacon-message-control-no-hover-effect]=\"beacon.noHoverEffect\">\n\t<div class=\"beacon-message-header\">\n\t\t<div>\n\t\t\t<span *ngIf=\"beacon.fontIcon\"><i [class]=\"beacon.icon\"></i></span>\n\t\t\t<span *ngIf=\"!beacon.fontIcon && beaconDefaultIconKeys.includes(beacon.icon)\" class=\"beacon-message-svg-control\">\n\t\t\t\t<app-beacon-icon-alert *ngIf=\"beacon.icon | beaconTypeResolve:'alert'\"></app-beacon-icon-alert>\n\t\t\t\t<app-beacon-icon-error *ngIf=\"beacon.icon | beaconTypeResolve:'error'\"></app-beacon-icon-error>\n\t\t\t\t<app-beacon-icon-info *ngIf=\"beacon.icon | beaconTypeResolve:'info'\"></app-beacon-icon-info>\n\t\t\t\t<app-beacon-icon-success *ngIf=\"beacon.icon | beaconTypeResolve:'success'\"></app-beacon-icon-success>\n\t\t\t\t<app-beacon-icon-warning *ngIf=\"beacon.icon | beaconTypeResolve:'warning'\"></app-beacon-icon-warning>\n\t\t\t</span>\n\t\t\t<span *ngIf=\"!beacon.fontIcon && beacon.icon && !beaconDefaultIconKeys.includes(beacon.icon)\" class=\"beacon-message-svg-control\" [innerHTML]=\"beacon.svgIcon\"></span>\n\t\t\t{{ beacon.title }}\n\t\t</div>\n\t\t<div>\n\t\t\t<div *ngIf=\"!beacon.fixed\" class=\"beacon-message-close\" (click)=\"closeBeacon(beaconControl, beacon)\">\n\t\t\t\t<svg width=\"10\" height=\"10\" viewBox=\"0 0 78 78\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t <rect y=\"7.07104\" width=\"10\" height=\"100\" rx=\"5\" transform=\"rotate(-45 0 7.07104)\" />\n\t\t\t <rect x=\"70.7109\" width=\"10\" height=\"100\" rx=\"5\" transform=\"rotate(45 70.7109 0)\" />\n\t\t\t\t</svg>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div class=\"beacon-message-divider\"></div>\n\t<div class=\"beacon-message-body\" [innerHTML]=\"beacon.bodyHtml\"></div>\n\t<div class=\"beacon-message-divider\" *ngIf=\"beacon.buttons?.one || beacon.buttons?.two\"></div>\n\n\t<div class=\"beacon-message-footer\" *ngIf=\"beacon.buttons && beacon.buttons.one && beacon.buttons.two\">\n\t\t<div><button (click)=\"beaconButtonClick($event, 1)\">{{ beacon.buttons.one.text }}</button></div>\n\t\t<div><button (click)=\"beaconButtonClick($event, 2)\">{{ beacon.buttons.two.text }}</button></div>\n\t</div>\n\n\t<div class=\"beacon-message-footer\" *ngIf=\"beacon.buttons && beacon.buttons.one && !beacon.buttons.two\">\n\t\t<div [class]=\"beacon.buttons.one.position ? ('beacon-message-button-container-' + beacon.buttons.one.position) : ''\">\n\t\t\t<button (click)=\"beaconButtonClick($event, 1)\">{{ beacon.buttons.one.text }}</button>\n\t\t</div>\n\t</div>\n\n</div>", styles: [".beacon-message-control{width:270px;height:auto;background:#eee;margin:6px;border-radius:4px;position:relative;z-index:4000;cursor:pointer}.beacon-message-control:hover{box-shadow:0 0 20px #4443}.beacon-message-control-no-hover-effect{box-shadow:none!important}.beacon-message-control-animate{-webkit-animation:beacon-fade-out .5s 7s linear forwards;animation:beacon-fade-out .5s 7s linear forwards}.beacon-message-header,.beacon-message-body,.beacon-message-footer{padding:8px;font-size:14px}.beacon-message-header{font-weight:700;display:flex;font-size:15px}.beacon-message-header>div:first-child{flex-grow:1;display:flex;place-items:flex-start;word-break:break-all}.beacon-message-header>div:first-child i{font-size:20px;margin-right:7px;margin-top:2px}.beacon-message-header>div:last-child{flex-grow:0}.beacon-message-divider{border-top:1px solid #44444433}.beacon-message-close{height:22px;width:22px;border:1px solid #444444;display:flex;place-items:center;place-content:center;border-radius:100%;cursor:pointer;opacity:.3}.beacon-message-close svg rect{fill:#444}.beacon-message-close:hover{opacity:.7}.beacon-message-alert{background:#eee;color:#5e5e5e}.beacon-message-alert .beacon-message-footer button{border:1px solid #5E5E5E;color:#5e5e5e}.beacon-message-alert .beacon-message-footer button:hover{background:#5e5e5e;color:#fff}.beacon-message-success{background:#f0fff0;color:#698b69}.beacon-message-success .beacon-message-divider{border-color:#698b6933}.beacon-message-success .beacon-message-footer button{border:1px solid #698B69;color:#698b69}.beacon-message-success .beacon-message-footer button:hover{background:#698b69;color:#fff}.beacon-message-error{background:#ffe4e1;color:#b22222}.beacon-message-error .beacon-message-divider{border-color:#ee3b3b33}.beacon-message-error .beacon-message-footer button{border:1px solid #B22222;color:#b22222}.beacon-message-error .beacon-message-footer button:hover{background:#b22222;color:#fff}.beacon-message-warning{background:#fffacd;color:#b8860b}.beacon-message-warning .beacon-message-divider{border-color:#ffd70088}.beacon-message-warning .beacon-message-footer button{border:1px solid #B8860B;color:#b8860b}.beacon-message-warning .beacon-message-footer button:hover{background:#b8860b;color:#fff}.beacon-message-info{background:#bfefff;color:#4a708b}.beacon-message-info .beacon-message-divider{border-color:#5cacee33}.beacon-message-info .beacon-message-footer button{border:1px solid #4A708B;color:#4a708b}.beacon-message-info .beacon-message-footer button:hover{background:#4a708b;color:#fff}.beacon-message-footer{display:flex}.beacon-message-footer>div:first-child{flex-grow:1}.beacon-message-footer>div:last-child{flex-grow:1;text-align:right}.beacon-message-footer button{padding:4px 7px;border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;background:transparent;cursor:pointer}.beacon-message-footer .beacon-message-button-container-left{text-align:left!important}.beacon-message-footer .beacon-message-button-container-center{text-align:center!important}.beacon-message-footer .beacon-message-button-container-right{text-align:right!important}@keyframes beacon-fade-out{90%{opacity:0;display:none}to{opacity:0;display:none}}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: BeaconIconAlertComponent, selector: "app-beacon-icon-alert" }, { kind: "component", type: BeaconIconErrorComponent, selector: "app-beacon-icon-error" }, { kind: "component", type: BeaconIconInfoComponent, selector: "app-beacon-icon-info" }, { kind: "component", type: BeaconIconSuccessComponent, selector: "app-beacon-icon-success" }, { kind: "component", type: BeaconIconWarningComponent, selector: "app-beacon-icon-warning" }, { kind: "pipe", type: BeaconTypeResolvePipe, name: "beaconTypeResolve" }] });
817
+ }
818
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconNotifyComponent, decorators: [{
819
+ type: Component,
820
+ args: [{ selector: 'app-beacon', template: "<div #beaconControl \n\t\t[id]=\"'bc_' + beacon.bid\"\n\t\t(mouseenter)=\"autoClose(false, beaconControl)\" \n\t\t(mouseleave)=\"autoClose(true, beaconControl)\"\n\t\t(click)=\"beacon.preventClickClose ? null : closeBeacon(beaconControl, beacon)\"\n\t\t[attr.data-beacon-static]=\"beacon.static\"\n\t\tclass=\"beacon-message-control {{ (beacon.static !== true && beacon.fixed !== true) ? beacon.animationClass : '' }} {{ beacon.replacementClass || beacon.type }} {{ beacon.styleClass }}\"\n\t\t[class.beacon-message-control-no-hover-effect]=\"beacon.noHoverEffect\">\n\t<div class=\"beacon-message-header\">\n\t\t<div>\n\t\t\t<span *ngIf=\"beacon.fontIcon\"><i [class]=\"beacon.icon\"></i></span>\n\t\t\t<span *ngIf=\"!beacon.fontIcon && beaconDefaultIconKeys.includes(beacon.icon)\" class=\"beacon-message-svg-control\">\n\t\t\t\t<app-beacon-icon-alert *ngIf=\"beacon.icon | beaconTypeResolve:'alert'\"></app-beacon-icon-alert>\n\t\t\t\t<app-beacon-icon-error *ngIf=\"beacon.icon | beaconTypeResolve:'error'\"></app-beacon-icon-error>\n\t\t\t\t<app-beacon-icon-info *ngIf=\"beacon.icon | beaconTypeResolve:'info'\"></app-beacon-icon-info>\n\t\t\t\t<app-beacon-icon-success *ngIf=\"beacon.icon | beaconTypeResolve:'success'\"></app-beacon-icon-success>\n\t\t\t\t<app-beacon-icon-warning *ngIf=\"beacon.icon | beaconTypeResolve:'warning'\"></app-beacon-icon-warning>\n\t\t\t</span>\n\t\t\t<span *ngIf=\"!beacon.fontIcon && beacon.icon && !beaconDefaultIconKeys.includes(beacon.icon)\" class=\"beacon-message-svg-control\" [innerHTML]=\"beacon.svgIcon\"></span>\n\t\t\t{{ beacon.title }}\n\t\t</div>\n\t\t<div>\n\t\t\t<div *ngIf=\"!beacon.fixed\" class=\"beacon-message-close\" (click)=\"closeBeacon(beaconControl, beacon)\">\n\t\t\t\t<svg width=\"10\" height=\"10\" viewBox=\"0 0 78 78\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t <rect y=\"7.07104\" width=\"10\" height=\"100\" rx=\"5\" transform=\"rotate(-45 0 7.07104)\" />\n\t\t\t <rect x=\"70.7109\" width=\"10\" height=\"100\" rx=\"5\" transform=\"rotate(45 70.7109 0)\" />\n\t\t\t\t</svg>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<div class=\"beacon-message-divider\"></div>\n\t<div class=\"beacon-message-body\" [innerHTML]=\"beacon.bodyHtml\"></div>\n\t<div class=\"beacon-message-divider\" *ngIf=\"beacon.buttons?.one || beacon.buttons?.two\"></div>\n\n\t<div class=\"beacon-message-footer\" *ngIf=\"beacon.buttons && beacon.buttons.one && beacon.buttons.two\">\n\t\t<div><button (click)=\"beaconButtonClick($event, 1)\">{{ beacon.buttons.one.text }}</button></div>\n\t\t<div><button (click)=\"beaconButtonClick($event, 2)\">{{ beacon.buttons.two.text }}</button></div>\n\t</div>\n\n\t<div class=\"beacon-message-footer\" *ngIf=\"beacon.buttons && beacon.buttons.one && !beacon.buttons.two\">\n\t\t<div [class]=\"beacon.buttons.one.position ? ('beacon-message-button-container-' + beacon.buttons.one.position) : ''\">\n\t\t\t<button (click)=\"beaconButtonClick($event, 1)\">{{ beacon.buttons.one.text }}</button>\n\t\t</div>\n\t</div>\n\n</div>", styles: [".beacon-message-control{width:270px;height:auto;background:#eee;margin:6px;border-radius:4px;position:relative;z-index:4000;cursor:pointer}.beacon-message-control:hover{box-shadow:0 0 20px #4443}.beacon-message-control-no-hover-effect{box-shadow:none!important}.beacon-message-control-animate{-webkit-animation:beacon-fade-out .5s 7s linear forwards;animation:beacon-fade-out .5s 7s linear forwards}.beacon-message-header,.beacon-message-body,.beacon-message-footer{padding:8px;font-size:14px}.beacon-message-header{font-weight:700;display:flex;font-size:15px}.beacon-message-header>div:first-child{flex-grow:1;display:flex;place-items:flex-start;word-break:break-all}.beacon-message-header>div:first-child i{font-size:20px;margin-right:7px;margin-top:2px}.beacon-message-header>div:last-child{flex-grow:0}.beacon-message-divider{border-top:1px solid #44444433}.beacon-message-close{height:22px;width:22px;border:1px solid #444444;display:flex;place-items:center;place-content:center;border-radius:100%;cursor:pointer;opacity:.3}.beacon-message-close svg rect{fill:#444}.beacon-message-close:hover{opacity:.7}.beacon-message-alert{background:#eee;color:#5e5e5e}.beacon-message-alert .beacon-message-footer button{border:1px solid #5E5E5E;color:#5e5e5e}.beacon-message-alert .beacon-message-footer button:hover{background:#5e5e5e;color:#fff}.beacon-message-success{background:#f0fff0;color:#698b69}.beacon-message-success .beacon-message-divider{border-color:#698b6933}.beacon-message-success .beacon-message-footer button{border:1px solid #698B69;color:#698b69}.beacon-message-success .beacon-message-footer button:hover{background:#698b69;color:#fff}.beacon-message-error{background:#ffe4e1;color:#b22222}.beacon-message-error .beacon-message-divider{border-color:#ee3b3b33}.beacon-message-error .beacon-message-footer button{border:1px solid #B22222;color:#b22222}.beacon-message-error .beacon-message-footer button:hover{background:#b22222;color:#fff}.beacon-message-warning{background:#fffacd;color:#b8860b}.beacon-message-warning .beacon-message-divider{border-color:#ffd70088}.beacon-message-warning .beacon-message-footer button{border:1px solid #B8860B;color:#b8860b}.beacon-message-warning .beacon-message-footer button:hover{background:#b8860b;color:#fff}.beacon-message-info{background:#bfefff;color:#4a708b}.beacon-message-info .beacon-message-divider{border-color:#5cacee33}.beacon-message-info .beacon-message-footer button{border:1px solid #4A708B;color:#4a708b}.beacon-message-info .beacon-message-footer button:hover{background:#4a708b;color:#fff}.beacon-message-footer{display:flex}.beacon-message-footer>div:first-child{flex-grow:1}.beacon-message-footer>div:last-child{flex-grow:1;text-align:right}.beacon-message-footer button{padding:4px 7px;border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;background:transparent;cursor:pointer}.beacon-message-footer .beacon-message-button-container-left{text-align:left!important}.beacon-message-footer .beacon-message-button-container-center{text-align:center!important}.beacon-message-footer .beacon-message-button-container-right{text-align:right!important}@keyframes beacon-fade-out{90%{opacity:0;display:none}to{opacity:0;display:none}}\n"] }]
821
+ }], ctorParameters: () => [{ type: BeaconNotifyService }, { type: i1.DomSanitizer }], propDecorators: { beacon: [{
822
+ type: Input
823
+ }] } });
824
+
825
+ class BeaconNotifyContainerComponent {
826
+ beaconService;
827
+ set content(content) {
828
+ content && this.resolveBeaconContainer(content);
829
+ }
830
+ beaconLibrary;
831
+ constructor(beaconService) {
832
+ this.beaconService = beaconService;
833
+ this.beaconLibrary = this.beaconService.beaconLibrary;
834
+ }
835
+ ngOnInit() {
836
+ // Listen for delete event
837
+ this.beaconService.beaconEventTaskMaster.subscribe((message) => {
838
+ if (message.delete)
839
+ this.beaconLibrary = this.beaconService.beaconLibrary = this.beaconService.beaconLibrary.filter(x => x.bid != message.id);
840
+ });
841
+ }
842
+ ngAfterViewInit() { }
843
+ // Resolve beacon container
844
+ resolveBeaconContainer(content) {
845
+ this.beaconService.setBeaconContainer(content);
846
+ // Resolve position
847
+ const position = this.beaconService.getBeaconGlobalPositionConfig;
848
+ // Resolve ltr
849
+ if (position?.leftRight) {
850
+ if (position?.leftRight == 'left') {
851
+ content.nativeElement.style.left = 0;
852
+ content.nativeElement.style.right = 'auto';
853
+ }
854
+ else if (position?.leftRight == 'center') {
855
+ content.nativeElement.style.left = 0;
856
+ content.nativeElement.style.right = 0;
857
+ content.nativeElement.style.margin = 'auto';
858
+ }
859
+ else {
860
+ content.nativeElement.style.left = 'auto';
861
+ content.nativeElement.style.right = 0;
862
+ }
863
+ }
864
+ // Resolve ttb
865
+ if (position?.topBottom) {
866
+ if (position?.topBottom == 'top') {
867
+ content.nativeElement.style.top = 0;
868
+ content.nativeElement.style.bottom = 'auto';
869
+ }
870
+ else {
871
+ content.nativeElement.style.top = 'auto';
872
+ content.nativeElement.style.bottom = 0;
873
+ }
874
+ }
875
+ }
876
+ // Track-by function
877
+ trackBy(idx, item) {
878
+ return item.bid;
879
+ }
880
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconNotifyContainerComponent, deps: [{ token: BeaconNotifyService }], target: i0.ɵɵFactoryTarget.Component });
881
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.2", type: BeaconNotifyContainerComponent, selector: "ngx-beacon-notify", viewQueries: [{ propertyName: "content", first: true, predicate: ["beaconContainer"], descendants: true }], ngImport: i0, template: "<div id=\"app-beacon-notify-container\" #beaconContainer>\n\t<app-beacon *ngFor=\"let beacon of beaconLibrary; trackBy: trackBy\" [id]=\"'bcp_'+beacon.bid\" [beacon]=\"beacon\"></app-beacon>\n</div>", styles: ["#app-beacon-notify-container{position:fixed;height:auto;width:auto;inset:0 0 auto auto;z-index:3999;width:282px}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: BeaconNotifyComponent, selector: "app-beacon", inputs: ["beacon"] }] });
882
+ }
883
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconNotifyContainerComponent, decorators: [{
884
+ type: Component,
885
+ args: [{ selector: 'ngx-beacon-notify', template: "<div id=\"app-beacon-notify-container\" #beaconContainer>\n\t<app-beacon *ngFor=\"let beacon of beaconLibrary; trackBy: trackBy\" [id]=\"'bcp_'+beacon.bid\" [beacon]=\"beacon\"></app-beacon>\n</div>", styles: ["#app-beacon-notify-container{position:fixed;height:auto;width:auto;inset:0 0 auto auto;z-index:3999;width:282px}\n"] }]
886
+ }], ctorParameters: () => [{ type: BeaconNotifyService }], propDecorators: { content: [{
887
+ type: ViewChild,
888
+ args: ['beaconContainer', { static: false }]
889
+ }] } });
890
+
891
+ class BeaconNotifyModule {
892
+ static forRoot(config) {
893
+ return {
894
+ ngModule: BeaconNotifyModule,
895
+ providers: [
896
+ { provide: BEACON_GLOBAL_CONFIG, useValue: config },
897
+ BeaconNotifyService
898
+ ]
899
+ };
900
+ }
901
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconNotifyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
902
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.2", ngImport: i0, type: BeaconNotifyModule, declarations: [BeaconNotifyComponent,
903
+ BeaconNotifyContainerComponent,
904
+ BeaconIconAlertComponent,
905
+ BeaconIconErrorComponent,
906
+ BeaconIconInfoComponent,
907
+ BeaconIconSuccessComponent,
908
+ BeaconIconWarningComponent,
909
+ BeaconTypeResolvePipe], imports: [CommonModule], exports: [BeaconNotifyComponent,
910
+ BeaconNotifyContainerComponent] });
911
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconNotifyModule, imports: [CommonModule] });
912
+ }
913
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: BeaconNotifyModule, decorators: [{
914
+ type: NgModule,
915
+ args: [{
916
+ declarations: [
917
+ BeaconNotifyComponent,
918
+ BeaconNotifyContainerComponent,
919
+ BeaconIconAlertComponent,
920
+ BeaconIconErrorComponent,
921
+ BeaconIconInfoComponent,
922
+ BeaconIconSuccessComponent,
923
+ BeaconIconWarningComponent,
924
+ BeaconTypeResolvePipe
925
+ ],
926
+ imports: [
927
+ CommonModule
928
+ ],
929
+ exports: [
930
+ BeaconNotifyComponent,
931
+ BeaconNotifyContainerComponent
932
+ ]
933
+ }]
934
+ }] });
935
+
936
+ /**
937
+ * Generated bundle index. Do not edit.
938
+ */
939
+
940
+ export { BeaconNotifyComponent, BeaconNotifyContainerComponent, BeaconNotifyModule, BeaconNotifyService };
941
+ //# sourceMappingURL=ngx-beacon-notify.mjs.map