@konnectio/core
Version:
Konnectio Core Frontend Integration.
1,073 lines (1,072 loc) • 38.6 kB
JavaScript
import { $ as e, A as t, At as n, D as r, Dt as i, E as a, Et as o, M as s, O as c, P as l, S as u, T as d, Y as f, bt as p, c as m, dt as h, et as g, gt as _, j as v, k as y, o as b, p as x, q as S, r as C, s as w, st as T, t as E, u as D, x as O, y as k } from "./mitt-Dp_pykgV.js";
import { t as A } from "./dist-CcS6KL-S.js";
import { B as ee, C as j, D as te, E as M, F as N, G as P, H as F, J as I, K as L, L as R, M as z, Q as ne, S as B, U as V, X as H, Y as U, b as re, dt as ie, n as W, r as G, rt as ae, v as K, w as q, x as J, z as oe } from "./SelectField-CfD2awPl.js";
import { t as se } from "./_-13YE3WJt.js";
import { a as ce, c as le, d as ue, f as de, i as fe, l as pe, n as me, o as he, r as Y, s as X, u as ge } from "./AvailabilitySkeleton-DVRsnt_Y.js";
import { t as _e } from "./EventAvailabilityForm-Dy1fXJzt.js";
import { t as ve } from "./style-Bpqv9k-3.js";
import { a as ye, c as be, d as xe, l as Se, n as Z, o as Q, r as Ce, s as we, t as Te, u as Ee } from "./masonry.plugin-BfiSV-UY.js";
import { i as De, r as Oe, t as ke } from "./CheckoutWindow-Cx1MBwXg.js";
//#region node_modules/date-fns/formatDistanceStrict.js
function Ae(e, t, n) {
let r = le(), i = n?.locale ?? r.locale ?? Y, a = ce(e, t);
if (isNaN(a)) throw RangeError("Invalid time value");
let o = Object.assign({}, n, {
addSuffix: n?.addSuffix,
comparison: a
}), [s, c] = he(n?.in, ...a > 0 ? [t, e] : [e, t]), l = fe(n?.roundingMethod ?? "round"), u = c.getTime() - s.getTime(), d = u / pe, f = (u - (X(c) - X(s))) / pe, p = n?.unit, m;
if (m = p || (d < 1 ? "second" : d < 60 ? "minute" : d < 1440 ? "hour" : f < 43200 ? "day" : f < 525600 ? "month" : "year"), m === "second") {
let e = l(u / 1e3);
return i.formatDistance("xSeconds", e, o);
} else if (m === "minute") {
let e = l(d);
return i.formatDistance("xMinutes", e, o);
} else if (m === "hour") {
let e = l(d / 60);
return i.formatDistance("xHours", e, o);
} else if (m === "day") {
let e = l(f / ge);
return i.formatDistance("xDays", e, o);
} else if (m === "month") {
let e = l(f / ue);
return e === 12 && p !== "month" ? i.formatDistance("xYears", 1, o) : i.formatDistance("xMonths", e, o);
} else {
let e = l(f / de);
return i.formatDistance("xYears", e, o);
}
}
//#endregion
//#region src/components/listings/event/_.vue?vue&type=script&setup=true&lang.ts
var je = { class: "konnectio-event-listing-action-button" }, Me = /* @__PURE__ */ B(/* @__PURE__ */ l({
__name: "_",
props: {
name: {},
description: {},
toDate: {},
listingId: {},
tableGroupId: {},
days: {},
length: {},
timeFrom: {},
timeTo: {},
maxOnlineReservationLimit: {},
minimumPersonCount: {},
maxGuests: {},
fromPrice: { default: 0 },
gallery: {},
soldOut: {
type: Boolean,
default: !1
},
useNumberOfProductsForPersons: { type: Boolean },
type: {},
trackingEnabled: { type: Boolean },
disableDeepLink: {
type: Boolean,
default: !1
},
callback: {}
},
setup(e) {
let { t } = b(), n = e, { display: l } = z(), { hideEventGuestAmount: u } = D(M()), { maxNumberOfPeople: m, numberOfPeople: _, eventId: v, currentEventDate: y, tableGroupId: x } = D(q()), { getTemplateAvailability: S, getEventAvailability: C, isEventListingLoading: w } = q(), { addToCart: T } = te(), E = d(() => n.maxGuests || n.maxOnlineReservationLimit || m.value || Infinity), O = p(0), k = d(() => w(n.listingId)), A = () => {
if (!n.useNumberOfProductsForPersons && (O.value === 0 || isNaN(O.value))) {
l({
type: "error",
message: t("alert.error.selectPeople")
});
return;
}
n.trackingEnabled && T({
id: n.listingId,
name: n.name,
value: n.fromPrice || 0
}), v.value = n.listingId, _.value = n.useNumberOfProductsForPersons ? NaN : O.value, S(n.callback);
}, ee = () => {
if (!n.useNumberOfProductsForPersons && (O.value === 0 || isNaN(O.value))) {
l({
type: "error",
message: t("alert.error.selectPeople")
});
return;
}
n.trackingEnabled && T({
id: n.listingId,
name: n.name,
value: n.fromPrice || 0
}), v.value = n.listingId, x.value = n.tableGroupId, _.value = n.useNumberOfProductsForPersons ? NaN : O.value, C(n.callback);
};
return (n, l) => (f(), r(Ee, {
type: "event",
"listing-id": e.listingId,
gallery: e.gallery,
name: e.name,
description: e.description,
"prices-from": e.fromPrice,
"to-date": e.toDate,
layout: o(ne).Event,
"disable-deep-link": e.disableDeepLink
}, {
description: h(() => [g(n.$slots, "description", { maxNumberOfPeople: o(m) }, void 0, !0)]),
action: h(() => [g(n.$slots, "action", {}, () => [a("div", { class: i(["konnectio-event-listing-action", { "no-selectable-people": e.useNumberOfProductsForPersons }]) }, [e.useNumberOfProductsForPersons ? c("", !0) : (f(), r(G, {
key: 0,
modelValue: O.value,
"onUpdate:modelValue": l[0] ||= (e) => O.value = e,
label: o(t)("event.numberOfGuests"),
icon: "users",
"icon-type": "fas",
"icon-placement": "label",
description: E.value <= 20 && !o(u) ? `${o(t)("general.availableFor")}: 1 - ${E.value} ${o(V)(o(t)("general.guests"))}` : void 0,
"min-value": 0,
"max-value": E.value
}, null, 8, [
"modelValue",
"label",
"description",
"max-value"
])), a("div", je, [s(K, {
label: e.soldOut ? o(t)("event.soldOut") : o(t)("event.bookNowButton"),
disabled: e.soldOut,
"is-loading": k.value,
"full-width": "",
"sub-label": o(P)(o(y)),
onClickEvent: l[1] ||= (t) => e.type === "event" ? ee() : A()
}, null, 8, [
"label",
"disabled",
"is-loading",
"sub-label"
])])], 2)], !0)]),
_: 3
}, 8, [
"listing-id",
"gallery",
"name",
"description",
"prices-from",
"to-date",
"layout",
"disable-deep-link"
]));
}
}), [["__scopeId", "data-v-23ac9949"]]), Ne = { class: "konnectio-event-listing-information-new" }, Pe = {
key: 1,
class: "konnectio-pill-button"
}, Fe = {
key: 2,
class: "konnectio-pill-button"
}, Ie = { key: 0 }, Le = { key: 1 }, $ = /* @__PURE__ */ B(/* @__PURE__ */ l({
__name: "Event",
props: {
name: {},
description: {},
fromDate: {},
toDate: {},
length: {},
timeFrom: {},
timeTo: {},
gallery: {},
days: {},
listingId: {},
tableGroupId: {},
maxOnlineReservationLimit: {},
minimumPersonCount: {},
fromPrice: { default: 0 },
soldOut: { type: Boolean },
useNumberOfProductsForPersons: { type: Boolean },
trackingEnabled: { type: Boolean },
callback: {}
},
setup(e) {
let t = e, { t: i } = b(), { hideEventLength: l, hideEventEndTime: u } = D(M()), p = d(() => {
if (!t.length) return;
let e = t.length.split(":");
return Ae(new Date(2e3, 0, 1, Number(e[0]), Number(e[1]), 0), new Date(2e3, 0, 1, 0, 0, 0));
});
return (t, d) => (f(), r(Me, {
"listing-id": e.listingId,
name: e.name,
description: e.description,
gallery: e.gallery,
"prices-from": e.fromPrice,
"table-group-id": e.tableGroupId,
"max-guests": e.maxOnlineReservationLimit,
"use-number-of-products-for-persons": e.useNumberOfProductsForPersons,
"to-date": e.toDate,
"sold-out": e.soldOut,
type: "event",
"tracking-enabled": e.trackingEnabled,
callback: e.callback
}, {
description: h(() => [e.description ? (f(), r(xe, {
key: 0,
text: e.description
}, null, 8, ["text"])) : c("", !0), a("ul", Ne, [
c("", !0),
!o(l) && p.value ? (f(), y("li", Pe, [a("div", null, [s(J, {
icon: "calendar-clock",
color: "header"
}), a("span", null, n(o(i)("event.lengthOfEvent")), 1)]), a("span", null, n(p.value), 1)])) : c("", !0),
e.timeFrom ? (f(), y("li", Fe, [a("div", null, [s(J, {
icon: "calendar-clock",
color: "header"
}), a("span", null, n(o(i)("event.startAndEndTime")), 1)]), o(u) ? (f(), y("span", Le, n(o(U)(e.timeFrom)), 1)) : (f(), y("span", Ie, n(o(H)(e.timeFrom, e.timeTo)), 1))])) : c("", !0)
])]),
action: h(() => [g(t.$slots, "action", {}, void 0, !0)]),
_: 3
}, 8, [
"listing-id",
"name",
"description",
"gallery",
"prices-from",
"table-group-id",
"max-guests",
"use-number-of-products-for-persons",
"to-date",
"sold-out",
"tracking-enabled",
"callback"
]));
}
}), [["__scopeId", "data-v-40cbbf2c"]]), Re = {
key: 0,
class: "konnectio-event-grouped-listings-container"
}, ze = { class: "konnectio-event-grouped-listings" }, Be = /* @__PURE__ */ B(/* @__PURE__ */ l({
__name: "Event",
props: {
name: {},
events: {},
trackingEnabled: { type: Boolean },
callback: { type: Function }
},
setup(t) {
return (n, i) => t.events && t.events.length > 1 ? (f(), y("div", Re, [c("", !0), a("ul", ze, [(f(!0), y(O, null, e(t.events, ({ id: e, days: n, name: i, timeFrom: a, timeTo: o, tableGroupId: s, description: c, soldOut: l, length: u, images: d, maxOnlineReservationLimit: p, maxPaxPerReservation: m, useNumberOfProductsForPersons: h, maxTicketsLimit: g }) => (f(), r($, {
key: e,
type: "event",
"listing-id": e,
"table-group-id": s,
description: c,
name: i,
length: u,
gallery: d,
days: n,
"max-online-reservation-limit": m || p || g || void 0,
"time-from": a,
"time-to": o,
"sold-out": l,
"use-number-of-products-for-persons": h,
"tracking-enabled": t.trackingEnabled,
callback: t.callback
}, null, 8, [
"listing-id",
"table-group-id",
"description",
"name",
"length",
"gallery",
"days",
"max-online-reservation-limit",
"time-from",
"time-to",
"sold-out",
"use-number-of-products-for-persons",
"tracking-enabled",
"callback"
]))), 128))])])) : t.events ? (f(), r($, {
key: t.events[0].id,
type: "event",
"listing-id": t.events[0].id,
"table-group-id": t.events[0].tableGroupId,
description: t.events[0].description,
name: t.events[0].name,
length: t.events[0].length,
gallery: t.events[0].images,
days: t.events[0].days,
"from-date": t.events[0].fromDate,
"to-date": t.events[0].toDate,
"max-online-reservation-limit": t.events[0].maxPaxPerReservation || t.events[0].maxOnlineReservationLimit || t.events[0].maxTicketsLimit || void 0,
"time-from": t.events[0].timeFrom,
"time-to": t.events[0].timeTo,
"sold-out": t.events[0].soldOut,
"use-number-of-products-for-persons": t.events[0].useNumberOfProductsForPersons,
"tracking-enabled": t.trackingEnabled,
callback: t.callback
}, null, 8, [
"listing-id",
"table-group-id",
"description",
"name",
"length",
"gallery",
"days",
"from-date",
"to-date",
"max-online-reservation-limit",
"time-from",
"time-to",
"sold-out",
"use-number-of-products-for-persons",
"tracking-enabled",
"callback"
])) : c("", !0);
}
}), [["__scopeId", "data-v-374ad034"]]), Ve = { class: "konnectio-special-offer-availability" }, He = { class: "konnectio-special-offer-availability-button" }, Ue = { class: "konnectio-warning-notice" }, We = { key: 0 }, Ge = { key: 1 }, Ke = /* @__PURE__ */ B(/* @__PURE__ */ l({
__name: "NextEvent",
props: {
name: {},
description: {},
fromDate: {},
toDate: {},
length: {},
timeFrom: {},
timeTo: {},
gallery: {},
days: {},
listingId: {},
tableGroupId: {},
maxOnlineReservationLimit: {},
minimumPersonCount: {},
soldOut: { type: Boolean },
useNumberOfProductsForPersons: { type: Boolean },
trackingEnabled: { type: Boolean },
callback: { type: Function }
},
setup(e) {
let { t } = b(), { updateEventDate: i } = j(), { display: c } = z(), l = p(), u = e;
function m() {
l.value ? i(l.value) : c({
message: t("alert.error.selectDate"),
type: "error"
});
}
let g = d(() => R(u.fromDate, u.toDate) <= 1), _ = d(() => [
0,
1,
2,
3,
4,
5,
6
].filter((e) => !oe(u.days).includes(e)));
return S(() => {
g.value && (l.value = new Date(u.fromDate));
}), (i, c) => (f(), r($, {
name: e.name,
description: e.description,
"from-date": e.fromDate,
"to-date": e.toDate,
length: e.length,
"time-from": e.timeFrom,
"time-to": e.timeTo,
gallery: e.gallery,
days: e.days,
"listing-id": e.listingId,
"table-group-id": e.tableGroupId,
"max-online-reservation-limit": e.maxOnlineReservationLimit,
"minimum-person-count": e.minimumPersonCount,
"use-number-of-products-for-persons": e.useNumberOfProductsForPersons,
"tracking-enabled": e.trackingEnabled,
"sold-out": e.soldOut,
callback: e.callback,
"disable-deep-link": !0
}, {
action: h(() => [a("div", null, [a("div", Ve, [s(me, {
modelValue: l.value,
"onUpdate:modelValue": c[0] ||= (e) => l.value = e,
label: `${o(t)("event.selectDate")}*`,
placeholder: o(t)("event.selectDate"),
"icon-type": "fas",
"icon-placement": "label",
readonly: g.value,
"start-date": e.fromDate === "0001-01-01T00:00:00Z" ? new Date(e.toDate) : new Date(e.fromDate),
"min-date": e.fromDate === "0001-01-01T00:00:00Z" ? new Date(e.toDate) : new Date(e.fromDate),
"max-date": new Date(e.toDate),
"disabled-week-days": _.value
}, null, 8, [
"modelValue",
"label",
"placeholder",
"readonly",
"start-date",
"min-date",
"max-date",
"disabled-week-days"
]), a("div", He, [s(K, {
label: o(t)("availability.buttonLabel"),
onClick: k(m, ["prevent"])
}, null, 8, ["label"])])]), a("div", Ue, [g.value ? (f(), y("span", We, [v("*" + n(o(t)("event.canBeBooked")) + " ", 1), a("u", null, n(o(P)(e.fromDate)), 1)])) : (f(), y("span", Ge, [v("*" + n(o(t)("event.canBeBooked")) + " ", 1), a("u", null, n(o(L)(e.days)), 1)]))])])]),
_: 1
}, 8, [
"name",
"description",
"from-date",
"to-date",
"length",
"time-from",
"time-to",
"gallery",
"days",
"listing-id",
"table-group-id",
"max-online-reservation-limit",
"minimum-person-count",
"use-number-of-products-for-persons",
"tracking-enabled",
"sold-out",
"callback"
]));
}
}), [["__scopeId", "data-v-f6aed3b0"]]), qe = {
key: 0,
class: "konnectio-event-grouped-listings-container"
}, Je = { class: "konnectio-event-grouped-listings" }, Ye = /* @__PURE__ */ B(/* @__PURE__ */ l({
__name: "NextEvent",
props: {
name: {},
events: {},
trackingEnabled: { type: Boolean },
callback: { type: Function }
},
setup(t) {
return (n, i) => t.events && t.events.length > 1 ? (f(), y("div", qe, [c("", !0), a("ul", Je, [(f(!0), y(O, null, e(t.events, ({ id: e, days: n, name: i, timeFrom: a, timeTo: o, fromDate: s, toDate: c, tableGroupId: l, description: u, soldOut: d, length: p, images: m, maxOnlineReservationLimit: h, maxPaxPerReservation: g, useNumberOfProductsForPersons: _, maxTicketsLimit: v }) => (f(), r(Ke, {
key: e,
type: "event",
"listing-id": e,
"table-group-id": l,
description: u,
name: i,
length: p,
gallery: m,
days: n,
"from-date": s,
"to-date": c,
"max-online-reservation-limit": g || h || v || void 0,
"time-from": a,
"time-to": o,
"sold-out": d,
"use-number-of-products-for-persons": _,
"tracking-enabled": t.trackingEnabled,
callback: t.callback
}, null, 8, [
"listing-id",
"table-group-id",
"description",
"name",
"length",
"gallery",
"days",
"from-date",
"to-date",
"max-online-reservation-limit",
"time-from",
"time-to",
"sold-out",
"use-number-of-products-for-persons",
"tracking-enabled",
"callback"
]))), 128))])])) : t.events ? (f(), r(Ke, {
key: t.events[0].id,
type: "event",
"listing-id": t.events[0].id,
"table-group-id": t.events[0].tableGroupId,
description: t.events[0].description,
name: t.events[0].name,
length: t.events[0].length,
gallery: t.events[0].images,
days: t.events[0].days,
"from-date": t.events[0].fromDate,
"to-date": t.events[0].toDate,
"max-online-reservation-limit": t.events[0].maxPaxPerReservation || t.events[0].maxOnlineReservationLimit || t.events[0].maxTicketsLimit || void 0,
"time-from": t.events[0].timeFrom,
"time-to": t.events[0].timeTo,
"sold-out": t.events[0].soldOut,
"use-number-of-products-for-persons": t.events[0].useNumberOfProductsForPersons,
"tracking-enabled": t.trackingEnabled,
callback: t.callback
}, null, 8, [
"listing-id",
"table-group-id",
"description",
"name",
"length",
"gallery",
"days",
"from-date",
"to-date",
"max-online-reservation-limit",
"time-from",
"time-to",
"sold-out",
"use-number-of-products-for-persons",
"tracking-enabled",
"callback"
])) : c("", !0);
}
}), [["__scopeId", "data-v-39263761"]]), Xe = ["innerHTML"], Ze = /* @__PURE__ */ B(/* @__PURE__ */ l({
__name: "FallbackEvent",
props: {
name: {},
description: {},
fromDate: {},
gallery: {},
days: {},
listingId: {},
trackingEnabled: { type: Boolean },
callback: { type: Function }
},
setup(e) {
let { t } = b();
return (n, i) => (f(), r($, {
name: e.name,
description: e.description,
"from-date": e.fromDate,
gallery: e.gallery,
days: e.days,
"listing-id": e.listingId,
"tracking-enabled": e.trackingEnabled,
callback: e.callback,
"disable-deep-link": !0
}, {
action: h(() => [a("div", {
class: "konnectio-filter-notice konnectio-top-message",
innerHTML: o(t)("event.notAvailable", { name: `<b>${e.name}</b>` })
}, null, 8, Xe)]),
_: 1
}, 8, [
"name",
"description",
"from-date",
"gallery",
"days",
"listing-id",
"tracking-enabled",
"callback"
]));
}
}), [["__scopeId", "data-v-0167deff"]]), Qe = /* @__PURE__ */ l({
__name: "Template",
props: {
name: {},
description: {},
fromDate: {},
toDate: {},
listingId: {},
tableGroupId: {},
maxOnlineReservationLimit: {},
minimumPersonCount: {},
fromPrice: { default: 0 },
images: {},
trackingEnabled: { type: Boolean },
callback: {}
},
setup(e) {
return (t, n) => (f(), r(Me, {
"listing-id": e.listingId,
gallery: e.images,
name: e.name,
description: e.description,
"prices-from": e.fromPrice,
"to-date": e.toDate,
type: "template",
"tracking-enabled": e.trackingEnabled,
callback: e.callback
}, null, 8, [
"listing-id",
"gallery",
"name",
"description",
"prices-from",
"to-date",
"tracking-enabled",
"callback"
]));
}
}), $e = {
key: 0,
class: "konnectio-panel konnectio-reservation-notice-mobile"
}, et = ["innerHTML"], tt = { key: 0 }, nt = { key: 1 }, rt = { key: 2 }, it = { key: 0 }, at = { key: 4 }, ot = { key: 5 }, st = { key: 6 }, ct = { key: 0 }, lt = { key: 0 }, ut = { key: 1 }, dt = {
key: 0,
class: "konnectio-capitalize"
}, ft = /* @__PURE__ */ B(/* @__PURE__ */ l({
__name: "EventReservationForm",
props: {
showGiftCard: {
type: Boolean,
default: !1
},
showTermsNotice: {
type: Boolean,
default: !1
},
prevCallback: {}
},
setup(i) {
let { t: s } = b(), l = T(), { areListingsAvailable: u, arrivalTime: d, numberOfPeople: p, numberOfRooms: m, numberOfTotalDays: v, isTemplateEvent: x, currentEventDate: S, length: C, fromDate: w, tableBasePrice: E, getTemplateData: k, basePrice: A, totalPrice: ee, weekendFee: j, roomUpgrade: te, discountCode: N, totalSelectedProducts: F, discountValue: L, appliedDiscountCode: R } = D(q()), { totalAddonPrice: z, validateDiscountCode: ne } = q(), { currency: B, hideEventLength: V } = D(M()), H = s("event.reservationNotice");
return (b, T) => (f(), r(Q, {
"discount-code": o(N),
"onUpdate:discountCode": T[0] ||= (e) => _(N) ? N.value = e : null,
"validate-discount-code": o(ne),
"show-gift-card": i.showGiftCard,
"show-terms-notice": i.showTermsNotice,
"is-sidebar-loading": !o(u),
"base-price": o(A),
"total-price": o(ee),
"weekend-fee": o(j),
"room-upgrade": o(te),
notice: o(H),
"prev-callback": i.prevCallback
}, t({
form: h(() => [g(b.$slots, "form", {}, void 0, !0), o(H) ? (f(), y("div", $e, [a("p", {
innerHTML: o(H),
class: "konnectio-wysiwyg"
}, null, 8, et)])) : c("", !0)]),
"reservation-summary": h(() => [
o(x) ? c("", !0) : (f(), y("li", tt, [a("span", null, n(o(s)("general.date")), 1), a("b", null, n(o(P)(o(S))), 1)])),
o(p) > 0 ? (f(), y("li", nt, [a("span", null, n(o(s)("event.numberOfGuests")), 1), a("b", null, n(o(p)), 1)])) : c("", !0),
!o(x) && o(F) > 0 ? (f(), y("li", rt, [a("span", null, n(o(s)("event.numberOfProducts")), 1), a("b", null, n(o(F)), 1)])) : c("", !0),
o(x) ? (f(), y(O, { key: 3 }, [
a("li", null, [a("span", null, n(o(s)("booking.reservation.arrival")), 1), a("b", null, n(o(P)(o(w))), 1)]),
a("li", null, [a("span", null, n(o(s)("booking.reservation.departure")), 1), a("b", null, n(o(P)(o(w), o(v))), 1)]),
a("li", null, [a("span", null, n(o(s)("event.numberOfRooms")), 1), a("b", null, n(o(m)), 1)]),
o(v) > 0 ? (f(), y("li", it, [a("span", null, n(o(s)("event.numberOfDays")), 1), a("b", null, n(o(v)), 1)])) : c("", !0)
], 64)) : c("", !0),
!o(x) && o(d) ? (f(), y("li", at, [a("span", null, n(o(s)("event.startOfEvent")), 1), a("b", null, n(o(U)(o(d))), 1)])) : c("", !0),
!o(x) && o(C) && !o(V) ? (f(), y("li", ot, [a("span", null, n(o(s)("event.lengthOfEvent")), 1), a("b", null, n(o(U)(o(C))), 1)])) : c("", !0),
o(L) ? (f(), y("li", st, [a("span", null, n(o(s)("general.discountCode")), 1), a("b", null, n(o(R)), 1)])) : c("", !0)
]),
"price-summary": h(() => [!o(x) && o(E) > 0 ? (f(), y("li", ct, [a("span", null, n(o(s)("booking.availability.basePrice")), 1), a("b", null, n(o(I)(o(E), o(B))), 1)])) : c("", !0), o(k) ? (f(!0), y(O, { key: 1 }, e(o(k), ({ roomGroupId: e }, t) => (f(), y(O, null, [o(z)(e, t) > 0 ? (f(), y("li", { key: e }, [a("span", null, n(o(s)("booking.reservation.addons")) + " - " + n(o(s)("booking.reservation.room")) + " #" + n(t + 1), 1), a("b", null, n(o(I)(o(z)(e, t), o(B))), 1)])) : c("", !0)], 64))), 256)) : c("", !0)]),
navigation: h(() => [g(b.$slots, "navigation", {}, void 0, !0)]),
"mobile-under-price": h(() => [o(x) && o(v) > 0 ? (f(), y("div", lt, [a("span", null, n(o(P)(o(w))) + " - " + n(o(P)(o(w), o(v))), 1)])) : (f(), y("div", ut, [a("span", null, n(o(P)(o(S))), 1)]))]),
"mobile-summary": h(() => [!o(x) && o(F) > 0 ? (f(), y("span", dt, n(o(s)("event.numberOfProducts")) + ": " + n(o(F)), 1)) : c("", !0)]),
_: 2
}, [o(l).sidebar ? {
name: "sidebar",
fn: h(() => [g(b.$slots, "sidebar", {}, void 0, !0)]),
key: "0"
} : void 0]), 1032, [
"discount-code",
"validate-discount-code",
"show-gift-card",
"show-terms-notice",
"is-sidebar-loading",
"base-price",
"total-price",
"weekend-fee",
"room-upgrade",
"notice",
"prev-callback"
]));
}
}), [["__scopeId", "data-v-d2ff3f68"]]), pt = { class: "event-skeleton" }, mt = { class: "event-skeleton-content" }, ht = { class: "event-skeleton-sidebar" }, gt = /* @__PURE__ */ B(/* @__PURE__ */ l({
__name: "EventSkeleton",
setup(e) {
return (e, t) => (f(), y("div", pt, [a("div", mt, [s(Ce)]), a("div", ht, [c("", !0), s(we)])]));
}
}), [["__scopeId", "data-v-3e15c4e3"]]), _t = {
key: 0,
id: "konnectio-event-listings-wrapper"
}, vt = {
key: 1,
class: "konnectio-hotel-availability-title"
}, yt = { class: "konnectio-event-listings" }, bt = { class: "konnectio-hotel-availability-title" }, xt = { class: "konnectio-event-listings" }, St = ["innerHTML"], Ct = { class: "konnectio-panel" }, wt = {
key: 0,
id: "konnectio-event-addons"
}, Tt = { class: "konnectio-table with-lines" }, Et = { class: "konnectio-event-addons-price" }, Dt = { class: "konnectio-event-addons-input" }, Ot = { class: "konnectio-event-addons-price" }, kt = { class: "konnectio-event-addons-price" }, At = {
key: 1,
class: "konnectio-table with-lines without-header"
}, jt = { class: "konnectio-table-addons-information" }, Mt = { key: 0 }, Nt = { class: "konnectio-table-addons-option" }, Pt = { class: "konnectio-panel" }, Ft = /* @__PURE__ */ B(/* @__PURE__ */ l({
name: "EventLayout",
__name: "Event",
props: {
accessToken: {},
onlyShow: { default: "everything" },
selectedLocation: {},
resetDate: { default: "no" },
hideLocations: { default: "no" },
hideRemarks: { default: "no" },
hideAllergies: { default: "no" },
showFlagOnTable: { default: "no" },
showHighChairs: {},
sortOrder: { default: "asc" },
excludeEventIds: { default: "" },
styling: {}
},
setup(t) {
let i = t, { t: l } = b(), p = q(), { addons: m, products: g, numberOfDays: x, flagOnTable: S, numberOfHighChairs: C, name: w, phone: T, email: E, remark: k, allergies: A, arrivalTime: P, hasEvents: L, hasTemplates: R, getTemplates: ne, getEventData: B, getTemplateData: V, getEventTableData: H, hasProducts: oe, eventRateType: ce, areListingsAvailable: le, isAvailabilityDataAvailable: ue, hasListingData: de, isPaymentLoading: fe, isReservationFormFilled: pe, requiresArrivalTime: me, hasSelectedRequiredProducts: he, getUnavailableEvents: Y, hasFallbackEvents: X, getFallbackEvents: ge, excludeEventIds: ve } = D(p), xe = d(() => p.getSortedEvents(i.sortOrder)), { currency: Z, enableTracking: Q } = D(M()), { setActiveIdFilter: we } = M(), { eventDate: Te, eventLocation: Ee } = D(j()), { isValidRestaurantId: Ae } = j(), { initialize: je, fetchListings: Me, createBooking: Ne, localAddonPrice: Pe, totalAddonPrice: Fe, reset: Ie, goBack: Le } = q(), { beginEventCheckout: $ } = te(), { display: Re } = z(), ze = d(() => [
{
id: "availability",
label: l("booking.availability.title"),
icon: "search"
},
{
id: "addons",
label: l("general.addons"),
icon: "shopping-cart",
hidden: !1
},
{
id: "reservation",
label: l("booking.reservation.title"),
icon: "concierge-bell"
},
{
id: "payment",
hidden: !0
},
{
id: "confirmation",
label: l("booking.confirmation.title"),
icon: "calendar-check"
}
]), Ve = d(() => {
let e = [];
return H.value && H.value.forEach((t) => {
e.find((e) => e.value === t.time) || e.push({
label: U(t.time),
value: t.time
});
}), e;
});
function He() {
Ie(i.resetDate === "yes");
}
function Ue(e) {
Q.value && $(), Ne(e);
}
function We() {
let e = ie("history", { removeNullishValues: !0 }), t = parseInt(e.rid), n = e.d, r = parseInt(e.eid);
if (n) if (F(n)) {
let t = new Date(n);
t.setHours(12, 0, 0, 0) >= (/* @__PURE__ */ new Date()).setHours(12, 0, 0, 0) ? Te.value = t : (Re({
message: l("alert.error.invalidDateRange"),
type: "error"
}), e.d = void 0);
} else Re({
message: l("alert.error.wrongDateFormat"),
type: "error"
});
isNaN(t) || (Ae(t) ? Ee.value = t : (e.rid = void 0, Re({
message: l("alert.error.hotelIdNotFound"),
type: "error"
}))), isNaN(r) || we(r), i.excludeEventIds && (ve.value = i.excludeEventIds), Me();
}
return (i, d) => (f(), r(re, { styling: t.styling }, {
default: h(() => [(f(), r(u, { onResolve: We }, {
default: h(() => [s(se, {
id: "konnectio-event-module",
"access-token": t.accessToken,
callback: o(je)
}, {
default: h(() => [s(be, {
steps: ze.value,
onReset: He
}, {
availability: h(({ next: i }) => [s(ft, null, {
sidebar: h(() => [s(_e, {
redirection: !1,
"selected-location": Number(t.selectedLocation),
"hide-locations": t.hideLocations === "yes"
}, null, 8, ["selected-location", "hide-locations"])]),
form: h(() => [o(de) && o(le) ? (f(), y("div", _t, [
o(X) ? (f(!0), y(O, { key: 0 }, e(o(ge), ({ id: e, name: t, description: n, images: a }) => (f(), r(Ze, {
key: e,
type: "event",
"listing-id": e,
description: n,
name: t,
gallery: a,
"tracking-enabled": o(Q),
callback: i
}, null, 8, [
"listing-id",
"description",
"name",
"gallery",
"tracking-enabled",
"callback"
]))), 128)) : c("", !0),
xe.value.length > 0 && o(Y).length > 0 ? (f(), y("h2", vt, [s(J, {
icon: "calendar-clock",
type: "fal",
color: "header"
}), a("span", null, n(o(l)("event.availableNow")), 1)])) : c("", !0),
a("ul", yt, [o(L) && t.onlyShow !== "templates" ? (f(!0), y(O, { key: 0 }, e(xe.value, (e) => (f(), r(Be, {
name: e.name,
events: e.events,
"tracking-enabled": o(Q),
callback: i
}, null, 8, [
"name",
"events",
"tracking-enabled",
"callback"
]))), 256)) : c("", !0), o(R) && t.onlyShow !== "events" ? (f(!0), y(O, { key: 1 }, e(o(ne), ({ id: e, name: t, fromDate: n, toDate: a, minimumPersonCount: s, fromPrice: c, description: l, images: u }) => (f(), r(Qe, {
key: e,
"listing-id": e,
name: t,
images: u,
description: l,
"from-date": n,
"to-date": a,
"minimum-person-count": s,
fromPrice: c,
"tracking-enabled": o(Q),
callback: i
}, null, 8, [
"listing-id",
"name",
"images",
"description",
"from-date",
"to-date",
"minimum-person-count",
"fromPrice",
"tracking-enabled",
"callback"
]))), 128)) : c("", !0)]),
o(Y).length > 0 && t.onlyShow !== "templates" ? (f(), y(O, { key: 2 }, [a("h2", bt, [s(J, {
icon: "calendar-circle-exclamation",
type: "fal",
color: "header"
}), a("span", null, n(o(l)("event.availableLater")), 1)]), a("ul", xt, [(f(!0), y(O, null, e(o(Y), (e) => (f(), r(Ye, {
name: e.name,
events: e.events,
"tracking-enabled": o(Q),
callback: i
}, null, 8, [
"name",
"events",
"tracking-enabled",
"callback"
]))), 256))])], 64)) : c("", !0),
(!o(L) && !o(R) || !o(L) && t.onlyShow === "events" || !o(R) && t.onlyShow === "templates") && !o(X) ? (f(), y("div", {
key: 3,
class: "konnectio-panel",
innerHTML: o(l)("event.nothingAvailable")
}, null, 8, St)) : c("", !0)
])) : (f(), r(Ce, { key: 1 }))]),
_: 2
}, 1024)]),
addons: h(({ next: t, prev: i }) => [o(ue) ? (f(), r(ft, {
key: 0,
"prev-callback": () => o(Le)(i)
}, {
form: h(() => [a("form", Ct, [
a("h2", null, [a("span", null, n(o(l)("event.selectProducts")), 1)]),
o(V) && o(V).length > 0 ? (f(), y("ul", wt, [(f(!0), y(O, null, e(o(V), ({ roomGroupId: t, addons: i, adultPerRoom: c }, u) => (f(), y("li", { key: t }, [a("h5", null, [
a("span", null, n(o(l)("booking.reservation.room")) + " #" + n(u + 1), 1),
d[9] ||= v(" (", -1),
s(J, {
icon: "male",
type: "fas",
color: "header"
}),
v(" " + n(c) + ") ", 1)
]), a("table", Tt, [
a("thead", null, [a("tr", null, [
a("th", null, [a("span", null, n(o(l)("booking.reservation.addons")), 1)]),
d[10] ||= a("th", { class: "konnectio-event-addons-input" }, null, -1),
a("th", Et, [a("span", null, n(o(l)("booking.availability.price")), 1)])
])]),
a("tbody", null, [(f(!0), y(O, null, e(i, ({ id: e, cardinality: i, name: s, price: c, quantityStrategy: l }) => (f(), y("tr", { key: e }, [
a("td", null, [
a("b", null, n(s), 1),
d[11] ||= a("br", null, null, -1),
a("span", null, n(o(I)(c, o(Z))) + " " + n(o(ee)(l)), 1)
]),
a("td", Dt, [i === 3 ? (f(), r(G, {
key: 0,
modelValue: o(m)[`${t}.${e}.${u}`],
"onUpdate:modelValue": (n) => o(m)[`${t}.${e}.${u}`] = n,
small: !0,
"min-value": 0
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : (f(), r(Oe, {
key: 1,
modelValue: o(m)[`${t}.${e}.${u}`],
"onUpdate:modelValue": (n) => o(m)[`${t}.${e}.${u}`] = n,
numeric: !0
}, null, 8, ["modelValue", "onUpdate:modelValue"]))]),
a("td", Ot, [a("span", null, n(o(I)(o(Pe)(e, t, u), o(Z))), 1)])
]))), 128))]),
a("tfoot", null, [a("tr", null, [
d[12] ||= a("td", null, null, -1),
d[13] ||= a("td", null, null, -1),
a("td", kt, [a("u", null, [a("span", null, n(o(I)(o(Fe)(t, u), o(Z))), 1)])])
])])
])]))), 128))])) : c("", !0),
o(oe) ? (f(), y("table", At, [a("tbody", null, [(f(!0), y(O, null, e(o(B).products, ({ id: e, name: t, price: r, description: i }) => (f(), y("tr", { key: e }, [a("td", jt, [
a("b", null, [a("span", null, n(o(N)(t)), 1)]),
i && i !== t ? (f(), y("span", Mt, n(o(N)(i)), 1)) : c("", !0),
a("u", null, n(o(I)(r, o(Z))), 1)
]), a("td", Nt, [s(G, {
modelValue: o(g)[e],
"onUpdate:modelValue": (t) => o(g)[e] = t,
small: !0,
"min-value": 0
}, null, 8, ["modelValue", "onUpdate:modelValue"])])]))), 128))])])) : c("", !0)
])]),
navigation: h(() => [s(K, {
label: o(l)("event.startReservation"),
disabled: !o(he),
"full-width": "",
onClickEvent: t
}, null, 8, [
"label",
"disabled",
"onClickEvent"
])]),
_: 2
}, 1032, ["prev-callback"])) : c("", !0)]),
reservation: h(({ next: e, prev: i }) => [s(ft, {
"show-terms-notice": !0,
"show-gift-card": !0,
"prev-callback": () => o(Le)(i)
}, {
form: h(() => [a("form", Pt, [
a("h2", null, [a("span", null, n(o(l)("booking.reservation.detailsTitle")), 1)]),
s(W, {
modelValue: o(w),
"onUpdate:modelValue": d[0] ||= (e) => _(w) ? w.value = e : null,
type: "text",
label: o(l)("booking.reservation.name"),
icon: "user-alt",
placeholder: o(l)("booking.reservation.namePlaceholder"),
required: ""
}, null, 8, [
"modelValue",
"label",
"placeholder"
]),
s(W, {
modelValue: o(E),
"onUpdate:modelValue": d[1] ||= (e) => _(E) ? E.value = e : null,
label: o(l)("booking.reservation.email"),
type: "email",
name: "email",
autocomplete: "email",
icon: "at",
placeholder: o(l)("booking.reservation.emailPlaceholder"),
required: ""
}, null, 8, [
"modelValue",
"label",
"placeholder"
]),
s(De, {
modelValue: o(T),
"onUpdate:modelValue": d[2] ||= (e) => _(T) ? T.value = e : null,
label: o(l)("booking.reservation.phone"),
icon: "phone-office",
placeholder: o(l)("booking.reservation.phonePlaceholder"),
required: ""
}, null, 8, [
"modelValue",
"label",
"placeholder"
]),
o(me) ? (f(), r(Se, {
key: 0,
modelValue: o(P),
"onUpdate:modelValue": d[3] ||= (e) => _(P) ? P.value = e : null,
label: o(l)("event.selectArrivalTime"),
name: "eventTimeTable",
checkboxes: Ve.value,
required: ""
}, null, 8, [
"modelValue",
"label",
"checkboxes"
])) : c("", !0),
o(ce) === o(ae).FullDayEvent ? (f(), r(G, {
key: 1,
modelValue: o(x),
"onUpdate:modelValue": d[4] ||= (e) => _(x) ? x.value = e : null,
label: o(l)("event.numberOfDays"),
"min-value": 1,
required: ""
}, null, 8, ["modelValue", "label"])) : c("", !0),
t.showHighChairs === "yes" ? (f(), r(G, {
key: 2,
modelValue: o(C),
"onUpdate:modelValue": d[5] ||= (e) => _(C) ? C.value = e : null,
label: o(l)("event.numberOfHighChairs"),
icon: "baby",
"no-optional-label": !1
}, null, 8, ["modelValue", "label"])) : c("", !0),
t.showFlagOnTable === "yes" ? (f(), r(Oe, {
key: 3,
modelValue: o(S),
"onUpdate:modelValue": d[6] ||= (e) => _(S) ? S.value = e : null,
label: o(l)("event.flagOnTable")
}, null, 8, ["modelValue", "label"])) : c("", !0),
t.hideRemarks === "yes" ? c("", !0) : (f(), r(W, {
key: 4,
modelValue: o(k),
"onUpdate:modelValue": d[7] ||= (e) => _(k) ? k.value = e : null,
type: "textarea",
label: o(l)("booking.reservation.remark"),
icon: "info-circle",
placeholder: o(l)("booking.reservation.remarkPlaceholder")
}, null, 8, [
"modelValue",
"label",
"placeholder"
])),
t.hideAllergies !== "yes" && o(B)?.showAllergyFoodFieldOnline ? (f(), r(W, {
key: 5,
modelValue: o(A),
"onUpdate:modelValue": d[8] ||= (e) => _(A) ? A.value = e : null,
type: "textarea",
label: o(l)("booking.reservation.allergies"),
icon: "allergies",
placeholder: o(l)("booking.reservation.allergiesPlaceholder")
}, null, 8, [
"modelValue",
"label",
"placeholder"
])) : c("", !0)
])]),
navigation: h(() => [s(K, {
label: o(l)("general.confirmReservation"),
"is-loading": o(fe),
disabled: !o(pe),
"full-width": "",
onClickEvent: (t) => Ue(e)
}, null, 8, [
"label",
"is-loading",
"disabled",
"onClickEvent"
])]),
_: 2
}, 1032, ["prev-callback"])]),
payment: h(() => [s(ke)]),
confirmation: h(() => [s(ye, { message: o(l)("event.confirmationMessage") }, null, 8, ["message"])]),
_: 1
}, 8, ["steps"])]),
_: 1
}, 8, ["access-token", "callback"])]),
fallback: h(() => [s(gt)]),
_: 1
}))]),
_: 1
}, 8, ["styling"]));
}
}), [["__scopeId", "data-v-eed27455"]]), It = m(), Lt = E(), Rt = class extends HTMLElement {
vueApp;
constructor() {
super();
}
disconnectedCallback() {
this.vueApp.unmount();
}
connectedCallback() {
let e = w(Ft, this.attributes);
this.vueApp = x(Ft, e), this.vueApp.provide("emitter", Lt), this.vueApp.use(A), this.vueApp.use(C), this.vueApp.use(It), this.vueApp.use(Te), this.vueApp.use(ve), this.vueApp.use(Z);
let t = document.createElement("div");
this.vueApp.mount(t), this.appendChild(t.children[0]);
}
};
window.customElements.define("konnectio-event", Rt);
//#endregion
export { Rt as default };