@konnectio/core 4.8.0 → 4.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/{ActionField-CiBTmhVP.js → ActionField-nQffsZA2.js} +1 -1
  2. package/dist/ActionField-nQffsZA2.js.br +0 -0
  3. package/dist/ActionField-nQffsZA2.js.gz +0 -0
  4. package/dist/{AvailabilitySkeleton-Tv_yaXPa.js → AvailabilitySkeleton-AmgXdz28.js} +1539 -1540
  5. package/dist/AvailabilitySkeleton-AmgXdz28.js.br +0 -0
  6. package/dist/AvailabilitySkeleton-AmgXdz28.js.gz +0 -0
  7. package/dist/CheckoutWindow-D8IPM2hs.js +1786 -0
  8. package/dist/CheckoutWindow-D8IPM2hs.js.br +0 -0
  9. package/dist/CheckoutWindow-D8IPM2hs.js.gz +0 -0
  10. package/dist/{ErrorMessage-ClFJa4be.js → ErrorMessage-DJAdBPXD.js} +1 -1
  11. package/dist/ErrorMessage-DJAdBPXD.js.br +0 -0
  12. package/dist/ErrorMessage-DJAdBPXD.js.gz +0 -0
  13. package/dist/{EventAvailabilityForm-D_UqbRBj.js → EventAvailabilityForm-Bspi3PTG.js} +3 -3
  14. package/dist/EventAvailabilityForm-Bspi3PTG.js.br +0 -0
  15. package/dist/EventAvailabilityForm-Bspi3PTG.js.gz +0 -0
  16. package/dist/{Field-CzT0QKcQ.js → Field-BbzATkQp.js} +1 -1
  17. package/dist/Field-BbzATkQp.js.br +0 -0
  18. package/dist/Field-BbzATkQp.js.gz +4 -0
  19. package/dist/{HotelAvailabilityForm-oY9nC2co.js → HotelAvailabilityForm-DcNJrBEP.js} +3 -3
  20. package/dist/HotelAvailabilityForm-DcNJrBEP.js.br +0 -0
  21. package/dist/HotelAvailabilityForm-DcNJrBEP.js.gz +0 -0
  22. package/dist/{SelectField-DMU4o8wT.js → SelectField-DRafB_Cb.js} +47 -32
  23. package/dist/SelectField-DRafB_Cb.js.br +0 -0
  24. package/dist/SelectField-DRafB_Cb.js.gz +0 -0
  25. package/dist/{TermsOfService-Bh49zB1Y.js → TermsOfService-BJaXGVwJ.js} +2 -2
  26. package/dist/TermsOfService-BJaXGVwJ.js.br +0 -0
  27. package/dist/TermsOfService-BJaXGVwJ.js.gz +0 -0
  28. package/dist/{_-CYKi9htj.js → _-P_tgh1jk.js} +1 -1
  29. package/dist/_-P_tgh1jk.js.br +0 -0
  30. package/dist/_-P_tgh1jk.js.gz +3 -0
  31. package/dist/availability.js +7 -7
  32. package/dist/availability.js.br +0 -0
  33. package/dist/availability.js.gz +0 -0
  34. package/dist/cancel-reservation.js +4 -4
  35. package/dist/cancel-reservation.js.br +0 -0
  36. package/dist/cancel-reservation.js.gz +0 -0
  37. package/dist/core.css +1 -1
  38. package/dist/core.css.br +0 -0
  39. package/dist/core.css.gz +0 -0
  40. package/dist/{dist-Dhf-kBcE.js → dist-BHP07uuH.js} +2 -2
  41. package/dist/dist-BHP07uuH.js.br +0 -0
  42. package/dist/{dist-Dhf-kBcE.js.gz → dist-BHP07uuH.js.gz} +0 -0
  43. package/dist/{dist-IXFfy6j_.js → dist-D4EW1Jz1.js} +7 -7
  44. package/dist/dist-D4EW1Jz1.js.br +0 -0
  45. package/dist/dist-D4EW1Jz1.js.gz +0 -0
  46. package/dist/event.js +257 -228
  47. package/dist/event.js.br +0 -0
  48. package/dist/event.js.gz +0 -0
  49. package/dist/gift-card-validation.js +7 -7
  50. package/dist/gift-card-validation.js.br +0 -0
  51. package/dist/gift-card-validation.js.gz +0 -0
  52. package/dist/gift-card.js +122 -98
  53. package/dist/gift-card.js.br +0 -0
  54. package/dist/gift-card.js.gz +0 -0
  55. package/dist/{giftCard-BP6ydQ7Q.js → giftCard-Db5RQgXn.js} +21 -11
  56. package/dist/giftCard-Db5RQgXn.js.br +0 -0
  57. package/dist/giftCard-Db5RQgXn.js.gz +0 -0
  58. package/dist/hotel.js +1414 -2471
  59. package/dist/hotel.js.br +0 -0
  60. package/dist/hotel.js.gz +0 -0
  61. package/dist/polyfill.js +1 -1
  62. package/dist/polyfill.js.br +0 -0
  63. package/dist/polyfill.js.gz +0 -0
  64. package/dist/{style-CXIHVW9k.js → style-CLohB3MA.js} +1 -1
  65. package/dist/style-CLohB3MA.js.br +0 -0
  66. package/dist/style-CLohB3MA.js.gz +0 -0
  67. package/dist-wix/availability.js +5 -5
  68. package/dist-wix/event.js +17 -17
  69. package/dist-wix/gift-card-validation.js +4 -4
  70. package/dist-wix/gift-card.js +21 -21
  71. package/dist-wix/hotel.js +6 -6
  72. package/package.json +2 -2
  73. package/dist/ActionField-CiBTmhVP.js.br +0 -0
  74. package/dist/ActionField-CiBTmhVP.js.gz +0 -0
  75. package/dist/AvailabilitySkeleton-Tv_yaXPa.js.br +0 -0
  76. package/dist/AvailabilitySkeleton-Tv_yaXPa.js.gz +0 -0
  77. package/dist/CheckoutWindow-3gTfVepQ.js +0 -722
  78. package/dist/CheckoutWindow-3gTfVepQ.js.br +0 -0
  79. package/dist/CheckoutWindow-3gTfVepQ.js.gz +0 -0
  80. package/dist/ErrorMessage-ClFJa4be.js.br +0 -0
  81. package/dist/ErrorMessage-ClFJa4be.js.gz +0 -0
  82. package/dist/EventAvailabilityForm-D_UqbRBj.js.br +0 -0
  83. package/dist/EventAvailabilityForm-D_UqbRBj.js.gz +0 -0
  84. package/dist/Field-CzT0QKcQ.js.br +0 -0
  85. package/dist/Field-CzT0QKcQ.js.gz +0 -0
  86. package/dist/HotelAvailabilityForm-oY9nC2co.js.br +0 -0
  87. package/dist/HotelAvailabilityForm-oY9nC2co.js.gz +0 -0
  88. package/dist/SelectField-DMU4o8wT.js.br +0 -0
  89. package/dist/SelectField-DMU4o8wT.js.gz +0 -0
  90. package/dist/TermsOfService-Bh49zB1Y.js.br +0 -0
  91. package/dist/TermsOfService-Bh49zB1Y.js.gz +0 -0
  92. package/dist/_-CYKi9htj.js.br +0 -0
  93. package/dist/_-CYKi9htj.js.gz +0 -7
  94. package/dist/dist-Dhf-kBcE.js.br +0 -0
  95. package/dist/dist-IXFfy6j_.js.br +0 -0
  96. package/dist/dist-IXFfy6j_.js.gz +0 -0
  97. package/dist/giftCard-BP6ydQ7Q.js.br +0 -0
  98. package/dist/giftCard-BP6ydQ7Q.js.gz +0 -0
  99. package/dist/style-CXIHVW9k.js.br +0 -0
  100. package/dist/style-CXIHVW9k.js.gz +0 -0
