bhl-forms 0.6.15 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) 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 +314 -228
  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 +317 -236
  13. package/dist/forms/business.iife.js +1 -1
  14. package/dist/forms/business.json +1 -1
  15. package/dist/forms/childAndFamily.es.js +303 -224
  16. package/dist/forms/childAndFamily.iife.js +1 -1
  17. package/dist/forms/childAndFamily.json +1 -1
  18. package/dist/forms/childAndFamilySingle.es.js +643 -555
  19. package/dist/forms/childAndFamilySingle.iife.js +1 -1
  20. package/dist/forms/childAndFamilySingle.json +1 -1
  21. package/dist/forms/civilLawsuit.es.js +637 -551
  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 +307 -227
  27. package/dist/forms/contracts.iife.js +1 -1
  28. package/dist/forms/contracts.json +1 -1
  29. package/dist/forms/criminal.es.js +660 -572
  30. package/dist/forms/criminal.iife.js +1 -1
  31. package/dist/forms/criminal.json +1 -1
  32. package/dist/forms/divorce.es.js +643 -555
  33. package/dist/forms/divorce.iife.js +1 -1
  34. package/dist/forms/divorce.json +1 -1
  35. package/dist/forms/employmentAndWorkplace.es.js +584 -506
  36. package/dist/forms/employmentAndWorkplace.iife.js +1 -1
  37. package/dist/forms/employmentAndWorkplace.json +1 -1
  38. package/dist/forms/generalHomeImprovement.es.js +3015 -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 +341 -244
  42. package/dist/forms/generalLegal.iife.js +1 -1
  43. package/dist/forms/generalLegal.json +1 -1
  44. package/dist/forms/generalLegalJustAnswer.es.js +4542 -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 +342 -245
  48. package/dist/forms/generalLegalPopUnder.iife.js +1 -1
  49. package/dist/forms/generalLegalPopUnder.json +1 -1
  50. package/dist/forms/generalLegalPopUnderSingle.es.js +692 -612
  51. package/dist/forms/generalLegalPopUnderSingle.iife.js +1 -1
  52. package/dist/forms/generalLegalPopUnderSingle.json +1 -1
  53. package/dist/forms/generalLegalSingle.es.js +692 -612
  54. package/dist/forms/generalLegalSingle.iife.js +1 -1
  55. package/dist/forms/generalLegalSingle.json +1 -1
  56. package/dist/forms/generalLegalThankYou.es.js +204 -158
  57. package/dist/forms/generalLegalThankYou.iife.js +1 -1
  58. package/dist/forms/generalLegalThankYou.json +1 -1
  59. package/dist/forms/generalLegalThankYouConsultation.es.js +692 -612
  60. package/dist/forms/generalLegalThankYouConsultation.iife.js +1 -1
  61. package/dist/forms/generalLegalThankYouConsultation.json +1 -1
  62. package/dist/forms/harassmentAndDiscrimination.es.js +303 -224
  63. package/dist/forms/harassmentAndDiscrimination.iife.js +1 -1
  64. package/dist/forms/harassmentAndDiscrimination.json +1 -1
  65. package/dist/forms/landlordTenant.es.js +316 -240
  66. package/dist/forms/landlordTenant.iife.js +1 -1
  67. package/dist/forms/landlordTenant.json +1 -1
  68. package/dist/forms/malpractice.es.js +308 -227
  69. package/dist/forms/malpractice.iife.js +1 -1
  70. package/dist/forms/malpractice.json +1 -1
  71. package/dist/forms/mechanics.es.js +184 -166
  72. package/dist/forms/mechanics.iife.js +1 -1
  73. package/dist/forms/mechanics.json +1 -1
  74. package/dist/forms/patentsAndIP.es.js +646 -558
  75. package/dist/forms/patentsAndIP.iife.js +1 -1
  76. package/dist/forms/patentsAndIP.json +1 -1
  77. package/dist/forms/realEstate.es.js +339 -243
  78. package/dist/forms/realEstate.iife.js +1 -1
  79. package/dist/forms/realEstate.json +1 -1
  80. package/dist/forms/repossession.es.js +307 -227
  81. package/dist/forms/repossession.iife.js +1 -1
  82. package/dist/forms/repossession.json +1 -1
  83. package/dist/forms/ssdi.es.js +156 -140
  84. package/dist/forms/ssdi.iife.js +1 -1
  85. package/dist/forms/ssdi.json +1 -1
  86. package/dist/forms/testForm.es.js +69 -51
  87. package/dist/forms/testForm.iife.js +1 -1
  88. package/dist/forms/testForm.json +1 -1
  89. package/dist/forms/testRedirects.es.js +43 -22
  90. package/dist/forms/testRedirects.iife.js +1 -1
  91. package/dist/forms/testRedirects.json +1 -1
  92. package/dist/forms/vets.es.js +16 -7
  93. package/dist/forms/vets.iife.js +1 -1
  94. package/dist/forms/willsAndTrusts.es.js +304 -223
  95. package/dist/forms/willsAndTrusts.iife.js +1 -1
  96. package/dist/forms/willsAndTrusts.json +1 -1
  97. 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
 
