bhl-forms 0.6.15 → 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 +645 -573
  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
 
@@ -177,7 +260,74 @@ const sbsDate = (updates) => {
177
260
  return date(updates)
178
261
  };
179
262
 
180
- // ------ Inputs
263
+ const email = (scope) => sbsText({
264
+ $formkit: 'email',
265
+ name: scope ? scope + ':' + 'Email' : 'Email',
266
+ label: 'Email Address:',
267
+ placeholder: 'email@domain.com',
268
+ autocomplete: 'email',
269
+ 'data-tf-sensitive': 'false',
270
+ validation: 'required|email',
271
+ validationMessages: {
272
+ required: 'Email is required',
273
+ email: 'Invalid Email'
274
+ }
275
+ });
276
+
277
+ const firstName = (scope) => sbsText({
278
+ label: 'First Name:',
279
+ placeholder: 'First',
280
+ name: scope ? scope + ':' + 'First_Name' : 'First_Name',
281
+ autocomplete: "given-name",
282
+ validationMessages: {
283
+ required: 'First Name is required'
284
+ }
285
+ });
286
+
287
+ const lastName = (scope) => sbsText({
288
+ label: 'Last Name:',
289
+ placeholder: 'Last',
290
+ name: scope ? scope + ':' + 'Last_Name' : 'Last_Name',
291
+ autocomplete: "family-name",
292
+ validationMessages: {
293
+ required: 'Last Name is required'
294
+ }
295
+ });
296
+
297
+ const phone = (scope) => sbsText({
298
+ $formkit: 'tel',
299
+ name: scope ? scope + ':' + 'Primary_Phone' : 'Primary_Phone',
300
+ label: 'Phone Number:',
301
+ placeholder: '###-###-####',
302
+ maxlength: 12,
303
+ help: '10-digit phone number, hyphens optional',
304
+ autocomplete: 'tel-national',
305
+ 'data-tf-sensitive': 'false',
306
+ validation: 'required|matches:/^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$/|valid_phone',
307
+ validationMessages: {
308
+ required: 'Field is required',
309
+ matches: 'Invalid Phone Format, use ###-###-####',
310
+ valid_phone: 'Invalid Phone Number'
311
+ },
312
+ helpClass: "t-mt-2.5 md:t-text-right md:t-mt-[-2px]"
313
+ });
314
+
315
+
316
+ const zipcode = (scope) => sbsText({
317
+ label: 'Zip Code:',
318
+ placeholder: '#####',
319
+ name: scope ? scope + ':' + 'Zip' : 'Zip',
320
+ maxlength: 5,
321
+ inputmode: "numeric",
322
+ autocomplete: 'postal-code',
323
+ validation: 'required|matches:/^[0-9]{5}$/',
324
+ validationMessages: {
325
+ required: 'Zip Code is required',
326
+ matches: 'Invalid Zip Code'
327
+ }
328
+ });
329
+
330
+ // ------ Legal Inputs
181
331
 
182
332
 
