@ancon/wildcat-utils 1.40.14 → 1.40.15
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.
|
@@ -7,6 +7,7 @@ declare type CheckoutOrderSummaryItem = {
|
|
|
7
7
|
declare type CheckoutSummary = {
|
|
8
8
|
orderFormat: OrderFormat;
|
|
9
9
|
items: CheckoutOrderSummaryItem[];
|
|
10
|
+
deliveryStatus?: CheckoutDeliveryStatus;
|
|
10
11
|
};
|
|
11
12
|
declare type Options = {
|
|
12
13
|
/** Only relevant for table order */
|
|
@@ -16,7 +17,6 @@ declare type Options = {
|
|
|
16
17
|
checkoutStatus?: CheckoutStatus;
|
|
17
18
|
ticketStatus?: TicketStatus;
|
|
18
19
|
preOrderOptions?: PreOrderOptions;
|
|
19
|
-
deliveryStatus?: CheckoutDeliveryStatus;
|
|
20
20
|
};
|
|
21
21
|
export declare type PreOrderOptions = {
|
|
22
22
|
isHost: boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("@ancon/wildcat-types"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("@ancon/wildcat-types"),P=require("./getCheckoutItemsMappedByTicketItemStatus.js");var g=(e=>(e.OrderConfirmedHostWillApproveAndProcess="orderConfirmedHostWillApproveAndProcess",e.OrderConfirmedRestaurantAdminWillAcceptSoon="orderConfirmedRestaurantAdminWillAcceptSoon",e.YourOrderHasBeenApprovedByHost="yourOrderHasBeenApprovedByHost",e.YourOrderIsBeingProcessed="yourOrderIsBeingProcessed",e.YourOrderWasCancelled="yourOrderWasCancelled",e.ProcessingPayment="processingPayment",e.YourOrderIsBeingPrepared="yourOrderIsBeingPrepared",e.YourOrderIsReadyToCollect="yourOrderIsReadyToCollect",e.YourOrderIsBeingDelivered="yourOrderIsBeingDelivered",e.YourOrderHasBeenCompleted="yourOrderHasBeenCompleted",e.YourOrderWillArriveAtYourTable="yourOrderWillArriveAtYourTable",e.ModifiedDeliveryStartTime="modifiedDeliveryStartTime",e.ModifiedPickUpTime="modifiedPickUpTime",e.YourOrderHasBeenAcceptedEstimatedDeliveryStartTime="yourOrderHasBeenAcceptedEstimatedDeliveryStartTime",e.YourOrderIsBeingPreparedEstimatedDeliveryStartTime="yourOrderIsBeingPreparedEstimatedDeliveryStartTime",e.YourOrderHasBeenAcceptedEstimatedTime="yourOrderHasBeenAcceptedEstimatedTime",e.YourOrderHasBeenAcceptedPickupTime="yourOrderHasBeenAcceptedPickupTime",e.DeliveryWasCompleted="deliveryWasCompleted",e.OneItemIsReadyToCollect="oneItemIsReadyToCollect",e.MultipleItemsAreReadyToCollect="multipleItemsAreReadyToCollect",e.EnjoyMealWhileOtherItemsBeingPrepared="enjoyMealWhileOtherItemsBeingPrepared",e.ThereWasAnError="thereWasAnError",e.YourOrderReadyToPickupFromLocker="yourOrderReadyToPickupFromLocker",e))(g||{});function v(e,o){switch(e){case r.CheckoutStatus.Error:return"thereWasAnError";case r.CheckoutStatus.Created:case r.CheckoutStatus.Ready:case r.CheckoutStatus.Processing:case r.CheckoutStatus.Authorized:return"yourOrderIsBeingProcessed";case r.CheckoutStatus.Canceled:return"yourOrderWasCancelled";case r.CheckoutStatus.Received:return"processingPayment";case r.CheckoutStatus.ReadyToCollect:return o?"yourOrderIsBeingDelivered":"yourOrderIsReadyToCollect";default:return null}}function T(e){switch(e){case r.TicketStatus.Pending:case r.TicketStatus.PendingAccept:return"yourOrderIsBeingProcessed";case r.TicketStatus.Preparing:return"yourOrderIsBeingPrepared";case r.TicketStatus.Ready:return"yourOrderIsReadyToCollect";case r.TicketStatus.Closed:return"yourOrderHasBeenCompleted";case r.TicketStatus.Canceled:return"yourOrderWasCancelled";default:throw new Error(`Unhandled ticket status "${e}" in getTranslationKeyByTicketStatus()`)}}function A(e){const{isHost:o,preOrderStatus:i,preOrderAttendeeStatus:d}=e;if(d===r.AttendeePreOrderStatus.Confirmed)switch(i){case r.PreOrderStatus.Started:return"orderConfirmedHostWillApproveAndProcess";case r.PreOrderStatus.Waiting:return o?"orderConfirmedRestaurantAdminWillAcceptSoon":"yourOrderHasBeenApprovedByHost"}return null}function B(e,{checkoutStatus:o,ticketStatus:i,customersFetchTableOrders:d}){const a=(e==null?void 0:e.orderFormat)===r.OrderFormat.Delivery,n=(e==null?void 0:e.orderFormat)===r.OrderFormat.TakeAway,t=(e==null?void 0:e.orderFormat)===r.OrderFormat.TableOrder;if(a||n||t&&!d)return!1;const s=o!=null,c=i!=null;if(s){const l=o===r.CheckoutStatus.Captured,u=o===r.CheckoutStatus.InProgress;return l||u}if(c){const l=i===r.TicketStatus.Preparing,u=i===r.TicketStatus.Ready;return l||u}return!1}function I(e,{checkoutStatus:o,ticketStatus:i,customersFetchTableOrders:d,pickupTimeUpdated:a,preOrderOptions:n},t){if(t&&B(e,{checkoutStatus:o,ticketStatus:i,customersFetchTableOrders:d})){if(t.ready>0)return t.ready<2?["oneItemIsReadyToCollect"]:["multipleItemsAreReadyToCollect",{count:t.ready}];if(t.done>0&&t.done<t.all)return["enjoyMealWhileOtherItemsBeingPrepared",{count:Math.max(0,t.all-t.done-t.ready)}]}if(i!=null)return[T(i)];if(n&&(o===r.CheckoutStatus.Created||o===r.CheckoutStatus.Authorized)){const f=A(n);if(f)return[f]}const s=(e==null?void 0:e.orderFormat)===r.OrderFormat.Delivery,c=v(o,s);if(c)return[c];const l=o===r.CheckoutStatus.Captured,u=o===r.CheckoutStatus.InProgress,m=o===r.CheckoutStatus.Done,C=o===r.CheckoutStatus.DeliveryInProgress,p=(e==null?void 0:e.orderFormat)===r.OrderFormat.EatIn,y=(e==null?void 0:e.orderFormat)===r.OrderFormat.TakeAway,O=(e==null?void 0:e.orderFormat)===r.OrderFormat.TableOrder,h=(e==null?void 0:e.orderFormat)===r.OrderFormat.BoxPickup;if(l)return O&&!d?["yourOrderWillArriveAtYourTable"]:s?a?["modifiedDeliveryStartTime"]:["yourOrderHasBeenAcceptedEstimatedDeliveryStartTime"]:a?["modifiedPickUpTime"]:["yourOrderHasBeenAcceptedPickupTime"];if(u){if(s)return a?["modifiedDeliveryStartTime"]:["yourOrderIsBeingPreparedEstimatedDeliveryStartTime"];if(t&&(p||y)){if(t.ready===t.all)return["yourOrderIsReadyToCollect"];if(t.done===t.all)return["yourOrderHasBeenCompleted"]}if(O){if(t){if(t.ready===t.all)return d?["yourOrderIsReadyToCollect"]:["yourOrderWillArriveAtYourTable"];if(t.done===t.all)return d?["yourOrderHasBeenCompleted"]:["yourOrderWillArriveAtYourTable"]}return a?["modifiedPickUpTime"]:d?["yourOrderIsBeingPrepared"]:["yourOrderWillArriveAtYourTable"]}return a?["modifiedPickUpTime"]:["yourOrderIsBeingPrepared"]}if(m)return p||y?["yourOrderHasBeenCompleted"]:s?["deliveryWasCompleted"]:["yourOrderHasBeenCompleted"];if(C&&h)return(e==null?void 0:e.deliveryStatus)===r.CheckoutDeliveryStatus.Delivered?["yourOrderHasBeenCompleted"]:["yourOrderReadyToPickupFromLocker"];throw new Error("Could not resolve translation key in getTranslationKey()")}const k={orderConfirmedHostWillApproveAndProcess:()=>({title:`Order Confirmed!
|
|
2
2
|
The host will approve and process the pre-order.`,message:"Please contact the host if you want to edit your order."}),orderConfirmedRestaurantAdminWillAcceptSoon:()=>({title:`Order Confirmed!
|
|
3
|
-
The restaurant admin will accept your pre-order soon.`}),yourOrderHasBeenApprovedByHost:()=>({title:"Your order has been approved by host!",message:"The restaurant admin will accept and process the pre-order"}),yourOrderIsBeingProcessed:()=>({title:"Your order is being processed"}),yourOrderWasCancelled:()=>({title:"Your order was canceled",message:"Sorry. Your order could not go through."}),processingPayment:()=>({title:"Processing payment",message:"Please wait while your payment is being processed"}),yourOrderIsBeingPrepared:()=>({title:"Your order is now being prepared!",message:"We will let you know when it is ready for pickup."}),yourOrderIsReadyToCollect:()=>({title:"Your order is ready to be collected!",message:"Please go ahead and show this screen at the collection point"}),yourOrderIsBeingDelivered:()=>({title:"Your order is being delivered",message:"It will arrive at your door shortly. Enjoy your meal!"}),yourOrderHasBeenCompleted:()=>({title:"Enjoy your meal!",message:"Your order has been completed!"}),yourOrderWillArriveAtYourTable:()=>({title:"Your order has been accepted!",message:"It will arrive at your table shortly"}),modifiedDeliveryStartTime:()=>({title:"Your delivery time was modified",message:"Delivery will start at approximately 00:00."}),modifiedPickUpTime:()=>({title:"Your pickup time was modified",message:"Pickup time: 00:00"}),yourOrderHasBeenAcceptedEstimatedDeliveryStartTime:()=>({title:"Your order has been accepted",message:"Estimated delivery start time: 00:00"}),yourOrderIsBeingPreparedEstimatedDeliveryStartTime:()=>({title:"Your order is now being prepared!",message:"Estimated delivery start time: 00:00"}),yourOrderHasBeenAcceptedEstimatedTime:()=>({title:"Your order has been accepted",message:"Estimated time: 00:00"}),yourOrderHasBeenAcceptedPickupTime:()=>({title:"Your order has been accepted",message:"Pickup time: 00:00"}),deliveryWasCompleted:()=>({title:"Your order was completed",message:"Enjoy your meal!"}),oneItemIsReadyToCollect:()=>({title:"One item is ready to pick up!",message:"Please allow cashier or waiter to confirm that the prepared item has been successfully issued."}),multipleItemsAreReadyToCollect:()=>({title:"Multiple items are ready to pick up!",message:"Please allow cashier or waiter to confirm that the prepared items have been successfully issued."}),enjoyMealWhileOtherItemsBeingPrepared:({meta:e})=>({title:"Enjoy your meal while the rest of the items are being prepared!",message:`${e.count} more items are being prepared`}),thereWasAnError:()=>({title:"Checkout error",message:"There was an error with the checkout"}),yourOrderReadyToPickupFromLocker:()=>({title:"Your order is ready to pick up from the locker!"})};function
|
|
3
|
+
The restaurant admin will accept your pre-order soon.`}),yourOrderHasBeenApprovedByHost:()=>({title:"Your order has been approved by host!",message:"The restaurant admin will accept and process the pre-order"}),yourOrderIsBeingProcessed:()=>({title:"Your order is being processed"}),yourOrderWasCancelled:()=>({title:"Your order was canceled",message:"Sorry. Your order could not go through."}),processingPayment:()=>({title:"Processing payment",message:"Please wait while your payment is being processed"}),yourOrderIsBeingPrepared:()=>({title:"Your order is now being prepared!",message:"We will let you know when it is ready for pickup."}),yourOrderIsReadyToCollect:()=>({title:"Your order is ready to be collected!",message:"Please go ahead and show this screen at the collection point"}),yourOrderIsBeingDelivered:()=>({title:"Your order is being delivered",message:"It will arrive at your door shortly. Enjoy your meal!"}),yourOrderHasBeenCompleted:()=>({title:"Enjoy your meal!",message:"Your order has been completed!"}),yourOrderWillArriveAtYourTable:()=>({title:"Your order has been accepted!",message:"It will arrive at your table shortly"}),modifiedDeliveryStartTime:()=>({title:"Your delivery time was modified",message:"Delivery will start at approximately 00:00."}),modifiedPickUpTime:()=>({title:"Your pickup time was modified",message:"Pickup time: 00:00"}),yourOrderHasBeenAcceptedEstimatedDeliveryStartTime:()=>({title:"Your order has been accepted",message:"Estimated delivery start time: 00:00"}),yourOrderIsBeingPreparedEstimatedDeliveryStartTime:()=>({title:"Your order is now being prepared!",message:"Estimated delivery start time: 00:00"}),yourOrderHasBeenAcceptedEstimatedTime:()=>({title:"Your order has been accepted",message:"Estimated time: 00:00"}),yourOrderHasBeenAcceptedPickupTime:()=>({title:"Your order has been accepted",message:"Pickup time: 00:00"}),deliveryWasCompleted:()=>({title:"Your order was completed",message:"Enjoy your meal!"}),oneItemIsReadyToCollect:()=>({title:"One item is ready to pick up!",message:"Please allow cashier or waiter to confirm that the prepared item has been successfully issued."}),multipleItemsAreReadyToCollect:()=>({title:"Multiple items are ready to pick up!",message:"Please allow cashier or waiter to confirm that the prepared items have been successfully issued."}),enjoyMealWhileOtherItemsBeingPrepared:({meta:e})=>({title:"Enjoy your meal while the rest of the items are being prepared!",message:`${e.count} more items are being prepared`}),thereWasAnError:()=>({title:"Checkout error",message:"There was an error with the checkout"}),yourOrderReadyToPickupFromLocker:()=>({title:"Your order is ready to pick up from the locker!"})};function S(e,o){if(o)return;const i=P(e);return{all:i.all.length,ready:i.ready.length,done:i.done.length}}function w(e,o,i=k){const{isSkipTicketStatus:d}=o,a=S((e==null?void 0:e.items)??[],d),[n,t]=I(e,o,a),s=i[n]({key:n,meta:t});if(!s)throw new Error("Could not resolve translation in getOrderStatusTexts()");return[s,n]}exports.TranslationKey=g;exports.default=w;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CheckoutStatus as o, OrderFormat as
|
|
2
|
-
import
|
|
3
|
-
var
|
|
4
|
-
function
|
|
1
|
+
import { CheckoutStatus as o, OrderFormat as c, CheckoutDeliveryStatus as B, TicketStatus as s, AttendeePreOrderStatus as I, PreOrderStatus as P } from "@ancon/wildcat-types";
|
|
2
|
+
import h from "./getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
3
|
+
var T = /* @__PURE__ */ ((e) => (e.OrderConfirmedHostWillApproveAndProcess = "orderConfirmedHostWillApproveAndProcess", e.OrderConfirmedRestaurantAdminWillAcceptSoon = "orderConfirmedRestaurantAdminWillAcceptSoon", e.YourOrderHasBeenApprovedByHost = "yourOrderHasBeenApprovedByHost", e.YourOrderIsBeingProcessed = "yourOrderIsBeingProcessed", e.YourOrderWasCancelled = "yourOrderWasCancelled", e.ProcessingPayment = "processingPayment", e.YourOrderIsBeingPrepared = "yourOrderIsBeingPrepared", e.YourOrderIsReadyToCollect = "yourOrderIsReadyToCollect", e.YourOrderIsBeingDelivered = "yourOrderIsBeingDelivered", e.YourOrderHasBeenCompleted = "yourOrderHasBeenCompleted", e.YourOrderWillArriveAtYourTable = "yourOrderWillArriveAtYourTable", e.ModifiedDeliveryStartTime = "modifiedDeliveryStartTime", e.ModifiedPickUpTime = "modifiedPickUpTime", e.YourOrderHasBeenAcceptedEstimatedDeliveryStartTime = "yourOrderHasBeenAcceptedEstimatedDeliveryStartTime", e.YourOrderIsBeingPreparedEstimatedDeliveryStartTime = "yourOrderIsBeingPreparedEstimatedDeliveryStartTime", e.YourOrderHasBeenAcceptedEstimatedTime = "yourOrderHasBeenAcceptedEstimatedTime", e.YourOrderHasBeenAcceptedPickupTime = "yourOrderHasBeenAcceptedPickupTime", e.DeliveryWasCompleted = "deliveryWasCompleted", e.OneItemIsReadyToCollect = "oneItemIsReadyToCollect", e.MultipleItemsAreReadyToCollect = "multipleItemsAreReadyToCollect", e.EnjoyMealWhileOtherItemsBeingPrepared = "enjoyMealWhileOtherItemsBeingPrepared", e.ThereWasAnError = "thereWasAnError", e.YourOrderReadyToPickupFromLocker = "yourOrderReadyToPickupFromLocker", e))(T || {});
|
|
4
|
+
function w(e, t) {
|
|
5
5
|
switch (e) {
|
|
6
6
|
case o.Error:
|
|
7
7
|
return "thereWasAnError";
|
|
@@ -20,7 +20,7 @@ function Y(e, t) {
|
|
|
20
20
|
return null;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function Y(e) {
|
|
24
24
|
switch (e) {
|
|
25
25
|
case s.Pending:
|
|
26
26
|
case s.PendingAccept:
|
|
@@ -39,45 +39,44 @@ function W(e) {
|
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function W(e) {
|
|
43
43
|
const { isHost: t, preOrderStatus: i, preOrderAttendeeStatus: d } = e;
|
|
44
|
-
if (d ===
|
|
44
|
+
if (d === I.Confirmed)
|
|
45
45
|
switch (i) {
|
|
46
|
-
case
|
|
46
|
+
case P.Started:
|
|
47
47
|
return "orderConfirmedHostWillApproveAndProcess";
|
|
48
|
-
case
|
|
48
|
+
case P.Waiting:
|
|
49
49
|
return t ? "orderConfirmedRestaurantAdminWillAcceptSoon" : "yourOrderHasBeenApprovedByHost";
|
|
50
50
|
}
|
|
51
51
|
return null;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function H(e, {
|
|
54
54
|
checkoutStatus: t,
|
|
55
55
|
ticketStatus: i,
|
|
56
56
|
customersFetchTableOrders: d
|
|
57
57
|
}) {
|
|
58
|
-
const a = (e == null ? void 0 : e.orderFormat) ===
|
|
59
|
-
if (a ||
|
|
58
|
+
const a = (e == null ? void 0 : e.orderFormat) === c.Delivery, l = (e == null ? void 0 : e.orderFormat) === c.TakeAway, r = (e == null ? void 0 : e.orderFormat) === c.TableOrder;
|
|
59
|
+
if (a || l || r && !d)
|
|
60
60
|
return !1;
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
63
|
-
const
|
|
64
|
-
return
|
|
61
|
+
const n = t != null, y = i != null;
|
|
62
|
+
if (n) {
|
|
63
|
+
const u = t === o.Captured, p = t === o.InProgress;
|
|
64
|
+
return u || p;
|
|
65
65
|
}
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
68
|
-
return
|
|
66
|
+
if (y) {
|
|
67
|
+
const u = i === s.Preparing, p = i === s.Ready;
|
|
68
|
+
return u || p;
|
|
69
69
|
}
|
|
70
70
|
return !1;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function k(e, {
|
|
73
73
|
checkoutStatus: t,
|
|
74
74
|
ticketStatus: i,
|
|
75
75
|
customersFetchTableOrders: d,
|
|
76
76
|
pickupTimeUpdated: a,
|
|
77
|
-
preOrderOptions:
|
|
78
|
-
deliveryStatus: u
|
|
77
|
+
preOrderOptions: l
|
|
79
78
|
}, r) {
|
|
80
|
-
if (r &&
|
|
79
|
+
if (r && H(e, {
|
|
81
80
|
checkoutStatus: t,
|
|
82
81
|
ticketStatus: i,
|
|
83
82
|
customersFetchTableOrders: d
|
|
@@ -97,24 +96,24 @@ function D(e, {
|
|
|
97
96
|
];
|
|
98
97
|
}
|
|
99
98
|
if (i != null)
|
|
100
|
-
return [
|
|
101
|
-
if (
|
|
102
|
-
const
|
|
103
|
-
if (
|
|
104
|
-
return [
|
|
99
|
+
return [Y(i)];
|
|
100
|
+
if (l && (t === o.Created || t === o.Authorized)) {
|
|
101
|
+
const m = W(l);
|
|
102
|
+
if (m)
|
|
103
|
+
return [m];
|
|
105
104
|
}
|
|
106
|
-
const
|
|
105
|
+
const n = (e == null ? void 0 : e.orderFormat) === c.Delivery, y = w(
|
|
107
106
|
t,
|
|
108
|
-
|
|
107
|
+
n
|
|
109
108
|
);
|
|
110
|
-
if (p)
|
|
111
|
-
return [p];
|
|
112
|
-
const y = t === o.Captured, A = t === o.InProgress, B = t === o.Done, v = t === o.DeliveryInProgress, f = (e == null ? void 0 : e.orderFormat) === l.EatIn, g = (e == null ? void 0 : e.orderFormat) === l.TakeAway, m = (e == null ? void 0 : e.orderFormat) === l.TableOrder, I = (e == null ? void 0 : e.orderFormat) === l.BoxPickup;
|
|
113
109
|
if (y)
|
|
114
|
-
return
|
|
110
|
+
return [y];
|
|
111
|
+
const u = t === o.Captured, p = t === o.InProgress, C = t === o.Done, v = t === o.DeliveryInProgress, f = (e == null ? void 0 : e.orderFormat) === c.EatIn, O = (e == null ? void 0 : e.orderFormat) === c.TakeAway, g = (e == null ? void 0 : e.orderFormat) === c.TableOrder, A = (e == null ? void 0 : e.orderFormat) === c.BoxPickup;
|
|
112
|
+
if (u)
|
|
113
|
+
return g && !d ? [
|
|
115
114
|
"yourOrderWillArriveAtYourTable"
|
|
116
115
|
/* YourOrderWillArriveAtYourTable */
|
|
117
|
-
] :
|
|
116
|
+
] : n ? a ? [
|
|
118
117
|
"modifiedDeliveryStartTime"
|
|
119
118
|
/* ModifiedDeliveryStartTime */
|
|
120
119
|
] : [
|
|
@@ -127,8 +126,8 @@ function D(e, {
|
|
|
127
126
|
"yourOrderHasBeenAcceptedPickupTime"
|
|
128
127
|
/* YourOrderHasBeenAcceptedPickupTime */
|
|
129
128
|
];
|
|
130
|
-
if (
|
|
131
|
-
if (
|
|
129
|
+
if (p) {
|
|
130
|
+
if (n)
|
|
132
131
|
return a ? [
|
|
133
132
|
"modifiedDeliveryStartTime"
|
|
134
133
|
/* ModifiedDeliveryStartTime */
|
|
@@ -136,7 +135,7 @@ function D(e, {
|
|
|
136
135
|
"yourOrderIsBeingPreparedEstimatedDeliveryStartTime"
|
|
137
136
|
/* YourOrderIsBeingPreparedEstimatedDeliveryStartTime */
|
|
138
137
|
];
|
|
139
|
-
if (r && (f ||
|
|
138
|
+
if (r && (f || O)) {
|
|
140
139
|
if (r.ready === r.all)
|
|
141
140
|
return [
|
|
142
141
|
"yourOrderIsReadyToCollect"
|
|
@@ -148,7 +147,7 @@ function D(e, {
|
|
|
148
147
|
/* YourOrderHasBeenCompleted */
|
|
149
148
|
];
|
|
150
149
|
}
|
|
151
|
-
if (
|
|
150
|
+
if (g) {
|
|
152
151
|
if (r) {
|
|
153
152
|
if (r.ready === r.all)
|
|
154
153
|
return d ? [
|
|
@@ -186,32 +185,28 @@ function D(e, {
|
|
|
186
185
|
/* YourOrderIsBeingPrepared */
|
|
187
186
|
];
|
|
188
187
|
}
|
|
189
|
-
if (
|
|
190
|
-
return f ||
|
|
188
|
+
if (C)
|
|
189
|
+
return f || O ? [
|
|
191
190
|
"yourOrderHasBeenCompleted"
|
|
192
191
|
/* YourOrderHasBeenCompleted */
|
|
193
|
-
] :
|
|
192
|
+
] : n ? [
|
|
194
193
|
"deliveryWasCompleted"
|
|
195
194
|
/* DeliveryWasCompleted */
|
|
196
195
|
] : [
|
|
197
196
|
"yourOrderHasBeenCompleted"
|
|
198
197
|
/* YourOrderHasBeenCompleted */
|
|
199
198
|
];
|
|
200
|
-
if (v &&
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
"yourOrderHasBeenCompleted"
|
|
209
|
-
/* YourOrderHasBeenCompleted */
|
|
210
|
-
];
|
|
211
|
-
}
|
|
199
|
+
if (v && A)
|
|
200
|
+
return (e == null ? void 0 : e.deliveryStatus) === B.Delivered ? [
|
|
201
|
+
"yourOrderHasBeenCompleted"
|
|
202
|
+
/* YourOrderHasBeenCompleted */
|
|
203
|
+
] : [
|
|
204
|
+
"yourOrderReadyToPickupFromLocker"
|
|
205
|
+
/* YourOrderReadyToPickupFromLocker */
|
|
206
|
+
];
|
|
212
207
|
throw new Error("Could not resolve translation key in getTranslationKey()");
|
|
213
208
|
}
|
|
214
|
-
const
|
|
209
|
+
const D = {
|
|
215
210
|
orderConfirmedHostWillApproveAndProcess: () => ({
|
|
216
211
|
title: `Order Confirmed!
|
|
217
212
|
The host will approve and process the pre-order.`,
|
|
@@ -304,26 +299,26 @@ The restaurant admin will accept your pre-order soon.`
|
|
|
304
299
|
title: "Your order is ready to pick up from the locker!"
|
|
305
300
|
})
|
|
306
301
|
};
|
|
307
|
-
function
|
|
302
|
+
function R(e, t) {
|
|
308
303
|
if (t)
|
|
309
304
|
return;
|
|
310
|
-
const i =
|
|
305
|
+
const i = h(e);
|
|
311
306
|
return {
|
|
312
307
|
all: i.all.length,
|
|
313
308
|
ready: i.ready.length,
|
|
314
309
|
done: i.done.length
|
|
315
310
|
};
|
|
316
311
|
}
|
|
317
|
-
function
|
|
318
|
-
const { isSkipTicketStatus: d } = t, a =
|
|
312
|
+
function S(e, t, i = D) {
|
|
313
|
+
const { isSkipTicketStatus: d } = t, a = R(
|
|
319
314
|
(e == null ? void 0 : e.items) ?? [],
|
|
320
315
|
d
|
|
321
|
-
), [
|
|
322
|
-
if (!
|
|
316
|
+
), [l, r] = k(e, t, a), n = i[l]({ key: l, meta: r });
|
|
317
|
+
if (!n)
|
|
323
318
|
throw new Error("Could not resolve translation in getOrderStatusTexts()");
|
|
324
|
-
return [
|
|
319
|
+
return [n, l];
|
|
325
320
|
}
|
|
326
321
|
export {
|
|
327
|
-
|
|
328
|
-
|
|
322
|
+
T as TranslationKey,
|
|
323
|
+
S as default
|
|
329
324
|
};
|