bhl-forms 0.7.2 → 0.7.4

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 (101) hide show
  1. package/dist/bhl-forms.es.js +551 -543
  2. package/dist/bhl-forms.iife.js +4 -4
  3. package/dist/bhl-forms.modern.es.js +649 -649
  4. package/dist/bhl-forms.modern.iife.js +7 -7
  5. package/dist/bhl-forms.modern.umd.js +7 -7
  6. package/dist/bhl-forms.umd.js +4 -4
  7. package/dist/forms/accidentsAndInjuries.es.js +1459 -1151
  8. package/dist/forms/accidentsAndInjuries.iife.js +1 -1
  9. package/dist/forms/accidentsAndInjuries.json +1 -1
  10. package/dist/forms/appraisals.es.js +138 -137
  11. package/dist/forms/appraisals.iife.js +1 -1
  12. package/dist/forms/business.es.js +1432 -1149
  13. package/dist/forms/business.iife.js +1 -1
  14. package/dist/forms/business.json +1 -1
  15. package/dist/forms/childAndFamily.es.js +1327 -1043
  16. package/dist/forms/childAndFamily.iife.js +1 -1
  17. package/dist/forms/childAndFamily.json +1 -1
  18. package/dist/forms/childAndFamilySingle.es.js +1526 -1378
  19. package/dist/forms/childAndFamilySingle.iife.js +1 -1
  20. package/dist/forms/childAndFamilySingle.json +1 -1
  21. package/dist/forms/civilLawsuit.es.js +1998 -1807
  22. package/dist/forms/civilLawsuit.iife.js +1 -1
  23. package/dist/forms/civilLawsuit.json +1 -1
  24. package/dist/forms/coins.es.js +138 -137
  25. package/dist/forms/coins.iife.js +1 -1
  26. package/dist/forms/contracts.es.js +1347 -1050
  27. package/dist/forms/contracts.iife.js +1 -1
  28. package/dist/forms/contracts.json +1 -1
  29. package/dist/forms/criminal.es.js +1830 -1711
  30. package/dist/forms/criminal.iife.js +1 -1
  31. package/dist/forms/criminal.json +1 -1
  32. package/dist/forms/divorce.es.js +1539 -1385
  33. package/dist/forms/divorce.iife.js +1 -1
  34. package/dist/forms/divorce.json +1 -1
  35. package/dist/forms/employmentAndWorkplace.es.js +1831 -1678
  36. package/dist/forms/employmentAndWorkplace.iife.js +1 -1
  37. package/dist/forms/employmentAndWorkplace.json +1 -1
  38. package/dist/forms/generalHomeImprovement.es.js +1361 -1975
  39. package/dist/forms/generalHomeImprovement.iife.js +1 -1
  40. package/dist/forms/generalHomeImprovement.json +1 -1
  41. package/dist/forms/generalHomeImprovementThankYou.es.js +1361 -1975
  42. package/dist/forms/generalHomeImprovementThankYou.iife.js +1 -1
  43. package/dist/forms/generalHomeImprovementThankYou.json +1 -1
  44. package/dist/forms/generalLegal.es.js +3035 -2535
  45. package/dist/forms/generalLegal.iife.js +1 -1
  46. package/dist/forms/generalLegal.json +1 -1
  47. package/dist/forms/generalLegalJustAnswer.es.js +3214 -2872
  48. package/dist/forms/generalLegalJustAnswer.iife.js +1 -1
  49. package/dist/forms/generalLegalJustAnswer.json +1 -1
  50. package/dist/forms/generalLegalPopUnder.es.js +3035 -2535
  51. package/dist/forms/generalLegalPopUnder.iife.js +1 -1
  52. package/dist/forms/generalLegalPopUnder.json +1 -1
  53. package/dist/forms/generalLegalPopUnderSingle.es.js +3214 -2872
  54. package/dist/forms/generalLegalPopUnderSingle.iife.js +1 -1
  55. package/dist/forms/generalLegalPopUnderSingle.json +1 -1
  56. package/dist/forms/generalLegalSingle.es.js +3214 -2872
  57. package/dist/forms/generalLegalSingle.iife.js +1 -1
  58. package/dist/forms/generalLegalSingle.json +1 -1
  59. package/dist/forms/generalLegalThankYou.es.js +2823 -2303
  60. package/dist/forms/generalLegalThankYou.iife.js +1 -1
  61. package/dist/forms/generalLegalThankYou.json +1 -1
  62. package/dist/forms/generalLegalThankYouConsultation.es.js +3214 -2872
  63. package/dist/forms/generalLegalThankYouConsultation.iife.js +1 -1
  64. package/dist/forms/generalLegalThankYouConsultation.json +1 -1
  65. package/dist/forms/harassmentAndDiscrimination.es.js +1423 -1120
  66. package/dist/forms/harassmentAndDiscrimination.iife.js +1 -1
  67. package/dist/forms/harassmentAndDiscrimination.json +1 -1
  68. package/dist/forms/landlordTenant.es.js +1393 -1106
  69. package/dist/forms/landlordTenant.iife.js +1 -1
  70. package/dist/forms/landlordTenant.json +1 -1
  71. package/dist/forms/malpractice.es.js +1529 -1223
  72. package/dist/forms/malpractice.iife.js +1 -1
  73. package/dist/forms/malpractice.json +1 -1
  74. package/dist/forms/mechanics.es.js +701 -530
  75. package/dist/forms/mechanics.iife.js +1 -1
  76. package/dist/forms/mechanics.json +1 -1
  77. package/dist/forms/patentsAndIP.es.js +1828 -1652
  78. package/dist/forms/patentsAndIP.iife.js +1 -1
  79. package/dist/forms/patentsAndIP.json +1 -1
  80. package/dist/forms/realEstate.es.js +2850 -2405
  81. package/dist/forms/realEstate.iife.js +1 -1
  82. package/dist/forms/realEstate.json +1 -1
  83. package/dist/forms/repossession.es.js +1566 -1251
  84. package/dist/forms/repossession.iife.js +1 -1
  85. package/dist/forms/repossession.json +1 -1
  86. package/dist/forms/ssdi.es.js +635 -520
  87. package/dist/forms/ssdi.iife.js +1 -1
  88. package/dist/forms/ssdi.json +1 -1
  89. package/dist/forms/testForm.es.js +409 -371
  90. package/dist/forms/testForm.iife.js +1 -1
  91. package/dist/forms/testForm.json +1 -1
  92. package/dist/forms/testRedirects.es.js +420 -316
  93. package/dist/forms/testRedirects.iife.js +1 -1
  94. package/dist/forms/testRedirects.json +1 -1
  95. package/dist/forms/vets.es.js +138 -137
  96. package/dist/forms/vets.iife.js +1 -1
  97. package/dist/forms/willsAndTrusts.es.js +1426 -1112
  98. package/dist/forms/willsAndTrusts.iife.js +1 -1
  99. package/dist/forms/willsAndTrusts.json +1 -1
  100. package/dist/main.css +1 -1
  101. package/package.json +1 -1
@@ -6,96 +6,101 @@ 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
- 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.";
9
+ const DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL =
10
+ '$getKey($meta, "commentsPlaceholders." + $get(Type_Of_Legal_Problem).value, $meta.defaultCommentsPlaceholder)';
11
+ const DEFAULT_COMMENTS_LABEL_LEGAL = "Please briefly describe your legal issue in a few words:";
12
+ const DEFAULT_FINAL_HEADLINE_LEGAL = "Submit Your Case";
13
+ const DEFAULT_FINAL_HEADLINE_DYNAMIC_LEGAL =
14
+ '$getKey($meta, "finalHeadlines." + $get(Type_Of_Legal_Problem).value, $meta.defaultFinalHeadline)';
15
+ const DEFAULT_FINAL_SUBHEADLINE_LEGAL =
16
+ "You may benefit from speaking with a legal professional. Please verify your contact information.";
17
+ const DEFAULT_FINAL_SUBHEADLINE_DYNAMIC_LEGAL =
18
+ '$getKey($meta, "finalSubHeadlines." + $get(Type_Of_Legal_Problem).value, $meta.defaultFinalSubHeadline)';
19
+ const TCPA_LANGUAGE_LEGAL =
20
+ "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
21
  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',
22
+ "Auto and Car Accidents": "Injured in a Car Accident",
23
+ "Personal Injury": "Personal or Workplace Injury",
24
+ "DUI and DWI": "Involved in a DUI/DWI",
25
+ "Wills and Trusts": "Need a Will or Trust",
26
+ "Power of Attorney": "Update Power of Attorney",
27
+ "Social Security Disability and Insurance": "Interest in Disability Benefits",
23
28
  };
24
29
  const CROSS_SELL_OPTION_MAP_LEGAL = {
25
30
  // 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',
31
+ "Auto and Car Accidents": {
32
+ "Social Security Disability and Insurance": "Interest in Disability Benefits",
33
+ "Wills and Trusts": "Need a Will or Trust",
34
+ "Workers Compensation": "Workplace Injury",
35
+ "Power of Attorney": "Update Power of Attorney",
36
+ "Divorce and Separation": "Need a Divorce or Separation",
37
+ "Child Custody": "Need help with Child Custody",
33
38
  },
34
39
  "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
+ "DUI and DWI": "Involved in a DUI/DWI",
41
+ "Wills and Trusts": "Need a Will or Trust",
42
+ "Power of Attorney": "Update Power of Attorney",
43
+ "Divorce and Separation": "Need a Divorce or Separation",
44
+ "Child Custody": "Need help with Child Custody",
40
45
  // TODO add one more?
41
46
  },
42
47
  "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
+ "DUI and DWI": "Involved in a DUI/DWI",
49
+ "Wills and Trusts": "Need a Will or Trust",
50
+ "Power of Attorney": "Update Power of Attorney",
51
+ "Divorce and Separation": "Need a Divorce or Separation",
52
+ "Child Custody": "Need help with Child Custody",
48
53
  // TODO add one more?
49
54
  },
50
55
  "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',
56
+ "Personal Injury": "Personal or Workplace Injury",
57
+ "Wills and Trusts": "Need a Will or Trust",
58
+ "Social Security Disability and Insurance": "Interest in Disability Benefits",
59
+ "Power of Attorney": "Update Power of Attorney",
60
+ "Divorce and Separation": "Need a Divorce or Separation",
61
+ "Child Custody": "Need help with Child Custody",
57
62
  },
58
63
  "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',
64
+ "Auto and Car Accidents": "Injured in a Car Accident",
65
+ "Personal Injury": "Personal or Workplace Injury",
66
+ "DUI and DWI": "Involved in a DUI/DWI",
67
+ "Social Security Disability and Insurance": "Interest in Disability Benefits",
68
+ "Divorce and Separation": "Need a Divorce or Separation",
69
+ "Child Custody": "Need help with Child Custody",
65
70
  },
66
71
  "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',
72
+ "Auto and Car Accidents": "Injured in a Car Accident",
73
+ "Personal Injury": "Personal or Workplace Injury",
74
+ "DUI and DWI": "Involved in a DUI/DWI",
75
+ "Social Security Disability and Insurance": "Interest in Disability Benefits",
76
+ "Divorce and Separation": "Need a Divorce or Separation",
77
+ "Child Custody": "Need help with Child Custody",
73
78
  },
74
79
  "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',
80
+ "Auto and Car Accidents": "Injured in a Car Accident",
81
+ "Personal Injury": "Personal or Workplace Injury",
82
+ "DUI and DWI": "Involved in a DUI/DWI",
83
+ "Social Security Disability and Insurance": "Interest in Disability Benefits",
84
+ "Divorce and Separation": "Need a Divorce or Separation",
85
+ "Child Custody": "Need help with Child Custody",
81
86
  },
82
87
  "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',
88
+ "Auto and Car Accidents": "Injured in a Car Accident",
89
+ "DUI and DWI": "Involved in a DUI/DWI",
90
+ "Wills and Trusts": "Need a Will or Trust",
91
+ "Power of Attorney": "Update Power of Attorney",
92
+ "Divorce and Separation": "Need a Divorce or Separation",
93
+ "Child Custody": "Need help with Child Custody",
89
94
  },
90
95
  "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',
96
+ "Auto and Car Accidents": "Injured in a Car Accident",
97
+ "DUI and DWI": "Involved in a DUI/DWI",
98
+ "Wills and Trusts": "Need a Will or Trust",
99
+ "Power of Attorney": "Update Power of Attorney",
100
+ "Divorce and Separation": "Need a Divorce or Separation",
101
+ "Child Custody": "Need help with Child Custody",
97
102
  },
98
- '*': defaultLegalImprovementCrossSells,
103
+ "*": defaultLegalImprovementCrossSells,
99
104
  };
100
105
 
101
106
  // ------ Common Base Settings
@@ -104,32 +109,48 @@ const checkbox = (updates) => {
104
109
  if (updates.name && !updates.id) {
105
110
  updates.id = updates.name;
106
111
  }
107
- return merge({
108
- $formkit: 'checkbox',
109
- validation: 'required',
110
- validationMessages: {
111
- required: 'Field is required'
112
- }
113
- }, updates)
112
+ return merge(
113
+ {
114
+ $formkit: "checkbox",
115
+ validation: "required",
116
+ validationMessages: {
117
+ required: "Field is required",
118
+ },
119
+ },
120
+ updates
121
+ )
114
122
  };
115
123
 
116
124
  const sbsCheckbox = (updates) => {
117
- updates.legendClass = 'legend-left required';
118
- updates.fieldsetClass = '$reset side-by-side';
119
- updates.optionsClass = 't-pl-1';
120
- updates.innerClass = 't-flex t-items-center';
121
- updates.wrapperClass = 't-mb-3';
125
+ updates.legendClass = "legend-left required";
126
+ updates.fieldsetClass = "$reset side-by-side";
127
+ updates.optionsClass = "t-pl-1";
128
+ updates.innerClass = "t-flex t-items-center";
129
+ updates.wrapperClass = "t-mb-3";
122
130
  return checkbox(updates)
123
131
  };
124
132
 
125
133
  const col2Checkbox = (updates) => {
126
134
  if (!updates || !updates.legendClass) {
127
- updates.legendClass = 'required';
135
+ updates.legendClass = "required";
128
136
  }
129
- updates.fieldsetClass = '$reset';
130
- updates.optionsClass = 't-pl-8 md:t-pl-2 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2';
131
- updates.innerClass = 't-items-start';
132
- updates.wrapperClass = '$reset t-flex t-cursor-pointer t-mb-3';
137
+ updates.fieldsetClass = "$reset";
138
+ updates.optionsClass = "t-pl-8 md:t-pl-2 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2";
139
+ updates.innerClass = "t-items-start";
140
+ updates.wrapperClass = "$reset t-flex t-cursor-pointer t-mb-3";
141
+ return checkbox(updates)
142
+ };
143
+
144
+ const verticalCol2Checkbox = (updates) => {
145
+ if (!updates || !updates.legendClass) {
146
+ updates.legendClass = "required";
147
+ }
148
+ updates.fieldsetClass = "$reset t-flex t-justify-center";
149
+ updates.optionClass = "t-mx-5";
150
+ updates.optionsClass = "t-pl-2 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2";
151
+ updates.innerClass = "t-items-center";
152
+ updates.wrapperClass = "$reset t-flex t-cursor-pointer t-mb-3";
153
+ updates.messagesClass = "t-flex t-justify-center";
133
154
  return checkbox(updates)
134
155
  };
135
156
 
