bhl-forms 0.6.14 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/bhl-forms.es.js +1757 -1759
  2. package/dist/bhl-forms.iife.js +4 -4
  3. package/dist/bhl-forms.modern.es.js +2804 -2811
  4. package/dist/bhl-forms.modern.iife.js +6 -6
  5. package/dist/bhl-forms.modern.umd.js +6 -6
  6. package/dist/bhl-forms.umd.js +4 -4
  7. package/dist/forms/accidentsAndInjuries.es.js +278 -215
  8. package/dist/forms/accidentsAndInjuries.iife.js +1 -1
  9. package/dist/forms/accidentsAndInjuries.json +1 -1
  10. package/dist/forms/appraisals.es.js +16 -7
  11. package/dist/forms/appraisals.iife.js +1 -1
  12. package/dist/forms/business.es.js +288 -226
  13. package/dist/forms/business.iife.js +1 -1
  14. package/dist/forms/business.json +1 -1
  15. package/dist/forms/childAndFamily.es.js +271 -214
  16. package/dist/forms/childAndFamily.iife.js +1 -1
  17. package/dist/forms/childAndFamily.json +1 -1
  18. package/dist/forms/childAndFamilySingle.es.js +614 -545
  19. package/dist/forms/childAndFamilySingle.iife.js +1 -1
  20. package/dist/forms/childAndFamilySingle.json +1 -1
  21. package/dist/forms/civilLawsuit.es.js +608 -541
  22. package/dist/forms/civilLawsuit.iife.js +1 -1
  23. package/dist/forms/civilLawsuit.json +1 -1
  24. package/dist/forms/coins.es.js +16 -7
  25. package/dist/forms/coins.iife.js +1 -1
  26. package/dist/forms/contracts.es.js +275 -217
  27. package/dist/forms/contracts.iife.js +1 -1
  28. package/dist/forms/contracts.json +1 -1
  29. package/dist/forms/criminal.es.js +631 -562
  30. package/dist/forms/criminal.iife.js +1 -1
  31. package/dist/forms/criminal.json +1 -1
  32. package/dist/forms/divorce.es.js +614 -545
  33. package/dist/forms/divorce.iife.js +1 -1
  34. package/dist/forms/divorce.json +1 -1
  35. package/dist/forms/employmentAndWorkplace.es.js +555 -496
  36. package/dist/forms/employmentAndWorkplace.iife.js +1 -1
  37. package/dist/forms/employmentAndWorkplace.json +1 -1
  38. package/dist/forms/generalHomeImprovement.es.js +3224 -0
  39. package/dist/forms/generalHomeImprovement.iife.js +1 -0
  40. package/dist/forms/generalHomeImprovement.json +1 -0
  41. package/dist/forms/generalLegal.es.js +274 -216
  42. package/dist/forms/generalLegal.iife.js +1 -1
  43. package/dist/forms/generalLegal.json +1 -1
  44. package/dist/forms/generalLegalJustAnswer.es.js +4534 -0
  45. package/dist/forms/generalLegalJustAnswer.iife.js +1 -0
  46. package/dist/forms/generalLegalJustAnswer.json +1 -0
  47. package/dist/forms/generalLegalPopUnder.es.js +275 -217
  48. package/dist/forms/generalLegalPopUnder.iife.js +1 -1
  49. package/dist/forms/generalLegalPopUnder.json +1 -1
  50. package/dist/forms/generalLegalPopUnderSingle.es.js +645 -573
  51. package/dist/forms/generalLegalPopUnderSingle.iife.js +1 -1
  52. package/dist/forms/generalLegalPopUnderSingle.json +1 -1
  53. package/dist/forms/generalLegalSingle.es.js +645 -573
  54. package/dist/forms/generalLegalSingle.iife.js +1 -1
  55. package/dist/forms/generalLegalSingle.json +1 -1
  56. package/dist/forms/generalLegalThankYou.es.js +137 -130
  57. package/dist/forms/generalLegalThankYou.iife.js +1 -1
  58. package/dist/forms/generalLegalThankYouConsultation.es.js +647 -575
  59. package/dist/forms/generalLegalThankYouConsultation.iife.js +1 -1
  60. package/dist/forms/generalLegalThankYouConsultation.json +1 -1
  61. package/dist/forms/harassmentAndDiscrimination.es.js +271 -214
  62. package/dist/forms/harassmentAndDiscrimination.iife.js +1 -1
  63. package/dist/forms/harassmentAndDiscrimination.json +1 -1
  64. package/dist/forms/landlordTenant.es.js +287 -230
  65. package/dist/forms/landlordTenant.iife.js +1 -1
  66. package/dist/forms/landlordTenant.json +1 -1
  67. package/dist/forms/malpractice.es.js +276 -217
  68. package/dist/forms/malpractice.iife.js +1 -1
  69. package/dist/forms/malpractice.json +1 -1
  70. package/dist/forms/mechanics.es.js +171 -165
  71. package/dist/forms/mechanics.iife.js +1 -1
  72. package/dist/forms/mechanics.json +1 -1
  73. package/dist/forms/patentsAndIP.es.js +617 -548
  74. package/dist/forms/patentsAndIP.iife.js +1 -1
  75. package/dist/forms/patentsAndIP.json +1 -1
  76. package/dist/forms/realEstate.es.js +272 -215
  77. package/dist/forms/realEstate.iife.js +1 -1
  78. package/dist/forms/realEstate.json +1 -1
  79. package/dist/forms/repossession.es.js +275 -217
  80. package/dist/forms/repossession.iife.js +1 -1
  81. package/dist/forms/repossession.json +1 -1
  82. package/dist/forms/ssdi.es.js +139 -138
  83. package/dist/forms/ssdi.iife.js +1 -1
  84. package/dist/forms/ssdi.json +1 -1
  85. package/dist/forms/testForm.es.js +55 -52
  86. package/dist/forms/testForm.iife.js +1 -1
  87. package/dist/forms/testRedirects.es.js +28 -22
  88. package/dist/forms/testRedirects.iife.js +1 -1
  89. package/dist/forms/vets.es.js +16 -7
  90. package/dist/forms/vets.iife.js +1 -1
  91. package/dist/forms/willsAndTrusts.es.js +272 -213
  92. package/dist/forms/willsAndTrusts.iife.js +1 -1
  93. package/dist/forms/willsAndTrusts.json +1 -1
  94. package/package.json +3 -3
