@everymatrix/general-registration 1.90.6 → 1.90.8

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.
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-7dc4a1f4.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-7f9689f9.js';
2
2
 
3
3
  const DEFAULT_LANGUAGE$1 = 'en';
4
4
  const TRANSLATIONS$1 = {
@@ -374,6 +374,124 @@ const validateID = (id) => {
374
374
 
375
375
  const tooltipIconSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGNpcmNsZSBjeD0iNiIgY3k9IjYiIHI9IjUuNSIgc3Ryb2tlPSIjOTc5Nzk3Ii8+CjxyZWN0IHg9IjUiIHk9IjUiIHdpZHRoPSIyIiBoZWlnaHQ9IjUiIGZpbGw9IiM5Nzk3OTciLz4KPGNpcmNsZSBjeD0iNiIgY3k9IjMiIHI9IjEiIGZpbGw9IiM5Nzk3OTciLz4KPC9zdmc+Cg==';
376
376
 
377
+ const StyleCacheKey = '__WIDGET_GLOBAL_STYLE_CACHE__';
378
+
379
+ /**
380
+ * @name setClientStyling
381
+ * @description Method used to create and append to the passed element of the widget a style element with the content received
382
+ * @param {HTMLElement} stylingContainer The reference element of the widget
383
+ * @param {string} clientStyling The style content
384
+ */
385
+ function setClientStyling(stylingContainer, clientStyling) {
386
+ if (stylingContainer) {
387
+ const sheet = document.createElement('style');
388
+ sheet.innerHTML = clientStyling;
389
+ stylingContainer.appendChild(sheet);
390
+ }
391
+ }
392
+
393
+ /**
394
+ * @name setClientStylingURL
395
+ * @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
396
+ * @param {HTMLElement} stylingContainer The reference element of the widget
397
+ * @param {string} clientStylingUrl The URL of the style content
398
+ */
399
+ function setClientStylingURL(stylingContainer, clientStylingUrl) {
400
+ if (!stylingContainer || !clientStylingUrl) return;
401
+
402
+ const url = new URL(clientStylingUrl);
403
+
404
+ fetch(url.href)
405
+ .then((res) => res.text())
406
+ .then((data) => {
407
+ const cssFile = document.createElement('style');
408
+ cssFile.innerHTML = data;
409
+ if (stylingContainer) {
410
+ stylingContainer.appendChild(cssFile);
411
+ }
412
+ })
413
+ .catch((err) => {
414
+ console.error('There was an error while trying to load client styling from URL', err);
415
+ });
416
+ }
417
+
418
+ /**
419
+ * @name setStreamLibrary
420
+ * @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
421
+ * @param {HTMLElement} stylingContainer The highest element of the widget
422
+ * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
423
+ * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
424
+ * @param {boolean} useAdoptedStyleSheets A flag to gradually enable testing of adoptedStyleSheets
425
+ */
426
+ function setStreamStyling(stylingContainer, domain, subscription, useAdoptedStyleSheets = false) {
427
+ if (!window.emMessageBus) return;
428
+
429
+ const supportAdoptStyle = 'adoptedStyleSheets' in Document.prototype;
430
+
431
+ if (!supportAdoptStyle || !useAdoptedStyleSheets) {
432
+ subscription = getStyleTagSubscription(stylingContainer, domain);
433
+
434
+ return subscription;
435
+ }
436
+
437
+ if (!window[StyleCacheKey]) {
438
+ window[StyleCacheKey] = {};
439
+ }
440
+ subscription = getAdoptStyleSubscription(stylingContainer, domain);
441
+
442
+ const originalUnsubscribe = subscription.unsubscribe.bind(subscription);
443
+ const wrappedUnsubscribe = () => {
444
+ if (window[StyleCacheKey][domain]) {
445
+ const cachedObject = window[StyleCacheKey][domain];
446
+ cachedObject.refCount > 1
447
+ ? (cachedObject.refCount = cachedObject.refCount - 1)
448
+ : delete window[StyleCacheKey][domain];
449
+ }
450
+
451
+ originalUnsubscribe();
452
+ };
453
+ subscription.unsubscribe = wrappedUnsubscribe;
454
+
455
+ return subscription;
456
+ }
457
+
458
+ function getStyleTagSubscription(stylingContainer, domain) {
459
+ const sheet = document.createElement('style');
460
+
461
+ return window.emMessageBus.subscribe(domain, (data) => {
462
+ if (stylingContainer) {
463
+ sheet.innerHTML = data;
464
+ stylingContainer.appendChild(sheet);
465
+ }
466
+ });
467
+ }
468
+
469
+ function getAdoptStyleSubscription(stylingContainer, domain) {
470
+ return window.emMessageBus.subscribe(domain, (data) => {
471
+ if (!stylingContainer) return;
472
+
473
+ const shadowRoot = stylingContainer.getRootNode();
474
+ const cacheStyleObject = window[StyleCacheKey];
475
+ let cachedStyle = cacheStyleObject[domain] && cacheStyleObject[domain].sheet;
476
+
477
+ if (!cachedStyle) {
478
+ cachedStyle = new CSSStyleSheet();
479
+ cachedStyle.replaceSync(data);
480
+ cacheStyleObject[domain] = {
481
+ sheet: cachedStyle,
482
+ refCount: 1
483
+ };
484
+ } else {
485
+ cacheStyleObject[domain].refCount = cacheStyleObject[domain].refCount + 1;
486
+ }
487
+
488
+ const currentSheets = shadowRoot.adoptedStyleSheets || [];
489
+ if (!currentSheets.includes(cachedStyle)) {
490
+ shadowRoot.adoptedStyleSheets = [...currentSheets, cachedStyle];
491
+ }
492
+ });
493
+ }
494
+
377
495
  const checkboxGroupInputCss = "*,*::before,*::after{padding:0;margin:0;box-sizing:border-box}vaadin-checkbox-group{margin-top:5px;margin-left:40px}.checkboxgroup{font-family:\"Roboto\";font-style:normal;font-size:15px}.checkboxgroup__wrapper{position:relative}.checkboxgroup__wrapper--flex{display:flex;gap:5px;align-content:flex-start}.checkboxgroup__wrapper--relative{position:relative;display:inline}.checkboxgroup__input{vertical-align:baseline}.checkboxgroup__input[indeterminate]::part(checkbox)::after,.checkboxgroup__input[indeterminate]::part(checkbox),.checkboxgroup__input[checked]::part(checkbox){background-color:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E))}.checkboxgroup__label{font-style:inherit;font-family:inherit;font-weight:400;font-size:16px;color:var(--emw--registration-typography, var(--emw--color-black, #000000));line-height:1.5;padding-left:10px;vertical-align:baseline}.checkboxgroup__label-text{font-size:16px}.checkboxgroup__label a{color:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E))}.checkboxgroup__error-message{position:absolute;top:calc(100% + 5px);left:0;color:var(--emw--color-error, var(--emw--color-red, #ed0909))}.checkboxgroup__tooltip-icon{width:16px;height:auto}.checkboxgroup__tooltip{position:absolute;top:0;right:0;background-color:var(--emw--color-white, #FFFFFF);border:1px solid var(--emw--color-gray-100, #E6E6E6);color:var(--emw--registration-typography, var(--emw--color-black, #000000));padding:10px;border-radius:5px;opacity:0;transition:opacity 0.3s ease-in-out;z-index:10}.checkboxgroup__tooltip.visible{opacity:1}.checkbox__input::part(checkbox){background-color:var(--emw--color-white, #FFFFFF);transform:scale(0.8, 0.8);border-radius:var(--emw--border-radius-small, 2px);box-shadow:0 0px 0px 2px var(--emw--color-gray, #7a7a7a)}.checkbox__input[indeterminate]::part(checkbox),.checkbox__input[checked]::part(checkbox){background-color:var(--emw--login-color-primary, var(--emw--color-primary, #22B04E));box-shadow:none}";
378
496
  const CheckboxGroupInputStyle0 = checkboxGroupInputCss;
379
497
 
@@ -383,11 +501,6 @@ const CheckboxGroupInput = class {
383
501
  this.sendValidityState = createEvent(this, "sendValidityState", 7);
384
502
  this.sendInputValue = createEvent(this, "sendInputValue", 7);
385
503
  this.value = null;
386
- this.setClientStyling = () => {
387
- let sheet = document.createElement('style');
388
- sheet.innerHTML = this.clientStyling;
389
- this.stylingContainer.prepend(sheet);
390
- };
391
504
  this.name = undefined;
392
505
  this.displayName = undefined;
393
506
  this.defaultValue = '';
@@ -398,16 +511,17 @@ const CheckboxGroupInput = class {
398
511
  this.language = undefined;
399
512
  this.emitValue = undefined;
400
513
  this.clientStyling = '';
514
+ this.mbSource = undefined;
401
515
  this.errorMessage = undefined;
402
516
  this.isValid = undefined;
403
- this.limitStylingAppends = false;
404
517
  this.showTooltip = false;
405
518
  this.selectedValues = [];
406
519
  this.showCheckboxes = false;
407
520
  }
408
- handleStylingChange(newValue, oldValue) {
409
- if (newValue !== oldValue)
410
- this.setClientStyling();
521
+ handleClientStylingChange(newValue, oldValue) {
522
+ if (newValue !== oldValue) {
523
+ setClientStyling(this.stylingContainer, this.clientStyling);
524
+ }
411
525
  }
412
526
  validityChanged() {
413
527
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -439,16 +553,17 @@ const CheckboxGroupInput = class {
439
553
  this.showTooltip = false;
440
554
  }
441
555
  }
442
- componentDidRender() {
443
- // start custom styling area
444
- if (!this.limitStylingAppends && this.stylingContainer) {
445
- if (this.clientStyling)
446
- this.setClientStyling();
447
- this.limitStylingAppends = true;
556
+ handleClientStyling() {
557
+ if (window.emMessageBus !== undefined) {
558
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
559
+ return;
560
+ }
561
+ if (this.clientStyling) {
562
+ setClientStyling(this.stylingContainer, this.clientStyling);
448
563
  }
449
- // end custom styling area
450
564
  }
451
565
  componentDidLoad() {
566
+ this.handleClientStyling();
452
567
  this.inputReference = this.element.shadowRoot.querySelector('input');
453
568
  // For now this input has no validation. Send isValid as true immediately.
454
569
  //@TODO: add validation logic to it, if business reason arises.
@@ -485,14 +600,14 @@ const CheckboxGroupInput = class {
485
600
  return (h("label", { class: 'checkbox__label', htmlFor: `${this.name}__input`, slot: 'label' }, h("div", { class: 'checkbox__label-text', innerHTML: `${this.displayName} ${this.validation.mandatory ? '*' : ''}` })));
486
601
  }
487
602
  render() {
488
- return h("div", { key: '9985f4050655bc2233090f63abb0e22f2fe0b556', class: `checkboxgroup__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '9922e45ae7ee74b137ffc8552b3d714b7e3b1f59', class: 'checkboxgroup__wrapper--flex' }, h("vaadin-checkbox", { key: 'f18bae7c3ee6df76edcde75924eb1ad51a227443', class: 'checkbox__input', checked: this.selectedValues.length === this.options.length || this.defaultValue === 'true', indeterminate: this.selectedValues.length > 0 && this.selectedValues.length < this.options.length, onChange: (e) => this.handleParentCheckbox(e) }, this.renderLabel()), this.tooltip &&
489
- h("img", { key: '3dc2ce07e4d5f8de7ed4707b5e140fb4752ca86b', class: 'checkboxgroup__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), h("small", { key: 'd55f25f75aa20007ff58cf45b6632517f49b6c00', class: 'checkboxgroup__error-message' }, this.errorMessage), this.showCheckboxes && (h("vaadin-checkbox-group", { key: '210c3cc2868a07a403494e04336c4f3091eea0e4', theme: "vertical", value: this.selectedValues, "on-value-changed": (event) => {
603
+ return h("div", { key: '342900ae923094f2746fd43917743d01efba942e', class: `checkboxgroup__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '8f3b470274047b355741b438a4e15c7c46504f5a', class: 'checkboxgroup__wrapper--flex' }, h("vaadin-checkbox", { key: 'c7a74f9da877304f4d71607d58eba90dd0a29de7', class: 'checkbox__input', checked: this.selectedValues.length === this.options.length || this.defaultValue === 'true', indeterminate: this.selectedValues.length > 0 && this.selectedValues.length < this.options.length, onChange: (e) => this.handleParentCheckbox(e) }, this.renderLabel()), this.tooltip &&
604
+ h("img", { key: '75d807ad544e043a2e3beed46bf0c7dfa2125324', class: 'checkboxgroup__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), h("small", { key: '4b17e1e613c7561fb3c99f334926544ef2ba787a', class: 'checkboxgroup__error-message' }, this.errorMessage), this.showCheckboxes && (h("vaadin-checkbox-group", { key: '9a8d573a7cb48bb2d68cceec5f39f1e0886ea05f', theme: "vertical", value: this.selectedValues, "on-value-changed": (event) => {
490
605
  this.selectedValues = event.detail.value;
491
606
  } }, this.options.map((checkbox) => h("vaadin-checkbox", { class: 'checkbox__input', name: checkbox.name, value: checkbox.name, label: checkbox.displayName })))));
492
607
  }
493
608
  get element() { return getElement(this); }
494
609
  static get watchers() { return {
495
- "clientStyling": ["handleStylingChange"],
610
+ "clientStyling": ["handleClientStylingChange"],
496
611
  "isValid": ["validityChanged"],
497
612
  "selectedValues": ["setValue"],
498
613
  "emitValue": ["emitValueHandler"]
@@ -509,11 +624,6 @@ const CheckboxInput = class {
509
624
  this.sendValidityState = createEvent(this, "sendValidityState", 7);
510
625
  this.sendInputValue = createEvent(this, "sendInputValue", 7);
511
626
  this.value = '';
512
- this.setClientStyling = () => {
513
- let sheet = document.createElement('style');
514
- sheet.innerHTML = this.clientStyling;
515
- this.stylingContainer.prepend(sheet);
516
- };
517
627
  this.name = undefined;
518
628
  this.displayName = undefined;
519
629
  this.defaultValue = '';
@@ -523,14 +633,15 @@ const CheckboxInput = class {
523
633
  this.language = undefined;
524
634
  this.emitValue = undefined;
525
635
  this.clientStyling = '';
636
+ this.mbSource = undefined;
526
637
  this.errorMessage = undefined;
527
638
  this.isValid = undefined;
528
- this.limitStylingAppends = false;
529
639
  this.showTooltip = false;
530
640
  }
531
- handleStylingChange(newValue, oldValue) {
532
- if (newValue !== oldValue)
533
- this.setClientStyling();
641
+ handleClientStylingChange(newValue, oldValue) {
642
+ if (newValue !== oldValue) {
643
+ setClientStyling(this.stylingContainer, this.clientStyling);
644
+ }
534
645
  }
535
646
  validityChanged() {
536
647
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -555,16 +666,17 @@ const CheckboxInput = class {
555
666
  this.showTooltip = false;
556
667
  }
557
668
  }
558
- componentDidRender() {
559
- // start custom styling area
560
- if (!this.limitStylingAppends && this.stylingContainer) {
561
- if (this.clientStyling)
562
- this.setClientStyling();
563
- this.limitStylingAppends = true;
669
+ handleClientStyling() {
670
+ if (window.emMessageBus !== undefined) {
671
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
672
+ return;
673
+ }
674
+ if (this.clientStyling) {
675
+ setClientStyling(this.stylingContainer, this.clientStyling);
564
676
  }
565
- // end custom styling area
566
677
  }
567
678
  componentDidLoad() {
679
+ this.handleClientStyling();
568
680
  this.inputReference = this.vaadinCheckbox.querySelector('input');
569
681
  if (this.defaultValue) {
570
682
  this.value = this.defaultValue;
@@ -599,10 +711,10 @@ const CheckboxInput = class {
599
711
  return null;
600
712
  }
601
713
  render() {
602
- return (h("div", { key: '80ed581cec5bb009ea5ea009f11c6453fe24ef7b', class: `checkbox__wrapper ${this.name}__input`, ref: (el) => (this.stylingContainer = el) }, h("vaadin-checkbox", { key: '42d793f607af77435f629218f9bdac7736522bc3', class: "checkbox__input", required: this.validation.mandatory, checked: this.defaultValue === 'true', onChange: (e) => this.handleCheckbox(e), "error-message": !this.isValid && this.errorMessage, ref: (el) => (this.vaadinCheckbox = el) }, this.renderLabel()), this.tooltip && (h("img", { key: 'ce3870810ede8f3905fd8c07c0892ab0d909bab5', class: "checkboxgroup__tooltip-icon", src: tooltipIconSvg, alt: "", ref: (el) => (this.tooltipIconReference = el), onClick: () => (this.showTooltip = !this.showTooltip) })), this.renderTooltip()));
714
+ return (h("div", { key: 'a8d8bf6aa2001b6aee44d728a198244819ae169e', class: `checkbox__wrapper ${this.name}__input`, ref: (el) => (this.stylingContainer = el) }, h("vaadin-checkbox", { key: '13a5589a78bef4277922535e59c5718d36b1f318', class: "checkbox__input", required: this.validation.mandatory, checked: this.defaultValue === 'true', onChange: (e) => this.handleCheckbox(e), "error-message": !this.isValid && this.errorMessage, ref: (el) => (this.vaadinCheckbox = el) }, this.renderLabel()), this.tooltip && (h("img", { key: '008bb9a318c914b4b40e80b15080f7f174cc1262', class: "checkboxgroup__tooltip-icon", src: tooltipIconSvg, alt: "", ref: (el) => (this.tooltipIconReference = el), onClick: () => (this.showTooltip = !this.showTooltip) })), this.renderTooltip()));
603
715
  }
604
716
  static get watchers() { return {
605
- "clientStyling": ["handleStylingChange"],
717
+ "clientStyling": ["handleClientStylingChange"],
606
718
  "isValid": ["validityChanged"],
607
719
  "emitValue": ["emitValueHandler"]
608
720
  }; }
@@ -5993,11 +6105,6 @@ const DateInput = class {
5993
6105
  const date = parse(inputValue, this.dateFormat, new Date());
5994
6106
  return { year: date.getFullYear(), month: date.getMonth(), day: date.getDate() };
5995
6107
  };
5996
- this.setClientStyling = () => {
5997
- let sheet = document.createElement('style');
5998
- sheet.innerHTML = this.clientStyling;
5999
- this.stylingContainer.prepend(sheet);
6000
- };
6001
6108
  this.handleDocumentIdUpdate = (e) => {
6002
6109
  if (this.name !== CONSTANTS.BIRTHDATE) {
6003
6110
  return;
@@ -6084,9 +6191,9 @@ const DateInput = class {
6084
6191
  this.emitOnClick = false;
6085
6192
  this.enableSouthAfricanMode = undefined;
6086
6193
  this.enableManualDateInput = false;
6194
+ this.mbSource = undefined;
6087
6195
  this.errorMessage = undefined;
6088
6196
  this.isValid = undefined;
6089
- this.limitStylingAppends = false;
6090
6197
  this.showTooltip = false;
6091
6198
  }
6092
6199
  get formattedValue() {
@@ -6095,9 +6202,10 @@ const DateInput = class {
6095
6202
  const parsedDate = parse(this.value, 'yyyy-MM-dd', new Date());
6096
6203
  return format(parsedDate, this.dateFormat);
6097
6204
  }
6098
- handleStylingChange(newValue, oldValue) {
6099
- if (newValue !== oldValue)
6100
- this.setClientStyling();
6205
+ handleClientStylingChange(newValue, oldValue) {
6206
+ if (newValue !== oldValue) {
6207
+ setClientStyling(this.stylingContainer, this.clientStyling);
6208
+ }
6101
6209
  }
6102
6210
  validityChanged() {
6103
6211
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -6135,17 +6243,18 @@ const DateInput = class {
6135
6243
  this.minDate = parse(((_a = this.validation.min) === null || _a === void 0 ? void 0 : _a.toString()) || '', 'yyyy-MM-dd', new Date());
6136
6244
  this.maxDate = parse(((_b = this.validation.max) === null || _b === void 0 ? void 0 : _b.toString()) || '', 'yyyy-MM-dd', new Date());
6137
6245
  }
6138
- componentDidRender() {
6139
- // start custom styling area
6140
- if (!this.limitStylingAppends && this.stylingContainer) {
6141
- if (this.clientStyling)
6142
- this.setClientStyling();
6143
- this.limitStylingAppends = true;
6246
+ handleClientStyling() {
6247
+ if (window.emMessageBus !== undefined) {
6248
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
6249
+ return;
6250
+ }
6251
+ if (this.clientStyling) {
6252
+ setClientStyling(this.stylingContainer, this.clientStyling);
6144
6253
  }
6145
- // end custom styling area
6146
6254
  }
6147
6255
  componentDidLoad() {
6148
6256
  var _a;
6257
+ this.handleClientStyling();
6149
6258
  this.datePicker = this.element.shadowRoot.querySelector('vaadin-date-picker');
6150
6259
  this.inputReference = this.element.shadowRoot.querySelector('input');
6151
6260
  if (this.datePicker) {
@@ -6300,12 +6409,12 @@ const DateInput = class {
6300
6409
  if (this.touched) {
6301
6410
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
6302
6411
  }
6303
- return h("div", { key: 'f8011520dee6f11203da18cc27a6f278283daace', class: `date__wrapper ${this.autofilled ? 'date__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("label", { key: 'e1e21a234b5f20f05a5c2d6eb38095bb50748ad6', class: `date__label ${this.validation.mandatory ? 'date__label--required' : ''}}`, htmlFor: `${this.name}__input` }, this.displayName, h("span", { key: '8dbd7ecb2e8fc686afc02a15a247f5f78484ec22', class: this.validation.mandatory ? 'date__label--required' : '' })), h("vaadin-date-picker", { key: '40b5106d0b80799cd81b154889461fa5378264b8', id: `${this.name}__input`, type: 'date', class: `date__input ${invalidClass} ${this.enableManualDateInput && 'date__manual-mode'}`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.placeholder}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onChange: (e) => this.handleInput(e), onValidated: () => this.handleValidated(), autoOpenDisabled: this.enableManualDateInput }), h("small", { key: 'cd96dd3bb68896ea44d5071d783a7a2e2d75738f', class: 'date__error-message' }, this.errorMessage), this.tooltip &&
6304
- h("img", { key: '971aeba271d68264bb9ff23b86bed878699d81b1', class: 'date__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
6412
+ return h("div", { key: 'ffff8be16fb22a41ea8c5168a79e40b9f410c63b', class: `date__wrapper ${this.autofilled ? 'date__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("label", { key: '60da1ad0bc4cc7757e6f1096866667a97bd146b5', class: `date__label ${this.validation.mandatory ? 'date__label--required' : ''}}`, htmlFor: `${this.name}__input` }, this.displayName, h("span", { key: '450b4638efa34f4490035b0d99b0b186f053a2d0', class: this.validation.mandatory ? 'date__label--required' : '' })), h("vaadin-date-picker", { key: '421875a710bb4508e3218d28bf2c28dcd0e9793b', id: `${this.name}__input`, type: 'date', class: `date__input ${invalidClass} ${this.enableManualDateInput && 'date__manual-mode'}`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.placeholder}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onChange: (e) => this.handleInput(e), onValidated: () => this.handleValidated(), autoOpenDisabled: this.enableManualDateInput }), h("small", { key: '33a6fed8057a84cb648f94a318c3ec0b1e495fff', class: 'date__error-message' }, this.errorMessage), this.tooltip &&
6413
+ h("img", { key: 'd91fcd13e1ae384b67b6d478834b65136ab77b77', class: 'date__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
6305
6414
  }
6306
6415
  get element() { return getElement(this); }
6307
6416
  static get watchers() { return {
6308
- "clientStyling": ["handleStylingChange"],
6417
+ "clientStyling": ["handleClientStylingChange"],
6309
6418
  "isValid": ["validityChanged"],
6310
6419
  "emitValue": ["emitValueHandler"],
6311
6420
  "enableSouthAfricanMode": ["handleCustomRegistrationChange"]
@@ -6340,11 +6449,6 @@ const EmailInput = class {
6340
6449
  this.errorMessage = this.setErrorMessage();
6341
6450
  this.touched = true;
6342
6451
  };
6343
- this.setClientStyling = () => {
6344
- let sheet = document.createElement('style');
6345
- sheet.innerHTML = this.clientStyling;
6346
- this.stylingContainer.prepend(sheet);
6347
- };
6348
6452
  this.name = undefined;
6349
6453
  this.displayName = undefined;
6350
6454
  this.placeholder = undefined;
@@ -6356,14 +6460,15 @@ const EmailInput = class {
6356
6460
  this.emitValue = undefined;
6357
6461
  this.isDuplicateInput = undefined;
6358
6462
  this.clientStyling = '';
6463
+ this.mbSource = undefined;
6359
6464
  this.errorMessage = undefined;
6360
6465
  this.isValid = undefined;
6361
- this.limitStylingAppends = false;
6362
6466
  this.showTooltip = false;
6363
6467
  }
6364
- handleStylingChange(newValue, oldValue) {
6365
- if (newValue !== oldValue)
6366
- this.setClientStyling();
6468
+ handleClientStylingChange(newValue, oldValue) {
6469
+ if (newValue !== oldValue) {
6470
+ setClientStyling(this.stylingContainer, this.clientStyling);
6471
+ }
6367
6472
  }
6368
6473
  validityChanged() {
6369
6474
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -6398,16 +6503,17 @@ const EmailInput = class {
6398
6503
  connectedCallback() {
6399
6504
  this.validationPattern = this.setPattern();
6400
6505
  }
6401
- componentDidRender() {
6402
- // start custom styling area
6403
- if (!this.limitStylingAppends && this.stylingContainer) {
6404
- if (this.clientStyling)
6405
- this.setClientStyling();
6406
- this.limitStylingAppends = true;
6506
+ handleClientStyling() {
6507
+ if (window.emMessageBus !== undefined) {
6508
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
6509
+ return;
6510
+ }
6511
+ if (this.clientStyling) {
6512
+ setClientStyling(this.stylingContainer, this.clientStyling);
6407
6513
  }
6408
- // end custom styling area
6409
6514
  }
6410
6515
  componentDidLoad() {
6516
+ this.handleClientStyling();
6411
6517
  this.isValid = this.setValidity();
6412
6518
  if (this.defaultValue) {
6413
6519
  this.value = this.defaultValue;
@@ -6453,11 +6559,11 @@ const EmailInput = class {
6453
6559
  if (this.touched) {
6454
6560
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
6455
6561
  }
6456
- return h("div", { key: '723df8f3a6e8c57fe19082400971daf50f5c981d', class: `email__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '581d6e02b63d1c659ae44424518f64db450d5365', class: 'email__wrapper--flex' }, h("label", { key: '11e6a848f6f04903989b3ab2075865f6e279c087', class: `email__label ${this.validation.mandatory ? 'email__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '73e11520cffbddda1a2aeb4b560e7f4cf456e2fb', class: 'email__wrapper--relative' }, this.tooltip &&
6457
- h("img", { key: 'e8571ce14b9b98311daf1712ebde7d6da9b5a6a6', class: 'email__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: 'dd05ef0b4d906598c6d5775a78ccbdc9ea81cb8c', id: `${this.name}__input`, type: 'email', class: `email__input ${invalidClass}`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, pattern: this.validationPattern, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { key: '0d2d41207f8274d8c6f69143131265ef5b458689', class: 'email__error-message' }, this.errorMessage));
6562
+ return h("div", { key: 'f852525fe8d8b695e638fdd83e8b0c2c20d98771', class: `email__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: 'd6a6dec4e76ba1fbe15bed09f82cecde12cabe1a', class: 'email__wrapper--flex' }, h("label", { key: '4498ae1bac287cb80544c4d743afad2ec678e3bd', class: `email__label ${this.validation.mandatory ? 'email__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: 'e54d1258e48f54304a553cffb83466e4a4fadb4c', class: 'email__wrapper--relative' }, this.tooltip &&
6563
+ h("img", { key: '29d7b95f22c8cb70d505f74a7ea18284faa908ee', class: 'email__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: '08754b178e395f26c1d8a61ff667b91df3fb0ec7', id: `${this.name}__input`, type: 'email', class: `email__input ${invalidClass}`, value: this.defaultValue, readOnly: this.autofilled, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, pattern: this.validationPattern, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { key: '3024a57f5d0897f34013eb4397d78babc2333192', class: 'email__error-message' }, this.errorMessage));
6458
6564
  }
6459
6565
  static get watchers() { return {
6460
- "clientStyling": ["handleStylingChange"],
6566
+ "clientStyling": ["handleClientStylingChange"],
6461
6567
  "isValid": ["validityChanged"],
6462
6568
  "emitValue": ["emitValueHandler"]
6463
6569
  }; }
@@ -13131,32 +13237,6 @@ const GeneralInput = class {
13131
13237
  constructor(hostRef) {
13132
13238
  registerInstance(this, hostRef);
13133
13239
  this.registrationWidgetLoaded = createEvent(this, "registrationWidgetLoaded", 7);
13134
- this.setClientStyling = () => {
13135
- let sheet = document.createElement('style');
13136
- sheet.innerHTML = this.clientStyling;
13137
- this.host.shadowRoot.prepend(sheet);
13138
- };
13139
- this.setStreamStyling = (domain) => {
13140
- if (window.emMessageBus) {
13141
- const sheet = document.createElement('style');
13142
- this.stylingSubscription = window.emMessageBus.subscribe(domain, (data) => {
13143
- sheet.innerHTML = data;
13144
- this.clientStyling = data;
13145
- this.host.shadowRoot.prepend(sheet);
13146
- });
13147
- }
13148
- };
13149
- this.setClientStylingURL = () => {
13150
- let url = new URL(this.clientStylingUrl);
13151
- let cssFile = document.createElement('style');
13152
- fetch(url.href)
13153
- .then((res) => res.text())
13154
- .then((data) => {
13155
- cssFile.innerHTML = data;
13156
- this.clientStyling = data;
13157
- setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
13158
- });
13159
- };
13160
13240
  this.handleClick = (event) => {
13161
13241
  if (this.emitOnClick) {
13162
13242
  event.stopPropagation();
@@ -13193,15 +13273,17 @@ const GeneralInput = class {
13193
13273
  this.enableManualDateInput = false;
13194
13274
  this.pinAttemptsExceeded = undefined;
13195
13275
  this.mbSource = undefined;
13196
- this.limitStylingAppends = false;
13197
13276
  }
13198
- handleStylingChange(newValue, oldValue) {
13199
- if (newValue !== oldValue)
13200
- this.setClientStyling();
13277
+ handleClientStylingChange(newValue, oldValue) {
13278
+ if (newValue !== oldValue) {
13279
+ setClientStyling(this.stylingContainer, this.clientStyling);
13280
+ }
13201
13281
  }
13202
- handleStylingUrlChange(newValue, oldValue) {
13203
- if (newValue !== oldValue)
13204
- this.setClientStylingURL();
13282
+ handleClientStylingChangeURL(newValue, oldValue) {
13283
+ if (newValue !== oldValue) {
13284
+ if (this.clientStylingUrl)
13285
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
13286
+ }
13205
13287
  }
13206
13288
  connectedCallback() {
13207
13289
  if (this.translationUrl) {
@@ -13212,51 +13294,50 @@ const GeneralInput = class {
13212
13294
  this.stylingSubscription && this.stylingSubscription.unsubscribe();
13213
13295
  }
13214
13296
  componentDidLoad() {
13297
+ this.handleClientStyling();
13215
13298
  this.registrationWidgetLoaded.emit();
13216
13299
  window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
13217
- if (!this.limitStylingAppends && this.host) {
13218
- if (window.emMessageBus != undefined) {
13219
- this.setStreamStyling(`${this.mbSource}.Style`);
13220
- }
13221
- else {
13222
- if (this.clientStyling)
13223
- this.setClientStyling();
13224
- if (this.clientStylingUrl)
13225
- this.setClientStylingURL();
13226
- this.limitStylingAppends = true;
13227
- }
13300
+ }
13301
+ handleClientStyling() {
13302
+ if (window.emMessageBus !== undefined) {
13303
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
13304
+ return;
13228
13305
  }
13306
+ if (this.clientStyling)
13307
+ setClientStyling(this.stylingContainer, this.clientStyling);
13308
+ if (this.clientStylingUrl)
13309
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
13229
13310
  }
13230
13311
  renderInput() {
13231
13312
  var _a;
13232
13313
  switch ((_a = this.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) {
13233
13314
  case 'text':
13234
13315
  if (this.haspostalcodelookup && this.name === 'PostalCode') {
13235
- return h("postalcode-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, postalcodelength: this.postalcodelength, addresses: this.addresses, ignoreCountry: this.ignoreCountry });
13316
+ return h("postalcode-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, postalcodelength: this.postalcodelength, addresses: this.addresses, ignoreCountry: this.ignoreCountry, "mb-source": this.mbSource });
13236
13317
  }
13237
13318
  else {
13238
- return h("text-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, haspostalcodelookup: this.haspostalcodelookup, "enable-south-african-mode": this.enableSouthAfricanMode });
13319
+ return h("text-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, haspostalcodelookup: this.haspostalcodelookup, "enable-south-african-mode": this.enableSouthAfricanMode, "mb-source": this.mbSource });
13239
13320
  }
13240
13321
  case 'email':
13241
- return h("email-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
13322
+ return h("email-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "mb-source": this.mbSource });
13242
13323
  case 'number':
13243
- return h("number-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
13324
+ return h("number-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "mb-source": this.mbSource });
13244
13325
  case 'checkbox':
13245
- return h("checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, defaultValue: this.defaultValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip });
13326
+ return h("checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, defaultValue: this.defaultValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, "mb-source": this.mbSource });
13246
13327
  case 'checkboxgroup':
13247
- return h("checkbox-group-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options });
13328
+ return h("checkbox-group-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options, "mb-source": this.mbSource });
13248
13329
  case 'togglecheckbox':
13249
- return h("toggle-checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options, "emit-on-click": this.emitOnClick });
13330
+ return h("toggle-checkbox-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, options: this.options, "emit-on-click": this.emitOnClick, "mb-source": this.mbSource });
13250
13331
  case 'datetime':
13251
- return h("date-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, dateFormat: this.dateFormat, "emit-on-click": this.emitOnClick, "enable-south-african-mode": this.enableSouthAfricanMode, "enable-manual-date-input": this.enableManualDateInput });
13332
+ return h("date-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, dateFormat: this.dateFormat, "emit-on-click": this.emitOnClick, "enable-south-african-mode": this.enableSouthAfricanMode, "enable-manual-date-input": this.enableManualDateInput, "mb-source": this.mbSource });
13252
13333
  case 'password':
13253
- return h("password-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, hidePasswordComplexity: this.hidePasswordComplexity, "no-validation": this.noValidation, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "enable-south-african-mode": this.enableSouthAfricanMode });
13334
+ return h("password-input", { name: this.name, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, autofilled: this.autofilled, emitValue: this.emitValue, language: this.language, isDuplicateInput: this.isDuplicateInput, hidePasswordComplexity: this.hidePasswordComplexity, "no-validation": this.noValidation, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "enable-south-african-mode": this.enableSouthAfricanMode, "mb-source": this.mbSource });
13254
13335
  case 'radio':
13255
- return h("radio-input", { name: this.name, displayName: this.displayName, optionsGroup: this.options, validation: this.validation, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling });
13336
+ return h("radio-input", { name: this.name, displayName: this.displayName, optionsGroup: this.options, validation: this.validation, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, "mb-source": this.mbSource });
13256
13337
  case 'tel':
13257
- return h("tel-input", { name: this.name, action: this.action, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language, autofilled: this.autofilled, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
13338
+ return h("tel-input", { name: this.name, action: this.action, displayName: this.displayName, validation: this.validation, defaultValue: this.defaultValue, emitValue: this.emitValue, language: this.language, autofilled: this.autofilled, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "mb-source": this.mbSource });
13258
13339
  case 'dropdown':
13259
- return h("select-input", { name: this.name, action: this.action, defaultValue: this.defaultValue, displayName: this.displayName, options: this.options, validation: this.validation, emitValue: this.emitValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder });
13340
+ return h("select-input", { name: this.name, action: this.action, defaultValue: this.defaultValue, displayName: this.displayName, options: this.options, validation: this.validation, emitValue: this.emitValue, autofilled: this.autofilled, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, placeholder: this.placeholder, "mb-source": this.mbSource });
13260
13341
  case 'twofa':
13261
13342
  return h("twofa-input", { name: this.name, displayName: this.displayName, validation: this.validation, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: this.tooltip, destination: this.twofaDestination, "resend-interval-seconds": this.twofaResendIntervalSeconds, "enable-south-african-mode": this.enableSouthAfricanMode, "pin-attempts-exceeded": this.pinAttemptsExceeded, "mb-source": this.mbSource });
13262
13343
  case 'label':
@@ -13271,12 +13352,12 @@ const GeneralInput = class {
13271
13352
  }
13272
13353
  }
13273
13354
  render() {
13274
- return (h(Host, { key: '7a7805c641082de9c5da4859187765002ab6f32d', class: `general-input--${this.name}`, onClick: this.handleClick }, this.renderInput()));
13355
+ return (h(Host, { key: '12e3e43442ba3fd4a47bbc5c05456eb019405b1e', class: `general-input--${this.name}`, onClick: this.handleClick }, this.renderInput()));
13275
13356
  }
13276
13357
  get host() { return getElement(this); }
13277
13358
  static get watchers() { return {
13278
- "clientStyling": ["handleStylingChange"],
13279
- "clientStylingUrl": ["handleStylingUrlChange"]
13359
+ "clientStyling": ["handleClientStylingChange"],
13360
+ "clientStylingUrl": ["handleClientStylingChangeURL"]
13280
13361
  }; }
13281
13362
  };
13282
13363
  GeneralInput.style = GeneralInputStyle0;
@@ -14434,32 +14515,6 @@ const GeneralRegistration = class {
14434
14515
  this.getIgnoreCountry = (input) => {
14435
14516
  return input.name === 'PostalCode' && this.haspostalcodelookup && !this.listOfInputs.some(i => i.name === 'CountryCode');
14436
14517
  };
14437
- this.setClientStyling = () => {
14438
- let sheet = document.createElement('style');
14439
- sheet.innerHTML = this.clientStyling;
14440
- this.host.shadowRoot.prepend(sheet);
14441
- };
14442
- this.setClientStylingURL = () => {
14443
- let url = new URL(this.clientStylingUrl);
14444
- let cssFile = document.createElement('style');
14445
- fetch(url.href)
14446
- .then((res) => res.text())
14447
- .then((data) => {
14448
- cssFile.innerHTML = data;
14449
- this.clientStyling = data;
14450
- setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
14451
- });
14452
- };
14453
- this.setStreamStyling = (domain) => {
14454
- if (window.emMessageBus) {
14455
- const sheet = document.createElement('style');
14456
- this.stylingSubscription = window.emMessageBus.subscribe(domain, (data) => {
14457
- sheet.innerHTML = data;
14458
- this.clientStyling = data;
14459
- this.host.shadowRoot.prepend(sheet);
14460
- });
14461
- }
14462
- };
14463
14518
  // handles sending a custom event for initial interaction with the registration form
14464
14519
  this.handleInitialClick = (e) => {
14465
14520
  if (!this.isInitalInteraction)
@@ -14488,7 +14543,6 @@ const GeneralRegistration = class {
14488
14543
  this.isLoadingPOST = false;
14489
14544
  this.registrationStep = '';
14490
14545
  this.forms = {};
14491
- this.limitStylingAppends = false;
14492
14546
  this.autofilled = false;
14493
14547
  this.isInitalInteraction = true;
14494
14548
  this.addresses = [];
@@ -14498,13 +14552,16 @@ const GeneralRegistration = class {
14498
14552
  this.registrationStepUpdated.emit(this.registrationStep);
14499
14553
  window.postMessage({ type: 'registrationStepUpdated', step: this.registrationStep }, window.location.href);
14500
14554
  }
14501
- handleStylingChange(newValue, oldValue) {
14502
- if (newValue !== oldValue)
14503
- this.setClientStyling();
14555
+ handleClientStylingChange(newValue, oldValue) {
14556
+ if (newValue !== oldValue) {
14557
+ setClientStyling(this.stylingContainer, this.clientStyling);
14558
+ }
14504
14559
  }
14505
- handleStylingUrlChange(newValue, oldValue) {
14506
- if (newValue !== oldValue)
14507
- this.setClientStylingURL();
14560
+ handleClientStylingChangeURL(newValue, oldValue) {
14561
+ if (newValue !== oldValue) {
14562
+ if (this.clientStylingUrl)
14563
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
14564
+ }
14508
14565
  }
14509
14566
  setFormValidity() {
14510
14567
  this.errorMessage = '';
@@ -14683,21 +14740,20 @@ const GeneralRegistration = class {
14683
14740
  console.error(err);
14684
14741
  });
14685
14742
  }
14743
+ handleClientStyling() {
14744
+ if (window.emMessageBus !== undefined) {
14745
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
14746
+ return;
14747
+ }
14748
+ if (this.clientStyling)
14749
+ setClientStyling(this.stylingContainer, this.clientStyling);
14750
+ if (this.clientStylingUrl)
14751
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
14752
+ }
14686
14753
  componentDidLoad() {
14687
14754
  this.registrationWidgetLoaded.emit();
14688
14755
  window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
14689
- if (!this.limitStylingAppends && this.host) {
14690
- if (window.emMessageBus != undefined) {
14691
- this.setStreamStyling(`${this.mbSource}.Style`);
14692
- }
14693
- else {
14694
- if (this.clientStyling)
14695
- this.setClientStyling();
14696
- if (this.clientStylingUrl)
14697
- this.setClientStylingURL();
14698
- this.limitStylingAppends = true;
14699
- }
14700
- }
14756
+ this.handleClientStyling();
14701
14757
  }
14702
14758
  disconnectedCallback() {
14703
14759
  this.stylingSubscription && this.stylingSubscription.unsubscribe();
@@ -15436,13 +15492,13 @@ const GeneralRegistration = class {
15436
15492
  else if (!this.isLoading && this.registerErrors) {
15437
15493
  return this.renderErrorMessage(this.errorMessage);
15438
15494
  }
15439
- return (h("div", { class: `registration registration__${this.registrationStep}` }, this.renderForm(), !this.buttonInsideForm && this.renderButtons()));
15495
+ return (h("div", { ref: (el) => (this.stylingContainer = el), class: `registration registration__${this.registrationStep}` }, this.renderForm(), !this.buttonInsideForm && this.renderButtons()));
15440
15496
  }
15441
15497
  get host() { return getElement(this); }
15442
15498
  static get watchers() { return {
15443
15499
  "registrationStep": ["sendStep"],
15444
- "clientStyling": ["handleStylingChange"],
15445
- "clientStylingUrl": ["handleStylingUrlChange"],
15500
+ "clientStyling": ["handleClientStylingChange"],
15501
+ "clientStylingUrl": ["handleClientStylingChangeURL"],
15446
15502
  "forms": ["setFormValidity"],
15447
15503
  "btag": ["addBtag"]
15448
15504
  }; }
@@ -15476,11 +15532,6 @@ const NumberInput = class {
15476
15532
  this.errorMessage = this.setErrorMessage();
15477
15533
  this.touched = true;
15478
15534
  };
15479
- this.setClientStyling = () => {
15480
- let sheet = document.createElement('style');
15481
- sheet.innerHTML = this.clientStyling;
15482
- this.stylingContainer.prepend(sheet);
15483
- };
15484
15535
  this.name = undefined;
15485
15536
  this.displayName = undefined;
15486
15537
  this.placeholder = undefined;
@@ -15491,14 +15542,15 @@ const NumberInput = class {
15491
15542
  this.language = undefined;
15492
15543
  this.emitValue = undefined;
15493
15544
  this.clientStyling = '';
15545
+ this.mbSource = undefined;
15494
15546
  this.errorMessage = undefined;
15495
15547
  this.isValid = undefined;
15496
- this.limitStylingAppends = false;
15497
15548
  this.showTooltip = false;
15498
15549
  }
15499
- handleStylingChange(newValue, oldValue) {
15500
- if (newValue !== oldValue)
15501
- this.setClientStyling();
15550
+ handleClientStylingChange(newValue, oldValue) {
15551
+ if (newValue !== oldValue) {
15552
+ setClientStyling(this.stylingContainer, this.clientStyling);
15553
+ }
15502
15554
  }
15503
15555
  validityChanged() {
15504
15556
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -15526,16 +15578,17 @@ const NumberInput = class {
15526
15578
  connectedCallback() {
15527
15579
  this.validationPattern = this.setPattern();
15528
15580
  }
15529
- componentDidRender() {
15530
- // start custom styling area
15531
- if (!this.limitStylingAppends && this.stylingContainer) {
15532
- if (this.clientStyling)
15533
- this.setClientStyling();
15534
- this.limitStylingAppends = true;
15581
+ handleClientStyling() {
15582
+ if (window.emMessageBus !== undefined) {
15583
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
15584
+ return;
15585
+ }
15586
+ if (this.clientStyling) {
15587
+ setClientStyling(this.stylingContainer, this.clientStyling);
15535
15588
  }
15536
- // end custom styling area
15537
15589
  }
15538
15590
  componentDidLoad() {
15591
+ this.handleClientStyling();
15539
15592
  this.isValid = this.setValidity();
15540
15593
  if (this.defaultValue) {
15541
15594
  this.value = this.defaultValue;
@@ -15576,11 +15629,11 @@ const NumberInput = class {
15576
15629
  if (this.touched) {
15577
15630
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
15578
15631
  }
15579
- return h("div", { key: 'aea370172d0e55d32dc665a1c340c734334e1caf', class: `number__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '10e16d10b956c5a647bc68ecffbc2eb0b06fa92a', class: 'number__wrapper--flex' }, h("label", { key: '0827d47c7278c6fdf8ebdd1dff03b91c39be6812', class: `number__label ${this.validation.mandatory ? 'number__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: 'cb868d01e8555f5e3333240f54d86f0a56641d0f', class: 'number__wrapper--relative' }, this.tooltip &&
15580
- h("img", { key: '1aa2b16b59f4bfd4b1dadf2641ec6cb4cfc251bf', class: 'number__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: '365b70a2eb333878d367d1d414ee0e296c91b3ec', ref: (el) => this.inputReference = el, type: "number", value: this.defaultValue, readOnly: this.autofilled, id: `${this.name}__input`, class: `number__input ${invalidClass}`, pattern: this.validationPattern, placeholder: `${this.placeholder}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { key: 'a8639df7ef1e98807a7daffc9da4afd347b1c292', class: 'number__error-message' }, this.errorMessage));
15632
+ return h("div", { key: 'bd11140dc6c8ddb6b800d4fe6544df733c5157c4', class: `number__wrapper ${this.autofilled ? 'number__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: 'c8318c687bc471fc225b9aba52686e38ecb400de', class: 'number__wrapper--flex' }, h("label", { key: '7eaf64057ef71b07a0defc1e372fd85baab2bd68', class: `number__label ${this.validation.mandatory ? 'number__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '99f4151f50a7fb0abb9a8e53bacc8c8bd303d659', class: 'number__wrapper--relative' }, this.tooltip &&
15633
+ h("img", { key: '875d6284697dc06ac05c682509856faeade3d8be', class: 'number__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: 'f1f563567cde4a744c68e27ab91a3d795f596be6', ref: (el) => this.inputReference = el, type: "number", value: this.defaultValue, readOnly: this.autofilled, id: `${this.name}__input`, class: `number__input ${invalidClass}`, pattern: this.validationPattern, placeholder: `${this.placeholder}`, required: this.validation.mandatory, max: this.validation.max, min: this.validation.min, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { key: '0226f04a059fd8763822483de42bd7e647040bf3', class: 'number__error-message' }, this.errorMessage));
15581
15634
  }
15582
15635
  static get watchers() { return {
15583
- "clientStyling": ["handleStylingChange"],
15636
+ "clientStyling": ["handleClientStylingChange"],
15584
15637
  "isValid": ["validityChanged"],
15585
15638
  "emitValue": ["emitValueHandler"]
15586
15639
  }; }
@@ -15629,11 +15682,6 @@ const PasswordInput = class {
15629
15682
  this.showPopup = true;
15630
15683
  this.calculateComplexity(this.value);
15631
15684
  };
15632
- this.setClientStyling = () => {
15633
- let sheet = document.createElement('style');
15634
- sheet.innerHTML = this.clientStyling;
15635
- this.stylingContainer.prepend(sheet);
15636
- };
15637
15685
  this.name = undefined;
15638
15686
  this.displayName = undefined;
15639
15687
  this.placeholder = undefined;
@@ -15648,17 +15696,18 @@ const PasswordInput = class {
15648
15696
  this.hidePasswordComplexity = false;
15649
15697
  this.clientStyling = '';
15650
15698
  this.enableSouthAfricanMode = undefined;
15699
+ this.mbSource = undefined;
15651
15700
  this.isValid = undefined;
15652
15701
  this.errorMessage = undefined;
15653
- this.limitStylingAppends = false;
15654
15702
  this.showTooltip = false;
15655
15703
  this.passwordComplexity = undefined;
15656
15704
  this.showPopup = undefined;
15657
15705
  this.value = '';
15658
15706
  }
15659
- handleStylingChange(newValue, oldValue) {
15660
- if (newValue !== oldValue)
15661
- this.setClientStyling();
15707
+ handleClientStylingChange(newValue, oldValue) {
15708
+ if (newValue !== oldValue) {
15709
+ setClientStyling(this.stylingContainer, this.clientStyling);
15710
+ }
15662
15711
  }
15663
15712
  validityChanged() {
15664
15713
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -15719,16 +15768,17 @@ const PasswordInput = class {
15719
15768
  this.showTooltip = false;
15720
15769
  }
15721
15770
  }
15722
- componentDidRender() {
15723
- // start custom styling area
15724
- if (!this.limitStylingAppends && this.stylingContainer) {
15725
- if (this.clientStyling)
15726
- this.setClientStyling();
15727
- this.limitStylingAppends = true;
15771
+ handleClientStyling() {
15772
+ if (window.emMessageBus !== undefined) {
15773
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
15774
+ return;
15775
+ }
15776
+ if (this.clientStyling) {
15777
+ setClientStyling(this.stylingContainer, this.clientStyling);
15728
15778
  }
15729
- // end custom styling area
15730
15779
  }
15731
15780
  componentDidLoad() {
15781
+ this.handleClientStyling();
15732
15782
  this.inputReference = this.element.shadowRoot.querySelector('input');
15733
15783
  this.passwordButton = this.element.shadowRoot.querySelector('vaadin-password-field-button');
15734
15784
  this.passwordButton.tabIndex = -1;
@@ -15835,8 +15885,8 @@ const PasswordInput = class {
15835
15885
  if (this.touched) {
15836
15886
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
15837
15887
  }
15838
- return h("div", { key: 'fe895585dd908f75eee4ba797dc9c02b237bed7f', class: `password__wrapper ${this.autofilled ? 'password__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '844bdb3dab98e62cc5d92a761b85adcdc44831d0', class: 'password__wrapper--flex' }, h("label", { key: '28041267a6df666e7df3660a907f995eff092ae1', class: `password__label ${this.validation.mandatory ? 'password__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '79c300643134802f04d8f909fe7bb3895911c88a', class: 'password__wrapper--relative' }, this.tooltip &&
15839
- h("img", { key: '43ae58549e42ba59054162c25887ec36eb826aaa', class: 'password__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("vaadin-password-field", { key: '0edcfed0ea65666537240f531e5239bd5b11181e', type: "password", id: `${this.name}__input`, class: `password__input ${invalidClass}`, name: this.name, readOnly: this.autofilled, value: this.defaultValue, required: this.validation.mandatory, maxlength: this.validation.maxLength, minlength: this.validation.minLength, pattern: this.validationPattern, placeholder: `${this.placeholder}`, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus }), !this.noValidation && h("small", { key: 'c8aeba074e66b771d745194fec535aa0b82de6d8', class: 'password__error-message' }, this.errorMessage), this.passwordComplexity &&
15888
+ return h("div", { key: '18213d251639938165f3e4ad58bdc904fb953fe2', class: `password__wrapper ${this.autofilled ? 'password__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '092c431b178682d0006cf6ad5c14b0a7e6fb5569', class: 'password__wrapper--flex' }, h("label", { key: '64c101b7d70305ecf09735234d902a6b33823551', class: `password__label ${this.validation.mandatory ? 'password__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '189929eefa1caf71a1be39f0d663eef914d241d5', class: 'password__wrapper--relative' }, this.tooltip &&
15889
+ h("img", { key: '95ee0d824b5be14ab4e62fc0b5f1731fe6ca5775', class: 'password__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("vaadin-password-field", { key: 'bf85dde83305233c566b1c50d0286548ba0f48a5', type: "password", id: `${this.name}__input`, class: `password__input ${invalidClass}`, name: this.name, readOnly: this.autofilled, value: this.defaultValue, required: this.validation.mandatory, maxlength: this.validation.maxLength, minlength: this.validation.minLength, pattern: this.validationPattern, placeholder: `${this.placeholder}`, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus }), !this.noValidation && h("small", { key: '3acbe164ff532bcfcd9e4a237a6f352df0cfdc2d', class: 'password__error-message' }, this.errorMessage), this.passwordComplexity &&
15840
15890
  this.showPopup &&
15841
15891
  !this.hidePasswordComplexity &&
15842
15892
  !this.isDuplicateInput &&
@@ -15846,7 +15896,7 @@ const PasswordInput = class {
15846
15896
  }
15847
15897
  get element() { return getElement(this); }
15848
15898
  static get watchers() { return {
15849
- "clientStyling": ["handleStylingChange"],
15899
+ "clientStyling": ["handleClientStylingChange"],
15850
15900
  "isValid": ["validityChanged"],
15851
15901
  "value": ["valueChanged"],
15852
15902
  "emitValue": ["emitValueHandler"]
@@ -15996,11 +16046,6 @@ const PostalCodeInput = class {
15996
16046
  targetInput.focus();
15997
16047
  }
15998
16048
  };
15999
- this.setClientStyling = () => {
16000
- let sheet = document.createElement('style');
16001
- sheet.innerHTML = this.clientStyling;
16002
- this.stylingContainer.prepend(sheet);
16003
- };
16004
16049
  this.handleOutsideClick = (event) => {
16005
16050
  if (!this.openAddressDropdown)
16006
16051
  return;
@@ -16026,9 +16071,9 @@ const PostalCodeInput = class {
16026
16071
  this.postalcodelength = undefined;
16027
16072
  this.addresses = undefined;
16028
16073
  this.ignoreCountry = false;
16074
+ this.mbSource = undefined;
16029
16075
  this.isValid = undefined;
16030
16076
  this.errorMessage = '';
16031
- this.limitStylingAppends = false;
16032
16077
  this.showTooltip = false;
16033
16078
  this.selectedCountryCode = '';
16034
16079
  this.currentPostalCode = '';
@@ -16037,9 +16082,10 @@ const PostalCodeInput = class {
16037
16082
  this.refreshTrigger = 0;
16038
16083
  this.isFetchingAddresses = false;
16039
16084
  }
16040
- handleStylingChange(newValue, oldValue) {
16041
- if (newValue !== oldValue)
16042
- this.setClientStyling();
16085
+ handleClientStylingChange(newValue, oldValue) {
16086
+ if (newValue !== oldValue) {
16087
+ setClientStyling(this.stylingContainer, this.clientStyling);
16088
+ }
16043
16089
  }
16044
16090
  validityChanged() {
16045
16091
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -16100,19 +16146,22 @@ const PostalCodeInput = class {
16100
16146
  connectedCallback() {
16101
16147
  this.validationPattern = this.setPattern();
16102
16148
  }
16103
- componentDidRender() {
16104
- if (!this.limitStylingAppends && this.stylingContainer) {
16105
- if (this.clientStyling)
16106
- this.setClientStyling();
16107
- this.limitStylingAppends = true;
16108
- }
16109
- }
16110
16149
  componentWillLoad() {
16111
16150
  if (this.defaultValue) {
16112
16151
  this.value = this.defaultValue;
16113
16152
  }
16114
16153
  }
16154
+ handleClientStyling() {
16155
+ if (window.emMessageBus !== undefined) {
16156
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
16157
+ return;
16158
+ }
16159
+ if (this.clientStyling) {
16160
+ setClientStyling(this.stylingContainer, this.clientStyling);
16161
+ }
16162
+ }
16115
16163
  componentDidLoad() {
16164
+ this.handleClientStyling();
16116
16165
  if (this.defaultValue) {
16117
16166
  this.valueHandler({ name: this.name, value: this.value });
16118
16167
  }
@@ -16204,10 +16253,10 @@ const PostalCodeInput = class {
16204
16253
  let shouldShowNoResults = this.showNoResultsMessage && this.currentPostalCode &&
16205
16254
  this.currentPostalCode.length >= this.postalcodelength && (((_b = this.addresses) === null || _b === void 0 ? void 0 : _b.length) === 0) && isUKCountry;
16206
16255
  let showLoadingMessage = this.isFetchingAddresses && this.currentPostalCode.length >= this.postalcodelength;
16207
- return (h("div", { key: 'e358dddfc4b20b0847d03e3f12ff637922470105', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, h("div", { key: 'b806cac9ad62480a1be6bf802528c60c79804e94', class: 'text__wrapper--flex' }, h("label", { key: '4fb327989e8b828559c01601eea47bdd58da4bd3', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '6c293495a8935db477cbcac2eb9102bffeb85ddb', class: 'text__wrapper--relative' }, this.tooltip && (h("img", { key: '848bb5b44d834c4f0e4a78cfebef0ecf1b88fd2e', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip })), this.renderTooltip())), h("div", { key: '7f6195e5cfc5bfabc9854ec6acc19c1e52e70f1b', class: 'input__text-wrapper' }, h("input", { key: '4369b4a99016a7aebbb396bdda35c31d92e4d557', name: this.name, id: `${this.name}__input`, value: this.determineInputValue(), type: 'text', class: `text__input ${invalidClass}`, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, readOnly: this.autofilled, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.maxPostalCodeLength, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus }), !isUKCountry && (h("p", { key: '0e3c0fcb974d2f3dae76f9afdbf173fcc25d258f', class: "address__manual-input-msg", onClick: () => this.enterAddressManually() }, translate$1('enterIEAddressManually', this.language))), showAddressesDropdown && (h("div", { key: '1c644f87f2617180e6356c724d72b6d3fc8e472e', class: "input__addresses-container", ref: (el) => (this.addressesDropdownRef = el) }, h("div", { key: 'f2a7b8133908441a3cf67eb48928a2d61d17e32f', class: "options" }, this.addresses.map((addr, index) => (h("div", { key: index, class: "option", onClick: (e) => this.handlePostalCode(e, addr) }, addr.number, " ", addr.street, " ", addr.city)))))), showLoadingMessage && (h("div", { key: 'c0cb29f7d174ca8981c8b9dfd2ee9b972b0fd1ea', class: "postalcode__loading-spinner" }, h("div", { key: '76f17cb0a440f7ed9cc8de3620b55136549586e6', class: "loading-spinner" }), h("span", { key: 'e10c4177fb0f21f142fd3120177e450413687cf3' }, translate$1('searchingForAddresses', this.language)))), shouldShowNoResults && (h("div", { key: 'f729f6206cc900a2c94e3df0e8b08cc3dc5b751f', class: "postalcode__no-results-message" }, translate$1('postalLookUpNoAddressFound', this.language)))), h("small", { key: 'c8a79e601f22444b34dc7d037c94f92875f51aad', class: 'text__error-message' }, this.errorMessage)));
16256
+ return (h("div", { key: 'f0dda39cf9a02d53213848926908c0cb39d1cd3f', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, h("div", { key: '5e1c51af264392d2be986e305e6526310f55f40b', class: 'text__wrapper--flex' }, h("label", { key: 'c12c45d88bdf42aeb6be505d473ab0f55da2be87', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '7b93a75f19590b445227fa1a64c90fd20c0afd5d', class: 'text__wrapper--relative' }, this.tooltip && (h("img", { key: '504004a13595694307c1e3450b69982150dc55fd', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip })), this.renderTooltip())), h("div", { key: '19de66fd72fd0a6befe3bbaebb6c8f99ec5f850b', class: 'input__text-wrapper' }, h("input", { key: '78cd4229ed5104518b991df0bc6bf527df2ec3e2', name: this.name, id: `${this.name}__input`, value: this.determineInputValue(), type: 'text', class: `text__input ${invalidClass}`, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, readOnly: this.autofilled, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.maxPostalCodeLength, onInput: this.handleInput, onBlur: this.handleBlur, onFocus: this.handleFocus }), !isUKCountry && (h("p", { key: '6b9e307d59fb9fed93f4df6c07a091d299844c62', class: "address__manual-input-msg", onClick: () => this.enterAddressManually() }, translate$1('enterIEAddressManually', this.language))), showAddressesDropdown && (h("div", { key: 'ecb7892a9a8d967540d8fd013518ae19498fcd48', class: "input__addresses-container", ref: (el) => (this.addressesDropdownRef = el) }, h("div", { key: 'a5ef3f81a85207a821964e23b21aaf783be807cc', class: "options" }, this.addresses.map((addr, index) => (h("div", { key: index, class: "option", onClick: (e) => this.handlePostalCode(e, addr) }, addr.number, " ", addr.street, " ", addr.city)))))), showLoadingMessage && (h("div", { key: '338c17e484721efb387e608f3ce4416a0e47b8af', class: "postalcode__loading-spinner" }, h("div", { key: '7638cea4fba975e3a27d4cb00bce217129bd0750', class: "loading-spinner" }), h("span", { key: 'b59a8a9c3d7ecf209a68717346d1d29062994f79' }, translate$1('searchingForAddresses', this.language)))), shouldShowNoResults && (h("div", { key: '212a74fed94b3ee089aed5c9afb544966b5f11cd', class: "postalcode__no-results-message" }, translate$1('postalLookUpNoAddressFound', this.language)))), h("small", { key: '4f66e97dd811b9917c92ff4bcbf236817ac57933', class: 'text__error-message' }, this.errorMessage)));
16208
16257
  }
16209
16258
  static get watchers() { return {
16210
- "clientStyling": ["handleStylingChange"],
16259
+ "clientStyling": ["handleClientStylingChange"],
16211
16260
  "isValid": ["validityChanged"],
16212
16261
  "emitValue": ["emitValueHandler"],
16213
16262
  "addresses": ["handleAddresses"]
@@ -16223,11 +16272,6 @@ const RadioInput = class {
16223
16272
  registerInstance(this, hostRef);
16224
16273
  this.sendInputValue = createEvent(this, "sendInputValue", 7);
16225
16274
  this.sendValidityState = createEvent(this, "sendValidityState", 7);
16226
- this.setClientStyling = () => {
16227
- let sheet = document.createElement('style');
16228
- sheet.innerHTML = this.clientStyling;
16229
- this.stylingContainer.prepend(sheet);
16230
- };
16231
16275
  this.name = undefined;
16232
16276
  this.displayName = undefined;
16233
16277
  this.optionsGroup = undefined;
@@ -16236,14 +16280,15 @@ const RadioInput = class {
16236
16280
  this.language = undefined;
16237
16281
  this.emitValue = undefined;
16238
16282
  this.clientStyling = '';
16283
+ this.mbSource = undefined;
16239
16284
  this.errorMessage = undefined;
16240
16285
  this.isValid = undefined;
16241
- this.limitStylingAppends = false;
16242
16286
  this.showTooltip = false;
16243
16287
  }
16244
- handleStylingChange(newValue, oldValue) {
16245
- if (newValue !== oldValue)
16246
- this.setClientStyling();
16288
+ handleClientStylingChange(newValue, oldValue) {
16289
+ if (newValue !== oldValue) {
16290
+ setClientStyling(this.stylingContainer, this.clientStyling);
16291
+ }
16247
16292
  }
16248
16293
  validityChanged() {
16249
16294
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -16268,14 +16313,17 @@ const RadioInput = class {
16268
16313
  this.showTooltip = false;
16269
16314
  }
16270
16315
  }
16271
- componentDidRender() {
16272
- // start custom styling area
16273
- if (!this.limitStylingAppends && this.stylingContainer) {
16274
- if (this.clientStyling)
16275
- this.setClientStyling();
16276
- this.limitStylingAppends = true;
16316
+ handleClientStyling() {
16317
+ if (window.emMessageBus !== undefined) {
16318
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
16319
+ return;
16277
16320
  }
16278
- // end custom styling area
16321
+ if (this.clientStyling) {
16322
+ setClientStyling(this.stylingContainer, this.clientStyling);
16323
+ }
16324
+ }
16325
+ componentDidLoad() {
16326
+ this.handleClientStyling();
16279
16327
  }
16280
16328
  handleClick(event) {
16281
16329
  this.value = event.target.value;
@@ -16298,11 +16346,11 @@ const RadioInput = class {
16298
16346
  return null;
16299
16347
  }
16300
16348
  render() {
16301
- return h("fieldset", { key: '33493de460303a32a37d253a0fd5f9da59676542', class: `radio__fieldset ${this.name}__input`, ref: el => this.stylingContainer = el }, h("legend", { key: '8aef7aa84a119742e05d72d976c936a560154b3f', class: 'radio__legend' }, this.displayName, ":"), this.optionsGroup.map(option => h("div", { class: 'radio__wrapper' }, h("input", { type: "radio", class: 'radio__input', id: `${option.label}__input`, ref: (el) => this.inputReference = el, value: option.value, name: this.name, required: this.validation.mandatory, onClick: (e) => this.handleClick(e) }), h("label", { htmlFor: `${option.label}__input` }, option.label))), h("small", { key: 'bec44ed4007e408ddeb0b0293b82e034c8e165f2', class: 'radio__error-message' }, this.errorMessage), this.tooltip &&
16302
- h("img", { key: 'a3b0a041beabe3f14661c0af8cd970040d060435', class: 'radio__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
16349
+ return h("fieldset", { key: '7048de0e37c9541af1c9788e8b46c789ca788c31', class: `radio__fieldset ${this.name}__input`, ref: el => this.stylingContainer = el }, h("legend", { key: '403b739c966d510740ca59621c094872b93e2cba', class: 'radio__legend' }, this.displayName, ":"), this.optionsGroup.map(option => h("div", { class: 'radio__wrapper' }, h("input", { type: "radio", class: 'radio__input', id: `${option.label}__input`, ref: (el) => this.inputReference = el, value: option.value, name: this.name, required: this.validation.mandatory, onClick: (e) => this.handleClick(e) }), h("label", { htmlFor: `${option.label}__input` }, option.label))), h("small", { key: '46dce1082a6aa9f2a5bdc3e3654c924fcd2a8357', class: 'radio__error-message' }, this.errorMessage), this.tooltip &&
16350
+ h("img", { key: 'dfe155a429485b5c891db2943d9115cdc40e169b', class: 'radio__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip());
16303
16351
  }
16304
16352
  static get watchers() { return {
16305
- "clientStyling": ["handleStylingChange"],
16353
+ "clientStyling": ["handleClientStylingChange"],
16306
16354
  "isValid": ["validityChanged"],
16307
16355
  "emitValue": ["emitValueHandler"]
16308
16356
  }; }
@@ -16351,11 +16399,6 @@ const SelectInput = class {
16351
16399
  this.validityStateHandler({ valid: this.isValid, name: this.name });
16352
16400
  this.emitValueHandler(true);
16353
16401
  };
16354
- this.setClientStyling = () => {
16355
- let sheet = document.createElement('style');
16356
- sheet.innerHTML = this.clientStyling;
16357
- this.stylingContainer.prepend(sheet);
16358
- };
16359
16402
  this.name = undefined;
16360
16403
  this.displayName = undefined;
16361
16404
  this.placeholder = undefined;
@@ -16368,14 +16411,15 @@ const SelectInput = class {
16368
16411
  this.language = undefined;
16369
16412
  this.emitValue = undefined;
16370
16413
  this.clientStyling = '';
16414
+ this.mbSource = undefined;
16371
16415
  this.errorMessage = undefined;
16372
16416
  this.isValid = undefined;
16373
- this.limitStylingAppends = false;
16374
16417
  this.showTooltip = false;
16375
16418
  }
16376
- handleStylingChange(newValue, oldValue) {
16377
- if (newValue !== oldValue)
16378
- this.setClientStyling();
16419
+ handleClientStylingChange(newValue, oldValue) {
16420
+ if (newValue !== oldValue) {
16421
+ setClientStyling(this.stylingContainer, this.clientStyling);
16422
+ }
16379
16423
  }
16380
16424
  validityChanged() {
16381
16425
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -16425,16 +16469,17 @@ const SelectInput = class {
16425
16469
  }
16426
16470
  }
16427
16471
  }
16428
- componentDidRender() {
16429
- // start custom styling area
16430
- if (!this.limitStylingAppends && this.stylingContainer) {
16431
- if (this.clientStyling)
16432
- this.setClientStyling();
16433
- this.limitStylingAppends = true;
16472
+ handleClientStyling() {
16473
+ if (window.emMessageBus !== undefined) {
16474
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
16475
+ return;
16476
+ }
16477
+ if (this.clientStyling) {
16478
+ setClientStyling(this.stylingContainer, this.clientStyling);
16434
16479
  }
16435
- // end custom styling area
16436
16480
  }
16437
16481
  componentDidLoad() {
16482
+ this.handleClientStyling();
16438
16483
  this.inputReference = this.vaadinCombo.querySelector('input');
16439
16484
  if (this.defaultValue) {
16440
16485
  this.value = this.defaultValue;
@@ -16499,13 +16544,13 @@ const SelectInput = class {
16499
16544
  if (this.touched) {
16500
16545
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
16501
16546
  }
16502
- return h("div", { key: 'b0ed504667761e5fd77e0ac13382b467448a1944', class: `select__wrapper ${this.autofilled ? 'select__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: 'b48d38dc4c2cb3442ff6773a1b1d13191ec4d0e6', class: 'select__wrapper--flex' }, h("label", { key: 'ad592c8c98ecbec1961d22cdfeb8cec910291ea8', class: 'select__label', htmlFor: `${this.name}__input` }, this.displayName, h("span", { key: 'b3c0f2fe9a2d26ade1626878ed9bc1f0b86a23ad', class: this.validation.mandatory ? 'select__label--required' : '' })), h("div", { key: '29d0f504d0f51175818dffffb882ac4e6e9c3bde', class: 'select__wrapper--relative' }, this.tooltip &&
16503
- h("img", { key: '66e524ffebc43f9418e90b3bd2d7ae62eba47da3', class: 'select__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), this.isComboBox ? h("vaadin-combo-box", { name: this.name, id: `${this.name}__input`, class: `select__input ${invalidClass} ${this.autofilled ? 'select__input--autofilled' : ''}`, "item-label-path": "label", "item-value-path": "value", ref: (el) => this.vaadinCombo = el, readOnly: this.autofilled, required: (_a = this.validation) === null || _a === void 0 ? void 0 : _a.mandatory, value: this.value, placeholder: `${this.placeholder}`, items: this.displayedOptions, onChange: this.handleComboChange, onBlur: this.handleBlur })
16547
+ return h("div", { key: 'eb6c9d7d85546159d44d06a0635f173263edd7d1', class: `select__wrapper ${this.autofilled ? 'select__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '0fd71c528870966fdb23049b1806a267e9e6ca5c', class: 'select__wrapper--flex' }, h("label", { key: '44aeb4e50ab2f79df06741ff07ac03131c987447', class: 'select__label', htmlFor: `${this.name}__input` }, this.displayName, h("span", { key: '796a83aeadd480a571b6bae035a46138d7b10b24', class: this.validation.mandatory ? 'select__label--required' : '' })), h("div", { key: '6d7b2d785c6b0bdd05c7444f563b21cedf26ff7c', class: 'select__wrapper--relative' }, this.tooltip &&
16548
+ h("img", { key: 'f33e43a9d42e8b8d1cf136374505eeaedcbede26', class: 'select__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), this.isComboBox ? h("vaadin-combo-box", { name: this.name, id: `${this.name}__input`, class: `select__input ${invalidClass} ${this.autofilled ? 'select__input--autofilled' : ''}`, "item-label-path": "label", "item-value-path": "value", ref: (el) => this.vaadinCombo = el, readOnly: this.autofilled, required: (_a = this.validation) === null || _a === void 0 ? void 0 : _a.mandatory, value: this.value, placeholder: `${this.placeholder}`, items: this.displayedOptions, onChange: this.handleComboChange, onBlur: this.handleBlur })
16504
16549
  :
16505
- h("vaadin-select", { name: this.name, popover: false, id: `${this.name}__input`, class: `select__input ${invalidClass} ${this.autofilled ? 'select__input--autofilled' : ''}`, "item-label-path": "label", "item-value-path": "value", ref: (el) => this.vaadinCombo = el, readOnly: this.autofilled, required: (_b = this.validation) === null || _b === void 0 ? void 0 : _b.mandatory, value: this.value, placeholder: `${this.placeholder}`, items: this.displayedOptions, onChange: this.handleSelectChange, "no-vertical-overlap": true, noVerticalOverlap: true }), h("small", { key: '0143b538740c3a8e9bfcab6bbb44660355c40cf7', class: 'select__error-message' }, this.errorMessage));
16550
+ h("vaadin-select", { name: this.name, popover: false, id: `${this.name}__input`, class: `select__input ${invalidClass} ${this.autofilled ? 'select__input--autofilled' : ''}`, "item-label-path": "label", "item-value-path": "value", ref: (el) => this.vaadinCombo = el, readOnly: this.autofilled, required: (_b = this.validation) === null || _b === void 0 ? void 0 : _b.mandatory, value: this.value, placeholder: `${this.placeholder}`, items: this.displayedOptions, onChange: this.handleSelectChange, "no-vertical-overlap": true, noVerticalOverlap: true }), h("small", { key: '261b3c4abc9b360e6b937d851f8bfc810280a8c6', class: 'select__error-message' }, this.errorMessage));
16506
16551
  }
16507
16552
  static get watchers() { return {
16508
- "clientStyling": ["handleStylingChange"],
16553
+ "clientStyling": ["handleClientStylingChange"],
16509
16554
  "isValid": ["validityChanged"],
16510
16555
  "emitValue": ["emitValueHandler"]
16511
16556
  }; }
@@ -16540,11 +16585,6 @@ const TelInput = class {
16540
16585
  this.isValid = this.isValidValue();
16541
16586
  this.errorMessage = this.setErrorMessage();
16542
16587
  };
16543
- this.setClientStyling = () => {
16544
- let sheet = document.createElement('style');
16545
- sheet.innerHTML = this.clientStyling;
16546
- this.stylingContainer.prepend(sheet);
16547
- };
16548
16588
  this.name = undefined;
16549
16589
  this.displayName = undefined;
16550
16590
  this.placeholder = undefined;
@@ -16557,9 +16597,9 @@ const TelInput = class {
16557
16597
  this.language = undefined;
16558
16598
  this.emitValue = undefined;
16559
16599
  this.clientStyling = '';
16600
+ this.mbSource = undefined;
16560
16601
  this.isValid = undefined;
16561
16602
  this.errorMessage = undefined;
16562
- this.limitStylingAppends = false;
16563
16603
  this.showTooltip = false;
16564
16604
  this.disablePhonePrefix = false;
16565
16605
  this.phoneValue = '';
@@ -16571,9 +16611,10 @@ const TelInput = class {
16571
16611
  if (this.inputReference)
16572
16612
  this.inputReference.value = this.phoneValue;
16573
16613
  }
16574
- handleStylingChange(newValue, oldValue) {
16575
- if (newValue !== oldValue)
16576
- this.setClientStyling();
16614
+ handleClientStylingChange(newValue, oldValue) {
16615
+ if (newValue !== oldValue) {
16616
+ setClientStyling(this.stylingContainer, this.clientStyling);
16617
+ }
16577
16618
  }
16578
16619
  validityChanged() {
16579
16620
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -16624,16 +16665,17 @@ const TelInput = class {
16624
16665
  }
16625
16666
  }
16626
16667
  }
16627
- componentDidRender() {
16628
- // start custom styling area
16629
- if (!this.limitStylingAppends && this.stylingContainer) {
16630
- if (this.clientStyling)
16631
- this.setClientStyling();
16632
- this.limitStylingAppends = true;
16668
+ handleClientStyling() {
16669
+ if (window.emMessageBus !== undefined) {
16670
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
16671
+ return;
16672
+ }
16673
+ if (this.clientStyling) {
16674
+ setClientStyling(this.stylingContainer, this.clientStyling);
16633
16675
  }
16634
- // end custom styling area
16635
16676
  }
16636
16677
  componentDidLoad() {
16678
+ this.handleClientStyling();
16637
16679
  this.isValid = this.isValidValue();
16638
16680
  if (this.defaultValue) {
16639
16681
  this.value = this.defaultValue;
@@ -16725,11 +16767,11 @@ const TelInput = class {
16725
16767
  if (this.touched) {
16726
16768
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
16727
16769
  }
16728
- return h("div", { key: 'bf824bf310bec50746fb6b82cd8f7decbcfc284b', class: `tel__wrapper ${this.autofilled ? 'tel__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '0b6c42e7aca5686f310ffdcecb96cf909e83521f', class: 'tel__wrapper--flex-label' }, h("label", { key: 'ddf2fa885ac53e7f337525357a7dce52f911213d', class: `tel__label ${this.validation.mandatory ? 'tel__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: 'e21a84509b32f379bb3ce92137255caf99a86dc5', class: 'tel__wrapper--relative' }, this.tooltip &&
16729
- h("img", { key: '9ff0a8c19aa067c1e7799227617405e373b344e4', class: 'tel__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("div", { key: '5db13af7e421480b89253970a5f2470f999c922d', class: `tel__wrapper--flex ${invalidClass}` }, h("vaadin-combo-box", { key: '164fe2bd2940bd5a251fda48b28f1af1bc3e78be', class: 'tel__prefix', items: this.phoneCodesOptions, value: this.prefixValue, readOnly: this.disablePhonePrefix, onChange: (e) => this.handlePrefixInput(e) }), h("input", { key: '90ae038a383645d6579fb68bc5adbe8a2b1d676c', type: "tel", ref: (el) => this.inputReference = el, id: `${this.name}__input`, readOnly: this.autofilled, class: `tel__input`, value: (_a = this.phoneValue) !== null && _a !== void 0 ? _a : '', placeholder: `${this.placeholder}`, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, pattern: this.validationPattern, onInput: this.handleInput, onBlur: this.handleBlur })), h("small", { key: 'a68f95384965384a67d042b89264dbda03f25b7a', class: 'tel__error-message' }, this.errorMessage));
16770
+ return h("div", { key: '9cf9eb751bca1978d8554fffc912ef2039c42e41', class: `tel__wrapper ${this.autofilled ? 'tel__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: 'cc88d6e9aa7a0f3801fad75e3ca509fbd01b0538', class: 'tel__wrapper--flex-label' }, h("label", { key: 'c8a35af4ddd2d4f9751d7f60c9e075ae8eccb441', class: `tel__label ${this.validation.mandatory ? 'tel__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '73fcdcc25dde1be087ee60062dc5eee2d1e5d29e', class: 'tel__wrapper--relative' }, this.tooltip &&
16771
+ h("img", { key: '56df66fddf599fbafb179c7cd90ea7d58b008ea6', class: 'tel__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("div", { key: '20eb5689932c2f71322102229cc7346d18e9bc87', class: `tel__wrapper--flex ${invalidClass}` }, h("vaadin-combo-box", { key: '9ec4142dc84e0022ced7e34248d5f4f8f59c34af', class: 'tel__prefix', items: this.phoneCodesOptions, value: this.prefixValue, readOnly: this.disablePhonePrefix, onChange: (e) => this.handlePrefixInput(e) }), h("input", { key: 'c083b17f71de36b84892a8080f776debf1fe7351', type: "tel", ref: (el) => this.inputReference = el, id: `${this.name}__input`, readOnly: this.autofilled, class: `tel__input`, value: (_a = this.phoneValue) !== null && _a !== void 0 ? _a : '', placeholder: `${this.placeholder}`, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, pattern: this.validationPattern, onInput: this.handleInput, onBlur: this.handleBlur })), h("small", { key: '2201c2d7b968731042624b265cf535c656c86933', class: 'tel__error-message' }, this.errorMessage));
16730
16772
  }
16731
16773
  static get watchers() { return {
16732
- "clientStyling": ["handleStylingChange"],
16774
+ "clientStyling": ["handleClientStylingChange"],
16733
16775
  "isValid": ["validityChanged"],
16734
16776
  "emitValue": ["emitValueHandler"]
16735
16777
  }; }
@@ -16773,11 +16815,6 @@ const TextInput = class {
16773
16815
  this.touched = true;
16774
16816
  this.updateValidationState();
16775
16817
  };
16776
- this.setClientStyling = () => {
16777
- let sheet = document.createElement('style');
16778
- sheet.innerHTML = this.clientStyling;
16779
- this.stylingContainer.prepend(sheet);
16780
- };
16781
16818
  this.name = undefined;
16782
16819
  this.displayName = undefined;
16783
16820
  this.placeholder = undefined;
@@ -16792,15 +16829,16 @@ const TextInput = class {
16792
16829
  this.clientStyling = '';
16793
16830
  this.haspostalcodelookup = undefined;
16794
16831
  this.enableSouthAfricanMode = undefined;
16832
+ this.mbSource = undefined;
16795
16833
  this.isValid = undefined;
16796
16834
  this.errorMessage = '';
16797
- this.limitStylingAppends = false;
16798
16835
  this.showTooltip = false;
16799
16836
  this.selectedCountryCode = '';
16800
16837
  }
16801
- handleStylingChange(newValue, oldValue) {
16802
- if (newValue !== oldValue)
16803
- this.setClientStyling();
16838
+ handleClientStylingChange(newValue, oldValue) {
16839
+ if (newValue !== oldValue) {
16840
+ setClientStyling(this.stylingContainer, this.clientStyling);
16841
+ }
16804
16842
  }
16805
16843
  validityChanged() {
16806
16844
  this.validityStateHandler({ valid: this.isValid, name: this.name });
@@ -16912,21 +16950,22 @@ const TextInput = class {
16912
16950
  }
16913
16951
  this.validityStateHandler({ valid: false, name: this.name });
16914
16952
  }
16915
- componentDidRender() {
16916
- // start custom styling area
16917
- if (!this.limitStylingAppends && this.stylingContainer) {
16918
- if (this.clientStyling)
16919
- this.setClientStyling();
16920
- this.limitStylingAppends = true;
16921
- }
16922
- // end custom styling area
16923
- }
16924
16953
  componentWillLoad() {
16925
16954
  if (this.defaultValue) {
16926
16955
  this.value = this.defaultValue;
16927
16956
  }
16928
16957
  }
16958
+ handleClientStyling() {
16959
+ if (window.emMessageBus !== undefined) {
16960
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
16961
+ return;
16962
+ }
16963
+ if (this.clientStyling) {
16964
+ setClientStyling(this.stylingContainer, this.clientStyling);
16965
+ }
16966
+ }
16929
16967
  componentDidLoad() {
16968
+ this.handleClientStyling();
16930
16969
  if (this.defaultValue) {
16931
16970
  this.value = this.defaultValue;
16932
16971
  this.valueHandler({ name: this.name, value: this.value });
@@ -17038,11 +17077,11 @@ const TextInput = class {
17038
17077
  if (this.touched) {
17039
17078
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
17040
17079
  }
17041
- return h("div", { key: 'aacb35e1808720cfdb24708254c01cb5be0fe6b6', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, h("div", { key: '14a292cc7661d663698384d989d57d21786210b9', class: 'text__wrapper--flex' }, h("label", { key: 'c04b29364c4b54e9aad3036264044177e4a2dc51', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: 'eb8aee30e47241b533c7ca8fcb354c782b4e2be1', class: 'text__wrapper--relative' }, this.tooltip &&
17042
- h("img", { key: '23d4b70d93910f43ce0ea54c1bcffd81dfc54ebc', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: '3f901d85111256370811f4abe51bcd5b2971b60c', name: this.name, id: `${this.name}__input`, value: this.value, type: 'text', class: `text__input ${invalidClass}`, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, readOnly: this.autofilled, required: this.validation.mandatory, minlength: this.enableSouthAfricanMode ? '' : this.validation.minLength, maxlength: this.enableSouthAfricanMode ? '' : this.validation.maxLength, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { key: '1661215687f1eecd622b2610c3e056f45944fee3', class: 'text__error-message' }, this.errorMessage));
17080
+ return h("div", { key: 'f48e592bac049022b283bac917c095772b1508f5', class: `text__wrapper ${this.name}__input ${this.autofilled ? 'text__wrapper--autofilled' : ''}`, ref: el => this.stylingContainer = el }, h("div", { key: 'fe3626ead38dd18dfa14795ee2332e93f5f09652', class: 'text__wrapper--flex' }, h("label", { key: '6b2854b460e0ac7d4ae0ebccc06dbe64770581d5', class: `text__label ${this.validation.mandatory ? 'text__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: 'f29d266973bd700a4270495bc4eb6e8296b6eeaf', class: 'text__wrapper--relative' }, this.tooltip &&
17081
+ h("img", { key: '68e69abbb78250e763822608e963bc16d702f099', class: 'text__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("input", { key: '99b8eab15ab32656f86fedd3f36a09a5bbe108d3', name: this.name, id: `${this.name}__input`, value: this.value, type: 'text', class: `text__input ${invalidClass}`, placeholder: `${this.placeholder}`, ref: (el) => this.inputReference = el, readOnly: this.autofilled, required: this.validation.mandatory, minlength: this.enableSouthAfricanMode ? '' : this.validation.minLength, maxlength: this.enableSouthAfricanMode ? '' : this.validation.maxLength, onInput: this.handleInput, onBlur: this.handleBlur }), h("small", { key: 'cc28c1c19370faa94fa1f738066042dce8d694ce', class: 'text__error-message' }, this.errorMessage));
17043
17082
  }
17044
17083
  static get watchers() { return {
17045
- "clientStyling": ["handleStylingChange"],
17084
+ "clientStyling": ["handleClientStylingChange"],
17046
17085
  "isValid": ["validityChanged"],
17047
17086
  "emitValue": ["emitValueHandler"]
17048
17087
  }; }
@@ -17064,11 +17103,6 @@ const ToggleCheckboxInput = class {
17064
17103
  event.stopPropagation();
17065
17104
  window.postMessage({ type: `registration${fieldName}Clicked` }, window.location.href);
17066
17105
  };
17067
- this.setClientStyling = () => {
17068
- let sheet = document.createElement('style');
17069
- sheet.innerHTML = this.clientStyling;
17070
- this.stylingContainer.prepend(sheet);
17071
- };
17072
17106
  this.name = undefined;
17073
17107
  this.displayName = undefined;
17074
17108
  this.defaultValue = '';
@@ -17079,15 +17113,16 @@ const ToggleCheckboxInput = class {
17079
17113
  this.language = undefined;
17080
17114
  this.emitValue = undefined;
17081
17115
  this.clientStyling = '';
17116
+ this.mbSource = undefined;
17082
17117
  this.errorMessage = undefined;
17083
17118
  this.isValid = undefined;
17084
- this.limitStylingAppends = false;
17085
17119
  this.showTooltip = false;
17086
17120
  this.showFields = this.defaultValue === 'true';
17087
17121
  }
17088
- handleStylingChange(newValue, oldValue) {
17089
- if (newValue !== oldValue)
17090
- this.setClientStyling();
17122
+ handleClientStylingChange(newValue, oldValue) {
17123
+ if (newValue !== oldValue) {
17124
+ setClientStyling(this.stylingContainer, this.clientStyling);
17125
+ }
17091
17126
  }
17092
17127
  validityStateHandler(inputStateEvent) {
17093
17128
  this.sendValidityState.emit(inputStateEvent);
@@ -17101,16 +17136,17 @@ const ToggleCheckboxInput = class {
17101
17136
  this.showTooltip = false;
17102
17137
  }
17103
17138
  }
17104
- componentDidRender() {
17105
- // start custom styling area
17106
- if (!this.limitStylingAppends && this.stylingContainer) {
17107
- if (this.clientStyling)
17108
- this.setClientStyling();
17109
- this.limitStylingAppends = true;
17139
+ handleClientStyling() {
17140
+ if (window.emMessageBus !== undefined) {
17141
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
17142
+ return;
17143
+ }
17144
+ if (this.clientStyling) {
17145
+ setClientStyling(this.stylingContainer, this.clientStyling);
17110
17146
  }
17111
- // end custom styling area
17112
17147
  }
17113
17148
  componentDidLoad() {
17149
+ this.handleClientStyling();
17114
17150
  if (this.options.length === 0)
17115
17151
  return;
17116
17152
  this.options.forEach((subField) => {
@@ -17147,13 +17183,13 @@ const ToggleCheckboxInput = class {
17147
17183
  return null;
17148
17184
  }
17149
17185
  render() {
17150
- return h("div", { key: '828751327e59e9649afc04c6c9f7a02ef7dcae8d', class: `togglecheckbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: 'd02a2a6ef595aaf7142cbc6e9681394ee4db8fee', class: 'togglecheckbox__wrapper--flex' }, h("input", { key: 'fca6401ef6eb178f53471362444d54ed69086429', class: 'togglecheckbox__input', type: "checkbox", id: `${this.name}__input`, ref: (el) => this.checkboxReference = el, name: this.name, checked: this.defaultValue === "true", readOnly: this.autofilled, required: this.validation.mandatory, value: this.value, onClick: () => this.handleClick() }), this.renderLabel()), h("small", { key: '3781a8fdfeb719422693bcd541a4a3fe708e705a', class: 'togglecheckbox__error-message' }, this.errorMessage), h("div", { key: '27a4c6b047cd332407ee40c82cf7be1914ed34c9', class: 'togglecheckbox__wrapper--relative' }, this.tooltip &&
17151
- h("img", { key: 'f1367d7e061d20ad68c24dfbe3147e6b67df746f', class: 'togglecheckbox__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), h("div", { key: '98d42103554de4d14a65eafd1722bf9d587a27f1', class: `togglecheckbox__fields-wrapper ${this.showFields ? '' : 'hidden'}` }, this.options.map(subfield => {
17186
+ return h("div", { key: '31cd24b5da24368eef2f53952714395d6d9f6285', class: `togglecheckbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: 'aa14784bd8a3870f7015db79d23226521706ad58', class: 'togglecheckbox__wrapper--flex' }, h("input", { key: '0237f06c99b8b2ed7de80433f5b93b9eae7c25f5', class: 'togglecheckbox__input', type: "checkbox", id: `${this.name}__input`, ref: (el) => this.checkboxReference = el, name: this.name, checked: this.defaultValue === "true", readOnly: this.autofilled, required: this.validation.mandatory, value: this.value, onClick: () => this.handleClick() }), this.renderLabel()), h("small", { key: '7e26bea1cfcc725d5aa5a795fd0f999d99abe39d', class: 'togglecheckbox__error-message' }, this.errorMessage), h("div", { key: '4256fc552545b7a1050ff5cdeb005f5ea83cc5c1', class: 'togglecheckbox__wrapper--relative' }, this.tooltip &&
17187
+ h("img", { key: 'be3c3e036f0bfe46658fce870ae0ffa258229e7d', class: 'togglecheckbox__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), h("div", { key: '2d61bedaac02f21116318b10a21b361e70e0213f', class: `togglecheckbox__fields-wrapper ${this.showFields ? '' : 'hidden'}` }, this.options.map(subfield => {
17152
17188
  return h("general-input", { type: subfield.inputType, name: subfield.name, displayName: subfield.displayName, validation: subfield.validate, action: subfield.action || null, defaultValue: subfield.defaultValue, autofilled: subfield.autofill, emitValue: this.emitValue, language: this.language, "client-styling": this.clientStyling, tooltip: subfield.tooltip, placeholder: subfield.placeholder == null ? '' : subfield.placeholder, ref: el => this.subFieldsObject[subfield.name] = el });
17153
17189
  })));
17154
17190
  }
17155
17191
  static get watchers() { return {
17156
- "clientStyling": ["handleStylingChange"]
17192
+ "clientStyling": ["handleClientStylingChange"]
17157
17193
  }; }
17158
17194
  };
17159
17195
  ToggleCheckboxInput.style = ToggleCheckboxInputStyle0;
@@ -17179,17 +17215,6 @@ const TwofaInput = class {
17179
17215
  this.triggerResendInterval();
17180
17216
  this.resendCode.emit();
17181
17217
  };
17182
- this.setClientStylingURL = () => {
17183
- let url = new URL(this.clientStylingUrl);
17184
- let cssFile = document.createElement('style');
17185
- fetch(url.href)
17186
- .then((res) => res.text())
17187
- .then((data) => {
17188
- cssFile.innerHTML = data;
17189
- this.clientStyling = data;
17190
- setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
17191
- });
17192
- };
17193
17218
  this.setInputRef = (el, idx) => {
17194
17219
  if (el) {
17195
17220
  this.inputRefs[idx] = el;
@@ -17245,21 +17270,6 @@ const TwofaInput = class {
17245
17270
  this.setValidity();
17246
17271
  this.setErrorMessage();
17247
17272
  };
17248
- this.setClientStyling = () => {
17249
- let sheet = document.createElement('style');
17250
- sheet.innerHTML = this.clientStyling;
17251
- this.stylingContainer.prepend(sheet);
17252
- };
17253
- this.setStreamStyling = (domain) => {
17254
- if (window.emMessageBus) {
17255
- const sheet = document.createElement('style');
17256
- this.stylingSubscription = window.emMessageBus.subscribe(domain, (data) => {
17257
- sheet.innerHTML = data;
17258
- this.clientStyling = data;
17259
- this.host.shadowRoot.prepend(sheet);
17260
- });
17261
- }
17262
- };
17263
17273
  this.name = '';
17264
17274
  this.displayName = '';
17265
17275
  this.placeholder = '';
@@ -17274,7 +17284,6 @@ const TwofaInput = class {
17274
17284
  this.pinAttemptsExceeded = undefined;
17275
17285
  this.clientStylingUrl = '';
17276
17286
  this.mbSource = undefined;
17277
- this.limitStylingAppends = false;
17278
17287
  this.isValid = false;
17279
17288
  this.isResendButtonAvailable = true;
17280
17289
  this.showTooltip = false;
@@ -17294,9 +17303,16 @@ const TwofaInput = class {
17294
17303
  this.valueHandler({ name: this.name, value: this.code.join('') });
17295
17304
  }
17296
17305
  }
17297
- handleStylingUrlChange(newValue, oldValue) {
17298
- if (newValue !== oldValue)
17299
- this.setClientStylingURL();
17306
+ handleClientStylingChange(newValue, oldValue) {
17307
+ if (newValue !== oldValue) {
17308
+ setClientStyling(this.stylingContainer, this.clientStyling);
17309
+ }
17310
+ }
17311
+ handleClientStylingChangeURL(newValue, oldValue) {
17312
+ if (newValue !== oldValue) {
17313
+ if (this.clientStylingUrl)
17314
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
17315
+ }
17300
17316
  }
17301
17317
  validityStateHandler(inputStateEvent) {
17302
17318
  this.sendValidityState.emit(inputStateEvent);
@@ -17310,10 +17326,6 @@ const TwofaInput = class {
17310
17326
  this.showTooltip = false;
17311
17327
  }
17312
17328
  }
17313
- handleStylingChange(newValue, oldValue) {
17314
- if (newValue !== oldValue)
17315
- this.setClientStyling();
17316
- }
17317
17329
  connectedCallback() {
17318
17330
  this.validationPattern = this.setPattern();
17319
17331
  this.code = new Array(this.validation.maxLength).fill('');
@@ -17321,30 +17333,21 @@ const TwofaInput = class {
17321
17333
  disconnectedCallback() {
17322
17334
  this.stylingSubscription && this.stylingSubscription.unsubscribe();
17323
17335
  }
17324
- componentDidRender() {
17325
- if (!this.limitStylingAppends && this.stylingContainer) {
17326
- if (this.clientStyling) {
17327
- this.setClientStyling();
17328
- }
17329
- this.limitStylingAppends = true;
17336
+ handleClientStyling() {
17337
+ if (window.emMessageBus !== undefined) {
17338
+ this.stylingSubscription = setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription, true);
17339
+ return;
17330
17340
  }
17341
+ if (this.clientStyling)
17342
+ setClientStyling(this.stylingContainer, this.clientStyling);
17343
+ if (this.clientStylingUrl)
17344
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
17331
17345
  }
17332
17346
  componentDidLoad() {
17333
17347
  this.setValidity();
17334
17348
  this.registrationWidgetLoaded.emit();
17335
17349
  window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
17336
- if (!this.limitStylingAppends && this.host) {
17337
- if (window.emMessageBus != undefined) {
17338
- this.setStreamStyling(`${this.mbSource}.Style`);
17339
- }
17340
- else {
17341
- if (this.clientStyling)
17342
- this.setClientStyling();
17343
- if (this.clientStylingUrl)
17344
- this.setClientStylingURL();
17345
- this.limitStylingAppends = true;
17346
- }
17347
- }
17350
+ this.handleClientStyling();
17348
17351
  }
17349
17352
  handleKeyDown(e, idx) {
17350
17353
  if (e.key === 'Backspace') {
@@ -17435,9 +17438,9 @@ const TwofaInput = class {
17435
17438
  return current;
17436
17439
  }
17437
17440
  render() {
17438
- return (h("div", { key: '08b9139f1c2236dd40a045517a9623ad966f29d3', class: "twofa", ref: el => this.stylingContainer = el }, h("div", { key: '7528885100be3d450ec52aafd6085a4c852710c8', class: 'twofa__error-message' }, h("p", { key: '51dab3f02156b5eb3b7408f06f2d359cfbda11a7' }, this.errorMessage)), h("div", { key: 'f336f89ecee0724663b1bbb4d443bb834336b5c1', class: "twofa__description", innerHTML: translate$1('twofaDescription', this.language, { values: { destination: this.destination } }) }), h("div", { key: '5127127ccc8e50428f8319fddc9e21606f3b4148', class: "twofa__input-wrapper", ref: this.setContainerRef }, this.code.map((_, idx) => {
17441
+ return (h("div", { key: 'cd5396afccaf4016201281f5cc53898c0a2052ed', class: "twofa", ref: el => this.stylingContainer = el }, h("div", { key: '008dd54682a0d93190e9e5b2b49673262ed01763', class: 'twofa__error-message' }, h("p", { key: '41db51d6b396ccd1f3149e4473e96960e92d05ca' }, this.errorMessage)), h("div", { key: '67e9e4ac90cf95f2269e75b121ed220a02c5f139', class: "twofa__description", innerHTML: translate$1('twofaDescription', this.language, { values: { destination: this.destination } }) }), h("div", { key: '702c342eb7be0001ab8de310cadd7e8684a8025d', class: "twofa__input-wrapper", ref: this.setContainerRef }, this.code.map((_, idx) => {
17439
17442
  return (h("input", { key: idx, ref: el => this.setInputRef(el, idx), id: `otp-input-${idx}`, type: "text", maxLength: 2, value: this.getInputDisplayValue(idx), onInput: (event) => this.handleInput(event, idx), onKeyDown: (event) => this.handleKeyDown(event, idx), onPaste: (event) => this.handlePaste(event) }));
17440
- })), h("div", { key: 'be82ae1192129d571275b78c8097c3023468cf3e', class: "twofa__button-wrapper" }, h("p", { key: '11de61d738ffa74bfd44f0d7c88fc4e456647d0c', class: "twofa__resend-message" }, translate$1('twofaResendMessage', this.language)), h("button", { key: '84d5c55c4d9bf024164ec52e2100cfcc8c236ac2', class: `twofa__resend-button ${this.pinAttemptsExceeded ? 'twofa__resend-button--disabled' : ''}`, onClick: this.resendCodeHandler, disabled: !this.isResendButtonAvailable || this.pinAttemptsExceeded }, this.isResendButtonAvailable
17443
+ })), h("div", { key: '63564bd4a0442232f81058ba914ee86c537ce85a', class: "twofa__button-wrapper" }, h("p", { key: '219f5005c0d03189df48f05c5e0cd980eb0e1979', class: "twofa__resend-message" }, translate$1('twofaResendMessage', this.language)), h("button", { key: '12b7b4bc3ea165994f2c50107f406c64e708cf4d', class: `twofa__resend-button ${this.pinAttemptsExceeded ? 'twofa__resend-button--disabled' : ''}`, onClick: this.resendCodeHandler, disabled: !this.isResendButtonAvailable || this.pinAttemptsExceeded }, this.isResendButtonAvailable
17441
17444
  ? translate$1('twofaResendButton', this.language)
17442
17445
  : this.formatTime()))));
17443
17446
  }
@@ -17445,8 +17448,8 @@ const TwofaInput = class {
17445
17448
  static get watchers() { return {
17446
17449
  "isValid": ["validityChanged"],
17447
17450
  "emitValue": ["emitValueHandler"],
17448
- "clientStylingUrl": ["handleStylingUrlChange"],
17449
- "clientStyling": ["handleStylingChange"]
17451
+ "clientStyling": ["handleClientStylingChange"],
17452
+ "clientStylingUrl": ["handleClientStylingChangeURL"]
17450
17453
  }; }
17451
17454
  };
17452
17455
  TwofaInput.style = TwofaInputStyle0;