bhl-forms 0.12.5 → 0.12.6

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.
@@ -0,0 +1,1878 @@
1
+ function merge() {
2
+ return Object.assign({}, ...arguments)
3
+ }
4
+
5
+ // Default is zone 4 for post-form redirect
6
+ function RedirectUrl(domain, vertical, category, zone = 4) {
7
+ return 'https://listings.' + domain + '/api/v1/redirect?zone_id=' + zone + '&sub_id=${properties.vid}&vertical=' + encodeURIComponent(vertical) + '&category=' + encodeURIComponent(category)
8
+ }
9
+
10
+ function RedirectUrlComments(domain, vertical, category) {
11
+ return RedirectUrl(domain, vertical, category) + '&Comments=${properties.Comments}'
12
+ }
13
+
14
+ const DEFAULT_COMMENTS_LABEL = "Please briefly describe your issue in a few words:";
15
+ const DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC =
16
+ '$getKey($meta, "commentsPlaceholders." + $get(Category).value, $meta.defaultCommentsPlaceholder)';
17
+
18
+ const DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL =
19
+ '$getKey($meta, "commentsPlaceholders." + $get(Type_Of_Legal_Problem).value, $meta.defaultCommentsPlaceholder)';
20
+ const DEFAULT_FINAL_HEADLINE_LEGAL = "Connect With The Legal Help You Deserve";
21
+ const DEFAULT_FINAL_HEADLINE_DYNAMIC =
22
+ '$getKey($meta, "finalHeadlines." + ($get(Type_Of_Legal_Problem).value || $get(Category).value), $meta.defaultFinalHeadline)';
23
+ const DEFAULT_FINAL_SUBHEADLINE_LEGAL = "Get a no-obligation consultation with a legal expert.";
24
+ const DEFAULT_FINAL_SUBHEADLINE_DYNAMIC =
25
+ '$getKey($meta, "finalSubHeadlines." + ($get(Type_Of_Legal_Problem).value || $get(Category).value), $meta.defaultFinalSubHeadline)';
26
+ const TCPA_LANGUAGE_LEGAL =
27
+ 'By checking this box, I agree to the Terms of Use and consent to be contacted by <a href="/providers" target="_blank">lawyers, lawyer networks, and partners</a> of this website using live, autodialed, pre-recorded, or artificial voice calls and text messages, at any time including before 8 AM or after 9 PM local time. 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.';
28
+
29
+ // ------ Common Base Settings
30
+
31
+ const ensureIds = (cfg) => {
32
+ if (cfg.name && !cfg.id) {
33
+ cfg.id = cfg.name;
34
+ }
35
+ return cfg
36
+ };
37
+
38
+ const radio = (updates) => {
39
+ ensureIds(updates);
40
+ return merge(
41
+ {
42
+ $formkit: "radio",
43
+ validation: "required",
44
+ validationMessages: {
45
+ required: "Field is required",
46
+ },
47
+ optionsClass: "t-pt-3 t-pl-1",
48
+ legendClass: "required",
49
+ },
50
+ updates
51
+ )
52
+ };
53
+
54
+ // TODO: rename
55
+ const col2RadioCenter = (updates) => {
56
+ updates.legendClass = "required t-w-[100%] t-text-center";
57
+ if (typeof updates.fieldsetClass === "undefined") {
58
+ updates.fieldsetClass = "$reset t-flex t-justify-center";
59
+ }
60
+ updates.innerClass = "t-items-start";
61
+ updates.wrapperClass = "$reset t-flex t-cursor-pointer t-mb-3";
62
+ updates.optionClass = "t-pl-4 sm:t-pl-8 sm:t-min-w-[200px]";
63
+ updates.optionsClass = "t-pl-0 sm:t-pl-4 t-pt-3 t-grid t-grid-cols-1 sm:t-grid-cols-2";
64
+ updates.messagesClass = "t-flex t-justify-center";
65
+ updates.helpClass = "t-mt-0 t-mb-4 !t-text-sm t-text-center";
66
+ return radio(updates)
67
+ };
68
+
69
+ const sbs2ColRadio = (updates) => {
70
+ updates.legendClass = "legend-left-flex md:t-max-w-[40%] required";
71
+ updates.fieldsetClass = "$reset side-by-side-flex";
72
+ updates.optionsClass = "md:t-ml-4 md:t-mt-2 t-grid t-grid-cols-1 md:t-grid-cols-2-125";
73
+ updates.innerClass = "t-flex t-items-start";
74
+ updates.wrapperClass = "$reset t-flex t-cursor-pointer t-mb-3";
75
+ return radio(updates)
76
+ };
77
+
78
+ const sbs2ItemRadio = (updates) => {
79
+ updates.legendClass = "legend-left t-pb-1 required";
80
+ updates.fieldsetClass = "$reset side-by-side t-items-center";
81
+ updates.optionsClass = "t-mt-1 t-grid t-grid-cols-1 md:t-grid-cols-2-125 t-items-center";
82
+ updates.innerClass = "t-flex t-items-center";
83
+ updates.optionClass = "t-pr-1";
84
+ return radio(updates)
85
+ };
86
+
87
+ const sbsYesNoRadio = (updates) => {
88
+ updates.options = ["Yes", "No"];
89
+ return sbs2ItemRadio(updates)
90
+ };
91
+
92
+ const verticalButtonRadio = (updates) => {
93
+ updates.legendClass = "legend-left";
94
+ updates.fieldsetClass = "$reset t-flex t-justify-center t-flex-col-reverse t-items-center";
95
+ if (typeof updates.optionsClass === "undefined") {
96
+ updates.optionsClass = "t-flex t-flex-col sm:t-flex-row t-justify-center t-my-3";
97
+ }
98
+ updates.optionClass = "radiobtn t-my-2 sm:t-my-0 t-mx-2 md:t-mx-5";
99
+ updates.wrapperClass = "$reset formkit-wrapper t-mb-0 t-flex t-items-center t-h-[100%]";
100
+ updates.labelClass = "t-font-semibold t-text-[#1e448f] t-w-[100%]";
101
+ updates.decoratorIcon = false;
102
+ updates.messagesClass = "t-flex t-justify-center";
103
+ updates.helpClass = "t-mt-2.5 !t-text-sm t-text-center";
104
+ return radio(updates)
105
+ };
106
+
107
+ const verticalYesNoRadio = (updates) => {
108
+ updates.options = ["Yes", "No"];
109
+ updates.optionsClass = "t-flex t-justify-center t-my-3";
110
+ return verticalButtonRadio(updates)
111
+ };
112
+
113
+ const text = (updates) => {
114
+ ensureIds(updates);
115
+ return merge(
116
+ {
117
+ $formkit: "text",
118
+ validation: "required",
119
+ validationMessages: {
120
+ required: "Field is required",
121
+ },
122
+ labelClass: "required",
123
+ },
124
+ updates
125
+ )
126
+ };
127
+
128
+ const sbsText = (updates) => {
129
+ updates.wrapperClass = "side-by-side t-items-center";
130
+ return text(updates)
131
+ };
132
+
133
+ const verticalText = (updates) => {
134
+ updates.wrapperClass = "t-flex t-justify-center";
135
+ updates.messagesClass = "t-flex t-justify-center";
136
+ updates.inputClass = "t-text-center";
137
+ updates.helpClass = "t-mt-2.5 !t-text-sm t-text-center";
138
+ return text(updates)
139
+ };
140
+
141
+ const textArea = (updates) => {
142
+ ensureIds(updates);
143
+ return merge(
144
+ {
145
+ $formkit: "textarea",
146
+ rows: 5,
147
+ maxlength: 500,
148
+ validation: "required",
149
+ validationMessages: {
150
+ required: "Field is required",
151
+ },
152
+ innerClass: "t-max-w-xl",
153
+ labelClass: "required",
154
+ },
155
+ updates
156
+ )
157
+ };
158
+
159
+ const date = (updates) => {
160
+ ensureIds(updates);
161
+ return merge(
162
+ {
163
+ $formkit: "DatePicker",
164
+ validation: "required",
165
+ validationMessages: {
166
+ required: "Field is required",
167
+ },
168
+ labelClass: "required t-block t-mb-3 t-font-semibold t-text-base formkit-invalid:t-text-red-500",
169
+ innerClass:
170
+ "t-border t-border-gray-400 formkit-invalid:t-border-red-500 t-rounded t-mb-1 focus-within:t-border-blue-500",
171
+ },
172
+ updates
173
+ )
174
+ };
175
+
176
+ const sbsDate = (updates) => {
177
+ updates.wrapperClass = "side-by-side t-items-center";
178
+ return date(updates)
179
+ };
180
+
181
+ const verticalDate = (updates) => {
182
+ updates.wrapperClass = "t-flex t-justify-center";
183
+ updates.inputClass = "t-text-center";
184
+ updates.messagesClass = "t-flex t-justify-center";
185
+ return date(updates)
186
+ };
187
+
188
+ const email = (scope, vertical, updates = {}) => {
189
+ const func = vertical ? verticalText : sbsText;
190
+ const label = vertical ? updates.label : "Email Address:";
191
+ return func({
192
+ $formkit: "email",
193
+ name: scope ? scope + ":" + "Email" : "Email",
194
+ label,
195
+ placeholder: "email@domain.com",
196
+ autocomplete: "email",
197
+ "data-tf-sensitive": "false",
198
+ validation: "required|email",
199
+ validationMessages: {
200
+ required: "Email is required",
201
+ email: "Invalid Email",
202
+ },
203
+ ...updates,
204
+ })
205
+ };
206
+
207
+ const firstName = (scope, vertical, updates = {}) => {
208
+ const func = vertical ? verticalText : sbsText;
209
+ const label = vertical ? updates.label : "First Name:";
210
+ return func({
211
+ label,
212
+ placeholder: "First Name",
213
+ name: scope ? scope + ":" + "First_Name" : "First_Name",
214
+ autocomplete: "given-name",
215
+ validationMessages: {
216
+ required: "First Name is required",
217
+ },
218
+ ...updates,
219
+ })
220
+ };
221
+
222
+ const lastName = (scope, vertical, updates = {}) => {
223
+ const func = vertical ? verticalText : sbsText;
224
+ const label = vertical ? updates.label : "Last Name:";
225
+ return func({
226
+ label,
227
+ placeholder: "Last Name",
228
+ name: scope ? scope + ":" + "Last_Name" : "Last_Name",
229
+ autocomplete: "family-name",
230
+ validationMessages: {
231
+ required: "Last Name is required",
232
+ },
233
+ ...updates,
234
+ })
235
+ };
236
+
237
+ const phone = (scope, vertical, updates = {}) => {
238
+ const func = vertical ? verticalText : sbsText;
239
+ const label = vertical ? updates.label : "Phone Number:";
240
+ return func({
241
+ $formkit: "tel",
242
+ name: scope ? scope + ":" + "Primary_Phone" : "Primary_Phone",
243
+ label,
244
+ placeholder: updates.placeholder || "###-###-####",
245
+ maxlength: 12,
246
+ help: updates.help || "10-digit phone number, hyphens optional",
247
+ autocomplete: "tel-national",
248
+ "data-tf-sensitive": "false",
249
+ validation: "required|matches:/^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$/|valid_phone",
250
+ validationMessages: {
251
+ required: "Phone Number is required",
252
+ matches: "Invalid Phone Format, use ###-###-####",
253
+ valid_phone: "Invalid Phone Number",
254
+ },
255
+ helpClass: "t-mt-2.5 md:t-text-right md:t-mt-[-2px]",
256
+ ...updates,
257
+ })
258
+ };
259
+
260
+ const zipcode$1 = (scope, vertical, updates = {}) => {
261
+ const func = vertical ? verticalText : sbsText;
262
+ const label = vertical ? updates.label : "Zip Code:";
263
+ const help = vertical ? updates.help ?? "We try to match you with local help" : null;
264
+ return func({
265
+ label,
266
+ help,
267
+ placeholder: "#####",
268
+ name: scope ? scope + ":" + "Zip" : "Zip",
269
+ maxlength: 5,
270
+ inputmode: "numeric",
271
+ autocomplete: "postal-code",
272
+ validation: "required|matches:/^[0-9]{5}$/",
273
+ validationMessages: {
274
+ required: "Zip Code is required",
275
+ matches: "Invalid Zip Code",
276
+ },
277
+ ...updates,
278
+ })
279
+ };
280
+
281
+ const autoDamageFromAccident$1 = (scope, vertical, updates = {}) => {
282
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
283
+ const label = vertical ? updates.label : "Auto Damage from Accident?";
284
+ return func(
285
+ merge(
286
+ {
287
+ label,
288
+ name: scope ? scope + ":" + "Auto_Damage_From_Accident" : "Auto_Damage_From_Accident",
289
+ },
290
+ updates
291
+ )
292
+ )
293
+ };
294
+
295
+ const wouldLikeMVAConsultation$1 = (scope, vertical, updates = {}) => {
296
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
297
+ const label = vertical ? updates.label : "Would You Like a Free MVA Consultation?";
298
+ return func(
299
+ merge(
300
+ {
301
+ label,
302
+ name: scope ? scope + ":" + "Would_Like_MVA_Consultation" : "Would_Like_MVA_Consultation",
303
+ help: "Note: we'll still connect you for a mechanic.",
304
+ },
305
+ updates
306
+ )
307
+ )
308
+ };
309
+
310
+ const atFault$1 = (scope, vertical, updates = {}) => {
311
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
312
+ const label = vertical ? updates.label : "Were You at Fault?";
313
+ return func(
314
+ merge(
315
+ {
316
+ label,
317
+ name: scope ? scope + ":" + "At_Fault" : "At_Fault",
318
+ },
319
+ updates
320
+ )
321
+ )
322
+ };
323
+
324
+ // TODO: vertical not supported yet
325
+ const comments = (scope, vertical, updates) =>
326
+ textArea(
327
+ merge(
328
+ {
329
+ name: scope ? scope + ":" + "Comments" : "Comments",
330
+ label: "Please briefly describe your situation in a few words:",
331
+ placeholder:
332
+ 'For Example: "I would like help with child support payments" or "I need help with visitation rights"',
333
+ },
334
+ updates
335
+ )
336
+ );
337
+
338
+ const doctorTreatment$1 = (scope, vertical, updates = {}) => {
339
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
340
+ const label = vertical ? updates.label : "Have You Recently Been Treated by a Doctor, Hospital or Clinic?";
341
+ return func(
342
+ merge(
343
+ {
344
+ name: scope ? scope + ":" + "Doctor_Treatment" : "Doctor_Treatment",
345
+ label,
346
+ },
347
+ updates
348
+ )
349
+ )
350
+ };
351
+
352
+ const haveAttorney$1 = (scope, vertical, updates = {}) => {
353
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
354
+ const label = vertical ? updates.label : "Already Working with An Attorney?";
355
+ return func(
356
+ merge(
357
+ {
358
+ label,
359
+ name: scope ? scope + ":" + "Have_Attorney" : "Have_Attorney",
360
+ },
361
+ updates
362
+ )
363
+ )
364
+ };
365
+
366
+ const incidentDate$1 = (scope, vertical, updates = {}) => {
367
+ const func = vertical ? verticalDate : sbsDate;
368
+ const label = vertical ? updates.label : "Date of Incident:";
369
+ return func(
370
+ merge(
371
+ {
372
+ label,
373
+ name: scope ? scope + ":" + "Incident_Date" : "Incident_Date",
374
+ },
375
+ updates
376
+ )
377
+ )
378
+ };
379
+
380
+ const mechanicsCrossSells = (scope) =>
381
+ radio({
382
+ id: scope ? scope + ":" + "Mechanics_CrossSells" : "Mechanics_CrossSells",
383
+ name: scope ? scope + ":" + "Mechanics_CrossSells" : "Mechanics_CrossSells",
384
+ // label: 'Click all that apply (optional):',
385
+ fieldsetClass: "$reset",
386
+ wrapperClass: "t-mb-2",
387
+ optionsClass: "t-pt-3",
388
+ legendClass: "",
389
+ validation: null,
390
+ options: {
391
+ // 'Auto and Car Accidents': "I was involved in a car accident",
392
+ // "Auto Insurance": "I'd like to reduce my auto insurance bill (optional)",
393
+ "Auto Insurance": "Save up to $700* on my auto insurance (optional)",
394
+ },
395
+ });
396
+
397
+ const primaryInjury$1 = (scope, vertical, updates = {}) => {
398
+ const func = vertical ? col2RadioCenter : sbs2ColRadio;
399
+ const label = vertical ? updates.label : "Primary Injury:";
400
+ return func(
401
+ merge(
402
+ {
403
+ label,
404
+ name: scope ? scope + ":" + "Primary_Injury" : "Primary_Injury",
405
+ options: [
406
+ "Anxiety",
407
+ "Back or Neck Pain",
408
+ "Broken Bones",
409
+ "Cuts and Bruises",
410
+ "Headaches",
411
+ "Memory Loss",
412
+ "Loss of Limb",
413
+ "Not Sure or Other",
414
+ ],
415
+ },
416
+ updates
417
+ )
418
+ )
419
+ };
420
+
421
+ const policeReportFiled$1 = (scope, vertical, updates = {}) => {
422
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
423
+ const label = vertical ? updates.label : "Was a Police Report Filed?";
424
+ return func(
425
+ merge(
426
+ {
427
+ name: scope ? scope + ":" + "Police_Report_Filed" : "Police_Report_Filed",
428
+ label,
429
+ },
430
+ updates
431
+ )
432
+ )
433
+ };
434
+
435
+ const TCPAConsent = (scope, updates = {}) => ({
436
+ $formkit: "checkbox",
437
+ label: "$meta.tcpaLanguage",
438
+ // Necessary to get links to work in the tcpa language
439
+ __raw__sectionsSchema: {
440
+ label: { attrs: { innerHTML: "$label" } },
441
+ },
442
+ name: scope ? scope + ":" + "TCPA_Opt_In" : "TCPA_Opt_In",
443
+ "data-tf-sensitive": "false",
444
+ validation: "required|accepted",
445
+ validationMessages: {
446
+ required: "Consent is required",
447
+ accepted: "Consent is required",
448
+ },
449
+ classes: {
450
+ outer: updates.outerClass ? updates.outerClass : "",
451
+ wrapper: updates.wrapperClass ? updates.wrapperClass : "",
452
+ messages: updates.messagesClass ? updates.messagesClass : "",
453
+ label:
454
+ "!t-text-[0.7rem] t-text-slate-500 t-font-normal !t-leading-[0.9rem]" +
455
+ (updates.labelClass ? " " + updates.labelClass : ""),
456
+ },
457
+ });
458
+
459
+ const NEXT_ON_ENTER = "$onEnter($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))";
460
+ const NEXT_ON_INPUT = "$onInput($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))";
461
+
462
+ const isInput = (n) => {
463
+ return n.type !== "group" && n.type !== "section" && n.type !== "form" && n.$formkit !== "hidden" && !n.children
464
+ };
465
+
466
+ const findLastInput = (n) => {
467
+ if (isInput(n)) {
468
+ return n
469
+ }
470
+ for (var i = n.children.length - 1; i >= 0; i--) {
471
+ if (typeof n.children === "string") {
472
+ continue
473
+ }
474
+ const child = n.children[i];
475
+ if (isInput(child)) {
476
+ return child
477
+ }
478
+ const res = findLastInput(child);
479
+ if (res) {
480
+ return res
481
+ }
482
+ }
483
+ return null
484
+ };
485
+
486
+ const secureIconDefault = {
487
+ $el: "div",
488
+ if: "$activeStep === $lastStep()",
489
+ attrs: {
490
+ class: "t-flex t-justify-center t-items-center t-text-sm t-text-gray-500",
491
+ },
492
+ children: [
493
+ {
494
+ $el: "img",
495
+ attrs: {
496
+ loading: "lazy",
497
+ alt: "",
498
+ style: {
499
+ border: 0,
500
+ },
501
+ width: "25",
502
+ height: "25",
503
+ src: "https://d27hmee62k45vz.cloudfront.net/lock_icon_1.jpeg",
504
+ },
505
+ },
506
+ {
507
+ $el: "span",
508
+ children: "Secure & Encrypted",
509
+ attrs: {
510
+ class: "t-pl-2 t-pt-1 t-font-medium",
511
+ },
512
+ },
513
+ ],
514
+ };
515
+
516
+ function secureIcon(updates = {}) {
517
+ return merge(secureIconDefault, updates)
518
+ }
519
+
520
+ function verticalStepHeadline(updates) {
521
+ return {
522
+ $el: "h3",
523
+ children: updates.headline || "Tell Us About Your Situation",
524
+ attrs: {
525
+ class:
526
+ "t-flex t-justify-center t-text-center t-text-lg sm:t-text-xl t-font-bold t-text-dark t-pb-5 t-pt-0 t-px-1" +
527
+ " " +
528
+ (updates.headlineClass || ""),
529
+ },
530
+ }
531
+ }
532
+
533
+ function verticalStepSubHeadline(updates) {
534
+ return {
535
+ $el: "h5",
536
+ children: updates.subheadline || "",
537
+ attrs: {
538
+ class:
539
+ "t-flex t-justify-center t-text-center !t-text-lg t-font-normal t-text-dark t-pb-5 t-pt-0 t-px-1" +
540
+ " " +
541
+ (updates.subheadlineClass || ""),
542
+ },
543
+ }
544
+ }
545
+
546
+ function commentsStepHeadline(updates) {
547
+ return {
548
+ $el: "h3",
549
+ children: updates.headline || "Additional Details",
550
+ attrs: {
551
+ class:
552
+ "t-flex t-justify-center t-text-center t-text-lg sm:t-text-xl t-font-bold t-text-blue-500 t-pb-5 t-pt-0 t-px-1" +
553
+ " " +
554
+ (updates.headlineClass || ""),
555
+ },
556
+ }
557
+ }
558
+
559
+ function firstAndLastStepHeadline(updates) {
560
+ return {
561
+ $el: "h3",
562
+ children: updates.headline || "Please Provide a Contact Name",
563
+ attrs: {
564
+ class:
565
+ "t-flex t-justify-center t-text-center t-text-xl t-font-bold t-text-blue-500 t-pb-5 t-pt-0 t-px-1" +
566
+ " " +
567
+ (updates.headlineClass || ""),
568
+ },
569
+ }
570
+ }
571
+
572
+ function contactStepHeadline(updates) {
573
+ return {
574
+ $el: "h3",
575
+ children: updates.headline || DEFAULT_FINAL_HEADLINE_DYNAMIC,
576
+ attrs: {
577
+ class:
578
+ "t-flex t-justify-center t-text-center !t-text-xl md:!t-text-2xl t-font-bold t-text-blue-500 t-pb-3 t-pt-4 t-px-1" +
579
+ " " +
580
+ (updates.headlineClass || "") +
581
+ " f-contact-info-headline",
582
+ },
583
+ }
584
+ }
585
+
586
+ function contactStepSubHeadline(updates) {
587
+ return {
588
+ $el: "h5",
589
+ children: updates.subheadline || DEFAULT_FINAL_SUBHEADLINE_DYNAMIC,
590
+ attrs: {
591
+ class:
592
+ "t-flex t-justify-center t-text-center !t-text-base md:!t-text-lg t-font-semibold t-pb-6 t-pt-0 t-px-3" +
593
+ " " +
594
+ (updates.subheadlineClass || "") +
595
+ " f-contact-info-subheadline",
596
+ },
597
+ }
598
+ }
599
+
600
+ const TRUSTED_FORM_JS = `(function() {
601
+ if (window.xxTrustedFormLoaded) {
602
+ return
603
+ }
604
+ var vid = '';
605
+ if (typeof window.zar !== 'undefined') {
606
+ vid = window.zar.getVID();
607
+ }
608
+ window.xxTrustedFormLoaded = true;
609
+ var sandbox = document.location.hostname.indexOf('localhost') > -1 ? 'true' : 'false'
610
+ var tf = document.createElement('script');
611
+ tf.type = 'text/javascript'; tf.async = true;
612
+ tf.src = ("https:" == document.location.protocol ? 'https' : 'http') + "://api.trustedform.com/trustedform.js?field=xxTrustedFormCertUrl&identifier=" + vid + "&ping_field=xxTrustedFormPingUrl&provideReferrer=false&invert_field_sensitivity=true&sandbox=" + sandbox + "&l=" + new Date().getTime() + Math.random();
613
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(tf, s);
614
+ })();`;
615
+
616
+ function trustedFormScript() {
617
+ return {
618
+ $el: "script",
619
+ if: "$activeStep === $lastStep()",
620
+ children: TRUSTED_FORM_JS,
621
+ }
622
+ }
623
+
624
+ const stepDefaults = (step, stepKey) => ({
625
+ $el: "section",
626
+ if: '$stepEnabled("' + step + '")',
627
+ attrs: {
628
+ hidden: '$activeStep !== "' + step + '"',
629
+ key: stepKey ? stepKey : step,
630
+ },
631
+ });
632
+
633
+ function step(name, inputs, updates = {}) {
634
+ const {
635
+ nextOnEnter = true,
636
+ nextOnInput = false,
637
+ stepKey = undefined,
638
+ nextStepMap = undefined,
639
+ triggerRedirectMap = undefined,
640
+ autoFocus = undefined,
641
+ } = updates;
642
+
643
+ if (inputs && inputs.length && (nextOnEnter || nextOnInput)) {
644
+ const lastInput = findLastInput(inputs[inputs.length - 1]);
645
+ if (lastInput && nextOnEnter === true) {
646
+ lastInput.onKeypress = NEXT_ON_ENTER;
647
+ }
648
+ if (lastInput && nextOnInput === true) {
649
+ lastInput.onInput = NEXT_ON_INPUT;
650
+ }
651
+ }
652
+
653
+ const mergeUpdates = {
654
+ children: [
655
+ {
656
+ $formkit: "group",
657
+ id: name,
658
+ name: name,
659
+ nextStepMap: nextStepMap,
660
+ triggerRedirectMap: triggerRedirectMap,
661
+ autoFocus: autoFocus,
662
+ children: inputs,
663
+ },
664
+ ],
665
+ };
666
+
667
+ if (typeof updates.if !== "undefined") {
668
+ mergeUpdates.if = updates.if;
669
+ }
670
+
671
+ return merge(stepDefaults(name, stepKey), mergeUpdates)
672
+ }
673
+
674
+ // Single question step
675
+ function sqstep(name, input, defaultHeadline, updates = {}) {
676
+ if (typeof updates.nextOnInput === "undefined") {
677
+ updates.nextOnInput = true;
678
+ }
679
+
680
+ return step(
681
+ name,
682
+ [
683
+ verticalStepHeadline({
684
+ headline: updates.headline ?? defaultHeadline,
685
+ headlineClass: updates.headlineClass,
686
+ }),
687
+ ...(Array.isArray(input) ? input : [input]),
688
+ ],
689
+ updates
690
+ )
691
+ }
692
+
693
+ function commentsHeadline(updates = {}) {
694
+ const mergedUpdates = { ...updates, nextOnEnter: false };
695
+
696
+ return step(
697
+ "comments",
698
+ [
699
+ commentsStepHeadline(updates),
700
+ comments(updates.scope, false, {
701
+ label: typeof updates.label === "undefined" ? DEFAULT_COMMENTS_LABEL : updates.label,
702
+ placeholder: updates.placeholder || DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC,
703
+ inputClass: typeof updates.inputClass === "undefined" ? "!t-h-32" : updates.inputClass,
704
+ innerClass: typeof updates.innerClass === "undefined" ? "t-max-w-xl" : updates.innerClass,
705
+ wrapperClass: typeof updates.wrapperClass === "undefined" ? undefined : updates.wrapperClass,
706
+ }),
707
+ ],
708
+ mergedUpdates
709
+ )
710
+ }
711
+
712
+ function commentsMechanics(updates = {}) {
713
+ return step(
714
+ "commentsMechanics",
715
+ [
716
+ // commentsStepHeadline(updates),
717
+ comments(updates.scope, false, {
718
+ label: typeof updates.label === "undefined" ? DEFAULT_COMMENTS_LABEL : updates.label,
719
+ placeholder: updates.placeholder || DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC,
720
+ inputClass: "!t-h-20",
721
+ }),
722
+ mechanicsCrossSells(updates.scope),
723
+ ],
724
+ updates
725
+ )
726
+ }
727
+
728
+ function contactInfo(updates = {}) {
729
+ return step(
730
+ "contactInfo",
731
+ [
732
+ contactStepHeadline(updates),
733
+ contactStepSubHeadline(updates),
734
+ trustedFormScript(),
735
+ email(updates.scope),
736
+ phone(updates.scope),
737
+ TCPAConsent(updates.scope),
738
+ secureIcon(),
739
+ ],
740
+ { nextOnEnter: false }
741
+ )
742
+ }
743
+
744
+ function firstAndLastV3(updates = {}) {
745
+ return step(
746
+ "firstAndLast",
747
+ [
748
+ firstAndLastStepHeadline({
749
+ headline: updates.headline ?? "Who is looking for help?",
750
+ headlineClass: updates.headlineClass,
751
+ }),
752
+ verticalStepSubHeadline({
753
+ subheadline: updates.subheadline ?? "We never share info without consent",
754
+ subheadlineClass: "!t-text-sm !t-text-gray-500",
755
+ }),
756
+ firstName(updates.scope),
757
+ lastName(updates.scope),
758
+ ],
759
+ updates
760
+ )
761
+ }
762
+
763
+ function zipcode(updates = {}) {
764
+ return sqstep("zipcode", zipcode$1(updates.scope, true, updates.input), "Please verify your Zip Code", updates)
765
+ }
766
+
767
+ function autoDamageFromAccident(updates = {}) {
768
+ return step("autoDamageFromAccident", [autoDamageFromAccident$1(updates.scope, true, updates.input)], updates)
769
+ }
770
+
771
+ function wouldLikeMVAConsultation(updates = {}) {
772
+ return step(
773
+ "wouldLikeMVAConsultation",
774
+ [
775
+ verticalStepHeadline({
776
+ headline: updates.headline ?? "Do you want a free legal evaluation?",
777
+ }),
778
+ verticalStepSubHeadline({
779
+ subheadline: updates.subheadline ?? "You may be entitled to compensation for your accident.",
780
+ subheadlineClass: "!t-text-blue-900 !t-font-semibold",
781
+ }),
782
+ {
783
+ $formkit: "hidden",
784
+ name: "CrossSell:Auto_and_Car_Accidents:Type_Of_Legal_Problem",
785
+ id: "CrossSell:Auto_and_Car_Accidents:Type_Of_Legal_Problem",
786
+ value: "Auto and Car Accidents",
787
+ },
788
+ {
789
+ $formkit: "hidden",
790
+ name: "CrossSell:Auto_and_Car_Accidents:vertical",
791
+ value: "Legal",
792
+ },
793
+ wouldLikeMVAConsultation$1(updates.scope, true, updates.input),
794
+ ],
795
+ updates
796
+ )
797
+ }
798
+
799
+ function haveAttorney(updates = {}) {
800
+ return sqstep(
801
+ "haveAttorney",
802
+ haveAttorney$1(updates.scope, true, updates.input),
803
+ "Already working with an attorney?",
804
+ updates
805
+ )
806
+ }
807
+
808
+ function incidentDate(updates = {}) {
809
+ return sqstep(
810
+ "incidentDate",
811
+ incidentDate$1(updates.scope, true, updates.input),
812
+ "When did the incident occur?",
813
+ updates
814
+ )
815
+ }
816
+
817
+ function doctorTreatment(updates = {}) {
818
+ return sqstep(
819
+ "doctorTreatment",
820
+ doctorTreatment$1(updates.scope, true, updates.input),
821
+ "Have you seen a doctor about this?",
822
+ updates
823
+ )
824
+ }
825
+
826
+ function atFault(updates = {}) {
827
+ return sqstep("atFault", atFault$1(updates.scope, true, updates.input), "Were you at fault?", updates)
828
+ }
829
+
830
+ function primaryInjury(updates = {}) {
831
+ return sqstep(
832
+ "primaryInjury",
833
+ primaryInjury$1(updates.scope, true, updates.input),
834
+ "What was the primary injury?",
835
+ updates
836
+ )
837
+ }
838
+
839
+ function policeReportFiled(updates = {}) {
840
+ return sqstep(
841
+ "policeReportFiled",
842
+ policeReportFiled$1(updates.scope, true, updates.input),
843
+ "Was a police report filed?",
844
+ updates
845
+ )
846
+ }
847
+
848
+ const formNavigation = (updates = {}) => ({
849
+ $el: "div",
850
+ attrs: {
851
+ class: {
852
+ if: "$activeStep === $firstStep()",
853
+ then: "step-nav " + (updates.firstStepButtonClass || "!t-justify-center sm:!t-justify-between"),
854
+ else: "step-nav !t-justify-between",
855
+ },
856
+ },
857
+ children: [
858
+ {
859
+ $formkit: "button",
860
+ name: "back_button",
861
+ onClick: "$setPreviousStep($prevStepFunc($get(form)))",
862
+ children: "Back",
863
+ outerClass: {
864
+ if: "$activeStep === $firstStep()",
865
+ then: "t-hidden sm:t-block",
866
+ else: "",
867
+ },
868
+ style: {
869
+ if: "$activeStep === $firstStep()",
870
+ then: "display: none;",
871
+ },
872
+ classes: {
873
+ input: (updates.inputClass || "") + " f-navigation-input",
874
+ },
875
+ },
876
+ {
877
+ $formkit: "button",
878
+ name: "next_button",
879
+ onClick: "$setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form)))",
880
+ children: {
881
+ if: "$activeStep === $firstStep()",
882
+ then: updates.startText || "Start",
883
+ else: "Next",
884
+ },
885
+ outerClass: {
886
+ if: "$activeStep === $lastStep()",
887
+ then: "t-hidden",
888
+ else: "",
889
+ },
890
+ style: {
891
+ if: "$activeStep === $lastStep()",
892
+ then: "display: none;",
893
+ },
894
+ classes: {
895
+ input: (updates.inputClass || "") + " f-navigation-input",
896
+ },
897
+ },
898
+ {
899
+ $formkit: "submit",
900
+ name: "submit_button",
901
+ label: updates.submitLabel || "Submit",
902
+ if: "$activeStep === $lastStep()",
903
+ style: {
904
+ if: "$activeStep !== $lastStep()",
905
+ then: "display: none;",
906
+ },
907
+ classes: {
908
+ input: (updates.inputClass || "") + " !t-ml-2 sm:!t-ml-auto f-navigation-input",
909
+ },
910
+ },
911
+ ],
912
+ });
913
+
914
+ const formDetails = () => ({
915
+ $el: "pre",
916
+ if: '$urlParam("fdbg", "") == 1',
917
+ children: [
918
+ {
919
+ $el: "pre",
920
+ children: "$stringify( $get(form).value )",
921
+ attrs: {
922
+ class: "t-text-xs",
923
+ style: "overflow: scroll",
924
+ },
925
+ },
926
+ {
927
+ $el: "pre",
928
+ children: ["activeStep: ", "$activeStep"],
929
+ attrs: {
930
+ class: "t-text-xs",
931
+ style: "overflow: scroll",
932
+ },
933
+ },
934
+ {
935
+ $el: "pre",
936
+ children: ["stepHistory: ", "$stepHistory"],
937
+ attrs: {
938
+ class: "t-text-xs",
939
+ style: "overflow: scroll",
940
+ },
941
+ },
942
+ {
943
+ $el: "pre",
944
+ children: ["stepQueue: ", "$stepQueue"],
945
+ attrs: {
946
+ class: "t-text-xs",
947
+ style: "overflow: scroll",
948
+ },
949
+ },
950
+ {
951
+ $el: "pre",
952
+ children: ["steps: ", "$stepKeys()"],
953
+ attrs: {
954
+ class: "t-text-xs",
955
+ style: "overflow: scroll",
956
+ },
957
+ },
958
+ ],
959
+ });
960
+
961
+ const formPropDefaults = {
962
+ type: "form",
963
+ id: "form",
964
+ config: { validationVisibility: "submit" },
965
+ onSubmit: '$submit($submitUrl, $prepData, $handleRedirect, "text/plain; charset=UTF-8")',
966
+ plugins: "$plugins",
967
+ actions: false,
968
+ anchorElement: "form-anchor",
969
+ useLocalStorage: true,
970
+ prepop: {
971
+ fromURL: true,
972
+ },
973
+ errorCodes: {
974
+ 403: { message: "An Error Occurred", abort: false },
975
+ 409: { abort: false },
976
+ 429: "An Error Occurred",
977
+ 504: { message: "An Error Occurred", abort: false },
978
+ },
979
+ formClass: "!t-max-w-[40rem]",
980
+ };
981
+
982
+ function filterMapByKey(obj, keyList) {
983
+ return Object.fromEntries(Object.entries(obj).filter(([key]) => keyList.includes(key)))
984
+ }
985
+
986
+ // export function filteredNextStepsMapLegal(keyList) {
987
+ // const res = { Type_Of_Legal_Problem: filterMapByKey(nextStepsMapGeneralLegal["Type_Of_Legal_Problem"], keyList) }
988
+ // res["*"] = nextStepsMapGeneralLegal["*"]
989
+ // return res
990
+ // }
991
+
992
+ function formProps(updates) {
993
+ const props = merge(formPropDefaults, updates);
994
+ if (props.formId && !props.name) {
995
+ props.name = props.formId;
996
+ }
997
+ return props
998
+ }
999
+
1000
+ const metaDefaults = {};
1001
+
1002
+ function metaProps(updates) {
1003
+ const data = merge(metaDefaults, updates);
1004
+ return {
1005
+ type: "meta",
1006
+ data,
1007
+ }
1008
+ }
1009
+
1010
+ function defaultMetaPropsLegal(tolps = null) {
1011
+ let commentsPlaceholders = TOLPCommentsPlaceholders;
1012
+ let finalHeadlines = TOLPFinalHeadlines;
1013
+ let finalSubHeadlines = TOLPFinalSubHeadlines;
1014
+ if (tolps) {
1015
+ commentsPlaceholders = filterMapByKey(TOLPCommentsPlaceholders, tolps);
1016
+ finalHeadlines = filterMapByKey(TOLPFinalHeadlines, tolps);
1017
+ finalSubHeadlines = filterMapByKey(TOLPFinalSubHeadlines, tolps);
1018
+ }
1019
+ return metaProps({
1020
+ tcpaLanguage: TCPA_LANGUAGE_LEGAL,
1021
+ defaultCommentsPlaceholder: DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL,
1022
+ commentsPlaceholders: commentsPlaceholders,
1023
+ defaultFinalHeadline: DEFAULT_FINAL_HEADLINE_LEGAL,
1024
+ finalHeadlines: finalHeadlines,
1025
+ defaultFinalSubHeadline: DEFAULT_FINAL_SUBHEADLINE_LEGAL,
1026
+ finalSubHeadlines: finalSubHeadlines,
1027
+ })
1028
+ }
1029
+
1030
+ function dynamicSchemaNode(field = "Type_Of_Legal_Problem") {
1031
+ return {
1032
+ $cmp: "FormKitSchema",
1033
+ if: "$get(" + field + ").value",
1034
+ props: {
1035
+ schema: "$meta.dynamicSchema",
1036
+ data: "$buildData($meta)",
1037
+ },
1038
+ }
1039
+ }
1040
+
1041
+ const formAnchorDefaults = {
1042
+ $el: "div",
1043
+ children: [
1044
+ {
1045
+ $el: "div",
1046
+ attrs: {
1047
+ id: "form-anchor",
1048
+ class: "t-absolute",
1049
+ style: { top: "-30px", left: 0 },
1050
+ },
1051
+ },
1052
+ ],
1053
+ attrs: {
1054
+ class: "t-relative",
1055
+ },
1056
+ };
1057
+
1058
+ function formAnchor(updates) {
1059
+ return merge(formAnchorDefaults, updates)
1060
+ }
1061
+
1062
+ function headlineDefaults(updates = {}) {
1063
+ return {
1064
+ $el: "h1",
1065
+ attrs: {
1066
+ class:
1067
+ "t-flex t-justify-center t-text-center t-text-[1.7rem] sm:t-text-[2rem] t-font-semibold t-pt-5 t-px-7 md:t-px-3" +
1068
+ " " +
1069
+ (updates.headlineClass || "") +
1070
+ " f-first-headline",
1071
+ },
1072
+ }
1073
+ }
1074
+
1075
+ function headline(updates = {}) {
1076
+ return merge(headlineDefaults(updates), updates)
1077
+ }
1078
+
1079
+ function subHeadlineDefaults(updates = {}) {
1080
+ return {
1081
+ $el: "h3",
1082
+ attrs: {
1083
+ class:
1084
+ "t-flex t-justify-center t-text-center t-text-[1.1rem] md:t-text-[1.2rem] t-font-medium t-text-blue-500 t-px-10 t-pb-3" +
1085
+ " " +
1086
+ (updates.subheadlineClass || "") +
1087
+ " f-first-subheadline",
1088
+ },
1089
+ }
1090
+ }
1091
+
1092
+ function subHeadline(updates = {}) {
1093
+ return merge(subHeadlineDefaults(updates), updates)
1094
+ }
1095
+
1096
+ const hiddenInputsBase = [
1097
+ {
1098
+ $formkit: "hidden",
1099
+ name: "gclid",
1100
+ value: null,
1101
+ },
1102
+ {
1103
+ $formkit: "hidden",
1104
+ name: "campaignid",
1105
+ value: null,
1106
+ },
1107
+ {
1108
+ $formkit: "hidden",
1109
+ name: "s",
1110
+ value: null,
1111
+ },
1112
+ ];
1113
+
1114
+ const hiddenInputsMechanics = [
1115
+ {
1116
+ $formkit: "hidden",
1117
+ name: "vertical",
1118
+ value: "AutoRepair",
1119
+ },
1120
+ {
1121
+ $formkit: "hidden",
1122
+ name: "Category",
1123
+ id: "Category",
1124
+ value: "Mechanics",
1125
+ },
1126
+ ...hiddenInputsBase,
1127
+ ];
1128
+
1129
+ const TOLPCommentsPlaceholders = {
1130
+ Adoption: 'Example: "I need help with adoption forms"',
1131
+ "Asbestos and Mesothelioma": 'Example: "I was exposed to asbestos at work and would like to file a claim"',
1132
+ "Auto and Car Accidents":
1133
+ 'Example: "A truck crashed into my car on the highway" or "I\'ve been involved in a hit and run accident"',
1134
+ Bankruptcy: 'Example: "I need help filing for bankruptcy"',
1135
+ "Birth Certificate and Name Change": 'Example: "Just married and would like to change my last name"',
1136
+ "Business Lawyers": 'Example: "I need help incorporating a business" or "I would like a legal contract reviewed"',
1137
+ "Child Custody and Support": 'Example: "Need help getting custody" or "Issues with child support payments"',
1138
+ "Child Custody": 'Example: "Need help getting custody"',
1139
+ "Child Support": 'Example: "Issues with child support payments"',
1140
+ "Civil Rights and Discrimination": 'Example: "Police brutality" or "Coworker keeps harassing me"',
1141
+ "Civil Lawsuit":
1142
+ 'Example: "A contractor took my money and never completed the job" or "I am being sued by a neighbor"',
1143
+ "File a Lawsuit": 'Example: "A contractor took my money and never completed the job"',
1144
+ "Defend a Lawsuit": 'Example: "I am being sued by a neighbor"',
1145
+ "Consumer Lawyers":
1146
+ 'Example: "Someone committed fraud against me" or "A contractor took my money and never completed the job"',
1147
+ "Copyrights and Trademarks": 'Example: "I would like to register a trademark or copyright a name"',
1148
+ "Criminal and Felony":
1149
+ 'Example: "I was arrested for DUI and need legal defense" or "I am being charged with assault"',
1150
+ "Debt and Collections": 'Example: "I would like to consolidate my debt" or "A collection agency is harassing me"',
1151
+ "Divorce and Separation": 'Example: "I would like to file for an uncontested divorce"',
1152
+ "DUI and DWI": 'Example: "I was arrested for DUI and need legal defense"',
1153
+ "Elder Law": 'Example: "I would like help with Estate Planning" or "I need help with a guardianship"',
1154
+ "Employment and Workplace": 'Example: "I was injured while on the job" or "My company is discriminating against me"',
1155
+ Expungement: 'Example: "I would like to file for an expungement and clear my record"',
1156
+ "Family Issues": 'Example: "I need help with guardianship" or "I need a simple will created"',
1157
+ Foreclosure: 'Example: "I need help to avoid foreclosure on my house"',
1158
+ Guardianship: 'Example: "I need help with guardianship documents"',
1159
+ "Harassment and Discrimination": 'Example: "I am being discriminated at work" or "My neighbor is harassing me"',
1160
+ "Sexual Harassment": 'Example: "I am being sexually harassed by a coworker"',
1161
+ "Workplace Harassment": 'Example: "My coworker is being aggressive towards me"',
1162
+ "Non-Workplace Harassment": 'Example: "My neighbor is harassing me"',
1163
+ "Workplace Discrimination": 'Example: "I am being discriminated at work based on my age"',
1164
+ "Non-Workplace Discrimination": 'Example: "I am being discriminated against by a local official"',
1165
+ "Identity Theft": 'Example: "Someone stole my identity and I need help fixing the issue"',
1166
+ "Immigration and Visas": 'Example: "I need help filing for a visa" or "Help with a green card"',
1167
+ Insurance: 'Example: "I need help filing an insurance claim for damage to my house"',
1168
+ "Landlord and Tenant":
1169
+ 'Example: "I need help to fight an eviction" or "I would like a lawyer to review a rental contract"',
1170
+ "Lemon Law": 'Example: "I purchased a new vehicle that broke down already and seller will not assist"',
1171
+ "Long Term Disability":
1172
+ 'Example: "I was injured on the job and would like to file for benefits" or "I need help filing for disability benefits"',
1173
+ "Medical Malpractice": 'Example: "A doctor performed surgery on the wrong limb and I would like to file a lawsuit"',
1174
+ "Patents and Intellectual Property": 'Example: "I would like to file for a patent" or "I need to copyright a name"',
1175
+ "Personal Injury": 'Example: "I was bit by the neighbor\'s dog" or "I fell in the icy grocery store parking lot"',
1176
+ "Power of Attorney": 'Example: "I need help with a limited or general power of attorney"',
1177
+ "Probate and Estates":
1178
+ 'Example: "I need help with planning for my estate" or "A family member passed without a will in place"',
1179
+ "Product Liability": 'Example: "My car battery caught on fire" or "I purchased a faulty product"',
1180
+ "Property Damage": 'Example: "The neighbor\'s tree fell on my fence" or "My car was hit in the parking lot"',
1181
+ "Real Estate":
1182
+ 'Example: "I need help with a quitclaim deed" or "I need a lawyer to review a purchase and sales agreement"',
1183
+ "Social Security Disability and Insurance":
1184
+ 'Example: "I would like help filing for disability benefits" or "I\'ve been denied for SSDI and would like to appeal"',
1185
+ "Tax and IRS": 'Example: "I need help fighting an IRS tax claim" or "I need audit defense"',
1186
+ "Traffic and Tickets":
1187
+ 'Example: "I need help reinstating a supsended license" or "I would like to fight a traffic ticket"',
1188
+ Unemployment: 'Example: "I need help filing for unemployment benefits"',
1189
+ "Victim of a Crime": 'Example: "I was assaulted in the store" or "I am being discriminated against at work"',
1190
+ "Wills and Trusts": 'Example: "I need a simple will created" or "I would like guidance on creating a trust fund"',
1191
+ "Workers Compensation": 'Example: "I broke my arm at work and need help getting compensation"',
1192
+ "Wrongful Death": 'Example: "A family member was killed on the job and we need legal representation"',
1193
+ "Wrongful Termination": 'Example: "I was fired by my employer without cause"',
1194
+ "Not Sure or Other": 'Example: "I was involved in a car accident" or "I need help setting up power of attorney"',
1195
+ };
1196
+
1197
+ const TOLPFinalHeadlines = {
1198
+ Adoption: "Connect With Adoption Professionals Today",
1199
+ "Auto and Car Accidents": "Connect With Accident Professionals Today",
1200
+ Bankruptcy: "Take Control of Your Financial Future",
1201
+ "Birth Certificate and Name Change": "Start Your Change Today",
1202
+ "Business Lawyers": "Connect With Business Professionals Today",
1203
+ "Child Custody": "Connect With Custody Professionals Today",
1204
+ "Child Support": "Connect With Child Support Professionals",
1205
+ // 'Child Custody and Support': '',
1206
+ "Civil Rights and Discrimination": "Stand Up For Your Rights",
1207
+ "Civil Lawsuit": "Connect With Lawsuit Professionals Today",
1208
+ // "Consumer Lawyers": "",
1209
+ "Copyrights and Trademarks": "Protect Your Intellectual Property",
1210
+ // "Criminal and Felony": "Connect With Legal Help",
1211
+ "Debt and Collections": "Connect With Debt Professionals Today",
1212
+ "Divorce and Separation": "Connect With Divorce Professionals Today",
1213
+ "DUI and DWI": "Defend Against DUI Charges",
1214
+ "Elder Law": "Connect With Elder Law Professionals",
1215
+ // "Employment and Workplace": "Connect With Legal Help",
1216
+ Expungement: "Clear Your Record",
1217
+ "Family Issues": "Connect With Family Legal Help",
1218
+ Foreclosure: "Fight to Keep Your Home",
1219
+ Guardianship: "Connect With Guardianship Professionals",
1220
+ // "Harassment and Discrimination": "Connect With Legal Help",
1221
+ // "Identity Theft": "Connect With Legal Help",
1222
+ "Immigration and Visas": "Get Immigration Legal Help",
1223
+ Insurance: "Get Insurance Legal Help",
1224
+ // "Landlord and Tenant": "Connect With Legal Help",
1225
+ "Lemon Law": "Connect With Lemon Law Professionals",
1226
+ "Long Term Disability": "Connect With Disability Professionals",
1227
+ "Medical Malpractice": "Hold Negligent Providers Accountable",
1228
+ "Patents and Intellectual Property": "Connect With IP Professionals Today",
1229
+ "Personal Injury": "Maximize Your Injury Compensation",
1230
+ // "Power of Attorney": "Connect With Legal Help",
1231
+ "Probate and Estates": "Manage Probate with Expert Guidance",
1232
+ "Product Liability": "Get Justice for Faulty Products",
1233
+ // 'Property Damage': 'Connect With Legal Help',
1234
+ "Real Estate": "Connect With Real Estate Professionals",
1235
+ "Sexual Harassment": "Stand Up Against Sexual Harassment",
1236
+ "Social Security Disability and Insurance": "Get the Benefits You Deserve",
1237
+ "Tax and IRS": "Connect With Tax Legal Help",
1238
+ "Traffic and Tickets": "Protect Your Record Today",
1239
+ Unemployment: "Connect With Unemployment Professionals",
1240
+ "Victim of a Crime": "Seek Justice as a Crime Victim",
1241
+ "Wills and Trusts": "Plan Your Estate with Confidence",
1242
+ "Workers Compensation": "Maximize Your Workers' Comp Benefits",
1243
+ "Wrongful Death": "Seek Justice for a Loved One",
1244
+ "Wrongful Termination": "Fight Back Against Unfair Firing Today",
1245
+ // 'Not Sure or Other': ''
1246
+ // 'Workplace Harassment': '',
1247
+ // 'Non-Workplace Harassment': '',
1248
+ // 'Workplace Discrimination': '',
1249
+ // 'Non-Workplace Discrimination': '',
1250
+ };
1251
+
1252
+ const TOLPFinalSubHeadlines = {
1253
+ // Adoption: "You may benefit from speaking with an adoption professional. Please verify your contact information.",
1254
+ // // 'Asbestos and Mesothelioma': '',
1255
+ // "Auto and Car Accidents":
1256
+ // "You may benefit from speaking with an accident professional. Please verify your contact information.",
1257
+ // Bankruptcy: "You may benefit from speaking with a bankruptcy professional. Please verify your contact information.",
1258
+ // // 'Birth Certificate and Name Change': '',
1259
+ // // 'Business Lawyers': '',
1260
+ // // 'Child Custody and Support': '',
1261
+ // // 'Civil Rights and Discrimination': '',
1262
+ // // 'Civil Lawsuit': '',
1263
+ // // 'Consumer Lawyers': '',
1264
+ // "Copyrights and Trademarks":
1265
+ // "You may benefit from speaking with a copyright and trademark professional. Please verify your contact information.",
1266
+ // // 'Criminal and Felony': '',
1267
+ // // 'Debt and Collections': '',
1268
+ // "Divorce and Separation":
1269
+ // "You may benefit from speaking with a divorce professional. Please verify your contact information.",
1270
+ // "DUI and DWI": "You may benefit from speaking with a DUI professional. Please verify your contact information.",
1271
+ // "Elder Law": "You may benefit from speaking with an elder law professional. Please verify your contact information.",
1272
+ // // 'Employment and Workplace': '',
1273
+ // // 'Expungement': '',
1274
+ // // 'Family Issues': '',
1275
+ // Foreclosure: "You may benefit from speaking with a foreclosure professional. Please verify your contact information.",
1276
+ // Guardianship:
1277
+ // "You may benefit from speaking with a guardianship professional. Please verify your contact information.",
1278
+ // // 'Harassment and Discrimination': '',
1279
+ // // 'Identity Theft': '',
1280
+ // "Immigration and Visas":
1281
+ // "You may benefit from speaking with a immigration professional. Please verify your contact information.",
1282
+ // // 'Insurance': '',
1283
+ // "Landlord and Tenant":
1284
+ // "You may benefit from speaking with a landlord and tenant legal professional. Please verify your contact information.",
1285
+ // // 'Lemon Law': '',
1286
+ // "Long Term Disability":
1287
+ // "You may benefit from speaking with a disability legal professional. Please verify your contact information.",
1288
+ // "Medical Malpractice":
1289
+ // "You may benefit from speaking with a malpractice professional. Please verify your contact information.",
1290
+ // "Patents and Intellectual Property":
1291
+ // "You may benefit from speaking with a patent professional. Please verify your contact information.",
1292
+ // "Personal Injury":
1293
+ // "You may benefit from speaking with a personal injury professional. Please verify your contact information.",
1294
+ // // 'Power of Attorney': '',
1295
+ // "Probate and Estates":
1296
+ // "You may benefit from speaking with a probate and estate professional. Please verify your contact information.",
1297
+ // // 'Product Liability': '',
1298
+ // // 'Property Damage': '',
1299
+ // "Real Estate":
1300
+ // "You may benefit from speaking with a real estate professional. Please verify your contact information.",
1301
+ // "Social Security Disability and Insurance":
1302
+ // "You may benefit from speaking with an SSDI professional. Please verify your contact information.",
1303
+ // "Tax and IRS": "You may benefit from speaking with a tax professional. Please verify your contact information.",
1304
+ // // 'Traffic and Tickets': '',
1305
+ // Unemployment:
1306
+ // "You may benefit from speaking with an unemployment professional. Please verify your contact information.",
1307
+ // // 'Victim of a Crime': '',
1308
+ // // 'Wills and Trusts': '',
1309
+ // "Workers Compensation":
1310
+ // "You may benefit from speaking with a workers compensation professional. Please verify your contact information.",
1311
+ // // 'Wrongful Death': '',
1312
+ // // 'Wrongful Termination': '',
1313
+ // // 'Not Sure or Other': ''
1314
+ // // 'Sexual Harassment': '',
1315
+ // // 'Workplace Harassment': '',
1316
+ // // 'Non-Workplace Harassment': '',
1317
+ // // 'Workplace Discrimination': '',
1318
+ // // 'Non-Workplace Discrimination': '',
1319
+ };
1320
+
1321
+ const nextStepsLegalDefault = [
1322
+ "haveAttorney",
1323
+ "degreeOfInterest",
1324
+ "commentsWithBankruptcy",
1325
+ "zipcode",
1326
+ "legalCrossSells",
1327
+ "firstAndLast",
1328
+ "contactInfo",
1329
+ ];
1330
+
1331
+ const nextStepsLegalDefaultLPM = [
1332
+ "haveAttorney",
1333
+ "degreeOfInterest",
1334
+ "lawyerPaymentMethod",
1335
+ "commentsWithBankruptcy",
1336
+ "zipcode",
1337
+ "legalCrossSells",
1338
+ "firstAndLast",
1339
+ "contactInfo",
1340
+ ];
1341
+
1342
+ const nextStepsLegalNoDOI = [
1343
+ "haveAttorney",
1344
+ "commentsWithBankruptcy",
1345
+ "zipcode",
1346
+ "legalCrossSells",
1347
+ "firstAndLast",
1348
+ "contactInfo",
1349
+ ];
1350
+
1351
+ const nextStepsLegalNoHA = [
1352
+ "degreeOfInterest",
1353
+ "commentsWithBankruptcy",
1354
+ "zipcode",
1355
+ "legalCrossSells",
1356
+ "firstAndLast",
1357
+ "contactInfo",
1358
+ ];
1359
+
1360
+ const nextStepsMapGeneralLegal = {
1361
+ values: {
1362
+ Type_Of_Legal_Problem: {
1363
+ Adoption: ["maritalStatus", "haveChildren", ...nextStepsLegalDefaultLPM],
1364
+ "Asbestos and Mesothelioma": ["incidentDate", "doctorTreatment", ...nextStepsLegalDefault],
1365
+ "Auto and Car Accidents": [
1366
+ "incidentDate",
1367
+ "atFault",
1368
+ "primaryInjury",
1369
+ "doctorTreatment",
1370
+ "policeReportFiled",
1371
+ ...nextStepsLegalNoDOI,
1372
+ ],
1373
+ Bankruptcy: ["totalMonthlyIncome", "totalDebt", "ownRealEstate", "valueOfAssets", ...nextStepsLegalDefault],
1374
+ "Business Lawyers": ["businessServices", "businessType", "numEmployeesOfBusiness", ...nextStepsLegalDefault],
1375
+ "Child Custody": ["childRelationship", "childHome", "childPrimaryCaregiver", ...nextStepsLegalDefaultLPM],
1376
+ "Child Support": ["childRelationship", "childHome", "childPrimaryCaregiver", ...nextStepsLegalDefaultLPM],
1377
+ "Civil Rights and Discrimination": ["civilRightsType", ...nextStepsLegalDefault],
1378
+ "Civil Lawsuit": ["civilDefense", "lawsuitOtherParty", ...nextStepsLegalDefault],
1379
+ "File a Lawsuit": ["civilLawsuitTOLPDisplay", "lawsuitOtherParty", ...nextStepsLegalDefault],
1380
+ "Defend a Lawsuit": ["lawsuitOtherParty", ...nextStepsLegalDefault],
1381
+ "Consumer Lawyers": ["consumerLawyerType", "incidentDate", "lawsuitOtherParty", ...nextStepsLegalDefault],
1382
+ "Criminal and Felony": [
1383
+ "criminalTOLPDisplay",
1384
+ "crimeCommittedDate",
1385
+ "roleInMatterCriminal",
1386
+ "pendingCharges",
1387
+ ...nextStepsLegalDefaultLPM,
1388
+ ],
1389
+ "Debt and Collections": [
1390
+ "totalMonthlyIncome",
1391
+ "totalDebt",
1392
+ "ownRealEstate",
1393
+ "valueOfAssets",
1394
+ ...nextStepsLegalDefault,
1395
+ ],
1396
+ "Divorce and Separation": ["maritalStatus", "haveChildren", ...nextStepsLegalDefaultLPM],
1397
+ "DUI and DWI": [
1398
+ "incidentDate",
1399
+ "priorAlcoholOffenses",
1400
+ "typeOfAlcoholTest",
1401
+ "bloodContentAlcoholTest",
1402
+ "pendingCharges",
1403
+ ...nextStepsLegalDefault,
1404
+ ],
1405
+ "Employment and Workplace": [
1406
+ "employmentAndWorkplaceTOLPDisplay",
1407
+ "numEmployeesOfBusiness",
1408
+ "employerType",
1409
+ "employeeAtCompany",
1410
+ ...nextStepsLegalDefault,
1411
+ ],
1412
+ Expungement: ["incidentDate", "criminalChargeType", ...nextStepsLegalDefaultLPM],
1413
+ "Family Issues": ["maritalStatus", "haveChildren", ...nextStepsLegalDefaultLPM],
1414
+ Foreclosure: [
1415
+ "ownRealEstate",
1416
+ "typeOfProperty",
1417
+ "amountPaymentsPastDue",
1418
+ "loanAmount",
1419
+ "defaultNotice",
1420
+ ...nextStepsLegalDefault,
1421
+ ],
1422
+ Guardianship: ["maritalStatus", "haveChildren", ...nextStepsLegalDefaultLPM],
1423
+ "Immigration and Visas": [
1424
+ "countryOfCitizenship",
1425
+ "immigrationLocation",
1426
+ "immigrationEntry",
1427
+ "immigrationType",
1428
+ "immigrationStatus",
1429
+ "immigrationDetails",
1430
+ ...nextStepsLegalDefault,
1431
+ ],
1432
+ "Landlord and Tenant": ["landlordTenantIssue", "landlordTenantParty", ...nextStepsLegalDefault],
1433
+ "Lemon Law": ["incidentDate", "lawsuitOtherParty", ...nextStepsLegalDefault],
1434
+ "Long Term Disability": [
1435
+ "applicantOccupation",
1436
+ "applicantAge",
1437
+ "applicantLTDisabilityPolicy",
1438
+ "applicantDisabilityHowObtain",
1439
+ "applicantPreviouslyAppliedLtdBenefits",
1440
+ "applicantReceivedDisabilityBenefits",
1441
+ "applicantMonthlySalary",
1442
+ ...nextStepsLegalNoDOI,
1443
+ ],
1444
+ "Medical Malpractice": [
1445
+ "incidentDate",
1446
+ "claimStatus",
1447
+ "doctorTreatment",
1448
+ "medicalMalpracticeInjuries",
1449
+ ...nextStepsLegalDefault,
1450
+ ],
1451
+ "Patents and Intellectual Property": ["patentAssistanceType", "patentFor", ...nextStepsLegalDefault],
1452
+ "Personal Injury": [
1453
+ "incidentDate",
1454
+ "claimStatus",
1455
+ "atFault",
1456
+ "primaryInjury",
1457
+ "doctorTreatment",
1458
+ ...nextStepsLegalNoDOI,
1459
+ ],
1460
+ "Probate and Estates": [
1461
+ "valueOfAssets",
1462
+ "typeOfAssets",
1463
+ "roleInMatterProbate",
1464
+ "estateLegalServicesNeeded",
1465
+ ...nextStepsLegalDefault,
1466
+ ],
1467
+ "Property Damage": ["wouldLikeLawyerTo", ...nextStepsLegalDefault],
1468
+ "Real Estate": ["realEstateTOLPDisplay", "realEstateArea", "wouldLikeLawyerTo", ...nextStepsLegalDefault],
1469
+ "Social Security Disability and Insurance": [
1470
+ "applicantAge",
1471
+ "disabilityConditionStopWork",
1472
+ "disabilityWorkHistory",
1473
+ "socialSecurityDisabilityReceivingBenefits",
1474
+ "doctorTreatment",
1475
+ ...nextStepsLegalNoDOI,
1476
+ ],
1477
+ "Tax and IRS": ["totalDebt", "taxProblemDetails", "taxLevel", "taxIssueType", ...nextStepsLegalDefault],
1478
+ "Traffic and Tickets": ["driversLicenseType", "trafficViolations", "haveCourtDate", ...nextStepsLegalDefault],
1479
+ Unemployment: ["numEmployeesOfBusiness", "employerType", ...nextStepsLegalNoHA],
1480
+ "Victim of a Crime": [
1481
+ "crimeCommittedDate",
1482
+ "roleInMatterCriminal",
1483
+ "pendingCharges",
1484
+ ...nextStepsLegalDefaultLPM,
1485
+ ],
1486
+ "Wills and Trusts": [
1487
+ "valueOfAssets",
1488
+ "typeOfAssets",
1489
+ "roleInMatterProbate",
1490
+ "estateLegalServicesNeeded",
1491
+ ...nextStepsLegalDefault,
1492
+ ],
1493
+ "Workers Compensation": [
1494
+ "incidentDate",
1495
+ "claimStatus",
1496
+ "primaryInjury",
1497
+ "causeOfInjury",
1498
+ "doctorTreatment",
1499
+ ...nextStepsLegalNoDOI,
1500
+ ],
1501
+ "Workplace Harassment": ["numEmployeesOfBusiness", "employerType", "employeeAtCompany", ...nextStepsLegalDefault],
1502
+ "Workplace Discrimination": [
1503
+ "numEmployeesOfBusiness",
1504
+ "employerType",
1505
+ "employeeAtCompany",
1506
+ ...nextStepsLegalDefault,
1507
+ ],
1508
+ "Wrongful Death": [
1509
+ "incidentDate",
1510
+ "relationshipToVictim",
1511
+ "criminalChargesFiled",
1512
+ "causeOfDeath",
1513
+ ...nextStepsLegalNoDOI,
1514
+ ],
1515
+ "Wrongful Termination": ["numEmployeesOfBusiness", "employerType", ...nextStepsLegalDefault],
1516
+ },
1517
+ "*": nextStepsLegalDefault,
1518
+ },
1519
+ };
1520
+
1521
+ // Helper to take existing map and trim or replace steps
1522
+ function filterNextStepsMap(nextStepsMap, removableSteps = [], replaceSteps = {}) {
1523
+ const modifiedMap = { ...nextStepsMap };
1524
+
1525
+ function filterSteps(steps) {
1526
+ return steps.filter((step) => !removableSteps.includes(step)).map((step) => replaceSteps[step] || step)
1527
+ }
1528
+
1529
+ function modifyValues(values) {
1530
+ const modifiedValues = {};
1531
+ for (const key in values) {
1532
+ if (Array.isArray(values[key])) {
1533
+ modifiedValues[key] = filterSteps(values[key]);
1534
+ } else if (typeof values[key] === "object") {
1535
+ modifiedValues[key] = modifyValues(values[key]);
1536
+ } else {
1537
+ modifiedValues[key] = values[key];
1538
+ }
1539
+ }
1540
+ return modifiedValues
1541
+ }
1542
+
1543
+ modifiedMap.values = modifyValues(nextStepsMap.values);
1544
+ return modifiedMap
1545
+ }
1546
+
1547
+ filterNextStepsMap(nextStepsMapGeneralLegal, ["legalCrossSells"], {
1548
+ commentsWithBankruptcy: "comments",
1549
+ });
1550
+
1551
+ const TOLPNextSteps = nextStepsMapGeneralLegal["values"]["Type_Of_Legal_Problem"];
1552
+
1553
+ ({
1554
+ values: {
1555
+ Type_Of_Legal_Problem_Display: {
1556
+ "Auto Accident": TOLPNextSteps["Auto and Car Accidents"].filter((step) => step !== "legalCrossSells"),
1557
+ "Workplace Injury": TOLPNextSteps["Workers Compensation"].filter((step) => step !== "legalCrossSells"),
1558
+ "Dog Bite": TOLPNextSteps["Personal Injury"].filter((step) => step !== "legalCrossSells"),
1559
+ "Slip and Fall": TOLPNextSteps["Personal Injury"].filter((step) => step !== "legalCrossSells"),
1560
+ "Trucking Accident": TOLPNextSteps["Auto and Car Accidents"].filter((step) => step !== "legalCrossSells"),
1561
+ "Motorcycle Accident": TOLPNextSteps["Auto and Car Accidents"].filter((step) => step !== "legalCrossSells"),
1562
+ "Other Accidents or Injuries": TOLPNextSteps["Personal Injury"].filter((step) => step !== "legalCrossSells"),
1563
+ },
1564
+ "*": TOLPNextSteps["Personal Injury"].filter((step) => step !== "legalCrossSells"),
1565
+ },
1566
+ });
1567
+
1568
+ ({
1569
+ values: {
1570
+ Type_Of_Legal_Problem: {
1571
+ "Child Custody": TOLPNextSteps["Child Custody"],
1572
+ "Child Support": TOLPNextSteps["Child Support"],
1573
+ "Not Sure or Other": nextStepsMapGeneralLegal["values"]["*"],
1574
+ },
1575
+ "*": TOLPNextSteps["Family Issues"],
1576
+ },
1577
+ });
1578
+
1579
+ ({
1580
+ values: {
1581
+ Type_Of_Legal_Problem_Display: {
1582
+ "Alimony or Child Support": TOLPNextSteps["Child Support"],
1583
+ "Child Custody": TOLPNextSteps["Child Custody"],
1584
+ "Not Sure or Other": nextStepsMapGeneralLegal["values"]["*"],
1585
+ },
1586
+ "*": TOLPNextSteps["Divorce and Separation"],
1587
+ },
1588
+ });
1589
+
1590
+ ({
1591
+ values: {
1592
+ Civil_Defense: {
1593
+ Yes: TOLPNextSteps["Defend a Lawsuit"],
1594
+ No: TOLPNextSteps["File a Lawsuit"],
1595
+ },
1596
+ "*": ["lawsuitOtherParty", ...nextStepsLegalDefault],
1597
+ },
1598
+ });
1599
+
1600
+ const nextStepsMapCivilTolp = {
1601
+ values: {
1602
+ Type_Of_Legal_Problem: {
1603
+ "Defend a Lawsuit": TOLPNextSteps["Defend a Lawsuit"],
1604
+ "File a Lawsuit": TOLPNextSteps["File a Lawsuit"],
1605
+ },
1606
+ "*": ["lawsuitOtherParty", ...nextStepsLegalDefault],
1607
+ },
1608
+ };
1609
+
1610
+ filterNextStepsMap(nextStepsMapCivilTolp, ["legalCrossSells"], {
1611
+ commentsWithBankruptcy: "comments",
1612
+ });
1613
+
1614
+ const nextStepsMapCivilTOLPDisplay = {
1615
+ values: {
1616
+ Type_Of_Legal_Problem_Display: {
1617
+ "Automobile Accident": TOLPNextSteps["Auto and Car Accidents"],
1618
+ "Contract Disputes": TOLPNextSteps["Business Lawyers"],
1619
+ "Dog Bite": TOLPNextSteps["Personal Injury"],
1620
+ "Employment and Workplace": TOLPNextSteps["Employment and Workplace"],
1621
+ Fraud: TOLPNextSteps["Consumer Lawyers"],
1622
+ "Medical Malpractice": TOLPNextSteps["Medical Malpractice"],
1623
+ "Personal Injury": TOLPNextSteps["Personal Injury"],
1624
+ "Property Damage": TOLPNextSteps["Property Damage"],
1625
+ "Real Estate": TOLPNextSteps["Real Estate"],
1626
+ "Not Sure or Other": nextStepsMapGeneralLegal["values"]["*"],
1627
+ },
1628
+ "*": ["lawsuitOtherParty", ...nextStepsLegalDefault],
1629
+ },
1630
+ };
1631
+
1632
+ filterNextStepsMap(nextStepsMapCivilTOLPDisplay, ["legalCrossSells"], {
1633
+ commentsWithBankruptcy: "comments",
1634
+ });
1635
+
1636
+ const nextStepsMapCriminalTOLPDisplay = {
1637
+ values: {
1638
+ Type_Of_Legal_Problem_Display: {
1639
+ "Victim of a Crime": TOLPNextSteps["Victim of a Crime"],
1640
+ "DUI and DWI": TOLPNextSteps["DUI and DWI"],
1641
+ Expungement: TOLPNextSteps["Expungement"],
1642
+ "Not Sure or Other": nextStepsMapGeneralLegal["values"]["*"],
1643
+ },
1644
+ "*": ["crimeCommittedDate", "roleInMatterCriminal", "pendingCharges", ...nextStepsLegalDefaultLPM],
1645
+ },
1646
+ };
1647
+
1648
+ filterNextStepsMap(
1649
+ nextStepsMapCriminalTOLPDisplay,
1650
+ ["legalCrossSells"],
1651
+ {
1652
+ commentsWithBankruptcy: "comments",
1653
+ }
1654
+ );
1655
+
1656
+ const nextStepsMapEmploymentAndWorkplaceTOLPDisplay = {
1657
+ values: {
1658
+ Type_Of_Legal_Problem_Display: {
1659
+ "Wrongful Termination": TOLPNextSteps["Wrongful Termination"],
1660
+ "Workers Compensation": TOLPNextSteps["Workers Compensation"],
1661
+ "Personal Injury": TOLPNextSteps["Personal Injury"],
1662
+ Unemployment: TOLPNextSteps["Unemployment"],
1663
+ },
1664
+ "*": ["numEmployeesOfBusiness", "employerType", "employeeAtCompany", ...nextStepsLegalDefault],
1665
+ },
1666
+ };
1667
+
1668
+ filterNextStepsMap(
1669
+ nextStepsMapEmploymentAndWorkplaceTOLPDisplay,
1670
+ ["legalCrossSells"],
1671
+ {
1672
+ commentsWithBankruptcy: "comments",
1673
+ }
1674
+ );
1675
+
1676
+ ({
1677
+ values: {
1678
+ // Custom because we ask typeOfProperty on s1
1679
+ "*": ["amountPaymentsPastDue", "loanAmount", "defaultNotice", "ownRealEstate", ...nextStepsLegalDefault],
1680
+ },
1681
+ });
1682
+
1683
+ ({
1684
+ values: {
1685
+ Type_Of_Legal_Problem: {
1686
+ "Workplace Harassment": TOLPNextSteps["Workplace Harassment"],
1687
+ "Workplace Discrimination": TOLPNextSteps["Workplace Discrimination"],
1688
+ },
1689
+ "*": [...nextStepsLegalDefault],
1690
+ },
1691
+ });
1692
+
1693
+ ({
1694
+ values: {
1695
+ Type_Of_Legal_Problem: {
1696
+ "Probate and Estates": TOLPNextSteps["Probate and Estates"],
1697
+ "Wills and Trusts": TOLPNextSteps["Wills and Trusts"],
1698
+ "Wrongful Death": TOLPNextSteps["Wrongful Death"],
1699
+ },
1700
+ "*": [...nextStepsLegalDefault],
1701
+ },
1702
+ });
1703
+
1704
+ ({
1705
+ values: {
1706
+ Type_Of_Legal_Problem_Display: {
1707
+ Patents: TOLPNextSteps["Patents and Intellectual Property"],
1708
+ "Business Lawyers": TOLPNextSteps["Business Lawyers"],
1709
+ "Business Consulting": TOLPNextSteps["Business Lawyers"],
1710
+ },
1711
+ "*": nextStepsMapGeneralLegal["values"]["*"],
1712
+ },
1713
+ });
1714
+
1715
+ const nextStepsMapRealEstateTOLPDisplay = {
1716
+ values: {
1717
+ Type_Of_Legal_Problem_Display: {
1718
+ Foreclosure: TOLPNextSteps["Foreclosure"],
1719
+ "Landlord and Tenant": TOLPNextSteps["Landlord and Tenant"],
1720
+ "Wills, Trusts, and Estates": TOLPNextSteps["Wills and Trusts"],
1721
+ "Property Damage": TOLPNextSteps["Property Damage"],
1722
+ },
1723
+ "*": ["realEstateArea", "wouldLikeLawyerTo", ...nextStepsLegalDefault],
1724
+ },
1725
+ };
1726
+
1727
+ filterNextStepsMap(
1728
+ nextStepsMapRealEstateTOLPDisplay,
1729
+ ["legalCrossSells"],
1730
+ {
1731
+ commentsWithBankruptcy: "comments",
1732
+ }
1733
+ );
1734
+
1735
+ const tolps = ["Auto and Car Accidents"];
1736
+
1737
+ const meta = defaultMetaPropsLegal(tolps);
1738
+
1739
+ // All of the dynamic MVA questions get scoped
1740
+ const scope = "CrossSell:Auto_and_Car_Accidents";
1741
+
1742
+ meta.data.dynamicSchema = [
1743
+ incidentDate({
1744
+ scope,
1745
+ nextOnInput: false,
1746
+ }),
1747
+ atFault({
1748
+ scope,
1749
+ }),
1750
+ primaryInjury({
1751
+ scope,
1752
+ }),
1753
+ doctorTreatment({
1754
+ scope,
1755
+ }),
1756
+ policeReportFiled({
1757
+ scope,
1758
+ }),
1759
+ haveAttorney({
1760
+ scope,
1761
+ }),
1762
+ commentsHeadline({
1763
+ scope,
1764
+ label: null,
1765
+ placeholder:
1766
+ 'Example: "A truck crashed into my car on the highway" or "I\'ve been involved in a hit and run accident"',
1767
+ headline: "Please briefly describe the accident:",
1768
+ headlineClass: "!t-text-dark",
1769
+ }),
1770
+ zipcode({
1771
+ scope,
1772
+ help: "We try to match you with local help",
1773
+ }),
1774
+ firstAndLastV3({
1775
+ scope,
1776
+ headlineClass: "!t-text-dark",
1777
+ }),
1778
+ contactInfo({
1779
+ scope,
1780
+ headline: "Connect Now - Final Step",
1781
+ subheadline:
1782
+ "After submitting you'll be connected for a mechanic chat and be contacted for an accident legal consultation.",
1783
+ }),
1784
+ ];
1785
+
1786
+ const schema = [
1787
+ meta,
1788
+ formAnchor(),
1789
+ {
1790
+ $cmp: "FormKit",
1791
+ props: formProps({
1792
+ formId: "mechanicsMVA",
1793
+ popUnderMap: {
1794
+ "properties.Mechanics_CrossSells": {
1795
+ "Auto Insurance": RedirectUrl("answers-now.com", "Insurance", "Auto Insurance"),
1796
+ },
1797
+ },
1798
+ redirectMap: {
1799
+ "*": RedirectUrlComments("answers-now.com", "AutoRepair", "Mechanics"),
1800
+ },
1801
+ formClass: "!t-max-w-[38rem]",
1802
+ }),
1803
+ children: [
1804
+ headline({
1805
+ children: '$urlParam("hl", "Get Instant Car Advice Online")',
1806
+ if: "$activeStep === $firstStep()",
1807
+ }),
1808
+ subHeadline({
1809
+ children: '$urlParam("shl", "Is the issue due to an auto accident?")',
1810
+ if: "$activeStep === $firstStep()",
1811
+ subheadlineClass: "!t-text-dark",
1812
+ }),
1813
+ ...hiddenInputsMechanics,
1814
+ {
1815
+ $formkit: "hidden",
1816
+ name: "CrossSell:Auto_and_Car_Accidents:TCPA_Language",
1817
+ value: "$meta.tcpaLanguage",
1818
+ },
1819
+ {
1820
+ $el: "div",
1821
+ attrs: {
1822
+ class: "form-body",
1823
+ },
1824
+ children: [
1825
+ autoDamageFromAccident({
1826
+ nextOnInput: false,
1827
+ nextStepMap: {
1828
+ values: {
1829
+ Auto_Damage_From_Accident: {
1830
+ Yes: ["wouldLikeMVAConsultation", "commentsMechanics"],
1831
+ No: ["commentsMechanics"],
1832
+ },
1833
+ "*": ["commentsMechanics"],
1834
+ },
1835
+ },
1836
+ }),
1837
+ wouldLikeMVAConsultation({
1838
+ nextOnInput: true,
1839
+ nextStepMap: {
1840
+ values: {
1841
+ Would_Like_MVA_Consultation: {
1842
+ Yes: [
1843
+ "incidentDate",
1844
+ "atFault",
1845
+ "primaryInjury",
1846
+ "doctorTreatment",
1847
+ "policeReportFiled",
1848
+ "haveAttorney",
1849
+ "comments",
1850
+ "zipcode",
1851
+ "firstAndLast",
1852
+ "contactInfo",
1853
+ ],
1854
+ No: ["commentsMechanics"],
1855
+ },
1856
+ "*": ["commentsMechanics"],
1857
+ },
1858
+ },
1859
+ }),
1860
+ dynamicSchemaNode("Auto_Damage_From_Accident"),
1861
+ commentsMechanics({
1862
+ headline: "Last Step: Describe your vehicle issue",
1863
+ headlineClass: "!t-text-dark",
1864
+ label: null,
1865
+ placeholder: 'Example: "I\'m having transmission trouble", or "My car won\'t start"',
1866
+ nextOnEnter: false,
1867
+ }),
1868
+ formNavigation({
1869
+ submitLabel: "Chat Now",
1870
+ }),
1871
+ formDetails(),
1872
+ ],
1873
+ },
1874
+ ],
1875
+ },
1876
+ ];
1877
+
1878
+ export { schema as default };