tickera-angular-components 0.0.1-dev.34 → 0.0.1-dev.35
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.
|
@@ -2761,6 +2761,452 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
2761
2761
|
args: [{ providedIn: 'root' }]
|
|
2762
2762
|
}] });
|
|
2763
2763
|
|
|
2764
|
+
class PerformanceBookingDataService {
|
|
2765
|
+
_show = signal(null, ...(ngDevMode ? [{ debugName: "_show" }] : []));
|
|
2766
|
+
_performance = signal(null, ...(ngDevMode ? [{ debugName: "_performance" }] : []));
|
|
2767
|
+
_roomMap = signal(null, ...(ngDevMode ? [{ debugName: "_roomMap" }] : []));
|
|
2768
|
+
_hallFloors = signal([], ...(ngDevMode ? [{ debugName: "_hallFloors" }] : []));
|
|
2769
|
+
_selectedHallFloor = signal(null, ...(ngDevMode ? [{ debugName: "_selectedHallFloor" }] : []));
|
|
2770
|
+
_selectedTicketIds = signal(new Set(), ...(ngDevMode ? [{ debugName: "_selectedTicketIds" }] : []));
|
|
2771
|
+
_allRenderData = signal([], ...(ngDevMode ? [{ debugName: "_allRenderData" }] : []));
|
|
2772
|
+
_stageConfig = signal(DEFAULT_STAGE_CONFIG, ...(ngDevMode ? [{ debugName: "_stageConfig" }] : []));
|
|
2773
|
+
selectedCount = computed(() => this._selectedTicketIds().size, ...(ngDevMode ? [{ debugName: "selectedCount" }] : []));
|
|
2774
|
+
selectedTicketIds = computed(() => this._selectedTicketIds(), ...(ngDevMode ? [{ debugName: "selectedTicketIds" }] : []));
|
|
2775
|
+
show = computed(() => this._show(), ...(ngDevMode ? [{ debugName: "show" }] : []));
|
|
2776
|
+
hallFloors = computed(() => this._hallFloors(), ...(ngDevMode ? [{ debugName: "hallFloors" }] : []));
|
|
2777
|
+
selectedHallFloor = computed(() => this._selectedHallFloor(), ...(ngDevMode ? [{ debugName: "selectedHallFloor" }] : []));
|
|
2778
|
+
performance = computed(() => this._performance(), ...(ngDevMode ? [{ debugName: "performance" }] : []));
|
|
2779
|
+
stageConfig = computed(() => this._stageConfig(), ...(ngDevMode ? [{ debugName: "stageConfig" }] : []));
|
|
2780
|
+
roomMap = computed(() => this._roomMap(), ...(ngDevMode ? [{ debugName: "roomMap" }] : []));
|
|
2781
|
+
renderData = computed(() => {
|
|
2782
|
+
return this._allRenderData()?.filter(({ hallFloorId }) => {
|
|
2783
|
+
return hallFloorId == this._selectedHallFloor()?.id;
|
|
2784
|
+
});
|
|
2785
|
+
}, ...(ngDevMode ? [{ debugName: "renderData" }] : []));
|
|
2786
|
+
setPerformanceBookingData({ data }) {
|
|
2787
|
+
this._performance.set(data.performance);
|
|
2788
|
+
this._show.set(data.show);
|
|
2789
|
+
const roomMap = data.room_map;
|
|
2790
|
+
this._roomMap.set(roomMap);
|
|
2791
|
+
const hallFloors = data.room_map?.hall?.hall_floors ?? [];
|
|
2792
|
+
const selectedHallFloor = hallFloors.length > 0 ? hallFloors[0] : null;
|
|
2793
|
+
this._hallFloors.set(hallFloors);
|
|
2794
|
+
this._selectedHallFloor.set(selectedHallFloor);
|
|
2795
|
+
const renderData = processElementsToRenderData(roomMap.elements, data.tickets, roomMap.price_zones);
|
|
2796
|
+
this._allRenderData.set(renderData);
|
|
2797
|
+
const canvasSettings = roomMap.canvas_settings || {};
|
|
2798
|
+
this._stageConfig.set({
|
|
2799
|
+
...DEFAULT_STAGE_CONFIG,
|
|
2800
|
+
width: canvasSettings.width || 800,
|
|
2801
|
+
height: canvasSettings.height || 600,
|
|
2802
|
+
});
|
|
2803
|
+
}
|
|
2804
|
+
setSelectedHallFloor(id) {
|
|
2805
|
+
const hallFloor = this._hallFloors().find((hallFloor) => hallFloor.id === id);
|
|
2806
|
+
this._selectedHallFloor.set(hallFloor ?? null);
|
|
2807
|
+
}
|
|
2808
|
+
updateStageConfig(data) {
|
|
2809
|
+
this._stageConfig.set({
|
|
2810
|
+
...this._stageConfig(),
|
|
2811
|
+
...data,
|
|
2812
|
+
});
|
|
2813
|
+
}
|
|
2814
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: PerformanceBookingDataService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2815
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: PerformanceBookingDataService, providedIn: 'root' });
|
|
2816
|
+
}
|
|
2817
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: PerformanceBookingDataService, decorators: [{
|
|
2818
|
+
type: Injectable,
|
|
2819
|
+
args: [{
|
|
2820
|
+
providedIn: 'root',
|
|
2821
|
+
}]
|
|
2822
|
+
}] });
|
|
2823
|
+
|
|
2824
|
+
class TicketSelectionDetailsService {
|
|
2825
|
+
_customerEmail = signal(null, ...(ngDevMode ? [{ debugName: "_customerEmail" }] : []));
|
|
2826
|
+
_customerId = signal(null, ...(ngDevMode ? [{ debugName: "_customerId" }] : []));
|
|
2827
|
+
_paymentMethod = signal(null, ...(ngDevMode ? [{ debugName: "_paymentMethod" }] : []));
|
|
2828
|
+
_billingInformation = signal(null, ...(ngDevMode ? [{ debugName: "_billingInformation" }] : []));
|
|
2829
|
+
customerEmail = computed(() => this._customerEmail(), ...(ngDevMode ? [{ debugName: "customerEmail" }] : []));
|
|
2830
|
+
customerId = computed(() => this._customerId(), ...(ngDevMode ? [{ debugName: "customerId" }] : []));
|
|
2831
|
+
paymentMethod = computed(() => this._paymentMethod(), ...(ngDevMode ? [{ debugName: "paymentMethod" }] : []));
|
|
2832
|
+
billingInformation = computed(() => this._billingInformation(), ...(ngDevMode ? [{ debugName: "billingInformation" }] : []));
|
|
2833
|
+
setCustomerEmail(email) {
|
|
2834
|
+
this._customerEmail.set(email);
|
|
2835
|
+
}
|
|
2836
|
+
setCustomerId(id) {
|
|
2837
|
+
this._customerId.set(id);
|
|
2838
|
+
}
|
|
2839
|
+
setPaymentMethod(method) {
|
|
2840
|
+
this._paymentMethod.set(method);
|
|
2841
|
+
}
|
|
2842
|
+
setBillingInformation(values) {
|
|
2843
|
+
this._billingInformation.set(values);
|
|
2844
|
+
}
|
|
2845
|
+
clearSelection() {
|
|
2846
|
+
this._customerEmail.set(null);
|
|
2847
|
+
this._customerId.set(null);
|
|
2848
|
+
this._paymentMethod.set(null);
|
|
2849
|
+
this._billingInformation.set(null);
|
|
2850
|
+
}
|
|
2851
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: TicketSelectionDetailsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2852
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: TicketSelectionDetailsService, providedIn: 'root' });
|
|
2853
|
+
}
|
|
2854
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: TicketSelectionDetailsService, decorators: [{
|
|
2855
|
+
type: Injectable,
|
|
2856
|
+
args: [{ providedIn: 'root' }]
|
|
2857
|
+
}] });
|
|
2858
|
+
|
|
2859
|
+
class TicketSelectionDiscountService {
|
|
2860
|
+
_coupon = signal(null, ...(ngDevMode ? [{ debugName: "_coupon" }] : []));
|
|
2861
|
+
_corporateBond = signal(null, ...(ngDevMode ? [{ debugName: "_corporateBond" }] : []));
|
|
2862
|
+
_corporateBondCode = signal(null, ...(ngDevMode ? [{ debugName: "_corporateBondCode" }] : []));
|
|
2863
|
+
_giftBond = signal(null, ...(ngDevMode ? [{ debugName: "_giftBond" }] : []));
|
|
2864
|
+
_giftBondCode = signal(null, ...(ngDevMode ? [{ debugName: "_giftBondCode" }] : []));
|
|
2865
|
+
coupon = computed(() => this._coupon(), ...(ngDevMode ? [{ debugName: "coupon" }] : []));
|
|
2866
|
+
corporateBond = computed(() => this._corporateBond(), ...(ngDevMode ? [{ debugName: "corporateBond" }] : []));
|
|
2867
|
+
corporateBondCode = computed(() => this._corporateBondCode(), ...(ngDevMode ? [{ debugName: "corporateBondCode" }] : []));
|
|
2868
|
+
giftBond = computed(() => this._giftBond(), ...(ngDevMode ? [{ debugName: "giftBond" }] : []));
|
|
2869
|
+
giftBondCode = computed(() => this._giftBondCode(), ...(ngDevMode ? [{ debugName: "giftBondCode" }] : []));
|
|
2870
|
+
selectedDiscount = computed(() => {
|
|
2871
|
+
const coupon = this.coupon();
|
|
2872
|
+
if (!!coupon) {
|
|
2873
|
+
return {
|
|
2874
|
+
name: coupon.code,
|
|
2875
|
+
value: coupon.discount_value,
|
|
2876
|
+
type: SelectedDiscountCardType.COUPON,
|
|
2877
|
+
};
|
|
2878
|
+
}
|
|
2879
|
+
const giftBond = this.giftBond();
|
|
2880
|
+
if (!!giftBond) {
|
|
2881
|
+
return {
|
|
2882
|
+
name: giftBond.name,
|
|
2883
|
+
value: giftBond.value,
|
|
2884
|
+
type: SelectedDiscountCardType.GIFT_BOND,
|
|
2885
|
+
};
|
|
2886
|
+
}
|
|
2887
|
+
const [corporateBond, corporateBondCode] = [this.corporateBond(), this.corporateBondCode()];
|
|
2888
|
+
if (!!corporateBond && !!corporateBondCode) {
|
|
2889
|
+
return {
|
|
2890
|
+
name: corporateBondCode,
|
|
2891
|
+
value: corporateBond.value,
|
|
2892
|
+
type: SelectedDiscountCardType.CORPORATE_BOND,
|
|
2893
|
+
};
|
|
2894
|
+
}
|
|
2895
|
+
return null;
|
|
2896
|
+
}, ...(ngDevMode ? [{ debugName: "selectedDiscount" }] : []));
|
|
2897
|
+
selectedDiscountType = computed(() => {
|
|
2898
|
+
return this.selectedDiscount()?.type;
|
|
2899
|
+
}, ...(ngDevMode ? [{ debugName: "selectedDiscountType" }] : []));
|
|
2900
|
+
selectedDiscountValue = computed(() => {
|
|
2901
|
+
return this.selectedDiscount()?.value ?? undefined;
|
|
2902
|
+
}, ...(ngDevMode ? [{ debugName: "selectedDiscountValue" }] : []));
|
|
2903
|
+
setCoupon(coupon) {
|
|
2904
|
+
this._coupon.set(coupon);
|
|
2905
|
+
}
|
|
2906
|
+
setCorporateBond(corporateBond) {
|
|
2907
|
+
this._corporateBond.set(corporateBond);
|
|
2908
|
+
}
|
|
2909
|
+
setCorporateBondCode(code) {
|
|
2910
|
+
this._corporateBondCode.set(code);
|
|
2911
|
+
}
|
|
2912
|
+
setGiftBond(giftBond) {
|
|
2913
|
+
this._giftBond.set(giftBond);
|
|
2914
|
+
}
|
|
2915
|
+
setGiftBondCode(code) {
|
|
2916
|
+
this._giftBondCode.set(code);
|
|
2917
|
+
}
|
|
2918
|
+
clearSelection() {
|
|
2919
|
+
this._coupon.set(null);
|
|
2920
|
+
this._corporateBond.set(null);
|
|
2921
|
+
this._corporateBondCode.set(null);
|
|
2922
|
+
this._giftBond.set(null);
|
|
2923
|
+
this._giftBondCode.set(null);
|
|
2924
|
+
}
|
|
2925
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: TicketSelectionDiscountService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2926
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: TicketSelectionDiscountService, providedIn: 'root' });
|
|
2927
|
+
}
|
|
2928
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: TicketSelectionDiscountService, decorators: [{
|
|
2929
|
+
type: Injectable,
|
|
2930
|
+
args: [{ providedIn: 'root' }]
|
|
2931
|
+
}] });
|
|
2932
|
+
|
|
2933
|
+
class TicketSelectionService {
|
|
2934
|
+
bookingDataService = inject(PerformanceBookingDataService);
|
|
2935
|
+
selectionDetailsService = inject(TicketSelectionDetailsService);
|
|
2936
|
+
selectionDiscountService = inject(TicketSelectionDiscountService);
|
|
2937
|
+
_zoneQuantities = signal(new Map(), ...(ngDevMode ? [{ debugName: "_zoneQuantities" }] : []));
|
|
2938
|
+
_allTickets = signal([], ...(ngDevMode ? [{ debugName: "_allTickets" }] : []));
|
|
2939
|
+
_selectedTickets = signal(new Set(), ...(ngDevMode ? [{ debugName: "_selectedTickets" }] : []));
|
|
2940
|
+
_selectedBlockedTickets = signal(new Set(), ...(ngDevMode ? [{ debugName: "_selectedBlockedTickets" }] : []));
|
|
2941
|
+
_products = signal([], ...(ngDevMode ? [{ debugName: "_products" }] : []));
|
|
2942
|
+
_productQuantities = signal(new Map(), ...(ngDevMode ? [{ debugName: "_productQuantities" }] : []));
|
|
2943
|
+
selectedTickets = computed(() => {
|
|
2944
|
+
const ids = this._selectedTickets();
|
|
2945
|
+
return this._allTickets().filter((t) => ids.has(t));
|
|
2946
|
+
}, ...(ngDevMode ? [{ debugName: "selectedTickets" }] : []));
|
|
2947
|
+
selectedBlockedTickets = computed(() => {
|
|
2948
|
+
const ids = this._selectedBlockedTickets();
|
|
2949
|
+
return this._allTickets().filter((t) => ids.has(t));
|
|
2950
|
+
}, ...(ngDevMode ? [{ debugName: "selectedBlockedTickets" }] : []));
|
|
2951
|
+
selectedCount = computed(() => this._selectedTickets().size, ...(ngDevMode ? [{ debugName: "selectedCount" }] : []));
|
|
2952
|
+
blockedSelectedCount = computed(() => this._selectedBlockedTickets().size, ...(ngDevMode ? [{ debugName: "blockedSelectedCount" }] : []));
|
|
2953
|
+
selectedTicketIds = computed(() => this._selectedTickets(), ...(ngDevMode ? [{ debugName: "selectedTicketIds" }] : []));
|
|
2954
|
+
selectedBlockedTicketIds = computed(() => this.selectedBlockedTickets().map((t) => t.id), ...(ngDevMode ? [{ debugName: "selectedBlockedTicketIds" }] : []));
|
|
2955
|
+
selectedTicketIdList = computed(() => this.selectedTickets().map((t) => t.id), ...(ngDevMode ? [{ debugName: "selectedTicketIdList" }] : []));
|
|
2956
|
+
products = computed(() => this._products(), ...(ngDevMode ? [{ debugName: "products" }] : []));
|
|
2957
|
+
productQuantities = computed(() => this._productQuantities(), ...(ngDevMode ? [{ debugName: "productQuantities" }] : []));
|
|
2958
|
+
selectedProductEntries = computed(() => {
|
|
2959
|
+
const entries = [];
|
|
2960
|
+
this._productQuantities().forEach((quantity, id) => {
|
|
2961
|
+
if (quantity > 0) {
|
|
2962
|
+
entries.push({ id, quantity });
|
|
2963
|
+
}
|
|
2964
|
+
});
|
|
2965
|
+
return entries;
|
|
2966
|
+
}, ...(ngDevMode ? [{ debugName: "selectedProductEntries" }] : []));
|
|
2967
|
+
selectedProductCount = computed(() => this.selectedProductEntries().length, ...(ngDevMode ? [{ debugName: "selectedProductCount" }] : []));
|
|
2968
|
+
serviceFee = computed(() => {
|
|
2969
|
+
return Number(this.bookingDataService.show()?.service_fee ?? '0');
|
|
2970
|
+
}, ...(ngDevMode ? [{ debugName: "serviceFee" }] : []));
|
|
2971
|
+
setTickets(tickets) {
|
|
2972
|
+
this._allTickets.set(tickets);
|
|
2973
|
+
}
|
|
2974
|
+
setProducts(products) {
|
|
2975
|
+
this._products.set(products);
|
|
2976
|
+
}
|
|
2977
|
+
updateProductQuantity(productId, delta) {
|
|
2978
|
+
this._productQuantities.update((map) => {
|
|
2979
|
+
const next = new Map(map);
|
|
2980
|
+
const current = next.get(productId) ?? 0;
|
|
2981
|
+
const newQty = Math.max(0, current + delta);
|
|
2982
|
+
if (newQty === 0) {
|
|
2983
|
+
next.delete(productId);
|
|
2984
|
+
}
|
|
2985
|
+
else {
|
|
2986
|
+
next.set(productId, newQty);
|
|
2987
|
+
}
|
|
2988
|
+
return next;
|
|
2989
|
+
});
|
|
2990
|
+
}
|
|
2991
|
+
getProductQuantity(productId) {
|
|
2992
|
+
return this._productQuantities().get(productId) ?? 0;
|
|
2993
|
+
}
|
|
2994
|
+
getListByStatus(ticket) {
|
|
2995
|
+
const lists = {
|
|
2996
|
+
[PerformanceTicketStatus.BLOCKED]: this._selectedBlockedTickets,
|
|
2997
|
+
[PerformanceTicketStatus.AVAILABLE]: this._selectedTickets,
|
|
2998
|
+
};
|
|
2999
|
+
return lists[ticket.status] ?? null;
|
|
3000
|
+
}
|
|
3001
|
+
toggle(ticket) {
|
|
3002
|
+
const list = this.getListByStatus(ticket);
|
|
3003
|
+
if (list) {
|
|
3004
|
+
list.update((ids) => {
|
|
3005
|
+
const next = new Set(ids);
|
|
3006
|
+
if (next.has(ticket)) {
|
|
3007
|
+
next.delete(ticket);
|
|
3008
|
+
}
|
|
3009
|
+
else {
|
|
3010
|
+
next.add(ticket);
|
|
3011
|
+
}
|
|
3012
|
+
return next;
|
|
3013
|
+
});
|
|
3014
|
+
}
|
|
3015
|
+
}
|
|
3016
|
+
select(ticket) {
|
|
3017
|
+
const list = this.getListByStatus(ticket);
|
|
3018
|
+
if (list) {
|
|
3019
|
+
list.update((ids) => {
|
|
3020
|
+
const next = new Set(ids);
|
|
3021
|
+
next.add(ticket);
|
|
3022
|
+
return next;
|
|
3023
|
+
});
|
|
3024
|
+
}
|
|
3025
|
+
}
|
|
3026
|
+
deselect(ticket) {
|
|
3027
|
+
const list = this.getListByStatus(ticket);
|
|
3028
|
+
if (list) {
|
|
3029
|
+
list.update((ids) => {
|
|
3030
|
+
const next = new Set(ids);
|
|
3031
|
+
next.delete(ticket);
|
|
3032
|
+
return next;
|
|
3033
|
+
});
|
|
3034
|
+
}
|
|
3035
|
+
}
|
|
3036
|
+
clearBlockedSelection() {
|
|
3037
|
+
this._selectedBlockedTickets.set(new Set());
|
|
3038
|
+
}
|
|
3039
|
+
clearSelection() {
|
|
3040
|
+
this._selectedTickets.set(new Set());
|
|
3041
|
+
this._zoneQuantities.set(new Map());
|
|
3042
|
+
this._productQuantities.set(new Map());
|
|
3043
|
+
this.selectionDetailsService.clearSelection();
|
|
3044
|
+
this.selectionDiscountService.clearSelection();
|
|
3045
|
+
}
|
|
3046
|
+
isSelected(ticket) {
|
|
3047
|
+
return this._selectedTickets().has(ticket);
|
|
3048
|
+
}
|
|
3049
|
+
initZoneQuantity(elementId, maxCapacity) {
|
|
3050
|
+
this._zoneQuantities.update((map) => {
|
|
3051
|
+
const next = new Map(map);
|
|
3052
|
+
if (!next.has(elementId)) {
|
|
3053
|
+
next.set(elementId, { elementId, selectedCount: 0, maxCapacity });
|
|
3054
|
+
}
|
|
3055
|
+
return next;
|
|
3056
|
+
});
|
|
3057
|
+
}
|
|
3058
|
+
adjustZoneQuantity(elementId, delta) {
|
|
3059
|
+
const zoneTickets = this._allTickets()
|
|
3060
|
+
.filter((t) => t.room_map_element_id === elementId)
|
|
3061
|
+
.sort((a, b) => ((a.seat_label || '') < (b.seat_label || '') ? -1 : 1));
|
|
3062
|
+
this._zoneQuantities.update((map) => {
|
|
3063
|
+
const next = new Map(map);
|
|
3064
|
+
const current = next.get(elementId);
|
|
3065
|
+
if (!current)
|
|
3066
|
+
return next;
|
|
3067
|
+
const newCount = Math.max(0, Math.min(current.maxCapacity, current.selectedCount + delta));
|
|
3068
|
+
next.set(elementId, { ...current, selectedCount: newCount });
|
|
3069
|
+
return next;
|
|
3070
|
+
});
|
|
3071
|
+
const state = this._zoneQuantities().get(elementId);
|
|
3072
|
+
const currentCount = state ? state.selectedCount : 0;
|
|
3073
|
+
this._selectedTickets.update((ids) => {
|
|
3074
|
+
const next = new Set(ids);
|
|
3075
|
+
const nowSelected = zoneTickets.filter((t) => next.has(t));
|
|
3076
|
+
if (delta > 0) {
|
|
3077
|
+
const toSelect = zoneTickets.find((t) => !next.has(t) && t.status === 'available');
|
|
3078
|
+
if (toSelect)
|
|
3079
|
+
next.add(toSelect);
|
|
3080
|
+
}
|
|
3081
|
+
else if (delta < 0 && nowSelected.length > 0) {
|
|
3082
|
+
const lastSelected = nowSelected[nowSelected.length - 1];
|
|
3083
|
+
next.delete(lastSelected);
|
|
3084
|
+
}
|
|
3085
|
+
return next;
|
|
3086
|
+
});
|
|
3087
|
+
}
|
|
3088
|
+
getZoneTickets(elementId) {
|
|
3089
|
+
return this._allTickets()
|
|
3090
|
+
.filter((t) => t.room_map_element_id === elementId)
|
|
3091
|
+
.sort((a, b) => ((a.seat_label || '') < (b.seat_label || '') ? -1 : 1));
|
|
3092
|
+
}
|
|
3093
|
+
buildTooltipData(ticket, elementName, seatLabel, x, y) {
|
|
3094
|
+
return {
|
|
3095
|
+
x,
|
|
3096
|
+
y,
|
|
3097
|
+
elementName,
|
|
3098
|
+
seatLabel,
|
|
3099
|
+
price: Number(ticket.normal_price ?? '0'),
|
|
3100
|
+
status: ticket.status,
|
|
3101
|
+
statusLabel: TICKET_STATUS_LABELS[ticket.status] || ticket.status,
|
|
3102
|
+
statusColor: TICKET_STATUS_COLORS[ticket.status] || '#999',
|
|
3103
|
+
isSelected: this.isSelected(ticket),
|
|
3104
|
+
ticketId: ticket.id,
|
|
3105
|
+
};
|
|
3106
|
+
}
|
|
3107
|
+
buildReservePerformanceDto(paymentMethod = 'cash', termsAccepted = true, dataProcessingAccepted = true) {
|
|
3108
|
+
const billing = this.selectionDetailsService.billingInformation();
|
|
3109
|
+
return {
|
|
3110
|
+
ticket_ids: this.selectedTicketIdList(),
|
|
3111
|
+
coupon_code: this.selectionDiscountService.coupon()?.code ?? undefined,
|
|
3112
|
+
gift_bond_code: this.selectionDiscountService.giftBondCode() ?? undefined,
|
|
3113
|
+
corporate_bond_code: this.selectionDiscountService.corporateBondCode() ?? undefined,
|
|
3114
|
+
billing: {
|
|
3115
|
+
first_name: billing?.first_name ?? '',
|
|
3116
|
+
last_name: billing?.last_name ?? '',
|
|
3117
|
+
email: billing?.email ?? '',
|
|
3118
|
+
mobile: billing?.mobile ?? '',
|
|
3119
|
+
document_type: billing?.document_type ?? '',
|
|
3120
|
+
document_number: String(billing?.document_number ?? ''),
|
|
3121
|
+
address: billing?.address ?? '',
|
|
3122
|
+
city_id: billing?.city_id ?? 0,
|
|
3123
|
+
postal_code: billing?.postal_code ?? undefined,
|
|
3124
|
+
address_notes: undefined,
|
|
3125
|
+
payment_method: paymentMethod,
|
|
3126
|
+
terms_accepted: termsAccepted,
|
|
3127
|
+
data_processing_accepted: dataProcessingAccepted,
|
|
3128
|
+
comments: undefined,
|
|
3129
|
+
},
|
|
3130
|
+
};
|
|
3131
|
+
}
|
|
3132
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: TicketSelectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3133
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: TicketSelectionService, providedIn: 'root' });
|
|
3134
|
+
}
|
|
3135
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: TicketSelectionService, decorators: [{
|
|
3136
|
+
type: Injectable,
|
|
3137
|
+
args: [{ providedIn: 'root' }]
|
|
3138
|
+
}] });
|
|
3139
|
+
|
|
3140
|
+
class TicketSelectionTotalsService {
|
|
3141
|
+
bookingDataService = inject(PerformanceBookingDataService);
|
|
3142
|
+
selectionService = inject(TicketSelectionService);
|
|
3143
|
+
selectionDiscountService = inject(TicketSelectionDiscountService);
|
|
3144
|
+
selectedProductEntries = computed(() => {
|
|
3145
|
+
const entries = [];
|
|
3146
|
+
this.selectionService.productQuantities().forEach((quantity, id) => {
|
|
3147
|
+
if (quantity > 0) {
|
|
3148
|
+
entries.push({ id, quantity });
|
|
3149
|
+
}
|
|
3150
|
+
});
|
|
3151
|
+
return entries;
|
|
3152
|
+
}, ...(ngDevMode ? [{ debugName: "selectedProductEntries" }] : []));
|
|
3153
|
+
selectedProductCount = computed(() => this.selectedProductEntries().length, ...(ngDevMode ? [{ debugName: "selectedProductCount" }] : []));
|
|
3154
|
+
productSubtotal = computed(() => {
|
|
3155
|
+
let total = 0;
|
|
3156
|
+
const products = this.selectionService.products();
|
|
3157
|
+
this.selectionService.productQuantities().forEach((quantity, id) => {
|
|
3158
|
+
if (quantity > 0) {
|
|
3159
|
+
const product = products.find((p) => p.id === id);
|
|
3160
|
+
if (product) {
|
|
3161
|
+
total += product.price * quantity;
|
|
3162
|
+
}
|
|
3163
|
+
}
|
|
3164
|
+
});
|
|
3165
|
+
return total;
|
|
3166
|
+
}, ...(ngDevMode ? [{ debugName: "productSubtotal" }] : []));
|
|
3167
|
+
serviceFee = computed(() => {
|
|
3168
|
+
return Number(this.bookingDataService.show()?.service_fee ?? '0');
|
|
3169
|
+
}, ...(ngDevMode ? [{ debugName: "serviceFee" }] : []));
|
|
3170
|
+
subtotalValue() {
|
|
3171
|
+
return (this.selectionService.selectedTickets().reduce((sum, ticket) => {
|
|
3172
|
+
return sum + Number(ticket?.normal_price || '0');
|
|
3173
|
+
}, 0) + this.productSubtotal());
|
|
3174
|
+
}
|
|
3175
|
+
totalValue() {
|
|
3176
|
+
if (this.subtotalValue() < 1) {
|
|
3177
|
+
return 0;
|
|
3178
|
+
}
|
|
3179
|
+
return this.subtotalValue() + this.serviceFee();
|
|
3180
|
+
}
|
|
3181
|
+
totalDiscounted() {
|
|
3182
|
+
let total = null;
|
|
3183
|
+
if (this.subtotalValue() < 1) {
|
|
3184
|
+
return total;
|
|
3185
|
+
}
|
|
3186
|
+
total = this.subtotalValue();
|
|
3187
|
+
if (this.serviceFee() > 0) {
|
|
3188
|
+
total += this.serviceFee();
|
|
3189
|
+
}
|
|
3190
|
+
const discountValue = this.selectionDiscountService.selectedDiscountValue();
|
|
3191
|
+
if (!discountValue) {
|
|
3192
|
+
return null;
|
|
3193
|
+
}
|
|
3194
|
+
if (discountValue && discountValue > 0) {
|
|
3195
|
+
total = total - discountValue;
|
|
3196
|
+
}
|
|
3197
|
+
if (total && total < 0) {
|
|
3198
|
+
total = 0;
|
|
3199
|
+
}
|
|
3200
|
+
return total;
|
|
3201
|
+
}
|
|
3202
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: TicketSelectionTotalsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3203
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: TicketSelectionTotalsService, providedIn: 'root' });
|
|
3204
|
+
}
|
|
3205
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: TicketSelectionTotalsService, decorators: [{
|
|
3206
|
+
type: Injectable,
|
|
3207
|
+
args: [{ providedIn: 'root' }]
|
|
3208
|
+
}] });
|
|
3209
|
+
|
|
2764
3210
|
const authInterceptor = (req, next) => {
|
|
2765
3211
|
const platformId = inject(PLATFORM_ID);
|
|
2766
3212
|
const config = inject(TICKERA_COMPONENTS_CONFIG);
|
|
@@ -6409,5 +6855,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
6409
6855
|
* Generated bundle index. Do not edit.
|
|
6410
6856
|
*/
|
|
6411
6857
|
|
|
6412
|
-
export { ADMIN_API_ROUTES, ALERT_ICONS, AdminSelectComponent, AdminService, ApiService, AppAlertComponent, AppButtonComponent, AppLinkButtonComponent, AppModalComponent, AsyncSelectComponent, AuditInformationComponent, BASE_BUTTON_CLASSES, BASE_INPUT_CLASSES, BUTTON_SIZES_CLASSES, BUTTON_VARIANT_CLASSES, BaseModalService, CITY_API_ENDPOINTS, COUNTRY_API_ENDPOINTS, CUSTOMERS_API_ROUTES, ChangePasswordFormComponent, ChangePasswordFormService, CitiesService, CitySelectComponent, ColorPickerComponent, CorporateBondStatus, CountrySelectComponent, CountryService, CouponApplicability, CouponDiscountType, CouponStatus, CustomerSelectComponent, CustomerService, DEFAULT_STAGE_CONFIG, DOCUMENT_TYPES_OPTIONS, DateInputComponent, DateService, DaySelectorGridComponent, DeleteConfirmationComponent, DeleteConfirmationService, DynamicTableComponent, ERROR_INPUT_CLASSES, EndDateGreaterThanStartValidator, FORM_ERROR_MESSAGES, FeedbackModalComponent, FeedbackModalService, FileType, FileUploadComponent, FileUploadPreviewComponent, FormEditorComponent, FormInputComponent, FormSelectComponent, FormTextareaComponent, GiftBondStatus, KONVA_SHAPE_MAPPINGS, LanguageSwitcherComponent, MinTodayValidator, MustMatchValidator, OrderItemType, OrderStatus, PAYMENT_METHODS_OPTIONS, PERFORMANCES_API_ROUTES, PRICE_ZONES_API_ROUTES, PRODUCTS_API_ROUTES, PRODUCT_CATEGORIES_API_ROUTES, PRODUCT_TAGS_API_ROUTES, PRODUCT_TYPES_API_ROUTES, PerformanceCardComponent, PerformanceCardListComponent, PerformanceMultiSelectComponent, PerformanceSelectComponent, PerformanceService, PerformanceStatus, PerformanceStepperComponent, PerformanceTicketStatus, PerformancesListEventsService, PriceZoneEventService, PriceZoneFormModalService, PriceZoneSelectComponent, PriceZoneService, ProductCategoryService, ProductMultiSelectComponent, ProductSelectComponent, ProductService, ProductTagService, ProductTypeService, RoomMapElementOrientation, RoomMapElementType, SHOWS_API_ROUTES, STATE_API_ENDPOINTS, SelectedDiscountCardType, ShowMultiSelectComponent, ShowSelectComponent, ShowService, ShowsFilterComponent, StateSelectComponent, StatesService, TICKERA_COMPONENTS_CONFIG, TICKET_ELEMENT_TYPES, TICKET_MAP_GRID_SIZE, TICKET_MAP_TITLE_HEIGHT, TICKET_STATUS_COLORS, TICKET_STATUS_FILLS, TICKET_STATUS_LABELS, TickeraTranslocoLoader, ToastService, ToggleSwitchComponent, VENUES_API_ROUTES, ZonePriceItemComponent, ZonePriceListComponent, authInterceptor, drawChairIcon$1 as drawChairIcon, drawHappyFace, drawRoundedRect, drawWheelchairIcon, findElementAtPosition, findTicketAtPosition, formatCitiesResponseToSelect, generateExitScene, generateHallwayScene, generateProductionAreaScene, generateSeatBlockScene, generateSeatBlockTicketScene, generateStageScene, generateStairScene, generateTableScene, generateTableTicketScene, generateUnavailableSpaceScene, generateZoneScene, getBrowserLanguage, getCustomerFullname, getItemTypeIcon, getStoredLanguage, numberToLetter$1 as numberToLetter, parseJsonToFormDataAdvanced, processElementsToRenderData, provideTickeraComponents, resolveLanguage, setStoredLanguage, tintColor, transformImageToFile };
|
|
6858
|
+
export { ADMIN_API_ROUTES, ALERT_ICONS, AdminSelectComponent, AdminService, ApiService, AppAlertComponent, AppButtonComponent, AppLinkButtonComponent, AppModalComponent, AsyncSelectComponent, AuditInformationComponent, BASE_BUTTON_CLASSES, BASE_INPUT_CLASSES, BUTTON_SIZES_CLASSES, BUTTON_VARIANT_CLASSES, BaseModalService, CITY_API_ENDPOINTS, COUNTRY_API_ENDPOINTS, CUSTOMERS_API_ROUTES, ChangePasswordFormComponent, ChangePasswordFormService, CitiesService, CitySelectComponent, ColorPickerComponent, CorporateBondStatus, CountrySelectComponent, CountryService, CouponApplicability, CouponDiscountType, CouponStatus, CustomerSelectComponent, CustomerService, DEFAULT_STAGE_CONFIG, DOCUMENT_TYPES_OPTIONS, DateInputComponent, DateService, DaySelectorGridComponent, DeleteConfirmationComponent, DeleteConfirmationService, DynamicTableComponent, ERROR_INPUT_CLASSES, EndDateGreaterThanStartValidator, FORM_ERROR_MESSAGES, FeedbackModalComponent, FeedbackModalService, FileType, FileUploadComponent, FileUploadPreviewComponent, FormEditorComponent, FormInputComponent, FormSelectComponent, FormTextareaComponent, GiftBondStatus, KONVA_SHAPE_MAPPINGS, LanguageSwitcherComponent, MinTodayValidator, MustMatchValidator, OrderItemType, OrderStatus, PAYMENT_METHODS_OPTIONS, PERFORMANCES_API_ROUTES, PRICE_ZONES_API_ROUTES, PRODUCTS_API_ROUTES, PRODUCT_CATEGORIES_API_ROUTES, PRODUCT_TAGS_API_ROUTES, PRODUCT_TYPES_API_ROUTES, PerformanceBookingDataService, PerformanceCardComponent, PerformanceCardListComponent, PerformanceMultiSelectComponent, PerformanceSelectComponent, PerformanceService, PerformanceStatus, PerformanceStepperComponent, PerformanceTicketStatus, PerformancesListEventsService, PriceZoneEventService, PriceZoneFormModalService, PriceZoneSelectComponent, PriceZoneService, ProductCategoryService, ProductMultiSelectComponent, ProductSelectComponent, ProductService, ProductTagService, ProductTypeService, RoomMapElementOrientation, RoomMapElementType, SHOWS_API_ROUTES, STATE_API_ENDPOINTS, SelectedDiscountCardType, ShowMultiSelectComponent, ShowSelectComponent, ShowService, ShowsFilterComponent, StateSelectComponent, StatesService, TICKERA_COMPONENTS_CONFIG, TICKET_ELEMENT_TYPES, TICKET_MAP_GRID_SIZE, TICKET_MAP_TITLE_HEIGHT, TICKET_STATUS_COLORS, TICKET_STATUS_FILLS, TICKET_STATUS_LABELS, TickeraTranslocoLoader, TicketSelectionDetailsService, TicketSelectionDiscountService, TicketSelectionService, TicketSelectionTotalsService, ToastService, ToggleSwitchComponent, VENUES_API_ROUTES, ZonePriceItemComponent, ZonePriceListComponent, authInterceptor, drawChairIcon$1 as drawChairIcon, drawHappyFace, drawRoundedRect, drawWheelchairIcon, findElementAtPosition, findTicketAtPosition, formatCitiesResponseToSelect, generateExitScene, generateHallwayScene, generateProductionAreaScene, generateSeatBlockScene, generateSeatBlockTicketScene, generateStageScene, generateStairScene, generateTableScene, generateTableTicketScene, generateUnavailableSpaceScene, generateZoneScene, getBrowserLanguage, getCustomerFullname, getItemTypeIcon, getStoredLanguage, numberToLetter$1 as numberToLetter, parseJsonToFormDataAdvanced, processElementsToRenderData, provideTickeraComponents, resolveLanguage, setStoredLanguage, tintColor, transformImageToFile };
|
|
6413
6859
|
//# sourceMappingURL=tickera-angular-components.mjs.map
|