@@ -137,70 +158,120 @@ const radio = (updates) => {
137
158
  if (updates.name && !updates.id) {
138
159
  updates.id = updates.name;
139
160
  }
140
- return merge({
141
- $formkit: 'radio',
142
- validation: 'required',
143
- validationMessages: {
144
- required: 'Field is required'
161
+ return merge(
162
+ {
163
+ $formkit: "radio",
164
+ validation: "required",
165
+ validationMessages: {
166
+ required: "Field is required",
167
+ },
168
+ optionsClass: "t-pt-3 t-pl-1",
169
+ legendClass: "required",
145
170
  },
146
- optionsClass: 't-pt-3 t-pl-1',
147
- legendClass: 'required'
148
- }, updates)
171
+ updates
172
+ )
149
173
  };
150
174
 
151
175
  const col2Radio = (updates) => {
152
- updates.legendClass = 'required';
153
- updates.fieldsetClass = '$reset';
154
- updates.optionsClass = 't-pl-2 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2';
155
- updates.innerClass = 't-items-start';
156
- updates.wrapperClass = '$reset t-flex t-cursor-pointer t-mb-3';
176
+ updates.legendClass = "required";
177
+ updates.fieldsetClass = "$reset";
178
+ updates.optionsClass = "t-pl-2 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2";
179
+ updates.innerClass = "t-items-start";
180
+ updates.wrapperClass = "$reset t-flex t-cursor-pointer t-mb-3";
181
+ return radio(updates)
182
+ };
183
+
184
+ const col2RadioCenter = (updates) => {
185
+ updates.legendClass = "required t-w-[100%] t-text-center";
186
+ if (typeof updates.fieldsetClass === "undefined") {
187
+ updates.fieldsetClass = "$reset t-flex t-justify-center";
188
+ }
189
+ updates.optionsClass = "t-pl-4 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2";
190
+ updates.innerClass = "t-items-start";
191
+ updates.wrapperClass = "$reset t-flex t-cursor-pointer t-mb-3";
192
+ updates.optionClass = "t-pl-4 md:t-pl-8 md:t-min-w-[200px]";
193
+ updates.messagesClass = "t-flex t-justify-center";
194
+ updates.helpClass = "t-mt-0 t-mb-4 !t-text-sm t-text-center";
157
195
  return radio(updates)
158
196
  };
159
197
 
160
198
  const sbs2ColRadio = (updates) => {
161
- updates.legendClass = 'legend-left-flex md:t-max-w-[40%] required';
162
- updates.fieldsetClass = '$reset side-by-side-flex';
163
- updates.optionsClass = 'md:t-ml-4 md:t-mt-2 t-grid t-grid-cols-1 md:t-grid-cols-2-125';
164
- updates.innerClass = 't-flex t-items-start';
165
- updates.wrapperClass = '$reset t-flex t-cursor-pointer t-mb-3';
199
+ updates.legendClass = "legend-left-flex md:t-max-w-[40%] required";
200
+ updates.fieldsetClass = "$reset side-by-side-flex";
201
+ updates.optionsClass = "md:t-ml-4 md:t-mt-2 t-grid t-grid-cols-1 md:t-grid-cols-2-125";
202
+ updates.innerClass = "t-flex t-items-start";
203
+ updates.wrapperClass = "$reset t-flex t-cursor-pointer t-mb-3";
166
204
  return radio(updates)
167
205
  };
168
206
 
169
207
  const sbs2ItemRadio = (updates) => {
170
- updates.legendClass = 'legend-left t-pb-1 required';
171
- updates.fieldsetClass = '$reset side-by-side t-items-center';
172
- updates.optionsClass = 't-mt-1 t-grid t-grid-cols-1 md:t-grid-cols-2-125 t-items-center';
173
- updates.innerClass = 't-flex t-items-center';
174
- updates.optionClass = 't-pr-1';
208
+ updates.legendClass = "legend-left t-pb-1 required";
209
+ updates.fieldsetClass = "$reset side-by-side t-items-center";
210
+ updates.optionsClass = "t-mt-1 t-grid t-grid-cols-1 md:t-grid-cols-2-125 t-items-center";
211
+ updates.innerClass = "t-flex t-items-center";
212
+ updates.optionClass = "t-pr-1";
175
213
  return radio(updates)
176
214
  };
177
215
 
178
216
  const sbsYesNoRadio = (updates) => {
179
- updates.options = ['Yes', 'No'];
217
+ updates.options = ["Yes", "No"];
180
218
  return sbs2ItemRadio(updates)
181
219
  };
182
220
 
221
+ const verticalButtonRadio = (updates) => {
222
+ updates.legendClass = "legend-left";
223
+ updates.fieldsetClass = "$reset t-flex t-justify-center t-flex-col-reverse t-items-center";
224
+ if (typeof updates.optionsClass === "undefined") {
225
+ updates.optionsClass = "t-flex t-flex-col sm:t-flex-row t-justify-center t-my-3";
226
+ }
227
+ updates.optionClass = "radiobtn t-my-2 sm:t-my-0 t-mx-2 md:t-mx-5";
228
+ updates.wrapperClass = "$reset formkit-wrapper t-mb-0 t-flex t-items-center t-h-[100%]";
229
+ updates.labelClass = "t-font-semibold t-text-[#1e448f] t-w-[100%]";
230
+ updates.decoratorIcon = false;
231
+ updates.messagesClass = "t-flex t-justify-center";
232
+ updates.helpClass = "t-mt-2.5 !t-text-sm t-text-center";
233
+ return radio(updates)
234
+ };
235
+
236
+ const verticalYesNoRadio = (updates) => {
237
+ updates.options = ["Yes", "No"];
238
+ updates.optionsClass = "t-flex t-justify-center t-my-3";
239
+ return verticalButtonRadio(updates)
240
+ };
241
+
183
242
  const select = (updates) => {
184
243
  if (updates.name && !updates.id) {
185
244
  updates.id = updates.name;
186
245
  }
187
- return merge({
188
- $formkit: 'select',
189
- placeholder: "Please Select",
190
- validation: 'required',
191
- validationMessages: {
192
- required: 'Field is required'
246
+ return merge(
247
+ {
248
+ $formkit: "select",
249
+ placeholder: "Please Select",
250
+ validation: "required",
251
+ validationMessages: {
252
+ required: "Field is required",
253
+ },
254
+ inputClass: "t-bg-white",
255
+ labelClass: "required",
193
256
  },
194
- inputClass: 't-bg-white',
195
- labelClass: 'required'
196
- }, updates)
257
+ updates
258
+ )
197
259
  };
198
260
 
199
261
  const sbsSelect = (updates) => {
200
- updates.labelClass = 'required';
201
- updates.wrapperClass = 'side-by-side t-items-center';
202
- updates.innerClass = 'select-height-content';
203
- updates.helpClass = 't-mt-2.5 md:t-text-right md:t-mt-[-5px]';
262
+ updates.labelClass = "required";
263
+ updates.wrapperClass = "side-by-side t-items-center";
264
+ updates.innerClass = "select-height-content";
265
+ updates.helpClass = "t-mt-2.5 md:t-text-right md:t-mt-[-5px]";
266
+ return select(updates)
267
+ };
268
+
269
+ const verticalSelect = (updates) => {
270
+ updates.labelClass = "required";
271
+ updates.wrapperClass = "t-flex t-justify-center";
272
+ updates.messagesClass = "t-flex t-justify-center";
273
+ updates.inputClass = "t-min-w-[150px] t-bg-white";
274
+ updates.helpClass = "t-mt-2.5 t-text-center";
204
275
  return select(updates)
205
276
  };
206
277
 
@@ -208,26 +279,29 @@ const text = (updates) => {
208
279
  if (updates.name && !updates.id) {
209
280
  updates.id = updates.name;
210
281
  }
211
- return merge({
212
- $formkit: 'text',
213
- validation: 'required',
214
- validationMessages: {
215
- required: 'Field is required'
282
+ return merge(
283
+ {
284
+ $formkit: "text",
285
+ validation: "required",
286
+ validationMessages: {
287
+ required: "Field is required",
288
+ },
289
+ labelClass: "required",
216
290
  },
217
- labelClass: 'required'
218
- }, updates)
291
+ updates
292
+ )
219
293
  };
220
294
 
221
295
  const sbsText = (updates) => {
222
- updates.wrapperClass = 'side-by-side t-items-center';
296
+ updates.wrapperClass = "side-by-side t-items-center";
223
297
  return text(updates)
224
298
  };
225
299
 
226
300
  const verticalText = (updates) => {
227
- updates.wrapperClass = 't-flex t-justify-center';
228
- updates.messagesClass = 't-flex t-justify-center';
229
- updates.inputClass = 't-text-center';
230
- updates.helpClass = 't-mt-2.5 !t-text-sm t-text-center';
301
+ updates.wrapperClass = "t-flex t-justify-center";
302
+ updates.messagesClass = "t-flex t-justify-center";
303
+ updates.inputClass = "t-text-center";
304
+ updates.helpClass = "t-mt-2.5 !t-text-sm t-text-center";
231
305
  return text(updates)
232
306
  };
233
307
 
@@ -235,509 +309,758 @@ const textArea = (updates) => {
235
309
  if (updates.name && !updates.id) {
236
310
  updates.id = updates.name;
237
311
  }
238
- return merge({
239
- $formkit: 'textarea',
240
- rows: 5,
241
- maxlength: 500,
242
- validation: 'required',
243
- validationMessages: {
244
- required: 'Field is required'
312
+ return merge(
313
+ {
314
+ $formkit: "textarea",
315
+ rows: 5,
316
+ maxlength: 500,
317
+ validation: "required",
318
+ validationMessages: {
319
+ required: "Field is required",
320
+ },
321
+ innerClass: "t-max-w-xl",
322
+ labelClass: "required",
245
323
  },
246
- innerClass: 't-max-w-xl',
247
- labelClass: 'required'
248
- }, updates)
324
+ updates
325
+ )
249
326
  };
250
327
 
251
328
  const date = (updates) => {
252
329
  if (updates.name && !updates.id) {
253
330
  updates.id = updates.name;
254
331
  }
255
- return merge({
256
- $formkit: 'DatePicker',
257
- validation: 'required',
258
- validationMessages: {
259
- required: 'Field is required'
332
+ return merge(
333
+ {
334
+ $formkit: "DatePicker",
335
+ validation: "required",
336
+ validationMessages: {
337
+ required: "Field is required",
338
+ },
339
+ labelClass: "required t-block t-mb-3 t-font-semibold t-text-base formkit-invalid:t-text-red-500",
340
+ innerClass:
341
+ "t-border t-border-gray-400 formkit-invalid:t-border-red-500 t-rounded t-mb-1 focus-within:t-border-blue-500",
260
342
  },
261
- labelClass: 'required t-block t-mb-3 t-font-semibold t-text-base formkit-invalid:t-text-red-500',
262
- innerClass: 't-border t-border-gray-400 formkit-invalid:t-border-red-500 t-rounded t-mb-1 focus-within:t-border-blue-500'
263
- }, updates)
343
+ updates
344
+ )
264
345
  };
265
346
 
266
347
  const sbsDate = (updates) => {
267
- updates.wrapperClass = 'side-by-side t-items-center';
348
+ updates.wrapperClass = "side-by-side t-items-center";
268
349
  return date(updates)
269
350
  };
270
351
 
271
- const email = (scope) => sbsText({
272
- $formkit: 'email',
273
- name: scope ? scope + ':' + 'Email' : 'Email',
274
- label: 'Email Address:',
275
- placeholder: 'email@domain.com',
276
- autocomplete: 'email',
277
- 'data-tf-sensitive': 'false',
278
- validation: 'required|email',
279
- validationMessages: {
280
- required: 'Email is required',
281
- email: 'Invalid Email'
282
- }
283
- });
352
+ const verticalDate = (updates) => {
353
+ updates.wrapperClass = "t-flex t-justify-center";
354
+ updates.inputClass = "t-text-center";
355
+ updates.messagesClass = "t-flex t-justify-center";
356
+ return date(updates)
357
+ };
284
358
 
285
- const firstName = (scope) => sbsText({
286
- label: 'First Name:',
287
- placeholder: 'First',
288
- name: scope ? scope + ':' + 'First_Name' : 'First_Name',
289
- autocomplete: "given-name",
290
- validationMessages: {
291
- required: 'First Name is required'
292
- }
293
- });
359
+ const email = (scope, vertical, updates = {}) => {
360
+ const func = vertical ? verticalText : sbsText;
361
+ const label = vertical ? updates.label : "Email Address:";
362
+ return func({
363
+ $formkit: "email",
364
+ name: scope ? scope + ":" + "Email" : "Email",
365
+ label,
366
+ placeholder: "email@domain.com",
367
+ autocomplete: "email",
368
+ "data-tf-sensitive": "false",
369
+ validation: "required|email",
370
+ validationMessages: {
371
+ required: "Email is required",
372
+ email: "Invalid Email",
373
+ },
374
+ ...updates,
375
+ })
376
+ };
294
377
 
295
- const lastName = (scope) => sbsText({
296
- label: 'Last Name:',
297
- placeholder: 'Last',
298
- name: scope ? scope + ':' + 'Last_Name' : 'Last_Name',
299
- autocomplete: "family-name",
300
- validationMessages: {
301
- required: 'Last Name is required'
302
- }
303
- });
378
+ const firstName = (scope, vertical, updates = {}) => {
379
+ const func = vertical ? verticalText : sbsText;
380
+ const label = vertical ? updates.label : "First Name:";
381
+ return func({
382
+ label,
383
+ placeholder: "First",
384
+ name: scope ? scope + ":" + "First_Name" : "First_Name",
385
+ autocomplete: "given-name",
386
+ validationMessages: {
387
+ required: "First Name is required",
388
+ },
389
+ ...updates,
390
+ })
391
+ };
304
392
 
305
- const phone = (scope) => sbsText({
306
- $formkit: 'tel',
307
- name: scope ? scope + ':' + 'Primary_Phone' : 'Primary_Phone',
308
- label: 'Phone Number:',
309
- placeholder: '###-###-####',
310
- maxlength: 12,
311
- help: '10-digit phone number, hyphens optional',
312
- autocomplete: 'tel-national',
313
- 'data-tf-sensitive': 'false',
314
- validation: 'required|matches:/^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$/|valid_phone',
315
- validationMessages: {
316
- required: 'Field is required',
317
- matches: 'Invalid Phone Format, use ###-###-####',
318
- valid_phone: 'Invalid Phone Number'
319
- },
320
- helpClass: "t-mt-2.5 md:t-text-right md:t-mt-[-2px]"
321
- });
393
+ const lastName = (scope, vertical, updates = {}) => {
394
+ const func = vertical ? verticalText : sbsText;
395
+ const label = vertical ? updates.label : "Last Name:";
396
+ return func({
397
+ label,
398
+ placeholder: "Last",
399
+ name: scope ? scope + ":" + "Last_Name" : "Last_Name",
400
+ autocomplete: "family-name",
401
+ validationMessages: {
402
+ required: "Last Name is required",
403
+ },
404
+ ...updates,
405
+ })
406
+ };
322
407
 
408
+ const phone = (scope, vertical, updates = {}) => {
409
+ const func = vertical ? verticalText : sbsText;
410
+ const label = vertical ? updates.label : "Phone Number:";
411
+ return func({
412
+ $formkit: "tel",
413
+ name: scope ? scope + ":" + "Primary_Phone" : "Primary_Phone",
414
+ label,
415
+ placeholder: "###-###-####",
416
+ maxlength: 12,
417
+ help: "10-digit phone number, hyphens optional",
418
+ autocomplete: "tel-national",
419
+ "data-tf-sensitive": "false",
420
+ validation: "required|matches:/^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$/|valid_phone",
421
+ validationMessages: {
422
+ required: "Phone Number is required",
423
+ matches: "Invalid Phone Format, use ###-###-####",
424
+ valid_phone: "Invalid Phone Number",
425
+ },
426
+ helpClass: "t-mt-2.5 md:t-text-right md:t-mt-[-2px]",
427
+ ...updates,
428
+ })
429
+ };
323
430
 
324
431
  const zipcode = (scope, vertical, updates = {}) => {
325
432
  const func = vertical ? verticalText : sbsText;
326
- const label = vertical ? (updates.label) : 'Zip Code:';
327
- const help = vertical ? (updates.help ?? "We try to match you with local help") : null;
433
+ const label = vertical ? updates.label : "Zip Code:";
434
+ const help = vertical ? updates.help ?? "We try to match you with local help" : null;
328
435
  return func({
329
436
  label,
330
437
  help,
331
- placeholder: '#####',
332
- name: scope ? scope + ':' + 'Zip' : 'Zip',
438
+ placeholder: "#####",
439
+ name: scope ? scope + ":" + "Zip" : "Zip",
333
440
  maxlength: 5,
334
441
  inputmode: "numeric",
335
- autocomplete: 'postal-code',
336
- validation: 'required|matches:/^[0-9]{5}$/',
442
+ autocomplete: "postal-code",
443
+ validation: "required|matches:/^[0-9]{5}$/",
337
444
  validationMessages: {
338
- required: 'Zip Code is required',
339
- matches: 'Invalid Zip Code'
445
+ required: "Zip Code is required",
446
+ matches: "Invalid Zip Code",
340
447
  },
341
- ...updates
448
+ ...updates,
342
449
  })
343
450
  };
344
451
 
345
452
  const applicantAge = (scope, vertical, updates = {}) => {
346
453
  const func = vertical ? verticalText : sbsText;
347
- const label = vertical ? (updates.label) : 'Age of Applicant?';
348
- const value = vertical ? (updates.value ?? "50") : null;
349
- return func(merge({
350
- label,
351
- placeholder: 'Age between 18 and 65',
352
- name: scope ? scope + ':' + 'Applicant_Age' : 'Applicant_Age',
353
- value,
354
- maxlength: 2,
355
- inputmode: "numeric",
356
- validation: "required|min:18,max:65",
357
- validationMessages: {
358
- required: 'Applicant Age is required',
359
- min: 'Invalid Age - must be between 18 and 65',
360
- max: 'Invalid Age - must be between 18 and 65',
361
- },
362
- ...updates
363
- }))
454
+ const label = vertical ? updates.label : "Age of Applicant?";
455
+ const value = vertical ? updates.value ?? "50" : null;
456
+ return func(
457
+ merge({
458
+ label,
459
+ placeholder: "Age between 18 and 65",
460
+ name: scope ? scope + ":" + "Applicant_Age" : "Applicant_Age",
461
+ value,
462
+ maxlength: 2,
463
+ inputmode: "numeric",
464
+ validation: "required|min:18,max:65",
465
+ validationMessages: {
466
+ required: "Applicant Age is required",
467
+ min: "Invalid Age - must be between 18 and 65",
468
+ max: "Invalid Age - must be between 18 and 65",
469
+ },
470
+ ...updates,
471
+ })
472
+ )
364
473
  };
365
474
 
366
- const atFault = (scope) => sbsYesNoRadio({
367
- name: scope ? scope + ':' + 'At_Fault' : 'At_Fault',
368
- label: 'Were You at Fault?'
369
- });
475
+ const atFault = (scope, vertical, updates = {}) => {
476
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
477
+ const label = vertical ? updates.label : "Were You at Fault?";
478
+ return func(
479
+ merge(
480
+ {
481
+ label,
482
+ name: scope ? scope + ":" + "At_Fault" : "At_Fault",
483
+ },
484
+ updates
485
+ )
486
+ )
487
+ };
370
488
 
371
- const bankruptcyCrossSell = () => sbsCheckbox({
372
- label: "I'd also like a consult for bankruptcy or debt elimination (optional)",
373
- help: "Note: you will be contacted separately by a bankruptcy/debt expert",
374
- name: 'CrossSell_Bankruptcy',
375
- id: 'CrossSell_Bankruptcy',
376
- if: '$getVal($get(form), "Type_Of_Legal_Problem") != "Bankruptcy" && ($getVal($get(form), "Degree_Of_Interest") == "Absolutely Can\'t Afford" || $getVal($get(form), "Degree_Of_Interest") == "Maybe" || $getVal($get(form), "Degree_Of_Interest") == "Probably")',
377
- validation: null,
378
- helpClass: "!t-text-sm"
379
- });
489
+ const bankruptcyCrossSell = (scope) =>
490
+ sbsCheckbox({
491
+ label: "I'd also like a consult for bankruptcy or debt elimination (optional)",
492
+ help: "Note: you will be contacted separately by a bankruptcy/debt expert",
493
+ name: scope ? scope + ":CrossSell_Bankruptcy" : "CrossSell_Bankruptcy",
494
+ id: scope ? scope + ":CrossSell_Bankruptcy" : "CrossSell_Bankruptcy",
495
+ if: '$getVal($get(form), "Type_Of_Legal_Problem") != "Bankruptcy" && ($getVal($get(form), "Degree_Of_Interest") == "Absolutely Can\'t Afford" || $getVal($get(form), "Degree_Of_Interest") == "Maybe" || $getVal($get(form), "Degree_Of_Interest") == "Probably")',
496
+ validation: null,
497
+ helpClass: "!t-text-sm",
498
+ });
499
+
500
+ const bloodContentAlcoholTest = (scope, vertical, updates = {}) => {
501
+ const func = vertical ? verticalSelect : sbsSelect;
502
+ const label = vertical ? updates.label : "Blood Alcohol Content Measured by Test:";
503
+ return func(
504
+ merge(
505
+ {
506
+ label,
507
+ name: scope ? scope + ":" + "Blood_Alcohol_Content_Test" : "Blood_Alcohol_Content_Test",
508
+ options: [
509
+ "No Test",
510
+ "0.00% - 0.04%",
511
+ "0.05% - 0.08%",
512
+ "0.09% - 0.12%",
513
+ "0.13% - 0.16%",
514
+ "0.17% - 0.20%",
515
+ "More than 0.20%",
516
+ "Don't know",
517
+ ],
518
+ },
519
+ updates
520
+ )
521
+ )
522
+ };
380
523
 
381
- const bloodContentAlcoholTest = (scope) => sbsSelect({
382
- name: scope ? scope + ':' + 'Blood_Alcohol_Content_Test' : 'Blood_Alcohol_Content_Test',
383
- label: 'Blood Alcohol Content Measured by Test:',
384
- options: [
385
- "No Test",
386
- "0.00% - 0.04%",
387
- "0.05% - 0.08%",
388
- "0.09% - 0.12%",
389
- "0.13% - 0.16%",
390
- "0.17% - 0.20%",
391
- "More than 0.20%",
392
- "Don't know"
393
- ]
394
- });
524
+ const causeOfInjury = (scope, vertical, updates = {}) => {
525
+ const func = vertical ? col2RadioCenter : sbsSelect;
526
+ const label = vertical ? updates.label : "Cause of Injury:";
527
+ return func(
528
+ merge(
529
+ {
530
+ label,
531
+ name: scope ? scope + ":" + "Cause_Of_Injury" : "Cause_Of_Injury",
532
+ options: [
533
+ "Traumatic Physical Injury (Accident)",
534
+ "Repeated Trauma Injury",
535
+ "Mental Injury",
536
+ "Occupational Disease",
537
+ "Not Sure",
538
+ ],
539
+ },
540
+ updates
541
+ )
542
+ )
543
+ };
395
544
 
396
- const causeOfInjury = (scope) => sbsSelect({
397
- name: scope ? scope + ':' + 'Cause_Of_Injury' : 'Cause_Of_Injury',
398
- label: 'Cause of Injury:',
399
- options: [
400
- "Traumatic Physical Injury (Accident)",
401
- "Repeated Trauma Injury",
402
- "Mental Injury",
403
- "Occupational Disease",
404
- "Not Sure"
405
- ]
406
- });
545
+ const childHome = (scope, vertical, updates = {}) => {
546
+ const func = vertical ? col2RadioCenter : sbsSelect;
547
+ const label = vertical ? updates.label : "With Whom Do the Children Currently Live?";
548
+ return func(
549
+ merge(
550
+ {
551
+ label,
552
+ name: scope ? scope + ":" + "Child_Home" : "Child_Home",
553
+ options: ["Mother", "Father", "Grandparents", "Other"],
554
+ },
555
+ updates
556
+ )
557
+ )
558
+ };
407
559
 
408
- const childHome = (scope) => sbsSelect({
409
- name: scope ? scope + ':' + 'Child_Home' : 'Child_Home',
410
- label: 'With Whom Do the Children Currently Live?',
411
- options: [
412
- 'Mother',
413
- 'Father',
414
- 'Grandparents',
415
- 'Other'
416
- ]
417
- });
560
+ const childPrimaryCaregiver = (scope, vertical, updates = {}) => {
561
+ const func = vertical ? verticalButtonRadio : sbsSelect;
562
+ const label = vertical ? updates.label : "Who is the Primary Caregiver?";
563
+ return func(
564
+ merge(
565
+ {
566
+ label,
567
+ name: scope ? scope + ":" + "Child_Primary_Caregiver" : "Child_Primary_Caregiver",
568
+ options: ["Mother", "Father", "Other"],
569
+ },
570
+ updates
571
+ )
572
+ )
573
+ };
418
574
 
419
- const childPrimaryCaregiver = (scope) => sbsSelect({
420
- name: scope ? scope + ':' + 'Child_Primary_Caregiver' : 'Child_Primary_Caregiver',
421
- label: 'Who is the Primary Caregiver?',
422
- options: [
423
- 'Mother',
424
- 'Father',
425
- 'Other'
426
- ]
427
- });
575
+ const childRelationship = (scope, vertical, updates = {}) => {
576
+ const func = vertical ? col2RadioCenter : sbsSelect;
577
+ const label = vertical ? updates.label : "Your Relationship to Child(ren):";
578
+ return func(
579
+ merge(
580
+ {
581
+ label,
582
+ name: scope ? scope + ":" + "Child_Relationship" : "Child_Relationship",
583
+ options: ["Father", "Mother", "Grandparent", "Aunt/Uncle", "Other"],
584
+ },
585
+ updates
586
+ )
587
+ )
588
+ };
428
589
 
429
- const childRelationship = (scope) => sbsSelect({
430
- name: scope ? scope + ':' + 'Child_Relationship' : 'Child_Relationship',
431
- label: 'Your Relationship to Child(ren):',
432
- options: [
433
- 'Father',
434
- 'Mother',
435
- 'Grandparent',
436
- 'Aunt/Uncle',
437
- 'Other'
438
- ]
439
- });
590
+ const claimStatus = (scope, vertical, updates = {}) => {
591
+ const func = vertical ? col2RadioCenter : sbsSelect;
592
+ const label = vertical ? updates.label : "Status of Claim:";
593
+ return func(
594
+ merge(
595
+ {
596
+ label,
597
+ name: scope ? scope + ":" + "Claim_Status" : "Claim_Status",
598
+ options: ["No action taken yet", "Demand for compensation made", "Lawsuit filed", "Other"],
599
+ },
600
+ updates
601
+ )
602
+ )
603
+ };
440
604
 
441
- const claimStatus = (scope) => sbsSelect({
442
- name: scope ? scope + ':' + 'Claim_Status' : 'Claim_Status',
443
- label: "Status of Claim:",
444
- options: [
445
- "No action taken yet",
446
- "Demand for compensation made",
447
- "Lawsuit filed",
448
- "Other"
449
- ]
450
- });
605
+ // TODO: vertical not supported yet
606
+ const comments = (scope, vertical, updates) =>
607
+ textArea(
608
+ merge(
609
+ {
610
+ name: scope ? scope + ":" + "Comments" : "Comments",
611
+ label: "Please briefly describe your situation in a few words:",
612
+ placeholder:
613
+ 'For Example: "I would like help with child support payments" or "I need help with visitation rights"',
614
+ },
615
+ updates
616
+ )
617
+ );
451
618
 
452
- const comments = (updates, scope) => textArea(
453
- merge({
454
- name: scope ? scope + ':' + 'Comments' : 'Comments',
455
- label: 'Please briefly describe your situation in a few words:',
456
- placeholder: 'For Example: "I would like help with child support payments" or "I need help with visitation rights"'
457
- }, updates)
458
- );
459
-
460
- const contractsTOLPDisplay = (updates) => col2Radio(merge({
461
- name: 'Type_Of_Legal_Problem_Display',
462
- label: 'Select The Contract Issue:',
463
- options: [
464
- 'Contract Creation',
465
- 'Contract Enforcement',
466
- 'Contract Cancellation',
467
- 'Contract Fraud',
468
- 'Breach of Contract',
469
- 'Other Contract Issues'
470
- ]
471
- }, updates));
472
-
473
- const degreeOfInterest = (scope, help) => sbsSelect({
474
- name: scope ? scope + ':' + 'Degree_Of_Interest' : 'Degree_Of_Interest',
475
- id: scope ? scope + ':' + 'Degree_Of_Interest' : 'Degree_Of_Interest',
476
- label: 'How Likely Are You to Pay if Your Issue Could be Resolved?',
477
- help: help,
478
- options: [
479
- 'Definitely',
480
- 'Probably',
481
- 'Maybe',
482
- "Absolutely Can't Afford"
483
- ]
484
- });
619
+ const contractsTOLPDisplay = (scope, vertical, updates = {}) => {
620
+ const func = vertical ? col2RadioCenter : col2Radio;
621
+ const label = vertical ? updates.label : "Select The Contract Issue:";
622
+ return func(
623
+ merge(
624
+ {
625
+ label,
626
+ name: scope ? scope + ":" + "Type_Of_Legal_Problem_Display" : "Type_Of_Legal_Problem_Display",
627
+ options: [
628
+ "Contract Creation",
629
+ "Contract Enforcement",
630
+ "Contract Cancellation",
631
+ "Contract Fraud",
632
+ "Breach of Contract",
633
+ "Other Contract Issues",
634
+ ],
635
+ },
636
+ updates
637
+ )
638
+ )
639
+ };
485
640
 
486
- const degreeOfInterestHelp = (scope) => degreeOfInterest(scope, 'No payment necessary to speak with lawyers.');
641
+ const degreeOfInterest = (scope, vertical, updates = {}) => {
642
+ const func = vertical ? col2RadioCenter : sbsSelect;
643
+ const label = vertical ? updates.label : "How Likely Are You to Pay if Your Issue Could be Resolved?";
644
+ const help = vertical ? updates.help : "No payment necessary to speak with lawyers.";
645
+ return func(
646
+ merge(
647
+ {
648
+ name: scope ? scope + ":" + "Degree_Of_Interest" : "Degree_Of_Interest",
649
+ id: scope ? scope + ":" + "Degree_Of_Interest" : "Degree_Of_Interest",
650
+ label,
651
+ help,
652
+ options: ["Definitely", "Probably", "Maybe", "Absolutely Can't Afford"],
653
+ },
654
+ updates
655
+ )
656
+ )
657
+ };
487
658
 
488
- const disabilityConditionStopWork = (scope) => sbsYesNoRadio({
489
- name: scope ? scope + ':' + 'Disability_Condition_Stop_Work' : 'Disability_Condition_Stop_Work',
490
- label: 'Do You Expect To Be Out Of Work For At Least a Year Due To Your Health?'
491
- });
659
+ const degreeOfInterestHelp = (scope, vertical, updates = {}) =>
660
+ degreeOfInterest(scope, vertical, merge(updates, { help: "No payment necessary to speak with lawyers." }));
492
661
 
493
- const disabilityWorkHistory = (scope) => sbsYesNoRadio({
494
- name: scope ? scope + ':' + 'Disability_Work_History' : 'Disability_Work_History',
495
- label: 'Have You Had a Full-Time Job Within the Past 5 Years?'
496
- });
662
+ const disabilityConditionStopWork = (scope, vertical, updates = {}) => {
663
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
664
+ const label = vertical
665
+ ? updates.label
666
+ : "Do You Expect To Be Out Of Work For At Least a Year Due To Your Health?";
667
+ return func(
668
+ merge(
669
+ {
670
+ name: scope ? scope + ":" + "Disability_Condition_Stop_Work" : "Disability_Condition_Stop_Work",
671
+ label,
672
+ },
673
+ updates
674
+ )
675
+ )
676
+ };
497
677
 
498
- const doctorTreatment = (scope) => sbsYesNoRadio({
499
- name: scope ? scope + ':' + 'Doctor_Treatment' : 'Doctor_Treatment',
500
- label: 'Have You Recently Been Treated by a Doctor, Hospital or Clinic?',
501
- });
678
+ const disabilityWorkHistory = (scope, vertical, updates = {}) => {
679
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
680
+ const label = vertical ? updates.label : "Have You Had a Full-Time Job Within the Past 5 Years?";
681
+ return func(
682
+ merge(
683
+ {
684
+ name: scope ? scope + ":" + "Disability_Work_History" : "Disability_Work_History",
685
+ label,
686
+ },
687
+ updates
688
+ )
689
+ )
690
+ };
502
691
 
503
- const estateLegalServicesNeeded = (scope) => sbsSelect({
504
- name: scope ? scope + ':' + 'Estate_Legal_Services_Needed' : 'Estate_Legal_Services_Needed',
505
- label: "Legal Services Needed for Your Estate:",
506
- options: [
507
- "Charitable Giving",
508
- "Contested Wills",
509
- "Drafting Wills or Trust",
510
- "Estate Administration",
511
- "Asset Protection",
512
- "Other"
513
- ]
514
- });
692
+ const doctorTreatment = (scope, vertical, updates = {}) => {
693
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
694
+ const label = vertical ? updates.label : "Have You Recently Been Treated by a Doctor, Hospital or Clinic?";
695
+ return func(
696
+ merge(
697
+ {
698
+ name: scope ? scope + ":" + "Doctor_Treatment" : "Doctor_Treatment",
699
+ label,
700
+ },
701
+ updates
702
+ )
703
+ )
704
+ };
515
705
 
516
- const haveAttorney = (scope) => sbsYesNoRadio({
517
- name: scope ? scope + ':' + 'Have_Attorney' : 'Have_Attorney',
518
- label: 'Already Working with An Attorney?'
519
- });
706
+ const estateLegalServicesNeeded = (scope, vertical, updates = {}) => {
707
+ const func = vertical ? col2RadioCenter : sbsSelect;
708
+ const label = vertical ? updates.label : "Legal Services Needed for Your Estate:";
709
+ return func(
710
+ merge(
711
+ {
712
+ name: scope ? scope + ":" + "Estate_Legal_Services_Needed" : "Estate_Legal_Services_Needed",
713
+ label,
714
+ options: [
715
+ "Charitable Giving",
716
+ "Contested Wills",
717
+ "Drafting Wills or Trust",
718
+ "Estate Administration",
719
+ "Asset Protection",
720
+ "Other",
721
+ ],
722
+ },
723
+ updates
724
+ )
725
+ )
726
+ };
520
727
 
521
- const haveChildren = (scope) => sbsYesNoRadio({
522
- name: scope ? scope + ':' + 'Have_Children' : 'Have_Children',
523
- label: 'Do You Have Children?'
524
- });
728
+ const haveAttorney = (scope, vertical, updates = {}) => {
729
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
730
+ const label = vertical ? updates.label : "Already Working with An Attorney?";
731
+ return func(
732
+ merge(
733
+ {
734
+ label,
735
+ name: scope ? scope + ":" + "Have_Attorney" : "Have_Attorney",
736
+ },
737
+ updates
738
+ )
739
+ )
740
+ };
525
741
 
526
- const incidentDate = (scope) => sbsDate({
527
- name: scope ? scope + ':' + 'Incident_Date' : 'Incident_Date',
528
- label: 'Date of Incident:',
529
- });
742
+ const haveChildren = (scope, vertical, updates = {}) => {
743
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
744
+ const label = vertical ? updates.label : "Do You Have Children?";
745
+ return func(
746
+ merge(
747
+ {
748
+ name: scope ? scope + ":" + "Have_Children" : "Have_Children",
749
+ label,
750
+ },
751
+ updates
752
+ )
753
+ )
754
+ };
530
755
 
531
- const lawyerPaymentMethod = (scope) => sbsSelect({
532
- name: scope ? scope + ':' + 'Lawyer_Payment_Method' : 'Lawyer_Payment_Method',
533
- label: 'How Will You Pay for Legal Fees if You Hire a Lawyer?',
534
- help: 'No payment necessary to speak with lawyers.',
535
- options: [
536
- 'Cash',
537
- 'Check',
538
- 'Credit Card',
539
- 'Friend',
540
- 'Family',
541
- 'Other'
542
- ]
543
- });
756
+ const incidentDate = (scope, vertical, updates = {}) => {
757
+ const func = vertical ? verticalDate : sbsDate;
758
+ const label = vertical ? updates.label : "Date of Incident:";
759
+ return func(
760
+ merge(
761
+ {
762
+ label,
763
+ name: scope ? scope + ":" + "Incident_Date" : "Incident_Date",
764
+ },
765
+ updates
766
+ )
767
+ )
768
+ };
544
769
 
545
- const legalCrossSells$1 = () => col2Checkbox({
546
- id: 'Legal_CrossSells',
547
- name: 'Legal_CrossSells',
548
- help: 'Just hit "Next" if none apply',
549
- helpClass: 't-text-center !t-text-sm',
550
- validation: null,
551
- options: '$getCrossSellOptions($get(form), $getVal($get(form), "Type_Of_Legal_Problem"))',
552
- });
770
+ const lawyerPaymentMethod = (scope, vertical, updates = {}) => {
771
+ const func = vertical ? col2RadioCenter : sbsSelect;
772
+ const label = vertical ? updates.label : "How Will You Pay for Legal Fees if You Hire a Lawyer?";
773
+ const help = vertical ? updates.help : "No payment necessary to start a consultation.";
774
+ const options = vertical
775
+ ? {
776
+ Cash: "Cash",
777
+ "Credit Card": "Credit Card",
778
+ Family: "Family or Friend",
779
+ Other: "Other",
780
+ }
781
+ : ["Cash", "Check", "Credit Card", "Friend", "Family", "Other"];
782
+ return func(
783
+ merge(
784
+ {
785
+ label,
786
+ help,
787
+ name: scope ? scope + ":" + "Lawyer_Payment_Method" : "Lawyer_Payment_Method",
788
+ options,
789
+ fieldsetClass: vertical ? "$reset t-flex t-flex-col t-items-center" : undefined,
790
+ },
791
+ updates
792
+ )
793
+ )
794
+ };
553
795
 
554
- const maritalStatus = (scope) => sbsSelect({
555
- name: scope ? scope + ':' + 'Marital_Status' : 'Marital_Status',
556
- label: 'Marital Status:',
557
- options: [
558
- 'Unmarried, Living Together',
559
- 'Unmarried, Do Not Live Together',
560
- 'Married, Living Together',
561
- 'Separated',
562
- 'Divorced',
563
- 'Other'
564
- ]
565
- });
796
+ const legalCrossSells$1 = () =>
797
+ col2Checkbox({
798
+ id: "Legal_CrossSells",
799
+ name: "Legal_CrossSells",
800
+ help: 'Just hit "Next" if none apply',
801
+ helpClass: "t-text-center !t-text-sm",
802
+ validation: null,
803
+ options: '$getCrossSellOptions($get(form), $getVal($get(form), "Type_Of_Legal_Problem"))',
804
+ });
805
+
806
+ const maritalStatus = (scope, vertical, updates = {}) => {
807
+ const func = vertical ? col2RadioCenter : sbsSelect;
808
+ const label = vertical ? updates.label : "Marital Status:";
809
+ return func(
810
+ merge(
811
+ {
812
+ label,
813
+ name: scope ? scope + ":" + "Marital_Status" : "Marital_Status",
814
+ options: [
815
+ "Unmarried, Living Together",
816
+ "Unmarried, Do Not Live Together",
817
+ "Married, Living Together",
818
+ "Separated",
819
+ "Divorced",
820
+ "Other",
821
+ ],
822
+ },
823
+ updates
824
+ )
825
+ )
826
+ };
566
827
 
567
- const pendingCharges = (scope) => sbsYesNoRadio({
568
- name: scope ? scope + ':' + 'Pending_Charges' : 'Pending_Charges',
569
- label: 'Do you currently have any pending charges?'
570
- });
828
+ // XXX HERE
571
829
 
572
- const primaryInjury = (scope) => sbs2ColRadio({
573
- name: scope ? scope + ':' + 'Primary_Injury' : 'Primary_Injury',
574
- label: 'Primary Injury:',
575
- options: [
576
- "Anxiety",
577
- "Back or Neck Pain",
578
- "Broken Bones",
579
- "Cuts and Bruises",
580
- "Headaches",
581
- "Memory Loss",
582
- "Loss of Limb",
583
- "Not Sure or Other"
584
- ]
585
- });
830
+ const pendingCharges = (scope, vertical, updates = {}) => {
831
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
832
+ const label = vertical ? updates.label : "Do you currently have any pending charges?";
833
+ return func(
834
+ merge(
835
+ {
836
+ name: scope ? scope + ":" + "Pending_Charges" : "Pending_Charges",
837
+ label,
838
+ },
839
+ updates
840
+ )
841
+ )
842
+ };
586
843
 
587
- const priorAlcoholOffenses = (scope) => sbsYesNoRadio({
588
- name: scope ? scope + ':' + 'Prior_Alcohol_Offenses' : 'Prior_Alcohol_Offenses',
589
- label: 'Any Prior Alcohol Related Offenses?'
590
- });
844
+ const primaryInjury = (scope, vertical, updates = {}) => {
845
+ const func = vertical ? col2RadioCenter : sbs2ColRadio;
846
+ const label = vertical ? updates.label : "Primary Injury:";
847
+ return func(
848
+ merge(
849
+ {
850
+ label,
851
+ name: scope ? scope + ":" + "Primary_Injury" : "Primary_Injury",
852
+ options: [
853
+ "Anxiety",
854
+ "Back or Neck Pain",
855
+ "Broken Bones",
856
+ "Cuts and Bruises",
857
+ "Headaches",
858
+ "Memory Loss",
859
+ "Loss of Limb",
860
+ "Not Sure or Other",
861
+ ],
862
+ },
863
+ updates
864
+ )
865
+ )
866
+ };
591
867
 
592
- const policeReportFiled = (scope) => sbsYesNoRadio({
593
- name: scope ? scope + ':' + 'Police_Report_Filed' : 'Police_Report_Filed',
594
- label: 'Was a Police Report Filed?'
595
- });
868
+ const priorAlcoholOffenses = (scope, vertical, updates = {}) => {
869
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
870
+ const label = vertical ? updates.label : "Any Prior Alcohol Related Offenses?";
871
+ return func(
872
+ merge(
873
+ {
874
+ name: scope ? scope + ":" + "Prior_Alcohol_Offenses" : "Prior_Alcohol_Offenses",
875
+ label,
876
+ },
877
+ updates
878
+ )
879
+ )
880
+ };
596
881
 
597
- const roleInMatterProbate = (scope) => sbsSelect({
598
- name: scope ? scope + ':' + 'Role_In_Matter_Probate' : 'Role_In_Matter_Probate',
599
- label: "What Is Your Role in this Matter?",
600
- options: [
601
- "Preparing My Will",
602
- "Executor",
603
- "Heir",
604
- "Other"
605
- ]
606
- });
882
+ const policeReportFiled = (scope, vertical, updates = {}) => {
883
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
884
+ const label = vertical ? updates.label : "Was a Police Report Filed?";
885
+ return func(
886
+ merge(
887
+ {
888
+ name: scope ? scope + ":" + "Police_Report_Filed" : "Police_Report_Filed",
889
+ label,
890
+ },
891
+ updates
892
+ )
893
+ )
894
+ };
607
895
 
608
- const socialSecurityDisabilityReceivingBenefits = (scope) => sbsYesNoRadio({
609
- name: scope ? scope + ':' + 'Social_Security_Disability_Receiving_Benefits' : 'Social_Security_Disability_Receiving_Benefits',
610
- label: 'Are You Currently Receiving Social Security Disability Benefits?'
611
- });
896
+ const roleInMatterProbate = (scope, vertical, updates = {}) => {
897
+ const func = vertical ? col2RadioCenter : sbsSelect;
898
+ const label = vertical ? updates.label : "What is Your Role in this Matter?";
899
+ return func(
900
+ merge(
901
+ {
902
+ label,
903
+ name: scope ? scope + ":" + "Role_In_Matter_Probate" : "Role_In_Matter_Probate",
904
+ options: ["Preparing My Will", "Executor", "Heir", "Other"],
905
+ },
906
+ updates
907
+ )
908
+ )
909
+ };
910
+
911
+ const socialSecurityDisabilityReceivingBenefits = (scope, vertical, updates = {}) => {
912
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
913
+ const label = vertical ? updates.label : "Are You Currently Receiving Social Security Disability Benefits?";
914
+ return func(
915
+ merge(
916
+ {
917
+ name: scope
918
+ ? scope + ":" + "Social_Security_Disability_Receiving_Benefits"
919
+ : "Social_Security_Disability_Receiving_Benefits",
920
+ label,
921
+ },
922
+ updates
923
+ )
924
+ )
925
+ };
612
926
 
613
927
  const TCPAConsent = (scope) => ({
614
- $formkit: 'checkbox',
615
- label: '$meta.tcpaLanguage',
616
- name: scope ? scope + ':' + 'TCPA_Opt_In' : 'TCPA_Opt_In',
617
- 'data-tf-sensitive': 'false',
618
- validation: 'required|accepted',
928
+ $formkit: "checkbox",
929
+ label: "$meta.tcpaLanguage",
930
+ // Necessary to get links to work in the tcpa language
931
+ __raw__sectionsSchema: {
932
+ label: { attrs: { innerHTML: "$label" } },
933
+ },
934
+ name: scope ? scope + ":" + "TCPA_Opt_In" : "TCPA_Opt_In",
935
+ "data-tf-sensitive": "false",
936
+ validation: "required|accepted",
619
937
  validationMessages: {
620
- required: 'Consent is required',
621
- accepted: 'Consent is required'
938
+ required: "Consent is required",
939
+ accepted: "Consent is required",
622
940
  },
623
941
  classes: {
624
- label: "t-text-xs t-text-slate-500 t-font-normal"
625
- }
942
+ label: "t-text-xs t-text-slate-500 t-font-normal",
943
+ },
626
944
  });
627
945
 
628
- const typeOfAlcoholTest = (scope) => sbsSelect({
629
- name: scope ? scope + ':' + 'Type_Of_Alcohol_Test' : 'Type_Of_Alcohol_Test',
630
- label: 'Type of Alcohol Test Performed?',
631
- options: [
632
- "No Test",
633
- "Refused Test",
634
- "Breath Test",
635
- "Blood Test",
636
- "Urine Test",
637
- "Don't Know"
638
- ]
639
- });
946
+ const typeOfAlcoholTest = (scope, vertical, updates = {}) => {
947
+ const func = vertical ? col2RadioCenter : sbsSelect;
948
+ const label = vertical ? updates.label : "Type of Alcohol Test Performed?";
949
+ return func(
950
+ merge(
951
+ {
952
+ label,
953
+ name: scope ? scope + ":" + "Type_Of_Alcohol_Test" : "Type_Of_Alcohol_Test",
954
+ options: ["No Test", "Refused Test", "Breath Test", "Blood Test", "Urine Test", "Don't Know"],
955
+ },
956
+ updates
957
+ )
958
+ )
959
+ };
640
960
 
641
- const typeOfAssets = (scope) => col2Checkbox({
642
- name: scope ? scope + ':' + 'Type_Of_Assets' : 'Type_Of_Assets',
643
- label: 'Type of Assets:',
644
- options: [
645
- "Business Interests",
646
- "Cash",
647
- "Life Insurance Policies",
648
- "Pensions/Retirement",
649
- "Personal Possessions",
650
- "Property",
651
- "Stock/Bonds"
652
- ]
653
- });
961
+ const typeOfAssets = (scope, vertical, updates = {}) => {
962
+ const func = vertical ? verticalCol2Checkbox : col2Checkbox;
963
+ const label = vertical ? updates.label : "Type of Assets:";
964
+ return func(
965
+ merge(
966
+ {
967
+ label,
968
+ name: scope ? scope + ":" + "Type_Of_Assets" : "Type_Of_Assets",
969
+ options: [
970
+ "Business Interests",
971
+ "Cash",
972
+ "Life Insurance Policies",
973
+ "Pensions/Retirement",
974
+ "Personal Possessions",
975
+ "Property",
976
+ "Stock/Bonds",
977
+ ],
978
+ },
979
+ updates
980
+ )
981
+ )
982
+ };
654
983
 
655
- const valueOfAssets = (scope) => sbsSelect({
656
- name: scope ? scope + ':' + 'Value_Of_Assets' : 'Value_Of_Assets',
657
- label: 'Value of Your Assets?',
658
- options: [
659
- "Less than 50K",
660
- "50K to 100K",
661
- "100K to 250K",
662
- "250K to 500K",
663
- "500K to 1M",
664
- "More than 1M"
665
- ]
666
- });
984
+ const valueOfAssets = (scope, vertical, updates = {}) => {
985
+ const func = vertical ? col2RadioCenter : sbsSelect;
986
+ const label = vertical ? updates.label : "Value of Your Assets?";
987
+ return func(
988
+ merge(
989
+ {
990
+ label,
991
+ name: scope ? scope + ":" + "Value_Of_Assets" : "Value_Of_Assets",
992
+ options: ["Less than 50K", "50K to 100K", "100K to 250K", "250K to 500K", "500K to 1M", "More than 1M"],
993
+ },
994
+ updates
995
+ )
996
+ )
997
+ };
667
998
 
668
- // ------ Question Groups
999
+ // ------ Question Groups - TODO: move these go separate file groups.js
669
1000
 
670
1001
  // NOTE: name must be unique within a form!
671
1002
  const group = (name, updates) => {
672
- return merge({
673
- $cmp: 'FormKit',
674
- props: {
675
- type: 'group',
676
- key: name,
677
- id: name,
678
- name: name
679
- }
680
- }, updates)
1003
+ return merge(
1004
+ {
1005
+ $cmp: "FormKit",
1006
+ props: {
1007
+ type: "group",
1008
+ key: name,
1009
+ id: name,
1010
+ name: name,
1011
+ },
1012
+ },
1013
+ updates
1014
+ )
681
1015
  };
682
1016
 
683
- const AutoAndCarAccidentsQuestions = (condition, scope) => group(
684
- 'AutoAndCarAccidentsQuestions',
685
- {
686
- if: (condition || '$get(Type_Of_Legal_Problem).value == "Auto and Car Accidents"'),
1017
+ const AutoAndCarAccidentsQuestions = (condition, scope) =>
1018
+ group("AutoAndCarAccidentsQuestions", {
1019
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Auto and Car Accidents"',
687
1020
  children: [
688
1021
  haveAttorney(scope),
689
1022
  incidentDate(scope),
690
1023
  atFault(scope),
691
1024
  primaryInjury(scope),
692
1025
  doctorTreatment(scope),
693
- policeReportFiled(scope)
694
- ]
695
- }
696
- );
1026
+ policeReportFiled(scope),
1027
+ ],
1028
+ });
697
1029
 
698
- const ContractsQuestions = () => group(
699
- 'ContractsQuestions',
700
- {
701
- children: [
702
- haveAttorney(),
703
- degreeOfInterestHelp()
704
- ]
705
- }
706
- );
1030
+ const ContractsQuestions = (condition, scope) =>
1031
+ group("ContractsQuestions", {
1032
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Contracts"',
1033
+ children: [haveAttorney(scope), degreeOfInterestHelp(scope)],
1034
+ });
707
1035
 
708
- const ChildCustodyQuestions = (condition, scope) => group(
709
- 'ChildCustodyQuestions',
710
- {
711
- if: (condition || '$get(Type_Of_Legal_Problem).value == "Child Custody"'),
1036
+ const ChildCustodyQuestions = (condition, scope) =>
1037
+ group("ChildCustodyQuestions", {
1038
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Child Custody"',
712
1039
  children: [
713
1040
  haveAttorney(scope),
714
1041
  childRelationship(scope),
715
1042
  childHome(scope),
716
1043
  childPrimaryCaregiver(scope),
717
1044
  degreeOfInterest(scope),
718
- lawyerPaymentMethod(scope)
719
- ]
720
- }
721
- );
1045
+ lawyerPaymentMethod(scope),
1046
+ ],
1047
+ });
722
1048
 
723
- const DivorceQuestions = (condition, scope) => group(
724
- 'DivorceQuestions',
725
- {
726
- if: (condition || '$get(Type_Of_Legal_Problem).value == "Divorce and Separation"'),
1049
+ const DivorceQuestions = (condition, scope) =>
1050
+ group("DivorceQuestions", {
1051
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Divorce and Separation"',
727
1052
  children: [
728
1053
  haveAttorney(scope),
729
1054
  maritalStatus(scope),
730
1055
  haveChildren(scope),
731
1056
  degreeOfInterest(scope),
732
- lawyerPaymentMethod(scope)
733
- ]
734
- }
735
- );
1057
+ lawyerPaymentMethod(scope),
1058
+ ],
1059
+ });
736
1060
 
737
- const DUIAndDWIQuestions = (condition, scope) => group(
738
- 'DUIAndDWIQuestions',
739
- {
740
- if: (condition || '$get(Type_Of_Legal_Problem).value == "DUI and DWI"'),
1061
+ const DUIAndDWIQuestions = (condition, scope) =>
1062
+ group("DUIAndDWIQuestions", {
1063
+ if: condition || '$get(Type_Of_Legal_Problem).value == "DUI and DWI"',
741
1064
  children: [
742
1065
  haveAttorney(scope),
743
1066
  incidentDate(scope),
@@ -745,104 +1068,87 @@ const DUIAndDWIQuestions = (condition, scope) => group(
745
1068
  typeOfAlcoholTest(scope),
746
1069
  bloodContentAlcoholTest(scope),
747
1070
  pendingCharges(scope),
748
- degreeOfInterestHelp(scope)
749
- ]
750
- }
751
- );
1071
+ degreeOfInterestHelp(scope),
1072
+ ],
1073
+ });
752
1074
 
753
- const PersonalInjuryQuestions = (condition, scope) => group(
754
- 'PersonalInjuryQuestions',
755
- {
756
- if: (condition || '$get(Type_Of_Legal_Problem).value == "Personal Injury"'),
1075
+ const PersonalInjuryQuestions = (condition, scope) =>
1076
+ group("PersonalInjuryQuestions", {
1077
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Personal Injury"',
757
1078
  children: [
758
1079
  haveAttorney(scope),
759
1080
  incidentDate(scope),
760
1081
  claimStatus(scope),
761
1082
  atFault(scope),
762
1083
  primaryInjury(scope),
763
- doctorTreatment(scope)
764
- ]
765
- }
766
- );
1084
+ doctorTreatment(scope),
1085
+ ],
1086
+ });
767
1087
 