183
333
  const accidentsAndInjuriesTOLPDisplay = (updates) => col2Radio(merge({
@@ -333,20 +483,6 @@ const doctorTreatment = (scope) => sbsYesNoRadio({
333
483
  label: 'Have You Recently Been Treated by a Doctor, Hospital or Clinic?',
334
484
  });
335
485
 
336
- const email = (scope) => sbsText({
337
- $formkit: 'email',
338
- name: scope ? scope + ':' + 'Email' : 'Email',
339
- label: 'Email Address:',
340
- placeholder: 'email@domain.com',
341
- autocomplete: 'email',
342
- 'data-tf-sensitive': 'false',
343
- validation: 'required|email',
344
- validationMessages: {
345
- required: 'Email is required',
346
- email: 'Invalid Email'
347
- }
348
- });
349
-
350
486
  const estateLegalServicesNeeded = (scope) => sbsSelect({
351
487
  name: scope ? scope + ':' + 'Estate_Legal_Services_Needed' : 'Estate_Legal_Services_Needed',
352
488
  label: "Legal Services Needed for Your Estate:",
@@ -360,17 +496,6 @@ const estateLegalServicesNeeded = (scope) => sbsSelect({
360
496
  ]
361
497
  });
362
498
 
363
- const firstName = (scope) => sbsText({
364
- $formkit: 'text',
365
- label: 'First Name:',
366
- placeholder: 'First',
367
- name: scope ? scope + ':' + 'First_Name' : 'First_Name',
368
- autocomplete: "given-name",
369
- validationMessages: {
370
- required: 'First Name is required'
371
- }
372
- });
373
-
374
499
  const haveAttorney = (scope) => sbsYesNoRadio({
375
500
  name: scope ? scope + ':' + 'Have_Attorney' : 'Have_Attorney',
376
501
  label: 'Already Working with An Attorney?'
@@ -386,17 +511,6 @@ const incidentDate = (scope) => sbsDate({
386
511
  label: 'Date of Incident:',
387
512
  });
388
513
 
389
- const lastName = (scope) => sbsText({
390
- $formkit: 'text',
391
- label: 'Last Name:',
392
- placeholder: 'Last',
393
- name: scope ? scope + ':' + 'Last_Name' : 'Last_Name',
394
- autocomplete: "family-name",
395
- validationMessages: {
396
- required: 'Last Name is required'
397
- }
398
- });
399
-
400
514
  const lawyerPaymentMethod = (scope) => sbsSelect({
401
515
  name: scope ? scope + ':' + 'Lawyer_Payment_Method' : 'Lawyer_Payment_Method',
402
516
  label: 'How Will You Pay for Legal Fees if You Hire a Lawyer?',
@@ -417,69 +531,7 @@ const legalCrossSells$1 = () => col2Checkbox({
417
531
  help: 'Just hit "Next" if none apply',
418
532
  helpClass: 't-text-center !t-text-sm',
419
533
  validation: null,
420
- options: {
421
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Auto and Car Accidents"',
422
- then: {
423
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
424
- 'Wills and Trusts': 'Need a Will or Trust',
425
- 'Workers Compensation': 'Workplace Injury',
426
- 'Power of Attorney': 'Update Power of Attorney',
427
- 'Divorce and Separation': 'Need a Divorce or Separation',
428
- 'Child Custody': 'Need help with Child Custody',
429
- },
430
- else: {
431
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Personal Injury" || $getVal($get(form), "Type_Of_Legal_Problem") === "Workers Compensation"',
432
- then: {
433
- 'DUI and DWI': 'Involved in a DUI/DWI',
434
- 'Wills and Trusts': 'Need a Will or Trust',
435
- 'Power of Attorney': 'Update Power of Attorney',
436
- 'Divorce and Separation': 'Need a Divorce or Separation',
437
- 'Child Custody': 'Need help with Child Custody',
438
- // TODO add one more?
439
- },
440
- else: {
441
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "DUI and DWI"',
442
- then: {
443
- 'Personal Injury': 'Personal or Workplace Injury',
444
- 'Wills and Trusts': 'Need a Will or Trust',
445
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
446
- 'Power of Attorney': 'Update Power of Attorney',
447
- 'Divorce and Separation': 'Need a Divorce or Separation',
448
- 'Child Custody': 'Need help with Child Custody',
449
- },
450
- else: {
451
- 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"',
452
- then: {
453
- 'Auto and Car Accidents': 'Injured in a Car Accident',
454
- 'Personal Injury': 'Personal or Workplace Injury',
455
- 'DUI and DWI': 'Involved in a DUI/DWI',
456
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
457
- 'Divorce and Separation': 'Need a Divorce or Separation',
458
- 'Child Custody': 'Need help with Child Custody',
459
- },
460
- else: {
461
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Long Term Disability" || $getVal($get(form), "Type_Of_Legal_Problem") === "Social Security Disability and Insurance"',
462
- then: {
463
- 'Auto and Car Accidents': 'Injured in a Car Accident',
464
- 'DUI and DWI': 'Involved in a DUI/DWI',
465
- 'Wills and Trusts': 'Need a Will or Trust',
466
- 'Power of Attorney': 'Update Power of Attorney',
467
- 'Divorce and Separation': 'Need a Divorce or Separation',
468
- 'Child Custody': 'Need help with Child Custody',
469
- },
470
- else: {
471
- 'Auto and Car Accidents': 'Injured in a Car Accident',
472
- 'Personal Injury': 'Personal or Workplace Injury',
473
- 'DUI and DWI': 'Involved in a DUI/DWI',
474
- 'Wills and Trusts': 'Need a Will or Trust',
475
- 'Power of Attorney': 'Update Power of Attorney',
476
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
477
- }
478
- }
479
- }
480
- }
481
- }
482
- }
534
+ options: '$getCrossSellOptions($get(form), $getVal($get(form), "Type_Of_Legal_Problem"))',
483
535
  });
484
536
 
485
537
  const maritalStatus = (scope) => sbsSelect({
@@ -500,24 +552,6 @@ const pendingCharges = (scope) => sbsYesNoRadio({
500
552
  label: 'Do you currently have any pending charges?'
501
553
  });
502
554
 
503
- const phone = (scope) => sbsText({
504
- $formkit: 'tel',
505
- name: scope ? scope + ':' + 'Primary_Phone' : 'Primary_Phone',
506
- label: 'Phone Number:',
507
- placeholder: '###-###-####',
508
- maxlength: 12,
509
- help: '10-digit phone number, hyphens optional',
510
- autocomplete: 'tel-national',
511
- 'data-tf-sensitive': 'false',
512
- validation: 'required|matches:/^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$/|valid_phone',
513
- validationMessages: {
514
- required: 'Field is required',
515
- matches: 'Invalid Phone Format, use ###-###-####',
516
- valid_phone: 'Invalid Phone Number'
517
- },
518
- helpClass: "t-mt-2.5 md:t-text-right md:t-mt-[-2px]"
519
- });
520
-
521
555
  const primaryInjury = (scope) => sbs2ColRadio({
522
556
  name: scope ? scope + ':' + 'Primary_Injury' : 'Primary_Injury',
523
557
  label: 'Primary Injury:',
@@ -614,21 +648,6 @@ const valueOfAssets = (scope) => sbsSelect({
614
648
  ]
615
649
  });
616
650
 
617
- const zipcode = (scope) => sbsText({
618
- label: 'Zip Code:',
619
- placeholder: '#####',
620
- name: scope ? scope + ':' + 'Zip' : 'Zip',
621
- maxlength: 5,
622
- inputmode: "numeric",
623
- autocomplete: 'postal-code',
624
- validation: 'required|matches:/^[0-9]{5}$/',
625
- validationMessages: {
626
- required: 'Zip Code is required',
627
- matches: 'Invalid Zip Code'
628
- }
629
- });
630
-
631
-
632
651
  // ------ Question Groups
633
652
 
634
653
  // NOTE: name must be unique within a form!
@@ -870,13 +889,20 @@ function crossSellQuestionsStepSubHeadline(updates) {
870
889
  function commentsStepHeadline(updates) {
871
890
  return {
872
891
  $el: 'h3',
873
- children: updates.headline || 'Additional Case Details',
892
+ children: updates.headline || 'Additional Details',
874
893
  attrs: {
875
894
  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 || '')
876
895
  }
877
896
  }
878
897
  }
879
898
 
899
+ function commentsStepHeadlineLegal(updates) {
900
+ return commentsStepHeadline({
901
+ headline: updates.headline || 'Additional Case Details',
902
+ headlineClass: updates.headlineClass
903
+ })
904
+ }
905
+
880
906
  function firstAndLastStepHeadline(updates) {
881
907
  return {
882
908
  $el: 'h3',
@@ -900,7 +926,7 @@ function legalCrossSellsStepHeadline(updates) {
900
926
  function contactStepHeadline(updates) {
901
927
  return {
902
928
  $el: 'h3',
903
- children: updates.headline || DEFAULT_FINAL_HEADLINE_DYNAMIC,
929
+ children: updates.headline || DEFAULT_FINAL_HEADLINE_DYNAMIC_LEGAL,
904
930
  attrs: {
905
931
  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 || '')
906
932
  }
@@ -910,7 +936,7 @@ function contactStepHeadline(updates) {
910
936
  function contactStepSubHeadline(updates) {
911
937
  return {
912
938
  $el: 'h5',
913
- children: updates.subheadline || DEFAULT_FINAL_SUBHEADLINE_DYNAMIC,
939
+ children: updates.subheadline || DEFAULT_FINAL_SUBHEADLINE_DYNAMIC_LEGAL,
914
940
  attrs: {
915
941
  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 || '')
916
942
  }
@@ -950,10 +976,16 @@ const stepDefaults = (step, stepKey) => ({
950
976
  }
951
977
  });
952
978
 
953
- function step(name, inputs, nextOnEnter = true, nextOnInput = false, stepKey = undefined, nextStepMap = undefined, autoFocus = undefined) {
954
- if (typeof nextOnEnter === 'undefined') {
955
- nextOnEnter = true;
956
- }
979
+ function step(name, inputs, updates = {}) {
980
+ const {
981
+ nextOnEnter = true,
982
+ nextOnInput = false,
983
+ stepKey = undefined,
984
+ nextStepMap = undefined,
985
+ triggerRedirectMap = undefined,
986
+ autoFocus = undefined,
987
+ } = updates;
988
+
957
989
  if (inputs && inputs.length && (nextOnEnter || nextOnInput)) {
958
990
  const lastInput = findLastInput(inputs[inputs.length - 1]);
959
991
  if (lastInput && nextOnEnter === true) {
@@ -973,6 +1005,7 @@ function step(name, inputs, nextOnEnter = true, nextOnInput = false, stepKey = u
973
1005
  id: name,
974
1006
  name: name,
975
1007
  nextStepMap: nextStepMap,
1008
+ triggerRedirectMap: triggerRedirectMap,
976
1009
  autoFocus: autoFocus,
977
1010
  children: inputs
978
1011
  }
@@ -981,6 +1014,38 @@ function step(name, inputs, nextOnEnter = true, nextOnInput = false, stepKey = u
981
1014
  )
982
1015
  }
983
1016
 
1017
+ function contactInfo(updates = {}) {
1018
+ return step(
1019
+ 'contactInfo',
1020
+ [
1021
+ contactStepHeadline(updates),
1022
+ contactStepSubHeadline(updates),
1023
+ trustedFormScript(),
1024
+ email(updates.scope),
1025
+ phone(updates.scope),
1026
+ TCPAConsent(updates.scope),
1027
+ secureIcon()
1028
+ ],
1029
+ { nextOnEnter: false }
1030
+ )
1031
+ }
1032
+
1033
+ function firstAndLastV2(updates = {}) {
1034
+ return step(
1035
+ 'firstAndLast',
1036
+ [
1037
+ firstAndLastStepHeadline(updates),
1038
+ firstName(),
1039
+ lastName()
1040
+ ],
1041
+ updates
1042
+ )
1043
+ }
1044
+
1045
+
1046
+ // ------ Legal Steps
1047
+
1048
+
984
1049
  function accidentsAndInjuriesTOLPAndZip(updates = {}) {
985
1050
  return step(
986
1051
  'accidentsAndInjuriesTOLPAndZip',
@@ -996,10 +1061,7 @@ function accidentsAndInjuriesTOLPAndZip(updates = {}) {
996
1061
  }),
997
1062
  zipcode()
998
1063
  ],
999
- updates.nextOnEnter,
1000
- updates.nextOnInput,
1001
- updates.stepKey,
1002
- updates.nextStepMap
1064
+ updates
1003
1065
  )
1004
1066
  }
1005
1067
 
@@ -1012,7 +1074,7 @@ function accidentsAndInjuriesTOLPQuestions(updates = {}) {
1012
1074
  PersonalInjuryQuestions(),
1013
1075
  WorkersCompensationQuestions()
1014
1076
  ],
1015
- updates.nextOnEnter
1077
+ updates
1016
1078
  )
1017
1079
  }
1018
1080
 
@@ -1020,10 +1082,10 @@ function commentsWithBankruptcy(updates = {}) {
1020
1082
  return step(
1021
1083
  'commentsWithBankruptcy',
1022
1084
  [
1023
- commentsStepHeadline(updates),
1085
+ commentsStepHeadlineLegal(updates),
1024
1086
  comments({
1025
- label: typeof updates.label === 'undefined' ? DEFAULT_COMMENTS_LABEL : updates.label,
1026
- placeholder: updates.placeholder || DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC,
1087
+ label: typeof updates.label === 'undefined' ? DEFAULT_COMMENTS_LABEL_LEGAL : updates.label,
1088
+ placeholder: updates.placeholder || DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL,
1027
1089
  inputClass: typeof updates.inputClass === 'undefined' ? '!t-h-32' : updates.inputClass,
1028
1090
  }, updates.scope),
1029
1091
  // TODO: needs scope support
@@ -1040,35 +1102,7 @@ function commentsWithBankruptcy(updates = {}) {
1040
1102
  ],
1041
1103
  }
1042
1104
  ],
1043
- false // nextOnEnter
1044
- )
1045
- }
1046
-
1047
- function contactInfo(updates = {}) {
1048
- return step(
1049
- 'contactInfo',
1050
- [
1051
- contactStepHeadline(updates),
1052
- contactStepSubHeadline(updates),
1053
- trustedFormScript(),
1054
- email(updates.scope),
1055
- phone(updates.scope),
1056
- TCPAConsent(updates.scope),
1057
- secureIcon()
1058
- ],
1059
- false, // nextOnEnter
1060
- )
1061
- }
1062
-
1063
- function firstAndLastV2(updates = {}) {
1064
- return step(
1065
- 'firstAndLast',
1066
- [
1067
- firstAndLastStepHeadline(updates),
1068
- firstName(),
1069
- lastName()
1070
- ],
1071
- updates.nextOnEnter
1105
+ { nextOnEnter: false }
1072
1106
  )
1073
1107
  }
1074
1108
 
@@ -1087,7 +1121,7 @@ function childCustodyCrossSellQuestions(updates = {}) {
1087
1121
  'CrossSell:Child_Custody'
1088
1122
  )
1089
1123
  ],
1090
- updates.nextOnEnter
1124
+ updates
1091
1125
  )
1092
1126
  }
1093
1127
 
@@ -1106,7 +1140,7 @@ function divorceAndSeparationCrossSellQuestions(updates = {}) {
1106
1140
  'CrossSell:Divorce_and_Separation'
1107
1141
  )
1108
1142
  ],
1109
- updates.nextOnEnter
1143
+ updates
1110
1144
  )
1111
1145
  }
1112
1146
 
@@ -1125,7 +1159,7 @@ function duiAndDWICrossSellQuestions(updates = {}) {
1125
1159
  'CrossSell:DUI_and_DWI'
1126
1160
  )
1127
1161
  ],
1128
- updates.nextOnEnter
1162
+ updates
1129
1163
  )
1130
1164
  }
1131
1165
 
@@ -1145,7 +1179,7 @@ function ssdiCrossSellQuestions(updates = {}) {
1145
1179
  'CrossSell:Social_Security_Disability_and_Insurance'
1146
1180
  )
1147
1181
  ],
1148
- updates.nextOnEnter
1182
+ updates
1149
1183
  )
1150
1184
  }
1151
1185
 
@@ -1164,7 +1198,7 @@ function powerOfAttorneyCrossSellQuestions(updates = {}) {
1164
1198
  'CrossSell:Power_of_Attorney'
1165
1199
  )
1166
1200
  ],
1167
- updates.nextOnEnter
1201
+ updates
1168
1202
  )