@@ -149,6 +232,14 @@ const sbsText = (updates) => {
149
232
  return text(updates)
150
233
  };
151
234
 
235
+ const verticalText = (updates) => {
236
+ updates.wrapperClass = 't-flex t-justify-center';
237
+ updates.messagesClass = 't-flex t-justify-center';
238
+ updates.inputClass = 't-text-center';
239
+ updates.helpClass = 't-mt-2.5 !t-text-sm t-text-center';
240
+ return text(updates)
241
+ };
242
+
152
243
  const textArea = (updates) => {
153
244
  if (updates.name && !updates.id) {
154
245
  updates.id = updates.name;
@@ -186,20 +277,101 @@ const sbsDate = (updates) => {
186
277
  return date(updates)
187
278
  };
188
279
 
189
- const applicantAge = (scope) => sbsText({
190
- name: scope ? scope + ':' + 'Applicant_Age' : 'Applicant_Age',
191
- label: 'Age of Applicant?',
192
- placeholder: 'Age between 18 and 65',
193
- maxlength: 2,
194
- inputmode: "numeric",
195
- validation: "required|min:18,max:65",
280
+ const email = (scope) => sbsText({
281
+ $formkit: 'email',
282
+ name: scope ? scope + ':' + 'Email' : 'Email',
283
+ label: 'Email Address:',
284
+ placeholder: 'email@domain.com',
285
+ autocomplete: 'email',
286
+ 'data-tf-sensitive': 'false',
287
+ validation: 'required|email',
196
288
  validationMessages: {
197
- required: 'Applicant Age is required',
198
- min: 'Invalid Age - must be between 18 and 65',
199
- max: 'Invalid Age - must be between 18 and 65',
289
+ required: 'Email is required',
290
+ email: 'Invalid Email'
200
291
  }
201
292
  });
202
293
 
294
+ const firstName = (scope) => sbsText({
295
+ label: 'First Name:',
296
+ placeholder: 'First',
297
+ name: scope ? scope + ':' + 'First_Name' : 'First_Name',
298
+ autocomplete: "given-name",
299
+ validationMessages: {
300
+ required: 'First Name is required'
301
+ }
302
+ });
303
+
304
+ const lastName = (scope) => sbsText({
305
+ label: 'Last Name:',
306
+ placeholder: 'Last',
307
+ name: scope ? scope + ':' + 'Last_Name' : 'Last_Name',
308
+ autocomplete: "family-name",
309
+ validationMessages: {
310
+ required: 'Last Name is required'
311
+ }
312
+ });
313
+
314
+ const phone = (scope) => sbsText({
315
+ $formkit: 'tel',
316
+ name: scope ? scope + ':' + 'Primary_Phone' : 'Primary_Phone',
317
+ label: 'Phone Number:',
318
+ placeholder: '###-###-####',
319
+ maxlength: 12,
320
+ help: '10-digit phone number, hyphens optional',
321
+ autocomplete: 'tel-national',
322
+ 'data-tf-sensitive': 'false',
323
+ validation: 'required|matches:/^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$/|valid_phone',
324
+ validationMessages: {
325
+ required: 'Field is required',
326
+ matches: 'Invalid Phone Format, use ###-###-####',
327
+ valid_phone: 'Invalid Phone Number'
328
+ },
329
+ helpClass: "t-mt-2.5 md:t-text-right md:t-mt-[-2px]"
330
+ });
331
+
332
+
333
+ const zipcode = (scope, vertical, updates = {}) => {
334
+ const func = vertical ? verticalText : sbsText;
335
+ const label = vertical ? (updates.label) : 'Zip Code:';
336
+ const help = vertical ? (updates.help ?? "We try to match you with local help") : null;
337
+ return func({
338
+ label,
339
+ help,
340
+ placeholder: '#####',
341
+ name: scope ? scope + ':' + 'Zip' : 'Zip',
342
+ maxlength: 5,
343
+ inputmode: "numeric",
344
+ autocomplete: 'postal-code',
345
+ validation: 'required|matches:/^[0-9]{5}$/',
346
+ validationMessages: {
347
+ required: 'Zip Code is required',
348
+ matches: 'Invalid Zip Code'
349
+ },
350
+ ...updates
351
+ })
352
+ };
353
+
354
+ const applicantAge = (scope, vertical, updates = {}) => {
355
+ const func = vertical ? verticalText : sbsText;
356
+ const label = vertical ? (updates.label) : 'Age of Applicant?';
357
+ const value = vertical ? (updates.value ?? "50") : null;
358
+ return func(merge({
359
+ label,
360
+ placeholder: 'Age between 18 and 65',
361
+ name: scope ? scope + ':' + 'Applicant_Age' : 'Applicant_Age',
362
+ value,
363
+ maxlength: 2,
364
+ inputmode: "numeric",
365
+ validation: "required|min:18,max:65",
366
+ validationMessages: {
367
+ required: 'Applicant Age is required',
368
+ min: 'Invalid Age - must be between 18 and 65',
369
+ max: 'Invalid Age - must be between 18 and 65',
370
+ },
371
+ ...updates
372
+ }))
373
+ };
374
+
203
375
  const atFault = (scope) => sbsYesNoRadio({
204
376
  name: scope ? scope + ':' + 'At_Fault' : 'At_Fault',
205
377
  label: 'Were You at Fault?'
@@ -345,20 +517,6 @@ const doctorTreatment = (scope) => sbsYesNoRadio({
345
517
  label: 'Have You Recently Been Treated by a Doctor, Hospital or Clinic?',
346
518
  });
347
519
 
348
- const email = (scope) => sbsText({
349
- $formkit: 'email',
350
- name: scope ? scope + ':' + 'Email' : 'Email',
351
- label: 'Email Address:',
352
- placeholder: 'email@domain.com',
353
- autocomplete: 'email',
354
- 'data-tf-sensitive': 'false',
355
- validation: 'required|email',
356
- validationMessages: {
357
- required: 'Email is required',
358
- email: 'Invalid Email'
359
- }
360
- });
361
-
362
520
  const estateLegalServicesNeeded = (scope) => sbsSelect({
363
521
  name: scope ? scope + ':' + 'Estate_Legal_Services_Needed' : 'Estate_Legal_Services_Needed',
364
522
  label: "Legal Services Needed for Your Estate:",
@@ -372,17 +530,6 @@ const estateLegalServicesNeeded = (scope) => sbsSelect({
372
530
  ]
373
531
  });
374
532
 
375
- const firstName = (scope) => sbsText({
376
- $formkit: 'text',
377
- label: 'First Name:',
378
- placeholder: 'First',
379
- name: scope ? scope + ':' + 'First_Name' : 'First_Name',
380
- autocomplete: "given-name",
381
- validationMessages: {
382
- required: 'First Name is required'
383
- }
384
- });
385
-
386
533
  const haveAttorney = (scope) => sbsYesNoRadio({
387
534
  name: scope ? scope + ':' + 'Have_Attorney' : 'Have_Attorney',
388
535
  label: 'Already Working with An Attorney?'
@@ -398,17 +545,6 @@ const incidentDate = (scope) => sbsDate({
398
545
  label: 'Date of Incident:',
399
546
  });
400
547
 
401
- const lastName = (scope) => sbsText({
402
- $formkit: 'text',
403
- label: 'Last Name:',
404
- placeholder: 'Last',
405
- name: scope ? scope + ':' + 'Last_Name' : 'Last_Name',
406
- autocomplete: "family-name",
407
- validationMessages: {
408
- required: 'Last Name is required'
409
- }
410
- });
411
-
412
548
  const lawyerPaymentMethod = (scope) => sbsSelect({
413
549
  name: scope ? scope + ':' + 'Lawyer_Payment_Method' : 'Lawyer_Payment_Method',
414
550
  label: 'How Will You Pay for Legal Fees if You Hire a Lawyer?',
@@ -429,69 +565,7 @@ const legalCrossSells$1 = () => col2Checkbox({
429
565
  help: 'Just hit "Next" if none apply',
430
566
  helpClass: 't-text-center !t-text-sm',
431
567
  validation: null,
432
- options: {
433
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Auto and Car Accidents"',
434
- then: {
435
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
436
- 'Wills and Trusts': 'Need a Will or Trust',
437
- 'Workers Compensation': 'Workplace Injury',
438
- 'Power of Attorney': 'Update Power of Attorney',
439
- 'Divorce and Separation': 'Need a Divorce or Separation',
440
- 'Child Custody': 'Need help with Child Custody',
441
- },
442
- else: {
443
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Personal Injury" || $getVal($get(form), "Type_Of_Legal_Problem") === "Workers Compensation"',
444
- then: {
445
- 'DUI and DWI': 'Involved in a DUI/DWI',
446
- 'Wills and Trusts': 'Need a Will or Trust',
447
- 'Power of Attorney': 'Update Power of Attorney',
448
- 'Divorce and Separation': 'Need a Divorce or Separation',
449
- 'Child Custody': 'Need help with Child Custody',
450
- // TODO add one more?
451
- },
452
- else: {
453
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "DUI and DWI"',
454
- then: {
455
- 'Personal Injury': 'Personal or Workplace Injury',
456
- 'Wills and Trusts': 'Need a Will or Trust',
457
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
458
- 'Power of Attorney': 'Update Power of Attorney',
459
- 'Divorce and Separation': 'Need a Divorce or Separation',
460
- 'Child Custody': 'Need help with Child Custody',
461
- },
462
- else: {
463
- 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"',
464
- then: {
465
- 'Auto and Car Accidents': 'Injured in a Car Accident',
466
- 'Personal Injury': 'Personal or Workplace Injury',
467
- 'DUI and DWI': 'Involved in a DUI/DWI',
468
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
469
- 'Divorce and Separation': 'Need a Divorce or Separation',
470
- 'Child Custody': 'Need help with Child Custody',
471
- },
472
- else: {
473
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Long Term Disability" || $getVal($get(form), "Type_Of_Legal_Problem") === "Social Security Disability and Insurance"',
474
- then: {
475
- 'Auto and Car Accidents': 'Injured in a Car Accident',
476
- 'DUI and DWI': 'Involved in a DUI/DWI',
477
- 'Wills and Trusts': 'Need a Will or Trust',
478
- 'Power of Attorney': 'Update Power of Attorney',
479
- 'Divorce and Separation': 'Need a Divorce or Separation',
480
- 'Child Custody': 'Need help with Child Custody',
481
- },
482
- else: {
483
- 'Auto and Car Accidents': 'Injured in a Car Accident',
484
- 'Personal Injury': 'Personal or Workplace Injury',
485
- 'DUI and DWI': 'Involved in a DUI/DWI',
486
- 'Wills and Trusts': 'Need a Will or Trust',
487
- 'Power of Attorney': 'Update Power of Attorney',
488
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
489
- }
490
- }
491
- }
492
- }
493
- }
494
- }
568
+ options: '$getCrossSellOptions($get(form), $getVal($get(form), "Type_Of_Legal_Problem"))',
495
569
  });
496
570
 
497
571
  const maritalStatus = (scope) => sbsSelect({
@@ -512,24 +586,6 @@ const pendingCharges = (scope) => sbsYesNoRadio({
512
586
  label: 'Do you currently have any pending charges?'
513
587
  });
514
588
 
515
- const phone = (scope) => sbsText({
516
- $formkit: 'tel',
517
- name: scope ? scope + ':' + 'Primary_Phone' : 'Primary_Phone',
518
- label: 'Phone Number:',
519
- placeholder: '###-###-####',
520
- maxlength: 12,
521
- help: '10-digit phone number, hyphens optional',
522
- autocomplete: 'tel-national',
523
- 'data-tf-sensitive': 'false',
524
- validation: 'required|matches:/^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$/|valid_phone',
525
- validationMessages: {
526
- required: 'Field is required',
527
- matches: 'Invalid Phone Format, use ###-###-####',
528
- valid_phone: 'Invalid Phone Number'
529
- },
530
- helpClass: "t-mt-2.5 md:t-text-right md:t-mt-[-2px]"
531
- });
532
-
533
589
  const primaryInjury = (scope) => sbs2ColRadio({
534
590
  name: scope ? scope + ':' + 'Primary_Injury' : 'Primary_Injury',
535
591
  label: 'Primary Injury:',
@@ -651,21 +707,6 @@ const willsAndTrustsTOLP = () => col2Radio({
651
707
  ]
652
708
  });
653
709
 
654
- const zipcode = (scope) => sbsText({
655
- label: 'Zip Code:',
656
- placeholder: '#####',
657
- name: scope ? scope + ':' + 'Zip' : 'Zip',
658
- maxlength: 5,
659
- inputmode: "numeric",
660
- autocomplete: 'postal-code',
661
- validation: 'required|matches:/^[0-9]{5}$/',
662
- validationMessages: {
663
- required: 'Zip Code is required',
664
- matches: 'Invalid Zip Code'
665
- }
666
- });
667
-
668
-
669
710
  // ------ Question Groups
670
711
 
671
712
  // NOTE: name must be unique within a form!
@@ -961,13 +1002,20 @@ function crossSellQuestionsStepSubHeadline(updates) {
961
1002
  function commentsStepHeadline(updates) {
962
1003
  return {
963
1004
  $el: 'h3',
964
- children: updates.headline || 'Additional Case Details',
1005
+ children: updates.headline || 'Additional Details',
965
1006
  attrs: {
966
1007
  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 || '')
967
1008
  }
968
1009
  }
969
1010
  }
970
1011
 
1012
+ function commentsStepHeadlineLegal(updates) {
1013
+ return commentsStepHeadline({
1014
+ headline: updates.headline || 'Additional Case Details',
1015
+ headlineClass: updates.headlineClass
1016
+ })
1017
+ }
1018
+
971
1019
  function firstAndLastStepHeadline(updates) {
972
1020
  return {
973
1021
  $el: 'h3',
@@ -991,7 +1039,7 @@ function legalCrossSellsStepHeadline(updates) {
991
1039
  function contactStepHeadline(updates) {
992
1040
  return {
993
1041
  $el: 'h3',
994
- children: updates.headline || DEFAULT_FINAL_HEADLINE_DYNAMIC,
1042
+ children: updates.headline || DEFAULT_FINAL_HEADLINE_DYNAMIC_LEGAL,
995
1043
  attrs: {
996
1044
  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 || '')
997
1045
  }
@@ -1001,7 +1049,7 @@ function contactStepHeadline(updates) {
1001
1049
  function contactStepSubHeadline(updates) {
1002
1050
  return {
1003
1051
  $el: 'h5',
1004
- children: updates.subheadline || DEFAULT_FINAL_SUBHEADLINE_DYNAMIC,
1052
+ children: updates.subheadline || DEFAULT_FINAL_SUBHEADLINE_DYNAMIC_LEGAL,
1005
1053
  attrs: {
1006
1054
  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 || '')
1007
1055
  }
@@ -1041,10 +1089,16 @@ const stepDefaults = (step, stepKey) => ({
1041
1089
  }
1042
1090
  });
1043
1091
 
1044
- function step(name, inputs, nextOnEnter = true, nextOnInput = false, stepKey = undefined, nextStepMap = undefined, autoFocus = undefined) {
1045
- if (typeof nextOnEnter === 'undefined') {
1046
- nextOnEnter = true;
1047
- }
1092
+ function step(name, inputs, updates = {}) {
1093
+ const {
1094
+ nextOnEnter = true,
1095
+ nextOnInput = false,
1096
+ stepKey = undefined,
1097
+ nextStepMap = undefined,
1098
+ triggerRedirectMap = undefined,
1099
+ autoFocus = undefined,
1100
+ } = updates;
1101
+
1048
1102
  if (inputs && inputs.length && (nextOnEnter || nextOnInput)) {
1049
1103
  const lastInput = findLastInput(inputs[inputs.length - 1]);
1050
1104
  if (lastInput && nextOnEnter === true) {
@@ -1064,6 +1118,7 @@ function step(name, inputs, nextOnEnter = true, nextOnInput = false, stepKey = u
1064
1118
  id: name,
1065
1119
  name: name,
1066
1120
  nextStepMap: nextStepMap,
1121
+ triggerRedirectMap: triggerRedirectMap,
1067
1122
  autoFocus: autoFocus,
1068
1123
  children: inputs
1069
1124
  }
@@ -1072,34 +1127,6 @@ function step(name, inputs, nextOnEnter = true, nextOnInput = false, stepKey = u
1072
1127
  )
1073
1128
  }
1074
1129
 
1075
- function commentsWithBankruptcy(updates = {}) {
1076
- return step(
1077
- 'commentsWithBankruptcy',
1078
- [
1079
- commentsStepHeadline(updates),
1080
- comments({
1081
- label: typeof updates.label === 'undefined' ? DEFAULT_COMMENTS_LABEL : updates.label,
1082
- placeholder: updates.placeholder || DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC,
1083
- inputClass: typeof updates.inputClass === 'undefined' ? '!t-h-32' : updates.inputClass,
1084
- }, updates.scope),
1085
- // TODO: needs scope support
1086
- bankruptcyCrossSell(),
1087
- {
1088
- $el: 'div',
1089
- if: '$get(CrossSell_Bankruptcy).value == true',
1090
- children: [
1091
- comments({
1092
- label: 'Bankruptcy or debt details:',
1093
- placeholder: 'Please describe your bankrtupcy or debt situation in a few words...',
1094
- inputClass: '!t-h-16'
1095
- }, 'CrossSell:Bankruptcy')
1096
- ],
1097
- }
1098
- ],
1099
- false // nextOnEnter
1100
- )
1101
- }
1102
-
1103
1130
  function contactInfo(updates = {}) {
1104
1131
  return step(
1105
1132
  'contactInfo',
@@ -1112,7 +1139,7 @@ function contactInfo(updates = {}) {
1112
1139
  TCPAConsent(updates.scope),
1113
1140
  secureIcon()
1114
1141
  ],
1115
- false, // nextOnEnter
1142
+ { nextOnEnter: false }
1116
1143
  )
1117
1144
  }
1118
1145
 
@@ -1124,10 +1151,37 @@ function firstAndLastV2(updates = {}) {
1124
1151
  firstName(),
1125
1152
  lastName()
1126
1153
  ],
1127
- updates.nextOnEnter
1154
+ updates
1128
1155
  )
1129
1156
  }
1130
1157
 
1158
+ function commentsWithBankruptcy(updates = {}) {
1159
+ return step(
1160
+ 'commentsWithBankruptcy',
1161
+ [
1162
+ commentsStepHeadlineLegal(updates),
1163
+ comments({
1164
+ label: typeof updates.label === 'undefined' ? DEFAULT_COMMENTS_LABEL_LEGAL : updates.label,
1165
+ placeholder: updates.placeholder || DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL,
1166
+ inputClass: typeof updates.inputClass === 'undefined' ? '!t-h-32' : updates.inputClass,
1167
+ }, updates.scope),
1168
+ // TODO: needs scope support
1169
+ bankruptcyCrossSell(),
1170
+ {
1171
+ $el: 'div',
1172
+ if: '$get(CrossSell_Bankruptcy).value == true',
1173
+ children: [
1174
+ comments({
1175
+ label: 'Bankruptcy or debt details:',
1176
+ placeholder: 'Please describe your bankrtupcy or debt situation in a few words...',
1177
+ inputClass: '!t-h-16'
1178
+ }, 'CrossSell:Bankruptcy')
1179
+ ],
1180
+ }
1181
+ ],
1182
+ { nextOnEnter: false }
1183
+ )
1184
+ }
1131
1185
 
1132
1186
  function autoAndCarAccidentCrossSellQuestions(updates = {}) {
1133
1187
  return step(
@@ -1145,7 +1199,7 @@ function autoAndCarAccidentCrossSellQuestions(updates = {}) {
1145
1199
  'CrossSell:Auto_and_Car_Accidents'
1146
1200
  )
1147
1201
  ],
1148
- updates.nextOnEnter
1202
+ updates
1149
1203
  )
1150
1204
  }
1151
1205
 
@@ -1164,7 +1218,7 @@ function childCustodyCrossSellQuestions(updates = {}) {
1164
1218
  'CrossSell:Child_Custody'
1165
1219
  )
1166
1220
  ],
1167
- updates.nextOnEnter
1221
+ updates
1168
1222
  )
1169
1223
  }
1170
1224
 
@@ -1183,7 +1237,7 @@ function divorceAndSeparationCrossSellQuestions(updates = {}) {
1183
1237
  'CrossSell:Divorce_and_Separation'
1184
1238
  )
1185
1239
  ],
1186
- updates.nextOnEnter
1240
+ updates
1187
1241
  )
1188
1242
  }
1189
1243
 
@@ -1202,7 +1256,7 @@ function duiAndDWICrossSellQuestions(updates = {}) {
1202
1256
  'CrossSell:DUI_and_DWI'
1203
1257
  )
1204
1258
  ],
1205
- updates.nextOnEnter
1259
+ updates
1206
1260
  )
1207
1261
  }
1208
1262
 
@@ -1222,7 +1276,7 @@ function ssdiCrossSellQuestions(updates = {}) {
1222
1276
  'CrossSell:Social_Security_Disability_and_Insurance'
1223
1277
  )
1224
1278
  ],
1225
- updates.nextOnEnter
1279
+ updates
1226
1280
  )
1227
1281
  }
1228
1282
 
@@ -1242,7 +1296,7 @@ function personalInjuryCrossSellQuestions(updates = {}) {
1242
1296
  'CrossSell:Personal_Injury'
1243
1297
  )
1244
1298
  ],
1245
- updates.nextOnEnter
1299
+ updates
1246
1300
  )
1247
1301
  }
1248
1302
 
@@ -1261,7 +1315,7 @@ function powerOfAttorneyCrossSellQuestions(updates = {}) {
1261
1315
  'CrossSell:Power_of_Attorney'
1262
1316
  )
1263
1317
  ],
1264
- updates.nextOnEnter
1318
+ updates
1265
1319
  )
1266
1320
  }
1267
1321
 
@@ -1280,7 +1334,7 @@ function willsAndTrustsCrossSellQuestions(updates = {}) {
1280
1334
  'CrossSell:Wills_and_Trusts'
1281
1335
  )
1282
1336
  ],