768
- const PowerofAttorneyQuestions = (condition, scope) => group(
769
- 'PowerofAttorneyQuestions',
770
- {
771
- if: (condition || '$get(Type_Of_Legal_Problem).value == "Power of Attorney"'),
772
- children: [
773
- haveAttorney(scope),
774
- degreeOfInterestHelp(scope)
775
- ]
776
- }
777
- );
1088
+ const PowerofAttorneyQuestions = (condition, scope) =>
1089
+ group("PowerofAttorneyQuestions", {
1090
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Power of Attorney"',
1091
+ children: [haveAttorney(scope), degreeOfInterestHelp(scope)],
1092
+ });
778
1093
 
779
- const SocialSecurityDisabilityAndInsuranceQuestions = (condition, scope) => group(
780
- 'SocialSecurityDisabilityAndInsuranceQuestions',
781
- {
782
- if: (condition || '$get(Type_Of_Legal_Problem).value == "Social Security Disability and Insurance"'),
1094
+ const SocialSecurityDisabilityAndInsuranceQuestions = (condition, scope) =>
1095
+ group("SocialSecurityDisabilityAndInsuranceQuestions", {
1096
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Social Security Disability and Insurance"',
783
1097
  children: [
784
1098
  haveAttorney(scope),
785
1099
  applicantAge(scope),
786
1100
  disabilityConditionStopWork(scope),
787
1101
  disabilityWorkHistory(scope),
788
1102
  socialSecurityDisabilityReceivingBenefits(scope),
789
- doctorTreatment(scope)
790
- ]
791
- }
792
- );
1103
+ doctorTreatment(scope),
1104
+ ],
1105
+ });
793
1106
 