1169
1203
  }
1170
1204
 
@@ -1183,7 +1217,7 @@ function willsAndTrustsCrossSellQuestions(updates = {}) {
1183
1217
  'CrossSell:Wills_and_Trusts'
1184
1218
  )
1185
1219
  ],
1186
- updates.nextOnEnter
1220
+ updates
1187
1221
  )
1188
1222
  }
1189
1223
 
@@ -1203,21 +1237,20 @@ function workersCompensationCrossSellQuestions(updates = {}) {
1203
1237
  'CrossSell:Workers_Compensation'
1204
1238
  )
1205
1239
  ],
1206
- updates.nextOnEnter
1240
+ updates
1207
1241
  )
1208
1242
  }
1209
1243
 
1210
1244
  function legalCrossSells(updates = {}) {
1245
+ updates.nextOnInput = false;
1246
+ updates.stepKey = '$get(Type_Of_Legal_Problem).value';
1211
1247
  return step(
1212
1248
  'legalCrossSells',
1213
1249
  [
1214
1250
  legalCrossSellsStepHeadline(updates),
1215
1251
  legalCrossSells$1(),
1216
1252
  ],
1217
- updates.nextOnEnter,
1218
- false,
1219
- // Note: we should probably scope this stepKey to this step name
1220
- '$get(Type_Of_Legal_Problem).value'
1253
+ updates
1221
1254
  )
1222
1255
  }
