@everymatrix/general-registration-hsl 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/checkbox-group-input_14.cjs.entry.js +13098 -0
  3. package/dist/cjs/general-registration-hsl-e3c6c171.js +1071 -0
  4. package/dist/cjs/general-registration-hsl.cjs.js +25 -0
  5. package/dist/cjs/index-f6112702.js +1323 -0
  6. package/dist/cjs/index.cjs.js +10 -0
  7. package/dist/cjs/loader.cjs.js +15 -0
  8. package/dist/collection/collection-manifest.json +31 -0
  9. package/dist/collection/components/general-registration-hsl/general-registration-hsl.css +130 -0
  10. package/dist/collection/components/general-registration-hsl/general-registration-hsl.js +1107 -0
  11. package/dist/collection/components/general-registration-hsl/index.js +1 -0
  12. package/dist/collection/index.js +1 -0
  13. package/dist/collection/utils/locale.utils.js +202 -0
  14. package/dist/collection/utils/utils.js +3 -0
  15. package/dist/esm/app-globals-0f993ce5.js +3 -0
  16. package/dist/esm/checkbox-group-input_14.entry.js +13081 -0
  17. package/dist/esm/general-registration-hsl-4e3648d7.js +1069 -0
  18. package/dist/esm/general-registration-hsl.js +20 -0
  19. package/dist/esm/index-8c1bd3e8.js +1294 -0
  20. package/dist/esm/index.js +2 -0
  21. package/dist/esm/loader.js +11 -0
  22. package/dist/general-registration-hsl/app-globals-0f993ce5.js +1 -0
  23. package/dist/general-registration-hsl/checkbox-group-input_14.entry.js +5614 -0
  24. package/dist/general-registration-hsl/general-registration-hsl-4e3648d7.js +15 -0
  25. package/dist/general-registration-hsl/general-registration-hsl.esm.js +1 -0
  26. package/dist/general-registration-hsl/index-8c1bd3e8.js +2 -0
  27. package/dist/general-registration-hsl/index.esm.js +1 -0
  28. package/dist/index.cjs.js +1 -0
  29. package/dist/index.js +1 -0
  30. package/dist/stencil.config.dev.js +19 -0
  31. package/dist/stencil.config.js +19 -0
  32. package/dist/storybook/main.js +43 -0
  33. package/dist/storybook/preview.js +9 -0
  34. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-registration-hsl/.stencil/libs/common/src/storybook/storybook-utils.d.ts +39 -0
  35. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-registration-hsl/.stencil/packages/stencil/general-input-hsl/src/utils/types.d.ts +111 -0
  36. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-registration-hsl/.stencil/packages/stencil/general-registration-hsl/stencil.config.d.ts +2 -0
  37. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-registration-hsl/.stencil/packages/stencil/general-registration-hsl/stencil.config.dev.d.ts +2 -0
  38. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-registration-hsl/.stencil/packages/stencil/general-registration-hsl/storybook/main.d.ts +3 -0
  39. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-registration-hsl/.stencil/packages/stencil/general-registration-hsl/storybook/preview.d.ts +70 -0
  40. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-registration-hsl/.stencil/tools/plugins/index.d.ts +3 -0
  41. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-registration-hsl/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +5 -0
  42. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-registration-hsl/.stencil/tools/plugins/vite-chunk-plugin.d.ts +6 -0
  43. package/dist/types/Users/maria.bumbar/Desktop/Widgets & Template/widgets-monorepo/packages/stencil/general-registration-hsl/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +4 -0
  44. package/dist/types/components/general-registration-hsl/general-registration-hsl.d.ts +142 -0
  45. package/dist/types/components/general-registration-hsl/index.d.ts +1 -0
  46. package/dist/types/components.d.ts +137 -0
  47. package/dist/types/index.d.ts +1 -0
  48. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  49. package/dist/types/utils/locale.utils.d.ts +14 -0
  50. package/dist/types/utils/utils.d.ts +1 -0
  51. package/loader/cdn.js +1 -0
  52. package/loader/index.cjs.js +1 -0
  53. package/loader/index.d.ts +24 -0
  54. package/loader/index.es2017.js +1 -0
  55. package/loader/index.js +2 -0
  56. package/loader/package.json +11 -0
  57. package/package.json +27 -0
