@forgebuild/sidon-booking-widget 4.1.3 → 4.1.4
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.
- package/dist/sidon-berth-map.js +87 -70
- package/dist/sidon-booking-widget.js +160 -138
- package/package.json +1 -1
package/dist/sidon-berth-map.js
CHANGED
|
@@ -2402,59 +2402,69 @@ var Ii = /* @__PURE__ */ kr("<div class=\"sbm-map svelte-yb07tk\"></div>"), Li =
|
|
|
2402
2402
|
};
|
|
2403
2403
|
function Ri(e, t) {
|
|
2404
2404
|
Ke(t, !0), Gr(e, Li);
|
|
2405
|
-
let n = Y(t, "mapsApiKey", 7), r = Y(t, "mapStyle", 7), i = Y(t, "center", 7), a = Y(t, "navy", 7), o = Y(t, "gold", 7), s = Y(t, "logoMark", 7, null), c = Y(t, "marinaName", 7, ""), l = Y(t, "otherMarinas", 7), u = Y(t, "berths", 7), d = Y(t, "overlays", 7), f = Y(t, "layout", 7), p = Y(t, "loa", 7), m = Y(t, "selectedBerth", 7), h = Y(t, "onBerthClick", 7), g = Y(t, "staff", 7, !1), _, v = /* @__PURE__ */ H(null),
|
|
2405
|
+
let n = Y(t, "mapsApiKey", 7), r = Y(t, "mapStyle", 7), i = Y(t, "center", 7), a = Y(t, "navy", 7), o = Y(t, "gold", 7), s = Y(t, "logoMark", 7, null), c = Y(t, "marinaName", 7, ""), l = Y(t, "otherMarinas", 7), u = Y(t, "berths", 7), d = Y(t, "overlays", 7), f = Y(t, "layout", 7), p = Y(t, "loa", 7), m = Y(t, "selectedBerth", 7), h = Y(t, "onBerthClick", 7), g = Y(t, "staff", 7, !1), _ = Y(t, "fitInset", 7), v, y = /* @__PURE__ */ H(null), b = /* @__PURE__ */ new Map(), ee = [], x = [], te = !1;
|
|
2406
|
+
function ne() {
|
|
2407
|
+
let e = _()?.() ?? 0;
|
|
2408
|
+
return e > 0 ? {
|
|
2409
|
+
top: 60,
|
|
2410
|
+
right: 60,
|
|
2411
|
+
bottom: 60,
|
|
2412
|
+
left: e + 60
|
|
2413
|
+
} : 60;
|
|
2414
|
+
}
|
|
2415
|
+
let re = /* @__PURE__ */ z(() => ({
|
|
2406
2416
|
fillColor: o(),
|
|
2407
2417
|
fillOpacity: .38,
|
|
2408
2418
|
strokeColor: o(),
|
|
2409
2419
|
strokeOpacity: 1,
|
|
2410
2420
|
strokeWeight: 1.6
|
|
2411
|
-
})),
|
|
2421
|
+
})), ie = /* @__PURE__ */ z(() => ({
|
|
2412
2422
|
fillColor: o(),
|
|
2413
2423
|
fillOpacity: .62,
|
|
2414
2424
|
strokeColor: o(),
|
|
2415
2425
|
strokeOpacity: 1,
|
|
2416
2426
|
strokeWeight: 1.6
|
|
2417
|
-
})),
|
|
2427
|
+
})), ae = /* @__PURE__ */ z(() => ({
|
|
2418
2428
|
fillColor: o(),
|
|
2419
2429
|
fillOpacity: .72,
|
|
2420
2430
|
strokeColor: "#252525",
|
|
2421
2431
|
strokeOpacity: 1,
|
|
2422
2432
|
strokeWeight: 2
|
|
2423
|
-
})),
|
|
2433
|
+
})), oe = {
|
|
2424
2434
|
fillColor: "#b8b8b8",
|
|
2425
2435
|
fillOpacity: .08,
|
|
2426
2436
|
strokeColor: "#b8b8b8",
|
|
2427
2437
|
strokeOpacity: .5,
|
|
2428
2438
|
strokeWeight: 1
|
|
2429
|
-
},
|
|
2439
|
+
}, se = {
|
|
2430
2440
|
fillColor: "#888888",
|
|
2431
2441
|
fillOpacity: .15,
|
|
2432
2442
|
strokeColor: "#888888",
|
|
2433
2443
|
strokeOpacity: .4,
|
|
2434
2444
|
strokeWeight: 1
|
|
2435
|
-
},
|
|
2445
|
+
}, ce = /* @__PURE__ */ z(() => ({
|
|
2436
2446
|
fillColor: a(),
|
|
2437
2447
|
fillOpacity: .85,
|
|
2438
2448
|
strokeColor: a(),
|
|
2439
2449
|
strokeOpacity: 1,
|
|
2440
2450
|
strokeWeight: 1.6
|
|
2441
|
-
})),
|
|
2442
|
-
function
|
|
2451
|
+
})), S = (e) => Math.max(5, e.lengthM || 15), C = (e, t) => e.angle == null ? e.circle.setRadius(S(e.berth) * t) : e.circle.setPaths(Fi(e.berth, e.angle, Mi, t)), w = /* @__PURE__ */ new WeakMap();
|
|
2452
|
+
function T(e) {
|
|
2443
2453
|
let t = e.circle, n = Symbol();
|
|
2444
|
-
|
|
2454
|
+
w.set(t, n);
|
|
2445
2455
|
let r = performance.now(), i = (a) => {
|
|
2446
|
-
if (
|
|
2456
|
+
if (w.get(t) !== n) return;
|
|
2447
2457
|
let o = a - r;
|
|
2448
2458
|
if (o >= 260) {
|
|
2449
|
-
|
|
2459
|
+
C(e, 1);
|
|
2450
2460
|
return;
|
|
2451
2461
|
}
|
|
2452
2462
|
let s = o < 90 ? o / 90 : 1 - (o - 90) / 170, c = s * (2 - s);
|
|
2453
|
-
|
|
2463
|
+
C(e, 1 + .18 * c), requestAnimationFrame(i);
|
|
2454
2464
|
};
|
|
2455
2465
|
requestAnimationFrame(i);
|
|
2456
2466
|
}
|
|
2457
|
-
let
|
|
2467
|
+
let E = [
|
|
2458
2468
|
{
|
|
2459
2469
|
elementType: "geometry",
|
|
2460
2470
|
stylers: [{ color: "#ffffff" }]
|
|
@@ -2512,7 +2522,7 @@ function Ri(e, t) {
|
|
|
2512
2522
|
elementType: "labels.text.fill",
|
|
2513
2523
|
stylers: [{ color: "#aab0b4" }]
|
|
2514
2524
|
}
|
|
2515
|
-
],
|
|
2525
|
+
], D = /* @__PURE__ */ z(() => [
|
|
2516
2526
|
{
|
|
2517
2527
|
elementType: "geometry",
|
|
2518
2528
|
stylers: [{ color: "#f5efe4" }]
|
|
@@ -2594,7 +2604,7 @@ function Ri(e, t) {
|
|
|
2594
2604
|
stylers: [{ color: a() }]
|
|
2595
2605
|
}
|
|
2596
2606
|
]);
|
|
2597
|
-
class
|
|
2607
|
+
class le {
|
|
2598
2608
|
position;
|
|
2599
2609
|
href;
|
|
2600
2610
|
img;
|
|
@@ -2629,7 +2639,7 @@ function Ri(e, t) {
|
|
|
2629
2639
|
this.overlayView.setMap(e);
|
|
2630
2640
|
}
|
|
2631
2641
|
}
|
|
2632
|
-
let
|
|
2642
|
+
let O = {
|
|
2633
2643
|
available: {
|
|
2634
2644
|
fill: "rgba(16,185,129,0.3)",
|
|
2635
2645
|
stroke: "#10b981"
|
|
@@ -2647,7 +2657,7 @@ function Ri(e, t) {
|
|
|
2647
2657
|
stroke: "rgba(136,136,136,0.4)"
|
|
2648
2658
|
}
|
|
2649
2659
|
};
|
|
2650
|
-
function
|
|
2660
|
+
function ue(e) {
|
|
2651
2661
|
let t = {};
|
|
2652
2662
|
for (let e of u()) e.berthId && (t[e.berthId] = {
|
|
2653
2663
|
price: e.pricePerNight,
|
|
@@ -2660,7 +2670,7 @@ function Ri(e, t) {
|
|
|
2660
2670
|
r?.price != null && e.setAttribute("data-price", String(r.price));
|
|
2661
2671
|
let i = r?.status ?? "occupied";
|
|
2662
2672
|
e.setAttribute("data-status", i), g() && r && e.setAttribute("data-pick", "1");
|
|
2663
|
-
let a =
|
|
2673
|
+
let a = O[i] ?? O.occupied, o = e.querySelector("rect:not([data-role]), circle");
|
|
2664
2674
|
o && (o.setAttribute("fill", a.fill), o.setAttribute("stroke", a.stroke));
|
|
2665
2675
|
let s = e.querySelector("[data-role=\"entrance\"]");
|
|
2666
2676
|
s && s.setAttribute("fill", a.stroke);
|
|
@@ -2696,7 +2706,7 @@ function Ri(e, t) {
|
|
|
2696
2706
|
return e;
|
|
2697
2707
|
}
|
|
2698
2708
|
}
|
|
2699
|
-
class
|
|
2709
|
+
class de {
|
|
2700
2710
|
bounds;
|
|
2701
2711
|
svgData;
|
|
2702
2712
|
rotation;
|
|
@@ -2713,7 +2723,7 @@ function Ri(e, t) {
|
|
|
2713
2723
|
lat: e.neLat,
|
|
2714
2724
|
lng: e.neLng
|
|
2715
2725
|
}
|
|
2716
|
-
}, this.svgData =
|
|
2726
|
+
}, this.svgData = ue(e.svgData), this.rotation = e.rotation ?? 0, this.overlayView.onAdd = () => {
|
|
2717
2727
|
this.div = document.createElement("div"), this.div.style.cssText = "position:absolute;pointer-events:none;transform-origin:center center;", this.div.innerHTML = this.svgData;
|
|
2718
2728
|
let e = this.div.querySelector("svg");
|
|
2719
2729
|
e && (e.style.width = "100%", e.style.height = "100%"), this.div.addEventListener("click", (e) => {
|
|
@@ -2721,7 +2731,7 @@ function Ri(e, t) {
|
|
|
2721
2731
|
if (!t || !(g() ? t.getAttribute("data-pick") === "1" : t.getAttribute("data-status") === "available" && !t.hasAttribute("data-fit"))) return;
|
|
2722
2732
|
let n = t.getAttribute("data-berth-id");
|
|
2723
2733
|
h()(m() === n ? null : n);
|
|
2724
|
-
}), this.overlayView.getPanes().overlayMouseTarget.appendChild(this.div),
|
|
2734
|
+
}), this.overlayView.getPanes().overlayMouseTarget.appendChild(this.div), k();
|
|
2725
2735
|
}, this.overlayView.draw = () => {
|
|
2726
2736
|
if (!this.div) return;
|
|
2727
2737
|
let e = this.overlayView.getProjection();
|
|
@@ -2736,8 +2746,8 @@ function Ri(e, t) {
|
|
|
2736
2746
|
this.overlayView.setMap(e);
|
|
2737
2747
|
}
|
|
2738
2748
|
}
|
|
2739
|
-
function
|
|
2740
|
-
let e =
|
|
2749
|
+
function k() {
|
|
2750
|
+
let e = v?.getRootNode();
|
|
2741
2751
|
if (!e) return;
|
|
2742
2752
|
let t = new Map(u().map((e) => [e.berthId, e]));
|
|
2743
2753
|
e.querySelectorAll("[data-berth-id]").forEach((e) => {
|
|
@@ -2745,61 +2755,61 @@ function Ri(e, t) {
|
|
|
2745
2755
|
!g() && r && !Di(r, p()) ? e.setAttribute("data-fit", "small") : e.removeAttribute("data-fit"), n === m() ? e.setAttribute("data-selected", "1") : e.removeAttribute("data-selected");
|
|
2746
2756
|
});
|
|
2747
2757
|
}
|
|
2748
|
-
function
|
|
2758
|
+
function fe(e, t) {
|
|
2749
2759
|
let n = e.berth.status !== "available";
|
|
2750
2760
|
e.pickable = Oi(e.berth, p(), g());
|
|
2751
|
-
let r = t === m() ? J(
|
|
2761
|
+
let r = t === m() ? J(ae) : n ? g() ? J(ce) : se : e.pickable ? J(re) : oe;
|
|
2752
2762
|
e.circle.setOptions({
|
|
2753
2763
|
...r,
|
|
2754
2764
|
clickable: e.pickable
|
|
2755
|
-
}), e.hull?.setOptions({ fillOpacity: r ===
|
|
2765
|
+
}), e.hull?.setOptions({ fillOpacity: r === oe || r === se ? .2 : .85 });
|
|
2756
2766
|
}
|
|
2757
2767
|
Hr(() => {
|
|
2758
2768
|
let e = !1;
|
|
2759
2769
|
return bi(n()).then(() => {
|
|
2760
|
-
if (e || !
|
|
2761
|
-
let t = window.google.maps, n = new t.Map(
|
|
2770
|
+
if (e || !v) return;
|
|
2771
|
+
let t = window.google.maps, n = new t.Map(v, {
|
|
2762
2772
|
center: i(),
|
|
2763
2773
|
zoom: 15,
|
|
2764
2774
|
disableDefaultUI: !0,
|
|
2765
2775
|
zoomControl: !0,
|
|
2766
|
-
styles: r() === "coastal" ? J(
|
|
2776
|
+
styles: r() === "coastal" ? J(D) : E,
|
|
2767
2777
|
backgroundColor: r() === "coastal" ? "#f5efe4" : "#ffffff"
|
|
2768
2778
|
});
|
|
2769
2779
|
t.event.addListenerOnce(n, "idle", () => {
|
|
2770
|
-
e || U(
|
|
2780
|
+
e || U(y, n);
|
|
2771
2781
|
});
|
|
2772
2782
|
}), () => {
|
|
2773
2783
|
e = !0;
|
|
2774
2784
|
};
|
|
2775
2785
|
});
|
|
2776
|
-
let
|
|
2786
|
+
let pe = null, A = null;
|
|
2777
2787
|
xn(() => {
|
|
2778
|
-
!J(
|
|
2788
|
+
!J(y) || i().lat === pe && i().lng === A || (pe = i().lat, A = i().lng, J(y).setCenter(i()));
|
|
2779
2789
|
}), xn(() => {
|
|
2780
|
-
m(), p(), u(), g(),
|
|
2790
|
+
m(), p(), u(), g(), k();
|
|
2781
2791
|
});
|
|
2782
|
-
function
|
|
2783
|
-
if (!J(
|
|
2792
|
+
function j() {
|
|
2793
|
+
if (!J(y) || r() !== "chart") return;
|
|
2784
2794
|
let e = new window.google.maps.LatLngBounds();
|
|
2785
2795
|
for (let t of u()) {
|
|
2786
2796
|
if (t.lat == null || t.lng == null || !t.berthId) continue;
|
|
2787
2797
|
let n = window.google.maps, r = Pi(t, d()), i = r == null ? new n.Circle({
|
|
2788
|
-
map: J(
|
|
2798
|
+
map: J(y),
|
|
2789
2799
|
center: {
|
|
2790
2800
|
lat: t.lat,
|
|
2791
2801
|
lng: t.lng
|
|
2792
2802
|
},
|
|
2793
|
-
radius:
|
|
2794
|
-
...J(
|
|
2803
|
+
radius: S(t),
|
|
2804
|
+
...J(re)
|
|
2795
2805
|
}) : new n.Polygon({
|
|
2796
|
-
map: J(
|
|
2806
|
+
map: J(y),
|
|
2797
2807
|
paths: Fi(t, r, Mi),
|
|
2798
|
-
...J(
|
|
2808
|
+
...J(re)
|
|
2799
2809
|
}), o = {
|
|
2800
2810
|
circle: i,
|
|
2801
2811
|
hull: r == null ? null : new n.Polygon({
|
|
2802
|
-
map: J(
|
|
2812
|
+
map: J(y),
|
|
2803
2813
|
paths: Fi(t, r, Ni, .8),
|
|
2804
2814
|
clickable: !1,
|
|
2805
2815
|
zIndex: 1,
|
|
@@ -2811,42 +2821,42 @@ function Ri(e, t) {
|
|
|
2811
2821
|
berth: t,
|
|
2812
2822
|
pickable: !1
|
|
2813
2823
|
};
|
|
2814
|
-
|
|
2815
|
-
o.pickable && t.berthId !== m() && i.setOptions(J(
|
|
2824
|
+
b.set(t.berthId, o), hr(() => fe(o, t.berthId)), i.addListener("click", () => h()(t.berthId === m() ? null : t.berthId)), i.addListener("mouseover", () => {
|
|
2825
|
+
o.pickable && t.berthId !== m() && i.setOptions(J(ie));
|
|
2816
2826
|
}), i.addListener("mouseout", () => {
|
|
2817
|
-
t.berthId !== m() &&
|
|
2827
|
+
t.berthId !== m() && fe(o, t.berthId);
|
|
2818
2828
|
}), e.extend({
|
|
2819
2829
|
lat: t.lat,
|
|
2820
2830
|
lng: t.lng
|
|
2821
2831
|
});
|
|
2822
2832
|
}
|
|
2823
|
-
|
|
2833
|
+
b.size && !te && (te = !0, e.extend(i()), J(y).fitBounds(e, ne()));
|
|
2824
2834
|
}
|
|
2825
2835
|
xn(() => {
|
|
2826
|
-
if (!(!J(
|
|
2827
|
-
for (let e of
|
|
2828
|
-
|
|
2836
|
+
if (!(!J(y) || r() !== "chart")) {
|
|
2837
|
+
for (let e of b.values()) e.circle.setMap(null), e.hull?.setMap(null);
|
|
2838
|
+
b.clear(), j();
|
|
2829
2839
|
}
|
|
2830
2840
|
}), xn(() => {
|
|
2831
|
-
if (!J(
|
|
2832
|
-
for (let e of
|
|
2841
|
+
if (!J(y)) return;
|
|
2842
|
+
for (let e of ee) e.setMap(null);
|
|
2833
2843
|
let e = [];
|
|
2834
|
-
s() && e.push(new
|
|
2835
|
-
for (let t of l()) t.logoMark && e.push(new
|
|
2844
|
+
s() && e.push(new le(i(), s(), c(), null));
|
|
2845
|
+
for (let t of l()) t.logoMark && e.push(new le({
|
|
2836
2846
|
lat: t.lat,
|
|
2837
2847
|
lng: t.lng
|
|
2838
2848
|
}, t.logoMark, t.name, t.href));
|
|
2839
|
-
for (let t of e) t.setMap(J(
|
|
2840
|
-
|
|
2849
|
+
for (let t of e) t.setMap(J(y));
|
|
2850
|
+
ee = e;
|
|
2841
2851
|
}), xn(() => {
|
|
2842
|
-
if (!J(
|
|
2843
|
-
for (let e of
|
|
2852
|
+
if (!J(y) || r() !== "coastal") return;
|
|
2853
|
+
for (let e of x) e.setMap(null);
|
|
2844
2854
|
let e = d().length ? d() : f() ? [f()] : [];
|
|
2845
|
-
if (
|
|
2846
|
-
let t = new
|
|
2847
|
-
return t.setMap(J(
|
|
2848
|
-
}), e.length && !
|
|
2849
|
-
|
|
2855
|
+
if (x = e.map((e) => {
|
|
2856
|
+
let t = new de(e);
|
|
2857
|
+
return t.setMap(J(y)), t;
|
|
2858
|
+
}), e.length && !te) {
|
|
2859
|
+
te = !0;
|
|
2850
2860
|
let t = new window.google.maps.LatLngBounds();
|
|
2851
2861
|
for (let n of e) t.extend({
|
|
2852
2862
|
lat: n.swLat,
|
|
@@ -2855,17 +2865,17 @@ function Ri(e, t) {
|
|
|
2855
2865
|
lat: n.neLat,
|
|
2856
2866
|
lng: n.neLng
|
|
2857
2867
|
});
|
|
2858
|
-
J(
|
|
2868
|
+
J(y).fitBounds(t, ne());
|
|
2859
2869
|
}
|
|
2860
2870
|
});
|
|
2861
|
-
let
|
|
2871
|
+
let me = null;
|
|
2862
2872
|
xn(() => {
|
|
2863
2873
|
p();
|
|
2864
|
-
let e = m() != null && m() !==
|
|
2865
|
-
for (let [t, n] of
|
|
2866
|
-
|
|
2874
|
+
let e = m() != null && m() !== me;
|
|
2875
|
+
for (let [t, n] of b) fe(n, t), e && t === m() && T(n);
|
|
2876
|
+
me = m();
|
|
2867
2877
|
});
|
|
2868
|
-
var
|
|
2878
|
+
var he = {
|
|
2869
2879
|
get mapsApiKey() {
|
|
2870
2880
|
return n();
|
|
2871
2881
|
},
|
|
@@ -2955,9 +2965,15 @@ function Ri(e, t) {
|
|
|
2955
2965
|
},
|
|
2956
2966
|
set staff(e = !1) {
|
|
2957
2967
|
g(e), V();
|
|
2968
|
+
},
|
|
2969
|
+
get fitInset() {
|
|
2970
|
+
return _();
|
|
2971
|
+
},
|
|
2972
|
+
set fitInset(e) {
|
|
2973
|
+
_(e), V();
|
|
2958
2974
|
}
|
|
2959
|
-
},
|
|
2960
|
-
return fi(
|
|
2975
|
+
}, ge = Ii();
|
|
2976
|
+
return fi(ge, (e) => v = e, () => v), jr(e, ge), qe(he);
|
|
2961
2977
|
}
|
|
2962
2978
|
vi(Ri, {
|
|
2963
2979
|
mapsApiKey: {},
|
|
@@ -2974,7 +2990,8 @@ vi(Ri, {
|
|
|
2974
2990
|
loa: {},
|
|
2975
2991
|
selectedBerth: {},
|
|
2976
2992
|
onBerthClick: {},
|
|
2977
|
-
staff: {}
|
|
2993
|
+
staff: {},
|
|
2994
|
+
fitInset: {}
|
|
2978
2995
|
}, [], [], { mode: "open" });
|
|
2979
2996
|
//#endregion
|
|
2980
2997
|
//#region node_modules/flatpickr/dist/esm/types/options.js
|
|
@@ -4438,59 +4438,69 @@ var go = /* @__PURE__ */ Y("<div class=\"sbm-map svelte-yb07tk\"></div>"), _o =
|
|
|
4438
4438
|
};
|
|
4439
4439
|
function vo(e, t) {
|
|
4440
4440
|
Xe(t, !0), ai(e, _o);
|
|
4441
|
-
let n = $(t, "mapsApiKey", 7), r = $(t, "mapStyle", 7), i = $(t, "center", 7), a = $(t, "navy", 7), o = $(t, "gold", 7), s = $(t, "logoMark", 7, null), c = $(t, "marinaName", 7, ""), l = $(t, "otherMarinas", 7), u = $(t, "berths", 7), d = $(t, "overlays", 7), f = $(t, "layout", 7), p = $(t, "loa", 7), m = $(t, "selectedBerth", 7), h = $(t, "onBerthClick", 7), g = $(t, "staff", 7, !1), _, v = /* @__PURE__ */ B(null),
|
|
4441
|
+
let n = $(t, "mapsApiKey", 7), r = $(t, "mapStyle", 7), i = $(t, "center", 7), a = $(t, "navy", 7), o = $(t, "gold", 7), s = $(t, "logoMark", 7, null), c = $(t, "marinaName", 7, ""), l = $(t, "otherMarinas", 7), u = $(t, "berths", 7), d = $(t, "overlays", 7), f = $(t, "layout", 7), p = $(t, "loa", 7), m = $(t, "selectedBerth", 7), h = $(t, "onBerthClick", 7), g = $(t, "staff", 7, !1), _ = $(t, "fitInset", 7), v, y = /* @__PURE__ */ B(null), b = /* @__PURE__ */ new Map(), x = [], S = [], ee = !1;
|
|
4442
|
+
function C() {
|
|
4443
|
+
let e = _()?.() ?? 0;
|
|
4444
|
+
return e > 0 ? {
|
|
4445
|
+
top: 60,
|
|
4446
|
+
right: 60,
|
|
4447
|
+
bottom: 60,
|
|
4448
|
+
left: e + 60
|
|
4449
|
+
} : 60;
|
|
4450
|
+
}
|
|
4451
|
+
let w = /* @__PURE__ */ I(() => ({
|
|
4442
4452
|
fillColor: o(),
|
|
4443
4453
|
fillOpacity: .38,
|
|
4444
4454
|
strokeColor: o(),
|
|
4445
4455
|
strokeOpacity: 1,
|
|
4446
4456
|
strokeWeight: 1.6
|
|
4447
|
-
})),
|
|
4457
|
+
})), T = /* @__PURE__ */ I(() => ({
|
|
4448
4458
|
fillColor: o(),
|
|
4449
4459
|
fillOpacity: .62,
|
|
4450
4460
|
strokeColor: o(),
|
|
4451
4461
|
strokeOpacity: 1,
|
|
4452
4462
|
strokeWeight: 1.6
|
|
4453
|
-
})),
|
|
4463
|
+
})), te = /* @__PURE__ */ I(() => ({
|
|
4454
4464
|
fillColor: o(),
|
|
4455
4465
|
fillOpacity: .72,
|
|
4456
4466
|
strokeColor: "#252525",
|
|
4457
4467
|
strokeOpacity: 1,
|
|
4458
4468
|
strokeWeight: 2
|
|
4459
|
-
})),
|
|
4469
|
+
})), ne = {
|
|
4460
4470
|
fillColor: "#b8b8b8",
|
|
4461
4471
|
fillOpacity: .08,
|
|
4462
4472
|
strokeColor: "#b8b8b8",
|
|
4463
4473
|
strokeOpacity: .5,
|
|
4464
4474
|
strokeWeight: 1
|
|
4465
|
-
},
|
|
4475
|
+
}, E = {
|
|
4466
4476
|
fillColor: "#888888",
|
|
4467
4477
|
fillOpacity: .15,
|
|
4468
4478
|
strokeColor: "#888888",
|
|
4469
4479
|
strokeOpacity: .4,
|
|
4470
4480
|
strokeWeight: 1
|
|
4471
|
-
},
|
|
4481
|
+
}, D = /* @__PURE__ */ I(() => ({
|
|
4472
4482
|
fillColor: a(),
|
|
4473
4483
|
fillOpacity: .85,
|
|
4474
4484
|
strokeColor: a(),
|
|
4475
4485
|
strokeOpacity: 1,
|
|
4476
4486
|
strokeWeight: 1.6
|
|
4477
|
-
})),
|
|
4478
|
-
function
|
|
4487
|
+
})), O = (e) => Math.max(5, e.lengthM || 15), k = (e, t) => e.angle == null ? e.circle.setRadius(O(e.berth) * t) : e.circle.setPaths(ho(e.berth, e.angle, fo, t)), re = /* @__PURE__ */ new WeakMap();
|
|
4488
|
+
function ie(e) {
|
|
4479
4489
|
let t = e.circle, n = Symbol();
|
|
4480
|
-
|
|
4490
|
+
re.set(t, n);
|
|
4481
4491
|
let r = performance.now(), i = (a) => {
|
|
4482
|
-
if (
|
|
4492
|
+
if (re.get(t) !== n) return;
|
|
4483
4493
|
let o = a - r;
|
|
4484
4494
|
if (o >= 260) {
|
|
4485
|
-
|
|
4495
|
+
k(e, 1);
|
|
4486
4496
|
return;
|
|
4487
4497
|
}
|
|
4488
4498
|
let s = o < 90 ? o / 90 : 1 - (o - 90) / 170, c = s * (2 - s);
|
|
4489
|
-
|
|
4499
|
+
k(e, 1 + .18 * c), requestAnimationFrame(i);
|
|
4490
4500
|
};
|
|
4491
4501
|
requestAnimationFrame(i);
|
|
4492
4502
|
}
|
|
4493
|
-
let
|
|
4503
|
+
let A = [
|
|
4494
4504
|
{
|
|
4495
4505
|
elementType: "geometry",
|
|
4496
4506
|
stylers: [{ color: "#ffffff" }]
|
|
@@ -4548,7 +4558,7 @@ function vo(e, t) {
|
|
|
4548
4558
|
elementType: "labels.text.fill",
|
|
4549
4559
|
stylers: [{ color: "#aab0b4" }]
|
|
4550
4560
|
}
|
|
4551
|
-
],
|
|
4561
|
+
], ae = /* @__PURE__ */ I(() => [
|
|
4552
4562
|
{
|
|
4553
4563
|
elementType: "geometry",
|
|
4554
4564
|
stylers: [{ color: "#f5efe4" }]
|
|
@@ -4630,7 +4640,7 @@ function vo(e, t) {
|
|
|
4630
4640
|
stylers: [{ color: a() }]
|
|
4631
4641
|
}
|
|
4632
4642
|
]);
|
|
4633
|
-
class
|
|
4643
|
+
class oe {
|
|
4634
4644
|
position;
|
|
4635
4645
|
href;
|
|
4636
4646
|
img;
|
|
@@ -4665,7 +4675,7 @@ function vo(e, t) {
|
|
|
4665
4675
|
this.overlayView.setMap(e);
|
|
4666
4676
|
}
|
|
4667
4677
|
}
|
|
4668
|
-
let
|
|
4678
|
+
let se = {
|
|
4669
4679
|
available: {
|
|
4670
4680
|
fill: "rgba(16,185,129,0.3)",
|
|
4671
4681
|
stroke: "#10b981"
|
|
@@ -4683,7 +4693,7 @@ function vo(e, t) {
|
|
|
4683
4693
|
stroke: "rgba(136,136,136,0.4)"
|
|
4684
4694
|
}
|
|
4685
4695
|
};
|
|
4686
|
-
function
|
|
4696
|
+
function ce(e) {
|
|
4687
4697
|
let t = {};
|
|
4688
4698
|
for (let e of u()) e.berthId && (t[e.berthId] = {
|
|
4689
4699
|
price: e.pricePerNight,
|
|
@@ -4696,7 +4706,7 @@ function vo(e, t) {
|
|
|
4696
4706
|
r?.price != null && e.setAttribute("data-price", String(r.price));
|
|
4697
4707
|
let i = r?.status ?? "occupied";
|
|
4698
4708
|
e.setAttribute("data-status", i), g() && r && e.setAttribute("data-pick", "1");
|
|
4699
|
-
let a =
|
|
4709
|
+
let a = se[i] ?? se.occupied, o = e.querySelector("rect:not([data-role]), circle");
|
|
4700
4710
|
o && (o.setAttribute("fill", a.fill), o.setAttribute("stroke", a.stroke));
|
|
4701
4711
|
let s = e.querySelector("[data-role=\"entrance\"]");
|
|
4702
4712
|
s && s.setAttribute("fill", a.stroke);
|
|
@@ -4732,7 +4742,7 @@ function vo(e, t) {
|
|
|
4732
4742
|
return e;
|
|
4733
4743
|
}
|
|
4734
4744
|
}
|
|
4735
|
-
class
|
|
4745
|
+
class le {
|
|
4736
4746
|
bounds;
|
|
4737
4747
|
svgData;
|
|
4738
4748
|
rotation;
|
|
@@ -4749,7 +4759,7 @@ function vo(e, t) {
|
|
|
4749
4759
|
lat: e.neLat,
|
|
4750
4760
|
lng: e.neLng
|
|
4751
4761
|
}
|
|
4752
|
-
}, this.svgData =
|
|
4762
|
+
}, this.svgData = ce(e.svgData), this.rotation = e.rotation ?? 0, this.overlayView.onAdd = () => {
|
|
4753
4763
|
this.div = document.createElement("div"), this.div.style.cssText = "position:absolute;pointer-events:none;transform-origin:center center;", this.div.innerHTML = this.svgData;
|
|
4754
4764
|
let e = this.div.querySelector("svg");
|
|
4755
4765
|
e && (e.style.width = "100%", e.style.height = "100%"), this.div.addEventListener("click", (e) => {
|
|
@@ -4757,7 +4767,7 @@ function vo(e, t) {
|
|
|
4757
4767
|
if (!t || !(g() ? t.getAttribute("data-pick") === "1" : t.getAttribute("data-status") === "available" && !t.hasAttribute("data-fit"))) return;
|
|
4758
4768
|
let n = t.getAttribute("data-berth-id");
|
|
4759
4769
|
h()(m() === n ? null : n);
|
|
4760
|
-
}), this.overlayView.getPanes().overlayMouseTarget.appendChild(this.div),
|
|
4770
|
+
}), this.overlayView.getPanes().overlayMouseTarget.appendChild(this.div), ue();
|
|
4761
4771
|
}, this.overlayView.draw = () => {
|
|
4762
4772
|
if (!this.div) return;
|
|
4763
4773
|
let e = this.overlayView.getProjection();
|
|
@@ -4772,8 +4782,8 @@ function vo(e, t) {
|
|
|
4772
4782
|
this.overlayView.setMap(e);
|
|
4773
4783
|
}
|
|
4774
4784
|
}
|
|
4775
|
-
function
|
|
4776
|
-
let e =
|
|
4785
|
+
function ue() {
|
|
4786
|
+
let e = v?.getRootNode();
|
|
4777
4787
|
if (!e) return;
|
|
4778
4788
|
let t = new Map(u().map((e) => [e.berthId, e]));
|
|
4779
4789
|
e.querySelectorAll("[data-berth-id]").forEach((e) => {
|
|
@@ -4781,61 +4791,61 @@ function vo(e, t) {
|
|
|
4781
4791
|
!g() && r && !ro(r, p()) ? e.setAttribute("data-fit", "small") : e.removeAttribute("data-fit"), n === m() ? e.setAttribute("data-selected", "1") : e.removeAttribute("data-selected");
|
|
4782
4792
|
});
|
|
4783
4793
|
}
|
|
4784
|
-
function
|
|
4794
|
+
function de(e, t) {
|
|
4785
4795
|
let n = e.berth.status !== "available";
|
|
4786
4796
|
e.pickable = io(e.berth, p(), g());
|
|
4787
|
-
let r = t === m() ? q(
|
|
4797
|
+
let r = t === m() ? q(te) : n ? g() ? q(D) : E : e.pickable ? q(w) : ne;
|
|
4788
4798
|
e.circle.setOptions({
|
|
4789
4799
|
...r,
|
|
4790
4800
|
clickable: e.pickable
|
|
4791
|
-
}), e.hull?.setOptions({ fillOpacity: r ===
|
|
4801
|
+
}), e.hull?.setOptions({ fillOpacity: r === ne || r === E ? .2 : .85 });
|
|
4792
4802
|
}
|
|
4793
4803
|
qr(() => {
|
|
4794
4804
|
let e = !1;
|
|
4795
4805
|
return Ra(n()).then(() => {
|
|
4796
|
-
if (e || !
|
|
4797
|
-
let t = window.google.maps, n = new t.Map(
|
|
4806
|
+
if (e || !v) return;
|
|
4807
|
+
let t = window.google.maps, n = new t.Map(v, {
|
|
4798
4808
|
center: i(),
|
|
4799
4809
|
zoom: 15,
|
|
4800
4810
|
disableDefaultUI: !0,
|
|
4801
4811
|
zoomControl: !0,
|
|
4802
|
-
styles: r() === "coastal" ? q(
|
|
4812
|
+
styles: r() === "coastal" ? q(ae) : A,
|
|
4803
4813
|
backgroundColor: r() === "coastal" ? "#f5efe4" : "#ffffff"
|
|
4804
4814
|
});
|
|
4805
4815
|
t.event.addListenerOnce(n, "idle", () => {
|
|
4806
|
-
e || V(
|
|
4816
|
+
e || V(y, n);
|
|
4807
4817
|
});
|
|
4808
4818
|
}), () => {
|
|
4809
4819
|
e = !0;
|
|
4810
4820
|
};
|
|
4811
4821
|
});
|
|
4812
|
-
let
|
|
4822
|
+
let fe = null, pe = null;
|
|
4813
4823
|
Tn(() => {
|
|
4814
|
-
!q(
|
|
4824
|
+
!q(y) || i().lat === fe && i().lng === pe || (fe = i().lat, pe = i().lng, q(y).setCenter(i()));
|
|
4815
4825
|
}), Tn(() => {
|
|
4816
|
-
m(), p(), u(), g(),
|
|
4826
|
+
m(), p(), u(), g(), ue();
|
|
4817
4827
|
});
|
|
4818
|
-
function
|
|
4819
|
-
if (!q(
|
|
4828
|
+
function me() {
|
|
4829
|
+
if (!q(y) || r() !== "chart") return;
|
|
4820
4830
|
let e = new window.google.maps.LatLngBounds();
|
|
4821
4831
|
for (let t of u()) {
|
|
4822
4832
|
if (t.lat == null || t.lng == null || !t.berthId) continue;
|
|
4823
4833
|
let n = window.google.maps, r = mo(t, d()), i = r == null ? new n.Circle({
|
|
4824
|
-
map: q(
|
|
4834
|
+
map: q(y),
|
|
4825
4835
|
center: {
|
|
4826
4836
|
lat: t.lat,
|
|
4827
4837
|
lng: t.lng
|
|
4828
4838
|
},
|
|
4829
|
-
radius:
|
|
4830
|
-
...q(
|
|
4839
|
+
radius: O(t),
|
|
4840
|
+
...q(w)
|
|
4831
4841
|
}) : new n.Polygon({
|
|
4832
|
-
map: q(
|
|
4842
|
+
map: q(y),
|
|
4833
4843
|
paths: ho(t, r, fo),
|
|
4834
|
-
...q(
|
|
4844
|
+
...q(w)
|
|
4835
4845
|
}), o = {
|
|
4836
4846
|
circle: i,
|
|
4837
4847
|
hull: r == null ? null : new n.Polygon({
|
|
4838
|
-
map: q(
|
|
4848
|
+
map: q(y),
|
|
4839
4849
|
paths: ho(t, r, po, .8),
|
|
4840
4850
|
clickable: !1,
|
|
4841
4851
|
zIndex: 1,
|
|
@@ -4847,42 +4857,42 @@ function vo(e, t) {
|
|
|
4847
4857
|
berth: t,
|
|
4848
4858
|
pickable: !1
|
|
4849
4859
|
};
|
|
4850
|
-
|
|
4851
|
-
o.pickable && t.berthId !== m() && i.setOptions(q(
|
|
4860
|
+
b.set(t.berthId, o), J(() => de(o, t.berthId)), i.addListener("click", () => h()(t.berthId === m() ? null : t.berthId)), i.addListener("mouseover", () => {
|
|
4861
|
+
o.pickable && t.berthId !== m() && i.setOptions(q(T));
|
|
4852
4862
|
}), i.addListener("mouseout", () => {
|
|
4853
|
-
t.berthId !== m() &&
|
|
4863
|
+
t.berthId !== m() && de(o, t.berthId);
|
|
4854
4864
|
}), e.extend({
|
|
4855
4865
|
lat: t.lat,
|
|
4856
4866
|
lng: t.lng
|
|
4857
4867
|
});
|
|
4858
4868
|
}
|
|
4859
|
-
|
|
4869
|
+
b.size && !ee && (ee = !0, e.extend(i()), q(y).fitBounds(e, C()));
|
|
4860
4870
|
}
|
|
4861
4871
|
Tn(() => {
|
|
4862
|
-
if (!(!q(
|
|
4863
|
-
for (let e of
|
|
4864
|
-
|
|
4872
|
+
if (!(!q(y) || r() !== "chart")) {
|
|
4873
|
+
for (let e of b.values()) e.circle.setMap(null), e.hull?.setMap(null);
|
|
4874
|
+
b.clear(), me();
|
|
4865
4875
|
}
|
|
4866
4876
|
}), Tn(() => {
|
|
4867
|
-
if (!q(
|
|
4868
|
-
for (let e of
|
|
4877
|
+
if (!q(y)) return;
|
|
4878
|
+
for (let e of x) e.setMap(null);
|
|
4869
4879
|
let e = [];
|
|
4870
|
-
s() && e.push(new
|
|
4871
|
-
for (let t of l()) t.logoMark && e.push(new
|
|
4880
|
+
s() && e.push(new oe(i(), s(), c(), null));
|
|
4881
|
+
for (let t of l()) t.logoMark && e.push(new oe({
|
|
4872
4882
|
lat: t.lat,
|
|
4873
4883
|
lng: t.lng
|
|
4874
4884
|
}, t.logoMark, t.name, t.href));
|
|
4875
|
-
for (let t of e) t.setMap(q(
|
|
4876
|
-
|
|
4885
|
+
for (let t of e) t.setMap(q(y));
|
|
4886
|
+
x = e;
|
|
4877
4887
|
}), Tn(() => {
|
|
4878
|
-
if (!q(
|
|
4879
|
-
for (let e of
|
|
4888
|
+
if (!q(y) || r() !== "coastal") return;
|
|
4889
|
+
for (let e of S) e.setMap(null);
|
|
4880
4890
|
let e = d().length ? d() : f() ? [f()] : [];
|
|
4881
|
-
if (
|
|
4882
|
-
let t = new
|
|
4883
|
-
return t.setMap(q(
|
|
4884
|
-
}), e.length && !
|
|
4885
|
-
|
|
4891
|
+
if (S = e.map((e) => {
|
|
4892
|
+
let t = new le(e);
|
|
4893
|
+
return t.setMap(q(y)), t;
|
|
4894
|
+
}), e.length && !ee) {
|
|
4895
|
+
ee = !0;
|
|
4886
4896
|
let t = new window.google.maps.LatLngBounds();
|
|
4887
4897
|
for (let n of e) t.extend({
|
|
4888
4898
|
lat: n.swLat,
|
|
@@ -4891,17 +4901,17 @@ function vo(e, t) {
|
|
|
4891
4901
|
lat: n.neLat,
|
|
4892
4902
|
lng: n.neLng
|
|
4893
4903
|
});
|
|
4894
|
-
q(
|
|
4904
|
+
q(y).fitBounds(t, C());
|
|
4895
4905
|
}
|
|
4896
4906
|
});
|
|
4897
|
-
let
|
|
4907
|
+
let he = null;
|
|
4898
4908
|
Tn(() => {
|
|
4899
4909
|
p();
|
|
4900
|
-
let e = m() != null && m() !==
|
|
4901
|
-
for (let [t, n] of
|
|
4902
|
-
|
|
4910
|
+
let e = m() != null && m() !== he;
|
|
4911
|
+
for (let [t, n] of b) de(n, t), e && t === m() && ie(n);
|
|
4912
|
+
he = m();
|
|
4903
4913
|
});
|
|
4904
|
-
var
|
|
4914
|
+
var ge = {
|
|
4905
4915
|
get mapsApiKey() {
|
|
4906
4916
|
return n();
|
|
4907
4917
|
},
|
|
@@ -4991,9 +5001,15 @@ function vo(e, t) {
|
|
|
4991
5001
|
},
|
|
4992
5002
|
set staff(e = !1) {
|
|
4993
5003
|
g(e), z();
|
|
5004
|
+
},
|
|
5005
|
+
get fitInset() {
|
|
5006
|
+
return _();
|
|
5007
|
+
},
|
|
5008
|
+
set fitInset(e) {
|
|
5009
|
+
_(e), z();
|
|
4994
5010
|
}
|
|
4995
|
-
},
|
|
4996
|
-
return Ai(
|
|
5011
|
+
}, _e = go();
|
|
5012
|
+
return Ai(_e, (e) => v = e, () => v), X(e, _e), Ze(ge);
|
|
4997
5013
|
}
|
|
4998
5014
|
Ii(vo, {
|
|
4999
5015
|
mapsApiKey: {},
|
|
@@ -5010,7 +5026,8 @@ Ii(vo, {
|
|
|
5010
5026
|
loa: {},
|
|
5011
5027
|
selectedBerth: {},
|
|
5012
5028
|
onBerthClick: {},
|
|
5013
|
-
staff: {}
|
|
5029
|
+
staff: {},
|
|
5030
|
+
fitInset: {}
|
|
5014
5031
|
}, [], [], { mode: "open" });
|
|
5015
5032
|
//#endregion
|
|
5016
5033
|
//#region src/components/Stepper.svelte
|
|
@@ -13158,28 +13175,32 @@ function Lc(e, t) {
|
|
|
13158
13175
|
}), qr(() => {
|
|
13159
13176
|
_() === "overlay" ? (T.style.maxWidth = "none", T.style.setProperty("--sbw-card-width", g())) : T.style.maxWidth = g();
|
|
13160
13177
|
});
|
|
13161
|
-
let Oe = /* @__PURE__ */
|
|
13178
|
+
let Oe = /* @__PURE__ */ B(void 0), ke = /* @__PURE__ */ B(void 0);
|
|
13179
|
+
function Ae() {
|
|
13180
|
+
return _() !== "overlay" || !q(Oe) || !q(ke) || !matchMedia("(min-width: 768px)").matches ? 0 : q(ke).getBoundingClientRect().right - q(Oe).getBoundingClientRect().left;
|
|
13181
|
+
}
|
|
13182
|
+
let je = /* @__PURE__ */ I(() => !!d() && !D && !q(he)), Me = /* @__PURE__ */ I(() => q(de) != null && q(de) > 0 ? q(de) : null), Ne = /* @__PURE__ */ I(() => (q(pe)?.berths ?? []).filter((e) => e.status === "available")), Pe = /* @__PURE__ */ I(() => !q(Ne).length || q(Ne).some((e) => e.lengthM == null) ? 200 : Math.max(...q(Ne).map((e) => e.lengthM ?? 0))), Fe = /* @__PURE__ */ I(() => q(oe) && q(me).some((e) => e.label === q(oe)) ? q(oe) : ao(q(me))), Ie = /* @__PURE__ */ I(() => q(me).find((e) => e.label === q(Fe)) ?? null), Le = /* @__PURE__ */ I(() => q(Ie)?.totalPrice == null ? null : co(q(Ie).totalPrice, q(pe)?.currency ?? null, l(), q(ne))), Re = !1;
|
|
13162
13183
|
Tn(() => {
|
|
13163
|
-
|
|
13184
|
+
Re || !q(Ne).length || (Re = !0, q(ie) > q(Pe) && V(ie, q(Pe), !0));
|
|
13164
13185
|
}), Tn(() => {
|
|
13165
13186
|
let e = s();
|
|
13166
13187
|
J(() => {
|
|
13167
13188
|
q(k) <= 2 && V(oe, e || null, !0);
|
|
13168
13189
|
});
|
|
13169
13190
|
});
|
|
13170
|
-
let
|
|
13191
|
+
let M = {
|
|
13171
13192
|
arrival: "",
|
|
13172
13193
|
departure: ""
|
|
13173
|
-
},
|
|
13194
|
+
}, ze = /* @__PURE__ */ I(() => q(A) && q(ae) && +q(ae) > +q(A) ? M = {
|
|
13174
13195
|
arrival: Aa(q(A)),
|
|
13175
13196
|
departure: Aa(q(ae))
|
|
13176
|
-
} :
|
|
13197
|
+
} : M), N = /* @__PURE__ */ B(1);
|
|
13177
13198
|
qr(() => {
|
|
13178
|
-
D || Io(r(), n(), J(() => q(
|
|
13179
|
-
e.requirements.length || (V(
|
|
13199
|
+
D || Io(r(), n(), J(() => q(ze)), null).then((e) => {
|
|
13200
|
+
e.requirements.length || (V(N, 2), q(k) === 1 && (V(_e, !0), V(k, 2)));
|
|
13180
13201
|
}, () => {});
|
|
13181
13202
|
});
|
|
13182
|
-
let
|
|
13203
|
+
let Be = {
|
|
13183
13204
|
email: "",
|
|
13184
13205
|
name: ""
|
|
13185
13206
|
};
|
|
@@ -13187,10 +13208,10 @@ function Lc(e, t) {
|
|
|
13187
13208
|
let e = q(ve);
|
|
13188
13209
|
J(() => {
|
|
13189
13210
|
if (e) {
|
|
13190
|
-
V(ce,
|
|
13211
|
+
V(ce, Be.email = e.email, !0), !q(se).trim() && e.name && V(se, Be.name = e.name, !0);
|
|
13191
13212
|
return;
|
|
13192
13213
|
}
|
|
13193
|
-
|
|
13214
|
+
Be.email && q(ce) === Be.email && V(ce, ""), Be.name && q(se) === Be.name && V(se, ""), Be = {
|
|
13194
13215
|
email: "",
|
|
13195
13216
|
name: ""
|
|
13196
13217
|
};
|
|
@@ -13201,11 +13222,11 @@ function Lc(e, t) {
|
|
|
13201
13222
|
V(ie, e, !0);
|
|
13202
13223
|
});
|
|
13203
13224
|
});
|
|
13204
|
-
let
|
|
13225
|
+
let Ve = "";
|
|
13205
13226
|
Tn(() => {
|
|
13206
13227
|
let e = q(ye);
|
|
13207
13228
|
J(() => {
|
|
13208
|
-
e && !q(ue).trim() ? V(ue,
|
|
13229
|
+
e && !q(ue).trim() ? V(ue, Ve = e, !0) : !e && Ve && q(ue) === Ve && V(ue, Ve = "", !0);
|
|
13209
13230
|
});
|
|
13210
13231
|
}), Tn(() => {
|
|
13211
13232
|
if (D) return;
|
|
@@ -13230,7 +13251,7 @@ function Lc(e, t) {
|
|
|
13230
13251
|
arrival: Aa(q(A)),
|
|
13231
13252
|
departure: Aa(q(ae)),
|
|
13232
13253
|
boatLengthM: q(ie),
|
|
13233
|
-
boatBeamM: q(
|
|
13254
|
+
boatBeamM: q(Me)
|
|
13234
13255
|
};
|
|
13235
13256
|
q(ge);
|
|
13236
13257
|
let t = !1, i = setTimeout(() => {
|
|
@@ -13248,30 +13269,30 @@ function Lc(e, t) {
|
|
|
13248
13269
|
}), Tn(() => {
|
|
13249
13270
|
D || te("sidon-loa-change", { loa: q(ie) });
|
|
13250
13271
|
});
|
|
13251
|
-
function
|
|
13272
|
+
function He(e) {
|
|
13252
13273
|
q(k) <= 2 && V(oe, e, !0);
|
|
13253
13274
|
}
|
|
13254
|
-
function
|
|
13255
|
-
e < q(k) &&
|
|
13275
|
+
function Ue(e) {
|
|
13276
|
+
e < q(k) && et();
|
|
13256
13277
|
}
|
|
13257
|
-
function
|
|
13258
|
-
q(we) || (V(Te, null), q(k) === 1 ? q(_e) && V(k, 2) : q(k) === 2 ?
|
|
13278
|
+
function We() {
|
|
13279
|
+
q(we) || (V(Te, null), q(k) === 1 ? q(_e) && V(k, 2) : q(k) === 2 ? Je() : q(k) === 3 && Qe());
|
|
13259
13280
|
}
|
|
13260
|
-
let
|
|
13261
|
-
function
|
|
13281
|
+
let Ge = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
13282
|
+
function Ke() {
|
|
13262
13283
|
let e = q(E).wizard;
|
|
13263
|
-
return !q(A) || !q(ae) || +q(ae) <= +q(A) ? e.errDates : q(ie) > 0 ? q(
|
|
13284
|
+
return !q(A) || !q(ae) || +q(ae) <= +q(A) ? e.errDates : q(ie) > 0 ? q(Fe) ? q(se).trim() ? q(ue).trim() ? Ge.test(q(ce).trim()) ? null : e.errEmail : e.errBoatName : e.errName : e.errNoBerth : e.errLength;
|
|
13264
13285
|
}
|
|
13265
|
-
function
|
|
13286
|
+
function qe() {
|
|
13266
13287
|
return q(ve) ? Do(S())?.token ?? null : null;
|
|
13267
13288
|
}
|
|
13268
|
-
async function
|
|
13269
|
-
let e =
|
|
13289
|
+
async function Je() {
|
|
13290
|
+
let e = Ke();
|
|
13270
13291
|
if (e) return void V(Te, e, !0);
|
|
13271
13292
|
V(we, !0);
|
|
13272
13293
|
try {
|
|
13273
13294
|
let e = await Ro(r(), n(), {
|
|
13274
|
-
berthLabel: q(
|
|
13295
|
+
berthLabel: q(Fe),
|
|
13275
13296
|
arrival: Aa(q(A)),
|
|
13276
13297
|
departure: Aa(q(ae)),
|
|
13277
13298
|
contactName: q(se).trim(),
|
|
@@ -13279,25 +13300,25 @@ function Lc(e, t) {
|
|
|
13279
13300
|
contactPhone: q(le).trim() || void 0,
|
|
13280
13301
|
boatName: q(ue).trim(),
|
|
13281
13302
|
boatLengthM: q(ie),
|
|
13282
|
-
boatBeamM: q(
|
|
13303
|
+
boatBeamM: q(Me),
|
|
13283
13304
|
notes: q(fe).trim() || void 0,
|
|
13284
13305
|
locale: q(ne)
|
|
13285
|
-
},
|
|
13306
|
+
}, qe()), t = {
|
|
13286
13307
|
id: e.booking.id,
|
|
13287
13308
|
token: e.token
|
|
13288
13309
|
};
|
|
13289
|
-
V(O, t, !0), kc(n(), t), e.payment ? (V(xe, e, !0), V(k, 3)) :
|
|
13310
|
+
V(O, t, !0), kc(n(), t), e.payment ? (V(xe, e, !0), V(k, 3)) : $e(t.id);
|
|
13290
13311
|
} catch (e) {
|
|
13291
|
-
|
|
13312
|
+
Ye(e);
|
|
13292
13313
|
} finally {
|
|
13293
13314
|
V(we, !1);
|
|
13294
13315
|
}
|
|
13295
13316
|
}
|
|
13296
|
-
function
|
|
13317
|
+
function Ye(e) {
|
|
13297
13318
|
let t = q(E).wizard;
|
|
13298
13319
|
if (!(e instanceof Ao) || e.status === 0) return void V(Te, t.errNetwork, !0);
|
|
13299
13320
|
if (Ja(e.status, e.message)) {
|
|
13300
|
-
V(
|
|
13321
|
+
V(N, 1), V(k, 1), V(Te, q(E).docsStep.missingNow, !0);
|
|
13301
13322
|
return;
|
|
13302
13323
|
}
|
|
13303
13324
|
(e.status === 409 || e.status === 404) && nn(ge);
|
|
@@ -13310,7 +13331,7 @@ function Lc(e, t) {
|
|
|
13310
13331
|
};
|
|
13311
13332
|
V(Te, n[e.status] ?? (e.status >= 500 ? t.errUnavailable : e.message), !0);
|
|
13312
13333
|
}
|
|
13313
|
-
async function
|
|
13334
|
+
async function Qe() {
|
|
13314
13335
|
let e = q(O);
|
|
13315
13336
|
if (!(!e || !q(Ce))) {
|
|
13316
13337
|
V(we, !0);
|
|
@@ -13320,20 +13341,20 @@ function Lc(e, t) {
|
|
|
13320
13341
|
V(Te, e instanceof Error ? e.message : q(E).wizard.errNetwork, !0), V(we, !1);
|
|
13321
13342
|
return;
|
|
13322
13343
|
}
|
|
13323
|
-
await Bo(r(), n(), e).catch(() => {}), V(we, !1),
|
|
13344
|
+
await Bo(r(), n(), e).catch(() => {}), V(we, !1), $e(e.id);
|
|
13324
13345
|
}
|
|
13325
13346
|
}
|
|
13326
|
-
function
|
|
13347
|
+
function $e(e) {
|
|
13327
13348
|
V(xe, null), V(k, 4), te("sidon-booked", {
|
|
13328
13349
|
bookingId: e,
|
|
13329
13350
|
marina: n()
|
|
13330
13351
|
});
|
|
13331
13352
|
}
|
|
13332
|
-
async function
|
|
13353
|
+
async function et() {
|
|
13333
13354
|
let e = q(O);
|
|
13334
13355
|
if (q(we)) return;
|
|
13335
13356
|
if (q(k) === 2) {
|
|
13336
|
-
V(Te, null), V(k, q(
|
|
13357
|
+
V(Te, null), V(k, q(N), !0);
|
|
13337
13358
|
return;
|
|
13338
13359
|
}
|
|
13339
13360
|
if (q(k) !== 3 || !e) return;
|
|
@@ -13342,16 +13363,16 @@ function Lc(e, t) {
|
|
|
13342
13363
|
if (V(we, !1), !t) return void V(Te, q(E).wizard.errNetwork, !0);
|
|
13343
13364
|
Ac(n()), V(O, null), V(xe, null), V(k, 2);
|
|
13344
13365
|
}
|
|
13345
|
-
function
|
|
13346
|
-
Ac(n()), V(O, null), V(Te, null), V(k, q(
|
|
13366
|
+
function tt() {
|
|
13367
|
+
Ac(n()), V(O, null), V(Te, null), V(k, q(N), !0);
|
|
13347
13368
|
}
|
|
13348
|
-
function
|
|
13369
|
+
function nt(e, t) {
|
|
13349
13370
|
t !== null && q(O) && te("sidon-booking-status", {
|
|
13350
13371
|
bookingId: q(O).id,
|
|
13351
13372
|
status: e
|
|
13352
13373
|
});
|
|
13353
13374
|
}
|
|
13354
|
-
var
|
|
13375
|
+
var rt = {
|
|
13355
13376
|
get marina() {
|
|
13356
13377
|
return n();
|
|
13357
13378
|
},
|
|
@@ -13496,7 +13517,7 @@ function Lc(e, t) {
|
|
|
13496
13517
|
set sailorApiOrigin(e = "") {
|
|
13497
13518
|
w(e), z();
|
|
13498
13519
|
}
|
|
13499
|
-
},
|
|
13520
|
+
}, it = Fc(), at = hn(it), ot = (e) => {
|
|
13500
13521
|
var t = Mc();
|
|
13501
13522
|
let n;
|
|
13502
13523
|
var r = H(t);
|
|
@@ -13543,24 +13564,25 @@ function Lc(e, t) {
|
|
|
13543
13564
|
return q(ie);
|
|
13544
13565
|
},
|
|
13545
13566
|
get selectedBerth() {
|
|
13546
|
-
return q(
|
|
13567
|
+
return q(Fe);
|
|
13547
13568
|
},
|
|
13548
|
-
onBerthClick:
|
|
13569
|
+
onBerthClick: He,
|
|
13570
|
+
fitInset: Ae
|
|
13549
13571
|
});
|
|
13550
13572
|
}
|
|
13551
|
-
P(t), W(() => {
|
|
13573
|
+
P(t), Ai(t, (e) => V(Oe, e), () => q(Oe)), W(() => {
|
|
13552
13574
|
n = fi(t, 1, "sbw-map-slot svelte-h0br6q", null, n, {
|
|
13553
13575
|
"sbw-map-slot--full-bleed": m() === "100vw",
|
|
13554
13576
|
"sbw-map-slot--overlay": _() === "overlay"
|
|
13555
13577
|
}), mi(t, `height: ${p() ?? ""}; width: ${m() ?? ""}; margin-bottom: ${h() ?? ""};`);
|
|
13556
13578
|
}), X(e, t);
|
|
13557
13579
|
};
|
|
13558
|
-
Q(
|
|
13559
|
-
q(
|
|
13580
|
+
Q(at, (e) => {
|
|
13581
|
+
q(je) && e(ot);
|
|
13560
13582
|
});
|
|
13561
|
-
var
|
|
13562
|
-
let
|
|
13563
|
-
var
|
|
13583
|
+
var st = U(at, 2);
|
|
13584
|
+
let ct;
|
|
13585
|
+
var lt = H(st), ut = (e) => {
|
|
13564
13586
|
var t = Fr(), i = hn(t), a = (e) => {
|
|
13565
13587
|
{
|
|
13566
13588
|
let t = /* @__PURE__ */ I(() => c() ? q(ne) : null);
|
|
@@ -13586,7 +13608,7 @@ function Lc(e, t) {
|
|
|
13586
13608
|
get host() {
|
|
13587
13609
|
return T;
|
|
13588
13610
|
},
|
|
13589
|
-
onstatus:
|
|
13611
|
+
onstatus: nt
|
|
13590
13612
|
});
|
|
13591
13613
|
}
|
|
13592
13614
|
}, o = (e) => {
|
|
@@ -13596,19 +13618,19 @@ function Lc(e, t) {
|
|
|
13596
13618
|
Q(i, (e) => {
|
|
13597
13619
|
q(O) ? e(a) : e(o, -1);
|
|
13598
13620
|
}), X(e, t);
|
|
13599
|
-
},
|
|
13621
|
+
}, dt = (e) => {
|
|
13600
13622
|
var t = Pc(), i = hn(t);
|
|
13601
13623
|
{
|
|
13602
|
-
let e = /* @__PURE__ */ I(() => q(
|
|
13624
|
+
let e = /* @__PURE__ */ I(() => q(Fe) ?? "—"), t = /* @__PURE__ */ I(() => c() || "en"), n = /* @__PURE__ */ I(() => q(k) > 2);
|
|
13603
13625
|
Ia(i, {
|
|
13604
13626
|
get berthLabel() {
|
|
13605
13627
|
return q(e);
|
|
13606
13628
|
},
|
|
13607
13629
|
get priceLabel() {
|
|
13608
|
-
return q(
|
|
13630
|
+
return q(Le);
|
|
13609
13631
|
},
|
|
13610
13632
|
get maxLoa() {
|
|
13611
|
-
return q(
|
|
13633
|
+
return q(Pe);
|
|
13612
13634
|
},
|
|
13613
13635
|
get locale() {
|
|
13614
13636
|
return q(t);
|
|
@@ -13644,7 +13666,7 @@ function Lc(e, t) {
|
|
|
13644
13666
|
return q(k);
|
|
13645
13667
|
},
|
|
13646
13668
|
get first() {
|
|
13647
|
-
return q(
|
|
13669
|
+
return q(N);
|
|
13648
13670
|
},
|
|
13649
13671
|
get skip() {
|
|
13650
13672
|
return q(e);
|
|
@@ -13652,7 +13674,7 @@ function Lc(e, t) {
|
|
|
13652
13674
|
get labels() {
|
|
13653
13675
|
return q(E).steps;
|
|
13654
13676
|
},
|
|
13655
|
-
onStepClick:
|
|
13677
|
+
onStepClick: Ue
|
|
13656
13678
|
});
|
|
13657
13679
|
}
|
|
13658
13680
|
var o = U(a, 2), s = (e) => {
|
|
@@ -13694,10 +13716,10 @@ function Lc(e, t) {
|
|
|
13694
13716
|
return q(t);
|
|
13695
13717
|
},
|
|
13696
13718
|
get arrival() {
|
|
13697
|
-
return q(
|
|
13719
|
+
return q(ze).arrival;
|
|
13698
13720
|
},
|
|
13699
13721
|
get departure() {
|
|
13700
|
-
return q(
|
|
13722
|
+
return q(ze).departure;
|
|
13701
13723
|
},
|
|
13702
13724
|
get lang() {
|
|
13703
13725
|
return q(ne);
|
|
@@ -13828,8 +13850,8 @@ function Lc(e, t) {
|
|
|
13828
13850
|
get host() {
|
|
13829
13851
|
return T;
|
|
13830
13852
|
},
|
|
13831
|
-
onstatus:
|
|
13832
|
-
onstartover:
|
|
13853
|
+
onstatus: nt,
|
|
13854
|
+
onstartover: tt
|
|
13833
13855
|
});
|
|
13834
13856
|
}
|
|
13835
13857
|
};
|
|
@@ -13844,7 +13866,7 @@ function Lc(e, t) {
|
|
|
13844
13866
|
return q(k);
|
|
13845
13867
|
},
|
|
13846
13868
|
get firstStep() {
|
|
13847
|
-
return q(
|
|
13869
|
+
return q(N);
|
|
13848
13870
|
},
|
|
13849
13871
|
get sending() {
|
|
13850
13872
|
return q(we);
|
|
@@ -13861,17 +13883,17 @@ function Lc(e, t) {
|
|
|
13861
13883
|
get variant() {
|
|
13862
13884
|
return u();
|
|
13863
13885
|
},
|
|
13864
|
-
onBack:
|
|
13865
|
-
onNext:
|
|
13886
|
+
onBack: et,
|
|
13887
|
+
onNext: We
|
|
13866
13888
|
});
|
|
13867
13889
|
}
|
|
13868
13890
|
X(e, t);
|
|
13869
13891
|
};
|
|
13870
|
-
return Q(
|
|
13871
|
-
D ? e(
|
|
13872
|
-
}), P(
|
|
13873
|
-
|
|
13874
|
-
}), X(e,
|
|
13892
|
+
return Q(lt, (e) => {
|
|
13893
|
+
D ? e(ut) : e(dt, -1);
|
|
13894
|
+
}), P(st), Ai(st, (e) => V(ke, e), () => q(ke)), W(() => {
|
|
13895
|
+
ct = fi(st, 1, "sbw-root svelte-h0br6q", null, ct, { "sbw-root--overlay": _() === "overlay" }), mi(st, `--sbw-map-h: ${(q(je) ? p() : "0px") ?? ""}; --sbw-map-gap: ${(q(je) ? h() : "0px") ?? ""};`);
|
|
13896
|
+
}), X(e, it), Ze(rt);
|
|
13875
13897
|
}
|
|
13876
13898
|
customElements.define("sidon-booking-widget", Ii(Lc, {
|
|
13877
13899
|
marina: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forgebuild/sidon-booking-widget",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.4",
|
|
4
4
|
"description": "Berth booking and berth map custom elements for marinas on OTA, plus an Astro forwarder route and server client.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|