794
- const WillsAndTrustsQuestions = (condition, scope) => group(
795
- 'WillsAndTrustsQuestions',
796
- {
797
- if: (condition || '$get(Type_Of_Legal_Problem).value == "Wills and Trusts"'),
1107
+ const WillsAndTrustsQuestions = (condition, scope) =>
1108
+ group("WillsAndTrustsQuestions", {
1109
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Wills and Trusts"',
798
1110
  children: [
799
1111
  haveAttorney(scope),
800
1112
  valueOfAssets(scope),
801
1113
  typeOfAssets(scope),
802
1114
  roleInMatterProbate(scope),
803
1115
  estateLegalServicesNeeded(scope),
804
- degreeOfInterestHelp(scope)
805
- ]
806
- }
807
- );
1116
+ degreeOfInterestHelp(scope),
1117
+ ],
1118
+ });
808
1119
 
809
- const WorkersCompensationQuestions = (condition, scope) => group(
810
- 'WorkersCompensationQuestions',
811
- {
812
- if: (condition || '$get(Type_Of_Legal_Problem).value == "Workers Compensation"'),
1120
+ const WorkersCompensationQuestions = (condition, scope) =>
1121
+ group("WorkersCompensationQuestions", {
1122
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Workers Compensation"',
813
1123
  children: [
814
1124
  haveAttorney(scope),
815
1125
  incidentDate(scope),
816
1126
  claimStatus(scope),
817
1127
  primaryInjury(scope),
818
1128
  causeOfInjury(scope),
819
- doctorTreatment(scope)
820
- ]
821
- }
822
- );
1129
+ doctorTreatment(scope),
1130
+ ],
1131
+ });
823
1132
 