1223
1256
 
@@ -1360,9 +1393,7 @@ function formProps(updates) {
1360
1393
  return props
1361
1394
  }
1362
1395
 
1363
- const metaDefaults = {
1364
- tcpaLanguage: TCPA_LANGUAGE
1365
- };
1396
+ const metaDefaults = {};
1366
1397
 
1367
1398
  function metaProps(updates) {
1368
1399
  const data = merge(
@@ -1375,7 +1406,7 @@ function metaProps(updates) {
1375
1406
  }
1376
1407
  }
1377
1408
 
1378
- function defaultMetaProps(tolps = null) {
1409
+ function defaultMetaPropsLegal(tolps = null) {
1379
1410
  let commentsPlaceholders = TOLPCommentsPlaceholders;
1380
1411
  let finalHeadlines = TOLPFinalHeadlines;
1381
1412
  let finalSubHeadlines = TOLPFinalSubHeadlines;
@@ -1385,12 +1416,13 @@ function defaultMetaProps(tolps = null) {
1385
1416
  finalSubHeadlines = filterMapByKey(TOLPFinalSubHeadlines, tolps);
1386
1417
  }
1387
1418
  return metaProps({
1388
- defaultCommentsPlaceholder: DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC,
1419
+ tcpaLanguage: TCPA_LANGUAGE_LEGAL,
1420
+ defaultCommentsPlaceholder: DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL,
1389
1421
  commentsPlaceholders: commentsPlaceholders,
1390
- defaultFinalHeadline: DEFAULT_FINAL_HEADLINE,
1422
+ defaultFinalHeadline: DEFAULT_FINAL_HEADLINE_LEGAL,
1391
1423
  finalHeadlines: finalHeadlines,
1392
- defaultFinalSubHeadline: DEFAULT_FINAL_SUBHEADLINE,
1393
- finalSubHeadlines: finalSubHeadlines,
1424
+ defaultFinalSubHeadline: DEFAULT_FINAL_SUBHEADLINE_LEGAL,
1425
+ finalSubHeadlines: finalSubHeadlines
1394
1426
  })
1395
1427
  }
1396
1428
 
@@ -1863,25 +1895,55 @@ const TOLPFinalSubHeadlines = {
1863
1895
  // 'Non-Workplace Discrimination': '',
1864
1896
  };
1865
1897
 
1866
-
1867
1898
  const nextStepsMapLegalLegacy = {
1868
- '*': [
1869
- 'TOLPQuestions',
1870
- 'commentsWithBankruptcy',
1871
- 'legalCrossSells',
1872
- 'firstAndLast',
1873
- 'contactInfo',
1874
- ]
1899
+ values: {
1900
+ '*': [
1901
+ 'TOLPQuestions',
1902
+ 'commentsWithBankruptcy',
1903
+ 'legalCrossSells',
1904
+ 'firstAndLast',
1905
+ 'contactInfo',
1906
+ ]
1907
+ }
1875
1908
  };
1876
1909
 
1877
- const meta = defaultMetaProps();
1910
+ const nextStepsMapLegalCrossSells = {
1911
+ values: {
1912
+ 'Legal_CrossSells': {
1913
+ 'Auto and Car Accidents': ['autoAndCarAccidentCrossSellQuestions'],
1914
+ 'Personal Injury': ['personalInjuryCrossSellQuestions'],
1915
+ 'Workers Compensation': ['workersCompensationCrossSellQuestions'],
1916
+ 'DUI and DWI': ['duiAndDWICrossSellQuestions'],
1917
+ 'Long Term Disability': ['longTermDisabilityCrossSellQuestions'],
1918
+ 'Social Security Disability and Insurance': ['ssdiCrossSellQuestions'],
1919
+ 'Bankruptcy': ['bankruptcyCrossSellQuestions'],
1920
+ 'Power of Attorney': ['powerOfAttorneyCrossSellQuestions'],
1921
+ 'Wills and Trusts': ['willsAndTrustsCrossSellQuestions'],
1922
+ 'Divorce and Separation': ['divorceAndSeparationCrossSellQuestions'],
1923
+ 'Child Custody': ['childCustodyCrossSellQuestions'],
1924
+ },
1925
+ '*': ['firstAndLast', 'contactInfo'],
1926
+ },
1927
+
1928
+ // NOTE: this assumes a certain placement of the cross sell question
1929
+ // in the form flow.
1930
+ appendSteps: ['firstAndLast', 'contactInfo'],
1931
+ matchesAllowed: 1,
1932
+ };
1933
+
1934
+ const legalCrossSellOptionMap = CROSS_SELL_OPTION_MAP_LEGAL;
1935
+
1936
+ const meta = defaultMetaPropsLegal();
1878
1937
 
1879
1938
  meta.data.dynamicSchema = [
1880
1939
  accidentsAndInjuriesTOLPQuestions(),
1881
1940
  commentsWithBankruptcy({
1882
1941
  inputClass: '!t-h-28'
1883
1942
  }),
1884
- legalCrossSells(),
1943
+ legalCrossSells({
1944
+ headlineClass: '!t-text-dark',
1945
+ nextStepMap: nextStepsMapLegalCrossSells,
1946
+ }),
1885
1947
  workersCompensationCrossSellQuestions(),
1886
1948
  duiAndDWICrossSellQuestions(),
1887
1949
  ssdiCrossSellQuestions(),
@@ -1900,7 +1962,8 @@ const schema = [
1900
1962
  props: formProps({
1901
1963
  formId: 'accidentsAndInjuries',
1902
1964
  redirectMap: legalRedirectMap(),
1903
- valueOverrideMap: legalAllValueOverrideMap
1965
+ valueOverrideMap: legalAllValueOverrideMap,
1966
+ crossSellOptionMap: legalCrossSellOptionMap
1904
1967
  }),
1905
1968
  children: [
1906
1969
  headline({