1283
- updates.nextOnEnter
1337
+ updates
1284
1338
  )
1285
1339
  }
1286
1340
 
@@ -1300,21 +1354,20 @@ function workersCompensationCrossSellQuestions(updates = {}) {
1300
1354
  'CrossSell:Workers_Compensation'
1301
1355
  )
1302
1356
  ],
1303
- updates.nextOnEnter
1357
+ updates
1304
1358
  )
1305
1359
  }
1306
1360
 
1307
1361
  function legalCrossSells(updates = {}) {
1362
+ updates.nextOnInput = false;
1363
+ updates.stepKey = '$get(Type_Of_Legal_Problem).value';
1308
1364
  return step(
1309
1365
  'legalCrossSells',
1310
1366
  [
1311
1367
  legalCrossSellsStepHeadline(updates),
1312
1368
  legalCrossSells$1(),
1313
1369
  ],
1314
- updates.nextOnEnter,
1315
- false,
1316
- // Note: we should probably scope this stepKey to this step name
1317
- '$get(Type_Of_Legal_Problem).value'
1370
+ updates
1318
1371
  )
1319
1372
  }
1320
1373
 
@@ -1326,10 +1379,7 @@ function willsAndTrustsTOLPAndZip(updates = {}) {
1326
1379
  willsAndTrustsTOLP(),
1327
1380
  zipcode()
1328
1381
  ],
