@vergelijkdirect/comparison-forms 2.0.0-rc.10 → 2.0.0-rc.13

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.
@@ -24254,8 +24254,25 @@ function dM(e) {
24254
24254
  return uM.includes(e);
24255
24255
  }
24256
24256
  //#endregion
24257
+ //#region src/utils/normalizeInitialData.util.ts
24258
+ function fM(e) {
24259
+ if (e == null) return {};
24260
+ if (typeof e == "string") {
24261
+ let t = e.trim();
24262
+ if (!t) return {};
24263
+ let n;
24264
+ try {
24265
+ n = JSON.parse(t);
24266
+ } catch (e) {
24267
+ return { error: e };
24268
+ }
24269
+ return $f(n) ? { data: n } : { error: /* @__PURE__ */ Error("initial-data must be a JSON object") };
24270
+ }
24271
+ return $f(e) ? { data: e } : { error: /* @__PURE__ */ Error("initial-data must be an object") };
24272
+ }
24273
+ //#endregion
24257
24274
  //#region src/schemas/birthdateRange.ts
24258
- function fM(e, t, n = "ageRange") {
24275
+ function pM(e, t, n = "ageRange") {
24259
24276
  return {
24260
24277
  name: n,
24261
24278
  test(n, r) {
@@ -24271,7 +24288,7 @@ function fM(e, t, n = "ageRange") {
24271
24288
  }
24272
24289
  //#endregion
24273
24290
  //#region src/schemas/messages.ts
24274
- var pM = {
24291
+ var mM = {
24275
24292
  birthdate: {
24276
24293
  required: "Geboortedatum is verplicht",
24277
24294
  dateFormat: "Geboortedatum is incorrect",
@@ -24310,11 +24327,11 @@ var pM = {
24310
24327
  };
24311
24328
  //#endregion
24312
24329
  //#region src/schemas/birthdate.schema.ts
24313
- function mM(e) {
24330
+ function hM(e) {
24314
24331
  return cM(e, $j) !== null;
24315
24332
  }
24316
- function hM(e = Qj) {
24317
- return gb().required(pM.birthdate.required).test("date_format", pM.birthdate.dateFormat, mM).test(fM({
24333
+ function gM(e = Qj) {
24334
+ return gb().required(mM.birthdate.required).test("date_format", mM.birthdate.dateFormat, hM).test(pM({
24318
24335
  min: {
24319
24336
  value: e.min,
24320
24337
  unit: "year"
@@ -24324,45 +24341,45 @@ function hM(e = Qj) {
24324
24341
  unit: "year"
24325
24342
  }
24326
24343
  }, {
24327
- tooYoung: () => pM.birthdate.tooYoung(e.min),
24328
- tooOld: () => pM.birthdate.tooOld(e.max)
24344
+ tooYoung: () => mM.birthdate.tooYoung(e.min),
24345
+ tooOld: () => mM.birthdate.tooOld(e.max)
24329
24346
  }));
24330
24347
  }
24331
24348
  //#endregion
24332
24349
  //#region src/schemas/rules.ts
24333
- function gM(e, t) {
24350
+ function _M(e, t) {
24334
24351
  return gb().required(t).oneOf(e, t);
24335
24352
  }
24336
- function _M(e) {
24353
+ function vM(e) {
24337
24354
  return gb().required(e);
24338
24355
  }
24339
- function vM(e) {
24356
+ function yM(e) {
24340
24357
  return yb().typeError(e).required(e);
24341
24358
  }
24342
24359
  //#endregion
24343
24360
  //#region src/schemas/familyComposition.schema.ts
24344
- function yM(e = pM.familyComposition.required) {
24345
- return gM(eM, e);
24361
+ function bM(e = mM.familyComposition.required) {
24362
+ return _M(eM, e);
24346
24363
  }
24347
- var bM = yM(), xM = gM(tM, pM.ownedBuilding.required), SM = [1, 7], CM = [3, 4], wM = {
24364
+ var xM = bM(), SM = _M(tM, mM.ownedBuilding.required), CM = [1, 7], wM = [3, 4], TM = {
24348
24365
  raceOrMtb: 15e3,
24349
24366
  default: 9999
24350
- }, TM = (e, t) => e.test("max-value", pM.bike.priceMax(t), (e) => {
24367
+ }, EM = (e, t) => e.test("max-value", mM.bike.priceMax(t), (e) => {
24351
24368
  let n = Number(e);
24352
24369
  return Number.isNaN(n) || n <= t;
24353
- }), EM = Pb({
24354
- kind: vM(pM.bike.kindRequired),
24355
- condition: vM(pM.bike.conditionRequired),
24356
- price: gb().required(pM.bike.priceRequired).when("kind", {
24357
- is: (e) => CM.includes(Number(e)),
24358
- then: (e) => TM(e, wM.raceOrMtb),
24359
- otherwise: (e) => TM(e, wM.default)
24370
+ }), DM = Pb({
24371
+ kind: yM(mM.bike.kindRequired),
24372
+ condition: yM(mM.bike.conditionRequired),
24373
+ price: gb().required(mM.bike.priceRequired).when("kind", {
24374
+ is: (e) => wM.includes(Number(e)),
24375
+ then: (e) => EM(e, TM.raceOrMtb),
24376
+ otherwise: (e) => EM(e, TM.default)
24360
24377
  }),
24361
24378
  brand: gb().when("kind", {
24362
- is: (e) => SM.includes(Number(e)),
24363
- then: (e) => e.required(pM.bike.brandRequired)
24379
+ is: (e) => CM.includes(Number(e)),
24380
+ then: (e) => e.required(mM.bike.brandRequired)
24364
24381
  })
24365
- }), DM = [
24382
+ }), OM = [
24366
24383
  {
24367
24384
  value: 4,
24368
24385
  title: "ATB / Mountainbike",
@@ -24429,13 +24446,13 @@ var bM = yM(), xM = gM(tM, pM.ownedBuilding.required), SM = [1, 7], CM = [3, 4],
24429
24446
  name: "Vouwfiets",
24430
24447
  isEBike: !1
24431
24448
  }
24432
- ], OM = [{
24449
+ ], kM = [{
24433
24450
  value: 1,
24434
24451
  label: "Nieuw"
24435
24452
  }, {
24436
24453
  value: 0,
24437
24454
  label: "Tweedehands"
24438
- }], kM = [
24455
+ }], AM = [
24439
24456
  {
24440
24457
  id: "Ander merk",
24441
24458
  name: "Ander merk"
@@ -25856,7 +25873,7 @@ var bM = yM(), xM = gM(tM, pM.ownedBuilding.required), SM = [1, 7], CM = [3, 4],
25856
25873
  id: "Zündapp",
25857
25874
  name: "Zündapp"
25858
25875
  }
25859
- ], AM = /* @__PURE__ */ L({
25876
+ ], jM = /* @__PURE__ */ L({
25860
25877
  __name: "BikeForm",
25861
25878
  props: /*@__PURE__*/ Va({
25862
25879
  initialData: {},
@@ -25875,14 +25892,14 @@ var bM = yM(), xM = gM(tM, pM.ownedBuilding.required), SM = [1, 7], CM = [3, 4],
25875
25892
  }),
25876
25893
  emits: ["submit"],
25877
25894
  setup(e, { emit: t }) {
25878
- let n = e, r = _d(n), i = t, { isSubmitting: a, handleSubmit: o, defineField: s, resetField: c } = qb(EM, {
25895
+ let n = e, r = _d(n), i = t, { isSubmitting: a, handleSubmit: o, defineField: s, resetField: c } = qb(DM, {
25879
25896
  kind: n.initialData?.kind ?? null,
25880
25897
  condition: n.initialData?.condition ?? 1,
25881
25898
  price: n.initialData?.price ?? "",
25882
25899
  brand: n.initialData?.brand ?? ""
25883
- }), [l, u, d] = s("kind", { validateAt: "change" }), [f, p, m] = s("brand", { validateAt: "change" }), [h, g, _] = s("condition"), [v, y, b] = s("price"), x = K(() => SM.includes(Number(l.value)));
25900
+ }), [l, u, d] = s("kind", { validateAt: "change" }), [f, p, m] = s("brand", { validateAt: "change" }), [h, g, _] = s("condition"), [v, y, b] = s("price"), x = K(() => CM.includes(Number(l.value)));
25884
25901
  I(l, (e) => {
25885
- SM.includes(Number(e)) || c("brand", { value: "" });
25902
+ CM.includes(Number(e)) || c("brand", { value: "" });
25886
25903
  }, { immediate: !0 });
25887
25904
  function S() {
25888
25905
  o((e) => {
@@ -25903,7 +25920,7 @@ var bM = yM(), xM = gM(tM, pM.ownedBuilding.required), SM = [1, 7], CM = [3, 4],
25903
25920
  "onUpdate:modelValue": n[0] ||= (e) => /* @__PURE__ */ M(l) ? l.value = e : null,
25904
25921
  modelModifiers: { number: !0 },
25905
25922
  label: "Soort fiets",
25906
- options: P(DM),
25923
+ options: P(OM),
25907
25924
  name: "kind",
25908
25925
  required: !1,
25909
25926
  "error-message": P(d)
@@ -25924,7 +25941,7 @@ var bM = yM(), xM = gM(tM, pM.ownedBuilding.required), SM = [1, 7], CM = [3, 4],
25924
25941
  "onUpdate:modelValue": n[1] ||= (e) => /* @__PURE__ */ M(f) ? f.value = e : null,
25925
25942
  label: "Merk fiets",
25926
25943
  placeholder: "Typ of kies je merk",
25927
- options: P(kM),
25944
+ options: P(AM),
25928
25945
  "label-key": "name",
25929
25946
  "value-key": "id",
25930
25947
  name: "brand",
@@ -25946,7 +25963,7 @@ var bM = yM(), xM = gM(tM, pM.ownedBuilding.required), SM = [1, 7], CM = [3, 4],
25946
25963
  "onUpdate:modelValue": n[2] ||= (e) => /* @__PURE__ */ M(h) ? h.value = e : null,
25947
25964
  legend: "Gekocht als",
25948
25965
  name: "condition",
25949
- options: P(OM),
25966
+ options: P(kM),
25950
25967
  variant: "boxed",
25951
25968
  required: !1,
25952
25969
  "error-message": P(_)
@@ -25981,7 +25998,7 @@ var bM = yM(), xM = gM(tM, pM.ownedBuilding.required), SM = [1, 7], CM = [3, 4],
25981
25998
  });
25982
25999
  //#endregion
25983
26000
  //#region src/comparisons/bike/bike.presenter.ts
25984
- function jM(e) {
26001
+ function MM(e) {
25985
26002
  return {
25986
26003
  comparison: vd.Bike,
25987
26004
  detail: { bike: {
@@ -25995,30 +26012,30 @@ function jM(e) {
25995
26012
  }
25996
26013
  //#endregion
25997
26014
  //#region src/comparisons/bike/index.ts
25998
- var MM = /* @__PURE__ */ c({
25999
- Form: () => AM,
26000
- presenter: () => jM
26001
- }), NM = {
26015
+ var NM = /* @__PURE__ */ c({
26016
+ Form: () => jM,
26017
+ presenter: () => MM
26018
+ }), PM = {
26002
26019
  min: 0,
26003
26020
  max: 99
26004
- }, PM = Pb({
26005
- kind: gb().required(pM.pet.kindRequired),
26006
- age: gb().required(pM.birthdate.required).test("date_format", pM.birthdate.dateFormat, mM).test(fM({
26021
+ }, FM = Pb({
26022
+ kind: gb().required(mM.pet.kindRequired),
26023
+ age: gb().required(mM.birthdate.required).test("date_format", mM.birthdate.dateFormat, hM).test(pM({
26007
26024
  min: {
26008
26025
  value: 7,
26009
26026
  unit: "week"
26010
26027
  },
26011
26028
  max: {
26012
- value: NM.max,
26029
+ value: PM.max,
26013
26030
  unit: "year"
26014
26031
  }
26015
26032
  }, {
26016
- future: () => pM.birthdate.tooYoung(NM.min),
26017
- tooYoung: ({ earliest: e, latest: t }) => pM.pet.outOfRange(e.format($j), t.format($j)),
26018
- tooOld: () => pM.birthdate.tooOld(NM.max)
26033
+ future: () => mM.birthdate.tooYoung(PM.min),
26034
+ tooYoung: ({ earliest: e, latest: t }) => mM.pet.outOfRange(e.format($j), t.format($j)),
26035
+ tooOld: () => mM.birthdate.tooOld(PM.max)
26019
26036
  }, "birthdate_range")),
26020
- zipcode: gb().required(pM.pet.zipcodeRequired).matches(/^\d{4}\s?[a-zA-Z]{2}$/, pM.pet.zipcodeInvalid)
26021
- }), FM = [
26037
+ zipcode: gb().required(mM.pet.zipcodeRequired).matches(/^\d{4}\s?[a-zA-Z]{2}$/, mM.pet.zipcodeInvalid)
26038
+ }), IM = [
26022
26039
  {
26023
26040
  title: "Hond",
26024
26041
  value: "dog"
@@ -26035,7 +26052,7 @@ var MM = /* @__PURE__ */ c({
26035
26052
  title: "Vogel",
26036
26053
  value: "bird"
26037
26054
  }
26038
- ], IM = /* @__PURE__ */ L({
26055
+ ], LM = /* @__PURE__ */ L({
26039
26056
  __name: "PetForm",
26040
26057
  props: /*@__PURE__*/ Va({
26041
26058
  initialData: {},
@@ -26054,7 +26071,7 @@ var MM = /* @__PURE__ */ c({
26054
26071
  }),
26055
26072
  emits: ["submit"],
26056
26073
  setup(e, { emit: t }) {
26057
- let n = e, r = _d(n), i = t, { isSubmitting: a, handleSubmit: o, defineField: s } = qb(PM, {
26074
+ let n = e, r = _d(n), i = t, { isSubmitting: a, handleSubmit: o, defineField: s } = qb(FM, {
26058
26075
  kind: n.initialData?.kind ?? "dog",
26059
26076
  age: n.initialData?.age ?? "",
26060
26077
  zipcode: n.initialData?.zipcode ?? ""
@@ -26078,7 +26095,7 @@ var MM = /* @__PURE__ */ c({
26078
26095
  "onUpdate:modelValue": n[0] ||= (e) => /* @__PURE__ */ M(c) ? c.value = e : null,
26079
26096
  label: "Wat voor huisdier wil je verzekeren?",
26080
26097
  placeholder: "",
26081
- options: P(FM),
26098
+ options: P(IM),
26082
26099
  name: "kind",
26083
26100
  required: !1,
26084
26101
  "error-message": P(u)
@@ -26147,7 +26164,7 @@ var MM = /* @__PURE__ */ c({
26147
26164
  });
26148
26165
  //#endregion
26149
26166
  //#region src/comparisons/pet/pet.presenter.ts
26150
- function LM(e) {
26167
+ function RM(e) {
26151
26168
  return {
26152
26169
  comparison: vd.Pet,
26153
26170
  detail: { pet: {
@@ -26159,14 +26176,14 @@ function LM(e) {
26159
26176
  }
26160
26177
  //#endregion
26161
26178
  //#region src/comparisons/pet/index.ts
26162
- var RM = /* @__PURE__ */ c({
26163
- Form: () => IM,
26164
- presenter: () => LM
26165
- }), zM = Pb({
26166
- TypeOfCaravan: _M(pM.caravan.typeOfCaravanRequired),
26167
- NewOrOccasion: gM(tM, pM.caravan.newOrOccasionRequired),
26168
- BuildYear: _M(pM.caravan.buildYearRequired)
26169
- }), BM = [
26179
+ var zM = /* @__PURE__ */ c({
26180
+ Form: () => LM,
26181
+ presenter: () => RM
26182
+ }), BM = Pb({
26183
+ TypeOfCaravan: vM(mM.caravan.typeOfCaravanRequired),
26184
+ NewOrOccasion: _M(tM, mM.caravan.newOrOccasionRequired),
26185
+ BuildYear: vM(mM.caravan.buildYearRequired)
26186
+ }), VM = [
26170
26187
  {
26171
26188
  value: "CS",
26172
26189
  title: "Stacaravan"
@@ -26179,7 +26196,7 @@ var RM = /* @__PURE__ */ c({
26179
26196
  value: "CV",
26180
26197
  title: "Vouwwagen"
26181
26198
  }
26182
- ], VM = [{
26199
+ ], HM = [{
26183
26200
  value: bd.Yes,
26184
26201
  label: "Nieuw"
26185
26202
  }, {
@@ -26188,7 +26205,7 @@ var RM = /* @__PURE__ */ c({
26188
26205
  }];
26189
26206
  //#endregion
26190
26207
  //#region src/comparisons/caravan/models/buildYears.model.ts
26191
- function HM() {
26208
+ function UM() {
26192
26209
  let e = sM();
26193
26210
  return Array.from({ length: 126 }, (t, n) => ({
26194
26211
  title: String(e - n),
@@ -26197,7 +26214,7 @@ function HM() {
26197
26214
  }
26198
26215
  //#endregion
26199
26216
  //#region src/comparisons/caravan/CaravanForm.vue
26200
- var UM = /* @__PURE__ */ L({
26217
+ var WM = /* @__PURE__ */ L({
26201
26218
  __name: "CaravanForm",
26202
26219
  props: /*@__PURE__*/ Va({
26203
26220
  initialData: {},
@@ -26216,7 +26233,7 @@ var UM = /* @__PURE__ */ L({
26216
26233
  }),
26217
26234
  emits: ["submit"],
26218
26235
  setup(e, { emit: t }) {
26219
- let n = e, r = _d(n), i = t, a = HM(), { isSubmitting: o, handleSubmit: s, defineField: c } = qb(zM, {
26236
+ let n = e, r = _d(n), i = t, a = UM(), { isSubmitting: o, handleSubmit: s, defineField: c } = qb(BM, {
26220
26237
  TypeOfCaravan: n.initialData?.TypeOfCaravan ?? null,
26221
26238
  NewOrOccasion: n.initialData?.NewOrOccasion ?? bd.Yes,
26222
26239
  BuildYear: n.initialData?.BuildYear ?? null
@@ -26239,7 +26256,7 @@ var UM = /* @__PURE__ */ L({
26239
26256
  modelValue: P(l),
26240
26257
  "onUpdate:modelValue": n[0] ||= (e) => /* @__PURE__ */ M(l) ? l.value = e : null,
26241
26258
  label: "Soort caravan",
26242
- options: P(BM),
26259
+ options: P(VM),
26243
26260
  name: "typeOfCaravan",
26244
26261
  required: !1,
26245
26262
  "error-message": P(d)
@@ -26259,7 +26276,7 @@ var UM = /* @__PURE__ */ L({
26259
26276
  "onUpdate:modelValue": n[1] ||= (e) => /* @__PURE__ */ M(f) ? f.value = e : null,
26260
26277
  legend: "Gekocht als",
26261
26278
  name: "newOrOccasion",
26262
- options: P(VM),
26279
+ options: P(HM),
26263
26280
  variant: "boxed",
26264
26281
  required: !1,
26265
26282
  "error-message": P(m)
@@ -26296,7 +26313,7 @@ var UM = /* @__PURE__ */ L({
26296
26313
  });
26297
26314
  //#endregion
26298
26315
  //#region src/comparisons/caravan/caravan.presenter.ts
26299
- function WM(e) {
26316
+ function GM(e) {
26300
26317
  return {
26301
26318
  comparison: vd.Caravan,
26302
26319
  detail: { caravan: {
@@ -26309,21 +26326,21 @@ function WM(e) {
26309
26326
  }
26310
26327
  //#endregion
26311
26328
  //#region src/comparisons/caravan/index.ts
26312
- var GM = /* @__PURE__ */ c({
26313
- Form: () => UM,
26314
- presenter: () => WM
26315
- }), KM = /* @__PURE__ */ function(e) {
26329
+ var KM = /* @__PURE__ */ c({
26330
+ Form: () => WM,
26331
+ presenter: () => GM
26332
+ }), qM = /* @__PURE__ */ function(e) {
26316
26333
  return e.Continuous = "L", e.ShortTerm = "S", e;
26317
- }({}), qM = Pb({
26318
- PaymentTerm: gM([KM.Continuous, KM.ShortTerm], pM.travel.paymentTermRequired),
26319
- birthdate: hM()
26320
- }), JM = [{
26321
- value: KM.Continuous,
26334
+ }({}), JM = Pb({
26335
+ PaymentTerm: _M([qM.Continuous, qM.ShortTerm], mM.travel.paymentTermRequired),
26336
+ birthdate: gM()
26337
+ }), YM = [{
26338
+ value: qM.Continuous,
26322
26339
  label: "Doorlopend"
26323
26340
  }, {
26324
- value: KM.ShortTerm,
26341
+ value: qM.ShortTerm,
26325
26342
  label: "Kortlopend"
26326
- }], YM = /* @__PURE__ */ L({
26343
+ }], XM = /* @__PURE__ */ L({
26327
26344
  __name: "TravelForm",
26328
26345
  props: /*@__PURE__*/ Va({
26329
26346
  initialData: {},
@@ -26342,8 +26359,8 @@ var GM = /* @__PURE__ */ c({
26342
26359
  }),
26343
26360
  emits: ["submit"],
26344
26361
  setup(e, { emit: t }) {
26345
- let n = e, r = _d(n), i = t, { isSubmitting: a, handleSubmit: o, defineField: s } = qb(qM, {
26346
- PaymentTerm: n.initialData?.PaymentTerm ?? KM.Continuous,
26362
+ let n = e, r = _d(n), i = t, { isSubmitting: a, handleSubmit: o, defineField: s } = qb(JM, {
26363
+ PaymentTerm: n.initialData?.PaymentTerm ?? qM.Continuous,
26347
26364
  birthdate: n.initialData?.birthdate ?? ""
26348
26365
  }), [c, l, u] = s("PaymentTerm", { validateAt: "change" }), [d, f, p] = s("birthdate");
26349
26366
  function m() {
@@ -26364,7 +26381,7 @@ var GM = /* @__PURE__ */ c({
26364
26381
  "onUpdate:modelValue": n[0] ||= (e) => /* @__PURE__ */ M(c) ? c.value = e : null,
26365
26382
  legend: "Kies je dekking",
26366
26383
  name: "PaymentTerm",
26367
- options: P(JM),
26384
+ options: P(YM),
26368
26385
  variant: "boxed",
26369
26386
  required: !1,
26370
26387
  "error-message": P(u)
@@ -26402,7 +26419,7 @@ var GM = /* @__PURE__ */ c({
26402
26419
  });
26403
26420
  //#endregion
26404
26421
  //#region src/comparisons/travel/travel.presenter.ts
26405
- function XM(e) {
26422
+ function ZM(e) {
26406
26423
  return {
26407
26424
  comparison: vd.Travel,
26408
26425
  detail: { comparison: { PaymentTerm: e.PaymentTerm } },
@@ -26411,14 +26428,14 @@ function XM(e) {
26411
26428
  }
26412
26429
  //#endregion
26413
26430
  //#region src/comparisons/travel/index.ts
26414
- var ZM = /* @__PURE__ */ c({
26415
- Form: () => YM,
26416
- presenter: () => XM
26417
- }), QM = (e) => Pb({
26431
+ var QM = /* @__PURE__ */ c({
26432
+ Form: () => XM,
26433
+ presenter: () => ZM
26434
+ }), $M = (e) => Pb({
26418
26435
  address: e,
26419
- birthdate: hM(),
26420
- familyComposition: bM
26421
- }), $M = /* @__PURE__ */ L({
26436
+ birthdate: gM(),
26437
+ familyComposition: xM
26438
+ }), eN = /* @__PURE__ */ L({
26422
26439
  __name: "LiabilityForm",
26423
26440
  props: /*@__PURE__*/ Va({
26424
26441
  initialData: {},
@@ -26437,7 +26454,7 @@ var ZM = /* @__PURE__ */ c({
26437
26454
  }),
26438
26455
  emits: ["submit"],
26439
26456
  setup(e, { emit: t }) {
26440
- let n = e, r = _d(n), i = t, { addressSchema: a, draft: o, resolvedAddress: s, additionOptions: c } = aj({ initial: n.initialData?.address }), { isSubmitting: l, handleSubmit: u, defineField: d } = qb(QM(a), {
26457
+ let n = e, r = _d(n), i = t, { addressSchema: a, draft: o, resolvedAddress: s, additionOptions: c } = aj({ initial: n.initialData?.address }), { isSubmitting: l, handleSubmit: u, defineField: d } = qb($M(a), {
26441
26458
  birthdate: n.initialData?.birthdate ?? "",
26442
26459
  familyComposition: n.initialData?.familyComposition ?? yd.SingleWithoutChildren,
26443
26460
  address: o
@@ -26496,7 +26513,7 @@ var ZM = /* @__PURE__ */ c({
26496
26513
  });
26497
26514
  //#endregion
26498
26515
  //#region src/comparisons/liability/liability.presenter.ts
26499
- function eN(e) {
26516
+ function tN(e) {
26500
26517
  return {
26501
26518
  comparison: vd.Liability,
26502
26519
  detail: { liability: {
@@ -26516,20 +26533,20 @@ function eN(e) {
26516
26533
  }
26517
26534
  //#endregion
26518
26535
  //#region src/comparisons/liability/index.ts
26519
- var tN = /* @__PURE__ */ c({
26520
- Form: () => $M,
26521
- presenter: () => eN
26522
- }), nN = [{
26536
+ var nN = /* @__PURE__ */ c({
26537
+ Form: () => eN,
26538
+ presenter: () => tN
26539
+ }), rN = [{
26523
26540
  value: bd.Yes,
26524
26541
  label: "Gekocht"
26525
26542
  }, {
26526
26543
  value: bd.No,
26527
26544
  label: "Verhuurd"
26528
- }], rN = (e) => Pb({
26545
+ }], iN = (e) => Pb({
26529
26546
  address: e,
26530
- ownedBuilding: xM,
26531
- familyComposition: yM(pM.house.familyCompositionRequired)
26532
- }), iN = /* @__PURE__ */ L({
26547
+ ownedBuilding: SM,
26548
+ familyComposition: bM(mM.house.familyCompositionRequired)
26549
+ }), aN = /* @__PURE__ */ L({
26533
26550
  __name: "HouseForm",
26534
26551
  props: /*@__PURE__*/ Va({
26535
26552
  initialData: {},
@@ -26548,7 +26565,7 @@ var tN = /* @__PURE__ */ c({
26548
26565
  }),
26549
26566
  emits: ["submit"],
26550
26567
  setup(e, { emit: t }) {
26551
- let n = e, r = _d(n), i = t, { addressSchema: a, draft: o, resolvedAddress: s, additionOptions: c } = aj({ initial: n.initialData?.address }), { isSubmitting: l, handleSubmit: u, defineField: d } = qb(rN(a), {
26568
+ let n = e, r = _d(n), i = t, { addressSchema: a, draft: o, resolvedAddress: s, additionOptions: c } = aj({ initial: n.initialData?.address }), { isSubmitting: l, handleSubmit: u, defineField: d } = qb(iN(a), {
26552
26569
  ownedBuilding: n.initialData?.ownedBuilding ?? bd.Yes,
26553
26570
  familyComposition: n.initialData?.familyComposition ?? yd.SingleWithoutChildren,
26554
26571
  address: o
@@ -26587,7 +26604,7 @@ var tN = /* @__PURE__ */ c({
26587
26604
  "onUpdate:modelValue": n[1] ||= (e) => /* @__PURE__ */ M(f) ? f.value = e : null,
26588
26605
  legend: "Jouw woning is...",
26589
26606
  name: "ownedBuilding",
26590
- options: P(nN),
26607
+ options: P(rN),
26591
26608
  variant: "boxed",
26592
26609
  required: !1,
26593
26610
  "error-message": P(m)
@@ -26616,7 +26633,7 @@ var tN = /* @__PURE__ */ c({
26616
26633
  });
26617
26634
  //#endregion
26618
26635
  //#region src/comparisons/house/house.presenter.ts
26619
- function aN(e) {
26636
+ function oN(e) {
26620
26637
  return {
26621
26638
  comparison: vd.Housing,
26622
26639
  detail: { house: { ownedBuilding: e.ownedBuilding } },
@@ -26632,25 +26649,25 @@ function aN(e) {
26632
26649
  }
26633
26650
  //#endregion
26634
26651
  //#region src/comparisons/house/index.ts
26635
- var oN = /* @__PURE__ */ c({
26636
- Form: () => iN,
26637
- presenter: () => aN
26638
- }), sN = yd.SingleWithChildren, cN = (e) => Pb({
26652
+ var sN = /* @__PURE__ */ c({
26653
+ Form: () => aN,
26654
+ presenter: () => oN
26655
+ }), cN = yd.SingleWithChildren, lN = (e) => Pb({
26639
26656
  address: e,
26640
- ownedBuilding: xM,
26641
- birthdate: hM(),
26642
- familyComposition: bM,
26657
+ ownedBuilding: SM,
26658
+ birthdate: gM(),
26659
+ familyComposition: xM,
26643
26660
  familySize: gb().defined().when("familyComposition", {
26644
- is: sN,
26645
- then: (e) => e.required(pM.legal.familySizeRequired)
26661
+ is: cN,
26662
+ then: (e) => e.required(mM.legal.familySizeRequired)
26646
26663
  })
26647
- }), lN = [{
26664
+ }), uN = [{
26648
26665
  title: "Alleenstaande met 1 kind",
26649
26666
  value: "2"
26650
26667
  }, {
26651
26668
  title: "Alleenstaande met 2 of meer kinderen",
26652
26669
  value: "3"
26653
- }], uN = /* @__PURE__ */ L({
26670
+ }], dN = /* @__PURE__ */ L({
26654
26671
  __name: "LegalForm",
26655
26672
  props: /*@__PURE__*/ Va({
26656
26673
  initialData: {},
@@ -26669,15 +26686,15 @@ var oN = /* @__PURE__ */ c({
26669
26686
  }),
26670
26687
  emits: ["submit"],
26671
26688
  setup(e, { emit: t }) {
26672
- let n = e, r = _d(n), i = t, { addressSchema: a, draft: o, resolvedAddress: s, additionOptions: c } = aj({ initial: n.initialData?.address }), { isSubmitting: l, handleSubmit: u, defineField: d, resetField: f } = qb(cN(a), {
26689
+ let n = e, r = _d(n), i = t, { addressSchema: a, draft: o, resolvedAddress: s, additionOptions: c } = aj({ initial: n.initialData?.address }), { isSubmitting: l, handleSubmit: u, defineField: d, resetField: f } = qb(lN(a), {
26673
26690
  ownedBuilding: n.initialData?.ownedBuilding ?? bd.Yes,
26674
26691
  birthdate: n.initialData?.birthdate ?? "",
26675
26692
  familyComposition: n.initialData?.familyComposition ?? yd.SingleWithoutChildren,
26676
26693
  familySize: n.initialData?.familySize ?? "",
26677
26694
  address: o
26678
- }), [p, m, h] = d("ownedBuilding"), [g, _, v] = d("birthdate"), [y, b, x] = d("familyComposition", { validateAt: "change" }), [S, C, w] = d("familySize", { validateAt: "change" }), T = K(() => y.value === sN);
26695
+ }), [p, m, h] = d("ownedBuilding"), [g, _, v] = d("birthdate"), [y, b, x] = d("familyComposition", { validateAt: "change" }), [S, C, w] = d("familySize", { validateAt: "change" }), T = K(() => y.value === cN);
26679
26696
  I(y, (e) => {
26680
- e !== sN && f("familySize", { value: "" });
26697
+ e !== cN && f("familySize", { value: "" });
26681
26698
  }, { immediate: !0 });
26682
26699
  function E() {
26683
26700
  u(({ ownedBuilding: e, birthdate: t, familyComposition: n, familySize: r }) => {
@@ -26715,7 +26732,7 @@ var oN = /* @__PURE__ */ c({
26715
26732
  "onUpdate:modelValue": n[1] ||= (e) => /* @__PURE__ */ M(p) ? p.value = e : null,
26716
26733
  legend: "Jouw woning is...",
26717
26734
  name: "ownedBuilding",
26718
- options: P(nN),
26735
+ options: P(rN),
26719
26736
  variant: "boxed",
26720
26737
  required: !1,
26721
26738
  "error-message": P(h)
@@ -26758,7 +26775,7 @@ var oN = /* @__PURE__ */ c({
26758
26775
  "onUpdate:modelValue": n[4] ||= (e) => /* @__PURE__ */ M(S) ? S.value = e : null,
26759
26776
  label: "Aantal kinderen",
26760
26777
  placeholder: "Maak een keuze",
26761
- options: P(lN),
26778
+ options: P(uN),
26762
26779
  name: "familySize",
26763
26780
  required: !1,
26764
26781
  "error-message": P(w)
@@ -26776,11 +26793,11 @@ var oN = /* @__PURE__ */ c({
26776
26793
  });
26777
26794
  //#endregion
26778
26795
  //#region src/comparisons/legal/legal.presenter.ts
26779
- function dN(e) {
26796
+ function fN(e) {
26780
26797
  return {
26781
26798
  comparison: vd.LegalAssistance,
26782
26799
  detail: { comparison: {
26783
- familySize: e.familyComposition === sN ? e.familySize : "",
26800
+ familySize: e.familyComposition === cN ? e.familySize : "",
26784
26801
  deductables: 300,
26785
26802
  ownedBuilding: e.ownedBuilding
26786
26803
  } },
@@ -26797,18 +26814,18 @@ function dN(e) {
26797
26814
  }
26798
26815
  //#endregion
26799
26816
  //#region src/comparisons/legal/index.ts
26800
- var fN = /* @__PURE__ */ c({
26801
- Form: () => uN,
26802
- presenter: () => dN
26803
- }), pN = (e) => Pb({
26817
+ var pN = /* @__PURE__ */ c({
26818
+ Form: () => dN,
26819
+ presenter: () => fN
26820
+ }), mN = (e) => Pb({
26804
26821
  address: e,
26805
- birthdate: hM(),
26806
- familyComposition: bM,
26822
+ birthdate: gM(),
26823
+ familyComposition: xM,
26807
26824
  partnerBirthdate: gb().defined().when("familyComposition", {
26808
26825
  is: dM,
26809
- then: () => hM()
26826
+ then: () => gM()
26810
26827
  })
26811
- }), mN = /* @__PURE__ */ L({
26828
+ }), hN = /* @__PURE__ */ L({
26812
26829
  __name: "PackageForm",
26813
26830
  props: /*@__PURE__*/ Va({
26814
26831
  initialData: {},
@@ -26827,7 +26844,7 @@ var fN = /* @__PURE__ */ c({
26827
26844
  }),
26828
26845
  emits: ["submit"],
26829
26846
  setup(e, { emit: t }) {
26830
- let n = e, r = _d(n), i = t, { addressSchema: a, draft: o, resolvedAddress: s, additionOptions: c } = aj({ initial: n.initialData?.address }), { isSubmitting: l, handleSubmit: u, defineField: d, resetField: f } = qb(pN(a), {
26847
+ let n = e, r = _d(n), i = t, { addressSchema: a, draft: o, resolvedAddress: s, additionOptions: c } = aj({ initial: n.initialData?.address }), { isSubmitting: l, handleSubmit: u, defineField: d, resetField: f } = qb(mN(a), {
26831
26848
  birthdate: n.initialData?.birthdate ?? "",
26832
26849
  familyComposition: n.initialData?.familyComposition ?? yd.SingleWithoutChildren,
26833
26850
  partnerBirthdate: n.initialData?.partnerBirthdate ?? "",
@@ -26906,7 +26923,7 @@ var fN = /* @__PURE__ */ c({
26906
26923
  });
26907
26924
  //#endregion
26908
26925
  //#region src/comparisons/package/package.presenter.ts
26909
- function hN(e) {
26926
+ function gN(e) {
26910
26927
  return {
26911
26928
  comparison: vd.Package,
26912
26929
  detail: { partner: { birthdate: e.partnerBirthdate } },
@@ -26923,21 +26940,21 @@ function hN(e) {
26923
26940
  }
26924
26941
  //#endregion
26925
26942
  //#region src/comparisons/package/index.ts
26926
- var gN = /* @__PURE__ */ c({
26927
- Form: () => mN,
26928
- presenter: () => hN
26929
- }), _N = {
26943
+ var _N = /* @__PURE__ */ c({
26944
+ Form: () => hN,
26945
+ presenter: () => gN
26946
+ }), vN = {
26930
26947
  min: 21,
26931
26948
  max: 74
26932
- }, vN = {
26949
+ }, yN = {
26933
26950
  min: 3500,
26934
26951
  max: 75e3
26935
- }, yN = Pb({
26936
- LoanPurpose: gb().required(pM.loan.purposeRequired),
26937
- LoanAmount: vM(pM.loan.amountRequired).min(vN.min, pM.loan.amountMin(vN.min)).max(vN.max, pM.loan.amountMax(vN.max)),
26938
- birthdate: hM(_N),
26939
- familyComposition: bM
26940
- }), bN = [
26952
+ }, bN = Pb({
26953
+ LoanPurpose: gb().required(mM.loan.purposeRequired),
26954
+ LoanAmount: yM(mM.loan.amountRequired).min(yN.min, mM.loan.amountMin(yN.min)).max(yN.max, mM.loan.amountMax(yN.max)),
26955
+ birthdate: gM(vN),
26956
+ familyComposition: xM
26957
+ }), xN = [
26941
26958
  {
26942
26959
  title: "Aankoop auto",
26943
26960
  value: "02"
@@ -26986,7 +27003,7 @@ var gN = /* @__PURE__ */ c({
26986
27003
  title: "Anders",
26987
27004
  value: "99"
26988
27005
  }
26989
- ], xN = /* @__PURE__ */ L({
27006
+ ], SN = /* @__PURE__ */ L({
26990
27007
  __name: "LoanForm",
26991
27008
  props: /*@__PURE__*/ Va({
26992
27009
  initialData: {},
@@ -27005,7 +27022,7 @@ var gN = /* @__PURE__ */ c({
27005
27022
  }),
27006
27023
  emits: ["submit"],
27007
27024
  setup(e, { emit: t }) {
27008
- let n = e, r = _d(n), i = t, { isSubmitting: a, handleSubmit: o, defineField: s } = qb(yN, {
27025
+ let n = e, r = _d(n), i = t, { isSubmitting: a, handleSubmit: o, defineField: s } = qb(bN, {
27009
27026
  LoanPurpose: n.initialData?.LoanPurpose ?? "",
27010
27027
  LoanAmount: n.initialData?.LoanAmount ?? null,
27011
27028
  birthdate: n.initialData?.birthdate ?? "",
@@ -27030,7 +27047,7 @@ var gN = /* @__PURE__ */ c({
27030
27047
  "onUpdate:modelValue": n[0] ||= (e) => /* @__PURE__ */ M(c) ? c.value = e : null,
27031
27048
  label: "Leendoel",
27032
27049
  placeholder: "Maak een keuze",
27033
- options: P(bN),
27050
+ options: P(xN),
27034
27051
  name: "LoanPurpose",
27035
27052
  required: !1,
27036
27053
  "error-message": P(u)
@@ -27089,19 +27106,19 @@ var gN = /* @__PURE__ */ c({
27089
27106
  });
27090
27107
  //#endregion
27091
27108
  //#region src/comparisons/loan/loan.presenter.ts
27092
- function SN(e) {
27109
+ function CN(e) {
27093
27110
  let t = cM(e, $j);
27094
27111
  if (!t) return 120;
27095
27112
  let n = t.add(76, "year").diff((0, iM.default)(), "month", !0), r = Math.floor(n / 12) * 12;
27096
27113
  return Math.min(r, 120);
27097
27114
  }
27098
- function CN(e) {
27115
+ function wN(e) {
27099
27116
  return {
27100
27117
  comparison: vd.Loan,
27101
27118
  detail: { loan: {
27102
27119
  LoanPurpose: e.LoanPurpose,
27103
27120
  LoanAmount: e.LoanAmount,
27104
- MaxDurationByLegalLimit: SN(e.birthdate)
27121
+ MaxDurationByLegalLimit: CN(e.birthdate)
27105
27122
  } },
27106
27123
  user: {
27107
27124
  birthdate: e.birthdate,
@@ -27111,17 +27128,17 @@ function CN(e) {
27111
27128
  }
27112
27129
  //#endregion
27113
27130
  //#region src/comparisons/loan/index.ts
27114
- var wN = /* @__PURE__ */ c({
27115
- Form: () => xN,
27116
- presenter: () => CN
27117
- }), TN = {
27131
+ var TN = /* @__PURE__ */ c({
27132
+ Form: () => SN,
27133
+ presenter: () => wN
27134
+ }), EN = {
27118
27135
  min: 16,
27119
27136
  max: 99
27120
- }, EN = (e, t) => Pb({
27137
+ }, DN = (e, t) => Pb({
27121
27138
  licensePlate: e,
27122
27139
  address: t,
27123
- birthdate: hM(TN)
27124
- }), DN = /* @__PURE__ */ L({
27140
+ birthdate: gM(EN)
27141
+ }), ON = /* @__PURE__ */ L({
27125
27142
  __name: "MopedForm",
27126
27143
  props: /*@__PURE__*/ Va({
27127
27144
  initialData: {},
@@ -27140,7 +27157,7 @@ var wN = /* @__PURE__ */ c({
27140
27157
  }),
27141
27158
  emits: ["submit"],
27142
27159
  setup(e, { emit: t }) {
27143
- let n = e, r = _d(n), i = t, { addressSchema: a, draft: o, resolvedAddress: s, additionOptions: c } = aj({ initial: n.initialData?.address }), { vehicleData: l, licensePlateSchema: u } = Tj(vd.Moped, { initialData: n.initialData?.vehicle ?? void 0 }), { isSubmitting: d, handleSubmit: f, defineField: p } = qb(EN(u, a), {
27160
+ let n = e, r = _d(n), i = t, { addressSchema: a, draft: o, resolvedAddress: s, additionOptions: c } = aj({ initial: n.initialData?.address }), { vehicleData: l, licensePlateSchema: u } = Tj(vd.Moped, { initialData: n.initialData?.vehicle ?? void 0 }), { isSubmitting: d, handleSubmit: f, defineField: p } = qb(DN(u, a), {
27144
27161
  licensePlate: n.initialData?.licensePlate ?? "",
27145
27162
  birthdate: n.initialData?.birthdate ?? "",
27146
27163
  address: o
@@ -27221,7 +27238,7 @@ var wN = /* @__PURE__ */ c({
27221
27238
  });
27222
27239
  //#endregion
27223
27240
  //#region src/comparisons/moped/moped.presenter.ts
27224
- function ON(e) {
27241
+ function kN(e) {
27225
27242
  return {
27226
27243
  comparison: vd.Moped,
27227
27244
  detail: { moped: { ...e.vehicle } },
@@ -27238,14 +27255,14 @@ function ON(e) {
27238
27255
  }
27239
27256
  //#endregion
27240
27257
  //#region src/comparisons/moped/index.ts
27241
- var kN = /* @__PURE__ */ c({
27242
- Form: () => DN,
27243
- presenter: () => ON
27244
- }), AN = (e, t) => Pb({
27258
+ var AN = /* @__PURE__ */ c({
27259
+ Form: () => ON,
27260
+ presenter: () => kN
27261
+ }), jN = (e, t) => Pb({
27245
27262
  licensePlate: e,
27246
27263
  address: t,
27247
- birthdate: hM()
27248
- }), jN = /* @__PURE__ */ L({
27264
+ birthdate: gM()
27265
+ }), MN = /* @__PURE__ */ L({
27249
27266
  __name: "MotorForm",
27250
27267
  props: /*@__PURE__*/ Va({
27251
27268
  initialData: {},
@@ -27264,7 +27281,7 @@ var kN = /* @__PURE__ */ c({
27264
27281
  }),
27265
27282
  emits: ["submit"],
27266
27283
  setup(e, { emit: t }) {
27267
- let n = e, r = _d(n), i = t, { addressSchema: a, draft: o, resolvedAddress: s, additionOptions: c } = aj({ initial: n.initialData?.address }), { vehicleData: l, licensePlateSchema: u } = Tj(vd.Motor, { initialData: n.initialData?.vehicle ?? void 0 }), { isSubmitting: d, handleSubmit: f, defineField: p } = qb(AN(u, a), {
27284
+ let n = e, r = _d(n), i = t, { addressSchema: a, draft: o, resolvedAddress: s, additionOptions: c } = aj({ initial: n.initialData?.address }), { vehicleData: l, licensePlateSchema: u } = Tj(vd.Motor, { initialData: n.initialData?.vehicle ?? void 0 }), { isSubmitting: d, handleSubmit: f, defineField: p } = qb(jN(u, a), {
27268
27285
  licensePlate: n.initialData?.licensePlate ?? "",
27269
27286
  birthdate: n.initialData?.birthdate ?? "",
27270
27287
  address: o
@@ -27345,7 +27362,7 @@ var kN = /* @__PURE__ */ c({
27345
27362
  });
27346
27363
  //#endregion
27347
27364
  //#region src/comparisons/motor/motor.presenter.ts
27348
- function MN(e) {
27365
+ function NN(e) {
27349
27366
  return {
27350
27367
  comparison: vd.Motor,
27351
27368
  detail: { motor: { ...e.vehicle } },
@@ -27362,14 +27379,14 @@ function MN(e) {
27362
27379
  }
27363
27380
  //#endregion
27364
27381
  //#region src/comparisons/motor/index.ts
27365
- var NN = /* @__PURE__ */ c({
27366
- Form: () => jN,
27367
- presenter: () => MN
27368
- }), PN = (e, t) => Pb({
27382
+ var PN = /* @__PURE__ */ c({
27383
+ Form: () => MN,
27384
+ presenter: () => NN
27385
+ }), FN = (e, t) => Pb({
27369
27386
  licensePlate: e,
27370
27387
  address: t,
27371
- birthdate: hM()
27372
- }), FN = /* @__PURE__ */ L({
27388
+ birthdate: gM()
27389
+ }), IN = /* @__PURE__ */ L({
27373
27390
  __name: "CarForm",
27374
27391
  props: /*@__PURE__*/ Va({
27375
27392
  initialData: {},
@@ -27388,7 +27405,7 @@ var NN = /* @__PURE__ */ c({
27388
27405
  }),
27389
27406
  emits: ["submit"],
27390
27407
  setup(e, { emit: t }) {
27391
- let n = e, r = _d(n), i = t, { addressSchema: a, draft: o, resolvedAddress: s, additionOptions: c } = aj({ initial: n.initialData?.address }), { vehicleData: l, licensePlateSchema: u } = Tj(vd.Car, { initialData: n.initialData?.vehicle ?? void 0 }), { isSubmitting: d, handleSubmit: f, defineField: p } = qb(PN(u, a), {
27408
+ let n = e, r = _d(n), i = t, { addressSchema: a, draft: o, resolvedAddress: s, additionOptions: c } = aj({ initial: n.initialData?.address }), { vehicleData: l, licensePlateSchema: u } = Tj(vd.Car, { initialData: n.initialData?.vehicle ?? void 0 }), { isSubmitting: d, handleSubmit: f, defineField: p } = qb(FN(u, a), {
27392
27409
  licensePlate: n.initialData?.licensePlate ?? "",
27393
27410
  birthdate: n.initialData?.birthdate ?? "",
27394
27411
  address: o
@@ -27469,7 +27486,7 @@ var NN = /* @__PURE__ */ c({
27469
27486
  });
27470
27487
  //#endregion
27471
27488
  //#region src/comparisons/car/car.presenter.ts
27472
- function IN(e) {
27489
+ function LN(e) {
27473
27490
  return {
27474
27491
  comparison: vd.Car,
27475
27492
  detail: { car: { ...e.vehicle } },
@@ -27486,13 +27503,13 @@ function IN(e) {
27486
27503
  }
27487
27504
  //#endregion
27488
27505
  //#region src/comparisons/car/index.ts
27489
- var LN = /* @__PURE__ */ c({
27490
- Form: () => FN,
27491
- presenter: () => IN
27492
- }), RN = (e) => Pb({
27506
+ var RN = /* @__PURE__ */ c({
27507
+ Form: () => IN,
27508
+ presenter: () => LN
27509
+ }), zN = (e) => Pb({
27493
27510
  licensePlate: e,
27494
27511
  company: Zj()
27495
- }), zN = /* @__PURE__ */ L({
27512
+ }), BN = /* @__PURE__ */ L({
27496
27513
  __name: "BusinessCarForm",
27497
27514
  props: /*@__PURE__*/ Va({
27498
27515
  initialData: {},
@@ -27511,7 +27528,7 @@ var LN = /* @__PURE__ */ c({
27511
27528
  }),
27512
27529
  emits: ["submit"],
27513
27530
  setup(e, { emit: t }) {
27514
- let n = e, r = _d(n), i = t, { vehicleData: a, licensePlateSchema: o } = Tj(vd.Car, { initialData: n.initialData?.vehicle ?? void 0 }), { isSubmitting: s, handleSubmit: c, defineField: l, setErrors: u, removeError: d } = qb(RN(o), {
27531
+ let n = e, r = _d(n), i = t, { vehicleData: a, licensePlateSchema: o } = Tj(vd.Car, { initialData: n.initialData?.vehicle ?? void 0 }), { isSubmitting: s, handleSubmit: c, defineField: l, setErrors: u, removeError: d } = qb(zN(o), {
27515
27532
  licensePlate: n.initialData?.licensePlate ?? "",
27516
27533
  company: n.initialData?.company ?? null
27517
27534
  }), [f, p, m, h] = l("licensePlate"), [g, _, v] = l("company"), y = (e) => e ? u({ company: e }) : d("company"), b = K(() => !!g.value && !g.value.hasVisitingAddress);
@@ -27591,7 +27608,7 @@ var LN = /* @__PURE__ */ c({
27591
27608
  });
27592
27609
  //#endregion
27593
27610
  //#region src/comparisons/car-business/businessCar.presenter.ts
27594
- function BN(e) {
27611
+ function VN(e) {
27595
27612
  let { hasVisitingAddress: t, ...n } = e.company;
27596
27613
  return {
27597
27614
  comparison: vd.CarBusiness,
@@ -27604,10 +27621,10 @@ function BN(e) {
27604
27621
  }
27605
27622
  //#endregion
27606
27623
  //#region src/comparisons/car-business/index.ts
27607
- var VN = /* @__PURE__ */ c({
27608
- Form: () => zN,
27609
- presenter: () => BN
27610
- }), HN = Pb({ company: Zj() }), UN = /* @__PURE__ */ L({
27624
+ var HN = /* @__PURE__ */ c({
27625
+ Form: () => BN,
27626
+ presenter: () => VN
27627
+ }), UN = Pb({ company: Zj() }), WN = /* @__PURE__ */ L({
27611
27628
  __name: "BusinessLiabilityForm",
27612
27629
  props: /*@__PURE__*/ Va({
27613
27630
  initialData: {},
@@ -27628,7 +27645,7 @@ var VN = /* @__PURE__ */ c({
27628
27645
  }),
27629
27646
  emits: ["submit"],
27630
27647
  setup(e, { emit: t }) {
27631
- let n = e, r = _d(n), i = t, { isSubmitting: a, handleSubmit: o, defineField: s, setErrors: c, removeError: l } = qb(HN, { company: n.initialData?.company ?? null }), [u, d, f] = s("company"), p = (e) => e ? c({ company: e }) : l("company"), m = K(() => !!u.value && !u.value.hasVisitingAddress);
27648
+ let n = e, r = _d(n), i = t, { isSubmitting: a, handleSubmit: o, defineField: s, setErrors: c, removeError: l } = qb(UN, { company: n.initialData?.company ?? null }), [u, d, f] = s("company"), p = (e) => e ? c({ company: e }) : l("company"), m = K(() => !!u.value && !u.value.hasVisitingAddress);
27632
27649
  function h() {
27633
27650
  o(({ company: e }) => {
27634
27651
  i("submit", { company: e });
@@ -27672,7 +27689,7 @@ var VN = /* @__PURE__ */ c({
27672
27689
  });
27673
27690
  //#endregion
27674
27691
  //#region src/comparisons/businessLiability/businessLiability.presenter.ts
27675
- function WN(e) {
27692
+ function GN(e) {
27676
27693
  let { hasVisitingAddress: t, ...n } = e.company;
27677
27694
  return {
27678
27695
  comparison: vd.BusinessLiability,
@@ -27682,29 +27699,29 @@ function WN(e) {
27682
27699
  }
27683
27700
  //#endregion
27684
27701
  //#region src/comparisons/businessLiability/index.ts
27685
- var GN = /* @__PURE__ */ c({
27686
- Form: () => UN,
27687
- presenter: () => WN
27688
- }), KN = {
27689
- [vd.Bike]: MM,
27690
- [vd.Pet]: RM,
27691
- [vd.Caravan]: GM,
27692
- [vd.Travel]: ZM,
27693
- [vd.Liability]: tN,
27694
- [vd.Housing]: oN,
27695
- house: oN,
27696
- [vd.LegalAssistance]: fN,
27697
- [vd.Package]: gN,
27698
- [vd.Loan]: wN,
27699
- [vd.Moped]: kN,
27700
- [vd.Motor]: NN,
27701
- [vd.Car]: LN,
27702
- [vd.CarBusiness]: VN,
27703
- "business-car": VN,
27704
- [vd.BusinessLiability]: GN
27705
- }, qN = { [vd.Travel]: "/tarieven/" }, JN = (e, t, n) => `${e}#/${n}${qN[t] ?? ""}`, YN = (e) => {
27702
+ var KN = /* @__PURE__ */ c({
27703
+ Form: () => WN,
27704
+ presenter: () => GN
27705
+ }), qN = {
27706
+ [vd.Bike]: NM,
27707
+ [vd.Pet]: zM,
27708
+ [vd.Caravan]: KM,
27709
+ [vd.Travel]: QM,
27710
+ [vd.Liability]: nN,
27711
+ [vd.Housing]: sN,
27712
+ house: sN,
27713
+ [vd.LegalAssistance]: pN,
27714
+ [vd.Package]: _N,
27715
+ [vd.Loan]: TN,
27716
+ [vd.Moped]: AN,
27717
+ [vd.Motor]: PN,
27718
+ [vd.Car]: RN,
27719
+ [vd.CarBusiness]: HN,
27720
+ "business-car": HN,
27721
+ [vd.BusinessLiability]: KN
27722
+ }, JN = { [vd.Travel]: "/tarieven/" }, YN = (e, t, n) => `${e}#/${n}${JN[t] ?? ""}`, XN = (e) => {
27706
27723
  window.location.href = e;
27707
- }, XN = ({ user: e, detail: t }) => new RA.User({
27724
+ }, ZN = ({ user: e, detail: t }) => new RA.User({
27708
27725
  email: e.email || null,
27709
27726
  name: e.firstName || null,
27710
27727
  zip_code: e.zipcode || null,
@@ -27718,14 +27735,14 @@ var GN = /* @__PURE__ */ c({
27718
27735
  ...e.city && { city: e.city }
27719
27736
  }
27720
27737
  });
27721
- function ZN(e) {
27738
+ function QN(e) {
27722
27739
  let t = /* @__PURE__ */ N(!1), n = /* @__PURE__ */ N(null);
27723
27740
  return {
27724
27741
  submit: async (r) => {
27725
27742
  t.value = !0, n.value = null;
27726
27743
  try {
27727
- let t = await WA().comparisonService.create(r.comparison, XN(r)), n = JN(e.link, r.comparison, t.getId());
27728
- e.onRedirect ? e.onRedirect(n) : YN(n);
27744
+ let t = await WA().comparisonService.create(r.comparison, ZN(r)), n = YN(e.link, r.comparison, t.getId());
27745
+ e.onRedirect ? e.onRedirect(n) : XN(n);
27729
27746
  } catch (t) {
27730
27747
  n.value = t, e.onError?.(t, r);
27731
27748
  } finally {
@@ -27738,7 +27755,7 @@ function ZN(e) {
27738
27755
  }
27739
27756
  //#endregion
27740
27757
  //#region src/flow/ComparisonFormFlow.vue
27741
- var QN = /* @__PURE__ */ L({
27758
+ var $N = /* @__PURE__ */ L({
27742
27759
  __name: "ComparisonFormFlow",
27743
27760
  props: {
27744
27761
  form: {},
@@ -27769,7 +27786,7 @@ var QN = /* @__PURE__ */ L({
27769
27786
  },
27770
27787
  emits: ["submitted", "error"],
27771
27788
  setup(e, { emit: t }) {
27772
- let n = e, r = t, i = _d(n), a = K(() => KN[n.form]), { submit: o, isSubmitting: s } = ZN({
27789
+ let n = e, r = t, i = _d(n), a = K(() => qN[n.form]), { submit: o, isSubmitting: s } = QN({
27773
27790
  link: n.link,
27774
27791
  onRedirect: (e) => {
27775
27792
  r("submitted", e), n.redirect ? n.redirect(e) : window.location.href = e;
@@ -27785,16 +27802,16 @@ var QN = /* @__PURE__ */ L({
27785
27802
  onSubmit: c
27786
27803
  }), null, 16, ["initial-data", "submit-disabled"])) : W("", !0);
27787
27804
  }
27788
- }), $N = /* @__PURE__ */ kl(/* @__PURE__ */ L({
27805
+ }), eP = /* @__PURE__ */ kl(/* @__PURE__ */ L({
27789
27806
  __name: "ComparisonFormFlow.ce",
27790
27807
  props: {
27808
+ initialData: { type: [Object, String] },
27791
27809
  apiUrl: { type: String },
27792
27810
  mijnUrl: { type: String },
27793
27811
  qaUrl: { type: String },
27794
27812
  form: { type: null },
27795
27813
  link: { type: String },
27796
27814
  redirect: { type: Function },
27797
- initialData: { type: Object },
27798
27815
  title: { type: String },
27799
27816
  description: { type: String },
27800
27817
  banner: { type: String },
@@ -27819,23 +27836,28 @@ var QN = /* @__PURE__ */ L({
27819
27836
  },
27820
27837
  emits: ["submitted", "error"],
27821
27838
  setup(e, { emit: t }) {
27822
- let n = e, r = Yu(n, "apiUrl", "mijnUrl", "qaUrl"), i = t, a = /* @__PURE__ */ N(!1);
27839
+ let n = e, r = Yu(n, "apiUrl", "mijnUrl", "qaUrl", "initialData"), i = t, a = K(() => fM(n.initialData)), o = K(() => a.value.data);
27840
+ I(a, ({ error: e }) => {
27841
+ e && i("error", e);
27842
+ }, { immediate: !0 });
27843
+ let s = /* @__PURE__ */ N(!1);
27823
27844
  return ia(async () => {
27824
27845
  try {
27825
27846
  await VA({
27826
27847
  api: n.apiUrl ? { url: n.apiUrl } : void 0,
27827
27848
  mijn: n.mijnUrl ? { url: n.mijnUrl } : void 0,
27828
27849
  qa: n.qaUrl ? { url: n.qaUrl } : void 0
27829
- }), a.value = !0;
27850
+ }), s.value = !0;
27830
27851
  } catch (e) {
27831
27852
  i("error", e);
27832
27853
  }
27833
- }), (e, t) => a.value ? (z(), V(QN, G({ key: 0 }, P(r), {
27854
+ }), (e, t) => s.value ? (z(), V($N, G({ key: 0 }, P(r), {
27855
+ "initial-data": o.value,
27834
27856
  onSubmitted: t[0] ||= (e) => i("submitted", e),
27835
27857
  onError: t[1] ||= (e, t) => i("error", e, t)
27836
- }), null, 16)) : W("", !0);
27858
+ }), null, 16, ["initial-data"])) : W("", !0);
27837
27859
  }
27838
27860
  }), { shadowRoot: !1 });
27839
- customElements.define("vd-comparison-form", $N);
27861
+ customElements.define("vd-comparison-form", eP);
27840
27862
  //#endregion
27841
- export { $N as VdComparisonFormElement };
27863
+ export { eP as VdComparisonFormElement };