@@ -6,14 +6,97 @@ function LegalRedirectUrl() {
6
6
  return 'https://listings.ziplawyer.com/api/v1/redirect?zone_id=4&vertical=Legal&category=${properties.Type_Of_Legal_Problem}&Degree_Of_Interest=${properties.Degree_Of_Interest}&zip_code=${properties.Zip}&sub_id=${properties.vid}'
7
7
  }
8
8
 
9
- var TCPA_LANGUAGE = "By checking this box, I a) agree to the Terms of Use, and b) consent to be contacted by lawyers, lawyer networks, and partners of this website using live, autodialed, pre-recorded, or artificial voice calls, as well as text messages. Your consent is not required as a condition of purchasing any goods or services. To submit this request without this consent, call 878-213-4937.";
10
-
11
- const DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC = '$getKey($meta, "commentsPlaceholders." + $get(Type_Of_Legal_Problem).value, $meta.defaultCommentsPlaceholder)';
12
- const DEFAULT_COMMENTS_LABEL = 'Please briefly describe your legal issue in a few words:';
13
- const DEFAULT_FINAL_HEADLINE = 'Submit Your Case';
14
- const DEFAULT_FINAL_HEADLINE_DYNAMIC = '$getKey($meta, "finalHeadlines." + $get(Type_Of_Legal_Problem).value, $meta.defaultFinalHeadline)';
15
- const DEFAULT_FINAL_SUBHEADLINE = 'You may benefit from speaking with a legal professional. Please verify your contact information.';
16
- const DEFAULT_FINAL_SUBHEADLINE_DYNAMIC = '$getKey($meta, "finalSubHeadlines." + $get(Type_Of_Legal_Problem).value, $meta.defaultFinalSubHeadline)';
9
+ const DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL = '$getKey($meta, "commentsPlaceholders." + $get(Type_Of_Legal_Problem).value, $meta.defaultCommentsPlaceholder)';
10
+ const DEFAULT_COMMENTS_LABEL_LEGAL = 'Please briefly describe your legal issue in a few words:';
11
+ const DEFAULT_FINAL_HEADLINE_LEGAL = 'Submit Your Case';
12
+ const DEFAULT_FINAL_HEADLINE_DYNAMIC_LEGAL = '$getKey($meta, "finalHeadlines." + $get(Type_Of_Legal_Problem).value, $meta.defaultFinalHeadline)';
13
+ const DEFAULT_FINAL_SUBHEADLINE_LEGAL = 'You may benefit from speaking with a legal professional. Please verify your contact information.';
14
+ const DEFAULT_FINAL_SUBHEADLINE_DYNAMIC_LEGAL = '$getKey($meta, "finalSubHeadlines." + $get(Type_Of_Legal_Problem).value, $meta.defaultFinalSubHeadline)';
15
+ const TCPA_LANGUAGE_LEGAL = "By checking this box, I a) agree to the Terms of Use, and b) consent to be contacted by lawyers, lawyer networks, and partners of this website using live, autodialed, pre-recorded, or artificial voice calls, as well as text messages. Your consent is not required as a condition of purchasing any goods or services. To submit this request without this consent, call 878-213-4937.";
16
+ const defaultLegalImprovementCrossSells = {
17
+ 'Auto and Car Accidents': 'Injured in a Car Accident',
18
+ 'Personal Injury': 'Personal or Workplace Injury',
19
+ 'DUI and DWI': 'Involved in a DUI/DWI',
20
+ 'Wills and Trusts': 'Need a Will or Trust',
21
+ 'Power of Attorney': 'Update Power of Attorney',
22
+ 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
23
+ };
24
+ const CROSS_SELL_OPTION_MAP_LEGAL = {
25
+ // Values can be a list or a map of value -> display value
26
+ 'Auto and Car Accidents': {
27
+ 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
28
+ 'Wills and Trusts': 'Need a Will or Trust',
29
+ 'Workers Compensation': 'Workplace Injury',
30
+ 'Power of Attorney': 'Update Power of Attorney',
31
+ 'Divorce and Separation': 'Need a Divorce or Separation',
32
+ 'Child Custody': 'Need help with Child Custody',
33
+ },
34
+ "Personal Injury": {
35
+ 'DUI and DWI': 'Involved in a DUI/DWI',
36
+ 'Wills and Trusts': 'Need a Will or Trust',
37
+ 'Power of Attorney': 'Update Power of Attorney',
38
+ 'Divorce and Separation': 'Need a Divorce or Separation',
39
+ 'Child Custody': 'Need help with Child Custody',
40
+ // TODO add one more?
41
+ },
42
+ "Workers Compensation": {
43
+ 'DUI and DWI': 'Involved in a DUI/DWI',
44
+ 'Wills and Trusts': 'Need a Will or Trust',
45
+ 'Power of Attorney': 'Update Power of Attorney',
46
+ 'Divorce and Separation': 'Need a Divorce or Separation',
47
+ 'Child Custody': 'Need help with Child Custody',
48
+ // TODO add one more?
49
+ },
50
+ "DUI and DWI": {
51
+ 'Personal Injury': 'Personal or Workplace Injury',
52
+ 'Wills and Trusts': 'Need a Will or Trust',
53
+ 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
54
+ 'Power of Attorney': 'Update Power of Attorney',
55
+ 'Divorce and Separation': 'Need a Divorce or Separation',
56
+ 'Child Custody': 'Need help with Child Custody',
57
+ },
58
+ "Wills and Trusts": {
59
+ 'Auto and Car Accidents': 'Injured in a Car Accident',
60
+ 'Personal Injury': 'Personal or Workplace Injury',
61
+ 'DUI and DWI': 'Involved in a DUI/DWI',
62
+ 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
63
+ 'Divorce and Separation': 'Need a Divorce or Separation',
64
+ 'Child Custody': 'Need help with Child Custody',
65
+ },
66
+ "Probate and Estates": {
67
+ 'Auto and Car Accidents': 'Injured in a Car Accident',
68
+ 'Personal Injury': 'Personal or Workplace Injury',
69
+ 'DUI and DWI': 'Involved in a DUI/DWI',
70
+ 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
71
+ 'Divorce and Separation': 'Need a Divorce or Separation',
72
+ 'Child Custody': 'Need help with Child Custody',
73
+ },
74
+ "Power of Attorney": {
75
+ 'Auto and Car Accidents': 'Injured in a Car Accident',
76
+ 'Personal Injury': 'Personal or Workplace Injury',
77
+ 'DUI and DWI': 'Involved in a DUI/DWI',
78
+ 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
79
+ 'Divorce and Separation': 'Need a Divorce or Separation',
80
+ 'Child Custody': 'Need help with Child Custody',
81
+ },
82
+ "Long Term Disability": {
83
+ 'Auto and Car Accidents': 'Injured in a Car Accident',
84
+ 'DUI and DWI': 'Involved in a DUI/DWI',
85
+ 'Wills and Trusts': 'Need a Will or Trust',
86
+ 'Power of Attorney': 'Update Power of Attorney',
87
+ 'Divorce and Separation': 'Need a Divorce or Separation',
88
+ 'Child Custody': 'Need help with Child Custody',
89
+ },
90
+ "Social Security Disability and Insurance": {
91
+ 'Auto and Car Accidents': 'Injured in a Car Accident',
92
+ 'DUI and DWI': 'Involved in a DUI/DWI',
93
+ 'Wills and Trusts': 'Need a Will or Trust',
94
+ 'Power of Attorney': 'Update Power of Attorney',
95
+ 'Divorce and Separation': 'Need a Divorce or Separation',
96
+ 'Child Custody': 'Need help with Child Custody',
97
+ },
98
+ '*': defaultLegalImprovementCrossSells,
99
+ };
17
100
 
