@gomusdev/web-components 4.11.0 → 4.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/dist-js/gomus-webcomponents.iife.js +200 -26
- package/dist-js/gomus-webcomponents.js +200 -26
- package/dist-js/gomus-webcomponents.min.iife.js +35 -35
- package/dist-js/gomus-webcomponents.min.js +6122 -5996
- package/dist-js/src/components/ticketSelection/subcomponents/calendar/components/Calendar.spec.d.ts +1 -0
- package/dist-js/src/components/ticketSelection/subcomponents/calendar/lib/calendar.spec.d.ts +1 -0
- package/dist-js/src/components/ticketSelection/subcomponents/calendar/lib/calendar.svelte.d.ts +28 -2
- package/dist-js/src/lib/stores/shop.svelte.d.ts +1 -3
- package/dist-js/src/lib/stores/shop.translate.spec.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.13.0 (2026-07-28)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **cart:** make − remove the line at its minimum quantity
|
|
8
|
+
|
|
9
|
+
## 4.12.0 (2026-07-28)
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **calendar:** add availability-override callback to <go-calendar>
|
|
14
|
+
|
|
3
15
|
## 4.11.0 (2026-07-23)
|
|
4
16
|
|
|
5
17
|
### Features
|
|
@@ -6378,6 +6378,18 @@ createHTML: (html) => {
|
|
|
6378
6378
|
console.warn(`[go] Invalid locale "${locale}" — not a valid BCP 47 language tag (use "de", "de-CH", "en", …). Price and date formatting will throw.`);
|
|
6379
6379
|
}
|
|
6380
6380
|
}
|
|
6381
|
+
var defaultTranslations_default = {
|
|
6382
|
+
en: {
|
|
6383
|
+
"quantity.remove": "Remove item",
|
|
6384
|
+
"quantity.remove.label": "✕",
|
|
6385
|
+
"cart.item.remove": "✕"
|
|
6386
|
+
},
|
|
6387
|
+
de: {
|
|
6388
|
+
"quantity.remove": "Artikel entfernen",
|
|
6389
|
+
"quantity.remove.label": "✕",
|
|
6390
|
+
"cart.item.remove": "✕"
|
|
6391
|
+
}
|
|
6392
|
+
};
|
|
6381
6393
|
//#endregion
|
|
6382
6394
|
//#region src/lib/helpers/urls.ts
|
|
6383
6395
|
var ANGULAR_URLS = {
|
|
@@ -6480,6 +6492,9 @@ createHTML: (html) => {
|
|
|
6480
6492
|
var isObject$2 = (value) => {
|
|
6481
6493
|
return !!value && value.constructor === Object;
|
|
6482
6494
|
};
|
|
6495
|
+
var isFunction$2 = (value) => {
|
|
6496
|
+
return !!(value && value.constructor && value.call && value.apply);
|
|
6497
|
+
};
|
|
6483
6498
|
var isString = (value) => {
|
|
6484
6499
|
return typeof value === "string" || value instanceof String;
|
|
6485
6500
|
};
|
|
@@ -6490,6 +6505,12 @@ createHTML: (html) => {
|
|
|
6490
6505
|
return false;
|
|
6491
6506
|
}
|
|
6492
6507
|
};
|
|
6508
|
+
var isPromise = (value) => {
|
|
6509
|
+
if (!value) return false;
|
|
6510
|
+
if (!value.then) return false;
|
|
6511
|
+
if (!isFunction$2(value.then)) return false;
|
|
6512
|
+
return true;
|
|
6513
|
+
};
|
|
6493
6514
|
//#endregion
|
|
6494
6515
|
//#region ../../node_modules/.pnpm/radash@12.1.1/node_modules/radash/dist/esm/array.mjs
|
|
6495
6516
|
var group = (array, getGroupId) => {
|
|
@@ -13714,6 +13735,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
13714
13735
|
success: false,
|
|
13715
13736
|
errors: ["Not signed in"]
|
|
13716
13737
|
} };
|
|
13738
|
+
var defaultTranslations = defaultTranslations_default;
|
|
13717
13739
|
var Shop = class {
|
|
13718
13740
|
type;
|
|
13719
13741
|
#data = /* @__PURE__ */ state(proxy({
|
|
@@ -13781,7 +13803,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
13781
13803
|
return this.shop?.config.donations;
|
|
13782
13804
|
}
|
|
13783
13805
|
get translations() {
|
|
13784
|
-
return
|
|
13806
|
+
return {
|
|
13807
|
+
...defaultTranslations[(this.locale ?? "en").toLowerCase().split(/[-_]/)[0]] ?? defaultTranslations.en,
|
|
13808
|
+
...this.shop?.translations
|
|
13809
|
+
};
|
|
13785
13810
|
}
|
|
13786
13811
|
get currency() {
|
|
13787
13812
|
return this.shop?.config.currency;
|
|
@@ -15744,23 +15769,34 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15744
15769
|
}
|
|
15745
15770
|
//#endregion
|
|
15746
15771
|
//#region src/components/shared/quantityStepper/QuantityStepper.svelte
|
|
15747
|
-
var root$50 = /* @__PURE__ */ from_html(`<div class="go-quantity-stepper" role="group"><button type="button"
|
|
15772
|
+
var root$50 = /* @__PURE__ */ from_html(`<div class="go-quantity-stepper" role="group"><button type="button" tabindex="-1"><span aria-hidden="true"> </span></button> <input class="go-quantity-stepper-value" type="text" role="spinbutton" inputmode="numeric" autocomplete="off"/> <button type="button" class="go-quantity-stepper-button go-quantity-stepper-increment" tabindex="-1"><span aria-hidden="true">+</span></button></div>`);
|
|
15748
15773
|
function QuantityStepper($$anchor, $$props) {
|
|
15749
15774
|
const inputId = props_id();
|
|
15750
15775
|
push($$props, true);
|
|
15751
|
-
let value = prop($$props, "value", 7), min = prop($$props, "min", 7), max = prop($$props, "max", 7), floor = prop($$props, "floor", 7, 0), label = prop($$props, "label", 7), decreaseLabel = prop($$props, "decreaseLabel", 7), increaseLabel = prop($$props, "increaseLabel", 7), onChange = prop($$props, "onChange", 7);
|
|
15752
|
-
const
|
|
15776
|
+
let value = prop($$props, "value", 7), min = prop($$props, "min", 7), max = prop($$props, "max", 7), floor = prop($$props, "floor", 7, 0), label = prop($$props, "label", 7), decreaseLabel = prop($$props, "decreaseLabel", 7), increaseLabel = prop($$props, "increaseLabel", 7), onDecrementBelowMin = prop($$props, "onDecrementBelowMin", 7), removeAriaLabel = prop($$props, "removeAriaLabel", 7), removeLabel = prop($$props, "removeLabel", 7, "✕"), onChange = prop($$props, "onChange", 7);
|
|
15777
|
+
const removeMode = /* @__PURE__ */ user_derived(() => onDecrementBelowMin() != null);
|
|
15778
|
+
const removeBottom = /* @__PURE__ */ user_derived(() => Math.max(min(), 1));
|
|
15779
|
+
const bounds = /* @__PURE__ */ user_derived(() => get$2(removeMode) ? {
|
|
15780
|
+
min: get$2(removeBottom),
|
|
15781
|
+
max: max(),
|
|
15782
|
+
floor: get$2(removeBottom)
|
|
15783
|
+
} : {
|
|
15753
15784
|
min: min(),
|
|
15754
15785
|
max: max(),
|
|
15755
15786
|
floor: floor()
|
|
15756
|
-
})
|
|
15787
|
+
});
|
|
15788
|
+
const atRemove = /* @__PURE__ */ user_derived(() => get$2(removeMode) && value() <= get$2(removeBottom));
|
|
15757
15789
|
let inputEl;
|
|
15758
15790
|
let invalid = /* @__PURE__ */ state(false);
|
|
15759
|
-
const decDisabled = /* @__PURE__ */ user_derived(() => !canDecrement(value(), get$2(bounds)));
|
|
15791
|
+
const decDisabled = /* @__PURE__ */ user_derived(() => !get$2(atRemove) && !canDecrement(value(), get$2(bounds)));
|
|
15760
15792
|
const incDisabled = /* @__PURE__ */ user_derived(() => !canIncrement(value(), get$2(bounds)));
|
|
15761
15793
|
function emit(next) {
|
|
15762
15794
|
if (next !== value()) onChange()(next);
|
|
15763
15795
|
}
|
|
15796
|
+
function pressDecrement() {
|
|
15797
|
+
if (get$2(atRemove)) onDecrementBelowMin()();
|
|
15798
|
+
else stepDown();
|
|
15799
|
+
}
|
|
15764
15800
|
function stepDown() {
|
|
15765
15801
|
if (canDecrement(value(), get$2(bounds))) emit(decrement(value(), get$2(bounds)));
|
|
15766
15802
|
}
|
|
@@ -15768,7 +15804,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15768
15804
|
if (canIncrement(value(), get$2(bounds))) emit(increment(value(), get$2(bounds)));
|
|
15769
15805
|
}
|
|
15770
15806
|
function commitTyped() {
|
|
15771
|
-
const
|
|
15807
|
+
const raw = parseInt(inputEl.value, 10);
|
|
15808
|
+
if (get$2(removeMode) && (!Number.isFinite(raw) || raw <= 0)) {
|
|
15809
|
+
set(invalid, false);
|
|
15810
|
+
inputEl.value = String(value());
|
|
15811
|
+
onDecrementBelowMin()();
|
|
15812
|
+
return;
|
|
15813
|
+
}
|
|
15814
|
+
const next = clampTyped(raw, get$2(bounds));
|
|
15772
15815
|
set(invalid, false);
|
|
15773
15816
|
inputEl.value = String(next);
|
|
15774
15817
|
emit(next);
|
|
@@ -15789,7 +15832,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15789
15832
|
break;
|
|
15790
15833
|
case "Home":
|
|
15791
15834
|
e.preventDefault();
|
|
15792
|
-
emit(
|
|
15835
|
+
emit(get$2(bounds).floor);
|
|
15793
15836
|
break;
|
|
15794
15837
|
case "End":
|
|
15795
15838
|
e.preventDefault();
|
|
@@ -15851,6 +15894,27 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15851
15894
|
increaseLabel($$value);
|
|
15852
15895
|
flushSync();
|
|
15853
15896
|
},
|
|
15897
|
+
get onDecrementBelowMin() {
|
|
15898
|
+
return onDecrementBelowMin();
|
|
15899
|
+
},
|
|
15900
|
+
set onDecrementBelowMin($$value) {
|
|
15901
|
+
onDecrementBelowMin($$value);
|
|
15902
|
+
flushSync();
|
|
15903
|
+
},
|
|
15904
|
+
get removeAriaLabel() {
|
|
15905
|
+
return removeAriaLabel();
|
|
15906
|
+
},
|
|
15907
|
+
set removeAriaLabel($$value) {
|
|
15908
|
+
removeAriaLabel($$value);
|
|
15909
|
+
flushSync();
|
|
15910
|
+
},
|
|
15911
|
+
get removeLabel() {
|
|
15912
|
+
return removeLabel();
|
|
15913
|
+
},
|
|
15914
|
+
set removeLabel($$value = "✕") {
|
|
15915
|
+
removeLabel($$value);
|
|
15916
|
+
flushSync();
|
|
15917
|
+
},
|
|
15854
15918
|
get onChange() {
|
|
15855
15919
|
return onChange();
|
|
15856
15920
|
},
|
|
@@ -15861,6 +15925,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15861
15925
|
};
|
|
15862
15926
|
var div = root$50();
|
|
15863
15927
|
var button = child(div);
|
|
15928
|
+
let classes;
|
|
15929
|
+
var span = child(button);
|
|
15930
|
+
var text = child(span, true);
|
|
15931
|
+
reset(span);
|
|
15932
|
+
reset(button);
|
|
15864
15933
|
var input = sibling(button, 2);
|
|
15865
15934
|
remove_input_defaults(input);
|
|
15866
15935
|
bind_this(input, ($$value) => inputEl = $$value, () => inputEl);
|
|
@@ -15868,21 +15937,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15868
15937
|
reset(div);
|
|
15869
15938
|
template_effect(() => {
|
|
15870
15939
|
set_attribute(div, "aria-label", label());
|
|
15871
|
-
|
|
15940
|
+
classes = set_class(button, 1, "go-quantity-stepper-button go-quantity-stepper-decrement", null, classes, { "go-quantity-stepper-remove": get$2(atRemove) });
|
|
15941
|
+
set_attribute(button, "title", get$2(atRemove) ? removeAriaLabel() : decreaseLabel());
|
|
15872
15942
|
set_attribute(button, "aria-controls", inputId);
|
|
15873
15943
|
set_attribute(button, "aria-disabled", get$2(decDisabled));
|
|
15944
|
+
set_text(text, get$2(atRemove) ? removeLabel() : "−");
|
|
15874
15945
|
set_attribute(input, "id", inputId);
|
|
15875
15946
|
set_attribute(input, "aria-label", label());
|
|
15876
15947
|
set_value(input, value());
|
|
15877
15948
|
set_attribute(input, "aria-valuenow", value());
|
|
15878
|
-
set_attribute(input, "aria-valuemin",
|
|
15949
|
+
set_attribute(input, "aria-valuemin", get$2(bounds).floor);
|
|
15879
15950
|
set_attribute(input, "aria-valuemax", max());
|
|
15880
15951
|
set_attribute(input, "aria-invalid", get$2(invalid) ? "true" : void 0);
|
|
15881
15952
|
set_attribute(button_1, "title", increaseLabel());
|
|
15882
15953
|
set_attribute(button_1, "aria-controls", inputId);
|
|
15883
15954
|
set_attribute(button_1, "aria-disabled", get$2(incDisabled));
|
|
15884
15955
|
});
|
|
15885
|
-
delegated("click", button,
|
|
15956
|
+
delegated("click", button, pressDecrement);
|
|
15886
15957
|
delegated("input", input, onInput);
|
|
15887
15958
|
delegated("change", input, commitTyped);
|
|
15888
15959
|
event("blur", input, commitTyped);
|
|
@@ -15905,6 +15976,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15905
15976
|
label: {},
|
|
15906
15977
|
decreaseLabel: {},
|
|
15907
15978
|
increaseLabel: {},
|
|
15979
|
+
onDecrementBelowMin: {},
|
|
15980
|
+
removeAriaLabel: {},
|
|
15981
|
+
removeLabel: {},
|
|
15908
15982
|
onChange: {}
|
|
15909
15983
|
}, [], [], { mode: "open" });
|
|
15910
15984
|
//#endregion
|
|
@@ -15945,8 +16019,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15945
16019
|
* `min_persons`) a hard bottom on both controls: the backend does not enforce it,
|
|
15946
16020
|
* so the UI must (Angular-shop parity).
|
|
15947
16021
|
*/
|
|
16022
|
+
/**
|
|
16023
|
+
* Cart-only: when set, the stepper's `−` at the order minimum removes the line instead of
|
|
16024
|
+
* stepping (fires this). Presence turns the behaviour on; the legacy `<select>` ignores it.
|
|
16025
|
+
*/
|
|
15948
16026
|
/** Emits the next committed quantity. The control never mutates anything itself. */
|
|
15949
|
-
let value = prop($$props, "value", 7), min = prop($$props, "min", 7), max = prop($$props, "max", 7), label = prop($$props, "label", 7), floor = prop($$props, "floor", 7, 0), deselectable = prop($$props, "deselectable", 7, true), onChange = prop($$props, "onChange", 7);
|
|
16027
|
+
let value = prop($$props, "value", 7), min = prop($$props, "min", 7), max = prop($$props, "max", 7), label = prop($$props, "label", 7), floor = prop($$props, "floor", 7, 0), deselectable = prop($$props, "deselectable", 7, true), onDecrementBelowMin = prop($$props, "onDecrementBelowMin", 7), onChange = prop($$props, "onChange", 7);
|
|
15950
16028
|
const useStepper = /* @__PURE__ */ user_derived(() => configStore.config.quantityStepper);
|
|
15951
16029
|
var $$exports = {
|
|
15952
16030
|
get value() {
|
|
@@ -15991,6 +16069,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15991
16069
|
deselectable($$value);
|
|
15992
16070
|
flushSync();
|
|
15993
16071
|
},
|
|
16072
|
+
get onDecrementBelowMin() {
|
|
16073
|
+
return onDecrementBelowMin();
|
|
16074
|
+
},
|
|
16075
|
+
set onDecrementBelowMin($$value) {
|
|
16076
|
+
onDecrementBelowMin($$value);
|
|
16077
|
+
flushSync();
|
|
16078
|
+
},
|
|
15994
16079
|
get onChange() {
|
|
15995
16080
|
return onChange();
|
|
15996
16081
|
},
|
|
@@ -16006,6 +16091,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16006
16091
|
let $0 = /* @__PURE__ */ user_derived(() => deselectable() ? 0 : min());
|
|
16007
16092
|
let $1 = /* @__PURE__ */ user_derived(() => shop.t("quantity.decrease"));
|
|
16008
16093
|
let $2 = /* @__PURE__ */ user_derived(() => shop.t("quantity.increase"));
|
|
16094
|
+
let $3 = /* @__PURE__ */ user_derived(() => shop.t("quantity.remove"));
|
|
16095
|
+
let $4 = /* @__PURE__ */ user_derived(() => shop.t("quantity.remove.label"));
|
|
16009
16096
|
QuantityStepper($$anchor, {
|
|
16010
16097
|
get value() {
|
|
16011
16098
|
return value();
|
|
@@ -16028,6 +16115,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16028
16115
|
get increaseLabel() {
|
|
16029
16116
|
return get$2($2);
|
|
16030
16117
|
},
|
|
16118
|
+
get onDecrementBelowMin() {
|
|
16119
|
+
return onDecrementBelowMin();
|
|
16120
|
+
},
|
|
16121
|
+
get removeAriaLabel() {
|
|
16122
|
+
return get$2($3);
|
|
16123
|
+
},
|
|
16124
|
+
get removeLabel() {
|
|
16125
|
+
return get$2($4);
|
|
16126
|
+
},
|
|
16031
16127
|
get onChange() {
|
|
16032
16128
|
return onChange();
|
|
16033
16129
|
}
|
|
@@ -16068,6 +16164,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16068
16164
|
label: {},
|
|
16069
16165
|
floor: {},
|
|
16070
16166
|
deselectable: {},
|
|
16167
|
+
onDecrementBelowMin: {},
|
|
16071
16168
|
onChange: {}
|
|
16072
16169
|
}, [], [], { mode: "open" });
|
|
16073
16170
|
//#endregion
|
|
@@ -18062,7 +18159,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18062
18159
|
var root_2$11 = /* @__PURE__ */ from_html(`<span data-testid="cart-item-participant-count"> </span>`);
|
|
18063
18160
|
var root_3$8 = /* @__PURE__ */ from_html(`<span data-testid="cart-item-voucher-quantity"> </span>`);
|
|
18064
18161
|
var root_4$4 = /* @__PURE__ */ from_html(`<span> </span>`);
|
|
18065
|
-
var root_5$3 = /* @__PURE__ */ from_html(`<li class="go-cart-item-remove"><button class="go-cart-remove"
|
|
18162
|
+
var root_5$3 = /* @__PURE__ */ from_html(`<li class="go-cart-item-remove"><button class="go-cart-remove"> </button></li>`);
|
|
18066
18163
|
var root_6$2 = /* @__PURE__ */ from_html(`<ul class="go-sub-tickets" role="list"></ul>`);
|
|
18067
18164
|
var root_7$2 = /* @__PURE__ */ from_html(`<article class="go-cart-item-content"><ul><li class="go-cart-item-title-container"><!></li> <li class="go-cart-item-price"><!></li> <li class="go-cart-item-count"><!></li> <!> <li class="go-cart-item-sum"> </li></ul></article> <!>`, 1);
|
|
18068
18165
|
function Item$1($$anchor, $$props) {
|
|
@@ -18231,7 +18328,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18231
18328
|
return get$2($1);
|
|
18232
18329
|
},
|
|
18233
18330
|
floor: 1,
|
|
18234
|
-
onChange: updateQuantity
|
|
18331
|
+
onChange: updateQuantity,
|
|
18332
|
+
onDecrementBelowMin: del
|
|
18235
18333
|
});
|
|
18236
18334
|
}
|
|
18237
18335
|
};
|
|
@@ -18246,8 +18344,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18246
18344
|
var consequent_8 = ($$anchor) => {
|
|
18247
18345
|
var li_3 = root_5$3();
|
|
18248
18346
|
var button = child(li_3);
|
|
18347
|
+
var text_6 = child(button, true);
|
|
18348
|
+
reset(button);
|
|
18249
18349
|
reset(li_3);
|
|
18250
|
-
template_effect(($0
|
|
18350
|
+
template_effect(($0, $1) => {
|
|
18351
|
+
set_attribute(button, "aria-label", $0);
|
|
18352
|
+
set_text(text_6, $1);
|
|
18353
|
+
}, [() => shop.t("cart.item.aria.removeItem"), () => shop.t("cart.item.remove")]);
|
|
18251
18354
|
delegated("click", button, del);
|
|
18252
18355
|
append($$anchor, li_3);
|
|
18253
18356
|
};
|
|
@@ -18255,7 +18358,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18255
18358
|
if (!preview()) $$render(consequent_8);
|
|
18256
18359
|
});
|
|
18257
18360
|
var li_4 = sibling(node_4, 2);
|
|
18258
|
-
var
|
|
18361
|
+
var text_7 = child(li_4, true);
|
|
18259
18362
|
reset(li_4);
|
|
18260
18363
|
reset(ul);
|
|
18261
18364
|
reset(article);
|
|
@@ -18289,7 +18392,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18289
18392
|
if_block(node_5, ($$render) => {
|
|
18290
18393
|
if (get$2(mantleProduct)) $$render(consequent_9);
|
|
18291
18394
|
});
|
|
18292
|
-
template_effect(($0) => set_text(
|
|
18395
|
+
template_effect(($0) => set_text(text_7, $0), [() => formatCurrency(displayItem().total_price_cents)]);
|
|
18293
18396
|
append($$anchor, fragment_1);
|
|
18294
18397
|
};
|
|
18295
18398
|
if_block(node, ($$render) => {
|
|
@@ -37921,6 +38024,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
37921
38024
|
customElements.define("go-timeslots", create_custom_element(Timeslots, {}, [], ["details"]));
|
|
37922
38025
|
//#endregion
|
|
37923
38026
|
//#region src/components/ticketSelection/subcomponents/calendar/lib/calendar.svelte.ts
|
|
38027
|
+
function describeAvailability(value) {
|
|
38028
|
+
if (typeof value === "string") return `'${value}'`;
|
|
38029
|
+
if (value === null || value === void 0) return String(value);
|
|
38030
|
+
if (isPromise(value)) return "a Promise — the callback must be synchronous";
|
|
38031
|
+
return `a ${typeof value}`;
|
|
38032
|
+
}
|
|
37924
38033
|
var Calendar = class {
|
|
37925
38034
|
#details = /* @__PURE__ */ state();
|
|
37926
38035
|
get details() {
|
|
@@ -37943,6 +38052,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
37943
38052
|
set selected(value) {
|
|
37944
38053
|
set(this.#selected, value, true);
|
|
37945
38054
|
}
|
|
38055
|
+
#availabilityOverride = /* @__PURE__ */ state();
|
|
38056
|
+
get availabilityOverride() {
|
|
38057
|
+
return get$2(this.#availabilityOverride);
|
|
38058
|
+
}
|
|
38059
|
+
set availabilityOverride(value) {
|
|
38060
|
+
set(this.#availabilityOverride, value, true);
|
|
38061
|
+
}
|
|
38062
|
+
#logged = [];
|
|
37946
38063
|
get endpoint() {
|
|
37947
38064
|
return (this.details?.filters?.map((f) => getFilter(f).calendarEndpoint).filter(Boolean) ?? [])[0] ?? null;
|
|
37948
38065
|
}
|
|
@@ -37954,12 +38071,49 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
37954
38071
|
default: return;
|
|
37955
38072
|
}
|
|
37956
38073
|
}
|
|
38074
|
+
/** What gomus makes of a date on its own, ignoring any integrator override. */
|
|
38075
|
+
defaultAvailability(date) {
|
|
38076
|
+
switch (this.dates?.[date.toString()]) {
|
|
38077
|
+
case "unavailable": return "unavailable";
|
|
38078
|
+
case "fully_booked": return "sold_out";
|
|
38079
|
+
default: return "available";
|
|
38080
|
+
}
|
|
38081
|
+
}
|
|
38082
|
+
/** The gomus default, with the integrator's override given the last word. */
|
|
38083
|
+
availability(date) {
|
|
38084
|
+
const defaultAvailability = this.defaultAvailability(date);
|
|
38085
|
+
const override = this.#overrideCallback();
|
|
38086
|
+
if (!override) return defaultAvailability;
|
|
38087
|
+
let returned;
|
|
38088
|
+
try {
|
|
38089
|
+
returned = override(date.toString(), defaultAvailability);
|
|
38090
|
+
} catch (error) {
|
|
38091
|
+
this.#reportOnce("threw", `[go-calendar] the availability-override callback threw (${String(error)}) — using the gomus default instead.`);
|
|
38092
|
+
return defaultAvailability;
|
|
38093
|
+
}
|
|
38094
|
+
if (returned === "pass_through") return defaultAvailability;
|
|
38095
|
+
if (returned === "available" || returned === "sold_out" || returned === "unavailable") return returned;
|
|
38096
|
+
this.#reportOnce("returned", `[go-calendar] the availability-override callback must return 'available', 'sold_out', 'unavailable' or 'pass_through', got ${describeAvailability(returned)} — using the gomus default instead.`);
|
|
38097
|
+
return defaultAvailability;
|
|
38098
|
+
}
|
|
38099
|
+
#overrideCallback() {
|
|
38100
|
+
const source = this.availabilityOverride;
|
|
38101
|
+
if (typeof source === "function") return source;
|
|
38102
|
+
if (!source) return void 0;
|
|
38103
|
+
const candidate = globalThis[source];
|
|
38104
|
+
if (typeof candidate === "function") return candidate;
|
|
38105
|
+
this.#reportOnce(`unresolved:${source}`, `[go-calendar] availability-override="${source}" does not resolve to a function on window — using the gomus defaults.`, console.warn);
|
|
38106
|
+
}
|
|
38107
|
+
#reportOnce(key, message, log = console.error) {
|
|
38108
|
+
if (this.#logged.includes(key)) return;
|
|
38109
|
+
this.#logged.push(key);
|
|
38110
|
+
log(message);
|
|
38111
|
+
}
|
|
37957
38112
|
isDateDisabled(date) {
|
|
37958
|
-
|
|
37959
|
-
return date.compare($ad063034c8620db8$export$d0bdf45af03a6ea3($ad063034c8620db8$export$aa8b41735afcabd2())) < 0;
|
|
38113
|
+
return date.compare($ad063034c8620db8$export$d0bdf45af03a6ea3($ad063034c8620db8$export$aa8b41735afcabd2())) < 0 || this.availability(date) === "unavailable";
|
|
37960
38114
|
}
|
|
37961
38115
|
isDateUnavailable(date) {
|
|
37962
|
-
return this.
|
|
38116
|
+
return this.availability(date) === "sold_out";
|
|
37963
38117
|
}
|
|
37964
38118
|
get apiFilters() {
|
|
37965
38119
|
return this.details?.filters?.map((f) => getFilter(f).apiToken).filter(Boolean);
|
|
@@ -37988,13 +38142,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
37988
38142
|
thisMonth.add({ months: 2 })
|
|
37989
38143
|
];
|
|
37990
38144
|
}
|
|
38145
|
+
#mergedDates(fetchMonth) {
|
|
38146
|
+
return this.fetchPeriod().reduce((all, startAt) => Object.assign(all, fetchMonth(this.params(startAt))), {});
|
|
38147
|
+
}
|
|
37991
38148
|
eventsDates() {
|
|
37992
|
-
|
|
37993
|
-
return this.fetchPeriod().reduce((prev, startAt) => assign(prev, method(this.params(startAt))), {});
|
|
38149
|
+
return this.#mergedDates((params) => shop.calendar(params));
|
|
37994
38150
|
}
|
|
37995
38151
|
ticketsDates() {
|
|
37996
|
-
|
|
37997
|
-
return this.fetchPeriod().reduce((prev, startAt) => assign(prev, method(this.params(startAt))), {});
|
|
38152
|
+
return this.#mergedDates((params) => shop.ticketsCalendar(params));
|
|
37998
38153
|
}
|
|
37999
38154
|
};
|
|
38000
38155
|
//#endregion
|
|
@@ -38226,12 +38381,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
38226
38381
|
//#region src/components/ticketSelection/subcomponents/calendar/components/Calendar.svelte
|
|
38227
38382
|
function Calendar_1($$anchor, $$props) {
|
|
38228
38383
|
push($$props, true);
|
|
38384
|
+
/**
|
|
38385
|
+
* Per-date availability override. As an attribute it names a global function
|
|
38386
|
+
* (`<go-calendar availability-override="shopRule">`); as a property it is the function
|
|
38387
|
+
* itself (`element.availabilityOverride = fn`).
|
|
38388
|
+
*/
|
|
38389
|
+
let availabilityOverride = prop($$props, "availabilityOverride", 7);
|
|
38229
38390
|
const ticketsCalendar = new Calendar();
|
|
38230
38391
|
const details = ticketsCalendar;
|
|
38231
38392
|
const _ticketSelectionDetails = getTicketSelectionDetails($$props.$$host);
|
|
38232
38393
|
const ticketSelectionDetails = /* @__PURE__ */ user_derived(() => _ticketSelectionDetails.value);
|
|
38233
38394
|
user_effect(() => {
|
|
38234
38395
|
ticketsCalendar.details = get$2(ticketSelectionDetails);
|
|
38396
|
+
ticketsCalendar.availabilityOverride = availabilityOverride();
|
|
38235
38397
|
});
|
|
38236
38398
|
$$props.$$host.addEventListener("go-date-select", (e) => {
|
|
38237
38399
|
if (get$2(ticketSelectionDetails)) {
|
|
@@ -38239,7 +38401,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
38239
38401
|
get$2(ticketSelectionDetails).selectedTimeslot = void 0;
|
|
38240
38402
|
}
|
|
38241
38403
|
});
|
|
38242
|
-
var $$exports = {
|
|
38404
|
+
var $$exports = {
|
|
38405
|
+
details,
|
|
38406
|
+
get availabilityOverride() {
|
|
38407
|
+
return availabilityOverride();
|
|
38408
|
+
},
|
|
38409
|
+
set availabilityOverride($$value) {
|
|
38410
|
+
availabilityOverride($$value);
|
|
38411
|
+
flushSync();
|
|
38412
|
+
}
|
|
38413
|
+
};
|
|
38243
38414
|
var fragment = comment();
|
|
38244
38415
|
var node = first_child(fragment);
|
|
38245
38416
|
var consequent = ($$anchor) => {
|
|
@@ -38253,7 +38424,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
38253
38424
|
append($$anchor, fragment);
|
|
38254
38425
|
return pop($$exports);
|
|
38255
38426
|
}
|
|
38256
|
-
customElements.define("go-calendar", create_custom_element(Calendar_1, {
|
|
38427
|
+
customElements.define("go-calendar", create_custom_element(Calendar_1, { availabilityOverride: {
|
|
38428
|
+
attribute: "availability-override",
|
|
38429
|
+
type: "String"
|
|
38430
|
+
} }, [], ["details"]));
|
|
38257
38431
|
//#endregion
|
|
38258
38432
|
//#region src/components/ticketSelection/subcomponents/addToCartButton/AddToCartButton.svelte.ts
|
|
38259
38433
|
var Details = class {
|