@@ -0,0 +1,1107 @@
1
+ import { h } from "@stencil/core";
2
+ import { getTranslations, translate, TRANSLATIONS, DEFAULT_LANGUAGE } from "../../utils/locale.utils";
3
+ import { dispatchCustomEvent } from "../../../../../../../../libs/custom-events/src/index";
4
+ import "../../../../../general-input-hsl/dist/types/index";
5
+ import "../../../../../../svelte/player-consents/es2015/player-consents";
6
+ export class GeneralRegistrationHsl {
7
+ constructor() {
8
+ this.listOfInputValues = [];
9
+ this.listOfInputValidity = [];
10
+ this.listOfActions = [];
11
+ this.listOfInputs = [];
12
+ this.conditionalValidationMap = {};
13
+ this.lastStep = '';
14
+ this.emitValue = false;
15
+ this.form = null;
16
+ this.errorCode = '';
17
+ this.backButtonPressed = false;
18
+ this.registerErrors = false;
19
+ this.extraActions = [];
20
+ this.registerCredentialsEvent = null;
21
+ this.twofaDestination = '';
22
+ this.registrationStepsState = {
23
+ regId: null
24
+ };
25
+ this.setClientStyling = () => {
26
+ let sheet = document.createElement('style');
27
+ sheet.innerHTML = this.clientStyling;
28
+ this.host.shadowRoot.prepend(sheet);
29
+ };
30
+ this.setClientStylingURL = () => {
31
+ let url = new URL(this.clientStylingUrl);
32
+ let cssFile = document.createElement('style');
33
+ fetch(url.href)
34
+ .then((res) => res.text())
35
+ .then((data) => {
36
+ cssFile.innerHTML = data;
37
+ this.clientStyling = data;
38
+ setTimeout(() => { this.host.shadowRoot.prepend(cssFile); }, 1);
39
+ });
40
+ };
41
+ this.setStreamStyling = (domain) => {
42
+ if (window.emMessageBus) {
43
+ const sheet = document.createElement('style');
44
+ this.stylingSubscription = window.emMessageBus.subscribe(domain, (data) => {
45
+ sheet.innerHTML = data;
46
+ this.clientStyling = data;
47
+ this.host.shadowRoot.prepend(sheet);
48
+ });
49
+ }
50
+ };
51
+ // handles sending a custom event for initial interaction with the registration form
52
+ this.handleInitialClick = (e) => {
53
+ if (!this.isInitalInteraction)
54
+ return;
55
+ dispatchCustomEvent('register_start', { field: e.target.name });
56
+ this.isInitalInteraction = false;
57
+ };
58
+ this.endpoint = undefined;
59
+ this.language = 'en';
60
+ this.clientStyling = '';
61
+ this.mbSource = undefined;
62
+ this.clientStylingUrl = '';
63
+ this.translationUrl = '';
64
+ this.dateFormat = undefined;
65
+ this.buttonInsideForm = undefined;
66
+ this.btag = null;
67
+ this.emitOnClick = false;
68
+ this.errorMessage = '';
69
+ this.isFormValid = false;
70
+ this.isConsentValid = false;
71
+ this.isConsentReady = false;
72
+ this.isLoading = true;
73
+ this.isLoadingPOST = false;
74
+ this.registrationStep = '';
75
+ this.forms = [];
76
+ this.limitStylingAppends = false;
77
+ this.autofilled = false;
78
+ this.isInitalInteraction = true;
79
+ }
80
+ sendStep() {
81
+ this.registrationStepUpdated.emit(this.registrationStep);
82
+ window.postMessage({ type: 'registrationStepUpdated', step: this.registrationStep }, window.location.href);
83
+ }
84
+ handleStylingChange(newValue, oldValue) {
85
+ if (newValue !== oldValue)
86
+ this.setClientStyling();
87
+ }
88
+ handleStylingUrlChange(newValue, oldValue) {
89
+ if (newValue !== oldValue)
90
+ this.setClientStylingURL();
91
+ }
92
+ setFormValidity() {
93
+ this.errorMessage = '';
94
+ if (this.listOfInputValidity) {
95
+ this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
96
+ }
97
+ //Check for autofilled.
98
+ if (this.listOfInputs.some(inputs => inputs.autofill)) {
99
+ this.autofilled = true;
100
+ }
101
+ }
102
+ addBtag() {
103
+ this.addBtagValue();
104
+ }
105
+ checkInputsValidityHandler(event) {
106
+ // Set isValid state of the input in the list.
107
+ this.listOfInputValidity.find(input => input.name == event.detail.name).isValid = event.detail.valid;
108
+ // Check if any one is invalid.
109
+ this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
110
+ }
111
+ getInputsValueHandler(event) {
112
+ this.listOfInputValues.find(input => {
113
+ if (input.name == event.detail.name) {
114
+ input.value = event.detail.value;
115
+ input.type = event.detail.type || null;
116
+ }
117
+ });
118
+ this.stepsStateMachine({ event: 'set', type: 'values' });
119
+ this.handleConditionalValidation(event.detail.name, event.detail.value);
120
+ }
121
+ handleRequestTwofa() {
122
+ if (!this.twofaDestination)
123
+ return;
124
+ const url = new URL('api/v1/gm/legislation/twoFaCode/', this.endpoint);
125
+ const headers = new Headers({
126
+ 'Content-Type': 'application/problem+json; charset=utf-8'
127
+ });
128
+ const body = JSON.stringify({
129
+ channel: 'Sms',
130
+ destination: this.twofaDestination
131
+ });
132
+ const options = { method: 'POST', headers, body };
133
+ fetch(url.href, options)
134
+ .then(res => {
135
+ if (res.ok)
136
+ return;
137
+ res.json().then(err => {
138
+ var _a;
139
+ const errorCode = (_a = err.thirdPartyResponse) === null || _a === void 0 ? void 0 : _a.errorCode;
140
+ this.errorMessage = translate(errorCode, this.language) || translate('requestTwofaError', this.language);
141
+ });
142
+ })
143
+ .catch((err) => console.log(err));
144
+ }
145
+ messageHandler(e) {
146
+ //Handle Consents Message
147
+ if (!e.data)
148
+ return;
149
+ switch (e.data.type) {
150
+ case 'isConsentsValid':
151
+ this.listOfInputValidity.find((input) => input.name === "Consents").isValid = e.data.isValid;
152
+ this.isConsentValid = e.data.isValid;
153
+ this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
154
+ break;
155
+ }
156
+ }
157
+ componentWillLoad() {
158
+ return this.getRegisterConfig()
159
+ .then((config) => {
160
+ this.formatConfig(config);
161
+ this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
162
+ this.stepsStateMachine({ event: 'set', type: 'inputs' });
163
+ this.setupConditionalValidationMap();
164
+ }, (err) => {
165
+ console.error(err);
166
+ });
167
+ }
168
+ componentDidLoad() {
169
+ this.registrationWidgetLoaded.emit();
170
+ window.postMessage({ type: 'registrationWidgetLoaded' }, window.location.href);
171
+ if (!this.limitStylingAppends && this.host) {
172
+ if (window.emMessageBus != undefined) {
173
+ this.setStreamStyling(`${this.mbSource}.Style`);
174
+ }
175
+ else {
176
+ if (this.clientStyling)
177
+ this.setClientStyling();
178
+ if (this.clientStylingUrl)
179
+ this.setClientStylingURL();
180
+ this.limitStylingAppends = true;
181
+ }
182
+ }
183
+ }
184
+ disconnectedCallback() {
185
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
186
+ }
187
+ /**
188
+ * This function produces the conditionalValidationMap object presented below
189
+ *
190
+ * this.conditionalValidationMap =
191
+ * {
192
+ * correlationField: {
193
+ * correlationValue: {
194
+ * field: {
195
+ * ...validation
196
+ * },
197
+ * ...
198
+ * },
199
+ * ...
200
+ * },
201
+ * ...
202
+ * }
203
+ *
204
+ * - this object describes the conditional validation of some fields based on the value of others.
205
+ * - correlationField is the conditioning field, correlationValue is the value of the correlationField for which
206
+ * a certain validation is applied to the affected fields. {...validation} is an object of type ValidationSchema
207
+ */
208
+ setupConditionalValidationMap() {
209
+ for (const input of this.listOfInputs) {
210
+ // unconditioned rules (i.e correlationField and corrlationValue == null)
211
+ const staticRules = [];
212
+ // conditional rules
213
+ const conditionalRules = [];
214
+ for (const rule of input.validate.custom) {
215
+ if (!rule.correlationField || !rule.correlationValue) {
216
+ staticRules.push(rule);
217
+ continue;
218
+ }
219
+ conditionalRules.push(rule);
220
+ }
221
+ for (const rule of conditionalRules) {
222
+ if (rule.rule === 'regex') {
223
+ /**
224
+ * copy the original validation, replace the original "custom" rules (which contain all conditional rules)
225
+ * with only one conditional rule + all static rules, resulting in the validation for ${input} when
226
+ * ${rule.correlationField} takes value ${rule.correlationValue}
227
+ */
228
+ const validate = Object.assign({}, input.validate);
229
+ validate.custom = [...staticRules, rule];
230
+ const cf = rule.correlationField;
231
+ const cv = rule.correlationValue;
232
+ // assign new validation to ${input}
233
+ this.conditionalValidationMap[cf] = this.conditionalValidationMap[cf] || {};
234
+ this.conditionalValidationMap[cf][cv] = this.conditionalValidationMap[cf][cv] || {};
235
+ this.conditionalValidationMap[cf][cv][input.name] = validate;
236
+ }
237
+ }
238
+ }
239
+ }
240
+ /**
241
+ * Whenever a field changes its value, we check if it is conditioning any other fields and
242
+ * if it is we update the validation of the affected fields.
243
+ */
244
+ handleConditionalValidation(correlationField, correlationValue) {
245
+ if (!this.conditionalValidationMap[correlationField] ||
246
+ !this.conditionalValidationMap[correlationField][correlationValue]) {
247
+ return;
248
+ }
249
+ for (const [field, validation] of Object.entries(this.conditionalValidationMap[correlationField][correlationValue])) {
250
+ const registrationStepIdx = this.registrationStep && parseInt(this.registrationStep.replace('Step', '')) - 1;
251
+ this.forms[registrationStepIdx][this.registrationStep].find(item => item.name === field).validate = validation;
252
+ this.validationChange.emit({ validation, field });
253
+ }
254
+ }
255
+ nextHandler(e) {
256
+ e.preventDefault();
257
+ // Trigger events in subwidgets.
258
+ this.emitValue = true;
259
+ this.errorMessage = '';
260
+ this.registerErrors = false;
261
+ this.setRegisterStep();
262
+ }
263
+ backHandler(e) {
264
+ e.preventDefault();
265
+ this.registrationStep = this.stepChange('decrement');
266
+ this.errorMessage = '';
267
+ this.stepsStateMachine({ event: 'get', type: 'inputs' });
268
+ this.stepsStateMachine({ event: 'get', type: 'values' });
269
+ }
270
+ dispatchRegisterCredentialsEvent() {
271
+ let userNameEmail = '';
272
+ let userPassword = '';
273
+ Object.keys(this.registrationStepsState).forEach((step) => {
274
+ if (!this.registrationStepsState[step]['registerUserData'])
275
+ return;
276
+ if (!userNameEmail) {
277
+ userNameEmail = this.registrationStepsState[step]['registerUserData']['Email']
278
+ ? this.registrationStepsState[step]['registerUserData']['Email']['value']
279
+ : userNameEmail;
280
+ }
281
+ if (!userPassword) {
282
+ userPassword = this.registrationStepsState[step]['registerUserData']['Password']
283
+ ? this.registrationStepsState[step]['registerUserData']['Password']['value']
284
+ : userPassword;
285
+ }
286
+ });
287
+ this.registerCredentialsEvent = new CustomEvent('RegisterCredentials', {
288
+ bubbles: true,
289
+ detail: {
290
+ userNameEmail: userNameEmail,
291
+ userPassword: userPassword
292
+ }
293
+ });
294
+ window.dispatchEvent(this.registerCredentialsEvent);
295
+ }
296
+ stepsStateMachine(state) {
297
+ const saveToLocalStorage = () => {
298
+ localStorage.setItem('registrationStepsState', JSON.stringify(this.registrationStepsState));
299
+ };
300
+ const loadFromLocalStorage = () => {
301
+ return JSON.parse(localStorage.getItem('registrationStepsState'));
302
+ };
303
+ switch (state.event) {
304
+ case 'set':
305
+ if (state.type == 'inputs') {
306
+ // Store input-related data into the current step state
307
+ const currentStep = this.registrationStepsState[this.registrationStep];
308
+ currentStep.fields = this.listOfInputs;
309
+ currentStep.actions = this.listOfActions;
310
+ currentStep.fieldsValidity = this.listOfInputValidity;
311
+ }
312
+ if (state.type == 'values') {
313
+ // Map input values into the current step state
314
+ const currentStep = this.registrationStepsState[this.registrationStep];
315
+ currentStep.registerUserData = this.listOfInputValues.reduce((acc, curr) => {
316
+ acc[curr.name] = { value: curr.value, isDuplicate: curr.isDuplicate };
317
+ return acc;
318
+ }, {});
319
+ }
320
+ saveToLocalStorage();
321
+ break;
322
+ case 'get':
323
+ const savedUserData = loadFromLocalStorage();
324
+ if (!savedUserData)
325
+ return;
326
+ if (state.type == 'inputs') {
327
+ // Load input-related data from the saved state
328
+ const currentStep = this.registrationStepsState[this.registrationStep];
329
+ this.listOfInputs = currentStep.fields;
330
+ this.listOfActions = currentStep.actions;
331
+ this.listOfInputValidity = currentStep.fieldsValidity;
332
+ }
333
+ if (state.type == 'values') {
334
+ const savedValues = savedUserData[this.registrationStep].registerUserData;
335
+ // Convert saved values to the expected format for inputs
336
+ this.listOfInputValues = Object.keys(savedValues).map(name => {
337
+ return { name, value: savedValues[name].value, isDuplicate: savedValues[name].isDuplicate };
338
+ });
339
+ // Give to each field the user input as the default value.
340
+ this.listOfInputValues.forEach(inputValue => {
341
+ const input = this.listOfInputs.find(input => input.name === inputValue.name);
342
+ if (input) {
343
+ input.defaultValue = inputValue.value;
344
+ // if the input is a togglecheckbox, set the default value for each subfield.
345
+ if (input.inputType === 'togglecheckbox') {
346
+ input.data.subFields.forEach((subfield) => {
347
+ const subfieldValue = this.listOfInputValues.find(subfieldValue => subfieldValue.name === subfield.name);
348
+ subfield.defaultValue = subfieldValue.value;
349
+ });
350
+ }
351
+ }
352
+ });
353
+ }
354
+ this.isConsentReady = this.listOfActions.some(action => action === '/Consents');
355
+ this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
356
+ break;
357
+ }
358
+ }
359
+ triggerNotification(errMsg, errType = 'WidgetNotification') {
360
+ window.postMessage({
361
+ type: errType,
362
+ data: {
363
+ type: 'error',
364
+ message: errMsg
365
+ }
366
+ }, window.location.href);
367
+ }
368
+ getRegisterConfig(registrationID) {
369
+ const url = new URL('v1/player/legislation/registration/config/', this.endpoint);
370
+ const headers = new Headers();
371
+ headers.append('Content-Type', 'application/json');
372
+ headers.append('Accept', 'application/json');
373
+ if (registrationID) {
374
+ url.searchParams.append('registrationId', registrationID);
375
+ }
376
+ const options = {
377
+ method: 'GET',
378
+ headers
379
+ };
380
+ return new Promise((resolve, reject) => {
381
+ this.isLoading = true;
382
+ fetch(url.href, options)
383
+ .then((res) => {
384
+ if (!res.ok) {
385
+ this.registerErrors = true;
386
+ return res.json().then(error => {
387
+ this.errorCode = error.thirdPartyResponse.errorCode;
388
+ this.errorMessage = translate(`${this.errorCode}`, this.language) || translate(`generalError`, this.language);
389
+ this.triggerNotification(this.errorMessage);
390
+ });
391
+ }
392
+ return res.json();
393
+ })
394
+ .then((config) => {
395
+ this.isLoading = false;
396
+ if (!config) {
397
+ return reject('Get register config is empty or has an error.');
398
+ }
399
+ return resolve(config);
400
+ }, (err) => {
401
+ console.error('Get register config is empty or has an error: ', err);
402
+ return reject(err);
403
+ }).finally(() => {
404
+ this.isLoading = false;
405
+ });
406
+ });
407
+ }
408
+ setRegisterStep() {
409
+ this.isLoadingPOST = true;
410
+ const url = new URL('v1/player/legislation/registration/step/', this.endpoint);
411
+ const registerStep = {
412
+ registrationId: this.registrationID,
413
+ registerUserDto: this.listOfInputValues
414
+ .filter(input => !input.isDuplicate)
415
+ .reduce((acc, curr) => {
416
+ // Because the API is very robust, some values need to be split as separate entities.
417
+ if (curr.name === 'TypeOfPublicArea') {
418
+ acc[curr.name] = curr.value.toLowerCase();
419
+ }
420
+ else if (curr.type === 'tel') {
421
+ //@ts-ignore
422
+ acc['MobilePrefix'] = curr.value.prefix;
423
+ //@ts-ignore
424
+ acc[curr.name] = curr.value.phone;
425
+ }
426
+ else if (curr.type === 'checkboxgroup') {
427
+ // Skip adding the parent of the checkboxgroup as a key.
428
+ if (curr.value !== null) {
429
+ Object.entries(curr.value).forEach(([key, value]) => {
430
+ acc[key] = value ? 'true' : 'false';
431
+ });
432
+ }
433
+ }
434
+ else if (curr.type === 'toggle') {
435
+ acc[curr.name] = curr.value ? 'true' : 'false';
436
+ }
437
+ else {
438
+ acc[curr.name] = curr.value;
439
+ }
440
+ return acc;
441
+ }, {}),
442
+ step: this.registrationStep,
443
+ };
444
+ const headers = new Headers();
445
+ headers.append('Content-Type', 'application/json');
446
+ headers.append('Accept', 'application/json');
447
+ const options = {
448
+ method: 'POST',
449
+ body: JSON.stringify(registerStep),
450
+ headers
451
+ };
452
+ fetch(url.href, options)
453
+ .then((res) => {
454
+ if (!res.ok) {
455
+ return res.json().then(error => {
456
+ this.errorCode = error.thirdPartyResponse.errorCode;
457
+ // Show the idomsoft error if it is the case
458
+ if (this.errorCode == 'GmErr_BadRequest_IdomsoftVerification_ShouldRetry') {
459
+ this.errorMessage = error.thirdPartyResponse.message;
460
+ }
461
+ else if (this.errorCode === 'GmErr_Forbidden_UserAccount_NavExcluded') {
462
+ this.errorMessage = translate(`${this.errorCode}`, this.language);
463
+ }
464
+ else if (this.errorCode == 'GmErr_BadRequest') {
465
+ this.errorMessage = error.thirdPartyResponse.message;
466
+ }
467
+ else {
468
+ this.errorMessage = translate(`${this.errorCode}`, this.language) || translate(`generalError`, this.language);
469
+ }
470
+ this.triggerNotification(this.errorMessage);
471
+ });
472
+ }
473
+ // handles sending suctom events and the requested data for each registration step
474
+ if (this.registrationStep === 'Step1') {
475
+ const eventData = {
476
+ // @ts-ignore
477
+ IBAN: registerStep.registerUserDto.IBAN,
478
+ // @ts-ignore
479
+ username: registerStep.registerUserDto.Username,
480
+ };
481
+ dispatchCustomEvent('register_step1', { eventLabel: this.registrationStep, eventAction: 'nextStep', eventCategory: 'Registration', eventData: eventData });
482
+ }
483
+ else if (this.registrationStep === 'Step2') {
484
+ const eventData = {
485
+ // @ts-ignore
486
+ gender: registerStep.registerUserDto.Gender,
487
+ // @ts-ignore
488
+ fullName: `${registerStep.registerUserDto.FirstnameOnDocument} ${registerStep.registerUserDto.LastNameOnDocument}`,
489
+ // @ts-ignore
490
+ city: registerStep.registerUserDto.City
491
+ };
492
+ dispatchCustomEvent('register_step2', { eventLabel: this.registrationStep, eventAction: 'nextStep', eventCategory: 'Registration', eventData: eventData });
493
+ }
494
+ else if (this.registrationStep === 'Step3') {
495
+ const eventData = {
496
+ // @ts-ignore
497
+ OIB: registerStep.registerUserDto.PersonalID,
498
+ // @ts-ignore
499
+ documentType: registerStep.registerUserDto.DocumentType,
500
+ };
501
+ dispatchCustomEvent('register_step3', { eventLabel: this.registrationStep, eventAction: 'nextStep', eventCategory: 'Registration', eventData: eventData });
502
+ }
503
+ return res.json();
504
+ })
505
+ .then((data) => {
506
+ this.isLoadingPOST = false;
507
+ this.registrationID = data.registrationId;
508
+ if (this.listOfActions.find(action => action === '/request-2FA')) {
509
+ this.twofaDestination = Object.values(this.listOfInputValues.find(item => item.type === 'tel').value).join('');
510
+ this.handleRequestTwofa();
511
+ }
512
+ if (this.listOfActions.some(action => action == '/register')) {
513
+ if (this.listOfActions.some(action => action == '/generate-2FA-code/Generate2FACode')) {
514
+ this.extraActions.push('2fa');
515
+ }
516
+ if (localStorage.getItem('playerConsents')) {
517
+ localStorage.removeItem("playerConsents");
518
+ }
519
+ this.setRegister();
520
+ }
521
+ else {
522
+ if (this.isConsentValid) {
523
+ window.postMessage({ type: 'setUpPlayerConsents', registerid: this.registrationID });
524
+ }
525
+ // After sending the current step, increment and check if the next one is in state.
526
+ this.registrationStep = this.stepChange('increment');
527
+ // If step is present in state do NOT fetch the next config.
528
+ if (Object.keys(this.registrationStepsState).find(key => key == this.registrationStep)) {
529
+ // Use the one from state
530
+ this.stepsStateMachine({ event: 'get', type: 'inputs' });
531
+ this.stepsStateMachine({ event: 'get', type: 'values' });
532
+ }
533
+ else {
534
+ this.getRegisterConfig(this.registrationID).then((config) => {
535
+ // Format the new step config.
536
+ this.formatConfig(config);
537
+ // Set it in local storage.
538
+ this.stepsStateMachine({ event: 'set', type: 'inputs' });
539
+ // Setup conditionalValidationMap
540
+ this.setupConditionalValidationMap();
541
+ }, (err) => {
542
+ // Only send the error to user because this.getRegisterConfig already has proper error logging
543
+ this.triggerNotification(err);
544
+ });
545
+ }
546
+ }
547
+ })
548
+ .catch((err) => {
549
+ this.isLoadingPOST = false;
550
+ console.error(err);
551
+ }).finally(() => {
552
+ this.isLoadingPOST = false;
553
+ });
554
+ }
555
+ setRegister() {
556
+ this.isLoading = true;
557
+ this.registerErrors = false;
558
+ const url = new URL('v1/player/legislation/register/', this.endpoint);
559
+ const headers = new Headers();
560
+ headers.append('Content-Type', 'application/json');
561
+ headers.append('Accept', 'application/json');
562
+ const options = {
563
+ method: 'PUT',
564
+ body: JSON.stringify({ registrationId: this.registrationID }),
565
+ headers
566
+ };
567
+ dispatchCustomEvent('register_submit', { registrationId: this.registrationID });
568
+ fetch(url.href, options)
569
+ .then((res) => {
570
+ if (!res.ok) {
571
+ this.registerErrors = true;
572
+ return res.json().then(error => {
573
+ this.errorCode = error.thirdPartyResponse.errorCode;
574
+ // Show the idomsoft error if it is the case
575
+ if (this.errorCode == 'GmErr_BadRequest_IdomsoftVerification_ShouldRetry') {
576
+ this.errorMessage = error.thirdPartyResponse.message;
577
+ }
578
+ else if (this.errorCode == 'GmErr_BadRequest') {
579
+ this.errorMessage = error.thirdPartyResponse.message;
580
+ }
581
+ else {
582
+ this.errorMessage = translate(`${this.errorCode}`, this.language) || translate(`generalError`, this.language);
583
+ }
584
+ window.postMessage({ type: 'registrationFailed', errorMessage: error === null || error === void 0 ? void 0 : error.thirdPartyResponse.message }, window.location.href);
585
+ this.triggerNotification(this.errorMessage);
586
+ dispatchCustomEvent('register_fail', { error: this.errorMessage });
587
+ });
588
+ }
589
+ return res.json();
590
+ })
591
+ .then((data) => {
592
+ this.isLoading = false;
593
+ if (!this.registerErrors) {
594
+ this.dispatchRegisterCredentialsEvent();
595
+ window.postMessage({ type: 'registrationSuccessful', userId: data === null || data === void 0 ? void 0 : data.userId, extraActions: this.extraActions }, window.location.href);
596
+ window.postMessage({
597
+ type: 'WidgetNotification', data: {
598
+ type: 'success',
599
+ message: translate('successMessage', this.language)
600
+ }
601
+ }, window.location.href);
602
+ dispatchCustomEvent('register_closed', { userId: data.userId });
603
+ }
604
+ })
605
+ .catch((err) => {
606
+ this.isLoading = false;
607
+ console.error(err);
608
+ })
609
+ .finally(() => {
610
+ this.isLoading = false;
611
+ });
612
+ }
613
+ formatConfig(config) {
614
+ this.listOfInputs = config.content.fields.flatMap((field) => {
615
+ // Special case for inputs that need to be duplicated.
616
+ const duplicateInputRule = field.validate.custom.find(customRule => customRule.rule === 'duplicate-input');
617
+ const inputElement = Object.assign({}, field);
618
+ if (duplicateInputRule) {
619
+ const duplicateInput = Object.assign(Object.assign({}, field), { name: `${field.name}Duplicate`, displayName: duplicateInputRule.displayName, isDuplicateInput: true });
620
+ return [inputElement, duplicateInput];
621
+ }
622
+ else {
623
+ return [inputElement];
624
+ }
625
+ });
626
+ this.listOfInputValidity = this.listOfInputs.reduce((acc, field) => {
627
+ var _a;
628
+ // If the field is a togglecheckbox, add its subfields
629
+ if (((_a = field.inputType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "togglecheckbox") {
630
+ field.data.subFields.forEach(subfield => {
631
+ acc.push({
632
+ name: subfield.name,
633
+ isValid: this.setInitialValidStatus(subfield)
634
+ });
635
+ });
636
+ }
637
+ else {
638
+ acc.push({
639
+ name: field.name,
640
+ isValid: this.setInitialValidStatus(field)
641
+ });
642
+ }
643
+ return acc;
644
+ }, []);
645
+ this.listOfInputValues = this.listOfInputs.reduce((acc, field) => {
646
+ var _a;
647
+ const inputType = (_a = field.inputType) === null || _a === void 0 ? void 0 : _a.toLowerCase();
648
+ // If the field type is a 'togglecheckbox', add its subfields
649
+ if (inputType === 'togglecheckbox') {
650
+ field.data.subFields.forEach(subfield => {
651
+ var _a;
652
+ acc.push({
653
+ name: subfield.name,
654
+ value: ((_a = subfield.inputType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) == 'checkbox' ? 'false' : null,
655
+ isDuplicate: subfield.isDuplicateInput || false,
656
+ type: inputType === 'togglecheckbox' ? 'togglecheckbox' : null
657
+ });
658
+ });
659
+ }
660
+ acc.push({
661
+ name: field.name,
662
+ value: inputType === 'checkbox' || inputType === 'togglecheckbox' ? 'false' : null,
663
+ isDuplicate: field.isDuplicateInput || false,
664
+ type: inputType === 'checkboxgroup' ? 'checkboxgroup' : (inputType === 'togglecheckbox' ? 'toggle' : null)
665
+ });
666
+ return acc;
667
+ }, []);
668
+ if (this.btag)
669
+ this.addBtagValue();
670
+ // Set the list of actions
671
+ this.listOfActions = config.content.actions.map(action => action);
672
+ this.registrationID = config.content.registrationID;
673
+ this.registrationStep = config.content.step;
674
+ if (this.listOfActions.some(action => action == '/register')) {
675
+ this.lastStep = this.registrationStep;
676
+ }
677
+ ;
678
+ if (this.listOfActions.some(action => action == '/Consents')) {
679
+ if (this.isConsentReady) {
680
+ this.listOfInputValidity.find((input) => input.name === "Consents").isValid = false;
681
+ this.isFormValid = !this.getInvalidStatus(this.listOfInputValidity);
682
+ return;
683
+ }
684
+ this.listOfInputValidity.push({ name: 'Consents', isValid: false });
685
+ this.isConsentReady = true;
686
+ }
687
+ else {
688
+ this.isConsentReady = false;
689
+ }
690
+ // The translations for fields happens here.
691
+ if (this.translationUrl) {
692
+ getTranslations(this.translationUrl).then(() => {
693
+ this.listOfInputs.forEach(field => {
694
+ var _a, _b;
695
+ this.addTranslation(field);
696
+ // Logic for field types that have subfields
697
+ if (((_a = field.inputType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'togglecheckbox') {
698
+ field.data.subFields.forEach(subField => this.addTranslation(subField));
699
+ }
700
+ if (((_b = field.inputType) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'checkboxgroup') {
701
+ this.addTranslation(field);
702
+ field.data.subFields.forEach(subField => this.addTranslation(subField));
703
+ }
704
+ return field;
705
+ });
706
+ })
707
+ .catch((error) => {
708
+ console.error('Failed to fetch translations:', error);
709
+ }).finally(() => {
710
+ this.forms = [...this.forms, { [this.registrationStep]: this.listOfInputs }];
711
+ });
712
+ }
713
+ else {
714
+ this.forms = [...this.forms, { [this.registrationStep]: this.listOfInputs }];
715
+ }
716
+ // Add the step to the registrationStepsData
717
+ this.registrationStepsState.regId = this.registrationID;
718
+ if (!this.registrationStepsState[this.registrationStep]) {
719
+ this.registrationStepsState[this.registrationStep] = {
720
+ fields: [],
721
+ fieldsValidity: [],
722
+ registerUserData: {},
723
+ actions: []
724
+ };
725
+ }
726
+ }
727
+ addBtagValue() {
728
+ const btagField = this.listOfInputs.find(input => input.name.toLowerCase() === 'btag');
729
+ if (btagField) {
730
+ btagField.defaultValue = this.btag;
731
+ }
732
+ const btagValue = this.listOfInputValues.find(input => input.name.toLowerCase() === 'btag');
733
+ if (btagValue) {
734
+ btagValue.value = this.btag;
735
+ }
736
+ }
737
+ addTranslation(field) {
738
+ const lang = TRANSLATIONS[this.language] ? this.language : DEFAULT_LANGUAGE;
739
+ if (TRANSLATIONS[lang][field.name]) {
740
+ Object.keys(TRANSLATIONS[this.language][field.name]).forEach((key) => {
741
+ field[key] = TRANSLATIONS[this.language][field.name][key];
742
+ });
743
+ }
744
+ }
745
+ setInitialValidStatus(field) {
746
+ var _a, _b, _c, _d;
747
+ // Input type checkbox, with no validation are valid
748
+ if (((_a = field.inputType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) == 'checkbox' && ((_b = field.validate) === null || _b === void 0 ? void 0 : _b.mandatory) == false) {
749
+ return true;
750
+ }
751
+ //Checkboxes that are mandatory and set as false || null should't be valid.
752
+ if (((_c = field.inputType) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'checkbox' && ((_d = field.validate) === null || _d === void 0 ? void 0 : _d.mandatory) && field.defaultValue !== 'true') {
753
+ return false;
754
+ }
755
+ //Inputs that have default value and aren't mandatory are valid.
756
+ if (field.defaultValue !== null) {
757
+ return true;
758
+ }
759
+ return false;
760
+ }
761
+ stepChange(action) {
762
+ const stepNum = parseInt(this.registrationStep.replace('Step', ''));
763
+ if (action === 'increment') {
764
+ return 'Step' + (stepNum + 1);
765
+ }
766
+ if (action === 'decrement') {
767
+ return 'Step' + (stepNum - 1);
768
+ }
769
+ }
770
+ getInvalidStatus(listOfInputs) {
771
+ return listOfInputs.filter(input => input.isValid == false).length > 0;
772
+ }
773
+ renderErrorMessage(errorMsg) {
774
+ return (h("p", { class: "registration registration__error-message" }, errorMsg));
775
+ }
776
+ renderForm() {
777
+ return this.forms.map((form, index) => {
778
+ return h("form", { action: '.', id: `RegistrationForm${this.registrationStep}`, class: `registration__form ${this.registrationStep !== `Step${index + 1}` ? 'hidden' : ''}`, ref: el => this.form = el, onClick: this.handleInitialClick }, form[this.registrationStep] && form[this.registrationStep].map((input) => {
779
+ var _a, _b;
780
+ return h("div", { key: input.name, class: "input-wrapper" }, h("general-input-hsl", { type: input.inputType, name: input.name, displayName: input.displayName, validation: input.validate, action: input.action || null, options: input.data
781
+ ? (input.inputType.toLowerCase() === 'checkboxgroup' || input.inputType.toLowerCase() === 'togglecheckbox')
782
+ ? input.data.subFields
783
+ : input.data.values
784
+ : [], defaultValue: input.defaultValue, autofilled: input.autofill, emitValue: this.emitValue, language: this.language, isDuplicateInput: input.isDuplicateInput, "client-styling": this.clientStyling, tooltip: input.tooltip, placeholder: input.placeholder == null ? '' : input.placeholder, "date-format": this.dateFormat, "twofa-destination": this.twofaDestination, "twofa-resend-interval-seconds": (_a = input.customInfo) === null || _a === void 0 ? void 0 : _a.twofaResendIntervalSeconds, "translation-url": this.translationUrl, emitOnClick: this.emitOnClick, onClick: this.handleInitialClick }), ((_b = input.customInfo) === null || _b === void 0 ? void 0 : _b.description) && (h("div", { class: "input-description" }, input.customInfo.description)));
785
+ }), this.isConsentReady && this.renderConsents(), this.buttonInsideForm && this.renderButtons(), h("div", { class: 'registration__wrapper--flex' }, h("p", { class: 'registration__error-message', innerHTML: this.errorMessage })));
786
+ });
787
+ }
788
+ ;
789
+ renderConsents() {
790
+ return (h("div", { class: "consentsContainer" }, h("player-consents", { endpoint: this.endpoint })));
791
+ }
792
+ renderButtons() {
793
+ return (h("div", null, this.isLoadingPOST
794
+ && h("slot", { name: 'spinner' })
795
+ && h("svg", { class: "spinner", viewBox: "0 0 50 50" }, h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none", "stroke-width": "5" })), !this.isLoadingPOST && h("div", { class: `registration__buttons-wrapper ${this.autofilled ? 'registration__buttons-wrapper--autofilled' : ''}` }, h("button", { class: `registration__button registration__button--next ${this.isFormValid ? '' : 'registration__button--disabled'}`, type: 'submit', form: `RegistrationForm${this.registrationStep}`, onClick: (e) => this.nextHandler(e), disabled: !this.isFormValid }, this.lastStep === this.registrationStep ? translate('doneButton', this.language) : translate('nextButton', this.language)), h("button", { class: `registration__button registration__button--back ${this.registrationStep == 'Step1' ? 'registration__button--first-step' : ''}`, onClick: (e) => this.backHandler(e) }, translate('backButton', this.language)))));
796
+ }
797
+ render() {
798
+ if (this.isLoading && !this.registerErrors) {
799
+ return h("p", { class: `registration registration__loading-message` }, translate('loadingMessage', this.language));
800
+ }
801
+ else if (!this.isLoading && this.registerErrors) {
802
+ return this.renderErrorMessage(this.errorMessage);
803
+ }
804
+ return (h("div", { class: `registration registration__${this.registrationStep}` }, this.renderForm(), !this.buttonInsideForm && this.renderButtons()));
805
+ }
806
+ static get is() { return "general-registration-hsl"; }
807
+ static get encapsulation() { return "shadow"; }
808
+ static get originalStyleUrls() {
809
+ return {
810
+ "$": ["general-registration-hsl.scss"]
811
+ };
812
+ }
813
+ static get styleUrls() {
814
+ return {
815
+ "$": ["general-registration-hsl.css"]
816
+ };
817
+ }
818
+ static get properties() {
819
+ return {
820
+ "endpoint": {
821
+ "type": "string",
822
+ "mutable": false,
823
+ "complexType": {
824
+ "original": "string",
825
+ "resolved": "string",
826
+ "references": {}
827
+ },
828
+ "required": true,
829
+ "optional": false,
830
+ "docs": {
831
+ "tags": [],
832
+ "text": "NorWAy Endpoint for all the calls."
833
+ },
834
+ "attribute": "endpoint",
835
+ "reflect": true
836
+ },
837
+ "language": {
838
+ "type": "string",
839
+ "mutable": false,
840
+ "complexType": {
841
+ "original": "string",
842
+ "resolved": "string",
843
+ "references": {}
844
+ },
845
+ "required": false,
846
+ "optional": false,
847
+ "docs": {
848
+ "tags": [],
849
+ "text": "Currently selected language"
850
+ },
851
+ "attribute": "language",
852
+ "reflect": true,
853
+ "defaultValue": "'en'"
854
+ },
855
+ "clientStyling": {
856
+ "type": "string",
857
+ "mutable": true,
858
+ "complexType": {
859
+ "original": "string",
860
+ "resolved": "string",
861
+ "references": {}
862
+ },
863
+ "required": false,
864
+ "optional": false,
865
+ "docs": {
866
+ "tags": [],
867
+ "text": "Client custom styling via inline styles"
868
+ },
869
+ "attribute": "client-styling",
870
+ "reflect": true,
871
+ "defaultValue": "''"
872
+ },
873
+ "mbSource": {
874
+ "type": "string",
875
+ "mutable": false,
876
+ "complexType": {
877
+ "original": "string",
878
+ "resolved": "string",
879
+ "references": {}
880
+ },
881
+ "required": false,
882
+ "optional": false,
883
+ "docs": {
884
+ "tags": [],
885
+ "text": "Client custom styling via streamStyling"
886
+ },
887
+ "attribute": "mb-source",
888
+ "reflect": false
889
+ },
890
+ "clientStylingUrl": {
891
+ "type": "string",
892
+ "mutable": false,
893
+ "complexType": {
894
+ "original": "string",
895
+ "resolved": "string",
896
+ "references": {}
897
+ },
898
+ "required": false,
899
+ "optional": false,
900
+ "docs": {
901
+ "tags": [],
902
+ "text": "Client custom styling via url"
903
+ },
904
+ "attribute": "client-styling-url",
905
+ "reflect": true,
906
+ "defaultValue": "''"
907
+ },
908
+ "translationUrl": {
909
+ "type": "string",
910
+ "mutable": false,
911
+ "complexType": {
912
+ "original": "string",
913
+ "resolved": "string",
914
+ "references": {}
915
+ },
916
+ "required": false,
917
+ "optional": false,
918
+ "docs": {
919
+ "tags": [],
920
+ "text": "Translations via URL"
921
+ },
922
+ "attribute": "translation-url",
923
+ "reflect": true,
924
+ "defaultValue": "''"
925
+ },
926
+ "dateFormat": {
927
+ "type": "string",
928
+ "mutable": false,
929
+ "complexType": {
930
+ "original": "string",
931
+ "resolved": "string",
932
+ "references": {}
933
+ },
934
+ "required": false,
935
+ "optional": false,
936
+ "docs": {
937
+ "tags": [],
938
+ "text": "Date format for date picker"
939
+ },
940
+ "attribute": "date-format",
941
+ "reflect": true
942
+ },
943
+ "buttonInsideForm": {
944
+ "type": "boolean",
945
+ "mutable": false,
946
+ "complexType": {
947
+ "original": "boolean",
948
+ "resolved": "boolean",
949
+ "references": {}
950
+ },
951
+ "required": true,
952
+ "optional": false,
953
+ "docs": {
954
+ "tags": [],
955
+ "text": "Boolean that decides the position of the button. e.g. button inside -- true / outside -- false the form."
956
+ },
957
+ "attribute": "button-inside-form",
958
+ "reflect": true
959
+ },
960
+ "btag": {
961
+ "type": "string",
962
+ "mutable": false,
963
+ "complexType": {
964
+ "original": "string",
965
+ "resolved": "string",
966
+ "references": {}
967
+ },
968
+ "required": false,
969
+ "optional": false,
970
+ "docs": {
971
+ "tags": [],
972
+ "text": "Affiliate code to be passed in and sent in the registration."
973
+ },
974
+ "attribute": "btag",
975
+ "reflect": true,
976
+ "defaultValue": "null"
977
+ },
978
+ "emitOnClick": {
979
+ "type": "boolean",
980
+ "mutable": false,
981
+ "complexType": {
982
+ "original": "boolean",
983
+ "resolved": "boolean",
984
+ "references": {}
985
+ },
986
+ "required": false,
987
+ "optional": false,
988
+ "docs": {
989
+ "tags": [],
990
+ "text": "Boolean flag that tells inputs to emit an event on click."
991
+ },
992
+ "attribute": "emit-on-click",
993
+ "reflect": true,
994
+ "defaultValue": "false"
995
+ }
996
+ };
997
+ }
998
+ static get states() {
999
+ return {
1000
+ "errorMessage": {},
1001
+ "isFormValid": {},
1002
+ "isConsentValid": {},
1003
+ "isConsentReady": {},
1004
+ "isLoading": {},
1005
+ "isLoadingPOST": {},
1006
+ "registrationStep": {},
1007
+ "forms": {},
1008
+ "limitStylingAppends": {},
1009
+ "autofilled": {},
1010
+ "isInitalInteraction": {}
1011
+ };
1012
+ }
1013
+ static get events() {
1014
+ return [{
1015
+ "method": "registrationWidgetLoaded",
1016
+ "name": "registrationWidgetLoaded",
1017
+ "bubbles": true,
1018
+ "cancelable": true,
1019
+ "composed": true,
1020
+ "docs": {
1021
+ "tags": [],
1022
+ "text": ""
1023
+ },
1024
+ "complexType": {
1025
+ "original": "any",
1026
+ "resolved": "any",
1027
+ "references": {}
1028
+ }
1029
+ }, {
1030
+ "method": "registrationStepUpdated",
1031
+ "name": "registrationStepUpdated",
1032
+ "bubbles": true,
1033
+ "cancelable": true,
1034
+ "composed": true,
1035
+ "docs": {
1036
+ "tags": [],
1037
+ "text": ""
1038
+ },
1039
+ "complexType": {
1040
+ "original": "string",
1041
+ "resolved": "string",
1042
+ "references": {}
1043
+ }
1044
+ }, {
1045
+ "method": "validationChange",
1046
+ "name": "validationChange",
1047
+ "bubbles": true,
1048
+ "cancelable": true,
1049
+ "composed": true,
1050
+ "docs": {
1051
+ "tags": [],
1052
+ "text": ""
1053
+ },
1054
+ "complexType": {
1055
+ "original": "any",
1056
+ "resolved": "any",
1057
+ "references": {}
1058
+ }
1059
+ }];
1060
+ }
1061
+ static get elementRef() { return "host"; }
1062
+ static get watchers() {
1063
+ return [{
1064
+ "propName": "registrationStep",
1065
+ "methodName": "sendStep"
1066
+ }, {
1067
+ "propName": "clientStyling",
1068
+ "methodName": "handleStylingChange"
1069
+ }, {
1070
+ "propName": "clientStylingUrl",
1071
+ "methodName": "handleStylingUrlChange"
1072
+ }, {
1073
+ "propName": "forms",
1074
+ "methodName": "setFormValidity"
1075
+ }, {
1076
+ "propName": "btag",
1077
+ "methodName": "addBtag"
1078
+ }];
1079
+ }
1080
+ static get listeners() {
1081
+ return [{
1082
+ "name": "sendValidityState",
1083
+ "method": "checkInputsValidityHandler",
1084
+ "target": undefined,
1085
+ "capture": false,
1086
+ "passive": false
1087
+ }, {
1088
+ "name": "sendInputValue",
1089
+ "method": "getInputsValueHandler",
1090
+ "target": undefined,
1091
+ "capture": false,
1092
+ "passive": false
1093
+ }, {
1094
+ "name": "resendCode",
1095
+ "method": "handleRequestTwofa",
1096
+ "target": undefined,
1097
+ "capture": false,
1098
+ "passive": false
1099
+ }, {
1100
+ "name": "message",
1101
+ "method": "messageHandler",
1102
+ "target": "window",
1103
+ "capture": false,
1104
+ "passive": false
1105
+ }];
1106
+ }
1107
+ }