@getcredify/credify-insurance-widget 1.42.0 → 1.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +18 -0
  2. package/dist/{address-BEVwov8q-C8G87tij.js → address-BEVwov8q-CuX4iOBo.js} +1 -1
  3. package/dist/{api-C7f0dnt7.js → api-DYP3b3gY.js} +15 -15
  4. package/dist/{car-B0hJrE0Z.js → car-CR69ZjJ2.js} +1 -1
  5. package/dist/{check-Dfh9u4c0.js → check-Bo3wjuln.js} +1 -1
  6. package/dist/{copy-applicant-offer-B-BIN2o5-BX-QE7Ao.js → copy-applicant-offer-CqzfNhkJ-C01V9k7v.js} +3 -3
  7. package/dist/{copy-from-record-BNP6CFFR-Bcb9EW-a.js → copy-from-record-BNP6CFFR-B0wsM313.js} +8 -8
  8. package/dist/{core-Po4qPIof-fZL0sXdW.js → core-CrEw_I-E-D_5b2Ij3.js} +1 -1
  9. package/dist/{coverageDerivation-CV2ORogj-CAthw76f.js → coverageDerivation-CV2ORogj-CEEm5ZWr.js} +1 -1
  10. package/dist/{fixtures-ijbZ16Zg-Csnryzo8.js → fixtures-ijbZ16Zg-C9Egb9wf.js} +1 -1
  11. package/dist/{household-prefill-DVLBBva1-GGgzEdDL.js → household-prefill-CmtB9R3R-D86kYzTo.js} +8 -8
  12. package/dist/{householdPrefill-DLm3pxFH-B34UGBGP.js → householdPrefill-DLm3pxFH-BWVN4BLJ.js} +1 -1
  13. package/dist/iframe/assets/{address-BEVwov8q-BpbNiia-.js → address-BEVwov8q-BckjuR7s.js} +1 -1
  14. package/dist/iframe/assets/{car-DkfXVYz0.js → car-DKll0kXc.js} +1 -1
  15. package/dist/iframe/assets/{check-l6TGSrXO.js → check-B9ojZKSs.js} +1 -1
  16. package/dist/iframe/assets/{copy-applicant-offer-B-BIN2o5-cs-SCWuH.js → copy-applicant-offer-CqzfNhkJ-DJkKq7un.js} +1 -1
  17. package/dist/iframe/assets/{copy-from-record-BNP6CFFR-BtCRUQRw.js → copy-from-record-BNP6CFFR-Dk7QPvpr.js} +1 -1
  18. package/dist/iframe/assets/{core-Po4qPIof-jDmdAxP7.js → core-CrEw_I-E-Cgrp_zkJ.js} +1 -1
  19. package/dist/iframe/assets/{coverageDerivation-CV2ORogj-DhQFAhwv.js → coverageDerivation-CV2ORogj-BaQlJ22H.js} +1 -1
  20. package/dist/iframe/assets/{dob-calendar-RIJ5S6YU-DO_r0-z3.js → dob-calendar-RIJ5S6YU-C3ZYmy3v.js} +1 -1
  21. package/dist/iframe/assets/{fixtures-ijbZ16Zg-CUQxYANz.js → fixtures-ijbZ16Zg-B0KKADMf.js} +1 -1
  22. package/dist/iframe/assets/{household-prefill-DVLBBva1-DTK1EHT0.js → household-prefill-CmtB9R3R-DtfByJ8T.js} +1 -1
  23. package/dist/iframe/assets/{householdPrefill-DLm3pxFH-BM54Rqyd.js → householdPrefill-DLm3pxFH-DNBBTd54.js} +1 -1
  24. package/dist/iframe/assets/iframe-Chy4dD4i.js +107 -0
  25. package/dist/iframe/assets/{index-CNb9AhPB.js → index-D81Toecg.js} +2 -2
  26. package/dist/iframe/assets/{intake-review-panel-B7rXvRvm-wNGntinn.js → intake-review-panel-D27t8CZO-CyXFTi_6.js} +1 -1
  27. package/dist/iframe/assets/{mockJump-DpXrnQUq-DKyp2H5R.js → mockJump-hNzgzUmO-B4HifTQZ.js} +1 -1
  28. package/dist/iframe/assets/payload-DrGFAxms-CKeiScMv.js +1 -0
  29. package/dist/iframe/assets/{question-list-ChcBzofd-D5ZVofFR.js → question-list-DFjWa8ZA-5HX-Q_DR.js} +3 -3
  30. package/dist/iframe/assets/{rates-panel-BaIzEqX6-GSsykLkc.js → rates-panel-BSFiWEZX-CUbwWzwJ.js} +3 -3
  31. package/dist/iframe/assets/{review-panel-DYCuhwdo-CyBebe6T.js → review-panel-C_WxX33U-BnudlA3G.js} +2 -2
  32. package/dist/iframe/assets/{stage-Bpq1A5xB-CwZgWOhp.js → stage-knShj71W-BrRsgDlE.js} +1 -1
  33. package/dist/iframe/assets/{validation-DRqHT-u7-pY2KjHw4.js → validation-D42QXxck-DJUS31-5.js} +1 -1
  34. package/dist/iframe/assets/{vehicleCoverage-BPJaWQyg-DBJ_jL3e.js → vehicleCoverage-CBWORI1l-Bs6c4Xhh.js} +1 -1
  35. package/dist/iframe/assets/{visibility-hEdBjgi7-_AUGO8E2.js → visibility-CKRGC3Il-DVTBboJH.js} +1 -1
  36. package/dist/iframe/iframe.html +1 -1
  37. package/dist/{index-CQXR1Un8.js → index-7nmHdjZ4.js} +1 -1
  38. package/dist/index.d.ts +8 -0
  39. package/dist/index.es.js +1 -1
  40. package/dist/index.umd.js +103 -103
  41. package/dist/{intake-review-panel-B7rXvRvm-CDyR-rVg.js → intake-review-panel-D27t8CZO-CKLXjEb0.js} +11 -11
  42. package/dist/{mockJump-DpXrnQUq-BaitU9aZ.js → mockJump-hNzgzUmO-De8oea8T.js} +1 -1
  43. package/dist/{payload-JXpCaeS6-pjITtvlm.js → payload-DrGFAxms-CivFCNuj.js} +4 -4
  44. package/dist/{question-list-ChcBzofd-fVRN9fTl.js → question-list-DFjWa8ZA-sWgoo34K.js} +13 -13
  45. package/dist/{rates-panel-BaIzEqX6-BULjKxqz.js → rates-panel-BSFiWEZX-D2Z8IzSh.js} +36 -36
  46. package/dist/{review-panel-DYCuhwdo-BImR4S06.js → review-panel-C_WxX33U-qkUKI77r.js} +16 -16
  47. package/dist/{stage-Bpq1A5xB-Cphc07aC.js → stage-knShj71W-Cndh8rxW.js} +15 -15
  48. package/dist/utils/placesAuthFailure.d.ts +10 -0
  49. package/dist/utils/prefill.d.ts +18 -0
  50. package/dist/{validation-DRqHT-u7-CL2m7f4k.js → validation-D42QXxck-DFkyiEd-.js} +1 -1
  51. package/dist/{vehicleCoverage-BPJaWQyg-g7bBFmro.js → vehicleCoverage-CBWORI1l-Br309K1G.js} +3 -3
  52. package/dist/{visibility-hEdBjgi7-WW4BVjmf.js → visibility-CKRGC3Il-SsuTwW3e.js} +1 -1
  53. package/dist/{widget-BUAzkBEK.js → widget-Bc0CD2Yh.js} +2834 -2767
  54. package/package.json +2 -2
  55. package/dist/iframe/assets/iframe-BImWklE9.js +0 -107
  56. package/dist/iframe/assets/payload-JXpCaeS6-CcfrGvLo.js +0 -1
