@everymatrix/general-input 1.99.49 → 1.99.51

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-7a4b2771.js');
5
+ const index = require('./index-2221a973.js');
6
6
 
7
7
  const DEFAULT_LANGUAGE = 'en';
8
8
  const TRANSLATIONS = {
@@ -343,21 +343,23 @@ const translate = (key, customLang, values) => {
343
343
  }
344
344
  return translation;
345
345
  };
346
+ const setTranslation = (data) => {
347
+ Object.keys(data).forEach((locale) => {
348
+ TRANSLATIONS[locale] = TRANSLATIONS[locale] || {};
349
+ Object.keys(data[locale]).forEach((key) => {
350
+ if (typeof data[locale][key] === 'string') {
351
+ TRANSLATIONS[locale][key] = data[locale][key];
352
+ }
353
+ });
354
+ });
355
+ };
346
356
  const getTranslations = (url) => {
347
357
  // fetch url, get the data, replace the TRANSLATIONS content
348
358
  return new Promise((resolve) => {
349
359
  fetch(url)
350
360
  .then((res) => res.json())
351
361
  .then((data) => {
352
- Object.keys(data).forEach((item) => {
353
- TRANSLATIONS[item] = TRANSLATIONS[item] || {};
354
- for (let key in data[item]) {
355
- if (typeof data[item][key] === 'string') {
356
- TRANSLATIONS[item] = TRANSLATIONS[item] || {};
357
- TRANSLATIONS[item][key] = data[item][key];
358
- }
359
- }
360
- });
362
+ setTranslation(data);
361
363
  resolve(true);
362
364
  });
363
365
  });
@@ -6582,6 +6584,26 @@ const EmailInput = class {
6582
6584
  };
6583
6585
  EmailInput.style = EmailInputStyle0;
6584
6586
 
6587
+ /**
6588
+ * Subscribe to translation updates from the message bus.
6589
+ *
6590
+ * @param {string} domain - Message bus topic, such as `MyWidget.Translation`.
6591
+ * @param {object | undefined} subscription - Existing subscription returned if the message bus is unavailable.
6592
+ * @param {Function} onChange - Callback receiving the payload or `(locale, messages)` when byLocale is true.
6593
+ * @param {boolean} [byLocale=false] - Invoke the callback once per locale, ignoring invalid payloads.
6594
+ * @returns {object | undefined} The new or existing subscription.
6595
+ */
6596
+ function getStreamTranslations(domain, subscription, onChange, byLocale = false) {
6597
+ if (window.emMessageBus) {
6598
+ const callback = byLocale ? (data) => {
6599
+ if (!data || typeof data !== 'object' || Array.isArray(data)) return;
6600
+ Object.keys(data).forEach((locale) => onChange(locale, data[locale]));
6601
+ } : onChange;
6602
+ subscription = window.emMessageBus.subscribe(domain, callback);
6603
+ }
6604
+ return subscription;
6605
+ }
6606
+
6585
6607
  var qr=Object.defineProperty,Yr=Object.defineProperties;var Kr=Object.getOwnPropertyDescriptors;var lo=Object.getOwnPropertySymbols;var Gr=Object.prototype.hasOwnProperty,Xr=Object.prototype.propertyIsEnumerable;var Mt=(s,t,e)=>t in s?qr(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,we=(s,t)=>{for(var e in t||(t={}))Gr.call(t,e)&&Mt(s,e,t[e]);if(lo)for(var e of lo(t))Xr.call(t,e)&&Mt(s,e,t[e]);return s},Nt=(s,t)=>Yr(s,Kr(t));var k=(s,t,e)=>(Mt(s,typeof t!="symbol"?t+"":t,e),e);var Ce=(s,t,e)=>new Promise((i,o)=>{var r=l=>{try{a(e.next(l));}catch(d){o(d);}},n=l=>{try{a(e.throw(l));}catch(d){o(d);}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(r,n);a((e=e.apply(s,t)).next());});/**
6586
6608
  * @license
6587
6609
  * Copyright (c) 2021 - 2024 Vaadin Ltd.
@@ -13305,9 +13327,28 @@ const GeneralInput = class {
13305
13327
  }
13306
13328
  }
13307
13329
  disconnectedCallback() {
13330
+ var _a;
13331
+ (_a = this.translationSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
13308
13332
  this.stylingSubscription && this.stylingSubscription.unsubscribe();
13309
13333
  }
13334
+ handleClientTranslations() {
13335
+ if (this.mbSource && !this.translationUrl) {
13336
+ this.translationSubscription = getStreamTranslations(`${this.mbSource}.Translation`, this.translationSubscription, (data) => {
13337
+ var _a;
13338
+ if (!data || typeof data !== 'object')
13339
+ return;
13340
+ setTranslation(data);
13341
+ index.forceUpdate(this.host);
13342
+ (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('*').forEach((element) => {
13343
+ if (typeof element.componentOnReady === 'function') {
13344
+ index.forceUpdate(element);
13345
+ }
13346
+ });
13347
+ });
13348
+ }
13349
+ }
13310
13350
  componentDidLoad() {
13351
+ this.handleClientTranslations();
13311
13352
  this.handleClientStyling();
13312
13353
  this.registrationWidgetLoaded.emit();
13313
13354
  window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
@@ -13341,7 +13382,7 @@ const GeneralInput = class {
13341
13382
  case 'checkboxgroup':
13342
13383
  return index.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 });
13343
13384
  case 'togglecheckbox':
13344
- return index.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 });
13385
+ return index.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, "translation-url": this.translationUrl });
13345
13386
  case 'datetime':
13346
13387
  return index.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 });
13347
13388
  case 'password':
@@ -13366,7 +13407,7 @@ const GeneralInput = class {
13366
13407
  }
13367
13408
  }
13368
13409
  render() {
13369
- return (index.h(index.Host, { key: '3d24065bd97aae6602df1223069eec8b49c14d03', class: `general-input--${this.name}`, onClick: this.handleClick }, this.renderInput()));
13410
+ return (index.h(index.Host, { key: 'b9d7daf54c988a5cd60f6a4d2348aa276a9f8022', class: `general-input--${this.name}`, onClick: this.handleClick }, this.renderInput()));
13370
13411
  }
13371
13412
  get host() { return index.getElement(this); }
13372
13413
  static get watchers() { return {
@@ -15091,6 +15132,7 @@ const ToggleCheckboxInput = class {
15091
15132
  this.emitValue = undefined;
15092
15133
  this.clientStyling = '';
15093
15134
  this.mbSource = undefined;
15135
+ this.translationUrl = undefined;
15094
15136
  this.errorMessage = undefined;
15095
15137
  this.isValid = undefined;
15096
15138
  this.showTooltip = false;
@@ -15160,9 +15202,9 @@ const ToggleCheckboxInput = class {
15160
15202
  return null;
15161
15203
  }
15162
15204
  render() {
15163
- return index.h("div", { key: '31cd24b5da24368eef2f53952714395d6d9f6285', class: `togglecheckbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: 'aa14784bd8a3870f7015db79d23226521706ad58', class: 'togglecheckbox__wrapper--flex' }, index.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()), index.h("small", { key: '7e26bea1cfcc725d5aa5a795fd0f999d99abe39d', class: 'togglecheckbox__error-message' }, this.errorMessage), index.h("div", { key: '4256fc552545b7a1050ff5cdeb005f5ea83cc5c1', class: 'togglecheckbox__wrapper--relative' }, this.tooltip &&
15164
- index.h("img", { key: 'be3c3e036f0bfe46658fce870ae0ffa258229e7d', class: 'togglecheckbox__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), index.h("div", { key: '2d61bedaac02f21116318b10a21b361e70e0213f', class: `togglecheckbox__fields-wrapper ${this.showFields ? '' : 'hidden'}` }, this.options.map(subfield => {
15165
- return index.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 });
15205
+ return index.h("div", { key: '4bb7b3391398f78dceffef403f6b216c0cbdd312', class: `togglecheckbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: '214848f815c996605c1f710c46dde6bfe83f0cf7', class: 'togglecheckbox__wrapper--flex' }, index.h("input", { key: 'e1b829fafa91d20a80c19d49c2ce536c41892c0d', 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()), index.h("small", { key: 'e01a4c6bc20fae1aa56ba2888e18c3b43181e7ce', class: 'togglecheckbox__error-message' }, this.errorMessage), index.h("div", { key: '5d4b6f06c72de9d9bb62dfcba08bd7366d355733', class: 'togglecheckbox__wrapper--relative' }, this.tooltip &&
15206
+ index.h("img", { key: '51983de9c47a15e00b16ea7aae860c71580a6511', class: 'togglecheckbox__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), index.h("div", { key: 'ab12b489947e92ac32c9c061f5b30865996fe6e0', class: `togglecheckbox__fields-wrapper ${this.showFields ? '' : 'hidden'}` }, this.options.map(subfield => {
15207
+ return index.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, "mb-source": this.translationUrl ? undefined : this.mbSource, tooltip: subfield.tooltip, placeholder: subfield.placeholder == null ? '' : subfield.placeholder, ref: el => this.subFieldsObject[subfield.name] = el });
15166
15208
  })));
15167
15209
  }
15168
15210
  static get watchers() { return {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-7a4b2771.js');
5
+ const index = require('./index-2221a973.js');
6
6
  const appGlobals = require('./app-globals-3a1e7e63.js');
7
7
 
8
8
  /*
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["checkbox-group-input_14.cjs",[[1,"general-input",{"type":[513],"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"validation":[16],"options":[520],"language":[513],"autofilled":[516],"tooltip":[513],"defaultValue":[520,"default-value"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"hidePasswordComplexity":[516,"hide-password-complexity"],"noValidation":[516,"no-validation"],"clientStyling":[520,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"dateFormat":[513,"date-format"],"translationUrl":[513,"translation-url"],"emitOnClick":[516,"emit-on-click"],"twofaDestination":[513,"twofa-destination"],"twofaResendIntervalSeconds":[514,"twofa-resend-interval-seconds"],"twofaStartCountDown":[516,"twofa-start-count-down"],"haspostalcodelookup":[516],"postalcodelength":[514],"addresses":[520],"ignoreCountry":[516,"ignore-country"],"enableSouthAfricanMode":[516,"enable-south-african-mode"],"enableManualDateInput":[516,"enable-manual-date-input"],"pinAttemptsExceeded":[516,"pin-attempts-exceeded"],"mbSource":[513,"mb-source"],"enableCustomRegexValidation":[516,"enable-custom-regex-validation"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}],[1,"toggle-checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"options":[16],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32],"showFields":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"]}],[1,"checkbox-group-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[16],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32],"selectedValues":[32],"showCheckboxes":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"selectedValues":["setValue"],"emitValue":["emitValueHandler"]}],[1,"checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"date-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"dateFormat":[513,"date-format"],"emitOnClick":[516,"emit-on-click"],"enableSouthAfricanMode":[516,"enable-south-african-mode"],"enableManualDateInput":[516,"enable-manual-date-input"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"],"enableSouthAfricanMode":["handleCustomRegistrationChange"]}],[1,"email-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"number-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"password-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"noValidation":[516,"no-validation"],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"hidePasswordComplexity":[516,"hide-password-complexity"],"clientStyling":[513,"client-styling"],"enableSouthAfricanMode":[516,"enable-south-african-mode"],"mbSource":[513,"mb-source"],"isValid":[32],"errorMessage":[32],"showTooltip":[32],"passwordComplexity":[32],"showPopup":[32],"value":[32]},[[16,"sendOriginalValidityState","originalValidityChangedHandler"],[16,"sendInputValue","valueChangedHandler"],[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"value":["valueChanged"],"emitValue":["emitValueHandler"]}],[1,"postalcode-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"postalcodelength":[520],"addresses":[520],"ignoreCountry":[516,"ignore-country"],"mbSource":[513,"mb-source"],"isValid":[32],"errorMessage":[32],"showTooltip":[32],"selectedCountryCode":[32],"currentPostalCode":[32],"openAddressDropdown":[32],"showNoResultsMessage":[32],"refreshTrigger":[32],"isFetchingAddresses":[32]},[[10,"click","handleClickOutside"],[8,"countryCodeUpdated","handleCountryCodeUpdate"],[8,"addressFetchStarted","handleFetchStarted"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"],"addresses":["handleAddresses"]}],[1,"radio-input",{"name":[513],"displayName":[513,"display-name"],"optionsGroup":[16],"validation":[16],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"select-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[16],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"tel-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"showLabels":[516,"show-labels"],"action":[513],"validation":[16],"defaultValue":[520,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"enableCustomRegexValidation":[516,"enable-custom-regex-validation"],"isValid":[32],"errorMessage":[32],"showTooltip":[32],"disablePhonePrefix":[32],"phoneValue":[32],"phoneCodesOptions":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"text-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"checkValidity":[516,"check-validity"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"haspostalcodelookup":[516],"enableSouthAfricanMode":[516,"enable-south-african-mode"],"mbSource":[513,"mb-source"],"isValid":[32],"errorMessage":[32],"showTooltip":[32],"selectedCountryCode":[32]},[[10,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"],[16,"validationChange","handleValidationChange"],[8,"countryCodeUpdated","handleCountryCodeUpdate"],[16,"sendAddressValue","handleAddressSelection"],[8,"documentNumberUpdatedExternally","handleExternalDocUpdate"],[8,"documentNumberResetValidation","handleDocReset"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"twofa-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"destination":[513],"resendIntervalSeconds":[514,"resend-interval-seconds"],"clientStyling":[513,"client-styling"],"enableSouthAfricanMode":[516,"enable-south-african-mode"],"pinAttemptsExceeded":[516,"pin-attempts-exceeded"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"startCountDown":[516,"start-count-down"],"isValid":[32],"isResendButtonAvailable":[32],"showTooltip":[32],"errorMessage":[32],"code":[32],"resendIntervalSecondsLeft":[32],"revealedIndexes":[32]},[[10,"click","handleClickOutside"]],{"isValid":["validityChanged"],"emitValue":["emitValueHandler"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
22
+ return index.bootstrapLazy([["checkbox-group-input_14.cjs",[[1,"general-input",{"type":[513],"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"validation":[16],"options":[520],"language":[513],"autofilled":[516],"tooltip":[513],"defaultValue":[520,"default-value"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"hidePasswordComplexity":[516,"hide-password-complexity"],"noValidation":[516,"no-validation"],"clientStyling":[520,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"dateFormat":[513,"date-format"],"translationUrl":[513,"translation-url"],"emitOnClick":[516,"emit-on-click"],"twofaDestination":[513,"twofa-destination"],"twofaResendIntervalSeconds":[514,"twofa-resend-interval-seconds"],"twofaStartCountDown":[516,"twofa-start-count-down"],"haspostalcodelookup":[516],"postalcodelength":[514],"addresses":[520],"ignoreCountry":[516,"ignore-country"],"enableSouthAfricanMode":[516,"enable-south-african-mode"],"enableManualDateInput":[516,"enable-manual-date-input"],"pinAttemptsExceeded":[516,"pin-attempts-exceeded"],"mbSource":[513,"mb-source"],"enableCustomRegexValidation":[516,"enable-custom-regex-validation"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}],[1,"toggle-checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"options":[16],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"translationUrl":[513,"translation-url"],"errorMessage":[32],"isValid":[32],"showTooltip":[32],"showFields":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"]}],[1,"checkbox-group-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[16],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32],"selectedValues":[32],"showCheckboxes":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"selectedValues":["setValue"],"emitValue":["emitValueHandler"]}],[1,"checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"date-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"dateFormat":[513,"date-format"],"emitOnClick":[516,"emit-on-click"],"enableSouthAfricanMode":[516,"enable-south-african-mode"],"enableManualDateInput":[516,"enable-manual-date-input"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"],"enableSouthAfricanMode":["handleCustomRegistrationChange"]}],[1,"email-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"number-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"password-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"noValidation":[516,"no-validation"],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"hidePasswordComplexity":[516,"hide-password-complexity"],"clientStyling":[513,"client-styling"],"enableSouthAfricanMode":[516,"enable-south-african-mode"],"mbSource":[513,"mb-source"],"isValid":[32],"errorMessage":[32],"showTooltip":[32],"passwordComplexity":[32],"showPopup":[32],"value":[32]},[[16,"sendOriginalValidityState","originalValidityChangedHandler"],[16,"sendInputValue","valueChangedHandler"],[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"value":["valueChanged"],"emitValue":["emitValueHandler"]}],[1,"postalcode-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"postalcodelength":[520],"addresses":[520],"ignoreCountry":[516,"ignore-country"],"mbSource":[513,"mb-source"],"isValid":[32],"errorMessage":[32],"showTooltip":[32],"selectedCountryCode":[32],"currentPostalCode":[32],"openAddressDropdown":[32],"showNoResultsMessage":[32],"refreshTrigger":[32],"isFetchingAddresses":[32]},[[10,"click","handleClickOutside"],[8,"countryCodeUpdated","handleCountryCodeUpdate"],[8,"addressFetchStarted","handleFetchStarted"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"],"addresses":["handleAddresses"]}],[1,"radio-input",{"name":[513],"displayName":[513,"display-name"],"optionsGroup":[16],"validation":[16],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"select-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[16],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"tel-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"showLabels":[516,"show-labels"],"action":[513],"validation":[16],"defaultValue":[520,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"enableCustomRegexValidation":[516,"enable-custom-regex-validation"],"isValid":[32],"errorMessage":[32],"showTooltip":[32],"disablePhonePrefix":[32],"phoneValue":[32],"phoneCodesOptions":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"text-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"checkValidity":[516,"check-validity"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"haspostalcodelookup":[516],"enableSouthAfricanMode":[516,"enable-south-african-mode"],"mbSource":[513,"mb-source"],"isValid":[32],"errorMessage":[32],"showTooltip":[32],"selectedCountryCode":[32]},[[10,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"],[16,"validationChange","handleValidationChange"],[8,"countryCodeUpdated","handleCountryCodeUpdate"],[16,"sendAddressValue","handleAddressSelection"],[8,"documentNumberUpdatedExternally","handleExternalDocUpdate"],[8,"documentNumberResetValidation","handleDocReset"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"twofa-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"destination":[513],"resendIntervalSeconds":[514,"resend-interval-seconds"],"clientStyling":[513,"client-styling"],"enableSouthAfricanMode":[516,"enable-south-african-mode"],"pinAttemptsExceeded":[516,"pin-attempts-exceeded"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"startCountDown":[516,"start-count-down"],"isValid":[32],"isResendButtonAvailable":[32],"showTooltip":[32],"errorMessage":[32],"code":[32],"resendIntervalSecondsLeft":[32],"revealedIndexes":[32]},[[10,"click","handleClickOutside"]],{"isValid":["validityChanged"],"emitValue":["emitValueHandler"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -860,6 +860,16 @@ var postUpdateComponent = (hostRef) => {
860
860
  hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
861
861
  }
862
862
  };
863
+ var forceUpdate = (ref) => {
864
+ {
865
+ const hostRef = getHostRef(ref);
866
+ const isConnected = hostRef.$hostElement$.isConnected;
867
+ if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
868
+ scheduleUpdate(hostRef, false);
869
+ }
870
+ return isConnected;
871
+ }
872
+ };
863
873
  var appDidLoad = (who) => {
864
874
  {
865
875
  addHydratedFlag(doc.documentElement);
@@ -1289,6 +1299,7 @@ var setNonce = (nonce) => plt.$nonce$ = nonce;
1289
1299
  exports.Host = Host;
1290
1300
  exports.bootstrapLazy = bootstrapLazy;
1291
1301
  exports.createEvent = createEvent;
1302
+ exports.forceUpdate = forceUpdate;
1292
1303
  exports.getElement = getElement;
1293
1304
  exports.h = h;
1294
1305
  exports.promiseResolve = promiseResolve;
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-7a4b2771.js');
5
+ const index = require('./index-2221a973.js');
6
6
  const appGlobals = require('./app-globals-3a1e7e63.js');
7
7
 
8
8
  const defineCustomElements = async (win, options) => {
9
9
  if (typeof window === 'undefined') return undefined;
10
10
  await appGlobals.globalScripts();
11
- return index.bootstrapLazy([["checkbox-group-input_14.cjs",[[1,"general-input",{"type":[513],"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"validation":[16],"options":[520],"language":[513],"autofilled":[516],"tooltip":[513],"defaultValue":[520,"default-value"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"hidePasswordComplexity":[516,"hide-password-complexity"],"noValidation":[516,"no-validation"],"clientStyling":[520,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"dateFormat":[513,"date-format"],"translationUrl":[513,"translation-url"],"emitOnClick":[516,"emit-on-click"],"twofaDestination":[513,"twofa-destination"],"twofaResendIntervalSeconds":[514,"twofa-resend-interval-seconds"],"twofaStartCountDown":[516,"twofa-start-count-down"],"haspostalcodelookup":[516],"postalcodelength":[514],"addresses":[520],"ignoreCountry":[516,"ignore-country"],"enableSouthAfricanMode":[516,"enable-south-african-mode"],"enableManualDateInput":[516,"enable-manual-date-input"],"pinAttemptsExceeded":[516,"pin-attempts-exceeded"],"mbSource":[513,"mb-source"],"enableCustomRegexValidation":[516,"enable-custom-regex-validation"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}],[1,"toggle-checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"options":[16],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32],"showFields":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"]}],[1,"checkbox-group-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[16],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32],"selectedValues":[32],"showCheckboxes":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"selectedValues":["setValue"],"emitValue":["emitValueHandler"]}],[1,"checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"date-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"dateFormat":[513,"date-format"],"emitOnClick":[516,"emit-on-click"],"enableSouthAfricanMode":[516,"enable-south-african-mode"],"enableManualDateInput":[516,"enable-manual-date-input"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"],"enableSouthAfricanMode":["handleCustomRegistrationChange"]}],[1,"email-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"number-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"password-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"noValidation":[516,"no-validation"],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"hidePasswordComplexity":[516,"hide-password-complexity"],"clientStyling":[513,"client-styling"],"enableSouthAfricanMode":[516,"enable-south-african-mode"],"mbSource":[513,"mb-source"],"isValid":[32],"errorMessage":[32],"showTooltip":[32],"passwordComplexity":[32],"showPopup":[32],"value":[32]},[[16,"sendOriginalValidityState","originalValidityChangedHandler"],[16,"sendInputValue","valueChangedHandler"],[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"value":["valueChanged"],"emitValue":["emitValueHandler"]}],[1,"postalcode-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"postalcodelength":[520],"addresses":[520],"ignoreCountry":[516,"ignore-country"],"mbSource":[513,"mb-source"],"isValid":[32],"errorMessage":[32],"showTooltip":[32],"selectedCountryCode":[32],"currentPostalCode":[32],"openAddressDropdown":[32],"showNoResultsMessage":[32],"refreshTrigger":[32],"isFetchingAddresses":[32]},[[10,"click","handleClickOutside"],[8,"countryCodeUpdated","handleCountryCodeUpdate"],[8,"addressFetchStarted","handleFetchStarted"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"],"addresses":["handleAddresses"]}],[1,"radio-input",{"name":[513],"displayName":[513,"display-name"],"optionsGroup":[16],"validation":[16],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"select-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[16],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"tel-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"showLabels":[516,"show-labels"],"action":[513],"validation":[16],"defaultValue":[520,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"enableCustomRegexValidation":[516,"enable-custom-regex-validation"],"isValid":[32],"errorMessage":[32],"showTooltip":[32],"disablePhonePrefix":[32],"phoneValue":[32],"phoneCodesOptions":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"text-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"checkValidity":[516,"check-validity"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"haspostalcodelookup":[516],"enableSouthAfricanMode":[516,"enable-south-african-mode"],"mbSource":[513,"mb-source"],"isValid":[32],"errorMessage":[32],"showTooltip":[32],"selectedCountryCode":[32]},[[10,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"],[16,"validationChange","handleValidationChange"],[8,"countryCodeUpdated","handleCountryCodeUpdate"],[16,"sendAddressValue","handleAddressSelection"],[8,"documentNumberUpdatedExternally","handleExternalDocUpdate"],[8,"documentNumberResetValidation","handleDocReset"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"twofa-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"destination":[513],"resendIntervalSeconds":[514,"resend-interval-seconds"],"clientStyling":[513,"client-styling"],"enableSouthAfricanMode":[516,"enable-south-african-mode"],"pinAttemptsExceeded":[516,"pin-attempts-exceeded"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"startCountDown":[516,"start-count-down"],"isValid":[32],"isResendButtonAvailable":[32],"showTooltip":[32],"errorMessage":[32],"code":[32],"resendIntervalSecondsLeft":[32],"revealedIndexes":[32]},[[10,"click","handleClickOutside"]],{"isValid":["validityChanged"],"emitValue":["emitValueHandler"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
11
+ return index.bootstrapLazy([["checkbox-group-input_14.cjs",[[1,"general-input",{"type":[513],"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"validation":[16],"options":[520],"language":[513],"autofilled":[516],"tooltip":[513],"defaultValue":[520,"default-value"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"hidePasswordComplexity":[516,"hide-password-complexity"],"noValidation":[516,"no-validation"],"clientStyling":[520,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"dateFormat":[513,"date-format"],"translationUrl":[513,"translation-url"],"emitOnClick":[516,"emit-on-click"],"twofaDestination":[513,"twofa-destination"],"twofaResendIntervalSeconds":[514,"twofa-resend-interval-seconds"],"twofaStartCountDown":[516,"twofa-start-count-down"],"haspostalcodelookup":[516],"postalcodelength":[514],"addresses":[520],"ignoreCountry":[516,"ignore-country"],"enableSouthAfricanMode":[516,"enable-south-african-mode"],"enableManualDateInput":[516,"enable-manual-date-input"],"pinAttemptsExceeded":[516,"pin-attempts-exceeded"],"mbSource":[513,"mb-source"],"enableCustomRegexValidation":[516,"enable-custom-regex-validation"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}],[1,"toggle-checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"options":[16],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"translationUrl":[513,"translation-url"],"errorMessage":[32],"isValid":[32],"showTooltip":[32],"showFields":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"]}],[1,"checkbox-group-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[16],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32],"selectedValues":[32],"showCheckboxes":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"selectedValues":["setValue"],"emitValue":["emitValueHandler"]}],[1,"checkbox-input",{"name":[513],"displayName":[513,"display-name"],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"date-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"dateFormat":[513,"date-format"],"emitOnClick":[516,"emit-on-click"],"enableSouthAfricanMode":[516,"enable-south-african-mode"],"enableManualDateInput":[516,"enable-manual-date-input"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"],"enableSouthAfricanMode":["handleCustomRegistrationChange"]}],[1,"email-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"number-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"password-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"validation":[16],"noValidation":[516,"no-validation"],"language":[513],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"hidePasswordComplexity":[516,"hide-password-complexity"],"clientStyling":[513,"client-styling"],"enableSouthAfricanMode":[516,"enable-south-african-mode"],"mbSource":[513,"mb-source"],"isValid":[32],"errorMessage":[32],"showTooltip":[32],"passwordComplexity":[32],"showPopup":[32],"value":[32]},[[16,"sendOriginalValidityState","originalValidityChangedHandler"],[16,"sendInputValue","valueChangedHandler"],[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"value":["valueChanged"],"emitValue":["emitValueHandler"]}],[1,"postalcode-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"postalcodelength":[520],"addresses":[520],"ignoreCountry":[516,"ignore-country"],"mbSource":[513,"mb-source"],"isValid":[32],"errorMessage":[32],"showTooltip":[32],"selectedCountryCode":[32],"currentPostalCode":[32],"openAddressDropdown":[32],"showNoResultsMessage":[32],"refreshTrigger":[32],"isFetchingAddresses":[32]},[[10,"click","handleClickOutside"],[8,"countryCodeUpdated","handleCountryCodeUpdate"],[8,"addressFetchStarted","handleFetchStarted"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"],"addresses":["handleAddresses"]}],[1,"radio-input",{"name":[513],"displayName":[513,"display-name"],"optionsGroup":[16],"validation":[16],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"select-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"action":[513],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"options":[16],"validation":[16],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"errorMessage":[32],"isValid":[32],"showTooltip":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"tel-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"showLabels":[516,"show-labels"],"action":[513],"validation":[16],"defaultValue":[520,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"clientStyling":[513,"client-styling"],"mbSource":[513,"mb-source"],"enableCustomRegexValidation":[516,"enable-custom-regex-validation"],"isValid":[32],"errorMessage":[32],"showTooltip":[32],"disablePhonePrefix":[32],"phoneValue":[32],"phoneCodesOptions":[32]},[[10,"click","handleClickOutside"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"text-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"defaultValue":[513,"default-value"],"autofilled":[516],"tooltip":[513],"language":[513],"checkValidity":[516,"check-validity"],"emitValue":[516,"emit-value"],"isDuplicateInput":[516,"is-duplicate-input"],"clientStyling":[513,"client-styling"],"haspostalcodelookup":[516],"enableSouthAfricanMode":[516,"enable-south-african-mode"],"mbSource":[513,"mb-source"],"isValid":[32],"errorMessage":[32],"showTooltip":[32],"selectedCountryCode":[32]},[[10,"click","handleClickOutside"],[16,"sendInputValue","valueChangedHandler"],[16,"validationChange","handleValidationChange"],[8,"countryCodeUpdated","handleCountryCodeUpdate"],[16,"sendAddressValue","handleAddressSelection"],[8,"documentNumberUpdatedExternally","handleExternalDocUpdate"],[8,"documentNumberResetValidation","handleDocReset"]],{"clientStyling":["handleClientStylingChange"],"isValid":["validityChanged"],"emitValue":["emitValueHandler"]}],[1,"twofa-input",{"name":[513],"displayName":[513,"display-name"],"placeholder":[513],"validation":[16],"tooltip":[513],"language":[513],"emitValue":[516,"emit-value"],"destination":[513],"resendIntervalSeconds":[514,"resend-interval-seconds"],"clientStyling":[513,"client-styling"],"enableSouthAfricanMode":[516,"enable-south-african-mode"],"pinAttemptsExceeded":[516,"pin-attempts-exceeded"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"startCountDown":[516,"start-count-down"],"isValid":[32],"isResendButtonAvailable":[32],"showTooltip":[32],"errorMessage":[32],"code":[32],"resendIntervalSecondsLeft":[32],"revealedIndexes":[32]},[[10,"click","handleClickOutside"]],{"isValid":["validityChanged"],"emitValue":["emitValueHandler"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
12
12
  };
13
13
 
14
14
  exports.setNonce = index.setNonce;
@@ -1,5 +1,6 @@
1
- import { h, Host } from "@stencil/core";
2
- import { getTranslations } from "../../utils/locale.utils";
1
+ import { forceUpdate, h, Host } from "@stencil/core";
2
+ import { getTranslations, setTranslation } from "../../utils/locale.utils";
3
+ import { getStreamTranslations } from "../../../../../../../../libs/common/src/i18n/index";
3
4
  import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
4
5
  import "../../../../../../../libs/vaadin-facade/index";
5
6
  export class GeneralInput {
@@ -60,9 +61,28 @@ export class GeneralInput {
60
61
  }
61
62
  }
62
63
  disconnectedCallback() {
64
+ var _a;
65
+ (_a = this.translationSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
63
66
  this.stylingSubscription && this.stylingSubscription.unsubscribe();
64
67
  }
68
+ handleClientTranslations() {
69
+ if (this.mbSource && !this.translationUrl) {
70
+ this.translationSubscription = getStreamTranslations(`${this.mbSource}.Translation`, this.translationSubscription, (data) => {
71
+ var _a;
72
+ if (!data || typeof data !== 'object')
73
+ return;
74
+ setTranslation(data);
75
+ forceUpdate(this.host);
76
+ (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('*').forEach((element) => {
77
+ if (typeof element.componentOnReady === 'function') {
78
+ forceUpdate(element);
79
+ }
80
+ });
81
+ });
82
+ }
83
+ }
65
84
  componentDidLoad() {
85
+ this.handleClientTranslations();
66
86
  this.handleClientStyling();
67
87
  this.registrationWidgetLoaded.emit();
68
88
  window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
@@ -96,7 +116,7 @@ export class GeneralInput {
96
116
  case 'checkboxgroup':
97
117
  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 });
98
118
  case 'togglecheckbox':
99
- 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 });
119
+ 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, "translation-url": this.translationUrl });
100
120
  case 'datetime':
101
121
  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 });
102
122
  case 'password':
@@ -121,7 +141,7 @@ export class GeneralInput {
121
141
  }
122
142
  }
123
143
  render() {
124
- return (h(Host, { key: '3d24065bd97aae6602df1223069eec8b49c14d03', class: `general-input--${this.name}`, onClick: this.handleClick }, this.renderInput()));
144
+ return (h(Host, { key: 'b9d7daf54c988a5cd60f6a4d2348aa276a9f8022', class: `general-input--${this.name}`, onClick: this.handleClick }, this.renderInput()));
125
145
  }
126
146
  static get is() { return "general-input"; }
127
147
  static get encapsulation() { return "shadow"; }
@@ -22,6 +22,7 @@ export class ToggleCheckboxInput {
22
22
  this.emitValue = undefined;
23
23
  this.clientStyling = '';
24
24
  this.mbSource = undefined;
25
+ this.translationUrl = undefined;
25
26
  this.errorMessage = undefined;
26
27
  this.isValid = undefined;
27
28
  this.showTooltip = false;
@@ -91,9 +92,9 @@ export class ToggleCheckboxInput {
91
92
  return null;
92
93
  }
93
94
  render() {
94
- 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 &&
95
- h("img", { key: 'be3c3e036f0bfe46658fce870ae0ffa258229e7d', class: 'togglecheckbox__tooltip-icon', src: tooltipIcon, 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 => {
96
- 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 });
95
+ return h("div", { key: '4bb7b3391398f78dceffef403f6b216c0cbdd312', class: `togglecheckbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '214848f815c996605c1f710c46dde6bfe83f0cf7', class: 'togglecheckbox__wrapper--flex' }, h("input", { key: 'e1b829fafa91d20a80c19d49c2ce536c41892c0d', 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: 'e01a4c6bc20fae1aa56ba2888e18c3b43181e7ce', class: 'togglecheckbox__error-message' }, this.errorMessage), h("div", { key: '5d4b6f06c72de9d9bb62dfcba08bd7366d355733', class: 'togglecheckbox__wrapper--relative' }, this.tooltip &&
96
+ h("img", { key: '51983de9c47a15e00b16ea7aae860c71580a6511', class: 'togglecheckbox__tooltip-icon', src: tooltipIcon, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), h("div", { key: 'ab12b489947e92ac32c9c061f5b30865996fe6e0', class: `togglecheckbox__fields-wrapper ${this.showFields ? '' : 'hidden'}` }, this.options.map(subfield => {
97
+ 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, "mb-source": this.translationUrl ? undefined : this.mbSource, tooltip: subfield.tooltip, placeholder: subfield.placeholder == null ? '' : subfield.placeholder, ref: el => this.subFieldsObject[subfield.name] = el });
97
98
  })));
98
99
  }
99
100
  static get is() { return "toggle-checkbox-input"; }
@@ -306,6 +307,23 @@ export class ToggleCheckboxInput {
306
307
  },
307
308
  "attribute": "mb-source",
308
309
  "reflect": true
310
+ },
311
+ "translationUrl": {
312
+ "type": "string",
313
+ "mutable": false,
314
+ "complexType": {
315
+ "original": "string",
316
+ "resolved": "string",
317
+ "references": {}
318
+ },
319
+ "required": false,
320
+ "optional": false,
321
+ "docs": {
322
+ "tags": [],
323
+ "text": "Translation URL passed from the parent input."
324
+ },
325
+ "attribute": "translation-url",
326
+ "reflect": true
309
327
  }
310
328
  };
311
329
  }
@@ -337,21 +337,23 @@ export const translate = (key, customLang, values) => {
337
337
  }
338
338
  return translation;
339
339
  };
340
+ export const setTranslation = (data) => {
341
+ Object.keys(data).forEach((locale) => {
342
+ TRANSLATIONS[locale] = TRANSLATIONS[locale] || {};
343
+ Object.keys(data[locale]).forEach((key) => {
344
+ if (typeof data[locale][key] === 'string') {
345
+ TRANSLATIONS[locale][key] = data[locale][key];
346
+ }
347
+ });
348
+ });
349
+ };
340
350
  export const getTranslations = (url) => {
341
351
  // fetch url, get the data, replace the TRANSLATIONS content
342
352
  return new Promise((resolve) => {
343
353
  fetch(url)
344
354
  .then((res) => res.json())
345
355
  .then((data) => {
346
- Object.keys(data).forEach((item) => {
347
- TRANSLATIONS[item] = TRANSLATIONS[item] || {};
348
- for (let key in data[item]) {
349
- if (typeof data[item][key] === 'string') {
350
- TRANSLATIONS[item] = TRANSLATIONS[item] || {};
351
- TRANSLATIONS[item][key] = data[item][key];
352
- }
353
- }
354
- });
356
+ setTranslation(data);
355
357
  resolve(true);
356
358
  });
357
359
  });
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-9174417a.js';
1
+ import { r as registerInstance, c as createEvent, h, g as getElement, H as Host, f as forceUpdate } from './index-3d4ccab2.js';
2
2
 
3
3
  const DEFAULT_LANGUAGE = 'en';
4
4
  const TRANSLATIONS = {
@@ -339,21 +339,23 @@ const translate = (key, customLang, values) => {
339
339
  }
340
340
  return translation;
341
341
  };
342
+ const setTranslation = (data) => {
343
+ Object.keys(data).forEach((locale) => {
344
+ TRANSLATIONS[locale] = TRANSLATIONS[locale] || {};
345
+ Object.keys(data[locale]).forEach((key) => {
346
+ if (typeof data[locale][key] === 'string') {
347
+ TRANSLATIONS[locale][key] = data[locale][key];
348
+ }
349
+ });
350
+ });
351
+ };
342
352
  const getTranslations = (url) => {
343
353
  // fetch url, get the data, replace the TRANSLATIONS content
344
354
  return new Promise((resolve) => {
345
355
  fetch(url)
346
356
  .then((res) => res.json())
347
357
  .then((data) => {
348
- Object.keys(data).forEach((item) => {
349
- TRANSLATIONS[item] = TRANSLATIONS[item] || {};
350
- for (let key in data[item]) {
351
- if (typeof data[item][key] === 'string') {
352
- TRANSLATIONS[item] = TRANSLATIONS[item] || {};
353
- TRANSLATIONS[item][key] = data[item][key];
354
- }
355
- }
356
- });
358
+ setTranslation(data);
357
359
  resolve(true);
358
360
  });
359
361
  });
@@ -6578,6 +6580,26 @@ const EmailInput = class {
6578
6580
  };
6579
6581
  EmailInput.style = EmailInputStyle0;
6580
6582
 
6583
+ /**
6584
+ * Subscribe to translation updates from the message bus.
6585
+ *
6586
+ * @param {string} domain - Message bus topic, such as `MyWidget.Translation`.
6587
+ * @param {object | undefined} subscription - Existing subscription returned if the message bus is unavailable.
6588
+ * @param {Function} onChange - Callback receiving the payload or `(locale, messages)` when byLocale is true.
6589
+ * @param {boolean} [byLocale=false] - Invoke the callback once per locale, ignoring invalid payloads.
6590
+ * @returns {object | undefined} The new or existing subscription.
6591
+ */
6592
+ function getStreamTranslations(domain, subscription, onChange, byLocale = false) {
6593
+ if (window.emMessageBus) {
6594
+ const callback = byLocale ? (data) => {
6595
+ if (!data || typeof data !== 'object' || Array.isArray(data)) return;
6596
+ Object.keys(data).forEach((locale) => onChange(locale, data[locale]));
6597
+ } : onChange;
6598
+ subscription = window.emMessageBus.subscribe(domain, callback);
6599
+ }
6600
+ return subscription;
6601
+ }
6602
+
6581
6603
  var qr=Object.defineProperty,Yr=Object.defineProperties;var Kr=Object.getOwnPropertyDescriptors;var lo=Object.getOwnPropertySymbols;var Gr=Object.prototype.hasOwnProperty,Xr=Object.prototype.propertyIsEnumerable;var Mt=(s,t,e)=>t in s?qr(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,we=(s,t)=>{for(var e in t||(t={}))Gr.call(t,e)&&Mt(s,e,t[e]);if(lo)for(var e of lo(t))Xr.call(t,e)&&Mt(s,e,t[e]);return s},Nt=(s,t)=>Yr(s,Kr(t));var k=(s,t,e)=>(Mt(s,typeof t!="symbol"?t+"":t,e),e);var Ce=(s,t,e)=>new Promise((i,o)=>{var r=l=>{try{a(e.next(l));}catch(d){o(d);}},n=l=>{try{a(e.throw(l));}catch(d){o(d);}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(r,n);a((e=e.apply(s,t)).next());});/**
6582
6604
  * @license
6583
6605
  * Copyright (c) 2021 - 2024 Vaadin Ltd.
@@ -13301,9 +13323,28 @@ const GeneralInput = class {
13301
13323
  }
13302
13324
  }
13303
13325
  disconnectedCallback() {
13326
+ var _a;
13327
+ (_a = this.translationSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
13304
13328
  this.stylingSubscription && this.stylingSubscription.unsubscribe();
13305
13329
  }
13330
+ handleClientTranslations() {
13331
+ if (this.mbSource && !this.translationUrl) {
13332
+ this.translationSubscription = getStreamTranslations(`${this.mbSource}.Translation`, this.translationSubscription, (data) => {
13333
+ var _a;
13334
+ if (!data || typeof data !== 'object')
13335
+ return;
13336
+ setTranslation(data);
13337
+ forceUpdate(this.host);
13338
+ (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('*').forEach((element) => {
13339
+ if (typeof element.componentOnReady === 'function') {
13340
+ forceUpdate(element);
13341
+ }
13342
+ });
13343
+ });
13344
+ }
13345
+ }
13306
13346
  componentDidLoad() {
13347
+ this.handleClientTranslations();
13307
13348
  this.handleClientStyling();
13308
13349
  this.registrationWidgetLoaded.emit();
13309
13350
  window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
@@ -13337,7 +13378,7 @@ const GeneralInput = class {
13337
13378
  case 'checkboxgroup':
13338
13379
  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 });
13339
13380
  case 'togglecheckbox':
13340
- 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 });
13381
+ 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, "translation-url": this.translationUrl });
13341
13382
  case 'datetime':
13342
13383
  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 });
13343
13384
  case 'password':
@@ -13362,7 +13403,7 @@ const GeneralInput = class {
13362
13403
  }
13363
13404
  }
13364
13405
  render() {
13365
- return (h(Host, { key: '3d24065bd97aae6602df1223069eec8b49c14d03', class: `general-input--${this.name}`, onClick: this.handleClick }, this.renderInput()));
13406
+ return (h(Host, { key: 'b9d7daf54c988a5cd60f6a4d2348aa276a9f8022', class: `general-input--${this.name}`, onClick: this.handleClick }, this.renderInput()));
13366
13407
  }
13367
13408
  get host() { return getElement(this); }
13368
13409
  static get watchers() { return {
@@ -15087,6 +15128,7 @@ const ToggleCheckboxInput = class {
15087
15128
  this.emitValue = undefined;
15088
15129
  this.clientStyling = '';
15089
15130
  this.mbSource = undefined;
15131
+ this.translationUrl = undefined;
15090
15132
  this.errorMessage = undefined;
15091
15133
  this.isValid = undefined;
15092
15134
  this.showTooltip = false;
@@ -15156,9 +15198,9 @@ const ToggleCheckboxInput = class {
15156
15198
  return null;
15157
15199
  }
15158
15200
  render() {
15159
- 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 &&
15160
- 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 => {
15161
- 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 });
15201
+ return h("div", { key: '4bb7b3391398f78dceffef403f6b216c0cbdd312', class: `togglecheckbox__wrapper ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '214848f815c996605c1f710c46dde6bfe83f0cf7', class: 'togglecheckbox__wrapper--flex' }, h("input", { key: 'e1b829fafa91d20a80c19d49c2ce536c41892c0d', 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: 'e01a4c6bc20fae1aa56ba2888e18c3b43181e7ce', class: 'togglecheckbox__error-message' }, this.errorMessage), h("div", { key: '5d4b6f06c72de9d9bb62dfcba08bd7366d355733', class: 'togglecheckbox__wrapper--relative' }, this.tooltip &&
15202
+ h("img", { key: '51983de9c47a15e00b16ea7aae860c71580a6511', class: 'togglecheckbox__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip()), h("div", { key: 'ab12b489947e92ac32c9c061f5b30865996fe6e0', class: `togglecheckbox__fields-wrapper ${this.showFields ? '' : 'hidden'}` }, this.options.map(subfield => {
15203
+ 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, "mb-source": this.translationUrl ? undefined : this.mbSource, tooltip: subfield.tooltip, placeholder: subfield.placeholder == null ? '' : subfield.placeholder, ref: el => this.subFieldsObject[subfield.name] = el });
15162
15204
  })));
15163
15205
  }
15164
15206
  static get watchers() { return {