package/dist/event.js.br CHANGED
Binary file
package/dist/event.js.gz CHANGED
Binary file
@@ -1,11 +1,11 @@
1
1
  import { D as e, E as t, J as n, N as r, O as i, T as a, Tt as o, a as s, ht as c, j as l, kt as u, l as d, n as f, o as p, s as m, ut as h, v as g, w as _, x as v } from "./i18n-BF6zkld-.js";
2
- import { $ as y, E as b, M as x, S, X as C, b as w, x as T } from "./SelectField-DMU4o8wT.js";
3
- import { t as E } from "./_-CYKi9htj.js";
4
- import { t as D } from "./ErrorMessage-ClFJa4be.js";
5
- import { n as O, t as k } from "./Field-CzT0QKcQ.js";
6
- import { t as A } from "./style-CXIHVW9k.js";
7
- import { t as j } from "./ActionField-CiBTmhVP.js";
8
- import { t as M } from "./giftCard-BP6ydQ7Q.js";
2
+ import { $ as y, E as b, M as x, S, X as C, b as w, x as T } from "./SelectField-DRafB_Cb.js";
3
+ import { t as E } from "./_-P_tgh1jk.js";
4
+ import { t as D } from "./ErrorMessage-DJAdBPXD.js";
5
+ import { n as O, t as k } from "./Field-BbzATkQp.js";
6
+ import { t as A } from "./style-CLohB3MA.js";
7
+ import { t as j } from "./ActionField-nQffsZA2.js";
8
+ import { t as M } from "./giftCard-Db5RQgXn.js";
9
9
  //#region src/components/skeletons/GiftCardValidationSkeleton.vue?vue&type=script&setup=true&lang.ts