18
101
  // ------ Common Base Settings
19
102
 
@@ -203,6 +286,76 @@ const sbsDate = (updates) => {
203
286
  return date(updates)
204
287
  };
205
288
 
289
+ const email = (scope) => sbsText({
290
+ $formkit: 'email',
291
+ name: scope ? scope + ':' + 'Email' : 'Email',
292
+ label: 'Email Address:',
293
+ placeholder: 'email@domain.com',
294
+ autocomplete: 'email',
295
+ 'data-tf-sensitive': 'false',
296
+ validation: 'required|email',
297
+ validationMessages: {
298
+ required: 'Email is required',
299
+ email: 'Invalid Email'
300
+ }
301
+ });
302
+
303
+ const firstName = (scope) => sbsText({
304
+ label: 'First Name:',
305
+ placeholder: 'First',
306
+ name: scope ? scope + ':' + 'First_Name' : 'First_Name',
307
+ autocomplete: "given-name",
308
+ validationMessages: {
309
+ required: 'First Name is required'
310
+ }
311
+ });
312
+
313
+ const lastName = (scope) => sbsText({
314
+ label: 'Last Name:',
315
+ placeholder: 'Last',
316
+ name: scope ? scope + ':' + 'Last_Name' : 'Last_Name',
317
+ autocomplete: "family-name",
318
+ validationMessages: {
319
+ required: 'Last Name is required'
320
+ }
321
+ });
322
+
323
+ const phone = (scope) => sbsText({
324
+ $formkit: 'tel',
325
+ name: scope ? scope + ':' + 'Primary_Phone' : 'Primary_Phone',
326
+ label: 'Phone Number:',
327
+ placeholder: '###-###-####',
328
+ maxlength: 12,
329
+ help: '10-digit phone number, hyphens optional',
330
+ autocomplete: 'tel-national',
331
+ 'data-tf-sensitive': 'false',
332
+ validation: 'required|matches:/^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$/|valid_phone',
333
+ validationMessages: {
334
+ required: 'Field is required',
335
+ matches: 'Invalid Phone Format, use ###-###-####',
336
+ valid_phone: 'Invalid Phone Number'
337
+ },
338
+ helpClass: "t-mt-2.5 md:t-text-right md:t-mt-[-2px]"
339
+ });
340
+
341
+ const zipcodeCenter = (updates = {}, scope) => text({
342
+ placeholder: '#####',
343
+ help: updates.help ?? "We try to match you with local help",
344
+ name: scope ? scope + ':' + 'Zip' : 'Zip',
345
+ maxlength: 5,
346
+ inputmode: "numeric",
347
+ autocomplete: 'postal-code',
348
+ validation: 'required|matches:/^[0-9]{5}$/',
349
+ validationMessages: {
350
+ required: 'Zip Code is required',
351
+ matches: 'Invalid Zip Code'
352
+ },
353
+ wrapperClass: 't-flex t-justify-center',
354
+ messagesClass: 't-flex t-justify-center',
355
+ inputClass: 't-text-center',
356
+ helpClass: 't-mt-2.5 !t-text-sm t-text-center'
357
+ });
358
+
206
359
  const applicantAge = (scope) => sbsText({
207
360
  name: scope ? scope + ':' + 'Applicant_Age' : 'Applicant_Age',
208
361
  label: 'Age of Applicant?',
@@ -353,20 +506,6 @@ const doctorTreatment = (scope) => sbsYesNoRadio({
353
506
  label: 'Have You Recently Been Treated by a Doctor, Hospital or Clinic?',
354
507
  });
355
508
 
356
- const email = (scope) => sbsText({
357
- $formkit: 'email',
358
- name: scope ? scope + ':' + 'Email' : 'Email',
359
- label: 'Email Address:',
360
- placeholder: 'email@domain.com',
361
- autocomplete: 'email',
362
- 'data-tf-sensitive': 'false',
363
- validation: 'required|email',
364
- validationMessages: {
365
- required: 'Email is required',
366
- email: 'Invalid Email'
367
- }
368
- });
369
-
370
509
  const estateLegalServicesNeeded = (scope) => sbsSelect({
371
510
  name: scope ? scope + ':' + 'Estate_Legal_Services_Needed' : 'Estate_Legal_Services_Needed',
372
511
  label: "Legal Services Needed for Your Estate:",
@@ -380,17 +519,6 @@ const estateLegalServicesNeeded = (scope) => sbsSelect({
380
519
  ]
381
520
  });
382
521
 
383
- const firstName = (scope) => sbsText({
384
- $formkit: 'text',
385
- label: 'First Name:',
386
- placeholder: 'First',
387
- name: scope ? scope + ':' + 'First_Name' : 'First_Name',
388
- autocomplete: "given-name",
389
- validationMessages: {
390
- required: 'First Name is required'
391
- }
392
- });
393
-
394
522
  const haveAttorney$1 = (scope) => sbsYesNoRadio({
395
523
  name: scope ? scope + ':' + 'Have_Attorney' : 'Have_Attorney',
396
524
  label: 'Already Working with An Attorney?'
@@ -410,17 +538,6 @@ const incidentDate = (scope) => sbsDate({
410
538
  label: 'Date of Incident:',
411
539
  });
412
540
 
413
- const lastName = (scope) => sbsText({
414
- $formkit: 'text',
415
- label: 'Last Name:',
416
- placeholder: 'Last',
417
- name: scope ? scope + ':' + 'Last_Name' : 'Last_Name',
418
- autocomplete: "family-name",
419
- validationMessages: {
420
- required: 'Last Name is required'
421
- }
422
- });
423
-
424
541
  const landlordTenantPartyCenter = () => verticalButtonRadio({
425
542
  name: 'Landlord_Tenant_Party',
426
543
  options: [
@@ -465,69 +582,7 @@ const legalCrossSells$1 = () => col2Checkbox({
465
582
  help: 'Just hit "Next" if none apply',
466
583
  helpClass: 't-text-center !t-text-sm',
467
584
  validation: null,
468
- options: {
469
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Auto and Car Accidents"',
470
- then: {
471
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
472
- 'Wills and Trusts': 'Need a Will or Trust',
473
- 'Workers Compensation': 'Workplace Injury',
474
- 'Power of Attorney': 'Update Power of Attorney',
475
- 'Divorce and Separation': 'Need a Divorce or Separation',
476
- 'Child Custody': 'Need help with Child Custody',
477
- },
478
- else: {
479
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Personal Injury" || $getVal($get(form), "Type_Of_Legal_Problem") === "Workers Compensation"',
480
- then: {
481
- 'DUI and DWI': 'Involved in a DUI/DWI',
482
- 'Wills and Trusts': 'Need a Will or Trust',
483
- 'Power of Attorney': 'Update Power of Attorney',
484
- 'Divorce and Separation': 'Need a Divorce or Separation',
485
- 'Child Custody': 'Need help with Child Custody',
486
- // TODO add one more?
487
- },
488
- else: {
489
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "DUI and DWI"',
490
- then: {
491
- 'Personal Injury': 'Personal or Workplace Injury',
492
- 'Wills and Trusts': 'Need a Will or Trust',
493
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
494
- 'Power of Attorney': 'Update Power of Attorney',
495
- 'Divorce and Separation': 'Need a Divorce or Separation',
496
- 'Child Custody': 'Need help with Child Custody',
497
- },
498
- else: {
499
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Wills and Trusts" || $getVal($get(form), "Type_Of_Legal_Problem") === "Probate and Estates" || $getVal($get(form), "Type_Of_Legal_Problem") === "Power of Attorney"',
500
- then: {
501
- 'Auto and Car Accidents': 'Injured in a Car Accident',
502
- 'Personal Injury': 'Personal or Workplace Injury',
503
- 'DUI and DWI': 'Involved in a DUI/DWI',
504
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
505
- 'Divorce and Separation': 'Need a Divorce or Separation',
506
- 'Child Custody': 'Need help with Child Custody',
507
- },
508
- else: {
509
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Long Term Disability" || $getVal($get(form), "Type_Of_Legal_Problem") === "Social Security Disability and Insurance"',
510
- then: {
511
- 'Auto and Car Accidents': 'Injured in a Car Accident',
512
- 'DUI and DWI': 'Involved in a DUI/DWI',
513
- 'Wills and Trusts': 'Need a Will or Trust',
514
- 'Power of Attorney': 'Update Power of Attorney',
515
- 'Divorce and Separation': 'Need a Divorce or Separation',
516
- 'Child Custody': 'Need help with Child Custody',
517
- },
518
- else: {
519
- 'Auto and Car Accidents': 'Injured in a Car Accident',
520
- 'Personal Injury': 'Personal or Workplace Injury',
521
- 'DUI and DWI': 'Involved in a DUI/DWI',
522
- 'Wills and Trusts': 'Need a Will or Trust',
523
- 'Power of Attorney': 'Update Power of Attorney',
524
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
525
- }
526
- }
527
- }
528
- }
529
- }
530
- }
585
+ options: '$getCrossSellOptions($get(form), $getVal($get(form), "Type_Of_Legal_Problem"))',
531
586
  });
532
587
 
533
588
  const maritalStatus = (scope) => sbsSelect({
@@ -548,24 +603,6 @@ const pendingCharges = (scope) => sbsYesNoRadio({
548
603
  label: 'Do you currently have any pending charges?'
549
604
  });
550
605
 
551
- const phone = (scope) => sbsText({
552
- $formkit: 'tel',
553
- name: scope ? scope + ':' + 'Primary_Phone' : 'Primary_Phone',
554
- label: 'Phone Number:',
555
- placeholder: '###-###-####',
556
- maxlength: 12,
557
- help: '10-digit phone number, hyphens optional',
558
- autocomplete: 'tel-national',
559
- 'data-tf-sensitive': 'false',
560
- validation: 'required|matches:/^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$/|valid_phone',
561
- validationMessages: {
562
- required: 'Field is required',
563
- matches: 'Invalid Phone Format, use ###-###-####',
564
- valid_phone: 'Invalid Phone Number'
565
- },
566
- helpClass: "t-mt-2.5 md:t-text-right md:t-mt-[-2px]"
567
- });
568
-
569
606
  const primaryInjury = (scope) => sbs2ColRadio({
570
607
  name: scope ? scope + ':' + 'Primary_Injury' : 'Primary_Injury',
571
608
  label: 'Primary Injury:',
@@ -662,25 +699,6 @@ const valueOfAssets = (scope) => sbsSelect({
662
699
  ]
663
700
  });
664
701
 
665
- const zipcodeCenter = (updates = {}, scope) => text({
666
- placeholder: '#####',
667
- help: updates.help ?? "We try to match you with local legal help",
668
- name: scope ? scope + ':' + 'Zip' : 'Zip',
669
- maxlength: 5,
670
- inputmode: "numeric",
671
- autocomplete: 'postal-code',
672
- validation: 'required|matches:/^[0-9]{5}$/',
673
- validationMessages: {
674
- required: 'Zip Code is required',
675
- matches: 'Invalid Zip Code'
676
- },
677
- wrapperClass: 't-flex t-justify-center',
678
- messagesClass: 't-flex t-justify-center',
679
- inputClass: 't-text-center',
680
- helpClass: 't-mt-2.5 !t-text-sm t-text-center'
681
- });
682
-
683
-
684
702
  // ------ Question Groups
685
703
 
686
704
  // NOTE: name must be unique within a form!
@@ -932,13 +950,20 @@ function verticalStepSubHeadline(updates) {
932
950
  function commentsStepHeadline(updates) {
933
951
  return {
934
952
  $el: 'h3',
935
- children: updates.headline || 'Additional Case Details',
953
+ children: updates.headline || 'Additional Details',
936
954
  attrs: {
937
955
  class: 't-flex t-justify-center t-text-center t-text-2xl t-font-bold t-text-blue-500 t-pb-5 t-pt-0 t-px-1' + ' ' + (updates.headlineClass || '')
938
956
  }
939
957
  }
940
958
  }
941
959
 
960
+ function commentsStepHeadlineLegal(updates) {
961
+ return commentsStepHeadline({
962
+ headline: updates.headline || 'Additional Case Details',
963
+ headlineClass: updates.headlineClass
964
+ })
965
+ }
966
+
942
967
  function firstAndLastStepHeadline(updates) {
943
968
  return {
944
969
  $el: 'h3',
@@ -962,7 +987,7 @@ function legalCrossSellsStepHeadline(updates) {
962
987
  function contactStepHeadline(updates) {
963
988
  return {
964
989
  $el: 'h3',
965
- children: updates.headline || DEFAULT_FINAL_HEADLINE_DYNAMIC,
990
+ children: updates.headline || DEFAULT_FINAL_HEADLINE_DYNAMIC_LEGAL,
966
991
  attrs: {
967
992
  class: 't-flex t-justify-center t-text-center t-text-2xl t-font-bold t-text-blue-500 t-pb-3 t-pt-0 t-px-1' + ' ' + (updates.headlineClass || '')
968
993
  }
@@ -972,7 +997,7 @@ function contactStepHeadline(updates) {
972
997
  function contactStepSubHeadline(updates) {
973
998
  return {
974
999
  $el: 'h5',
975
- children: updates.subheadline || DEFAULT_FINAL_SUBHEADLINE_DYNAMIC,
1000
+ children: updates.subheadline || DEFAULT_FINAL_SUBHEADLINE_DYNAMIC_LEGAL,
976
1001
  attrs: {
977
1002
  class: 't-flex t-justify-center t-text-center !t-text-lg t-font-semibold t-pb-7 t-pt-0 t-px-3' + ' ' + (updates.subheadlineClass || '')
978
1003
  }
@@ -1012,10 +1037,16 @@ const stepDefaults = (step, stepKey) => ({
1012
1037
  }
1013
1038
  });
1014
1039
 
1015
- function step(name, inputs, nextOnEnter = true, nextOnInput = false, stepKey = undefined, nextStepMap = undefined, autoFocus = undefined) {
1016
- if (typeof nextOnEnter === 'undefined') {
1017
- nextOnEnter = true;
1018
- }
1040
+ function step(name, inputs, updates = {}) {
1041
+ const {
1042
+ nextOnEnter = true,
1043
+ nextOnInput = false,
1044
+ stepKey = undefined,
1045
+ nextStepMap = undefined,
1046
+ triggerRedirectMap = undefined,
1047
+ autoFocus = undefined,
1048
+ } = updates;
1049
+
1019
1050
  if (inputs && inputs.length && (nextOnEnter || nextOnInput)) {
1020
1051
  const lastInput = findLastInput(inputs[inputs.length - 1]);
1021
1052
  if (lastInput && nextOnEnter === true) {
@@ -1035,6 +1066,7 @@ function step(name, inputs, nextOnEnter = true, nextOnInput = false, stepKey = u
1035
1066
  id: name,
1036
1067
  name: name,
1037
1068
  nextStepMap: nextStepMap,
1069
+ triggerRedirectMap: triggerRedirectMap,
1038
1070
  autoFocus: autoFocus,
1039
1071
  children: inputs
1040
1072
  }
@@ -1045,44 +1077,17 @@ function step(name, inputs, nextOnEnter = true, nextOnInput = false, stepKey = u
1045
1077
 
1046
1078
  // Single question step
1047
1079
  function sqstep(name, input, defaultHeadline, updates = {}) {
1080
+ if (typeof updates.nextOnInput === 'undefined') {
1081
+ updates.nextOnInput = true;
1082
+ }
1083
+
1048
1084
  return step(
1049
1085
  name,
1050
1086
  [
1051
1087
  verticalStepHeadline({ headline: updates.headline ?? defaultHeadline, headlineClass: updates.headlineClass }),
1052
1088
  ...Array.isArray(input) ? input : [input],
1053
1089
  ],
1054
- updates.nextOnEnter,
1055
- typeof updates.nextOnInput === 'undefined' ? true : updates.nextOnInput,
1056
- updates.stepKey,
1057
- updates.nextStepMap
1058
- )
1059
- }
1060
-
1061
- function commentsWithBankruptcy(updates = {}) {
1062
- return step(
1063
- 'commentsWithBankruptcy',
1064
- [
1065
- commentsStepHeadline(updates),
1066
- comments({
1067
- label: typeof updates.label === 'undefined' ? DEFAULT_COMMENTS_LABEL : updates.label,
1068
- placeholder: updates.placeholder || DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC,
1069
- inputClass: typeof updates.inputClass === 'undefined' ? '!t-h-32' : updates.inputClass,
1070
- }, updates.scope),
1071
- // TODO: needs scope support
1072
- bankruptcyCrossSell(),
1073
- {
1074
- $el: 'div',
1075
- if: '$get(CrossSell_Bankruptcy).value == true',
1076
- children: [
1077
- comments({
1078
- label: 'Bankruptcy or debt details:',
1079
- placeholder: 'Please describe your bankrtupcy or debt situation in a few words...',
1080
- inputClass: '!t-h-16'
1081
- }, 'CrossSell:Bankruptcy')
1082
- ],
1083
- }
1084
- ],
1085
- false // nextOnEnter
1090
+ updates
1086
1091
  )
1087
1092
  }
1088
1093
 
@@ -1098,7 +1103,7 @@ function contactInfo(updates = {}) {
1098
1103
  TCPAConsent(updates.scope),
1099
1104
  secureIcon()
1100
1105
  ],
1101
- false, // nextOnEnter
1106
+ { nextOnEnter: false }
1102
1107
  )
1103
1108
  }
1104
1109
 
@@ -1117,10 +1122,46 @@ function firstAndLastV3(updates = {}, scope) {
1117
1122
  firstName(scope),
1118
1123
  lastName(scope)
1119
1124
  ],
1120
- updates.nextOnEnter
1125
+ updates
1126
+ )
1127
+ }
1128
+
1129
+ function zipcode(updates = {}) {
1130
+ return sqstep(
1131
+ 'zipcode',
1132
+ zipcodeCenter(updates, updates.scope),
1133
+ 'Please verify your Zip Code',
1134
+ updates
1121
1135
  )
1122
1136
  }
1123
1137
 
1138
+ function commentsWithBankruptcy(updates = {}) {
1139
+ return step(
1140
+ 'commentsWithBankruptcy',
1141
+ [
1142
+ commentsStepHeadlineLegal(updates),
1143
+ comments({
1144
+ label: typeof updates.label === 'undefined' ? DEFAULT_COMMENTS_LABEL_LEGAL : updates.label,
1145
+ placeholder: updates.placeholder || DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL,
1146
+ inputClass: typeof updates.inputClass === 'undefined' ? '!t-h-32' : updates.inputClass,
1147
+ }, updates.scope),
1148
+ // TODO: needs scope support
1149
+ bankruptcyCrossSell(),
1150
+ {
1151
+ $el: 'div',
1152
+ if: '$get(CrossSell_Bankruptcy).value == true',
1153
+ children: [
1154
+ comments({
1155
+ label: 'Bankruptcy or debt details:',
1156
+ placeholder: 'Please describe your bankrtupcy or debt situation in a few words...',
1157
+ inputClass: '!t-h-16'
1158
+ }, 'CrossSell:Bankruptcy')
1159
+ ],
1160
+ }
1161
+ ],
1162
+ { nextOnEnter: false }
1163
+ )
1164
+ }
1124
1165
 
1125
1166
  function autoAndCarAccidentCrossSellQuestions(updates = {}) {
1126
1167
  return step(
@@ -1138,7 +1179,7 @@ function autoAndCarAccidentCrossSellQuestions(updates = {}) {
1138
1179
  'CrossSell:Auto_and_Car_Accidents'
1139
1180
  )
1140
1181
  ],
1141
- updates.nextOnEnter
1182
+ updates
1142
1183
  )
1143
1184
  }
1144
1185
 
@@ -1157,7 +1198,7 @@ function childCustodyCrossSellQuestions(updates = {}) {
1157
1198
  'CrossSell:Child_Custody'
1158
1199
  )
1159
1200
  ],
1160
- updates.nextOnEnter
1201
+ updates
1161
1202
  )
1162
1203
  }
1163
1204
 
@@ -1176,7 +1217,7 @@ function divorceAndSeparationCrossSellQuestions(updates = {}) {
1176
1217
  'CrossSell:Divorce_and_Separation'
1177
1218
  )
1178
1219
  ],
1179
- updates.nextOnEnter
1220
+ updates
1180
1221
  )
1181
1222
  }
1182
1223
 
@@ -1195,7 +1236,7 @@ function duiAndDWICrossSellQuestions(updates = {}) {
1195
1236
  'CrossSell:DUI_and_DWI'
1196
1237
  )
1197
1238
  ],
1198
- updates.nextOnEnter
1239
+ updates
1199
1240
  )
1200
1241
  }
1201
1242
 
@@ -1215,7 +1256,7 @@ function ssdiCrossSellQuestions(updates = {}) {
1215
1256
  'CrossSell:Social_Security_Disability_and_Insurance'
1216
1257
  )
1217
1258
  ],
1218
- updates.nextOnEnter
1259
+ updates
1219
1260
  )
1220
1261
  }
1221
1262
 
@@ -1235,7 +1276,7 @@ function personalInjuryCrossSellQuestions(updates = {}) {
1235
1276
  'CrossSell:Personal_Injury'
1236
1277
  )
1237
1278
  ],
1238
- updates.nextOnEnter
1279
+ updates
1239
1280
  )
1240
1281
  }
1241
1282
 
@@ -1254,7 +1295,7 @@ function powerOfAttorneyCrossSellQuestions(updates = {}) {
1254
1295
  'CrossSell:Power_of_Attorney'
1255
1296
  )
1256
1297
  ],
1257
- updates.nextOnEnter
1298
+ updates
1258
1299
  )
1259
1300
  }
1260
1301
 
@@ -1273,7 +1314,7 @@ function willsAndTrustsCrossSellQuestions(updates = {}) {
1273
1314
  'CrossSell:Wills_and_Trusts'
1274
1315
  )
1275
1316
  ],