824
- const NotSureOrOtherQuestions = () => group(
825
- 'NotSureOrOtherQuestions',
826
- {
827
- if: '$get(Type_Of_Legal_Problem).value == "Not Sure or Other"',
828
- children: [
829
- haveAttorney(),
830
- degreeOfInterestHelp()
831
- ]
832
- }
833
- );
1133
+ const NotSureOrOtherQuestions = (condition, scope) =>
1134
+ group("NotSureOrOtherQuestions", {
1135
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Not Sure or Other"',
1136
+ children: [haveAttorney(scope), degreeOfInterestHelp(scope)],
1137
+ });
834
1138
 
835
- const NEXT_ON_ENTER = '$onEnter($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))';
836
- const NEXT_ON_INPUT = '$onInput($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))';
1139
+ const NEXT_ON_ENTER = "$onEnter($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))";
1140
+ const NEXT_ON_INPUT = "$onInput($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))";
837
1141
 
838
- const isInput = (n) => { return (n.type !== 'group' && n.type !== 'section' && n.type !== 'form' && n.$formkit !== 'hidden' && !n.children) };
1142
+ const isInput = (n) => {
1143
+ return n.type !== "group" && n.type !== "section" && n.type !== "form" && n.$formkit !== "hidden" && !n.children
1144
+ };
839
1145
 
840
1146
  const findLastInput = (n) => {
841
1147
  if (isInput(n)) {
842
1148
  return n
843
1149
  }
844
1150
  for (var i = n.children.length - 1; i >= 0; i--) {
845
- if (typeof n.children === 'string') {
1151
+ if (typeof n.children === "string") {
846
1152
  continue
847
1153
  }
848
1154
  const child = n.children[i];
@@ -858,126 +1164,138 @@ const findLastInput = (n) => {
858
1164
  };
859
1165
 
860
1166
  const secureIconDefault = {
861
- $el: 'div',
862
- if: '$activeStep === $lastStep()',
1167
+ $el: "div",
1168
+ if: "$activeStep === $lastStep()",
863
1169
  attrs: {
864
- class: 't-flex t-justify-center t-items-center t-text-sm t-text-gray-500'
1170
+ class: "t-flex t-justify-center t-items-center t-text-sm t-text-gray-500",
865
1171
  },
866
1172
  children: [
867
1173
  {
868
- $el: 'img',
1174
+ $el: "img",
869
1175
  attrs: {
870
- loading: 'lazy',
871
- alt: '',
1176
+ loading: "lazy",
1177
+ alt: "",
872
1178
  style: {
873
- border: 0
1179
+ border: 0,
874
1180
  },
875
- width: '25',
876
- height: '25',
877
- src: 'https://d27hmee62k45vz.cloudfront.net/lock_icon_1.jpeg',
878
- }
1181
+ width: "25",
1182
+ height: "25",
1183
+ src: "https://d27hmee62k45vz.cloudfront.net/lock_icon_1.jpeg",
1184
+ },
879
1185
  },
880
1186
  {
881
- $el: 'span',
882
- children: 'Secure & Encrypted',
1187
+ $el: "span",
1188
+ children: "Secure & Encrypted",
883
1189
  attrs: {
884
- class: 't-pl-2 t-pt-1 t-font-medium'
885
- }
886
- }
887
- ]
1190
+ class: "t-pl-2 t-pt-1 t-font-medium",
1191
+ },
1192
+ },
1193
+ ],
888
1194
  };
889
1195
 
890
1196
  function secureIcon(updates) {
891
- return merge(
892
- secureIconDefault,
893
- updates
894
- )
1197
+ return merge(secureIconDefault, updates)
895
1198
  }
896
1199
 
897
1200
  function questionsStepHeadline(updates) {
898
1201
  return {
899
- $el: 'h3',
900
- children: updates.headline || 'Tell Us About Your Situation',
1202
+ $el: "h3",
1203
+ children: updates.headline || "Tell Us About Your Situation",
901
1204
  attrs: {
902
- 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'
903
- }
1205
+ 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",
1206
+ },
904
1207
  }
905
1208
  }
906
1209
 
907
1210
  function crossSellQuestionsStepHeadline(updates) {
908
1211
  return {
909
- $el: 'h3',
910
- children: updates.headline || 'Tell Us About Your Situation',
1212
+ $el: "h3",
1213
+ children: updates.headline || "Tell Us About Your Situation",
911
1214
  attrs: {
912
- 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'
913
- }
1215
+ 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",
1216
+ },
914
1217
  }
915
1218
  }
916
1219
 
917
1220
  function crossSellQuestionsStepSubHeadline(updates) {
918
1221
  return {
919
- $el: 'h5',
920
- children: updates.subheadline || 'Tell us about your situation:',
1222
+ $el: "h5",
1223
+ children: updates.subheadline || "Tell us about your situation:",
921
1224
  attrs: {
922
- class: 't-flex t-justify-center t-text-dark t-text-center !t-text-lg t-font-semibold t-pb-4 t-pt-0 t-px-3'
923
- }
1225
+ class: "t-flex t-justify-center t-text-dark t-text-center !t-text-lg t-font-semibold t-pb-4 t-pt-0 t-px-3",
1226
+ },
924
1227
  }
925
1228
  }
926
1229
 
927
1230
  function commentsStepHeadline(updates) {
928
1231
  return {
929
- $el: 'h3',
930
- children: updates.headline || 'Additional Details',
1232
+ $el: "h3",
1233
+ children: updates.headline || "Additional Details",
931
1234
  attrs: {
932
- 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 || '')
933
- }
1235
+ class:
1236
+ "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" +
1237
+ " " +
1238
+ (updates.headlineClass || ""),
1239
+ },
934
1240
  }
935
1241
  }
936
1242
 
937
1243
  function commentsStepHeadlineLegal(updates) {
938
1244
  return commentsStepHeadline({
939
- headline: updates.headline || 'Additional Case Details',
940
- headlineClass: updates.headlineClass
1245
+ headline: updates.headline || "Additional Case Details",
1246
+ headlineClass: updates.headlineClass,
941
1247
  })
942
1248
  }
943
1249
 
944
1250
  function firstAndLastStepHeadline(updates) {
945
1251
  return {
946
- $el: 'h3',
947
- children: updates.headline || 'Please Provide a Contact Name',
1252
+ $el: "h3",
1253
+ children: updates.headline || "Please Provide a Contact Name",
948
1254
  attrs: {
949
- 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 || '')
950
- }
1255
+ class:
1256
+ "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" +
1257
+ " " +
1258
+ (updates.headlineClass || ""),
1259
+ },
951
1260
  }
952
1261
  }
953
1262
 
954
1263
  function legalCrossSellsStepHeadline(updates) {
955
1264
  return {
956
- $el: 'h3',
957
- children: updates.headline || 'Do any of the following situations apply?',
1265
+ $el: "h3",
1266
+ children: updates.headline || "Do any of the following situations apply?",
958
1267
  attrs: {
959
- 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 || '')
960
- }
1268
+ class:
1269
+ "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" +
1270
+ " " +
1271
+ (updates.headlineClass || ""),
1272
+ },
961
1273
  }
962
1274
  }
963
1275
 
964
1276
  function contactStepHeadline(updates) {
965
1277
  return {
966
- $el: 'h3',
1278
+ $el: "h3",
967
1279
  children: updates.headline || DEFAULT_FINAL_HEADLINE_DYNAMIC_LEGAL,
968
1280
  attrs: {
969
- 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 || '')
970
- }
1281
+ class:
1282
+ "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" +
1283
+ " " +
1284
+ (updates.headlineClass || ""),
1285
+ },
971
1286
  }
972
1287
  }
973
1288
 
974
1289
  function contactStepSubHeadline(updates) {
975
1290
  return {
976
- $el: 'h5',
1291
+ $el: "h5",
977
1292
  children: updates.subheadline || DEFAULT_FINAL_SUBHEADLINE_DYNAMIC_LEGAL,
978
1293
  attrs: {
979
- 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 || '')
980
- }
1294
+ class:
1295
+ "t-flex t-justify-center t-text-center !t-text-lg t-font-semibold t-pb-7 t-pt-0 t-px-3" +
1296
+ " " +
1297
+ (updates.subheadlineClass || ""),
1298
+ },
981
1299
  }
982
1300
  }
983
1301
 
