@sheerid/jslib 1.80.0 → 1.81.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es5/Tmetrix.bundle.js +5 -5
- package/es5/messages_ar.bundle.js +5 -5
- package/es5/messages_bg.bundle.js +5 -5
- package/es5/messages_cs.bundle.js +5 -5
- package/es5/messages_da.bundle.js +5 -5
- package/es5/messages_de.bundle.js +5 -5
- package/es5/messages_el.bundle.js +5 -5
- package/es5/messages_en-GB.bundle.js +5 -5
- package/es5/messages_es-ES.bundle.js +5 -5
- package/es5/messages_es.bundle.js +5 -5
- package/es5/messages_fi.bundle.js +5 -5
- package/es5/messages_fr-CA.bundle.js +5 -5
- package/es5/messages_fr.bundle.js +5 -5
- package/es5/messages_ga.bundle.js +5 -5
- package/es5/messages_hr.bundle.js +5 -5
- package/es5/messages_hu.bundle.js +5 -5
- package/es5/messages_id.bundle.js +5 -5
- package/es5/messages_it.bundle.js +5 -5
- package/es5/messages_iw.bundle.js +5 -5
- package/es5/messages_ja.bundle.js +5 -5
- package/es5/messages_ko.bundle.js +5 -5
- package/es5/messages_lo.bundle.js +5 -5
- package/es5/messages_lt.bundle.js +5 -5
- package/es5/messages_ms.bundle.js +5 -5
- package/es5/messages_nl.bundle.js +5 -5
- package/es5/messages_no.bundle.js +5 -5
- package/es5/messages_pl.bundle.js +5 -5
- package/es5/messages_pt-BR.bundle.js +5 -5
- package/es5/messages_pt.bundle.js +5 -5
- package/es5/messages_ru.bundle.js +5 -5
- package/es5/messages_sk.bundle.js +5 -5
- package/es5/messages_sl.bundle.js +5 -5
- package/es5/messages_sr.bundle.js +5 -5
- package/es5/messages_sv.bundle.js +5 -5
- package/es5/messages_th.bundle.js +5 -5
- package/es5/messages_tr.bundle.js +5 -5
- package/es5/messages_zh-HK.bundle.js +5 -5
- package/es5/messages_zh.bundle.js +5 -5
- package/manifest.json +46 -46
- package/package.json +1 -1
- package/sheerid-requestOrg.css +4 -4
- package/sheerid-requestOrg.js +10 -10
- package/sheerid-requestOrg.js.map +1 -1
- package/sheerid-utils.js +8 -8
- package/sheerid-utils.js.map +1 -1
- package/sheerid.css +4 -4
- package/sheerid.js +12 -12
- package/sheerid.js.map +1 -1
- package/sheerides6.js +103 -68
- package/sheerides6.js.map +1 -1
- package/src/es6.d.ts +2 -1
- package/src/lib/types/types.d.ts +2 -0
- package/src/lib/utils/stepComponentHelpers/stepComponentHelpers.d.ts +9 -7
- package/types-reference.zip +0 -0
package/sheerides6.js
CHANGED
|
@@ -4489,6 +4489,9 @@ const populateViewModelFromQueryParams = (verificationService) => {
|
|
|
4489
4489
|
});
|
|
4490
4490
|
verificationService.updateViewModel(nextState);
|
|
4491
4491
|
};
|
|
4492
|
+
const updateFieldValidationErrors = (fieldValidationErrors, verificationService) => {
|
|
4493
|
+
verificationService.updateFieldValidationErrors(fieldValidationErrors);
|
|
4494
|
+
};
|
|
4492
4495
|
const updateFieldValidationErrorsByFieldId = (fieldId, value, verificationService) => {
|
|
4493
4496
|
const { fieldValidationErrors } = verificationService;
|
|
4494
4497
|
const nextState = fn(fieldValidationErrors, (draft) => {
|
|
@@ -4498,13 +4501,16 @@ const updateFieldValidationErrorsByFieldId = (fieldId, value, verificationServic
|
|
|
4498
4501
|
});
|
|
4499
4502
|
updateFieldValidationErrors(nextState, verificationService);
|
|
4500
4503
|
};
|
|
4501
|
-
const updateFieldValidationErrors = (fieldValidationErrors, verificationService) => {
|
|
4502
|
-
verificationService.updateFieldValidationErrors(fieldValidationErrors);
|
|
4503
|
-
};
|
|
4504
4504
|
const shouldCollectAddressFields = (countryChoice, countries) => (getSafe(() => countries.length === 1)
|
|
4505
4505
|
&& getSafe(() => countries[0]) === 'US')
|
|
4506
4506
|
|| getSafe(() => countryChoice.value === 'US')
|
|
4507
4507
|
|| getSafe(() => countryChoice.value === undefined);
|
|
4508
|
+
const getStatusLabel = (intl, status, defaultMessages) => {
|
|
4509
|
+
if (!status) {
|
|
4510
|
+
return '';
|
|
4511
|
+
}
|
|
4512
|
+
return intl.formatMessage({ id: status, defaultMessage: defaultMessages[status] });
|
|
4513
|
+
};
|
|
4508
4514
|
const getAvailableMilitaryStatuses = (verificationService, intl) => {
|
|
4509
4515
|
const availableStatusesResponse = verificationService.verificationResponse.availableStatuses
|
|
4510
4516
|
|| (verificationService.previousVerificationResponse
|
|
@@ -4513,12 +4519,12 @@ const getAvailableMilitaryStatuses = (verificationService, intl) => {
|
|
|
4513
4519
|
if (!availableStatusesResponse) {
|
|
4514
4520
|
return null;
|
|
4515
4521
|
}
|
|
4516
|
-
|
|
4522
|
+
availableStatusesResponse.forEach((status) => {
|
|
4517
4523
|
availableStatuses.push({
|
|
4518
4524
|
value: status,
|
|
4519
|
-
label: intl
|
|
4525
|
+
label: getStatusLabel(intl, status, MilitaryStatusDefaultMessagesEnum),
|
|
4520
4526
|
});
|
|
4521
|
-
}
|
|
4527
|
+
});
|
|
4522
4528
|
return availableStatuses;
|
|
4523
4529
|
};
|
|
4524
4530
|
/**
|
|
@@ -4530,18 +4536,6 @@ const getFieldDisplayOrderFromRefs = () => {
|
|
|
4530
4536
|
refs.map((refObject) => fieldDisplayOrder.push(refObject.fieldId));
|
|
4531
4537
|
return fieldDisplayOrder;
|
|
4532
4538
|
};
|
|
4533
|
-
/**
|
|
4534
|
-
* @private
|
|
4535
|
-
*/
|
|
4536
|
-
const getFirstErroredFieldId = (fieldDisplayOrder, fieldValidationErrors) => {
|
|
4537
|
-
let firstErrordFieldId;
|
|
4538
|
-
for (const field of fieldDisplayOrder) {
|
|
4539
|
-
if (fieldValidationErrors[field]) {
|
|
4540
|
-
firstErrordFieldId = field;
|
|
4541
|
-
return adjustFirstErroredFieldId(firstErrordFieldId);
|
|
4542
|
-
}
|
|
4543
|
-
}
|
|
4544
|
-
};
|
|
4545
4539
|
/**
|
|
4546
4540
|
* HD-638 - focus on year, rather than month (which is an open <select> that covers error msg)
|
|
4547
4541
|
*/
|
|
@@ -4551,6 +4545,19 @@ const adjustFirstErroredFieldId = (firstErroredFieldId) => {
|
|
|
4551
4545
|
}
|
|
4552
4546
|
return firstErroredFieldId;
|
|
4553
4547
|
};
|
|
4548
|
+
/**
|
|
4549
|
+
* @private
|
|
4550
|
+
*/
|
|
4551
|
+
const getFirstErroredFieldId = (fieldDisplayOrder, fieldValidationErrors) => {
|
|
4552
|
+
let firstErroredFieldId;
|
|
4553
|
+
fieldDisplayOrder.forEach((field) => {
|
|
4554
|
+
if (fieldValidationErrors[field]) {
|
|
4555
|
+
firstErroredFieldId = field;
|
|
4556
|
+
return adjustFirstErroredFieldId(firstErroredFieldId);
|
|
4557
|
+
}
|
|
4558
|
+
});
|
|
4559
|
+
return adjustFirstErroredFieldId(firstErroredFieldId);
|
|
4560
|
+
};
|
|
4554
4561
|
/**
|
|
4555
4562
|
* @private
|
|
4556
4563
|
*/
|
|
@@ -4630,6 +4637,16 @@ const getAvailableStateChoices = (programTheme, intl) => {
|
|
|
4630
4637
|
}),
|
|
4631
4638
|
}));
|
|
4632
4639
|
};
|
|
4640
|
+
const produceDraftViewModelWithRequiredFields = (previousModel, newRequiredFields, conditionalRequiredFieldKeys) => (fn(previousModel, (draft) => {
|
|
4641
|
+
conditionalRequiredFieldKeys.forEach((requiredFieldKey) => {
|
|
4642
|
+
if (newRequiredFields.some((field) => field.key === requiredFieldKey)) {
|
|
4643
|
+
draft[requiredFieldKey] = previousModel[requiredFieldKey] !== undefined ? previousModel[requiredFieldKey] : '';
|
|
4644
|
+
}
|
|
4645
|
+
else {
|
|
4646
|
+
delete draft[requiredFieldKey];
|
|
4647
|
+
}
|
|
4648
|
+
});
|
|
4649
|
+
}));
|
|
4633
4650
|
/**
|
|
4634
4651
|
* @private
|
|
4635
4652
|
*/
|
|
@@ -11080,6 +11097,8 @@ const ageViewModelToRequest = (viewModel) => ({
|
|
|
11080
11097
|
deviceFingerprintHash: viewModel.deviceFingerprintHash,
|
|
11081
11098
|
locale: viewModel.localeChoice.value,
|
|
11082
11099
|
country: viewModel.countryChoice ? viewModel.countryChoice.value : undefined,
|
|
11100
|
+
city: viewModel.city !== '' ? viewModel.city : undefined,
|
|
11101
|
+
address1: viewModel.address1 !== '' ? viewModel.address1 : undefined,
|
|
11083
11102
|
metadata: viewModel.metadata,
|
|
11084
11103
|
});
|
|
11085
11104
|
// ActiveMilitaryPersonalInfoViewModel contains multiple keys we don't want so we can't return the full viewModel as the request body
|
|
@@ -16549,6 +16568,28 @@ const carrierConsentValueValidator = (countryChoiceValue) => (value, programThem
|
|
|
16549
16568
|
}
|
|
16550
16569
|
};
|
|
16551
16570
|
|
|
16571
|
+
const City = ({ value, isErrored, onChange, intl, onKeyDown = undefined, placeholder = '', }) => (React.createElement("div", { className: "sid-field sid-city" },
|
|
16572
|
+
React.createElement("div", { className: "sid-l-space-top-md" }),
|
|
16573
|
+
React.createElement("label", { htmlFor: "sid-city" },
|
|
16574
|
+
React.createElement("div", { className: `sid-field__label sid-l-space-btm-sm ${placeholder ? 'sid-h-screen-reader-only' : ''}` },
|
|
16575
|
+
React.createElement("div", { className: "sid-field__label sid-field__label--required" },
|
|
16576
|
+
React.createElement(FormattedHTMLMessage, { id: "city", defaultMessage: "City" })))),
|
|
16577
|
+
React.createElement(InputTextComponent, { id: "city", isErrored: isErrored, onChange: e => onChange(e.target.value), onKeyDown: typeof onKeyDown === 'function' ? e => onKeyDown(e) : undefined, placeholder: placeholder || intl.formatMessage({ id: 'cityPlaceholder', defaultMessage: 'City*' }), value: value }),
|
|
16578
|
+
isErrored ? (React.createElement("div", { className: "sid-field-error" },
|
|
16579
|
+
React.createElement(FormattedHTMLMessage, { id: "errorId.invalidCity", defaultMessage: "Invalid city" }))) : null));
|
|
16580
|
+
const CityComponent = injectIntl(City);
|
|
16581
|
+
|
|
16582
|
+
const Address = ({ value, isErrored, onChange, intl, onKeyDown = undefined, placeholder = '', }) => (React.createElement("div", { className: "sid-field sid-address" },
|
|
16583
|
+
React.createElement("div", { className: "sid-l-space-top-md" }),
|
|
16584
|
+
React.createElement("label", { htmlFor: "sid-address" },
|
|
16585
|
+
React.createElement("div", { className: `sid-field__label sid-l-space-btm-sm ${placeholder ? 'sid-h-screen-reader-only' : ''}` },
|
|
16586
|
+
React.createElement("div", { className: "sid-field__label sid-field__label--required" },
|
|
16587
|
+
React.createElement(FormattedHTMLMessage, { id: "address", defaultMessage: "Address" })))),
|
|
16588
|
+
React.createElement(InputTextComponent, { id: "address", isErrored: isErrored, onChange: e => onChange(e.target.value), onKeyDown: typeof onKeyDown === 'function' ? e => onKeyDown(e) : undefined, placeholder: placeholder || intl.formatMessage({ id: 'addressPlaceholder', defaultMessage: 'Address*' }), value: value }),
|
|
16589
|
+
isErrored ? (React.createElement("div", { className: "sid-field-error" },
|
|
16590
|
+
React.createElement(FormattedHTMLMessage, { id: "errorId.invalidAddress", defaultMessage: "Invalid address" }))) : null));
|
|
16591
|
+
const AddressComponent = injectIntl(Address);
|
|
16592
|
+
|
|
16552
16593
|
/**
|
|
16553
16594
|
* TODO - preamble
|
|
16554
16595
|
*/
|
|
@@ -16561,6 +16602,8 @@ const StepAgePersonalInfo = ({ verificationService, intl }) => {
|
|
|
16561
16602
|
const defaultCountryChoice = getDefaultCountryChoice(countryChoices);
|
|
16562
16603
|
const { isSmsNotifierConfigured, smsLoopEnabled } = verificationService.programTheme;
|
|
16563
16604
|
const safeCountryValue = getSafe(() => viewModel.countryChoice.value, defaultCountryChoice.value);
|
|
16605
|
+
const defaultRequiredFields = safeCountryValue === 'US' ? [{ key: 'postalCode' }] : [];
|
|
16606
|
+
const [requiredFields, setRequiredFields] = React.useState(defaultRequiredFields);
|
|
16564
16607
|
if (!fieldValidationErrors.phoneNumber && verificationResponse.errorIds && verificationResponse.errorIds.includes('invalidPhoneNumber')) {
|
|
16565
16608
|
verificationService.updateFieldValidationErrors({
|
|
16566
16609
|
...fieldValidationErrors,
|
|
@@ -16569,13 +16612,15 @@ const StepAgePersonalInfo = ({ verificationService, intl }) => {
|
|
|
16569
16612
|
}
|
|
16570
16613
|
const displayPhoneNumber = (country, displayForSmsLoop) => (country !== 'US' || displayForSmsLoop);
|
|
16571
16614
|
const updateAgeViewModel = (key, value) => {
|
|
16572
|
-
const nextState =
|
|
16573
|
-
|
|
16574
|
-
|
|
16615
|
+
const nextState = produceDraftViewModel(viewModel, key, value);
|
|
16616
|
+
verificationService.updateViewModel(nextState);
|
|
16617
|
+
};
|
|
16618
|
+
const updateViewModelWithRequiredFields = (newRequiredFields, conditionalRequiredFieldKeys) => {
|
|
16619
|
+
const nextState = produceDraftViewModelWithRequiredFields(viewModel, newRequiredFields, conditionalRequiredFieldKeys);
|
|
16575
16620
|
verificationService.updateViewModel(nextState);
|
|
16576
16621
|
};
|
|
16622
|
+
const isFieldRequired = (key) => requiredFields.some((field) => field.key === key);
|
|
16577
16623
|
overrideValidator('phoneNumber', phoneNumberValidator(safeCountryValue));
|
|
16578
|
-
overrideValidator('postalCode', postalCodeValidator(safeCountryValue));
|
|
16579
16624
|
if (displayPhoneNumber(safeCountryValue, smsLoopEnabled)) {
|
|
16580
16625
|
if (!customValidatorExists$1('carrierConsentValue')) {
|
|
16581
16626
|
setCustomValidator('carrierConsentValue', carrierConsentValueValidator(safeCountryValue));
|
|
@@ -16588,6 +16633,19 @@ const StepAgePersonalInfo = ({ verificationService, intl }) => {
|
|
|
16588
16633
|
updateAgeViewModel('metadata', { ...verificationService.viewModel.metadata, carrierConsentValue: newValue });
|
|
16589
16634
|
updateFieldValidationErrorsByFieldId('carrierConsentValue', newValue, verificationService);
|
|
16590
16635
|
};
|
|
16636
|
+
React.useEffect(() => {
|
|
16637
|
+
(async () => {
|
|
16638
|
+
try {
|
|
16639
|
+
const collectFieldsResponse = await getFieldsToCollect(verificationResponse.verificationId, verificationResponse.currentStep, viewModel);
|
|
16640
|
+
const newRequiredFields = getSafe(() => collectFieldsResponse.fieldsToCollect.required, []);
|
|
16641
|
+
updateViewModelWithRequiredFields(newRequiredFields, ['postalCode', 'city', 'address1']);
|
|
16642
|
+
setRequiredFields(newRequiredFields);
|
|
16643
|
+
}
|
|
16644
|
+
catch (error) {
|
|
16645
|
+
logger.error(`Failed to determine fields to collect: ${error}`);
|
|
16646
|
+
}
|
|
16647
|
+
})();
|
|
16648
|
+
}, [viewModel.country]);
|
|
16591
16649
|
return (React.createElement("div", { id: "sid-step-student-personal-info", className: "sid-l-container" },
|
|
16592
16650
|
failedInstantMatch
|
|
16593
16651
|
? (React.createElement("div", { className: "sid-header" },
|
|
@@ -16613,9 +16671,6 @@ const StepAgePersonalInfo = ({ verificationService, intl }) => {
|
|
|
16613
16671
|
if (!displayPhoneNumber(country, smsLoopEnabled)) {
|
|
16614
16672
|
viewModelDraft.phoneNumber = '';
|
|
16615
16673
|
}
|
|
16616
|
-
if (country !== 'US') {
|
|
16617
|
-
viewModelDraft.postalCode = '';
|
|
16618
|
-
}
|
|
16619
16674
|
} }),
|
|
16620
16675
|
React.createElement("div", { className: "sid-names" },
|
|
16621
16676
|
React.createElement(FirstNameComponent, { value: viewModel.firstName, isErrored: !!fieldValidationErrors.firstName, onChange: (newValue) => {
|
|
@@ -16630,7 +16685,15 @@ const StepAgePersonalInfo = ({ verificationService, intl }) => {
|
|
|
16630
16685
|
updateAgeViewModel('birthDate', newValue);
|
|
16631
16686
|
updateFieldValidationErrorsByFieldId('birthDate', newValue, verificationService);
|
|
16632
16687
|
}, value: viewModel.birthDate }),
|
|
16633
|
-
|
|
16688
|
+
isFieldRequired('city') && (React.createElement(CityComponent, { value: viewModel.city, isRequired: true, isErrored: !!fieldValidationErrors.city, errorId: fieldValidationErrors.city, onChange: (value) => {
|
|
16689
|
+
updateAgeViewModel('city', value);
|
|
16690
|
+
updateFieldValidationErrorsByFieldId('city', value, verificationService);
|
|
16691
|
+
} })),
|
|
16692
|
+
isFieldRequired('address1') && (React.createElement(AddressComponent, { value: viewModel.address1, isRequired: true, isErrored: !!fieldValidationErrors.address1, errorId: fieldValidationErrors.address1, onChange: (value) => {
|
|
16693
|
+
updateAgeViewModel('address1', value);
|
|
16694
|
+
updateFieldValidationErrorsByFieldId('address1', value, verificationService);
|
|
16695
|
+
} })),
|
|
16696
|
+
isFieldRequired('postalCode') && (React.createElement(PostalCodeComponent, { isErrored: !!fieldValidationErrors.postalCode, onChange: (newValue) => {
|
|
16634
16697
|
updateAgeViewModel('postalCode', newValue);
|
|
16635
16698
|
updateFieldValidationErrorsByFieldId('postalCode', newValue, verificationService);
|
|
16636
16699
|
}, value: viewModel.postalCode })),
|
|
@@ -17031,8 +17094,8 @@ const StepActiveMilitaryPersonalInfo = ({ intl, verificationService }) => {
|
|
|
17031
17094
|
React.createElement(CountryComponentWrapper, { verificationService: verificationService, viewModel: viewModel, nextFocusField: "status" }),
|
|
17032
17095
|
availableStatuses
|
|
17033
17096
|
? (React.createElement(MilitaryStatusComponent, { value: {
|
|
17034
|
-
value:
|
|
17035
|
-
label:
|
|
17097
|
+
value: viewModel.status,
|
|
17098
|
+
label: getStatusLabel(intl, viewModel.status, MilitaryStatusDefaultMessagesEnum),
|
|
17036
17099
|
}, isErrored: !!fieldValidationErrors.status, options: availableStatuses, onChange: (status) => {
|
|
17037
17100
|
updateActiveMilitaryViewModel('status', status ? status.value : '');
|
|
17038
17101
|
updateFieldValidationErrorsByFieldId('status', status ? status.value : '', verificationService);
|
|
@@ -17214,8 +17277,8 @@ const StepInactiveMilitaryPersonalInfo = ({ intl, verificationService }) => {
|
|
|
17214
17277
|
React.createElement(CountryComponentWrapper, { verificationService: verificationService, viewModel: viewModel, nextFocusField: "status" }),
|
|
17215
17278
|
availableStatuses
|
|
17216
17279
|
? (React.createElement(MilitaryStatusComponent, { value: {
|
|
17217
|
-
value:
|
|
17218
|
-
label:
|
|
17280
|
+
value: viewModel.status,
|
|
17281
|
+
label: getStatusLabel(intl, viewModel.status, MilitaryStatusDefaultMessagesEnum),
|
|
17219
17282
|
}, isErrored: !!fieldValidationErrors.status, options: availableStatuses, onChange: (status) => {
|
|
17220
17283
|
updateInactiveMilitaryViewModel('status', status ? status.value : '');
|
|
17221
17284
|
updateFieldValidationErrorsByFieldId('status', status ? status.value : '', verificationService);
|
|
@@ -17309,12 +17372,12 @@ const StepFirstResponderPersonalInfo = ({ intl, verificationService }) => {
|
|
|
17309
17372
|
const getAvailableFirstResponderStatuses = () => {
|
|
17310
17373
|
const availableStatusesResponse = verificationService.verificationResponse.availableStatuses;
|
|
17311
17374
|
const availableStatuses = [];
|
|
17312
|
-
|
|
17375
|
+
availableStatusesResponse.forEach((status) => {
|
|
17313
17376
|
availableStatuses.push({
|
|
17314
17377
|
value: status,
|
|
17315
|
-
label: intl
|
|
17378
|
+
label: getStatusLabel(intl, status, FirstResponderStatusDefaultMessagesEnum),
|
|
17316
17379
|
});
|
|
17317
|
-
}
|
|
17380
|
+
});
|
|
17318
17381
|
return availableStatuses;
|
|
17319
17382
|
};
|
|
17320
17383
|
const handleFirstResponderStatusOnKeyDown = (event) => {
|
|
@@ -17354,8 +17417,8 @@ const StepFirstResponderPersonalInfo = ({ intl, verificationService }) => {
|
|
|
17354
17417
|
React.createElement(RewardsRemainingComponent, { verificationService: verificationService })))),
|
|
17355
17418
|
React.createElement(CountryComponentWrapper, { verificationService: verificationService, viewModel: viewModel, nextFocusField: "status" }),
|
|
17356
17419
|
React.createElement(FirstResponderStatusComponent, { value: {
|
|
17357
|
-
value:
|
|
17358
|
-
label:
|
|
17420
|
+
value: viewModel.status,
|
|
17421
|
+
label: getStatusLabel(intl, viewModel.status, FirstResponderStatusDefaultMessagesEnum),
|
|
17359
17422
|
}, isErrored: !!fieldValidationErrors.status, options: getAvailableFirstResponderStatuses(), onChange: (status) => {
|
|
17360
17423
|
updateFirstResponderViewModel('status', status ? status.value : '');
|
|
17361
17424
|
updateFieldValidationErrorsByFieldId('status', status ? status.value : '', verificationService);
|
|
@@ -17455,12 +17518,6 @@ const StepMedicalProfessionalPersonalInfo = ({ intl, verificationService }) => {
|
|
|
17455
17518
|
const failedInstantMatch = hasFailedInstantMatch(verificationResponse);
|
|
17456
17519
|
const [memberIdMessageKeys, setMemberIdMessageKeys] = React.useState(undefined);
|
|
17457
17520
|
const [showMemberId, setShowMemberId] = React.useState(false);
|
|
17458
|
-
const getStatusLabel = (status) => {
|
|
17459
|
-
if (!status) {
|
|
17460
|
-
return '';
|
|
17461
|
-
}
|
|
17462
|
-
return intl.formatMessage({ id: status, defaultMessage: MedicalProfessionalStatusDefaultMessagesEnum[status] });
|
|
17463
|
-
};
|
|
17464
17521
|
const updateMedicalProfessionalViewModel = (key, value) => {
|
|
17465
17522
|
const nextState = produceDraftViewModel(viewModel, key, value);
|
|
17466
17523
|
verificationService.updateViewModel(nextState);
|
|
@@ -17468,12 +17525,12 @@ const StepMedicalProfessionalPersonalInfo = ({ intl, verificationService }) => {
|
|
|
17468
17525
|
const getAvailableMedicalStatuses = () => {
|
|
17469
17526
|
const availableStatusesResponse = verificationResponse.availableStatuses;
|
|
17470
17527
|
const availableStatuses = [];
|
|
17471
|
-
|
|
17528
|
+
availableStatusesResponse.forEach((status) => {
|
|
17472
17529
|
availableStatuses.push({
|
|
17473
17530
|
value: status,
|
|
17474
|
-
label: getStatusLabel(status),
|
|
17531
|
+
label: getStatusLabel(intl, status, MedicalProfessionalStatusDefaultMessagesEnum),
|
|
17475
17532
|
});
|
|
17476
|
-
}
|
|
17533
|
+
});
|
|
17477
17534
|
return availableStatuses;
|
|
17478
17535
|
};
|
|
17479
17536
|
const handleMedicalStatusOnKeyDown = (event) => {
|
|
@@ -17525,7 +17582,7 @@ const StepMedicalProfessionalPersonalInfo = ({ intl, verificationService }) => {
|
|
|
17525
17582
|
React.createElement(CountryComponentWrapper, { verificationService: verificationService, viewModel: viewModel }),
|
|
17526
17583
|
React.createElement(MedicalStatusComponent, { value: {
|
|
17527
17584
|
value: viewModel.status,
|
|
17528
|
-
label: getStatusLabel(viewModel.status),
|
|
17585
|
+
label: getStatusLabel(intl, viewModel.status, MedicalProfessionalStatusDefaultMessagesEnum),
|
|
17529
17586
|
}, isErrored: !!fieldValidationErrors.status, options: getAvailableMedicalStatuses(), onChange: (status) => {
|
|
17530
17587
|
updateMedicalProfessionalViewModel('status', status ? status.value : '');
|
|
17531
17588
|
updateFieldValidationErrorsByFieldId('status', status ? status.value : '', verificationService);
|
|
@@ -17582,28 +17639,6 @@ const StepMedicalProfessionalPersonalInfo = ({ intl, verificationService }) => {
|
|
|
17582
17639
|
};
|
|
17583
17640
|
const StepMedicalProfessionalPersonalInfoComponent = injectIntl(StepMedicalProfessionalPersonalInfo);
|
|
17584
17641
|
|
|
17585
|
-
const Address = ({ value, isErrored, onChange, intl, onKeyDown = undefined, placeholder = '', }) => (React.createElement("div", { className: "sid-field sid-address" },
|
|
17586
|
-
React.createElement("div", { className: "sid-l-space-top-md" }),
|
|
17587
|
-
React.createElement("label", { htmlFor: "sid-address" },
|
|
17588
|
-
React.createElement("div", { className: `sid-field__label sid-l-space-btm-sm ${placeholder ? 'sid-h-screen-reader-only' : ''}` },
|
|
17589
|
-
React.createElement("div", { className: "sid-field__label sid-field__label--required" },
|
|
17590
|
-
React.createElement(FormattedHTMLMessage, { id: "address", defaultMessage: "Address" })))),
|
|
17591
|
-
React.createElement(InputTextComponent, { id: "address", isErrored: isErrored, onChange: e => onChange(e.target.value), onKeyDown: typeof onKeyDown === 'function' ? e => onKeyDown(e) : undefined, placeholder: placeholder || intl.formatMessage({ id: 'addressPlaceholder', defaultMessage: 'Address*' }), value: value }),
|
|
17592
|
-
isErrored ? (React.createElement("div", { className: "sid-field-error" },
|
|
17593
|
-
React.createElement(FormattedHTMLMessage, { id: "errorId.invalidAddress", defaultMessage: "Invalid address" }))) : null));
|
|
17594
|
-
const AddressComponent = injectIntl(Address);
|
|
17595
|
-
|
|
17596
|
-
const City = ({ value, isErrored, onChange, intl, onKeyDown = undefined, placeholder = '', }) => (React.createElement("div", { className: "sid-field sid-city" },
|
|
17597
|
-
React.createElement("div", { className: "sid-l-space-top-md" }),
|
|
17598
|
-
React.createElement("label", { htmlFor: "sid-city" },
|
|
17599
|
-
React.createElement("div", { className: `sid-field__label sid-l-space-btm-sm ${placeholder ? 'sid-h-screen-reader-only' : ''}` },
|
|
17600
|
-
React.createElement("div", { className: "sid-field__label sid-field__label--required" },
|
|
17601
|
-
React.createElement(FormattedHTMLMessage, { id: "city", defaultMessage: "City" })))),
|
|
17602
|
-
React.createElement(InputTextComponent, { id: "city", isErrored: isErrored, onChange: e => onChange(e.target.value), onKeyDown: typeof onKeyDown === 'function' ? e => onKeyDown(e) : undefined, placeholder: placeholder || intl.formatMessage({ id: 'cityPlaceholder', defaultMessage: 'City*' }), value: value }),
|
|
17603
|
-
isErrored ? (React.createElement("div", { className: "sid-field-error" },
|
|
17604
|
-
React.createElement(FormattedHTMLMessage, { id: "errorId.invalidCity", defaultMessage: "Invalid city" }))) : null));
|
|
17605
|
-
const CityComponent = injectIntl(City);
|
|
17606
|
-
|
|
17607
17642
|
const State = ({ value, isErrored, onChange, intl, onKeyDown = undefined, placeholder = '', }) => (React.createElement("div", { className: "sid-field sid-state" },
|
|
17608
17643
|
React.createElement("div", { className: "sid-l-space-top-md" }),
|
|
17609
17644
|
React.createElement("label", { htmlFor: "sid-state" },
|
|
@@ -21098,5 +21133,5 @@ const collectDeviceProfile = async (verificationId, programId) => {
|
|
|
21098
21133
|
includeIPQSDeviceFingerprintScript(programTheme, verificationId);
|
|
21099
21134
|
};
|
|
21100
21135
|
|
|
21101
|
-
export { ACCEPTED_DOC_MIME_TYPES, AcceptableUploadsComponent, AddressComponent, BirthDateComponent, BranchOfServiceComponent, ChangeLocaleComponent, CityComponent, CollegeNameComponent, CompanyComponent, CopyToClipboard, CountDownComponent, CountryComponent, CountryComponentWrapper, DEFAULT_LOCALE, DEFAULT_MINIMUM_ORG_SEARCH_VALUE_LENGTH, DEFAULT_PRIVACY_POLICY_URL, DeleteJson, DischargeDateComponent, DriverLicenseNumberComponent, EmailComponent, FaqLinkComponent, FetchOrganizationsComponent, FieldIdEnum, FieldIds, FirstNameComponent, FirstResponderOrganizationComponent, FirstResponderStatusComponent, FirstResponderStatusDefaultMessagesEnum, FormFooterComponent, GetEmptyTheme, GetJson, GetResponse, HTTP_REQUEST_TIMEOUT, HookNameEnum, HookNames, HowDoesVerifyingWorkComponent, InputSelectButtonComponent, InputSelectComponent, InputSelectListComponent, InputTextComponent, LastNameComponent, LicensedProfessionalOrganizationComponent, LinkExternal, LoadingSpinnerComponent, Locales, LogoComponent, MAX_DOC_UPLOAD_DOCS_ALLOWED, MarketConsentWrapperComponent as MarketConsentWrapper, MedicalProfessionalOrganizationComponent, MedicalProfessionalStatusDefaultMessagesEnum, MedicalStatusComponent, MemberIdComponent, MembershipOrganizationComponent, MilitaryStatusComponent, MilitaryStatusDefaultMessagesEnum, MockSteps, MockStepsEnum, OptInComponent, OptInInputComponent, OrganizationListComponent, OrganizationResultComponent, PhoneNumberComponent, PostFiles, PostJson, PostalCodeComponent, PostalCodeInputComponent, PoweredByComponent, PrivacyPolicyLinkComponent, QUERY_STRING_ERRORID_OVERRIDE, QUERY_STRING_INSTALL_PAGE_URL, QUERY_STRING_SEGMENT_OVERRIDE, QUERY_STRING_STEP_OVERRIDE, QUERY_STRING_SUBSEGMENT_OVERRIDE, RequestOrganizationContext, RequestOrganizationErrorComponent, RequestOrganizationForm, RequestOrganizationFormFooterComponent, RequestOrganizationSearchComponent, RequestOrganizationSearchResultComponent, RequestOrganizationSuccessComponent, ReviewPendingComponent, RewardsRemainingComponent, SHEERID, SMSCodeComponent, SSN_STRING_LENGTH, SSOPendingComponent, SearchFieldComponent, SegmentEnum, Segments, SelectButtonComponent, SelectComponent, SelectListComponent, SocialSecurityNumber, SortByLabel, SsnChoice, StateComponent, StateEnum, StateSelectComponent, StatusComponent, StepActiveMilitaryPersonalInfoComponent, StepDriverLicensePersonalInfoComponent, StepGeneralIdentityPersonalInfoComponent, StepHybridIdentityPersonalInfoComponent, SubSegmentEnum, TeacherSchoolComponent, TryAgainButtonComponent, TryAgainSteps, TypeaheadComponent, UPLOAD_FILE_PREFIX, UploadInfoComponent, VerificationApiClient, VerificationForm, VerificationSteps, VerificationStepsEnum, addFiles, addHook, allMockedResponses, arrayUnique, assertValidConversionRequest, assertValidDatabaseId, assertValidFieldId, assertValidFunction, assertValidHook, assertValidHookName, assertValidHtmlElement, assertValidLocale, assertValidMockStepName, assertValidProgramId, assertValidSegmentName, assertValidTrackingId, assertValidTryAgainStep, assertValidVerificationStepName, carrierConsentValueValidator, closeTabRef, collectDeviceProfile, conversion, convertByTrackingId, convertByVerificationId, customValidatorExists$1 as customValidatorExists, deepClone, deepMerge, displaySSN, employmentPInfoReqEmpty, ensureMaxMetadataKeyValueLengths, ensureTrailingSlash, fetchExistingVerificationRequest, fetchProgramOrganizations, fetchRequestOrganizations, formatTwoDigitValues, getAddSchoolRequestUrl, getAllEmptyViewModels, getAvailableCountryChoices, getAvailableLocaleChoices, getAvailableLocales, getAvailableMilitaryStatuses, getAvailableStateChoices, getCompanyName, getConfiguredCountries, getConfiguredStates, getCustomValidator, getCustomValidatorFields, getDefaultCountryChoice, getDomainFromUrl, getEmptyViewModel, getEstAndMaxReviewTimes, getEstimatedReviewTime, getExtendedFieldValidationErrorsEmpty, getFaqLink, getFieldDisplayOrderFromRefs, getFieldValidationErrors, getFieldValidationErrorsEmpty, getFingerprint, getFirstErroredFieldId, getHook, getLocaleSafely, getLogoUrl, getMarketConsent, getMaxReviewTime, getMessages, getMetadata, getNewEmailCodeResendUrl, getNewSmsCodeResendUrl, getNewVerificationRequestUrl, getOptions, getOrgSearchCountryTags, getOverriddenMock, getOverridenValidator, getPhoneNumberValidationError, getPrivacyPolicyCompanyName, getPrivacyPolicyUrl, getProgramThemeUrl, getQueryParamsFromUrl, getRefByFieldId, getRefs, getRouteOverride, getSafe, getSheerIdScriptBasePath, getTabRef, getTrackingIdFromQueryString, getVerificationIdFromQueryString, getVerificationStatusUrl, handleCountryOnKeyDown, handleEmailOnKeyDown, handleStateChange, hasFailedInstantMatch, howDoesVerifyingWorkMessages, isFormErrored, isFormFilled, isValidLocale, isValidUsPostalCode, listenToSheerIdFrame, loadInModal, loadInlineIframe, logger, orgToOption, orgsInStatus, overrideComponent, overrideValidator, phoneNumberValidator, populateViewModelFromQueryParams, postVerificationSizeUpdates, postalCodeMatchers, postalCodeValidator, produceDraftViewModel, refreshStore, registerAdditionalLocales, removeAllFiles, removeCustomValidator, removeFile, requestOrganizationConstants, resetCustomValidators, resetHooks, resetMetadata, resetOptions, resetOverriddenComponents, resetOverriddenValidators, resetRefs, resetStore, resetTabRef, resetViewModel, resolveTrackingId, setCustomValidator, setFocus, setMetadata, setOptions, setRef, setTabRef, setViewModel, shouldCollectAddressFields, shouldCollectPostalCode, socialSecurityEmpty, speakToOuterFrame, submitAddSchoolRequest, submitForm, unDisplaySSN, updateFieldValidationErrors, updateFieldValidationErrorsByFieldId, updateMilitaryViewModel, updateViewModelOrganization, usePollingInterval, validateFieldById, validateMetadata };
|
|
21136
|
+
export { ACCEPTED_DOC_MIME_TYPES, AcceptableUploadsComponent, AddressComponent, BirthDateComponent, BranchOfServiceComponent, ChangeLocaleComponent, CityComponent, CollegeNameComponent, CompanyComponent, CopyToClipboard, CountDownComponent, CountryComponent, CountryComponentWrapper, DEFAULT_LOCALE, DEFAULT_MINIMUM_ORG_SEARCH_VALUE_LENGTH, DEFAULT_PRIVACY_POLICY_URL, DeleteJson, DischargeDateComponent, DriverLicenseNumberComponent, EmailComponent, FaqLinkComponent, FetchOrganizationsComponent, FieldIdEnum, FieldIds, FirstNameComponent, FirstResponderOrganizationComponent, FirstResponderStatusComponent, FirstResponderStatusDefaultMessagesEnum, FormFooterComponent, GetEmptyTheme, GetJson, GetResponse, HTTP_REQUEST_TIMEOUT, HookNameEnum, HookNames, HowDoesVerifyingWorkComponent, InputSelectButtonComponent, InputSelectComponent, InputSelectListComponent, InputTextComponent, LastNameComponent, LicensedProfessionalOrganizationComponent, LinkExternal, LoadingSpinnerComponent, Locales, LogoComponent, MAX_DOC_UPLOAD_DOCS_ALLOWED, MarketConsentWrapperComponent as MarketConsentWrapper, MedicalProfessionalOrganizationComponent, MedicalProfessionalStatusDefaultMessagesEnum, MedicalStatusComponent, MemberIdComponent, MembershipOrganizationComponent, MilitaryStatusComponent, MilitaryStatusDefaultMessagesEnum, MockSteps, MockStepsEnum, OptInComponent, OptInInputComponent, OrganizationListComponent, OrganizationResultComponent, PhoneNumberComponent, PostFiles, PostJson, PostalCodeComponent, PostalCodeInputComponent, PoweredByComponent, PrivacyPolicyLinkComponent, QUERY_STRING_ERRORID_OVERRIDE, QUERY_STRING_INSTALL_PAGE_URL, QUERY_STRING_SEGMENT_OVERRIDE, QUERY_STRING_STEP_OVERRIDE, QUERY_STRING_SUBSEGMENT_OVERRIDE, RequestOrganizationContext, RequestOrganizationErrorComponent, RequestOrganizationForm, RequestOrganizationFormFooterComponent, RequestOrganizationSearchComponent, RequestOrganizationSearchResultComponent, RequestOrganizationSuccessComponent, ReviewPendingComponent, RewardsRemainingComponent, SHEERID, SMSCodeComponent, SSN_STRING_LENGTH, SSOPendingComponent, SearchFieldComponent, SegmentEnum, Segments, SelectButtonComponent, SelectComponent, SelectListComponent, SocialSecurityNumber, SortByLabel, SsnChoice, StateComponent, StateEnum, StateSelectComponent, StatusComponent, StepActiveMilitaryPersonalInfoComponent, StepDriverLicensePersonalInfoComponent, StepGeneralIdentityPersonalInfoComponent, StepHybridIdentityPersonalInfoComponent, SubSegmentEnum, TeacherSchoolComponent, TryAgainButtonComponent, TryAgainSteps, TypeaheadComponent, UPLOAD_FILE_PREFIX, UploadInfoComponent, VerificationApiClient, VerificationForm, VerificationSteps, VerificationStepsEnum, addFiles, addHook, allMockedResponses, arrayUnique, assertValidConversionRequest, assertValidDatabaseId, assertValidFieldId, assertValidFunction, assertValidHook, assertValidHookName, assertValidHtmlElement, assertValidLocale, assertValidMockStepName, assertValidProgramId, assertValidSegmentName, assertValidTrackingId, assertValidTryAgainStep, assertValidVerificationStepName, carrierConsentValueValidator, closeTabRef, collectDeviceProfile, conversion, convertByTrackingId, convertByVerificationId, customValidatorExists$1 as customValidatorExists, deepClone, deepMerge, displaySSN, employmentPInfoReqEmpty, ensureMaxMetadataKeyValueLengths, ensureTrailingSlash, fetchExistingVerificationRequest, fetchProgramOrganizations, fetchRequestOrganizations, formatTwoDigitValues, getAddSchoolRequestUrl, getAllEmptyViewModels, getAvailableCountryChoices, getAvailableLocaleChoices, getAvailableLocales, getAvailableMilitaryStatuses, getAvailableStateChoices, getCompanyName, getConfiguredCountries, getConfiguredStates, getCustomValidator, getCustomValidatorFields, getDefaultCountryChoice, getDomainFromUrl, getEmptyViewModel, getEstAndMaxReviewTimes, getEstimatedReviewTime, getExtendedFieldValidationErrorsEmpty, getFaqLink, getFieldDisplayOrderFromRefs, getFieldValidationErrors, getFieldValidationErrorsEmpty, getFingerprint, getFirstErroredFieldId, getHook, getLocaleSafely, getLogoUrl, getMarketConsent, getMaxReviewTime, getMessages, getMetadata, getNewEmailCodeResendUrl, getNewSmsCodeResendUrl, getNewVerificationRequestUrl, getOptions, getOrgSearchCountryTags, getOverriddenMock, getOverridenValidator, getPhoneNumberValidationError, getPrivacyPolicyCompanyName, getPrivacyPolicyUrl, getProgramThemeUrl, getQueryParamsFromUrl, getRefByFieldId, getRefs, getRouteOverride, getSafe, getSheerIdScriptBasePath, getStatusLabel, getTabRef, getTrackingIdFromQueryString, getVerificationIdFromQueryString, getVerificationStatusUrl, handleCountryOnKeyDown, handleEmailOnKeyDown, handleStateChange, hasFailedInstantMatch, howDoesVerifyingWorkMessages, isFormErrored, isFormFilled, isTestEmailDomains, isValidLocale, isValidUsPostalCode, listenToSheerIdFrame, loadInModal, loadInlineIframe, logger, orgToOption, orgsInStatus, overrideComponent, overrideValidator, phoneNumberValidator, populateViewModelFromQueryParams, postVerificationSizeUpdates, postalCodeMatchers, postalCodeValidator, produceDraftViewModel, produceDraftViewModelWithRequiredFields, recordEvent, recordVerificationResponse, recordViewModelChange, refreshStore, registerAdditionalLocales, removeAllFiles, removeCustomValidator, removeFile, requestOrganizationConstants, resetCustomValidators, resetHooks, resetMetadata, resetOptions, resetOverriddenComponents, resetOverriddenValidators, resetRefs, resetStore, resetTabRef, resetViewModel, resolveTrackingId, setCustomValidator, setDimension, setFocus, setGaDimensionIsTest, setMetadata, setOptions, setRef, setTabRef, setViewModel, shouldCollectAddressFields, shouldCollectPostalCode, socialSecurityEmpty, speakToOuterFrame, submitAddSchoolRequest, submitForm, unDisplaySSN, updateFieldValidationErrors, updateFieldValidationErrorsByFieldId, updateMilitaryViewModel, updateViewModelOrganization, usePollingInterval, validateFieldById, validateMetadata };
|
|
21102
21137
|
//# sourceMappingURL=sheerides6.js.map
|