10
10
  var N = { class: "gift-card-validation-skeleton" }, P = { class: "gift-card-validation-skeleton-form" }, F = { class: "gift-card-validation-skeleton-text" }, I = { class: "gift-card-validation-skeleton-input" }, L = /*#__PURE__*/ S(/* @__PURE__ */ r({
11
11
  __name: "GiftCardValidationSkeleton",
Binary file
Binary file
package/dist/gift-card.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { D as e, E as t, Et as n, J as r, K as i, N as a, O as o, Q as s, T as c, Tt as l, a as u, b as d, ct as f, dt as p, g as m, ht as h, i as g, j as _, kt as v, l as y, n as b, o as x, s as S, ut as C, v as w, w as T, x as ee, yt as E } from "./i18n-BF6zkld-.js";
2
- import { t as D } from "./dist-Dhf-kBcE.js";
3
- import { E as te, N as O, S as k, _ as ne, b as re, n as A, r as j, t as M, v as N, y as P } from "./SelectField-DMU4o8wT.js";
4
- import { t as F } from "./_-CYKi9htj.js";
5
- import { t as I } from "./ErrorMessage-ClFJa4be.js";
6
- import { n as L, t as R } from "./Field-CzT0QKcQ.js";
7
- import { t as z } from "./style-CXIHVW9k.js";
8
- import { a as ie, i as ae, r as oe, t as se } from "./CheckoutWindow-3gTfVepQ.js";
9
- import { t as B } from "./giftCard-BP6ydQ7Q.js";
10
- import { t as V } from "./TermsOfService-Bh49zB1Y.js";
2
+ import { t as D } from "./dist-BHP07uuH.js";
3
+ import { E as te, N as ne, S as O, T as re, _ as ie, b as ae, n as k, r as A, t as oe, v as j, y as se } from "./SelectField-DRafB_Cb.js";
4
+ import { a as ce, c as le, i as ue, l as de, r as fe, s as pe, t as me } from "./CheckoutWindow-D8IPM2hs.js";
5
+ import { t as he } from "./_-P_tgh1jk.js";
6
+ import { t as ge } from "./ErrorMessage-DJAdBPXD.js";
7
+ import { n as M, t as N } from "./Field-BbzATkQp.js";
8
+ import { t as P } from "./style-CLohB3MA.js";
9
+ import { t as F } from "./giftCard-Db5RQgXn.js";
10
+ import { t as I } from "./TermsOfService-BJaXGVwJ.js";
11
11
  //#region src/components/inputs/MediaSelector.vue?vue&type=script&setup=true&lang.ts
12
- var H = { class: "media-selector" }, U = ["accept"], W = { class: "media-selector-wrapper" }, G = { class: "media-selector-tools" }, K = { key: 0 }, q = { key: 1 }, J = { key: 2 }, Y = ["src"], X = /*@__PURE__*/ a({
12
+ var L = { class: "media-selector" }, R = ["accept"], z = { class: "media-selector-wrapper" }, B = { class: "media-selector-tools" }, V = { key: 0 }, H = { key: 1 }, U = { key: 2 }, W = ["src"], G = /*@__PURE__*/ a({
13
13
  __name: "MediaSelector",
14
14
  props: {
15
15
  modelValue: {},
@@ -23,7 +23,7 @@ var H = { class: "media-selector" }, U = ["accept"], W = { class: "media-selecto
23
23
  },
24
24
  emits: ["update:modelValue"],
25
25
  setup(i, { emit: a }) {
26
- let s = a, d = i, { t: f } = u(), { display: p } = O(), m = E(), h = T(() => d.modelValue.base64 !== "");
26
+ let s = a, d = i, { t: f } = u(), { display: p } = ne(), m = E(), h = T(() => d.modelValue.base64 !== "");
27
27
  function g(e) {
28
28
  s("update:modelValue", e);
29
29
  }
@@ -57,12 +57,12 @@ var H = { class: "media-selector" }, U = ["accept"], W = { class: "media-selecto
57
57
  let e;
58
58
  (e = m.value.files) instanceof FileList && b(e[0], g);
59
59
  }
60
- return (a, s) => (r(), t(ne, {
60
+ return (a, s) => (r(), t(ie, {
61
61
  label: i.label,
62
62
  required: i.required,
63
63
  type: "media"
64
64
  }, {
65
- default: C(() => [c("div", H, [c("input", {
65
+ default: C(() => [c("div", L, [c("input", {
66
66
  ref_key: "fileInput",
67
67
  ref: m,
68
68
  type: "file",
@@ -70,22 +70,22 @@ var H = { class: "media-selector" }, U = ["accept"], W = { class: "media-selecto
70
70
  accept: i.validation,
71
71
  single: "",
72
72
  onChange: s[0] ||= (e) => x()
73
- }, null, 40, U), c("div", W, [c("ul", G, [
74
- h.value ? e("", !0) : (r(), o("li", K, [_(N, {
73
+ }, null, 40, R), c("div", z, [c("ul", B, [
74
+ h.value ? e("", !0) : (r(), o("li", V, [_(j, {
75
75
  label: l(f)("uploadFile"),
76
76
  type: "button",
77
77
  icon: "upload",
78
78
  "icon-color": i.iconColor,
79
79
  onClickEvent: s[1] ||= (e) => y()
80
80
  }, null, 8, ["label", "icon-color"])])),
81
- h.value ? (r(), o("li", q, [_(N, {
81
+ h.value ? (r(), o("li", H, [_(j, {
82
82
  label: l(f)("replaceFile"),
83
83
  type: "button",
84
84
  icon: "repeat-alt",
85
85
  "icon-color": i.iconColor,
86
86
  onClickEvent: s[2] ||= (e) => y()
87
87
  }, null, 8, ["label", "icon-color"])])) : e("", !0),
88
- h.value ? (r(), o("li", J, [_(N, {
88
+ h.value ? (r(), o("li", U, [_(j, {
89
89
  label: l(f)("removeFile"),
90
90
  type: "button",
91
91
  icon: "trash-alt",
@@ -95,14 +95,14 @@ var H = { class: "media-selector" }, U = ["accept"], W = { class: "media-selecto
95
95
  ]), c("div", { class: n(["media-selector-previewer", { opened: h.value }]) }, [i.modelValue ? (r(), o("img", {
96
96
  key: 0,
97
97
  src: i.modelValue.base64
98
- }, null, 8, Y)) : e("", !0)], 2)])])]),
98
+ }, null, 8, W)) : e("", !0)], 2)])])]),
99
99
  _: 1
100
100
  }, 8, ["label", "required"]));
101
101
  }
102
102
  });
103
103
  //#endregion
104
104
  //#region src/components/inputs/MediaSelector.vue?vue&type=i18n&index=0&lang.yaml
105
- function Z(e) {
105
+ function K(e) {
106
106
  let t = e;
107
107
  t.__i18n = t.__i18n || [], t.__i18n.push({
108
108
  locale: "",
@@ -180,22 +180,22 @@ function Z(e) {
180
180
  }
181
181
  //#endregion
182
182
  //#region src/components/inputs/MediaSelector.vue
183
- typeof Z == "function" && Z(X);
183
+ typeof K == "function" && K(G);
184
184
  //#endregion
185
185
  //#region src/components/skeletons/GiftCardSkeleton.vue?vue&type=script&setup=true&lang.ts
186
- var Q = { class: "gift-card-skeleton" }, ce = { class: "gift-card-skeleton-form" }, le = /*#__PURE__*/ k(/* @__PURE__ */ a({
186
+ var q = { class: "gift-card-skeleton" }, J = { class: "gift-card-skeleton-form" }, _e = /*#__PURE__*/ O(/* @__PURE__ */ a({
187
187
  __name: "GiftCardSkeleton",
188
188
  setup(e) {
189
- return (e, t) => (r(), o("div", Q, [c("div", ce, [
190
- _(R),
191
- _(R),
192
- _(R),
193
- _(R),
194
- _(R, { "is-text-area": "" }),
195
- _(L, { height: "44px" })
189
+ return (e, t) => (r(), o("div", q, [c("div", J, [
190
+ _(N),
191
+ _(N),
192
+ _(N),
193
+ _(N),
194
+ _(N, { "is-text-area": "" }),
195
+ _(M, { height: "44px" })
196
196
  ])]));
197
197
  }
198
- }), [["__scopeId", "data-v-952c68dd"]]), ue = { class: "konnectio-accept-terms" }, de = /*#__PURE__*/ k(/* @__PURE__ */ a({
198
+ }), [["__scopeId", "data-v-952c68dd"]]), Y = { class: "konnectio-accept-terms" }, X = /*#__PURE__*/ O(/* @__PURE__ */ a({
199
199
  __name: "_",
200
200
  props: {
201
201
  content: {},
@@ -203,7 +203,7 @@ var Q = { class: "gift-card-skeleton" }, ce = { class: "gift-card-skeleton-form"
203
203
  },
204
204
  setup(e) {
205
205
  let { t } = u(), n = E(!1);
206
- return (i, a) => (r(), o("div", ue, [_(l(g), {
206
+ return (i, a) => (r(), o("div", Y, [_(l(g), {
207
207
  keypath: "general.termsAndConditionsNotice",
208
208
  tag: "span",
209
209
  scope: "global"
@@ -215,34 +215,34 @@ var Q = { class: "gift-card-skeleton" }, ce = { class: "gift-card-skeleton-form"
215
215
  onClick: a[0] ||= w((e) => n.value = !0, ["prevent"])
216
216
  }, [c("span", null, v(l(t)("general.termsAndConditions")), 1)])]),
217
217
  _: 1
218
- }), _(V, {
218
+ }), _(I, {
219
219
  modelValue: n.value,
220
220
  "onUpdate:modelValue": a[1] ||= (e) => n.value = e,
221
221
  description: e.content
222
222
  }, null, 8, ["modelValue", "description"])]));
223
223
  }
224
- }), [["__scopeId", "data-v-93ef3159"]]), fe = /* @__PURE__ */ a({
224
+ }), [["__scopeId", "data-v-93ef3159"]]), ve = /* @__PURE__ */ a({
225
225
  __name: "GiftCard",
226
226
  setup(e) {
227
- let { t: n } = u(), i = B();
228
- return (e, a) => (r(), t(de, {
227
+ let { t: n } = u(), i = F();
228
+ return (e, a) => (r(), t(X, {
229
229
  content: l(i).termsOfService,
230
230
  "button-label": l(n)("giftCard.orderGiftCard")
231
231
  }, null, 8, ["content", "button-label"]));
232
232
  }
233
- }), pe = ["data-layout"], me = { id: "konnectio-gift-card-wrapper" }, he = { id: "konnectio-gift-card-title" }, ge = { id: "konnectio-gift-card-content" }, _e = { id: "konnectio-gift-card-payment" }, ve = ["innerHTML"], ye = { key: 0 }, be = {
233
+ }), ye = ["data-layout"], be = { id: "konnectio-gift-card-wrapper" }, xe = { id: "konnectio-gift-card-title" }, Se = { id: "konnectio-gift-card-content" }, Ce = { id: "konnectio-gift-card-payment" }, we = ["innerHTML"], Te = { key: 0 }, Ee = {
234
234
  key: 0,
235
235
  id: "konnectio-select-place-type"
236
- }, $ = { class: /*@__PURE__*/ n(["konnectio-label", "required"]) }, xe = { id: "konnectio-select-place-type-input" }, Se = ["innerHTML"], Ce = {
236
+ }, De = { class: /*@__PURE__*/ n(["konnectio-label", "required"]) }, Oe = { id: "konnectio-select-place-type-input" }, ke = ["innerHTML"], Z = {
237
237
  key: 0,
238
238
  id: "konnectio-gift-card-order"
239
- }, we = { class: "konnectio-panel" }, Te = {
239
+ }, Ae = { class: "konnectio-panel" }, je = {
240
240
  key: 1,
241
241
  id: "konnectio-gift-card-remarks"
242
- }, Ee = {
242
+ }, Me = {
243
243
  key: 2,
244
244
  id: "konnectio-gift-card-order-minimal"
245
- }, De = { id: "konnectio-gift-card-recaptcha" }, Oe = /*#__PURE__*/ k(/* @__PURE__ */ a({
245
+ }, Ne = { id: "konnectio-gift-card-recaptcha" }, Q = /*#__PURE__*/ O(/* @__PURE__ */ a({
246
246
  name: "GiftCardLayout",
247
247
  __name: "GiftCard",
248
248
  props: {
@@ -255,20 +255,33 @@ var Q = { class: "gift-card-skeleton" }, ce = { class: "gift-card-skeleton-form"
255
255
  let a = n, g = T(() => ({
256
256
  panelMaxWidth: "800px",
257
257
  ...a.styling
258
- })), { t: b } = u(), { name: x, email: S, phone: w, value: E, remark: D, showValue: O, quantity: k, media: ne, placeId: L, placeType: R, showFormPage: z, showPaymentPage: V, showConfirmationPage: H, places: U, hasFilledForm: W, hasForcedPlaceType: G, isWaitingForResponse: K } = y(B()), { initialize: q, orderGiftCard: J, fetchMetadata: Y } = B(), { isRecaptchaEnabled: X, currency: Z, hasError: Q } = y(te());
259
- return f(R, () => {
260
- L.value = void 0;
258
+ })), { t: b } = u(), { name: x, email: S, phone: w, value: E, remark: D, showValue: ne, quantity: O, media: ie, placeId: M, placeType: N, showFormPage: P, showPaymentPage: I, showConfirmationPage: L, places: R, hasFilledForm: z, hasForcedPlaceType: B, isWaitingForResponse: V } = y(F()), { initialize: H, orderGiftCard: U, fetchMetadata: W, giftCardPayload: G } = F(), { isRecaptchaEnabled: K, currency: q, hasError: J } = y(te());
259
+ de.useHttpClient(pe(re()));
260
+ let Y = le("post", "/gift-card/create", G());
261
+ Y.setValidationTimeout(600);
262
+ function X(e) {
263
+ Y.setData(G()), Y.validate(e);
264
+ }
265
+ function Q(e) {
266
+ return Y.errors[e];
267
+ }
268
+ async function $() {
269
+ let e = await U();
270
+ e && Y.setErrors(e);
271
+ }
272
+ return f(x, () => X("contactName")), f(S, () => X("contactEmail")), f(w, () => X("contactPhone")), f(E, () => X("amount")), f(O, () => X("quantity")), f(N, () => {
273
+ M.value = void 0;
261
274
  }), i(() => {
262
275
  let e = a.placeType ? parseInt(a.placeType) : void 0;
263
- q(e);
264
- }), (i, a) => (r(), t(re, { styling: g.value }, {
276
+ H(e);
277
+ }), (i, a) => (r(), t(ae, { styling: g.value }, {
265
278
  default: C(() => [(r(), t(ee, null, {
266
- default: C(() => [_(F, {
279
+ default: C(() => [_(he, {
267
280
  "access-token": n.accessToken,
268
281
  "data-layout": n.layout,
269
- callback: l(Y)
282
+ callback: l(W)
270
283
  }, {
271
- default: C(() => [l(Q) ? (r(), t(I, {
284
+ default: C(() => [l(J) ? (r(), t(ge, {
272
285
  key: 1,
273
286
  title: "Unable to render Gift card module",
274
287
  description: "Gift card functionality hasn't been setup for this account. Please contact Octopus PMS for support."
@@ -276,17 +289,17 @@ var Q = { class: "gift-card-skeleton" }, ce = { class: "gift-card-skeleton-form"
276
289
  key: 0,
277
290
  id: "konnectio-gift-card-module",
278
291
  "data-layout": n.layout
279
- }, [c("div", me, [
280
- c("h2", he, [c("span", null, v(l(b)("giftCard.title")), 1)]),
281
- c("div", ge, [
282
- p(c("div", _e, [_(se)], 512), [[m, l(V)]]),
292
+ }, [c("div", be, [
293
+ c("h2", xe, [c("span", null, v(l(b)("giftCard.title")), 1)]),
294
+ c("div", Se, [
295
+ p(c("div", Ce, [_(me)], 512), [[m, l(I)]]),
283
296
  p(c("div", null, [c("p", {
284
297
  id: "konnectio-gift-card-description",
285
298
  innerHTML: l(b)("giftCard.description")
286
- }, null, 8, ve), c("form", null, [
287
- l(G) ? e("", !0) : (r(), o("div", ye, [l(U) ? (r(), o("div", be, [c("label", $, [c("span", null, v(l(b)("giftCard.selectType")), 1)]), c("div", xe, [c("ul", null, [(r(!0), o(d, null, s(l(U), (e, t) => (r(), o("li", { key: t }, [_(ae, {
288
- modelValue: l(R),
289
- "onUpdate:modelValue": a[0] ||= (e) => h(R) ? R.value = e : null,
299
+ }, null, 8, we), c("form", null, [
300
+ l(B) ? e("", !0) : (r(), o("div", Te, [l(R) ? (r(), o("div", Ee, [c("label", De, [c("span", null, v(l(b)("giftCard.selectType")), 1)]), c("div", Oe, [c("ul", null, [(r(!0), o(d, null, s(l(R), (e, t) => (r(), o("li", { key: t }, [_(ue, {
301
+ modelValue: l(N),
302
+ "onUpdate:modelValue": a[0] ||= (e) => h(N) ? N.value = e : null,
290
303
  type: "radio",
291
304
  name: "placeType",
292
305
  val: t,
@@ -295,12 +308,12 @@ var Q = { class: "gift-card-skeleton" }, ce = { class: "gift-card-skeleton-form"
295
308
  "modelValue",
296
309
  "val",
297
310
  "label"
298
- ])]))), 128))]), l(U)[l(R)] && l(U)[l(R)].data.length > 1 ? (r(), t(M, {
311
+ ])]))), 128))]), l(R)[l(N)] && l(R)[l(N)].data.length > 1 ? (r(), t(oe, {
299
312
  key: 0,
300
- modelValue: l(L),
301
- "onUpdate:modelValue": a[1] ||= (e) => h(L) ? L.value = e : null,
313
+ modelValue: l(M),
314
+ "onUpdate:modelValue": a[1] ||= (e) => h(M) ? M.value = e : null,
302
315
  placeholder: l(b)("giftCard.selectPlacePlaceholder"),
303
- options: l(U)[l(R)].data,
316
+ options: l(R)[l(N)].data,
304
317
  labelKey: "name",
305
318
  valueKey: "id",
306
319
  required: ""
@@ -308,8 +321,8 @@ var Q = { class: "gift-card-skeleton" }, ce = { class: "gift-card-skeleton-form"
308
321
  "modelValue",
309
322
  "placeholder",
310
323
  "options"
311
- ])) : e("", !0)])])) : (r(), t(P, { key: 1 }))])),
312
- _(A, {
324
+ ])) : e("", !0)])])) : (r(), t(se, { key: 1 }))])),
325
+ _(k, {
313
326
  modelValue: l(x),
314
327
  "onUpdate:modelValue": a[2] ||= (e) => h(x) ? x.value = e : null,
315
328
  type: "text",
@@ -318,13 +331,15 @@ var Q = { class: "gift-card-skeleton" }, ce = { class: "gift-card-skeleton-form"
318
331
  label: l(b)("giftCard.name"),
319
332
  icon: "user-alt",
320
333
  placeholder: l(b)("giftCard.namePlaceholder"),
334
+ error: Q("contactName"),
321
335
  required: ""
322
336
  }, null, 8, [
323
337
  "modelValue",
324
338
  "label",
325
- "placeholder"
339
+ "placeholder",
340
+ "error"
326
341
  ]),
327
- _(A, {
342
+ _(k, {
328
343
  modelValue: l(S),
329
344
  "onUpdate:modelValue": a[3] ||= (e) => h(S) ? S.value = e : null,
330
345
  type: "email",
@@ -333,25 +348,29 @@ var Q = { class: "gift-card-skeleton" }, ce = { class: "gift-card-skeleton-form"
333
348
  label: l(b)("giftCard.email"),
334
349
  icon: "at",
335
350
  placeholder: l(b)("giftCard.emailPlaceholder"),
351
+ error: Q("contactEmail"),
336
352
  required: ""
337
353
  }, null, 8, [
338
354
  "modelValue",
339
355
  "label",
340
- "placeholder"
356
+ "placeholder",
357
+ "error"
341
358
  ]),
342
- _(ie, {
359
+ _(ce, {
343
360
  modelValue: l(w),
344
361
  "onUpdate:modelValue": a[4] ||= (e) => h(w) ? w.value = e : null,
345
362
  icon: "phone-office",
346
363
  label: l(b)("giftCard.phone"),
347
364
  placeholder: l(b)("giftCard.phonePlaceholder"),
365
+ error: Q("contactPhone"),
348
366
  required: ""
349
367
  }, null, 8, [
350
368
  "modelValue",
351
369
  "label",
352
- "placeholder"
370
+ "placeholder",
371
+ "error"
353
372
  ]),
354
- _(A, {
373
+ _(k, {
355
374
  modelValue: l(E),
356
375
  "onUpdate:modelValue": a[5] ||= (e) => h(E) ? E.value = e : null,
357
376
  type: "number",
@@ -359,40 +378,46 @@ var Q = { class: "gift-card-skeleton" }, ce = { class: "gift-card-skeleton-form"
359
378
  label: l(b)("giftCard.value"),
360
379
  icon: "money-bill",
361
380
  placeholder: l(b)("giftCard.valuePlaceholder"),
362
- suffix: l(Z),
381
+ suffix: l(q),
382
+ error: Q("amount"),
363
383
  required: ""
364
384
  }, null, 8, [
365
385
  "modelValue",
366
386
  "label",
367
387
  "placeholder",
368
- "suffix"
388
+ "suffix",
389
+ "error"
369
390
  ]),
370
391
  e("", !0),
371
392
  e("", !0),
372
- _(j, {
373
- modelValue: l(k),
374
- "onUpdate:modelValue": a[8] ||= (e) => h(k) ? k.value = e : null,
393
+ _(A, {
394
+ modelValue: l(O),
395
+ "onUpdate:modelValue": a[8] ||= (e) => h(O) ? O.value = e : null,
375
396
  label: l(b)("giftCard.quantity"),
376
397
  icon: "gift-card",
398
+ error: Q("quantity"),
377
399
  required: ""
378
- }, null, 8, ["modelValue", "label"])
379
- ])], 512), [[m, l(z)]]),
380
- p(c("div", null, [c("div", { innerHTML: l(b)("giftCard.thankYou") }, null, 8, Se)], 512), [[m, l(H)]])
400
+ }, null, 8, [
401
+ "modelValue",
402
+ "label",
403
+ "error"
404
+ ])
405
+ ])], 512), [[m, l(P)]]),
406
+ p(c("div", null, [c("div", { innerHTML: l(b)("giftCard.thankYou") }, null, 8, ke)], 512), [[m, l(L)]])
381
407
  ]),
382
- n.layout !== "minimal" && l(z) ? (r(), o("div", Ce, [c("div", we, [_(N, {
408
+ n.layout !== "minimal" && l(P) ? (r(), o("div", Z, [c("div", Ae, [_(j, {
383
409
  label: l(b)("giftCard.orderGiftCard"),
384
410
  "full-width": !0,
385
- disabled: !l(W),
386
- "is-loading": l(K),
387
- "onUpdate:isLoading": a[9] ||= (e) => h(K) ? K.value = e : null,
388
- onClickEvent: l(J)
411
+ disabled: !l(z),
412
+ "is-loading": l(V),
413
+ "onUpdate:isLoading": a[9] ||= (e) => h(V) ? V.value = e : null,
414
+ onClickEvent: $
389
415
  }, null, 8, [
390
416
  "label",
391
417
  "disabled",
392
- "is-loading",
393
- "onClickEvent"
418
+ "is-loading"
394
419
  ])])])) : e("", !0),
395
- l(z) ? (r(), o("div", Te, [_(A, {
420
+ l(P) ? (r(), o("div", je, [_(k, {
396
421
  modelValue: l(D),
397
422
  "onUpdate:modelValue": a[10] ||= (e) => h(D) ? D.value = e : null,
398
423
  type: "textarea",
@@ -405,39 +430,38 @@ var Q = { class: "gift-card-skeleton" }, ce = { class: "gift-card-skeleton-form"
405
430
  "label",
406
431
  "placeholder"
407
432
  ])])) : e("", !0),
408
- l(z) ? (r(), o("div", Ee, [
409
- _(N, {
433
+ l(P) ? (r(), o("div", Me, [
434
+ _(j, {
410
435
  label: l(b)("giftCard.orderGiftCard"),
411
436
  "full-width": !0,
412
- disabled: !l(W),
437
+ disabled: !l(z),
413
438
  "data-test": "orderGiftCard",
414
- "is-loading": l(K),
415
- "onUpdate:isLoading": a[11] ||= (e) => h(K) ? K.value = e : null,
416
- onClickEvent: l(J)
439
+ "is-loading": l(V),
440
+ "onUpdate:isLoading": a[11] ||= (e) => h(V) ? V.value = e : null,
441
+ onClickEvent: $
417
442
  }, null, 8, [
418
443
  "label",
419
444
  "disabled",
420
- "is-loading",
421
- "onClickEvent"
445
+ "is-loading"
422
446
  ]),
423
- c("div", null, [a[12] ||= c("div", { class: "konnectio-divider" }, null, -1), _(fe)]),
424
- p(c("div", De, [_(oe)], 512), [[m, l(X)]])
447
+ c("div", null, [a[12] ||= c("div", { class: "konnectio-divider" }, null, -1), _(ve)]),
448
+ p(c("div", Ne, [_(fe)], 512), [[m, l(K)]])
425
449
  ])) : e("", !0)
426
- ])], 8, pe))]),
450
+ ])], 8, ye))]),
427
451
  _: 1
428
452
  }, 8, [
429
453
  "access-token",
430
454
  "data-layout",
431
455
  "callback"
432
456
  ])]),
433
- fallback: C(() => [_(le)]),
457
+ fallback: C(() => [_(_e)]),
434
458
  _: 1
435
459
  }))]),
436
460
  _: 1
437
461
  }, 8, ["styling"]));
438
462
  }
439
- }), [["__scopeId", "data-v-5baf85ce"]]), ke = S(), Ae = x("konnectio-gift-card", Oe, (e) => {
440
- e.use(D), e.use(ke), e.use(b), e.use(z);
463
+ }), [["__scopeId", "data-v-779afb5c"]]), $ = S(), Pe = x("konnectio-gift-card", Q, (e) => {
464
+ e.use(D), e.use($), e.use(b), e.use(P);
441
465
  });
442
466
  //#endregion
443
- export { Ae as default };
467
+ export { Pe as default };
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  import { c as e, l as t, t as n, w as r, yt as i } from "./i18n-BF6zkld-.js";
2
- import { E as a, I as o, K as s, N as c, T as l, at as u, j as d, pt as f, ut as p } from "./SelectField-DMU4o8wT.js";
2
+ import { E as a, I as o, K as s, N as c, T as l, at as u, j as d, pt as f, ut as p } from "./SelectField-DRafB_Cb.js";
3
3
  //#region src/store/giftCard.ts
4
4
  var m = e("giftCard", () => {
5
5
  let { pay: e } = d(), { display: m } = c(), { metaData: h, currencyId: g, hasError: _ } = t(a()), v = a(), y = i(u.InitialState), b = f("konnectio_name", "", void 0, { serializer: p.string }), x = f("konnectio_email", "", void 0, { serializer: p.string }), S = f("konnectio_phone", "", void 0, { serializer: p.string }), C = i(""), w = i(1), T = i(!0), E = i(""), D = i({
@@ -16,15 +16,15 @@ var m = e("giftCard", () => {
16
16
  label: n.t("giftCard.restaurantType"),
17
17
  data: []
18
18
  }
19
- }, t = h.value.hotels[0].places;
19
+ }, t = h.value.hotels?.[0]?.places;
20
20
  return t && t.forEach((t) => {
21
21
  e[t.placeType].data.push(t);
22
22
  }), Object.fromEntries(Object.entries(e).filter(([, e]) => e.data.length > 0));
23
23
  }), R = r(() => j.value !== 0), z = r(() => {
24
24
  let e;
25
- if (R.value) e = L.value[j.value].data[0];
25
+ if (R.value) e = L.value[j.value]?.data[0];
26
26
  else if (k.value !== 0) {
27
- let t = O.value, n = L.value[k.value].data;
27
+ let t = O.value, n = L.value[k.value]?.data ?? [];
28
28
  n.length === 1 ? e = n[0] : t !== void 0 && n.forEach((n) => {
29
29
  String(n.id) === String(t) && (e = n);
30
30
  });
@@ -42,8 +42,8 @@ var m = e("giftCard", () => {
42
42
  });
43
43
  }
44
44
  }
45
- async function W() {
46
- y.value = u.WaitingForResponse, A.value = !0, await l().post("/gift-card/create", {
45
+ function W() {
46
+ return {
47
47
  termsOfserviceURL: window.location.origin,
48
48
  checkoutUrl: window.location.origin,
49
49
  currencyID: g.value,
@@ -60,7 +60,12 @@ var m = e("giftCard", () => {
60
60
  imageFormat: D.value.type,
61
61
  placeType: z.value ? z.value.placeType : void 0,
62
62
  placeID: z.value ? z.value.id : void 0
63
- }).then((t) => {
63
+ };
64
+ }
65
+ async function G() {
66
+ y.value = u.WaitingForResponse, A.value = !0;
67
+ try {
68
+ let t = await l().post("/gift-card/create", W());
64
69
  y.value = u.ReadyToPay, A.value = !1, e({
65
70
  callback: (e) => {
66
71
  e === 2 && (y.value = u.PaymentSuccess);
@@ -68,9 +73,13 @@ var m = e("giftCard", () => {
68
73
  response: t.data,
69
74
  enableHostedRedirect: !0
70
75
  });
71
- });
76
+ return;
77
+ } catch (e) {
78
+ if (A.value = !1, y.value = u.InitialState, e?.response?.status === 422) return e.response.data.errors;
79
+ throw e;
80
+ }
72
81
  }
73
- function G(e) {
82
+ function K(e) {
74
83
  e && (j.value = e);
75
84
  }
76
85
  return {
@@ -96,8 +105,9 @@ var m = e("giftCard", () => {
96
105
  isMetadataAvailable: V,
97
106
  termsOfService: N,
98
107
  fetchMetadata: U,
99
- orderGiftCard: W,
100
- initialize: G
108
+ giftCardPayload: W,
109
+ orderGiftCard: G,
110
+ initialize: K
101
111
  };
102
112
  });
103
113
  //#endregion
Binary file
Binary file