@@ -999,19 +1317,19 @@ const TRUSTED_FORM_JS = `(function() {
999
1317
 
1000
1318
  function trustedFormScript() {
1001
1319
  return {
1002
- $el: 'script',
1003
- if: '$activeStep === $lastStep()',
1004
- children: TRUSTED_FORM_JS
1320
+ $el: "script",
1321
+ if: "$activeStep === $lastStep()",
1322
+ children: TRUSTED_FORM_JS,
1005
1323
  }
1006
1324
  }
1007
1325
 
1008
1326
  const stepDefaults = (step, stepKey) => ({
1009
- $el: 'section',
1327
+ $el: "section",
1010
1328
  if: '$stepEnabled("' + step + '")',
1011
1329
  attrs: {
1012
1330
  hidden: '$activeStep !== "' + step + '"',
1013
- key: stepKey ? stepKey : step
1014
- }
1331
+ key: stepKey ? stepKey : step,
1332
+ },
1015
1333
  });
1016
1334
 
1017
1335
  function step(name, inputs, updates = {}) {
@@ -1034,27 +1352,24 @@ function step(name, inputs, updates = {}) {
1034
1352
  }
1035
1353
  }
1036
1354
 
1037
- return merge(
1038
- stepDefaults(name, stepKey),
1039
- {
1040
- children: [
1041
- {
1042
- $formkit: 'group',
1043
- id: name,
1044
- name: name,
1045
- nextStepMap: nextStepMap,
1046
- triggerRedirectMap: triggerRedirectMap,
1047
- autoFocus: autoFocus,
1048
- children: inputs
1049
- }
1050
- ]
1051
- }
1052
- )
1355
+ return merge(stepDefaults(name, stepKey), {
1356
+ children: [
1357
+ {
1358
+ $formkit: "group",
1359
+ id: name,
1360
+ name: name,
1361
+ nextStepMap: nextStepMap,
1362
+ triggerRedirectMap: triggerRedirectMap,
1363
+ autoFocus: autoFocus,
1364
+ children: inputs,
1365
+ },
1366
+ ],
1367
+ })
1053
1368
  }
1054
1369
 
1055
1370
  function contactInfo(updates = {}) {
1056
1371
  return step(
1057
- 'contactInfo',
1372
+ "contactInfo",
1058
1373
  [
1059
1374
  contactStepHeadline(updates),
1060
1375
  contactStepSubHeadline(updates),
@@ -1062,7 +1377,7 @@ function contactInfo(updates = {}) {
1062
1377
  email(updates.scope),
1063
1378
  phone(updates.scope),
1064
1379
  TCPAConsent(updates.scope),
1065
- secureIcon()
1380
+ secureIcon(),
1066
1381
  ],
1067
1382
  { nextOnEnter: false }
1068
1383
  )
@@ -1070,34 +1385,30 @@ function contactInfo(updates = {}) {
1070
1385
 
1071
1386
  function firstAndLastV2(updates = {}) {
1072
1387
  return step(
1073
- 'firstAndLast',
1074
- [
1075
- firstAndLastStepHeadline(updates),
1076
- firstName(),
1077
- lastName()
1078
- ],
1388
+ "firstAndLast",
1389
+ [firstAndLastStepHeadline(updates), firstName(updates.scope), lastName(updates.scope)],
1079
1390
  updates
1080
1391
  )
1081
1392
  }
1082
1393
 
1083
1394
  function contractsTOLPAndZip(updates = {}) {
1084
1395
  return step(
1085
- 'contractsTOLPAndZip',
1396
+ "contractsTOLPAndZip",
1086
1397
  [
1087
1398
  {
1088
- $formkit: 'hidden',
1399
+ $formkit: "hidden",
1089
1400
  name: "Type_Of_Legal_Problem",
1090
1401
  id: "Type_Of_Legal_Problem",
1091
- value: "Business Lawyers"
1402
+ value: "Business Lawyers",
1092
1403
  },
1093
1404
  {
1094
- $formkit: 'hidden',
1405
+ $formkit: "hidden",
1095
1406
  name: "Business_Services",
1096
1407
  id: "Business_Services",
1097
- value: "Contracts"
1408
+ value: "Contracts",
1098
1409
  },
1099
- contractsTOLPDisplay(),
1100
- zipcode()
1410
+ contractsTOLPDisplay(updates.scope),
1411
+ zipcode(updates.scope),
1101
1412
  ],
1102
1413
  updates
1103
1414
  )
@@ -1105,27 +1416,27 @@ function contractsTOLPAndZip(updates = {}) {
1105
1416
 
1106
1417
  function commentsWithBankruptcy(updates = {}) {
1107
1418
  return step(
1108
- 'commentsWithBankruptcy',
1419
+ "commentsWithBankruptcy",
1109
1420
  [
1110
1421
  commentsStepHeadlineLegal(updates),
1111
- comments({
1112
- label: typeof updates.label === 'undefined' ? DEFAULT_COMMENTS_LABEL_LEGAL : updates.label,
1422
+ comments(updates.scope, false, {
1423
+ label: typeof updates.label === "undefined" ? DEFAULT_COMMENTS_LABEL_LEGAL : updates.label,
1113
1424
  placeholder: updates.placeholder || DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL,
1114
- inputClass: typeof updates.inputClass === 'undefined' ? '!t-h-32' : updates.inputClass,
1115
- }, updates.scope),
1425
+ inputClass: typeof updates.inputClass === "undefined" ? "!t-h-32" : updates.inputClass,
1426
+ }),
1116
1427
  // TODO: needs scope support
1117
1428
  bankruptcyCrossSell(),
1118
1429
  {
1119
- $el: 'div',
1120
- if: '$get(CrossSell_Bankruptcy).value == true',
1430
+ $el: "div",
1431
+ if: "$get(CrossSell_Bankruptcy).value == true",
1121
1432
  children: [
1122
- comments({
1123
- label: 'Bankruptcy or debt details:',
1124
- placeholder: 'Please describe your bankrtupcy or debt situation in a few words...',
1125
- inputClass: '!t-h-16'
1126
- }, 'CrossSell:Bankruptcy')
1433
+ comments("CrossSell:Bankruptcy", false, {
1434
+ label: "Bankruptcy or debt details:",
1435
+ placeholder: "Please describe your bankrtupcy or debt situation in a few words...",
1436
+ inputClass: "!t-h-16",
1437
+ }),
1127
1438
  ],
1128
- }
1439
+ },
1129
1440
  ],
1130
1441
  { nextOnEnter: false }
1131
1442
  )
@@ -1133,19 +1444,20 @@ function commentsWithBankruptcy(updates = {}) {
1133
1444
 
1134
1445
  function autoAndCarAccidentCrossSellQuestions(updates = {}) {
1135
1446
  return step(
1136
- 'autoAndCarAccidentCrossSellQuestions',
1447
+ "autoAndCarAccidentCrossSellQuestions",
1137
1448
  [
1138
- crossSellQuestionsStepHeadline({ headline: 'You May Be Entitled To Compensation' }),
1139
- crossSellQuestionsStepSubHeadline({ subheadline: 'Tell us about your accident:' }),
1140
- AutoAndCarAccidentsQuestions("true", 'CrossSell:Auto_and_Car_Accidents'),
1141
- comments(
1142
- {
1143
- label: 'Accident Description:',
1144
- placeholder: 'Please describe your accident in a few words...',
1145
- inputClass: '!t-h-16'
1146
- },
1147
- 'CrossSell:Auto_and_Car_Accidents'
1148
- )
1449
+ crossSellQuestionsStepHeadline({
1450
+ headline: "You May Be Entitled To Compensation",
1451
+ }),
1452
+ crossSellQuestionsStepSubHeadline({
1453
+ subheadline: "Tell us about your accident:",
1454
+ }),
1455
+ AutoAndCarAccidentsQuestions("true", "CrossSell:Auto_and_Car_Accidents"),
1456
+ comments("CrossSell:Auto_and_Car_Accidents", false, {
1457
+ label: "Accident Description:",
1458
+ placeholder: "Please describe your accident in a few words...",
1459
+ inputClass: "!t-h-16",
1460
+ }),
1149
1461
  ],
1150
1462
  updates
1151
1463
  )
@@ -1153,18 +1465,15 @@ function autoAndCarAccidentCrossSellQuestions(updates = {}) {
1153
1465
 
1154
1466
  function childCustodyCrossSellQuestions(updates = {}) {
1155
1467
  return step(
1156
- 'childCustodyCrossSellQuestions',
1468
+ "childCustodyCrossSellQuestions",
1157
1469
  [
1158
- crossSellQuestionsStepHeadline({ headline: 'Child Custody Information' }),
1159
- ChildCustodyQuestions("true", 'CrossSell:Child_Custody'),
1160
- comments(
1161
- {
1162
- label: 'Description:',
1163
- placeholder: 'Please describe your situation in a few words...',
1164
- inputClass: '!t-h-16'
1165
- },
1166
- 'CrossSell:Child_Custody'
1167
- )
1470
+ crossSellQuestionsStepHeadline({ headline: "Child Custody Information" }),
1471
+ ChildCustodyQuestions("true", "CrossSell:Child_Custody"),
1472
+ comments("CrossSell:Child_Custody", false, {
1473
+ label: "Description:",
1474
+ placeholder: "Please describe your situation in a few words...",
1475
+ inputClass: "!t-h-16",
1476
+ }),
1168
1477
  ],
1169
1478
  updates
1170
1479
  )
@@ -1172,18 +1481,17 @@ function childCustodyCrossSellQuestions(updates = {}) {
1172
1481
 
1173
1482
  function divorceAndSeparationCrossSellQuestions(updates = {}) {
1174
1483
  return step(
1175
- 'divorceAndSeparationCrossSellQuestions',
1484
+ "divorceAndSeparationCrossSellQuestions",
1176
1485
  [
1177
- crossSellQuestionsStepHeadline({ headline: 'Divorce or Separation Information' }),
1178
- DivorceQuestions("true", 'CrossSell:Divorce_and_Separation'),
1179
- comments(
1180
- {
1181
- label: 'Description:',
1182
- placeholder: 'Please describe your situation in a few words...',
1183
- inputClass: '!t-h-16'
1184
- },
1185
- 'CrossSell:Divorce_and_Separation'
1186
- )
1486
+ crossSellQuestionsStepHeadline({
1487
+ headline: "Divorce or Separation Information",
1488
+ }),
1489
+ DivorceQuestions("true", "CrossSell:Divorce_and_Separation"),
1490
+ comments("CrossSell:Divorce_and_Separation", false, {
1491
+ label: "Description:",
1492
+ placeholder: "Please describe your situation in a few words...",
1493
+ inputClass: "!t-h-16",
1494
+ }),
1187
1495
  ],
1188
1496
  updates
1189
1497
  )
@@ -1191,18 +1499,15 @@ function divorceAndSeparationCrossSellQuestions(updates = {}) {
1191
1499
 
1192
1500
  function duiAndDWICrossSellQuestions(updates = {}) {
1193
1501
  return step(
1194
- 'duiAndDWICrossSellQuestions',
1502
+ "duiAndDWICrossSellQuestions",
1195
1503
  [
1196
- crossSellQuestionsStepHeadline({ headline: 'About Your DUI/DWI' }),
1197
- DUIAndDWIQuestions("true", 'CrossSell:DUI_and_DWI'),
1198
- comments(
1199
- {
1200
- label: 'Incident Description:',
1201
- placeholder: 'Please describe your incident in a few words...',
1202
- inputClass: '!t-h-16'
1203
- },
1204
- 'CrossSell:DUI_and_DWI'
1205
- )
1504
+ crossSellQuestionsStepHeadline({ headline: "About Your DUI/DWI" }),
1505
+ DUIAndDWIQuestions("true", "CrossSell:DUI_and_DWI"),
1506
+ comments("CrossSell:DUI_and_DWI", false, {
1507
+ label: "Incident Description:",
1508
+ placeholder: "Please describe your incident in a few words...",
1509
+ inputClass: "!t-h-16",
1510
+ }),
1206
1511
  ],
1207
1512
  updates
1208
1513
  )
@@ -1210,19 +1515,20 @@ function duiAndDWICrossSellQuestions(updates = {}) {
1210
1515
 
1211
1516
  function ssdiCrossSellQuestions(updates = {}) {
1212
1517
  return step(
1213
- 'ssdiCrossSellQuestions',
1518
+ "ssdiCrossSellQuestions",
1214
1519
  [
1215
- crossSellQuestionsStepHeadline({ headline: 'You May Be Entitled To Benefits' }),
1216
- crossSellQuestionsStepSubHeadline({ subheadline: 'Tell us about your disability:' }),
1217
- SocialSecurityDisabilityAndInsuranceQuestions("true", 'CrossSell:Social_Security_Disability_and_Insurance'),
1218
- comments(
1219
- {
1220
- label: 'Description:',
1221
- placeholder: 'Please describe your situation in a few words...',
1222
- inputClass: '!t-h-16'
1223
- },
1224
- 'CrossSell:Social_Security_Disability_and_Insurance'
1225
- )
1520
+ crossSellQuestionsStepHeadline({
1521
+ headline: "You May Be Entitled To Benefits",
1522
+ }),
1523
+ crossSellQuestionsStepSubHeadline({
1524
+ subheadline: "Tell us about your disability:",
1525
+ }),
1526
+ SocialSecurityDisabilityAndInsuranceQuestions("true", "CrossSell:Social_Security_Disability_and_Insurance"),
1527
+ comments("CrossSell:Social_Security_Disability_and_Insurance", false, {
1528
+ label: "Description:",
1529
+ placeholder: "Please describe your situation in a few words...",
1530
+ inputClass: "!t-h-16",
1531
+ }),
1226
1532
  ],
1227
1533
  updates
1228
1534
  )
@@ -1230,19 +1536,20 @@ function ssdiCrossSellQuestions(updates = {}) {
1230
1536
 
1231
1537
  function personalInjuryCrossSellQuestions(updates = {}) {
1232
1538
  return step(
1233
- 'personalInjuryCrossSellQuestions',
1539
+ "personalInjuryCrossSellQuestions",
1234
1540
  [
1235
- crossSellQuestionsStepHeadline({ headline: 'You May Be Entitled To Compensation' }),
1236
- crossSellQuestionsStepSubHeadline({ subheadline: 'Tell us about your injury:' }),
1237
- PersonalInjuryQuestions("true", 'CrossSell:Personal_Injury'),
1238
- comments(
1239
- {
1240
- label: 'Injury Description:',
1241
- placeholder: 'Please describe your injury in a few words...',
1242
- inputClass: '!t-h-16'
1243
- },
1244
- 'CrossSell:Personal_Injury'
1245
- )
1541
+ crossSellQuestionsStepHeadline({
1542
+ headline: "You May Be Entitled To Compensation",
1543
+ }),
1544
+ crossSellQuestionsStepSubHeadline({
1545
+ subheadline: "Tell us about your injury:",
1546
+ }),
1547
+ PersonalInjuryQuestions("true", "CrossSell:Personal_Injury"),
1548
+ comments("CrossSell:Personal_Injury", false, {
1549
+ label: "Injury Description:",
1550
+ placeholder: "Please describe your injury in a few words...",
1551
+ inputClass: "!t-h-16",
1552
+ }),
1246
1553
  ],
1247
1554
  updates
1248
1555
  )
@@ -1250,18 +1557,17 @@ function personalInjuryCrossSellQuestions(updates = {}) {
1250
1557
 
1251
1558
  function powerOfAttorneyCrossSellQuestions(updates = {}) {
1252
1559
  return step(
1253
- 'powerOfAttorneyCrossSellQuestions',
1560
+ "powerOfAttorneyCrossSellQuestions",
1254
1561
  [
1255
- crossSellQuestionsStepHeadline({ headline: 'Power of Attorney Information' }),
1256
- PowerofAttorneyQuestions("true", 'CrossSell:Power_of_Attorney'),
1257
- comments(
1258
- {
1259
- label: 'Description:',
1260
- placeholder: 'Please describe your situation in a few words...',
1261
- inputClass: '!t-h-16'
1262
- },
1263
- 'CrossSell:Power_of_Attorney'
1264
- )
1562
+ crossSellQuestionsStepHeadline({
1563
+ headline: "Power of Attorney Information",
1564
+ }),
1565
+ PowerofAttorneyQuestions("true", "CrossSell:Power_of_Attorney"),
1566
+ comments("CrossSell:Power_of_Attorney", false, {
1567
+ label: "Description:",
1568
+ placeholder: "Please describe your situation in a few words...",
1569
+ inputClass: "!t-h-16",
1570
+ }),
1265
1571
  ],
1266
1572
  updates
1267
1573
  )
@@ -1269,18 +1575,15 @@ function powerOfAttorneyCrossSellQuestions(updates = {}) {
1269
1575
 
1270
1576
  function willsAndTrustsCrossSellQuestions(updates = {}) {
1271
1577
  return step(
1272
- 'willsAndTrustsCrossSellQuestions',
1578
+ "willsAndTrustsCrossSellQuestions",
1273
1579
  [
1274
- crossSellQuestionsStepHeadline({ headline: 'Will or Trust Information' }),
1275
- WillsAndTrustsQuestions("true", 'CrossSell:Wills_and_Trusts'),
1276
- comments(
1277
- {
1278
- label: 'Description:',
1279
- placeholder: 'Please describe your situation in a few words...',
1280
- inputClass: '!t-h-16'
1281
- },
1282
- 'CrossSell:Wills_and_Trusts'
1283
- )
1580
+ crossSellQuestionsStepHeadline({ headline: "Will or Trust Information" }),
1581
+ WillsAndTrustsQuestions("true", "CrossSell:Wills_and_Trusts"),
1582
+ comments("CrossSell:Wills_and_Trusts", false, {
1583
+ label: "Description:",
1584
+ placeholder: "Please describe your situation in a few words...",
1585
+ inputClass: "!t-h-16",
1586
+ }),
1284
1587
  ],
1285
1588
  updates
1286
1589
  )
@@ -1288,19 +1591,20 @@ function willsAndTrustsCrossSellQuestions(updates = {}) {
1288
1591
 
1289
1592
  function workersCompensationCrossSellQuestions(updates = {}) {
1290
1593
  return step(
1291
- 'workersCompensationCrossSellQuestions',
1594
+ "workersCompensationCrossSellQuestions",
1292
1595
  [
1293
- crossSellQuestionsStepHeadline({ headline: 'You May Be Entitled To Benefits' }),
1294
- crossSellQuestionsStepSubHeadline({ subheadline: 'Tell us about your injury:' }),
1295
- WorkersCompensationQuestions("true", 'CrossSell:Workers_Compensation'),
1296
- comments(
1297
- {
1298
- label: 'Injury Description:',
1299
- placeholder: 'Please describe your injury in a few words...',
1300
- inputClass: '!t-h-16'
1301
- },
1302
- 'CrossSell:Workers_Compensation'
1303
- )
1596
+ crossSellQuestionsStepHeadline({
1597
+ headline: "You May Be Entitled To Benefits",
1598
+ }),
1599
+ crossSellQuestionsStepSubHeadline({
1600
+ subheadline: "Tell us about your injury:",
1601
+ }),
1602
+ WorkersCompensationQuestions("true", "CrossSell:Workers_Compensation"),
1603
+ comments("CrossSell:Workers_Compensation", false, {
1604
+ label: "Injury Description:",
1605
+ placeholder: "Please describe your injury in a few words...",
1606
+ inputClass: "!t-h-16",
1607
+ }),
1304
1608
  ],
1305
1609
  updates
1306
1610
  )
@@ -1308,135 +1612,124 @@ function workersCompensationCrossSellQuestions(updates = {}) {
1308
1612
 
1309
1613
  function contractsTOLPQuestions(updates = {}) {
1310
1614
  return step(
1311
- 'TOLPQuestions',
1312
- [
1313
- questionsStepHeadline(updates),
1314
- ContractsQuestions(),
1315
- NotSureOrOtherQuestions()
1316
- ],
1615
+ "TOLPQuestions",
1616
+ [questionsStepHeadline(updates), ContractsQuestions(), NotSureOrOtherQuestions()],
1317
1617
  updates
1318
1618
  )
1319
1619
  }
1320
1620
 
1321
1621
  function legalCrossSells(updates = {}) {
1322
1622
  updates.nextOnInput = false;
1323
- updates.stepKey = '$get(Type_Of_Legal_Problem).value';
1324
- return step(
1325
- 'legalCrossSells',
1326
- [
1327
- legalCrossSellsStepHeadline(updates),
1328
- legalCrossSells$1(),
1329
- ],
1330
- updates
1331
- )
1623
+ updates.stepKey = "$get(Type_Of_Legal_Problem).value";
1624
+ return step("legalCrossSells", [legalCrossSellsStepHeadline(updates), legalCrossSells$1()], updates)
1332
1625
  }
1333
1626
 
1334
1627
  const formNavigation = (updates = {}) => ({
1335
- $el: 'div',
1628
+ $el: "div",
1336
1629
  attrs: {
1337
- class: 'step-nav'
1630
+ class: "step-nav",
1338
1631
  },
1339
1632
  children: [
1340
1633
  {
1341
- $formkit: 'button',
1342
- name: 'back_button',
1343
- onClick: '$setPreviousStep($prevStepFunc($get(form)))',
1344
- children: 'Back',
1634
+ $formkit: "button",
1635
+ name: "back_button",
1636
+ onClick: "$setPreviousStep($prevStepFunc($get(form)))",
1637
+ children: "Back",
1345
1638
  style: {
1346
- if: '$activeStep === $firstStep()',
1347
- then: 'visibility: hidden;'
1348
- }
1639
+ if: "$activeStep === $firstStep()",
1640
+ then: "visibility: hidden;",
1641
+ },
1349
1642
  },
1350
1643
  {
1351
- $formkit: 'button',
1352
- name: 'next_button',
1353
- onClick: '$setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form)))',
1644
+ $formkit: "button",
1645
+ name: "next_button",
1646
+ onClick: "$setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form)))",
1354
1647
  children: {
1355
- if: '$activeStep === $firstStep()',
1356
- then: 'Start',
1357
- else: 'Next'
1648
+ if: "$activeStep === $firstStep()",
1649
+ then: "Start",
1650
+ else: "Next",
1358
1651
  },
1359
1652
  outerClass: {
1360
- if: '$activeStep === $lastStep()',
1361
- then: 't-hidden',
1362
- else: ''
1653
+ if: "$activeStep === $lastStep()",
1654
+ then: "t-hidden",
1655
+ else: "",
1363
1656
  },
1364
1657
  style: {
1365
- if: '$activeStep === $lastStep()',
1366
- then: 'display: none;'
1367
- }
1658
+ if: "$activeStep === $lastStep()",
1659
+ then: "display: none;",
1660
+ },
1368
1661
  },
1369
1662
  {
1370
- $formkit: 'submit',
1371
- name: 'submit_button',
1372
- label: updates.submitLabel || 'Submit',
1373
- if: '$activeStep === $lastStep()',
1663
+ $formkit: "submit",
1664
+ name: "submit_button",
1665
+ label: updates.submitLabel || "Submit",
1666
+ if: "$activeStep === $lastStep()",
1374
1667
  style: {
1375
- if: '$activeStep !== $lastStep()',
1376
- then: 'display: none;'
1377
- }
1378
- }
1379
- ]
1668
+ if: "$activeStep !== $lastStep()",
1669
+ then: "display: none;",
1670
+ },
1671
+ },
1672
+ ],
1380
1673
  });
1381
1674
 
1382
1675
  const formDetails = () => ({
1383
- $el: 'pre',
1676
+ $el: "pre",
1384
1677
  if: '$urlParam("fdbg", "") == 1',
1385
1678
  children: [
1386
1679
  {
1387
- $el: 'pre',
1388
- children: '$stringify( $get(form).value )',
1680
+ $el: "pre",
1681
+ children: "$stringify( $get(form).value )",
1389
1682
  attrs: {
1390
- class: 't-text-xs',
1391
- style: 'overflow: scroll'
1392
- }
1683
+ class: "t-text-xs",
1684
+ style: "overflow: scroll",
1685
+ },
1393
1686
  },
1394
1687
  {
1395
- $el: 'pre',
1396
- children: ['activeStep: ', '$activeStep'],
1688
+ $el: "pre",
1689
+ children: ["activeStep: ", "$activeStep"],
1397
1690
  attrs: {
1398
- class: 't-text-xs',
1399
- style: 'overflow: scroll'
1400
- }
1691
+ class: "t-text-xs",
1692
+ style: "overflow: scroll",
1693
+ },
1401
1694
  },
1402
1695
  {
1403
- $el: 'pre',
1404
- children: ['stepHistory: ', '$stepHistory'],
1696
+ $el: "pre",
1697
+ children: ["stepHistory: ", "$stepHistory"],
1405
1698
  attrs: {
1406
- class: 't-text-xs',
1407
- style: 'overflow: scroll'
1408
- }
1699
+ class: "t-text-xs",
1700
+ style: "overflow: scroll",
1701
+ },
1409
1702
  },
1410
1703
  {
1411
- $el: 'pre',
1412
- children: ['stepQueue: ', '$stepQueue'],
1704
+ $el: "pre",
1705
+ children: ["stepQueue: ", "$stepQueue"],
1413
1706
  attrs: {
1414
- class: 't-text-xs',
1415
- style: 'overflow: scroll'
1416
- }
1707
+ class: "t-text-xs",
1708
+ style: "overflow: scroll",
1709
+ },
1417
1710
  },
1418
1711
  {
1419
- $el: 'pre',
1420
- children: ['steps: ', '$stepKeys()'],
1712
+ $el: "pre",
1713
+ children: ["steps: ", "$stepKeys()"],
1421
1714
  attrs: {
1422
- class: 't-text-xs',
1423
- style: 'overflow: scroll'
1424
- }
1425
- }
1426
- ]
1715
+ class: "t-text-xs",
1716
+ style: "overflow: scroll",
1717
+ },
1718
+ },
1719
+ ],
1427
1720
  });
1428
1721
 
1429
1722
  const formPropDefaults = {
1430
- type: 'form',
1431
- id: 'form',
1432
- config: { validationVisibility: 'submit' },
1723
+ type: "form",
1724
+ id: "form",
1725
+ config: { validationVisibility: "submit" },
1433
1726
  onSubmit: '$submit($submitUrl, $prepData, $handleRedirect, "text/plain; charset=UTF-8")',
1434
- plugins: '$plugins',
1727
+ plugins: "$plugins",
1435
1728
  actions: false,
1436
- anchorElement: 'form-anchor',
1729
+ anchorElement: "form-anchor",
1437
1730
  useLocalStorage: true,
1438
1731
  prepop: {
1439
- fromURL: true
1732
+ fromURL: true,
1440
1733
  },
1441
1734
  errorCodes: {
1442
1735
  403: { message: "An Error Occurred", abort: false },
@@ -1444,13 +1737,11 @@ const formPropDefaults = {
1444
1737
  429: "An Error Occurred",
1445
1738
  504: { message: "An Error Occurred", abort: false },
1446
1739
  },
1447
- formClass: '!t-max-w-[40rem]'
1740
+ formClass: "!t-max-w-[40rem]",
1448
1741
  };
1449
1742
 
1450
1743
  function filterMapByKey(obj, keyList) {
1451
- return Object.fromEntries(
1452
- Object.entries(obj).filter(([key]) => keyList.includes(key))
1453
- );
1744
+ return Object.fromEntries(Object.entries(obj).filter(([key]) => keyList.includes(key)))
1454
1745
  }
1455
1746
 
1456
1747
  // export function filteredNextStepsMapLegal(keyList) {
@@ -1460,10 +1751,7 @@ function filterMapByKey(obj, keyList) {
1460
1751
  // }
1461
1752
 
1462
1753
  function formProps(updates) {
1463
- const props = merge(
1464
- formPropDefaults,
1465
- updates
1466
- );
1754
+ const props = merge(formPropDefaults, updates);
1467
1755
  if (props.formId && !props.name) {
1468
1756
  props.name = props.formId;
1469
1757
  }
@@ -1473,13 +1761,10 @@ function formProps(updates) {
1473
1761
  const metaDefaults = {};
1474
1762
 
1475
1763
  function metaProps(updates) {
1476
- const data = merge(
1477
- metaDefaults,
1478
- updates
1479
- );
1764
+ const data = merge(metaDefaults, updates);
1480
1765
  return {
1481
- type: 'meta',
1482
- data
1766
+ type: "meta",
1767
+ data,
1483
1768
  }
1484
1769
  }
1485
1770
 
@@ -1499,177 +1784,180 @@ function defaultMetaPropsLegal(tolps = null) {
1499
1784
  defaultFinalHeadline: DEFAULT_FINAL_HEADLINE_LEGAL,
1500
1785
  finalHeadlines: finalHeadlines,
1501
1786
  defaultFinalSubHeadline: DEFAULT_FINAL_SUBHEADLINE_LEGAL,
1502
- finalSubHeadlines: finalSubHeadlines
1787
+ finalSubHeadlines: finalSubHeadlines,
1503
1788
  })
1504
1789
  }
1505
1790
 
1506
- function dynamicSchemaNode(field = 'Type_Of_Legal_Problem') {
1791
+ function dynamicSchemaNode(field = "Type_Of_Legal_Problem") {
1507
1792
  return {
1508
- $cmp: 'FormKitSchema',
1509
- if: '$get(' + field + ').value',
1793
+ $cmp: "FormKitSchema",
1794
+ if: "$get(" + field + ").value",
1510
1795
  props: {
1511
- schema: '$meta.dynamicSchema',
1512
- data: '$buildData($meta)'
1513
- }
1796
+ schema: "$meta.dynamicSchema",
1797
+ data: "$buildData($meta)",
1798
+ },
1514
1799
  }
1515
1800
  }
1516
1801
 
1517
1802
  const formAnchorDefaults = {
1518
- $el: 'div',
1803
+ $el: "div",
1519
1804
  children: [
1520
1805
  {
1521
- $el: 'div',
1806
+ $el: "div",
1522
1807
  attrs: {
1523
- id: 'form-anchor',
1524
- class: 't-absolute',
1525
- style: { top: '-30px', left: 0 }
1526
- }
1527
- }
1808
+ id: "form-anchor",
1809
+ class: "t-absolute",
1810
+ style: { top: "-30px", left: 0 },
1811
+ },
1812
+ },
1528
1813
  ],
1529
1814
  attrs: {
1530
- class: 't-relative'
1531
- }
1815
+ class: "t-relative",
1816
+ },
1532
1817
  };
1533
1818
 
1534
1819
  function formAnchor(updates) {
1535
- return merge(
1536
- formAnchorDefaults,
1537
- updates
1538
- )
1820
+ return merge(formAnchorDefaults, updates)
1539
1821
  }
1540
1822
 
1541
1823
  function headlineDefaults(updates = {}) {
1542
1824
  return {
1543
- $el: 'h1',
1825
+ $el: "h1",
1544
1826
  attrs: {
1545
- class: 't-flex t-justify-center t-text-center !t-text-[2rem] t-font-semibold t-pt-5 t-px-7 md:t-px-3' + ' ' + (updates.headlineClass || '')
1546
- }
1827
+ class:
1828
+ "t-flex t-justify-center t-text-center !t-text-[2rem] t-font-semibold t-pt-5 t-px-7 md:t-px-3" +
1829
+ " " +
1830
+ (updates.headlineClass || ""),
1831
+ },
1547
1832
  }
1548
1833
  }
1549
1834
 
1550
1835
  function headline(updates = {}) {
1551
- return merge(
1552
- headlineDefaults(updates),
1553
- updates
1554
- )
1836
+ return merge(headlineDefaults(updates), updates)
1555
1837
  }
1556
1838
 
1557
1839
  function subHeadlineDefaults(updates = {}) {
1558
1840
  return {
1559
- $el: 'h3',
1841
+ $el: "h3",
1560
1842
  attrs: {
1561
- class: 't-flex t-justify-center t-text-center !t-text-[1.2rem] t-font-medium t-text-blue-500 t-px-10' + ' ' + (updates.subheadlineClass || '')
1562
- }
1843
+ class:
1844
+ "t-flex t-justify-center t-text-center !t-text-[1.2rem] t-font-medium t-text-blue-500 t-px-10" +
1845
+ " " +
1846
+ (updates.subheadlineClass || ""),
1847
+ },
1563
1848
  }
1564
1849
  }
1565
1850
 
1566
1851
  function subHeadline(updates = {}) {
1567
- return merge(
1568
- subHeadlineDefaults(updates),
1569
- updates
1570
- )
1852
+ return merge(subHeadlineDefaults(updates), updates)
1571
1853
  }
1572
1854
 
1573
1855
  const hiddenInputsBase = [
1574
1856
  {
1575
- $formkit: 'hidden',
1857
+ $formkit: "hidden",
1576
1858
  name: "gclid",
1577
- value: null
1859
+ value: null,
1578
1860
  },
1579
1861
  {
1580
- $formkit: 'hidden',
1862
+ $formkit: "hidden",
1581
1863
  name: "campaignid",
1582
- value: null
1864
+ value: null,
1583
1865
  },
1584
1866
  {
1585
- $formkit: 'hidden',
1867
+ $formkit: "hidden",
1586
1868
  name: "s",
1587
- value: null
1588
- }
1869
+ value: null,
1870
+ },
1589
1871
  ];
1590
1872
 
1591
1873
  const hiddenInputsLegal = [
1592
1874
  {
1593
- $formkit: 'hidden',
1875
+ $formkit: "hidden",
1594
1876
  name: "vertical",
1595
- value: "Legal"
1877
+ value: "Legal",
1596
1878
  },
1597
1879
  {
1598
- $formkit: 'hidden',
1880
+ $formkit: "hidden",
1599
1881
  name: "TCPA_Language",
1600
- value: "$meta.tcpaLanguage"
1882
+ value: "$meta.tcpaLanguage",
1601
1883
  },
1602
- ...hiddenInputsBase
1884
+ ...hiddenInputsBase,
1603
1885
  ];
1604
1886
 
1605
1887
  const legalRedirectMapDefaults = {
1606
- '*': LegalRedirectUrl()
1888
+ "*": LegalRedirectUrl(),
1607
1889
  };
1608
1890
 
1609
-
1610
1891
  function legalRedirectMap(updates) {
1611
- return merge(
1612
- legalRedirectMapDefaults,
1613
- updates
1614
- )
1892
+ return merge(legalRedirectMapDefaults, updates)
1615
1893
  }
1616
1894
 
1617
1895
  const TOLPCommentsPlaceholders = {
1618
- 'Adoption': 'Example: "I need help with adoption forms"',
1619
- 'Asbestos and Mesothelioma': 'Example: "I was exposed to asbestos at work and would like to file a claim"',
1620
- 'Auto and Car Accidents': 'Example: "A truck crashed into my car on the highway" or "I\'ve been involved in a hit and run accident"',
1621
- 'Bankruptcy': 'Example: "I need help filing for bankruptcy"',
1622
- 'Birth Certificate and Name Change': 'Example: "Just married and would like to change my last name"',
1623
- 'Business Lawyers': 'Example: "I need help incorporating a business" or "I would like a legal contract reviewed"',
1624
- 'Child Custody and Support': 'Example: "Need help getting custody" or "Issues with child support payments"',
1625
- 'Child Custody': 'Example: "Need help getting custody"',
1626
- 'Child Support': 'Example: "Issues with child support payments"',
1627
- 'Civil Rights and Discrimination': 'Example: "Police brutality" or "Coworker keeps harassing me"',
1628
- 'Civil Lawsuit': 'Example: "A contractor took my money and never completed the job" or "I am being sued by a neighbor"',
1629
- 'File a Lawsuit': 'Example: "A contractor took my money and never completed the job"',
1630
- 'Defend a Lawsuit': 'Example: "I am being sued by a neighbor"',
1631
- 'Consumer Lawyers': 'Example: "Someone committed fraud against me" or "A contractor took my money and never completed the job"',
1632
- 'Copyrights and Trademarks': 'Example: "I would like to register a trademark or copyright a name"',
1633
- 'Criminal and Felony': 'Example: "I was arrested for DUI and need legal defense" or "I am being charged with assault"',
1634
- 'Debt and Collections': 'Example: "I would like to consolidate my debt" or "A collection agency is harassing me"',
1635
- 'Divorce and Separation': 'Example: "I would like to file for an uncontested divorce"',
1636
- 'DUI and DWI': 'Example: "I was arrested for DUI and need legal defense"',
1637
- 'Elder Law': 'Example: "I would like help with Estate Planning" or "I need help with a guardianship"',
1638
- 'Employment and Workplace': 'Example: "I was injured while on the job" or "My company is discriminating against me"',
1639
- 'Expungement': 'Example: "I would like to file for an expungement and clear my record"',
1640
- 'Family Issues': 'Example: "I need help with guardianship" or "I need a simple will created"',
1641
- 'Foreclosure': 'Example: "I need help to avoid foreclosure on my house"',
1642
- 'Guardianship': 'Example: "I need help with guardianship documents"',
1643
- 'Harassment and Discrimination': 'Example: "I am being discriminated at work" or "My neighbor is harassing me"',
1644
- 'Sexual Harassment': 'Example: "I am being sexually harassed by a coworker"',
1645
- 'Workplace Harassment': 'Example: "My coworker is being aggressive towards me"',
1646
- 'Non-Workplace Harassment': 'Example: "My neighbor is harassing me"',
1647
- 'Workplace Discrimination': 'Example: "I am being discriminated at work based on my age"',
1648
- 'Non-Workplace Discrimination': 'Example: "I am being discriminated against by a local official"',
1649
- 'Identity Theft': 'Example: "Someone stole my identity and I need help fixing the issue"',
1650
- 'Immigration and Visas': 'Example: "I need help filing for a visa" or "Help with a green card"',
1651
- 'Insurance': 'Example: "I need help filing an insurance claim for damage to my house"',
1652
- 'Landlord and Tenant': 'Example: "I need help to fight an eviction" or "I would like a lawyer to review a rental contract"',
1653
- 'Lemon Law': 'Example: "I purchased a new vehicle that broke down already and seller will not assist"',
1654
- 'Long Term Disability': 'Example: "I was injured on the job and would like to file for benefits" or "I need help filing for disability benefits"',
1655
- 'Medical Malpractice': 'Example: "A doctor performed surgery on the wrong limb and I would like to file a lawsuit"',
1656
- 'Patents and Intellectual Property': 'Example: "I would like to file for a patent" or "I need to copyright a name"',
1657
- 'Personal Injury': 'Example: "I was bit by the neighbor\'s dog" or "I fell in the icy grocery store parking lot"',
1658
- 'Power of Attorney': 'Example: "I need help with a limited or general power of attorney"',
1659
- 'Probate and Estates': 'Example: "I need help with planning for my estate" or "A family member passed without a will in place"',
1660
- 'Product Liability': 'Example: "My car battery caught on fire" or "I purchased a faulty product"',
1661
- 'Property Damage': 'Example: "The neighbor\'s tree fell on my fence" or "My car was hit in the parking lot"',
1662
- 'Real Estate': 'Example: "I need help with a quitclaim deed" or "I need a lawyer to review a purchase and sales agreement"',
1663
- 'Social Security Disability and Insurance': 'Example: "I would like help filing for disability benefits" or "I\'ve been denied for SSDI and would like to appeal"',
1664
- 'Tax and IRS': 'Example: "I need help fighting an IRS tax claim" or "I need audit defense"',
1665
- 'Traffic and Tickets': 'Example: "I need help reinstating a supsended license" or "I would like to fight a traffic ticket"',
1666
- 'Unemployment': 'Example: "I need help filing for unemployment benefits"',
1667
- 'Victim of a Crime': 'Example: "I was assaulted in the store" or "I am being discriminated against at work"',
1668
- 'Wills and Trusts': 'Example: "I need a simple will created" or "I would like guidance on creating a trust fund"',
1669
- 'Workers Compensation': 'Example: "I was injured at work and would like to file for workers compensation benefits"',
1670
- 'Wrongful Death': 'Example: "A family member was killed on the job and we need legal representation"',
1671
- 'Wrongful Termination': 'Example: "I was fired by my employer without cause"',
1672
- 'Not Sure or Other': 'Example: "I was involved in a car accident" or "I need help setting up power of attorney"'
1896
+ Adoption: 'Example: "I need help with adoption forms"',
1897
+ "Asbestos and Mesothelioma": 'Example: "I was exposed to asbestos at work and would like to file a claim"',
1898
+ "Auto and Car Accidents":
1899
+ 'Example: "A truck crashed into my car on the highway" or "I\'ve been involved in a hit and run accident"',
1900
+ Bankruptcy: 'Example: "I need help filing for bankruptcy"',
1901
+ "Birth Certificate and Name Change": 'Example: "Just married and would like to change my last name"',
1902
+ "Business Lawyers": 'Example: "I need help incorporating a business" or "I would like a legal contract reviewed"',
1903
+ "Child Custody and Support": 'Example: "Need help getting custody" or "Issues with child support payments"',
1904
+ "Child Custody": 'Example: "Need help getting custody"',
1905
+ "Child Support": 'Example: "Issues with child support payments"',
1906
+ "Civil Rights and Discrimination": 'Example: "Police brutality" or "Coworker keeps harassing me"',
1907
+ "Civil Lawsuit":
1908
+ 'Example: "A contractor took my money and never completed the job" or "I am being sued by a neighbor"',
1909
+ "File a Lawsuit": 'Example: "A contractor took my money and never completed the job"',
1910
+ "Defend a Lawsuit": 'Example: "I am being sued by a neighbor"',
1911
+ "Consumer Lawyers":
1912
+ 'Example: "Someone committed fraud against me" or "A contractor took my money and never completed the job"',
1913
+ "Copyrights and Trademarks": 'Example: "I would like to register a trademark or copyright a name"',
1914
+ "Criminal and Felony":
1915
+ 'Example: "I was arrested for DUI and need legal defense" or "I am being charged with assault"',
1916
+ "Debt and Collections": 'Example: "I would like to consolidate my debt" or "A collection agency is harassing me"',
1917
+ "Divorce and Separation": 'Example: "I would like to file for an uncontested divorce"',
1918
+ "DUI and DWI": 'Example: "I was arrested for DUI and need legal defense"',
1919
+ "Elder Law": 'Example: "I would like help with Estate Planning" or "I need help with a guardianship"',
1920
+ "Employment and Workplace": 'Example: "I was injured while on the job" or "My company is discriminating against me"',
1921
+ Expungement: 'Example: "I would like to file for an expungement and clear my record"',
1922
+ "Family Issues": 'Example: "I need help with guardianship" or "I need a simple will created"',
1923
+ Foreclosure: 'Example: "I need help to avoid foreclosure on my house"',
1924
+ Guardianship: 'Example: "I need help with guardianship documents"',
1925
+ "Harassment and Discrimination": 'Example: "I am being discriminated at work" or "My neighbor is harassing me"',
1926
+ "Sexual Harassment": 'Example: "I am being sexually harassed by a coworker"',
1927
+ "Workplace Harassment": 'Example: "My coworker is being aggressive towards me"',
1928
+ "Non-Workplace Harassment": 'Example: "My neighbor is harassing me"',
1929
+ "Workplace Discrimination": 'Example: "I am being discriminated at work based on my age"',
1930
+ "Non-Workplace Discrimination": 'Example: "I am being discriminated against by a local official"',
1931
+ "Identity Theft": 'Example: "Someone stole my identity and I need help fixing the issue"',
1932
+ "Immigration and Visas": 'Example: "I need help filing for a visa" or "Help with a green card"',
1933
+ Insurance: 'Example: "I need help filing an insurance claim for damage to my house"',
1934
+ "Landlord and Tenant":
1935
+ 'Example: "I need help to fight an eviction" or "I would like a lawyer to review a rental contract"',
1936
+ "Lemon Law": 'Example: "I purchased a new vehicle that broke down already and seller will not assist"',
1937
+ "Long Term Disability":
1938
+ 'Example: "I was injured on the job and would like to file for benefits" or "I need help filing for disability benefits"',
1939
+ "Medical Malpractice": 'Example: "A doctor performed surgery on the wrong limb and I would like to file a lawsuit"',
1940
+ "Patents and Intellectual Property": 'Example: "I would like to file for a patent" or "I need to copyright a name"',
1941
+ "Personal Injury": 'Example: "I was bit by the neighbor\'s dog" or "I fell in the icy grocery store parking lot"',
1942
+ "Power of Attorney": 'Example: "I need help with a limited or general power of attorney"',
1943
+ "Probate and Estates":
1944
+ 'Example: "I need help with planning for my estate" or "A family member passed without a will in place"',
1945
+ "Product Liability": 'Example: "My car battery caught on fire" or "I purchased a faulty product"',
1946
+ "Property Damage": 'Example: "The neighbor\'s tree fell on my fence" or "My car was hit in the parking lot"',
1947
+ "Real Estate":
1948
+ 'Example: "I need help with a quitclaim deed" or "I need a lawyer to review a purchase and sales agreement"',
1949
+ "Social Security Disability and Insurance":
1950
+ 'Example: "I would like help filing for disability benefits" or "I\'ve been denied for SSDI and would like to appeal"',
1951
+ "Tax and IRS": 'Example: "I need help fighting an IRS tax claim" or "I need audit defense"',
1952
+ "Traffic and Tickets":
1953
+ 'Example: "I need help reinstating a supsended license" or "I would like to fight a traffic ticket"',
1954
+ Unemployment: 'Example: "I need help filing for unemployment benefits"',
1955
+ "Victim of a Crime": 'Example: "I was assaulted in the store" or "I am being discriminated against at work"',
1956
+ "Wills and Trusts": 'Example: "I need a simple will created" or "I would like guidance on creating a trust fund"',
1957
+ "Workers Compensation": 'Example: "I was injured at work and would like to file for workers compensation benefits"',
1958
+ "Wrongful Death": 'Example: "A family member was killed on the job and we need legal representation"',
1959
+ "Wrongful Termination": 'Example: "I was fired by my employer without cause"',
1960
+ "Not Sure or Other": 'Example: "I was involved in a car accident" or "I need help setting up power of attorney"',
1673
1961
  };
1674
1962
 
1675
1963
  const TOLPFinalHeadlines = {
@@ -1677,49 +1965,64 @@ const TOLPFinalHeadlines = {
1677
1965
  };
1678
1966
 
1679
1967
  const TOLPFinalSubHeadlines = {
1680
- 'Adoption': 'You may benefit from speaking with an adoption professional. Please verify your contact information.',
1968
+ Adoption: "You may benefit from speaking with an adoption professional. Please verify your contact information.",
1681
1969
  // 'Asbestos and Mesothelioma': '',
1682
- 'Auto and Car Accidents': 'You may benefit from speaking with an accident professional. Please verify your contact information.',
1683
- 'Bankruptcy': 'You may benefit from speaking with a bankruptcy professional. Please verify your contact information.',
1970
+ "Auto and Car Accidents":
1971
+ "You may benefit from speaking with an accident professional. Please verify your contact information.",
1972
+ Bankruptcy: "You may benefit from speaking with a bankruptcy professional. Please verify your contact information.",
1684
1973
  // 'Birth Certificate and Name Change': '',
1685
1974
  // 'Business Lawyers': '',
1686
1975
  // 'Child Custody and Support': '',
1687
1976
  // 'Civil Rights and Discrimination': '',
1688
1977
  // 'Civil Lawsuit': '',
1689
1978
  // 'Consumer Lawyers': '',
1690
- 'Copyrights and Trademarks': 'You may benefit from speaking with a copyright and trademark professional. Please verify your contact information.',
1979
+ "Copyrights and Trademarks":
1980
+ "You may benefit from speaking with a copyright and trademark professional. Please verify your contact information.",
1691
1981
  // 'Criminal and Felony': '',
1692
1982
  // 'Debt and Collections': '',
1693
- 'Divorce and Separation': 'You may benefit from speaking with a divorce professional. Please verify your contact information.',
1694
- 'DUI and DWI': 'You may benefit from speaking with a DUI professional. Please verify your contact information.',
1695
- 'Elder Law': 'You may benefit from speaking with an elder law professional. Please verify your contact information.',
1983
+ "Divorce and Separation":
1984
+ "You may benefit from speaking with a divorce professional. Please verify your contact information.",
1985
+ "DUI and DWI": "You may benefit from speaking with a DUI professional. Please verify your contact information.",
1986
+ "Elder Law": "You may benefit from speaking with an elder law professional. Please verify your contact information.",
1696
1987
  // 'Employment and Workplace': '',
1697
1988
  // 'Expungement': '',
1698
1989
  // 'Family Issues': '',
1699
- 'Foreclosure': 'You may benefit from speaking with a foreclosure professional. Please verify your contact information.',
1700
- 'Guardianship': 'You may benefit from speaking with a guardianship professional. Please verify your contact information.',
1990
+ Foreclosure: "You may benefit from speaking with a foreclosure professional. Please verify your contact information.",
1991
+ Guardianship:
1992
+ "You may benefit from speaking with a guardianship professional. Please verify your contact information.",
1701
1993
  // 'Harassment and Discrimination': '',
1702
1994
  // 'Identity Theft': '',
1703
- 'Immigration and Visas': 'You may benefit from speaking with a immigration professional. Please verify your contact information.',
1995
+ "Immigration and Visas":
1996
+ "You may benefit from speaking with a immigration professional. Please verify your contact information.",
1704
1997
  // 'Insurance': '',
1705
- 'Landlord and Tenant': 'You may benefit from speaking with a landlord and tenant legal professional. Please verify your contact information.',
1998
+ "Landlord and Tenant":
1999
+ "You may benefit from speaking with a landlord and tenant legal professional. Please verify your contact information.",
1706
2000
  // 'Lemon Law': '',
1707
- 'Long Term Disability': 'You may benefit from speaking with a disability legal professional. Please verify your contact information.',
1708
- 'Medical Malpractice': 'You may benefit from speaking with a malpractice professional. Please verify your contact information.',
1709
- 'Patents and Intellectual Property': 'You may benefit from speaking with a patent professional. Please verify your contact information.',
1710
- 'Personal Injury': 'You may benefit from speaking with a personal injury professional. Please verify your contact information.',
2001
+ "Long Term Disability":
2002
+ "You may benefit from speaking with a disability legal professional. Please verify your contact information.",
2003
+ "Medical Malpractice":
2004
+ "You may benefit from speaking with a malpractice professional. Please verify your contact information.",
2005
+ "Patents and Intellectual Property":
2006
+ "You may benefit from speaking with a patent professional. Please verify your contact information.",
2007
+ "Personal Injury":
2008
+ "You may benefit from speaking with a personal injury professional. Please verify your contact information.",
1711
2009
  // 'Power of Attorney': '',
1712
- 'Probate and Estates': 'You may benefit from speaking with a probate and estate professional. Please verify your contact information.',
2010
+ "Probate and Estates":
2011
+ "You may benefit from speaking with a probate and estate professional. Please verify your contact information.",
1713
2012
  // 'Product Liability': '',
1714
2013
  // 'Property Damage': '',
1715
- 'Real Estate': 'You may benefit from speaking with a real estate professional. Please verify your contact information.',
1716
- 'Social Security Disability and Insurance': 'You may benefit from speaking with an SSDI professional. Please verify your contact information.',
1717
- 'Tax and IRS': 'You may benefit from speaking with a tax professional. Please verify your contact information.',
2014
+ "Real Estate":
2015
+ "You may benefit from speaking with a real estate professional. Please verify your contact information.",
2016
+ "Social Security Disability and Insurance":
2017
+ "You may benefit from speaking with an SSDI professional. Please verify your contact information.",
2018
+ "Tax and IRS": "You may benefit from speaking with a tax professional. Please verify your contact information.",
1718
2019
  // 'Traffic and Tickets': '',
1719
- 'Unemployment': 'You may benefit from speaking with an unemployment professional. Please verify your contact information.',
2020
+ Unemployment:
2021
+ "You may benefit from speaking with an unemployment professional. Please verify your contact information.",
1720
2022
  // 'Victim of a Crime': '',
1721
2023
  // 'Wills and Trusts': '',
1722
- 'Workers Compensation': 'You may benefit from speaking with a workers compensation professional. Please verify your contact information.',
2024
+ "Workers Compensation":
2025
+ "You may benefit from speaking with a workers compensation professional. Please verify your contact information.",
1723
2026
  // 'Wrongful Death': '',
1724
2027
  // 'Wrongful Termination': '',
1725
2028
  // 'Not Sure or Other': ''
@@ -1732,37 +2035,31 @@ const TOLPFinalSubHeadlines = {
1732
2035
 
1733
2036
  const nextStepsMapLegalLegacy = {
1734
2037
  values: {
1735
- '*': [
1736
- 'TOLPQuestions',
1737
- 'commentsWithBankruptcy',
1738
- 'legalCrossSells',
1739
- 'firstAndLast',
1740
- 'contactInfo',
1741
- ]
1742
- }
2038
+ "*": ["TOLPQuestions", "commentsWithBankruptcy", "legalCrossSells", "firstAndLast", "contactInfo"],
2039
+ },
1743
2040
  };
1744
2041
 
1745
2042
  const nextStepsMapLegalCrossSells = {
1746
2043
  values: {
1747
- 'Legal_CrossSells': {
1748
- 'Auto and Car Accidents': ['autoAndCarAccidentCrossSellQuestions'],
1749
- 'Personal Injury': ['personalInjuryCrossSellQuestions'],
1750
- 'Workers Compensation': ['workersCompensationCrossSellQuestions'],
1751
- 'DUI and DWI': ['duiAndDWICrossSellQuestions'],
1752
- 'Long Term Disability': ['longTermDisabilityCrossSellQuestions'],
1753
- 'Social Security Disability and Insurance': ['ssdiCrossSellQuestions'],
1754
- 'Bankruptcy': ['bankruptcyCrossSellQuestions'],
1755
- 'Power of Attorney': ['powerOfAttorneyCrossSellQuestions'],
1756
- 'Wills and Trusts': ['willsAndTrustsCrossSellQuestions'],
1757
- 'Divorce and Separation': ['divorceAndSeparationCrossSellQuestions'],
1758
- 'Child Custody': ['childCustodyCrossSellQuestions'],
2044
+ Legal_CrossSells: {
2045
+ "Auto and Car Accidents": ["autoAndCarAccidentCrossSellQuestions"],
2046
+ "Personal Injury": ["personalInjuryCrossSellQuestions"],
2047
+ "Workers Compensation": ["workersCompensationCrossSellQuestions"],
2048
+ "DUI and DWI": ["duiAndDWICrossSellQuestions"],
2049
+ "Long Term Disability": ["longTermDisabilityCrossSellQuestions"],
2050
+ "Social Security Disability and Insurance": ["ssdiCrossSellQuestions"],
2051
+ Bankruptcy: ["bankruptcyCrossSellQuestions"],
2052
+ "Power of Attorney": ["powerOfAttorneyCrossSellQuestions"],
2053
+ "Wills and Trusts": ["willsAndTrustsCrossSellQuestions"],
2054
+ "Divorce and Separation": ["divorceAndSeparationCrossSellQuestions"],
2055
+ "Child Custody": ["childCustodyCrossSellQuestions"],
1759
2056
  },
1760
- '*': ['firstAndLast', 'contactInfo'],
2057
+ "*": ["firstAndLast", "contactInfo"],
1761
2058
  },
1762
-
2059
+
1763
2060
  // NOTE: this assumes a certain placement of the cross sell question
1764
2061
  // in the form flow.
1765
- appendSteps: ['firstAndLast', 'contactInfo'],
2062
+ appendSteps: ["firstAndLast", "contactInfo"],
1766
2063
  matchesAllowed: 1,
1767
2064
  };
1768
2065