@ancon/wildcat-utils 1.43.0-timezone-refactor.7 → 1.43.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/_baseIsEqual-39cef2eb.mjs +530 -0
- package/_baseIsEqual-b3df9240.js +1 -0
- package/_baseIteratee-13e892b8.mjs +151 -0
- package/_baseIteratee-be26bb18.js +1 -0
- package/card/getScannedWalletReadingInfo.d.ts +2 -2
- package/card/getScannedWalletReadingInfo.js +1 -1
- package/card/getScannedWalletReadingInfo.mjs +6 -6
- package/checkout/getCheckoutOrderStatusTexts.js +1 -1
- package/checkout/getCheckoutOrderStatusTexts.mjs +5 -7
- package/checkout/getCheckoutPenguinLockersMetaData.js +1 -1
- package/checkout/getCheckoutPenguinLockersMetaData.mjs +2 -2
- package/checkout/index.js +1 -1
- package/checkout/index.mjs +47 -49
- package/checkout/isCheckoutItemsAreEqual.js +1 -1
- package/checkout/isCheckoutItemsAreEqual.mjs +13 -14
- package/currency/getFormattedCurrency.d.ts +15 -0
- package/currency/getFormattedCurrency.js +1 -1
- package/currency/getFormattedCurrency.mjs +25 -10
- package/error/isAPIError.d.ts +1 -1
- package/error/isAPIError.js +1 -1
- package/error/isAPIError.mjs +7 -7
- package/index.d.ts +1 -2
- package/index.js +1 -1
- package/index.mjs +237 -255
- package/license/getLicenseUIState.d.ts +1 -1
- package/license/getLicenseUIState.js +1 -1
- package/license/getLicenseUIState.mjs +30 -11
- package/logger/index.js +1 -1
- package/logger/index.mjs +7 -8
- package/logger/pascalCaseFormatter.js +1 -1
- package/logger/pascalCaseFormatter.mjs +27 -21
- package/order/getCheckOrderItemsMappedByTicketItemStatus.js +1 -1
- package/order/getCheckOrderItemsMappedByTicketItemStatus.mjs +13 -15
- package/order/getCheckOrderMinimumStatusTicketItem.js +1 -1
- package/order/getCheckOrderMinimumStatusTicketItem.mjs +17 -19
- package/order/index.js +1 -1
- package/order/index.mjs +9 -11
- package/outlet/constants.d.ts +1 -0
- package/outlet/constants.js +1 -1
- package/outlet/constants.mjs +4 -3
- package/outlet/getExpressAvailableOrderFormats.js +1 -1
- package/outlet/getExpressAvailableOrderFormats.mjs +26 -27
- package/outlet/getExpressNextAvailabilityShiftTime.d.ts +2 -2
- package/outlet/getExpressNextAvailabilityShiftTime.js +1 -1
- package/outlet/getExpressNextAvailabilityShiftTime.mjs +18 -19
- package/outlet/getExpressServiceIntervalEnd.d.ts +2 -2
- package/outlet/getExpressServiceIntervalEnd.js +1 -1
- package/outlet/getExpressServiceIntervalEnd.mjs +9 -7
- package/outlet/getExpressServiceIntervalStart.d.ts +2 -2
- package/outlet/getExpressServiceIntervalStart.js +1 -1
- package/outlet/getExpressServiceIntervalStart.mjs +9 -7
- package/outlet/getListOutletOpeningHoursTable.d.ts +1 -1
- package/outlet/getListOutletOpeningHoursTable.js +1 -1
- package/outlet/getListOutletOpeningHoursTable.mjs +150 -135
- package/outlet/getMomentFromDateAndTimeString.js +1 -1
- package/outlet/getMomentFromDateAndTimeString.mjs +1 -1
- package/outlet/getOutletActiveOpeningInterval.d.ts +2 -2
- package/outlet/getOutletActiveOpeningInterval.js +1 -1
- package/outlet/getOutletActiveOpeningInterval.mjs +12 -15
- package/outlet/getOutletAvailabilityInfo.js +1 -1
- package/outlet/getOutletAvailabilityInfo.mjs +25 -23
- package/outlet/getOutletCurrentActiveOperatingHour.js +1 -1
- package/outlet/getOutletCurrentActiveOperatingHour.mjs +15 -16
- package/outlet/getOutletCurrentAvailabilityInfo.js +1 -1
- package/outlet/getOutletCurrentAvailabilityInfo.mjs +26 -27
- package/outlet/getOutletCurrentClosingTimeText.js +1 -1
- package/outlet/getOutletCurrentClosingTimeText.mjs +10 -14
- package/outlet/getOutletDeliveryFee.js +1 -1
- package/outlet/getOutletDeliveryFee.mjs +5 -5
- package/outlet/getOutletFormattedAddress.d.ts +1 -9
- package/outlet/getOutletFormattedAddress.js +1 -1
- package/outlet/getOutletFormattedAddress.mjs +4 -9
- package/outlet/getOutletNextOpeningTagInformation.js +1 -1
- package/outlet/getOutletNextOpeningTagInformation.mjs +7 -8
- package/outlet/getOutletNextOpeningTimeText.js +1 -1
- package/outlet/getOutletNextOpeningTimeText.mjs +8 -10
- package/outlet/getOutletNextReadyToOrderTime.js +1 -1
- package/outlet/getOutletNextReadyToOrderTime.mjs +29 -21
- package/outlet/getOutletNextServiceTimeOffset.d.ts +11 -0
- package/outlet/getOutletNextServiceTimeOffset.js +1 -0
- package/outlet/getOutletNextServiceTimeOffset.mjs +10 -0
- package/outlet/getOutletPickerTimesForDay.js +1 -1
- package/outlet/getOutletPickerTimesForDay.mjs +38 -36
- package/outlet/getOutletPickerTimesForWeek.js +1 -1
- package/outlet/getOutletPickerTimesForWeek.mjs +2 -2
- package/outlet/getOutletTagInformation.d.ts +1 -1
- package/outlet/getOutletTagInformation.js +1 -1
- package/outlet/getOutletTagInformation.mjs +70 -69
- package/outlet/getOutletTodayOpeningTimes.js +1 -1
- package/outlet/getOutletTodayOpeningTimes.mjs +39 -43
- package/outlet/getPartitionedOutletsList.js +1 -1
- package/outlet/getPartitionedOutletsList.mjs +4 -4
- package/outlet/getPickerIntervalsForDay.js +1 -1
- package/outlet/getPickerIntervalsForDay.mjs +12 -20
- package/outlet/getServiceIntervalEnd.d.ts +1 -1
- package/outlet/getServiceIntervalEnd.js +1 -1
- package/outlet/getServiceIntervalEnd.mjs +10 -12
- package/outlet/getServiceIntervalRange.d.ts +2 -1
- package/outlet/getServiceIntervalRange.js +1 -1
- package/outlet/getServiceIntervalRange.mjs +12 -8
- package/outlet/getServiceIntervalStart.d.ts +1 -1
- package/outlet/getServiceIntervalStart.js +1 -1
- package/outlet/getServiceIntervalStart.mjs +7 -6
- package/outlet/getServiceIntervalsForOrderFormat.d.ts +8 -7
- package/outlet/getStructuredOutletAddress.js +1 -1
- package/outlet/getStructuredOutletAddress.mjs +7 -7
- package/outlet/index.d.ts +2 -1
- package/outlet/index.js +1 -1
- package/outlet/index.mjs +68 -71
- package/outlet/searchNextOpeningMoment.d.ts +1 -1
- package/outlet/searchNextOpeningMoment.js +1 -1
- package/outlet/searchNextOpeningMoment.mjs +56 -49
- package/outlet/serviceDateTimesFromOpeningHours.d.ts +5 -3
- package/outlet/serviceDateTimesFromOpeningHours.js +1 -1
- package/outlet/serviceDateTimesFromOpeningHours.mjs +27 -342
- package/outlet/types.d.ts +2 -0
- package/package.json +16 -21
- package/quantity/getFormattedQuantity.d.ts +24 -0
- package/quantity/getFormattedQuantity.js +1 -0
- package/quantity/getFormattedQuantity.mjs +30 -0
- package/quantity/index.d.ts +2 -0
- package/quantity/index.js +1 -0
- package/quantity/index.mjs +4 -0
- package/time/getEndTimeSpanOfTimePeriod.js +1 -1
- package/time/getEndTimeSpanOfTimePeriod.mjs +9 -5
- package/toString-425512fc.js +1 -0
- package/{toString-3b91b335.mjs → toString-e631a957.mjs} +11 -12
- package/_baseIsEqual-12d01a44.mjs +0 -169
- package/_baseIsEqual-bcac9024.js +0 -1
- package/_baseIteratee-075c204c.js +0 -1
- package/_baseIteratee-4c4d0995.mjs +0 -97
- package/_baseSlice-4d543985.mjs +0 -10
- package/_baseSlice-e1b41ceb.js +0 -1
- package/_getTag-4e44633b.mjs +0 -382
- package/_getTag-b8923c48.js +0 -1
- package/date/createLocalTimezoneDate.d.ts +0 -8
- package/date/createLocalTimezoneDate.js +0 -1
- package/date/createLocalTimezoneDate.mjs +0 -8
- package/date/createLocalTimezoneMoment.d.ts +0 -9
- package/date/createLocalTimezoneMoment.js +0 -1
- package/date/createLocalTimezoneMoment.mjs +0 -8
- package/date/getFormattedUTCDateTime.d.ts +0 -10
- package/date/getFormattedUTCDateTime.js +0 -1
- package/date/getFormattedUTCDateTime.mjs +0 -8
- package/date/index.d.ts +0 -4
- package/date/index.js +0 -1
- package/date/index.mjs +0 -9
- package/identity-1bae7cf8.js +0 -1
- package/identity-6eafe87b.mjs +0 -64
- package/toString-9eae9442.js +0 -1
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { IntervalType as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import D from "
|
|
5
|
-
import { OutletMapKeyFormatter as d, OutletTimelineDayCount as M } from "./constants.mjs";
|
|
6
|
-
import O from "./getOutletCurrentActiveOperatingHour.mjs";
|
|
1
|
+
import { IntervalType as g } from "@ancon/wildcat-types";
|
|
2
|
+
import r from "moment";
|
|
3
|
+
import { OutletMapKeyFormatter as d, OutletTimelineDayCount as v } from "./constants.mjs";
|
|
4
|
+
import D from "./getOutletCurrentActiveOperatingHour.mjs";
|
|
7
5
|
import k from "./getMomentFromDateAndTimeString.mjs";
|
|
8
|
-
import
|
|
6
|
+
import M from "./searchNextOpeningMoment.mjs";
|
|
9
7
|
const x = {
|
|
10
8
|
0: 127,
|
|
11
9
|
1: 1,
|
|
@@ -18,100 +16,103 @@ const x = {
|
|
|
18
16
|
// WEEKDAYS: 31,
|
|
19
17
|
// WEEKENDS: 96,
|
|
20
18
|
};
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
[
|
|
19
|
+
function S(n, t) {
|
|
20
|
+
const a = n.isSame(t, "d"), o = {
|
|
21
|
+
[t.format(d)]: {
|
|
24
22
|
intervals: [],
|
|
25
23
|
exception: null,
|
|
26
|
-
metadata: { dayOfWeek: x[
|
|
24
|
+
metadata: { dayOfWeek: x[t.isoWeekday()] }
|
|
27
25
|
}
|
|
28
26
|
};
|
|
29
|
-
for (let
|
|
30
|
-
const
|
|
31
|
-
|
|
27
|
+
for (let i = a ? 1 : 0; i < v; i += 1) {
|
|
28
|
+
const s = r(n).add(i, "d");
|
|
29
|
+
o[s.format(d)] = {
|
|
32
30
|
intervals: [],
|
|
33
31
|
exception: null,
|
|
34
|
-
metadata: { dayOfWeek: x[
|
|
32
|
+
metadata: { dayOfWeek: x[s.isoWeekday()] }
|
|
35
33
|
};
|
|
36
34
|
}
|
|
37
|
-
return
|
|
35
|
+
return o;
|
|
38
36
|
}
|
|
39
|
-
function W(n,
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
42
|
-
|
|
37
|
+
function W(n, t) {
|
|
38
|
+
const a = r().utcOffset(), e = r(t.fromDate).utc(!1).subtract(a, "minutes"), o = r(t.toDate).utc(!1).subtract(a, "minutes");
|
|
39
|
+
if (!e.isSame(
|
|
40
|
+
o,
|
|
43
41
|
"d"
|
|
44
42
|
))
|
|
45
43
|
Object.keys(n).forEach((s) => {
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
48
|
-
const
|
|
49
|
-
|
|
44
|
+
const c = r(s);
|
|
45
|
+
if (c.isSame(e, "d") || c.isSame(o, "d") || c.isBetween(e, o)) {
|
|
46
|
+
const f = n[s], p = f.exception ? f.exception.position : 0;
|
|
47
|
+
t.position > p && (f.exception = t);
|
|
50
48
|
}
|
|
51
49
|
});
|
|
52
50
|
else {
|
|
53
|
-
const s =
|
|
54
|
-
if (
|
|
55
|
-
const
|
|
56
|
-
|
|
51
|
+
const s = e.format(d), c = n[s];
|
|
52
|
+
if (c) {
|
|
53
|
+
const y = c.exception ? c.exception.position : 0;
|
|
54
|
+
t.position > y && (c.exception = t);
|
|
57
55
|
}
|
|
58
56
|
}
|
|
59
57
|
}
|
|
60
|
-
function E(n,
|
|
61
|
-
Object.keys(n).forEach((
|
|
62
|
-
const
|
|
63
|
-
(
|
|
58
|
+
function E(n, t) {
|
|
59
|
+
Object.keys(n).forEach((a) => {
|
|
60
|
+
const e = n[a], { dayOfWeek: o } = e.metadata, { dayOfWeek: i } = t;
|
|
61
|
+
(o & i) === o && e.intervals.push(t);
|
|
64
62
|
});
|
|
65
63
|
}
|
|
66
|
-
function I(n,
|
|
67
|
-
const
|
|
68
|
-
return n.forEach((
|
|
69
|
-
|
|
70
|
-
}),
|
|
64
|
+
function I(n, t, a) {
|
|
65
|
+
const e = S(t, a);
|
|
66
|
+
return n.forEach((o) => {
|
|
67
|
+
o.type === g.Exception ? W(e, o) : E(e, o);
|
|
68
|
+
}), e;
|
|
71
69
|
}
|
|
72
|
-
function h(n, e, o
|
|
73
|
-
const
|
|
70
|
+
function h(n, t, a, e, o) {
|
|
71
|
+
const i = I(
|
|
74
72
|
n,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
), s =
|
|
73
|
+
a,
|
|
74
|
+
e
|
|
75
|
+
), s = e.format(d), c = D(
|
|
78
76
|
s,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
) !== null,
|
|
82
|
-
let
|
|
83
|
-
if (
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
77
|
+
i[s],
|
|
78
|
+
e
|
|
79
|
+
) !== null, y = t;
|
|
80
|
+
let f = null, p = null;
|
|
81
|
+
if (t) {
|
|
82
|
+
const u = a.format(d), l = D(
|
|
83
|
+
u,
|
|
84
|
+
i[u],
|
|
85
|
+
a
|
|
88
86
|
);
|
|
89
|
-
if (
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
c.from
|
|
96
|
-
), p = r.clone().add(m, "hours").add(y, "minutes");
|
|
87
|
+
if (l) {
|
|
88
|
+
const [m, O] = l.duration.split(":").map(Number);
|
|
89
|
+
p = k(
|
|
90
|
+
u,
|
|
91
|
+
l.start
|
|
92
|
+
), f = p.clone().add(m, "hours").add(O, "minutes");
|
|
97
93
|
}
|
|
98
94
|
} else
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
)
|
|
104
|
-
|
|
95
|
+
p = M(
|
|
96
|
+
i,
|
|
97
|
+
a,
|
|
98
|
+
o
|
|
99
|
+
);
|
|
100
|
+
if (!t && !p) {
|
|
101
|
+
const u = n.filter(
|
|
102
|
+
(m) => m.state && r(m.toDate).isAfter(a)
|
|
103
|
+
), [l] = u.sort(
|
|
104
|
+
(m, O) => e.valueOf() - (r(m.toDate).valueOf() - r(O.toDate).valueOf())
|
|
105
105
|
);
|
|
106
|
-
if (
|
|
106
|
+
if (l)
|
|
107
107
|
return h(
|
|
108
108
|
n,
|
|
109
|
+
t,
|
|
110
|
+
r(l.toDate),
|
|
109
111
|
e,
|
|
110
|
-
|
|
111
|
-
t
|
|
112
|
+
o
|
|
112
113
|
);
|
|
113
114
|
}
|
|
114
|
-
return { closingTime:
|
|
115
|
+
return { closingTime: f, openingTime: p, openDuringSpecifiedTime: y, openNow: c };
|
|
115
116
|
}
|
|
116
117
|
export {
|
|
117
118
|
x as DaysOfWeekMap,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const q=require("moment"),I=require("../_baseIteratee-be26bb18.js"),f=require("../_baseIsEqual-b3df9240.js"),b=require("../noop-7ea3b37b.js"),w=require("./getListOutletOpeningHoursTable.js");require("../isArray-640f9811.js");require("../toString-425512fc.js");require("@ancon/wildcat-types");require("../shared/isWithinFlag.js");require("../shared/generateId.js");require("react");function T(e,n,t,i){for(var r=e.length,s=t+(i?1:-1);i?s--:++s<r;)if(n(e[s],s,e))return s;return-1}function p(e){return e!==e}function O(e,n,t){for(var i=t-1,r=e.length;++i<r;)if(e[i]===n)return i;return-1}function S(e,n,t){return n===n?O(e,n,t):T(e,p,t)}function x(e,n){var t=e==null?0:e.length;return!!t&&S(e,n,0)>-1}function a(e,n,t){for(var i=-1,r=e==null?0:e.length;++i<r;)if(t(n,e[i]))return!0;return!1}var A=1/0,_=f.Set&&1/f.setToArray(new f.Set([,-0]))[1]==A?function(e){return new f.Set(e)}:b.noop;const H=_;var N=200;function W(e,n,t){var i=-1,r=x,s=e.length,h=!0,o=[],u=o;if(t)h=!1,r=a;else if(s>=N){var g=n?null:H(e);if(g)return f.setToArray(g);h=!1,r=f.cacheHas,u=new f.SetCache}else u=n?[]:o;e:for(;++i<s;){var l=e[i],c=n?n(l):l;if(l=t||l!==0?l:0,h&&c===c){for(var d=u.length;d--;)if(u[d]===c)continue e;n&&u.push(c),o.push(l)}else r(u,c,t)||(u!==o&&u.push(c),o.push(l))}return o}function k(e,n){return e&&e.length?W(e,I.baseIteratee(n)):[]}function E(e){const n=w(e),i=q().isoWeekday(),r=n.reduce((s,{openingHours:h})=>{var u;const o=(u=h.find(g=>g.isoWeekday===i))==null?void 0:u.open;return o&&s.push(...o),s},[]);return r?k(r,["start","end"]):null}module.exports=E;
|
|
@@ -1,91 +1,87 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { b as
|
|
3
|
-
import { s as
|
|
4
|
-
import { S as c } from "../_getTag-4e44633b.mjs";
|
|
1
|
+
import m from "moment";
|
|
2
|
+
import { b as a } from "../_baseIteratee-13e892b8.mjs";
|
|
3
|
+
import { S as g, s as d, a as I, c as b } from "../_baseIsEqual-39cef2eb.mjs";
|
|
5
4
|
import { n as w } from "../noop-378485d5.mjs";
|
|
6
5
|
import O from "./getListOutletOpeningHoursTable.mjs";
|
|
7
|
-
import "../identity-6eafe87b.mjs";
|
|
8
6
|
import "../isArray-0d9c7aaa.mjs";
|
|
9
|
-
import "../toString-
|
|
7
|
+
import "../toString-e631a957.mjs";
|
|
10
8
|
import "@ancon/wildcat-types";
|
|
11
9
|
import "../shared/isWithinFlag.mjs";
|
|
12
10
|
import "../shared/generateId.mjs";
|
|
13
11
|
import "react";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (e(n[o], o, n))
|
|
19
|
-
return o;
|
|
12
|
+
function T(n, e, t, i) {
|
|
13
|
+
for (var s = n.length, r = t + (i ? 1 : -1); i ? r-- : ++r < s; )
|
|
14
|
+
if (e(n[r], r, n))
|
|
15
|
+
return r;
|
|
20
16
|
return -1;
|
|
21
17
|
}
|
|
22
|
-
function
|
|
18
|
+
function x(n) {
|
|
23
19
|
return n !== n;
|
|
24
20
|
}
|
|
25
|
-
function
|
|
26
|
-
for (var i = t - 1,
|
|
21
|
+
function S(n, e, t) {
|
|
22
|
+
for (var i = t - 1, s = n.length; ++i < s; )
|
|
27
23
|
if (n[i] === e)
|
|
28
24
|
return i;
|
|
29
25
|
return -1;
|
|
30
26
|
}
|
|
31
27
|
function A(n, e, t) {
|
|
32
|
-
return e === e ?
|
|
28
|
+
return e === e ? S(n, e, t) : T(n, x, t);
|
|
33
29
|
}
|
|
34
30
|
function H(n, e) {
|
|
35
31
|
var t = n == null ? 0 : n.length;
|
|
36
32
|
return !!t && A(n, e, 0) > -1;
|
|
37
33
|
}
|
|
38
34
|
function N(n, e, t) {
|
|
39
|
-
for (var i = -1,
|
|
35
|
+
for (var i = -1, s = n == null ? 0 : n.length; ++i < s; )
|
|
40
36
|
if (t(e, n[i]))
|
|
41
37
|
return !0;
|
|
42
38
|
return !1;
|
|
43
39
|
}
|
|
44
|
-
var W = 1 / 0, k =
|
|
45
|
-
return new
|
|
40
|
+
var W = 1 / 0, k = g && 1 / d(new g([, -0]))[1] == W ? function(n) {
|
|
41
|
+
return new g(n);
|
|
46
42
|
} : w;
|
|
47
43
|
const q = k;
|
|
48
44
|
var v = 200;
|
|
49
45
|
function C(n, e, t) {
|
|
50
|
-
var i = -1,
|
|
46
|
+
var i = -1, s = H, r = n.length, h = !0, u = [], o = u;
|
|
51
47
|
if (t)
|
|
52
|
-
h = !1,
|
|
53
|
-
else if (
|
|
54
|
-
var
|
|
55
|
-
if (
|
|
56
|
-
return
|
|
57
|
-
h = !1,
|
|
48
|
+
h = !1, s = N;
|
|
49
|
+
else if (r >= v) {
|
|
50
|
+
var c = e ? null : q(n);
|
|
51
|
+
if (c)
|
|
52
|
+
return d(c);
|
|
53
|
+
h = !1, s = b, o = new I();
|
|
58
54
|
} else
|
|
59
|
-
|
|
55
|
+
o = e ? [] : u;
|
|
60
56
|
n:
|
|
61
|
-
for (; ++i <
|
|
57
|
+
for (; ++i < r; ) {
|
|
62
58
|
var f = n[i], l = e ? e(f) : f;
|
|
63
59
|
if (f = t || f !== 0 ? f : 0, h && l === l) {
|
|
64
|
-
for (var
|
|
65
|
-
if (
|
|
60
|
+
for (var p = o.length; p--; )
|
|
61
|
+
if (o[p] === l)
|
|
66
62
|
continue n;
|
|
67
|
-
e &&
|
|
63
|
+
e && o.push(l), u.push(f);
|
|
68
64
|
} else
|
|
69
|
-
|
|
65
|
+
s(o, l, t) || (o !== u && o.push(l), u.push(f));
|
|
70
66
|
}
|
|
71
67
|
return u;
|
|
72
68
|
}
|
|
73
69
|
function E(n, e) {
|
|
74
|
-
return n && n.length ? C(n,
|
|
70
|
+
return n && n.length ? C(n, a(e)) : [];
|
|
75
71
|
}
|
|
76
|
-
function
|
|
77
|
-
const e = O(n), i =
|
|
78
|
-
(
|
|
79
|
-
var
|
|
80
|
-
const u = (
|
|
81
|
-
(
|
|
82
|
-
)) == null ? void 0 :
|
|
83
|
-
return u &&
|
|
72
|
+
function j(n) {
|
|
73
|
+
const e = O(n), i = m().isoWeekday(), s = e.reduce(
|
|
74
|
+
(r, { openingHours: h }) => {
|
|
75
|
+
var o;
|
|
76
|
+
const u = (o = h.find(
|
|
77
|
+
(c) => c.isoWeekday === i
|
|
78
|
+
)) == null ? void 0 : o.open;
|
|
79
|
+
return u && r.push(...u), r;
|
|
84
80
|
},
|
|
85
81
|
[]
|
|
86
82
|
);
|
|
87
|
-
return
|
|
83
|
+
return s ? E(s, ["start", "end"]) : null;
|
|
88
84
|
}
|
|
89
85
|
export {
|
|
90
|
-
|
|
86
|
+
j as default
|
|
91
87
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("@ancon/wildcat-types"),u=require("./isOutletAcceptingPreOrders.js"),e=require("./types.js");function o(s){return s.reduce((r,t)=>{const i=u(t.orderFormatSettings);return t.state===n.OutletState.
|
|
1
|
+
"use strict";const n=require("@ancon/wildcat-types"),u=require("./isOutletAcceptingPreOrders.js"),e=require("./types.js");function o(s){return s.reduce((r,t)=>{const i=u(t.orderFormatSettings);return t.state===n.OutletState.Open?r[e.OutletListSection.OrderNow].push(t):i?r[e.OutletListSection.PreOrder].push(t):r[e.OutletListSection.Closed].push(t),r},{[e.OutletListSection.OrderNow]:[],[e.OutletListSection.PreOrder]:[],[e.OutletListSection.Closed]:[]})}module.exports=o;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { OutletState as
|
|
2
|
-
import
|
|
1
|
+
import { OutletState as o } from "@ancon/wildcat-types";
|
|
2
|
+
import d from "./isOutletAcceptingPreOrders.mjs";
|
|
3
3
|
import { OutletListSection as e } from "./types.mjs";
|
|
4
4
|
function f(s) {
|
|
5
5
|
return s.reduce(
|
|
6
6
|
(t, r) => {
|
|
7
|
-
const i =
|
|
7
|
+
const i = d(
|
|
8
8
|
r.orderFormatSettings
|
|
9
9
|
);
|
|
10
|
-
return r.state ===
|
|
10
|
+
return r.state === o.Open ? t[e.OrderNow].push(r) : i ? t[e.PreOrder].push(r) : t[e.Closed].push(r), t;
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
[e.OrderNow]: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const f=require("@ancon/wildcat-types"),s=require("moment"),D=require("../shared/constants.js"),c=require("./getServiceIntervalsForOrderFormat.js");function p(r,o,n){return c(n,o).reduce((t,e)=>{const a=e.dayOfWeek===f.DayOfWeek.Everyday,i=!!e.type,u=r.isoWeekday();if(a){if(i){const y=s(e.fromDate),d=s(e.toDate);return r.isBetween(y,d,"day","[]")&&t.push(e),t}return t.push(e),t}return e.dayOfWeek===D.DaysOfWeekMap[u]&&t.push(e),t},[])}module.exports=p;
|
|
@@ -1,30 +1,22 @@
|
|
|
1
|
-
import { DayOfWeek as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { DayOfWeek as d } from "@ancon/wildcat-types";
|
|
2
|
+
import o from "moment";
|
|
3
|
+
import { DaysOfWeekMap as p } from "../shared/constants.mjs";
|
|
4
4
|
import u from "./getServiceIntervalsForOrderFormat.mjs";
|
|
5
|
-
|
|
6
|
-
function w(o, n, s) {
|
|
5
|
+
function w(t, s, n) {
|
|
7
6
|
return u(
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
n,
|
|
8
|
+
s
|
|
10
9
|
).reduce(
|
|
11
10
|
(r, e) => {
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
14
|
-
if (
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
), f = t(e.periodTo);
|
|
18
|
-
return o.isBetween(
|
|
19
|
-
d,
|
|
20
|
-
f,
|
|
21
|
-
"day",
|
|
22
|
-
"[]"
|
|
23
|
-
) && r.push(e), r;
|
|
11
|
+
const a = e.dayOfWeek === d.Everyday, f = !!e.type, m = t.isoWeekday();
|
|
12
|
+
if (a) {
|
|
13
|
+
if (f) {
|
|
14
|
+
const i = o(e.fromDate), y = o(e.toDate);
|
|
15
|
+
return t.isBetween(i, y, "day", "[]") && r.push(e), r;
|
|
24
16
|
}
|
|
25
17
|
return r.push(e), r;
|
|
26
18
|
}
|
|
27
|
-
return e.dayOfWeek ===
|
|
19
|
+
return e.dayOfWeek === p[m] && r.push(e), r;
|
|
28
20
|
},
|
|
29
21
|
[]
|
|
30
22
|
);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ServiceDateTimeInterval } from '@ancon/wildcat-types';
|
|
2
2
|
import { Moment } from 'moment';
|
|
3
|
-
export default function getServiceIntervalEnd(date: Moment, interval: ServiceDateTimeInterval, preparationTime?: string): Moment;
|
|
3
|
+
export default function getServiceIntervalEnd(date: Moment, interval: ServiceDateTimeInterval, preparationTime?: string, outletTimeZoneOffset?: string): Moment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const b=require("moment"),h=require("./hoursAndMinutesToMinutes.js");function I(e,n,i="00:00:00",r="00:00:00"){const d=b(),[m,c]=n.start.split(":").map(Number),[u,o]=i.split(":").map(Number),[a,l]=n.duration.split(":").map(Number),[f,p]=r.split(":").map(Number);let t=e.clone().utc(!0).hour(m).minute(c).second(0).millisecond(0);const s=t.clone().add(f,"hour").add(p,"minute").date()-e.date();s!==0&&(t=t.subtract(s,"day")),t.add(a,"hour").add(l,"minute");const M=h(u,o);return t.diff(d,"minute")<M&&t.subtract(u,"hour").subtract(o,"minute"),t}module.exports=I;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
t.add(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
);
|
|
11
|
-
return t.diff(m, "minute") < c && t.subtract(n), t;
|
|
1
|
+
import b from "moment";
|
|
2
|
+
import h from "./hoursAndMinutesToMinutes.mjs";
|
|
3
|
+
function T(e, n, r = "00:00:00", s = "00:00:00") {
|
|
4
|
+
const m = b(), [d, a] = n.start.split(":").map(Number), [u, o] = r.split(":").map(Number), [c, f] = n.duration.split(":").map(Number), [l, p] = s.split(":").map(Number);
|
|
5
|
+
let t = e.clone().utc(!0).hour(d).minute(a).second(0).millisecond(0);
|
|
6
|
+
const i = t.clone().add(l, "hour").add(p, "minute").date() - e.date();
|
|
7
|
+
i !== 0 && (t = t.subtract(i, "day")), t.add(c, "hour").add(f, "minute");
|
|
8
|
+
const M = h(u, o);
|
|
9
|
+
return t.diff(m, "minute") < M && t.subtract(u, "hour").subtract(o, "minute"), t;
|
|
12
10
|
}
|
|
13
11
|
export {
|
|
14
|
-
|
|
12
|
+
T as default
|
|
15
13
|
};
|
|
@@ -6,6 +6,7 @@ import moment, { Moment } from 'moment';
|
|
|
6
6
|
* @param date - Moment object representing the date to be used for the calculation
|
|
7
7
|
* @param interval - Object containing the start and duration of the interval in the form "hh:mm:ss"
|
|
8
8
|
* @param preparationTime - String representing the preparation time in the form "hh:mm:ss"
|
|
9
|
+
* @param outletTimeZoneOffset - String representing the outlet timezone offset in the form "hh:mm:ss"
|
|
9
10
|
* @returns - Array containing the interval start and end as Moment objects
|
|
10
11
|
*/
|
|
11
|
-
export default function getServiceIntervalRange(date: Moment, interval: Pick<ServiceDateTimeInterval, '
|
|
12
|
+
export default function getServiceIntervalRange(date: Moment, interval: Pick<ServiceDateTimeInterval, 'start' | 'duration'>, preparationTime?: string, outletTimeZoneOffset?: string): moment.Moment[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const H=require("moment"),v=require("../time/toMinutes.js"),y=require("../time/getNextTenthMinute.js");function n(e){return e.split(":").map(Number)}function S(e,u,r="00:00:00",c="00:00:00"){const{duration:d,start:m}=u,[a,f]=n(m),[l,M]=n(c),[p,O]=n(r),[h,T]=n(d),t=e.clone().utc(!0).hour(a).minute(f).second(0).millisecond(0),s=t.clone().add(l,"hour").add(M,"minute").clone().startOf("day").diff(e.clone().startOf("day"),"day");s!==0&&t.subtract(s,"day");const i=v(p,O),o=t.clone().add(h,"hours").add(T,"minutes");return o.diff(H().utc(!0),"minutes")<i&&o.subtract(i,"minutes"),t.add(i,"minutes"),t.minute(y(t)),[t,o]}module.exports=S;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import H from "moment";
|
|
2
|
+
import v from "../time/toMinutes.mjs";
|
|
3
|
+
import y from "../time/getNextTenthMinute.mjs";
|
|
4
|
+
function n(e) {
|
|
5
|
+
return e.split(":").map(Number);
|
|
6
|
+
}
|
|
7
|
+
function I(e, s, r = "00:00:00", d = "00:00:00") {
|
|
8
|
+
const { duration: m, start: a } = s, [c, f] = n(a), [l, p] = n(d), [M, O] = n(r), [h, T] = n(m), t = e.clone().utc(!0).hour(c).minute(f).second(0).millisecond(0), u = t.clone().add(l, "hour").add(p, "minute").clone().startOf("day").diff(e.clone().startOf("day"), "day");
|
|
9
|
+
u !== 0 && t.subtract(u, "day");
|
|
10
|
+
const o = v(M, O), i = t.clone().add(h, "hours").add(T, "minutes");
|
|
11
|
+
return i.diff(H().utc(!0), "minutes") < o && i.subtract(o, "minutes"), t.add(o, "minutes"), t.minute(y(t)), [t, i];
|
|
8
12
|
}
|
|
9
13
|
export {
|
|
10
|
-
|
|
14
|
+
I as default
|
|
11
15
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ServiceDateTimeInterval } from '@ancon/wildcat-types';
|
|
2
2
|
import { Moment } from 'moment';
|
|
3
|
-
export default function getServiceIntervalStart(date: Moment, interval: ServiceDateTimeInterval, preparationTime?: string): Moment;
|
|
3
|
+
export default function getServiceIntervalStart(date: Moment, interval: ServiceDateTimeInterval, preparationTime?: string, outletTimeZoneOffset?: string): Moment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const d=require("./getNextTenthMinute.js");require("moment");function f(e,r,u="00:00:00",o="00:00:00"){const[s,i]=r.start.split(":").map(Number),[a,m]=u.split(":").map(Number),[c,l]=o.split(":").map(Number);let t=e.clone().utc(!0).hour(s).minute(i).second(0).millisecond(0);const n=t.clone().add(c,"hour").add(l,"minute").clone().startOf("day").diff(e.clone().startOf("day"),"day");return n!==0&&(t=t.subtract(n,"day")),t.add(a,"hours").add(m,"minutes"),t.minute(d(t)),t}module.exports=f;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import s from "./getNextTenthMinute.mjs";
|
|
1
|
+
import c from "./getNextTenthMinute.mjs";
|
|
3
2
|
import "moment";
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
|
|
3
|
+
function O(e, r, o = "00:00:00", a = "00:00:00") {
|
|
4
|
+
const [u, i] = r.start.split(":").map(Number), [s, m] = o.split(":").map(Number), [d, l] = a.split(":").map(Number);
|
|
5
|
+
let t = e.clone().utc(!0).hour(u).minute(i).second(0).millisecond(0);
|
|
6
|
+
const n = t.clone().add(d, "hour").add(l, "minute").clone().startOf("day").diff(e.clone().startOf("day"), "day");
|
|
7
|
+
return n !== 0 && (t = t.subtract(n, "day")), t.add(s, "hours").add(m, "minutes"), t.minute(c(t)), t;
|
|
7
8
|
}
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
+
O as default
|
|
10
11
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OrderFormat, ServiceDateTime } from '@ancon/wildcat-types';
|
|
2
2
|
declare type ModifiedServiceDateTimeInterval = {
|
|
3
|
-
|
|
3
|
+
start: string;
|
|
4
4
|
duration: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
end: string;
|
|
6
|
+
fromDate: string;
|
|
7
|
+
toDate: string;
|
|
8
|
+
type: number;
|
|
8
9
|
position: number;
|
|
9
|
-
state:
|
|
10
|
-
dayOfWeek:
|
|
10
|
+
state: number;
|
|
11
|
+
dayOfWeek: number;
|
|
11
12
|
isDefault: boolean;
|
|
12
13
|
reason: string;
|
|
13
14
|
orderFormats: OrderFormat;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function i(t){return t.filter(Boolean).join(", ")||""}function l(t){if(t){const{street:r,city:
|
|
1
|
+
"use strict";function i(t){return t.filter(Boolean).join(", ")||""}function l(t){if(t){const{street:r,city:s,state:o,zip:c,country:u}=t,e=i([r||"",s||""]),n=i([o||"",c||"",u||""]);return{line1:e||n,line2:e?n:""}}return{line1:"",line2:""}}module.exports=l;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
function i(
|
|
2
|
-
return
|
|
1
|
+
function i(t) {
|
|
2
|
+
return t.filter(Boolean).join(", ") || "";
|
|
3
3
|
}
|
|
4
|
-
function l(
|
|
5
|
-
if (
|
|
6
|
-
const { street: r, city: o, state: s,
|
|
4
|
+
function l(t) {
|
|
5
|
+
if (t) {
|
|
6
|
+
const { street: r, city: o, state: s, zip: u, country: c } = t, e = i([r || "", o || ""]), n = i([
|
|
7
7
|
s || "",
|
|
8
8
|
u || "",
|
|
9
9
|
c || ""
|
|
10
10
|
]);
|
|
11
11
|
return {
|
|
12
|
-
line1:
|
|
13
|
-
line2:
|
|
12
|
+
line1: e || n,
|
|
13
|
+
line2: e ? n : ""
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
return {
|
package/outlet/index.d.ts
CHANGED
|
@@ -29,4 +29,5 @@ import getOrderFormatAOTipSettings from './getOrderFormatAOTipSettings';
|
|
|
29
29
|
import isAOTippingEnabledForOrderFormat from './isAOTippingEnabledForOrderFormat';
|
|
30
30
|
import isMenuTreeHierarchyProductAvailable from './isMenuTreeHierarchyProductAvailable';
|
|
31
31
|
import getOutletMenuProductsSortCriteria from './getOutletMenuProductsSortCriteria';
|
|
32
|
-
|
|
32
|
+
import getOutletNextServiceTimeOffset from './getOutletNextServiceTimeOffset';
|
|
33
|
+
export { getListOutletOpeningHoursTable, getOutletTagInformation, getOutletAvailabilityInfo, getOutletOfflineOrderFormats, getOutletAvailableOrderFormats, getOutletFormattedDistance, isOutletAcceptingPreOrders, getOutletDeliveryFee, getOutletTodayOpeningTimes, getOutletOrderFormats, serviceDateTimesFromOpeningHours, getPickerIntervalsForDay, getServiceIntervalRange, getServiceIntervalsForOrderFormat, getOutletFormattedAddress, getPartitionedOutletsList, getOutletPickerTimesForWeek, getOutletPickerTimesForDay, getOutletNextReadyToOrderTime, getOutletOrderPreparationTime, getStructuredOutletAddress, getOutletNextOpeningTimeText, getOutletCurrentClosingTimeText, getOutletNextOpeningTagInformation, getOutletCurrentAvailabilityInfo, getExpressAvailableOrderFormats, getExpressNextAvailabilityShiftTime, getOrderFormatAOTipSettings, isAOTippingEnabledForOrderFormat, isMenuTreeHierarchyProductAvailable, getOutletMenuProductsSortCriteria, getOutletNextServiceTimeOffset, };
|
package/outlet/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getListOutletOpeningHoursTable.js"),t=require("./getOutletTagInformation.js"),r=require("./getOutletAvailabilityInfo.js"),i=require("./getOutletOfflineOrderFormats.js"),u=require("./getOutletAvailableOrderFormats.js"),o=require("./getOutletFormattedDistance.js"),l=require("./isOutletAcceptingPreOrders.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getListOutletOpeningHoursTable.js"),t=require("./getOutletTagInformation.js"),r=require("./getOutletAvailabilityInfo.js"),i=require("./getOutletOfflineOrderFormats.js"),u=require("./getOutletAvailableOrderFormats.js"),o=require("./getOutletFormattedDistance.js"),l=require("./isOutletAcceptingPreOrders.js"),s=require("./getOutletDeliveryFee.js"),n=require("./getOutletTodayOpeningTimes.js"),a=require("./getOutletOrderFormats.js"),O=require("./serviceDateTimesFromOpeningHours.js"),g=require("./getPickerIntervalsForDay.js"),c=require("./getServiceIntervalRange.js"),q=require("./getServiceIntervalsForOrderFormat.js"),d=require("./getOutletFormattedAddress.js"),m=require("./getPartitionedOutletsList.js"),T=require("./getOutletPickerTimesForWeek.js"),F=require("./getOutletPickerTimesForDay.js"),_=require("./getOutletOrderPrepTime.js"),v=require("./getStructuredOutletAddress.js"),p=require("./getOutletNextOpeningTimeText.js"),f=require("./getOutletCurrentClosingTimeText.js"),A=require("./getOutletNextReadyToOrderTime.js"),y=require("./getOutletNextOpeningTagInformation.js"),b=require("./getOutletCurrentAvailabilityInfo.js"),x=require("./getExpressAvailableOrderFormats.js"),P=require("./getExpressNextAvailabilityShiftTime.js"),S=require("./getOrderFormatAOTipSettings.js"),I=require("./isAOTippingEnabledForOrderFormat.js"),D=require("./isMenuTreeHierarchyProductAvailable.js"),N=require("./getOutletMenuProductsSortCriteria.js"),k=require("./getOutletNextServiceTimeOffset.js");require("moment");require("@ancon/wildcat-types");require("../shared/isWithinFlag.js");require("../shared/generateId.js");require("react");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getMomentFromDateAndTimeString.js");require("./searchNextOpeningMoment.js");require("../_baseIteratee-be26bb18.js");require("../_baseIsEqual-b3df9240.js");require("../isArray-640f9811.js");require("../toString-425512fc.js");require("../noop-7ea3b37b.js");require("../shared/constants.js");require("../time/toMinutes.js");require("../time/getNextTenthMinute.js");require("./types.js");require("./getSettingsForOrderFormat.js");require("./getServiceIntervalStart.js");require("./getNextTenthMinute.js");require("./generatePickerTimesForDay.js");require("./getServiceIntervalEnd.js");require("./hoursAndMinutesToMinutes.js");require("./getExpressServiceIntervalStart.js");require("../time/getTimeSpanParts.js");require("./getExpressServiceIntervalEnd.js");exports.getListOutletOpeningHoursTable=e;exports.getOutletTagInformation=t.default;exports.getOutletAvailabilityInfo=r.default;exports.getOutletOfflineOrderFormats=i;exports.getOutletAvailableOrderFormats=u;exports.getOutletFormattedDistance=o;exports.isOutletAcceptingPreOrders=l;exports.getOutletDeliveryFee=s;exports.getOutletTodayOpeningTimes=n;exports.getOutletOrderFormats=a;exports.serviceDateTimesFromOpeningHours=O;exports.getPickerIntervalsForDay=g;exports.getServiceIntervalRange=c;exports.getServiceIntervalsForOrderFormat=q;exports.getOutletFormattedAddress=d;exports.getPartitionedOutletsList=m;exports.getOutletPickerTimesForWeek=T;exports.getOutletPickerTimesForDay=F;exports.getOutletOrderPreparationTime=_;exports.getStructuredOutletAddress=v;exports.getOutletNextOpeningTimeText=p;exports.getOutletCurrentClosingTimeText=f;exports.getOutletNextReadyToOrderTime=A;exports.getOutletNextOpeningTagInformation=y;exports.getOutletCurrentAvailabilityInfo=b;exports.getExpressAvailableOrderFormats=x;exports.getExpressNextAvailabilityShiftTime=P;exports.getOrderFormatAOTipSettings=S.default;exports.isAOTippingEnabledForOrderFormat=I;exports.isMenuTreeHierarchyProductAvailable=D;exports.getOutletMenuProductsSortCriteria=N;exports.getOutletNextServiceTimeOffset=k;
|