1276
- updates.nextOnEnter
1317
+ updates
1277
1318
  )
1278
1319
  }
1279
1320
 
@@ -1293,29 +1334,19 @@ function workersCompensationCrossSellQuestions(updates = {}) {
1293
1334
  'CrossSell:Workers_Compensation'
1294
1335
  )
1295
1336
  ],
1296
- updates.nextOnEnter
1337
+ updates
1297
1338
  )
1298
1339
  }
1299
1340
 
1300
1341
  function legalCrossSells(updates = {}) {
1342
+ updates.nextOnInput = false;
1343
+ updates.stepKey = '$get(Type_Of_Legal_Problem).value';
1301
1344
  return step(
1302
1345
  'legalCrossSells',
1303
1346
  [
1304
1347
  legalCrossSellsStepHeadline(updates),
1305
1348
  legalCrossSells$1(),
1306
1349
  ],
1307
- updates.nextOnEnter,
1308
- false,
1309
- // Note: we should probably scope this stepKey to this step name
1310
- '$get(Type_Of_Legal_Problem).value'
1311
- )
1312
- }
1313
-
1314
- function zipcode(updates = {}) {
1315
- return sqstep(
1316
- 'zipcode',
1317
- zipcodeCenter(updates, updates.scope),
1318
- 'Please verify your Zip Code',
1319
1350
  updates
1320
1351
  )
1321
1352
  }