1329
- updates.nextOnEnter,
1330
- updates.nextOnInput,
1331
- updates.stepKey,
1332
- updates.nextStepMap
1382
+ updates
1333
1383
  )
1334
1384
  }
1335
1385
 
@@ -1345,7 +1395,7 @@ function willsAndTrustsTOLPQuestions(updates = {}) {
1345
1395
  FamilyIssuesQuestions(),
1346
1396
  NotSureOrOtherQuestions()
1347
1397
  ],
1348
- updates.nextOnEnter
1398
+ updates
1349
1399
  )
1350
1400
  }
1351
1401
 
@@ -1488,9 +1538,7 @@ function formProps(updates) {
1488
1538
  return props
1489
1539
  }
1490
1540
 
1491
- const metaDefaults = {
1492
- tcpaLanguage: TCPA_LANGUAGE
1493
- };
1541
+ const metaDefaults = {};
1494
1542
 
1495
1543
  function metaProps(updates) {
1496
1544
  const data = merge(
@@ -1503,7 +1551,7 @@ function metaProps(updates) {
1503
1551
  }
1504
1552
  }
1505
1553
 
1506
- function defaultMetaProps(tolps = null) {
1554
+ function defaultMetaPropsLegal(tolps = null) {
1507
1555
  let commentsPlaceholders = TOLPCommentsPlaceholders;
1508
1556
  let finalHeadlines = TOLPFinalHeadlines;
1509
1557
  let finalSubHeadlines = TOLPFinalSubHeadlines;
@@ -1513,12 +1561,13 @@ function defaultMetaProps(tolps = null) {
1513
1561
  finalSubHeadlines = filterMapByKey(TOLPFinalSubHeadlines, tolps);
1514
1562
  }
1515
1563
  return metaProps({
1516
- defaultCommentsPlaceholder: DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC,
1564
+ tcpaLanguage: TCPA_LANGUAGE_LEGAL,
1565
+ defaultCommentsPlaceholder: DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL,
1517
1566
  commentsPlaceholders: commentsPlaceholders,
1518
- defaultFinalHeadline: DEFAULT_FINAL_HEADLINE,
1567
+ defaultFinalHeadline: DEFAULT_FINAL_HEADLINE_LEGAL,
1519
1568
  finalHeadlines: finalHeadlines,
1520
- defaultFinalSubHeadline: DEFAULT_FINAL_SUBHEADLINE,
1521
- finalSubHeadlines: finalSubHeadlines,
1569
+ defaultFinalSubHeadline: DEFAULT_FINAL_SUBHEADLINE_LEGAL,
1570
+ finalSubHeadlines: finalSubHeadlines
1522
1571
  })
1523
1572
  }
1524
1573
 
@@ -1763,23 +1812,53 @@ const TOLPFinalSubHeadlines = {
1763
1812
  // 'Non-Workplace Discrimination': '',
1764
1813
  };
1765
1814
 
1766
-
1767
1815
  const nextStepsMapLegalLegacy = {
1768
- '*': [
1769
- 'TOLPQuestions',
1770
- 'commentsWithBankruptcy',
1771
- 'legalCrossSells',
1772
- 'firstAndLast',
1773
- 'contactInfo',
1774
- ]
1816
+ values: {
1817
+ '*': [
1818
+ 'TOLPQuestions',
1819
+ 'commentsWithBankruptcy',
1820
+ 'legalCrossSells',
1821
+ 'firstAndLast',
1822
+ 'contactInfo',
1823
+ ]
1824
+ }
1775
1825
  };
1776
1826
 
1777
- const meta = defaultMetaProps();
1827
+ const nextStepsMapLegalCrossSells = {
1828
+ values: {
1829
+ 'Legal_CrossSells': {
1830
+ 'Auto and Car Accidents': ['autoAndCarAccidentCrossSellQuestions'],
1831
+ 'Personal Injury': ['personalInjuryCrossSellQuestions'],
1832
+ 'Workers Compensation': ['workersCompensationCrossSellQuestions'],
1833
+ 'DUI and DWI': ['duiAndDWICrossSellQuestions'],
1834
+ 'Long Term Disability': ['longTermDisabilityCrossSellQuestions'],
1835
+ 'Social Security Disability and Insurance': ['ssdiCrossSellQuestions'],
1836
+ 'Bankruptcy': ['bankruptcyCrossSellQuestions'],
1837
+ 'Power of Attorney': ['powerOfAttorneyCrossSellQuestions'],
1838
+ 'Wills and Trusts': ['willsAndTrustsCrossSellQuestions'],
1839
+ 'Divorce and Separation': ['divorceAndSeparationCrossSellQuestions'],
1840
+ 'Child Custody': ['childCustodyCrossSellQuestions'],
1841
+ },
1842
+ '*': ['firstAndLast', 'contactInfo'],
1843
+ },
1844
+
1845
+ // NOTE: this assumes a certain placement of the cross sell question
1846
+ // in the form flow.
1847
+ appendSteps: ['firstAndLast', 'contactInfo'],
1848
+ matchesAllowed: 1,
1849
+ };
1850
+
1851
+ const legalCrossSellOptionMap = CROSS_SELL_OPTION_MAP_LEGAL;
1852
+
1853
+ const meta = defaultMetaPropsLegal();
1778
1854
 
1779
1855
  meta.data.dynamicSchema = [
1780
1856
  willsAndTrustsTOLPQuestions(),
1781
1857
  commentsWithBankruptcy(),
1782
- legalCrossSells(),
1858
+ legalCrossSells({
1859
+ headlineClass: '!t-text-dark',
1860
+ nextStepMap: nextStepsMapLegalCrossSells,
1861
+ }),
1783
1862
  autoAndCarAccidentCrossSellQuestions(),
1784
1863
  personalInjuryCrossSellQuestions(),
1785
1864
  workersCompensationCrossSellQuestions(),
@@ -1800,6 +1879,8 @@ const schema = [
1800
1879
  props: formProps({
1801
1880
  formId: 'willsAndTrusts',
1802
1881
  redirectMap: legalRedirectMap(),
1882
+ crossSellOptionMap: legalCrossSellOptionMap
1883
+
1803
1884
  }),
1804
1885
  children: [
1805
1886
  defaultHeadline(),