package/README.md CHANGED
@@ -429,6 +429,24 @@ configureApi({
429
429
  });
430
430
  ```
431
431
 
432
+ ## Skipping questions you have already asked
433
+
434
+ If your page collects a ZIP or an email of its own, hand them over and the flow
435
+ starts on the first question the visitor has not seen:
436
+
437
+ ```js
438
+ CredifyInsuranceWidget.init({
439
+ partner: { id: 'cp_live_...' },
440
+ prefill: { zip: '78701', email: 'sam@example.com' }
441
+ });
442
+ ```
443
+
444
+ Both are optional and independently applied. A value the flow cannot use — a
445
+ four-digit ZIP, something that is not an address — is dropped and that one
446
+ question is asked as usual, so a bad value costs the shortcut and never the
447
+ quote. A visitor resuming a saved quote is never overwritten: their own answers
448
+ win.
449
+
432
450
  ## Test Mode (internal)
433
451
 
434
452
  Test mode is for walking the **live** flow — real API, real carriers, real SMS —
@@ -1,4 +1,4 @@
1
- import { t as _ } from "./widget-BUAzkBEK.js";
1
+ import { t as _ } from "./widget-Bc0CD2Yh.js";
2
2
  (function() {
3
3
  if (typeof t > "u")
4
4
  var t = { env: {} };
@@ -1,4 +1,4 @@
1
- import { w as i, e as o, Q as t, A as r, D as l, c as u, H as n, z as d, K as f, P as p, b as g, W as c, V as m, d as S, T, j as h, O as y, k as Q, E as k, Y as A, C as E, p as v, _ as P, S as R, a as C, B as _, f as O, m as V, g as b, v as D, M as I, h as K, s as U, x as B, I as F, y as L, i as M, l as Y, L as q, N as x, n as G, o as H, q as N, r as W } from "./widget-BUAzkBEK.js";
1
+ import { Z as i, e as o, X as t, A as r, D as l, c as u, H as n, z as d, K as f, F as p, q as g, W as c, V as m, d as S, T, j as h, O as y, k, E as A, J as E, C as Q, p as v, _ as P, S as R, w as C, B as _, a as O, m as V, Y as b, v as D, N as I, b as F, s as K, x as U, I as B, y as L, f as M, g as Y, L as Z, P as q, M as x, h as G, i as H, l as N } from "./widget-Bc0CD2Yh.js";
2
2
  (function() {
3
3
  if (typeof e > "u")
4
4
  var e = { env: {} };
@@ -21,10 +21,10 @@ export {
21
21
  T as decodeVin,
22
22
  h as dismissDriverPrefill,
23
23
  y as dismissVehiclePrefill,
24
- Q as fetchDriverPrefillSuggestions,
25
- k as fetchVehiclePrefillSuggestions,
26
- A as getApiConfig,
27
- E as getQuestionsByStage,
24
+ k as fetchDriverPrefillSuggestions,
25
+ A as fetchVehiclePrefillSuggestions,
26
+ E as getApiConfig,
27
+ Q as getQuestionsByStage,
28
28
  v as getQuote,
29
29
  P as getRates,
30
30
  R as getStagesForQuote,
@@ -35,17 +35,17 @@ export {
35
35
  b as isTestModeEnabled,
36
36
  D as issueResumeLink,
37
37
  I as loadAuthToken,
38
- K as loadQuoteId,
39
- U as post,
40
- B as prefillProperty,
41
- F as prefillSuggestions,
38
+ F as loadQuoteId,
39
+ K as post,
40
+ U as prefillProperty,
41
+ B as prefillSuggestions,
42
42
  L as redeemResumeToken,
43
43
  M as requestBind,
44
44
  Y as resetApiConfig,
45
- q as resetPrefillSuggestions,
46
- x as saveAuthToken,
47
- G as saveQuoteId,
48
- H as sendSmsCode,
49
- N as updateQuote,
50
- W as verifySmsCode
45
+ Z as resetPrefillSuggestions,
46
+ q as saveAuthToken,
47
+ x as saveQuoteId,
48
+ G as sendSmsCode,
49
+ H as updateQuote,
50
+ N as verifySmsCode
51
51
  };
@@ -1,4 +1,4 @@
1
- import { a4 as e } from "./widget-BUAzkBEK.js";
1
+ import { a4 as e } from "./widget-Bc0CD2Yh.js";
2
2
  (function() {
3
3
  if (typeof c > "u")
4
4
  var c = { env: {} };
@@ -1,4 +1,4 @@
1
- import { a4 as c } from "./widget-BUAzkBEK.js";
1
+ import { a4 as c } from "./widget-Bc0CD2Yh.js";
2
2
  (function() {
3
3
  if (typeof e > "u")
4
4
  var e = { env: {} };
@@ -1,6 +1,6 @@
1
- import { t as d } from "./widget-BUAzkBEK.js";
2
- import { k as y, j as h } from "./visibility-hEdBjgi7-WW4BVjmf.js";
3
- import { u as m, l as f, s as c } from "./copy-from-record-BNP6CFFR-Bcb9EW-a.js";
1
+ import { t as d } from "./widget-Bc0CD2Yh.js";
2
+ import { k as y, j as h } from "./visibility-CKRGC3Il-SsuTwW3e.js";
3
+ import { u as m, l as f, s as c } from "./copy-from-record-BNP6CFFR-B0wsM313.js";
4
4
  import { useMemo as p, useCallback as b } from "react";
5
5
  import { jsx as g } from "react/jsx-runtime";
6
6
  (function() {
@@ -1,9 +1,9 @@
1
- import { a4 as x, a5 as b, G as v } from "./widget-BUAzkBEK.js";
2
- import { j as N } from "./visibility-hEdBjgi7-WW4BVjmf.js";
3
- import { O as f } from "./validation-DRqHT-u7-CL2m7f4k.js";
1
+ import { a4 as x, a5 as b, r as v } from "./widget-Bc0CD2Yh.js";
2
+ import { j as N } from "./visibility-CKRGC3Il-SsuTwW3e.js";
3
+ import { O as f } from "./validation-D42QXxck-DFkyiEd-.js";
4
4
  import { useState as y } from "react";
5
5
  import { jsxs as p, jsx as n, Fragment as k } from "react/jsx-runtime";
6
- import { C as K } from "./check-Dfh9u4c0.js";
6
+ import { C as K } from "./check-Bo3wjuln.js";
7
7
  (function() {
8
8
  if (typeof t > "u")
9
9
  var t = { env: {} };
@@ -78,7 +78,7 @@ var A = {
78
78
  index: i,
79
79
  name: a || `Driver ${i + 1}`
80
80
  }] : [];
81
- }), G = ({ kind: t, source: c, targetQuestions: e }) => {
81
+ }), I = ({ kind: t, source: c, targetQuestions: e }) => {
82
82
  let i = new Map(e.map((d) => [d.key, d])), a = {};
83
83
  for (let [d, o] of Object.entries(A[t])) {
84
84
  let m = i.get(d);
@@ -90,7 +90,7 @@ var A = {
90
90
  }
91
91
  let r = $[t];
92
92
  return r && a[r.occupationKey] !== void 0 && (b(a[r.industryKey])?.includes(String(a[r.occupationKey])) || delete a[r.occupationKey]), a;
93
- }, I = ({ heading: t, body: c, candidates: e, applyLabel: i = "Use these details", onApply: a }) => {
93
+ }, Q = ({ heading: t, body: c, candidates: e, applyLabel: i = "Use these details", onApply: a }) => {
94
94
  let [r, d] = y(e[0]?.index ?? 0), [o, m] = y(null);
95
95
  if (!e.length) return null;
96
96
  if (o) return /* @__PURE__ */ p("p", {
@@ -184,6 +184,6 @@ export {
184
184
  w as U,
185
185
  O as c,
186
186
  B as l,
187
- I as s,
188
- G as u
187
+ Q as s,
188
+ I as u
189
189
  };
@@ -1,4 +1,4 @@
1
- import { a4 as y, af as b } from "./widget-BUAzkBEK.js";
1
+ import { a4 as y, af as b } from "./widget-Bc0CD2Yh.js";
2
2
  (function() {
3
3
  if (typeof e > "u")
4
4
  var e = { env: {} };
@@ -1,4 +1,4 @@
1
- import { t as E } from "./widget-BUAzkBEK.js";
1
+ import { t as E } from "./widget-Bc0CD2Yh.js";
2
2
  (function() {
3
3
  if (typeof r > "u")
4
4
  var r = { env: {} };
@@ -1,4 +1,4 @@
1
- import { t } from "./widget-BUAzkBEK.js";
1
+ import { t } from "./widget-Bc0CD2Yh.js";
2
2
  (function() {
3
3
  if (typeof e > "u")
4
4
  var e = { env: {} };
@@ -1,9 +1,9 @@
1
- import { t as U, j as z, A as D, I as p, O as E, D as L, G as w } from "./widget-BUAzkBEK.js";
2
- import { U as q, y as G, h as H, m as R, d as T, u as B, l as F } from "./householdPrefill-DLm3pxFH-B34UGBGP.js";
3
- import { j as J } from "./visibility-hEdBjgi7-WW4BVjmf.js";
1
+ import { t as U, j as z, A as D, I as p, O as E, D as L, r as w } from "./widget-Bc0CD2Yh.js";
2
+ import { U as q, y as H, h as R, m as T, d as B, u as F, l as G } from "./householdPrefill-DLm3pxFH-BWVN4BLJ.js";
3
+ import { j as J } from "./visibility-CKRGC3Il-SsuTwW3e.js";
4
4
  import { useState as u, useRef as C, useEffect as I } from "react";
5
5
  import { jsx as d, jsxs as r } from "react/jsx-runtime";
6
- import { C as K } from "./car-B0hJrE0Z.js";
6
+ import { C as K } from "./car-CR69ZjJ2.js";
7
7
  (function() {
8
8
  if (typeof t > "u")
9
9
  var t = { env: {} };
@@ -14,7 +14,7 @@ var de = /* @__PURE__ */ U({ HouseholdPrefill: () => Q }), M = {
14
14
  peek: p.vehicle.peek,
15
15
  apply: L,
16
16
  dismiss: E,
17
- mergeInto: R,
17
+ mergeInto: T,
18
18
  skip: () => !1,
19
19
  alreadyPresent: () => !1,
20
20
  icon: K,
@@ -28,9 +28,9 @@ var de = /* @__PURE__ */ U({ HouseholdPrefill: () => Q }), M = {
28
28
  peek: p.driver.peek,
29
29
  apply: D,
30
30
  dismiss: z,
31
- mergeInto: H,
32
- skip: G,
33
- alreadyPresent: (t, c) => J(t, "drivers").some((i) => T(F(i), B(c.label))),
31
+ mergeInto: R,
32
+ skip: H,
33
+ alreadyPresent: (t, c) => J(t, "drivers").some((i) => B(G(i), F(c.label))),
34
34
  icon: q,
35
35
  heading: (t) => t === 1 ? "We found another driver in your household" : `We found ${t} drivers in your household`,
36
36
  body: "Add anyone who drives these vehicles. We already have you.",
@@ -1,4 +1,4 @@
1
- import { a4 as A } from "./widget-BUAzkBEK.js";
1
+ import { a4 as A } from "./widget-Bc0CD2Yh.js";
2
2
  import { t as c } from "./types-LUGvo5ic-CiVRcsV9.js";
3
3
  (function() {
4
4
  if (typeof e > "u")
@@ -1 +1 @@
1
- import{t as _}from"./iframe-BImWklE9.js";var u=_({ADDRESS_COLUMN_PREFIXES:()=>m,addressFromColumns:()=>p,addressToColumns:()=>c,composeAddress:()=>n,normalizeStateCode:()=>a,parseAddress:()=>i}),a=r=>{let t=r.trim();return/^[A-Za-z]{2}$/.test(t)?t.toUpperCase():t},i=r=>{let[t="",e="",o=""]=r.split(",").map(d=>d.trim()).filter(Boolean),l=/^([A-Za-z .]{2,})\s+(\d{5})(?:-\d{4})?$/.exec(o);return{line_1:t,city:e,state:a(l?.[1]?.trim()??""),postal_code:l?.[2]??""}},n=r=>{let t=[r.line_1.trim(),r.line_2.trim()].filter(Boolean).join(" ");if(!t)return"";let e=a(r.state.trim());return`${t}, ${r.city.trim()}, ${e} ${r.postal_code.trim()}`.replace(/\s+/g," ").trim()},m={address:"",prior_address:"prior_",garaging_address:"garaging_address_"},s=(r,t)=>{let e=r[t];return e==null?"":String(e)},p=(r,t)=>n({line_1:s(r,`${t}line_1`),line_2:s(r,`${t}line_2`),city:s(r,`${t}city`),state:s(r,`${t}state`),postal_code:s(r,`${t}postal_code`)}),c=(r,t)=>{let e=i(r);return{[`${t}line_1`]:e.line_1||null,[`${t}city`]:e.city||null,[`${t}state`]:e.state||null,[`${t}postal_code`]:e.postal_code||null}};export{n as a,u as i,p as n,a as o,c as r,i as s,m as t};
1
+ import{t as _}from"./iframe-Chy4dD4i.js";var u=_({ADDRESS_COLUMN_PREFIXES:()=>m,addressFromColumns:()=>p,addressToColumns:()=>c,composeAddress:()=>n,normalizeStateCode:()=>a,parseAddress:()=>i}),a=r=>{let t=r.trim();return/^[A-Za-z]{2}$/.test(t)?t.toUpperCase():t},i=r=>{let[t="",e="",o=""]=r.split(",").map(d=>d.trim()).filter(Boolean),l=/^([A-Za-z .]{2,})\s+(\d{5})(?:-\d{4})?$/.exec(o);return{line_1:t,city:e,state:a(l?.[1]?.trim()??""),postal_code:l?.[2]??""}},n=r=>{let t=[r.line_1.trim(),r.line_2.trim()].filter(Boolean).join(" ");if(!t)return"";let e=a(r.state.trim());return`${t}, ${r.city.trim()}, ${e} ${r.postal_code.trim()}`.replace(/\s+/g," ").trim()},m={address:"",prior_address:"prior_",garaging_address:"garaging_address_"},s=(r,t)=>{let e=r[t];return e==null?"":String(e)},p=(r,t)=>n({line_1:s(r,`${t}line_1`),line_2:s(r,`${t}line_2`),city:s(r,`${t}city`),state:s(r,`${t}state`),postal_code:s(r,`${t}postal_code`)}),c=(r,t)=>{let e=i(r);return{[`${t}line_1`]:e.line_1||null,[`${t}city`]:e.city||null,[`${t}state`]:e.state||null,[`${t}postal_code`]:e.postal_code||null}};export{n as a,u as i,p as n,a as o,c as r,i as s,m as t};
@@ -1,4 +1,4 @@
1
- import{m as c}from"./iframe-BImWklE9.js";/**
1
+ import{l as c}from"./iframe-Chy4dD4i.js";/**
2
2
  * @license lucide-react v0.562.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{m as c}from"./iframe-BImWklE9.js";/**
1
+ import{l as c}from"./iframe-Chy4dD4i.js";/**
2
2
  * @license lucide-react v0.562.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{t as y,r as s,b as d}from"./iframe-BImWklE9.js";import{k as h,j as m}from"./visibility-hEdBjgi7-_AUGO8E2.js";import{u as c,l as b,s as g}from"./copy-from-record-BNP6CFFR-BtCRUQRw.js";import"./types-LUGvo5ic-CB-wcgK3.js";import"./validation-DRqHT-u7-pY2KjHw4.js";import"./check-l6TGSrXO.js";var O=y({CopyApplicantOffer:()=>k}),f={Demographics:{kind:"applicant",heading:"Are you one of the drivers?",body:"We'll reuse the details you already gave for them, so you don't type them twice.",applyLabel:"Use these details"},Ssn:{kind:"applicantSsn",heading:"Are you one of the drivers?",body:"We can reuse the Social Security number you already entered for them.",applyLabel:"Use the SSN"}},k=({stage:r,questions:n,values:t,onPatch:u})=>{let e=f[r],i=s.useMemo(()=>e?h(n,t,r):[],[e,n,t,r]),o=s.useCallback(a=>e?c({kind:e.kind,source:m(t,"drivers")[a]??{},targetQuestions:i}):{},[e,t,i]),l=s.useMemo(()=>e?b(t).filter(a=>Object.keys(o(a.index)).length>0):[],[e,t,o]);return!e||!l.length?null:d.jsx(g,{heading:e.heading,body:e.body,applyLabel:e.applyLabel,candidates:l,onApply:a=>{let p=o(a);return u(p),Object.keys(p).length}})};export{O as n,k as t};
1
+ import{t as y,r as s,a as d}from"./iframe-Chy4dD4i.js";import{k as h,j as m}from"./visibility-CKRGC3Il-DVTBboJH.js";import{u as c,l as b,s as g}from"./copy-from-record-BNP6CFFR-Dk7QPvpr.js";import"./types-LUGvo5ic-CB-wcgK3.js";import"./validation-D42QXxck-DJUS31-5.js";import"./check-B9ojZKSs.js";var O=y({CopyApplicantOffer:()=>k}),f={Demographics:{kind:"applicant",heading:"Are you one of the drivers?",body:"We'll reuse the details you already gave for them, so you don't type them twice.",applyLabel:"Use these details"},Ssn:{kind:"applicantSsn",heading:"Are you one of the drivers?",body:"We can reuse the Social Security number you already entered for them.",applyLabel:"Use the SSN"}},k=({stage:r,questions:n,values:t,onPatch:u})=>{let e=f[r],i=s.useMemo(()=>e?h(n,t,r):[],[e,n,t,r]),o=s.useCallback(a=>e?c({kind:e.kind,source:m(t,"drivers")[a]??{},targetQuestions:i}):{},[e,t,i]),l=s.useMemo(()=>e?b(t).filter(a=>Object.keys(o(a.index)).length>0):[],[e,t,o]);return!e||!l.length?null:d.jsx(g,{heading:e.heading,body:e.body,applyLabel:e.applyLabel,candidates:l,onApply:a=>{let p=o(a);return u(p),Object.keys(p).length}})};export{O as n,k as t};
@@ -1,4 +1,4 @@
1
- import{m as f,N as g,r as _,b as t,f as b}from"./iframe-BImWklE9.js";import{j}from"./visibility-hEdBjgi7-_AUGO8E2.js";import{O as y}from"./validation-DRqHT-u7-pY2KjHw4.js";import{C as N}from"./check-l6TGSrXO.js";/**
1
+ import{l as f,N as g,r as _,a as t,f as b}from"./iframe-Chy4dD4i.js";import{j}from"./visibility-CKRGC3Il-DVTBboJH.js";import{O as y}from"./validation-D42QXxck-DJUS31-5.js";import{C as N}from"./check-B9ojZKSs.js";/**
2
2
  * @license lucide-react v0.562.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{m as A,V as v}from"./iframe-BImWklE9.js";/**
1
+ import{l as A,J as v}from"./iframe-Chy4dD4i.js";/**
2
2
  * @license lucide-react v0.562.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{t as E}from"./iframe-BImWklE9.js";var b=E({COVERAGE_EDITED_KEY:()=>o,COVERAGE_SHARE_OF_DWELLING:()=>i,DWELLING_KEY:()=>s,PURCHASE_PRICE_KEY:()=>d,backfillRelatedCoverages:()=>g,coverageSharePercent:()=>p,deriveRelatedCoverages:()=>C,derivedCoverageAmount:()=>u,isCoverageEdited:()=>f,markCoverageEdited:()=>m,seedHomeCoverages:()=>A}),i={other_structures_coverage:.1,personal_property_coverage:.5,loss_of_use_coverage:.2},s="dwelling_replacement_cost",d="sale_price_cents",o="__coverage_edited",_=500,u=(r,e)=>Math.round(r*e/_)*_,p=r=>{let e=i[r];return e===void 0?null:Math.round(e*100)},c=r=>{let e=r[o];return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]},f=(r,e)=>c(r).includes(e),a=r=>{let e=String(r??"").replace(/\D/g,"");if(!e)return null;let t=Number(e);return Number.isFinite(t)&&t>0?t:null},m=(r,e,t)=>{if(i[e]===void 0)return{};let l=c(r);return a(t)===null?l.includes(e)?{[o]:l.filter(n=>n!==e)}:{}:l.includes(e)?{}:{[o]:[...l,e]}},C=(r,e)=>{let t=a(e);if(t===null)return{};let l={};for(let[n,v]of Object.entries(i))f(r,n)||(l[n]=u(t,v));return l},g=r=>{let e=a(r[s]);if(e===null)return{};let t={};for(let[l,n]of Object.entries(i))a(r[l])===null&&(t[l]=u(e,n));return t},A=r=>{let e={};if(a(r.dwelling_replacement_cost)===null){let t=a(r[d]);t!==null&&(e[s]=t)}return{...e,...g({...r,...e})}};export{g as a,C as c,m as d,A as f,d as i,u as l,i as n,b as o,s as r,p as s,o as t,f as u};
1
+ import{t as E}from"./iframe-Chy4dD4i.js";var b=E({COVERAGE_EDITED_KEY:()=>o,COVERAGE_SHARE_OF_DWELLING:()=>i,DWELLING_KEY:()=>s,PURCHASE_PRICE_KEY:()=>d,backfillRelatedCoverages:()=>g,coverageSharePercent:()=>p,deriveRelatedCoverages:()=>C,derivedCoverageAmount:()=>u,isCoverageEdited:()=>f,markCoverageEdited:()=>m,seedHomeCoverages:()=>A}),i={other_structures_coverage:.1,personal_property_coverage:.5,loss_of_use_coverage:.2},s="dwelling_replacement_cost",d="sale_price_cents",o="__coverage_edited",_=500,u=(r,e)=>Math.round(r*e/_)*_,p=r=>{let e=i[r];return e===void 0?null:Math.round(e*100)},c=r=>{let e=r[o];return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]},f=(r,e)=>c(r).includes(e),a=r=>{let e=String(r??"").replace(/\D/g,"");if(!e)return null;let t=Number(e);return Number.isFinite(t)&&t>0?t:null},m=(r,e,t)=>{if(i[e]===void 0)return{};let l=c(r);return a(t)===null?l.includes(e)?{[o]:l.filter(n=>n!==e)}:{}:l.includes(e)?{}:{[o]:[...l,e]}},C=(r,e)=>{let t=a(e);if(t===null)return{};let l={};for(let[n,v]of Object.entries(i))f(r,n)||(l[n]=u(t,v));return l},g=r=>{let e=a(r[s]);if(e===null)return{};let t={};for(let[l,n]of Object.entries(i))a(r[l])===null&&(t[l]=u(e,n));return t},A=r=>{let e={};if(a(r.dwelling_replacement_cost)===null){let t=a(r[d]);t!==null&&(e[s]=t)}return{...e,...g({...r,...e})}};export{g as a,C as c,m as d,A as f,d as i,u as l,i as n,b as o,s as r,p as s,o as t,f as u};