@@ -1332,10 +1363,7 @@ function landlordTenantIssueTOLP(updates = {}) {
1332
1363
  },
1333
1364
  landlordTenantIssueRadioCenter(),
1334
1365
  ],
1335
- updates.nextOnEnter,
1336
- updates.nextOnInput,
1337
- updates.stepKey,
1338
- updates.nextStepMap
1366
+ updates
1339
1367
  )
1340
1368
  }
1341
1369
 
@@ -1505,9 +1533,7 @@ function formProps(updates) {
1505
1533
  return props
1506
1534
  }
1507
1535
 
1508
- const metaDefaults = {
1509
- tcpaLanguage: TCPA_LANGUAGE
1510
- };
1536
+ const metaDefaults = {};
1511
1537
 
1512
1538
  function metaProps(updates) {
1513
1539
  const data = merge(
@@ -1520,7 +1546,7 @@ function metaProps(updates) {
1520
1546
  }
1521
1547
  }
1522
1548
 
1523
- function defaultMetaProps(tolps = null) {
1549
+ function defaultMetaPropsLegal(tolps = null) {
1524
1550
  let commentsPlaceholders = TOLPCommentsPlaceholders;
1525
1551
  let finalHeadlines = TOLPFinalHeadlines;
1526
1552
  let finalSubHeadlines = TOLPFinalSubHeadlines;
@@ -1530,12 +1556,13 @@ function defaultMetaProps(tolps = null) {
1530
1556
  finalSubHeadlines = filterMapByKey(TOLPFinalSubHeadlines, tolps);
1531
1557
  }
1532
1558
  return metaProps({
1533
- defaultCommentsPlaceholder: DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC,
1559
+ tcpaLanguage: TCPA_LANGUAGE_LEGAL,
1560
+ defaultCommentsPlaceholder: DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL,
1534
1561
  commentsPlaceholders: commentsPlaceholders,
1535
- defaultFinalHeadline: DEFAULT_FINAL_HEADLINE,
1562
+ defaultFinalHeadline: DEFAULT_FINAL_HEADLINE_LEGAL,
1536
1563
  finalHeadlines: finalHeadlines,
1537
- defaultFinalSubHeadline: DEFAULT_FINAL_SUBHEADLINE,
1538
- finalSubHeadlines: finalSubHeadlines,
1564
+ defaultFinalSubHeadline: DEFAULT_FINAL_SUBHEADLINE_LEGAL,
1565
+ finalSubHeadlines: finalSubHeadlines
1539
1566
  })
1540
1567
  }
1541
1568
 
@@ -1822,12 +1849,38 @@ const TOLPFinalSubHeadlines = {
1822
1849
  // 'Non-Workplace Discrimination': '',
1823
1850
  };
1824
1851
 
1852
+ const nextStepsMapLegalCrossSells = {
1853
+ values: {
1854
+ 'Legal_CrossSells': {
1855
+ 'Auto and Car Accidents': ['autoAndCarAccidentCrossSellQuestions'],
1856
+ 'Personal Injury': ['personalInjuryCrossSellQuestions'],
1857
+ 'Workers Compensation': ['workersCompensationCrossSellQuestions'],
1858
+ 'DUI and DWI': ['duiAndDWICrossSellQuestions'],
1859
+ 'Long Term Disability': ['longTermDisabilityCrossSellQuestions'],
1860
+ 'Social Security Disability and Insurance': ['ssdiCrossSellQuestions'],
1861
+ 'Bankruptcy': ['bankruptcyCrossSellQuestions'],
1862
+ 'Power of Attorney': ['powerOfAttorneyCrossSellQuestions'],
1863
+ 'Wills and Trusts': ['willsAndTrustsCrossSellQuestions'],
1864
+ 'Divorce and Separation': ['divorceAndSeparationCrossSellQuestions'],
1865
+ 'Child Custody': ['childCustodyCrossSellQuestions'],
1866
+ },
1867
+ '*': ['firstAndLast', 'contactInfo'],
1868
+ },
1869
+
1870
+ // NOTE: this assumes a certain placement of the cross sell question
1871
+ // in the form flow.
1872
+ appendSteps: ['firstAndLast', 'contactInfo'],
1873
+ matchesAllowed: 1,
1874
+ };
1875
+
1876
+ const legalCrossSellOptionMap = CROSS_SELL_OPTION_MAP_LEGAL;
1877
+
1825
1878
  const tolps = [
1826
1879
  'Landlord and Tenant',
1827
1880
  'Not Sure or Other'
1828
1881
  ];
1829
1882
 
1830
- const meta = defaultMetaProps(tolps);
1883
+ const meta = defaultMetaPropsLegal(tolps);
1831
1884
 
1832
1885
  meta.data.dynamicSchema = [
1833
1886
  landlordTenantParty(),
@@ -1840,7 +1893,8 @@ meta.data.dynamicSchema = [
1840
1893
  }),
1841
1894
  zipcode(),
1842
1895
  legalCrossSells({
1843
- headlineClass: '!t-text-dark'
1896
+ headlineClass: '!t-text-dark',
1897
+ nextStepMap: nextStepsMapLegalCrossSells,
1844
1898
  }),
1845
1899
  autoAndCarAccidentCrossSellQuestions(),
1846
1900
  personalInjuryCrossSellQuestions(),
@@ -1864,6 +1918,7 @@ const schema = [
1864
1918
  props: formProps({
1865
1919
  formId: 'landlordTenant',
1866
1920
  redirectMap: legalRedirectMap(),
1921
+ crossSellOptionMap: legalCrossSellOptionMap
1867
1922
  }),
1868
1923
  children: [
1869
1924
  progressBar(),
@@ -1886,16 +1941,18 @@ const schema = [
1886
1941
  nextOnInput: false,
1887
1942
  headlineClass: 't-text-lg',
1888
1943
  nextStepMap: {
1889
- '*': [
1890
- 'landlordTenantParty',
1891
- 'haveAttorney',
1892
- 'degreeOfInterest',
1893
- 'commentsWithBankruptcy',
1894
- 'zipcode',
1895
- 'legalCrossSells',
1896
- 'firstAndLast',
1897
- 'contactInfo',
1898
- ]
1944
+ values: {
1945
+ '*': [
1946
+ 'landlordTenantParty',
1947
+ 'haveAttorney',
1948
+ 'degreeOfInterest',
1949
+ 'commentsWithBankruptcy',
1950
+ 'zipcode',
1951
+ 'legalCrossSells',
1952
+ 'firstAndLast',
1953
+ 'contactInfo',
1954
+ ]
1955
+ }
1899
1956
  }
1900
1957
  }),
1901
1958
  dynamicSchemaNode(),